@romainbx/wpic-components 0.0.88 → 0.0.90
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/style.css +1 -1
- package/dist/wpic-components.js +2303 -2258
- package/dist/wpic-components.umd.cjs +21 -21
- package/package.json +1 -1
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* vee-validate v4.12.8
|
|
3
3
|
* (c) 2024 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Te(t){return typeof t=="function"}function fa(t){return t==null}const Jt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Wo(t){return Number(t)>=0}function mp(t){const e=parseFloat(t);return isNaN(e)?t:e}function gp(t){return typeof t=="object"&&t!==null}function yp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ha(t){if(!gp(t)||yp(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 Ar(t,e){return Object.keys(e).forEach(n=>{if(ha(e[n])&&ha(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Vr(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Wo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const pa={};function yt(t,e){kp(t,e),pa[t]=e}function bp(t){return pa[t]}function kp(t,e){if(!Te(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ma(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(ge(l),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)ma(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]||ma(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),ga=Symbol("vee-validate-field-instance"),Mi=Symbol("Default empty value"),xp=typeof window<"u";function Uo(t){return Te(t)&&!!t.__locatorRef}function bt(t){return!!t&&Te(t.parse)&&t.__type==="VVTypedSchema"}function Ti(t){return!!t&&Te(t.validate)}function _r(t){return t==="checkbox"||t==="radio"}function wp(t){return Jt(t)||Array.isArray(t)}function vp(t){return Array.isArray(t)?t.length===0:Jt(t)&&Object.keys(t).length===0}function $i(t){return/^\[.+\]$/i.test(t)}function Cp(t){return ya(t)&&t.multiple}function ya(t){return t.tagName==="SELECT"}function Sp(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Ep(t,e){return!Sp(t,e)&&e.type!=="file"&&!_r(e.type)}function ba(t){return qo(t)&&t.target&&"submit"in t.target}function qo(t){return t?!!(typeof Event<"u"&&Te(Event)&&t instanceof Event||t&&t.srcElement):!1}function ka(t,e){return e in t&&t[e]!==Mi}function je(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(!je(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(!je(r[1],e.get(r[0])))return!1;return!0}if(xa(t)&&xa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function xa(t){return xp?t instanceof File:!1}function Ko(t){return $i(t)?t.replace(/\[|\]/gi,""):t}function qe(t,e,n){return t?$i(e)?t[Ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>wp(i)&&o in i?i[o]:n,t):n}function Lt(t,e,n){if($i(e)){t[Ko(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||fa(i[r[o]]))&&(i[r[o]]=Wo(r[o+1])?[]:{}),i=i[r[o]]}}function Yo(t,e){if(Array.isArray(t)&&Wo(e)){t.splice(Number(e),1);return}Jt(t)&&delete t[e]}function wa(t,e){if($i(e)){delete t[Ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){Yo(r,n[o]);break}if(!(n[o]in r)||fa(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>qe(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(vp(i[o])){if(o===0){Yo(t,n[0]);continue}Yo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Jo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function va(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return je(t,e)?n:e}function Op(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Ca(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function Mp(t,e){return Jt(e)&&e.number?mp(t):t}function Go(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Zo(t){return Array.isArray(t)?t:t?[t]:[]}function Ni(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function Tp(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Xo(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 Qo(t){if(Sa(t))return t._value}function Sa(t){return"_value"in t}function $p(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Bi(t){if(!qo(t))return t;const e=t.target;if(_r(e.type)&&Sa(e))return Qo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Cp(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Qo);if(ya(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Qo(n):e.value}return $p(e)}function Ea(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Jt(t)&&t._$$isNormalized?t:Jt(t)?Object.keys(t).reduce((n,r)=>{const i=Np(t[r]);return t[r]!==!1&&(n[r]=Oa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Bp(r);return i.name&&(n[i.name]=Oa(i.params)),n},e):e}function Np(t){return t===!0?[]:Array.isArray(t)||Jt(t)?t:[t]}function Oa(t){const e=n=>typeof n=="string"&&n[0]==="@"?Ap(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 Bp=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Ap(t){const e=n=>qe(n,t)||n[t];return e.__locatorRef=t,e}function Vp(t){return Array.isArray(t)?t.filter(Uo):Ke(t).filter(e=>Uo(t[e])).map(e=>t[e])}let Dp=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const wn=()=>Dp;async function Ma(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await _p(i,t)).errors;return{errors:s,valid:!s.length}}async function _p(t,e){if(bt(t.rules)||Ti(t.rules))return Ip(e,t.rules);if(Te(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:$a(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Ea(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Pp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function Lp(t){return!!t&&t.name==="ValidationError"}function Ta(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Lp(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function Ip(t,e){const r=await(bt(e)?e:Ta(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Pp(t,e,n){const r=bp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Rp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:$a(o)}}function $a(t){const e=wn().generateMessage;return e?e(t):"Field is invalid"}function Rp(t,e){const n=r=>Uo(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 zp(t,e){const r=await(bt(t)?t:Ta(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function jp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Ma(qe(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Na=0;function Fp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Hp(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=qp(),u=Na>=Number.MAX_SAFE_INTEGER?0:++Na,f=Up(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function Hp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?qe(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=Wp(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return qe(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Wp(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:qe(e.values,a.unref(r),a.unref(n))}function Up(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!je(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function qp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Zo(e)}}}function Ba(t){process.env.NODE_ENV!=="production"&&pp({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"},Jp)}const Lr={},Ir={};let It;const Kn=Op(()=>{setTimeout(async()=>{await a.nextTick(),It==null||It.sendInspectorState(Yn),It==null||It.sendInspectorTree(Yn)},100)},100);function Kp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Lr[t.formId]=Object.assign({},t),Lr[t.formId]._vm=e,a.onUnmounted(()=>{delete Lr[t.formId],Kn()}),Kn()}function Yp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],Kn()}),Kn()}const Yn="vee-validate-inspector",Ye={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Jp(t){It=t,t.addInspector({id:Yn,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!==Yn)return;const n=Object.values(Lr),r=Object.values(Ir);e.rootNodes=[...n.map(Gp),...r.map(i=>Xp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Yn||n.currentTab!==`custom-inspector:${Yn}`)return;const{form:r,field:i,state:o,type:s}=Qp(e.nodeId);if(r&&s==="form"){e.state=em(r),Ce={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Va(o),Ce={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Va({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 Gp(t){const{textColor:e,bgColor:n}=Da(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Lt(r,a.unref(s.path),Zp(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Jt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:es(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ye.white,backgroundColor:Ye.unknown}]}}function Zp(t,e){return{id:es(e,t),label:a.unref(t.path),tags:Aa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Xp(t,e){return{id:es(e,t),label:a.unref(t.name),tags:Aa(!1,1,t.type,t.meta.valid,e)}}function Aa(t,e,n,r,i){const{textColor:o,bgColor:s}=Da(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ye.black,backgroundColor:Ye.gray},n==="checkbox"?{label:"Checkbox",textColor:Ye.white,backgroundColor:Ye.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ye.white,backgroundColor:Ye.purple}:void 0,t?{label:"Multiple",textColor:Ye.black,backgroundColor:Ye.orange}:void 0].filter(Boolean)}function es(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.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 Qp(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Lr[e.f];if(!n&&e.ff){const i=Ir[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 Va(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 em(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Da(t){return{bgColor:t?Ye.success:Ye.error,textColor:t?Ye.black:Ye.white}}function tm(t,e,n){return _r(n==null?void 0:n.type)?rm(t,e,n):_a(t,e,n)}function _a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=nm(n),y=f?Jo(Dr):void 0,g=m||y,b=a.computed(()=>Vr(a.toValue(t))),v=a.computed(()=>{if(a.toValue(g==null?void 0:g.schema))return;const te=a.unref(e);return Ti(te)||bt(te)||Te(te)||Array.isArray(te)?te:Ea(te)}),T=!Te(v.value)&&bt(a.toValue(e)),{id:k,value:M,initialValue:w,meta:A,setState:P,errors:_,flags:B}=Fp(b,{modelValue:r,form:g,bails:o,label:c,type:s,validate:v.value?C:void 0,schema:T?e:void 0}),$=a.computed(()=>_.value[0]);p&&im({value:M,prop:p,handleChange:V,shouldValidate:()=>d&&!B.pendingReset});const q=(R,te=!1)=>{A.touched=!0,te&&L()};async function ee(R){var te,he;if(g!=null&&g.validateSchema){const{results:le}=await g.validateSchema(R);return(te=le[a.toValue(b)])!==null&&te!==void 0?te:{valid:!0,errors:[]}}return v.value?Ma(M.value,v.value,{name:a.toValue(b),label:a.toValue(c),values:(he=g==null?void 0:g.values)!==null&&he!==void 0?he:{},bails:o}):{valid:!0,errors:[]}}const L=Go(async()=>(A.pending=!0,A.validated=!0,ee("validated-only")),R=>(B.pendingUnmount[X.id]||(P({errors:R.errors}),A.pending=!1,A.valid=R.valid),R)),S=Go(async()=>ee("silent"),R=>(A.valid=R.valid,R));function C(R){return(R==null?void 0:R.mode)==="silent"?S():L()}function V(R,te=!0){const he=Bi(R);N(he,te)}a.onMounted(()=>{if(i)return L();(!g||!g.validateSchema)&&S()});function I(R){A.touched=R}function J(R){var te;const he=R&&"value"in R?R.value:w.value;P({value:ge(he),initialValue:ge(he),touched:(te=R==null?void 0:R.touched)!==null&&te!==void 0?te:!1,errors:(R==null?void 0:R.errors)||[]}),A.pending=!1,A.validated=!1,S()}const Z=a.getCurrentInstance();function N(R,te=!0){M.value=Z&&p?Mp(R,Z.props.modelModifiers):R,(te?L:S)()}function D(R){P({errors:Array.isArray(R)?R:[R]})}const j=a.computed({get(){return M.value},set(R){N(R,d)}}),X={id:k,name:b,label:c,value:j,meta:A,errors:_,errorMessage:$,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:J,handleReset:()=>J(),validate:C,handleChange:V,handleBlur:q,setState:P,setTouched:I,setErrors:D,setValue:N};if(a.provide(ga,X),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(R,te)=>{je(R,te)||(A.validated?L():S())},{deep:!0}),process.env.NODE_ENV!=="production"&&(X._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:_.value},A),{value:M.value}),Kn,{deep:!0}),g||Yp(X)),!g)return X;const U=a.computed(()=>{const R=v.value;return!R||Te(R)||Ti(R)||bt(R)||Array.isArray(R)?{}:Object.keys(R).reduce((te,he)=>{const le=Vp(R[he]).map(pe=>pe.__locatorRef).reduce((pe,be)=>{const Me=qe(g.values,be)||g.values[be];return Me!==void 0&&(pe[be]=Me),pe},{});return Object.assign(te,le),te},{})});return a.watch(U,(R,te)=>{if(!Object.keys(R).length)return;!je(R,te)&&(A.validated?L():S())}),a.onBeforeUnmount(()=>{var R;const te=(R=a.toValue(X.keepValueOnUnmount))!==null&&R!==void 0?R:a.toValue(g.keepValuesOnUnmount),he=a.toValue(b);if(te||!g||B.pendingUnmount[X.id]){g==null||g.removePathState(he,k);return}B.pendingUnmount[X.id]=!0;const le=g.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(X.id):(le==null?void 0:le.id)===X.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const be=le.value.findIndex(Me=>je(Me,a.toValue(X.checkedValue)));if(be>-1){const Me=[...le.value];Me.splice(be,1),g.setFieldValue(he,Me)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(X.id),1)}else g.unsetPathValue(a.toValue(b));g.removePathState(he,k)}}),X}function nm(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||{}))?ts(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function rm(t,e,n){const r=n!=null&&n.standalone?void 0:Jo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>je(p,h))>=0:je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const y=a.toValue(t),g=r==null?void 0:r.getPathState(y),b=Bi(f);let v=(m=a.toValue(i))!==null&&m!==void 0?m:b;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?v=va(qe(r.values,y)||[],v,void 0):(n==null?void 0:n.type)==="checkbox"&&(v=va(a.toValue(l.value),v,a.toValue(o))),c(v,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(_a(t,e,n))}function im({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{je(l,ts(i,o))||i.emit(s,l)}),a.watch(()=>ts(i,o),l=>{if(l===Mi&&e.value===void 0)return;const c=l===Mi?void 0:l;je(c,e.value)||n(c,r())}))}function ts(t,e){if(t)return t.props[e]}const om=a.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:()=>wn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Mi},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=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:y,meta:g,checked:b,setErrors:v}=tm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:lm(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),T=function(_,B=!0){f(_,B)},k=a.computed(()=>{const{validateOnInput:P,validateOnChange:_,validateOnBlur:B,validateOnModelUpdate:$}=sm(t);function q(C){h(C,B),Te(e.attrs.onBlur)&&e.attrs.onBlur(C)}function ee(C){T(C,P),Te(e.attrs.onInput)&&e.attrs.onInput(C)}function L(C){T(C,_),Te(e.attrs.onChange)&&e.attrs.onChange(C)}const S={name:t.name,onBlur:q,onInput:ee,onChange:L};return S["onUpdate:modelValue"]=C=>T(C,$),S}),M=a.computed(()=>{const P=Object.assign({},k.value);_r(e.attrs.type)&&b&&(P.checked=b.value);const _=La(t,e);return Ep(_,e.attrs)&&(P.value=c.value),P}),w=a.computed(()=>Object.assign(Object.assign({},k.value),{modelValue:c.value}));function A(){return{field:M.value,componentField:w.value,value:c.value,meta:g,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:T,handleInput:P=>T(P,!1),handleReset:y,handleBlur:k.value.onBlur,setTouched:p,setErrors:v}}return e.expose({value:c,meta:g,errors:l,errorMessage:d,setErrors:v,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const P=a.resolveDynamicComponent(La(t,e)),_=Xo(P,e,A);return P?a.h(P,Object.assign(Object.assign({},e.attrs),M.value),_):_}}});function La(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function sm(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=wn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function lm(t,e){return _r(e.attrs.type)?ka(t,"modelValue")?t.modelValue:void 0:ka(t,"modelValue")?t.modelValue:e.attrs.value}const vn=om;let am=0;const Ai=["bails","fieldsCount","id","multiple","type","validate"];function Ia(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&bt(r)&&Te(r.cast)?ge(r.cast(n)||{}):ge(n)}function cm(t){var e;const n=am++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ia(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=Tp(()=>{f.value=d.value.reduce((O,E)=>(O[Vr(a.toValue(E.path))]=E,O),{})});function p(O,E){const z=C(O);if(!z){typeof O=="string"&&(u.value[Vr(O)]=Zo(E));return}if(typeof O=="string"){const Y=Vr(O);u.value[Y]&&delete u.value[Y]}z.errors=Zo(E),z.valid=!z.errors.length}function m(O){Ke(O).forEach(E=>{p(E,O[E])})}t!=null&&t.initialErrors&&m(t.initialErrors);const y=a.computed(()=>{const O=d.value.reduce((E,z)=>(z.errors.length&&(E[z.path]=z.errors),E),{});return Object.assign(Object.assign({},u.value),O)}),g=a.computed(()=>Ke(y.value).reduce((O,E)=>{const z=y.value[E];return z!=null&&z.length&&(O[E]=z[0]),O},{})),b=a.computed(()=>d.value.reduce((O,E)=>(O[E.path]={name:E.path||"",label:E.label||""},O),{})),v=a.computed(()=>d.value.reduce((O,E)=>{var z;return O[E.path]=(z=E.bails)!==null&&z!==void 0?z:!0,O},{})),T=Object.assign({},(t==null?void 0:t.initialErrors)||{}),k=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:M,originalInitialValues:w,setInitialValues:A}=um(d,c,t),P=dm(d,c,w,g),_=a.computed(()=>d.value.reduce((O,E)=>{const z=qe(c,E.path);return Lt(O,E.path,z),O},{})),B=t==null?void 0:t.validationSchema;function $(O,E){var z,Y;const oe=a.computed(()=>qe(M.value,a.toValue(O))),x=f.value[a.toValue(O)],W=(E==null?void 0:E.type)==="checkbox"||(E==null?void 0:E.type)==="radio";if(x&&W){x.multiple=!0;const Ue=r++;return Array.isArray(x.id)?x.id.push(Ue):x.id=[x.id,Ue],x.fieldsCount++,x.__flags.pendingUnmount[Ue]=!1,x}const G=a.computed(()=>qe(c,a.toValue(O))),ie=a.toValue(O),se=I.findIndex(Ue=>Ue===ie);se!==-1&&I.splice(se,1);const de=a.computed(()=>{var Ue,st,Un,xn;const _t=a.toValue(B);if(bt(_t))return(st=(Ue=_t.describe)===null||Ue===void 0?void 0:Ue.call(_t,a.toValue(O)).required)!==null&&st!==void 0?st:!1;const Oi=a.toValue(E==null?void 0:E.schema);return bt(Oi)&&(xn=(Un=Oi.describe)===null||Un===void 0?void 0:Un.call(Oi).required)!==null&&xn!==void 0?xn:!1}),me=r++,ve=a.reactive({id:me,path:O,touched:!1,pending:!1,valid:!0,validated:!!(!((z=T[ie])===null||z===void 0)&&z.length),required:de,initialValue:oe,errors:a.shallowRef([]),bails:(Y=E==null?void 0:E.bails)!==null&&Y!==void 0?Y:!1,label:E==null?void 0:E.label,type:(E==null?void 0:E.type)||"default",value:G,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:E==null?void 0:E.validate,dirty:a.computed(()=>!je(a.unref(G),a.unref(oe)))});return d.value.push(ve),f.value[ie]=ve,h(),g.value[ie]&&!T[ie]&&a.nextTick(()=>{mt(ie,{mode:"silent"})}),a.isRef(O)&&a.watch(O,Ue=>{h();const st=ge(G.value);f.value[Ue]=ve,a.nextTick(()=>{Lt(c,Ue,st)})}),ve}const q=Ca(Dt,5),ee=Ca(Dt,5),L=Go(async O=>await(O==="silent"?q():ee()),(O,[E])=>{const z=Ke(R.errorBag.value),oe=[...new Set([...Ke(O.results),...d.value.map(x=>x.path),...z])].sort().reduce((x,W)=>{var G;const ie=W,se=C(ie)||V(ie),de=((G=O.results[ie])===null||G===void 0?void 0:G.errors)||[],me=a.toValue(se==null?void 0:se.path)||ie,ve=fm({errors:de,valid:!de.length},x.results[me]);return x.results[me]=ve,ve.valid||(x.errors[me]=ve.errors[0]),se&&u.value[me]&&delete u.value[me],se?(se.valid=ve.valid,E==="silent"||E==="validated-only"&&!se.validated||p(se,ve.errors),x):(p(me,de),x)},{valid:O.valid,results:{},errors:{}});return O.values&&(oe.values=O.values),Ke(oe.results).forEach(x=>{var W;const G=C(x);G&&E!=="silent"&&(E==="validated-only"&&!G.validated||p(G,(W=oe.results[x])===null||W===void 0?void 0:W.errors))}),oe});function S(O){d.value.forEach(O)}function C(O){const E=typeof O=="string"?Vr(O):O;return typeof E=="string"?f.value[E]:E}function V(O){return d.value.filter(z=>O.startsWith(z.path)).reduce((z,Y)=>z?Y.path.length>z.path.length?Y:z:Y,void 0)}let I=[],J;function Z(O){return I.push(O),J||(J=a.nextTick(()=>{[...I].sort().reverse().forEach(z=>{wa(c,z)}),I=[],J=null})),J}function N(O){return function(z,Y){return function(x){return x instanceof Event&&(x.preventDefault(),x.stopPropagation()),S(W=>W.touched=!0),i.value=!0,s.value++,vt().then(W=>{const G=ge(c);if(W.valid&&typeof z=="function"){const ie=ge(_.value);let se=O?ie:G;return W.values&&(se=W.values),z(se,{evt:x,controlledValues:ie,setErrors:m,setFieldError:p,setTouched:yn,setFieldTouched:be,setValues:le,setFieldValue:te,resetForm:qt,resetField:bn})}!W.valid&&typeof Y=="function"&&Y({values:G,evt:x,errors:W.errors,results:W.results})}).then(W=>(i.value=!1,W),W=>{throw i.value=!1,W})}}}const j=N(!1);j.withControlled=N(!0);function X(O,E){const z=d.value.findIndex(oe=>oe.path===O&&(Array.isArray(oe.id)?oe.id.includes(E):oe.id===E)),Y=d.value[z];if(!(z===-1||!Y)){if(a.nextTick(()=>{mt(O,{mode:"silent",warn:!1})}),Y.multiple&&Y.fieldsCount&&Y.fieldsCount--,Array.isArray(Y.id)){const oe=Y.id.indexOf(E);oe>=0&&Y.id.splice(oe,1),delete Y.__flags.pendingUnmount[E]}(!Y.multiple||Y.fieldsCount<=0)&&(d.value.splice(z,1),gt(O),h(),delete f.value[O])}}function U(O){Ke(f.value).forEach(E=>{E.startsWith(O)&&delete f.value[E]}),d.value=d.value.filter(E=>!E.path.startsWith(O)),a.nextTick(()=>{h()})}const R={formId:n,values:c,controlledValues:_,errorBag:y,errors:g,schema:B,submitCount:s,meta:P,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:k,validateSchema:a.unref(B)?L:void 0,validate:vt,setFieldError:p,validateField:mt,setFieldValue:te,setValues:le,setErrors:m,setFieldTouched:be,setTouched:yn,resetForm:qt,resetField:bn,handleSubmit:j,useFieldModel:$r,defineInputBinds:Nr,defineComponentBinds:Br,defineField:kn,stageInitialValue:Vt,unsetInitialValue:gt,setFieldInitialValue:Kt,createPathState:$,getPathState:C,unsetPathValue:Z,removePathState:X,initialValues:M,getAllPathStates:()=>d.value,destroyPath:U,isFieldTouched:Me,isFieldDirty:pt,isFieldValid:Tr};function te(O,E,z=!0){const Y=ge(E),oe=typeof O=="string"?O:O.path;C(oe)||$(oe),Lt(c,oe,Y),z&&mt(oe)}function he(O,E=!0){Ke(c).forEach(z=>{delete c[z]}),Ke(O).forEach(z=>{te(z,O[z],!1)}),E&&vt()}function le(O,E=!0){Ar(c,O),l.forEach(z=>z&&z.reset()),E&&vt()}function pe(O,E){const z=C(a.toValue(O))||$(O);return a.computed({get(){return z.value},set(Y){var oe;const x=a.toValue(O);te(x,Y,(oe=a.toValue(E))!==null&&oe!==void 0?oe:!1)}})}function be(O,E){const z=C(O);z&&(z.touched=E)}function Me(O){const E=C(O);return E?E.touched:d.value.filter(z=>z.path.startsWith(O)).some(z=>z.touched)}function pt(O){const E=C(O);return E?E.dirty:d.value.filter(z=>z.path.startsWith(O)).some(z=>z.dirty)}function Tr(O){const E=C(O);return E?E.valid:d.value.filter(z=>z.path.startsWith(O)).every(z=>z.valid)}function yn(O){if(typeof O=="boolean"){S(E=>{E.touched=O});return}Ke(O).forEach(E=>{be(E,!!O[E])})}function bn(O,E){var z;const Y=E&&"value"in E?E.value:qe(M.value,O),oe=C(O);oe&&(oe.__flags.pendingReset=!0),Kt(O,ge(Y),!0),te(O,Y,!1),be(O,(z=E==null?void 0:E.touched)!==null&&z!==void 0?z:!1),p(O,(E==null?void 0:E.errors)||[]),a.nextTick(()=>{oe&&(oe.__flags.pendingReset=!1)})}function qt(O,E){let z=ge(O!=null&&O.values?O.values:w.value);z=E!=null&&E.force?z:Ar(w.value,z),z=bt(B)&&Te(B.cast)?B.cast(z):z,A(z),S(Y=>{var oe;Y.__flags.pendingReset=!0,Y.validated=!1,Y.touched=((oe=O==null?void 0:O.touched)===null||oe===void 0?void 0:oe[Y.path])||!1,te(Y.path,qe(z,Y.path),!1),p(Y.path,void 0)}),E!=null&&E.force?he(z,!1):le(z,!1),m((O==null?void 0:O.errors)||{}),s.value=(O==null?void 0:O.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),S(Y=>{Y.__flags.pendingReset=!1})})}async function vt(O){const E=(O==null?void 0:O.mode)||"force";if(E==="force"&&S(x=>x.validated=!0),R.validateSchema)return R.validateSchema(E);o.value=!0;const z=await Promise.all(d.value.map(x=>x.validate?x.validate(O).then(W=>({key:x.path,valid:W.valid,errors:W.errors})):Promise.resolve({key:x.path,valid:!0,errors:[]})));o.value=!1;const Y={},oe={};for(const x of z)Y[x.key]={valid:x.valid,errors:x.errors},x.errors.length&&(oe[x.key]=x.errors[0]);return{valid:z.every(x=>x.valid),results:Y,errors:oe}}async function mt(O,E){var z;const Y=C(O);if(Y&&(E==null?void 0:E.mode)!=="silent"&&(Y.validated=!0),B){const{results:x}=await L((E==null?void 0:E.mode)||"validated-only");return x[O]||{errors:[],valid:!0}}return Y!=null&&Y.validate?Y.validate(E):(!Y&&((z=E==null?void 0:E.warn)!==null&&z!==void 0?z:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${O} was not found`),Promise.resolve({errors:[],valid:!0}))}function gt(O){wa(M.value,O)}function Vt(O,E,z=!1){Kt(O,E),Lt(c,O,E),z&&!(t!=null&&t.initialValues)&&Lt(w.value,O,ge(E))}function Kt(O,E,z=!1){Lt(M.value,O,ge(E)),z&&Lt(w.value,O,ge(E))}async function Dt(){const O=a.unref(B);if(!O)return{valid:!0,results:{},errors:{}};o.value=!0;const E=Ti(O)||bt(O)?await zp(O,c):await jp(O,c,{names:b.value,bailsMap:v.value});return o.value=!1,E}const Wn=j((O,{evt:E})=>{ba(E)&&E.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&yn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}R.validateSchema&&R.validateSchema("silent")}),a.isRef(B)&&a.watch(B,()=>{var O;(O=R.validateSchema)===null||O===void 0||O.call(R,"validated-only")}),a.provide(Dr,R),process.env.NODE_ENV!=="production"&&(Kp(R),a.watch(()=>Object.assign(Object.assign({errors:y.value},P.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Kn,{deep:!0}));function kn(O,E){const z=Te(E)||E==null?void 0:E.label,Y=C(a.toValue(O))||$(O,{label:z}),oe=()=>Te(E)?E(Ni(Y,Ai)):E||{};function x(){var de;Y.touched=!0,((de=oe().validateOnBlur)!==null&&de!==void 0?de:wn().validateOnBlur)&&mt(Y.path)}function W(){var de;((de=oe().validateOnInput)!==null&&de!==void 0?de:wn().validateOnInput)&&a.nextTick(()=>{mt(Y.path)})}function G(){var de;((de=oe().validateOnChange)!==null&&de!==void 0?de:wn().validateOnChange)&&a.nextTick(()=>{mt(Y.path)})}const ie=a.computed(()=>{const de={onChange:G,onInput:W,onBlur:x};return Te(E)?Object.assign(Object.assign({},de),E(Ni(Y,Ai)).props||{}):E!=null&&E.props?Object.assign(Object.assign({},de),E.props(Ni(Y,Ai))):de});return[pe(O,()=>{var de,me,ve;return(ve=(de=oe().validateOnModelUpdate)!==null&&de!==void 0?de:(me=wn())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),ie]}function $r(O){return Array.isArray(O)?O.map(E=>pe(E,!0)):pe(O)}function Nr(O,E){const[z,Y]=kn(O,E);function oe(){Y.value.onBlur()}function x(G){const ie=Bi(G);te(a.toValue(O),ie,!1),Y.value.onInput()}function W(G){const ie=Bi(G);te(a.toValue(O),ie,!1),Y.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},Y.value),{onBlur:oe,onInput:x,onChange:W,value:z.value}))}function Br(O,E){const[z,Y]=kn(O,E),oe=C(a.toValue(O));function x(W){z.value=W}return a.computed(()=>{const W=Te(E)?E(Ni(oe,Ai)):E||{};return Object.assign({[W.model||"modelValue"]:z.value,[`onUpdate:${W.model||"modelValue"}`]:x},Y.value)})}return Object.assign(Object.assign({},R),{values:a.readonly(c),handleReset:()=>qt(),submitForm:Wn})}function dm(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!je(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function um(t,e,n){const r=Ia(n),i=a.ref(r),o=a.ref(ge(r));function s(l,c=!1){i.value=Ar(ge(i.value)||{},ge(l)),o.value=Ar(ge(o.value)||{},ge(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=qe(i.value,d.path);Lt(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function fm(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const hm=a.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=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:y,handleSubmit:g,setErrors:b,setFieldError:v,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:w,resetField:A}=cm({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),P=g((C,{evt:V})=>{ba(V)&&V.target.submit()},t.onInvalidSubmit),_=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):P;function B(C){qo(C)&&C.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function $(C,V){return g(typeof C=="function"&&!V?C:V,t.onInvalidSubmit)(C)}function q(){return ge(s)}function ee(){return ge(l.value)}function L(){return ge(i.value)}function S(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:$,handleReset:m,submitForm:P,setErrors:b,setFieldError:v,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:w,resetForm:y,resetField:A,getValues:q,getMeta:ee,getErrors:L}}return e.expose({setFieldError:v,setErrors:b,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:w,resetForm:y,validate:h,validateField:p,resetField:A,getValues:q,getMeta:ee,getErrors:L,values:s,meta:l,errors:i}),function(){const V=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,I=Xo(V,e,S);if(!V)return I;const J=V==="form"?{novalidate:!0}:{};return a.h(V,Object.assign(Object.assign(Object.assign({},J),e.attrs),{onSubmit:_,onReset:B}),I)}}}),pm=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=Xo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function mm(t){const e=Jo(Dr),n=t?void 0:a.inject(ga);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}yt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),yt("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"}),yt("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"),yt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),yt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),yt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),yt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),yt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),yt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),yt("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"}),yt("number",t=>parseFloat(t)?!0:"This field must be a number");const ae=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},gm={},ym={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},bm=[a.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 km(t,e){return a.openBlock(),a.createElementBlock("svg",ym,bm)}const xm=ae(gm,[["render",km]]),wm={},vm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Cm=[a.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 Sm(t,e){return a.openBlock(),a.createElementBlock("svg",vm,Cm)}const Em=ae(wm,[["render",Sm]]),Om={class:"relative"},Jn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",Om,[a.createVNode(xm,{class:"absolute opacity-25"}),a.createVNode(Em,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ne={theme:"wpic-tools",popoverTarget:"body"};const Mm=["is","type","disabled"],Tm={key:0,class:"absolute inset-0 flex justify-center items-center"},$m={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},Nm=["onClick"],Pr=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=b=>{r.value&&!r.value.contains(b.target)&&n.value&&!n.value.contains(b.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"bg-transparent text-gray-700 disabled:text-gray-700/50 enabled:hover:bg-gray-900/5 enabled:active:bg-gray-200 enabled:active:shadow-inner dark:enabled:border-gray-900 dark:text-gray-400 dark:enabled:hover:bg-gray-900 dark:enabled:active:bg-gray-930 dark:disabled:text-gray-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={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":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={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":"border-none! bg-linear-to-b bg-gray-400 text-white disabled:text-white/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-gray-300 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-gray-800 dark:enabled:active:shadow-inner dark:enabled:hover:bg-gray-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},y={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},g={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(b,v)=>{var T;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:v[0]||(v[0]=k=>{var M;return(M=t.actions)!=null&&M.length?i.value=!i.value:null}),class:a.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&&!t.hideDisabled,border:t.outline&&!t.plain,[`${l[a.unref(ne).theme]}`]:!0,[`${u[a.unref(ne).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(ne).theme]}`]:t.secondary,[`${p[a.unref(ne).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(ne).theme]}`]:t.primary&&t.plain,[`${g[a.unref(ne).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(ne).theme]}`]:t.colorless,[`${h[a.unref(ne).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${y[a.unref(ne).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(ne).theme]}`]:t.destructive&&t.colorless,"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,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",Tm,[a.createVNode(Jn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(T=t.actions)!=null&&T.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",$m,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,k=>(a.openBlock(),a.createElementBlock("div",{onClick:k.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(k.label),9,Nm))),256))])],512)):a.createCommentVNode("",!0)],10,Mm)}}}),Bm=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(ne).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),Am={name:"WpicInputGroup"},Vm={class:"wpic-input-group flex w-full"};function Dm(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",Vm,[a.renderSlot(t.$slots,"default")])}const _m=ae(Am,[["render",Dm]]),Lm=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(hm),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Gn=Math.max,Vi=Math.round,Gt=t=>({x:t,y:t}),Im={left:"right",right:"left",bottom:"top",top:"bottom"},Pm={start:"end",end:"start"};function ns(t,e,n){return Gn(t,Rr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function Pa(t){return t==="x"?"y":"x"}function rs(t){return t==="y"?"height":"width"}function Di(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function is(t){return Pa(Di(t))}function Rm(t,e,n){n===void 0&&(n=!1);const r=jr(t),i=is(t),o=rs(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_i(s)),[s,_i(s)]}function zm(t){const e=_i(t);return[ss(t),e,ss(e)]}function ss(t){return t.replace(/start|end/g,e=>Pm[e])}function jm(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Fm(t,e,n,r){const i=jr(t);let o=jm(Cn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ss)))),o}function _i(t){return t.replace(/left|right|bottom|top/g,e=>Im[e])}function Hm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ra(t){return typeof t!="number"?Hm(t):{top:t,right:t,bottom:t,left:t}}function Li(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 za(t,e,n){let{reference:r,floating:i}=t;const o=Di(e),s=is(e),l=rs(s),c=Cn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){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(jr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Wm=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=za(d,r,c),h=r,p={},m=0;for(let y=0;y<l.length;y++){const{name:g,fn:b}=l[y],{x:v,y:T,data:k,reset:M}=await b({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=v??u,f=T??f,p={...p,[g]:{...p[g],...k}},M&&m<=50&&(m++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(d=M.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):M.rects),{x:u,y:f}=za(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ja(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zr(e,t),m=Ra(p),g=l[h?f==="floating"?"reference":"floating":f],b=Li(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},M=Li(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:T,strategy:c}):v);return{top:(b.top-M.top+m.top)/k.y,bottom:(M.bottom-b.bottom+m.bottom)/k.y,left:(b.left-M.left+m.left)/k.x,right:(M.right-b.right+m.right)/k.x}}const Um=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=zr(t,e)||{};if(d==null)return{};const f=Ra(u),h={x:n,y:r},p=is(i),m=rs(p),y=await s.getDimensions(d),g=p==="y",b=g?"top":"left",v=g?"bottom":"right",T=g?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-h[p]-o.floating[m],M=h[p]-o.reference[p],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let A=w?w[T]:0;(!A||!await(s.isElement==null?void 0:s.isElement(w)))&&(A=l.floating[T]||o.floating[m]);const P=k/2-M/2,_=A/2-y[m]/2-1,B=Rr(f[b],_),$=Rr(f[v],_),q=B,ee=A-y[m]-$,L=A/2-y[m]/2+P,S=ns(q,L,ee),C=!c.arrow&&jr(i)!=null&&L!==S&&o.reference[m]/2-(L<q?B:$)-y[m]/2<0,V=C?L<q?L-q:L-ee:0;return{[p]:h[p]+V,data:{[p]:S,centerOffset:L-S-V,...C&&{alignmentOffset:V}},reset:C}}}),qm=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...g}=zr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Cn(i),v=Cn(l)===l,T=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=h||(v||!y?[_i(l)]:zm(l));!h&&m!=="none"&&k.push(...Fm(l,y,m,T));const M=[l,...k],w=await ja(e,g),A=[];let P=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(w[b]),f){const q=Rm(i,s,T);A.push(w[q[0]],w[q[1]])}if(P=[...P,{placement:i,overflows:A}],!A.every(q=>q<=0)){var _,B;const q=(((_=o.flip)==null?void 0:_.index)||0)+1,ee=M[q];if(ee)return{data:{index:q,overflows:P},reset:{placement:ee}};let L=(B=P.filter(S=>S.overflows[0]<=0).sort((S,C)=>S.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!L)switch(p){case"bestFit":{var $;const S=($=P.map(C=>[C.placement,C.overflows.filter(V=>V>0).reduce((V,I)=>V+I,0)]).sort((C,V)=>C[1]-V[1])[0])==null?void 0:$[0];S&&(L=S);break}case"initialPlacement":L=l;break}if(i!==L)return{reset:{placement:L}}}return{}}}};async function Km(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Cn(n),l=jr(n),c=Di(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=zr(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 l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Ym=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Km(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Jm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...c}=zr(t,e),d={x:n,y:r},u=await ja(e,c),f=Di(Cn(i)),h=Pa(f);let p=d[h],m=d[f];if(o){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[g],T=p-u[b];p=ns(v,p,T)}if(s){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=m+u[g],T=m-u[b];m=ns(v,m,T)}const y=l.fn({...e,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function Sn(t){return ls(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zt(t){var e;return(e=(ls(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ls(t){return t instanceof Node||t instanceof Qe(t).Node}function Ct(t){return t instanceof Element||t instanceof Qe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function Fa(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Gm(t){return["table","td","th"].includes(Sn(t))}function as(t){const e=cs(),n=kt(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 Zm(t){let e=Xt(t);for(;St(e)&&!Zn(e);){if(as(e))return e;e=Xt(e)}return null}function cs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(t){return["html","body","#document"].includes(Sn(t))}function kt(t){return Qe(t).getComputedStyle(t)}function Ii(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xt(t){if(Sn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||Zt(t);return Fa(e)?e.host:e}function Ha(t){const e=Xt(t);return Zn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Ha(e)}function ds(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ha(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?ds(s.frameElement):[]):e.concat(i,ds(i,[],n))}function Wa(t){const e=kt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Vi(n)!==o||Vi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ua(t){return Ct(t)?t:t.contextElement}function Xn(t){const e=Ua(t);if(!St(e))return Gt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wa(e);let s=(o?Vi(n.width):n.width)/r,l=(o?Vi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xm=Gt(0);function qa(t){const e=Qe(t);return!cs()||!e.visualViewport?Xm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qm(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ua(t);let s=Gt(1);e&&(r?Ct(r)&&(s=Xn(r)):s=Xn(t));const l=Qm(o,n,r)?qa(o):Gt(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Qe(o),p=r&&Ct(r)?Qe(r):r;let m=h,y=m.frameElement;for(;y&&r&&p!==m;){const g=Xn(y),b=y.getBoundingClientRect(),v=kt(y),T=b.left+(y.clientLeft+parseFloat(v.paddingLeft))*g.x,k=b.top+(y.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,f*=g.y,c+=T,d+=k,m=Qe(y),y=m.frameElement}}return Li({width:u,height:f,x:c,y:d})}const eg=[":popover-open",":modal"];function us(t){return eg.some(e=>{try{return t.matches(e)}catch{return!1}})}function tg(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Zt(r),l=e?us(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=St(r);if((f||!f&&!o)&&((Sn(r)!=="body"||Fr(s))&&(c=Ii(r)),St(r))){const h=Hr(r);d=Xn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function ng(t){return Array.from(t.getClientRects())}function Ka(t){return Hr(Zt(t)).left+Ii(t).scrollLeft}function rg(t){const e=Zt(t),n=Ii(t),r=t.ownerDocument.body,i=Gn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(t);const l=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=Gn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function ig(t,e){const n=Qe(t),r=Zt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=cs();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function og(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Xn(t):Gt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function Ya(t,e,n){let r;if(e==="viewport")r=ig(t,n);else if(e==="document")r=rg(Zt(t));else if(Ct(e))r=og(e,n);else{const i=qa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Li(r)}function Ja(t,e){const n=Xt(t);return n===e||!Ct(n)||Zn(n)?!1:kt(n).position==="fixed"||Ja(n,e)}function sg(t,e){const n=e.get(t);if(n)return n;let r=ds(t,[],!1).filter(l=>Ct(l)&&Sn(l)!=="body"),i=null;const o=kt(t).position==="fixed";let s=o?Xt(t):t;for(;Ct(s)&&!Zn(s);){const l=kt(s),c=as(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ja(t,s))?r=r.filter(u=>u!==s):i=l,s=Xt(s)}return e.set(t,r),r}function lg(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?us(e)?[]:sg(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=Ya(e,u,i);return d.top=Gn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Gn(f.left,d.left),d},Ya(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ag(t){const{width:e,height:n}=Wa(t);return{width:e,height:n}}function cg(t,e,n){const r=St(e),i=Zt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);if(r||!r&&!o)if((Sn(e)!=="body"||Fr(i))&&(l=Ii(e)),r){const f=Hr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Ka(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function fs(t){return kt(t).position==="static"}function Ga(t,e){return!St(t)||kt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Za(t,e){const n=Qe(t);if(us(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!Zn(i);){if(Ct(i)&&!fs(i))return i;i=Xt(i)}return n}let r=Ga(t,e);for(;r&&Gm(r)&&fs(r);)r=Ga(r,e);return r&&Zn(r)&&fs(r)&&!as(r)?n:r||Zm(t)||n}const dg=async function(t){const e=this.getOffsetParent||Za,n=this.getDimensions,r=await n(t.floating);return{reference:cg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ug(t){return kt(t).direction==="rtl"}const fg={convertOffsetParentRelativeRectToViewportRelativeRect:tg,getDocumentElement:Zt,getClippingRect:lg,getOffsetParent:Za,getElementRects:dg,getClientRects:ng,getDimensions:ag,getScale:Xn,isElement:Ct,isRTL:ug},Xa=Ym,Qa=Jm,ec=qm,hg=Um,tc=(t,e,n)=>{const r=new Map,i={platform:fg,...n},o={...i.platform,_c:r};return Wm(t,e,{...i,platform:o})};function pg(t){return t!=null&&typeof t=="object"&&"$el"in t}function mg(t){if(pg(t)){const e=t.$el;return ls(e)&&Sn(e)==="#comment"?null:e}return t}function gg(t){return{name:"arrow",options:t,fn(e){const n=mg(a.unref(t.element));return n==null?{}:hg({element:n,padding:t.padding}).fn(e)}}}const yg={},bg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function xg(t,e){return a.openBlock(),a.createElementBlock("svg",bg,kg)}const Wr=ae(yg,[["render",xg]]);let Pi;const wg=new Uint8Array(16);function vg(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(wg)}const Ve=[];for(let t=0;t<256;++t)Ve.push((t+256).toString(16).slice(1));function Cg(t,e=0){return Ve[t[e+0]]+Ve[t[e+1]]+Ve[t[e+2]]+Ve[t[e+3]]+"-"+Ve[t[e+4]]+Ve[t[e+5]]+"-"+Ve[t[e+6]]+Ve[t[e+7]]+"-"+Ve[t[e+8]]+Ve[t[e+9]]+"-"+Ve[t[e+10]]+Ve[t[e+11]]+Ve[t[e+12]]+Ve[t[e+13]]+Ve[t[e+14]]+Ve[t[e+15]]}const nc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hs(t,e,n){if(nc.randomUUID&&!t)return nc.randomUUID();t=t||{};const r=t.random||(t.rng||vg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Cg(r)}let Sg={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)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const En=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=hs(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(b){if(d.value)u();else{if(o.noCloseClasses.some(v=>b.target.closest(`.${v}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const b=await tc(l.value,c.value,{placement:o.placement,middleware:[ec(),Qa(),Xa(o.offset)]});c.value.style.left=`${b.x}px`,c.value.style.top=`${b.y}px`}const m=b=>{c.value&&!c.value.contains(b.target)&&l.value&&!l.value.contains(b.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",b=>{b.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function y(){o.hover&&u()}function g(){o.hover&&h()}return e({hide:h}),(b,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:y,onMouseleave:g,onClick:v[0]||(v[0]=a.withModifiers(T=>f(T),["stop"]))},[a.renderSlot(b.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(ne).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(ne).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(b.$slots,"content")],6))],8,["to"]))],64))}}),Eg={},Og={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Mg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function Tg(t,e){return a.openBlock(),a.createElementBlock("svg",Og,Mg)}const rc=ae(Eg,[["render",Tg]]),$g={},Ng={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Bg=[a.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 Ag(t,e){return a.openBlock(),a.createElementBlock("svg",Ng,Bg)}const ps=ae($g,[["render",Ag]]),Vg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},Dg={class:"flex items-center gap-2"},_g={key:0},Lg={class:""},Ig={class:"flex justify-end"},Pg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},Rg={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},zg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Ur=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",Vg,[a.createElementVNode("div",Dg,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",_g,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Lg,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ig,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(ne).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(ne).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Pg,[a.createElementVNode("div",Rg,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",zg,[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=jg,Fg=typeof On=="object"&&On&&On.Object===Object&&On,ic=Fg,Hg=ic,Wg=typeof self=="object"&&self&&self.Object===Object&&self,Ug=Hg||Wg||Function("return this")(),Et=Ug,qg=Et,Kg=function(){return qg.Date.now()},Yg=Kg,Jg=/\s/;function Gg(t){for(var e=t.length;e--&&Jg.test(t.charAt(e)););return e}var Zg=Gg,Xg=Zg,Qg=/^\s+/;function e0(t){return t&&t.slice(0,Xg(t)+1).replace(Qg,"")}var t0=e0,n0=Et,r0=n0.Symbol,ms=r0,oc=ms,sc=Object.prototype,i0=sc.hasOwnProperty,o0=sc.toString,Kr=oc?oc.toStringTag:void 0;function s0(t){var e=i0.call(t,Kr),n=t[Kr];try{t[Kr]=void 0;var r=!0}catch{}var i=o0.call(t);return r&&(e?t[Kr]=n:delete t[Kr]),i}var l0=s0,a0=Object.prototype,c0=a0.toString;function d0(t){return c0.call(t)}var u0=d0,lc=ms,f0=l0,h0=u0,p0="[object Null]",m0="[object Undefined]",ac=lc?lc.toStringTag:void 0;function g0(t){return t==null?t===void 0?m0:p0:ac&&ac in Object(t)?f0(t):h0(t)}var Yr=g0;function y0(t){return t!=null&&typeof t=="object"}var Jr=y0,b0=Yr,k0=Jr,x0="[object Symbol]";function w0(t){return typeof t=="symbol"||k0(t)&&b0(t)==x0}var v0=w0,C0=t0,cc=Ri,S0=v0,dc=NaN,E0=/^[-+]0x[0-9a-f]+$/i,O0=/^0b[01]+$/i,M0=/^0o[0-7]+$/i,T0=parseInt;function $0(t){if(typeof t=="number")return t;if(S0(t))return dc;if(cc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=C0(t);var n=O0.test(t);return n||M0.test(t)?T0(t.slice(2),n?2:8):E0.test(t)?dc:+t}var N0=$0,B0=Ri,gs=Yg,uc=N0,A0="Expected a function",V0=Math.max,D0=Math.min;function _0(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(A0);e=uc(e)||0,B0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?V0(uc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(w){var A=r,P=i;return r=i=void 0,d=w,s=t.apply(P,A),s}function m(w){return d=w,l=setTimeout(b,e),u?p(w):s}function y(w){var A=w-c,P=w-d,_=e-A;return f?D0(_,o-P):_}function g(w){var A=w-c,P=w-d;return c===void 0||A>=e||A<0||f&&P>=o}function b(){var w=gs();if(g(w))return v(w);l=setTimeout(b,y(w))}function v(w){return l=void 0,h&&r?p(w):(r=i=void 0,s)}function T(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function k(){return l===void 0?s:v(gs())}function M(){var w=gs(),A=g(w);if(r=arguments,i=this,c=w,A){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),s}return M.cancel=T,M.flush=k,M}var L0=_0;const fc=qr(L0);function I0(){this.__data__=[],this.size=0}var P0=I0;function R0(t,e){return t===e||t!==t&&e!==e}var hc=R0,z0=hc;function j0(t,e){for(var n=t.length;n--;)if(z0(t[n][0],e))return n;return-1}var zi=j0,F0=zi,H0=Array.prototype,W0=H0.splice;function U0(t){var e=this.__data__,n=F0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():W0.call(e,n,1),--this.size,!0}var q0=U0,K0=zi;function Y0(t){var e=this.__data__,n=K0(e,t);return n<0?void 0:e[n][1]}var J0=Y0,G0=zi;function Z0(t){return G0(this.__data__,t)>-1}var X0=Z0,Q0=zi;function ey(t,e){var n=this.__data__,r=Q0(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ty=ey,ny=P0,ry=q0,iy=J0,oy=X0,sy=ty;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=ny,Qn.prototype.delete=ry,Qn.prototype.get=iy,Qn.prototype.has=oy,Qn.prototype.set=sy;var ji=Qn,ly=ji;function ay(){this.__data__=new ly,this.size=0}var cy=ay;function dy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var uy=dy;function fy(t){return this.__data__.get(t)}var hy=fy;function py(t){return this.__data__.has(t)}var my=py,gy=Yr,yy=Ri,by="[object AsyncFunction]",ky="[object Function]",xy="[object GeneratorFunction]",wy="[object Proxy]";function vy(t){if(!yy(t))return!1;var e=gy(t);return e==ky||e==xy||e==by||e==wy}var pc=vy,Cy=Et,Sy=Cy["__core-js_shared__"],Ey=Sy,ys=Ey,mc=function(){var t=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Oy(t){return!!mc&&mc in t}var My=Oy,Ty=Function.prototype,$y=Ty.toString;function Ny(t){if(t!=null){try{return $y.call(t)}catch{}try{return t+""}catch{}}return""}var gc=Ny,By=pc,Ay=My,Vy=Ri,Dy=gc,_y=/[\\^$.*+?()[\]{}|]/g,Ly=/^\[object .+?Constructor\]$/,Iy=Function.prototype,Py=Object.prototype,Ry=Iy.toString,zy=Py.hasOwnProperty,jy=RegExp("^"+Ry.call(zy).replace(_y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fy(t){if(!Vy(t)||Ay(t))return!1;var e=By(t)?jy:Ly;return e.test(Dy(t))}var Hy=Fy;function Wy(t,e){return t==null?void 0:t[e]}var Uy=Wy,qy=Hy,Ky=Uy;function Yy(t,e){var n=Ky(t,e);return qy(n)?n:void 0}var er=Yy,Jy=er,Gy=Et,Zy=Jy(Gy,"Map"),bs=Zy,Xy=er,Qy=Xy(Object,"create"),Fi=Qy,yc=Fi;function e1(){this.__data__=yc?yc(null):{},this.size=0}var t1=e1;function n1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var r1=n1,i1=Fi,o1="__lodash_hash_undefined__",s1=Object.prototype,l1=s1.hasOwnProperty;function a1(t){var e=this.__data__;if(i1){var n=e[t];return n===o1?void 0:n}return l1.call(e,t)?e[t]:void 0}var c1=a1,d1=Fi,u1=Object.prototype,f1=u1.hasOwnProperty;function h1(t){var e=this.__data__;return d1?e[t]!==void 0:f1.call(e,t)}var p1=h1,m1=Fi,g1="__lodash_hash_undefined__";function y1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=m1&&e===void 0?g1:e,this}var b1=y1,k1=t1,x1=r1,w1=c1,v1=p1,C1=b1;function tr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}tr.prototype.clear=k1,tr.prototype.delete=x1,tr.prototype.get=w1,tr.prototype.has=v1,tr.prototype.set=C1;var S1=tr,bc=S1,E1=ji,O1=bs;function M1(){this.size=0,this.__data__={hash:new bc,map:new(O1||E1),string:new bc}}var T1=M1;function $1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var N1=$1,B1=N1;function A1(t,e){var n=t.__data__;return B1(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Hi=A1,V1=Hi;function D1(t){var e=V1(this,t).delete(t);return this.size-=e?1:0,e}var _1=D1,L1=Hi;function I1(t){return L1(this,t).get(t)}var P1=I1,R1=Hi;function z1(t){return R1(this,t).has(t)}var j1=z1,F1=Hi;function H1(t,e){var n=F1(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var W1=H1,U1=T1,q1=_1,K1=P1,Y1=j1,J1=W1;function nr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=U1,nr.prototype.delete=q1,nr.prototype.get=K1,nr.prototype.has=Y1,nr.prototype.set=J1;var kc=nr,G1=ji,Z1=bs,X1=kc,Q1=200;function eb(t,e){var n=this.__data__;if(n instanceof G1){var r=n.__data__;if(!Z1||r.length<Q1-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new X1(r)}return n.set(t,e),this.size=n.size,this}var tb=eb,nb=ji,rb=cy,ib=uy,ob=hy,sb=my,lb=tb;function rr(t){var e=this.__data__=new nb(t);this.size=e.size}rr.prototype.clear=rb,rr.prototype.delete=ib,rr.prototype.get=ob,rr.prototype.has=sb,rr.prototype.set=lb;var ab=rr,cb="__lodash_hash_undefined__";function db(t){return this.__data__.set(t,cb),this}var ub=db;function fb(t){return this.__data__.has(t)}var hb=fb,pb=kc,mb=ub,gb=hb;function Wi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new pb;++e<n;)this.add(t[e])}Wi.prototype.add=Wi.prototype.push=mb,Wi.prototype.has=gb;var yb=Wi;function bb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var kb=bb;function xb(t,e){return t.has(e)}var wb=xb,vb=yb,Cb=kb,Sb=wb,Eb=1,Ob=2;function Mb(t,e,n,r,i,o){var s=n&Eb,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Ob?new vb:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],y=e[f];if(r)var g=s?r(y,m,f,e,t,o):r(m,y,f,t,e,o);if(g!==void 0){if(g)continue;h=!1;break}if(p){if(!Cb(e,function(b,v){if(!Sb(p,v)&&(m===b||i(m,b,n,r,o)))return p.push(v)})){h=!1;break}}else if(!(m===y||i(m,y,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var xc=Mb,Tb=Et,$b=Tb.Uint8Array,Nb=$b;function Bb(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Ab=Bb;function Vb(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Db=Vb,wc=ms,vc=Nb,_b=hc,Lb=xc,Ib=Ab,Pb=Db,Rb=1,zb=2,jb="[object Boolean]",Fb="[object Date]",Hb="[object Error]",Wb="[object Map]",Ub="[object Number]",qb="[object RegExp]",Kb="[object Set]",Yb="[object String]",Jb="[object Symbol]",Gb="[object ArrayBuffer]",Zb="[object DataView]",Cc=wc?wc.prototype:void 0,ks=Cc?Cc.valueOf:void 0;function Xb(t,e,n,r,i,o,s){switch(n){case Zb:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Gb:return!(t.byteLength!=e.byteLength||!o(new vc(t),new vc(e)));case jb:case Fb:case Ub:return _b(+t,+e);case Hb:return t.name==e.name&&t.message==e.message;case qb:case Yb:return t==e+"";case Wb:var l=Ib;case Kb:var c=r&Rb;if(l||(l=Pb),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=zb,s.set(t,e);var u=Lb(l(t),l(e),r,i,o,s);return s.delete(t),u;case Jb:if(ks)return ks.call(t)==ks.call(e)}return!1}var Qb=Xb;function e2(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var t2=e2,n2=Array.isArray,xs=n2,r2=t2,i2=xs;function o2(t,e,n){var r=e(t);return i2(t)?r:r2(r,n(t))}var s2=o2;function l2(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var a2=l2;function c2(){return[]}var d2=c2,u2=a2,f2=d2,h2=Object.prototype,p2=h2.propertyIsEnumerable,Sc=Object.getOwnPropertySymbols,m2=Sc?function(t){return t==null?[]:(t=Object(t),u2(Sc(t),function(e){return p2.call(t,e)}))}:f2,g2=m2;function y2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var b2=y2,k2=Yr,x2=Jr,w2="[object Arguments]";function v2(t){return x2(t)&&k2(t)==w2}var C2=v2,Ec=C2,S2=Jr,Oc=Object.prototype,E2=Oc.hasOwnProperty,O2=Oc.propertyIsEnumerable,M2=Ec(function(){return arguments}())?Ec:function(t){return S2(t)&&E2.call(t,"callee")&&!O2.call(t,"callee")},T2=M2,Ui={exports:{}};function $2(){return!1}var N2=$2;Ui.exports,function(t,e){var n=Et,r=N2,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Ui,Ui.exports);var Mc=Ui.exports,B2=9007199254740991,A2=/^(?:0|[1-9]\d*)$/;function V2(t,e){var n=typeof t;return e=e??B2,!!e&&(n=="number"||n!="symbol"&&A2.test(t))&&t>-1&&t%1==0&&t<e}var D2=V2,_2=9007199254740991;function L2(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_2}var Tc=L2,I2=Yr,P2=Tc,R2=Jr,z2="[object Arguments]",j2="[object Array]",F2="[object Boolean]",H2="[object Date]",W2="[object Error]",U2="[object Function]",q2="[object Map]",K2="[object Number]",Y2="[object Object]",J2="[object RegExp]",G2="[object Set]",Z2="[object String]",X2="[object WeakMap]",Q2="[object ArrayBuffer]",ek="[object DataView]",tk="[object Float32Array]",nk="[object Float64Array]",rk="[object Int8Array]",ik="[object Int16Array]",ok="[object Int32Array]",sk="[object Uint8Array]",lk="[object Uint8ClampedArray]",ak="[object Uint16Array]",ck="[object Uint32Array]",ke={};ke[tk]=ke[nk]=ke[rk]=ke[ik]=ke[ok]=ke[sk]=ke[lk]=ke[ak]=ke[ck]=!0,ke[z2]=ke[j2]=ke[Q2]=ke[F2]=ke[ek]=ke[H2]=ke[W2]=ke[U2]=ke[q2]=ke[K2]=ke[Y2]=ke[J2]=ke[G2]=ke[Z2]=ke[X2]=!1;function dk(t){return R2(t)&&P2(t.length)&&!!ke[I2(t)]}var uk=dk;function fk(t){return function(e){return t(e)}}var hk=fk,qi={exports:{}};qi.exports,function(t,e){var n=ic,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var pk=qi.exports,mk=uk,gk=hk,$c=pk,Nc=$c&&$c.isTypedArray,yk=Nc?gk(Nc):mk,Bc=yk,bk=b2,kk=T2,xk=xs,wk=Mc,vk=D2,Ck=Bc,Sk=Object.prototype,Ek=Sk.hasOwnProperty;function Ok(t,e){var n=xk(t),r=!n&&kk(t),i=!n&&!r&&wk(t),o=!n&&!r&&!i&&Ck(t),s=n||r||i||o,l=s?bk(t.length,String):[],c=l.length;for(var d in t)(e||Ek.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||vk(d,c)))&&l.push(d);return l}var Mk=Ok,Tk=Object.prototype;function $k(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Tk;return t===n}var Nk=$k;function Bk(t,e){return function(n){return t(e(n))}}var Ak=Bk,Vk=Ak,Dk=Vk(Object.keys,Object),_k=Dk,Lk=Nk,Ik=_k,Pk=Object.prototype,Rk=Pk.hasOwnProperty;function zk(t){if(!Lk(t))return Ik(t);var e=[];for(var n in Object(t))Rk.call(t,n)&&n!="constructor"&&e.push(n);return e}var jk=zk,Fk=pc,Hk=Tc;function Wk(t){return t!=null&&Hk(t.length)&&!Fk(t)}var Uk=Wk,qk=Mk,Kk=jk,Yk=Uk;function Jk(t){return Yk(t)?qk(t):Kk(t)}var Gk=Jk,Zk=s2,Xk=g2,Qk=Gk;function ex(t){return Zk(t,Qk,Xk)}var tx=ex,Ac=tx,nx=1,rx=Object.prototype,ix=rx.hasOwnProperty;function ox(t,e,n,r,i,o){var s=n&nx,l=Ac(t),c=l.length,d=Ac(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:ix.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<c;){h=l[f];var b=t[h],v=e[h];if(r)var T=s?r(v,b,h,e,t,o):r(b,v,h,t,e,o);if(!(T===void 0?b===v||i(b,v,n,r,o):T)){y=!1;break}g||(g=h=="constructor")}if(y&&!g){var k=t.constructor,M=e.constructor;k!=M&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof M=="function"&&M instanceof M)&&(y=!1)}return o.delete(t),o.delete(e),y}var sx=ox,lx=er,ax=Et,cx=lx(ax,"DataView"),dx=cx,ux=er,fx=Et,hx=ux(fx,"Promise"),px=hx,mx=er,gx=Et,yx=mx(gx,"Set"),bx=yx,kx=er,xx=Et,wx=kx(xx,"WeakMap"),vx=wx,ws=dx,vs=bs,Cs=px,Ss=bx,Es=vx,Vc=Yr,ir=gc,Dc="[object Map]",Cx="[object Object]",_c="[object Promise]",Lc="[object Set]",Ic="[object WeakMap]",Pc="[object DataView]",Sx=ir(ws),Ex=ir(vs),Ox=ir(Cs),Mx=ir(Ss),Tx=ir(Es),Mn=Vc;(ws&&Mn(new ws(new ArrayBuffer(1)))!=Pc||vs&&Mn(new vs)!=Dc||Cs&&Mn(Cs.resolve())!=_c||Ss&&Mn(new Ss)!=Lc||Es&&Mn(new Es)!=Ic)&&(Mn=function(t){var e=Vc(t),n=e==Cx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case Sx:return Pc;case Ex:return Dc;case Ox:return _c;case Mx:return Lc;case Tx:return Ic}return e});var $x=Mn,Os=ab,Nx=xc,Bx=Qb,Ax=sx,Rc=$x,zc=xs,jc=Mc,Vx=Bc,Dx=1,Fc="[object Arguments]",Hc="[object Array]",Ki="[object Object]",_x=Object.prototype,Wc=_x.hasOwnProperty;function Lx(t,e,n,r,i,o){var s=zc(t),l=zc(e),c=s?Hc:Rc(t),d=l?Hc:Rc(e);c=c==Fc?Ki:c,d=d==Fc?Ki:d;var u=c==Ki,f=d==Ki,h=c==d;if(h&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Os),s||Vx(t)?Nx(t,e,n,r,i,o):Bx(t,e,c,n,r,i,o);if(!(n&Dx)){var p=u&&Wc.call(t,"__wrapped__"),m=f&&Wc.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,g=m?e.value():e;return o||(o=new Os),i(y,g,n,r,o)}}return h?(o||(o=new Os),Ax(t,e,n,r,i,o)):!1}var Ix=Lx,Px=Ix,Uc=Jr;function qc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Uc(t)&&!Uc(e)?t!==t&&e!==e:Px(t,e,n,r,qc,i)}var Rx=qc,zx=Rx;function jx(t,e){return zx(t,e)}var Fx=jx;const Kc=qr(Fx),Hx={},Wx={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Ux=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function qx(t,e){return a.openBlock(),a.createElementBlock("svg",Wx,Ux)}const Kx=ae(Hx,[["render",qx]]),Yx={key:0,class:"leading-none"},Jx={key:1},Gx={class:"flex flex-col max-h-80 overflow-y-auto"},Zx={key:0,class:"p-3"},Xx={key:1},Qx={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},ew=["onClick"],tw={class:"select-none flex w-full items-center justify-between"},Yc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var k;(k=r.options)!=null&&k.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(k){var M,w;if(r.multiple){if(k){let A=r.modelValue||[];A.indexOf(k)>=0?A.splice(A.indexOf(k),1):A.push(k),s("update:modelValue",A),p(A),((M=r.modelValue)==null?void 0:M.length)===((w=r.options)==null?void 0:w.length)?i.value=!0:i.value=!1}}else s("update:modelValue",k),p(k),l.value=null,c.value.hide()}async function u(k){var M,w;s("update:modelValue",k),p(k),await a.nextTick(),((M=r.modelValue)==null?void 0:M.length)===((w=r.options)==null?void 0:w.length)&&(i.value=!0)}function f(k){s("update:modelValue",k),i.value=!1,p(k)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=fc(function(k){s("change",k)},r.debounce),m=a.computed(()=>{var k,M,w,A;if(r.multiple)if(r.maxDisplay){let P=(M=o.value)==null?void 0:M.filter(B=>{var $;return(($=r.modelValue)==null?void 0:$.indexOf(B.value))>=0}).map(B=>B.label),_=P==null?void 0:P.slice(0,r.maxDisplay);return(P==null?void 0:P.length)-(_==null?void 0:_.length)>0?(_==null?void 0:_.join(", "))+` (+${(P==null?void 0:P.length)-_.length})`:_==null?void 0:_.join(", ")}else return(k=o.value)==null?void 0:k.filter(P=>{var _;return((_=r.modelValue)==null?void 0:_.indexOf(P.value))>=0}).map(P=>P.label).join(", ");else return((A=(w=o.value)==null?void 0:w.find(P=>P.value===r.modelValue))==null?void 0:A.label)||r.modelValue});function y(k){var M;try{return r.multiple?r.modelValue!==null&&((M=r.modelValue)==null?void 0:M.some(w=>Kc(w,k))):r.modelValue!==null&&Kc(k,r.modelValue)}catch(w){return console.log(w),!1}}const g={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},b=a.computed(()=>{var k,M;return((k=r.modelValue)==null?void 0:k.length)===((M=r.options)==null?void 0:M.length)}),v=a.computed(()=>{var k;if(r.filterable&&!r.remoteMethod&&((k=l.value)!=null&&k.trim().length)){const M=l.value.trim().toLowerCase();return r.options.filter(w=>{var A;return(A=w.label)==null?void 0:A.toLowerCase().includes(M)})}return r.options});function T(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:b}),(k,M)=>(a.openBlock(),a.createBlock(En,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:w})=>[a.createVNode(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var A,P,_,B,$,q;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((A=t.modelValue)==null?void 0:A.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Yx,[b.value&&((P=t.allSelectedText)!=null&&P.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((_=t.options)==null?void 0:_.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(ee=>ee.value===null))?(a.openBlock(),a.createElementBlock("span",Jx,a.toDisplayString((q=($=t.options)==null?void 0:$.find(ee=>ee.value===null))==null?void 0:q.label),1)):a.renderSlot(k.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Kx,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var w;return[a.createElementVNode("div",Gx,[t.filterable?(a.openBlock(),a.createElementBlock("div",Zx,[a.createVNode(Xc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[M[0]||(M[0]=A=>l.value=A),T]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((w=t.options)==null?void 0:w.length)==0?(a.openBlock(),a.createElementBlock("span",Xx,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Qx,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:M[1]||(M[1]=A=>{var P;return u((P=v.value)==null?void 0:P.filter(_=>_.value).map(_=>_.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:M[2]||(M[2]=A=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.value,A=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!y(A.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||A.value,[`${g[a.unref(ne).theme]}`]:!0}]),onClick:P=>A.disabled?null:d(A.value)},[a.createElementVNode("div",tw,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":A.disabled}])},a.toDisplayString(A.label||A.value),3),t.multiple&&y(A.value)?(a.openBlock(),a.createBlock(rc,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,ew)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Jc=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),nw={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},rw={class:""},iw=["value","disabled","rows","placeholder"],Gc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",nw,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",rw,[d.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:a.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,iw)],64))}}),ow=["placeholder"],Zc={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,ow),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},sw={},lw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},aw=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.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 cw(t,e){return a.openBlock(),a.createElementBlock("svg",lw,aw)}const dw=ae(sw,[["render",cw]]),uw={},fw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},hw=[a.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),a.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),a.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 pw(t,e){return a.openBlock(),a.createElementBlock("svg",fw,hw)}const mw=ae(uw,[["render",pw]]),gw={},yw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},bw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function kw(t,e){return a.openBlock(),a.createElementBlock("svg",yw,bw)}const xw=ae(gw,[["render",kw]]),ww={class:"flex items-center gap-2"},vw={key:0},Cw={class:""},Sw=["innerHTML"],Ew={class:"flex justify-end"},Ow=["name","value","checked"],Mw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},Tw={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},$w={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},Nw={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Xc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:hs()),l=mm(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var B;if(o.rules&&typeof o.rules=="string"){let $=(B=o.rules)==null?void 0:B.split("|");return o.required&&$.push("required"),o.email&&$.push("email"),$.join("|")}else if(!o.rules){let $=[];return o.required&&$.push("required"),o.email&&$.push("email"),$.join("|")}return"required"});function p(B){let $=B&&B.target?B.target.value:B;v($)}const m=n;function y(B){B===!0||B===!1?m("update:modelValue",!B):m("update:modelValue",B)}function g(B){let $=B&&B.target?B.target.value:B;m("update:modelValue",$),m("onChange",$)}function b(){m("update:modelValue",null),m("onChange",null),m("onClear")}const v=fc(function(B){m("update:modelValue",B),m("onChange",B)},o.debounce),T=a.ref(null),k=a.ref();function M(){var B,$;o.textarea?(B=k.value)==null||B.focus():($=T.value)==null||$.$el.focus()}function w(){return T.value.meta.valid}const A=a.ref(),P=a.computed(()=>A.value.allSelected),_=a.computed(()=>A.value.isAllSelected);return e({focus:M,isValid:w,allSelected:P,isAllSelected:_}),(B,$)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",ww,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",vw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Cw,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,Sw)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ew,[a.renderSlot(B.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:T,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:q})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:$[0]||($[0]=ee=>t.disabled?void 0:y(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(ne).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(rc,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(B.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:T,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:q})=>[a.createElementVNode("div",{onClick:$[2]||($[2]=()=>{t.disabled||g(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:$[1]||($[1]=(...ee)=>B.onChange&&B.onChange(...ee)),checked:t.radioValue==t.modelValue},null,40,Ow),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(vn),{key:3,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>{var ee;return[a.createVNode(Yc,{ref_key:"myChoiceList",ref:A,modelValue:t.modelValue,"onUpdate:modelValue":g,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((ee=h.value)==null?void 0:ee.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(vn),{key:4,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>[a.createVNode(Zc,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":g},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(vn),{key:5,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>[a.createVNode(Jc,{modelValue:t.modelValue,"onUpdate:modelValue":g,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(ne).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[B.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",Mw,[a.renderSlot(B.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var q;return[a.createVNode(Gc,{ref_key:"myTextarea",ref:k,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((q=h.value)==null?void 0:q.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:T,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!B.$slots.prepend&&!t.naked,"pl-8":B.$slots.prepend&&!t.naked,"pl-6":B.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(b,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(b,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),B.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",Tw,[a.createElementVNode("div",$w,[a.renderSlot(B.$slots,"append",{},()=>[a.withDirectives(a.createVNode(dw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(mw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",Nw,[a.createVNode(a.unref(pm),{name:s.value},{default:a.withCtx(q=>[a.createTextVNode(a.toDisplayString(q.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),B.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(B.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),Bw=["innerHTML"],Qc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();hs();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await tc(e.value,n.value,{placement:i.placement,middleware:[ec(),Qa(),Xa(i.offset),gg({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,Bw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),Aw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},Vw={class:""},Dw={key:2,class:"flex items-center justify-end py-4 px-6"},_w=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(ne).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",Aw,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(ne).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",Vw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",Dw,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),Lw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Iw={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},Pw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(ne).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",Lw,[a.createElementVNode("div",Iw,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),Rw=a.createElementVNode("div",{class:""},null,-1),zw=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),jw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(ne).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createVNode(Qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[Rw]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[zw],64)):a.createCommentVNode("",!0)],2))}}),Fw={class:"leading-none"},Hw=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(ne).theme]]:!0}])},[a.createElementVNode("span",Fw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Ww=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),Uw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),qw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Kw=[Uw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Yw=ae(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",qw,Kw)):(a.openBlock(),a.createBlock(Jn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Jw={class:"text-base font-medium select-none"},Gr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled: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":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},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 dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(ne).theme]]:!t.active&&!t.disabled,[n[a.unref(ne).theme]]:t.active&&!t.disabled,[r[a.unref(ne).theme]]:t.disabled}])},[a.createElementVNode("span",Jw,[a.renderSlot(i.$slots,"default")])],2))}}),Gw={},Zw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Xw=[a.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 Qw(t,e){return a.openBlock(),a.createElementBlock("svg",Zw,Xw)}const ed=ae(Gw,[["render",Qw]]),ev={},tv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nv=[a.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 rv(t,e){return a.openBlock(),a.createElementBlock("svg",tv,nv)}const td=ae(ev,[["render",rv]]),iv={},ov={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},sv=[a.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 lv(t,e){return a.openBlock(),a.createElementBlock("svg",ov,sv)}const nd=ae(iv,[["render",lv]]),av={},cv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},dv=[a.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 uv(t,e){return a.openBlock(),a.createElementBlock("svg",cv,dv)}const rd=ae(av,[["render",uv]]),fv={class:"wpic-pagination flex justify-between"},hv={key:0,class:"flex items-center"},pv={key:0},mv={key:1,class:"flex flex-wrap gap-2"},gv=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:Boolean,total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},emits:["update:perPage","update:currentPage"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=a.computed(()=>Math.ceil(r.total/r.perPage)),s=a.computed(()=>{const u=o.value;if(!u||u===1)return[1];const f=r.currentPage,h=1;let p=Math.max(2,f-h),m=Math.min(u-1,f+h);f<=h+2&&(p=2,m=Math.min(2*h+2,u-1)),f>=u-h-1&&(p=Math.max(2,u-2*h-1),m=u-1);const y=[];for(let g=p;g<=m;g++)y.push(g);return p>2&&y.unshift("..."),m<u-1&&y.push("..."),[1,...y,u]});function l(u){u>=1&&u<=o.value&&i("update:currentPage",u)}function c(){return r.perPage*(r.currentPage-1)+1}function d(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:c,getEnd:d}),(u,f)=>(a.openBlock(),a.createElementBlock("div",fv,[t.info?(a.openBlock(),a.createElementBlock("div",hv,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(c())+" - "+a.toDisplayString(d()),1),t.total?(a.openBlock(),a.createElementBlock("span",pv," / "+a.toDisplayString(t.total),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",mv,[a.createVNode(Gr,{onClick:f[0]||(f[0]=h=>l(1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(ed,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:f[1]||(f[1]=h=>l(t.currentPage-1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(td,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,h=>(a.openBlock(),a.createBlock(Gr,{key:`page_${h}`,onClick:p=>l(h),active:h===t.currentPage,disabled:o.value==0||!o.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(h),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Gr,{onClick:f[2]||(f[2]=h=>l(t.currentPage+1)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(rd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:f[3]||(f[3]=h=>l(o.value)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(nd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"])])):a.createCommentVNode("",!0),a.createCommentVNode("",!0)]))}}),id=(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 a.h("td",e.attrs,n)};id.props=["column","item","rowIndex"];const Yi=id,yv={},bv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},kv=[a.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 xv(t,e){return a.openBlock(),a.createElementBlock("svg",bv,kv)}const wv=ae(yv,[["render",xv]]),vv={class:"font-semibold"},od={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",vv,[t.checkable?(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},Cv={},Sv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},Ev=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function Ov(t,e){return a.openBlock(),a.createElementBlock("svg",Sv,Ev)}const Mv=ae(Cv,[["render",Ov]]),Tv={},$v={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Nv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function Bv(t,e){return a.openBlock(),a.createElementBlock("svg",$v,Nv)}const Av=ae(Tv,[["render",Bv]]),Vv={class:"wpic-table"},Dv={key:0,class:"px-2 py-1 flex justify-end border-b dark:border-gray-900"},_v={class:"overflow-y-auto"},Lv={class:"w-full rounded-lg"},Iv={key:0,class:"w-16"},Pv=["width"],Rv=["width"],zv={class:"flex justify-center items-center h-full"},jv=["onClick"],Fv={class:"rounded-b-lg relative"},Hv={key:0},Wv=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],Uv={class:"flex justify-center items-center h-full"},qv={key:1},Kv={key:0,class:"text-center text-gray-400 py-3"},Yv=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;a.onMounted(()=>{b()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),y=a.ref([]),g=a.computed(()=>r.columnToggleable?m.value.filter($=>y.value.includes($.field)||!$.selectable):m.value.filter($=>$.visible||!$.selectable));function b(){const $=(L,S)=>{let C={};for(let V in L){if(typeof L[V].default=="boolean"&&S[V]!==void 0){C[V]=S[V]!==!1;continue}if(S[V]!==void 0){C[V]=S[V];continue}if(typeof L[V].default=="function"){C[V]=L[V].default();continue}C[V]=L[V].default}return C};let q=[];(p.default&&p.default()||[]).forEach(L=>{var S,C;((S=L.type)==null?void 0:S.name)==="WpicTableColumn"?q.push(L):(C=L.children)!=null&&C.length&&L.children.forEach(V=>{var I;((I=V.type)==null?void 0:I.name)==="WpicTableColumn"&&q.push(V)})}),m.value=q.map(L=>{let S=L.children,C=L.props||{},{field:V,label:I,help:J,width:Z,minWidth:N,maxWidth:D,sortable:j,selectable:X,render:U,type:R,align:te,visible:he,noPadding:le}=$(L.type.props,C);return V||(V=B(I)),X&&he&&y.value.push(V),{label:I,help:J,width:Z,minWidth:N,maxWidth:D,type:R,align:te,sortable:j,selectable:X,field:V,render:U,children:S,visible:he,noPadding:le}})}function v($){var ee,L;let q=(ee=r.sortOptions)==null?void 0:ee.sortDirection;((L=r.sortOptions)==null?void 0:L.sortBy)===$&&(q=q==="asc"?"desc":"asc"),f("changeSort",{sortDirection:q,sortBy:$})}a.watch(()=>p.default,$=>{b()},{deep:!0});const T=a.reactive({});function k({index:$,item:q}){T[$]?T[$]=null:(T[$]=!0,f("expandRow",{index:$,item:q}))}const M=a.ref([]);function w($){const q=_($,r.itemId);M.value.includes(q)?(M.value.splice(M.value.indexOf(q),1),A.value=!1):M.value.push(q)}const A=a.ref(!1);function P(){if(A.value=!A.value,M.value=[],A.value)for(let $ of r.data){let q=_($,r.itemId);M.value.push(q)}}e({buildColumns:b,selectedRows:M,selectedColumns:y});function _($,q){return q.split(".").reduce((ee,L)=>ee?ee[L]:void 0,$)}function B($){return!$||typeof $!="string"?"":$.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return($,q)=>{const ee=a.resolveComponent("wpic-choice-list"),L=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",Vv,[t.columnToggleable?(a.openBlock(),a.createElementBlock("div",Dv,[a.createElementVNode("div",null,[a.createVNode(ee,{multiple:"",modelValue:y.value,"onUpdate:modelValue":q[0]||(q[0]=S=>y.value=S),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(S=>S.selectable).map(S=>({label:S.label,value:S.field}))},{default:a.withCtx(()=>[a.createVNode(Pr,{medium:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(Av,{class:"w-5 h-5 mr-2"}),a.createTextVNode(" Columns ")]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createElementVNode("div",_v,[a.createElementVNode("table",Lv,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",Iv)):a.createCommentVNode("",!0),g.value.find(S=>S.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${g.value.find(S=>S.type=="expand").minWidth}px`}),width:g.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,Pv)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(g.value.filter(S=>S.type!="expand"),(S,C)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:C},null,12,Rv))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},[a.createElementVNode("div",zv,[a.createVNode(L,{slim:"","hide-error":"",checkbox:"",modelValue:A.value,"onUpdate:modelValue":P},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),g.value.find(S=>S.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(g.value.filter(S=>S.type!="expand"),(S,C)=>{var V,I;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(ne).theme]}`]:!0,"sticky top-0 left-0":C===0}]),style:a.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{S.sortable&&v(S.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":S.align=="right"}])},a.toDisplayString(S.label),3),S.sortable&&S.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":S.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[a.createVNode(wv,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((I=t.sortOptions)==null?void 0:I.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,jv)],6)}),256))])],2)),a.createElementVNode("tbody",Fv,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(ne).theme]]])},[a.createVNode(Jn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",Hv,Wv))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(od,{key:1,checkable:t.checkable,position:"header",columns:g.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(S,C)=>{var V,I,J,Z,N;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${C}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":C%2==0,"is-even":C%2!=0,[s[a.unref(ne).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}])},[a.createElementVNode("div",Uv,[a.createVNode(L,{slim:"","hide-error":"",checkbox:"",modelValue:M.value.includes(_(S,t.itemId)),checkboxValue:_(S,t.itemId),"onUpdate:modelValue":D=>w(S)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),g.value.find(D=>D.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Pr,{small:"",square:"",onClick:D=>k({item:S,index:C})},{default:a.withCtx(()=>[T[C]?(a.openBlock(),a.createBlock(xw,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(Mv,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(g.value.filter(D=>D.type!="expand"),(D,j)=>{var X,U;return a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":j===0,[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":C===((X=t.data)==null?void 0:X.length)-1&&!t.totalItem&&!g.value.find(R=>R.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":C===((U=t.data)==null?void 0:U.length)-1&&!t.totalItem&&!g.value.find(R=>R.type=="expand")&&!t.noRadius,"text-center justify-center":D.align=="center","text-right justify-end":D.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${D.maxWidth}px`}),id:`${C}_${j}`,column:D,item:S,rowIndex:C,key:j},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),g.value.find(D=>D.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(ne).theme]]:!t.stripe,[l[a.unref(ne).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Yi,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(ne).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=g.value.find(D=>D.type=="expand"))!=null&&V.noPadding),"p-0":(I=g.value.find(D=>D.type=="expand"))==null?void 0:I.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":C===((J=t.data)==null?void 0:J.length)-1&&!t.totalItem,"first:rounded-bl-lg":C===((Z=t.data)==null?void 0:Z.length)-1&&!t.totalItem,"text-center":g.value.find(D=>D.type=="expand").align=="center","text-right":g.value.find(D=>D.type=="expand").align=="right"}]),column:g.value.find(D=>D.type=="expand"),rowIndex:C,colspan:(N=g.value)==null?void 0:N.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,T[C]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",qv,[a.createVNode(od,{checkable:t.checkable,position:"footer",columns:g.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])]),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",Kv," No Data ")):a.createCommentVNode("",!0)],2)])}}}),Jv={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},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(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=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.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}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function sd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=sd(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ld(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=ld(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class F{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new F(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new F(r,i)}cutByIndex(e,n){return e==n?F.empty:e==0&&n==this.content.length?this:new F(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new F(i,o)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(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 sd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ld(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ji(0,e);if(e==this.size)return Ji(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ji(r+1,s):Ji(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return F.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new F(n||e,r)}static from(e){if(!e)return F.empty;if(e instanceof F)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new F([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}F.empty=new F([],0);const Ms={index:0,offset:0};function Ji(t,e){return Ms.index=t,Ms.offset=e,Ms}function Gi(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(!Gi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Gi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class aa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gi(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`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}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 aa.none;if(e instanceof aa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class Zi extends Error{}class K{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=cd(this.content,e+this.openStart,n);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,n){return new K(ad(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 K.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 K(F.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new K(e,r,i)}}K.empty=new K(F.empty,0,0);function ad(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ad(o.content,e-i-1,n-i-1)))}function cd(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=cd(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function Gv(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return dd(t,e,n,0)}function dd(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=dd(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $n(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=Zv(n,t);return $n(o,fd(t,s,l,e,r))}else return $n(o,Xi(t,e,r))}function ud(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return ud(r,e.node(n)),r}function Tn(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 Zr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Tn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Tn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Tn(e.nodeBefore,r)}function $n(t,e){return t.type.checkContent(e),t.copy(e)}function fd(t,e,n,r,i){let o=t.depth>i&&Ts(t,e,i+1),s=r.depth>i&&Ts(n,r,i+1),l=[];return Zr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ud(o,s),Tn($n(o,fd(t,e,n,r,i+1)),l)):(o&&Tn($n(o,Xi(t,e,i+1)),l),Zr(e,n,i,l),s&&Tn($n(s,Xi(n,r,i+1)),l)),Zr(r,null,i,l),new F(l)}function Xi(t,e,n){let r=[];if(Zr(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);Tn($n(i,Xi(t,e,n+1)),r)}return Zr(e,null,n,r),new F(r)}function Zv(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(F.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Xr(n,r,o)}static resolveCached(e,n){let r=hd.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else hd.set(e,r=new Xv);let i=r.elts[r.i]=Xr.resolve(e,n);return r.i=(r.i+1)%Qv,i}}class Xv{constructor(){this.elts=[],this.i=0}}const Qv=12,hd=new WeakMap;class Qi{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 e5=Object.create(null);let Qt=class ca{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||F.empty}get children(){return this.content.content}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&&Gi(this.attrs,n||e.defaultAttrs||e5)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ca(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ca(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 K.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new K(d,i.depth-s,o.depth-s)}replace(e,n,r){return Gv(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 Xr.resolveCached(this,e)}resolveNoCache(e){return Xr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),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=F.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;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=F.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Qt.prototype.text=void 0;class eo extends Qt{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 eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new eo(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 Nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new t5(e,n);if(r.next==null)return Nn.empty;let i=md(r);r.next&&r.err("Unexpected trailing text");let o=a5(l5(i));return c5(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return F.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
6
|
-
`)}}Nn.empty=new Nn(!0);class t5{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 md(t){let e=[];do e.push(n5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function n5(t){let e=[];do e.push(r5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function r5(t){let e=s5(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=i5(t,e);else break;return e}function gd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function i5(t,e){let n=gd(t),r=n;return t.eat(",")&&(t.next!="}"?r=gd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function o5(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function s5(t){if(t.eat("(")){let e=md(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=o5(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 l5(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function yd(t,e){return e-t}function bd(t,e){let n=[];return r(e),n.sort(yd);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function a5(t){let e=Object.create(null);return n(bd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);bd(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Nn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(yd);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function c5(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function kd(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 xd(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wd(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function vd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new u5(t,r,e[r]);return n}let Cd=class sp{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=vd(e,r.attrs),this.defaultAttrs=kd(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==Nn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:xd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qt(this,this.computeAttrs(e),F.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=F.from(n),this.checkContent(n),new Qt(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=F.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(F.empty,!0);return o?new Qt(this,e,n.append(o),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new sp(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function d5(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class u5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?d5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class to{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vd(e,i.attrs),this.excluded=null;let o=kd(this.attrs);this.instance=o?new ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,xd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new to(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Sd{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=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Cd.compile(this.spec.nodes,this),this.marks=to.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?Ed(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ed(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Cd){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 eo(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Qt.fromJSON(this,e)}markFromJSON(e){return ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ed(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function f5(t){return t.tag!=null}function h5(t){return t.style!=null}class en{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(f5(i))this.tags.push(i);else if(h5(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new $d(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $d(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),K.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(g5(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new en(e,en.schemaRules(e)))}}const Od={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},p5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Md={ol:!0,ul:!0},Qr=1,$s=2,no=4;function Td(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?$s:0):t&&t.whitespace=="pre"?Qr|$s:n&-5}class ro{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ye.none,this.match=o||(s&no?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(F.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&Qr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=F.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Od.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $d{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Td(null,n.preserveWhitespace,0)|(r?no:0);i?o=new ro(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ro(null,null,ye.none,!0,null,s):o=new ro(e.schema.topNodeType,null,ye.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&$s?"full":this.localPreserveWS||(i.options&Qr)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
7
|
-
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Md.hasOwnProperty(s)&&this.parser.normalizeLists&&
|
|
8
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ye.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Bd(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Td(e,o,s.options);s.options&no&&s.content.length==0&&(l|=no);let c=ye.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Bd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ro(e,n,c,i,null,l)),this.open++,r}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;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function m5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Md.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function g5(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Nd(t){let e={};for(let n in t)e[n]=t[n];return e}function Bd(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Bn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ns(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=io(Ns(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&io(Ns(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return io(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ad(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ad(e.marks)}}function Ad(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ns(t){return t.document||window.document}const Vd=new WeakMap;function y5(t){let e=Vd.get(t);return e===void 0&&Vd.set(t,e=b5(t)),e}function b5(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function io(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=y5(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=io(t,h,n,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Dd=65535,_d=Math.pow(2,16);function k5(t,e){return t+e*_d}function Ld(t){return t&Dd}function x5(t){return(t-(t&Dd))/_d}const Id=1,Pd=2,oo=4,Rd=8;class Bs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Rd)>0}get deletedBefore(){return(this.delInfo&(Id|oo))>0}get deletedAfter(){return(this.delInfo&(Pd|oo))>0}get deletedAcross(){return(this.delInfo&oo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=Ld(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+x5(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:n:n,p=c+i+(h<0?0:u);if(r)return p;let m=e==(n<0?c:f)?null:k5(l/3,e-c),y=e==c?Pd:e==f?Id:oo;return(n<0?e!=c:e!=f)&&(y|=Rd),new Bs(p,y,m)}i+=u-d}return r?e+i:new Bs(e+i,0,null)}touches(e,n){let r=0,i=Ld(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class or{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 or(this.maps,this.mirror,e,n)}copy(){return new or(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 or;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Bs(e,i,null)}}const As=Object.create(null);class Pe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=As[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 As)throw new RangeError("Duplicate use of step JSON ID "+e);return As[e]=n,n.prototype.jsonID=e,n}}class Se{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Se(e,null)}static fail(e){return new Se(null,e)}static fromReplace(e,n,r,i){try{return Se.ok(e.replace(n,r,i))}catch(o){if(o instanceof Zi)return Se.fail(o.message);throw o}}}function Vs(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Vs(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return F.fromArray(r)}class tn extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new K(Vs(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,o)}invert(){return new Ot(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 tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(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 tn(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("addMark",tn);class Ot extends Pe{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 K(Vs(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,r)}invert(){return new tn(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 Ot(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(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 Ot(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("removeMark",Ot);class nn extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new K(F.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 nn(this.pos,n.marks[i]);return new nn(this.pos,this.mark)}}return new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nn(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 nn(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("addNodeMark",nn);class sr extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new K(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new nn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sr(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 sr(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("removeNodeMark",sr);class $e extends Pe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ds(e,this.from,this.to)?Se.fail("Structure replace would overwrite content"):Se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new $e(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 $e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof $e)||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?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $e(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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $e(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 $e(n.from,n.to,K.fromJSON(e,n.slice),!!n.structure)}}Pe.jsonID("replace",$e);class Ne extends Pe{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Ds(e,this.from,this.gapFrom)||Ds(e,this.gapTo,this.to)))return Se.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Se.fromReplace(e,this.from,this.to,r):Se.fail("Content does not fit in gap")}getMap(){return new et([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 Ne(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ne(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(n.from,n.to,n.gapFrom,n.gapTo,K.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pe.jsonID("replaceAround",Ne);function Ds(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function w5(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,n),m=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[y])?s.to=p:i.push(s=new Ot(h,p,f[y])));l&&l.to==h?l.to=p:o.push(l=new tn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function v5(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof to){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Ot(s.from,s.to,s.style)))}function _s(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new $e(l,u,K.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ot(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new K(F.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new $e(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(F.empty,!0);t.replace(l,l,new K(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function C5(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!C5(i,o,s))break}return null}function S5(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=F.empty,f=0;for(let m=o,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=F.from(r.node(m).copy(u)),f++):c--;let h=F.empty,p=0;for(let m=o,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=F.from(i.node(m).copy(h)),p++):d++;t.step(new Ne(c,d,s,l,new K(u.append(h),f,p),u.size-f,!0))}function Ls(t,e,n=null,r=t){let i=E5(t,e),o=i&&O5(r,e);return o?i.map(zd).concat({type:e,attrs:n}).concat(o.map(zd)):null}function zd(t){return{type:t,attrs:null}}function E5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function O5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function M5(t,e,n){let r=F.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=F.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new K(r,0,0),n.length,!0))}function T5(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&$5(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Fd(t,s,l,o),_s(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return t.step(new Ne(f,h,f+1,h-1,new K(F.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&jd(t,s,l,o),!1}})}function jd(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Fd(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
9
|
-
`))}})}function $5(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function N5(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new K(F.from(s),0,0),1,!0))}function Pt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!y.type.validContent(p))return!1}let l=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function B5(t,e,n=1,r){let i=t.doc.resolve(e),o=F.empty,s=F.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=F.from(i.node(l).copy(o));let u=r&&r[d];s=F.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new $e(e,e,new K(o.append(s),n,n),!0))}function rn(t,e){let n=t.resolve(e),r=n.index();return Hd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function A5(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Hd(t,e){return!!(t&&e&&!t.isLeaf&&A5(t,e))}function so(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Hd(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function V5(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Fd(t,u.node(),u.before(),l)}s.inlineContent&&_s(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(l),d=c.map(e-n);if(t.step(new $e(d,c.map(e+n,-1),K.empty,!0)),r===!0){let u=t.doc.resolve(d);jd(t,u.node(),u.before(),t.steps.length)}return t}function D5(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Wd(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function lo(t,e,n=e,r=K.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ud(i,o,r)?new $e(e,n,r):new _5(i,o,r).fit()}function Ud(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class _5{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let c=new K(o,s,l);return e>-1?new Ne(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new $e(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Is(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(F.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Is(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(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=Is(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new K(ei(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new K(ei(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let s=this.unplaced,l=r?r.content:s.content,c=s.openStart-e,d=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=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let y=l.child(d),g=f.matchType(y.type);if(!g)break;d++,(d>1||c==0||y.content.size)&&(f=g,u.push(qd(y.mark(h.allowedMarks(y.marks)),d==1?c:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=ti(this.placed,n,F.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=l;y<p;y++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=m?e==0?K.empty:new K(ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new K(ei(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ps(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ps(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=Ps(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ti(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ti(this.placed,this.depth,F.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(F.empty,!0);n.childCount&&(this.placed=ti(this.placed,this.frontier.length,n))}}function ei(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ei(t.firstChild.content,e-1,n)))}function ti(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ti(t.lastChild.content,e-1,n)))}function Is(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function qd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,qd(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(F.empty,!0)))),t.copy(r)}function Ps(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!L5(n,o.content,s)?l:null}function L5(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function I5(t){return t.spec.defining||t.spec.definingForContent}function P5(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Ud(i,o,r))return t.step(new $e(e,n,r));let s=Yd(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(l),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=I5(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let y=0;y<s.length;y++){let g=s[(y+c)%s.length],b=!0;g<0&&(b=!1,g=-g);let v=i.node(g-1),T=i.index(g-1);if(v.canReplaceWith(T,T,m.type,m.marks))return t.replace(i.before(g),b?o.after(g):n,new K(Kd(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Kd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Kd(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(F.empty,!0))}return t}function R5(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=D5(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new K(F.from(r),0,0))}function z5(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Yd(r,i);for(let s=0;s<o.length;s++){let l=o[s],c=s==o.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Yd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class ar extends Pe{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 Se.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Se.fromReplace(e,this.pos,this.pos+1,new K(F.from(i),0,n.isLeaf?0:1))}getMap(){return et.empty}invert(e){return new ar(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 ar(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 ar(n.pos,n.attr,n.value)}}Pe.jsonID("attr",ar);class ni extends Pe{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 Se.ok(r)}getMap(){return et.empty}invert(e){return new ni(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 ni(n.attr,n.value)}}Pe.jsonID("docAttr",ni);let cr=class extends Error{};cr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},cr.prototype=Object.create(Error.prototype),cr.prototype.constructor=cr,cr.prototype.name="TransformError";class j5{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new or}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cr(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=K.empty){let i=lo(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new K(F.from(r),0,0))}delete(e,n){return this.replace(e,n,K.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return P5(this,e,n,r),this}replaceRangeWith(e,n,r){return R5(this,e,n,r),this}deleteRange(e,n){return z5(this,e,n),this}lift(e,n){return S5(this,e,n),this}join(e,n=1){return V5(this,e,n),this}wrap(e,n){return M5(this,e,n),this}setBlockType(e,n=e,r,i=null){return T5(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return N5(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ar(e,n,r)),this}setDocAttribute(e,n){return this.step(new ni(e,n)),this}addNodeMark(e,n){return this.step(new nn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ye)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new sr(e,n)),this}split(e,n=1,r){return B5(this,e,n,r),this}addMark(e,n,r){return w5(this,e,n,r),this}removeMark(e,n,r){return v5(this,e,n,r),this}clearIncompatible(e,n,r){return _s(this,e,n,r),this}}const Rs=Object.create(null);class ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new F5(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=K.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:c,$to:d}=s[l],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),l?K.empty:n),l==0&&Zd(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(l.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Zd(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ce(e):dr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?dr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):dr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new tt(e.node(0))}static atStart(e){return dr(e,e,0,0,1)||new tt(e)}static atEnd(e){return dr(e,e,e.content.size,e.childCount,-1)||new tt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Rs[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 Rs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rs[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}ue.prototype.visible=!0;class F5{constructor(e,n){this.$from=e,this.$to=n}}let Jd=!1;function Gd(t){!Jd&&!t.parent.inlineContent&&(Jd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ce extends ue{constructor(e,n=e){Gd(e),Gd(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 ue.near(r);let i=e.resolve(n.map(this.anchor));return new ce(i.parent.inlineContent?i:r,r)}replace(e,n=K.empty){if(super.replace(e,n),n==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ao(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 ce(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ce(e,n)}}ue.jsonID("text",ce);class ao{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ao(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class re extends ue{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ue.near(o):new re(o)}content(){return new K(F.from(this.node),0,0)}eq(e){return e instanceof re&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zs(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new re(e.resolve(n.anchor))}static create(e,n){return new re(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}re.prototype.visible=!1,ue.jsonID("node",re);class zs{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ao(r,r):new zs(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&re.isSelectable(r)?new re(n):ue.near(n)}}class tt extends ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=K.empty){if(n==K.empty){e.delete(0,e.doc.content.size);let r=ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new tt(e)}map(e){return new tt(e)}eq(e){return e instanceof tt}getBookmark(){return H5}}ue.jsonID("all",tt);const H5={map(){return this},resolve(t){return new tt(t)}};function dr(t,e,n,r,i,o=!1){if(e.inlineContent)return ce.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&re.isSelectable(l))return re.create(t,n-(i<0?l.nodeSize:0))}else{let c=dr(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Zd(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;let o=t.mapping.maps[r],s;o.forEach((l,c,d,u)=>{s==null&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const Xd=1,Qd=2,eu=4;class W5 extends j5{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|Xd)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Xd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qd,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Qd)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.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|=eu,this}get scrolledIntoView(){return(this.updated&eu)>0}}function tu(t,e){return!e||!t?t:t.bind(e)}class ri{constructor(e,n,r){this.name=e,this.init=tu(n.init,r),this.apply=tu(n.apply,r)}}const U5=[new ri("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ri("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new ri("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ri("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class js{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=U5.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 ri(r.key,r.spec.state,r))})}}class ur{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new W5(this)}static create(e){let n=new js(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(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 js(this.schema,e.plugins),r=n.fields,i=new ur(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new js(e.schema,e.plugins),o=new ur(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Qt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function nu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=nu(i,e,{})),n[r]=i}return n}class _e{constructor(e){this.spec=e,this.props={},e.props&&nu(e.props,this,this.props),this.key=e.key?e.key.key:ru("plugin")}getState(e){return e[this.key]}}const Fs=Object.create(null);function ru(t){return t in Fs?t+"$"+ ++Fs[t]:(Fs[t]=0,t+"$")}class nt{constructor(e="key"){this.key=ru(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Le=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ii=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Hs=null;const Rt=function(t,e,n){let r=Hs||(Hs=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},q5=function(){Hs=null},An=function(t,e,n,r){return n&&(iu(t,e,n,r,-1)||iu(t,e,n,r,1))},K5=/^(img|br|input|textarea|hr)$/i;function iu(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:lt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||oi(t)||K5.test(t.nodeName)||t.contentEditable=="false")return!1;e=Le(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?lt(t):0}else return!1}}function lt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Y5(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=lt(t)}else if(t.parentNode&&!oi(t))e=Le(t),t=t.parentNode;else return null}}function J5(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&&!oi(t))e=Le(t)+1,t=t.parentNode;else return null}}function G5(t,e,n){for(let r=e==0,i=e==lt(t);r||i;){if(t==n)return!0;let o=Le(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==lt(t)}}function oi(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 co=function(t){return t.focusNode&&An(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Vn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Z5(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function X5(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(lt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(lt(r.startContainer),r.startOffset)}}}const Mt=typeof navigator<"u"?navigator:null,ou=typeof document<"u"?document:null,on=Mt&&Mt.userAgent||"",Ws=/Edge\/(\d+)/.exec(on),su=/MSIE \d/.exec(on),Us=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(on),Je=!!(su||Us||Ws),sn=su?document.documentMode:Us?+Us[1]:Ws?+Ws[1]:0,xt=!Je&&/gecko\/(\d+)/i.test(on);xt&&+(/Firefox\/(\d+)/.exec(on)||[0,0])[1];const qs=!Je&&/Chrome\/(\d+)/.exec(on),Re=!!qs,lu=qs?+qs[1]:0,Fe=!Je&&!!Mt&&/Apple Computer/.test(Mt.vendor),fr=Fe&&(/Mobile\/\w+/.test(on)||!!Mt&&Mt.maxTouchPoints>2),at=fr||(Mt?/Mac/.test(Mt.platform):!1),Q5=Mt?/Win/.test(Mt.platform):!1,zt=/Android \d/.test(on),si=!!ou&&"webkitFontSmoothing"in ou.documentElement.style,eC=si?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tC(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 jt(t,e){return typeof t=="number"?t:t[e]}function nC(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 au(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=ii(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?tC(o):nC(l),u=0,f=0;if(e.top<d.top+jt(r,"top")?f=-(d.top-e.top+jt(i,"top")):e.bottom>d.bottom-jt(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+jt(i,"top")-d.top:e.bottom-d.bottom+jt(i,"bottom")),e.left<d.left+jt(r,"left")?u=-(d.left-e.left+jt(i,"left")):e.right>d.right-jt(r,"right")&&(u=e.right-d.right+jt(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,y=l.scrollTop-p;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function rC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:cu(t.dom)}}function cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ii(r));return e}function iC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;du(n,r==0?0:r-e)}function du(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let hr=null;function oC(t){if(t.setActive)return t.setActive();if(hr)return t.focus(hr);let e=cu(t);t.focus(hr==null?{get preventScroll(){return hr={preventScroll:!0},!0}}:void 0),hr||(hr=!1,du(e,0))}function uu(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,c,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Rt(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);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&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?sC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:uu(n,i)}function sC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=ln(r,1);if(o.top!=o.bottom&&Ks(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ks(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function lC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function aC(t,e,n){let{node:r,offset:i}=uu(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function cC(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function fu(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Ks(e,d))return fu(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function dC(t,e){let n=t.dom.ownerDocument,r,i=0,o=X5(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!Ks(e,d)||(s=fu(t.dom,e,d),!s))return null}if(Fe)for(let d=s;r&&d;d=ii(d))d.draggable&&(r=void 0);if(s=lC(s,e),r){if(xt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;si&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=cC(t,r,i,e))}l==null&&(l=aC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function hu(t){return t.top<t.bottom||t.left<t.right}function ln(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(hu(r))return r}return Array.prototype.find.call(n,hu)||t.getBoundingClientRect()}const uC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function pu(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=si||xt;if(r.nodeType==3)if(s&&(uC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=ln(Rt(r,i,i),n);if(xt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=ln(Rt(r,i-1,i-1),-1);if(d.top==c.top){let u=ln(Rt(r,i,i+1),-1);if(u.top!=c.top)return li(u,u.left<d.left)}}return c}else{let c=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(c--,u=1):n<0?c--:d++,li(ln(Rt(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!0)}return Ys(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Rt(c,lt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return li(ln(d,1),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Rt(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return li(ln(d,-1),!0)}return li(ln(r.nodeType==3?Rt(r):r,-n),n>=0)}function li(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 Ys(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 mu(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 fC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return mu(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=pu(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Rt(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const hC=/[\u0590-\u08ac]/;function pC(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!hC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:mu(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=l.caretBidiLevel;l.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)||c==m&&d==y;try{l.collapse(u,f),c&&(c!=u||d!=f)&&l.extend&&l.extend(c,d)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let gu=null,yu=null,bu=!1;function mC(t,e,n){return gu==e&&yu==n?bu:(gu=e,yu=n,bu=n=="up"||n=="down"?fC(t,e,n):pC(t,e,n))}const ct=0,ku=1,Dn=2,Tt=3;class ai{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ct,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Le(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let l=i.children[s];if(l.size){i=l;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof vu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof xu&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Le(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Le(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let c=this.children[l],d=s+c.size;if(i==-1&&e<=d){let u=s+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Le(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Le(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let y=this.children[p],g=m+y.size;if(o>m&&s<g)return y.setSelection(e-m-y.border,n-m-y.border,r,i);m=g}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((xt||Fe)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
10
|
-
`),f&&m==p.nodeValue.length)for(let y=p,g;y;y=y.parentNode){if(g=y.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:Le(g)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let y=p.childNodes[m-1];f=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(xt&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&Fe)&&An(l.node,l.offset,u.anchorNode,u.anchorOffset)&&An(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,c=s-o.border;if(e>=l&&n<=c){this.dirty=e==r||n==s?Dn:ku,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Tt:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Dn:Tt}r=s}this.dirty=Dn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Dn:ku;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class xu extends ai{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==ct&&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 gC extends ai{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 _n extends ai{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Bn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new _n(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Tt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ct){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ct}}slice(e,n,r){let i=_n.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Gs(o,n,s,r)),e>0&&(o=Gs(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class an extends ai{constructor(e,n,r,i,o,s,l,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],c,d=l&&l(n,o,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Bn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Eu(u,r,n),d?c=new yC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new uo(e,n,r,i,u,h,o):new an(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,n,r){return this.dirty==ct&&e.eq(this.node)&&fo(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,c=new kC(this,s&&s.node,e);vC(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?ye.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,h)=>{c.syncToMarks(d.marks,r,e);let p;c.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,p,e)||c.updateNextNode(d,u,f,e,h,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Dn)&&(s&&this.protectLocalComposition(e,s),Cu(this.contentDOM,this.children,e),fr&&CC(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=SC(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new gC(this,o,n,i);e.input.compositionNodes.push(s),this.children=Gs(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Tt||!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=ct}updateOuterDeco(e){if(fo(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Su(this.dom,this.nodeDOM,Js(this.outerDeco,this.node,n),Js(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 wu(t,e,n,r,i){Eu(r,e,t);let o=new an(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class uo extends an{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,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==Tt||this.dirty!=ct&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ct||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=ct,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new uo(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vu extends ai{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ct&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class yC extends an{constructor(e,n,r,i,o,s,l,c,d,u){super(e,n,r,i,o,s,l,d,u),this.spec=c}update(e,n,r,i){if(this.dirty==Tt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):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 Cu(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Ou(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof _n){let c=r?r.previousSibling:t.lastChild;Cu(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=Ou(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const ci=function(t){t&&(this.nodeName=t)};ci.prototype=Object.create(null);const Ln=[new ci];function Js(t,e,n){if(t.length==0)return Ln;let r=n?Ln[0]:new ci,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new ci(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new ci(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function Su(t,e,n,r){if(n==Ln&&r==Ln)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let c;l&&l.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=Ln[0]),i=c}bC(i,l||Ln[0],s)}return i}function bC(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Eu(t,e,n){return Su(t,t,Ln,Js(e,n,t.nodeType!=1))}function fo(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 Ou(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class kC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=xC(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=ct,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=_n.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Tt&&s.dom==s.contentDOM&&(s.dirty=Dn),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof an){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,h=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Tt&&fo(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Dn,f.updateChildren(i,s+1),f.dirty=ct),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!fo(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=an.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,r,i,o){let s=an.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new xu(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof _n;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof uo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fe||Re)&&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 vu(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 xC(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof _n)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function wC(t,e){return t.type.side-e.type.side}function vC(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,l=[],c=null;for(let d=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(wC);for(let g=0;g<f.length;g++)n(f[g],d,!!c)}else n(u,d,!!c);let h,p;if(c)p=-1,h=c,c=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let g=0;g<l.length;g++)l[g].to<=o&&l.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let g=m;s<i.length&&i[s].from<g&&(g=i[s].from);for(let b=0;b<l.length;b++)l[b].to<g&&(g=l[b].to);g<m&&(c=h.cut(g-o),h=h.cut(0,g-o),m=g,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let y=h.isInline&&!h.isLeaf?l.filter(g=>!g.inline):l.slice();r(h,y,e.forChild(o,h),p),o=m}}function CC(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 SC(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let c=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?c.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function Gs(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let c=t[s],d=l,u=l+=c.size;d>=n||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(c.slice(n-d,c.size,r)))}return o}function Zs(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(co(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&re.isSelectable(f)&&i.parent&&!(f.isInline&&G5(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new re(s==h?l:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==t.state.selection.anchor?[h,f]:[f,h],l=r.resolve(s)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=Qs(t,u,l,f)}return d}function Mu(t){return t.editable?t.hasFocus():Du(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ft(t,e=!1){let n=t.state.selection;if(Bu(t,n),!!Mu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Re){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&An(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)OC(t);else{let{anchor:r,head:i}=n,o,s;Tu&&!(n instanceof ce)&&(n.$from.parent.inlineContent||(o=$u(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=$u(t,n.to))),t.docView.setSelection(r,i,t,e),Tu&&(o&&Nu(o),s&&Nu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&EC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tu=Fe||Re&&lu<63;function $u(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Fe&&i&&i.contentEditable=="false")return Xs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xs(i);if(o)return Xs(o)}}function Xs(t){return t.contentEditable="true",Fe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Nu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function EC(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(()=>{(!Mu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function OC(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Le(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Je&&sn<=11&&(r.disabled=!0,r.disabled=!1)}function Bu(t,e){if(e instanceof re){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Au(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Au(t)}function Au(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Qs(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function Vu(t){return t.editable&&!t.hasFocus()?!1:Du(t)}function Du(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 MC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return An(e.node,e.offset,n.anchorNode,n.anchorOffset)}function el(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function cn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function _u(t,e,n){let r=t.state.selection;if(r instanceof ce)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return cn(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=el(t.state,e);return i&&i instanceof re?cn(t,i):!1}else if(!(at&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?re.isSelectable(o)?cn(t,new re(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):si?cn(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof re&&r.node.isInline)return cn(t,new ce(e>0?r.$to:r.$from));{let i=el(t.state,e);return i?cn(t,i):!1}}}function ho(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function di(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function pr(t,e){return e<0?TC(t):$C(t)}function TC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(xt&&n.nodeType==1&&r<ho(n)&&di(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(di(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Lu(n))break;{let l=n.previousSibling;for(;l&&di(l,-1);)i=n.parentNode,o=Le(l),l=l.previousSibling;if(l)n=l,r=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?tl(t,n,r):i&&tl(t,i,o)}function $C(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ho(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(di(l,1))o=n,s=++r;else break}else{if(Lu(n))break;{let l=n.nextSibling;for(;l&&di(l,1);)o=l.parentNode,s=Le(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&tl(t,o,s)}function Lu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function NC(t,e){for(;t&&e==t.childNodes.length&&!oi(t);)e=Le(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 BC(t,e){for(;t&&!e&&!oi(t);)e=Le(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 tl(t,e,n){if(e.nodeType!=3){let o,s;(s=NC(e,n))?(e=s,n=0):(o=BC(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(co(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ft(t)},50)}function Iu(t,e){let n=t.state.doc.resolve(e);if(!(Re||Q5)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Pu(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||at&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=el(t.state,e);if(s&&s instanceof re)return cn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof tt?ue.near(s,e):ue.findFrom(s,e);return l?cn(t,l):!1}return!1}function Ru(t,e){if(!(t.state.selection instanceof ce))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function zu(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function AC(t){if(!Fe||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;zu(t,r,"true"),setTimeout(()=>zu(t,r,"false"),20)}return!1}function VC(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function DC(t,e){let n=e.keyCode,r=VC(e);if(n==8||at&&n==72&&r=="c")return Ru(t,-1)||pr(t,-1);if(n==46&&!e.shiftKey||at&&n==68&&r=="c")return Ru(t,1)||pr(t,1);if(n==13||n==27)return!0;if(n==37||at&&n==66&&r=="c"){let i=n==37?Iu(t,t.state.selection.from)=="ltr"?-1:1:-1;return _u(t,i,r)||pr(t,i)}else if(n==39||at&&n==70&&r=="c"){let i=n==39?Iu(t,t.state.selection.from)=="ltr"?1:-1:1;return _u(t,i,r)||pr(t,i)}else{if(n==38||at&&n==80&&r=="c")return Pu(t,-1,r)||pr(t,-1);if(n==40||at&&n==78&&r=="c")return AC(t)||Pu(t,1,r)||pr(t,1);if(r==(at?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function nl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Bn.fromSchema(t.state.schema),l=Yu(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=qu[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
5
|
+
*/function Te(t){return typeof t=="function"}function fa(t){return t==null}const Jt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Wo(t){return Number(t)>=0}function mp(t){const e=parseFloat(t);return isNaN(e)?t:e}function gp(t){return typeof t=="object"&&t!==null}function yp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ha(t){if(!gp(t)||yp(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 Ar(t,e){return Object.keys(e).forEach(n=>{if(ha(e[n])&&ha(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Vr(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Wo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const pa={};function yt(t,e){kp(t,e),pa[t]=e}function bp(t){return pa[t]}function kp(t,e){if(!Te(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ma(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(ge(l),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)ma(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]||ma(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),ga=Symbol("vee-validate-field-instance"),Mi=Symbol("Default empty value"),xp=typeof window<"u";function Uo(t){return Te(t)&&!!t.__locatorRef}function bt(t){return!!t&&Te(t.parse)&&t.__type==="VVTypedSchema"}function Ti(t){return!!t&&Te(t.validate)}function _r(t){return t==="checkbox"||t==="radio"}function wp(t){return Jt(t)||Array.isArray(t)}function vp(t){return Array.isArray(t)?t.length===0:Jt(t)&&Object.keys(t).length===0}function $i(t){return/^\[.+\]$/i.test(t)}function Cp(t){return ya(t)&&t.multiple}function ya(t){return t.tagName==="SELECT"}function Sp(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Ep(t,e){return!Sp(t,e)&&e.type!=="file"&&!_r(e.type)}function ba(t){return qo(t)&&t.target&&"submit"in t.target}function qo(t){return t?!!(typeof Event<"u"&&Te(Event)&&t instanceof Event||t&&t.srcElement):!1}function ka(t,e){return e in t&&t[e]!==Mi}function je(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(!je(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(!je(r[1],e.get(r[0])))return!1;return!0}if(xa(t)&&xa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function xa(t){return xp?t instanceof File:!1}function Ko(t){return $i(t)?t.replace(/\[|\]/gi,""):t}function qe(t,e,n){return t?$i(e)?t[Ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>wp(i)&&o in i?i[o]:n,t):n}function Lt(t,e,n){if($i(e)){t[Ko(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||fa(i[r[o]]))&&(i[r[o]]=Wo(r[o+1])?[]:{}),i=i[r[o]]}}function Yo(t,e){if(Array.isArray(t)&&Wo(e)){t.splice(Number(e),1);return}Jt(t)&&delete t[e]}function wa(t,e){if($i(e)){delete t[Ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){Yo(r,n[o]);break}if(!(n[o]in r)||fa(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>qe(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(vp(i[o])){if(o===0){Yo(t,n[0]);continue}Yo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Jo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function va(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return je(t,e)?n:e}function Op(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Ca(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function Mp(t,e){return Jt(e)&&e.number?mp(t):t}function Go(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Zo(t){return Array.isArray(t)?t:t?[t]:[]}function Ni(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function Tp(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Xo(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 Qo(t){if(Sa(t))return t._value}function Sa(t){return"_value"in t}function $p(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Bi(t){if(!qo(t))return t;const e=t.target;if(_r(e.type)&&Sa(e))return Qo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Cp(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Qo);if(ya(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Qo(n):e.value}return $p(e)}function Ea(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Jt(t)&&t._$$isNormalized?t:Jt(t)?Object.keys(t).reduce((n,r)=>{const i=Np(t[r]);return t[r]!==!1&&(n[r]=Oa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Bp(r);return i.name&&(n[i.name]=Oa(i.params)),n},e):e}function Np(t){return t===!0?[]:Array.isArray(t)||Jt(t)?t:[t]}function Oa(t){const e=n=>typeof n=="string"&&n[0]==="@"?Ap(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 Bp=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Ap(t){const e=n=>qe(n,t)||n[t];return e.__locatorRef=t,e}function Vp(t){return Array.isArray(t)?t.filter(Uo):Ke(t).filter(e=>Uo(t[e])).map(e=>t[e])}let Dp=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const wn=()=>Dp;async function Ma(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await _p(i,t)).errors;return{errors:s,valid:!s.length}}async function _p(t,e){if(bt(t.rules)||Ti(t.rules))return Ip(e,t.rules);if(Te(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:$a(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Ea(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Pp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function Lp(t){return!!t&&t.name==="ValidationError"}function Ta(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Lp(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function Ip(t,e){const r=await(bt(e)?e:Ta(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Pp(t,e,n){const r=bp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Rp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:$a(o)}}function $a(t){const e=wn().generateMessage;return e?e(t):"Field is invalid"}function Rp(t,e){const n=r=>Uo(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 zp(t,e){const r=await(bt(t)?t:Ta(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function jp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Ma(qe(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Na=0;function Fp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Hp(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=qp(),u=Na>=Number.MAX_SAFE_INTEGER?0:++Na,f=Up(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function Hp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?qe(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=Wp(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return qe(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Wp(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:qe(e.values,a.unref(r),a.unref(n))}function Up(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!je(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function qp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Zo(e)}}}function Ba(t){process.env.NODE_ENV!=="production"&&pp({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"},Jp)}const Lr={},Ir={};let It;const Kn=Op(()=>{setTimeout(async()=>{await a.nextTick(),It==null||It.sendInspectorState(Yn),It==null||It.sendInspectorTree(Yn)},100)},100);function Kp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Lr[t.formId]=Object.assign({},t),Lr[t.formId]._vm=e,a.onUnmounted(()=>{delete Lr[t.formId],Kn()}),Kn()}function Yp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],Kn()}),Kn()}const Yn="vee-validate-inspector",Ye={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Jp(t){It=t,t.addInspector({id:Yn,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!==Yn)return;const n=Object.values(Lr),r=Object.values(Ir);e.rootNodes=[...n.map(Gp),...r.map(i=>Xp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Yn||n.currentTab!==`custom-inspector:${Yn}`)return;const{form:r,field:i,state:o,type:s}=Qp(e.nodeId);if(r&&s==="form"){e.state=em(r),Ce={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Va(o),Ce={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Va({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 Gp(t){const{textColor:e,bgColor:n}=Da(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Lt(r,a.unref(s.path),Zp(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Jt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:es(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ye.white,backgroundColor:Ye.unknown}]}}function Zp(t,e){return{id:es(e,t),label:a.unref(t.path),tags:Aa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Xp(t,e){return{id:es(e,t),label:a.unref(t.name),tags:Aa(!1,1,t.type,t.meta.valid,e)}}function Aa(t,e,n,r,i){const{textColor:o,bgColor:s}=Da(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ye.black,backgroundColor:Ye.gray},n==="checkbox"?{label:"Checkbox",textColor:Ye.white,backgroundColor:Ye.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ye.white,backgroundColor:Ye.purple}:void 0,t?{label:"Multiple",textColor:Ye.black,backgroundColor:Ye.orange}:void 0].filter(Boolean)}function es(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.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 Qp(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Lr[e.f];if(!n&&e.ff){const i=Ir[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 Va(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 em(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Da(t){return{bgColor:t?Ye.success:Ye.error,textColor:t?Ye.black:Ye.white}}function tm(t,e,n){return _r(n==null?void 0:n.type)?rm(t,e,n):_a(t,e,n)}function _a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=nm(n),g=f?Jo(Dr):void 0,y=m||g,b=a.computed(()=>Vr(a.toValue(t))),w=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const te=a.unref(e);return Ti(te)||bt(te)||Te(te)||Array.isArray(te)?te:Ea(te)}),T=!Te(w.value)&&bt(a.toValue(e)),{id:k,value:M,initialValue:v,meta:A,setState:P,errors:_,flags:B}=Fp(b,{modelValue:r,form:y,bails:o,label:c,type:s,validate:w.value?C:void 0,schema:T?e:void 0}),$=a.computed(()=>_.value[0]);p&&im({value:M,prop:p,handleChange:V,shouldValidate:()=>d&&!B.pendingReset});const q=(R,te=!1)=>{A.touched=!0,te&&L()};async function ee(R){var te,he;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(R);return(te=le[a.toValue(b)])!==null&&te!==void 0?te:{valid:!0,errors:[]}}return w.value?Ma(M.value,w.value,{name:a.toValue(b),label:a.toValue(c),values:(he=y==null?void 0:y.values)!==null&&he!==void 0?he:{},bails:o}):{valid:!0,errors:[]}}const L=Go(async()=>(A.pending=!0,A.validated=!0,ee("validated-only")),R=>(B.pendingUnmount[X.id]||(P({errors:R.errors}),A.pending=!1,A.valid=R.valid),R)),S=Go(async()=>ee("silent"),R=>(A.valid=R.valid,R));function C(R){return(R==null?void 0:R.mode)==="silent"?S():L()}function V(R,te=!0){const he=Bi(R);N(he,te)}a.onMounted(()=>{if(i)return L();(!y||!y.validateSchema)&&S()});function I(R){A.touched=R}function J(R){var te;const he=R&&"value"in R?R.value:v.value;P({value:ge(he),initialValue:ge(he),touched:(te=R==null?void 0:R.touched)!==null&&te!==void 0?te:!1,errors:(R==null?void 0:R.errors)||[]}),A.pending=!1,A.validated=!1,S()}const Z=a.getCurrentInstance();function N(R,te=!0){M.value=Z&&p?Mp(R,Z.props.modelModifiers):R,(te?L:S)()}function D(R){P({errors:Array.isArray(R)?R:[R]})}const j=a.computed({get(){return M.value},set(R){N(R,d)}}),X={id:k,name:b,label:c,value:j,meta:A,errors:_,errorMessage:$,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:J,handleReset:()=>J(),validate:C,handleChange:V,handleBlur:q,setState:P,setTouched:I,setErrors:D,setValue:N};if(a.provide(ga,X),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(R,te)=>{je(R,te)||(A.validated?L():S())},{deep:!0}),process.env.NODE_ENV!=="production"&&(X._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:_.value},A),{value:M.value}),Kn,{deep:!0}),y||Yp(X)),!y)return X;const U=a.computed(()=>{const R=w.value;return!R||Te(R)||Ti(R)||bt(R)||Array.isArray(R)?{}:Object.keys(R).reduce((te,he)=>{const le=Vp(R[he]).map(pe=>pe.__locatorRef).reduce((pe,be)=>{const Me=qe(y.values,be)||y.values[be];return Me!==void 0&&(pe[be]=Me),pe},{});return Object.assign(te,le),te},{})});return a.watch(U,(R,te)=>{if(!Object.keys(R).length)return;!je(R,te)&&(A.validated?L():S())}),a.onBeforeUnmount(()=>{var R;const te=(R=a.toValue(X.keepValueOnUnmount))!==null&&R!==void 0?R:a.toValue(y.keepValuesOnUnmount),he=a.toValue(b);if(te||!y||B.pendingUnmount[X.id]){y==null||y.removePathState(he,k);return}B.pendingUnmount[X.id]=!0;const le=y.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(X.id):(le==null?void 0:le.id)===X.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const be=le.value.findIndex(Me=>je(Me,a.toValue(X.checkedValue)));if(be>-1){const Me=[...le.value];Me.splice(be,1),y.setFieldValue(he,Me)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(X.id),1)}else y.unsetPathValue(a.toValue(b));y.removePathState(he,k)}}),X}function nm(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||{}))?ts(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function rm(t,e,n){const r=n!=null&&n.standalone?void 0:Jo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>je(p,h))>=0:je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),b=Bi(f);let w=(m=a.toValue(i))!==null&&m!==void 0?m:b;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?w=va(qe(r.values,g)||[],w,void 0):(n==null?void 0:n.type)==="checkbox"&&(w=va(a.toValue(l.value),w,a.toValue(o))),c(w,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(_a(t,e,n))}function im({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{je(l,ts(i,o))||i.emit(s,l)}),a.watch(()=>ts(i,o),l=>{if(l===Mi&&e.value===void 0)return;const c=l===Mi?void 0:l;je(c,e.value)||n(c,r())}))}function ts(t,e){if(t)return t.props[e]}const om=a.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:()=>wn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Mi},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=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:b,setErrors:w}=tm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:lm(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),T=function(_,B=!0){f(_,B)},k=a.computed(()=>{const{validateOnInput:P,validateOnChange:_,validateOnBlur:B,validateOnModelUpdate:$}=sm(t);function q(C){h(C,B),Te(e.attrs.onBlur)&&e.attrs.onBlur(C)}function ee(C){T(C,P),Te(e.attrs.onInput)&&e.attrs.onInput(C)}function L(C){T(C,_),Te(e.attrs.onChange)&&e.attrs.onChange(C)}const S={name:t.name,onBlur:q,onInput:ee,onChange:L};return S["onUpdate:modelValue"]=C=>T(C,$),S}),M=a.computed(()=>{const P=Object.assign({},k.value);_r(e.attrs.type)&&b&&(P.checked=b.value);const _=La(t,e);return Ep(_,e.attrs)&&(P.value=c.value),P}),v=a.computed(()=>Object.assign(Object.assign({},k.value),{modelValue:c.value}));function A(){return{field:M.value,componentField:v.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:T,handleInput:P=>T(P,!1),handleReset:g,handleBlur:k.value.onBlur,setTouched:p,setErrors:w}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:w,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const P=a.resolveDynamicComponent(La(t,e)),_=Xo(P,e,A);return P?a.h(P,Object.assign(Object.assign({},e.attrs),M.value),_):_}}});function La(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function sm(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=wn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function lm(t,e){return _r(e.attrs.type)?ka(t,"modelValue")?t.modelValue:void 0:ka(t,"modelValue")?t.modelValue:e.attrs.value}const vn=om;let am=0;const Ai=["bails","fieldsCount","id","multiple","type","validate"];function Ia(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&bt(r)&&Te(r.cast)?ge(r.cast(n)||{}):ge(n)}function cm(t){var e;const n=am++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ia(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=Tp(()=>{f.value=d.value.reduce((O,E)=>(O[Vr(a.toValue(E.path))]=E,O),{})});function p(O,E){const z=C(O);if(!z){typeof O=="string"&&(u.value[Vr(O)]=Zo(E));return}if(typeof O=="string"){const Y=Vr(O);u.value[Y]&&delete u.value[Y]}z.errors=Zo(E),z.valid=!z.errors.length}function m(O){Ke(O).forEach(E=>{p(E,O[E])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const O=d.value.reduce((E,z)=>(z.errors.length&&(E[z.path]=z.errors),E),{});return Object.assign(Object.assign({},u.value),O)}),y=a.computed(()=>Ke(g.value).reduce((O,E)=>{const z=g.value[E];return z!=null&&z.length&&(O[E]=z[0]),O},{})),b=a.computed(()=>d.value.reduce((O,E)=>(O[E.path]={name:E.path||"",label:E.label||""},O),{})),w=a.computed(()=>d.value.reduce((O,E)=>{var z;return O[E.path]=(z=E.bails)!==null&&z!==void 0?z:!0,O},{})),T=Object.assign({},(t==null?void 0:t.initialErrors)||{}),k=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:M,originalInitialValues:v,setInitialValues:A}=um(d,c,t),P=dm(d,c,v,y),_=a.computed(()=>d.value.reduce((O,E)=>{const z=qe(c,E.path);return Lt(O,E.path,z),O},{})),B=t==null?void 0:t.validationSchema;function $(O,E){var z,Y;const oe=a.computed(()=>qe(M.value,a.toValue(O))),x=f.value[a.toValue(O)],W=(E==null?void 0:E.type)==="checkbox"||(E==null?void 0:E.type)==="radio";if(x&&W){x.multiple=!0;const Ue=r++;return Array.isArray(x.id)?x.id.push(Ue):x.id=[x.id,Ue],x.fieldsCount++,x.__flags.pendingUnmount[Ue]=!1,x}const G=a.computed(()=>qe(c,a.toValue(O))),ie=a.toValue(O),se=I.findIndex(Ue=>Ue===ie);se!==-1&&I.splice(se,1);const de=a.computed(()=>{var Ue,st,Un,xn;const _t=a.toValue(B);if(bt(_t))return(st=(Ue=_t.describe)===null||Ue===void 0?void 0:Ue.call(_t,a.toValue(O)).required)!==null&&st!==void 0?st:!1;const Oi=a.toValue(E==null?void 0:E.schema);return bt(Oi)&&(xn=(Un=Oi.describe)===null||Un===void 0?void 0:Un.call(Oi).required)!==null&&xn!==void 0?xn:!1}),me=r++,ve=a.reactive({id:me,path:O,touched:!1,pending:!1,valid:!0,validated:!!(!((z=T[ie])===null||z===void 0)&&z.length),required:de,initialValue:oe,errors:a.shallowRef([]),bails:(Y=E==null?void 0:E.bails)!==null&&Y!==void 0?Y:!1,label:E==null?void 0:E.label,type:(E==null?void 0:E.type)||"default",value:G,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:E==null?void 0:E.validate,dirty:a.computed(()=>!je(a.unref(G),a.unref(oe)))});return d.value.push(ve),f.value[ie]=ve,h(),y.value[ie]&&!T[ie]&&a.nextTick(()=>{mt(ie,{mode:"silent"})}),a.isRef(O)&&a.watch(O,Ue=>{h();const st=ge(G.value);f.value[Ue]=ve,a.nextTick(()=>{Lt(c,Ue,st)})}),ve}const q=Ca(Dt,5),ee=Ca(Dt,5),L=Go(async O=>await(O==="silent"?q():ee()),(O,[E])=>{const z=Ke(R.errorBag.value),oe=[...new Set([...Ke(O.results),...d.value.map(x=>x.path),...z])].sort().reduce((x,W)=>{var G;const ie=W,se=C(ie)||V(ie),de=((G=O.results[ie])===null||G===void 0?void 0:G.errors)||[],me=a.toValue(se==null?void 0:se.path)||ie,ve=fm({errors:de,valid:!de.length},x.results[me]);return x.results[me]=ve,ve.valid||(x.errors[me]=ve.errors[0]),se&&u.value[me]&&delete u.value[me],se?(se.valid=ve.valid,E==="silent"||E==="validated-only"&&!se.validated||p(se,ve.errors),x):(p(me,de),x)},{valid:O.valid,results:{},errors:{}});return O.values&&(oe.values=O.values),Ke(oe.results).forEach(x=>{var W;const G=C(x);G&&E!=="silent"&&(E==="validated-only"&&!G.validated||p(G,(W=oe.results[x])===null||W===void 0?void 0:W.errors))}),oe});function S(O){d.value.forEach(O)}function C(O){const E=typeof O=="string"?Vr(O):O;return typeof E=="string"?f.value[E]:E}function V(O){return d.value.filter(z=>O.startsWith(z.path)).reduce((z,Y)=>z?Y.path.length>z.path.length?Y:z:Y,void 0)}let I=[],J;function Z(O){return I.push(O),J||(J=a.nextTick(()=>{[...I].sort().reverse().forEach(z=>{wa(c,z)}),I=[],J=null})),J}function N(O){return function(z,Y){return function(x){return x instanceof Event&&(x.preventDefault(),x.stopPropagation()),S(W=>W.touched=!0),i.value=!0,s.value++,vt().then(W=>{const G=ge(c);if(W.valid&&typeof z=="function"){const ie=ge(_.value);let se=O?ie:G;return W.values&&(se=W.values),z(se,{evt:x,controlledValues:ie,setErrors:m,setFieldError:p,setTouched:yn,setFieldTouched:be,setValues:le,setFieldValue:te,resetForm:qt,resetField:bn})}!W.valid&&typeof Y=="function"&&Y({values:G,evt:x,errors:W.errors,results:W.results})}).then(W=>(i.value=!1,W),W=>{throw i.value=!1,W})}}}const j=N(!1);j.withControlled=N(!0);function X(O,E){const z=d.value.findIndex(oe=>oe.path===O&&(Array.isArray(oe.id)?oe.id.includes(E):oe.id===E)),Y=d.value[z];if(!(z===-1||!Y)){if(a.nextTick(()=>{mt(O,{mode:"silent",warn:!1})}),Y.multiple&&Y.fieldsCount&&Y.fieldsCount--,Array.isArray(Y.id)){const oe=Y.id.indexOf(E);oe>=0&&Y.id.splice(oe,1),delete Y.__flags.pendingUnmount[E]}(!Y.multiple||Y.fieldsCount<=0)&&(d.value.splice(z,1),gt(O),h(),delete f.value[O])}}function U(O){Ke(f.value).forEach(E=>{E.startsWith(O)&&delete f.value[E]}),d.value=d.value.filter(E=>!E.path.startsWith(O)),a.nextTick(()=>{h()})}const R={formId:n,values:c,controlledValues:_,errorBag:g,errors:y,schema:B,submitCount:s,meta:P,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:k,validateSchema:a.unref(B)?L:void 0,validate:vt,setFieldError:p,validateField:mt,setFieldValue:te,setValues:le,setErrors:m,setFieldTouched:be,setTouched:yn,resetForm:qt,resetField:bn,handleSubmit:j,useFieldModel:$r,defineInputBinds:Nr,defineComponentBinds:Br,defineField:kn,stageInitialValue:Vt,unsetInitialValue:gt,setFieldInitialValue:Kt,createPathState:$,getPathState:C,unsetPathValue:Z,removePathState:X,initialValues:M,getAllPathStates:()=>d.value,destroyPath:U,isFieldTouched:Me,isFieldDirty:pt,isFieldValid:Tr};function te(O,E,z=!0){const Y=ge(E),oe=typeof O=="string"?O:O.path;C(oe)||$(oe),Lt(c,oe,Y),z&&mt(oe)}function he(O,E=!0){Ke(c).forEach(z=>{delete c[z]}),Ke(O).forEach(z=>{te(z,O[z],!1)}),E&&vt()}function le(O,E=!0){Ar(c,O),l.forEach(z=>z&&z.reset()),E&&vt()}function pe(O,E){const z=C(a.toValue(O))||$(O);return a.computed({get(){return z.value},set(Y){var oe;const x=a.toValue(O);te(x,Y,(oe=a.toValue(E))!==null&&oe!==void 0?oe:!1)}})}function be(O,E){const z=C(O);z&&(z.touched=E)}function Me(O){const E=C(O);return E?E.touched:d.value.filter(z=>z.path.startsWith(O)).some(z=>z.touched)}function pt(O){const E=C(O);return E?E.dirty:d.value.filter(z=>z.path.startsWith(O)).some(z=>z.dirty)}function Tr(O){const E=C(O);return E?E.valid:d.value.filter(z=>z.path.startsWith(O)).every(z=>z.valid)}function yn(O){if(typeof O=="boolean"){S(E=>{E.touched=O});return}Ke(O).forEach(E=>{be(E,!!O[E])})}function bn(O,E){var z;const Y=E&&"value"in E?E.value:qe(M.value,O),oe=C(O);oe&&(oe.__flags.pendingReset=!0),Kt(O,ge(Y),!0),te(O,Y,!1),be(O,(z=E==null?void 0:E.touched)!==null&&z!==void 0?z:!1),p(O,(E==null?void 0:E.errors)||[]),a.nextTick(()=>{oe&&(oe.__flags.pendingReset=!1)})}function qt(O,E){let z=ge(O!=null&&O.values?O.values:v.value);z=E!=null&&E.force?z:Ar(v.value,z),z=bt(B)&&Te(B.cast)?B.cast(z):z,A(z),S(Y=>{var oe;Y.__flags.pendingReset=!0,Y.validated=!1,Y.touched=((oe=O==null?void 0:O.touched)===null||oe===void 0?void 0:oe[Y.path])||!1,te(Y.path,qe(z,Y.path),!1),p(Y.path,void 0)}),E!=null&&E.force?he(z,!1):le(z,!1),m((O==null?void 0:O.errors)||{}),s.value=(O==null?void 0:O.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),S(Y=>{Y.__flags.pendingReset=!1})})}async function vt(O){const E=(O==null?void 0:O.mode)||"force";if(E==="force"&&S(x=>x.validated=!0),R.validateSchema)return R.validateSchema(E);o.value=!0;const z=await Promise.all(d.value.map(x=>x.validate?x.validate(O).then(W=>({key:x.path,valid:W.valid,errors:W.errors})):Promise.resolve({key:x.path,valid:!0,errors:[]})));o.value=!1;const Y={},oe={};for(const x of z)Y[x.key]={valid:x.valid,errors:x.errors},x.errors.length&&(oe[x.key]=x.errors[0]);return{valid:z.every(x=>x.valid),results:Y,errors:oe}}async function mt(O,E){var z;const Y=C(O);if(Y&&(E==null?void 0:E.mode)!=="silent"&&(Y.validated=!0),B){const{results:x}=await L((E==null?void 0:E.mode)||"validated-only");return x[O]||{errors:[],valid:!0}}return Y!=null&&Y.validate?Y.validate(E):(!Y&&((z=E==null?void 0:E.warn)!==null&&z!==void 0?z:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${O} was not found`),Promise.resolve({errors:[],valid:!0}))}function gt(O){wa(M.value,O)}function Vt(O,E,z=!1){Kt(O,E),Lt(c,O,E),z&&!(t!=null&&t.initialValues)&&Lt(v.value,O,ge(E))}function Kt(O,E,z=!1){Lt(M.value,O,ge(E)),z&&Lt(v.value,O,ge(E))}async function Dt(){const O=a.unref(B);if(!O)return{valid:!0,results:{},errors:{}};o.value=!0;const E=Ti(O)||bt(O)?await zp(O,c):await jp(O,c,{names:b.value,bailsMap:w.value});return o.value=!1,E}const Wn=j((O,{evt:E})=>{ba(E)&&E.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&yn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}R.validateSchema&&R.validateSchema("silent")}),a.isRef(B)&&a.watch(B,()=>{var O;(O=R.validateSchema)===null||O===void 0||O.call(R,"validated-only")}),a.provide(Dr,R),process.env.NODE_ENV!=="production"&&(Kp(R),a.watch(()=>Object.assign(Object.assign({errors:g.value},P.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Kn,{deep:!0}));function kn(O,E){const z=Te(E)||E==null?void 0:E.label,Y=C(a.toValue(O))||$(O,{label:z}),oe=()=>Te(E)?E(Ni(Y,Ai)):E||{};function x(){var de;Y.touched=!0,((de=oe().validateOnBlur)!==null&&de!==void 0?de:wn().validateOnBlur)&&mt(Y.path)}function W(){var de;((de=oe().validateOnInput)!==null&&de!==void 0?de:wn().validateOnInput)&&a.nextTick(()=>{mt(Y.path)})}function G(){var de;((de=oe().validateOnChange)!==null&&de!==void 0?de:wn().validateOnChange)&&a.nextTick(()=>{mt(Y.path)})}const ie=a.computed(()=>{const de={onChange:G,onInput:W,onBlur:x};return Te(E)?Object.assign(Object.assign({},de),E(Ni(Y,Ai)).props||{}):E!=null&&E.props?Object.assign(Object.assign({},de),E.props(Ni(Y,Ai))):de});return[pe(O,()=>{var de,me,ve;return(ve=(de=oe().validateOnModelUpdate)!==null&&de!==void 0?de:(me=wn())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),ie]}function $r(O){return Array.isArray(O)?O.map(E=>pe(E,!0)):pe(O)}function Nr(O,E){const[z,Y]=kn(O,E);function oe(){Y.value.onBlur()}function x(G){const ie=Bi(G);te(a.toValue(O),ie,!1),Y.value.onInput()}function W(G){const ie=Bi(G);te(a.toValue(O),ie,!1),Y.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},Y.value),{onBlur:oe,onInput:x,onChange:W,value:z.value}))}function Br(O,E){const[z,Y]=kn(O,E),oe=C(a.toValue(O));function x(W){z.value=W}return a.computed(()=>{const W=Te(E)?E(Ni(oe,Ai)):E||{};return Object.assign({[W.model||"modelValue"]:z.value,[`onUpdate:${W.model||"modelValue"}`]:x},Y.value)})}return Object.assign(Object.assign({},R),{values:a.readonly(c),handleReset:()=>qt(),submitForm:Wn})}function dm(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!je(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function um(t,e,n){const r=Ia(n),i=a.ref(r),o=a.ref(ge(r));function s(l,c=!1){i.value=Ar(ge(i.value)||{},ge(l)),o.value=Ar(ge(o.value)||{},ge(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=qe(i.value,d.path);Lt(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function fm(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const hm=a.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=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:b,setFieldError:w,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:v,resetField:A}=cm({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),P=y((C,{evt:V})=>{ba(V)&&V.target.submit()},t.onInvalidSubmit),_=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):P;function B(C){qo(C)&&C.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function $(C,V){return y(typeof C=="function"&&!V?C:V,t.onInvalidSubmit)(C)}function q(){return ge(s)}function ee(){return ge(l.value)}function L(){return ge(i.value)}function S(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:$,handleReset:m,submitForm:P,setErrors:b,setFieldError:w,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:v,resetForm:g,resetField:A,getValues:q,getMeta:ee,getErrors:L}}return e.expose({setFieldError:w,setErrors:b,setFieldValue:T,setValues:k,setFieldTouched:M,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:A,getValues:q,getMeta:ee,getErrors:L,values:s,meta:l,errors:i}),function(){const V=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,I=Xo(V,e,S);if(!V)return I;const J=V==="form"?{novalidate:!0}:{};return a.h(V,Object.assign(Object.assign(Object.assign({},J),e.attrs),{onSubmit:_,onReset:B}),I)}}}),pm=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=Xo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function mm(t){const e=Jo(Dr),n=t?void 0:a.inject(ga);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}yt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),yt("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"}),yt("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"),yt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),yt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),yt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),yt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),yt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),yt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),yt("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"}),yt("number",t=>parseFloat(t)?!0:"This field must be a number");const ae=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},gm={},ym={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},bm=[a.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 km(t,e){return a.openBlock(),a.createElementBlock("svg",ym,bm)}const xm=ae(gm,[["render",km]]),wm={},vm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Cm=[a.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 Sm(t,e){return a.openBlock(),a.createElementBlock("svg",vm,Cm)}const Em=ae(wm,[["render",Sm]]),Om={class:"relative"},Jn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",Om,[a.createVNode(xm,{class:"absolute opacity-25"}),a.createVNode(Em,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ne={theme:"wpic-tools",popoverTarget:"body"};const Mm=["is","type","disabled"],Tm={key:0,class:"absolute inset-0 flex justify-center items-center"},$m={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},Nm=["onClick"],Pr=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=b=>{r.value&&!r.value.contains(b.target)&&n.value&&!n.value.contains(b.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"bg-transparent text-gray-700 disabled:text-gray-700/50 enabled:hover:bg-gray-900/5 enabled:active:bg-gray-200 enabled:active:shadow-inner dark:enabled:border-gray-900 dark:text-gray-400 dark:enabled:hover:bg-gray-900 dark:enabled:active:bg-gray-930 dark:disabled:text-gray-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={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":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={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":"border-none! bg-linear-to-b bg-gray-400 text-white disabled:text-white/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-gray-300 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-gray-800 dark:enabled:active:shadow-inner dark:enabled:hover:bg-gray-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(b,w)=>{var T;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:w[0]||(w[0]=k=>{var M;return(M=t.actions)!=null&&M.length?i.value=!i.value:null}),class:a.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&&!t.hideDisabled,border:t.outline&&!t.plain,[`${l[a.unref(ne).theme]}`]:!0,[`${u[a.unref(ne).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(ne).theme]}`]:t.secondary,[`${p[a.unref(ne).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(ne).theme]}`]:t.primary&&t.plain,[`${y[a.unref(ne).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(ne).theme]}`]:t.colorless,[`${h[a.unref(ne).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(ne).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(ne).theme]}`]:t.destructive&&t.colorless,"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,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",Tm,[a.createVNode(Jn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(T=t.actions)!=null&&T.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",$m,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,k=>(a.openBlock(),a.createElementBlock("div",{onClick:k.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(k.label),9,Nm))),256))])],512)):a.createCommentVNode("",!0)],10,Mm)}}}),Bm=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(ne).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),Am={name:"WpicInputGroup"},Vm={class:"wpic-input-group flex w-full"};function Dm(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",Vm,[a.renderSlot(t.$slots,"default")])}const _m=ae(Am,[["render",Dm]]),Lm=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(hm),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Gn=Math.max,Vi=Math.round,Gt=t=>({x:t,y:t}),Im={left:"right",right:"left",bottom:"top",top:"bottom"},Pm={start:"end",end:"start"};function ns(t,e,n){return Gn(t,Rr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function Pa(t){return t==="x"?"y":"x"}function rs(t){return t==="y"?"height":"width"}function Di(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function is(t){return Pa(Di(t))}function Rm(t,e,n){n===void 0&&(n=!1);const r=jr(t),i=is(t),o=rs(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_i(s)),[s,_i(s)]}function zm(t){const e=_i(t);return[ss(t),e,ss(e)]}function ss(t){return t.replace(/start|end/g,e=>Pm[e])}function jm(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Fm(t,e,n,r){const i=jr(t);let o=jm(Cn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ss)))),o}function _i(t){return t.replace(/left|right|bottom|top/g,e=>Im[e])}function Hm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ra(t){return typeof t!="number"?Hm(t):{top:t,right:t,bottom:t,left:t}}function Li(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 za(t,e,n){let{reference:r,floating:i}=t;const o=Di(e),s=is(e),l=rs(s),c=Cn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){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(jr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Wm=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=za(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:w,y:T,data:k,reset:M}=await b({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=w??u,f=T??f,p={...p,[y]:{...p[y],...k}},M&&m<=50&&(m++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(d=M.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):M.rects),{x:u,y:f}=za(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ja(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zr(e,t),m=Ra(p),y=l[h?f==="floating"?"reference":"floating":f],b=Li(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),w=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},M=Li(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:T,strategy:c}):w);return{top:(b.top-M.top+m.top)/k.y,bottom:(M.bottom-b.bottom+m.bottom)/k.y,left:(b.left-M.left+m.left)/k.x,right:(M.right-b.right+m.right)/k.x}}const Um=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=zr(t,e)||{};if(d==null)return{};const f=Ra(u),h={x:n,y:r},p=is(i),m=rs(p),g=await s.getDimensions(d),y=p==="y",b=y?"top":"left",w=y?"bottom":"right",T=y?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-h[p]-o.floating[m],M=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let A=v?v[T]:0;(!A||!await(s.isElement==null?void 0:s.isElement(v)))&&(A=l.floating[T]||o.floating[m]);const P=k/2-M/2,_=A/2-g[m]/2-1,B=Rr(f[b],_),$=Rr(f[w],_),q=B,ee=A-g[m]-$,L=A/2-g[m]/2+P,S=ns(q,L,ee),C=!c.arrow&&jr(i)!=null&&L!==S&&o.reference[m]/2-(L<q?B:$)-g[m]/2<0,V=C?L<q?L-q:L-ee:0;return{[p]:h[p]+V,data:{[p]:S,centerOffset:L-S-V,...C&&{alignmentOffset:V}},reset:C}}}),qm=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=zr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Cn(i),w=Cn(l)===l,T=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=h||(w||!g?[_i(l)]:zm(l));!h&&m!=="none"&&k.push(...Fm(l,g,m,T));const M=[l,...k],v=await ja(e,y),A=[];let P=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(v[b]),f){const q=Rm(i,s,T);A.push(v[q[0]],v[q[1]])}if(P=[...P,{placement:i,overflows:A}],!A.every(q=>q<=0)){var _,B;const q=(((_=o.flip)==null?void 0:_.index)||0)+1,ee=M[q];if(ee)return{data:{index:q,overflows:P},reset:{placement:ee}};let L=(B=P.filter(S=>S.overflows[0]<=0).sort((S,C)=>S.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!L)switch(p){case"bestFit":{var $;const S=($=P.map(C=>[C.placement,C.overflows.filter(V=>V>0).reduce((V,I)=>V+I,0)]).sort((C,V)=>C[1]-V[1])[0])==null?void 0:$[0];S&&(L=S);break}case"initialPlacement":L=l;break}if(i!==L)return{reset:{placement:L}}}return{}}}};async function Km(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Cn(n),l=jr(n),c=Di(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=zr(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 l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Ym=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Km(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Jm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=zr(t,e),d={x:n,y:r},u=await ja(e,c),f=Di(Cn(i)),h=Pa(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=p+u[y],T=p-u[b];p=ns(w,p,T)}if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=m+u[y],T=m-u[b];m=ns(w,m,T)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function Sn(t){return ls(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zt(t){var e;return(e=(ls(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ls(t){return t instanceof Node||t instanceof Qe(t).Node}function Ct(t){return t instanceof Element||t instanceof Qe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function Fa(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Gm(t){return["table","td","th"].includes(Sn(t))}function as(t){const e=cs(),n=kt(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 Zm(t){let e=Xt(t);for(;St(e)&&!Zn(e);){if(as(e))return e;e=Xt(e)}return null}function cs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(t){return["html","body","#document"].includes(Sn(t))}function kt(t){return Qe(t).getComputedStyle(t)}function Ii(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xt(t){if(Sn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||Zt(t);return Fa(e)?e.host:e}function Ha(t){const e=Xt(t);return Zn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Ha(e)}function ds(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ha(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?ds(s.frameElement):[]):e.concat(i,ds(i,[],n))}function Wa(t){const e=kt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Vi(n)!==o||Vi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ua(t){return Ct(t)?t:t.contextElement}function Xn(t){const e=Ua(t);if(!St(e))return Gt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wa(e);let s=(o?Vi(n.width):n.width)/r,l=(o?Vi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xm=Gt(0);function qa(t){const e=Qe(t);return!cs()||!e.visualViewport?Xm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qm(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ua(t);let s=Gt(1);e&&(r?Ct(r)&&(s=Xn(r)):s=Xn(t));const l=Qm(o,n,r)?qa(o):Gt(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Qe(o),p=r&&Ct(r)?Qe(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Xn(g),b=g.getBoundingClientRect(),w=kt(g),T=b.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,k=b.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=T,d+=k,m=Qe(g),g=m.frameElement}}return Li({width:u,height:f,x:c,y:d})}const eg=[":popover-open",":modal"];function us(t){return eg.some(e=>{try{return t.matches(e)}catch{return!1}})}function tg(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Zt(r),l=e?us(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=St(r);if((f||!f&&!o)&&((Sn(r)!=="body"||Fr(s))&&(c=Ii(r)),St(r))){const h=Hr(r);d=Xn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function ng(t){return Array.from(t.getClientRects())}function Ka(t){return Hr(Zt(t)).left+Ii(t).scrollLeft}function rg(t){const e=Zt(t),n=Ii(t),r=t.ownerDocument.body,i=Gn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(t);const l=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=Gn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function ig(t,e){const n=Qe(t),r=Zt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=cs();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function og(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Xn(t):Gt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function Ya(t,e,n){let r;if(e==="viewport")r=ig(t,n);else if(e==="document")r=rg(Zt(t));else if(Ct(e))r=og(e,n);else{const i=qa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Li(r)}function Ja(t,e){const n=Xt(t);return n===e||!Ct(n)||Zn(n)?!1:kt(n).position==="fixed"||Ja(n,e)}function sg(t,e){const n=e.get(t);if(n)return n;let r=ds(t,[],!1).filter(l=>Ct(l)&&Sn(l)!=="body"),i=null;const o=kt(t).position==="fixed";let s=o?Xt(t):t;for(;Ct(s)&&!Zn(s);){const l=kt(s),c=as(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ja(t,s))?r=r.filter(u=>u!==s):i=l,s=Xt(s)}return e.set(t,r),r}function lg(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?us(e)?[]:sg(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=Ya(e,u,i);return d.top=Gn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Gn(f.left,d.left),d},Ya(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ag(t){const{width:e,height:n}=Wa(t);return{width:e,height:n}}function cg(t,e,n){const r=St(e),i=Zt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);if(r||!r&&!o)if((Sn(e)!=="body"||Fr(i))&&(l=Ii(e)),r){const f=Hr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Ka(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function fs(t){return kt(t).position==="static"}function Ga(t,e){return!St(t)||kt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Za(t,e){const n=Qe(t);if(us(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!Zn(i);){if(Ct(i)&&!fs(i))return i;i=Xt(i)}return n}let r=Ga(t,e);for(;r&&Gm(r)&&fs(r);)r=Ga(r,e);return r&&Zn(r)&&fs(r)&&!as(r)?n:r||Zm(t)||n}const dg=async function(t){const e=this.getOffsetParent||Za,n=this.getDimensions,r=await n(t.floating);return{reference:cg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ug(t){return kt(t).direction==="rtl"}const fg={convertOffsetParentRelativeRectToViewportRelativeRect:tg,getDocumentElement:Zt,getClippingRect:lg,getOffsetParent:Za,getElementRects:dg,getClientRects:ng,getDimensions:ag,getScale:Xn,isElement:Ct,isRTL:ug},Xa=Ym,Qa=Jm,ec=qm,hg=Um,tc=(t,e,n)=>{const r=new Map,i={platform:fg,...n},o={...i.platform,_c:r};return Wm(t,e,{...i,platform:o})};function pg(t){return t!=null&&typeof t=="object"&&"$el"in t}function mg(t){if(pg(t)){const e=t.$el;return ls(e)&&Sn(e)==="#comment"?null:e}return t}function gg(t){return{name:"arrow",options:t,fn(e){const n=mg(a.unref(t.element));return n==null?{}:hg({element:n,padding:t.padding}).fn(e)}}}const yg={},bg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function xg(t,e){return a.openBlock(),a.createElementBlock("svg",bg,kg)}const Wr=ae(yg,[["render",xg]]);let Pi;const wg=new Uint8Array(16);function vg(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(wg)}const Ve=[];for(let t=0;t<256;++t)Ve.push((t+256).toString(16).slice(1));function Cg(t,e=0){return Ve[t[e+0]]+Ve[t[e+1]]+Ve[t[e+2]]+Ve[t[e+3]]+"-"+Ve[t[e+4]]+Ve[t[e+5]]+"-"+Ve[t[e+6]]+Ve[t[e+7]]+"-"+Ve[t[e+8]]+Ve[t[e+9]]+"-"+Ve[t[e+10]]+Ve[t[e+11]]+Ve[t[e+12]]+Ve[t[e+13]]+Ve[t[e+14]]+Ve[t[e+15]]}const nc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hs(t,e,n){if(nc.randomUUID&&!t)return nc.randomUUID();t=t||{};const r=t.random||(t.rng||vg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Cg(r)}let Sg={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)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const En=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=hs(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(b){if(d.value)u();else{if(o.noCloseClasses.some(w=>b.target.closest(`.${w}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const b=await tc(l.value,c.value,{placement:o.placement,middleware:[ec(),Qa(),Xa(o.offset)]});c.value.style.left=`${b.x}px`,c.value.style.top=`${b.y}px`}const m=b=>{c.value&&!c.value.contains(b.target)&&l.value&&!l.value.contains(b.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",b=>{b.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(b,w)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:g,onMouseleave:y,onClick:w[0]||(w[0]=a.withModifiers(T=>f(T),["stop"]))},[a.renderSlot(b.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(ne).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(ne).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(b.$slots,"content")],6))],8,["to"]))],64))}}),Eg={},Og={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Mg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function Tg(t,e){return a.openBlock(),a.createElementBlock("svg",Og,Mg)}const rc=ae(Eg,[["render",Tg]]),$g={},Ng={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Bg=[a.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 Ag(t,e){return a.openBlock(),a.createElementBlock("svg",Ng,Bg)}const ps=ae($g,[["render",Ag]]),Vg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},Dg={class:"flex items-center gap-2"},_g={key:0},Lg={class:""},Ig={class:"flex justify-end"},Pg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},Rg={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},zg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Ur=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",Vg,[a.createElementVNode("div",Dg,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",_g,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Lg,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ig,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(ne).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(ne).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Pg,[a.createElementVNode("div",Rg,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",zg,[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=jg,Fg=typeof On=="object"&&On&&On.Object===Object&&On,ic=Fg,Hg=ic,Wg=typeof self=="object"&&self&&self.Object===Object&&self,Ug=Hg||Wg||Function("return this")(),Et=Ug,qg=Et,Kg=function(){return qg.Date.now()},Yg=Kg,Jg=/\s/;function Gg(t){for(var e=t.length;e--&&Jg.test(t.charAt(e)););return e}var Zg=Gg,Xg=Zg,Qg=/^\s+/;function e0(t){return t&&t.slice(0,Xg(t)+1).replace(Qg,"")}var t0=e0,n0=Et,r0=n0.Symbol,ms=r0,oc=ms,sc=Object.prototype,i0=sc.hasOwnProperty,o0=sc.toString,Kr=oc?oc.toStringTag:void 0;function s0(t){var e=i0.call(t,Kr),n=t[Kr];try{t[Kr]=void 0;var r=!0}catch{}var i=o0.call(t);return r&&(e?t[Kr]=n:delete t[Kr]),i}var l0=s0,a0=Object.prototype,c0=a0.toString;function d0(t){return c0.call(t)}var u0=d0,lc=ms,f0=l0,h0=u0,p0="[object Null]",m0="[object Undefined]",ac=lc?lc.toStringTag:void 0;function g0(t){return t==null?t===void 0?m0:p0:ac&&ac in Object(t)?f0(t):h0(t)}var Yr=g0;function y0(t){return t!=null&&typeof t=="object"}var Jr=y0,b0=Yr,k0=Jr,x0="[object Symbol]";function w0(t){return typeof t=="symbol"||k0(t)&&b0(t)==x0}var v0=w0,C0=t0,cc=Ri,S0=v0,dc=NaN,E0=/^[-+]0x[0-9a-f]+$/i,O0=/^0b[01]+$/i,M0=/^0o[0-7]+$/i,T0=parseInt;function $0(t){if(typeof t=="number")return t;if(S0(t))return dc;if(cc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=C0(t);var n=O0.test(t);return n||M0.test(t)?T0(t.slice(2),n?2:8):E0.test(t)?dc:+t}var N0=$0,B0=Ri,gs=Yg,uc=N0,A0="Expected a function",V0=Math.max,D0=Math.min;function _0(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(A0);e=uc(e)||0,B0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?V0(uc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var A=r,P=i;return r=i=void 0,d=v,s=t.apply(P,A),s}function m(v){return d=v,l=setTimeout(b,e),u?p(v):s}function g(v){var A=v-c,P=v-d,_=e-A;return f?D0(_,o-P):_}function y(v){var A=v-c,P=v-d;return c===void 0||A>=e||A<0||f&&P>=o}function b(){var v=gs();if(y(v))return w(v);l=setTimeout(b,g(v))}function w(v){return l=void 0,h&&r?p(v):(r=i=void 0,s)}function T(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function k(){return l===void 0?s:w(gs())}function M(){var v=gs(),A=y(v);if(r=arguments,i=this,c=v,A){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),s}return M.cancel=T,M.flush=k,M}var L0=_0;const fc=qr(L0);function I0(){this.__data__=[],this.size=0}var P0=I0;function R0(t,e){return t===e||t!==t&&e!==e}var hc=R0,z0=hc;function j0(t,e){for(var n=t.length;n--;)if(z0(t[n][0],e))return n;return-1}var zi=j0,F0=zi,H0=Array.prototype,W0=H0.splice;function U0(t){var e=this.__data__,n=F0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():W0.call(e,n,1),--this.size,!0}var q0=U0,K0=zi;function Y0(t){var e=this.__data__,n=K0(e,t);return n<0?void 0:e[n][1]}var J0=Y0,G0=zi;function Z0(t){return G0(this.__data__,t)>-1}var X0=Z0,Q0=zi;function ey(t,e){var n=this.__data__,r=Q0(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ty=ey,ny=P0,ry=q0,iy=J0,oy=X0,sy=ty;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=ny,Qn.prototype.delete=ry,Qn.prototype.get=iy,Qn.prototype.has=oy,Qn.prototype.set=sy;var ji=Qn,ly=ji;function ay(){this.__data__=new ly,this.size=0}var cy=ay;function dy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var uy=dy;function fy(t){return this.__data__.get(t)}var hy=fy;function py(t){return this.__data__.has(t)}var my=py,gy=Yr,yy=Ri,by="[object AsyncFunction]",ky="[object Function]",xy="[object GeneratorFunction]",wy="[object Proxy]";function vy(t){if(!yy(t))return!1;var e=gy(t);return e==ky||e==xy||e==by||e==wy}var pc=vy,Cy=Et,Sy=Cy["__core-js_shared__"],Ey=Sy,ys=Ey,mc=function(){var t=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Oy(t){return!!mc&&mc in t}var My=Oy,Ty=Function.prototype,$y=Ty.toString;function Ny(t){if(t!=null){try{return $y.call(t)}catch{}try{return t+""}catch{}}return""}var gc=Ny,By=pc,Ay=My,Vy=Ri,Dy=gc,_y=/[\\^$.*+?()[\]{}|]/g,Ly=/^\[object .+?Constructor\]$/,Iy=Function.prototype,Py=Object.prototype,Ry=Iy.toString,zy=Py.hasOwnProperty,jy=RegExp("^"+Ry.call(zy).replace(_y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fy(t){if(!Vy(t)||Ay(t))return!1;var e=By(t)?jy:Ly;return e.test(Dy(t))}var Hy=Fy;function Wy(t,e){return t==null?void 0:t[e]}var Uy=Wy,qy=Hy,Ky=Uy;function Yy(t,e){var n=Ky(t,e);return qy(n)?n:void 0}var er=Yy,Jy=er,Gy=Et,Zy=Jy(Gy,"Map"),bs=Zy,Xy=er,Qy=Xy(Object,"create"),Fi=Qy,yc=Fi;function e1(){this.__data__=yc?yc(null):{},this.size=0}var t1=e1;function n1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var r1=n1,i1=Fi,o1="__lodash_hash_undefined__",s1=Object.prototype,l1=s1.hasOwnProperty;function a1(t){var e=this.__data__;if(i1){var n=e[t];return n===o1?void 0:n}return l1.call(e,t)?e[t]:void 0}var c1=a1,d1=Fi,u1=Object.prototype,f1=u1.hasOwnProperty;function h1(t){var e=this.__data__;return d1?e[t]!==void 0:f1.call(e,t)}var p1=h1,m1=Fi,g1="__lodash_hash_undefined__";function y1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=m1&&e===void 0?g1:e,this}var b1=y1,k1=t1,x1=r1,w1=c1,v1=p1,C1=b1;function tr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}tr.prototype.clear=k1,tr.prototype.delete=x1,tr.prototype.get=w1,tr.prototype.has=v1,tr.prototype.set=C1;var S1=tr,bc=S1,E1=ji,O1=bs;function M1(){this.size=0,this.__data__={hash:new bc,map:new(O1||E1),string:new bc}}var T1=M1;function $1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var N1=$1,B1=N1;function A1(t,e){var n=t.__data__;return B1(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Hi=A1,V1=Hi;function D1(t){var e=V1(this,t).delete(t);return this.size-=e?1:0,e}var _1=D1,L1=Hi;function I1(t){return L1(this,t).get(t)}var P1=I1,R1=Hi;function z1(t){return R1(this,t).has(t)}var j1=z1,F1=Hi;function H1(t,e){var n=F1(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var W1=H1,U1=T1,q1=_1,K1=P1,Y1=j1,J1=W1;function nr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=U1,nr.prototype.delete=q1,nr.prototype.get=K1,nr.prototype.has=Y1,nr.prototype.set=J1;var kc=nr,G1=ji,Z1=bs,X1=kc,Q1=200;function eb(t,e){var n=this.__data__;if(n instanceof G1){var r=n.__data__;if(!Z1||r.length<Q1-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new X1(r)}return n.set(t,e),this.size=n.size,this}var tb=eb,nb=ji,rb=cy,ib=uy,ob=hy,sb=my,lb=tb;function rr(t){var e=this.__data__=new nb(t);this.size=e.size}rr.prototype.clear=rb,rr.prototype.delete=ib,rr.prototype.get=ob,rr.prototype.has=sb,rr.prototype.set=lb;var ab=rr,cb="__lodash_hash_undefined__";function db(t){return this.__data__.set(t,cb),this}var ub=db;function fb(t){return this.__data__.has(t)}var hb=fb,pb=kc,mb=ub,gb=hb;function Wi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new pb;++e<n;)this.add(t[e])}Wi.prototype.add=Wi.prototype.push=mb,Wi.prototype.has=gb;var yb=Wi;function bb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var kb=bb;function xb(t,e){return t.has(e)}var wb=xb,vb=yb,Cb=kb,Sb=wb,Eb=1,Ob=2;function Mb(t,e,n,r,i,o){var s=n&Eb,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Ob?new vb:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!Cb(e,function(b,w){if(!Sb(p,w)&&(m===b||i(m,b,n,r,o)))return p.push(w)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var xc=Mb,Tb=Et,$b=Tb.Uint8Array,Nb=$b;function Bb(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Ab=Bb;function Vb(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Db=Vb,wc=ms,vc=Nb,_b=hc,Lb=xc,Ib=Ab,Pb=Db,Rb=1,zb=2,jb="[object Boolean]",Fb="[object Date]",Hb="[object Error]",Wb="[object Map]",Ub="[object Number]",qb="[object RegExp]",Kb="[object Set]",Yb="[object String]",Jb="[object Symbol]",Gb="[object ArrayBuffer]",Zb="[object DataView]",Cc=wc?wc.prototype:void 0,ks=Cc?Cc.valueOf:void 0;function Xb(t,e,n,r,i,o,s){switch(n){case Zb:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Gb:return!(t.byteLength!=e.byteLength||!o(new vc(t),new vc(e)));case jb:case Fb:case Ub:return _b(+t,+e);case Hb:return t.name==e.name&&t.message==e.message;case qb:case Yb:return t==e+"";case Wb:var l=Ib;case Kb:var c=r&Rb;if(l||(l=Pb),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=zb,s.set(t,e);var u=Lb(l(t),l(e),r,i,o,s);return s.delete(t),u;case Jb:if(ks)return ks.call(t)==ks.call(e)}return!1}var Qb=Xb;function e2(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var t2=e2,n2=Array.isArray,xs=n2,r2=t2,i2=xs;function o2(t,e,n){var r=e(t);return i2(t)?r:r2(r,n(t))}var s2=o2;function l2(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var a2=l2;function c2(){return[]}var d2=c2,u2=a2,f2=d2,h2=Object.prototype,p2=h2.propertyIsEnumerable,Sc=Object.getOwnPropertySymbols,m2=Sc?function(t){return t==null?[]:(t=Object(t),u2(Sc(t),function(e){return p2.call(t,e)}))}:f2,g2=m2;function y2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var b2=y2,k2=Yr,x2=Jr,w2="[object Arguments]";function v2(t){return x2(t)&&k2(t)==w2}var C2=v2,Ec=C2,S2=Jr,Oc=Object.prototype,E2=Oc.hasOwnProperty,O2=Oc.propertyIsEnumerable,M2=Ec(function(){return arguments}())?Ec:function(t){return S2(t)&&E2.call(t,"callee")&&!O2.call(t,"callee")},T2=M2,Ui={exports:{}};function $2(){return!1}var N2=$2;Ui.exports,function(t,e){var n=Et,r=N2,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Ui,Ui.exports);var Mc=Ui.exports,B2=9007199254740991,A2=/^(?:0|[1-9]\d*)$/;function V2(t,e){var n=typeof t;return e=e??B2,!!e&&(n=="number"||n!="symbol"&&A2.test(t))&&t>-1&&t%1==0&&t<e}var D2=V2,_2=9007199254740991;function L2(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_2}var Tc=L2,I2=Yr,P2=Tc,R2=Jr,z2="[object Arguments]",j2="[object Array]",F2="[object Boolean]",H2="[object Date]",W2="[object Error]",U2="[object Function]",q2="[object Map]",K2="[object Number]",Y2="[object Object]",J2="[object RegExp]",G2="[object Set]",Z2="[object String]",X2="[object WeakMap]",Q2="[object ArrayBuffer]",ek="[object DataView]",tk="[object Float32Array]",nk="[object Float64Array]",rk="[object Int8Array]",ik="[object Int16Array]",ok="[object Int32Array]",sk="[object Uint8Array]",lk="[object Uint8ClampedArray]",ak="[object Uint16Array]",ck="[object Uint32Array]",ke={};ke[tk]=ke[nk]=ke[rk]=ke[ik]=ke[ok]=ke[sk]=ke[lk]=ke[ak]=ke[ck]=!0,ke[z2]=ke[j2]=ke[Q2]=ke[F2]=ke[ek]=ke[H2]=ke[W2]=ke[U2]=ke[q2]=ke[K2]=ke[Y2]=ke[J2]=ke[G2]=ke[Z2]=ke[X2]=!1;function dk(t){return R2(t)&&P2(t.length)&&!!ke[I2(t)]}var uk=dk;function fk(t){return function(e){return t(e)}}var hk=fk,qi={exports:{}};qi.exports,function(t,e){var n=ic,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var pk=qi.exports,mk=uk,gk=hk,$c=pk,Nc=$c&&$c.isTypedArray,yk=Nc?gk(Nc):mk,Bc=yk,bk=b2,kk=T2,xk=xs,wk=Mc,vk=D2,Ck=Bc,Sk=Object.prototype,Ek=Sk.hasOwnProperty;function Ok(t,e){var n=xk(t),r=!n&&kk(t),i=!n&&!r&&wk(t),o=!n&&!r&&!i&&Ck(t),s=n||r||i||o,l=s?bk(t.length,String):[],c=l.length;for(var d in t)(e||Ek.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||vk(d,c)))&&l.push(d);return l}var Mk=Ok,Tk=Object.prototype;function $k(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Tk;return t===n}var Nk=$k;function Bk(t,e){return function(n){return t(e(n))}}var Ak=Bk,Vk=Ak,Dk=Vk(Object.keys,Object),_k=Dk,Lk=Nk,Ik=_k,Pk=Object.prototype,Rk=Pk.hasOwnProperty;function zk(t){if(!Lk(t))return Ik(t);var e=[];for(var n in Object(t))Rk.call(t,n)&&n!="constructor"&&e.push(n);return e}var jk=zk,Fk=pc,Hk=Tc;function Wk(t){return t!=null&&Hk(t.length)&&!Fk(t)}var Uk=Wk,qk=Mk,Kk=jk,Yk=Uk;function Jk(t){return Yk(t)?qk(t):Kk(t)}var Gk=Jk,Zk=s2,Xk=g2,Qk=Gk;function ex(t){return Zk(t,Qk,Xk)}var tx=ex,Ac=tx,nx=1,rx=Object.prototype,ix=rx.hasOwnProperty;function ox(t,e,n,r,i,o){var s=n&nx,l=Ac(t),c=l.length,d=Ac(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:ix.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var b=t[h],w=e[h];if(r)var T=s?r(w,b,h,e,t,o):r(b,w,h,t,e,o);if(!(T===void 0?b===w||i(b,w,n,r,o):T)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var k=t.constructor,M=e.constructor;k!=M&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof M=="function"&&M instanceof M)&&(g=!1)}return o.delete(t),o.delete(e),g}var sx=ox,lx=er,ax=Et,cx=lx(ax,"DataView"),dx=cx,ux=er,fx=Et,hx=ux(fx,"Promise"),px=hx,mx=er,gx=Et,yx=mx(gx,"Set"),bx=yx,kx=er,xx=Et,wx=kx(xx,"WeakMap"),vx=wx,ws=dx,vs=bs,Cs=px,Ss=bx,Es=vx,Vc=Yr,ir=gc,Dc="[object Map]",Cx="[object Object]",_c="[object Promise]",Lc="[object Set]",Ic="[object WeakMap]",Pc="[object DataView]",Sx=ir(ws),Ex=ir(vs),Ox=ir(Cs),Mx=ir(Ss),Tx=ir(Es),Mn=Vc;(ws&&Mn(new ws(new ArrayBuffer(1)))!=Pc||vs&&Mn(new vs)!=Dc||Cs&&Mn(Cs.resolve())!=_c||Ss&&Mn(new Ss)!=Lc||Es&&Mn(new Es)!=Ic)&&(Mn=function(t){var e=Vc(t),n=e==Cx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case Sx:return Pc;case Ex:return Dc;case Ox:return _c;case Mx:return Lc;case Tx:return Ic}return e});var $x=Mn,Os=ab,Nx=xc,Bx=Qb,Ax=sx,Rc=$x,zc=xs,jc=Mc,Vx=Bc,Dx=1,Fc="[object Arguments]",Hc="[object Array]",Ki="[object Object]",_x=Object.prototype,Wc=_x.hasOwnProperty;function Lx(t,e,n,r,i,o){var s=zc(t),l=zc(e),c=s?Hc:Rc(t),d=l?Hc:Rc(e);c=c==Fc?Ki:c,d=d==Fc?Ki:d;var u=c==Ki,f=d==Ki,h=c==d;if(h&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Os),s||Vx(t)?Nx(t,e,n,r,i,o):Bx(t,e,c,n,r,i,o);if(!(n&Dx)){var p=u&&Wc.call(t,"__wrapped__"),m=f&&Wc.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Os),i(g,y,n,r,o)}}return h?(o||(o=new Os),Ax(t,e,n,r,i,o)):!1}var Ix=Lx,Px=Ix,Uc=Jr;function qc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Uc(t)&&!Uc(e)?t!==t&&e!==e:Px(t,e,n,r,qc,i)}var Rx=qc,zx=Rx;function jx(t,e){return zx(t,e)}var Fx=jx;const Kc=qr(Fx),Hx={},Wx={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Ux=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function qx(t,e){return a.openBlock(),a.createElementBlock("svg",Wx,Ux)}const Kx=ae(Hx,[["render",qx]]),Yx={key:0,class:"leading-none"},Jx={key:1},Gx={class:"flex flex-col max-h-80 overflow-y-auto"},Zx={key:0,class:"p-3"},Xx={key:1},Qx={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},ew=["onClick"],tw={class:"select-none flex w-full items-center justify-between"},Yc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var k;(k=r.options)!=null&&k.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(k){var M,v;if(r.multiple){if(k){let A=r.modelValue||[];A.indexOf(k)>=0?A.splice(A.indexOf(k),1):A.push(k),s("update:modelValue",A),p(A),((M=r.modelValue)==null?void 0:M.length)===((v=r.options)==null?void 0:v.length)?i.value=!0:i.value=!1}}else s("update:modelValue",k),p(k),l.value=null,c.value.hide()}async function u(k){var M,v;s("update:modelValue",k),p(k),await a.nextTick(),((M=r.modelValue)==null?void 0:M.length)===((v=r.options)==null?void 0:v.length)&&(i.value=!0)}function f(k){s("update:modelValue",k),i.value=!1,p(k)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=fc(function(k){s("change",k)},r.debounce),m=a.computed(()=>{var k,M,v,A;if(r.multiple)if(r.maxDisplay){let P=(M=o.value)==null?void 0:M.filter(B=>{var $;return(($=r.modelValue)==null?void 0:$.indexOf(B.value))>=0}).map(B=>B.label),_=P==null?void 0:P.slice(0,r.maxDisplay);return(P==null?void 0:P.length)-(_==null?void 0:_.length)>0?(_==null?void 0:_.join(", "))+` (+${(P==null?void 0:P.length)-_.length})`:_==null?void 0:_.join(", ")}else return(k=o.value)==null?void 0:k.filter(P=>{var _;return((_=r.modelValue)==null?void 0:_.indexOf(P.value))>=0}).map(P=>P.label).join(", ");else return((A=(v=o.value)==null?void 0:v.find(P=>P.value===r.modelValue))==null?void 0:A.label)||r.modelValue});function g(k){var M;try{return r.multiple?r.modelValue!==null&&((M=r.modelValue)==null?void 0:M.some(v=>Kc(v,k))):r.modelValue!==null&&Kc(k,r.modelValue)}catch(v){return console.log(v),!1}}const y={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},b=a.computed(()=>{var k,M;return((k=r.modelValue)==null?void 0:k.length)===((M=r.options)==null?void 0:M.length)}),w=a.computed(()=>{var k;if(r.filterable&&!r.remoteMethod&&((k=l.value)!=null&&k.trim().length)){const M=l.value.trim().toLowerCase();return r.options.filter(v=>{var A;return(A=v.label)==null?void 0:A.toLowerCase().includes(M)})}return r.options});function T(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:b}),(k,M)=>(a.openBlock(),a.createBlock(En,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:v})=>[a.createVNode(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var A,P,_,B,$,q;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((A=t.modelValue)==null?void 0:A.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Yx,[b.value&&((P=t.allSelectedText)!=null&&P.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((_=t.options)==null?void 0:_.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(ee=>ee.value===null))?(a.openBlock(),a.createElementBlock("span",Jx,a.toDisplayString((q=($=t.options)==null?void 0:$.find(ee=>ee.value===null))==null?void 0:q.label),1)):a.renderSlot(k.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Kx,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var v;return[a.createElementVNode("div",Gx,[t.filterable?(a.openBlock(),a.createElementBlock("div",Zx,[a.createVNode(Xc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[M[0]||(M[0]=A=>l.value=A),T]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((v=t.options)==null?void 0:v.length)==0?(a.openBlock(),a.createElementBlock("span",Xx,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Qx,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:M[1]||(M[1]=A=>{var P;return u((P=w.value)==null?void 0:P.filter(_=>_.value).map(_=>_.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:M[2]||(M[2]=A=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.value,A=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!g(A.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||A.value,[`${y[a.unref(ne).theme]}`]:!0}]),onClick:P=>A.disabled?null:d(A.value)},[a.createElementVNode("div",tw,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":A.disabled}])},a.toDisplayString(A.label||A.value),3),t.multiple&&g(A.value)?(a.openBlock(),a.createBlock(rc,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,ew)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Jc=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),nw={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},rw={class:""},iw=["value","disabled","rows","placeholder"],Gc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",nw,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",rw,[d.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:a.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,iw)],64))}}),ow=["placeholder"],Zc={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,ow),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},sw={},lw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},aw=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.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 cw(t,e){return a.openBlock(),a.createElementBlock("svg",lw,aw)}const dw=ae(sw,[["render",cw]]),uw={},fw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},hw=[a.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),a.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),a.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 pw(t,e){return a.openBlock(),a.createElementBlock("svg",fw,hw)}const mw=ae(uw,[["render",pw]]),gw={},yw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},bw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function kw(t,e){return a.openBlock(),a.createElementBlock("svg",yw,bw)}const xw=ae(gw,[["render",kw]]),ww={class:"flex items-center gap-2"},vw={key:0},Cw={class:""},Sw=["innerHTML"],Ew={class:"flex justify-end"},Ow=["name","value","checked"],Mw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},Tw={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},$w={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},Nw={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Xc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:hs()),l=mm(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var B;if(o.rules&&typeof o.rules=="string"){let $=(B=o.rules)==null?void 0:B.split("|");return o.required&&$.push("required"),o.email&&$.push("email"),$.join("|")}else if(!o.rules){let $=[];return o.required&&$.push("required"),o.email&&$.push("email"),$.join("|")}return"required"});function p(B){let $=B&&B.target?B.target.value:B;w($)}const m=n;function g(B){B===!0||B===!1?m("update:modelValue",!B):m("update:modelValue",B)}function y(B){let $=B&&B.target?B.target.value:B;m("update:modelValue",$),m("onChange",$)}function b(){m("update:modelValue",null),m("onChange",null),m("onClear")}const w=fc(function(B){m("update:modelValue",B),m("onChange",B)},o.debounce),T=a.ref(null),k=a.ref();function M(){var B,$;o.textarea?(B=k.value)==null||B.focus():($=T.value)==null||$.$el.focus()}function v(){return T.value.meta.valid}const A=a.ref(),P=a.computed(()=>A.value.allSelected),_=a.computed(()=>A.value.isAllSelected);return e({focus:M,isValid:v,allSelected:P,isAllSelected:_}),(B,$)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",ww,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",vw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Cw,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,Sw)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ew,[a.renderSlot(B.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:T,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:q})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:$[0]||($[0]=ee=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(ne).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(rc,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(B.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:T,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:q})=>[a.createElementVNode("div",{onClick:$[2]||($[2]=()=>{t.disabled||y(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:$[1]||($[1]=(...ee)=>B.onChange&&B.onChange(...ee)),checked:t.radioValue==t.modelValue},null,40,Ow),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(vn),{key:3,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>{var ee;return[a.createVNode(Yc,{ref_key:"myChoiceList",ref:A,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((ee=h.value)==null?void 0:ee.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(vn),{key:4,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>[a.createVNode(Zc,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(vn),{key:5,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:q})=>[a.createVNode(Jc,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(ne).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[B.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",Mw,[a.renderSlot(B.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var q;return[a.createVNode(Gc,{ref_key:"myTextarea",ref:k,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((q=h.value)==null?void 0:q.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:T,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!B.$slots.prepend&&!t.naked,"pl-8":B.$slots.prepend&&!t.naked,"pl-6":B.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(b,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(b,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),B.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",Tw,[a.createElementVNode("div",$w,[a.renderSlot(B.$slots,"append",{},()=>[a.withDirectives(a.createVNode(dw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(mw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",Nw,[a.createVNode(a.unref(pm),{name:s.value},{default:a.withCtx(q=>[a.createTextVNode(a.toDisplayString(q.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),B.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(B.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),Bw=["innerHTML"],Qc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();hs();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await tc(e.value,n.value,{placement:i.placement,middleware:[ec(),Qa(),Xa(i.offset),gg({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,Bw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),Aw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},Vw={class:""},Dw={key:2,class:"flex items-center justify-end py-4 px-6"},_w=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(ne).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",Aw,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(ne).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",Vw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",Dw,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),Lw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Iw={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},Pw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(ne).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",Lw,[a.createElementVNode("div",Iw,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),Rw=a.createElementVNode("div",{class:""},null,-1),zw=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),jw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(ne).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createVNode(Qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[Rw]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[zw],64)):a.createCommentVNode("",!0)],2))}}),Fw={class:"leading-none"},Hw=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(ne).theme]]:!0}])},[a.createElementVNode("span",Fw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Ww=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),Uw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),qw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Kw=[Uw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Yw=ae(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",qw,Kw)):(a.openBlock(),a.createBlock(Jn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Jw={class:"text-base font-medium select-none"},Gr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled: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":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},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 dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(ne).theme]]:!t.active&&!t.disabled,[n[a.unref(ne).theme]]:t.active&&!t.disabled,[r[a.unref(ne).theme]]:t.disabled}])},[a.createElementVNode("span",Jw,[a.renderSlot(i.$slots,"default")])],2))}}),Gw={},Zw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Xw=[a.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 Qw(t,e){return a.openBlock(),a.createElementBlock("svg",Zw,Xw)}const ed=ae(Gw,[["render",Qw]]),ev={},tv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nv=[a.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 rv(t,e){return a.openBlock(),a.createElementBlock("svg",tv,nv)}const td=ae(ev,[["render",rv]]),iv={},ov={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},sv=[a.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 lv(t,e){return a.openBlock(),a.createElementBlock("svg",ov,sv)}const nd=ae(iv,[["render",lv]]),av={},cv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},dv=[a.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 uv(t,e){return a.openBlock(),a.createElementBlock("svg",cv,dv)}const rd=ae(av,[["render",uv]]),fv={class:"wpic-pagination flex justify-between"},hv={key:0,class:"flex items-center"},pv={class:"font-medium"},mv=a.createElementVNode("span",{class:"px-1"},"to",-1),gv={class:"font-medium"},yv=a.createElementVNode("span",{class:"px-1"},"of",-1),bv={class:"font-medium"},kv={class:"pl-1"},xv={key:1,class:"flex flex-wrap gap-2"},wv=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!0},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const r=t,i=[{value:10,label:"10 per page"},{value:20,label:"20 per page"},{value:50,label:"50 per page"},{value:100,label:"100 per page"},{value:200,label:"200 per page"},{value:500,label:"500 per page"}],o=n,s=a.computed(()=>Math.ceil(r.total/r.perPage)),l=a.computed(()=>{const h=s.value;if(!h||h===1)return[1];const p=r.currentPage,m=1;let g=Math.max(2,p-m),y=Math.min(h-1,p+m);p<=m+2&&(g=2,y=Math.min(2*m+2,h-1)),p>=h-m-1&&(g=Math.max(2,h-2*m-1),y=h-1);const b=[];for(let w=g;w<=y;w++)b.push(w);return g>2&&b.unshift("..."),y<h-1&&b.push("..."),[1,...b,h]});function c(h){h>=1&&h<=s.value&&o("update:currentPage",h)}function d(){return r.perPage*(r.currentPage-1)+1}function u(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}function f(h){console.log("### updatePerPage",h),o("update:perPage",h)}return e({getStart:d,getEnd:u}),(h,p)=>{const m=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",fv,[t.info?(a.openBlock(),a.createElementBlock("div",hv,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",pv,a.toDisplayString(d()),1),mv,a.createElementVNode("span",gv,a.toDisplayString(u()),1),t.total?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[yv,a.createElementVNode("span",bv,a.toDisplayString(t.total),1),a.createElementVNode("span",kv,"result"+a.toDisplayString(t.total>1?"s":""),1)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",xv,[a.createVNode(Gr,{onClick:p[0]||(p[0]=g=>c(1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(ed,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[1]||(p[1]=g=>c(t.currentPage-1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(td,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,g=>(a.openBlock(),a.createBlock(Gr,{key:`page_${g}`,onClick:y=>c(g),active:g===t.currentPage,disabled:s.value==0||!s.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(g),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Gr,{onClick:p[2]||(p[2]=g=>c(t.currentPage+1)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(rd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[3]||(p[3]=g=>c(s.value)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(nd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(m,{key:0,modelValue:t.perPage,"onUpdate:modelValue":f,options:i},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.perPage)+" per page",1)]),_:1},8,["modelValue"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),id=(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 a.h("td",e.attrs,n)};id.props=["column","item","rowIndex"];const Yi=id,vv={},Cv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Sv=[a.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 Ev(t,e){return a.openBlock(),a.createElementBlock("svg",Cv,Sv)}const Ov=ae(vv,[["render",Ev]]),Mv={class:"font-semibold"},od={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",Mv,[t.checkable?(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},Tv={},$v={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},Nv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function Bv(t,e){return a.openBlock(),a.createElementBlock("svg",$v,Nv)}const Av=ae(Tv,[["render",Bv]]),Vv={},Dv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},_v=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function Lv(t,e){return a.openBlock(),a.createElementBlock("svg",Dv,_v)}const Iv=ae(Vv,[["render",Lv]]),Pv={class:"wpic-table"},Rv={key:0,class:"px-2 py-1 flex justify-end border-b dark:border-gray-900"},zv={class:"w-full rounded-lg"},jv={key:0,class:"w-16"},Fv=["width"],Hv=["width"],Wv={class:"flex justify-center items-center h-full"},Uv=["onClick"],qv={class:"rounded-b-lg relative"},Kv={key:0},Yv=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],Jv={class:"flex justify-center items-center h-full"},Gv={key:1},Zv={key:0,class:"text-center text-gray-400 py-3"},Xv=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;a.onMounted(()=>{b()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter($=>g.value.includes($.field)||!$.selectable):m.value.filter($=>$.visible||!$.selectable));function b(){const $=(L,S)=>{let C={};for(let V in L){if(typeof L[V].default=="boolean"&&S[V]!==void 0){C[V]=S[V]!==!1;continue}if(S[V]!==void 0){C[V]=S[V];continue}if(typeof L[V].default=="function"){C[V]=L[V].default();continue}C[V]=L[V].default}return C};let q=[];(p.default&&p.default()||[]).forEach(L=>{var S,C;((S=L.type)==null?void 0:S.name)==="WpicTableColumn"?q.push(L):(C=L.children)!=null&&C.length&&L.children.forEach(V=>{var I;((I=V.type)==null?void 0:I.name)==="WpicTableColumn"&&q.push(V)})}),m.value=q.map(L=>{let S=L.children,C=L.props||{},{field:V,label:I,help:J,width:Z,minWidth:N,maxWidth:D,sortable:j,selectable:X,render:U,type:R,align:te,visible:he,noPadding:le}=$(L.type.props,C);return V||(V=B(I)),X&&he&&g.value.push(V),{label:I,help:J,width:Z,minWidth:N,maxWidth:D,type:R,align:te,sortable:j,selectable:X,field:V,render:U,children:S,visible:he,noPadding:le}})}function w($){var ee,L;let q=(ee=r.sortOptions)==null?void 0:ee.sortDirection;((L=r.sortOptions)==null?void 0:L.sortBy)===$&&(q=q==="asc"?"desc":"asc"),f("changeSort",{sortDirection:q,sortBy:$})}a.watch(()=>p.default,$=>{b()},{deep:!0});const T=a.reactive({});function k({index:$,item:q}){T[$]?T[$]=null:(T[$]=!0,f("expandRow",{index:$,item:q}))}const M=a.ref([]);function v($){const q=_($,r.itemId);M.value.includes(q)?(M.value.splice(M.value.indexOf(q),1),A.value=!1):M.value.push(q)}const A=a.ref(!1);function P(){if(A.value=!A.value,M.value=[],A.value)for(let $ of r.data){let q=_($,r.itemId);M.value.push(q)}}e({buildColumns:b,selectedRows:M,selectedColumns:g});function _($,q){return q.split(".").reduce((ee,L)=>ee?ee[L]:void 0,$)}function B($){return!$||typeof $!="string"?"":$.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return($,q)=>{const ee=a.resolveComponent("wpic-choice-list"),L=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",Pv,[t.columnToggleable?(a.openBlock(),a.createElementBlock("div",Rv,[a.createElementVNode("div",null,[a.createVNode(ee,{multiple:"",modelValue:g.value,"onUpdate:modelValue":q[0]||(q[0]=S=>g.value=S),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(S=>S.selectable).map(S=>({label:S.label,value:S.field}))},{default:a.withCtx(()=>[a.createVNode(Pr,{medium:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(Iv,{class:"w-5 h-5 mr-2"}),a.createTextVNode(" Columns ")]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",zv,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",jv)):a.createCommentVNode("",!0),y.value.find(S=>S.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(S=>S.type=="expand").minWidth}px`}),width:y.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,Fv)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(S=>S.type!="expand"),(S,C)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:C},null,12,Hv))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},[a.createElementVNode("div",Wv,[a.createVNode(L,{slim:"","hide-error":"",checkbox:"",modelValue:A.value,"onUpdate:modelValue":P},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(S=>S.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(S=>S.type!="expand"),(S,C)=>{var V,I;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(ne).theme]}`]:!0,"sticky top-0 left-0":C===0}]),style:a.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{S.sortable&&w(S.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":S.align=="right"}])},a.toDisplayString(S.label),3),S.sortable&&S.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":S.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[a.createVNode(Ov,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((I=t.sortOptions)==null?void 0:I.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,Uv)],6)}),256))])],2)),a.createElementVNode("tbody",qv,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(ne).theme]]])},[a.createVNode(Jn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",Kv,Yv))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(od,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(S,C)=>{var V,I,J,Z,N;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${C}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":C%2==0,"is-even":C%2!=0,[s[a.unref(ne).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}])},[a.createElementVNode("div",Jv,[a.createVNode(L,{slim:"","hide-error":"",checkbox:"",modelValue:M.value.includes(_(S,t.itemId)),checkboxValue:_(S,t.itemId),"onUpdate:modelValue":D=>v(S)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(D=>D.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Pr,{small:"",square:"",onClick:D=>k({item:S,index:C})},{default:a.withCtx(()=>[T[C]?(a.openBlock(),a.createBlock(xw,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(Av,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(D=>D.type!="expand"),(D,j)=>{var X,U;return a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":j===0,[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":C===((X=t.data)==null?void 0:X.length)-1&&!t.totalItem&&!y.value.find(R=>R.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":C===((U=t.data)==null?void 0:U.length)-1&&!t.totalItem&&!y.value.find(R=>R.type=="expand")&&!t.noRadius,"text-center justify-center":D.align=="center","text-right justify-end":D.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${D.maxWidth}px`}),id:`${C}_${j}`,column:D,item:S,rowIndex:C,key:j},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(D=>D.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(ne).theme]]:!t.stripe,[l[a.unref(ne).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Yi,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(ne).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=y.value.find(D=>D.type=="expand"))!=null&&V.noPadding),"p-0":(I=y.value.find(D=>D.type=="expand"))==null?void 0:I.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":C===((J=t.data)==null?void 0:J.length)-1&&!t.totalItem,"first:rounded-bl-lg":C===((Z=t.data)==null?void 0:Z.length)-1&&!t.totalItem,"text-center":y.value.find(D=>D.type=="expand").align=="center","text-right":y.value.find(D=>D.type=="expand").align=="right"}]),column:y.value.find(D=>D.type=="expand"),rowIndex:C,colspan:(N=y.value)==null?void 0:N.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,T[C]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",Gv,[a.createVNode(od,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",Zv," No Data ")):a.createCommentVNode("",!0)],2)])}}}),Qv={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},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(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=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.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}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function sd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=sd(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ld(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=ld(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class F{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new F(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new F(r,i)}cutByIndex(e,n){return e==n?F.empty:e==0&&n==this.content.length?this:new F(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new F(i,o)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(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 sd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ld(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ji(0,e);if(e==this.size)return Ji(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ji(r+1,s):Ji(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return F.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new F(n||e,r)}static from(e){if(!e)return F.empty;if(e instanceof F)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new F([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}F.empty=new F([],0);const Ms={index:0,offset:0};function Ji(t,e){return Ms.index=t,Ms.offset=e,Ms}function Gi(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(!Gi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Gi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class aa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gi(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`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}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 aa.none;if(e instanceof aa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class Zi extends Error{}class K{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=cd(this.content,e+this.openStart,n);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,n){return new K(ad(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 K.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 K(F.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new K(e,r,i)}}K.empty=new K(F.empty,0,0);function ad(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ad(o.content,e-i-1,n-i-1)))}function cd(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=cd(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function e5(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return dd(t,e,n,0)}function dd(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=dd(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $n(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=t5(n,t);return $n(o,fd(t,s,l,e,r))}else return $n(o,Xi(t,e,r))}function ud(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return ud(r,e.node(n)),r}function Tn(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 Zr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Tn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Tn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Tn(e.nodeBefore,r)}function $n(t,e){return t.type.checkContent(e),t.copy(e)}function fd(t,e,n,r,i){let o=t.depth>i&&Ts(t,e,i+1),s=r.depth>i&&Ts(n,r,i+1),l=[];return Zr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ud(o,s),Tn($n(o,fd(t,e,n,r,i+1)),l)):(o&&Tn($n(o,Xi(t,e,i+1)),l),Zr(e,n,i,l),s&&Tn($n(s,Xi(n,r,i+1)),l)),Zr(r,null,i,l),new F(l)}function Xi(t,e,n){let r=[];if(Zr(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);Tn($n(i,Xi(t,e,n+1)),r)}return Zr(e,null,n,r),new F(r)}function t5(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(F.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Xr(n,r,o)}static resolveCached(e,n){let r=hd.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else hd.set(e,r=new n5);let i=r.elts[r.i]=Xr.resolve(e,n);return r.i=(r.i+1)%r5,i}}class n5{constructor(){this.elts=[],this.i=0}}const r5=12,hd=new WeakMap;class Qi{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 i5=Object.create(null);let Qt=class ca{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||F.empty}get children(){return this.content.content}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&&Gi(this.attrs,n||e.defaultAttrs||i5)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ca(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ca(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 K.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new K(d,i.depth-s,o.depth-s)}replace(e,n,r){return e5(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 Xr.resolveCached(this,e)}resolveNoCache(e){return Xr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),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=F.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;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=F.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Qt.prototype.text=void 0;class eo extends Qt{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 eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new eo(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 Nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new o5(e,n);if(r.next==null)return Nn.empty;let i=md(r);r.next&&r.err("Unexpected trailing text");let o=f5(u5(i));return h5(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return F.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
6
|
+
`)}}Nn.empty=new Nn(!0);class o5{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 md(t){let e=[];do e.push(s5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function s5(t){let e=[];do e.push(l5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function l5(t){let e=d5(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=a5(t,e);else break;return e}function gd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function a5(t,e){let n=gd(t),r=n;return t.eat(",")&&(t.next!="}"?r=gd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function c5(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function d5(t){if(t.eat("(")){let e=md(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=c5(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 u5(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function yd(t,e){return e-t}function bd(t,e){let n=[];return r(e),n.sort(yd);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function f5(t){let e=Object.create(null);return n(bd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);bd(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Nn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(yd);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function h5(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function kd(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 xd(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wd(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function vd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new m5(t,r,e[r]);return n}let Cd=class sp{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=vd(e,r.attrs),this.defaultAttrs=kd(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==Nn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:xd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qt(this,this.computeAttrs(e),F.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=F.from(n),this.checkContent(n),new Qt(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=F.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(F.empty,!0);return o?new Qt(this,e,n.append(o),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new sp(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function p5(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class m5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?p5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class to{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vd(e,i.attrs),this.excluded=null;let o=kd(this.attrs);this.instance=o?new ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,xd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new to(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Sd{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=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Cd.compile(this.spec.nodes,this),this.marks=to.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?Ed(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ed(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Cd){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 eo(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Qt.fromJSON(this,e)}markFromJSON(e){return ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ed(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function g5(t){return t.tag!=null}function y5(t){return t.style!=null}class en{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(g5(i))this.tags.push(i);else if(y5(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new $d(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $d(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),K.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(x5(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new en(e,en.schemaRules(e)))}}const Od={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},b5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Md={ol:!0,ul:!0},Qr=1,$s=2,no=4;function Td(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?$s:0):t&&t.whitespace=="pre"?Qr|$s:n&-5}class ro{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ye.none,this.match=o||(s&no?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(F.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&Qr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=F.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Od.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $d{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Td(null,n.preserveWhitespace,0)|(r?no:0);i?o=new ro(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ro(null,null,ye.none,!0,null,s):o=new ro(e.schema.topNodeType,null,ye.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&$s?"full":this.localPreserveWS||(i.options&Qr)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
7
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Md.hasOwnProperty(s)&&this.parser.normalizeLists&&k5(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:b5.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(Od.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=c&&c.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(o),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
8
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ye.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Bd(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Td(e,o,s.options);s.options&no&&s.content.length==0&&(l|=no);let c=ye.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Bd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ro(e,n,c,i,null,l)),this.open++,r}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;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function k5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Md.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function x5(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Nd(t){let e={};for(let n in t)e[n]=t[n];return e}function Bd(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Bn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ns(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=io(Ns(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&io(Ns(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return io(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ad(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ad(e.marks)}}function Ad(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ns(t){return t.document||window.document}const Vd=new WeakMap;function w5(t){let e=Vd.get(t);return e===void 0&&Vd.set(t,e=v5(t)),e}function v5(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function io(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=w5(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=io(t,h,n,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Dd=65535,_d=Math.pow(2,16);function C5(t,e){return t+e*_d}function Ld(t){return t&Dd}function S5(t){return(t-(t&Dd))/_d}const Id=1,Pd=2,oo=4,Rd=8;class Bs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Rd)>0}get deletedBefore(){return(this.delInfo&(Id|oo))>0}get deletedAfter(){return(this.delInfo&(Pd|oo))>0}get deletedAcross(){return(this.delInfo&oo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=Ld(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+S5(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:n:n,p=c+i+(h<0?0:u);if(r)return p;let m=e==(n<0?c:f)?null:C5(l/3,e-c),g=e==c?Pd:e==f?Id:oo;return(n<0?e!=c:e!=f)&&(g|=Rd),new Bs(p,g,m)}i+=u-d}return r?e+i:new Bs(e+i,0,null)}touches(e,n){let r=0,i=Ld(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class or{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 or(this.maps,this.mirror,e,n)}copy(){return new or(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 or;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Bs(e,i,null)}}const As=Object.create(null);class Pe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=As[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 As)throw new RangeError("Duplicate use of step JSON ID "+e);return As[e]=n,n.prototype.jsonID=e,n}}class Se{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Se(e,null)}static fail(e){return new Se(null,e)}static fromReplace(e,n,r,i){try{return Se.ok(e.replace(n,r,i))}catch(o){if(o instanceof Zi)return Se.fail(o.message);throw o}}}function Vs(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Vs(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return F.fromArray(r)}class tn extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new K(Vs(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,o)}invert(){return new Ot(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 tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(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 tn(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("addMark",tn);class Ot extends Pe{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 K(Vs(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,r)}invert(){return new tn(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 Ot(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(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 Ot(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("removeMark",Ot);class nn extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new K(F.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 nn(this.pos,n.marks[i]);return new nn(this.pos,this.mark)}}return new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nn(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 nn(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("addNodeMark",nn);class sr extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new K(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new nn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sr(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 sr(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("removeNodeMark",sr);class $e extends Pe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ds(e,this.from,this.to)?Se.fail("Structure replace would overwrite content"):Se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new $e(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 $e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof $e)||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?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $e(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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $e(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 $e(n.from,n.to,K.fromJSON(e,n.slice),!!n.structure)}}Pe.jsonID("replace",$e);class Ne extends Pe{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Ds(e,this.from,this.gapFrom)||Ds(e,this.gapTo,this.to)))return Se.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Se.fromReplace(e,this.from,this.to,r):Se.fail("Content does not fit in gap")}getMap(){return new et([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 Ne(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ne(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(n.from,n.to,n.gapFrom,n.gapTo,K.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pe.jsonID("replaceAround",Ne);function Ds(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function E5(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new Ot(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new tn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function O5(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof to){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Ot(s.from,s.to,s.style)))}function _s(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new $e(l,u,K.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ot(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new K(F.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new $e(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(F.empty,!0);t.replace(l,l,new K(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function M5(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!M5(i,o,s))break}return null}function T5(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=F.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=F.from(r.node(m).copy(u)),f++):c--;let h=F.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=F.from(i.node(m).copy(h)),p++):d++;t.step(new Ne(c,d,s,l,new K(u.append(h),f,p),u.size-f,!0))}function Ls(t,e,n=null,r=t){let i=$5(t,e),o=i&&N5(r,e);return o?i.map(zd).concat({type:e,attrs:n}).concat(o.map(zd)):null}function zd(t){return{type:t,attrs:null}}function $5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function N5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function B5(t,e,n){let r=F.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=F.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new K(r,0,0),n.length,!0))}function A5(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&V5(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Fd(t,s,l,o),_s(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return t.step(new Ne(f,h,f+1,h-1,new K(F.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&jd(t,s,l,o),!1}})}function jd(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Fd(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
9
|
+
`))}})}function V5(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function D5(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new K(F.from(s),0,0),1,!0))}function Pt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let l=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function _5(t,e,n=1,r){let i=t.doc.resolve(e),o=F.empty,s=F.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=F.from(i.node(l).copy(o));let u=r&&r[d];s=F.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new $e(e,e,new K(o.append(s),n,n),!0))}function rn(t,e){let n=t.resolve(e),r=n.index();return Hd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function L5(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Hd(t,e){return!!(t&&e&&!t.isLeaf&&L5(t,e))}function so(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Hd(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function I5(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Fd(t,u.node(),u.before(),l)}s.inlineContent&&_s(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(l),d=c.map(e-n);if(t.step(new $e(d,c.map(e+n,-1),K.empty,!0)),r===!0){let u=t.doc.resolve(d);jd(t,u.node(),u.before(),t.steps.length)}return t}function P5(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Wd(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function lo(t,e,n=e,r=K.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ud(i,o,r)?new $e(e,n,r):new R5(i,o,r).fit()}function Ud(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class R5{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let c=new K(o,s,l);return e>-1?new Ne(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new $e(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Is(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(F.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Is(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(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=Is(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new K(ei(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new K(ei(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,l=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let g=l.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||c==0||g.content.size)&&(f=y,u.push(qd(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=ti(this.placed,n,F.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=l;g<p;g++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=m?e==0?K.empty:new K(ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new K(ei(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ps(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ps(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=Ps(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ti(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ti(this.placed,this.depth,F.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(F.empty,!0);n.childCount&&(this.placed=ti(this.placed,this.frontier.length,n))}}function ei(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ei(t.firstChild.content,e-1,n)))}function ti(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ti(t.lastChild.content,e-1,n)))}function Is(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function qd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,qd(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(F.empty,!0)))),t.copy(r)}function Ps(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!z5(n,o.content,s)?l:null}function z5(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function j5(t){return t.spec.defining||t.spec.definingForContent}function F5(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Ud(i,o,r))return t.step(new $e(e,n,r));let s=Yd(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(l),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=j5(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+c)%s.length],b=!0;y<0&&(b=!1,y=-y);let w=i.node(y-1),T=i.index(y-1);if(w.canReplaceWith(T,T,m.type,m.marks))return t.replace(i.before(y),b?o.after(y):n,new K(Kd(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Kd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Kd(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(F.empty,!0))}return t}function H5(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=P5(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new K(F.from(r),0,0))}function W5(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Yd(r,i);for(let s=0;s<o.length;s++){let l=o[s],c=s==o.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Yd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class ar extends Pe{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 Se.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Se.fromReplace(e,this.pos,this.pos+1,new K(F.from(i),0,n.isLeaf?0:1))}getMap(){return et.empty}invert(e){return new ar(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 ar(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 ar(n.pos,n.attr,n.value)}}Pe.jsonID("attr",ar);class ni extends Pe{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 Se.ok(r)}getMap(){return et.empty}invert(e){return new ni(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 ni(n.attr,n.value)}}Pe.jsonID("docAttr",ni);let cr=class extends Error{};cr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},cr.prototype=Object.create(Error.prototype),cr.prototype.constructor=cr,cr.prototype.name="TransformError";class U5{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new or}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cr(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=K.empty){let i=lo(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new K(F.from(r),0,0))}delete(e,n){return this.replace(e,n,K.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return F5(this,e,n,r),this}replaceRangeWith(e,n,r){return H5(this,e,n,r),this}deleteRange(e,n){return W5(this,e,n),this}lift(e,n){return T5(this,e,n),this}join(e,n=1){return I5(this,e,n),this}wrap(e,n){return B5(this,e,n),this}setBlockType(e,n=e,r,i=null){return A5(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return D5(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ar(e,n,r)),this}setDocAttribute(e,n){return this.step(new ni(e,n)),this}addNodeMark(e,n){return this.step(new nn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ye)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new sr(e,n)),this}split(e,n=1,r){return _5(this,e,n,r),this}addMark(e,n,r){return E5(this,e,n,r),this}removeMark(e,n,r){return O5(this,e,n,r),this}clearIncompatible(e,n,r){return _s(this,e,n,r),this}}const Rs=Object.create(null);class ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new q5(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=K.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:c,$to:d}=s[l],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),l?K.empty:n),l==0&&Zd(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(l.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Zd(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ce(e):dr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?dr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):dr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new tt(e.node(0))}static atStart(e){return dr(e,e,0,0,1)||new tt(e)}static atEnd(e){return dr(e,e,e.content.size,e.childCount,-1)||new tt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Rs[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 Rs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rs[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}ue.prototype.visible=!0;class q5{constructor(e,n){this.$from=e,this.$to=n}}let Jd=!1;function Gd(t){!Jd&&!t.parent.inlineContent&&(Jd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ce extends ue{constructor(e,n=e){Gd(e),Gd(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 ue.near(r);let i=e.resolve(n.map(this.anchor));return new ce(i.parent.inlineContent?i:r,r)}replace(e,n=K.empty){if(super.replace(e,n),n==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ao(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 ce(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ce(e,n)}}ue.jsonID("text",ce);class ao{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ao(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class re extends ue{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ue.near(o):new re(o)}content(){return new K(F.from(this.node),0,0)}eq(e){return e instanceof re&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zs(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new re(e.resolve(n.anchor))}static create(e,n){return new re(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}re.prototype.visible=!1,ue.jsonID("node",re);class zs{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ao(r,r):new zs(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&re.isSelectable(r)?new re(n):ue.near(n)}}class tt extends ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=K.empty){if(n==K.empty){e.delete(0,e.doc.content.size);let r=ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new tt(e)}map(e){return new tt(e)}eq(e){return e instanceof tt}getBookmark(){return K5}}ue.jsonID("all",tt);const K5={map(){return this},resolve(t){return new tt(t)}};function dr(t,e,n,r,i,o=!1){if(e.inlineContent)return ce.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&re.isSelectable(l))return re.create(t,n-(i<0?l.nodeSize:0))}else{let c=dr(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Zd(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;let o=t.mapping.maps[r],s;o.forEach((l,c,d,u)=>{s==null&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const Xd=1,Qd=2,eu=4;class Y5 extends U5{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|Xd)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Xd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qd,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Qd)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.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|=eu,this}get scrolledIntoView(){return(this.updated&eu)>0}}function tu(t,e){return!e||!t?t:t.bind(e)}class ri{constructor(e,n,r){this.name=e,this.init=tu(n.init,r),this.apply=tu(n.apply,r)}}const J5=[new ri("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ri("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new ri("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ri("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class js{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=J5.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 ri(r.key,r.spec.state,r))})}}class ur{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new Y5(this)}static create(e){let n=new js(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(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 js(this.schema,e.plugins),r=n.fields,i=new ur(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new js(e.schema,e.plugins),o=new ur(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Qt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function nu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=nu(i,e,{})),n[r]=i}return n}class _e{constructor(e){this.spec=e,this.props={},e.props&&nu(e.props,this,this.props),this.key=e.key?e.key.key:ru("plugin")}getState(e){return e[this.key]}}const Fs=Object.create(null);function ru(t){return t in Fs?t+"$"+ ++Fs[t]:(Fs[t]=0,t+"$")}class nt{constructor(e="key"){this.key=ru(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Le=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ii=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Hs=null;const Rt=function(t,e,n){let r=Hs||(Hs=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},G5=function(){Hs=null},An=function(t,e,n,r){return n&&(iu(t,e,n,r,-1)||iu(t,e,n,r,1))},Z5=/^(img|br|input|textarea|hr)$/i;function iu(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:lt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||oi(t)||Z5.test(t.nodeName)||t.contentEditable=="false")return!1;e=Le(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?lt(t):0}else return!1}}function lt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function X5(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=lt(t)}else if(t.parentNode&&!oi(t))e=Le(t),t=t.parentNode;else return null}}function Q5(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&&!oi(t))e=Le(t)+1,t=t.parentNode;else return null}}function eC(t,e,n){for(let r=e==0,i=e==lt(t);r||i;){if(t==n)return!0;let o=Le(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==lt(t)}}function oi(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 co=function(t){return t.focusNode&&An(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Vn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function tC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(lt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(lt(r.startContainer),r.startOffset)}}}const Mt=typeof navigator<"u"?navigator:null,ou=typeof document<"u"?document:null,on=Mt&&Mt.userAgent||"",Ws=/Edge\/(\d+)/.exec(on),su=/MSIE \d/.exec(on),Us=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(on),Je=!!(su||Us||Ws),sn=su?document.documentMode:Us?+Us[1]:Ws?+Ws[1]:0,xt=!Je&&/gecko\/(\d+)/i.test(on);xt&&+(/Firefox\/(\d+)/.exec(on)||[0,0])[1];const qs=!Je&&/Chrome\/(\d+)/.exec(on),Re=!!qs,lu=qs?+qs[1]:0,Fe=!Je&&!!Mt&&/Apple Computer/.test(Mt.vendor),fr=Fe&&(/Mobile\/\w+/.test(on)||!!Mt&&Mt.maxTouchPoints>2),at=fr||(Mt?/Mac/.test(Mt.platform):!1),rC=Mt?/Win/.test(Mt.platform):!1,zt=/Android \d/.test(on),si=!!ou&&"webkitFontSmoothing"in ou.documentElement.style,iC=si?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function oC(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 jt(t,e){return typeof t=="number"?t:t[e]}function sC(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 au(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=ii(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?oC(o):sC(l),u=0,f=0;if(e.top<d.top+jt(r,"top")?f=-(d.top-e.top+jt(i,"top")):e.bottom>d.bottom-jt(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+jt(i,"top")-d.top:e.bottom-d.bottom+jt(i,"bottom")),e.left<d.left+jt(r,"left")?u=-(d.left-e.left+jt(i,"left")):e.right>d.right-jt(r,"right")&&(u=e.right-d.right+jt(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function lC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:cu(t.dom)}}function cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ii(r));return e}function aC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;du(n,r==0?0:r-e)}function du(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let hr=null;function cC(t){if(t.setActive)return t.setActive();if(hr)return t.focus(hr);let e=cu(t);t.focus(hr==null?{get preventScroll(){return hr={preventScroll:!0},!0}}:void 0),hr||(hr=!1,du(e,0))}function uu(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,c,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Rt(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?dC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:uu(n,i)}function dC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=ln(r,1);if(o.top!=o.bottom&&Ks(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ks(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function uC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function fC(t,e,n){let{node:r,offset:i}=uu(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function hC(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function fu(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Ks(e,d))return fu(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function pC(t,e){let n=t.dom.ownerDocument,r,i=0,o=nC(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!Ks(e,d)||(s=fu(t.dom,e,d),!s))return null}if(Fe)for(let d=s;r&&d;d=ii(d))d.draggable&&(r=void 0);if(s=uC(s,e),r){if(xt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;si&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=hC(t,r,i,e))}l==null&&(l=fC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function hu(t){return t.top<t.bottom||t.left<t.right}function ln(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(hu(r))return r}return Array.prototype.find.call(n,hu)||t.getBoundingClientRect()}const mC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function pu(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=si||xt;if(r.nodeType==3)if(s&&(mC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=ln(Rt(r,i,i),n);if(xt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=ln(Rt(r,i-1,i-1),-1);if(d.top==c.top){let u=ln(Rt(r,i,i+1),-1);if(u.top!=c.top)return li(u,u.left<d.left)}}return c}else{let c=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(c--,u=1):n<0?c--:d++,li(ln(Rt(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!0)}return Ys(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Rt(c,lt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return li(ln(d,1),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Rt(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return li(ln(d,-1),!0)}return li(ln(r.nodeType==3?Rt(r):r,-n),n>=0)}function li(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 Ys(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 mu(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 gC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return mu(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=pu(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Rt(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const yC=/[\u0590-\u08ac]/;function bC(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!yC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:mu(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{l.collapse(u,f),c&&(c!=u||d!=f)&&l.extend&&l.extend(c,d)}catch{}return h!=null&&(l.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let gu=null,yu=null,bu=!1;function kC(t,e,n){return gu==e&&yu==n?bu:(gu=e,yu=n,bu=n=="up"||n=="down"?gC(t,e,n):bC(t,e,n))}const ct=0,ku=1,Dn=2,Tt=3;class ai{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ct,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Le(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let l=i.children[s];if(l.size){i=l;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof vu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof xu&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Le(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Le(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let c=this.children[l],d=s+c.size;if(i==-1&&e<=d){let u=s+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Le(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Le(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],y=m+g.size;if(o>m&&s<y)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=y}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((xt||Fe)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
10
|
+
`),f&&m==p.nodeValue.length)for(let g=p,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(l=c={node:y.parentNode,offset:Le(y)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(xt&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&Fe)&&An(l.node,l.offset,u.anchorNode,u.anchorOffset)&&An(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,c=s-o.border;if(e>=l&&n<=c){this.dirty=e==r||n==s?Dn:ku,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Tt:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Dn:Tt}r=s}this.dirty=Dn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Dn:ku;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class xu extends ai{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==ct&&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 xC extends ai{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 _n extends ai{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Bn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new _n(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Tt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ct){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ct}}slice(e,n,r){let i=_n.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Gs(o,n,s,r)),e>0&&(o=Gs(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class an extends ai{constructor(e,n,r,i,o,s,l,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],c,d=l&&l(n,o,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Bn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Eu(u,r,n),d?c=new wC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new uo(e,n,r,i,u,h,o):new an(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,n,r){return this.dirty==ct&&e.eq(this.node)&&fo(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,c=new CC(this,s&&s.node,e);OC(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?ye.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,h)=>{c.syncToMarks(d.marks,r,e);let p;c.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,p,e)||c.updateNextNode(d,u,f,e,h,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Dn)&&(s&&this.protectLocalComposition(e,s),Cu(this.contentDOM,this.children,e),fr&&MC(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=TC(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new xC(this,o,n,i);e.input.compositionNodes.push(s),this.children=Gs(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Tt||!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=ct}updateOuterDeco(e){if(fo(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Su(this.dom,this.nodeDOM,Js(this.outerDeco,this.node,n),Js(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 wu(t,e,n,r,i){Eu(r,e,t);let o=new an(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class uo extends an{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,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==Tt||this.dirty!=ct&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ct||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=ct,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new uo(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vu extends ai{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ct&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class wC extends an{constructor(e,n,r,i,o,s,l,c,d,u){super(e,n,r,i,o,s,l,d,u),this.spec=c}update(e,n,r,i){if(this.dirty==Tt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):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 Cu(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Ou(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof _n){let c=r?r.previousSibling:t.lastChild;Cu(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=Ou(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const ci=function(t){t&&(this.nodeName=t)};ci.prototype=Object.create(null);const Ln=[new ci];function Js(t,e,n){if(t.length==0)return Ln;let r=n?Ln[0]:new ci,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new ci(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new ci(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function Su(t,e,n,r){if(n==Ln&&r==Ln)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let c;l&&l.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=Ln[0]),i=c}vC(i,l||Ln[0],s)}return i}function vC(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Eu(t,e,n){return Su(t,t,Ln,Js(e,n,t.nodeType!=1))}function fo(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 Ou(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class CC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=SC(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=ct,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=_n.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Tt&&s.dom==s.contentDOM&&(s.dirty=Dn),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof an){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,h=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Tt&&fo(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Dn,f.updateChildren(i,s+1),f.dirty=ct),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!fo(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=an.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,r,i,o){let s=an.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new xu(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof _n;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof uo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fe||Re)&&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 vu(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 SC(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof _n)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function EC(t,e){return t.type.side-e.type.side}function OC(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,l=[],c=null;for(let d=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(EC);for(let y=0;y<f.length;y++)n(f[y],d,!!c)}else n(u,d,!!c);let h,p;if(c)p=-1,h=c,c=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let y=0;y<l.length;y++)l[y].to<=o&&l.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let b=0;b<l.length;b++)l[b].to<y&&(y=l[b].to);y<m&&(c=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?l.filter(y=>!y.inline):l.slice();r(h,g,e.forChild(o,h),p),o=m}}function MC(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 TC(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let c=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?c.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function Gs(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let c=t[s],d=l,u=l+=c.size;d>=n||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(c.slice(n-d,c.size,r)))}return o}function Zs(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(co(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&re.isSelectable(f)&&i.parent&&!(f.isInline&&eC(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new re(s==h?l:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==t.state.selection.anchor?[h,f]:[f,h],l=r.resolve(s)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=Qs(t,u,l,f)}return d}function Mu(t){return t.editable?t.hasFocus():Du(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ft(t,e=!1){let n=t.state.selection;if(Bu(t,n),!!Mu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Re){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&An(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)NC(t);else{let{anchor:r,head:i}=n,o,s;Tu&&!(n instanceof ce)&&(n.$from.parent.inlineContent||(o=$u(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=$u(t,n.to))),t.docView.setSelection(r,i,t,e),Tu&&(o&&Nu(o),s&&Nu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&$C(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tu=Fe||Re&&lu<63;function $u(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Fe&&i&&i.contentEditable=="false")return Xs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xs(i);if(o)return Xs(o)}}function Xs(t){return t.contentEditable="true",Fe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Nu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function $C(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(()=>{(!Mu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function NC(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Le(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Je&&sn<=11&&(r.disabled=!0,r.disabled=!1)}function Bu(t,e){if(e instanceof re){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Au(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Au(t)}function Au(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Qs(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function Vu(t){return t.editable&&!t.hasFocus()?!1:Du(t)}function Du(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 BC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return An(e.node,e.offset,n.anchorNode,n.anchorOffset)}function el(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function cn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function _u(t,e,n){let r=t.state.selection;if(r instanceof ce)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return cn(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=el(t.state,e);return i&&i instanceof re?cn(t,i):!1}else if(!(at&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?re.isSelectable(o)?cn(t,new re(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):si?cn(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof re&&r.node.isInline)return cn(t,new ce(e>0?r.$to:r.$from));{let i=el(t.state,e);return i?cn(t,i):!1}}}function ho(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function di(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function pr(t,e){return e<0?AC(t):VC(t)}function AC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(xt&&n.nodeType==1&&r<ho(n)&&di(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(di(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Lu(n))break;{let l=n.previousSibling;for(;l&&di(l,-1);)i=n.parentNode,o=Le(l),l=l.previousSibling;if(l)n=l,r=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?tl(t,n,r):i&&tl(t,i,o)}function VC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ho(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(di(l,1))o=n,s=++r;else break}else{if(Lu(n))break;{let l=n.nextSibling;for(;l&&di(l,1);)o=l.parentNode,s=Le(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&tl(t,o,s)}function Lu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function DC(t,e){for(;t&&e==t.childNodes.length&&!oi(t);)e=Le(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 _C(t,e){for(;t&&!e&&!oi(t);)e=Le(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 tl(t,e,n){if(e.nodeType!=3){let o,s;(s=DC(e,n))?(e=s,n=0):(o=_C(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(co(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ft(t)},50)}function Iu(t,e){let n=t.state.doc.resolve(e);if(!(Re||rC)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Pu(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||at&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=el(t.state,e);if(s&&s instanceof re)return cn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof tt?ue.near(s,e):ue.findFrom(s,e);return l?cn(t,l):!1}return!1}function Ru(t,e){if(!(t.state.selection instanceof ce))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function zu(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function LC(t){if(!Fe||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;zu(t,r,"true"),setTimeout(()=>zu(t,r,"false"),20)}return!1}function IC(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function PC(t,e){let n=e.keyCode,r=IC(e);if(n==8||at&&n==72&&r=="c")return Ru(t,-1)||pr(t,-1);if(n==46&&!e.shiftKey||at&&n==68&&r=="c")return Ru(t,1)||pr(t,1);if(n==13||n==27)return!0;if(n==37||at&&n==66&&r=="c"){let i=n==37?Iu(t,t.state.selection.from)=="ltr"?-1:1:-1;return _u(t,i,r)||pr(t,i)}else if(n==39||at&&n==70&&r=="c"){let i=n==39?Iu(t,t.state.selection.from)=="ltr"?1:-1:1;return _u(t,i,r)||pr(t,i)}else{if(n==38||at&&n==80&&r=="c")return Pu(t,-1,r)||pr(t,-1);if(n==40||at&&n==78&&r=="c")return LC(t)||Pu(t,1,r)||pr(t,1);if(r==(at?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function nl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Bn.fromSchema(t.state.schema),l=Yu(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=qu[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
11
11
|
|
|
12
12
|
`);return{dom:c,text:h,slice:e}}function ju(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let c=e&&(r||o||!n);if(c){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new K(F.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
13
|
-
`))),0,0):K.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)l=f;else{let h=i.marks(),{schema:p}=t.state,m=Bn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let g=s.appendChild(document.createElement("p"));y&&g.appendChild(m.serializeNode(p.text(y,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=PC(n),si&&RC(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||en.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!_C.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=zC(Uu(l,+u[1],+u[2]),u[4]);else if(l=K.maxOpen(LC(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Uu(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const _C=/^(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 LC(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Hu(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Wu(s[s.length-1],o.length));let u=Fu(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return F.from(s)}return t}function Fu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,F.from(t));return t}function Hu(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Hu(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(F.from(Fu(n,t,i+1))))}}function Wu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Wu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(F.empty,!0);return t.copy(n.append(r))}function rl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=rl(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(F.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Uu(t,e,n){return e<t.openStart&&(t=new K(rl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new K(rl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const qu={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 Ku=null;function Yu(){return Ku||(Ku=document.implementation.createHTMLDocument("title"))}let il=null;function IC(t){let e=window.trustedTypes;return e?(il||(il=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),il.createHTML(t)):t}function PC(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Yu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&qu[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=IC(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function RC(t){let e=t.querySelectorAll(Re?"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 zC(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=F.from(c.create(r[l+1],i)),o++,s++}return new K(i,o,s)}const He={},We={},jC={touchstart:!0,touchmove:!0};class FC{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.lastChromeDelete=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 HC(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{UC(t,r)&&!sl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},jC[e]?{passive:!0}:void 0)}Fe&&t.dom.addEventListener("input",()=>null),ol(t)}function dn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function WC(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 ol(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>sl(t,r))})}function sl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function UC(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 qC(t,e){!sl(t,e)&&He[e.type]&&(t.editable||!(e.type in We))&&He[e.type](t,e)}We.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Gu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(zt&&Re&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fr&&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,Vn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||DC(t,n)?n.preventDefault():dn(t,"key")},We.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},We.keypress=(t,e)=>{let n=e;if(Gu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||at&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function po(t){return{left:t.clientX,top:t.clientY}}function KC(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ll(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function mr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function YC(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&re.isSelectable(r)?(mr(t,new re(n)),!0):!1}function JC(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof re&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(re.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(mr(t,re.create(t.state.doc,i)),!0):!1}function GC(t,e,n,r,i){return ll(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?JC(t,n):YC(t,n))}function ZC(t,e,n,r){return ll(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function XC(t,e,n,r){return ll(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||QC(t,n,r)}function QC(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mr(t,ce.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)mr(t,ce.create(r,l+1,l+1+s.content.size));else if(re.isSelectable(s))mr(t,re.create(r,l));else continue;return!0}}function al(t){return mo(t)}const Ju=at?"metaKey":"ctrlKey";He.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=al(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&KC(n,t.input.lastClick)&&!n[Ju]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(po(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new eS(t,s,n,!!r)):(o=="doubleClick"?ZC:XC)(t,s.pos,s.inside,n)?n.preventDefault():dn(t,"pointer"))};class eS{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[Ju],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof re&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xt&&!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)),dn(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(()=>Ft(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(po(e))),this.updateAllowDefault(e),this.allowDefault||!n?dn(this.view,"pointer"):GC(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fe&&this.mightDrag&&!this.mightDrag.node.isAtom||Re&&!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)?(mr(this.view,ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),dn(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)}}He.touchstart=t=>{t.input.lastTouch=Date.now(),al(t),dn(t,"pointer")},He.touchmove=t=>{t.input.lastTouch=Date.now(),dn(t,"pointer")},He.contextmenu=t=>al(t);function Gu(t,e){return t.composing?!0:Fe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const tS=zt?5e3:-1;We.compositionstart=We.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),mo(t,!0),t.markCursor=null;else if(mo(t,!e.selection.empty),xt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Zu(t,tS)},We.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++,Zu(t,20))};function Zu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>mo(t),e))}function Xu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=rS());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function nS(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Y5(e.focusNode,e.focusOffset),r=J5(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function rS(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function mo(t,e=!1){if(!(zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Xu(t),e||t.docView&&t.docView.dirty){let n=Zs(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function iS(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 ui=Je&&sn<15||fr&&eC<604;He.copy=We.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ui?null:n.clipboardData,s=r.content(),{dom:l,text:c}=nl(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):iS(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function oS(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function sS(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?fi(t,r.value,null,i,e):fi(t,r.textContent,r.innerHTML,i,e)},50)}function fi(t,e,n,r,i){let o=ju(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||K.empty)))return!0;if(!o)return!1;let s=oS(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qu(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," "):""}We.paste=(t,e)=>{let n=e;if(t.composing&&!zt)return;let r=ui?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&fi(t,Qu(r),r.getData("text/html"),i,n)?n.preventDefault():sS(t,n)};class ef{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const tf=at?"altKey":"ctrlKey";He.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(po(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof re?i.to-1:i.to))){if(r&&r.mightDrag)s=re.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=re.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=nl(t,l);(!n.dataTransfer.files.length||!Re||lu>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ui?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ui||n.dataTransfer.setData("text/plain",d),t.dragging=new ef(u,!n[tf],s)},He.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},We.dragover=We.dragenter=(t,e)=>e.preventDefault(),We.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(po(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=ju(t,Qu(n.dataTransfer),ui?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[tf]);if(t.someProp("handleDrop",m=>m(t,n,s||K.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Wd(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(l){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&re.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new re(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((y,g,b,v)=>m=v),d.setSelection(Qs(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},He.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())&&Ft(t)},20))},He.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)},He.beforeinput=(t,e)=>{if(Re&&zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Vn(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 We)He[t]=We[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 go{constructor(e,n){this.toDOM=e,this.spec=n||In,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new rt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof go&&(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 un{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new rt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof un&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}static is(e){return e.type instanceof un}destroy(){}}class cl{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new rt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof cl&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}destroy(){}}class rt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new rt(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 rt(e,e,new go(n,r))}static inline(e,n,r,i){return new rt(e,n,new un(r,i))}static node(e,n,r,i){return new rt(e,n,new cl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof un}get widget(){return this.type instanceof go}}const gr=[],In={};class Ee{constructor(e,n){this.local=e.length?e:gr,this.children=n.length?n:gr}static create(e,n){return n.length?yo(n,e,0,In):ze}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==ze||e.maps.length==0?this:this.mapInner(e,n,0,0,r||In)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?lS(this.children,s||[],e,n,r,i,o):s?new Ee(s.sort(Pn),gr):ze}add(e,n){return n.length?this==ze?Ee.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,c)=>{let d=c+r,u;if(u=rf(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,c,c+l.nodeSize,yo(u,l,d+1,In)),o+=3}});let s=nf(o?of(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ee(s.length?this.local.concat(s).sort(Pn):this.local,i||this.children)}remove(e){return e.length==0||this==ze?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=ze?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):ze}forChild(e,n){if(this==ze)return this;if(n.isLeaf)return Ee.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof un){let d=Math.max(o,c.from)-o,u=Math.min(s,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Ee(i.sort(Pn),gr);return r?new fn([l,r]):l}return r||ze}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 dl(this.localsInner(e))}localsInner(e){if(this==ze)return gr;if(e.inlineContent||!this.local.some(un.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof un||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]),Ee.removeOverlap=dl;const ze=Ee.empty;class fn{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,In));return fn.from(r)}forChild(e,n){if(n.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ze&&(o instanceof fn?r=r.concat(o.members):r.push(o))}return fn.from(r)}eq(e){if(!(e instanceof fn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?dl(r?n:n.sort(Pn)):gr}static from(e){switch(e.length){case 0:return ze;case 1:return e[0];default:return new fn(e.every(n=>n instanceof Ee)?e:e.reduce((n,r)=>n.concat(r instanceof Ee?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function lS(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,y)=>{let g=y-m-(p-h);for(let b=0;b<l.length;b+=3){let v=l[b+1];if(v<0||h>v+u-f)continue;let T=l[b]+u-f;p>=T?l[b+1]=h<=T?-2:-1:h>=u&&g&&(l[b]+=g,l[b+1]+=g)}f+=g}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let h=n.map(t[d+1]+o,-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 b=l[d+2].mapInner(n,g,u+1,t[d]+o+1,s);b!=ze?(l[d]=f,l[d+1]=p,l[d+2]=b):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=aS(l,t,e,n,i,o,s),u=yo(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ee(e.sort(Pn),l)}function nf(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 rt(i.from+e,i.to+e,i.type))}return n}function aS(t,e,n,r,i,o,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+o+1);return n}function rf(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function of(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function yo(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=rf(t,l,c+n);if(d){o=!0;let u=yo(d,l,n+c+1,r);u!=ze&&i.push(c,c+l.nodeSize,u)}});let s=nf(o?of(t):t,-n).sort(Pn);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new Ee(s,i):ze}function Pn(t,e){return t.from-e.from||t.to-e.to}function dl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),sf(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),sf(e,i,r.copy(o.from,r.to)));break}}}return e}function sf(t,e,n){for(;e<t.length&&Pn(n,t[e])>0;)e++;t.splice(e,0,n)}function ul(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ze&&e.push(r)}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),fn.from(e)}const cS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dS=Je&&sn<=11;class uS{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 fS{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new uS,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]);Je&&sn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),dS&&(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,cS)),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(Vu(this.view)){if(this.suppressingSelectionUpdates)return Ft(this.view);if(Je&&sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&An(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=ii(o))n.add(o);for(let o=e.anchorNode;o;o=ii(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Vu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(xt&&c.length){let u=c.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||mS(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&co(r)&&(d=Zs(e))&&d.eq(ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ft(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),hS(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ft(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Je&&sn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?Le(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?Le(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let lf=new WeakMap,af=!1;function hS(t){if(!lf.has(t)&&(lf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=xt,af)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."),af=!0}}function cf(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return An(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function pS(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return cf(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?cf(t,n):null}function mS(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 gS(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],co(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Re&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let b=r.childNodes[g-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){o=g;break}if(!v||v.size)break}let f=t.state.doc,h=t.someProp("domParser")||en.fromSchema(t.state.schema),p=f.resolve(s),m=null,y=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:yS,context:p});if(d&&d[0].pos!=null){let g=d[0].pos,b=d[1]&&d[1].pos;b==null&&(b=g),m={anchor:g+s,head:b+s}}return{doc:y,sel:m,from:s,to:l}}function yS(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Fe&&/^(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||Fe&&/^(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 bS=/^(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 kS(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,B=Zs(t,_);if(B&&!t.state.selection.eq(B)){if(Re&&zt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",q=>q(t,Vn(13,"Enter"))))return;let $=t.state.tr.setSelection(B);_=="pointer"?$.setMeta("pointer",!0):_=="key"&&$.scrollIntoView(),o&&$.setMeta("composition",o),t.dispatch($)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let c=t.state.selection,d=gS(t,e,n),u=t.state.doc,f=u.slice(d.from,d.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=vS(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(fr&&t.input.lastIOSEnter>Date.now()-225||zt)&&i.some(_=>_.nodeType==1&&!bS.test(_.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ce&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let _=df(t,t.state.doc,d.sel);if(_&&!_.eq(t.state.selection)){let B=t.state.tr.setSelection(_);o&&B.setMeta("composition",o),t.dispatch(B)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ce&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Je&&sn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let y=d.doc.resolveNoCache(m.start-d.from),g=d.doc.resolveNoCache(m.endB-d.from),b=u.resolve(m.start),v=y.sameParent(g)&&y.parent.inlineContent&&b.end()>=m.endA,T;if((fr&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!v&&y.pos<d.doc.content.size&&!y.sameParent(g)&&(T=ue.findFrom(d.doc.resolve(y.pos+1),1,!0))&&T.head==g.pos)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&wS(u,m.start,m.endA,y,g)&&t.someProp("handleKeyDown",_=>_(t,Vn(8,"Backspace")))){zt&&Re&&t.domObserver.suppressSelectionUpdates();return}Re&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),zt&&!v&&y.start()!=g.start()&&g.parentOffset==0&&y.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,g=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,Vn(13,"Enter"))})},20));let k=m.start,M=m.endA,w,A,P;if(v){if(y.pos==g.pos)Je&&sn<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ft(t),20)),w=t.state.tr.delete(k,M),A=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(P=xS(y.parent.content.cut(y.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))w=t.state.tr,P.type=="add"?w.addMark(k,M,P.mark):w.removeMark(k,M,P.mark);else if(y.parent.child(y.index()).isText&&y.index()==g.index()-(g.textOffset?0:1)){let _=y.parent.textBetween(y.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",B=>B(t,k,M,_)))return;w=t.state.tr.insertText(_,k,M)}}if(w||(w=t.state.tr.replace(k,M,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let _=df(t,w.doc,d.sel);_&&!(Re&&t.composing&&_.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==k||_.head==w.mapping.map(M)-1)||Je&&_.empty&&_.head==k)&&w.setSelection(_)}A&&w.ensureMarks(A),o&&w.setMeta("composition",o),t.dispatch(w.scrollIntoView())}function df(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Qs(t,e.resolve(n.anchor),e.resolve(n.head))}function xS(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",c=u=>u.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(F.from(d).eq(t))return{mark:l,type:s}}function wS(t,e,n,r,i){if(n-e<=i.pos-r.pos||fl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(fl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||fl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function fl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function vS(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&t.size<e.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<e.size&&uf(e.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<t.size&&uf(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function uf(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 CS{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 FC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(gf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=pf(this),hf(this),this.nodeViews=mf(this),this.docView=wu(this.state.doc,ff(this),ul(this),this.dom,this),this.domObserver=new fS(this,(r,i,o,s)=>kS(this,r,i,o,s)),this.domObserver.start(),HC(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&&ol(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(gf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Xu(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=mf(this);ES(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&ol(this),this.editable=pf(this),hf(this);let c=ul(this),d=ff(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,c);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&rC(this);if(s){this.domObserver.stop();let p=f&&(Je||Re)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&SS(i.selection,e.selection);if(f){let m=Re?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=nS(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=wu(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&MC(this))?Ft(this,p):(Bu(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&&iC(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&au(this,n.getBoundingClientRect(),e)}else au(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new ef(e.slice,e.move,i<0?void 0:re.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Je){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&&oC(this.dom),Ft(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 dC(this,e)}coordsAtPos(e,n=1){return pu(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 mC(this,n||this.state,e)}pasteHTML(e,n){return fi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return fi(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return nl(this,e)}destroy(){this.docView&&(WC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ul(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,q5())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return qC(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 e?Fe&&this.root.nodeType===11&&Z5(this.dom.ownerDocument)==this.dom&&pS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ff(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"),[rt.node(0,t.state.doc.content.size,e)]}function hf(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:rt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function pf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function SS(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 mf(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 ES(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 gf(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:"'"},bo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OS=typeof navigator<"u"&&/Mac/.test(navigator.platform),MS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ie=0;Ie<10;Ie++)hn[48+Ie]=hn[96+Ie]=String(Ie);for(var Ie=1;Ie<=24;Ie++)hn[Ie+111]="F"+Ie;for(var Ie=65;Ie<=90;Ie++)hn[Ie]=String.fromCharCode(Ie+32),bo[Ie]=String.fromCharCode(Ie);for(var hl in hn)bo.hasOwnProperty(hl)||(bo[hl]=hn[hl]);function TS(t){var e=OS&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||MS&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?bo: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 $S=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function NS(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))$S?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function BS(t){let e=Object.create(null);for(let n in t)e[NS(n)]=t[n];return e}function pl(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 AS(t){return new _e({props:{handleKeyDown:yf(t)}})}function yf(t){let e=BS(t);return function(n,r){let i=TS(r),o,s=e[pl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[pl(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=hn[r.keyCode])&&o!=i){let l=e[pl(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ml=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function bf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const kf=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);if(!i){let s=r.blockRange(),l=s&&lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(Tf(t,i,e,-1))return!0;if(r.parent.content.size==0&&(yr(o,"end")||re.isSelectable(o)))for(let s=r.depth;;s--){let l=lo(t.doc,r.before(s),r.after(s),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(yr(o,"end")?ue.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):re.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},VS=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);return i?xf(t,i,e):!1},DS=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);return i?xf(t,i,e):!1};function xf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=lo(t.doc,o,c,K.empty);if(!d||d.from!=o||d instanceof $e&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ce.create(u.doc,o)),n(u.scrollIntoView())}return!0}function yr(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 wf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=gl(r)}let s=o&&o.nodeBefore;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function gl(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 vf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Cf=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);if(!i)return!1;let o=i.nodeAfter;if(Tf(t,i,e,1))return!0;if(r.parent.content.size==0&&(yr(o,"start")||re.isSelectable(o))){let s=lo(t.doc,r.before(),r.after(),K.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(yr(o,"start")?ue.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):re.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Sf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=yl(r)}let s=o&&o.nodeAfter;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos)).scrollIntoView()),!0)};function yl(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 _S=(t,e)=>{let n=t.selection,r=n instanceof re,i;if(r){if(n.node.isTextblock||!rn(t.doc,n.from))return!1;i=n.from}else if(i=so(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(re.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},LS=(t,e)=>{let n=t.selection,r;if(n instanceof re){if(n.node.isTextblock||!rn(t.doc,n.to))return!1;r=n.to}else if(r=so(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},IS=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Ef=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
14
|
-
`).scrollIntoView()),!0)};function bl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const PS=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=bl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(ue.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},Of=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof tt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(ce.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},Mf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Pt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function RS(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof re&&e.selection.node.isBlock)return!r.parentOffset||!Pt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),l=bl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&l?{type:l}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ce||e.selection instanceof tt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Pt(u.doc,f,o.length,o);if(h||(o[0]=l?{type:l}:null,h=Pt(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=l){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);l&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return n&&n(u.scrollIntoView()),!0}}const zS=RS(),jS=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(re.create(t.doc,i))),!0)};function FS(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Tf(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&FS(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=F.empty;for(let b=s.length-1;b>=0;b--)m=F.from(s[b].create(null,m));m=F.from(i.copy(m));let y=t.tr.step(new Ne(e.pos-1,p,e.pos,p,new K(m,1,0),s.length,!0)),g=y.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&rn(y.doc,g.pos)&&y.join(g.pos),n(y.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:ue.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&lr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&yr(o,"start",!0)&&yr(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let y=o,g=1;for(;!y.isTextblock;y=y.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,y.content)){if(n){let b=F.empty;for(let T=m.length-1;T>=0;T--)b=F.from(m[T].copy(b));let v=t.tr.step(new Ne(e.pos-m.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new K(b,m.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function $f(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(ce.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const HS=$f(-1),WS=$f(1);function US(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Ls(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Nf(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(l,c,t,e)}r(o.scrollIntoView())}return!0}}function kl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}kl(ml,kf,wf),kl(ml,Cf,Sf),kl(Ef,Of,Mf,zS),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function qS(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let l=r?n.tr:null;return KS(l,s,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function KS(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);o=new Qi(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Qi(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=Ls(o,n,r,e);return l?(t&&YS(t,e,l,i,n),!0):!1}function YS(t,e,n,r,i){let o=F.empty;for(let u=n.length-1;u>=0;u--)o=F.from(n[u].type.create(n[u].attrs,o));t.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new K(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let l=n.length-s,c=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Pt(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function JS(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?GS(e,n,t,o):ZS(e,n,o):!0:!1}}function GS(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ne(o-1,s,o,s,new K(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Qi(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=lr(r);if(l==null)return!1;i.lift(r,l);let c=i.mapping.map(o,-1)-1;return rn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function ZS(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,y=n.startIndex;m>y;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(l?0:1),u+1,s.content.append(c?F.empty:F.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Ne(f-(l?1:0),h+(c?1:0),f+1,h-1,new K((l?F.empty:F.from(i.copy(F.empty))).append(c?F.empty:F.from(i.copy(F.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function XS(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,c=l.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,u=F.from(d?t.create():null),f=new K(F.from(t.create(null,F.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ne(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function ko(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class xo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>{const f=c(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...y)=>{const g=this.buildProps(d,n),b=p(...y)(g);return l.push(b),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ko({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}}class QS{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function Q(t,e,n){return t.config[e]===void 0&&t.parent?Q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Q(t.parent,e,n):null}):t.config[e]}function wo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Bf(t){const e=[],{nodeExtensions:n,markExtensions:r}=wo(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=Q(s,"addGlobalAttributes",l);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},c=Q(s,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Be(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function xe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),l.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function xl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>xe(n,r),{})}function Af(t){return typeof t=="function"}function fe(t,e=void 0,...n){return Af(t)?e?t.bind(e)(...n):t(...n):t}function eE(t={}){return Object.keys(t).length===0&&t.constructor===Object}function tE(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Vf(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):tE(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function Df(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&eE(n)?!1:n!=null))}function nE(t,e){var n;const r=Bf(t),{nodeExtensions:i,markExtensions:o}=wo(t),s=(n=i.find(d=>Q(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(b=>b.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((b,v)=>{const T=Q(v,"extendNodeSchema",f);return{...b,...T?T(d):{}}},{}),p=Df({...h,content:fe(Q(d,"content",f)),marks:fe(Q(d,"marks",f)),group:fe(Q(d,"group",f)),inline:fe(Q(d,"inline",f)),atom:fe(Q(d,"atom",f)),selectable:fe(Q(d,"selectable",f)),draggable:fe(Q(d,"draggable",f)),code:fe(Q(d,"code",f)),whitespace:fe(Q(d,"whitespace",f)),linebreakReplacement:fe(Q(d,"linebreakReplacement",f)),defining:fe(Q(d,"defining",f)),isolating:fe(Q(d,"isolating",f)),attrs:Object.fromEntries(u.map(b=>{var v;return[b.name,{default:(v=b==null?void 0:b.attribute)===null||v===void 0?void 0:v.default}]}))}),m=fe(Q(d,"parseHTML",f));m&&(p.parseDOM=m.map(b=>Vf(b,u)));const y=Q(d,"renderHTML",f);y&&(p.toDOM=b=>y({node:b,HTMLAttributes:xl(b,u)}));const g=Q(d,"renderText",f);return g&&(p.toText=g),[d.name,p]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(g=>g.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((g,b)=>{const v=Q(b,"extendMarkSchema",f);return{...g,...v?v(d):{}}},{}),p=Df({...h,inclusive:fe(Q(d,"inclusive",f)),excludes:fe(Q(d,"excludes",f)),group:fe(Q(d,"group",f)),spanning:fe(Q(d,"spanning",f)),code:fe(Q(d,"code",f)),attrs:Object.fromEntries(u.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),m=fe(Q(d,"parseHTML",f));m&&(p.parseDOM=m.map(g=>Vf(g,u)));const y=Q(d,"renderHTML",f);return y&&(p.toDOM=g=>y({mark:g,HTMLAttributes:xl(g,u)})),[d.name,p]}));return new Sd({topNode:s,nodes:l,marks:c})}function wl(t,e){return e.nodes[t]||e.marks[t]||null}function _f(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function vl(t,e){const n=Bn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const rE=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Cl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class vo{constructor(e){this.find=e.find,this.handler=e.handler}}const iE=(t,e)=>{if(Cl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Co(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=rE(d)+o;return s.forEach(h=>{if(u)return;const p=iE(f,h.find);if(!p)return;const m=c.state.tr,y=ko({state:c.state,transaction:m}),g={from:r-(p[0].length-o.length),to:i},{commands:b,chain:v,can:T}=new xo({editor:n,state:y});h.handler({state:y,range:g,match:p,commands:b,chain:v,can:T})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function oE(t){const{editor:e,rules:n}=t,r=new _e({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=vl(F.from(u),s.schema);const{from:f}=c,h=f+u.length;Co({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Co({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Co({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Co({editor:e,from:s.pos,to:s.pos,text:`
|
|
15
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
13
|
+
`))),0,0):K.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)l=f;else{let h=i.marks(),{schema:p}=t.state,m=Bn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=FC(n),si&&HC(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||en.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!RC.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=WC(Uu(l,+u[1],+u[2]),u[4]);else if(l=K.maxOpen(zC(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Uu(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const RC=/^(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 zC(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Hu(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Wu(s[s.length-1],o.length));let u=Fu(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return F.from(s)}return t}function Fu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,F.from(t));return t}function Hu(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Hu(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(F.from(Fu(n,t,i+1))))}}function Wu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Wu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(F.empty,!0);return t.copy(n.append(r))}function rl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=rl(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(F.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Uu(t,e,n){return e<t.openStart&&(t=new K(rl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new K(rl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const qu={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 Ku=null;function Yu(){return Ku||(Ku=document.implementation.createHTMLDocument("title"))}let il=null;function jC(t){let e=window.trustedTypes;return e?(il||(il=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),il.createHTML(t)):t}function FC(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Yu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&qu[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=jC(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function HC(t){let e=t.querySelectorAll(Re?"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 WC(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=F.from(c.create(r[l+1],i)),o++,s++}return new K(i,o,s)}const He={},We={},UC={touchstart:!0,touchmove:!0};class qC{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.lastChromeDelete=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 KC(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{JC(t,r)&&!sl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},UC[e]?{passive:!0}:void 0)}Fe&&t.dom.addEventListener("input",()=>null),ol(t)}function dn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function YC(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 ol(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>sl(t,r))})}function sl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function JC(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 GC(t,e){!sl(t,e)&&He[e.type]&&(t.editable||!(e.type in We))&&He[e.type](t,e)}We.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Gu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(zt&&Re&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fr&&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,Vn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||PC(t,n)?n.preventDefault():dn(t,"key")},We.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},We.keypress=(t,e)=>{let n=e;if(Gu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||at&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function po(t){return{left:t.clientX,top:t.clientY}}function ZC(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ll(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function mr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function XC(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&re.isSelectable(r)?(mr(t,new re(n)),!0):!1}function QC(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof re&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(re.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(mr(t,re.create(t.state.doc,i)),!0):!1}function eS(t,e,n,r,i){return ll(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?QC(t,n):XC(t,n))}function tS(t,e,n,r){return ll(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function nS(t,e,n,r){return ll(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||rS(t,n,r)}function rS(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mr(t,ce.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)mr(t,ce.create(r,l+1,l+1+s.content.size));else if(re.isSelectable(s))mr(t,re.create(r,l));else continue;return!0}}function al(t){return mo(t)}const Ju=at?"metaKey":"ctrlKey";He.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=al(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&ZC(n,t.input.lastClick)&&!n[Ju]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(po(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new iS(t,s,n,!!r)):(o=="doubleClick"?tS:nS)(t,s.pos,s.inside,n)?n.preventDefault():dn(t,"pointer"))};class iS{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[Ju],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof re&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xt&&!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)),dn(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(()=>Ft(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(po(e))),this.updateAllowDefault(e),this.allowDefault||!n?dn(this.view,"pointer"):eS(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fe&&this.mightDrag&&!this.mightDrag.node.isAtom||Re&&!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)?(mr(this.view,ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),dn(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)}}He.touchstart=t=>{t.input.lastTouch=Date.now(),al(t),dn(t,"pointer")},He.touchmove=t=>{t.input.lastTouch=Date.now(),dn(t,"pointer")},He.contextmenu=t=>al(t);function Gu(t,e){return t.composing?!0:Fe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const oS=zt?5e3:-1;We.compositionstart=We.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),mo(t,!0),t.markCursor=null;else if(mo(t,!e.selection.empty),xt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Zu(t,oS)},We.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++,Zu(t,20))};function Zu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>mo(t),e))}function Xu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=lS());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function sS(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=X5(e.focusNode,e.focusOffset),r=Q5(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function lS(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function mo(t,e=!1){if(!(zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Xu(t),e||t.docView&&t.docView.dirty){let n=Zs(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function aS(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 ui=Je&&sn<15||fr&&iC<604;He.copy=We.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ui?null:n.clipboardData,s=r.content(),{dom:l,text:c}=nl(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):aS(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function cS(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function dS(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?fi(t,r.value,null,i,e):fi(t,r.textContent,r.innerHTML,i,e)},50)}function fi(t,e,n,r,i){let o=ju(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||K.empty)))return!0;if(!o)return!1;let s=cS(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qu(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," "):""}We.paste=(t,e)=>{let n=e;if(t.composing&&!zt)return;let r=ui?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&fi(t,Qu(r),r.getData("text/html"),i,n)?n.preventDefault():dS(t,n)};class ef{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const tf=at?"altKey":"ctrlKey";He.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(po(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof re?i.to-1:i.to))){if(r&&r.mightDrag)s=re.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=re.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=nl(t,l);(!n.dataTransfer.files.length||!Re||lu>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ui?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ui||n.dataTransfer.setData("text/plain",d),t.dragging=new ef(u,!n[tf],s)},He.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},We.dragover=We.dragenter=(t,e)=>e.preventDefault(),We.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(po(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=ju(t,Qu(n.dataTransfer),ui?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[tf]);if(t.someProp("handleDrop",m=>m(t,n,s||K.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Wd(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(l){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&re.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new re(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,b,w)=>m=w),d.setSelection(Qs(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},He.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())&&Ft(t)},20))},He.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)},He.beforeinput=(t,e)=>{if(Re&&zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Vn(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 We)He[t]=We[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 go{constructor(e,n){this.toDOM=e,this.spec=n||In,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new rt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof go&&(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 un{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new rt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof un&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}static is(e){return e.type instanceof un}destroy(){}}class cl{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new rt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof cl&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}destroy(){}}class rt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new rt(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 rt(e,e,new go(n,r))}static inline(e,n,r,i){return new rt(e,n,new un(r,i))}static node(e,n,r,i){return new rt(e,n,new cl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof un}get widget(){return this.type instanceof go}}const gr=[],In={};class Ee{constructor(e,n){this.local=e.length?e:gr,this.children=n.length?n:gr}static create(e,n){return n.length?yo(n,e,0,In):ze}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==ze||e.maps.length==0?this:this.mapInner(e,n,0,0,r||In)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?uS(this.children,s||[],e,n,r,i,o):s?new Ee(s.sort(Pn),gr):ze}add(e,n){return n.length?this==ze?Ee.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,c)=>{let d=c+r,u;if(u=rf(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,c,c+l.nodeSize,yo(u,l,d+1,In)),o+=3}});let s=nf(o?of(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ee(s.length?this.local.concat(s).sort(Pn):this.local,i||this.children)}remove(e){return e.length==0||this==ze?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=ze?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):ze}forChild(e,n){if(this==ze)return this;if(n.isLeaf)return Ee.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof un){let d=Math.max(o,c.from)-o,u=Math.min(s,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Ee(i.sort(Pn),gr);return r?new fn([l,r]):l}return r||ze}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 dl(this.localsInner(e))}localsInner(e){if(this==ze)return gr;if(e.inlineContent||!this.local.some(un.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof un||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]),Ee.removeOverlap=dl;const ze=Ee.empty;class fn{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,In));return fn.from(r)}forChild(e,n){if(n.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ze&&(o instanceof fn?r=r.concat(o.members):r.push(o))}return fn.from(r)}eq(e){if(!(e instanceof fn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?dl(r?n:n.sort(Pn)):gr}static from(e){switch(e.length){case 0:return ze;case 1:return e[0];default:return new fn(e.every(n=>n instanceof Ee)?e:e.reduce((n,r)=>n.concat(r instanceof Ee?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function uS(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let b=0;b<l.length;b+=3){let w=l[b+1];if(w<0||h>w+u-f)continue;let T=l[b]+u-f;p>=T?l[b+1]=h<=T?-2:-1:h>=u&&y&&(l[b]+=y,l[b+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let h=n.map(t[d+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let b=l[d+2].mapInner(n,y,u+1,t[d]+o+1,s);b!=ze?(l[d]=f,l[d+1]=p,l[d+2]=b):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=fS(l,t,e,n,i,o,s),u=yo(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ee(e.sort(Pn),l)}function nf(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 rt(i.from+e,i.to+e,i.type))}return n}function fS(t,e,n,r,i,o,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+o+1);return n}function rf(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function of(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function yo(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=rf(t,l,c+n);if(d){o=!0;let u=yo(d,l,n+c+1,r);u!=ze&&i.push(c,c+l.nodeSize,u)}});let s=nf(o?of(t):t,-n).sort(Pn);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new Ee(s,i):ze}function Pn(t,e){return t.from-e.from||t.to-e.to}function dl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),sf(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),sf(e,i,r.copy(o.from,r.to)));break}}}return e}function sf(t,e,n){for(;e<t.length&&Pn(n,t[e])>0;)e++;t.splice(e,0,n)}function ul(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ze&&e.push(r)}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),fn.from(e)}const hS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pS=Je&&sn<=11;class mS{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 gS{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mS,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]);Je&&sn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),pS&&(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,hS)),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(Vu(this.view)){if(this.suppressingSelectionUpdates)return Ft(this.view);if(Je&&sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&An(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=ii(o))n.add(o);for(let o=e.anchorNode;o;o=ii(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Vu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(xt&&c.length){let u=c.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||kS(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&co(r)&&(d=Zs(e))&&d.eq(ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ft(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),yS(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ft(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Je&&sn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?Le(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?Le(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let lf=new WeakMap,af=!1;function yS(t){if(!lf.has(t)&&(lf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=xt,af)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."),af=!0}}function cf(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return An(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function bS(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return cf(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?cf(t,n):null}function kS(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 xS(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],co(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Re&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){o=y;break}if(!w||w.size)break}let f=t.state.doc,h=t.someProp("domParser")||en.fromSchema(t.state.schema),p=f.resolve(s),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:wS,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,b=d[1]&&d[1].pos;b==null&&(b=y),m={anchor:y+s,head:b+s}}return{doc:g,sel:m,from:s,to:l}}function wS(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Fe&&/^(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||Fe&&/^(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 vS=/^(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 CS(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,B=Zs(t,_);if(B&&!t.state.selection.eq(B)){if(Re&&zt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",q=>q(t,Vn(13,"Enter"))))return;let $=t.state.tr.setSelection(B);_=="pointer"?$.setMeta("pointer",!0):_=="key"&&$.scrollIntoView(),o&&$.setMeta("composition",o),t.dispatch($)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let c=t.state.selection,d=xS(t,e,n),u=t.state.doc,f=u.slice(d.from,d.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=OS(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(fr&&t.input.lastIOSEnter>Date.now()-225||zt)&&i.some(_=>_.nodeType==1&&!vS.test(_.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ce&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let _=df(t,t.state.doc,d.sel);if(_&&!_.eq(t.state.selection)){let B=t.state.tr.setSelection(_);o&&B.setMeta("composition",o),t.dispatch(B)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ce&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Je&&sn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),b=u.resolve(m.start),w=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,T;if((fr&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!w&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(T=ue.findFrom(d.doc.resolve(g.pos+1),1,!0))&&T.head==y.pos)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&ES(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",_=>_(t,Vn(8,"Backspace")))){zt&&Re&&t.domObserver.suppressSelectionUpdates();return}Re&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),zt&&!w&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,Vn(13,"Enter"))})},20));let k=m.start,M=m.endA,v,A,P;if(w){if(g.pos==y.pos)Je&&sn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ft(t),20)),v=t.state.tr.delete(k,M),A=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(P=SS(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))v=t.state.tr,P.type=="add"?v.addMark(k,M,P.mark):v.removeMark(k,M,P.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let _=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",B=>B(t,k,M,_)))return;v=t.state.tr.insertText(_,k,M)}}if(v||(v=t.state.tr.replace(k,M,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let _=df(t,v.doc,d.sel);_&&!(Re&&t.composing&&_.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==k||_.head==v.mapping.map(M)-1)||Je&&_.empty&&_.head==k)&&v.setSelection(_)}A&&v.ensureMarks(A),o&&v.setMeta("composition",o),t.dispatch(v.scrollIntoView())}function df(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Qs(t,e.resolve(n.anchor),e.resolve(n.head))}function SS(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",c=u=>u.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(F.from(d).eq(t))return{mark:l,type:s}}function ES(t,e,n,r,i){if(n-e<=i.pos-r.pos||fl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(fl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||fl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function fl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function OS(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&t.size<e.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<e.size&&uf(e.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<t.size&&uf(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function uf(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 MS{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 qC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(gf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=pf(this),hf(this),this.nodeViews=mf(this),this.docView=wu(this.state.doc,ff(this),ul(this),this.dom,this),this.domObserver=new gS(this,(r,i,o,s)=>CS(this,r,i,o,s)),this.domObserver.start(),KC(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&&ol(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(gf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Xu(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=mf(this);$S(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&ol(this),this.editable=pf(this),hf(this);let c=ul(this),d=ff(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,c);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&lC(this);if(s){this.domObserver.stop();let p=f&&(Je||Re)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&TS(i.selection,e.selection);if(f){let m=Re?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=sS(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=wu(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BC(this))?Ft(this,p):(Bu(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&&aC(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&au(this,n.getBoundingClientRect(),e)}else au(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new ef(e.slice,e.move,i<0?void 0:re.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Je){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&&cC(this.dom),Ft(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 pC(this,e)}coordsAtPos(e,n=1){return pu(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 kC(this,n||this.state,e)}pasteHTML(e,n){return fi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return fi(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return nl(this,e)}destroy(){this.docView&&(YC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ul(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,G5())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return GC(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 e?Fe&&this.root.nodeType===11&&tC(this.dom.ownerDocument)==this.dom&&bS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ff(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"),[rt.node(0,t.state.doc.content.size,e)]}function hf(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:rt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function pf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function TS(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 mf(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 $S(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 gf(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:"'"},bo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},NS=typeof navigator<"u"&&/Mac/.test(navigator.platform),BS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ie=0;Ie<10;Ie++)hn[48+Ie]=hn[96+Ie]=String(Ie);for(var Ie=1;Ie<=24;Ie++)hn[Ie+111]="F"+Ie;for(var Ie=65;Ie<=90;Ie++)hn[Ie]=String.fromCharCode(Ie+32),bo[Ie]=String.fromCharCode(Ie);for(var hl in hn)bo.hasOwnProperty(hl)||(bo[hl]=hn[hl]);function AS(t){var e=NS&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||BS&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?bo: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 VS=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DS(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))VS?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function _S(t){let e=Object.create(null);for(let n in t)e[DS(n)]=t[n];return e}function pl(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 LS(t){return new _e({props:{handleKeyDown:yf(t)}})}function yf(t){let e=_S(t);return function(n,r){let i=AS(r),o,s=e[pl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[pl(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=hn[r.keyCode])&&o!=i){let l=e[pl(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ml=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function bf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const kf=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);if(!i){let s=r.blockRange(),l=s&&lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(Tf(t,i,e,-1))return!0;if(r.parent.content.size==0&&(yr(o,"end")||re.isSelectable(o)))for(let s=r.depth;;s--){let l=lo(t.doc,r.before(s),r.after(s),K.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(yr(o,"end")?ue.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):re.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},IS=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);return i?xf(t,i,e):!1},PS=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);return i?xf(t,i,e):!1};function xf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=lo(t.doc,o,c,K.empty);if(!d||d.from!=o||d instanceof $e&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ce.create(u.doc,o)),n(u.scrollIntoView())}return!0}function yr(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 wf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=gl(r)}let s=o&&o.nodeBefore;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function gl(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 vf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Cf=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);if(!i)return!1;let o=i.nodeAfter;if(Tf(t,i,e,1))return!0;if(r.parent.content.size==0&&(yr(o,"start")||re.isSelectable(o))){let s=lo(t.doc,r.before(),r.after(),K.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(yr(o,"start")?ue.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):re.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Sf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=yl(r)}let s=o&&o.nodeAfter;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos)).scrollIntoView()),!0)};function yl(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 RS=(t,e)=>{let n=t.selection,r=n instanceof re,i;if(r){if(n.node.isTextblock||!rn(t.doc,n.from))return!1;i=n.from}else if(i=so(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(re.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},zS=(t,e)=>{let n=t.selection,r;if(n instanceof re){if(n.node.isTextblock||!rn(t.doc,n.to))return!1;r=n.to}else if(r=so(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},jS=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Ef=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
14
|
+
`).scrollIntoView()),!0)};function bl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const FS=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=bl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(ue.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},Of=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof tt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(ce.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},Mf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Pt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function HS(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof re&&e.selection.node.isBlock)return!r.parentOffset||!Pt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),l=bl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&l?{type:l}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ce||e.selection instanceof tt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Pt(u.doc,f,o.length,o);if(h||(o[0]=l?{type:l}:null,h=Pt(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=l){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);l&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return n&&n(u.scrollIntoView()),!0}}const WS=HS(),US=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(re.create(t.doc,i))),!0)};function qS(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Tf(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&qS(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=F.empty;for(let b=s.length-1;b>=0;b--)m=F.from(s[b].create(null,m));m=F.from(i.copy(m));let g=t.tr.step(new Ne(e.pos-1,p,e.pos,p,new K(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&rn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:ue.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&lr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&yr(o,"start",!0)&&yr(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=F.empty;for(let T=m.length-1;T>=0;T--)b=F.from(m[T].copy(b));let w=t.tr.step(new Ne(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new K(b,m.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function $f(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(ce.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const KS=$f(-1),YS=$f(1);function JS(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Ls(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Nf(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(l,c,t,e)}r(o.scrollIntoView())}return!0}}function kl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}kl(ml,kf,wf),kl(ml,Cf,Sf),kl(Ef,Of,Mf,WS),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function GS(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let l=r?n.tr:null;return ZS(l,s,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function ZS(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);o=new Qi(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Qi(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=Ls(o,n,r,e);return l?(t&&XS(t,e,l,i,n),!0):!1}function XS(t,e,n,r,i){let o=F.empty;for(let u=n.length-1;u>=0;u--)o=F.from(n[u].type.create(n[u].attrs,o));t.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new K(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let l=n.length-s,c=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Pt(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function QS(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?eE(e,n,t,o):tE(e,n,o):!0:!1}}function eE(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ne(o-1,s,o,s,new K(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Qi(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=lr(r);if(l==null)return!1;i.lift(r,l);let c=i.mapping.map(o,-1)-1;return rn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function tE(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(l?0:1),u+1,s.content.append(c?F.empty:F.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Ne(f-(l?1:0),h+(c?1:0),f+1,h-1,new K((l?F.empty:F.from(i.copy(F.empty))).append(c?F.empty:F.from(i.copy(F.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function nE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,c=l.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,u=F.from(d?t.create():null),f=new K(F.from(t.create(null,F.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ne(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function ko(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class xo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>{const f=c(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),b=p(...g)(y);return l.push(b),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ko({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}}class rE{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function Q(t,e,n){return t.config[e]===void 0&&t.parent?Q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Q(t.parent,e,n):null}):t.config[e]}function wo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Bf(t){const e=[],{nodeExtensions:n,markExtensions:r}=wo(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=Q(s,"addGlobalAttributes",l);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},c=Q(s,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Be(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function xe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),l.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function xl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>xe(n,r),{})}function Af(t){return typeof t=="function"}function fe(t,e=void 0,...n){return Af(t)?e?t.bind(e)(...n):t(...n):t}function iE(t={}){return Object.keys(t).length===0&&t.constructor===Object}function oE(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Vf(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):oE(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function Df(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&iE(n)?!1:n!=null))}function sE(t,e){var n;const r=Bf(t),{nodeExtensions:i,markExtensions:o}=wo(t),s=(n=i.find(d=>Q(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(b=>b.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((b,w)=>{const T=Q(w,"extendNodeSchema",f);return{...b,...T?T(d):{}}},{}),p=Df({...h,content:fe(Q(d,"content",f)),marks:fe(Q(d,"marks",f)),group:fe(Q(d,"group",f)),inline:fe(Q(d,"inline",f)),atom:fe(Q(d,"atom",f)),selectable:fe(Q(d,"selectable",f)),draggable:fe(Q(d,"draggable",f)),code:fe(Q(d,"code",f)),whitespace:fe(Q(d,"whitespace",f)),linebreakReplacement:fe(Q(d,"linebreakReplacement",f)),defining:fe(Q(d,"defining",f)),isolating:fe(Q(d,"isolating",f)),attrs:Object.fromEntries(u.map(b=>{var w;return[b.name,{default:(w=b==null?void 0:b.attribute)===null||w===void 0?void 0:w.default}]}))}),m=fe(Q(d,"parseHTML",f));m&&(p.parseDOM=m.map(b=>Vf(b,u)));const g=Q(d,"renderHTML",f);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:xl(b,u)}));const y=Q(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((y,b)=>{const w=Q(b,"extendMarkSchema",f);return{...y,...w?w(d):{}}},{}),p=Df({...h,inclusive:fe(Q(d,"inclusive",f)),excludes:fe(Q(d,"excludes",f)),group:fe(Q(d,"group",f)),spanning:fe(Q(d,"spanning",f)),code:fe(Q(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),m=fe(Q(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>Vf(y,u)));const g=Q(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:xl(y,u)})),[d.name,p]}));return new Sd({topNode:s,nodes:l,marks:c})}function wl(t,e){return e.nodes[t]||e.marks[t]||null}function _f(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function vl(t,e){const n=Bn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const lE=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Cl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class vo{constructor(e){this.find=e.find,this.handler=e.handler}}const aE=(t,e)=>{if(Cl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Co(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=lE(d)+o;return s.forEach(h=>{if(u)return;const p=aE(f,h.find);if(!p)return;const m=c.state.tr,g=ko({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:w,can:T}=new xo({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:b,chain:w,can:T})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function cE(t){const{editor:e,rules:n}=t,r=new _e({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=vl(F.from(u),s.schema);const{from:f}=c,h=f+u.length;Co({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Co({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Co({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Co({editor:e,from:s.pos,to:s.pos,text:`
|
|
15
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function dE(t){return Object.prototype.toString.call(t).slice(8,-1)}function So(t){return dE(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Eo(t,e){const n={...t};return So(t)&&So(e)&&Object.keys(e).forEach(r=>{So(e[r])&&So(t[r])?n[r]=Eo(t[r],e[r]):n[r]=e[r]}),n}class dt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(Q(this,"addOptions",{name:this.name}))),this.storage=fe(Q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new dt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new dt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(Q(n,"addOptions",{name:n.name})),n.storage=fe(Q(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const c=s.find(d=>(d==null?void 0:d.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function uE(t){return typeof t=="number"}class fE{constructor(e){this.find=e.find,this.handler=e.handler}}const hE=(t,e,n)=>{if(Cl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function pE(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:c,chain:d,can:u}=new xo({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{if(!p.isTextblock||p.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+p.content.size),b=p.textBetween(g-m,y-m,void 0,"");hE(b,o.find,s).forEach(T=>{if(T.index===void 0)return;const k=g+T.index+1,M=k+T[0].length,v={from:n.tr.mapping.map(k),to:n.tr.mapping.map(M)},A=o.handler({state:n,range:v,match:T,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(A)})}),f.every(p=>p!==null)}let Oo=null;const mE=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function gE(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=ko({state:u,transaction:g});if(!(!pE({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new _e({view(f){const h=m=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null,r&&(Oo=e)},p=()=>{Oo&&(Oo=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(o=r===f.dom.parentElement,l=h,!o){const p=Oo;p&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,b=m.getMeta("applyPasteRules"),w=!!b;if(!g&&!y&&!w)return;if(w){let{text:M}=b;typeof M=="string"?M=M:M=vl(F.from(M),p.schema);const{from:v}=b,A=v+M.length,P=mE(M);return c({rule:u,state:p,from:v,to:{b:A},pasteEvt:P})}const T=h.doc.content.findDiffStart(p.doc.content),k=h.doc.content.findDiffEnd(p.doc.content);if(!(!uE(T)||!k||T===k.b))return c({rule:u,state:p,from:T,to:k,pasteEvt:s})}}))}function yE(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class br{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=br.resolve(e),this.schema=sE(this.extensions,n),this.setupExtensions()}static resolve(e){const n=br.sort(br.flatten(e)),r=yE(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=Q(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=Q(r,"priority")||100,s=Q(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:wl(n.name,this.schema)},i=Q(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=br.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:wl(s.name,this.schema)},c=[],d=Q(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&Q(s,"exitable",l)&&(u.ArrowRight=()=>dt.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,b])=>[y,()=>b({editor:e})]));u={...u,...g}}const f=LS(u);c.push(f);const h=Q(s,"addInputRules",l);_f(s,e.options.enableInputRules)&&h&&r.push(...h());const p=Q(s,"addPasteRules",l);_f(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=Q(s,"addProseMirrorPlugins",l);if(m){const g=m();c.push(...g)}return c}).flat();return[cE({editor:e,rules:r}),...gE({editor:e,rules:i}),...o]}get attributes(){return Bf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=wo(this.extensions);return Object.fromEntries(n.filter(r=>!!Q(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Be(r.name,this.schema)},s=Q(r,"addNodeView",o);if(!s)return[];const l=(c,d,u,f,h)=>{const p=xl(c,i);return s()({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:e,extension:r,HTMLAttributes:p})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:wl(e.name,this.schema)};e.type==="mark"&&(!((n=fe(Q(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=Q(e,"onBeforeCreate",r),o=Q(e,"onCreate",r),s=Q(e,"onUpdate",r),l=Q(e,"onSelectionUpdate",r),c=Q(e,"onTransaction",r),d=Q(e,"onFocus",r),u=Q(e,"onBlur",r),f=Q(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class Oe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(Q(this,"addOptions",{name:this.name}))),this.storage=fe(Q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Oe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Oe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(Q(n,"addOptions",{name:n.name})),n.storage=fe(Q(n,"addStorage",{name:n.name,options:n.options})),n}}function Lf(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
16
16
|
|
|
17
|
-
`,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function If(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const pE=Oe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new _e({key:new nt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),c=If(n);return Lf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),mE=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),gE=(t=!1)=>({commands:e})=>e.setContent("",t),yE=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=lr(p);if(l.type.isTextblock){const{defaultType:y}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,y)}(m||m===0)&&e.lift(p,m)})}),!0},bE=t=>e=>t(e),kE=()=>({state:t,dispatch:e})=>Of(t,e),xE=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new ce(r.doc.resolve(s-1))),!0},wE=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),c=i.after(o);t.delete(l,c).scrollIntoView()}return!0}return!1},vE=t=>({tr:e,state:n,dispatch:r})=>{const i=Be(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},CE=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},SE=()=>({state:t,dispatch:e})=>ml(t,e),EE=()=>({commands:t})=>t.keyboardShortcut("Enter"),OE=()=>({state:t,dispatch:e})=>PS(t,e);function Mo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Pf(t,e,n={}){return t.find(r=>r.type===e&&Mo(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Rf(t,e,n={}){return!!Pf(t,e,n)}function Sl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Pf([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,c=s+1,d=l+i.node.nodeSize;for(;s>0&&Rf([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&Rf([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function pn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const ME=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=pn(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=Sl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ce.create(s,f.from,f.to);n.setSelection(h)}}return!0},TE=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function El(t){return t instanceof ce}function Ht(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function zf(t,e=null){if(!e)return null;const n=ue.atStart(t),r=ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ce.create(t,Ht(0,i,o),Ht(t.content.size,i,o)):ce.create(t,Ht(e,i,o),Ht(e,i,o))}function $E(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ol(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const NE=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ol()||$E())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!El(n.state.selection))return s(),!0;const l=zf(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},BE=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),AE=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jf=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jf(r)}return t};function To(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jf(n)}function $o(t,e,n){if(t instanceof Qt||t instanceof F)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return F.fromArray(t.map(l=>e.nodeFromJSON(l)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),$o("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new Sd({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?en.fromSchema(c).parseSlice(To(t),n.parseOptions):en.fromSchema(c).parse(To(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=en.fromSchema(e);return n.slice?o.parseSlice(To(t),n.parseOptions).content:o.parse(To(t),n.parseOptions)}return $o("",e,n)}function VE(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const DE=t=>!("type"in t),_E=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=$o(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((DE(l)?l:[l]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),c===d&&f){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof F){let m="";e.forEach(y=>{y.text&&(m+=y.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=l,r.replaceWith(c,d,p);n.updateSelection&&VE(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},LE=()=>({state:t,dispatch:e})=>_S(t,e),IE=()=>({state:t,dispatch:e})=>LS(t,e),PE=()=>({state:t,dispatch:e})=>kf(t,e),RE=()=>({state:t,dispatch:e})=>Cf(t,e),zE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},jE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},FE=()=>({state:t,dispatch:e})=>VS(t,e),HE=()=>({state:t,dispatch:e})=>DS(t,e);function Ff(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function WE(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Ol()||Ff()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const UE=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=WE(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function pi(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Be(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);l.push({node:f,from:p,to:m})});const c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Mo(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const qE=(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?IS(n,r):!1},KE=()=>({state:t,dispatch:e})=>Mf(t,e),YE=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return JS(r)(e,n)},JE=()=>({state:t,dispatch:e})=>Ef(t,e);function No(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Hf(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const GE=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Hf(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Hf(f.attrs,e)))})})}),!0):!1},ZE=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),XE=()=>({tr:t,dispatch:e})=>{if(e){const n=new tt(t.doc);t.setSelection(n)}return!0},QE=()=>({state:t,dispatch:e})=>wf(t,e),e3=()=>({state:t,dispatch:e})=>Sf(t,e),t3=()=>({state:t,dispatch:e})=>jS(t,e),n3=()=>({state:t,dispatch:e})=>WS(t,e),r3=()=>({state:t,dispatch:e})=>HS(t,e);function Ml(t,e,n={},r={}){return $o(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const i3=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Ml(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Bo(t,e){const n=pn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function o3(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function s3(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Tl(t){return e=>s3(e.$from,t)}function l3(t,e){const n={from:0,to:t.content.size};return Lf(t,n,e)}function a3(t,e){const n=Be(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function c3(t,e){const n=No(typeof e=="string"?e:e.name,t.schema);return n==="node"?a3(t,e):n==="mark"?Bo(t,e):{}}function Wf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Sl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ao(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $l(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?pn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Mo(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(y,g)=>{if(!y.isText&&!y.marks.length)return;const b=Math.max(p,g),v=Math.min(m,g+y.nodeSize),T=v-b;s+=T,l.push(...y.marks.map(k=>({mark:k,from:b,to:v})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Mo(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function d3(t,e,n={}){if(!e)return pi(t,null,n)||$l(t,null,n);const r=No(e,t.schema);return r==="node"?pi(t,e,n):r==="mark"?$l(t,e,n):!1}function Uf(t,e){const{nodeExtensions:n}=wo(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=fe(Q(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Nl(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Nl(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function u3(t){return t instanceof re}function qf(t,e,n){const i=t.state.doc.content.size,o=Ht(e,0,i),s=Ht(n,0,i),l=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(l.top,c.top),u=Math.max(l.bottom,c.bottom),f=Math.min(l.left,c.left),h=Math.max(l.right,c.right),p=h-f,m=u-d,b={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...b,toJSON:()=>b}}function f3(t,e,n){var r;const{selection:i}=e;let o=null;if(El(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,c.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(y=>y.type.excludes(n));d=p&&m}return!d}),d})}const h3=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=pn(t,r.schema);if(i)if(s){const d=Bo(r,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),y=Math.min(p+h.nodeSize,f);h.marks.find(b=>b.type===c)?h.marks.forEach(b=>{c===b.type&&n.addMark(m,y,c.create({...b.attrs,...e}))}):n.addMark(m,y,c.create(e))})});return f3(r,n,c)},p3=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),m3=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Be(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Nf(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Nf(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},g3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ht(t,0,r.content.size),o=re.create(r,i);e.setSelection(o)}return!0},y3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ce.atStart(r).from,l=ce.atEnd(r).to,c=Ht(i,s,l),d=Ht(o,s,l),u=ce.create(r,c,d);e.setSelection(u)}return!0},b3=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return XS(r)(e,n)};function Kf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const k3=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,u=Ao(d,l.node().type.name,l.node().attrs);if(o instanceof re&&o.node.isBlock)return!l.parentOffset||!Pt(s,l.pos)?!1:(r&&(t&&Kf(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:o3(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Pt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&Pt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const y=e.mapping.map(l.before()),g=e.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}t&&Kf(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},x3=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Be(t,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=F.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let P=c.depth-v;P>=c.depth-3;P-=1)b=F.from(c.node(P).copy(b));const T=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,k={...Ao(h,c.node().type.name,c.node().attrs),...e},M=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(k))||void 0;b=b.append(F.from(l.createAndFill(null,M)||void 0));const w=c.before(c.depth-(v-1));n.replace(w,c.after(-T),new K(b,4-v,0));let A=-1;n.doc.nodesBetween(w,n.doc.content.size,(P,_)=>{if(A>-1)return!1;P.isTextblock&&P.content.size===0&&(A=_+1)}),A>-1&&n.setSelection(ce.near(n.doc.resolve(A))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Ao(h,f.type.name,f.attrs),...e},y={...Ao(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const g=p?[{type:l,attrs:m},{type:p,attrs:y}]:[{type:l,attrs:m}];if(!Pt(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:v}=r,{splittableMarks:T}=o.extensionManager,k=v||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,g).scrollIntoView(),!k||!i)return!0;const M=k.filter(w=>T.includes(w.type.name));n.ensureMarks(M)}return!0},Bl=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,n.pos)&&t.join(n.pos),!0},Al=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,r)&&t.join(r),!0};var w3=Object.freeze({__proto__:null,blur:mE,clearContent:gE,clearNodes:yE,command:bE,createParagraphNear:kE,cut:xE,deleteCurrentNode:wE,deleteNode:vE,deleteRange:CE,deleteSelection:SE,enter:EE,exitCode:OE,extendMarkRange:ME,first:TE,focus:NE,forEach:BE,insertContent:AE,insertContentAt:_E,joinBackward:PE,joinDown:IE,joinForward:RE,joinItemBackward:zE,joinItemForward:jE,joinTextblockBackward:FE,joinTextblockForward:HE,joinUp:LE,keyboardShortcut:UE,lift:qE,liftEmptyBlock:KE,liftListItem:YE,newlineInCode:JE,resetAttributes:GE,scrollIntoView:ZE,selectAll:XE,selectNodeBackward:QE,selectNodeForward:e3,selectParentNode:t3,selectTextblockEnd:n3,selectTextblockStart:r3,setContent:i3,setMark:h3,setMeta:p3,setNode:m3,setNodeSelection:g3,setTextSelection:y3,sinkListItem:b3,splitBlock:k3,splitListItem:x3,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Be(t,s.schema),m=Be(e,s.schema),{selection:y,storedMarks:g}=s,{$from:b,$to:v}=y,T=b.blockRange(v),k=g||y.$to.parentOffset&&y.$from.marks();if(!T)return!1;const M=Tl(w=>Uf(w.type.name,f))(y);if(T.depth>=1&&M&&T.depth-M.depth<=1){if(M.node.type===p)return d.liftListItem(m);if(Uf(M.node.type.name,f)&&p.validContent(M.node.content)&&l)return c().command(()=>(o.setNodeMarkup(M.pos,p),!0)).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()}return!n||!k||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run():c().command(()=>{const w=u().wrapInList(p,r),A=k.filter(P=>h.includes(P.type.name));return o.ensureMarks(A),w?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=pn(t,r.schema);return $l(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Be(t,r.schema),s=Be(e,r.schema),l=pi(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,l=o.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,c=pn(t,r.schema),{$from:d,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:h,to:p}=l;const m=(o=d.marks().find(g=>g.type===c))===null||o===void 0?void 0:o.attrs,y=Sl(d,c,m);y&&(h=y.from,p=y.to),n.removeMark(h,p,c)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(y,g)=>{o&&o===y.type&&(p=Math.max(g,d),m=Math.min(g+y.nodeSize,u),f=g,h=y)}):r.doc.nodesBetween(d,u,(y,g)=>{g<d&&o&&o===y.type&&(p=Math.max(g,d),m=Math.min(g+y.nodeSize,u),f=g,h=y),g>=d&&g<=u&&(o&&o===y.type&&n.setNodeMarkup(g,void 0,{...y.attrs,...e}),s&&y.marks.length&&y.marks.forEach(b=>{if(s===b.type){const v=Math.max(g,d),T=Math.min(g+y.nodeSize,u);n.addMark(v,T,s.create({...b.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(y=>{s===y.type&&n.addMark(p,m,s.create({...y.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return US(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return qS(i,e)(n,r)}});const v3=Oe.create({name:"commands",addCommands(){return{...w3}}}),C3=Oe.create({name:"drop",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),S3=Oe.create({name:"editable",addProseMirrorPlugins(){return[new _e({key:new nt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),E3=Oe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new _e({key:new nt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),O3=Oe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,y=m.parent.type.spec.isolating,g=f.pos-f.parentOffset,b=y&&m.parent.childCount===1?g===f.pos:ue.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ol()||Ff()?o:i},addProseMirrorPlugins(){return[new _e({key:new nt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(y=>y.getMeta("composition")))return;const r=t.some(y=>y.docChanged)&&!e.doc.eq(n.doc),i=t.some(y=>y.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=e.selection,c=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!Nl(n.doc))return;const h=n.tr,p=ko({state:n,transaction:h}),{commands:m}=new xo({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),M3=Oe.create({name:"paste",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),T3=Oe.create({name:"tabindex",addProseMirrorPlugins(){return[new _e({key:new nt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Rn{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Rn(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Rn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Rn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const c=new Rn(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Rn(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const c=s[l];if(o[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(c=>n[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const $3=`.ProseMirror {
|
|
17
|
+
`,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function If(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const bE=Oe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new _e({key:new nt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),c=If(n);return Lf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),kE=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),xE=(t=!1)=>({commands:e})=>e.setContent("",t),wE=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=lr(p);if(l.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},vE=t=>e=>t(e),CE=()=>({state:t,dispatch:e})=>Of(t,e),SE=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new ce(r.doc.resolve(s-1))),!0},EE=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),c=i.after(o);t.delete(l,c).scrollIntoView()}return!0}return!1},OE=t=>({tr:e,state:n,dispatch:r})=>{const i=Be(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},ME=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},TE=()=>({state:t,dispatch:e})=>ml(t,e),$E=()=>({commands:t})=>t.keyboardShortcut("Enter"),NE=()=>({state:t,dispatch:e})=>FS(t,e);function Mo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Pf(t,e,n={}){return t.find(r=>r.type===e&&Mo(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Rf(t,e,n={}){return!!Pf(t,e,n)}function Sl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Pf([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,c=s+1,d=l+i.node.nodeSize;for(;s>0&&Rf([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&Rf([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function pn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const BE=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=pn(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=Sl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ce.create(s,f.from,f.to);n.setSelection(h)}}return!0},AE=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function El(t){return t instanceof ce}function Ht(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function zf(t,e=null){if(!e)return null;const n=ue.atStart(t),r=ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ce.create(t,Ht(0,i,o),Ht(t.content.size,i,o)):ce.create(t,Ht(e,i,o),Ht(e,i,o))}function VE(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ol(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const DE=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ol()||VE())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!El(n.state.selection))return s(),!0;const l=zf(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},_E=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),LE=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jf=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jf(r)}return t};function To(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jf(n)}function $o(t,e,n){if(t instanceof Qt||t instanceof F)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return F.fromArray(t.map(l=>e.nodeFromJSON(l)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),$o("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new Sd({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?en.fromSchema(c).parseSlice(To(t),n.parseOptions):en.fromSchema(c).parse(To(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=en.fromSchema(e);return n.slice?o.parseSlice(To(t),n.parseOptions).content:o.parse(To(t),n.parseOptions)}return $o("",e,n)}function IE(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const PE=t=>!("type"in t),RE=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=$o(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((PE(l)?l:[l]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),c===d&&f){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof F){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=l,r.replaceWith(c,d,p);n.updateSelection&&IE(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},zE=()=>({state:t,dispatch:e})=>RS(t,e),jE=()=>({state:t,dispatch:e})=>zS(t,e),FE=()=>({state:t,dispatch:e})=>kf(t,e),HE=()=>({state:t,dispatch:e})=>Cf(t,e),WE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},UE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},qE=()=>({state:t,dispatch:e})=>IS(t,e),KE=()=>({state:t,dispatch:e})=>PS(t,e);function Ff(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function YE(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Ol()||Ff()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const JE=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=YE(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function pi(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Be(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);l.push({node:f,from:p,to:m})});const c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Mo(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const GE=(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?jS(n,r):!1},ZE=()=>({state:t,dispatch:e})=>Mf(t,e),XE=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return QS(r)(e,n)},QE=()=>({state:t,dispatch:e})=>Ef(t,e);function No(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Hf(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const e3=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Hf(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Hf(f.attrs,e)))})})}),!0):!1},t3=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),n3=()=>({tr:t,dispatch:e})=>{if(e){const n=new tt(t.doc);t.setSelection(n)}return!0},r3=()=>({state:t,dispatch:e})=>wf(t,e),i3=()=>({state:t,dispatch:e})=>Sf(t,e),o3=()=>({state:t,dispatch:e})=>US(t,e),s3=()=>({state:t,dispatch:e})=>YS(t,e),l3=()=>({state:t,dispatch:e})=>KS(t,e);function Ml(t,e,n={},r={}){return $o(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const a3=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Ml(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Bo(t,e){const n=pn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function c3(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function d3(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Tl(t){return e=>d3(e.$from,t)}function u3(t,e){const n={from:0,to:t.content.size};return Lf(t,n,e)}function f3(t,e){const n=Be(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function h3(t,e){const n=No(typeof e=="string"?e:e.name,t.schema);return n==="node"?f3(t,e):n==="mark"?Bo(t,e):{}}function Wf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Sl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ao(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $l(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?pn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Mo(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(p,y),w=Math.min(m,y+g.nodeSize),T=w-b;s+=T,l.push(...g.marks.map(k=>({mark:k,from:b,to:w})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Mo(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function p3(t,e,n={}){if(!e)return pi(t,null,n)||$l(t,null,n);const r=No(e,t.schema);return r==="node"?pi(t,e,n):r==="mark"?$l(t,e,n):!1}function Uf(t,e){const{nodeExtensions:n}=wo(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=fe(Q(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Nl(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Nl(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function m3(t){return t instanceof re}function qf(t,e,n){const i=t.state.doc.content.size,o=Ht(e,0,i),s=Ht(n,0,i),l=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(l.top,c.top),u=Math.max(l.bottom,c.bottom),f=Math.min(l.left,c.left),h=Math.max(l.right,c.right),p=h-f,m=u-d,b={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...b,toJSON:()=>b}}function g3(t,e,n){var r;const{selection:i}=e;let o=null;if(El(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,c.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const y3=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=pn(t,r.schema);if(i)if(s){const d=Bo(r,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(b=>b.type===c)?h.marks.forEach(b=>{c===b.type&&n.addMark(m,g,c.create({...b.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return g3(r,n,c)},b3=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),k3=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Be(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Nf(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Nf(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},x3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ht(t,0,r.content.size),o=re.create(r,i);e.setSelection(o)}return!0},w3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ce.atStart(r).from,l=ce.atEnd(r).to,c=Ht(i,s,l),d=Ht(o,s,l),u=ce.create(r,c,d);e.setSelection(u)}return!0},v3=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return nE(r)(e,n)};function Kf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const C3=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,u=Ao(d,l.node().type.name,l.node().attrs);if(o instanceof re&&o.node.isBlock)return!l.parentOffset||!Pt(s,l.pos)?!1:(r&&(t&&Kf(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:c3(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Pt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&Pt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const g=e.mapping.map(l.before()),y=e.doc.resolve(g);l.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}t&&Kf(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},S3=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Be(t,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=F.empty;const w=c.index(-1)?1:c.index(-2)?2:3;for(let P=c.depth-w;P>=c.depth-3;P-=1)b=F.from(c.node(P).copy(b));const T=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,k={...Ao(h,c.node().type.name,c.node().attrs),...e},M=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(k))||void 0;b=b.append(F.from(l.createAndFill(null,M)||void 0));const v=c.before(c.depth-(w-1));n.replace(v,c.after(-T),new K(b,4-w,0));let A=-1;n.doc.nodesBetween(v,n.doc.content.size,(P,_)=>{if(A>-1)return!1;P.isTextblock&&P.content.size===0&&(A=_+1)}),A>-1&&n.setSelection(ce.near(n.doc.resolve(A))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Ao(h,f.type.name,f.attrs),...e},g={...Ao(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const y=p?[{type:l,attrs:m},{type:p,attrs:g}]:[{type:l,attrs:m}];if(!Pt(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:w}=r,{splittableMarks:T}=o.extensionManager,k=w||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!k||!i)return!0;const M=k.filter(v=>T.includes(v.type.name));n.ensureMarks(M)}return!0},Bl=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,n.pos)&&t.join(n.pos),!0},Al=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,r)&&t.join(r),!0};var E3=Object.freeze({__proto__:null,blur:kE,clearContent:xE,clearNodes:wE,command:vE,createParagraphNear:CE,cut:SE,deleteCurrentNode:EE,deleteNode:OE,deleteRange:ME,deleteSelection:TE,enter:$E,exitCode:NE,extendMarkRange:BE,first:AE,focus:DE,forEach:_E,insertContent:LE,insertContentAt:RE,joinBackward:FE,joinDown:jE,joinForward:HE,joinItemBackward:WE,joinItemForward:UE,joinTextblockBackward:qE,joinTextblockForward:KE,joinUp:zE,keyboardShortcut:JE,lift:GE,liftEmptyBlock:ZE,liftListItem:XE,newlineInCode:QE,resetAttributes:e3,scrollIntoView:t3,selectAll:n3,selectNodeBackward:r3,selectNodeForward:i3,selectParentNode:o3,selectTextblockEnd:s3,selectTextblockStart:l3,setContent:a3,setMark:y3,setMeta:b3,setNode:k3,setNodeSelection:x3,setTextSelection:w3,sinkListItem:v3,splitBlock:C3,splitListItem:S3,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Be(t,s.schema),m=Be(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:w}=g,T=b.blockRange(w),k=y||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const M=Tl(v=>Uf(v.type.name,f))(g);if(T.depth>=1&&M&&T.depth-M.depth<=1){if(M.node.type===p)return d.liftListItem(m);if(Uf(M.node.type.name,f)&&p.validContent(M.node.content)&&l)return c().command(()=>(o.setNodeMarkup(M.pos,p),!0)).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()}return!n||!k||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run():c().command(()=>{const v=u().wrapInList(p,r),A=k.filter(P=>h.includes(P.type.name));return o.ensureMarks(A),v?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=pn(t,r.schema);return $l(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Be(t,r.schema),s=Be(e,r.schema),l=pi(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,l=o.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,c=pn(t,r.schema),{$from:d,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:h,to:p}=l;const m=(o=d.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=Sl(d,c,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,c)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g),y>=d&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(b=>{if(s===b.type){const w=Math.max(y,d),T=Math.min(y+g.nodeSize,u);n.addMark(w,T,s.create({...b.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(p,m,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return JS(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return GS(i,e)(n,r)}});const O3=Oe.create({name:"commands",addCommands(){return{...E3}}}),M3=Oe.create({name:"drop",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),T3=Oe.create({name:"editable",addProseMirrorPlugins(){return[new _e({key:new nt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),$3=Oe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new _e({key:new nt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),N3=Oe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,b=g&&m.parent.childCount===1?y===f.pos:ue.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ol()||Ff()?o:i},addProseMirrorPlugins(){return[new _e({key:new nt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=e.selection,c=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!Nl(n.doc))return;const h=n.tr,p=ko({state:n,transaction:h}),{commands:m}=new xo({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),B3=Oe.create({name:"paste",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),A3=Oe.create({name:"tabindex",addProseMirrorPlugins(){return[new _e({key:new nt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Rn{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Rn(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Rn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Rn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const c=new Rn(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Rn(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const c=s[l];if(o[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(c=>n[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const V3=`.ProseMirror {
|
|
18
18
|
position: relative;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -88,36 +88,36 @@ img.ProseMirror-separator {
|
|
|
88
88
|
|
|
89
89
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
90
90
|
opacity: 0
|
|
91
|
-
}`;function
|
|
91
|
+
}`;function D3(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let _3=class extends rE{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=D3(V3,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Af(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(l=>!l.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[T3,bE.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),O3,$3,N3,A3,M3,B3].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new br(i,this)}createCommandManager(){this.commandManager=new xo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Ml(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=Ml(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=zf(n,this.options.autofocus);this.view=new MS(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:ur.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return h3(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return p3(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return vl(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
92
92
|
|
|
93
|
-
`,textSerializers:r={}}=e||{};return l3(this.state.doc,{blockSeparator:n,textSerializers:{...If(this.schema),...r}})}get isEmpty(){return Nl(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Rn(n,this)}get $doc(){return this.$pos(0)}};function kr(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=n.from+l.indexOf(s),u=d+s.length;if(Wf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(y=>y===t.type&&y!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Yf(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,c)}else if(r[0]){const d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function Vl(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=fe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function mi(t){return new vo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=fe(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&Ls(c,t.type,o);if(!d)return null;if(s.wrap(c,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const y=m.filter(g=>p.includes(g.type.name));s.ensureMarks(y)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&rn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ge=class da{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(Q(this,"addOptions",{name:this.name}))),this.storage=fe(Q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new da(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new da(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(Q(n,"addOptions",{name:n.name})),n.storage=fe(Q(n,"addStorage",{name:n.name,options:n.options})),n}};function xr(t){return new aE({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=fe(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=n.to;if(l){const u=c.search(/\S/),f=n.from+c.indexOf(l),h=f+l.length;if(Wf(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+l.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Ze="top",ut="bottom",ft="right",Xe="left",Dl="auto",gi=[Ze,ut,ft,Xe],wr="start",yi="end",A3="clippingParents",Jf="viewport",bi="popper",V3="reference",Gf=gi.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+yi])},[]),Zf=[].concat(gi,[Dl]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+yi])},[]),D3="beforeRead",_3="read",L3="afterRead",I3="beforeMain",P3="main",R3="afterMain",z3="beforeWrite",j3="write",F3="afterWrite",H3=[D3,_3,L3,I3,P3,R3,z3,j3,F3];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function it(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function zn(t){var e=it(t).Element;return t instanceof e||t instanceof Element}function ht(t){var e=it(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _l(t){if(typeof ShadowRoot>"u")return!1;var e=it(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function W3(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!ht(o)||!$t(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function U3(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,d){return c[d]="",c},{});!ht(i)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Xf={name:"applyStyles",enabled:!0,phase:"write",fn:W3,effect:U3,requires:["computeStyles"]};function Nt(t){return t.split("-")[0]}var jn=Math.max,Vo=Math.min,vr=Math.round;function Ll(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qf(){return!/^((?!chrome|android).)*safari/i.test(Ll())}function Cr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&ht(t)&&(i=t.offsetWidth>0&&vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&vr(r.height)/t.offsetHeight||1);var s=zn(t)?it(t):window,l=s.visualViewport,c=!Qf()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/i,u=(r.top+(c&&l?l.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function Il(t){var e=Cr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function eh(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_l(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wt(t){return it(t).getComputedStyle(t)}function q3(t){return["table","td","th"].indexOf($t(t))>=0}function mn(t){return((zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Do(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(_l(t)?t.host:null)||mn(t)}function th(t){return!ht(t)||Wt(t).position==="fixed"?null:t.offsetParent}function K3(t){var e=/firefox/i.test(Ll()),n=/Trident/i.test(Ll());if(n&&ht(t)){var r=Wt(t);if(r.position==="fixed")return null}var i=Do(t);for(_l(i)&&(i=i.host);ht(i)&&["html","body"].indexOf($t(i))<0;){var o=Wt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ki(t){for(var e=it(t),n=th(t);n&&q3(n)&&Wt(n).position==="static";)n=th(n);return n&&($t(n)==="html"||$t(n)==="body"&&Wt(n).position==="static")?e:n||K3(t)||e}function Pl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xi(t,e,n){return jn(t,Vo(e,n))}function Y3(t,e,n){var r=xi(t,e,n);return r>n?n:r}function nh(){return{top:0,right:0,bottom:0,left:0}}function rh(t){return Object.assign({},nh(),t)}function ih(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var J3=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,rh(typeof e!="number"?e:ih(e,gi))};function G3(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Nt(n.placement),c=Pl(l),d=[Xe,ft].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=J3(i.padding,n),h=Il(o),p=c==="y"?Ze:Xe,m=c==="y"?ut:ft,y=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],g=s[c]-n.rects.reference[c],b=ki(o),v=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,T=y/2-g/2,k=f[p],M=v-h[u]-f[m],w=v/2-h[u]/2+T,A=xi(k,w,M),P=c;n.modifiersData[r]=(e={},e[P]=A,e.centerOffset=A-w,e)}}function Z3(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||eh(e.elements.popper,i)&&(e.elements.arrow=i))}const X3={name:"arrow",enabled:!0,phase:"main",fn:G3,effect:Z3,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(t){return t.split("-")[1]}var Q3={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eO(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:vr(n*i)/i||0,y:vr(r*i)/i||0}}function oh(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,y=m===void 0?0:m,g=typeof u=="function"?u({x:p,y}):{x:p,y};p=g.x,y=g.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),T=Xe,k=Ze,M=window;if(d){var w=ki(n),A="clientHeight",P="clientWidth";if(w===it(n)&&(w=mn(n),Wt(w).position!=="static"&&l==="absolute"&&(A="scrollHeight",P="scrollWidth")),w=w,i===Ze||(i===Xe||i===ft)&&o===yi){k=ut;var _=f&&w===M&&M.visualViewport?M.visualViewport.height:w[A];y-=_-r.height,y*=c?1:-1}if(i===Xe||(i===Ze||i===ut)&&o===yi){T=ft;var B=f&&w===M&&M.visualViewport?M.visualViewport.width:w[P];p-=B-r.width,p*=c?1:-1}}var $=Object.assign({position:l},d&&Q3),q=u===!0?eO({x:p,y},it(n)):{x:p,y};if(p=q.x,y=q.y,c){var ee;return Object.assign({},$,(ee={},ee[k]=v?"0":"",ee[T]=b?"0":"",ee.transform=(M.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",ee))}return Object.assign({},$,(e={},e[k]=v?y+"px":"",e[T]=b?p+"px":"",e.transform="",e))}function tO(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Nt(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,oh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,oh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const nO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tO,data:{}};var _o={passive:!0};function rO(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,c=it(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,_o)}),l&&c.addEventListener("resize",n.update,_o),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,_o)}),l&&c.removeEventListener("resize",n.update,_o)}}const iO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rO,data:{}};var oO={left:"right",right:"left",bottom:"top",top:"bottom"};function Lo(t){return t.replace(/left|right|bottom|top/g,function(e){return oO[e]})}var sO={start:"end",end:"start"};function sh(t){return t.replace(/start|end/g,function(e){return sO[e]})}function Rl(t){var e=it(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function zl(t){return Cr(mn(t)).left+Rl(t).scrollLeft}function lO(t,e){var n=it(t),r=mn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Qf();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+zl(t),y:c}}function aO(t){var e,n=mn(t),r=Rl(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=jn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=jn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+zl(t),c=-r.scrollTop;return Wt(i||n).direction==="rtl"&&(l+=jn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function jl(t){var e=Wt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function lh(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:ht(t)&&jl(t)?t:lh(Do(t))}function wi(t,e){var n;e===void 0&&(e=[]);var r=lh(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=it(r),s=i?[o].concat(o.visualViewport||[],jl(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wi(Do(s)))}function Fl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function cO(t,e){var n=Cr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function ah(t,e,n){return e===Jf?Fl(lO(t,n)):zn(e)?cO(e,n):Fl(aO(mn(t)))}function dO(t){var e=wi(Do(t)),n=["absolute","fixed"].indexOf(Wt(t).position)>=0,r=n&&ht(t)?ki(t):t;return zn(r)?e.filter(function(i){return zn(i)&&eh(i,r)&&$t(i)!=="body"}):[]}function uO(t,e,n,r){var i=e==="clippingParents"?dO(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=ah(t,d,r);return c.top=jn(u.top,c.top),c.right=Vo(u.right,c.right),c.bottom=Vo(u.bottom,c.bottom),c.left=jn(u.left,c.left),c},ah(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ch(t){var e=t.reference,n=t.element,r=t.placement,i=r?Nt(r):null,o=r?Sr(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case Ze:c={x:s,y:e.y-n.height};break;case ut:c={x:s,y:e.y+e.height};break;case ft:c={x:e.x+e.width,y:l};break;case Xe:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?Pl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case wr:c[d]=c[d]-(e[u]/2-n[u]/2);break;case yi:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function vi(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,c=l===void 0?A3:l,d=n.rootBoundary,u=d===void 0?Jf:d,f=n.elementContext,h=f===void 0?bi:f,p=n.altBoundary,m=p===void 0?!1:p,y=n.padding,g=y===void 0?0:y,b=rh(typeof g!="number"?g:ih(g,gi)),v=h===bi?V3:bi,T=t.rects.popper,k=t.elements[m?v:h],M=uO(zn(k)?k:k.contextElement||mn(t.elements.popper),c,u,s),w=Cr(t.elements.reference),A=ch({reference:w,element:T,placement:i}),P=Fl(Object.assign({},T,A)),_=h===bi?P:w,B={top:M.top-_.top+b.top,bottom:_.bottom-M.bottom+b.bottom,left:M.left-_.left+b.left,right:_.right-M.right+b.right},$=t.modifiersData.offset;if(h===bi&&$){var q=$[i];Object.keys(B).forEach(function(ee){var L=[ft,ut].indexOf(ee)>=0?1:-1,S=[Ze,ut].indexOf(ee)>=0?"y":"x";B[ee]+=q[S]*L})}return B}function fO(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Zf:c,u=Sr(r),f=u?l?Gf:Gf.filter(function(m){return Sr(m)===u}):gi,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,y){return m[y]=vi(t,{placement:y,boundary:i,rootBoundary:o,padding:s})[Nt(y)],m},{});return Object.keys(p).sort(function(m,y){return p[m]-p[y]})}function hO(t){if(Nt(t)===Dl)return[];var e=Lo(t);return[sh(t),e,sh(e)]}function pO(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,y=n.allowedAutoPlacements,g=e.options.placement,b=Nt(g),v=b===g,T=c||(v||!m?[Lo(g)]:hO(g)),k=[g].concat(T).reduce(function(X,U){return X.concat(Nt(U)===Dl?fO(e,{placement:U,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:y}):U)},[]),M=e.rects.reference,w=e.rects.popper,A=new Map,P=!0,_=k[0],B=0;B<k.length;B++){var $=k[B],q=Nt($),ee=Sr($)===wr,L=[Ze,ut].indexOf(q)>=0,S=L?"width":"height",C=vi(e,{placement:$,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),V=L?ee?ft:Xe:ee?ut:Ze;M[S]>w[S]&&(V=Lo(V));var I=Lo(V),J=[];if(o&&J.push(C[q]<=0),l&&J.push(C[V]<=0,C[I]<=0),J.every(function(X){return X})){_=$,P=!1;break}A.set($,J)}if(P)for(var Z=m?3:1,N=function(U){var R=k.find(function(te){var he=A.get(te);if(he)return he.slice(0,U).every(function(le){return le})});if(R)return _=R,"break"},D=Z;D>0;D--){var j=N(D);if(j==="break")break}e.placement!==_&&(e.modifiersData[r]._skip=!0,e.placement=_,e.reset=!0)}}const mO={name:"flip",enabled:!0,phase:"main",fn:pO,requiresIfExists:["offset"],data:{_skip:!1}};function dh(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function uh(t){return[Ze,ft,ut,Xe].some(function(e){return t[e]>=0})}function gO(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=vi(e,{elementContext:"reference"}),l=vi(e,{altBoundary:!0}),c=dh(s,r),d=dh(l,i,o),u=uh(c),f=uh(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const yO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gO};function bO(t,e,n){var r=Nt(t),i=[Xe,Ze].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Xe,ft].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function kO(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Zf.reduce(function(u,f){return u[f]=bO(f,e.rects,o),u},{}),l=s[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const xO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kO};function wO(t){var e=t.state,n=t.name;e.modifiersData[n]=ch({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const vO={name:"popperOffsets",enabled:!0,phase:"read",fn:wO,data:{}};function CO(t){return t==="x"?"y":"x"}function SO(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,y=m===void 0?0:m,g=vi(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),b=Nt(e.placement),v=Sr(e.placement),T=!v,k=Pl(b),M=CO(k),w=e.modifiersData.popperOffsets,A=e.rects.reference,P=e.rects.popper,_=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,B=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(w){if(o){var ee,L=k==="y"?Ze:Xe,S=k==="y"?ut:ft,C=k==="y"?"height":"width",V=w[k],I=V+g[L],J=V-g[S],Z=p?-P[C]/2:0,N=v===wr?A[C]:P[C],D=v===wr?-P[C]:-A[C],j=e.elements.arrow,X=p&&j?Il(j):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:nh(),R=U[L],te=U[S],he=xi(0,A[C],X[C]),le=T?A[C]/2-Z-he-R-B.mainAxis:N-he-R-B.mainAxis,pe=T?-A[C]/2+Z+he+te+B.mainAxis:D+he+te+B.mainAxis,be=e.elements.arrow&&ki(e.elements.arrow),Me=be?k==="y"?be.clientTop||0:be.clientLeft||0:0,pt=(ee=$==null?void 0:$[k])!=null?ee:0,Tr=V+le-pt-Me,yn=V+pe-pt,bn=xi(p?Vo(I,Tr):I,V,p?jn(J,yn):J);w[k]=bn,q[k]=bn-V}if(l){var qt,vt=k==="x"?Ze:Xe,mt=k==="x"?ut:ft,gt=w[M],Vt=M==="y"?"height":"width",Kt=gt+g[vt],Dt=gt-g[mt],Wn=[Ze,Xe].indexOf(b)!==-1,kn=(qt=$==null?void 0:$[M])!=null?qt:0,$r=Wn?Kt:gt-A[Vt]-P[Vt]-kn+B.altAxis,Nr=Wn?gt+A[Vt]+P[Vt]-kn-B.altAxis:Dt,Br=p&&Wn?Y3($r,gt,Nr):xi(p?$r:Kt,gt,p?Nr:Dt);w[M]=Br,q[M]=Br-gt}e.modifiersData[r]=q}}const EO={name:"preventOverflow",enabled:!0,phase:"main",fn:SO,requiresIfExists:["offset"]};function OO(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function MO(t){return t===it(t)||!ht(t)?Rl(t):OO(t)}function TO(t){var e=t.getBoundingClientRect(),n=vr(e.width)/t.offsetWidth||1,r=vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function $O(t,e,n){n===void 0&&(n=!1);var r=ht(e),i=ht(e)&&TO(e),o=mn(e),s=Cr(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||jl(o))&&(l=MO(e)),ht(e)?(c=Cr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=zl(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function NO(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function BO(t){var e=NO(t);return H3.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function AO(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function VO(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var fh={placement:"bottom",modifiers:[],strategy:"absolute"};function hh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function DO(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?fh:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},fh,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(b){var v=typeof b=="function"?b(u.options):b;y(),u.options=Object.assign({},o,u.options,v),u.scrollParents={reference:zn(l)?wi(l):l.contextElement?wi(l.contextElement):[],popper:wi(c)};var T=BO(VO([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(k){return k.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var b=u.elements,v=b.reference,T=b.popper;if(hh(v,T)){u.rects={reference:$O(v,ki(T),u.options.strategy==="fixed"),popper:Il(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var k=0;k<u.orderedModifiers.length;k++){if(u.reset===!0){u.reset=!1,k=-1;continue}var M=u.orderedModifiers[k],w=M.fn,A=M.options,P=A===void 0?{}:A,_=M.name;typeof w=="function"&&(u=w({state:u,options:P,name:_,instance:p})||u)}}}},update:AO(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){y(),h=!0}};if(!hh(l,c))return p;p.setOptions(d).then(function(g){!h&&d.onFirstUpdate&&d.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var b=g.name,v=g.options,T=v===void 0?{}:v,k=g.effect;if(typeof k=="function"){var M=k({state:u,name:b,instance:p,options:T}),w=function(){};f.push(M||w)}})}function y(){f.forEach(function(g){return g()}),f=[]}return p}}var _O=[iO,vO,nO,Xf,xO,mO,EO,X3,yO],LO=DO({defaultModifiers:_O}),IO="tippy-box",ph="tippy-content",PO="tippy-backdrop",mh="tippy-arrow",gh="tippy-svg-arrow",Fn={passive:!0,capture:!0},yh=function(){return document.body};function RO(t,e){return{}.hasOwnProperty.call(t,e)}function Hl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Wl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function bh(t,e){return typeof t=="function"?t.apply(void 0,e):t}function kh(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function zO(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function jO(t){return t.split(/\s+/).filter(Boolean)}function Er(t){return[].concat(t)}function xh(t,e){t.indexOf(e)===-1&&t.push(e)}function FO(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function HO(t){return t.split("-")[0]}function Io(t){return[].slice.call(t)}function wh(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ci(){return document.createElement("div")}function Si(t){return["Element","Fragment"].some(function(e){return Wl(t,e)})}function WO(t){return Wl(t,"NodeList")}function UO(t){return Wl(t,"MouseEvent")}function qO(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function KO(t){return Si(t)?[t]:WO(t)?Io(t):Array.isArray(t)?t:Io(document.querySelectorAll(t))}function Ul(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function vh(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function YO(t){var e,n=Er(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function JO(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,c=l.interactiveBorder,d=HO(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,y=o.top-r+f>c,g=r-o.bottom-h>c,b=o.left-n+p>c,v=n-o.right-m>c;return y||g||b||v})}function ql(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ch(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Bt={isTouch:!1},Sh=0;function GO(){Bt.isTouch||(Bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Eh))}function Eh(){var t=performance.now();t-Sh<20&&(Bt.isTouch=!1,document.removeEventListener("mousemove",Eh)),Sh=t}function ZO(){var t=document.activeElement;if(qO(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function XO(){document.addEventListener("touchstart",GO,Fn),window.addEventListener("blur",ZO)}var QO=typeof window<"u"&&typeof document<"u",eM=QO?!!window.msCrypto:!1;function Or(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Oh(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function tM(t){return Oh(`
|
|
93
|
+
`,textSerializers:r={}}=e||{};return u3(this.state.doc,{blockSeparator:n,textSerializers:{...If(this.schema),...r}})}get isEmpty(){return Nl(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Rn(n,this)}get $doc(){return this.$pos(0)}};function kr(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=n.from+l.indexOf(s),u=d+s.length;if(Wf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Yf(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,c)}else if(r[0]){const d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function Vl(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=fe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function mi(t){return new vo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=fe(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&Ls(c,t.type,o);if(!d)return null;if(s.wrap(c,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&rn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ge=class da{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(Q(this,"addOptions",{name:this.name}))),this.storage=fe(Q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new da(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new da(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(Q(n,"addOptions",{name:n.name})),n.storage=fe(Q(n,"addStorage",{name:n.name,options:n.options})),n}};function xr(t){return new fE({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=fe(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=n.to;if(l){const u=c.search(/\S/),f=n.from+c.indexOf(l),h=f+l.length;if(Wf(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+l.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Ze="top",ut="bottom",ft="right",Xe="left",Dl="auto",gi=[Ze,ut,ft,Xe],wr="start",yi="end",L3="clippingParents",Jf="viewport",bi="popper",I3="reference",Gf=gi.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+yi])},[]),Zf=[].concat(gi,[Dl]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+yi])},[]),P3="beforeRead",R3="read",z3="afterRead",j3="beforeMain",F3="main",H3="afterMain",W3="beforeWrite",U3="write",q3="afterWrite",K3=[P3,R3,z3,j3,F3,H3,W3,U3,q3];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function it(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function zn(t){var e=it(t).Element;return t instanceof e||t instanceof Element}function ht(t){var e=it(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _l(t){if(typeof ShadowRoot>"u")return!1;var e=it(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Y3(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!ht(o)||!$t(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function J3(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,d){return c[d]="",c},{});!ht(i)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Xf={name:"applyStyles",enabled:!0,phase:"write",fn:Y3,effect:J3,requires:["computeStyles"]};function Nt(t){return t.split("-")[0]}var jn=Math.max,Vo=Math.min,vr=Math.round;function Ll(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qf(){return!/^((?!chrome|android).)*safari/i.test(Ll())}function Cr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&ht(t)&&(i=t.offsetWidth>0&&vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&vr(r.height)/t.offsetHeight||1);var s=zn(t)?it(t):window,l=s.visualViewport,c=!Qf()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/i,u=(r.top+(c&&l?l.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function Il(t){var e=Cr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function eh(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_l(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wt(t){return it(t).getComputedStyle(t)}function G3(t){return["table","td","th"].indexOf($t(t))>=0}function mn(t){return((zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Do(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(_l(t)?t.host:null)||mn(t)}function th(t){return!ht(t)||Wt(t).position==="fixed"?null:t.offsetParent}function Z3(t){var e=/firefox/i.test(Ll()),n=/Trident/i.test(Ll());if(n&&ht(t)){var r=Wt(t);if(r.position==="fixed")return null}var i=Do(t);for(_l(i)&&(i=i.host);ht(i)&&["html","body"].indexOf($t(i))<0;){var o=Wt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ki(t){for(var e=it(t),n=th(t);n&&G3(n)&&Wt(n).position==="static";)n=th(n);return n&&($t(n)==="html"||$t(n)==="body"&&Wt(n).position==="static")?e:n||Z3(t)||e}function Pl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xi(t,e,n){return jn(t,Vo(e,n))}function X3(t,e,n){var r=xi(t,e,n);return r>n?n:r}function nh(){return{top:0,right:0,bottom:0,left:0}}function rh(t){return Object.assign({},nh(),t)}function ih(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Q3=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,rh(typeof e!="number"?e:ih(e,gi))};function eO(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Nt(n.placement),c=Pl(l),d=[Xe,ft].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=Q3(i.padding,n),h=Il(o),p=c==="y"?Ze:Xe,m=c==="y"?ut:ft,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],b=ki(o),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,T=g/2-y/2,k=f[p],M=w-h[u]-f[m],v=w/2-h[u]/2+T,A=xi(k,v,M),P=c;n.modifiersData[r]=(e={},e[P]=A,e.centerOffset=A-v,e)}}function tO(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||eh(e.elements.popper,i)&&(e.elements.arrow=i))}const nO={name:"arrow",enabled:!0,phase:"main",fn:eO,effect:tO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(t){return t.split("-")[1]}var rO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iO(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:vr(n*i)/i||0,y:vr(r*i)/i||0}}function oh(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,g=m===void 0?0:m,y=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var b=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),T=Xe,k=Ze,M=window;if(d){var v=ki(n),A="clientHeight",P="clientWidth";if(v===it(n)&&(v=mn(n),Wt(v).position!=="static"&&l==="absolute"&&(A="scrollHeight",P="scrollWidth")),v=v,i===Ze||(i===Xe||i===ft)&&o===yi){k=ut;var _=f&&v===M&&M.visualViewport?M.visualViewport.height:v[A];g-=_-r.height,g*=c?1:-1}if(i===Xe||(i===Ze||i===ut)&&o===yi){T=ft;var B=f&&v===M&&M.visualViewport?M.visualViewport.width:v[P];p-=B-r.width,p*=c?1:-1}}var $=Object.assign({position:l},d&&rO),q=u===!0?iO({x:p,y:g},it(n)):{x:p,y:g};if(p=q.x,g=q.y,c){var ee;return Object.assign({},$,(ee={},ee[k]=w?"0":"",ee[T]=b?"0":"",ee.transform=(M.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",ee))}return Object.assign({},$,(e={},e[k]=w?g+"px":"",e[T]=b?p+"px":"",e.transform="",e))}function oO(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Nt(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,oh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,oh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const sO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:oO,data:{}};var _o={passive:!0};function lO(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,c=it(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,_o)}),l&&c.addEventListener("resize",n.update,_o),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,_o)}),l&&c.removeEventListener("resize",n.update,_o)}}const aO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lO,data:{}};var cO={left:"right",right:"left",bottom:"top",top:"bottom"};function Lo(t){return t.replace(/left|right|bottom|top/g,function(e){return cO[e]})}var dO={start:"end",end:"start"};function sh(t){return t.replace(/start|end/g,function(e){return dO[e]})}function Rl(t){var e=it(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function zl(t){return Cr(mn(t)).left+Rl(t).scrollLeft}function uO(t,e){var n=it(t),r=mn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Qf();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+zl(t),y:c}}function fO(t){var e,n=mn(t),r=Rl(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=jn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=jn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+zl(t),c=-r.scrollTop;return Wt(i||n).direction==="rtl"&&(l+=jn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function jl(t){var e=Wt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function lh(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:ht(t)&&jl(t)?t:lh(Do(t))}function wi(t,e){var n;e===void 0&&(e=[]);var r=lh(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=it(r),s=i?[o].concat(o.visualViewport||[],jl(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wi(Do(s)))}function Fl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function hO(t,e){var n=Cr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function ah(t,e,n){return e===Jf?Fl(uO(t,n)):zn(e)?hO(e,n):Fl(fO(mn(t)))}function pO(t){var e=wi(Do(t)),n=["absolute","fixed"].indexOf(Wt(t).position)>=0,r=n&&ht(t)?ki(t):t;return zn(r)?e.filter(function(i){return zn(i)&&eh(i,r)&&$t(i)!=="body"}):[]}function mO(t,e,n,r){var i=e==="clippingParents"?pO(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=ah(t,d,r);return c.top=jn(u.top,c.top),c.right=Vo(u.right,c.right),c.bottom=Vo(u.bottom,c.bottom),c.left=jn(u.left,c.left),c},ah(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ch(t){var e=t.reference,n=t.element,r=t.placement,i=r?Nt(r):null,o=r?Sr(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case Ze:c={x:s,y:e.y-n.height};break;case ut:c={x:s,y:e.y+e.height};break;case ft:c={x:e.x+e.width,y:l};break;case Xe:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?Pl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case wr:c[d]=c[d]-(e[u]/2-n[u]/2);break;case yi:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function vi(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,c=l===void 0?L3:l,d=n.rootBoundary,u=d===void 0?Jf:d,f=n.elementContext,h=f===void 0?bi:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,b=rh(typeof y!="number"?y:ih(y,gi)),w=h===bi?I3:bi,T=t.rects.popper,k=t.elements[m?w:h],M=mO(zn(k)?k:k.contextElement||mn(t.elements.popper),c,u,s),v=Cr(t.elements.reference),A=ch({reference:v,element:T,placement:i}),P=Fl(Object.assign({},T,A)),_=h===bi?P:v,B={top:M.top-_.top+b.top,bottom:_.bottom-M.bottom+b.bottom,left:M.left-_.left+b.left,right:_.right-M.right+b.right},$=t.modifiersData.offset;if(h===bi&&$){var q=$[i];Object.keys(B).forEach(function(ee){var L=[ft,ut].indexOf(ee)>=0?1:-1,S=[Ze,ut].indexOf(ee)>=0?"y":"x";B[ee]+=q[S]*L})}return B}function gO(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Zf:c,u=Sr(r),f=u?l?Gf:Gf.filter(function(m){return Sr(m)===u}):gi,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=vi(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[Nt(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function yO(t){if(Nt(t)===Dl)return[];var e=Lo(t);return[sh(t),e,sh(e)]}function bO(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=e.options.placement,b=Nt(y),w=b===y,T=c||(w||!m?[Lo(y)]:yO(y)),k=[y].concat(T).reduce(function(X,U){return X.concat(Nt(U)===Dl?gO(e,{placement:U,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):U)},[]),M=e.rects.reference,v=e.rects.popper,A=new Map,P=!0,_=k[0],B=0;B<k.length;B++){var $=k[B],q=Nt($),ee=Sr($)===wr,L=[Ze,ut].indexOf(q)>=0,S=L?"width":"height",C=vi(e,{placement:$,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),V=L?ee?ft:Xe:ee?ut:Ze;M[S]>v[S]&&(V=Lo(V));var I=Lo(V),J=[];if(o&&J.push(C[q]<=0),l&&J.push(C[V]<=0,C[I]<=0),J.every(function(X){return X})){_=$,P=!1;break}A.set($,J)}if(P)for(var Z=m?3:1,N=function(U){var R=k.find(function(te){var he=A.get(te);if(he)return he.slice(0,U).every(function(le){return le})});if(R)return _=R,"break"},D=Z;D>0;D--){var j=N(D);if(j==="break")break}e.placement!==_&&(e.modifiersData[r]._skip=!0,e.placement=_,e.reset=!0)}}const kO={name:"flip",enabled:!0,phase:"main",fn:bO,requiresIfExists:["offset"],data:{_skip:!1}};function dh(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function uh(t){return[Ze,ft,ut,Xe].some(function(e){return t[e]>=0})}function xO(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=vi(e,{elementContext:"reference"}),l=vi(e,{altBoundary:!0}),c=dh(s,r),d=dh(l,i,o),u=uh(c),f=uh(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const wO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xO};function vO(t,e,n){var r=Nt(t),i=[Xe,Ze].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Xe,ft].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function CO(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Zf.reduce(function(u,f){return u[f]=vO(f,e.rects,o),u},{}),l=s[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const SO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:CO};function EO(t){var e=t.state,n=t.name;e.modifiersData[n]=ch({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const OO={name:"popperOffsets",enabled:!0,phase:"read",fn:EO,data:{}};function MO(t){return t==="x"?"y":"x"}function TO(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=vi(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),b=Nt(e.placement),w=Sr(e.placement),T=!w,k=Pl(b),M=MO(k),v=e.modifiersData.popperOffsets,A=e.rects.reference,P=e.rects.popper,_=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,B=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(v){if(o){var ee,L=k==="y"?Ze:Xe,S=k==="y"?ut:ft,C=k==="y"?"height":"width",V=v[k],I=V+y[L],J=V-y[S],Z=p?-P[C]/2:0,N=w===wr?A[C]:P[C],D=w===wr?-P[C]:-A[C],j=e.elements.arrow,X=p&&j?Il(j):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:nh(),R=U[L],te=U[S],he=xi(0,A[C],X[C]),le=T?A[C]/2-Z-he-R-B.mainAxis:N-he-R-B.mainAxis,pe=T?-A[C]/2+Z+he+te+B.mainAxis:D+he+te+B.mainAxis,be=e.elements.arrow&&ki(e.elements.arrow),Me=be?k==="y"?be.clientTop||0:be.clientLeft||0:0,pt=(ee=$==null?void 0:$[k])!=null?ee:0,Tr=V+le-pt-Me,yn=V+pe-pt,bn=xi(p?Vo(I,Tr):I,V,p?jn(J,yn):J);v[k]=bn,q[k]=bn-V}if(l){var qt,vt=k==="x"?Ze:Xe,mt=k==="x"?ut:ft,gt=v[M],Vt=M==="y"?"height":"width",Kt=gt+y[vt],Dt=gt-y[mt],Wn=[Ze,Xe].indexOf(b)!==-1,kn=(qt=$==null?void 0:$[M])!=null?qt:0,$r=Wn?Kt:gt-A[Vt]-P[Vt]-kn+B.altAxis,Nr=Wn?gt+A[Vt]+P[Vt]-kn-B.altAxis:Dt,Br=p&&Wn?X3($r,gt,Nr):xi(p?$r:Kt,gt,p?Nr:Dt);v[M]=Br,q[M]=Br-gt}e.modifiersData[r]=q}}const $O={name:"preventOverflow",enabled:!0,phase:"main",fn:TO,requiresIfExists:["offset"]};function NO(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function BO(t){return t===it(t)||!ht(t)?Rl(t):NO(t)}function AO(t){var e=t.getBoundingClientRect(),n=vr(e.width)/t.offsetWidth||1,r=vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function VO(t,e,n){n===void 0&&(n=!1);var r=ht(e),i=ht(e)&&AO(e),o=mn(e),s=Cr(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||jl(o))&&(l=BO(e)),ht(e)?(c=Cr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=zl(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function DO(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function _O(t){var e=DO(t);return K3.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function LO(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function IO(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var fh={placement:"bottom",modifiers:[],strategy:"absolute"};function hh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function PO(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?fh:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},fh,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(b){var w=typeof b=="function"?b(u.options):b;g(),u.options=Object.assign({},o,u.options,w),u.scrollParents={reference:zn(l)?wi(l):l.contextElement?wi(l.contextElement):[],popper:wi(c)};var T=_O(IO([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(k){return k.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var b=u.elements,w=b.reference,T=b.popper;if(hh(w,T)){u.rects={reference:VO(w,ki(T),u.options.strategy==="fixed"),popper:Il(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var k=0;k<u.orderedModifiers.length;k++){if(u.reset===!0){u.reset=!1,k=-1;continue}var M=u.orderedModifiers[k],v=M.fn,A=M.options,P=A===void 0?{}:A,_=M.name;typeof v=="function"&&(u=v({state:u,options:P,name:_,instance:p})||u)}}}},update:LO(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!hh(l,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,T=w===void 0?{}:w,k=y.effect;if(typeof k=="function"){var M=k({state:u,name:b,instance:p,options:T}),v=function(){};f.push(M||v)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var RO=[aO,OO,sO,Xf,SO,kO,$O,nO,wO],zO=PO({defaultModifiers:RO}),jO="tippy-box",ph="tippy-content",FO="tippy-backdrop",mh="tippy-arrow",gh="tippy-svg-arrow",Fn={passive:!0,capture:!0},yh=function(){return document.body};function HO(t,e){return{}.hasOwnProperty.call(t,e)}function Hl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Wl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function bh(t,e){return typeof t=="function"?t.apply(void 0,e):t}function kh(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function WO(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function UO(t){return t.split(/\s+/).filter(Boolean)}function Er(t){return[].concat(t)}function xh(t,e){t.indexOf(e)===-1&&t.push(e)}function qO(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function KO(t){return t.split("-")[0]}function Io(t){return[].slice.call(t)}function wh(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ci(){return document.createElement("div")}function Si(t){return["Element","Fragment"].some(function(e){return Wl(t,e)})}function YO(t){return Wl(t,"NodeList")}function JO(t){return Wl(t,"MouseEvent")}function GO(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function ZO(t){return Si(t)?[t]:YO(t)?Io(t):Array.isArray(t)?t:Io(document.querySelectorAll(t))}function Ul(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function vh(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function XO(t){var e,n=Er(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function QO(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,c=l.interactiveBorder,d=KO(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>c,y=r-o.bottom-h>c,b=o.left-n+p>c,w=n-o.right-m>c;return g||y||b||w})}function ql(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ch(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Bt={isTouch:!1},Sh=0;function eM(){Bt.isTouch||(Bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Eh))}function Eh(){var t=performance.now();t-Sh<20&&(Bt.isTouch=!1,document.removeEventListener("mousemove",Eh)),Sh=t}function tM(){var t=document.activeElement;if(GO(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function nM(){document.addEventListener("touchstart",eM,Fn),window.addEventListener("blur",tM)}var rM=typeof window<"u"&&typeof document<"u",iM=rM?!!window.msCrypto:!1;function Or(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Oh(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function oM(t){return Oh(`
|
|
94
94
|
%ctippy.js
|
|
95
95
|
|
|
96
96
|
%c`+Oh(t)+`
|
|
97
97
|
|
|
98
98
|
%c👷 This is a development-only message. It will be removed in production.
|
|
99
|
-
`)}function Mh(t){return[
|
|
99
|
+
`)}function Mh(t){return[oM(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ei;process.env.NODE_ENV!=="production"&&sM();function sM(){Ei=new Set}function Ut(t,e){if(t&&!Ei.has(e)){var n;Ei.add(e),(n=console).warn.apply(n,Mh(e))}}function Kl(t,e){if(t&&!Ei.has(e)){var n;Ei.add(e),(n=console).error.apply(n,Mh(e))}}function lM(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Kl(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Kl(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Th={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},aM={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ot=Object.assign({appendTo:yh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Th,aM),cM=Object.keys(ot),dM=function(e){process.env.NODE_ENV!=="production"&&Bh(e,[]);var n=Object.keys(e);n.forEach(function(r){ot[r]=e[r]})};function $h(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=ot[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function uM(t,e){var n=e?Object.keys($h(Object.assign({},ot,{plugins:e}))):cM,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Nh(t,e){var n=Object.assign({},e,{content:bh(e.content,[t])},e.ignoreAttributes?{}:uM(t,e.plugins));return n.aria=Object.assign({},ot.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function Bh(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=WO(ot,Object.keys(Th)),o=!HO(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),Ut(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
100
100
|
|
|
101
101
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
102
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
102
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var fM=function(){return"innerHTML"};function Yl(t,e){t[fM()]=e}function Ah(t){var e=Ci();return t===!0?e.className=mh:(e.className=gh,Si(t)?e.appendChild(t):Yl(e,t)),e}function Vh(t,e){Si(e.content)?(Yl(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Yl(t,e.content):t.textContent=e.content)}function Jl(t){var e=t.firstElementChild,n=Io(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(ph)}),arrow:n.find(function(r){return r.classList.contains(mh)||r.classList.contains(gh)}),backdrop:n.find(function(r){return r.classList.contains(FO)})}}function Dh(t){var e=Ci(),n=Ci();n.className=jO,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ci();r.className=ph,r.setAttribute("data-state","hidden"),Vh(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Jl(e),c=l.box,d=l.content,u=l.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vh(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(Ah(s.arrow))):c.appendChild(Ah(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}Dh.$$tippy=!0;var hM=1,Po=[],Gl=[];function pM(t,e){var n=Nh(t,Object.assign({},ot,$h(wh(e)))),r,i,o,s=!1,l=!1,c=!1,d=!1,u,f,h,p=[],m=kh(Tr,n.interactiveDebounce),g,y=hM++,b=null,w=qO(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},k={id:y,reference:t,popper:Ci(),popperInstance:b,props:n,state:T,plugins:w,clearDelayTimeouts:$r,setProps:Nr,setContent:Br,show:O,hide:E,hideWithInteractivity:z,enable:Wn,disable:kn,unmount:Y,destroy:oe};if(!n.render)return process.env.NODE_ENV!=="production"&&Kl(!0,"render() function has not been supplied."),k;var M=n.render(k),v=M.popper,A=M.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+k.id,k.popper=v,t._tippy=k,v._tippy=k;var P=w.map(function(x){return x.fn(k)}),_=t.hasAttribute("aria-expanded");return be(),Z(),V(),I("onCreate",[k]),n.showOnCreate&&Kt(),v.addEventListener("mouseenter",function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()}),v.addEventListener("mouseleave",function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",m)}),k;function B(){var x=k.props.touch;return Array.isArray(x)?x:[x,0]}function $(){return B()[0]==="hold"}function q(){var x;return!!((x=k.props.render)!=null&&x.$$tippy)}function ee(){return g||t}function L(){var x=ee().parentNode;return x?XO(x):document}function S(){return Jl(v)}function C(x){return k.state.isMounted&&!k.state.isVisible||Bt.isTouch||u&&u.type==="focus"?0:Hl(k.props.delay,x?0:1,ot.delay)}function V(x){x===void 0&&(x=!1),v.style.pointerEvents=k.props.interactive&&!x?"":"none",v.style.zIndex=""+k.props.zIndex}function I(x,W,G){if(G===void 0&&(G=!0),P.forEach(function(se){se[x]&&se[x].apply(se,W)}),G){var ie;(ie=k.props)[x].apply(ie,W)}}function J(){var x=k.props.aria;if(x.content){var W="aria-"+x.content,G=v.id,ie=Er(k.props.triggerTarget||t);ie.forEach(function(se){var de=se.getAttribute(W);if(k.state.isVisible)se.setAttribute(W,de?de+" "+G:G);else{var me=de&&de.replace(G,"").trim();me?se.setAttribute(W,me):se.removeAttribute(W)}})}}function Z(){if(!(_||!k.props.aria.expanded)){var x=Er(k.props.triggerTarget||t);x.forEach(function(W){k.props.interactive?W.setAttribute("aria-expanded",k.state.isVisible&&W===ee()?"true":"false"):W.removeAttribute("aria-expanded")})}}function N(){L().removeEventListener("mousemove",m),Po=Po.filter(function(x){return x!==m})}function D(x){if(!(Bt.isTouch&&(c||x.type==="mousedown"))){var W=x.composedPath&&x.composedPath()[0]||x.target;if(!(k.props.interactive&&Ch(v,W))){if(Er(k.props.triggerTarget||t).some(function(G){return Ch(G,W)})){if(Bt.isTouch||k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[k,x]);k.props.hideOnClick===!0&&(k.clearDelayTimeouts(),k.hide(),l=!0,setTimeout(function(){l=!1}),k.state.isMounted||R())}}}function j(){c=!0}function X(){c=!1}function U(){var x=L();x.addEventListener("mousedown",D,!0),x.addEventListener("touchend",D,Fn),x.addEventListener("touchstart",X,Fn),x.addEventListener("touchmove",j,Fn)}function R(){var x=L();x.removeEventListener("mousedown",D,!0),x.removeEventListener("touchend",D,Fn),x.removeEventListener("touchstart",X,Fn),x.removeEventListener("touchmove",j,Fn)}function te(x,W){le(x,function(){!k.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&W()})}function he(x,W){le(x,W)}function le(x,W){var G=S().box;function ie(se){se.target===G&&(ql(G,"remove",ie),W())}if(x===0)return W();ql(G,"remove",f),ql(G,"add",ie),f=ie}function pe(x,W,G){G===void 0&&(G=!1);var ie=Er(k.props.triggerTarget||t);ie.forEach(function(se){se.addEventListener(x,W,G),p.push({node:se,eventType:x,handler:W,options:G})})}function be(){$()&&(pe("touchstart",pt,{passive:!0}),pe("touchend",yn,{passive:!0})),UO(k.props.trigger).forEach(function(x){if(x!=="manual")switch(pe(x,pt),x){case"mouseenter":pe("mouseleave",yn);break;case"focus":pe(iM?"focusout":"blur",bn);break;case"focusin":pe("focusout",bn);break}})}function Me(){p.forEach(function(x){var W=x.node,G=x.eventType,ie=x.handler,se=x.options;W.removeEventListener(G,ie,se)}),p=[]}function pt(x){var W,G=!1;if(!(!k.state.isEnabled||qt(x)||l)){var ie=((W=u)==null?void 0:W.type)==="focus";u=x,g=x.currentTarget,Z(),!k.state.isVisible&&JO(x)&&Po.forEach(function(se){return se(x)}),x.type==="click"&&(k.props.trigger.indexOf("mouseenter")<0||s)&&k.props.hideOnClick!==!1&&k.state.isVisible?G=!0:Kt(x),x.type==="click"&&(s=!G),G&&!ie&&Dt(x)}}function Tr(x){var W=x.target,G=ee().contains(W)||v.contains(W);if(!(x.type==="mousemove"&&G)){var ie=Vt().concat(v).map(function(se){var de,me=se._tippy,ve=(de=me.popperInstance)==null?void 0:de.state;return ve?{popperRect:se.getBoundingClientRect(),popperState:ve,props:n}:null}).filter(Boolean);QO(ie,x)&&(N(),Dt(x))}}function yn(x){var W=qt(x)||k.props.trigger.indexOf("click")>=0&&s;if(!W){if(k.props.interactive){k.hideWithInteractivity(x);return}Dt(x)}}function bn(x){k.props.trigger.indexOf("focusin")<0&&x.target!==ee()||k.props.interactive&&x.relatedTarget&&v.contains(x.relatedTarget)||Dt(x)}function qt(x){return Bt.isTouch?$()!==x.type.indexOf("touch")>=0:!1}function vt(){mt();var x=k.props,W=x.popperOptions,G=x.placement,ie=x.offset,se=x.getReferenceClientRect,de=x.moveTransition,me=q()?Jl(v).arrow:null,ve=se?{getBoundingClientRect:se,contextElement:se.contextElement||ee()}:t,Ue={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(xn){var _t=xn.state;if(q()){var Oi=S(),la=Oi.box;["placement","reference-hidden","escaped"].forEach(function(Fo){Fo==="placement"?la.setAttribute("data-placement",_t.placement):_t.attributes.popper["data-popper-"+Fo]?la.setAttribute("data-"+Fo,""):la.removeAttribute("data-"+Fo)}),_t.attributes.popper={}}}},st=[{name:"offset",options:{offset:ie}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!de}},Ue];q()&&me&&st.push({name:"arrow",options:{element:me,padding:3}}),st.push.apply(st,(W==null?void 0:W.modifiers)||[]),k.popperInstance=zO(ve,v,Object.assign({},W,{placement:G,onFirstUpdate:h,modifiers:st}))}function mt(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function gt(){var x=k.props.appendTo,W,G=ee();k.props.interactive&&x===yh||x==="parent"?W=G.parentNode:W=bh(x,[G]),W.contains(v)||W.appendChild(v),k.state.isMounted=!0,vt(),process.env.NODE_ENV!=="production"&&Ut(k.props.interactive&&x===ot.appendTo&&G.nextElementSibling!==v,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
103
103
|
|
|
104
104
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
105
105
|
|
|
106
106
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
107
107
|
|
|
108
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Vt(){return Io(
|
|
108
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Vt(){return Io(v.querySelectorAll("[data-tippy-root]"))}function Kt(x){k.clearDelayTimeouts(),x&&I("onTrigger",[k,x]),U();var W=C(!0),G=B(),ie=G[0],se=G[1];Bt.isTouch&&ie==="hold"&&se&&(W=se),W?r=setTimeout(function(){k.show()},W):k.show()}function Dt(x){if(k.clearDelayTimeouts(),I("onUntrigger",[k,x]),!k.state.isVisible){R();return}if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var W=C(!1);W?i=setTimeout(function(){k.state.isVisible&&k.hide()},W):o=requestAnimationFrame(function(){k.hide()})}}function Wn(){k.state.isEnabled=!0}function kn(){k.hide(),k.state.isEnabled=!1}function $r(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Nr(x){if(process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("setProps")),!k.state.isDestroyed){I("onBeforeUpdate",[k,x]),Me();var W=k.props,G=Nh(t,Object.assign({},W,wh(x),{ignoreAttributes:!0}));k.props=G,be(),W.interactiveDebounce!==G.interactiveDebounce&&(N(),m=kh(Tr,G.interactiveDebounce)),W.triggerTarget&&!G.triggerTarget?Er(W.triggerTarget).forEach(function(ie){ie.removeAttribute("aria-expanded")}):G.triggerTarget&&t.removeAttribute("aria-expanded"),Z(),V(),A&&A(W,G),k.popperInstance&&(vt(),Vt().forEach(function(ie){requestAnimationFrame(ie._tippy.popperInstance.forceUpdate)})),I("onAfterUpdate",[k,x])}}function Br(x){k.setProps({content:x})}function O(){process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("show"));var x=k.state.isVisible,W=k.state.isDestroyed,G=!k.state.isEnabled,ie=Bt.isTouch&&!k.props.touch,se=Hl(k.props.duration,0,ot.duration);if(!(x||W||G||ie)&&!ee().hasAttribute("disabled")&&(I("onShow",[k],!1),k.props.onShow(k)!==!1)){if(k.state.isVisible=!0,q()&&(v.style.visibility="visible"),V(),U(),k.state.isMounted||(v.style.transition="none"),q()){var de=S(),me=de.box,ve=de.content;Ul([me,ve],0)}h=function(){var st;if(!(!k.state.isVisible||d)){if(d=!0,v.offsetHeight,v.style.transition=k.props.moveTransition,q()&&k.props.animation){var Un=S(),xn=Un.box,_t=Un.content;Ul([xn,_t],se),vh([xn,_t],"visible")}J(),Z(),xh(Gl,k),(st=k.popperInstance)==null||st.forceUpdate(),I("onMount",[k]),k.props.animation&&q()&&he(se,function(){k.state.isShown=!0,I("onShown",[k])})}},gt()}}function E(){process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("hide"));var x=!k.state.isVisible,W=k.state.isDestroyed,G=!k.state.isEnabled,ie=Hl(k.props.duration,1,ot.duration);if(!(x||W||G)&&(I("onHide",[k],!1),k.props.onHide(k)!==!1)){if(k.state.isVisible=!1,k.state.isShown=!1,d=!1,s=!1,q()&&(v.style.visibility="hidden"),N(),R(),V(!0),q()){var se=S(),de=se.box,me=se.content;k.props.animation&&(Ul([de,me],ie),vh([de,me],"hidden"))}J(),Z(),k.props.animation?q()&&te(ie,k.unmount):k.unmount()}}function z(x){process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("hideWithInteractivity")),L().addEventListener("mousemove",m),xh(Po,m),m(x)}function Y(){process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("unmount")),k.state.isVisible&&k.hide(),k.state.isMounted&&(mt(),Vt().forEach(function(x){x._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),Gl=Gl.filter(function(x){return x!==k}),k.state.isMounted=!1,I("onHidden",[k]))}function oe(){process.env.NODE_ENV!=="production"&&Ut(k.state.isDestroyed,Or("destroy")),!k.state.isDestroyed&&(k.clearDelayTimeouts(),k.unmount(),Me(),delete t._tippy,k.state.isDestroyed=!0,I("onDestroy",[k]))}}function Mr(t,e){e===void 0&&(e={});var n=ot.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(lM(t),Bh(e,n)),nM();var r=Object.assign({},e,{plugins:n}),i=ZO(t);if(process.env.NODE_ENV!=="production"){var o=Si(r.content),s=i.length>1;Ut(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
109
109
|
|
|
110
110
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
111
111
|
|
|
112
112
|
`,`1) content: element.innerHTML
|
|
113
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&dM(d,r);return u&&c.push(u),c},[]);return Si(t)?l[0]:l}Mr.defaultProps=ot,Mr.setDefaultProps=sM,Mr.currentInput=Bt,Object.assign({},Xf,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Mr.setDefaultProps({render:Dh});class uM{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&El(c.selection),y=this.element.contains(document.activeElement);return!(!(l.hasFocus()||y)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var c;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,c)=>{const d=!(c!=null&&c.selection.eq(l.state.selection)),u=!(c!=null&&c.doc.eq(l.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,u,c)},this.updateDelay))},this.updateHandler=(l,c,d,u)=>{var f,h,p;const{state:m,composing:y}=l,{selection:g}=m;if(y||!c&&!d)return;this.createTooltip();const{ranges:v}=g,T=Math.min(...v.map(w=>w.$from.pos)),k=Math.max(...v.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:l,state:m,oldState:u,from:T,to:k}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(u3(m.selection)){let w=l.nodeDOM(T);const A=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(A&&(w=A.firstChild),w)return w.getBoundingClientRect()}return qf(l,T,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const _h=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new uM({view:e,...t})});Oe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[_h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class fM{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{const{selection:c}=l,{$anchor:d,empty:u}=c,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:l,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(l)&&n.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>qf(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Lh=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new fM({view:e,...t})});Oe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Lh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),a.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:l}=t;i.registerPlugin(_h({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:l}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Ih(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class hM extends B3{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=Ih(this.view.state),this.reactiveExtensionStorage=Ih(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),a.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const pM=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=a.ref(),n=a.getCurrentInstance();return a.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=a.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),a.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=a.h(a.Teleport,{to:e.teleportElement,key:e.id},a.h(e.component,{ref:e.id,...e.props}));t.push(n)}),a.h("div",{ref:e=>{this.rootEl=e}},...t)}});a.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Lh({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return a.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const mM=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new hM(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},gM=/^\s*>\s$/,yM=Ge.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[mi({find:gM,type:this.type})]}}),bM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,kM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,xM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vM=dt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[kr({find:bM,type:this.type}),kr({find:xM,type:this.type})]},addPasteRules(){return[xr({find:kM,type:this.type}),xr({find:wM,type:this.type})]}}),CM=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),Ph=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Rh=/^\s*([-+*])\s$/,SM=Ge.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(CM.name,this.editor.getAttributes(Ph.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=mi({find:Rh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mi({find:Rh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ph.name),editor:this.editor})),[t]}}),EM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,OM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,MM=dt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[kr({find:EM,type:this.type})]},addPasteRules(){return[xr({find:OM,type:this.type})]}}),TM=/^```([a-z]+)?[\s\n]$/,$M=/^~~~([a-z]+)?[\s\n]$/,NM=Ge.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",xe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
113
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&pM(d,r);return u&&c.push(u),c},[]);return Si(t)?l[0]:l}Mr.defaultProps=ot,Mr.setDefaultProps=dM,Mr.currentInput=Bt,Object.assign({},Xf,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Mr.setDefaultProps({render:Dh});class mM{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&El(c.selection),g=this.element.contains(document.activeElement);return!(!(l.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var c;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,c)=>{const d=!(c!=null&&c.selection.eq(l.state.selection)),u=!(c!=null&&c.doc.eq(l.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,u,c)},this.updateDelay))},this.updateHandler=(l,c,d,u)=>{var f,h,p;const{state:m,composing:g}=l,{selection:y}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:w}=y,T=Math.min(...w.map(v=>v.$from.pos)),k=Math.max(...w.map(v=>v.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:l,state:m,oldState:u,from:T,to:k}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(m3(m.selection)){let v=l.nodeDOM(T);const A=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(A&&(v=A.firstChild),v)return v.getBoundingClientRect()}return qf(l,T,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const _h=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new mM({view:e,...t})});Oe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[_h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class gM{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{const{selection:c}=l,{$anchor:d,empty:u}=c,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:l,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(l)&&n.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>qf(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Lh=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new gM({view:e,...t})});Oe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Lh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),a.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:l}=t;i.registerPlugin(_h({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:l}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Ih(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class yM extends _3{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=Ih(this.view.state),this.reactiveExtensionStorage=Ih(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),a.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const bM=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=a.ref(),n=a.getCurrentInstance();return a.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=a.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),a.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=a.h(a.Teleport,{to:e.teleportElement,key:e.id},a.h(e.component,{ref:e.id,...e.props}));t.push(n)}),a.h("div",{ref:e=>{this.rootEl=e}},...t)}});a.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Lh({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return a.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const kM=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new yM(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},xM=/^\s*>\s$/,wM=Ge.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[mi({find:xM,type:this.type})]}}),vM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,CM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,SM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,EM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,OM=dt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[kr({find:vM,type:this.type}),kr({find:SM,type:this.type})]},addPasteRules(){return[xr({find:CM,type:this.type}),xr({find:EM,type:this.type})]}}),MM=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),Ph=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Rh=/^\s*([-+*])\s$/,TM=Ge.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MM.name,this.editor.getAttributes(Ph.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=mi({find:Rh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mi({find:Rh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ph.name),editor:this.editor})),[t]}}),$M=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,NM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,BM=dt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[kr({find:$M,type:this.type})]},addPasteRules(){return[xr({find:NM,type:this.type})]}}),AM=/^```([a-z]+)?[\s\n]$/,VM=/^~~~([a-z]+)?[\s\n]$/,DM=Ge.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",xe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
114
114
|
|
|
115
|
-
`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Vl({find:
|
|
116
|
-
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),
|
|
117
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),WM=Ge.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]}`,xe(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=>Vl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var zo=200,Ae=function(){};Ae.prototype.append=function(e){return e.length?(e=Ae.from(e),!this.length&&e||e.length<zo&&this.leafAppend(e)||this.length<zo&&e.leafPrepend(this)||this.appendInner(e)):this},Ae.prototype.prepend=function(e){return e.length?Ae.from(e).append(this):this},Ae.prototype.appendInner=function(e){return new UM(this,e)},Ae.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ae.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ae.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ae.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)},Ae.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Ae.from=function(e){return e instanceof Ae?e:e&&e.length?new zh(e):Ae.empty};var zh=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=zo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=zo)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}(Ae);Ae.empty=new zh([]);var UM=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ae);const qM=500;class wt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new At(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new At(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new wt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new At(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>YM&&(l=KM(l,d),s-=d),new wt(l.append(o),s)}remapping(e,n){let r=new or;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new wt(this.items.append(e.map(n=>new At(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let p=o.getMirror(--c);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let y=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(c+1,p));g&&l++,r.push(new At(m,y,g))}else r.push(new At(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new At(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new wt(u,l);return f.emptyItemCount()>qM&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new At(d.invert(),c,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new wt(Ae.from(i.reverse()),o)}}wt.empty=new wt(Ae.empty,0);function KM(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class At{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 At(n.getMap().invert(),n,this.selection)}}}class gn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const YM=20;function JM(t,e,n,r){let i=n.getMeta(Hn),o;if(i)return i.historyState;n.getMeta(XM)&&(t=new gn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Hn))return s.getMeta(Hn).redo?new gn(t.done.addTransform(n,void 0,r,jo(e)),t.undone,jh(n.mapping.maps),t.prevTime,t.prevComposition):new gn(t.done,t.undone.addTransform(n,void 0,r,jo(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GM(n,t.prevRanges)),d=s?Xl(t.prevRanges,n.mapping):jh(n.mapping.maps);return new gn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,jo(e)),wt.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gn(t.done.rebased(n,o),t.undone.rebased(n,o),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GM(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function jh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Xl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function ZM(t,e,n){let r=jo(e),i=Hn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new gn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Hn,{redo:n,historyState:c})}let Ql=!1,Fh=null;function jo(t){let e=t.plugins;if(Fh!=e){Ql=!1,Fh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ql=!0;break}}return Ql}const Hn=new nt("history"),XM=new nt("closeHistory");function QM(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _e({key:Hn,state:{init(){return new gn(wt.empty,wt.empty,null,0,-1)},apply(e,n,r){return JM(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Wh:r=="historyRedo"?Uh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Hh(t,e){return(n,r)=>{let i=Hn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=ZM(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Wh=Hh(!1,!0),Uh=Hh(!0,!0),eT=Oe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Wh(t,e),redo:()=>({state:t,dispatch:e})=>Uh(t,e)}},addProseMirrorPlugins(){return[QM(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()}}}),tT=Ge.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ce.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(re.create(i.doc,l.pos)):i.setSelection(ce.create(i.doc,l.pos));else{const d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ce.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Yf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),nT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,iT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,oT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,sT=dt.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",xe(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[kr({find:nT,type:this.type}),kr({find:iT,type:this.type})]},addPasteRules(){return[xr({find:rT,type:this.type}),xr({find:oT,type:this.type})]}}),lT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),aT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),qh=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Kh=/^(\d+)\.\s$/,cT=Ge.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",xe(this.options.HTMLAttributes,n),0]:["ol",xe(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(aT.name,this.editor.getAttributes(qh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=mi({find:Kh,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=mi({find:Kh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),dT=Ge.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,fT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,hT=dt.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",xe(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[kr({find:uT,type:this.type})]},addPasteRules(){return[xr({find:fT,type:this.type})]}}),pT=Ge.create({name:"text",group:"inline"}),mT=Oe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,y,g,b;const v=[];return this.options.blockquote!==!1&&v.push(yM.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&v.push(vM.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&v.push(SM.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(MM.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(NM.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(BM.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(DM.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(FM.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&v.push(HM.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&v.push(WM.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&v.push(eT.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&v.push(tT.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&v.push(sT.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&v.push(lT.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&v.push(cT.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&v.push(dT.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&v.push(hT.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&v.push(pT.configure((b=this.options)===null||b===void 0?void 0:b.text)),v}}),gT=Oe.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 _e({key:new nt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,l=s&&s.type.isLeaf,c=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!l||!c);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=rt.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});o.push(g)}return this.options.includeChildren}),Ee.create(t,o)}}})]}}),yT=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ge.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Yf({find:yT,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const bT=Oe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),kT=dt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),xT=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},wT=dt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&xT(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),vT=Oe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),CT={},ST={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},ET=[a.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 OT(t,e){return a.openBlock(),a.createElementBlock("svg",ST,ET)}const MT=ae(CT,[["render",OT]]),TT={},$T={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},NT=[a.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 BT(t,e){return a.openBlock(),a.createElementBlock("svg",$T,NT)}const AT=ae(TT,[["render",BT]]),VT={},DT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},_T=[a.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 LT(t,e){return a.openBlock(),a.createElementBlock("svg",DT,_T)}const IT=ae(VT,[["render",LT]]),PT={},RT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},zT=[a.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 jT(t,e){return a.openBlock(),a.createElementBlock("svg",RT,zT)}const FT=ae(PT,[["render",jT]]),HT={},WT={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},UT=[a.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 qT(t,e){return a.openBlock(),a.createElementBlock("svg",WT,UT)}const KT=ae(HT,[["render",qT]]),YT={},JT={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},GT=[a.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 ZT(t,e){return a.openBlock(),a.createElementBlock("svg",JT,GT)}const XT=ae(YT,[["render",ZT]]),QT={},e$={fill:"currentColor",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"},t$=[a.createElementVNode("g",null,[a.createElementVNode("g",null,[a.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
|
|
115
|
+
`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Vl({find:AM,type:this.type,getAttributes:t=>({language:t[1]})}),Vl({find:VM,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new _e({key:new nt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return t.state.selection.from===t.state.doc.nodeSize-(1+t.state.selection.$to.depth*2)?s.insert(t.state.selection.from-1,this.type.create({language:o})):s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
|
|
116
|
+
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),_M=Ge.create({name:"doc",topNode:!0,content:"block+"});function LM(t={}){return new _e({view(e){return new IM(e,t)}})}class IM{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,c=e.nodeAfter;if(l||c){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=l?u.bottom:u.top;l&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Wd(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const PM=Oe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[LM(this.options)]}});class we extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return we.valid(r)?new we(r):ue.near(r)}content(){return K.empty}eq(e){return e instanceof we&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new we(e.resolve(n.pos))}getBookmark(){return new Zl(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!RM(e)||!zM(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&we.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let c=e.doc.resolve(i);if(we.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!re.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(we.valid(l))return l}return null}}}we.prototype.visible=!1,we.findFrom=we.findGapCursorFrom,ue.jsonID("gapcursor",we);class Zl{constructor(e){this.pos=e}map(e){return new Zl(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return we.valid(n)?new we(n):ue.near(n)}}function RM(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function zM(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function jM(){return new _e({props:{decorations:UM,createSelectionBetween(t,e,n){return e.pos==n.pos&&we.valid(n)?new we(n):null},handleClick:HM,handleKeyDown:FM,handleDOMEvents:{beforeinput:WM}}})}const FM=yf({ArrowLeft:Ro("horiz",-1),ArrowRight:Ro("horiz",1),ArrowUp:Ro("vert",-1),ArrowDown:Ro("vert",1)});function Ro(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,c=s.empty;if(s instanceof ce){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=we.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new we(d))),!0):!1}}function HM(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!we.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&re.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new we(r))),!0)}function WM(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof we))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=F.empty;for(let s=r.length-1;s>=0;s--)i=F.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new K(i,0,0));return o.setSelection(ce.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function UM(t){if(!(t.selection instanceof we))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(t.doc,[rt.widget(t.selection.head,e,{key:"gapcursor"})])}const qM=Oe.create({name:"gapCursor",addProseMirrorPlugins(){return[jM()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=fe(Q(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),KM=Ge.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",xe(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
117
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),YM=Ge.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]}`,xe(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=>Vl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var zo=200,Ae=function(){};Ae.prototype.append=function(e){return e.length?(e=Ae.from(e),!this.length&&e||e.length<zo&&this.leafAppend(e)||this.length<zo&&e.leafPrepend(this)||this.appendInner(e)):this},Ae.prototype.prepend=function(e){return e.length?Ae.from(e).append(this):this},Ae.prototype.appendInner=function(e){return new JM(this,e)},Ae.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ae.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ae.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ae.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)},Ae.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Ae.from=function(e){return e instanceof Ae?e:e&&e.length?new zh(e):Ae.empty};var zh=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=zo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=zo)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}(Ae);Ae.empty=new zh([]);var JM=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ae);const GM=500;class wt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new At(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new At(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new wt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new At(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>XM&&(l=ZM(l,d),s-=d),new wt(l.append(o),s)}remapping(e,n){let r=new or;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new wt(this.items.append(e.map(n=>new At(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let p=o.getMirror(--c);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&l++,r.push(new At(m,g,y))}else r.push(new At(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new At(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new wt(u,l);return f.emptyItemCount()>GM&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new At(d.invert(),c,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new wt(Ae.from(i.reverse()),o)}}wt.empty=new wt(Ae.empty,0);function ZM(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class At{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 At(n.getMap().invert(),n,this.selection)}}}class gn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const XM=20;function QM(t,e,n,r){let i=n.getMeta(Hn),o;if(i)return i.historyState;n.getMeta(nT)&&(t=new gn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Hn))return s.getMeta(Hn).redo?new gn(t.done.addTransform(n,void 0,r,jo(e)),t.undone,jh(n.mapping.maps),t.prevTime,t.prevComposition):new gn(t.done,t.undone.addTransform(n,void 0,r,jo(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!eT(n,t.prevRanges)),d=s?Xl(t.prevRanges,n.mapping):jh(n.mapping.maps);return new gn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,jo(e)),wt.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gn(t.done.rebased(n,o),t.undone.rebased(n,o),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function eT(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function jh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Xl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function tT(t,e,n){let r=jo(e),i=Hn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new gn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Hn,{redo:n,historyState:c})}let Ql=!1,Fh=null;function jo(t){let e=t.plugins;if(Fh!=e){Ql=!1,Fh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ql=!0;break}}return Ql}const Hn=new nt("history"),nT=new nt("closeHistory");function rT(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _e({key:Hn,state:{init(){return new gn(wt.empty,wt.empty,null,0,-1)},apply(e,n,r){return QM(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Wh:r=="historyRedo"?Uh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Hh(t,e){return(n,r)=>{let i=Hn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=tT(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Wh=Hh(!1,!0),Uh=Hh(!0,!0),iT=Oe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Wh(t,e),redo:()=>({state:t,dispatch:e})=>Uh(t,e)}},addProseMirrorPlugins(){return[rT(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()}}}),oT=Ge.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ce.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(re.create(i.doc,l.pos)):i.setSelection(ce.create(i.doc,l.pos));else{const d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ce.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Yf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,lT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,aT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,cT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,dT=dt.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",xe(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[kr({find:sT,type:this.type}),kr({find:aT,type:this.type})]},addPasteRules(){return[xr({find:lT,type:this.type}),xr({find:cT,type:this.type})]}}),uT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),fT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(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)}}}),qh=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Kh=/^(\d+)\.\s$/,hT=Ge.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",xe(this.options.HTMLAttributes,n),0]:["ol",xe(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(fT.name,this.editor.getAttributes(qh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=mi({find:Kh,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=mi({find:Kh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),pT=Ge.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,gT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yT=dt.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",xe(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[kr({find:mT,type:this.type})]},addPasteRules(){return[xr({find:gT,type:this.type})]}}),bT=Ge.create({name:"text",group:"inline"}),kT=Oe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,g,y,b;const w=[];return this.options.blockquote!==!1&&w.push(wM.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&w.push(OM.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&w.push(TM.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&w.push(BM.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&w.push(DM.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&w.push(_M.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&w.push(PM.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&w.push(qM.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&w.push(KM.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&w.push(YM.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&w.push(iT.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&w.push(oT.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&w.push(dT.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&w.push(uT.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&w.push(hT.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&w.push(pT.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&w.push(yT.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&w.push(bT.configure((b=this.options)===null||b===void 0?void 0:b.text)),w}}),xT=Oe.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 _e({key:new nt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,l=s&&s.type.isLeaf,c=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!l||!c);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=rt.node(h,h+f.nodeSize,{class:g.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});o.push(y)}return this.options.includeChildren}),Ee.create(t,o)}}})]}}),wT=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ge.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Yf({find:wT,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const vT=Oe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),CT=dt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ST=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},ET=dt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&ST(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),OT=Oe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),MT={},TT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},$T=[a.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 NT(t,e){return a.openBlock(),a.createElementBlock("svg",TT,$T)}const BT=ae(MT,[["render",NT]]),AT={},VT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},DT=[a.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 _T(t,e){return a.openBlock(),a.createElementBlock("svg",VT,DT)}const LT=ae(AT,[["render",_T]]),IT={},PT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},RT=[a.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 zT(t,e){return a.openBlock(),a.createElementBlock("svg",PT,RT)}const jT=ae(IT,[["render",zT]]),FT={},HT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},WT=[a.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 UT(t,e){return a.openBlock(),a.createElementBlock("svg",HT,WT)}const qT=ae(FT,[["render",UT]]),KT={},YT={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},JT=[a.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 GT(t,e){return a.openBlock(),a.createElementBlock("svg",YT,JT)}const ZT=ae(KT,[["render",GT]]),XT={},QT={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},e$=[a.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 t$(t,e){return a.openBlock(),a.createElementBlock("svg",QT,e$)}const n$=ae(XT,[["render",t$]]),r$={},i$={fill:"currentColor",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"},o$=[a.createElementVNode("g",null,[a.createElementVNode("g",null,[a.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 n$(t,e){return a.openBlock(),a.createElementBlock("svg",e$,t$)}const r$=ae(QT,[["render",n$]]),i$={},o$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},s$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_1_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-432.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_1_fill" transform="translate(432.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M19.0001,13.5187 L19.0001,20 C19.0001,20.5523 18.5524,21 18.0001,21 C17.4478,21 17.0001,20.5523 17.0001,20 L17.0001,15.366 C16.5471,15.6281 15.9624,15.4962 15.6681,15.0547 C15.3617,14.5951 15.4859,13.9743 15.9454,13.6679 L17.4299,12.6783 C18.101,12.2308 19.0001,12.712 19.0001,13.5187 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function l$(t,e){return a.openBlock(),a.createElementBlock("svg",o$,s$)}const a$=ae(i$,[["render",l$]]),c$={},d$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},u$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_2_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-480.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_2_fill" transform="translate(480.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M17.6575,12.6792 C18.2901,12.521 18.9499,12.6085 19.5304,12.8987 C20.6957,13.4814 21.2873,14.8195 20.9732,16.0757 C20.8743714,16.4711857 20.6906857,16.8394878 20.4358711,17.1556055 L20.3026,17.3092 L18.7244,19.0001 L20.3542,19.0001 C20.9065,19.0001 21.3542,19.4478 21.3542,20.0001 C21.3542,20.51295 20.968173,20.9356092 20.4708239,20.9933725 L20.3542,21.0001 L16.6492,21.0001 C16.0918,21.0001 15.6399,20.5482 15.6399,19.9908 C15.6399,19.69785 15.6621031,19.4213609 15.830043,19.1827703 L15.9113,19.0829 L18.8405,15.9446 C19.313,15.4383 18.8904,14.4325 18.1425,14.6195 C17.8287222,14.6979889 17.6756556,14.9547296 17.6455145,15.2464465 L17.6399,15.3572 C17.6399,15.9095 17.1922,16.3572 16.6399,16.3572 C16.0876,16.3572 15.6399,15.9095 15.6399,15.3572 C15.6399,14.1109 16.4218,12.9881 17.6575,12.6792 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function f$(t,e){return a.openBlock(),a.createElementBlock("svg",d$,u$)}const h$=ae(c$,[["render",f$]]),p$={},m$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},g$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_3_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-528.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_3_fill" transform="translate(528.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M18.3715,12.5 C19.827,12.5 21.0001,13.6854 21.0001,15.1334 C21.0001,15.7245 20.8,16.2932 20.4418,16.7501 C20.7999,17.2069 20.9999,17.7756 20.9999,18.3666 C20.9999,19.8146 19.8268,21 18.3713,21 C17.3195,21 16.332,20.6496 15.8873,19.6016 C15.6461,19.033 15.6582,18.3518 16.3235,18.0694 C16.7955857,17.8691071 17.3354439,18.0594112 17.5829394,18.4946729 L17.6347,18.5994 C17.7727273,18.9247091 17.9135661,18.9858645 18.1765622,18.9973488 L18.3713,19 L18.3713,19 C18.7147,19 18.9999,18.7176 18.9999,18.3666 C18.9999,17.9941455 18.7151893,17.7892942 18.3855875,17.7551267 L18.2856,17.75 C17.7333,17.75 17.2856,17.3023 17.2856,16.75 C17.2856,16.23715 17.6717995,15.8144908 18.1691731,15.7567275 L18.2858,15.75 C18.6556,15.75 19.0001,15.5431 19.0001,15.1334 C19.0001,14.7824 18.7149,14.5 18.3715,14.5 L18.1767622,14.5026512 C17.9429879,14.5128595 17.8057329,14.562314 17.6811769,14.8016529 L17.6349,14.9006 C17.4192,15.409 16.8322,15.6463 16.3238,15.4306 C15.6584,15.1482 15.6463,14.467 15.8876,13.8984 C16.3323,12.8504 17.3197,12.5 18.3715,12.5 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function y$(t,e){return a.openBlock(),a.createElementBlock("svg",m$,g$)}const b$=ae(p$,[["render",y$]]),k$={},x$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},w$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function v$(t,e){return a.openBlock(),a.createElementBlock("svg",x$,w$)}const C$=ae(k$,[["render",v$]]),S$={},E$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},O$=[a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8ZM5.5 12.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"},null,-1)];function M$(t,e){return a.openBlock(),a.createElementBlock("svg",E$,O$)}const T$=ae(S$,[["render",M$]]),$$={},N$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},B$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm6 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function A$(t,e){return a.openBlock(),a.createElementBlock("svg",N$,B$)}const V$=ae($$,[["render",A$]]),D$={},_$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},L$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function I$(t,e){return a.openBlock(),a.createElementBlock("svg",_$,L$)}const P$=ae(D$,[["render",I$]]),R$={},z$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},j$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.75 2a.75.75 0 0 1 .75.75V7a2.5 2.5 0 0 0 5 0V2.75a.75.75 0 0 1 1.5 0V7a4 4 0 0 1-8 0V2.75A.75.75 0 0 1 4.75 2ZM2 13.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function F$(t,e){return a.openBlock(),a.createElementBlock("svg",z$,j$)}const H$=ae(R$,[["render",F$]]),W$={},U$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},q$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.165 3.654c-.95-.255-1.921-.273-2.693-.042-.769.231-1.087.624-1.173.947-.087.323-.008.822.543 1.407.389.412.927.77 1.55 1.034H13a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 3 7h1.756l-.006-.006c-.787-.835-1.161-1.849-.9-2.823.26-.975 1.092-1.666 2.191-1.995 1.097-.33 2.36-.28 3.512.029.75.2 1.478.518 2.11.939a.75.75 0 0 1-.833 1.248 5.682 5.682 0 0 0-1.665-.738Zm2.074 6.365a.75.75 0 0 1 .91.543 2.44 2.44 0 0 1-.35 2.024c-.405.585-1.052 1.003-1.84 1.24-1.098.329-2.36.279-3.512-.03-1.152-.308-2.27-.897-3.056-1.73a.75.75 0 0 1 1.092-1.029c.552.586 1.403 1.056 2.352 1.31.95.255 1.92.273 2.692.042.55-.165.873-.417 1.038-.656a.942.942 0 0 0 .13-.803.75.75 0 0 1 .544-.91Z","clip-rule":"evenodd"},null,-1)];function K$(t,e){return a.openBlock(),a.createElementBlock("svg",U$,q$)}const Y$=ae(W$,[["render",K$]]),J$={},G$={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Z$=[a.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"},null,-1),a.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),a.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[a.createElementVNode("path",{d:"M5 18h14v3H5zm7.5-14h-1c-.401 0-.764.24-.921.609L5.745 16h2.173l1.273-3h5.604l1.268 3h2.171L13.421 4.61A1 1 0 0 0 12.5 4zm-2.46 7 1.959-4.616L13.95 11h-3.91z"})],-1)];function X$(t,e){return a.openBlock(),a.createElementBlock("svg",G$,Z$)}const Q$=ae(J$,[["render",X$]]),eN={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},tN={class:"flex gap-px"},nN=["onClick"],rN={key:1,class:"text-sm"},iN=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""},heading:Boolean,textAlign:Boolean,underline:Boolean,strike:Boolean,customStyles:{type:{},default:()=>{}},color:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=a.ref("#000000"),i=a.ref(!1),o=a.ref(),s={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-gray-300 dark:text-gray-200 dark:bg-gray-930 dark:border-gray-900"},l=[{method:"toggleBold",type:"chain",label:"bold",icon:XT,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:KT,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:H$,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:Y$,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:r$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:a$,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:h$,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:b$,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:C$,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:T$,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:V$,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:P$,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:MT,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:AT,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:IT,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:FT,disableCheck:!0,active:!0}],c=e,d=mM({content:n.modelValue,extensions:[mT,kT,vT,wT,bT.configure({types:["heading","paragraph"]}),gT.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});a.onBeforeUnmount(()=>{d.value.destroy()}),a.watch(()=>n.modelValue,m=>{m!==d.value.getHTML()&&d.value.commands.setContent(m,!1)});function u(m,y,g){if(m==="setTextAlign"){d.value.isActive({textAlign:g})?d.value.chain().focus().unsetTextAlign().run():d.value.chain().focus().setTextAlign(g).run();return}y==="chain"?g?d.value.chain().focus()[m](g).run():d.value.chain().focus()[m]().run():d.value[m]()()}function f(m,y,g,b){return b?y==="chain"?g?!d.value.can().chain().focus()[m](g).run():!d.value.can().chain().focus()[m]().run():!d.value.can()[m]().run():!1}const h=()=>{d.value.chain().focus().setColor(r.value).run(),i.value=!1},p=()=>{o.value.click()};return(m,y)=>{var g;return a.unref(d)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[a.unref(ne).theme]])},[a.createElementVNode("div",eN,[a.createElementVNode("div",tN,[t.color?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:p,class:"w-8 h-8 relative flex cursor-pointer items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10"},[a.createVNode(Q$,{class:"w-5 h-5",style:{}}),a.withDirectives(a.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":y[0]||(y[0]=b=>r.value=b),class:"w-0",onInput:h},null,544),[[a.vModelText,r.value]])])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.filter(b=>b.active),b=>(a.openBlock(),a.createElementBlock("div",{key:b.method,class:a.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10",{"cursor-pointer":!f(b.method,b.type,b.params,b.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":b.label.startsWith("h")?a.unref(d).isActive("heading",{level:b.params.level}):b.method==="setTextAlign"?a.unref(d).isActive({textAlign:b.params}):a.unref(d).isActive(b.label)}]),onClick:v=>u(b.method,b.type,b.params)},[b.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":b.smallIcon,"w-4 h-4":!b.smallIcon&&!b.largeIcon,"w-5 h-5":b.largeIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",rN,a.toDisplayString(a.unref(Sg).capitalize(b.label)),1))],10,nN))),128))])]),a.createElementVNode("div",{class:"max-h-72 w-full overflow-auto px-4 py-3 rounded-b-sm",style:a.normalizeStyle({backgroundColor:(g=t.customStyles)==null?void 0:g.backgroundColor})},[a.createVNode(a.unref(pM),{editor:a.unref(d)},null,8,["editor"])],4)],2)):a.createCommentVNode("",!0)}}}),oN={},sN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function aN(t,e){return a.openBlock(),a.createElementBlock("svg",sN,lN)}const cN=ae(oN,[["render",aN]]),dN={},uN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},fN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function hN(t,e){return a.openBlock(),a.createElementBlock("svg",uN,fN)}const pN=ae(dN,[["render",hN]]),mN={},gN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},yN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),a.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),a.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function bN(t,e){return a.openBlock(),a.createElementBlock("svg",gN,yN)}const kN=ae(mN,[["render",bN]]),xN={class:"flex-1"},wN=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(["inline-flex items-center justify-center border-0 font-normal rounded-md min-h-6 gap-1 leading-none text-sm px-2",{"bg-green-100 border-green-200 text-green-700 dark:border-green-600/30 dark:bg-green-800/15 dark:text-green-500/85":t.success,"bg-yellow-100 border-yellow-200 text-yellow-700 dark:border-yellow-600/30 dark:bg-yellow-800/15 dark:text-yellow-500/85":t.warning,"bg-red-100 border-red-200 text-red-700 dark:border-red-600/30 dark:bg-red-800/15 dark:text-red-500/85":t.error,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.success&&!t.warning&&!t.error}])},[t.complete?(a.openBlock(),a.createBlock(cN,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(pN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(kN,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.createElementVNode("span",xN,[a.renderSlot(e.$slots,"default")])],2))}}),ea={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":`
|
|
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 s$(t,e){return a.openBlock(),a.createElementBlock("svg",i$,o$)}const l$=ae(r$,[["render",s$]]),a$={},c$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},d$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_1_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-432.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_1_fill" transform="translate(432.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M19.0001,13.5187 L19.0001,20 C19.0001,20.5523 18.5524,21 18.0001,21 C17.4478,21 17.0001,20.5523 17.0001,20 L17.0001,15.366 C16.5471,15.6281 15.9624,15.4962 15.6681,15.0547 C15.3617,14.5951 15.4859,13.9743 15.9454,13.6679 L17.4299,12.6783 C18.101,12.2308 19.0001,12.712 19.0001,13.5187 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function u$(t,e){return a.openBlock(),a.createElementBlock("svg",c$,d$)}const f$=ae(a$,[["render",u$]]),h$={},p$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},m$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_2_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-480.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_2_fill" transform="translate(480.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M17.6575,12.6792 C18.2901,12.521 18.9499,12.6085 19.5304,12.8987 C20.6957,13.4814 21.2873,14.8195 20.9732,16.0757 C20.8743714,16.4711857 20.6906857,16.8394878 20.4358711,17.1556055 L20.3026,17.3092 L18.7244,19.0001 L20.3542,19.0001 C20.9065,19.0001 21.3542,19.4478 21.3542,20.0001 C21.3542,20.51295 20.968173,20.9356092 20.4708239,20.9933725 L20.3542,21.0001 L16.6492,21.0001 C16.0918,21.0001 15.6399,20.5482 15.6399,19.9908 C15.6399,19.69785 15.6621031,19.4213609 15.830043,19.1827703 L15.9113,19.0829 L18.8405,15.9446 C19.313,15.4383 18.8904,14.4325 18.1425,14.6195 C17.8287222,14.6979889 17.6756556,14.9547296 17.6455145,15.2464465 L17.6399,15.3572 C17.6399,15.9095 17.1922,16.3572 16.6399,16.3572 C16.0876,16.3572 15.6399,15.9095 15.6399,15.3572 C15.6399,14.1109 16.4218,12.9881 17.6575,12.6792 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function g$(t,e){return a.openBlock(),a.createElementBlock("svg",p$,m$)}const y$=ae(h$,[["render",g$]]),b$={},k$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},x$=[a.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_3_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-528.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_3_fill" transform="translate(528.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M18.3715,12.5 C19.827,12.5 21.0001,13.6854 21.0001,15.1334 C21.0001,15.7245 20.8,16.2932 20.4418,16.7501 C20.7999,17.2069 20.9999,17.7756 20.9999,18.3666 C20.9999,19.8146 19.8268,21 18.3713,21 C17.3195,21 16.332,20.6496 15.8873,19.6016 C15.6461,19.033 15.6582,18.3518 16.3235,18.0694 C16.7955857,17.8691071 17.3354439,18.0594112 17.5829394,18.4946729 L17.6347,18.5994 C17.7727273,18.9247091 17.9135661,18.9858645 18.1765622,18.9973488 L18.3713,19 L18.3713,19 C18.7147,19 18.9999,18.7176 18.9999,18.3666 C18.9999,17.9941455 18.7151893,17.7892942 18.3855875,17.7551267 L18.2856,17.75 C17.7333,17.75 17.2856,17.3023 17.2856,16.75 C17.2856,16.23715 17.6717995,15.8144908 18.1691731,15.7567275 L18.2858,15.75 C18.6556,15.75 19.0001,15.5431 19.0001,15.1334 C19.0001,14.7824 18.7149,14.5 18.3715,14.5 L18.1767622,14.5026512 C17.9429879,14.5128595 17.8057329,14.562314 17.6811769,14.8016529 L17.6349,14.9006 C17.4192,15.409 16.8322,15.6463 16.3238,15.4306 C15.6584,15.1482 15.6463,14.467 15.8876,13.8984 C16.3323,12.8504 17.3197,12.5 18.3715,12.5 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function w$(t,e){return a.openBlock(),a.createElementBlock("svg",k$,x$)}const v$=ae(b$,[["render",w$]]),C$={},S$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},E$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function O$(t,e){return a.openBlock(),a.createElementBlock("svg",S$,E$)}const M$=ae(C$,[["render",O$]]),T$={},$$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},N$=[a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8ZM5.5 12.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"},null,-1)];function B$(t,e){return a.openBlock(),a.createElementBlock("svg",$$,N$)}const A$=ae(T$,[["render",B$]]),V$={},D$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},_$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm6 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function L$(t,e){return a.openBlock(),a.createElementBlock("svg",D$,_$)}const I$=ae(V$,[["render",L$]]),P$={},R$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},z$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function j$(t,e){return a.openBlock(),a.createElementBlock("svg",R$,z$)}const F$=ae(P$,[["render",j$]]),H$={},W$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},U$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.75 2a.75.75 0 0 1 .75.75V7a2.5 2.5 0 0 0 5 0V2.75a.75.75 0 0 1 1.5 0V7a4 4 0 0 1-8 0V2.75A.75.75 0 0 1 4.75 2ZM2 13.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function q$(t,e){return a.openBlock(),a.createElementBlock("svg",W$,U$)}const K$=ae(H$,[["render",q$]]),Y$={},J$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},G$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.165 3.654c-.95-.255-1.921-.273-2.693-.042-.769.231-1.087.624-1.173.947-.087.323-.008.822.543 1.407.389.412.927.77 1.55 1.034H13a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 3 7h1.756l-.006-.006c-.787-.835-1.161-1.849-.9-2.823.26-.975 1.092-1.666 2.191-1.995 1.097-.33 2.36-.28 3.512.029.75.2 1.478.518 2.11.939a.75.75 0 0 1-.833 1.248 5.682 5.682 0 0 0-1.665-.738Zm2.074 6.365a.75.75 0 0 1 .91.543 2.44 2.44 0 0 1-.35 2.024c-.405.585-1.052 1.003-1.84 1.24-1.098.329-2.36.279-3.512-.03-1.152-.308-2.27-.897-3.056-1.73a.75.75 0 0 1 1.092-1.029c.552.586 1.403 1.056 2.352 1.31.95.255 1.92.273 2.692.042.55-.165.873-.417 1.038-.656a.942.942 0 0 0 .13-.803.75.75 0 0 1 .544-.91Z","clip-rule":"evenodd"},null,-1)];function Z$(t,e){return a.openBlock(),a.createElementBlock("svg",J$,G$)}const X$=ae(Y$,[["render",Z$]]),Q$={},eN={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},tN=[a.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"},null,-1),a.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),a.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[a.createElementVNode("path",{d:"M5 18h14v3H5zm7.5-14h-1c-.401 0-.764.24-.921.609L5.745 16h2.173l1.273-3h5.604l1.268 3h2.171L13.421 4.61A1 1 0 0 0 12.5 4zm-2.46 7 1.959-4.616L13.95 11h-3.91z"})],-1)];function nN(t,e){return a.openBlock(),a.createElementBlock("svg",eN,tN)}const rN=ae(Q$,[["render",nN]]),iN={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},oN={class:"flex gap-px"},sN=["onClick"],lN={key:1,class:"text-sm"},aN=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""},heading:Boolean,textAlign:Boolean,underline:Boolean,strike:Boolean,customStyles:{type:{},default:()=>{}},color:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=a.ref("#000000"),i=a.ref(!1),o=a.ref(),s={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-gray-300 dark:text-gray-200 dark:bg-gray-930 dark:border-gray-900"},l=[{method:"toggleBold",type:"chain",label:"bold",icon:n$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:ZT,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:K$,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:X$,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:l$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:f$,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:y$,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:v$,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:M$,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:A$,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:I$,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:F$,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:BT,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:LT,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:jT,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:qT,disableCheck:!0,active:!0}],c=e,d=kM({content:n.modelValue,extensions:[kT,CT,OT,ET,vT.configure({types:["heading","paragraph"]}),xT.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});a.onBeforeUnmount(()=>{d.value.destroy()}),a.watch(()=>n.modelValue,m=>{m!==d.value.getHTML()&&d.value.commands.setContent(m,!1)});function u(m,g,y){if(m==="setTextAlign"){d.value.isActive({textAlign:y})?d.value.chain().focus().unsetTextAlign().run():d.value.chain().focus().setTextAlign(y).run();return}g==="chain"?y?d.value.chain().focus()[m](y).run():d.value.chain().focus()[m]().run():d.value[m]()()}function f(m,g,y,b){return b?g==="chain"?y?!d.value.can().chain().focus()[m](y).run():!d.value.can().chain().focus()[m]().run():!d.value.can()[m]().run():!1}const h=()=>{d.value.chain().focus().setColor(r.value).run(),i.value=!1},p=()=>{o.value.click()};return(m,g)=>{var y;return a.unref(d)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[a.unref(ne).theme]])},[a.createElementVNode("div",iN,[a.createElementVNode("div",oN,[t.color?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:p,class:"w-8 h-8 relative flex cursor-pointer items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10"},[a.createVNode(rN,{class:"w-5 h-5",style:{}}),a.withDirectives(a.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=b=>r.value=b),class:"w-0",onInput:h},null,544),[[a.vModelText,r.value]])])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.filter(b=>b.active),b=>(a.openBlock(),a.createElementBlock("div",{key:b.method,class:a.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10",{"cursor-pointer":!f(b.method,b.type,b.params,b.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":b.label.startsWith("h")?a.unref(d).isActive("heading",{level:b.params.level}):b.method==="setTextAlign"?a.unref(d).isActive({textAlign:b.params}):a.unref(d).isActive(b.label)}]),onClick:w=>u(b.method,b.type,b.params)},[b.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":b.smallIcon,"w-4 h-4":!b.smallIcon&&!b.largeIcon,"w-5 h-5":b.largeIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",lN,a.toDisplayString(a.unref(Sg).capitalize(b.label)),1))],10,sN))),128))])]),a.createElementVNode("div",{class:"max-h-72 w-full overflow-auto px-4 py-3 rounded-b-sm",style:a.normalizeStyle({backgroundColor:(y=t.customStyles)==null?void 0:y.backgroundColor})},[a.createVNode(a.unref(bM),{editor:a.unref(d)},null,8,["editor"])],4)],2)):a.createCommentVNode("",!0)}}}),cN={},dN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function fN(t,e){return a.openBlock(),a.createElementBlock("svg",dN,uN)}const hN=ae(cN,[["render",fN]]),pN={},mN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},gN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function yN(t,e){return a.openBlock(),a.createElementBlock("svg",mN,gN)}const bN=ae(pN,[["render",yN]]),kN={},xN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},wN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),a.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),a.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function vN(t,e){return a.openBlock(),a.createElementBlock("svg",xN,wN)}const CN=ae(kN,[["render",vN]]),SN={class:"flex-1"},EN=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(["inline-flex items-center justify-center border-0 font-normal rounded-md min-h-6 gap-1 leading-none text-sm px-2",{"bg-green-100 border-green-200 text-green-700 dark:border-green-600/30 dark:bg-green-800/15 dark:text-green-500/85":t.success,"bg-yellow-100 border-yellow-200 text-yellow-700 dark:border-yellow-600/30 dark:bg-yellow-800/15 dark:text-yellow-500/85":t.warning,"bg-red-100 border-red-200 text-red-700 dark:border-red-600/30 dark:bg-red-800/15 dark:text-red-500/85":t.error,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.success&&!t.warning&&!t.error}])},[t.complete?(a.openBlock(),a.createBlock(hN,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(bN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(CN,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.createElementVNode("span",SN,[a.renderSlot(e.$slots,"default")])],2))}}),ea={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":`
|
|
121
121
|
hover:text-lime-500
|
|
122
122
|
rounded-full
|
|
123
123
|
|
|
@@ -130,4 +130,4 @@ img.ProseMirror-separator {
|
|
|
130
130
|
group-[.is-off]:text-gray-300
|
|
131
131
|
dark:group-[.is-off]:text-gray-800
|
|
132
132
|
|
|
133
|
-
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(l,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected&&!t.off,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[a.createElementVNode("div",{class:a.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[a.unref(ne).theme]}`]:t.between,[`${i[a.unref(ne).theme]}`]:t.firstDay,[`${o[a.unref(ne).theme]}`]:t.lastDay,[`${s[a.unref(ne).theme]}`]:t.highlight}]),style:a.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[a.createElementVNode("span",{class:a.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[a.unref(ne).theme]}`]:!0,[`${n[a.unref(ne).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[a.renderSlot(l.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.day),1)])],2)],6)],2))}};var Yh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",l="minute",c="hour",d="day",u="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var S=["th","st","nd","rd"],C=L%100;return"["+L+(S[(C-20)%10]||S[C]||S[0])+"]"}},T=function(L,S,C){var V=String(L);return!V||V.length>=S?L:""+Array(S+1-V.length).join(C)+L},k={s:T,z:function(L){var S=-L.utcOffset(),C=Math.abs(S),V=Math.floor(C/60),I=C%60;return(S<=0?"+":"-")+T(V,2,"0")+":"+T(I,2,"0")},m:function L(S,C){if(S.date()<C.date())return-L(C,S);var V=12*(C.year()-S.year())+(C.month()-S.month()),I=S.clone().add(V,f),J=C-I<0,Z=S.clone().add(V+(J?-1:1),f);return+(-(V+(C-I)/(J?I-Z:Z-I))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},M="en",w={};w[M]=v;var A="$isDayjsObject",P=function(L){return L instanceof q||!(!L||!L[A])},_=function L(S,C,V){var I;if(!S)return M;if(typeof S=="string"){var J=S.toLowerCase();w[J]&&(I=J),C&&(w[J]=C,I=J);var Z=S.split("-");if(!I&&Z.length>1)return L(Z[0])}else{var N=S.name;w[N]=S,I=N}return!V&&I&&(M=I),I||!V&&M},B=function(L,S){if(P(L))return L.clone();var C=typeof S=="object"?S:{};return C.date=L,C.args=arguments,new q(C)},$=k;$.l=_,$.i=P,$.w=function(L,S){return B(L,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var q=function(){function L(C){this.$L=_(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[A]=!0}var S=L.prototype;return S.parse=function(C){this.$d=function(V){var I=V.date,J=V.utc;if(I===null)return new Date(NaN);if($.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var Z=I.match(g);if(Z){var N=Z[2]-1||0,D=(Z[7]||"0").substring(0,3);return J?new Date(Date.UTC(Z[1],N,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,D)):new Date(Z[1],N,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,D)}}return new Date(I)}(C),this.init()},S.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},S.$utils=function(){return $},S.isValid=function(){return this.$d.toString()!==y},S.isSame=function(C,V){var I=B(C);return this.startOf(V)<=I&&I<=this.endOf(V)},S.isAfter=function(C,V){return B(C)<this.startOf(V)},S.isBefore=function(C,V){return this.endOf(V)<B(C)},S.$g=function(C,V,I){return $.u(C)?this[V]:this.set(I,C)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(C,V){var I=this,J=!!$.u(V)||V,Z=$.p(C),N=function(le,pe){var be=$.w(I.$u?Date.UTC(I.$y,pe,le):new Date(I.$y,pe,le),I);return J?be:be.endOf(d)},D=function(le,pe){return $.w(I.toDate()[le].apply(I.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(pe)),I)},j=this.$W,X=this.$M,U=this.$D,R="set"+(this.$u?"UTC":"");switch(Z){case p:return J?N(1,0):N(31,11);case f:return J?N(1,X):N(0,X+1);case u:var te=this.$locale().weekStart||0,he=(j<te?j+7:j)-te;return N(J?U-he:U+(6-he),X);case d:case m:return D(R+"Hours",0);case c:return D(R+"Minutes",1);case l:return D(R+"Seconds",2);case s:return D(R+"Milliseconds",3);default:return this.clone()}},S.endOf=function(C){return this.startOf(C,!1)},S.$set=function(C,V){var I,J=$.p(C),Z="set"+(this.$u?"UTC":""),N=(I={},I[d]=Z+"Date",I[m]=Z+"Date",I[f]=Z+"Month",I[p]=Z+"FullYear",I[c]=Z+"Hours",I[l]=Z+"Minutes",I[s]=Z+"Seconds",I[o]=Z+"Milliseconds",I)[J],D=J===d?this.$D+(V-this.$W):V;if(J===f||J===p){var j=this.clone().set(m,1);j.$d[N](D),j.init(),this.$d=j.set(m,Math.min(this.$D,j.daysInMonth())).$d}else N&&this.$d[N](D);return this.init(),this},S.set=function(C,V){return this.clone().$set(C,V)},S.get=function(C){return this[$.p(C)]()},S.add=function(C,V){var I,J=this;C=Number(C);var Z=$.p(V),N=function(X){var U=B(J);return $.w(U.date(U.date()+Math.round(X*C)),J)};if(Z===f)return this.set(f,this.$M+C);if(Z===p)return this.set(p,this.$y+C);if(Z===d)return N(1);if(Z===u)return N(7);var D=(I={},I[l]=r,I[c]=i,I[s]=n,I)[Z]||1,j=this.$d.getTime()+C*D;return $.w(j,this)},S.subtract=function(C,V){return this.add(-1*C,V)},S.format=function(C){var V=this,I=this.$locale();if(!this.isValid())return I.invalidDate||y;var J=C||"YYYY-MM-DDTHH:mm:ssZ",Z=$.z(this),N=this.$H,D=this.$m,j=this.$M,X=I.weekdays,U=I.months,R=I.meridiem,te=function(pe,be,Me,pt){return pe&&(pe[be]||pe(V,J))||Me[be].slice(0,pt)},he=function(pe){return $.s(N%12||12,pe,"0")},le=R||function(pe,be,Me){var pt=pe<12?"AM":"PM";return Me?pt.toLowerCase():pt};return J.replace(b,function(pe,be){return be||function(Me){switch(Me){case"YY":return String(V.$y).slice(-2);case"YYYY":return $.s(V.$y,4,"0");case"M":return j+1;case"MM":return $.s(j+1,2,"0");case"MMM":return te(I.monthsShort,j,U,3);case"MMMM":return te(U,j);case"D":return V.$D;case"DD":return $.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return te(I.weekdaysMin,V.$W,X,2);case"ddd":return te(I.weekdaysShort,V.$W,X,3);case"dddd":return X[V.$W];case"H":return String(N);case"HH":return $.s(N,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return le(N,D,!0);case"A":return le(N,D,!1);case"m":return String(D);case"mm":return $.s(D,2,"0");case"s":return String(V.$s);case"ss":return $.s(V.$s,2,"0");case"SSS":return $.s(V.$ms,3,"0");case"Z":return Z}return null}(pe)||Z.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(C,V,I){var J,Z=this,N=$.p(V),D=B(C),j=(D.utcOffset()-this.utcOffset())*r,X=this-D,U=function(){return $.m(Z,D)};switch(N){case p:J=U()/12;break;case f:J=U();break;case h:J=U()/3;break;case u:J=(X-j)/6048e5;break;case d:J=(X-j)/864e5;break;case c:J=X/i;break;case l:J=X/r;break;case s:J=X/n;break;default:J=X}return I?J:$.a(J)},S.daysInMonth=function(){return this.endOf(f).$D},S.$locale=function(){return w[this.$L]},S.locale=function(C,V){if(!C)return this.$L;var I=this.clone(),J=_(C,V,!0);return J&&(I.$L=J),I},S.clone=function(){return $.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},L}(),ee=q.prototype;return B.prototype=ee,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(L){ee[L[1]]=function(S){return this.$g(S,L[0],L[1])}}),B.extend=function(L,S){return L.$i||(L(S,q,B),L.$i=!0),B},B.locale=_,B.isDayjs=P,B.unix=function(L){return B(1e3*L)},B.en=w[M],B.Ls=w,B.p={},B})})(Yh);var vN=Yh.exports;const H=qr(vN);var Jh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n="week",r="year";return function(i,o,s){var l=o.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(r).add(1,r).date(d),f=s(this).endOf(n);if(u.isBefore(f))return 1}var h=s(this).startOf(r).date(d).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Jh);var CN=Jh.exports;const SN=qr(CN);var Gh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,l,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,l):!this.isBefore(d,l))&&(h?this.isBefore(u,l):!this.isAfter(u,l))||(f?this.isBefore(d,l):!this.isAfter(d,l))&&(h?this.isAfter(u,l):!this.isBefore(u,l))}}})})(Gh);var EN=Gh.exports;const ON=qr(EN),MN={class:"w-full dark:text-gray-400"},TN={class:"flex justify-between items-center mb-3"},$N={class:"flex"},NN={class:"font-medium flex items-center gap-2"},BN=["value","onChange"],AN=["value"],VN=["value","onChange"],DN=["value"],_N={class:"flex"},LN={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},IN={class:"flex justify-center text-sm"},ta=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:H().year()}},emits:["update:modelValue"],setup(t,{emit:e}){H.extend(ON),H.extend(SN);const n=t,r=a.ref([H(new Date).subtract(1,"month"),H(new Date)]);a.watch(()=>n.initDates,()=>{var N;if(!n.range&&n.initDates)r.value[0]=H(n.initDates);else if(!n.range&&!n.initDates)r.value[0]=H(new Date);else if(n.range&&((N=n.initDates)==null?void 0:N.length)===2){let D=H(n.initDates[0]),j=H(n.initDates[1]);j.isBefore(D,"month")&&(j=D.add(1,"month")),D.isSame(j,"month")&&(j=D.add(1,"month")),r.value=[D,j]}},{immediate:!0,once:!0}),a.watch(()=>[n.displayYearStart,n.displayMonthStart],([N,D])=>{N&&D&&(r.value[0]=H().year(Number(N)).month(Number(D)).startOf("month"),r.value[1]=H().year(Number(N)).month(Number(D)).startOf("month").add(1,"month"))},{immediate:!0}),a.watch(()=>[n.displayYearEnd,n.displayMonthEnd],([N,D])=>{if(N&&D){const j=r.value[0],X=H().year(Number(N)).month(Number(D)).startOf("month");X.isAfter(j,"month")&&(r.value[1]=X)}},{immediate:!0});const i=e,o=a.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(N){if(n.week)i("update:modelValue",[H(N).startOf("week"),H(N).endOf("week")]);else if(n.range){const D=n.modelValue.filter(j=>j).length;if(D==0)i("update:modelValue",[N]);else if(D==2)i("update:modelValue",[N]);else if(D==1){let j=[H(n.modelValue[0]),H(N)];j=j.sort((X,U)=>X-U),i("update:modelValue",j)}}else i("update:modelValue",H(N))}function l(N){const D=H(N).daysInMonth(),j=[],X=H(N).startOf("month");for(let U=1;U<=D;U++){let R=X.clone().date(U);j.push(R)}return j}function c(N){return H(N).startOf("month").day()}function d(N,D){const j=H(`${N}-${D}-01`,"YYYY-MM-DD"),U=j.day(),R=[];for(let te=0;te<U;te++)R.push(j.clone().subtract(U-te,"days"));return R}function u(N,D){const j=H(`${N}-${D}`,"YYYY-MM").endOf("month"),U=6-j.day(),R=[];for(let te=1;te<=U;te++)R.push(j.clone().add(te,"days"));return R}function f(N){const D=H();return H(N).isSame(D,"day")}function h(N){var D,j;if(n.range){if(((D=n.modelValue)==null?void 0:D.length)==1)return H(N).isSame(H(n.modelValue[0]),"day");if(((j=n.modelValue)==null?void 0:j.length)==2)return H(N).isSame(H(n.modelValue[0]),"day")||H(N).isSame(H(n.modelValue[1]),"day")}else if(n.modelValue)return H(N).isSame(H(n.modelValue),"day")}function p(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isBetween(H(n.modelValue[0]),H(n.modelValue[1]))}function m(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isSame(H(n.modelValue[0]),"day")}function y(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isSame(H(n.modelValue[1]),"day")}function g(N){try{return n.minDate?H(N).isBefore(H(n.minDate)):!1}catch(D){return console.log(D),!1}}function b(N){try{return n.maxDate?H(N).isAfter(H(n.maxDate)):!1}catch(D){return console.log(D),!1}}function v(N){B(N,r.value[N].subtract(1,"month"))}function T(N){B(N,r.value[N].add(1,"month"))}function k(N){B(N,r.value[N].subtract(1,"year"))}function M(N){B(N,r.value[N].add(1,"year"))}const w=N=>N===0?!0:r.value[N].subtract(1,"month").isAfter(r.value[0],"month"),A=N=>N===1?!0:r.value[N].add(1,"month").isBefore(r.value[1],"month"),P=N=>N===0?!0:r.value[N].subtract(1,"year").isAfter(r.value[0],"year"),_=N=>N===1?!0:r.value[N].add(1,"year").isBefore(r.value[1],"year");function B(N,D){if(N===0){if(!D.isBefore(r.value[1],"month"))return;r.value=[D,r.value[1]]}else{if(!D.isAfter(r.value[0],"month"))return;(D.isBefore(r.value[0],"month")||D.isSame(r.value[0],"month"))&&(D=r.value[0].add(1,"month")),r.value=[r.value[0],D]}}const $=a.ref();function q(N){n.week&&($.value=H(N).week())}function ee(N){return H(N).week()===$.value}function L(N){return H(N).week()===$.value?H(N).format("YYYY-MM-DD")===H().week($.value).startOf("week").format("YYYY-MM-DD"):!1}function S(N){return H(N).week()===$.value?H(N).format("YYYY-MM-DD")===H().week($.value).endOf("week").format("YYYY-MM-DD"):!1}function C(){$.value=null}function V(N,D){const j=r.value[N].year(Number(D));B(N,j)}function I(N,D){const j=r.value[N].month(Number(D));B(N,j)}const J=a.computed(()=>{const N=n.defaultMinYear,D=n.defaultMaxYear,j=[];for(let X=N;X<=D;X++)j.push(X);return j}),Z=["January","February","March","April","May","June","July","August","September","October","November","December"];return(N,D)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,j=>{var X;return a.openBlock(),a.createElementBlock("div",MN,[a.createElementVNode("div",TN,[a.createElementVNode("div",$N,[a.createVNode(ed,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!P(j),"hover:opacity-100":P(j)}]),onClick:U=>P(j)?k(j):null},null,8,["class","onClick"]),a.createVNode(td,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!w(j),"hover:opacity-100":w(j)}]),onClick:U=>w(j)?v(j):null},null,8,["class","onClick"])]),a.createElementVNode("div",NN,[a.createElementVNode("select",{value:r.value[j].format("YYYY"),onChange:U=>V(j,U.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(J.value,U=>(a.openBlock(),a.createElementBlock("option",{key:U,value:U},a.toDisplayString(U),9,AN))),128))],40,BN),a.createElementVNode("select",{value:r.value[j].month(),onChange:U=>I(j,U.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(Z,(U,R)=>a.createElementVNode("option",{key:R,value:R},a.toDisplayString(U),9,DN)),64))],40,VN)]),a.createElementVNode("div",_N,[a.createVNode(rd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!A(j),"hover:opacity-100":A(j)}]),onClick:U=>A(j)?T(j):null},null,8,["class","onClick"]),a.createVNode(nd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!_(j),"hover:opacity-100":_(j)}]),onClick:U=>_(j)?M(j):null},null,8,["class","onClick"])])]),a.createElementVNode("div",LN,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(7,U=>{var R;return a.createElementVNode("div",IN,a.toDisplayString((R=r.value[j])==null?void 0:R.clone().startOf("week").subtract(1,"days").add(U,"days").format("ddd")),1)}),64))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:C},[c(r.value[j])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(d(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1),U=>(a.openBlock(),a.createBlock(ea,{onClick:R=>!b(U)&&!g(U)?s(U):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l(r.value[j].clone()),U=>(a.openBlock(),a.createBlock(ea,{onMouseover:R=>q(U),onClick:R=>!b(U)&&!g(U)?s(U):null,today:f(U),selected:h(U),firstDay:m(U)||L(U),lastDay:y(U)||S(U),between:p(U),disabled:b(U)||g(U),off:b(U)||g(U),highlight:ee(U)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((X=u(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1))==null?void 0:X.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(u(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1),U=>(a.openBlock(),a.createBlock(ea,{onClick:R=>!b(U)&&!g(U)?s(U):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),PN={},RN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},zN=[a.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 jN(t,e){return a.openBlock(),a.createElementBlock("svg",RN,zN)}const Zh=ae(PN,[["render",jN]]),FN={},HN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},WN=[a.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 UN(t,e){return a.openBlock(),a.createElementBlock("svg",HN,WN)}const Xh=ae(FN,[["render",UN]]),qN={class:"flex gap-3"},KN={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},YN=["onClick"],JN=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(l){r("update:modelValue",l)}const o=a.computed(()=>{var l;if(n.range)return(l=n.modelValue)==null?void 0:l.map(c=>H(c).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return H(n.modelValue).format("YYYY-MM-DD")}),s=a.reactive([{text:"Month to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("month");r("update:modelValue",[d,c])}},{text:"Last Month",onClick(l){const c=H().startOf("month").subtract(1,"month"),d=H(c).endOf("month");r("update:modelValue",[c,d])}},{text:"Year to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("year");r("update:modelValue",[d,c])}}]);return(l,c)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",qN,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",KN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s,d=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},a.toDisplayString(d.text),9,YN))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>{var d;return[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=o.value)!=null&&d.length)),onOnClear:c[0]||(c[0]=u=>i(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),GN={class:"relative inline-block tabular-nums"},ZN=["value","placeholder","maxlength"],na={__name:"DateSegment",props:{modelValue:String,placeholder:String,segment:{type:String,default:"monthOrDay"},disabled:Boolean},emits:["update:modelValue","blur"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(null),o=a.computed(()=>n.segment==="year"?4:2);function s(c){const d=c.target.value.replace(/\D/g,"");r("update:modelValue",d.slice(0,o.value)),d.length>=o.value&&n.nextRef&&a.nextTick(()=>{n.nextRef.focus()})}function l(){r("blur")}return(c,d)=>(a.openBlock(),a.createElementBlock("div",GN,[a.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",value:t.modelValue,onInput:s,onKeydown:d[0]||(d[0]=(...u)=>c.onKeydown&&c.onKeydown(...u)),onBlur:l,placeholder:t.placeholder,class:a.normalizeClass(["date-segment bg-transparent text-gray-900 dark:text-gray-400 focus:outline-none border-b border-transparent focus:border-gray-800 dark:focus:border-gray-300 transition-all duration-200 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-800 focus:bg-white dark:focus:bg-gray-900 placeholder:opacity-25 placeholder:tracking-wider placeholder:pl-1",{"w-[4ch]":o.value===4,"w-[2ch]":o.value===2}]),inputmode:"numeric",pattern:"\\d*",maxlength:o.value},null,42,ZN)]))}},XN={class:"flex items-center gap-0"},QN=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),eB=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),ra={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue","update:initDates","update:displayYear","update:displayMonth"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(""),o=a.ref(""),s=a.ref(""),l=a.ref(null),c=a.ref(null),d=a.ref(null);a.watch(()=>n.modelValue,b=>{n.range?Array.isArray(b)&&b.length===2?(yearStart.value=b[0]?H(b[0]).format("YYYY"):"",monthStart.value=b[0]?H(b[0]).format("MM"):"",dayStart.value=b[0]?H(b[0]).format("DD"):"",yearEnd.value=b[1]?H(b[1]).format("YYYY"):"",monthEnd.value=b[1]?H(b[1]).format("MM"):"",dayEnd.value=b[1]?H(b[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):b?(i.value=H(b).format("YYYY"),o.value=H(b).format("MM"),s.value=H(b).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(b){b.length===4&&r("update:displayYear",Number(b)),u()}function h(b){b.length===2&&r("update:displayMonth",Number(b)-1),u()}function p(b){s.value=b,u()}function m(){i.value||(i.value=H().format("YYYY")),u()}function y(){o.value||(o.value=H().format("MM")),u()}function g(){s.value||(s.value=H().format("DD")),u()}return(b,v)=>(a.openBlock(),a.createElementBlock("div",XN,[a.createVNode(na,{modelValue:i.value,"onUpdate:modelValue":[v[0]||(v[0]=T=>i.value=T),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),QN,a.createVNode(na,{modelValue:o.value,"onUpdate:modelValue":[v[1]||(v[1]=T=>o.value=T),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),eB,a.createVNode(na,{modelValue:s.value,"onUpdate:modelValue":[v[2]||(v[2]=T=>s.value=T),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},tB={class:"tabular-nums"},nB={key:1,class:"flex items-center"},rB=a.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),iB={class:"flex gap-3"},oB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},sB=["onClick"],lB=Object.assign({name:"WpicAdvDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;a.ref(!1);const i=a.ref(H().year()),o=a.ref(H().month()),s=a.ref(null),l=a.ref(null);function c(){r("update:modelValue",null)}a.watch(()=>n.initDates,h=>{var p;n.range&&((p=n.initDates)==null?void 0:p.length)==2?(i.value=H(n.initDates[0]).year(),o.value=H(n.initDates[0]).month(),s.value=H(n.initDates[1]).year(),l.value=H(n.initDates[1]).month()):n.initDates&&(i.value=H(n.initDates).year(),o.value=H(n.initDates).month())},{immediate:!0});const d=a.ref(n.range?[]:"");a.watch(()=>n.modelValue,h=>{if(n.range){const p=h!=null&&h[0]?H(h[0]).format("YYYY-MM-DD"):"",m=h!=null&&h[1]?H(h[1]).format("YYYY-MM-DD"):"";(d.value[0]!==p||d.value[1]!==m)&&(d.value=[p,m])}else{const p=h?H(h).format("YYYY-MM-DD"):"";d.value!==p&&(d.value=p)}},{immediate:!0}),a.watch(()=>d.value,h=>{var p,m;if(n.range){const y=h[0]&&h[0].length===10?H(h[0]).toDate():null,g=h[1]&&h[1].length===10?H(h[1]).toDate():null;(!((p=n.modelValue)!=null&&p[0])||n.modelValue[0]!==y||!((m=n.modelValue)!=null&&m[1])||n.modelValue[1]!==g)&&r("update:modelValue",[y,g])}else if(h&&h.length===10){const y=H(h,"YYYY-MM-DD",!0);y.isValid()&&n.modelValue!==y.toDate()&&r("update:modelValue",y.toDate())}},{deep:!0});function u(h){r("update:modelValue",h)}const f=a.reactive([{text:"Month to Date",onClick(h){const p=H().subtract(1,"day"),m=H().startOf("month");r("update:modelValue",[m,p])}},{text:"Last Month",onClick(h){const p=H().startOf("month").subtract(1,"month"),m=H(p).endOf("month");r("update:modelValue",[p,m])}},{text:"Year to Date",onClick(h){const p=H().subtract(1,"day"),m=H().startOf("year");r("update:modelValue",[m,p])}}]);return(h,p)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:a.withCtx(()=>[a.createElementVNode("div",iB,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",oB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f,m=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:y=>m.onClick()},a.toDisplayString(m.text),9,sB))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,displayYearStart:i.value,displayMonthStart:o.value,displayYearEnd:s.value,displayMonthEnd:l.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:n.range?[...d.value]:d.value,"onUpdate:modelValue":u,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:t.clearable&&!!t.modelValue,onOnClear:c},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createElementVNode("div",tB,[t.range?t.range?(a.openBlock(),a.createElementBlock("div",nB,[a.createVNode(ra,{modelValue:d.value[0],"onUpdate:modelValue":p[3]||(p[3]=m=>d.value[0]=m),disabled:t.disabled,"onUpdate:displayYear":p[4]||(p[4]=m=>i.value=m),"onUpdate:displayMonth":p[5]||(p[5]=m=>o.value=m)},null,8,["modelValue","disabled"]),rB,a.createVNode(ra,{modelValue:d.value[1],"onUpdate:modelValue":p[6]||(p[6]=m=>d.value[1]=m),disabled:t.disabled,"onUpdate:displayYear":p[7]||(p[7]=m=>{s.value=m}),"onUpdate:displayMonth":p[8]||(p[8]=m=>{l.value=m})},null,8,["modelValue","disabled"])])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(t.placeholder),1)],64)):(a.openBlock(),a.createBlock(ra,{key:0,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),disabled:t.disabled,"onUpdate:displayYear":p[1]||(p[1]=m=>i.value=m),"onUpdate:displayMonth":p[2]||(p[2]=m=>o.value=m)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),aB=Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},backgroundColor:{type:String,default:"bg-white"},options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-15"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-gray-940"},i=n;function o(){i("close")}e({goBottom:c,goTop:l});const s=a.ref(null);function l(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-xs 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:a.withModifiers(o,["self"])},[a.createElementVNode("div",{class:a.normalizeClass(["h-full transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.backgroundColor]:!0,[t.options.width]:!0,[r[a.unref(ne).theme]]:!0}])},[a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[a.renderSlot(d.$slots,"default")],2)],2)],2))}}),cB={class:"absolute inset-0 flex items-center justify-center py-12"},dB={class:"text-lg font-medium dark:text-gray-300"},uB={key:0,class:"flex justify-end px-6 pb-4"},fB=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=a.ref(null),l=a.ref(!1);function c(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(l.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return a.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),a.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:l}),(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[a.createElementVNode("div",cB,[a.createElementVNode("div",{class:"absolute inset-0 bg-black/10 dark:bg-black/75 z-10",onClick:o}),a.createElementVNode("div",{class:a.normalizeClass(["relative flex flex-col justify-between bg-white dark:border dark:border-gray-900 dark:bg-gray-940 rounded-lg z-20 max-h-full",{"w-3/5":t.large,"w-4/5":t.extraLarge,"w-192":!t.large&&!t.extraLarge,"h-full":t.high,"overflow-hidden":!t.overflow}])},[a.createElementVNode("div",{class:a.normalizeClass(["px-6 pt-4 pb-4 flex items-center justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[a.createElementVNode("span",dB,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode(Wr,{class:"w-6 h-6"})])],2),a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[a.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(a.openBlock(),a.createElementBlock("div",uB,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),hB=["onClick"],pB=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},pills:Boolean,contrastPills:Boolean,nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},l=a.computed(()=>n.modelValue);return a.provide("addTab",s),a.provide("modelValue",l),(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",{class:a.normalizeClass(["wpic-tabs flex dark:border-gray-930 overflow-x-auto overflow-y-hidden",{"border-b-[1px]":!t.pills}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,u=>(a.openBlock(),a.createElementBlock("div",{key:u.name,class:a.normalizeClass(["items-center flex leading-snug cursor-pointer px-6 -mb-[px]",{"py-2":t.pills,"border-b-[2px] py-3":!t.pills,"border-transparent":!t.pills&&u.name!=t.modelValue,"dark:border-gray-930 hover:text-gray-800 dark:hover:text-gray-400 hover:border-gray-200":u.name!=t.modelValue,"text-wpic-500 border-b-wpic-500 dark:text-wpic-600 dark:border-b-wpic-600":!t.pills&&u.name===t.modelValue,"rounded-lg":t.pills,"bg-black/5 dark:bg-white/10 text-gray-800 dark:!text-gray-300":t.pills&&u.name===t.modelValue,"bg-gray-900 dark:bg-gray-300! text-white! dark:text-gray-800!":t.pills&&t.contrastPills&&u.name===t.modelValue,"text-gray-500 dark:text-gray-500":!u.disabled,"text-gray-300 dark:text-gray-700":u.disabled}]),onClick:f=>u.disabled?null:o(u.name)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.labelSlot||"span"),{class:a.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},{default:a.withCtx(()=>[u.labelSlot?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(u.label),1)],64))]),_:2},1032,["class"]))],10,hB))),128))],2),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),mB=Object.assign({name:"WpicTabPane"},{props:{label:{type:String,required:!0},name:{type:String,required:!0},noStyle:Boolean,disabled:Boolean},setup(t){const e=t,n=a.ref(!1),r=a.inject("addTab"),i=a.inject("modelValue"),o=a.useSlots();return a.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled,labelSlot:o.label})}),a.watch(()=>i.value,s=>{n.value=s===e.name},{immediate:!0,deep:!0}),(s,l)=>n.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[a.renderSlot(s.$slots,"default")],2)):a.createCommentVNode("",!0)}}),gB={},yB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},bB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},null,-1)];function kB(t,e){return a.openBlock(),a.createElementBlock("svg",yB,bB)}const xB=ae(gB,[["render",kB]]),wB={},vB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},CB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)];function SB(t,e){return a.openBlock(),a.createElementBlock("svg",vB,CB)}const EB=ae(wB,[["render",SB]]),OB={},MB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},TB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function $B(t,e){return a.openBlock(),a.createElementBlock("svg",MB,TB)}const NB=ae(OB,[["render",$B]]),BB={},AB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},VB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function DB(t,e){return a.openBlock(),a.createElementBlock("svg",AB,VB)}const _B=ae(BB,[["render",DB]]),LB={key:0,class:"w-6 opacity-50"},IB={class:"flex-1"},PB={key:0,class:"mb-2"},RB=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["py-3 rounded-md text-base flex gap-3 pr-6 mb-3",{"bg-iron-500/10 text-iron-900 dark:bg-iron-500/20 dark:text-iron-200/90":!t.warning&&!t.info&&!t.error&&!t.success,"bg-yellow-500/10 text-yellow-900 dark:bg-yellow-500/20 dark:text-yellow-200/90":t.warning,"bg-purple-500/10 text-purple-900 dark:bg-purple-500/20 dark:text-purple-200/90":t.info,"bg-red-500/10 text-red-900 dark:bg-red-500/20 dark:text-red-200/90":t.error,"bg-emerald-500/10 text-emerald-900 dark:bg-emerald-500/20 dark:text-emerald-200/90":t.success,"pl-4":t.warning||t.info||t.success||t.error,"pl-6":!t.warning&&!t.info&&!t.success&&!t.error}])},[t.warning||t.info||t.success||t.error?(a.openBlock(),a.createElementBlock("div",LB,[t.warning?(a.openBlock(),a.createBlock(xB,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock(EB,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(NB,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(_B,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",IB,[t.title?(a.openBlock(),a.createElementBlock("div",PB,a.toDisplayString(t.title),1)):a.createCommentVNode("",!0),a.createElementVNode("span",{class:a.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[a.renderSlot(e.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.text),1)])],2)])],2))}}),ia=a.ref(!1),Qh=a.ref(""),ep=a.ref(""),tp=a.ref(!1),np=a.ref(!1);let rp=()=>{},ip=()=>{};function oa(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d})=>{Qh.value=i,ep.value=o,tp.value=s,np.value=l,rp=c||(()=>{}),ip=d||(()=>{}),ia.value=!0},e=()=>{ia.value=!1};return{visible:ia,title:Qh,text:ep,positive:tp,negative:np,show:t,onConfirm:()=>{rp(),e()},onCancel:()=>{ip(),e()}}}const zB={key:0,class:"confirm-modal-overlay z-40"},jB={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},FB={class:"text-lg font-semibold mb-6"},HB={class:"mb-12"},WB={class:"flex justify-end"},sa={WpicColorPicker:Zc,WpicAlert:RB,WpicToggleSwitch:Jc,WpicAdvDateField:lB,WpicCalendar:ta,WpicTextarea:Gc,WpicDialog:fB,WpicSlidePanel:aB,WpicDateField:JN,WpicFormInput:Ur,WpicButton:Pr,WpicBadge:wN,WpicTextEditor:iN,WpicInputGroup:_m,WpicButtonGroup:Bm,WpicForm:Lm,WpicFormField:Xc,WpicSpinner:Jn,WpicTooltip:Qc,WpicPopover:En,WpicChoiceList:Yc,WpicCard:_w,WpicCardSection:Pw,WpicProgressBar:jw,WpicTag:Hw,WpicTagGroup:Ww,WpicPagination:gv,WpicLoadingPanel:Yw,WpicTable:Yv,WpicTableColumn:Jv,WpicTabs:pB,WpicTabPane:mB,WpicConfirm:ae(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l}=oa();return(c,d)=>a.unref(e)?(a.openBlock(),a.createElementBlock("div",zB,[a.createElementVNode("div",jB,[a.createElementVNode("div",FB,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",HB,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",WB,[a.createVNode(Pr,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode("Cancel")]),_:1},8,["onClick"]),a.createVNode(Pr,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-613542ab"]])};function op(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?op(t[n],e[n]):t[n]=e[n])}const UB={useConfirm:oa};function qB(t,e){op(ne,e);for(const n in sa)if(sa.hasOwnProperty(n)){const r=sa[n];t.component(r.name,r)}}const KB={install:qB,composables:UB,options:ne};Yt.default=KB,Yt.useConfirm=oa,Object.defineProperties(Yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
133
|
+
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(l,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected&&!t.off,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[a.createElementVNode("div",{class:a.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[a.unref(ne).theme]}`]:t.between,[`${i[a.unref(ne).theme]}`]:t.firstDay,[`${o[a.unref(ne).theme]}`]:t.lastDay,[`${s[a.unref(ne).theme]}`]:t.highlight}]),style:a.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[a.createElementVNode("span",{class:a.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[a.unref(ne).theme]}`]:!0,[`${n[a.unref(ne).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[a.renderSlot(l.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.day),1)])],2)],6)],2))}};var Yh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",l="minute",c="hour",d="day",u="week",f="month",h="quarter",p="year",m="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var S=["th","st","nd","rd"],C=L%100;return"["+L+(S[(C-20)%10]||S[C]||S[0])+"]"}},T=function(L,S,C){var V=String(L);return!V||V.length>=S?L:""+Array(S+1-V.length).join(C)+L},k={s:T,z:function(L){var S=-L.utcOffset(),C=Math.abs(S),V=Math.floor(C/60),I=C%60;return(S<=0?"+":"-")+T(V,2,"0")+":"+T(I,2,"0")},m:function L(S,C){if(S.date()<C.date())return-L(C,S);var V=12*(C.year()-S.year())+(C.month()-S.month()),I=S.clone().add(V,f),J=C-I<0,Z=S.clone().add(V+(J?-1:1),f);return+(-(V+(C-I)/(J?I-Z:Z-I))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},M="en",v={};v[M]=w;var A="$isDayjsObject",P=function(L){return L instanceof q||!(!L||!L[A])},_=function L(S,C,V){var I;if(!S)return M;if(typeof S=="string"){var J=S.toLowerCase();v[J]&&(I=J),C&&(v[J]=C,I=J);var Z=S.split("-");if(!I&&Z.length>1)return L(Z[0])}else{var N=S.name;v[N]=S,I=N}return!V&&I&&(M=I),I||!V&&M},B=function(L,S){if(P(L))return L.clone();var C=typeof S=="object"?S:{};return C.date=L,C.args=arguments,new q(C)},$=k;$.l=_,$.i=P,$.w=function(L,S){return B(L,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var q=function(){function L(C){this.$L=_(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[A]=!0}var S=L.prototype;return S.parse=function(C){this.$d=function(V){var I=V.date,J=V.utc;if(I===null)return new Date(NaN);if($.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var Z=I.match(y);if(Z){var N=Z[2]-1||0,D=(Z[7]||"0").substring(0,3);return J?new Date(Date.UTC(Z[1],N,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,D)):new Date(Z[1],N,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,D)}}return new Date(I)}(C),this.init()},S.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},S.$utils=function(){return $},S.isValid=function(){return this.$d.toString()!==g},S.isSame=function(C,V){var I=B(C);return this.startOf(V)<=I&&I<=this.endOf(V)},S.isAfter=function(C,V){return B(C)<this.startOf(V)},S.isBefore=function(C,V){return this.endOf(V)<B(C)},S.$g=function(C,V,I){return $.u(C)?this[V]:this.set(I,C)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(C,V){var I=this,J=!!$.u(V)||V,Z=$.p(C),N=function(le,pe){var be=$.w(I.$u?Date.UTC(I.$y,pe,le):new Date(I.$y,pe,le),I);return J?be:be.endOf(d)},D=function(le,pe){return $.w(I.toDate()[le].apply(I.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(pe)),I)},j=this.$W,X=this.$M,U=this.$D,R="set"+(this.$u?"UTC":"");switch(Z){case p:return J?N(1,0):N(31,11);case f:return J?N(1,X):N(0,X+1);case u:var te=this.$locale().weekStart||0,he=(j<te?j+7:j)-te;return N(J?U-he:U+(6-he),X);case d:case m:return D(R+"Hours",0);case c:return D(R+"Minutes",1);case l:return D(R+"Seconds",2);case s:return D(R+"Milliseconds",3);default:return this.clone()}},S.endOf=function(C){return this.startOf(C,!1)},S.$set=function(C,V){var I,J=$.p(C),Z="set"+(this.$u?"UTC":""),N=(I={},I[d]=Z+"Date",I[m]=Z+"Date",I[f]=Z+"Month",I[p]=Z+"FullYear",I[c]=Z+"Hours",I[l]=Z+"Minutes",I[s]=Z+"Seconds",I[o]=Z+"Milliseconds",I)[J],D=J===d?this.$D+(V-this.$W):V;if(J===f||J===p){var j=this.clone().set(m,1);j.$d[N](D),j.init(),this.$d=j.set(m,Math.min(this.$D,j.daysInMonth())).$d}else N&&this.$d[N](D);return this.init(),this},S.set=function(C,V){return this.clone().$set(C,V)},S.get=function(C){return this[$.p(C)]()},S.add=function(C,V){var I,J=this;C=Number(C);var Z=$.p(V),N=function(X){var U=B(J);return $.w(U.date(U.date()+Math.round(X*C)),J)};if(Z===f)return this.set(f,this.$M+C);if(Z===p)return this.set(p,this.$y+C);if(Z===d)return N(1);if(Z===u)return N(7);var D=(I={},I[l]=r,I[c]=i,I[s]=n,I)[Z]||1,j=this.$d.getTime()+C*D;return $.w(j,this)},S.subtract=function(C,V){return this.add(-1*C,V)},S.format=function(C){var V=this,I=this.$locale();if(!this.isValid())return I.invalidDate||g;var J=C||"YYYY-MM-DDTHH:mm:ssZ",Z=$.z(this),N=this.$H,D=this.$m,j=this.$M,X=I.weekdays,U=I.months,R=I.meridiem,te=function(pe,be,Me,pt){return pe&&(pe[be]||pe(V,J))||Me[be].slice(0,pt)},he=function(pe){return $.s(N%12||12,pe,"0")},le=R||function(pe,be,Me){var pt=pe<12?"AM":"PM";return Me?pt.toLowerCase():pt};return J.replace(b,function(pe,be){return be||function(Me){switch(Me){case"YY":return String(V.$y).slice(-2);case"YYYY":return $.s(V.$y,4,"0");case"M":return j+1;case"MM":return $.s(j+1,2,"0");case"MMM":return te(I.monthsShort,j,U,3);case"MMMM":return te(U,j);case"D":return V.$D;case"DD":return $.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return te(I.weekdaysMin,V.$W,X,2);case"ddd":return te(I.weekdaysShort,V.$W,X,3);case"dddd":return X[V.$W];case"H":return String(N);case"HH":return $.s(N,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return le(N,D,!0);case"A":return le(N,D,!1);case"m":return String(D);case"mm":return $.s(D,2,"0");case"s":return String(V.$s);case"ss":return $.s(V.$s,2,"0");case"SSS":return $.s(V.$ms,3,"0");case"Z":return Z}return null}(pe)||Z.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(C,V,I){var J,Z=this,N=$.p(V),D=B(C),j=(D.utcOffset()-this.utcOffset())*r,X=this-D,U=function(){return $.m(Z,D)};switch(N){case p:J=U()/12;break;case f:J=U();break;case h:J=U()/3;break;case u:J=(X-j)/6048e5;break;case d:J=(X-j)/864e5;break;case c:J=X/i;break;case l:J=X/r;break;case s:J=X/n;break;default:J=X}return I?J:$.a(J)},S.daysInMonth=function(){return this.endOf(f).$D},S.$locale=function(){return v[this.$L]},S.locale=function(C,V){if(!C)return this.$L;var I=this.clone(),J=_(C,V,!0);return J&&(I.$L=J),I},S.clone=function(){return $.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},L}(),ee=q.prototype;return B.prototype=ee,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(L){ee[L[1]]=function(S){return this.$g(S,L[0],L[1])}}),B.extend=function(L,S){return L.$i||(L(S,q,B),L.$i=!0),B},B.locale=_,B.isDayjs=P,B.unix=function(L){return B(1e3*L)},B.en=v[M],B.Ls=v,B.p={},B})})(Yh);var ON=Yh.exports;const H=qr(ON);var Jh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n="week",r="year";return function(i,o,s){var l=o.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(r).add(1,r).date(d),f=s(this).endOf(n);if(u.isBefore(f))return 1}var h=s(this).startOf(r).date(d).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Jh);var MN=Jh.exports;const TN=qr(MN);var Gh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,l,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,l):!this.isBefore(d,l))&&(h?this.isBefore(u,l):!this.isAfter(u,l))||(f?this.isBefore(d,l):!this.isAfter(d,l))&&(h?this.isAfter(u,l):!this.isBefore(u,l))}}})})(Gh);var $N=Gh.exports;const NN=qr($N),BN={class:"w-full dark:text-gray-400"},AN={class:"flex justify-between items-center mb-3"},VN={class:"flex"},DN={class:"font-medium flex items-center gap-2"},_N=["value","onChange"],LN=["value"],IN=["value","onChange"],PN=["value"],RN={class:"flex"},zN={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},jN={class:"flex justify-center text-sm"},ta=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:H().year()}},emits:["update:modelValue"],setup(t,{emit:e}){H.extend(NN),H.extend(TN);const n=t,r=a.ref([H(new Date).subtract(1,"month"),H(new Date)]);a.watch(()=>n.initDates,()=>{var N;if(!n.range&&n.initDates)r.value[0]=H(n.initDates);else if(!n.range&&!n.initDates)r.value[0]=H(new Date);else if(n.range&&((N=n.initDates)==null?void 0:N.length)===2){let D=H(n.initDates[0]),j=H(n.initDates[1]);j.isBefore(D,"month")&&(j=D.add(1,"month")),D.isSame(j,"month")&&(j=D.add(1,"month")),r.value=[D,j]}},{immediate:!0,once:!0}),a.watch(()=>[n.displayYearStart,n.displayMonthStart],([N,D])=>{N&&D&&(r.value[0]=H().year(Number(N)).month(Number(D)).startOf("month"),r.value[1]=H().year(Number(N)).month(Number(D)).startOf("month").add(1,"month"))},{immediate:!0}),a.watch(()=>[n.displayYearEnd,n.displayMonthEnd],([N,D])=>{if(N&&D){const j=r.value[0],X=H().year(Number(N)).month(Number(D)).startOf("month");X.isAfter(j,"month")&&(r.value[1]=X)}},{immediate:!0});const i=e,o=a.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(N){if(n.week)i("update:modelValue",[H(N).startOf("week"),H(N).endOf("week")]);else if(n.range){const D=n.modelValue.filter(j=>j).length;if(D==0)i("update:modelValue",[N]);else if(D==2)i("update:modelValue",[N]);else if(D==1){let j=[H(n.modelValue[0]),H(N)];j=j.sort((X,U)=>X-U),i("update:modelValue",j)}}else i("update:modelValue",H(N))}function l(N){const D=H(N).daysInMonth(),j=[],X=H(N).startOf("month");for(let U=1;U<=D;U++){let R=X.clone().date(U);j.push(R)}return j}function c(N){return H(N).startOf("month").day()}function d(N,D){const j=H(`${N}-${D}-01`,"YYYY-MM-DD"),U=j.day(),R=[];for(let te=0;te<U;te++)R.push(j.clone().subtract(U-te,"days"));return R}function u(N,D){const j=H(`${N}-${D}`,"YYYY-MM").endOf("month"),U=6-j.day(),R=[];for(let te=1;te<=U;te++)R.push(j.clone().add(te,"days"));return R}function f(N){const D=H();return H(N).isSame(D,"day")}function h(N){var D,j;if(n.range){if(((D=n.modelValue)==null?void 0:D.length)==1)return H(N).isSame(H(n.modelValue[0]),"day");if(((j=n.modelValue)==null?void 0:j.length)==2)return H(N).isSame(H(n.modelValue[0]),"day")||H(N).isSame(H(n.modelValue[1]),"day")}else if(n.modelValue)return H(N).isSame(H(n.modelValue),"day")}function p(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isBetween(H(n.modelValue[0]),H(n.modelValue[1]))}function m(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isSame(H(n.modelValue[0]),"day")}function g(N){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(N).isSame(H(n.modelValue[1]),"day")}function y(N){try{return n.minDate?H(N).isBefore(H(n.minDate)):!1}catch(D){return console.log(D),!1}}function b(N){try{return n.maxDate?H(N).isAfter(H(n.maxDate)):!1}catch(D){return console.log(D),!1}}function w(N){B(N,r.value[N].subtract(1,"month"))}function T(N){B(N,r.value[N].add(1,"month"))}function k(N){B(N,r.value[N].subtract(1,"year"))}function M(N){B(N,r.value[N].add(1,"year"))}const v=N=>N===0?!0:r.value[N].subtract(1,"month").isAfter(r.value[0],"month"),A=N=>N===1?!0:r.value[N].add(1,"month").isBefore(r.value[1],"month"),P=N=>N===0?!0:r.value[N].subtract(1,"year").isAfter(r.value[0],"year"),_=N=>N===1?!0:r.value[N].add(1,"year").isBefore(r.value[1],"year");function B(N,D){if(N===0){if(!D.isBefore(r.value[1],"month"))return;r.value=[D,r.value[1]]}else{if(!D.isAfter(r.value[0],"month"))return;(D.isBefore(r.value[0],"month")||D.isSame(r.value[0],"month"))&&(D=r.value[0].add(1,"month")),r.value=[r.value[0],D]}}const $=a.ref();function q(N){n.week&&($.value=H(N).week())}function ee(N){return H(N).week()===$.value}function L(N){return H(N).week()===$.value?H(N).format("YYYY-MM-DD")===H().week($.value).startOf("week").format("YYYY-MM-DD"):!1}function S(N){return H(N).week()===$.value?H(N).format("YYYY-MM-DD")===H().week($.value).endOf("week").format("YYYY-MM-DD"):!1}function C(){$.value=null}function V(N,D){const j=r.value[N].year(Number(D));B(N,j)}function I(N,D){const j=r.value[N].month(Number(D));B(N,j)}const J=a.computed(()=>{const N=n.defaultMinYear,D=n.defaultMaxYear,j=[];for(let X=N;X<=D;X++)j.push(X);return j}),Z=["January","February","March","April","May","June","July","August","September","October","November","December"];return(N,D)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,j=>{var X;return a.openBlock(),a.createElementBlock("div",BN,[a.createElementVNode("div",AN,[a.createElementVNode("div",VN,[a.createVNode(ed,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!P(j),"hover:opacity-100":P(j)}]),onClick:U=>P(j)?k(j):null},null,8,["class","onClick"]),a.createVNode(td,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!v(j),"hover:opacity-100":v(j)}]),onClick:U=>v(j)?w(j):null},null,8,["class","onClick"])]),a.createElementVNode("div",DN,[a.createElementVNode("select",{value:r.value[j].format("YYYY"),onChange:U=>V(j,U.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(J.value,U=>(a.openBlock(),a.createElementBlock("option",{key:U,value:U},a.toDisplayString(U),9,LN))),128))],40,_N),a.createElementVNode("select",{value:r.value[j].month(),onChange:U=>I(j,U.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(Z,(U,R)=>a.createElementVNode("option",{key:R,value:R},a.toDisplayString(U),9,PN)),64))],40,IN)]),a.createElementVNode("div",RN,[a.createVNode(rd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!A(j),"hover:opacity-100":A(j)}]),onClick:U=>A(j)?T(j):null},null,8,["class","onClick"]),a.createVNode(nd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!_(j),"hover:opacity-100":_(j)}]),onClick:U=>_(j)?M(j):null},null,8,["class","onClick"])])]),a.createElementVNode("div",zN,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(7,U=>{var R;return a.createElementVNode("div",jN,a.toDisplayString((R=r.value[j])==null?void 0:R.clone().startOf("week").subtract(1,"days").add(U,"days").format("ddd")),1)}),64))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:C},[c(r.value[j])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(d(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1),U=>(a.openBlock(),a.createBlock(ea,{onClick:R=>!b(U)&&!y(U)?s(U):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l(r.value[j].clone()),U=>(a.openBlock(),a.createBlock(ea,{onMouseover:R=>q(U),onClick:R=>!b(U)&&!y(U)?s(U):null,today:f(U),selected:h(U),firstDay:m(U)||L(U),lastDay:g(U)||S(U),between:p(U),disabled:b(U)||y(U),off:b(U)||y(U),highlight:ee(U)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((X=u(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1))==null?void 0:X.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(u(a.unref(H)(r.value[j]).year(),a.unref(H)(r.value[j]).month()+1),U=>(a.openBlock(),a.createBlock(ea,{onClick:R=>!b(U)&&!y(U)?s(U):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(U).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),FN={},HN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},WN=[a.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 UN(t,e){return a.openBlock(),a.createElementBlock("svg",HN,WN)}const Zh=ae(FN,[["render",UN]]),qN={},KN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},YN=[a.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 JN(t,e){return a.openBlock(),a.createElementBlock("svg",KN,YN)}const Xh=ae(qN,[["render",JN]]),GN={class:"flex gap-3"},ZN={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},XN=["onClick"],QN=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(l){r("update:modelValue",l)}const o=a.computed(()=>{var l;if(n.range)return(l=n.modelValue)==null?void 0:l.map(c=>H(c).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return H(n.modelValue).format("YYYY-MM-DD")}),s=a.reactive([{text:"Month to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("month");r("update:modelValue",[d,c])}},{text:"Last Month",onClick(l){const c=H().startOf("month").subtract(1,"month"),d=H(c).endOf("month");r("update:modelValue",[c,d])}},{text:"Year to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("year");r("update:modelValue",[d,c])}}]);return(l,c)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",GN,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",ZN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s,d=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},a.toDisplayString(d.text),9,XN))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>{var d;return[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=o.value)!=null&&d.length)),onOnClear:c[0]||(c[0]=u=>i(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),eB={class:"relative inline-block tabular-nums"},tB=["value","placeholder","maxlength"],na={__name:"DateSegment",props:{modelValue:String,placeholder:String,segment:{type:String,default:"monthOrDay"},disabled:Boolean},emits:["update:modelValue","blur"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(null),o=a.computed(()=>n.segment==="year"?4:2);function s(c){const d=c.target.value.replace(/\D/g,"");r("update:modelValue",d.slice(0,o.value)),d.length>=o.value&&n.nextRef&&a.nextTick(()=>{n.nextRef.focus()})}function l(){r("blur")}return(c,d)=>(a.openBlock(),a.createElementBlock("div",eB,[a.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",value:t.modelValue,onInput:s,onKeydown:d[0]||(d[0]=(...u)=>c.onKeydown&&c.onKeydown(...u)),onBlur:l,placeholder:t.placeholder,class:a.normalizeClass(["date-segment bg-transparent text-gray-900 dark:text-gray-400 focus:outline-none border-b border-transparent focus:border-gray-800 dark:focus:border-gray-300 transition-all duration-200 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-800 focus:bg-white dark:focus:bg-gray-900 placeholder:opacity-25 placeholder:tracking-wider placeholder:pl-1",{"w-[4ch]":o.value===4,"w-[2ch]":o.value===2}]),inputmode:"numeric",pattern:"\\d*",maxlength:o.value},null,42,tB)]))}},nB={class:"flex items-center gap-0"},rB=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),iB=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),ra={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue","update:initDates","update:displayYear","update:displayMonth"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(""),o=a.ref(""),s=a.ref(""),l=a.ref(null),c=a.ref(null),d=a.ref(null);a.watch(()=>n.modelValue,b=>{n.range?Array.isArray(b)&&b.length===2?(yearStart.value=b[0]?H(b[0]).format("YYYY"):"",monthStart.value=b[0]?H(b[0]).format("MM"):"",dayStart.value=b[0]?H(b[0]).format("DD"):"",yearEnd.value=b[1]?H(b[1]).format("YYYY"):"",monthEnd.value=b[1]?H(b[1]).format("MM"):"",dayEnd.value=b[1]?H(b[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):b?(i.value=H(b).format("YYYY"),o.value=H(b).format("MM"),s.value=H(b).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(b){b.length===4&&r("update:displayYear",Number(b)),u()}function h(b){b.length===2&&r("update:displayMonth",Number(b)-1),u()}function p(b){s.value=b,u()}function m(){i.value||(i.value=H().format("YYYY")),u()}function g(){o.value||(o.value=H().format("MM")),u()}function y(){s.value||(s.value=H().format("DD")),u()}return(b,w)=>(a.openBlock(),a.createElementBlock("div",nB,[a.createVNode(na,{modelValue:i.value,"onUpdate:modelValue":[w[0]||(w[0]=T=>i.value=T),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),rB,a.createVNode(na,{modelValue:o.value,"onUpdate:modelValue":[w[1]||(w[1]=T=>o.value=T),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),iB,a.createVNode(na,{modelValue:s.value,"onUpdate:modelValue":[w[2]||(w[2]=T=>s.value=T),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},oB={class:"tabular-nums"},sB={key:1,class:"flex items-center"},lB=a.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),aB={class:"flex gap-3"},cB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},dB=["onClick"],uB=Object.assign({name:"WpicAdvDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;a.ref(!1);const i=a.ref(H().year()),o=a.ref(H().month()),s=a.ref(null),l=a.ref(null);function c(){r("update:modelValue",null)}a.watch(()=>n.initDates,h=>{var p;n.range&&((p=n.initDates)==null?void 0:p.length)==2?(i.value=H(n.initDates[0]).year(),o.value=H(n.initDates[0]).month(),s.value=H(n.initDates[1]).year(),l.value=H(n.initDates[1]).month()):n.initDates&&(i.value=H(n.initDates).year(),o.value=H(n.initDates).month())},{immediate:!0});const d=a.ref(n.range?[]:"");a.watch(()=>n.modelValue,h=>{if(n.range){const p=h!=null&&h[0]?H(h[0]).format("YYYY-MM-DD"):"",m=h!=null&&h[1]?H(h[1]).format("YYYY-MM-DD"):"";(d.value[0]!==p||d.value[1]!==m)&&(d.value=[p,m])}else{const p=h?H(h).format("YYYY-MM-DD"):"";d.value!==p&&(d.value=p)}},{immediate:!0}),a.watch(()=>d.value,h=>{var p,m;if(n.range){const g=h[0]&&h[0].length===10?H(h[0]).toDate():null,y=h[1]&&h[1].length===10?H(h[1]).toDate():null;(!((p=n.modelValue)!=null&&p[0])||n.modelValue[0]!==g||!((m=n.modelValue)!=null&&m[1])||n.modelValue[1]!==y)&&r("update:modelValue",[g,y])}else if(h&&h.length===10){const g=H(h,"YYYY-MM-DD",!0);g.isValid()&&n.modelValue!==g.toDate()&&r("update:modelValue",g.toDate())}},{deep:!0});function u(h){r("update:modelValue",h)}const f=a.reactive([{text:"Month to Date",onClick(h){const p=H().subtract(1,"day"),m=H().startOf("month");r("update:modelValue",[m,p])}},{text:"Last Month",onClick(h){const p=H().startOf("month").subtract(1,"month"),m=H(p).endOf("month");r("update:modelValue",[p,m])}},{text:"Year to Date",onClick(h){const p=H().subtract(1,"day"),m=H().startOf("year");r("update:modelValue",[m,p])}}]);return(h,p)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:a.withCtx(()=>[a.createElementVNode("div",aB,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",cB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f,m=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:g=>m.onClick()},a.toDisplayString(m.text),9,dB))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,displayYearStart:i.value,displayMonthStart:o.value,displayYearEnd:s.value,displayMonthEnd:l.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:n.range?[...d.value]:d.value,"onUpdate:modelValue":u,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:t.clearable&&!!t.modelValue,onOnClear:c},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createElementVNode("div",oB,[t.range?t.range?(a.openBlock(),a.createElementBlock("div",sB,[a.createVNode(ra,{modelValue:d.value[0],"onUpdate:modelValue":p[3]||(p[3]=m=>d.value[0]=m),disabled:t.disabled,"onUpdate:displayYear":p[4]||(p[4]=m=>i.value=m),"onUpdate:displayMonth":p[5]||(p[5]=m=>o.value=m)},null,8,["modelValue","disabled"]),lB,a.createVNode(ra,{modelValue:d.value[1],"onUpdate:modelValue":p[6]||(p[6]=m=>d.value[1]=m),disabled:t.disabled,"onUpdate:displayYear":p[7]||(p[7]=m=>{s.value=m}),"onUpdate:displayMonth":p[8]||(p[8]=m=>{l.value=m})},null,8,["modelValue","disabled"])])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(t.placeholder),1)],64)):(a.openBlock(),a.createBlock(ra,{key:0,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),disabled:t.disabled,"onUpdate:displayYear":p[1]||(p[1]=m=>i.value=m),"onUpdate:displayMonth":p[2]||(p[2]=m=>o.value=m)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),fB=Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},backgroundColor:{type:String,default:"bg-white"},options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-15"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-gray-940"},i=n;function o(){i("close")}e({goBottom:c,goTop:l});const s=a.ref(null);function l(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-xs 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:a.withModifiers(o,["self"])},[a.createElementVNode("div",{class:a.normalizeClass(["h-full transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.backgroundColor]:!0,[t.options.width]:!0,[r[a.unref(ne).theme]]:!0}])},[a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[a.renderSlot(d.$slots,"default")],2)],2)],2))}}),hB={class:"absolute inset-0 flex items-center justify-center py-12"},pB={class:"text-lg font-medium dark:text-gray-300"},mB={key:0,class:"flex justify-end px-6 pb-4"},gB=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=a.ref(null),l=a.ref(!1);function c(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(l.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return a.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),a.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:l}),(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[a.createElementVNode("div",hB,[a.createElementVNode("div",{class:"absolute inset-0 bg-black/10 dark:bg-black/75 z-10",onClick:o}),a.createElementVNode("div",{class:a.normalizeClass(["relative flex flex-col justify-between bg-white dark:border dark:border-gray-900 dark:bg-gray-940 rounded-lg z-20 max-h-full",{"w-3/5":t.large,"w-4/5":t.extraLarge,"w-192":!t.large&&!t.extraLarge,"h-full":t.high,"overflow-hidden":!t.overflow}])},[a.createElementVNode("div",{class:a.normalizeClass(["px-6 pt-4 pb-4 flex items-center justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[a.createElementVNode("span",pB,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode(Wr,{class:"w-6 h-6"})])],2),a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[a.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(a.openBlock(),a.createElementBlock("div",mB,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),yB=["onClick"],bB=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},pills:Boolean,contrastPills:Boolean,nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},l=a.computed(()=>n.modelValue);return a.provide("addTab",s),a.provide("modelValue",l),(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",{class:a.normalizeClass(["wpic-tabs flex dark:border-gray-930 overflow-x-auto overflow-y-hidden",{"border-b-[1px]":!t.pills}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,u=>(a.openBlock(),a.createElementBlock("div",{key:u.name,class:a.normalizeClass(["items-center flex leading-snug cursor-pointer px-6 -mb-[px]",{"py-2":t.pills,"border-b-[2px] py-3":!t.pills,"border-transparent":!t.pills&&u.name!=t.modelValue,"dark:border-gray-930 hover:text-gray-800 dark:hover:text-gray-400 hover:border-gray-200":u.name!=t.modelValue,"text-wpic-500 border-b-wpic-500 dark:text-wpic-600 dark:border-b-wpic-600":!t.pills&&u.name===t.modelValue,"rounded-lg":t.pills,"bg-black/5 dark:bg-white/10 text-gray-800 dark:!text-gray-300":t.pills&&u.name===t.modelValue,"bg-gray-900 dark:bg-gray-300! text-white! dark:text-gray-800!":t.pills&&t.contrastPills&&u.name===t.modelValue,"text-gray-500 dark:text-gray-500":!u.disabled,"text-gray-300 dark:text-gray-700":u.disabled}]),onClick:f=>u.disabled?null:o(u.name)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.labelSlot||"span"),{class:a.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},{default:a.withCtx(()=>[u.labelSlot?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(u.label),1)],64))]),_:2},1032,["class"]))],10,yB))),128))],2),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),kB=Object.assign({name:"WpicTabPane"},{props:{label:{type:String,required:!0},name:{type:String,required:!0},noStyle:Boolean,disabled:Boolean},setup(t){const e=t,n=a.ref(!1),r=a.inject("addTab"),i=a.inject("modelValue"),o=a.useSlots();return a.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled,labelSlot:o.label})}),a.watch(()=>i.value,s=>{n.value=s===e.name},{immediate:!0,deep:!0}),(s,l)=>n.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[a.renderSlot(s.$slots,"default")],2)):a.createCommentVNode("",!0)}}),xB={},wB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},vB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},null,-1)];function CB(t,e){return a.openBlock(),a.createElementBlock("svg",wB,vB)}const SB=ae(xB,[["render",CB]]),EB={},OB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},MB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)];function TB(t,e){return a.openBlock(),a.createElementBlock("svg",OB,MB)}const $B=ae(EB,[["render",TB]]),NB={},BB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},AB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function VB(t,e){return a.openBlock(),a.createElementBlock("svg",BB,AB)}const DB=ae(NB,[["render",VB]]),_B={},LB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},IB=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function PB(t,e){return a.openBlock(),a.createElementBlock("svg",LB,IB)}const RB=ae(_B,[["render",PB]]),zB={key:0,class:"w-6 opacity-50"},jB={class:"flex-1"},FB={key:0,class:"mb-2"},HB=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["py-3 rounded-md text-base flex gap-3 pr-6 mb-3",{"bg-iron-500/10 text-iron-900 dark:bg-iron-500/20 dark:text-iron-200/90":!t.warning&&!t.info&&!t.error&&!t.success,"bg-yellow-500/10 text-yellow-900 dark:bg-yellow-500/20 dark:text-yellow-200/90":t.warning,"bg-purple-500/10 text-purple-900 dark:bg-purple-500/20 dark:text-purple-200/90":t.info,"bg-red-500/10 text-red-900 dark:bg-red-500/20 dark:text-red-200/90":t.error,"bg-emerald-500/10 text-emerald-900 dark:bg-emerald-500/20 dark:text-emerald-200/90":t.success,"pl-4":t.warning||t.info||t.success||t.error,"pl-6":!t.warning&&!t.info&&!t.success&&!t.error}])},[t.warning||t.info||t.success||t.error?(a.openBlock(),a.createElementBlock("div",zB,[t.warning?(a.openBlock(),a.createBlock(SB,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock($B,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(DB,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(RB,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",jB,[t.title?(a.openBlock(),a.createElementBlock("div",FB,a.toDisplayString(t.title),1)):a.createCommentVNode("",!0),a.createElementVNode("span",{class:a.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[a.renderSlot(e.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.text),1)])],2)])],2))}}),ia=a.ref(!1),Qh=a.ref(""),ep=a.ref(""),tp=a.ref(!1),np=a.ref(!1);let rp=()=>{},ip=()=>{};function oa(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d})=>{Qh.value=i,ep.value=o,tp.value=s,np.value=l,rp=c||(()=>{}),ip=d||(()=>{}),ia.value=!0},e=()=>{ia.value=!1};return{visible:ia,title:Qh,text:ep,positive:tp,negative:np,show:t,onConfirm:()=>{rp(),e()},onCancel:()=>{ip(),e()}}}const WB={key:0,class:"confirm-modal-overlay z-40"},UB={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},qB={class:"text-lg font-semibold mb-6"},KB={class:"mb-12"},YB={class:"flex justify-end"},sa={WpicColorPicker:Zc,WpicAlert:HB,WpicToggleSwitch:Jc,WpicAdvDateField:uB,WpicCalendar:ta,WpicTextarea:Gc,WpicDialog:gB,WpicSlidePanel:fB,WpicDateField:QN,WpicFormInput:Ur,WpicButton:Pr,WpicBadge:EN,WpicTextEditor:aN,WpicInputGroup:_m,WpicButtonGroup:Bm,WpicForm:Lm,WpicFormField:Xc,WpicSpinner:Jn,WpicTooltip:Qc,WpicPopover:En,WpicChoiceList:Yc,WpicCard:_w,WpicCardSection:Pw,WpicProgressBar:jw,WpicTag:Hw,WpicTagGroup:Ww,WpicPagination:wv,WpicLoadingPanel:Yw,WpicTable:Xv,WpicTableColumn:Qv,WpicTabs:bB,WpicTabPane:kB,WpicConfirm:ae(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l}=oa();return(c,d)=>a.unref(e)?(a.openBlock(),a.createElementBlock("div",WB,[a.createElementVNode("div",UB,[a.createElementVNode("div",qB,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",KB,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",YB,[a.createVNode(Pr,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode("Cancel")]),_:1},8,["onClick"]),a.createVNode(Pr,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-613542ab"]])};function op(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?op(t[n],e[n]):t[n]=e[n])}const JB={useConfirm:oa};function GB(t,e){op(ne,e);for(const n in sa)if(sa.hasOwnProperty(n)){const r=sa[n];t.component(r.name,r)}}const ZB={install:GB,composables:JB,options:ne};Yt.default=ZB,Yt.useConfirm=oa,Object.defineProperties(Yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|