@romainbx/wpic-components 0.0.115 → 0.0.117
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/src/components/form/Button.vue.d.ts +2 -0
- package/dist/src/components/form/ChoiceList.vue.d.ts +2 -0
- package/dist/src/components/form/FormField.vue.d.ts +2 -0
- package/dist/src/components/form/FormInput.vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/wpic-components.js +926 -918
- package/dist/wpic-components.umd.cjs +21 -21
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* vee-validate v4.12.8
|
|
3
3
|
* (c) 2024 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Ke(t){return typeof t=="function"}function Pc(t){return t==null}const Ln=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Zs(t){return Number(t)>=0}function Yg(t){const e=parseFloat(t);return isNaN(e)?t:e}function qg(t){return typeof t=="object"&&t!==null}function Kg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!qg(t)||Kg(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 Ei(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),Ei(t[n],e[n]);return}t[n]=e[n]}),t}function Ci(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Zs(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Gt(t,e){Jg(t,e),Fc[t]=e}function Gg(t){return Fc[t]}function Jg(t,e){if(!Ke(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function zc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(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(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(De(l),De(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(De(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++)zc(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]||zc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Si=Symbol("vee-validate-form"),jc=Symbol("vee-validate-field-instance"),_o=Symbol("Default empty value"),Zg=typeof window<"u";function Xs(t){return Ke(t)&&!!t.__locatorRef}function Jt(t){return!!t&&Ke(t.parse)&&t.__type==="VVTypedSchema"}function Oo(t){return!!t&&Ke(t.validate)}function _i(t){return t==="checkbox"||t==="radio"}function Xg(t){return Ln(t)||Array.isArray(t)}function Qg(t){return Array.isArray(t)?t.length===0:Ln(t)&&Object.keys(t).length===0}function To(t){return/^\[.+\]$/i.test(t)}function e0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function t0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function n0(t,e){return!t0(t,e)&&e.type!=="file"&&!_i(e.type)}function Wc(t){return Qs(t)&&t.target&&"submit"in t.target}function Qs(t){return t?!!(typeof Event<"u"&&Ke(Event)&&t instanceof Event||t&&t.srcElement):!1}function Uc(t,e){return e in t&&t[e]!==_o}function mt(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(!mt(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(!mt(r[1],e.get(r[0])))return!1;return!0}if(Yc(t)&&Yc(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(!mt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return Zg?t instanceof File:!1}function el(t){return To(t)?t.replace(/\[|\]/gi,""):t}function xt(t,e,n){return t?To(e)?t[el(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Xg(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(To(e)){t[el(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)||Pc(i[r[o]]))&&(i[r[o]]=Zs(r[o+1])?[]:{}),i=i[r[o]]}}function tl(t,e){if(Array.isArray(t)&&Zs(e)){t.splice(Number(e),1);return}Ln(t)&&delete t[e]}function qc(t,e){if(To(e)){delete t[el(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){tl(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>xt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Qg(i[o])){if(o===0){tl(t,n[0]);continue}tl(i[o-1],n[o-1])}}function Et(t){return Object.keys(t)}function nl(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>mt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return mt(t,e)?n:e}function r0(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 Gc(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 i0(t,e){return Ln(e)&&e.number?Yg(t):t}function rl(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 il(t){return Array.isArray(t)?t:t?[t]:[]}function No(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function o0(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 ol(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 sl(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function s0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Mo(t){if(!Qs(t))return t;const e=t.target;if(_i(e.type)&&Jc(e))return sl(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(e0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(sl);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?sl(n):e.value}return s0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Ln(t)&&t._$$isNormalized?t:Ln(t)?Object.keys(t).reduce((n,r)=>{const i=l0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=a0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function l0(t){return t===!0?[]:Array.isArray(t)||Ln(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?c0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const a0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function c0(t){const e=n=>xt(n,t)||n[t];return e.__locatorRef=t,e}function d0(t){return Array.isArray(t)?t.filter(Xs):Et(t).filter(e=>Xs(t[e])).map(e=>t[e])}let u0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ar=()=>u0;async function Qc(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 f0(i,t)).errors;return{errors:s,valid:!s.length}}async function f0(t,e){if(Jt(t.rules)||Oo(t.rules))return p0(e,t.rules);if(Ke(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:td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Zc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await m0(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function h0(t){return!!t&&t.name==="ValidationError"}function ed(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!h0(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 p0(t,e){const r=await(Jt(e)?e:ed(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function m0(t,e,n){const r=Gg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=g0(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:td(o)}}function td(t){const e=ar().generateMessage;return e?e(t):"Field is invalid"}function g0(t,e){const n=r=>Xs(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 y0(t,e){const r=await(Jt(t)?t:ed(t)).parse(De(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 b0(t,e,n){const i=Et(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 Qc(xt(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 nd=0;function k0(t,e){const{value:n,initialValue:r,setInitialValue:i}=w0(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}=E0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=x0(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 w0(t,e,n){const r=a.ref(a.unref(e));function i(){return n?xt(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=v0(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return xt(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function v0(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:xt(e.values,a.unref(r),a.unref(n))}function x0(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(()=>!mt(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function E0(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=il(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&Ug({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"},_0)}const Oi={},Ti={};let yn;const Pr=r0(()=>{setTimeout(async()=>{await a.nextTick(),yn==null||yn.sendInspectorState(Rr),yn==null||yn.sendInspectorTree(Rr)},100)},100);function C0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Oi[t.formId]=Object.assign({},t),Oi[t.formId]._vm=e,a.onUnmounted(()=>{delete Oi[t.formId],Pr()}),Pr()}function S0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ti[t.id]=Object.assign({},t),Ti[t.id]._vm=e,a.onUnmounted(()=>{delete Ti[t.id],Pr()}),Pr()}const Rr="vee-validate-inspector",Ct={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let He=null;function _0(t){yn=t,t.addInspector({id:Rr,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){await He.field.validate();return}if(He.type==="form"){await He.form.validate();return}He.type==="pathState"&&await He.form.validateField(He.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){He.field.resetField();return}He.type==="form"&&He.form.resetForm(),He.type==="pathState"&&He.form.resetField(He.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Rr)return;const n=Object.values(Oi),r=Object.values(Ti);e.rootNodes=[...n.map(O0),...r.map(i=>N0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Rr||n.currentTab!==`custom-inspector:${Rr}`)return;const{form:r,field:i,state:o,type:s}=M0(e.nodeId);if(r&&s==="form"){e.state=A0(r),He={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=od(o),He={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=od({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),He={field:i,type:"field"};return}He=null})}function O0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,a.unref(s.path),T0(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Ln(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:ll(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ct.white,backgroundColor:Ct.unknown}]}}function T0(t,e){return{id:ll(e,t),label:a.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function N0(t,e){return{id:ll(e,t),label:a.unref(t.name),tags:id(!1,1,t.type,t.meta.valid,e)}}function id(t,e,n,r,i){const{textColor:o,bgColor:s}=sd(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ct.black,backgroundColor:Ct.gray},n==="checkbox"?{label:"Checkbox",textColor:Ct.white,backgroundColor:Ct.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ct.white,backgroundColor:Ct.purple}:void 0,t?{label:"Multiple",textColor:Ct.black,backgroundColor:Ct.orange}:void 0].filter(Boolean)}function ll(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 M0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Oi[e.f];if(!n&&e.ff){const i=Ti[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 od(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 A0(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:Et(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 sd(t){return{bgColor:t?Ct.success:Ct.error,textColor:t?Ct.black:Ct.white}}function D0(t,e,n){return _i(n==null?void 0:n.type)?B0(t,e,n):ld(t,e,n)}function ld(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}=L0(n),g=f?nl(Si):void 0,y=m||g,k=a.computed(()=>Ci(a.toValue(t))),x=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const H=a.unref(e);return Oo(H)||Jt(H)||Ke(H)||Array.isArray(H)?H:Zc(H)}),w=!Ke(x.value)&&Jt(a.toValue(e)),{id:b,value:S,initialValue:v,meta:O,setState:B,errors:A,flags:P}=k0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?C:void 0,schema:w?e:void 0}),$=a.computed(()=>A.value[0]);p&&$0({value:S,prop:p,handleChange:I,shouldValidate:()=>d&&!P.pendingReset});const L=(q,H=!1)=>{O.touched=!0,H&&z()};async function j(q){var H,de;if(y!=null&&y.validateSchema){const{results:ae}=await y.validateSchema(q);return(H=ae[a.toValue(k)])!==null&&H!==void 0?H:{valid:!0,errors:[]}}return x.value?Qc(S.value,x.value,{name:a.toValue(k),label:a.toValue(c),values:(de=y==null?void 0:y.values)!==null&&de!==void 0?de:{},bails:o}):{valid:!0,errors:[]}}const z=rl(async()=>(O.pending=!0,O.validated=!0,j("validated-only")),q=>(P.pendingUnmount[W.id]||(B({errors:q.errors}),O.pending=!1,O.valid=q.valid),q)),D=rl(async()=>j("silent"),q=>(O.valid=q.valid,q));function C(q){return(q==null?void 0:q.mode)==="silent"?D():z()}function I(q,H=!0){const de=Mo(q);ce(de,H)}a.onMounted(()=>{if(i)return z();(!y||!y.validateSchema)&&D()});function R(q){O.touched=q}function ee(q){var H;const de=q&&"value"in q?q.value:v.value;B({value:De(de),initialValue:De(de),touched:(H=q==null?void 0:q.touched)!==null&&H!==void 0?H:!1,errors:(q==null?void 0:q.errors)||[]}),O.pending=!1,O.validated=!1,D()}const te=a.getCurrentInstance();function ce(q,H=!0){S.value=te&&p?i0(q,te.props.modelModifiers):q,(H?z:D)()}function ue(q){B({errors:Array.isArray(q)?q:[q]})}const V=a.computed({get(){return S.value},set(q){ce(q,d)}}),W={id:b,name:k,label:c,value:V,meta:O,errors:A,errorMessage:$,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:ee,handleReset:()=>ee(),validate:C,handleChange:I,handleBlur:L,setState:B,setTouched:R,setErrors:ue,setValue:ce};if(a.provide(jc,W),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(q,H)=>{mt(q,H)||(O.validated?z():D())},{deep:!0}),process.env.NODE_ENV!=="production"&&(W._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:A.value},O),{value:S.value}),Pr,{deep:!0}),y||S0(W)),!y)return W;const K=a.computed(()=>{const q=x.value;return!q||Ke(q)||Oo(q)||Jt(q)||Array.isArray(q)?{}:Object.keys(q).reduce((H,de)=>{const ae=d0(q[de]).map(we=>we.__locatorRef).reduce((we,Ne)=>{const Ie=xt(y.values,Ne)||y.values[Ne];return Ie!==void 0&&(we[Ne]=Ie),we},{});return Object.assign(H,ae),H},{})});return a.watch(K,(q,H)=>{if(!Object.keys(q).length)return;!mt(q,H)&&(O.validated?z():D())}),a.onBeforeUnmount(()=>{var q;const H=(q=a.toValue(W.keepValueOnUnmount))!==null&&q!==void 0?q:a.toValue(y.keepValuesOnUnmount),de=a.toValue(k);if(H||!y||P.pendingUnmount[W.id]){y==null||y.removePathState(de,b);return}P.pendingUnmount[W.id]=!0;const ae=y.getPathState(de);if(Array.isArray(ae==null?void 0:ae.id)&&(ae!=null&&ae.multiple)?ae!=null&&ae.id.includes(W.id):(ae==null?void 0:ae.id)===W.id){if(ae!=null&&ae.multiple&&Array.isArray(ae.value)){const Ne=ae.value.findIndex(Ie=>mt(Ie,a.toValue(W.checkedValue)));if(Ne>-1){const Ie=[...ae.value];Ie.splice(Ne,1),y.setFieldValue(de,Ie)}Array.isArray(ae.id)&&ae.id.splice(ae.id.indexOf(W.id),1)}else y.unsetPathValue(a.toValue(k));y.removePathState(de,b)}}),W}function L0(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||{}))?al(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 B0(t,e,n){const r=n!=null&&n.standalone?void 0:nl(Si),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=>mt(p,h))>=0:mt(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),k=Mo(f);let x=(m=a.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(xt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(a.toValue(l.value),x,a.toValue(o))),c(x,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ld(t,e,n))}function $0({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=>{mt(l,al(i,o))||i.emit(s,l)}),a.watch(()=>al(i,o),l=>{if(l===_o&&e.value===void 0)return;const c=l===_o?void 0:l;mt(c,e.value)||n(c,r())}))}function al(t,e){if(t)return t.props[e]}const I0=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:()=>ar().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:_o},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:k,setErrors:x}=D0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:P0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(A,P=!0){f(A,P)},b=a.computed(()=>{const{validateOnInput:B,validateOnChange:A,validateOnBlur:P,validateOnModelUpdate:$}=V0(t);function L(C){h(C,P),Ke(e.attrs.onBlur)&&e.attrs.onBlur(C)}function j(C){w(C,B),Ke(e.attrs.onInput)&&e.attrs.onInput(C)}function z(C){w(C,A),Ke(e.attrs.onChange)&&e.attrs.onChange(C)}const D={name:t.name,onBlur:L,onInput:j,onChange:z};return D["onUpdate:modelValue"]=C=>w(C,$),D}),S=a.computed(()=>{const B=Object.assign({},b.value);_i(e.attrs.type)&&k&&(B.checked=k.value);const A=ad(t,e);return n0(A,e.attrs)&&(B.value=c.value),B}),v=a.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function O(){return{field:S.value,componentField:v.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:B=>w(B,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const B=a.resolveDynamicComponent(ad(t,e)),A=ol(B,e,O);return B?a.h(B,Object.assign(Object.assign({},e.attrs),S.value),A):A}}});function ad(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function V0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=ar();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 P0(t,e){return _i(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const cr=I0;let R0=0;const Ao=["bails","fieldsCount","id","multiple","type","validate"];function cd(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&&Jt(r)&&Ke(r.cast)?De(r.cast(n)||{}):De(n)}function F0(t){var e;const n=R0++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(cd(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=o0(()=>{f.value=d.value.reduce((T,M)=>(T[Ci(a.toValue(M.path))]=M,T),{})});function p(T,M){const Y=C(T);if(!Y){typeof T=="string"&&(u.value[Ci(T)]=il(M));return}if(typeof T=="string"){const ne=Ci(T);u.value[ne]&&delete u.value[ne]}Y.errors=il(M),Y.valid=!Y.errors.length}function m(T){Et(T).forEach(M=>{p(M,T[M])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const T=d.value.reduce((M,Y)=>(Y.errors.length&&(M[Y.path]=Y.errors),M),{});return Object.assign(Object.assign({},u.value),T)}),y=a.computed(()=>Et(g.value).reduce((T,M)=>{const Y=g.value[M];return Y!=null&&Y.length&&(T[M]=Y[0]),T},{})),k=a.computed(()=>d.value.reduce((T,M)=>(T[M.path]={name:M.path||"",label:M.label||""},T),{})),x=a.computed(()=>d.value.reduce((T,M)=>{var Y;return T[M.path]=(Y=M.bails)!==null&&Y!==void 0?Y:!0,T},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:S,originalInitialValues:v,setInitialValues:O}=j0(d,c,t),B=z0(d,c,v,y),A=a.computed(()=>d.value.reduce((T,M)=>{const Y=xt(c,M.path);return gn(T,M.path,Y),T},{})),P=t==null?void 0:t.validationSchema;function $(T,M){var Y,ne;const fe=a.computed(()=>xt(S.value,a.toValue(T))),N=f.value[a.toValue(T)],X=(M==null?void 0:M.type)==="checkbox"||(M==null?void 0:M.type)==="radio";if(N&&X){N.multiple=!0;const vt=r++;return Array.isArray(N.id)?N.id.push(vt):N.id=[N.id,vt],N.fieldsCount++,N.__flags.pendingUnmount[vt]=!1,N}const ie=a.computed(()=>xt(c,a.toValue(T))),me=a.toValue(T),ye=R.findIndex(vt=>vt===me);ye!==-1&&R.splice(ye,1);const ve=a.computed(()=>{var vt,Ft,Ir,lr;const mn=a.toValue(P);if(Jt(mn))return(Ft=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,a.toValue(T)).required)!==null&&Ft!==void 0?Ft:!1;const So=a.toValue(M==null?void 0:M.schema);return Jt(So)&&(lr=(Ir=So.describe)===null||Ir===void 0?void 0:Ir.call(So).required)!==null&&lr!==void 0?lr:!1}),Ae=r++,je=a.reactive({id:Ae,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((Y=w[me])===null||Y===void 0)&&Y.length),required:ve,initialValue:fe,errors:a.shallowRef([]),bails:(ne=M==null?void 0:M.bails)!==null&&ne!==void 0?ne:!1,label:M==null?void 0:M.label,type:(M==null?void 0:M.type)||"default",value:ie,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:M==null?void 0:M.validate,dirty:a.computed(()=>!mt(a.unref(ie),a.unref(fe)))});return d.value.push(je),f.value[me]=je,h(),y.value[me]&&!w[me]&&a.nextTick(()=>{pt(me,{mode:"silent"})}),a.isRef(T)&&a.watch(T,vt=>{h();const Ft=De(ie.value);f.value[vt]=je,a.nextTick(()=>{gn(c,vt,Ft)})}),je}const L=Gc(se,5),j=Gc(se,5),z=rl(async T=>await(T==="silent"?L():j()),(T,[M])=>{const Y=Et(q.errorBag.value),fe=[...new Set([...Et(T.results),...d.value.map(N=>N.path),...Y])].sort().reduce((N,X)=>{var ie;const me=X,ye=C(me)||I(me),ve=((ie=T.results[me])===null||ie===void 0?void 0:ie.errors)||[],Ae=a.toValue(ye==null?void 0:ye.path)||me,je=H0({errors:ve,valid:!ve.length},N.results[Ae]);return N.results[Ae]=je,je.valid||(N.errors[Ae]=je.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=je.valid,M==="silent"||M==="validated-only"&&!ye.validated||p(ye,je.errors),N):(p(Ae,ve),N)},{valid:T.valid,results:{},errors:{}});return T.values&&(fe.values=T.values),Et(fe.results).forEach(N=>{var X;const ie=C(N);ie&&M!=="silent"&&(M==="validated-only"&&!ie.validated||p(ie,(X=fe.results[N])===null||X===void 0?void 0:X.errors))}),fe});function D(T){d.value.forEach(T)}function C(T){const M=typeof T=="string"?Ci(T):T;return typeof M=="string"?f.value[M]:M}function I(T){return d.value.filter(Y=>T.startsWith(Y.path)).reduce((Y,ne)=>Y?ne.path.length>Y.path.length?ne:Y:ne,void 0)}let R=[],ee;function te(T){return R.push(T),ee||(ee=a.nextTick(()=>{[...R].sort().reverse().forEach(Y=>{qc(c,Y)}),R=[],ee=null})),ee}function ce(T){return function(Y,ne){return function(N){return N instanceof Event&&(N.preventDefault(),N.stopPropagation()),D(X=>X.touched=!0),i.value=!0,s.value++,at().then(X=>{const ie=De(c);if(X.valid&&typeof Y=="function"){const me=De(A.value);let ye=T?me:ie;return X.values&&(ye=X.values),Y(ye,{evt:N,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Ne,setValues:ae,setFieldValue:H,resetForm:lt,resetField:At})}!X.valid&&typeof ne=="function"&&ne({values:ie,evt:N,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const V=ce(!1);V.withControlled=ce(!0);function W(T,M){const Y=d.value.findIndex(fe=>fe.path===T&&(Array.isArray(fe.id)?fe.id.includes(M):fe.id===M)),ne=d.value[Y];if(!(Y===-1||!ne)){if(a.nextTick(()=>{pt(T,{mode:"silent",warn:!1})}),ne.multiple&&ne.fieldsCount&&ne.fieldsCount--,Array.isArray(ne.id)){const fe=ne.id.indexOf(M);fe>=0&&ne.id.splice(fe,1),delete ne.__flags.pendingUnmount[M]}(!ne.multiple||ne.fieldsCount<=0)&&(d.value.splice(Y,1),E(T),h(),delete f.value[T])}}function K(T){Et(f.value).forEach(M=>{M.startsWith(T)&&delete f.value[M]}),d.value=d.value.filter(M=>!M.path.startsWith(T)),a.nextTick(()=>{h()})}const q={formId:n,values:c,controlledValues:A,errorBag:g,errors:y,schema:P,submitCount:s,meta:B,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:a.unref(P)?z:void 0,validate:at,setFieldError:p,validateField:pt,setFieldValue:H,setValues:ae,setErrors:m,setFieldTouched:Ne,setTouched:Ee,resetForm:lt,resetField:At,handleSubmit:V,useFieldModel:Oe,defineInputBinds:F,defineComponentBinds:Z,defineField:_e,stageInitialValue:_,unsetInitialValue:E,setFieldInitialValue:U,createPathState:$,getPathState:C,unsetPathValue:te,removePathState:W,initialValues:S,getAllPathStates:()=>d.value,destroyPath:K,isFieldTouched:Ie,isFieldDirty:tt,isFieldValid:Q};function H(T,M,Y=!0){const ne=De(M),fe=typeof T=="string"?T:T.path;C(fe)||$(fe),gn(c,fe,ne),Y&&pt(fe)}function de(T,M=!0){Et(c).forEach(Y=>{delete c[Y]}),Et(T).forEach(Y=>{H(Y,T[Y],!1)}),M&&at()}function ae(T,M=!0){Ei(c,T),l.forEach(Y=>Y&&Y.reset()),M&&at()}function we(T,M){const Y=C(a.toValue(T))||$(T);return a.computed({get(){return Y.value},set(ne){var fe;const N=a.toValue(T);H(N,ne,(fe=a.toValue(M))!==null&&fe!==void 0?fe:!1)}})}function Ne(T,M){const Y=C(T);Y&&(Y.touched=M)}function Ie(T){const M=C(T);return M?M.touched:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.touched)}function tt(T){const M=C(T);return M?M.dirty:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.dirty)}function Q(T){const M=C(T);return M?M.valid:d.value.filter(Y=>Y.path.startsWith(T)).every(Y=>Y.valid)}function Ee(T){if(typeof T=="boolean"){D(M=>{M.touched=T});return}Et(T).forEach(M=>{Ne(M,!!T[M])})}function At(T,M){var Y;const ne=M&&"value"in M?M.value:xt(S.value,T),fe=C(T);fe&&(fe.__flags.pendingReset=!0),U(T,De(ne),!0),H(T,ne,!1),Ne(T,(Y=M==null?void 0:M.touched)!==null&&Y!==void 0?Y:!1),p(T,(M==null?void 0:M.errors)||[]),a.nextTick(()=>{fe&&(fe.__flags.pendingReset=!1)})}function lt(T,M){let Y=De(T!=null&&T.values?T.values:v.value);Y=M!=null&&M.force?Y:Ei(v.value,Y),Y=Jt(P)&&Ke(P.cast)?P.cast(Y):Y,O(Y),D(ne=>{var fe;ne.__flags.pendingReset=!0,ne.validated=!1,ne.touched=((fe=T==null?void 0:T.touched)===null||fe===void 0?void 0:fe[ne.path])||!1,H(ne.path,xt(Y,ne.path),!1),p(ne.path,void 0)}),M!=null&&M.force?de(Y,!1):ae(Y,!1),m((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,a.nextTick(()=>{at({mode:"silent"}),D(ne=>{ne.__flags.pendingReset=!1})})}async function at(T){const M=(T==null?void 0:T.mode)||"force";if(M==="force"&&D(N=>N.validated=!0),q.validateSchema)return q.validateSchema(M);o.value=!0;const Y=await Promise.all(d.value.map(N=>N.validate?N.validate(T).then(X=>({key:N.path,valid:X.valid,errors:X.errors})):Promise.resolve({key:N.path,valid:!0,errors:[]})));o.value=!1;const ne={},fe={};for(const N of Y)ne[N.key]={valid:N.valid,errors:N.errors},N.errors.length&&(fe[N.key]=N.errors[0]);return{valid:Y.every(N=>N.valid),results:ne,errors:fe}}async function pt(T,M){var Y;const ne=C(T);if(ne&&(M==null?void 0:M.mode)!=="silent"&&(ne.validated=!0),P){const{results:N}=await z((M==null?void 0:M.mode)||"validated-only");return N[T]||{errors:[],valid:!0}}return ne!=null&&ne.validate?ne.validate(M):(!ne&&((Y=M==null?void 0:M.warn)!==null&&Y!==void 0?Y:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${T} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(T){qc(S.value,T)}function _(T,M,Y=!1){U(T,M),gn(c,T,M),Y&&!(t!=null&&t.initialValues)&&gn(v.value,T,De(M))}function U(T,M,Y=!1){gn(S.value,T,De(M)),Y&&gn(v.value,T,De(M))}async function se(){const T=a.unref(P);if(!T)return{valid:!0,results:{},errors:{}};o.value=!0;const M=Oo(T)||Jt(T)?await y0(T,c):await b0(T,c,{names:k.value,bailsMap:x.value});return o.value=!1,M}const Me=V((T,{evt:M})=>{Wc(M)&&M.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){at();return}q.validateSchema&&q.validateSchema("silent")}),a.isRef(P)&&a.watch(P,()=>{var T;(T=q.validateSchema)===null||T===void 0||T.call(q,"validated-only")}),a.provide(Si,q),process.env.NODE_ENV!=="production"&&(C0(q),a.watch(()=>Object.assign(Object.assign({errors:g.value},B.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Pr,{deep:!0}));function _e(T,M){const Y=Ke(M)||M==null?void 0:M.label,ne=C(a.toValue(T))||$(T,{label:Y}),fe=()=>Ke(M)?M(No(ne,Ao)):M||{};function N(){var ve;ne.touched=!0,((ve=fe().validateOnBlur)!==null&&ve!==void 0?ve:ar().validateOnBlur)&&pt(ne.path)}function X(){var ve;((ve=fe().validateOnInput)!==null&&ve!==void 0?ve:ar().validateOnInput)&&a.nextTick(()=>{pt(ne.path)})}function ie(){var ve;((ve=fe().validateOnChange)!==null&&ve!==void 0?ve:ar().validateOnChange)&&a.nextTick(()=>{pt(ne.path)})}const me=a.computed(()=>{const ve={onChange:ie,onInput:X,onBlur:N};return Ke(M)?Object.assign(Object.assign({},ve),M(No(ne,Ao)).props||{}):M!=null&&M.props?Object.assign(Object.assign({},ve),M.props(No(ne,Ao))):ve});return[we(T,()=>{var ve,Ae,je;return(je=(ve=fe().validateOnModelUpdate)!==null&&ve!==void 0?ve:(Ae=ar())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&je!==void 0?je:!0}),me]}function Oe(T){return Array.isArray(T)?T.map(M=>we(M,!0)):we(T)}function F(T,M){const[Y,ne]=_e(T,M);function fe(){ne.value.onBlur()}function N(ie){const me=Mo(ie);H(a.toValue(T),me,!1),ne.value.onInput()}function X(ie){const me=Mo(ie);H(a.toValue(T),me,!1),ne.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},ne.value),{onBlur:fe,onInput:N,onChange:X,value:Y.value}))}function Z(T,M){const[Y,ne]=_e(T,M),fe=C(a.toValue(T));function N(X){Y.value=X}return a.computed(()=>{const X=Ke(M)?M(No(fe,Ao)):M||{};return Object.assign({[X.model||"modelValue"]:Y.value,[`onUpdate:${X.model||"modelValue"}`]:N},ne.value)})}return Object.assign(Object.assign({},q),{values:a.readonly(c),handleReset:()=>lt(),submitForm:Me})}function z0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!mt(e,a.unref(n)));function s(){const c=t.value;return Et(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&&!Et(r.value).length,dirty:o.value}))}function j0(t,e,n){const r=cd(n),i=a.ref(r),o=a.ref(De(r));function s(l,c=!1){i.value=Ei(De(i.value)||{},De(l)),o.value=Ei(De(o.value)||{},De(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=xt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function H0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const W0=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:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetField:O}=F0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),B=y((C,{evt:I})=>{Wc(I)&&I.target.submit()},t.onInvalidSubmit),A=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):B;function P(C){Qs(C)&&C.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function $(C,I){return y(typeof C=="function"&&!I?C:I,t.onInvalidSubmit)(C)}function L(){return De(s)}function j(){return De(l.value)}function z(){return De(i.value)}function D(){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:B,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetForm:g,resetField:O,getValues:L,getMeta:j,getErrors:z}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:O,getValues:L,getMeta:j,getErrors:z,values:s,meta:l,errors:i}),function(){const I=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,R=ol(I,e,D);if(!I)return R;const ee=I==="form"?{novalidate:!0}:{};return a.h(I,Object.assign(Object.assign(Object.assign({},ee),e.attrs),{onSubmit:A,onReset:P}),R)}}}),U0=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Si,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=ol(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 Y0(t){const e=nl(Si),n=t?void 0:a.inject(jc);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}Gt("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),Gt("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"}),Gt("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"),Gt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Gt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Gt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Gt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Gt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Gt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Gt("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"}),Gt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},q0={},K0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},G0=[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 J0(t,e){return a.openBlock(),a.createElementBlock("svg",K0,G0)}const Z0=be(q0,[["render",J0]]),X0={},Q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ey=[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 ty(t,e){return a.openBlock(),a.createElementBlock("svg",Q0,ey)}const ny=be(X0,[["render",ty]]),ry={class:"relative"},Fr=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",ry,[a.createVNode(Z0,{class:"absolute opacity-25"}),a.createVNode(ny,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let he={theme:"wpic-tools",popoverTarget:"body"};const iy=["is","type","disabled"],oy={key:0,class:"absolute inset-0 flex justify-center items-center"},sy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ly=["onClick"],Ni=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=k=>{r.value&&!r.value.contains(k.target)&&n.value&&!n.value.contains(k.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":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-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-iron-100 text-iron-800 disabled:text-iron-800/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-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-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(k,x)=>{var w;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var S;return(S=t.actions)!=null&&S.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,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${l[a.unref(he).theme]}`]:!0,[`${u[a.unref(he).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(he).theme]}`]:t.secondary,[`${p[a.unref(he).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(he).theme]}`]:t.primary&&t.plain,[`${y[a.unref(he).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(he).theme]}`]:t.colorless,[`${h[a.unref(he).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(he).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(he).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",oy,[a.createVNode(Fr,{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(k.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.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",sy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,b=>(a.openBlock(),a.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(b.label),9,ly))),256))])],512)):a.createCommentVNode("",!0)],10,iy)}}}),ay=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(he).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),cy={name:"WpicInputGroup"},dy={class:"wpic-input-group flex w-full"};function uy(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",dy,[a.renderSlot(t.$slots,"default")])}const fy=be(cy,[["render",uy]]),hy=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(W0),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Mi=Math.min,zr=Math.max,Do=Math.round,Bn=t=>({x:t,y:t}),py={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function cl(t,e,n){return zr(t,Mi(e,n))}function Ai(t,e){return typeof t=="function"?t(e):t}function dr(t){return t.split("-")[0]}function Di(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function dl(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(dr(t))?"y":"x"}function ul(t){return dd(Lo(t))}function gy(t,e,n){n===void 0&&(n=!1);const r=Di(t),i=ul(t),o=dl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Bo(s)),[s,Bo(s)]}function yy(t){const e=Bo(t);return[fl(t),e,fl(e)]}function fl(t){return t.replace(/start|end/g,e=>my[e])}function by(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 ky(t,e,n,r){const i=Di(t);let o=by(dr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(fl)))),o}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>py[e])}function wy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?wy(t):{top:t,right:t,bottom:t,left:t}}function $o(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 fd(t,e,n){let{reference:r,floating:i}=t;const o=Lo(e),s=ul(e),l=dl(s),c=dr(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(Di(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const vy=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}=fd(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:k}=l[g],{x,y:w,data:b,reset:S}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=w??f,p={...p,[y]:{...p[y],...b}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:f}=fd(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function hd(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}=Ai(e,t),m=ud(p),y=l[h?f==="floating"?"reference":"floating":f],k=$o(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})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},S=$o(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-S.top+m.top)/b.y,bottom:(S.bottom-k.bottom+m.bottom)/b.y,left:(k.left-S.left+m.left)/b.x,right:(S.right-k.right+m.right)/b.x}}const xy=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}=Ai(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=ul(i),m=dl(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],S=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let O=v?v[w]:0;(!O||!await(s.isElement==null?void 0:s.isElement(v)))&&(O=l.floating[w]||o.floating[m]);const B=b/2-S/2,A=O/2-g[m]/2-1,P=Mi(f[k],A),$=Mi(f[x],A),L=P,j=O-g[m]-$,z=O/2-g[m]/2+B,D=cl(L,z,j),C=!c.arrow&&Di(i)!=null&&z!==D&&o.reference[m]/2-(z<L?P:$)-g[m]/2<0,I=C?z<L?z-L:z-j:0;return{[p]:h[p]+I,data:{[p]:D,centerOffset:z-D-I,...C&&{alignmentOffset:I}},reset:C}}}),Ey=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}=Ai(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=dr(i),x=dr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[Bo(l)]:yy(l));!h&&m!=="none"&&b.push(...ky(l,g,m,w));const S=[l,...b],v=await hd(e,y),O=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&O.push(v[k]),f){const L=gy(i,s,w);O.push(v[L[0]],v[L[1]])}if(B=[...B,{placement:i,overflows:O}],!O.every(L=>L<=0)){var A,P;const L=(((A=o.flip)==null?void 0:A.index)||0)+1,j=S[L];if(j)return{data:{index:L,overflows:B},reset:{placement:j}};let z=(P=B.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:P.placement;if(!z)switch(p){case"bestFit":{var $;const D=($=B.map(C=>[C.placement,C.overflows.filter(I=>I>0).reduce((I,R)=>I+R,0)]).sort((C,I)=>C[1]-I[1])[0])==null?void 0:$[0];D&&(z=D);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};async function Cy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=dr(n),l=Di(n),c=Lo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ai(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 Sy=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 Cy(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}}}}},_y=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:k,y:x}=y;return{x:k,y:x}}},...c}=Ai(t,e),d={x:n,y:r},u=await hd(e,c),f=Lo(dr(i)),h=dd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],w=p-u[k];p=cl(x,p,w)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],w=m-u[k];m=cl(x,m,w)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function ur(t){return hl(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $n(t){var e;return(e=(hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hl(t){return t instanceof Node||t instanceof Dt(t).Node}function rn(t){return t instanceof Element||t instanceof Dt(t).Element}function on(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Li(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Oy(t){return["table","td","th"].includes(ur(t))}function pl(t){const e=ml(),n=Zt(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 Ty(t){let e=In(t);for(;on(e)&&!jr(e);){if(pl(e))return e;e=In(e)}return null}function ml(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(ur(t))}function Zt(t){return Dt(t).getComputedStyle(t)}function Io(t){return rn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function In(t){if(ur(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||$n(t);return pd(e)?e.host:e}function md(t){const e=In(t);return jr(e)?t.ownerDocument?t.ownerDocument.body:t.body:on(e)&&Li(e)?e:md(e)}function gl(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=md(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);return o?e.concat(s,s.visualViewport||[],Li(i)?i:[],s.frameElement&&n?gl(s.frameElement):[]):e.concat(i,gl(i,[],n))}function gd(t){const e=Zt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=on(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Do(n)!==o||Do(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function yd(t){return rn(t)?t:t.contextElement}function Hr(t){const e=yd(t);if(!on(e))return Bn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Do(n.width):n.width)/r,l=(o?Do(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ny=Bn(0);function bd(t){const e=Dt(t);return!ml()||!e.visualViewport?Ny:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function My(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Bi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Bn(1);e&&(r?rn(r)&&(s=Hr(r)):s=Hr(t));const l=My(o,n,r)?bd(o):Bn(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=Dt(o),p=r&&rn(r)?Dt(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Hr(g),k=g.getBoundingClientRect(),x=Zt(g),w=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=b,m=Dt(g),g=m.frameElement}}return $o({width:u,height:f,x:c,y:d})}const Ay=[":popover-open",":modal"];function yl(t){return Ay.some(e=>{try{return t.matches(e)}catch{return!1}})}function Dy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=$n(r),l=e?yl(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Bn(1);const u=Bn(0),f=on(r);if((f||!f&&!o)&&((ur(r)!=="body"||Li(s))&&(c=Io(r)),on(r))){const h=Bi(r);d=Hr(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 Ly(t){return Array.from(t.getClientRects())}function kd(t){return Bi($n(t)).left+Io(t).scrollLeft}function By(t){const e=$n(t),n=Io(t),r=t.ownerDocument.body,i=zr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=zr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const l=-n.scrollTop;return Zt(r).direction==="rtl"&&(s+=zr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function $y(t,e){const n=Dt(t),r=$n(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=ml();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function Iy(t,e){const n=Bi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=on(t)?Hr(t):Bn(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 wd(t,e,n){let r;if(e==="viewport")r=$y(t,n);else if(e==="document")r=By($n(t));else if(rn(e))r=Iy(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return $o(r)}function vd(t,e){const n=In(t);return n===e||!rn(n)||jr(n)?!1:Zt(n).position==="fixed"||vd(n,e)}function Vy(t,e){const n=e.get(t);if(n)return n;let r=gl(t,[],!1).filter(l=>rn(l)&&ur(l)!=="body"),i=null;const o=Zt(t).position==="fixed";let s=o?In(t):t;for(;rn(s)&&!jr(s);){const l=Zt(s),c=pl(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Li(s)&&!c&&vd(t,s))?r=r.filter(u=>u!==s):i=l,s=In(s)}return e.set(t,r),r}function Py(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?yl(e)?[]:Vy(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=wd(e,u,i);return d.top=zr(f.top,d.top),d.right=Mi(f.right,d.right),d.bottom=Mi(f.bottom,d.bottom),d.left=zr(f.left,d.left),d},wd(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ry(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Fy(t,e,n){const r=on(e),i=$n(e),o=n==="fixed",s=Bi(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Bn(0);if(r||!r&&!o)if((ur(e)!=="body"||Li(i))&&(l=Io(e)),r){const f=Bi(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=kd(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 bl(t){return Zt(t).position==="static"}function xd(t,e){return!on(t)||Zt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=Dt(t);if(yl(t))return n;if(!on(t)){let i=In(t);for(;i&&!jr(i);){if(rn(i)&&!bl(i))return i;i=In(i)}return n}let r=xd(t,e);for(;r&&Oy(r)&&bl(r);)r=xd(r,e);return r&&jr(r)&&bl(r)&&!pl(r)?n:r||Ty(t)||n}const zy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Fy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jy(t){return Zt(t).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:$n,getClippingRect:Py,getOffsetParent:Ed,getElementRects:zy,getClientRects:Ly,getDimensions:Ry,getScale:Hr,isElement:rn,isRTL:jy},Cd=Sy,Sd=_y,_d=Ey,Wy=xy,Od=(t,e,n)=>{const r=new Map,i={platform:Hy,...n},o={...i.platform,_c:r};return vy(t,e,{...i,platform:o})};function Uy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Yy(t){if(Uy(t)){const e=t.$el;return hl(e)&&ur(e)==="#comment"?null:e}return t}function qy(t){return{name:"arrow",options:t,fn(e){const n=Yy(a.unref(t.element));return n==null?{}:Wy({element:n,padding:t.padding}).fn(e)}}}const Ky={},Gy={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Jy=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Zy(t,e){return a.openBlock(),a.createElementBlock("svg",Gy,Jy)}const $i=be(Ky,[["render",Zy]]);let Vo;const Xy=new Uint8Array(16);function Qy(){if(!Vo&&(Vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vo(Xy)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function e1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Td={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function kl(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||Qy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,e1(r)}let t1={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 fr=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"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=kl(),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(k){if(d.value)u();else{if(o.noCloseClasses.some(x=>k.target.closest(`.${x}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const k=await Od(l.value,c.value,{placement:o.placement,middleware:[_d(),Sd(),Cd(o.offset)]});c.value.style.left=`${k.x}px`,c.value.style.top=`${k.y}px`}const m=k=>{c.value&&!c.value.contains(k.target)&&l.value&&!l.value.contains(k.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.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}),(k,x)=>(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:x[0]||(x[0]=a.withModifiers(w=>f(w),["stop"]))},[a.renderSlot(k.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(he).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(he).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
|
|
5
|
+
*/function Ke(t){return typeof t=="function"}function Pc(t){return t==null}const Ln=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Zs(t){return Number(t)>=0}function Yg(t){const e=parseFloat(t);return isNaN(e)?t:e}function qg(t){return typeof t=="object"&&t!==null}function Kg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!qg(t)||Kg(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 Ei(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),Ei(t[n],e[n]);return}t[n]=e[n]}),t}function Ci(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Zs(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Gt(t,e){Jg(t,e),Fc[t]=e}function Gg(t){return Fc[t]}function Jg(t,e){if(!Ke(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function zc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(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(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(De(l),De(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(De(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++)zc(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]||zc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Si=Symbol("vee-validate-form"),jc=Symbol("vee-validate-field-instance"),Oo=Symbol("Default empty value"),Zg=typeof window<"u";function Xs(t){return Ke(t)&&!!t.__locatorRef}function Jt(t){return!!t&&Ke(t.parse)&&t.__type==="VVTypedSchema"}function _o(t){return!!t&&Ke(t.validate)}function Oi(t){return t==="checkbox"||t==="radio"}function Xg(t){return Ln(t)||Array.isArray(t)}function Qg(t){return Array.isArray(t)?t.length===0:Ln(t)&&Object.keys(t).length===0}function To(t){return/^\[.+\]$/i.test(t)}function e0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function t0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function n0(t,e){return!t0(t,e)&&e.type!=="file"&&!Oi(e.type)}function Wc(t){return Qs(t)&&t.target&&"submit"in t.target}function Qs(t){return t?!!(typeof Event<"u"&&Ke(Event)&&t instanceof Event||t&&t.srcElement):!1}function Uc(t,e){return e in t&&t[e]!==Oo}function mt(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(!mt(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(!mt(r[1],e.get(r[0])))return!1;return!0}if(Yc(t)&&Yc(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(!mt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return Zg?t instanceof File:!1}function el(t){return To(t)?t.replace(/\[|\]/gi,""):t}function xt(t,e,n){return t?To(e)?t[el(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Xg(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(To(e)){t[el(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)||Pc(i[r[o]]))&&(i[r[o]]=Zs(r[o+1])?[]:{}),i=i[r[o]]}}function tl(t,e){if(Array.isArray(t)&&Zs(e)){t.splice(Number(e),1);return}Ln(t)&&delete t[e]}function qc(t,e){if(To(e)){delete t[el(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){tl(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>xt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Qg(i[o])){if(o===0){tl(t,n[0]);continue}tl(i[o-1],n[o-1])}}function Et(t){return Object.keys(t)}function nl(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>mt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return mt(t,e)?n:e}function r0(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 Gc(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 i0(t,e){return Ln(e)&&e.number?Yg(t):t}function rl(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 il(t){return Array.isArray(t)?t:t?[t]:[]}function No(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function o0(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 ol(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 sl(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function s0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Mo(t){if(!Qs(t))return t;const e=t.target;if(Oi(e.type)&&Jc(e))return sl(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(e0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(sl);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?sl(n):e.value}return s0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Ln(t)&&t._$$isNormalized?t:Ln(t)?Object.keys(t).reduce((n,r)=>{const i=l0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=a0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function l0(t){return t===!0?[]:Array.isArray(t)||Ln(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?c0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const a0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function c0(t){const e=n=>xt(n,t)||n[t];return e.__locatorRef=t,e}function d0(t){return Array.isArray(t)?t.filter(Xs):Et(t).filter(e=>Xs(t[e])).map(e=>t[e])}let u0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ar=()=>u0;async function Qc(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 f0(i,t)).errors;return{errors:s,valid:!s.length}}async function f0(t,e){if(Jt(t.rules)||_o(t.rules))return p0(e,t.rules);if(Ke(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:td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Zc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await m0(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function h0(t){return!!t&&t.name==="ValidationError"}function ed(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!h0(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 p0(t,e){const r=await(Jt(e)?e:ed(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function m0(t,e,n){const r=Gg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=g0(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:td(o)}}function td(t){const e=ar().generateMessage;return e?e(t):"Field is invalid"}function g0(t,e){const n=r=>Xs(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 y0(t,e){const r=await(Jt(t)?t:ed(t)).parse(De(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 b0(t,e,n){const i=Et(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 Qc(xt(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 nd=0;function k0(t,e){const{value:n,initialValue:r,setInitialValue:i}=w0(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}=E0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=x0(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 w0(t,e,n){const r=a.ref(a.unref(e));function i(){return n?xt(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=v0(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return xt(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function v0(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:xt(e.values,a.unref(r),a.unref(n))}function x0(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(()=>!mt(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function E0(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=il(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&Ug({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"},O0)}const _i={},Ti={};let yn;const Pr=r0(()=>{setTimeout(async()=>{await a.nextTick(),yn==null||yn.sendInspectorState(Rr),yn==null||yn.sendInspectorTree(Rr)},100)},100);function C0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}_i[t.formId]=Object.assign({},t),_i[t.formId]._vm=e,a.onUnmounted(()=>{delete _i[t.formId],Pr()}),Pr()}function S0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ti[t.id]=Object.assign({},t),Ti[t.id]._vm=e,a.onUnmounted(()=>{delete Ti[t.id],Pr()}),Pr()}const Rr="vee-validate-inspector",Ct={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let He=null;function O0(t){yn=t,t.addInspector({id:Rr,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){await He.field.validate();return}if(He.type==="form"){await He.form.validate();return}He.type==="pathState"&&await He.form.validateField(He.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){He.field.resetField();return}He.type==="form"&&He.form.resetForm(),He.type==="pathState"&&He.form.resetField(He.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Rr)return;const n=Object.values(_i),r=Object.values(Ti);e.rootNodes=[...n.map(_0),...r.map(i=>N0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Rr||n.currentTab!==`custom-inspector:${Rr}`)return;const{form:r,field:i,state:o,type:s}=M0(e.nodeId);if(r&&s==="form"){e.state=A0(r),He={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=od(o),He={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=od({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),He={field:i,type:"field"};return}He=null})}function _0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,a.unref(s.path),T0(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Ln(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:ll(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ct.white,backgroundColor:Ct.unknown}]}}function T0(t,e){return{id:ll(e,t),label:a.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function N0(t,e){return{id:ll(e,t),label:a.unref(t.name),tags:id(!1,1,t.type,t.meta.valid,e)}}function id(t,e,n,r,i){const{textColor:o,bgColor:s}=sd(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ct.black,backgroundColor:Ct.gray},n==="checkbox"?{label:"Checkbox",textColor:Ct.white,backgroundColor:Ct.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ct.white,backgroundColor:Ct.purple}:void 0,t?{label:"Multiple",textColor:Ct.black,backgroundColor:Ct.orange}:void 0].filter(Boolean)}function ll(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 M0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=_i[e.f];if(!n&&e.ff){const i=Ti[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 od(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 A0(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:Et(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 sd(t){return{bgColor:t?Ct.success:Ct.error,textColor:t?Ct.black:Ct.white}}function D0(t,e,n){return Oi(n==null?void 0:n.type)?B0(t,e,n):ld(t,e,n)}function ld(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}=L0(n),g=f?nl(Si):void 0,y=m||g,k=a.computed(()=>Ci(a.toValue(t))),x=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const H=a.unref(e);return _o(H)||Jt(H)||Ke(H)||Array.isArray(H)?H:Zc(H)}),w=!Ke(x.value)&&Jt(a.toValue(e)),{id:b,value:S,initialValue:v,meta:_,setState:B,errors:A,flags:P}=k0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?C:void 0,schema:w?e:void 0}),$=a.computed(()=>A.value[0]);p&&$0({value:S,prop:p,handleChange:I,shouldValidate:()=>d&&!P.pendingReset});const L=(q,H=!1)=>{_.touched=!0,H&&z()};async function j(q){var H,de;if(y!=null&&y.validateSchema){const{results:ae}=await y.validateSchema(q);return(H=ae[a.toValue(k)])!==null&&H!==void 0?H:{valid:!0,errors:[]}}return x.value?Qc(S.value,x.value,{name:a.toValue(k),label:a.toValue(c),values:(de=y==null?void 0:y.values)!==null&&de!==void 0?de:{},bails:o}):{valid:!0,errors:[]}}const z=rl(async()=>(_.pending=!0,_.validated=!0,j("validated-only")),q=>(P.pendingUnmount[W.id]||(B({errors:q.errors}),_.pending=!1,_.valid=q.valid),q)),D=rl(async()=>j("silent"),q=>(_.valid=q.valid,q));function C(q){return(q==null?void 0:q.mode)==="silent"?D():z()}function I(q,H=!0){const de=Mo(q);ce(de,H)}a.onMounted(()=>{if(i)return z();(!y||!y.validateSchema)&&D()});function R(q){_.touched=q}function ee(q){var H;const de=q&&"value"in q?q.value:v.value;B({value:De(de),initialValue:De(de),touched:(H=q==null?void 0:q.touched)!==null&&H!==void 0?H:!1,errors:(q==null?void 0:q.errors)||[]}),_.pending=!1,_.validated=!1,D()}const te=a.getCurrentInstance();function ce(q,H=!0){S.value=te&&p?i0(q,te.props.modelModifiers):q,(H?z:D)()}function ue(q){B({errors:Array.isArray(q)?q:[q]})}const V=a.computed({get(){return S.value},set(q){ce(q,d)}}),W={id:b,name:k,label:c,value:V,meta:_,errors:A,errorMessage:$,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:ee,handleReset:()=>ee(),validate:C,handleChange:I,handleBlur:L,setState:B,setTouched:R,setErrors:ue,setValue:ce};if(a.provide(jc,W),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(q,H)=>{mt(q,H)||(_.validated?z():D())},{deep:!0}),process.env.NODE_ENV!=="production"&&(W._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:A.value},_),{value:S.value}),Pr,{deep:!0}),y||S0(W)),!y)return W;const K=a.computed(()=>{const q=x.value;return!q||Ke(q)||_o(q)||Jt(q)||Array.isArray(q)?{}:Object.keys(q).reduce((H,de)=>{const ae=d0(q[de]).map(we=>we.__locatorRef).reduce((we,Ne)=>{const Ie=xt(y.values,Ne)||y.values[Ne];return Ie!==void 0&&(we[Ne]=Ie),we},{});return Object.assign(H,ae),H},{})});return a.watch(K,(q,H)=>{if(!Object.keys(q).length)return;!mt(q,H)&&(_.validated?z():D())}),a.onBeforeUnmount(()=>{var q;const H=(q=a.toValue(W.keepValueOnUnmount))!==null&&q!==void 0?q:a.toValue(y.keepValuesOnUnmount),de=a.toValue(k);if(H||!y||P.pendingUnmount[W.id]){y==null||y.removePathState(de,b);return}P.pendingUnmount[W.id]=!0;const ae=y.getPathState(de);if(Array.isArray(ae==null?void 0:ae.id)&&(ae!=null&&ae.multiple)?ae!=null&&ae.id.includes(W.id):(ae==null?void 0:ae.id)===W.id){if(ae!=null&&ae.multiple&&Array.isArray(ae.value)){const Ne=ae.value.findIndex(Ie=>mt(Ie,a.toValue(W.checkedValue)));if(Ne>-1){const Ie=[...ae.value];Ie.splice(Ne,1),y.setFieldValue(de,Ie)}Array.isArray(ae.id)&&ae.id.splice(ae.id.indexOf(W.id),1)}else y.unsetPathValue(a.toValue(k));y.removePathState(de,b)}}),W}function L0(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||{}))?al(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 B0(t,e,n){const r=n!=null&&n.standalone?void 0:nl(Si),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=>mt(p,h))>=0:mt(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),k=Mo(f);let x=(m=a.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(xt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(a.toValue(l.value),x,a.toValue(o))),c(x,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ld(t,e,n))}function $0({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=>{mt(l,al(i,o))||i.emit(s,l)}),a.watch(()=>al(i,o),l=>{if(l===Oo&&e.value===void 0)return;const c=l===Oo?void 0:l;mt(c,e.value)||n(c,r())}))}function al(t,e){if(t)return t.props[e]}const I0=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:()=>ar().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Oo},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:k,setErrors:x}=D0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:P0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(A,P=!0){f(A,P)},b=a.computed(()=>{const{validateOnInput:B,validateOnChange:A,validateOnBlur:P,validateOnModelUpdate:$}=V0(t);function L(C){h(C,P),Ke(e.attrs.onBlur)&&e.attrs.onBlur(C)}function j(C){w(C,B),Ke(e.attrs.onInput)&&e.attrs.onInput(C)}function z(C){w(C,A),Ke(e.attrs.onChange)&&e.attrs.onChange(C)}const D={name:t.name,onBlur:L,onInput:j,onChange:z};return D["onUpdate:modelValue"]=C=>w(C,$),D}),S=a.computed(()=>{const B=Object.assign({},b.value);Oi(e.attrs.type)&&k&&(B.checked=k.value);const A=ad(t,e);return n0(A,e.attrs)&&(B.value=c.value),B}),v=a.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function _(){return{field:S.value,componentField:v.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:B=>w(B,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const B=a.resolveDynamicComponent(ad(t,e)),A=ol(B,e,_);return B?a.h(B,Object.assign(Object.assign({},e.attrs),S.value),A):A}}});function ad(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function V0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=ar();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 P0(t,e){return Oi(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const cr=I0;let R0=0;const Ao=["bails","fieldsCount","id","multiple","type","validate"];function cd(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&&Jt(r)&&Ke(r.cast)?De(r.cast(n)||{}):De(n)}function F0(t){var e;const n=R0++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(cd(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=o0(()=>{f.value=d.value.reduce((T,M)=>(T[Ci(a.toValue(M.path))]=M,T),{})});function p(T,M){const Y=C(T);if(!Y){typeof T=="string"&&(u.value[Ci(T)]=il(M));return}if(typeof T=="string"){const ne=Ci(T);u.value[ne]&&delete u.value[ne]}Y.errors=il(M),Y.valid=!Y.errors.length}function m(T){Et(T).forEach(M=>{p(M,T[M])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const T=d.value.reduce((M,Y)=>(Y.errors.length&&(M[Y.path]=Y.errors),M),{});return Object.assign(Object.assign({},u.value),T)}),y=a.computed(()=>Et(g.value).reduce((T,M)=>{const Y=g.value[M];return Y!=null&&Y.length&&(T[M]=Y[0]),T},{})),k=a.computed(()=>d.value.reduce((T,M)=>(T[M.path]={name:M.path||"",label:M.label||""},T),{})),x=a.computed(()=>d.value.reduce((T,M)=>{var Y;return T[M.path]=(Y=M.bails)!==null&&Y!==void 0?Y:!0,T},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:S,originalInitialValues:v,setInitialValues:_}=j0(d,c,t),B=z0(d,c,v,y),A=a.computed(()=>d.value.reduce((T,M)=>{const Y=xt(c,M.path);return gn(T,M.path,Y),T},{})),P=t==null?void 0:t.validationSchema;function $(T,M){var Y,ne;const fe=a.computed(()=>xt(S.value,a.toValue(T))),N=f.value[a.toValue(T)],X=(M==null?void 0:M.type)==="checkbox"||(M==null?void 0:M.type)==="radio";if(N&&X){N.multiple=!0;const vt=r++;return Array.isArray(N.id)?N.id.push(vt):N.id=[N.id,vt],N.fieldsCount++,N.__flags.pendingUnmount[vt]=!1,N}const ie=a.computed(()=>xt(c,a.toValue(T))),me=a.toValue(T),ye=R.findIndex(vt=>vt===me);ye!==-1&&R.splice(ye,1);const ve=a.computed(()=>{var vt,Ft,Ir,lr;const mn=a.toValue(P);if(Jt(mn))return(Ft=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,a.toValue(T)).required)!==null&&Ft!==void 0?Ft:!1;const So=a.toValue(M==null?void 0:M.schema);return Jt(So)&&(lr=(Ir=So.describe)===null||Ir===void 0?void 0:Ir.call(So).required)!==null&&lr!==void 0?lr:!1}),Ae=r++,je=a.reactive({id:Ae,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((Y=w[me])===null||Y===void 0)&&Y.length),required:ve,initialValue:fe,errors:a.shallowRef([]),bails:(ne=M==null?void 0:M.bails)!==null&&ne!==void 0?ne:!1,label:M==null?void 0:M.label,type:(M==null?void 0:M.type)||"default",value:ie,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:M==null?void 0:M.validate,dirty:a.computed(()=>!mt(a.unref(ie),a.unref(fe)))});return d.value.push(je),f.value[me]=je,h(),y.value[me]&&!w[me]&&a.nextTick(()=>{pt(me,{mode:"silent"})}),a.isRef(T)&&a.watch(T,vt=>{h();const Ft=De(ie.value);f.value[vt]=je,a.nextTick(()=>{gn(c,vt,Ft)})}),je}const L=Gc(se,5),j=Gc(se,5),z=rl(async T=>await(T==="silent"?L():j()),(T,[M])=>{const Y=Et(q.errorBag.value),fe=[...new Set([...Et(T.results),...d.value.map(N=>N.path),...Y])].sort().reduce((N,X)=>{var ie;const me=X,ye=C(me)||I(me),ve=((ie=T.results[me])===null||ie===void 0?void 0:ie.errors)||[],Ae=a.toValue(ye==null?void 0:ye.path)||me,je=H0({errors:ve,valid:!ve.length},N.results[Ae]);return N.results[Ae]=je,je.valid||(N.errors[Ae]=je.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=je.valid,M==="silent"||M==="validated-only"&&!ye.validated||p(ye,je.errors),N):(p(Ae,ve),N)},{valid:T.valid,results:{},errors:{}});return T.values&&(fe.values=T.values),Et(fe.results).forEach(N=>{var X;const ie=C(N);ie&&M!=="silent"&&(M==="validated-only"&&!ie.validated||p(ie,(X=fe.results[N])===null||X===void 0?void 0:X.errors))}),fe});function D(T){d.value.forEach(T)}function C(T){const M=typeof T=="string"?Ci(T):T;return typeof M=="string"?f.value[M]:M}function I(T){return d.value.filter(Y=>T.startsWith(Y.path)).reduce((Y,ne)=>Y?ne.path.length>Y.path.length?ne:Y:ne,void 0)}let R=[],ee;function te(T){return R.push(T),ee||(ee=a.nextTick(()=>{[...R].sort().reverse().forEach(Y=>{qc(c,Y)}),R=[],ee=null})),ee}function ce(T){return function(Y,ne){return function(N){return N instanceof Event&&(N.preventDefault(),N.stopPropagation()),D(X=>X.touched=!0),i.value=!0,s.value++,at().then(X=>{const ie=De(c);if(X.valid&&typeof Y=="function"){const me=De(A.value);let ye=T?me:ie;return X.values&&(ye=X.values),Y(ye,{evt:N,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Ne,setValues:ae,setFieldValue:H,resetForm:lt,resetField:At})}!X.valid&&typeof ne=="function"&&ne({values:ie,evt:N,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const V=ce(!1);V.withControlled=ce(!0);function W(T,M){const Y=d.value.findIndex(fe=>fe.path===T&&(Array.isArray(fe.id)?fe.id.includes(M):fe.id===M)),ne=d.value[Y];if(!(Y===-1||!ne)){if(a.nextTick(()=>{pt(T,{mode:"silent",warn:!1})}),ne.multiple&&ne.fieldsCount&&ne.fieldsCount--,Array.isArray(ne.id)){const fe=ne.id.indexOf(M);fe>=0&&ne.id.splice(fe,1),delete ne.__flags.pendingUnmount[M]}(!ne.multiple||ne.fieldsCount<=0)&&(d.value.splice(Y,1),E(T),h(),delete f.value[T])}}function K(T){Et(f.value).forEach(M=>{M.startsWith(T)&&delete f.value[M]}),d.value=d.value.filter(M=>!M.path.startsWith(T)),a.nextTick(()=>{h()})}const q={formId:n,values:c,controlledValues:A,errorBag:g,errors:y,schema:P,submitCount:s,meta:B,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:a.unref(P)?z:void 0,validate:at,setFieldError:p,validateField:pt,setFieldValue:H,setValues:ae,setErrors:m,setFieldTouched:Ne,setTouched:Ee,resetForm:lt,resetField:At,handleSubmit:V,useFieldModel:_e,defineInputBinds:F,defineComponentBinds:Z,defineField:Oe,stageInitialValue:O,unsetInitialValue:E,setFieldInitialValue:U,createPathState:$,getPathState:C,unsetPathValue:te,removePathState:W,initialValues:S,getAllPathStates:()=>d.value,destroyPath:K,isFieldTouched:Ie,isFieldDirty:tt,isFieldValid:Q};function H(T,M,Y=!0){const ne=De(M),fe=typeof T=="string"?T:T.path;C(fe)||$(fe),gn(c,fe,ne),Y&&pt(fe)}function de(T,M=!0){Et(c).forEach(Y=>{delete c[Y]}),Et(T).forEach(Y=>{H(Y,T[Y],!1)}),M&&at()}function ae(T,M=!0){Ei(c,T),l.forEach(Y=>Y&&Y.reset()),M&&at()}function we(T,M){const Y=C(a.toValue(T))||$(T);return a.computed({get(){return Y.value},set(ne){var fe;const N=a.toValue(T);H(N,ne,(fe=a.toValue(M))!==null&&fe!==void 0?fe:!1)}})}function Ne(T,M){const Y=C(T);Y&&(Y.touched=M)}function Ie(T){const M=C(T);return M?M.touched:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.touched)}function tt(T){const M=C(T);return M?M.dirty:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.dirty)}function Q(T){const M=C(T);return M?M.valid:d.value.filter(Y=>Y.path.startsWith(T)).every(Y=>Y.valid)}function Ee(T){if(typeof T=="boolean"){D(M=>{M.touched=T});return}Et(T).forEach(M=>{Ne(M,!!T[M])})}function At(T,M){var Y;const ne=M&&"value"in M?M.value:xt(S.value,T),fe=C(T);fe&&(fe.__flags.pendingReset=!0),U(T,De(ne),!0),H(T,ne,!1),Ne(T,(Y=M==null?void 0:M.touched)!==null&&Y!==void 0?Y:!1),p(T,(M==null?void 0:M.errors)||[]),a.nextTick(()=>{fe&&(fe.__flags.pendingReset=!1)})}function lt(T,M){let Y=De(T!=null&&T.values?T.values:v.value);Y=M!=null&&M.force?Y:Ei(v.value,Y),Y=Jt(P)&&Ke(P.cast)?P.cast(Y):Y,_(Y),D(ne=>{var fe;ne.__flags.pendingReset=!0,ne.validated=!1,ne.touched=((fe=T==null?void 0:T.touched)===null||fe===void 0?void 0:fe[ne.path])||!1,H(ne.path,xt(Y,ne.path),!1),p(ne.path,void 0)}),M!=null&&M.force?de(Y,!1):ae(Y,!1),m((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,a.nextTick(()=>{at({mode:"silent"}),D(ne=>{ne.__flags.pendingReset=!1})})}async function at(T){const M=(T==null?void 0:T.mode)||"force";if(M==="force"&&D(N=>N.validated=!0),q.validateSchema)return q.validateSchema(M);o.value=!0;const Y=await Promise.all(d.value.map(N=>N.validate?N.validate(T).then(X=>({key:N.path,valid:X.valid,errors:X.errors})):Promise.resolve({key:N.path,valid:!0,errors:[]})));o.value=!1;const ne={},fe={};for(const N of Y)ne[N.key]={valid:N.valid,errors:N.errors},N.errors.length&&(fe[N.key]=N.errors[0]);return{valid:Y.every(N=>N.valid),results:ne,errors:fe}}async function pt(T,M){var Y;const ne=C(T);if(ne&&(M==null?void 0:M.mode)!=="silent"&&(ne.validated=!0),P){const{results:N}=await z((M==null?void 0:M.mode)||"validated-only");return N[T]||{errors:[],valid:!0}}return ne!=null&&ne.validate?ne.validate(M):(!ne&&((Y=M==null?void 0:M.warn)!==null&&Y!==void 0?Y:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${T} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(T){qc(S.value,T)}function O(T,M,Y=!1){U(T,M),gn(c,T,M),Y&&!(t!=null&&t.initialValues)&&gn(v.value,T,De(M))}function U(T,M,Y=!1){gn(S.value,T,De(M)),Y&&gn(v.value,T,De(M))}async function se(){const T=a.unref(P);if(!T)return{valid:!0,results:{},errors:{}};o.value=!0;const M=_o(T)||Jt(T)?await y0(T,c):await b0(T,c,{names:k.value,bailsMap:x.value});return o.value=!1,M}const Me=V((T,{evt:M})=>{Wc(M)&&M.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){at();return}q.validateSchema&&q.validateSchema("silent")}),a.isRef(P)&&a.watch(P,()=>{var T;(T=q.validateSchema)===null||T===void 0||T.call(q,"validated-only")}),a.provide(Si,q),process.env.NODE_ENV!=="production"&&(C0(q),a.watch(()=>Object.assign(Object.assign({errors:g.value},B.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Pr,{deep:!0}));function Oe(T,M){const Y=Ke(M)||M==null?void 0:M.label,ne=C(a.toValue(T))||$(T,{label:Y}),fe=()=>Ke(M)?M(No(ne,Ao)):M||{};function N(){var ve;ne.touched=!0,((ve=fe().validateOnBlur)!==null&&ve!==void 0?ve:ar().validateOnBlur)&&pt(ne.path)}function X(){var ve;((ve=fe().validateOnInput)!==null&&ve!==void 0?ve:ar().validateOnInput)&&a.nextTick(()=>{pt(ne.path)})}function ie(){var ve;((ve=fe().validateOnChange)!==null&&ve!==void 0?ve:ar().validateOnChange)&&a.nextTick(()=>{pt(ne.path)})}const me=a.computed(()=>{const ve={onChange:ie,onInput:X,onBlur:N};return Ke(M)?Object.assign(Object.assign({},ve),M(No(ne,Ao)).props||{}):M!=null&&M.props?Object.assign(Object.assign({},ve),M.props(No(ne,Ao))):ve});return[we(T,()=>{var ve,Ae,je;return(je=(ve=fe().validateOnModelUpdate)!==null&&ve!==void 0?ve:(Ae=ar())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&je!==void 0?je:!0}),me]}function _e(T){return Array.isArray(T)?T.map(M=>we(M,!0)):we(T)}function F(T,M){const[Y,ne]=Oe(T,M);function fe(){ne.value.onBlur()}function N(ie){const me=Mo(ie);H(a.toValue(T),me,!1),ne.value.onInput()}function X(ie){const me=Mo(ie);H(a.toValue(T),me,!1),ne.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},ne.value),{onBlur:fe,onInput:N,onChange:X,value:Y.value}))}function Z(T,M){const[Y,ne]=Oe(T,M),fe=C(a.toValue(T));function N(X){Y.value=X}return a.computed(()=>{const X=Ke(M)?M(No(fe,Ao)):M||{};return Object.assign({[X.model||"modelValue"]:Y.value,[`onUpdate:${X.model||"modelValue"}`]:N},ne.value)})}return Object.assign(Object.assign({},q),{values:a.readonly(c),handleReset:()=>lt(),submitForm:Me})}function z0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!mt(e,a.unref(n)));function s(){const c=t.value;return Et(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&&!Et(r.value).length,dirty:o.value}))}function j0(t,e,n){const r=cd(n),i=a.ref(r),o=a.ref(De(r));function s(l,c=!1){i.value=Ei(De(i.value)||{},De(l)),o.value=Ei(De(o.value)||{},De(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=xt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function H0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const W0=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:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetField:_}=F0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),B=y((C,{evt:I})=>{Wc(I)&&I.target.submit()},t.onInvalidSubmit),A=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):B;function P(C){Qs(C)&&C.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function $(C,I){return y(typeof C=="function"&&!I?C:I,t.onInvalidSubmit)(C)}function L(){return De(s)}function j(){return De(l.value)}function z(){return De(i.value)}function D(){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:B,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetForm:g,resetField:_,getValues:L,getMeta:j,getErrors:z}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:S,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:_,getValues:L,getMeta:j,getErrors:z,values:s,meta:l,errors:i}),function(){const I=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,R=ol(I,e,D);if(!I)return R;const ee=I==="form"?{novalidate:!0}:{};return a.h(I,Object.assign(Object.assign(Object.assign({},ee),e.attrs),{onSubmit:A,onReset:P}),R)}}}),U0=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Si,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=ol(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 Y0(t){const e=nl(Si),n=t?void 0:a.inject(jc);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}Gt("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),Gt("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"}),Gt("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"),Gt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Gt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Gt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Gt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Gt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Gt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Gt("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"}),Gt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},q0={},K0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},G0=[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 J0(t,e){return a.openBlock(),a.createElementBlock("svg",K0,G0)}const Z0=be(q0,[["render",J0]]),X0={},Q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ey=[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 ty(t,e){return a.openBlock(),a.createElementBlock("svg",Q0,ey)}const ny=be(X0,[["render",ty]]),ry={class:"relative"},Fr=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",ry,[a.createVNode(Z0,{class:"absolute opacity-25"}),a.createVNode(ny,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let he={theme:"wpic-tools",popoverTarget:"body"};const iy=["is","type","disabled"],oy={key:0,class:"absolute inset-0 flex justify-center items-center"},sy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ly=["onClick"],Ni=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,highlightDisabled: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=k=>{r.value&&!r.value.contains(k.target)&&n.value&&!n.value.contains(k.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":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-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-iron-100 text-iron-800 disabled:text-iron-800/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-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-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(k,x)=>{var w;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var S;return(S=t.actions)!=null&&S.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,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${l[a.unref(he).theme]}`]:!0,[`${u[a.unref(he).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(he).theme]}`]:t.secondary,[`${p[a.unref(he).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(he).theme]}`]:t.primary&&t.plain,[`${y[a.unref(he).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(he).theme]}`]:t.colorless,[`${h[a.unref(he).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(he).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(he).theme]}`]:t.destructive&&t.colorless,"text-violet-500! dark:!text-violet-500/75":t.highlightDisabled&&t.disabled,"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",oy,[a.createVNode(Fr,{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(k.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.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",sy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,b=>(a.openBlock(),a.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(b.label),9,ly))),256))])],512)):a.createCommentVNode("",!0)],10,iy)}}}),ay=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(he).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),cy={name:"WpicInputGroup"},dy={class:"wpic-input-group flex w-full"};function uy(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",dy,[a.renderSlot(t.$slots,"default")])}const fy=be(cy,[["render",uy]]),hy=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(W0),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Mi=Math.min,zr=Math.max,Do=Math.round,Bn=t=>({x:t,y:t}),py={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function cl(t,e,n){return zr(t,Mi(e,n))}function Ai(t,e){return typeof t=="function"?t(e):t}function dr(t){return t.split("-")[0]}function Di(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function dl(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(dr(t))?"y":"x"}function ul(t){return dd(Lo(t))}function gy(t,e,n){n===void 0&&(n=!1);const r=Di(t),i=ul(t),o=dl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Bo(s)),[s,Bo(s)]}function yy(t){const e=Bo(t);return[fl(t),e,fl(e)]}function fl(t){return t.replace(/start|end/g,e=>my[e])}function by(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 ky(t,e,n,r){const i=Di(t);let o=by(dr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(fl)))),o}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>py[e])}function wy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?wy(t):{top:t,right:t,bottom:t,left:t}}function $o(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 fd(t,e,n){let{reference:r,floating:i}=t;const o=Lo(e),s=ul(e),l=dl(s),c=dr(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(Di(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const vy=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}=fd(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:k}=l[g],{x,y:w,data:b,reset:S}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=w??f,p={...p,[y]:{...p[y],...b}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:f}=fd(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function hd(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}=Ai(e,t),m=ud(p),y=l[h?f==="floating"?"reference":"floating":f],k=$o(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})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},S=$o(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-S.top+m.top)/b.y,bottom:(S.bottom-k.bottom+m.bottom)/b.y,left:(k.left-S.left+m.left)/b.x,right:(S.right-k.right+m.right)/b.x}}const xy=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}=Ai(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=ul(i),m=dl(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],S=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let _=v?v[w]:0;(!_||!await(s.isElement==null?void 0:s.isElement(v)))&&(_=l.floating[w]||o.floating[m]);const B=b/2-S/2,A=_/2-g[m]/2-1,P=Mi(f[k],A),$=Mi(f[x],A),L=P,j=_-g[m]-$,z=_/2-g[m]/2+B,D=cl(L,z,j),C=!c.arrow&&Di(i)!=null&&z!==D&&o.reference[m]/2-(z<L?P:$)-g[m]/2<0,I=C?z<L?z-L:z-j:0;return{[p]:h[p]+I,data:{[p]:D,centerOffset:z-D-I,...C&&{alignmentOffset:I}},reset:C}}}),Ey=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}=Ai(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=dr(i),x=dr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[Bo(l)]:yy(l));!h&&m!=="none"&&b.push(...ky(l,g,m,w));const S=[l,...b],v=await hd(e,y),_=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&_.push(v[k]),f){const L=gy(i,s,w);_.push(v[L[0]],v[L[1]])}if(B=[...B,{placement:i,overflows:_}],!_.every(L=>L<=0)){var A,P;const L=(((A=o.flip)==null?void 0:A.index)||0)+1,j=S[L];if(j)return{data:{index:L,overflows:B},reset:{placement:j}};let z=(P=B.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:P.placement;if(!z)switch(p){case"bestFit":{var $;const D=($=B.map(C=>[C.placement,C.overflows.filter(I=>I>0).reduce((I,R)=>I+R,0)]).sort((C,I)=>C[1]-I[1])[0])==null?void 0:$[0];D&&(z=D);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};async function Cy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=dr(n),l=Di(n),c=Lo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ai(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 Sy=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 Cy(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}}}}},Oy=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:k,y:x}=y;return{x:k,y:x}}},...c}=Ai(t,e),d={x:n,y:r},u=await hd(e,c),f=Lo(dr(i)),h=dd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],w=p-u[k];p=cl(x,p,w)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],w=m-u[k];m=cl(x,m,w)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function ur(t){return hl(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $n(t){var e;return(e=(hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hl(t){return t instanceof Node||t instanceof Dt(t).Node}function rn(t){return t instanceof Element||t instanceof Dt(t).Element}function on(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Li(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function _y(t){return["table","td","th"].includes(ur(t))}function pl(t){const e=ml(),n=Zt(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 Ty(t){let e=In(t);for(;on(e)&&!jr(e);){if(pl(e))return e;e=In(e)}return null}function ml(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(ur(t))}function Zt(t){return Dt(t).getComputedStyle(t)}function Io(t){return rn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function In(t){if(ur(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||$n(t);return pd(e)?e.host:e}function md(t){const e=In(t);return jr(e)?t.ownerDocument?t.ownerDocument.body:t.body:on(e)&&Li(e)?e:md(e)}function gl(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=md(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);return o?e.concat(s,s.visualViewport||[],Li(i)?i:[],s.frameElement&&n?gl(s.frameElement):[]):e.concat(i,gl(i,[],n))}function gd(t){const e=Zt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=on(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Do(n)!==o||Do(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function yd(t){return rn(t)?t:t.contextElement}function Hr(t){const e=yd(t);if(!on(e))return Bn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Do(n.width):n.width)/r,l=(o?Do(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ny=Bn(0);function bd(t){const e=Dt(t);return!ml()||!e.visualViewport?Ny:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function My(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Bi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Bn(1);e&&(r?rn(r)&&(s=Hr(r)):s=Hr(t));const l=My(o,n,r)?bd(o):Bn(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=Dt(o),p=r&&rn(r)?Dt(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Hr(g),k=g.getBoundingClientRect(),x=Zt(g),w=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=b,m=Dt(g),g=m.frameElement}}return $o({width:u,height:f,x:c,y:d})}const Ay=[":popover-open",":modal"];function yl(t){return Ay.some(e=>{try{return t.matches(e)}catch{return!1}})}function Dy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=$n(r),l=e?yl(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Bn(1);const u=Bn(0),f=on(r);if((f||!f&&!o)&&((ur(r)!=="body"||Li(s))&&(c=Io(r)),on(r))){const h=Bi(r);d=Hr(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 Ly(t){return Array.from(t.getClientRects())}function kd(t){return Bi($n(t)).left+Io(t).scrollLeft}function By(t){const e=$n(t),n=Io(t),r=t.ownerDocument.body,i=zr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=zr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const l=-n.scrollTop;return Zt(r).direction==="rtl"&&(s+=zr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function $y(t,e){const n=Dt(t),r=$n(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=ml();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function Iy(t,e){const n=Bi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=on(t)?Hr(t):Bn(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 wd(t,e,n){let r;if(e==="viewport")r=$y(t,n);else if(e==="document")r=By($n(t));else if(rn(e))r=Iy(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return $o(r)}function vd(t,e){const n=In(t);return n===e||!rn(n)||jr(n)?!1:Zt(n).position==="fixed"||vd(n,e)}function Vy(t,e){const n=e.get(t);if(n)return n;let r=gl(t,[],!1).filter(l=>rn(l)&&ur(l)!=="body"),i=null;const o=Zt(t).position==="fixed";let s=o?In(t):t;for(;rn(s)&&!jr(s);){const l=Zt(s),c=pl(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Li(s)&&!c&&vd(t,s))?r=r.filter(u=>u!==s):i=l,s=In(s)}return e.set(t,r),r}function Py(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?yl(e)?[]:Vy(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=wd(e,u,i);return d.top=zr(f.top,d.top),d.right=Mi(f.right,d.right),d.bottom=Mi(f.bottom,d.bottom),d.left=zr(f.left,d.left),d},wd(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ry(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Fy(t,e,n){const r=on(e),i=$n(e),o=n==="fixed",s=Bi(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Bn(0);if(r||!r&&!o)if((ur(e)!=="body"||Li(i))&&(l=Io(e)),r){const f=Bi(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=kd(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 bl(t){return Zt(t).position==="static"}function xd(t,e){return!on(t)||Zt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=Dt(t);if(yl(t))return n;if(!on(t)){let i=In(t);for(;i&&!jr(i);){if(rn(i)&&!bl(i))return i;i=In(i)}return n}let r=xd(t,e);for(;r&&_y(r)&&bl(r);)r=xd(r,e);return r&&jr(r)&&bl(r)&&!pl(r)?n:r||Ty(t)||n}const zy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Fy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jy(t){return Zt(t).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:$n,getClippingRect:Py,getOffsetParent:Ed,getElementRects:zy,getClientRects:Ly,getDimensions:Ry,getScale:Hr,isElement:rn,isRTL:jy},Cd=Sy,Sd=Oy,Od=Ey,Wy=xy,_d=(t,e,n)=>{const r=new Map,i={platform:Hy,...n},o={...i.platform,_c:r};return vy(t,e,{...i,platform:o})};function Uy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Yy(t){if(Uy(t)){const e=t.$el;return hl(e)&&ur(e)==="#comment"?null:e}return t}function qy(t){return{name:"arrow",options:t,fn(e){const n=Yy(a.unref(t.element));return n==null?{}:Wy({element:n,padding:t.padding}).fn(e)}}}const Ky={},Gy={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Jy=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Zy(t,e){return a.openBlock(),a.createElementBlock("svg",Gy,Jy)}const $i=be(Ky,[["render",Zy]]);let Vo;const Xy=new Uint8Array(16);function Qy(){if(!Vo&&(Vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vo(Xy)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function e1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Td={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function kl(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||Qy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,e1(r)}let t1={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 fr=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"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=kl(),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(k){if(d.value)u();else{if(o.noCloseClasses.some(x=>k.target.closest(`.${x}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const k=await _d(l.value,c.value,{placement:o.placement,middleware:[Od(),Sd(),Cd(o.offset)]});c.value.style.left=`${k.x}px`,c.value.style.top=`${k.y}px`}const m=k=>{c.value&&!c.value.contains(k.target)&&l.value&&!l.value.contains(k.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.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}),(k,x)=>(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:x[0]||(x[0]=a.withModifiers(w=>f(w),["stop"]))},[a.renderSlot(k.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(he).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(he).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
|
|
6
6
|
* shared v9.14.4
|
|
7
7
|
* (c) 2025 kazuya kawaguchi
|
|
8
8
|
* Released under the MIT License.
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
* (c) 2025 kazuya kawaguchi
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/function h1(t,e,n){return{line:t,column:e,offset:n}}function jo(t,e,n){return{start:t,end:e}}const p1=/\{([0-9a-zA-Z]+)\}/g;function Id(t,...e){return e.length===1&&m1(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(p1,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const Vd=Object.assign,Pd=t=>typeof t=="string",m1=t=>t!==null&&typeof t=="object";function Rd(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}const Ho={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},g1={[Ho.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function y1(t,e,...n){const r=Id(g1[t],...n||[]),i={message:String(r),code:t};return e&&(i.location=e),i}const ge={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},b1={[ge.EXPECTED_TOKEN]:"Expected token: '{0}'",[ge.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[ge.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[ge.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[ge.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[ge.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[ge.EMPTY_PLACEHOLDER]:"Empty placeholder",[ge.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[ge.INVALID_LINKED_FORMAT]:"Invalid linked format",[ge.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[ge.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[ge.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[ge.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[ge.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[ge.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function Ur(t,e,n={}){const{domain:r,messages:i,args:o}=n,s=Id((i||b1)[t]||"",...o||[]),l=new SyntaxError(String(s));return l.code=t,e&&(l.location=e),l.domain=r,l}function k1(t){throw t}const w1=/<\/?[\w\s="/.':;#-\/]+>/,v1=t=>w1.test(t),xn=" ",x1="\r",gt=`
|
|
15
|
-
`,E1="\u2028",C1="\u2029";function S1(t){const e=t;let n=0,r=1,i=1,o=0;const s=O=>e[O]===x1&&e[O+1]===gt,l=O=>e[O]===gt,c=O=>e[O]===C1,d=O=>e[O]===E1,u=O=>s(O)||l(O)||c(O)||d(O),f=()=>n,h=()=>r,p=()=>i,m=()=>o,g=O=>s(O)||c(O)||d(O)?gt:e[O],y=()=>g(n),k=()=>g(n+o);function x(){return o=0,u(n)&&(r++,i=0),s(n)&&n++,n++,i++,e[n]}function w(){return s(n+o)&&o++,o++,e[n+o]}function b(){n=0,r=1,i=1,o=0}function S(O=0){o=O}function v(){const O=n+o;for(;O!==n;)x();o=0}return{index:f,line:h,column:p,peekOffset:m,charAt:g,currentChar:y,currentPeek:k,next:x,peek:w,reset:b,resetPeek:S,skipToPeek:v}}const Vn=void 0,_1=".",Fd="'",O1="tokenizer";function T1(t,e={}){const n=e.location!==!1,r=S1(t),i=()=>r.index(),o=()=>h1(r.line(),r.column(),r.index()),s=o(),l=i(),c={currentType:14,offset:l,startLoc:s,endLoc:s,lastType:14,lastOffset:l,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=e;function f(E,_,U,...se){const Me=d();if(_.column+=U,_.offset+=U,u){const _e=n?jo(Me.startLoc,_):null,Oe=Ur(E,_e,{domain:O1,args:se});u(Oe)}}function h(E,_,U){E.endLoc=o(),E.currentType=_;const se={type:_};return n&&(se.loc=jo(E.startLoc,E.endLoc)),U!=null&&(se.value=U),se}const p=E=>h(E,14);function m(E,_){return E.currentChar()===_?(E.next(),_):(f(ge.EXPECTED_TOKEN,o(),0,_),"")}function g(E){let _="";for(;E.currentPeek()===xn||E.currentPeek()===gt;)_+=E.currentPeek(),E.peek();return _}function y(E){const _=g(E);return E.skipToPeek(),_}function k(E){if(E===Vn)return!1;const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_===95}function x(E){if(E===Vn)return!1;const _=E.charCodeAt(0);return _>=48&&_<=57}function w(E,_){const{currentType:U}=_;if(U!==2)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function b(E,_){const{currentType:U}=_;if(U!==2)return!1;g(E);const se=E.currentPeek()==="-"?E.peek():E.currentPeek(),Me=x(se);return E.resetPeek(),Me}function S(E,_){const{currentType:U}=_;if(U!==2)return!1;g(E);const se=E.currentPeek()===Fd;return E.resetPeek(),se}function v(E,_){const{currentType:U}=_;if(U!==8)return!1;g(E);const se=E.currentPeek()===".";return E.resetPeek(),se}function O(E,_){const{currentType:U}=_;if(U!==9)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function B(E,_){const{currentType:U}=_;if(!(U===8||U===12))return!1;g(E);const se=E.currentPeek()===":";return E.resetPeek(),se}function A(E,_){const{currentType:U}=_;if(U!==10)return!1;const se=()=>{const _e=E.currentPeek();return _e==="{"?k(E.peek()):_e==="@"||_e==="%"||_e==="|"||_e===":"||_e==="."||_e===xn||!_e?!1:_e===gt?(E.peek(),se()):L(E,!1)},Me=se();return E.resetPeek(),Me}function P(E){g(E);const _=E.currentPeek()==="|";return E.resetPeek(),_}function $(E){const _=g(E),U=E.currentPeek()==="%"&&E.peek()==="{";return E.resetPeek(),{isModulo:U,hasSpace:_.length>0}}function L(E,_=!0){const U=(Me=!1,_e="",Oe=!1)=>{const F=E.currentPeek();return F==="{"?_e==="%"?!1:Me:F==="@"||!F?_e==="%"?!0:Me:F==="%"?(E.peek(),U(Me,"%",!0)):F==="|"?_e==="%"||Oe?!0:!(_e===xn||_e===gt):F===xn?(E.peek(),U(!0,xn,Oe)):F===gt?(E.peek(),U(!0,gt,Oe)):!0},se=U();return _&&E.resetPeek(),se}function j(E,_){const U=E.currentChar();return U===Vn?Vn:_(U)?(E.next(),U):null}function z(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36}function D(E){return j(E,z)}function C(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36||_===45}function I(E){return j(E,C)}function R(E){const _=E.charCodeAt(0);return _>=48&&_<=57}function ee(E){return j(E,R)}function te(E){const _=E.charCodeAt(0);return _>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102}function ce(E){return j(E,te)}function ue(E){let _="",U="";for(;_=ee(E);)U+=_;return U}function V(E){y(E);const _=E.currentChar();return _!=="%"&&f(ge.EXPECTED_TOKEN,o(),0,_),E.next(),"%"}function W(E){let _="";for(;;){const U=E.currentChar();if(U==="{"||U==="}"||U==="@"||U==="|"||!U)break;if(U==="%")if(L(E))_+=U,E.next();else break;else if(U===xn||U===gt)if(L(E))_+=U,E.next();else{if(P(E))break;_+=U,E.next()}else _+=U,E.next()}return _}function K(E){y(E);let _="",U="";for(;_=I(E);)U+=_;return E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U}function q(E){y(E);let _="";return E.currentChar()==="-"?(E.next(),_+=`-${ue(E)}`):_+=ue(E),E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_}function H(E){return E!==Fd&&E!==gt}function de(E){y(E),m(E,"'");let _="",U="";for(;_=j(E,H);)_==="\\"?U+=ae(E):U+=_;const se=E.currentChar();return se===gt||se===Vn?(f(ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),se===gt&&(E.next(),m(E,"'")),U):(m(E,"'"),U)}function ae(E){const _=E.currentChar();switch(_){case"\\":case"'":return E.next(),`\\${_}`;case"u":return we(E,_,4);case"U":return we(E,_,6);default:return f(ge.UNKNOWN_ESCAPE_SEQUENCE,o(),0,_),""}}function we(E,_,U){m(E,_);let se="";for(let Me=0;Me<U;Me++){const _e=ce(E);if(!_e){f(ge.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${_}${se}${E.currentChar()}`);break}se+=_e}return`\\${_}${se}`}function Ne(E){return E!=="{"&&E!=="}"&&E!==xn&&E!==gt}function Ie(E){y(E);let _="",U="";for(;_=j(E,Ne);)U+=_;return U}function tt(E){let _="",U="";for(;_=D(E);)U+=_;return U}function Q(E){const _=U=>{const se=E.currentChar();return se==="{"||se==="%"||se==="@"||se==="|"||se==="("||se===")"||!se||se===xn?U:(U+=se,E.next(),_(U))};return _("")}function Ee(E){y(E);const _=m(E,"|");return y(E),_}function At(E,_){let U=null;switch(E.currentChar()){case"{":return _.braceNest>=1&&f(ge.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),E.next(),U=h(_,2,"{"),y(E),_.braceNest++,U;case"}":return _.braceNest>0&&_.currentType===2&&f(ge.EMPTY_PLACEHOLDER,o(),0),E.next(),U=h(_,3,"}"),_.braceNest--,_.braceNest>0&&y(E),_.inLinked&&_.braceNest===0&&(_.inLinked=!1),U;case"@":return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U=lt(E,_)||p(_),_.braceNest=0,U;default:{let Me=!0,_e=!0,Oe=!0;if(P(E))return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,U;if(_.braceNest>0&&(_.currentType===5||_.currentType===6||_.currentType===7))return f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_.braceNest=0,at(E,_);if(Me=w(E,_))return U=h(_,5,K(E)),y(E),U;if(_e=b(E,_))return U=h(_,6,q(E)),y(E),U;if(Oe=S(E,_))return U=h(_,7,de(E)),y(E),U;if(!Me&&!_e&&!Oe)return U=h(_,13,Ie(E)),f(ge.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,U.value),y(E),U;break}}return U}function lt(E,_){const{currentType:U}=_;let se=null;const Me=E.currentChar();switch((U===8||U===9||U===12||U===10)&&(Me===gt||Me===xn)&&f(ge.INVALID_LINKED_FORMAT,o(),0),Me){case"@":return E.next(),se=h(_,8,"@"),_.inLinked=!0,se;case".":return y(E),E.next(),h(_,9,".");case":":return y(E),E.next(),h(_,10,":");default:return P(E)?(se=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,se):v(E,_)||B(E,_)?(y(E),lt(E,_)):O(E,_)?(y(E),h(_,12,tt(E))):A(E,_)?(y(E),Me==="{"?At(E,_)||se:h(_,11,Q(E))):(U===8&&f(ge.INVALID_LINKED_FORMAT,o(),0),_.braceNest=0,_.inLinked=!1,at(E,_))}}function at(E,_){let U={type:14};if(_.braceNest>0)return At(E,_)||p(_);if(_.inLinked)return lt(E,_)||p(_);switch(E.currentChar()){case"{":return At(E,_)||p(_);case"}":return f(ge.UNBALANCED_CLOSING_BRACE,o(),0),E.next(),h(_,3,"}");case"@":return lt(E,_)||p(_);default:{if(P(E))return U=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,U;const{isModulo:Me,hasSpace:_e}=$(E);if(Me)return _e?h(_,0,W(E)):h(_,4,V(E));if(L(E))return h(_,0,W(E));break}}return U}function pt(){const{currentType:E,offset:_,startLoc:U,endLoc:se}=c;return c.lastType=E,c.lastOffset=_,c.lastStartLoc=U,c.lastEndLoc=se,c.offset=i(),c.startLoc=o(),r.currentChar()===Vn?h(c,14):at(r,c)}return{nextToken:pt,currentOffset:i,currentPosition:o,context:d}}const N1="parser",M1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function A1(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function D1(t={}){const e=t.location!==!1,{onError:n,onWarn:r}=t;function i(w,b,S,v,...O){const B=w.currentPosition();if(B.offset+=v,B.column+=v,n){const A=e?jo(S,B):null,P=Ur(b,A,{domain:N1,args:O});n(P)}}function o(w,b,S,v,...O){const B=w.currentPosition();if(B.offset+=v,B.column+=v,r){const A=e?jo(S,B):null;r(y1(b,A,O))}}function s(w,b,S){const v={type:w};return e&&(v.start=b,v.end=b,v.loc={start:S,end:S}),v}function l(w,b,S,v){e&&(w.end=b,w.loc&&(w.loc.end=S))}function c(w,b){const S=w.context(),v=s(3,S.offset,S.startLoc);return v.value=b,l(v,w.currentOffset(),w.currentPosition()),v}function d(w,b){const S=w.context(),{lastOffset:v,lastStartLoc:O}=S,B=s(5,v,O);return B.index=parseInt(b,10),w.nextToken(),l(B,w.currentOffset(),w.currentPosition()),B}function u(w,b,S){const v=w.context(),{lastOffset:O,lastStartLoc:B}=v,A=s(4,O,B);return A.key=b,S===!0&&(A.modulo=!0),w.nextToken(),l(A,w.currentOffset(),w.currentPosition()),A}function f(w,b){const S=w.context(),{lastOffset:v,lastStartLoc:O}=S,B=s(9,v,O);return B.value=b.replace(M1,A1),w.nextToken(),l(B,w.currentOffset(),w.currentPosition()),B}function h(w){const b=w.nextToken(),S=w.context(),{lastOffset:v,lastStartLoc:O}=S,B=s(8,v,O);return b.type!==12?(i(w,ge.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.lastStartLoc,0),B.value="",l(B,v,O),{nextConsumeToken:b,node:B}):(b.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Qt(b)),B.value=b.value||"",l(B,w.currentOffset(),w.currentPosition()),{node:B})}function p(w,b){const S=w.context(),v=s(7,S.offset,S.startLoc);return v.value=b,l(v,w.currentOffset(),w.currentPosition()),v}function m(w){const b=w.context(),S=s(6,b.offset,b.startLoc);let v=w.nextToken();if(v.type===9){const O=h(w);S.modifier=O.node,v=O.nextConsumeToken||w.nextToken()}switch(v.type!==10&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),v=w.nextToken(),v.type===2&&(v=w.nextToken()),v.type){case 11:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=p(w,v.value||"");break;case 5:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=u(w,v.value||"");break;case 6:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=d(w,v.value||"");break;case 7:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=f(w,v.value||"");break;default:{i(w,ge.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const O=w.context(),B=s(7,O.offset,O.startLoc);return B.value="",l(B,O.offset,O.startLoc),S.key=B,l(S,O.offset,O.startLoc),{nextConsumeToken:v,node:S}}}return l(S,w.currentOffset(),w.currentPosition()),{node:S}}function g(w){const b=w.context(),S=b.currentType===1?w.currentOffset():b.offset,v=b.currentType===1?b.endLoc:b.startLoc,O=s(2,S,v);O.items=[];let B=null,A=null;do{const L=B||w.nextToken();switch(B=null,L.type){case 0:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),O.items.push(c(w,L.value||""));break;case 6:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),O.items.push(d(w,L.value||""));break;case 4:A=!0;break;case 5:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),O.items.push(u(w,L.value||"",!!A)),A&&(o(w,Ho.USE_MODULO_SYNTAX,b.lastStartLoc,0,Qt(L)),A=null);break;case 7:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),O.items.push(f(w,L.value||""));break;case 8:{const j=m(w);O.items.push(j.node),B=j.nextConsumeToken||null;break}}}while(b.currentType!==14&&b.currentType!==1);const P=b.currentType===1?b.lastOffset:w.currentOffset(),$=b.currentType===1?b.lastEndLoc:w.currentPosition();return l(O,P,$),O}function y(w,b,S,v){const O=w.context();let B=v.items.length===0;const A=s(1,b,S);A.cases=[],A.cases.push(v);do{const P=g(w);B||(B=P.items.length===0),A.cases.push(P)}while(O.currentType!==14);return B&&i(w,ge.MUST_HAVE_MESSAGES_IN_PLURAL,S,0),l(A,w.currentOffset(),w.currentPosition()),A}function k(w){const b=w.context(),{offset:S,startLoc:v}=b,O=g(w);return b.currentType===14?O:y(w,S,v,O)}function x(w){const b=T1(w,Vd({},t)),S=b.context(),v=s(0,S.offset,S.startLoc);return e&&v.loc&&(v.loc.source=w),v.body=k(b),t.onCacheKey&&(v.cacheKey=t.onCacheKey(w)),S.currentType!==14&&i(b,ge.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,w[S.offset]||""),l(v,b.currentOffset(),b.currentPosition()),v}return{parse:x}}function Qt(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function L1(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function zd(t,e){for(let n=0;n<t.length;n++)vl(t[n],e)}function vl(t,e){switch(t.type){case 1:zd(t.cases,e),e.helper("plural");break;case 2:zd(t.items,e);break;case 6:{vl(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function B1(t,e={}){const n=L1(t);n.helper("normalize"),t.body&&vl(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function $1(t){const e=t.body;return e.type===2?jd(e):e.cases.forEach(n=>jd(n)),t}function jd(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Rd(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const I1="minifier";function Yr(t){switch(t.t=t.type,t.type){case 0:{const e=t;Yr(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)Yr(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)Yr(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;Yr(e.key),e.k=e.key,delete e.key,e.modifier&&(Yr(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:throw Ur(ge.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:I1,args:[t.type]})}delete t.type}const V1="parser";function P1(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,o=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};o&&t.loc&&(s.source=t.loc.source);const l=()=>s;function c(g,y){s.code+=g}function d(g,y=!0){const k=y?r:"";c(i?k+" ".repeat(g):k)}function u(g=!0){const y=++s.indentLevel;g&&d(y)}function f(g=!0){const y=--s.indentLevel;g&&d(y)}function h(){d(s.indentLevel)}return{context:l,push:c,indent:u,deindent:f,newline:h,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function R1(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),qr(t,e.key),e.modifier?(t.push(", "),qr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function F1(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let o=0;o<i&&(qr(t,e.items[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}function z1(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let o=0;o<i&&(qr(t,e.cases[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}}function j1(t,e){e.body?qr(t,e.body):t.push("null")}function qr(t,e){const{helper:n}=t;switch(e.type){case 0:j1(t,e);break;case 1:z1(t,e);break;case 2:F1(t,e);break;case 6:R1(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:throw Ur(ge.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:V1,args:[e.type]})}}const H1=(t,e={})=>{const n=Pd(e.mode)?e.mode:"normal",r=Pd(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
15
|
+
`,E1="\u2028",C1="\u2029";function S1(t){const e=t;let n=0,r=1,i=1,o=0;const s=_=>e[_]===x1&&e[_+1]===gt,l=_=>e[_]===gt,c=_=>e[_]===C1,d=_=>e[_]===E1,u=_=>s(_)||l(_)||c(_)||d(_),f=()=>n,h=()=>r,p=()=>i,m=()=>o,g=_=>s(_)||c(_)||d(_)?gt:e[_],y=()=>g(n),k=()=>g(n+o);function x(){return o=0,u(n)&&(r++,i=0),s(n)&&n++,n++,i++,e[n]}function w(){return s(n+o)&&o++,o++,e[n+o]}function b(){n=0,r=1,i=1,o=0}function S(_=0){o=_}function v(){const _=n+o;for(;_!==n;)x();o=0}return{index:f,line:h,column:p,peekOffset:m,charAt:g,currentChar:y,currentPeek:k,next:x,peek:w,reset:b,resetPeek:S,skipToPeek:v}}const Vn=void 0,O1=".",Fd="'",_1="tokenizer";function T1(t,e={}){const n=e.location!==!1,r=S1(t),i=()=>r.index(),o=()=>h1(r.line(),r.column(),r.index()),s=o(),l=i(),c={currentType:14,offset:l,startLoc:s,endLoc:s,lastType:14,lastOffset:l,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=e;function f(E,O,U,...se){const Me=d();if(O.column+=U,O.offset+=U,u){const Oe=n?jo(Me.startLoc,O):null,_e=Ur(E,Oe,{domain:_1,args:se});u(_e)}}function h(E,O,U){E.endLoc=o(),E.currentType=O;const se={type:O};return n&&(se.loc=jo(E.startLoc,E.endLoc)),U!=null&&(se.value=U),se}const p=E=>h(E,14);function m(E,O){return E.currentChar()===O?(E.next(),O):(f(ge.EXPECTED_TOKEN,o(),0,O),"")}function g(E){let O="";for(;E.currentPeek()===xn||E.currentPeek()===gt;)O+=E.currentPeek(),E.peek();return O}function y(E){const O=g(E);return E.skipToPeek(),O}function k(E){if(E===Vn)return!1;const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O===95}function x(E){if(E===Vn)return!1;const O=E.charCodeAt(0);return O>=48&&O<=57}function w(E,O){const{currentType:U}=O;if(U!==2)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function b(E,O){const{currentType:U}=O;if(U!==2)return!1;g(E);const se=E.currentPeek()==="-"?E.peek():E.currentPeek(),Me=x(se);return E.resetPeek(),Me}function S(E,O){const{currentType:U}=O;if(U!==2)return!1;g(E);const se=E.currentPeek()===Fd;return E.resetPeek(),se}function v(E,O){const{currentType:U}=O;if(U!==8)return!1;g(E);const se=E.currentPeek()===".";return E.resetPeek(),se}function _(E,O){const{currentType:U}=O;if(U!==9)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function B(E,O){const{currentType:U}=O;if(!(U===8||U===12))return!1;g(E);const se=E.currentPeek()===":";return E.resetPeek(),se}function A(E,O){const{currentType:U}=O;if(U!==10)return!1;const se=()=>{const Oe=E.currentPeek();return Oe==="{"?k(E.peek()):Oe==="@"||Oe==="%"||Oe==="|"||Oe===":"||Oe==="."||Oe===xn||!Oe?!1:Oe===gt?(E.peek(),se()):L(E,!1)},Me=se();return E.resetPeek(),Me}function P(E){g(E);const O=E.currentPeek()==="|";return E.resetPeek(),O}function $(E){const O=g(E),U=E.currentPeek()==="%"&&E.peek()==="{";return E.resetPeek(),{isModulo:U,hasSpace:O.length>0}}function L(E,O=!0){const U=(Me=!1,Oe="",_e=!1)=>{const F=E.currentPeek();return F==="{"?Oe==="%"?!1:Me:F==="@"||!F?Oe==="%"?!0:Me:F==="%"?(E.peek(),U(Me,"%",!0)):F==="|"?Oe==="%"||_e?!0:!(Oe===xn||Oe===gt):F===xn?(E.peek(),U(!0,xn,_e)):F===gt?(E.peek(),U(!0,gt,_e)):!0},se=U();return O&&E.resetPeek(),se}function j(E,O){const U=E.currentChar();return U===Vn?Vn:O(U)?(E.next(),U):null}function z(E){const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36}function D(E){return j(E,z)}function C(E){const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36||O===45}function I(E){return j(E,C)}function R(E){const O=E.charCodeAt(0);return O>=48&&O<=57}function ee(E){return j(E,R)}function te(E){const O=E.charCodeAt(0);return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}function ce(E){return j(E,te)}function ue(E){let O="",U="";for(;O=ee(E);)U+=O;return U}function V(E){y(E);const O=E.currentChar();return O!=="%"&&f(ge.EXPECTED_TOKEN,o(),0,O),E.next(),"%"}function W(E){let O="";for(;;){const U=E.currentChar();if(U==="{"||U==="}"||U==="@"||U==="|"||!U)break;if(U==="%")if(L(E))O+=U,E.next();else break;else if(U===xn||U===gt)if(L(E))O+=U,E.next();else{if(P(E))break;O+=U,E.next()}else O+=U,E.next()}return O}function K(E){y(E);let O="",U="";for(;O=I(E);)U+=O;return E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U}function q(E){y(E);let O="";return E.currentChar()==="-"?(E.next(),O+=`-${ue(E)}`):O+=ue(E),E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),O}function H(E){return E!==Fd&&E!==gt}function de(E){y(E),m(E,"'");let O="",U="";for(;O=j(E,H);)O==="\\"?U+=ae(E):U+=O;const se=E.currentChar();return se===gt||se===Vn?(f(ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),se===gt&&(E.next(),m(E,"'")),U):(m(E,"'"),U)}function ae(E){const O=E.currentChar();switch(O){case"\\":case"'":return E.next(),`\\${O}`;case"u":return we(E,O,4);case"U":return we(E,O,6);default:return f(ge.UNKNOWN_ESCAPE_SEQUENCE,o(),0,O),""}}function we(E,O,U){m(E,O);let se="";for(let Me=0;Me<U;Me++){const Oe=ce(E);if(!Oe){f(ge.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${O}${se}${E.currentChar()}`);break}se+=Oe}return`\\${O}${se}`}function Ne(E){return E!=="{"&&E!=="}"&&E!==xn&&E!==gt}function Ie(E){y(E);let O="",U="";for(;O=j(E,Ne);)U+=O;return U}function tt(E){let O="",U="";for(;O=D(E);)U+=O;return U}function Q(E){const O=U=>{const se=E.currentChar();return se==="{"||se==="%"||se==="@"||se==="|"||se==="("||se===")"||!se||se===xn?U:(U+=se,E.next(),O(U))};return O("")}function Ee(E){y(E);const O=m(E,"|");return y(E),O}function At(E,O){let U=null;switch(E.currentChar()){case"{":return O.braceNest>=1&&f(ge.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),E.next(),U=h(O,2,"{"),y(E),O.braceNest++,U;case"}":return O.braceNest>0&&O.currentType===2&&f(ge.EMPTY_PLACEHOLDER,o(),0),E.next(),U=h(O,3,"}"),O.braceNest--,O.braceNest>0&&y(E),O.inLinked&&O.braceNest===0&&(O.inLinked=!1),U;case"@":return O.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U=lt(E,O)||p(O),O.braceNest=0,U;default:{let Me=!0,Oe=!0,_e=!0;if(P(E))return O.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),U=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,U;if(O.braceNest>0&&(O.currentType===5||O.currentType===6||O.currentType===7))return f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),O.braceNest=0,at(E,O);if(Me=w(E,O))return U=h(O,5,K(E)),y(E),U;if(Oe=b(E,O))return U=h(O,6,q(E)),y(E),U;if(_e=S(E,O))return U=h(O,7,de(E)),y(E),U;if(!Me&&!Oe&&!_e)return U=h(O,13,Ie(E)),f(ge.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,U.value),y(E),U;break}}return U}function lt(E,O){const{currentType:U}=O;let se=null;const Me=E.currentChar();switch((U===8||U===9||U===12||U===10)&&(Me===gt||Me===xn)&&f(ge.INVALID_LINKED_FORMAT,o(),0),Me){case"@":return E.next(),se=h(O,8,"@"),O.inLinked=!0,se;case".":return y(E),E.next(),h(O,9,".");case":":return y(E),E.next(),h(O,10,":");default:return P(E)?(se=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,se):v(E,O)||B(E,O)?(y(E),lt(E,O)):_(E,O)?(y(E),h(O,12,tt(E))):A(E,O)?(y(E),Me==="{"?At(E,O)||se:h(O,11,Q(E))):(U===8&&f(ge.INVALID_LINKED_FORMAT,o(),0),O.braceNest=0,O.inLinked=!1,at(E,O))}}function at(E,O){let U={type:14};if(O.braceNest>0)return At(E,O)||p(O);if(O.inLinked)return lt(E,O)||p(O);switch(E.currentChar()){case"{":return At(E,O)||p(O);case"}":return f(ge.UNBALANCED_CLOSING_BRACE,o(),0),E.next(),h(O,3,"}");case"@":return lt(E,O)||p(O);default:{if(P(E))return U=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,U;const{isModulo:Me,hasSpace:Oe}=$(E);if(Me)return Oe?h(O,0,W(E)):h(O,4,V(E));if(L(E))return h(O,0,W(E));break}}return U}function pt(){const{currentType:E,offset:O,startLoc:U,endLoc:se}=c;return c.lastType=E,c.lastOffset=O,c.lastStartLoc=U,c.lastEndLoc=se,c.offset=i(),c.startLoc=o(),r.currentChar()===Vn?h(c,14):at(r,c)}return{nextToken:pt,currentOffset:i,currentPosition:o,context:d}}const N1="parser",M1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function A1(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function D1(t={}){const e=t.location!==!1,{onError:n,onWarn:r}=t;function i(w,b,S,v,..._){const B=w.currentPosition();if(B.offset+=v,B.column+=v,n){const A=e?jo(S,B):null,P=Ur(b,A,{domain:N1,args:_});n(P)}}function o(w,b,S,v,..._){const B=w.currentPosition();if(B.offset+=v,B.column+=v,r){const A=e?jo(S,B):null;r(y1(b,A,_))}}function s(w,b,S){const v={type:w};return e&&(v.start=b,v.end=b,v.loc={start:S,end:S}),v}function l(w,b,S,v){e&&(w.end=b,w.loc&&(w.loc.end=S))}function c(w,b){const S=w.context(),v=s(3,S.offset,S.startLoc);return v.value=b,l(v,w.currentOffset(),w.currentPosition()),v}function d(w,b){const S=w.context(),{lastOffset:v,lastStartLoc:_}=S,B=s(5,v,_);return B.index=parseInt(b,10),w.nextToken(),l(B,w.currentOffset(),w.currentPosition()),B}function u(w,b,S){const v=w.context(),{lastOffset:_,lastStartLoc:B}=v,A=s(4,_,B);return A.key=b,S===!0&&(A.modulo=!0),w.nextToken(),l(A,w.currentOffset(),w.currentPosition()),A}function f(w,b){const S=w.context(),{lastOffset:v,lastStartLoc:_}=S,B=s(9,v,_);return B.value=b.replace(M1,A1),w.nextToken(),l(B,w.currentOffset(),w.currentPosition()),B}function h(w){const b=w.nextToken(),S=w.context(),{lastOffset:v,lastStartLoc:_}=S,B=s(8,v,_);return b.type!==12?(i(w,ge.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.lastStartLoc,0),B.value="",l(B,v,_),{nextConsumeToken:b,node:B}):(b.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Qt(b)),B.value=b.value||"",l(B,w.currentOffset(),w.currentPosition()),{node:B})}function p(w,b){const S=w.context(),v=s(7,S.offset,S.startLoc);return v.value=b,l(v,w.currentOffset(),w.currentPosition()),v}function m(w){const b=w.context(),S=s(6,b.offset,b.startLoc);let v=w.nextToken();if(v.type===9){const _=h(w);S.modifier=_.node,v=_.nextConsumeToken||w.nextToken()}switch(v.type!==10&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),v=w.nextToken(),v.type===2&&(v=w.nextToken()),v.type){case 11:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=p(w,v.value||"");break;case 5:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=u(w,v.value||"");break;case 6:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=d(w,v.value||"");break;case 7:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(v)),S.key=f(w,v.value||"");break;default:{i(w,ge.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const _=w.context(),B=s(7,_.offset,_.startLoc);return B.value="",l(B,_.offset,_.startLoc),S.key=B,l(S,_.offset,_.startLoc),{nextConsumeToken:v,node:S}}}return l(S,w.currentOffset(),w.currentPosition()),{node:S}}function g(w){const b=w.context(),S=b.currentType===1?w.currentOffset():b.offset,v=b.currentType===1?b.endLoc:b.startLoc,_=s(2,S,v);_.items=[];let B=null,A=null;do{const L=B||w.nextToken();switch(B=null,L.type){case 0:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),_.items.push(c(w,L.value||""));break;case 6:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),_.items.push(d(w,L.value||""));break;case 4:A=!0;break;case 5:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),_.items.push(u(w,L.value||"",!!A)),A&&(o(w,Ho.USE_MODULO_SYNTAX,b.lastStartLoc,0,Qt(L)),A=null);break;case 7:L.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qt(L)),_.items.push(f(w,L.value||""));break;case 8:{const j=m(w);_.items.push(j.node),B=j.nextConsumeToken||null;break}}}while(b.currentType!==14&&b.currentType!==1);const P=b.currentType===1?b.lastOffset:w.currentOffset(),$=b.currentType===1?b.lastEndLoc:w.currentPosition();return l(_,P,$),_}function y(w,b,S,v){const _=w.context();let B=v.items.length===0;const A=s(1,b,S);A.cases=[],A.cases.push(v);do{const P=g(w);B||(B=P.items.length===0),A.cases.push(P)}while(_.currentType!==14);return B&&i(w,ge.MUST_HAVE_MESSAGES_IN_PLURAL,S,0),l(A,w.currentOffset(),w.currentPosition()),A}function k(w){const b=w.context(),{offset:S,startLoc:v}=b,_=g(w);return b.currentType===14?_:y(w,S,v,_)}function x(w){const b=T1(w,Vd({},t)),S=b.context(),v=s(0,S.offset,S.startLoc);return e&&v.loc&&(v.loc.source=w),v.body=k(b),t.onCacheKey&&(v.cacheKey=t.onCacheKey(w)),S.currentType!==14&&i(b,ge.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,w[S.offset]||""),l(v,b.currentOffset(),b.currentPosition()),v}return{parse:x}}function Qt(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function L1(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function zd(t,e){for(let n=0;n<t.length;n++)vl(t[n],e)}function vl(t,e){switch(t.type){case 1:zd(t.cases,e),e.helper("plural");break;case 2:zd(t.items,e);break;case 6:{vl(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function B1(t,e={}){const n=L1(t);n.helper("normalize"),t.body&&vl(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function $1(t){const e=t.body;return e.type===2?jd(e):e.cases.forEach(n=>jd(n)),t}function jd(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Rd(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const I1="minifier";function Yr(t){switch(t.t=t.type,t.type){case 0:{const e=t;Yr(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)Yr(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)Yr(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;Yr(e.key),e.k=e.key,delete e.key,e.modifier&&(Yr(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:throw Ur(ge.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:I1,args:[t.type]})}delete t.type}const V1="parser";function P1(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,o=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};o&&t.loc&&(s.source=t.loc.source);const l=()=>s;function c(g,y){s.code+=g}function d(g,y=!0){const k=y?r:"";c(i?k+" ".repeat(g):k)}function u(g=!0){const y=++s.indentLevel;g&&d(y)}function f(g=!0){const y=--s.indentLevel;g&&d(y)}function h(){d(s.indentLevel)}return{context:l,push:c,indent:u,deindent:f,newline:h,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function R1(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),qr(t,e.key),e.modifier?(t.push(", "),qr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function F1(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let o=0;o<i&&(qr(t,e.items[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}function z1(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let o=0;o<i&&(qr(t,e.cases[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}}function j1(t,e){e.body?qr(t,e.body):t.push("null")}function qr(t,e){const{helper:n}=t;switch(e.type){case 0:j1(t,e);break;case 1:z1(t,e);break;case 2:F1(t,e);break;case 6:R1(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:throw Ur(ge.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:V1,args:[e.type]})}}const H1=(t,e={})=>{const n=Pd(e.mode)?e.mode:"normal",r=Pd(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
16
16
|
`,o=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],l=P1(t,{filename:r,breakLineCode:i,needIndent:o});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),s.length>0&&(l.push(`const { ${Rd(s.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),qr(l,t),l.deindent(o),l.push("}"),delete t.helpers;const{code:c,map:d}=l.context();return{ast:t,code:c,map:d?d.toJSON():void 0}};function W1(t,e={}){const n=Vd({},e),r=!!n.jit,i=!!n.minify,o=n.optimize==null?!0:n.optimize,l=D1(n).parse(t);return r?(o&&$1(l),i&&Yr(l),{ast:l,code:""}):(B1(l,n),H1(l,n))}/*!
|
|
17
17
|
* core-base v9.14.4
|
|
18
18
|
* (c) 2025 kazuya kawaguchi
|
|
19
19
|
* Released under the MIT License.
|
|
20
|
-
*/function U1(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function en(t){return Te(t)&&xl(t)===0&&(Xt(t,"b")||Xt(t,"body"))}const Hd=["b","body"];function Y1(t){return Pn(t,Hd)}const Wd=["c","cases"];function q1(t){return Pn(t,Wd,[])}const Ud=["s","static"];function K1(t){return Pn(t,Ud)}const Yd=["i","items"];function G1(t){return Pn(t,Yd,[])}const qd=["t","type"];function xl(t){return Pn(t,qd)}const Kd=["v","value"];function Wo(t,e){const n=Pn(t,Kd);if(n!=null)return n;throw Ii(e)}const Gd=["m","modifier"];function J1(t){return Pn(t,Gd)}const Jd=["k","key"];function Z1(t){const e=Pn(t,Jd);if(e)return e;throw Ii(6)}function Pn(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(Xt(t,i)&&t[i]!=null)return t[i]}return n}const Zd=[...Hd,...Wd,...Ud,...Yd,...Jd,...Gd,...Kd,...qd];function Ii(t){return new Error(`unhandled node type: ${t}`)}const Rn=[];Rn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Rn[1]={w:[1],".":[2],"[":[4],o:[7]},Rn[2]={w:[2],i:[3,0],0:[3,0]},Rn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Rn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Rn[5]={"'":[4,0],o:8,l:[5,0]},Rn[6]={'"':[4,0],o:8,l:[6,0]};const X1=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Q1(t){return X1.test(t)}function eb(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function tb(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function nb(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Q1(e)?eb(e):"*"+e}function rb(t){const e=[];let n=-1,r=0,i=0,o,s,l,c,d,u,f;const h=[];h[0]=()=>{s===void 0?s=l:s+=l},h[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},h[2]=()=>{h[0](),i++},h[3]=()=>{if(i>0)i--,r=4,h[0]();else{if(i=0,s===void 0||(s=nb(s),s===!1))return!1;h[1]()}};function p(){const m=t[n+1];if(r===5&&m==="'"||r===6&&m==='"')return n++,l="\\"+m,h[0](),!0}for(;r!==null;)if(n++,o=t[n],!(o==="\\"&&p())){if(c=tb(o),f=Rn[r],d=f[c]||f.l||8,d===8||(r=d[0],d[1]!==void 0&&(u=h[d[1]],u&&(l=o,u()===!1))))return;if(r===7)return e}}const Xd=new Map;function ib(t,e){return Te(t)?t[e]:null}function ob(t,e){if(!Te(t))return null;let n=Xd.get(e);if(n||(n=rb(e),n&&Xd.set(e,n)),!n)return null;const r=n.length;let i=t,o=0;for(;o<r;){const s=n[o];if(Zd.includes(s)&&en(i))return null;const l=i[s];if(l===void 0||Ve(i))return null;i=l,o++}return i}const sb=t=>t,lb=t=>"",ab="text",cb=t=>t.length===0?"":d1(t),db=c1;function Qd(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function ub(t){const e=Ge(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ge(t.named.count)||Ge(t.named.n))?Ge(t.named.count)?t.named.count:Ge(t.named.n)?t.named.n:e:e}function fb(t,e){e.count||(e.count=t),e.n||(e.n=t)}function hb(t={}){const e=t.locale,n=ub(t),r=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?t.pluralRules[e]:Qd,i=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?Qd:void 0,o=k=>k[r(n,k.length,i)],s=t.list||[],l=k=>s[k],c=t.named||Le();Ge(t.pluralIndex)&&fb(n,c);const d=k=>c[k];function u(k){const x=Ve(t.messages)?t.messages(k):Te(t.messages)?t.messages[k]:!1;return x||(t.parent?t.parent.message(k):lb)}const f=k=>t.modifiers?t.modifiers[k]:sb,h=Se(t.processor)&&Ve(t.processor.normalize)?t.processor.normalize:cb,p=Se(t.processor)&&Ve(t.processor.interpolate)?t.processor.interpolate:db,m=Se(t.processor)&&oe(t.processor.type)?t.processor.type:ab,y={list:l,named:d,plural:o,linked:(k,...x)=>{const[w,b]=x;let S="text",v="";x.length===1?Te(w)?(v=w.modifier||v,S=w.type||S):oe(w)&&(v=w||v):x.length===2&&(oe(w)&&(v=w||v),oe(b)&&(S=b||S));const O=u(k)(y),B=S==="vnode"&&We(O)&&v?O[0]:O;return v?f(v)(B,S):B},message:u,type:m,interpolate:p,normalize:h,values:dt(Le(),s,c)};return y}let Vi=null;function pb(t){Vi=t}function mb(t,e,n){Vi&&Vi.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const gb=yb("function:translate");function yb(t){return e=>Vi&&Vi.emit(t,e)}const eu=Ho.__EXTEND_POINT__,pr=Ro(eu),yt={NOT_FOUND_KEY:eu,FALLBACK_TO_TRANSLATE:pr(),CANNOT_FORMAT_NUMBER:pr(),FALLBACK_TO_NUMBER_FORMAT:pr(),CANNOT_FORMAT_DATE:pr(),FALLBACK_TO_DATE_FORMAT:pr(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:pr(),__EXTEND_POINT__:pr()},bb={[yt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[yt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[yt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[yt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function mr(t,...e){return wl(bb[t],...e)}const tu=ge.__EXTEND_POINT__,gr=Ro(tu),Je={INVALID_ARGUMENT:tu,INVALID_DATE_ARGUMENT:gr(),INVALID_ISO_DATE_ARGUMENT:gr(),NOT_SUPPORT_NON_STRING_MESSAGE:gr(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:gr(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:gr(),NOT_SUPPORT_LOCALE_TYPE:gr(),__EXTEND_POINT__:gr()};function sn(t){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:kb}:void 0)}const kb={[Je.INVALID_ARGUMENT]:"Invalid arguments",[Je.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Je.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Je.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Je.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function El(t,e){return e.locale!=null?nu(e.locale):nu(t.locale)}let Cl;function nu(t){if(oe(t))return t;if(Ve(t)){if(t.resolvedOnce&&Cl!=null)return Cl;if(t.constructor.name==="Function"){const e=t();if(a1(e))throw sn(Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Cl=e}else throw sn(Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw sn(Je.NOT_SUPPORT_LOCALE_TYPE)}function wb(t,e,n){return[...new Set([n,...We(e)?e:Te(e)?Object.keys(e):oe(e)?[e]:[n]])]}function ru(t,e,n){const r=oe(n)?n:Pi,i=t;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let s=[n];for(;We(s);)s=iu(o,s,e);const l=We(e)||!Se(e)?e:e.default?e.default:null;s=oe(l)?[l]:l,We(s)&&iu(o,s,!1),i.__localeChainCache.set(r,o)}return o}function iu(t,e,n){let r=!0;for(let i=0;i<e.length&&Be(r);i++){const o=e[i];oe(o)&&(r=vb(t,e[i],n))}return r}function vb(t,e,n){let r;const i=e.split("-");do{const o=i.join("-");r=xb(t,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function xb(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const i=e.replace(/!/g,"");t.push(i),(We(n)||Se(n))&&n[i]&&(r=n[i])}return r}const Eb="9.14.4",Uo=-1,Pi="en-US",Yo="",ou=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Cb(){return{upper:(t,e)=>e==="text"&&oe(t)?t.toUpperCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&oe(t)?t.toLowerCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&oe(t)?ou(t):e==="vnode"&&Te(t)&&"__v_isVNode"in t?ou(t.children):t}}let su;function lu(t){su=t}let au;function Sb(t){au=t}let cu;function _b(t){cu=t}let du=null;const Ob=t=>{du=t},Tb=()=>du;let uu=null;const fu=t=>{uu=t},Nb=()=>uu;let hu=0;function Mb(t={}){const e=Ve(t.onWarn)?t.onWarn:vn,n=oe(t.version)?t.version:Eb,r=oe(t.locale)||Ve(t.locale)?t.locale:Pi,i=Ve(r)?Pi:r,o=We(t.fallbackLocale)||Se(t.fallbackLocale)||oe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,s=Se(t.messages)?t.messages:Sl(i),l=Se(t.datetimeFormats)?t.datetimeFormats:Sl(i),c=Se(t.numberFormats)?t.numberFormats:Sl(i),d=dt(Le(),t.modifiers,Cb()),u=t.pluralRules||Le(),f=Ve(t.missing)?t.missing:null,h=Be(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,p=Be(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,m=!!t.fallbackFormat,g=!!t.unresolving,y=Ve(t.postTranslation)?t.postTranslation:null,k=Se(t.processor)?t.processor:null,x=Be(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=Ve(t.messageCompiler)?t.messageCompiler:su;process.env.NODE_ENV!=="production"&&Ve(t.messageCompiler)&&$d(mr(yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const S=Ve(t.messageResolver)?t.messageResolver:au||ib,v=Ve(t.localeFallbacker)?t.localeFallbacker:cu||wb,O=Te(t.fallbackContext)?t.fallbackContext:void 0,B=t,A=Te(B.__datetimeFormatters)?B.__datetimeFormatters:new Map,P=Te(B.__numberFormatters)?B.__numberFormatters:new Map,$=Te(B.__meta)?B.__meta:{};hu++;const L={version:n,cid:hu,locale:r,fallbackLocale:o,messages:s,modifiers:d,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:p,fallbackFormat:m,unresolving:g,postTranslation:y,processor:k,warnHtmlMessage:x,escapeParameter:w,messageCompiler:b,messageResolver:S,localeFallbacker:v,fallbackContext:O,onWarn:e,__meta:$};return L.datetimeFormats=l,L.numberFormats=c,L.__datetimeFormatters=A,L.__numberFormatters=P,process.env.NODE_ENV!=="production"&&(L.__v_emitter=B.__v_emitter!=null?B.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&mb(L,n,$),L}const Sl=t=>({[t]:Le()});function qo(t,e){return t instanceof RegExp?t.test(e):t}function pu(t,e){return t instanceof RegExp?t.test(e):t}function _l(t,e,n,r,i){const{missing:o,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const l=t.__v_emitter;l&&l.emit("missing",{locale:n,key:e,type:i,groupId:`${i}:${e}`})}if(o!==null){const l=o(t,n,e,i);return oe(l)?l:e}else return process.env.NODE_ENV!=="production"&&pu(r,e)&&s(mr(yt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Ri(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function mu(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Ab(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(mu(t,e[r]))return!0;return!1}function Ol(t){return n=>Db(n,t)}function Db(t,e){const n=Y1(e);if(n==null)throw Ii(0);if(xl(n)===1){const o=q1(n);return t.plural(o.reduce((s,l)=>[...s,gu(t,l)],[]))}else return gu(t,n)}function gu(t,e){const n=K1(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=G1(e).reduce((i,o)=>[...i,Tl(t,o)],[]);return t.normalize(r)}}function Tl(t,e){const n=xl(e);switch(n){case 3:return Wo(e,n);case 9:return Wo(e,n);case 4:{const r=e;if(Xt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Xt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Ii(n)}case 5:{const r=e;if(Xt(r,"i")&&Ge(r.i))return t.interpolate(t.list(r.i));if(Xt(r,"index")&&Ge(r.index))return t.interpolate(t.list(r.index));throw Ii(n)}case 6:{const r=e,i=J1(r),o=Z1(r);return t.linked(Tl(t,o),i?Tl(t,i):void 0,t.type)}case 7:return Wo(e,n);case 8:return Wo(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Lb="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function yu(t,e){e&&v1(t)&&vn(wl(Lb,{source:t}))}const bu=t=>t;let Kr=Le();function ku(t){t.code===Ho.USE_MODULO_SYNTAX&&vn(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
|
|
20
|
+
*/function U1(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function en(t){return Te(t)&&xl(t)===0&&(Xt(t,"b")||Xt(t,"body"))}const Hd=["b","body"];function Y1(t){return Pn(t,Hd)}const Wd=["c","cases"];function q1(t){return Pn(t,Wd,[])}const Ud=["s","static"];function K1(t){return Pn(t,Ud)}const Yd=["i","items"];function G1(t){return Pn(t,Yd,[])}const qd=["t","type"];function xl(t){return Pn(t,qd)}const Kd=["v","value"];function Wo(t,e){const n=Pn(t,Kd);if(n!=null)return n;throw Ii(e)}const Gd=["m","modifier"];function J1(t){return Pn(t,Gd)}const Jd=["k","key"];function Z1(t){const e=Pn(t,Jd);if(e)return e;throw Ii(6)}function Pn(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(Xt(t,i)&&t[i]!=null)return t[i]}return n}const Zd=[...Hd,...Wd,...Ud,...Yd,...Jd,...Gd,...Kd,...qd];function Ii(t){return new Error(`unhandled node type: ${t}`)}const Rn=[];Rn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Rn[1]={w:[1],".":[2],"[":[4],o:[7]},Rn[2]={w:[2],i:[3,0],0:[3,0]},Rn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Rn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Rn[5]={"'":[4,0],o:8,l:[5,0]},Rn[6]={'"':[4,0],o:8,l:[6,0]};const X1=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Q1(t){return X1.test(t)}function eb(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function tb(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function nb(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Q1(e)?eb(e):"*"+e}function rb(t){const e=[];let n=-1,r=0,i=0,o,s,l,c,d,u,f;const h=[];h[0]=()=>{s===void 0?s=l:s+=l},h[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},h[2]=()=>{h[0](),i++},h[3]=()=>{if(i>0)i--,r=4,h[0]();else{if(i=0,s===void 0||(s=nb(s),s===!1))return!1;h[1]()}};function p(){const m=t[n+1];if(r===5&&m==="'"||r===6&&m==='"')return n++,l="\\"+m,h[0](),!0}for(;r!==null;)if(n++,o=t[n],!(o==="\\"&&p())){if(c=tb(o),f=Rn[r],d=f[c]||f.l||8,d===8||(r=d[0],d[1]!==void 0&&(u=h[d[1]],u&&(l=o,u()===!1))))return;if(r===7)return e}}const Xd=new Map;function ib(t,e){return Te(t)?t[e]:null}function ob(t,e){if(!Te(t))return null;let n=Xd.get(e);if(n||(n=rb(e),n&&Xd.set(e,n)),!n)return null;const r=n.length;let i=t,o=0;for(;o<r;){const s=n[o];if(Zd.includes(s)&&en(i))return null;const l=i[s];if(l===void 0||Ve(i))return null;i=l,o++}return i}const sb=t=>t,lb=t=>"",ab="text",cb=t=>t.length===0?"":d1(t),db=c1;function Qd(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function ub(t){const e=Ge(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ge(t.named.count)||Ge(t.named.n))?Ge(t.named.count)?t.named.count:Ge(t.named.n)?t.named.n:e:e}function fb(t,e){e.count||(e.count=t),e.n||(e.n=t)}function hb(t={}){const e=t.locale,n=ub(t),r=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?t.pluralRules[e]:Qd,i=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?Qd:void 0,o=k=>k[r(n,k.length,i)],s=t.list||[],l=k=>s[k],c=t.named||Le();Ge(t.pluralIndex)&&fb(n,c);const d=k=>c[k];function u(k){const x=Ve(t.messages)?t.messages(k):Te(t.messages)?t.messages[k]:!1;return x||(t.parent?t.parent.message(k):lb)}const f=k=>t.modifiers?t.modifiers[k]:sb,h=Se(t.processor)&&Ve(t.processor.normalize)?t.processor.normalize:cb,p=Se(t.processor)&&Ve(t.processor.interpolate)?t.processor.interpolate:db,m=Se(t.processor)&&oe(t.processor.type)?t.processor.type:ab,y={list:l,named:d,plural:o,linked:(k,...x)=>{const[w,b]=x;let S="text",v="";x.length===1?Te(w)?(v=w.modifier||v,S=w.type||S):oe(w)&&(v=w||v):x.length===2&&(oe(w)&&(v=w||v),oe(b)&&(S=b||S));const _=u(k)(y),B=S==="vnode"&&We(_)&&v?_[0]:_;return v?f(v)(B,S):B},message:u,type:m,interpolate:p,normalize:h,values:dt(Le(),s,c)};return y}let Vi=null;function pb(t){Vi=t}function mb(t,e,n){Vi&&Vi.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const gb=yb("function:translate");function yb(t){return e=>Vi&&Vi.emit(t,e)}const eu=Ho.__EXTEND_POINT__,pr=Ro(eu),yt={NOT_FOUND_KEY:eu,FALLBACK_TO_TRANSLATE:pr(),CANNOT_FORMAT_NUMBER:pr(),FALLBACK_TO_NUMBER_FORMAT:pr(),CANNOT_FORMAT_DATE:pr(),FALLBACK_TO_DATE_FORMAT:pr(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:pr(),__EXTEND_POINT__:pr()},bb={[yt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[yt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[yt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[yt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function mr(t,...e){return wl(bb[t],...e)}const tu=ge.__EXTEND_POINT__,gr=Ro(tu),Je={INVALID_ARGUMENT:tu,INVALID_DATE_ARGUMENT:gr(),INVALID_ISO_DATE_ARGUMENT:gr(),NOT_SUPPORT_NON_STRING_MESSAGE:gr(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:gr(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:gr(),NOT_SUPPORT_LOCALE_TYPE:gr(),__EXTEND_POINT__:gr()};function sn(t){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:kb}:void 0)}const kb={[Je.INVALID_ARGUMENT]:"Invalid arguments",[Je.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Je.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Je.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Je.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function El(t,e){return e.locale!=null?nu(e.locale):nu(t.locale)}let Cl;function nu(t){if(oe(t))return t;if(Ve(t)){if(t.resolvedOnce&&Cl!=null)return Cl;if(t.constructor.name==="Function"){const e=t();if(a1(e))throw sn(Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Cl=e}else throw sn(Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw sn(Je.NOT_SUPPORT_LOCALE_TYPE)}function wb(t,e,n){return[...new Set([n,...We(e)?e:Te(e)?Object.keys(e):oe(e)?[e]:[n]])]}function ru(t,e,n){const r=oe(n)?n:Pi,i=t;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let s=[n];for(;We(s);)s=iu(o,s,e);const l=We(e)||!Se(e)?e:e.default?e.default:null;s=oe(l)?[l]:l,We(s)&&iu(o,s,!1),i.__localeChainCache.set(r,o)}return o}function iu(t,e,n){let r=!0;for(let i=0;i<e.length&&Be(r);i++){const o=e[i];oe(o)&&(r=vb(t,e[i],n))}return r}function vb(t,e,n){let r;const i=e.split("-");do{const o=i.join("-");r=xb(t,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function xb(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const i=e.replace(/!/g,"");t.push(i),(We(n)||Se(n))&&n[i]&&(r=n[i])}return r}const Eb="9.14.4",Uo=-1,Pi="en-US",Yo="",ou=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Cb(){return{upper:(t,e)=>e==="text"&&oe(t)?t.toUpperCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&oe(t)?t.toLowerCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&oe(t)?ou(t):e==="vnode"&&Te(t)&&"__v_isVNode"in t?ou(t.children):t}}let su;function lu(t){su=t}let au;function Sb(t){au=t}let cu;function Ob(t){cu=t}let du=null;const _b=t=>{du=t},Tb=()=>du;let uu=null;const fu=t=>{uu=t},Nb=()=>uu;let hu=0;function Mb(t={}){const e=Ve(t.onWarn)?t.onWarn:vn,n=oe(t.version)?t.version:Eb,r=oe(t.locale)||Ve(t.locale)?t.locale:Pi,i=Ve(r)?Pi:r,o=We(t.fallbackLocale)||Se(t.fallbackLocale)||oe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,s=Se(t.messages)?t.messages:Sl(i),l=Se(t.datetimeFormats)?t.datetimeFormats:Sl(i),c=Se(t.numberFormats)?t.numberFormats:Sl(i),d=dt(Le(),t.modifiers,Cb()),u=t.pluralRules||Le(),f=Ve(t.missing)?t.missing:null,h=Be(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,p=Be(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,m=!!t.fallbackFormat,g=!!t.unresolving,y=Ve(t.postTranslation)?t.postTranslation:null,k=Se(t.processor)?t.processor:null,x=Be(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=Ve(t.messageCompiler)?t.messageCompiler:su;process.env.NODE_ENV!=="production"&&Ve(t.messageCompiler)&&$d(mr(yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const S=Ve(t.messageResolver)?t.messageResolver:au||ib,v=Ve(t.localeFallbacker)?t.localeFallbacker:cu||wb,_=Te(t.fallbackContext)?t.fallbackContext:void 0,B=t,A=Te(B.__datetimeFormatters)?B.__datetimeFormatters:new Map,P=Te(B.__numberFormatters)?B.__numberFormatters:new Map,$=Te(B.__meta)?B.__meta:{};hu++;const L={version:n,cid:hu,locale:r,fallbackLocale:o,messages:s,modifiers:d,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:p,fallbackFormat:m,unresolving:g,postTranslation:y,processor:k,warnHtmlMessage:x,escapeParameter:w,messageCompiler:b,messageResolver:S,localeFallbacker:v,fallbackContext:_,onWarn:e,__meta:$};return L.datetimeFormats=l,L.numberFormats=c,L.__datetimeFormatters=A,L.__numberFormatters=P,process.env.NODE_ENV!=="production"&&(L.__v_emitter=B.__v_emitter!=null?B.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&mb(L,n,$),L}const Sl=t=>({[t]:Le()});function qo(t,e){return t instanceof RegExp?t.test(e):t}function pu(t,e){return t instanceof RegExp?t.test(e):t}function Ol(t,e,n,r,i){const{missing:o,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const l=t.__v_emitter;l&&l.emit("missing",{locale:n,key:e,type:i,groupId:`${i}:${e}`})}if(o!==null){const l=o(t,n,e,i);return oe(l)?l:e}else return process.env.NODE_ENV!=="production"&&pu(r,e)&&s(mr(yt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Ri(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function mu(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Ab(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(mu(t,e[r]))return!0;return!1}function _l(t){return n=>Db(n,t)}function Db(t,e){const n=Y1(e);if(n==null)throw Ii(0);if(xl(n)===1){const o=q1(n);return t.plural(o.reduce((s,l)=>[...s,gu(t,l)],[]))}else return gu(t,n)}function gu(t,e){const n=K1(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=G1(e).reduce((i,o)=>[...i,Tl(t,o)],[]);return t.normalize(r)}}function Tl(t,e){const n=xl(e);switch(n){case 3:return Wo(e,n);case 9:return Wo(e,n);case 4:{const r=e;if(Xt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Xt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Ii(n)}case 5:{const r=e;if(Xt(r,"i")&&Ge(r.i))return t.interpolate(t.list(r.i));if(Xt(r,"index")&&Ge(r.index))return t.interpolate(t.list(r.index));throw Ii(n)}case 6:{const r=e,i=J1(r),o=Z1(r);return t.linked(Tl(t,o),i?Tl(t,i):void 0,t.type)}case 7:return Wo(e,n);case 8:return Wo(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Lb="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function yu(t,e){e&&v1(t)&&vn(wl(Lb,{source:t}))}const bu=t=>t;let Kr=Le();function ku(t){t.code===Ho.USE_MODULO_SYNTAX&&vn(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
|
|
21
21
|
reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format
|
|
22
|
-
(message compiler warning message: ${t.message})`)}function wu(t,e={}){let n=!1;const r=e.onError||k1;return e.onError=i=>{n=!0,r(i)},{...W1(t,e),detectError:n}}const Bb=(t,e)=>{if(!oe(t))throw sn(Je.NOT_SUPPORT_NON_STRING_MESSAGE);process.env.NODE_ENV!=="production"&&(e.onWarn=ku);{const n=Be(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Kr[i];if(o)return o;const{code:s,detectError:l}=wu(t,e),c=new Function(`return ${s}`)();return l?c:Kr[i]=c}};function $b(t,e){if(process.env.NODE_ENV!=="production"&&(e.onWarn=ku),__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&oe(t)){const n=Be(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Kr[i];if(o)return o;const{ast:s,detectError:l}=wu(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),c=
|
|
23
|
-
${d}`:c)}else throw s},onCacheKey:s=>r1(e,n,s)}}function Rb(t){if(oe(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function Fb(t,e,n,r){const{modifiers:i,pluralRules:o,messageResolver:s,fallbackLocale:l,fallbackWarn:c,missingWarn:d,fallbackContext:u}=t,h={locale:e,modifiers:i,pluralRules:o,messages:p=>{let m=s(n,p);if(m==null&&u){const[,,g]=Eu(u,p,e,l,c,d);m=s(g,p)}if(oe(m)||en(m)){let g=!1;const k=Cu(t,p,e,m,p,()=>{g=!0});return g?vu:k}else return zt(m)?m:vu}};return t.processor&&(h.processor=t.processor),r.list&&(h.list=r.list),r.named&&(h.named=r.named),Ge(r.plural)&&(h.pluralIndex=r.plural),h}const Su=typeof Intl<"u",
|
|
22
|
+
(message compiler warning message: ${t.message})`)}function wu(t,e={}){let n=!1;const r=e.onError||k1;return e.onError=i=>{n=!0,r(i)},{...W1(t,e),detectError:n}}const Bb=(t,e)=>{if(!oe(t))throw sn(Je.NOT_SUPPORT_NON_STRING_MESSAGE);process.env.NODE_ENV!=="production"&&(e.onWarn=ku);{const n=Be(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Kr[i];if(o)return o;const{code:s,detectError:l}=wu(t,e),c=new Function(`return ${s}`)();return l?c:Kr[i]=c}};function $b(t,e){if(process.env.NODE_ENV!=="production"&&(e.onWarn=ku),__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&oe(t)){const n=Be(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Kr[i];if(o)return o;const{ast:s,detectError:l}=wu(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),c=_l(s);return l?c:Kr[i]=c}else{if(process.env.NODE_ENV!=="production"&&!en(t))return vn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Kr[n];return r||(Kr[n]=_l(t))}else return _l(t)}}const vu=()=>"",zt=t=>Ve(t);function xu(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:o,fallbackLocale:s,messages:l}=t,[c,d]=Nl(...e),u=Be(d.missingWarn)?d.missingWarn:t.missingWarn,f=Be(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn,h=Be(d.escapeParameter)?d.escapeParameter:t.escapeParameter,p=!!d.resolvedMessage,m=oe(d.default)||Be(d.default)?Be(d.default)?o?c:()=>c:d.default:n?o?c:()=>c:"",g=n||m!=="",y=El(t,d);h&&Ib(d);let[k,x,w]=p?[c,y,l[y]||Le()]:Eu(t,c,y,s,f,u),b=k,S=c;if(!p&&!(oe(b)||en(b)||zt(b))&&g&&(b=m,S=b),!p&&(!(oe(b)||en(b)||zt(b))||!oe(x)))return i?Uo:c;if(process.env.NODE_ENV!=="production"&&oe(b)&&t.messageCompiler==null)return vn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${c}'.`),c;let v=!1;const _=()=>{v=!0},B=zt(b)?b:Cu(t,c,x,b,S,_);if(v)return b;const A=Fb(t,x,w,d),P=hb(A),$=Vb(t,B,P),L=r?r($,c):$;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const j={timestamp:Date.now(),key:oe(c)?c:zt(b)?b.key:"",locale:x||(zt(b)?b.locale:""),format:oe(b)?b:zt(b)?b.source:"",message:L};j.meta=dt({},t.__meta,Tb()||{}),gb(j)}return L}function Ib(t){We(t.list)?t.list=t.list.map(e=>oe(e)?Md(e):e):Te(t.named)&&Object.keys(t.named).forEach(e=>{oe(t.named[e])&&(t.named[e]=Md(t.named[e]))})}function Eu(t,e,n,r,i,o){const{messages:s,onWarn:l,messageResolver:c,localeFallbacker:d}=t,u=d(t,r,n);let f=Le(),h,p=null,m=n,g=null;const y="translate";for(let k=0;k<u.length;k++){if(h=g=u[k],process.env.NODE_ENV!=="production"&&n!==h&&!mu(n,h)&&qo(i,e)&&l(mr(yt.FALLBACK_TO_TRANSLATE,{key:e,target:h})),process.env.NODE_ENV!=="production"&&n!==h){const S=t.__v_emitter;S&&S.emit("fallback",{type:y,key:e,from:m,to:g,groupId:`${y}:${e}`})}f=s[h]||Le();let x=null,w,b;if(process.env.NODE_ENV!=="production"&&bn&&(x=window.performance.now(),w="intlify-message-resolve-start",b="intlify-message-resolve-end",Lt&&Lt(w)),(p=c(f,e))===null&&(p=f[e]),process.env.NODE_ENV!=="production"&&bn){const S=window.performance.now(),v=t.__v_emitter;v&&x&&p&&v.emit("message-resolve",{type:"message-resolve",key:e,message:p,time:S-x,groupId:`${y}:${e}`}),w&&b&&Lt&&hr&&(Lt(b),hr("intlify message resolve",w,b))}if(oe(p)||en(p)||zt(p))break;if(!Ab(h,u)){const S=Ol(t,e,h,o,y);S!==e&&(p=S)}m=g}return[p,h,f]}function Cu(t,e,n,r,i,o){const{messageCompiler:s,warnHtmlMessage:l}=t;if(zt(r)){const h=r;return h.locale=h.locale||n,h.key=h.key||e,h}if(s==null){const h=()=>r;return h.locale=n,h.key=e,h}let c=null,d,u;process.env.NODE_ENV!=="production"&&bn&&(c=window.performance.now(),d="intlify-message-compilation-start",u="intlify-message-compilation-end",Lt&&Lt(d));const f=s(r,Pb(t,n,i,r,l,o));if(process.env.NODE_ENV!=="production"&&bn){const h=window.performance.now(),p=t.__v_emitter;p&&c&&p.emit("message-compilation",{type:"message-compilation",message:r,time:h-c,groupId:`translate:${e}`}),d&&u&&Lt&&hr&&(Lt(u),hr("intlify message compilation",d,u))}return f.locale=n,f.key=e,f.source=r,f}function Vb(t,e,n){let r=null,i,o;process.env.NODE_ENV!=="production"&&bn&&(r=window.performance.now(),i="intlify-message-evaluation-start",o="intlify-message-evaluation-end",Lt&&Lt(i));const s=e(n);if(process.env.NODE_ENV!=="production"&&bn){const l=window.performance.now(),c=t.__v_emitter;c&&r&&c.emit("message-evaluation",{type:"message-evaluation",value:s,time:l-r,groupId:`translate:${e.key}`}),i&&o&&Lt&&hr&&(Lt(o),hr("intlify message evaluation",i,o))}return s}function Nl(...t){const[e,n,r]=t,i=Le();if(!oe(e)&&!Ge(e)&&!zt(e)&&!en(e))throw sn(Je.INVALID_ARGUMENT);const o=Ge(e)?String(e):(zt(e),e);return Ge(n)?i.plural=n:oe(n)?i.default=n:Se(n)&&!Po(n)?i.named=n:We(n)&&(i.list=n),Ge(r)?i.plural=r:oe(r)?i.default=r:Se(r)&&dt(i,r),[o,i]}function Pb(t,e,n,r,i,o){return{locale:e,key:n,warnHtmlMessage:i,onError:s=>{if(o&&o(s),process.env.NODE_ENV!=="production"){const l=Rb(r),c=`Message compilation error: ${s.message}`,d=s.location&&l&&u1(l,s.location.start.offset,s.location.end.offset),u=t.__v_emitter;u&&l&&u.emit("compile-error",{message:l,error:s.message,start:s.location&&s.location.start.offset,end:s.location&&s.location.end.offset,groupId:`translate:${n}`}),console.error(d?`${c}
|
|
23
|
+
${d}`:c)}else throw s},onCacheKey:s=>r1(e,n,s)}}function Rb(t){if(oe(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function Fb(t,e,n,r){const{modifiers:i,pluralRules:o,messageResolver:s,fallbackLocale:l,fallbackWarn:c,missingWarn:d,fallbackContext:u}=t,h={locale:e,modifiers:i,pluralRules:o,messages:p=>{let m=s(n,p);if(m==null&&u){const[,,g]=Eu(u,p,e,l,c,d);m=s(g,p)}if(oe(m)||en(m)){let g=!1;const k=Cu(t,p,e,m,p,()=>{g=!0});return g?vu:k}else return zt(m)?m:vu}};return t.processor&&(h.processor=t.processor),r.list&&(h.list=r.list),r.named&&(h.named=r.named),Ge(r.plural)&&(h.pluralIndex=r.plural),h}const Su=typeof Intl<"u",Ou={dateTimeFormat:Su&&typeof Intl.DateTimeFormat<"u",numberFormat:Su&&typeof Intl.NumberFormat<"u"};function _u(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:s}=t,{__datetimeFormatters:l}=t;if(process.env.NODE_ENV!=="production"&&!Ou.dateTimeFormat)return o(mr(yt.CANNOT_FORMAT_DATE)),Yo;const[c,d,u,f]=Ml(...e),h=Be(u.missingWarn)?u.missingWarn:t.missingWarn,p=Be(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=El(t,u),y=s(t,i,g);if(!oe(c)||c==="")return new Intl.DateTimeFormat(g,f).format(d);let k={},x,w=null,b=g,S=null;const v="datetime format";for(let A=0;A<y.length;A++){if(x=S=y[A],process.env.NODE_ENV!=="production"&&g!==x&&qo(p,c)&&o(mr(yt.FALLBACK_TO_DATE_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const P=t.__v_emitter;P&&P.emit("fallback",{type:v,key:c,from:b,to:S,groupId:`${v}:${c}`})}if(k=n[x]||{},w=k[c],Se(w))break;Ol(t,c,x,h,v),b=S}if(!Se(w)||!oe(x))return r?Uo:c;let _=`${x}__${c}`;Po(f)||(_=`${_}__${JSON.stringify(f)}`);let B=l.get(_);return B||(B=new Intl.DateTimeFormat(x,dt({},w,f)),l.set(_,B)),m?B.formatToParts(d):B.format(d)}const Tu=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ml(...t){const[e,n,r,i]=t,o=Le();let s=Le(),l;if(oe(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw sn(Je.INVALID_ISO_DATE_ARGUMENT);const d=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();l=new Date(d);try{l.toISOString()}catch{throw sn(Je.INVALID_ISO_DATE_ARGUMENT)}}else if(o1(e)){if(isNaN(e.getTime()))throw sn(Je.INVALID_DATE_ARGUMENT);l=e}else if(Ge(e))l=e;else throw sn(Je.INVALID_ARGUMENT);return oe(n)?o.key=n:Se(n)&&Object.keys(n).forEach(c=>{Tu.includes(c)?s[c]=n[c]:o[c]=n[c]}),oe(r)?o.locale=r:Se(r)&&(s=r),Se(i)&&(s=i),[o.key||"",l,o,s]}function Nu(t,e,n){const r=t;for(const i in n){const o=`${e}__${i}`;r.__datetimeFormatters.has(o)&&r.__datetimeFormatters.delete(o)}}function Mu(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:s}=t,{__numberFormatters:l}=t;if(process.env.NODE_ENV!=="production"&&!Ou.numberFormat)return o(mr(yt.CANNOT_FORMAT_NUMBER)),Yo;const[c,d,u,f]=Al(...e),h=Be(u.missingWarn)?u.missingWarn:t.missingWarn,p=Be(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=El(t,u),y=s(t,i,g);if(!oe(c)||c==="")return new Intl.NumberFormat(g,f).format(d);let k={},x,w=null,b=g,S=null;const v="number format";for(let A=0;A<y.length;A++){if(x=S=y[A],process.env.NODE_ENV!=="production"&&g!==x&&qo(p,c)&&o(mr(yt.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const P=t.__v_emitter;P&&P.emit("fallback",{type:v,key:c,from:b,to:S,groupId:`${v}:${c}`})}if(k=n[x]||{},w=k[c],Se(w))break;Ol(t,c,x,h,v),b=S}if(!Se(w)||!oe(x))return r?Uo:c;let _=`${x}__${c}`;Po(f)||(_=`${_}__${JSON.stringify(f)}`);let B=l.get(_);return B||(B=new Intl.NumberFormat(x,dt({},w,f)),l.set(_,B)),m?B.formatToParts(d):B.format(d)}const Au=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Al(...t){const[e,n,r,i]=t,o=Le();let s=Le();if(!Ge(e))throw sn(Je.INVALID_ARGUMENT);const l=e;return oe(n)?o.key=n:Se(n)&&Object.keys(n).forEach(c=>{Au.includes(c)?s[c]=n[c]:o[c]=n[c]}),oe(r)?o.locale=r:Se(r)&&(s=r),Se(i)&&(s=i),[o.key||"",l,o,s]}function Du(t,e,n){const r=t;for(const i in n){const o=`${e}__${i}`;r.__numberFormatters.has(o)&&r.__numberFormatters.delete(o)}}U1();/*!
|
|
24
24
|
* vue-i18n v9.14.4
|
|
25
25
|
* (c) 2025 kazuya kawaguchi
|
|
26
26
|
* Released under the MIT License.
|
|
27
|
-
*/const zb="9.14.4";function jb(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(wn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(wn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1)}const Lu=yt.__EXTEND_POINT__,En=Ro(Lu),St={FALLBACK_TO_ROOT:Lu,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},Hb={[St.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[St.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[St.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[St.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[St.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[St.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[St.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[St.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[St.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ko(t,...e){return wl(Hb[t],...e)}const Bu=Je.__EXTEND_POINT__,_t=Ro(Bu),Re={UNEXPECTED_RETURN_TYPE:Bu,INVALID_ARGUMENT:_t(),MUST_BE_CALL_SETUP_TOP:_t(),NOT_INSTALLED:_t(),NOT_AVAILABLE_IN_LEGACY_MODE:_t(),REQUIRED_VALUE:_t(),INVALID_VALUE:_t(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:_t(),NOT_INSTALLED_WITH_PROVIDE:_t(),UNEXPECTED_ERROR:_t(),NOT_COMPATIBLE_LEGACY_VUE_I18N:_t(),BRIDGE_SUPPORT_VUE_2_ONLY:_t(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:_t(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:_t(),__EXTEND_POINT__:_t()};function Fn(t,...e){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:Wb,args:e}:void 0)}const Wb={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Dl=kn("__translateVNode"),Ll=kn("__datetimeParts"),Bl=kn("__numberParts"),$l=kn("__enableEmitter"),Il=kn("__disableEmitter"),Ub=kn("__setPluralRules"),$u=kn("__injectWithOption"),Vl=kn("__dispose");function Fi(t){if(!Te(t)||en(t))return t;for(const e in t)if(Xt(t,e))if(!e.includes("."))Te(t[e])&&Fi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=Le()),!Te(i[n[s]])){process.env.NODE_ENV!=="production"&&vn(Ko(St.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(en(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!en(i)){const s=i[n[r]];Te(s)&&Fi(s)}}return t}function Pl(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=Se(n)?n:We(r)?Le():{[t]:Le()};if(We(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:c,resource:d}=l;c?(s[c]=s[c]||Le(),zo(d,s[c])):zo(d,s)}else oe(l)&&zo(JSON.parse(l),s)}),i==null&&o)for(const l in s)Xt(s,l)&&Fi(s[l]);return s}function Iu(t){return t.type}function Yb(t,e,n){let r=Te(e.messages)?e.messages:Le();"__i18nGlobal"in n&&(r=Pl(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Te(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Te(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Vu(t){return a.createVNode(a.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],qb=()=>!1;let Fu=0;function zu(t){return(e,n,r,i)=>t(n,r,a.getCurrentInstance()||void 0,i)}const Kb=()=>{const t=a.getCurrentInstance();let e=null;return t&&(e=Iu(t)[Pu])?{[Pu]:e}:null};function Gb(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?a.ref:a.shallowRef,l=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&l&&$d(Ko(St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Be(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:oe(t.locale)?t.locale:Pi),u=s(n&&c?n.fallbackLocale.value:oe(t.fallbackLocale)||We(t.fallbackLocale)||Se(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Pl(d.value,t)),h=s(Se(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(Se(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Be(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Be(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Be(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?zu(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,S=n?n.warnHtmlMessage:Be(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const O=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let B=t.pluralRules||n&&n.pluralRules,A;A=(()=>{i&&fu(null);const F={version:zb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:O,pluralRules:B,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:S,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};F.datetimeFormats=h.value,F.numberFormats=p.value,F.__datetimeFormatters=Se(A)?A.__datetimeFormatters:void 0,F.__numberFormatters=Se(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(F.__v_emitter=Se(A)?A.__v_emitter:void 0);const Z=Mb(F);return i&&fu(Z),Z})(),Ri(A,d.value,u.value);function $(){return[d.value,u.value,f.value,h.value,p.value]}const L=a.computed({get:()=>d.value,set:F=>{d.value=F,A.locale=d.value}}),j=a.computed({get:()=>u.value,set:F=>{u.value=F,A.fallbackLocale=u.value,Ri(A,d.value,F)}}),z=a.computed(()=>f.value),D=a.computed(()=>h.value),C=a.computed(()=>p.value);function I(){return Ve(b)?b:null}function R(F){b=F,A.postTranslation=F}function ee(){return x}function te(F){F!==null&&(w=zu(F)),x=F,A.missing=w}function ce(F,Z){return F!=="translate"||!Z.resolvedMessage}const ue=(F,Z,T,M,Y,ne)=>{$();let fe;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=n?Nb():void 0),fe=F(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(T!=="translate exists"&&Ge(fe)&&fe===Uo||T==="translate exists"&&!fe){const[N,X]=Z();if(process.env.NODE_ENV!=="production"&&n&&oe(N)&&ce(T,X)&&(y&&(qo(g,N)||pu(m,N))&&vn(Ko(St.FALLBACK_TO_ROOT,{key:N,type:T})),process.env.NODE_ENV!=="production")){const{__v_emitter:ie}=A;ie&&y&&ie.emit("fallback",{type:T,key:N,to:"global",groupId:`${T}:${N}`})}return n&&y?M(n):Y(N)}else{if(ne(fe))return fe;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function V(...F){return ue(Z=>Reflect.apply(xu,null,[Z,...F]),()=>Nl(...F),"translate",Z=>Reflect.apply(Z.t,Z,[...F]),Z=>Z,Z=>oe(Z))}function W(...F){const[Z,T,M]=F;if(M&&!Te(M))throw Fn(Re.INVALID_ARGUMENT);return V(Z,T,dt({resolvedMessage:!0},M||{}))}function K(...F){return ue(Z=>Reflect.apply(Ou,null,[Z,...F]),()=>Ml(...F),"datetime format",Z=>Reflect.apply(Z.d,Z,[...F]),()=>Yo,Z=>oe(Z))}function q(...F){return ue(Z=>Reflect.apply(Mu,null,[Z,...F]),()=>Al(...F),"number format",Z=>Reflect.apply(Z.n,Z,[...F]),()=>Yo,Z=>oe(Z))}function H(F){return F.map(Z=>oe(Z)||Ge(Z)||Be(Z)?Vu(String(Z)):Z)}const ae={normalize:H,interpolate:F=>F,type:"vnode"};function we(...F){return ue(Z=>{let T;const M=Z;try{M.processor=ae,T=Reflect.apply(xu,null,[M,...F])}finally{M.processor=null}return T},()=>Nl(...F),"translate",Z=>Z[Dl](...F),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...F){return ue(Z=>Reflect.apply(Mu,null,[Z,...F]),()=>Al(...F),"number format",Z=>Z[Bl](...F),Ru,Z=>oe(Z)||We(Z))}function Ie(...F){return ue(Z=>Reflect.apply(Ou,null,[Z,...F]),()=>Ml(...F),"datetime format",Z=>Z[Ll](...F),Ru,Z=>oe(Z)||We(Z))}function tt(F){B=F,A.pluralRules=B}function Q(F,Z){return ue(()=>{if(!F)return!1;const T=oe(Z)?Z:d.value,M=lt(T),Y=A.messageResolver(M,F);return l?Y!=null:en(Y)||zt(Y)||oe(Y)},()=>[F],"translate exists",T=>Reflect.apply(T.te,T,[F,Z]),qb,T=>Be(T))}function Ee(F){let Z=null;const T=ru(A,u.value,d.value);for(let M=0;M<T.length;M++){const Y=f.value[T[M]]||{},ne=A.messageResolver(Y,F);if(ne!=null){Z=ne;break}}return Z}function At(F){const Z=Ee(F);return Z??(n?n.tm(F)||{}:{})}function lt(F){return f.value[F]||{}}function at(F,Z){if(o){const T={[F]:Z};for(const M in T)Xt(T,M)&&Fi(T[M]);Z=T[F]}f.value[F]=Z,A.messages=f.value}function pt(F,Z){f.value[F]=f.value[F]||{};const T={[F]:Z};if(o)for(const M in T)Xt(T,M)&&Fi(T[M]);Z=T[F],zo(Z,f.value[F]),A.messages=f.value}function E(F){return h.value[F]||{}}function _(F,Z){h.value[F]=Z,A.datetimeFormats=h.value,Nu(A,F,Z)}function U(F,Z){h.value[F]=dt(h.value[F]||{},Z),A.datetimeFormats=h.value,Nu(A,F,Z)}function se(F){return p.value[F]||{}}function Me(F,Z){p.value[F]=Z,A.numberFormats=p.value,Du(A,F,Z)}function _e(F,Z){p.value[F]=dt(p.value[F]||{},Z),A.numberFormats=p.value,Du(A,F,Z)}Fu++,n&&bn&&(a.watch(n.locale,F=>{c&&(d.value=F,A.locale=F,Ri(A,d.value,u.value))}),a.watch(n.fallbackLocale,F=>{c&&(u.value=F,A.fallbackLocale=F,Ri(A,d.value,u.value))}));const Oe={id:Fu,locale:L,fallbackLocale:j,get inheritLocale(){return c},set inheritLocale(F){c=F,F&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ri(A,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:z,get modifiers(){return O},get pluralRules(){return B||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(F){m=F,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(F){g=F,A.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(F){y=F},get fallbackFormat(){return k},set fallbackFormat(F){k=F,A.fallbackFormat=k},get warnHtmlMessage(){return S},set warnHtmlMessage(F){S=F,A.warnHtmlMessage=F},get escapeParameter(){return v},set escapeParameter(F){v=F,A.escapeParameter=F},t:V,getLocaleMessage:lt,setLocaleMessage:at,mergeLocaleMessage:pt,getPostTranslationHandler:I,setPostTranslationHandler:R,getMissingHandler:ee,setMissingHandler:te,[Ub]:tt};return Oe.datetimeFormats=D,Oe.numberFormats=C,Oe.rt=W,Oe.te=Q,Oe.tm=At,Oe.d=K,Oe.n=q,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=_,Oe.mergeDateTimeFormat=U,Oe.getNumberFormat=se,Oe.setNumberFormat=Me,Oe.mergeNumberFormat=_e,Oe[$u]=r,Oe[Dl]=we,Oe[Ll]=Ie,Oe[Bl]=Ne,process.env.NODE_ENV!=="production"&&(Oe[$l]=F=>{A.__v_emitter=F},Oe[Il]=()=>{A.__v_emitter=void 0}),Oe}const Rl={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Jb({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===a.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Le())}function ju(t){return a.Fragment}dt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ge(t)||!isNaN(t)}},Rl);function Zb(t){return We(t)&&!oe(t[0])}function Hu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let l=Le();t.locale&&(s.locale=t.locale),oe(t.format)?s.key=t.format:Te(t.format)&&(oe(t.format.key)&&(s.key=t.format.key),l=Object.keys(t.format).reduce((h,p)=>n.includes(p)?dt(Le(),h,{[p]:t.format[p]}):h,Le()));const c=r(t.value,s,l);let d=[s.key];We(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return Zb(g)&&(g[0].key=`${h.type}-${p}`),g}):oe(c)&&(d=[c]);const u=dt(Le(),o),f=oe(t.tag)||Te(t.tag)?t.tag:ju();return a.h(f,u,d)}}dt({value:{type:Number,required:!0},format:{type:[String,Object]}},Rl),dt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rl);function Wu(t,e){}const Xb=kn("global-vue-i18n");function zn(t={}){const e=a.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=Qb(e),r=tk(n),i=Iu(e),o=ek(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return ok(e,o,r,t)}if(o==="global")return Yb(r,t,i),r;if(o==="parent"){let c=nk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&vn(Ko(St.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let l=s.__getInstance(e);if(l==null){const c=dt({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),l=Gb(c),s.__composerExtend&&(l[Vl]=s.__composerExtend(l)),ik(s,e,l),s.__setInstance(e,l)}return l}function Qb(t){{const e=a.inject(t.isCE?Xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function ek(t,e){return Po(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function tk(t){return t.mode==="composition"?t.global:t.global.__composer}function nk(t,e,n=!1){let r=null;const i=e.root;let o=rk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const l=s.__getInstance(o);l!=null&&(r=l.__composer,n&&r&&!r[$u]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function rk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function ik(t,e,n){let r=null;a.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=f1();const i=n;i[$l]&&i[$l](r),r.on("*",Wu)}},e),a.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[Il]&&i[Il](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Vl];o&&(o(),delete i[Vl])},e)}function ok(t,e,n,r={}){const i=e==="local",o=a.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Be(r.inheritLocale)?r.inheritLocale:!oe(r.locale),l=a.ref(!i||s?n.locale.value:oe(r.locale)?r.locale:Pi),c=a.ref(!i||s?n.fallbackLocale.value:oe(r.fallbackLocale)||We(r.fallbackLocale)||Se(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),d=a.ref(Pl(l.value,r)),u=a.ref(Se(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),f=a.ref(Se(r.numberFormats)?r.numberFormats:{[l.value]:{}}),h=i?n.missingWarn:Be(r.missingWarn)||Wr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Be(r.fallbackWarn)||Wr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Be(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Be(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},S=r.pluralRules||i&&n.pluralRules;function v(){return[l.value,c.value,d.value,u.value,f.value]}const O=a.computed({get:()=>o.value?o.value.locale.value:l.value,set:Q=>{o.value&&(o.value.locale.value=Q),l.value=Q}}),B=a.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),A=a.computed(()=>o.value?o.value.messages.value:d.value),P=a.computed(()=>u.value),$=a.computed(()=>f.value);function L(){return o.value?o.value.getPostTranslationHandler():k}function j(Q){o.value&&o.value.setPostTranslationHandler(Q)}function z(){return o.value?o.value.getMissingHandler():y}function D(Q){o.value&&o.value.setMissingHandler(Q)}function C(Q){return v(),Q()}function I(...Q){return o.value?C(()=>Reflect.apply(o.value.t,null,[...Q])):C(()=>"")}function R(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?C(()=>Reflect.apply(o.value.d,null,[...Q])):C(()=>"")}function te(...Q){return o.value?C(()=>Reflect.apply(o.value.n,null,[...Q])):C(()=>"")}function ce(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function V(Q){return o.value?o.value.getLocaleMessage(Q):{}}function W(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function K(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function q(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function H(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function de(Q,Ee){o.value&&o.value.mergeDateTimeFormat(Q,Ee)}function ae(Q){return o.value?o.value.getNumberFormat(Q):{}}function we(Q,Ee){o.value&&(o.value.setNumberFormat(Q,Ee),f.value[Q]=Ee)}function Ne(Q,Ee){o.value&&o.value.mergeNumberFormat(Q,Ee)}const Ie={get id(){return o.value?o.value.id:-1},locale:O,fallbackLocale:B,messages:A,datetimeFormats:P,numberFormats:$,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(Q){o.value&&(o.value.inheritLocale=Q)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:S},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(Q){o.value&&(o.value.fallbackRoot=Q)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(Q){o.value&&(o.value.fallbackFormat=Q)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(Q){o.value&&(o.value.warnHtmlMessage=Q)},get escapeParameter(){return o.value?o.value.escapeParameter:w},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:I,getPostTranslationHandler:L,setPostTranslationHandler:j,getMissingHandler:z,setMissingHandler:D,rt:R,d:ee,n:te,tm:ce,te:ue,getLocaleMessage:V,setLocaleMessage:W,mergeLocaleMessage:K,getDateTimeFormat:q,setDateTimeFormat:H,mergeDateTimeFormat:de,getNumberFormat:ae,setNumberFormat:we,mergeNumberFormat:Ne};function tt(Q){Q.locale.value=l.value,Q.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{Q.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{Q.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{Q.mergeNumberFormat(Ee,f.value[Ee])}),Q.escapeParameter=w,Q.fallbackFormat=g,Q.fallbackRoot=m,Q.fallbackWarn=p,Q.missingWarn=h,Q.warnHtmlMessage=x}return a.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Q=o.value=t.proxy.$i18n.__composer;e==="global"?(l.value=Q.locale.value,c.value=Q.fallbackLocale.value,d.value=Q.messages.value,u.value=Q.datetimeFormats.value,f.value=Q.numberFormats.value):i&&tt(Q)}),Ie}if(jb(),__INTLIFY_JIT_COMPILATION__?lu($b):lu(Bb),Sb(ob),_b(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=wn();t.__INTLIFY__=!0,pb(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const sk={},lk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ak=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ck(t,e){return a.openBlock(),a.createElementBlock("svg",lk,ak)}const Uu=be(sk,[["render",ck]]),dk={},uk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},fk=[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 hk(t,e){return a.openBlock(),a.createElementBlock("svg",uk,fk)}const Fl=be(dk,[["render",hk]]),pk={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},mk={class:"flex items-center gap-2"},gk={key:0},yk={class:""},bk={class:"flex justify-end"},kk={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},wk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},vk={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},zi=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",pk,[a.createElementVNode("div",mk,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",gk,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",yk,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",bk,[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(he).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(he).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",kk,[a.createElementVNode("div",wk,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",vk,[a.createVNode(Fr,{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($i,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var Yu=typeof global=="object"&&global&&global.Object===Object&&global,xk=typeof self=="object"&&self&&self.Object===Object&&self,ln=Yu||xk||Function("return this")(),Gr=ln.Symbol,qu=Object.prototype,Ek=qu.hasOwnProperty,Ck=qu.toString,ji=Gr?Gr.toStringTag:void 0;function Sk(t){var e=Ek.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Ck.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var _k=Object.prototype,Ok=_k.toString;function Tk(t){return Ok.call(t)}var Nk="[object Null]",Mk="[object Undefined]",Ku=Gr?Gr.toStringTag:void 0;function Jr(t){return t==null?t===void 0?Mk:Nk:Ku&&Ku in Object(t)?Sk(t):Tk(t)}function Zr(t){return t!=null&&typeof t=="object"}var Ak="[object Symbol]";function Dk(t){return typeof t=="symbol"||Zr(t)&&Jr(t)==Ak}var Go=Array.isArray,Lk=/\s/;function Bk(t){for(var e=t.length;e--&&Lk.test(t.charAt(e)););return e}var $k=/^\s+/;function Ik(t){return t&&t.slice(0,Bk(t)+1).replace($k,"")}function Hi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gu=NaN,Vk=/^[-+]0x[0-9a-f]+$/i,Pk=/^0b[01]+$/i,Rk=/^0o[0-7]+$/i,Fk=parseInt;function Ju(t){if(typeof t=="number")return t;if(Dk(t))return Gu;if(Hi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ik(t);var n=Pk.test(t);return n||Rk.test(t)?Fk(t.slice(2),n?2:8):Vk.test(t)?Gu:+t}var zk="[object AsyncFunction]",jk="[object Function]",Hk="[object GeneratorFunction]",Wk="[object Proxy]";function Zu(t){if(!Hi(t))return!1;var e=Jr(t);return e==jk||e==Hk||e==zk||e==Wk}var zl=ln["__core-js_shared__"],Xu=function(){var t=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Uk(t){return!!Xu&&Xu in t}var Yk=Function.prototype,qk=Yk.toString;function yr(t){if(t!=null){try{return qk.call(t)}catch{}try{return t+""}catch{}}return""}var Kk=/[\\^$.*+?()[\]{}|]/g,Gk=/^\[object .+?Constructor\]$/,Jk=Function.prototype,Zk=Object.prototype,Xk=Jk.toString,Qk=Zk.hasOwnProperty,e2=RegExp("^"+Xk.call(Qk).replace(Kk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t2(t){if(!Hi(t)||Uk(t))return!1;var e=Zu(t)?e2:Gk;return e.test(yr(t))}function n2(t,e){return t==null?void 0:t[e]}function Xr(t,e){var n=n2(t,e);return t2(n)?n:void 0}var jl=Xr(ln,"WeakMap"),r2=9007199254740991,i2=/^(?:0|[1-9]\d*)$/;function o2(t,e){var n=typeof t;return e=e??r2,!!e&&(n=="number"||n!="symbol"&&i2.test(t))&&t>-1&&t%1==0&&t<e}function Qu(t,e){return t===e||t!==t&&e!==e}var s2=9007199254740991;function ef(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s2}function l2(t){return t!=null&&ef(t.length)&&!Zu(t)}var a2=Object.prototype;function c2(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||a2;return t===n}function d2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var u2="[object Arguments]";function tf(t){return Zr(t)&&Jr(t)==u2}var nf=Object.prototype,f2=nf.hasOwnProperty,h2=nf.propertyIsEnumerable,p2=tf(function(){return arguments}())?tf:function(t){return Zr(t)&&f2.call(t,"callee")&&!h2.call(t,"callee")};function m2(){return!1}var rf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,g2=of&&of.exports===rf,sf=g2?ln.Buffer:void 0,y2=sf?sf.isBuffer:void 0,Hl=y2||m2,b2="[object Arguments]",k2="[object Array]",w2="[object Boolean]",v2="[object Date]",x2="[object Error]",E2="[object Function]",C2="[object Map]",S2="[object Number]",_2="[object Object]",O2="[object RegExp]",T2="[object Set]",N2="[object String]",M2="[object WeakMap]",A2="[object ArrayBuffer]",D2="[object DataView]",L2="[object Float32Array]",B2="[object Float64Array]",$2="[object Int8Array]",I2="[object Int16Array]",V2="[object Int32Array]",P2="[object Uint8Array]",R2="[object Uint8ClampedArray]",F2="[object Uint16Array]",z2="[object Uint32Array]",Pe={};Pe[L2]=Pe[B2]=Pe[$2]=Pe[I2]=Pe[V2]=Pe[P2]=Pe[R2]=Pe[F2]=Pe[z2]=!0,Pe[b2]=Pe[k2]=Pe[A2]=Pe[w2]=Pe[D2]=Pe[v2]=Pe[x2]=Pe[E2]=Pe[C2]=Pe[S2]=Pe[_2]=Pe[O2]=Pe[T2]=Pe[N2]=Pe[M2]=!1;function j2(t){return Zr(t)&&ef(t.length)&&!!Pe[Jr(t)]}function H2(t){return function(e){return t(e)}}var lf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Wi=lf&&typeof module=="object"&&module&&!module.nodeType&&module,W2=Wi&&Wi.exports===lf,Wl=W2&&Yu.process,af=function(){try{var t=Wi&&Wi.require&&Wi.require("util").types;return t||Wl&&Wl.binding&&Wl.binding("util")}catch{}}(),cf=af&&af.isTypedArray,df=cf?H2(cf):j2,U2=Object.prototype,Y2=U2.hasOwnProperty;function q2(t,e){var n=Go(t),r=!n&&p2(t),i=!n&&!r&&Hl(t),o=!n&&!r&&!i&&df(t),s=n||r||i||o,l=s?d2(t.length,String):[],c=l.length;for(var d in t)Y2.call(t,d)&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||o2(d,c)))&&l.push(d);return l}function K2(t,e){return function(n){return t(e(n))}}var G2=K2(Object.keys,Object),J2=Object.prototype,Z2=J2.hasOwnProperty;function X2(t){if(!c2(t))return G2(t);var e=[];for(var n in Object(t))Z2.call(t,n)&&n!="constructor"&&e.push(n);return e}function Q2(t){return l2(t)?q2(t):X2(t)}var Ui=Xr(Object,"create");function ew(){this.__data__=Ui?Ui(null):{},this.size=0}function tw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nw="__lodash_hash_undefined__",rw=Object.prototype,iw=rw.hasOwnProperty;function ow(t){var e=this.__data__;if(Ui){var n=e[t];return n===nw?void 0:n}return iw.call(e,t)?e[t]:void 0}var sw=Object.prototype,lw=sw.hasOwnProperty;function aw(t){var e=this.__data__;return Ui?e[t]!==void 0:lw.call(e,t)}var cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ui&&e===void 0?cw:e,this}function br(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])}}br.prototype.clear=ew,br.prototype.delete=tw,br.prototype.get=ow,br.prototype.has=aw,br.prototype.set=dw;function uw(){this.__data__=[],this.size=0}function Jo(t,e){for(var n=t.length;n--;)if(Qu(t[n][0],e))return n;return-1}var fw=Array.prototype,hw=fw.splice;function pw(t){var e=this.__data__,n=Jo(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():hw.call(e,n,1),--this.size,!0}function mw(t){var e=this.__data__,n=Jo(e,t);return n<0?void 0:e[n][1]}function gw(t){return Jo(this.__data__,t)>-1}function yw(t,e){var n=this.__data__,r=Jo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cn(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])}}Cn.prototype.clear=uw,Cn.prototype.delete=pw,Cn.prototype.get=mw,Cn.prototype.has=gw,Cn.prototype.set=yw;var Yi=Xr(ln,"Map");function bw(){this.size=0,this.__data__={hash:new br,map:new(Yi||Cn),string:new br}}function kw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zo(t,e){var n=t.__data__;return kw(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ww(t){var e=Zo(this,t).delete(t);return this.size-=e?1:0,e}function vw(t){return Zo(this,t).get(t)}function xw(t){return Zo(this,t).has(t)}function Ew(t,e){var n=Zo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function kr(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])}}kr.prototype.clear=bw,kr.prototype.delete=ww,kr.prototype.get=vw,kr.prototype.has=xw,kr.prototype.set=Ew;function Cw(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Sw(){this.__data__=new Cn,this.size=0}function _w(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Ow(t){return this.__data__.get(t)}function Tw(t){return this.__data__.has(t)}var Nw=200;function Mw(t,e){var n=this.__data__;if(n instanceof Cn){var r=n.__data__;if(!Yi||r.length<Nw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kr(r)}return n.set(t,e),this.size=n.size,this}function jn(t){var e=this.__data__=new Cn(t);this.size=e.size}jn.prototype.clear=Sw,jn.prototype.delete=_w,jn.prototype.get=Ow,jn.prototype.has=Tw,jn.prototype.set=Mw;function Aw(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}function Dw(){return[]}var Lw=Object.prototype,Bw=Lw.propertyIsEnumerable,uf=Object.getOwnPropertySymbols,$w=uf?function(t){return t==null?[]:(t=Object(t),Aw(uf(t),function(e){return Bw.call(t,e)}))}:Dw;function Iw(t,e,n){var r=e(t);return Go(t)?r:Cw(r,n(t))}function ff(t){return Iw(t,Q2,$w)}var Ul=Xr(ln,"DataView"),Yl=Xr(ln,"Promise"),ql=Xr(ln,"Set"),hf="[object Map]",Vw="[object Object]",pf="[object Promise]",mf="[object Set]",gf="[object WeakMap]",yf="[object DataView]",Pw=yr(Ul),Rw=yr(Yi),Fw=yr(Yl),zw=yr(ql),jw=yr(jl),Hn=Jr;(Ul&&Hn(new Ul(new ArrayBuffer(1)))!=yf||Yi&&Hn(new Yi)!=hf||Yl&&Hn(Yl.resolve())!=pf||ql&&Hn(new ql)!=mf||jl&&Hn(new jl)!=gf)&&(Hn=function(t){var e=Jr(t),n=e==Vw?t.constructor:void 0,r=n?yr(n):"";if(r)switch(r){case Pw:return yf;case Rw:return hf;case Fw:return pf;case zw:return mf;case jw:return gf}return e});var bf=ln.Uint8Array,Hw="__lodash_hash_undefined__";function Ww(t){return this.__data__.set(t,Hw),this}function Uw(t){return this.__data__.has(t)}function Xo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new kr;++e<n;)this.add(t[e])}Xo.prototype.add=Xo.prototype.push=Ww,Xo.prototype.has=Uw;function Yw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function qw(t,e){return t.has(e)}var Kw=1,Gw=2;function kf(t,e,n,r,i,o){var s=n&Kw,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&Gw?new Xo: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(!Yw(e,function(k,x){if(!qw(p,x)&&(m===k||i(m,k,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}function Jw(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Zw(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Xw=1,Qw=2,ev="[object Boolean]",tv="[object Date]",nv="[object Error]",rv="[object Map]",iv="[object Number]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",av="[object Symbol]",cv="[object ArrayBuffer]",dv="[object DataView]",wf=Gr?Gr.prototype:void 0,Kl=wf?wf.valueOf:void 0;function uv(t,e,n,r,i,o,s){switch(n){case dv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case cv:return!(t.byteLength!=e.byteLength||!o(new bf(t),new bf(e)));case ev:case tv:case iv:return Qu(+t,+e);case nv:return t.name==e.name&&t.message==e.message;case ov:case lv:return t==e+"";case rv:var l=Jw;case sv:var c=r&Xw;if(l||(l=Zw),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=Qw,s.set(t,e);var u=kf(l(t),l(e),r,i,o,s);return s.delete(t),u;case av:if(Kl)return Kl.call(t)==Kl.call(e)}return!1}var fv=1,hv=Object.prototype,pv=hv.hasOwnProperty;function mv(t,e,n,r,i,o){var s=n&fv,l=ff(t),c=l.length,d=ff(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:pv.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 k=t[h],x=e[h];if(r)var w=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(w===void 0?k===x||i(k,x,n,r,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,S=e.constructor;b!=S&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(t),o.delete(e),g}var gv=1,vf="[object Arguments]",xf="[object Array]",Qo="[object Object]",yv=Object.prototype,Ef=yv.hasOwnProperty;function bv(t,e,n,r,i,o){var s=Go(t),l=Go(e),c=s?xf:Hn(t),d=l?xf:Hn(e);c=c==vf?Qo:c,d=d==vf?Qo:d;var u=c==Qo,f=d==Qo,h=c==d;if(h&&Hl(t)){if(!Hl(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new jn),s||df(t)?kf(t,e,n,r,i,o):uv(t,e,c,n,r,i,o);if(!(n&gv)){var p=u&&Ef.call(t,"__wrapped__"),m=f&&Ef.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new jn),i(g,y,n,r,o)}}return h?(o||(o=new jn),mv(t,e,n,r,i,o)):!1}function Cf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Zr(t)&&!Zr(e)?t!==t&&e!==e:bv(t,e,n,r,Cf,i)}var Gl=function(){return ln.Date.now()},kv="Expected a function",wv=Math.max,vv=Math.min;function Jl(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(kv);e=Ju(e)||0,Hi(n)&&(u=!!n.leading,f="maxWait"in n,o=f?wv(Ju(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var O=r,B=i;return r=i=void 0,d=v,s=t.apply(B,O),s}function m(v){return d=v,l=setTimeout(k,e),u?p(v):s}function g(v){var O=v-c,B=v-d,A=e-O;return f?vv(A,o-B):A}function y(v){var O=v-c,B=v-d;return c===void 0||O>=e||O<0||f&&B>=o}function k(){var v=Gl();if(y(v))return x(v);l=setTimeout(k,g(v))}function x(v){return l=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function b(){return l===void 0?s:x(Gl())}function S(){var v=Gl(),O=y(v);if(r=arguments,i=this,c=v,O){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(k,e),p(c)}return l===void 0&&(l=setTimeout(k,e)),s}return S.cancel=w,S.flush=b,S}function qi(t,e){return Cf(t,e)}const xv={},Ev={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Cv=[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 Sv(t,e){return a.openBlock(),a.createElementBlock("svg",Ev,Cv)}const _v=be(xv,[["render",Sv]]),Ov={key:0,class:"leading-none"},Tv={key:1},Nv={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Mv={key:1},Av={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Dv=["onClick"],Lv={class:"select-none flex w-full items-center justify-between"},Bv={class:"flex-1"},$v={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},Iv={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},Sf=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,summaryText:String,oneLine:Boolean,total:{type:Number,default:null},groupSelected:{type:Boolean,default:!1}},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=zn(),o=a.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=a.ref(!1),l=a.ref(r.options);a.watch(()=>r.options,()=>{const L=(Array.isArray(r.modelValue)?r.modelValue:r.modelValue!==null&&r.modelValue!==void 0?[r.modelValue]:[]).map(j=>l.value.find(z=>qi(z.value,j))||r.options.find(z=>qi(z.value,j))).filter(Boolean);if(!r.groupSelected||!r.multiple){const j=new Set;l.value=[...r.options,...L].filter(z=>{const D=JSON.stringify(z.value);return j.has(D)?!1:(j.add(D),!0)})}else{const j=[...L];for(const z of r.options)j.some(D=>qi(D.value,z.value))||j.push(z);l.value=j}},{immediate:!0,deep:!0});const c=n,d=a.ref(),u=a.ref();function f($){var L,j;if(r.multiple){if($){let z=r.modelValue||[];z.indexOf($)>=0?z.splice(z.indexOf($),1):z.push($),c("update:modelValue",z),g(z),((L=r.modelValue)==null?void 0:L.length)===((j=r.options)==null?void 0:j.length)?s.value=!0:s.value=!1}}else c("update:modelValue",$),g($),d.value=null,u.value.hide()}async function h($){var L,j;c("update:modelValue",$),g($),await a.nextTick(),((L=r.modelValue)==null?void 0:L.length)===((j=r.options)==null?void 0:j.length)&&(s.value=!0)}function p($){c("update:modelValue",$),s.value=!1,g($)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=Jl(function($){c("change",$)},r.debounce),y=a.computed(()=>{var $,L,j,z;if(r.multiple){const D=(($=l.value)==null?void 0:$.filter(I=>{var R;return(R=r.modelValue)==null?void 0:R.includes(I.value)}))||[],C=((L=r.modelValue)==null?void 0:L.length)||0;if(r.summaryText&&C>0){const I=i(r.summaryText,C);return i("wpiccomponents.summary_items",{count:C,type:I})}if(r.maxDisplay){const I=D.slice(0,r.maxDisplay);return D.length-I.length>0?`${I.map(R=>R.label).join(", ")} (+${D.length-I.length})`:I.map(R=>R.label).join(", ")}else return D.map(I=>I.label).join(", ")}else return((z=(j=l.value)==null?void 0:j.find(D=>D.value===r.modelValue))==null?void 0:z.label)||r.modelValue});function k($){var L;try{return r.multiple?r.modelValue!==null&&((L=r.modelValue)==null?void 0:L.some(j=>qi(j,$))):r.modelValue!==null&&qi($,r.modelValue)}catch(j){return console.log(j),!1}}const x={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"},w=a.computed(()=>{var $,L;return(($=r.modelValue)==null?void 0:$.length)===((L=r.options)==null?void 0:L.length)}),b=a.computed(()=>{var D;const $=l.value||[];if(r.filterable&&!r.remoteMethod&&((D=d.value)!=null&&D.trim().length)){const C=d.value.trim().toLowerCase(),I=$.filter(ce=>{var ue;return(ue=ce.label)==null?void 0:ue.toLowerCase().includes(C)});if(!r.groupSelected||!r.multiple)return I;const R=r.modelValue||[],ee=I.filter(ce=>R.includes(ce.value)),te=I.filter(ce=>!R.includes(ce.value));return[...ee,...te]}if(!r.groupSelected||!r.multiple)return $;const L=r.modelValue||[],j=$.filter(C=>L.includes(C.value)),z=$.filter(C=>!L.includes(C.value));return[...j,...z]});function S(){v.value=1,r.remoteMethod&&(O.value=!0,P(d.value,v.value,()=>{O.value=!1}))}const v=a.ref(1),O=a.ref(!1),B=a.computed(()=>{var $;return r.total!==void 0&&(($=r.options)==null?void 0:$.length)>=r.total});function A($){const L=$.target;L.scrollTop+L.clientHeight>=L.scrollHeight-30&&!O.value&&!B.value&&(O.value=!0,v.value+=1,P(d.value,v.value,()=>{O.value=!1}))}const P=Jl(($,L,j)=>{r.remoteMethod($,L).finally(()=>{j==null||j()})},r.debounce||300);return e({allSelected:s,isAllSelected:w}),($,L)=>(a.openBlock(),a.createBlock(fr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:j})=>[a.createVNode(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var z,D,C,I,R,ee;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&&((z=t.modelValue)==null?void 0:z.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Ov,[w.value&&((D=t.allSelectedText)!=null&&D.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((C=t.options)==null?void 0:C.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(y.value),1)],64))])):!t.multiple&&((I=t.options)!=null&&I.find(te=>te.value===null))?(a.openBlock(),a.createElementBlock("span",Tv,a.toDisplayString((ee=(R=t.options)==null?void 0:R.find(te=>te.value===null))==null?void 0:ee.label),1)):a.renderSlot($.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(m,["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($i,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(_v,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var j,z;return[a.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:A},[t.filterable?(a.openBlock(),a.createElementBlock("div",Nv,[a.createVNode(Nf,{slim:"",placeholder:$.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[L[0]||(L[0]=D=>d.value=D),S]},null,8,["placeholder","modelValue"])])):a.createCommentVNode("",!0),!t.options&&((j=t.options)==null?void 0:j.length)==0?(a.openBlock(),a.createElementBlock("span",Mv,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Av,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:L[1]||(L[1]=D=>{var C;return h((C=b.value)==null?void 0:C.filter(I=>I.value).map(I=>I.value))})},a.toDisplayString($.$t("wpiccomponents.select_all")),1),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:L[2]||(L[2]=D=>p([]))},a.toDisplayString($.$t("wpiccomponents.select_none")),1)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,D=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!k(D.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||D.value,[`${x[a.unref(he).theme]}`]:!0}]),onClick:C=>D.disabled?null:f(D.value)},[a.createElementVNode("div",Lv,[a.createElementVNode("div",Bv,[a.createElementVNode("div",{class:a.normalizeClass(["",{"opacity-25":D.disabled,"line-clamp-1":t.oneLine}])},a.toDisplayString(D.label||D.value),3),D.description?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":D.disabled}])},a.toDisplayString(D.description),3)):a.createCommentVNode("",!0)]),t.multiple&&k(D.value)?(a.openBlock(),a.createBlock(Uu,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,Dv)],2))),256)),r.remoteMethod?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[O.value?(a.openBlock(),a.createElementBlock("div",$v,a.toDisplayString($.$t("wpiccomponents.loading_more")),1)):B.value&&((z=t.options)==null?void 0:z.length)>0?(a.openBlock(),a.createElementBlock("div",Iv,a.toDisplayString($.$t("wpiccomponents.no_more_results")),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64))],32)]}),_:3},8,["label","disabled"]))}}),_f=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))}}),Vv={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Pv={class:""},Rv=["value","disabled","rows","placeholder"],Of=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",Vv,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",Pv,[d.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{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,Rv)],64))}}),Fv=["placeholder"],Tf={__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(zi,{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,Fv),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},zv={},jv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Hv=[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 Wv(t,e){return a.openBlock(),a.createElementBlock("svg",jv,Hv)}const Uv=be(zv,[["render",Wv]]),Yv={},qv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Kv=[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 Gv(t,e){return a.openBlock(),a.createElementBlock("svg",qv,Kv)}const Jv=be(Yv,[["render",Gv]]),Zv={},Xv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Qv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function ex(t,e){return a.openBlock(),a.createElementBlock("svg",Xv,Qv)}const tx=be(Zv,[["render",ex]]),nx={class:"flex items-center gap-2"},rx={key:0},ix={class:""},ox=["innerHTML"],sx={class:"flex justify-end"},lx=["name","value","checked"],ax={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},cx={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},dx={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},ux={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Nf=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,summaryText:String,oneLine:Boolean,total:Number},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:kl()),l=Y0(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 P;if(o.rules&&typeof o.rules=="string"){let $=(P=o.rules)==null?void 0:P.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(P){let $=P&&P.target?P.target.value:P;x($)}const m=n;function g(P){P===!0||P===!1?m("update:modelValue",!P):m("update:modelValue",P)}function y(P){let $=P&&P.target?P.target.value:P;m("update:modelValue",$),m("onChange",$)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=Jl(function(P){m("update:modelValue",P),m("onChange",P)},o.debounce),w=a.ref(null),b=a.ref();function S(){var P,$;o.textarea?(P=b.value)==null||P.focus():($=w.value)==null||$.$el.focus()}function v(){return w.value.meta.valid}const O=a.ref(),B=a.computed(()=>O.value.allSelected),A=a.computed(()=>O.value.isAllSelected);return e({focus:S,isValid:v,allSelected:B,isAllSelected:A}),(P,$)=>(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",nx,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",rx,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",ix,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,ox)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",sx,[a.renderSlot(P.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:L})=>[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]=j=>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(he).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(Uu,{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(P.$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(cr),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:L})=>[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]=(...j)=>P.onChange&&P.onChange(...j)),checked:t.radioValue==t.modelValue},null,40,lx),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(cr),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>{var j;return[a.createVNode(Sf,{ref_key:"myChoiceList",ref:O,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,oneLine:t.oneLine,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,summaryText:t.summaryText,debounce:t.debounce,total:t.total,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((j=h.value)==null?void 0:j.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","debounce","total","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(cr),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>[a.createVNode(Tf,{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(cr),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>[a.createVNode(_f,{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(he).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)}])},[P.$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",ax,[a.renderSlot(P.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var L;return[a.createVNode(Of,{ref_key:"myTextarea",ref:b,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||((L=h.value)==null?void 0:L.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(cr),{key:2,ref_key:"myInput",ref:w,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":!P.$slots.prepend&&!t.naked,"pl-8":P.$slots.prepend&&!t.naked,"pl-6":P.$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(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(k,["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($i,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),P.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",cx,[a.createElementVNode("div",dx,[a.renderSlot(P.$slots,"append",{},()=>[a.withDirectives(a.createVNode(Uv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(Jv,{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",ux,[a.createVNode(a.unref(U0),{name:s.value},{default:a.withCtx(L=>[a.createTextVNode(a.toDisplayString(L.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),P.$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(P.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),fx=["innerHTML"],Mf=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();kl();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 Od(e.value,n.value,{placement:i.placement,middleware:[_d(),Sd(),Cd(i.offset),qy({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,fx),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),hx={key:1,class:"flex justify-between items-baseline pt-4 px-6"},px={class:""},mx={key:2,class:"flex items-center justify-end py-4 px-6"},gx=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(he).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",hx,[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(he).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",px,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",mx,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),yx={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},bx={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},kx=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(he).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",yx,[a.createElementVNode("div",bx,[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))}}),wx=a.createElementVNode("div",{class:""},null,-1),vx=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),xx=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(he).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(he).theme]}`]:!0}])},[a.createVNode(Mf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[wx]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[vx],64)):a.createCommentVNode("",!0)],2))}}),Ex={class:"leading-none"},Cx=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(he).theme]]:!0}])},[a.createElementVNode("span",Ex,[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($i,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Sx=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))}}),_x=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),Ox={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Tx=[_x(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Nx=be(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",Ox,Tx)):(a.openBlock(),a.createBlock(Fr,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Mx={class:"text-base font-medium select-none"},Ki=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(he).theme]]:!t.active&&!t.disabled,[n[a.unref(he).theme]]:t.active&&!t.disabled,[r[a.unref(he).theme]]:t.disabled}])},[a.createElementVNode("span",Mx,[a.renderSlot(i.$slots,"default")])],2))}}),Ax={},Dx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Lx=[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 Bx(t,e){return a.openBlock(),a.createElementBlock("svg",Dx,Lx)}const Af=be(Ax,[["render",Bx]]),$x={},Ix={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Vx=[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 Px(t,e){return a.openBlock(),a.createElementBlock("svg",Ix,Vx)}const Df=be($x,[["render",Px]]),Rx={},Fx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},zx=[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 jx(t,e){return a.openBlock(),a.createElementBlock("svg",Fx,zx)}const Lf=be(Rx,[["render",jx]]),Hx={},Wx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Ux=[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 Yx(t,e){return a.openBlock(),a.createElementBlock("svg",Wx,Ux)}const Bf=be(Hx,[["render",Yx]]),qx={class:"wpic-pagination flex justify-between"},Kx={key:0,class:"flex items-center"},Gx={key:0},Jx={key:1,class:"flex flex-wrap gap-2"},Zx=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=zn(),i=t,o=a.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,l=a.computed(()=>Math.ceil(i.total/i.perPage)),c=a.computed(()=>{const p=l.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let w=y;w<=k;w++)x.push(w);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=l.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",qx,[t.info?(a.openBlock(),a.createElementBlock("div",Kx,[t.total>0?(a.openBlock(),a.createElementBlock("span",Gx,a.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",Jx,[a.createVNode(Ki,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Af,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Df,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,y=>(a.openBlock(),a.createBlock(Ki,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:l.value==0||!l.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Ki,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Bf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[3]||(m[3]=y=>d(l.value)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Lf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),$f=(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)};$f.props=["column","item","rowIndex"];const es=$f,Xx={},Qx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},eE=[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 tE(t,e){return a.openBlock(),a.createElementBlock("svg",Qx,eE)}const nE=be(Xx,[["render",tE]]),rE={class:"font-semibold"},If={__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",rE,[t.checkable?(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).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(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).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))]))}},iE={},oE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},sE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function lE(t,e){return a.openBlock(),a.createElementBlock("svg",oE,sE)}const aE=be(iE,[["render",lE]]),cE={},dE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},uE=[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 fE(t,e){return a.openBlock(),a.createElementBlock("svg",dE,uE)}const hE=be(cE,[["render",fE]]),pE={class:"wpic-table"},mE={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},gE={class:"flex items-center gap-2"},yE={class:"flex items-center gap-2"},bE={class:"w-full rounded-lg"},kE={key:0,class:"w-16"},wE=["width"],vE=["width"],xE={class:"flex justify-center items-center h-full"},EE=["onClick"],CE={class:"rounded-b-lg relative"},SE={key:0},_E=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],OE={class:"flex justify-center items-center h-full"},TE={key:1},NE={key:0,class:"text-center text-gray-400 py-3"},ME=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(()=>{k()});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(L=>g.value.includes(L.field)||!L.selectable):m.value.filter(L=>L.visible||!L.selectable));function k(){const L=(D,C)=>{let I={};for(let R in D){if(typeof D[R].default=="boolean"&&C[R]!==void 0){I[R]=C[R]!==!1;continue}if(C[R]!==void 0){I[R]=C[R];continue}if(typeof D[R].default=="function"){I[R]=D[R].default();continue}I[R]=D[R].default}return I};let j=[];(p.default&&p.default()||[]).forEach(D=>{var C,I;((C=D.type)==null?void 0:C.name)==="WpicTableColumn"?j.push(D):(I=D.children)!=null&&I.length&&D.children.forEach(R=>{var ee;((ee=R.type)==null?void 0:ee.name)==="WpicTableColumn"&&j.push(R)})}),m.value=j.map(D=>{let C=D.children,I=D.props||{},{field:R,label:ee,help:te,width:ce,minWidth:ue,maxWidth:V,sortable:W,selectable:K,render:q,type:H,align:de,visible:ae,noPadding:we}=L(D.type.props,I);return R||(R=$(ee)),K&&ae&&g.value.push(R),{label:ee,help:te,width:ce,minWidth:ue,maxWidth:V,type:H,align:de,sortable:W,selectable:K,field:R,render:q,children:C,visible:ae,noPadding:we}})}function x(L){var z,D;let j=(z=r.sortOptions)==null?void 0:z.sortDirection;((D=r.sortOptions)==null?void 0:D.sortBy)===L&&(j=j==="asc"?"desc":"asc"),f("changeSort",{sortDirection:j,sortBy:L})}a.watch(()=>p.default,L=>{k()},{deep:!0});const w=a.reactive({});function b({index:L,item:j}){w[L]?w[L]=null:(w[L]=!0,f("expandRow",{index:L,item:j}))}const S=a.ref([]);function v(L){const j=P(L,r.itemId);S.value.includes(j)?(S.value.splice(S.value.indexOf(j),1),O.value=!1):S.value.push(j)}const O=a.ref(!1);function B(){if(O.value=!O.value,S.value=[],O.value)for(let L of r.data){let j=P(L,r.itemId);S.value.push(j)}}function A(){O.value=!1,S.value=[]}e({buildColumns:k,selectedRows:S,selectedColumns:g,resetSelectedRows:A});function P(L,j){return j.split(".").reduce((z,D)=>z?z[D]:void 0,L)}function $(L){return!L||typeof L!="string"?"":L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(L,j)=>{const z=a.resolveComponent("wpic-choice-list"),D=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",pE,[L.$slots.header||L.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",mE,[a.createElementVNode("div",gE,[a.renderSlot(L.$slots,"header")]),a.createElementVNode("div",yE,[a.renderSlot(L.$slots,"actions"),a.createVNode(z,{multiple:"",modelValue:g.value,"onUpdate:modelValue":j[0]||(j[0]=C=>g.value=C),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(C=>C.selectable).map(C=>({label:C.label,value:C.field}))},{default:a.withCtx(()=>[a.createVNode(Ni,{medium:"",square:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(hE,{class:"w-5 h-5"})]),_: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(he).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",bE,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",kE)):a.createCommentVNode("",!0),y.value.find(C=>C.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(C=>C.type=="expand").minWidth}px`}),width:y.value.find(C=>C.type=="expand").width,class:"w-16"},null,12,wE)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(C=>C.type!="expand"),(C,I)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${C.minWidth}px`,maxWidth:`${C.maxWidth}px`}),width:C.width,key:I},null,12,vE))),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(he).theme]}`]])},[a.createElementVNode("div",xE,[a.createVNode(D,{slim:"","hide-error":"",checkbox:"",modelValue:O.value,"onUpdate:modelValue":B},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(C=>C.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(he).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(C=>C.type!="expand"),(C,I)=>{var R,ee;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(he).theme]}`]:!0,"sticky top-0 left-0":I===0}]),style:a.normalizeStyle({maxWidth:`${C.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{C.sortable&&x(C.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":C.sortable&&C.field,"justify-center":C.align=="center","justify-end":C.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":C.align=="right"}])},a.toDisplayString(C.label),3),C.sortable&&C.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":C.field!=((R=t.sortOptions)==null?void 0:R.sortBy)}])},[a.createVNode(nE,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((ee=t.sortOptions)==null?void 0:ee.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,EE)],6)}),256))])],2)),a.createElementVNode("tbody",CE,[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(he).theme]]])},[a.createVNode(Fr,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",SE,_E))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(If,{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,(C,I)=>{var R,ee,te,ce,ue;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${I}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":I%2==0,"is-even":I%2!=0,[s[a.unref(he).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}])},[a.createElementVNode("div",OE,[a.createVNode(D,{slim:"","hide-error":"",checkbox:"",modelValue:S.value.includes(P(C,t.itemId)),checkboxValue:P(C,t.itemId),"onUpdate:modelValue":V=>v(C)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(V=>V.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(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Ni,{small:"",square:"",onClick:V=>b({item:C,index:I})},{default:a.withCtx(()=>[w[I]?(a.openBlock(),a.createBlock(tx,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(aE,{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(V=>V.type!="expand"),(V,W)=>{var K,q;return a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":W===0,[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!V.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":I===((K=t.data)==null?void 0:K.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":I===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"text-center justify-center":V.align=="center","text-right justify-end":V.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${V.maxWidth}px`}),id:`${I}_${W}`,column:V,item:C,rowIndex:I,key:W},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(V=>V.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(he).theme]]:!t.stripe,[l[a.unref(he).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(es,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(he).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((R=y.value.find(V=>V.type=="expand"))!=null&&R.noPadding),"p-0":(ee=y.value.find(V=>V.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":I===((te=t.data)==null?void 0:te.length)-1&&!t.totalItem,"first:rounded-bl-lg":I===((ce=t.data)==null?void 0:ce.length)-1&&!t.totalItem,"text-center":y.value.find(V=>V.type=="expand").align=="center","text-right":y.value.find(V=>V.type=="expand").align=="right"}]),column:y.value.find(V=>V.type=="expand"),rowIndex:I,colspan:(ue=y.value)==null?void 0:ue.length,item:C},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,w[I]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",TE,[a.createVNode(If,{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",NE," No Data ")):a.createCommentVNode("",!0)],2)])}}}),AE={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 rt(t){this.content=t}rt.prototype={constructor:rt,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 rt(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 rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(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 rt(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=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.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}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Vf(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=Vf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Pf(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=Pf(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class J{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 J(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 J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(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 J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(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 Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Pf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ts(0,e);if(e==this.size)return ts(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?ts(r+1,s):ts(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 J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.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 J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Zl={index:0,offset:0};function ts(t,e){return Zl.index=t,Zl.offset=e,Zl}function ns(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(!ns(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ns(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class Bc{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&&ns(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 Bc.none;if(e instanceof Bc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$e.none=[];class rs extends Error{}class re{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=Ff(this.content,e+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(e,n){return new re(Rf(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 re.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 re(J.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 re(e,r,i)}}re.empty=new re(J.empty,0,0);function Rf(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(Rf(o.content,e-i-1,n-i-1)))}function Ff(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=Ff(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function DE(t,e,n){if(n.openStart>t.depth)throw new rs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new rs("Inconsistent open depths");return zf(t,e,n,0)}function zf(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=zf(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 vr(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=LE(n,t);return vr(o,Hf(t,s,l,e,r))}else return vr(o,is(t,e,r))}function jf(t,e){if(!e.type.compatibleContent(t.type))throw new rs("Cannot join "+e.type.name+" onto "+t.type.name)}function Xl(t,e,n){let r=t.node(n);return jf(r,e.node(n)),r}function wr(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 Gi(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&&(wr(t.nodeAfter,r),o++));for(let l=o;l<s;l++)wr(i.child(l),r);e&&e.depth==n&&e.textOffset&&wr(e.nodeBefore,r)}function vr(t,e){return t.type.checkContent(e),t.copy(e)}function Hf(t,e,n,r,i){let o=t.depth>i&&Xl(t,e,i+1),s=r.depth>i&&Xl(n,r,i+1),l=[];return Gi(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(jf(o,s),wr(vr(o,Hf(t,e,n,r,i+1)),l)):(o&&wr(vr(o,is(t,e,i+1)),l),Gi(e,n,i,l),s&&wr(vr(s,is(n,r,i+1)),l)),Gi(r,null,i,l),new J(l)}function is(t,e,n){let r=[];if(Gi(null,t,n,r),t.depth>n){let i=Xl(t,e,n+1);wr(vr(i,is(t,e,n+1)),r)}return Gi(e,null,n,r),new J(r)}function LE(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(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ji{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 $e.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 ss(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 Ji(n,r,o)}static resolveCached(e,n){let r=Wf.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 Wf.set(e,r=new BE);let i=r.elts[r.i]=Ji.resolve(e,n);return r.i=(r.i+1)%$E,i}}class BE{constructor(){this.elts=[],this.i=0}}const $E=12,Wf=new WeakMap;class ss{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 IE=Object.create(null);let Wn=class $c{constructor(e,n,r,i=$e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||J.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&&ns(this.attrs,n||e.defaultAttrs||IE)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new $c(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new $c(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 re.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 re(d,i.depth-s,o.depth-s)}replace(e,n,r){return DE(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 Ji.resolveCached(this,e)}resolveNoCache(e){return Ji.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Uf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=J.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=$e.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(!$e.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=J.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Wn.prototype.text=void 0;class ls extends Wn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Uf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ls(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Uf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VE(e,n);if(r.next==null)return xr.empty;let i=Yf(r);r.next&&r.err("Unexpected trailing text");let o=WE(HE(i));return UE(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 J.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(`
|
|
27
|
+
*/const zb="9.14.4";function jb(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(wn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(wn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1)}const Lu=yt.__EXTEND_POINT__,En=Ro(Lu),St={FALLBACK_TO_ROOT:Lu,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},Hb={[St.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[St.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[St.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[St.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[St.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[St.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[St.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[St.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[St.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ko(t,...e){return wl(Hb[t],...e)}const Bu=Je.__EXTEND_POINT__,Ot=Ro(Bu),Re={UNEXPECTED_RETURN_TYPE:Bu,INVALID_ARGUMENT:Ot(),MUST_BE_CALL_SETUP_TOP:Ot(),NOT_INSTALLED:Ot(),NOT_AVAILABLE_IN_LEGACY_MODE:Ot(),REQUIRED_VALUE:Ot(),INVALID_VALUE:Ot(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Ot(),NOT_INSTALLED_WITH_PROVIDE:Ot(),UNEXPECTED_ERROR:Ot(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Ot(),BRIDGE_SUPPORT_VUE_2_ONLY:Ot(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Ot(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Ot(),__EXTEND_POINT__:Ot()};function Fn(t,...e){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:Wb,args:e}:void 0)}const Wb={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Dl=kn("__translateVNode"),Ll=kn("__datetimeParts"),Bl=kn("__numberParts"),$l=kn("__enableEmitter"),Il=kn("__disableEmitter"),Ub=kn("__setPluralRules"),$u=kn("__injectWithOption"),Vl=kn("__dispose");function Fi(t){if(!Te(t)||en(t))return t;for(const e in t)if(Xt(t,e))if(!e.includes("."))Te(t[e])&&Fi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=Le()),!Te(i[n[s]])){process.env.NODE_ENV!=="production"&&vn(Ko(St.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(en(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!en(i)){const s=i[n[r]];Te(s)&&Fi(s)}}return t}function Pl(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=Se(n)?n:We(r)?Le():{[t]:Le()};if(We(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:c,resource:d}=l;c?(s[c]=s[c]||Le(),zo(d,s[c])):zo(d,s)}else oe(l)&&zo(JSON.parse(l),s)}),i==null&&o)for(const l in s)Xt(s,l)&&Fi(s[l]);return s}function Iu(t){return t.type}function Yb(t,e,n){let r=Te(e.messages)?e.messages:Le();"__i18nGlobal"in n&&(r=Pl(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Te(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Te(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Vu(t){return a.createVNode(a.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],qb=()=>!1;let Fu=0;function zu(t){return(e,n,r,i)=>t(n,r,a.getCurrentInstance()||void 0,i)}const Kb=()=>{const t=a.getCurrentInstance();let e=null;return t&&(e=Iu(t)[Pu])?{[Pu]:e}:null};function Gb(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?a.ref:a.shallowRef,l=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&l&&$d(Ko(St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Be(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:oe(t.locale)?t.locale:Pi),u=s(n&&c?n.fallbackLocale.value:oe(t.fallbackLocale)||We(t.fallbackLocale)||Se(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Pl(d.value,t)),h=s(Se(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(Se(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Be(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Be(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Be(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?zu(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,S=n?n.warnHtmlMessage:Be(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const _=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let B=t.pluralRules||n&&n.pluralRules,A;A=(()=>{i&&fu(null);const F={version:zb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:_,pluralRules:B,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:S,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};F.datetimeFormats=h.value,F.numberFormats=p.value,F.__datetimeFormatters=Se(A)?A.__datetimeFormatters:void 0,F.__numberFormatters=Se(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(F.__v_emitter=Se(A)?A.__v_emitter:void 0);const Z=Mb(F);return i&&fu(Z),Z})(),Ri(A,d.value,u.value);function $(){return[d.value,u.value,f.value,h.value,p.value]}const L=a.computed({get:()=>d.value,set:F=>{d.value=F,A.locale=d.value}}),j=a.computed({get:()=>u.value,set:F=>{u.value=F,A.fallbackLocale=u.value,Ri(A,d.value,F)}}),z=a.computed(()=>f.value),D=a.computed(()=>h.value),C=a.computed(()=>p.value);function I(){return Ve(b)?b:null}function R(F){b=F,A.postTranslation=F}function ee(){return x}function te(F){F!==null&&(w=zu(F)),x=F,A.missing=w}function ce(F,Z){return F!=="translate"||!Z.resolvedMessage}const ue=(F,Z,T,M,Y,ne)=>{$();let fe;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=n?Nb():void 0),fe=F(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(T!=="translate exists"&&Ge(fe)&&fe===Uo||T==="translate exists"&&!fe){const[N,X]=Z();if(process.env.NODE_ENV!=="production"&&n&&oe(N)&&ce(T,X)&&(y&&(qo(g,N)||pu(m,N))&&vn(Ko(St.FALLBACK_TO_ROOT,{key:N,type:T})),process.env.NODE_ENV!=="production")){const{__v_emitter:ie}=A;ie&&y&&ie.emit("fallback",{type:T,key:N,to:"global",groupId:`${T}:${N}`})}return n&&y?M(n):Y(N)}else{if(ne(fe))return fe;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function V(...F){return ue(Z=>Reflect.apply(xu,null,[Z,...F]),()=>Nl(...F),"translate",Z=>Reflect.apply(Z.t,Z,[...F]),Z=>Z,Z=>oe(Z))}function W(...F){const[Z,T,M]=F;if(M&&!Te(M))throw Fn(Re.INVALID_ARGUMENT);return V(Z,T,dt({resolvedMessage:!0},M||{}))}function K(...F){return ue(Z=>Reflect.apply(_u,null,[Z,...F]),()=>Ml(...F),"datetime format",Z=>Reflect.apply(Z.d,Z,[...F]),()=>Yo,Z=>oe(Z))}function q(...F){return ue(Z=>Reflect.apply(Mu,null,[Z,...F]),()=>Al(...F),"number format",Z=>Reflect.apply(Z.n,Z,[...F]),()=>Yo,Z=>oe(Z))}function H(F){return F.map(Z=>oe(Z)||Ge(Z)||Be(Z)?Vu(String(Z)):Z)}const ae={normalize:H,interpolate:F=>F,type:"vnode"};function we(...F){return ue(Z=>{let T;const M=Z;try{M.processor=ae,T=Reflect.apply(xu,null,[M,...F])}finally{M.processor=null}return T},()=>Nl(...F),"translate",Z=>Z[Dl](...F),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...F){return ue(Z=>Reflect.apply(Mu,null,[Z,...F]),()=>Al(...F),"number format",Z=>Z[Bl](...F),Ru,Z=>oe(Z)||We(Z))}function Ie(...F){return ue(Z=>Reflect.apply(_u,null,[Z,...F]),()=>Ml(...F),"datetime format",Z=>Z[Ll](...F),Ru,Z=>oe(Z)||We(Z))}function tt(F){B=F,A.pluralRules=B}function Q(F,Z){return ue(()=>{if(!F)return!1;const T=oe(Z)?Z:d.value,M=lt(T),Y=A.messageResolver(M,F);return l?Y!=null:en(Y)||zt(Y)||oe(Y)},()=>[F],"translate exists",T=>Reflect.apply(T.te,T,[F,Z]),qb,T=>Be(T))}function Ee(F){let Z=null;const T=ru(A,u.value,d.value);for(let M=0;M<T.length;M++){const Y=f.value[T[M]]||{},ne=A.messageResolver(Y,F);if(ne!=null){Z=ne;break}}return Z}function At(F){const Z=Ee(F);return Z??(n?n.tm(F)||{}:{})}function lt(F){return f.value[F]||{}}function at(F,Z){if(o){const T={[F]:Z};for(const M in T)Xt(T,M)&&Fi(T[M]);Z=T[F]}f.value[F]=Z,A.messages=f.value}function pt(F,Z){f.value[F]=f.value[F]||{};const T={[F]:Z};if(o)for(const M in T)Xt(T,M)&&Fi(T[M]);Z=T[F],zo(Z,f.value[F]),A.messages=f.value}function E(F){return h.value[F]||{}}function O(F,Z){h.value[F]=Z,A.datetimeFormats=h.value,Nu(A,F,Z)}function U(F,Z){h.value[F]=dt(h.value[F]||{},Z),A.datetimeFormats=h.value,Nu(A,F,Z)}function se(F){return p.value[F]||{}}function Me(F,Z){p.value[F]=Z,A.numberFormats=p.value,Du(A,F,Z)}function Oe(F,Z){p.value[F]=dt(p.value[F]||{},Z),A.numberFormats=p.value,Du(A,F,Z)}Fu++,n&&bn&&(a.watch(n.locale,F=>{c&&(d.value=F,A.locale=F,Ri(A,d.value,u.value))}),a.watch(n.fallbackLocale,F=>{c&&(u.value=F,A.fallbackLocale=F,Ri(A,d.value,u.value))}));const _e={id:Fu,locale:L,fallbackLocale:j,get inheritLocale(){return c},set inheritLocale(F){c=F,F&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ri(A,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:z,get modifiers(){return _},get pluralRules(){return B||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(F){m=F,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(F){g=F,A.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(F){y=F},get fallbackFormat(){return k},set fallbackFormat(F){k=F,A.fallbackFormat=k},get warnHtmlMessage(){return S},set warnHtmlMessage(F){S=F,A.warnHtmlMessage=F},get escapeParameter(){return v},set escapeParameter(F){v=F,A.escapeParameter=F},t:V,getLocaleMessage:lt,setLocaleMessage:at,mergeLocaleMessage:pt,getPostTranslationHandler:I,setPostTranslationHandler:R,getMissingHandler:ee,setMissingHandler:te,[Ub]:tt};return _e.datetimeFormats=D,_e.numberFormats=C,_e.rt=W,_e.te=Q,_e.tm=At,_e.d=K,_e.n=q,_e.getDateTimeFormat=E,_e.setDateTimeFormat=O,_e.mergeDateTimeFormat=U,_e.getNumberFormat=se,_e.setNumberFormat=Me,_e.mergeNumberFormat=Oe,_e[$u]=r,_e[Dl]=we,_e[Ll]=Ie,_e[Bl]=Ne,process.env.NODE_ENV!=="production"&&(_e[$l]=F=>{A.__v_emitter=F},_e[Il]=()=>{A.__v_emitter=void 0}),_e}const Rl={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Jb({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===a.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Le())}function ju(t){return a.Fragment}dt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ge(t)||!isNaN(t)}},Rl);function Zb(t){return We(t)&&!oe(t[0])}function Hu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let l=Le();t.locale&&(s.locale=t.locale),oe(t.format)?s.key=t.format:Te(t.format)&&(oe(t.format.key)&&(s.key=t.format.key),l=Object.keys(t.format).reduce((h,p)=>n.includes(p)?dt(Le(),h,{[p]:t.format[p]}):h,Le()));const c=r(t.value,s,l);let d=[s.key];We(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return Zb(g)&&(g[0].key=`${h.type}-${p}`),g}):oe(c)&&(d=[c]);const u=dt(Le(),o),f=oe(t.tag)||Te(t.tag)?t.tag:ju();return a.h(f,u,d)}}dt({value:{type:Number,required:!0},format:{type:[String,Object]}},Rl),dt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rl);function Wu(t,e){}const Xb=kn("global-vue-i18n");function zn(t={}){const e=a.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=Qb(e),r=tk(n),i=Iu(e),o=ek(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return ok(e,o,r,t)}if(o==="global")return Yb(r,t,i),r;if(o==="parent"){let c=nk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&vn(Ko(St.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let l=s.__getInstance(e);if(l==null){const c=dt({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),l=Gb(c),s.__composerExtend&&(l[Vl]=s.__composerExtend(l)),ik(s,e,l),s.__setInstance(e,l)}return l}function Qb(t){{const e=a.inject(t.isCE?Xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function ek(t,e){return Po(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function tk(t){return t.mode==="composition"?t.global:t.global.__composer}function nk(t,e,n=!1){let r=null;const i=e.root;let o=rk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const l=s.__getInstance(o);l!=null&&(r=l.__composer,n&&r&&!r[$u]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function rk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function ik(t,e,n){let r=null;a.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=f1();const i=n;i[$l]&&i[$l](r),r.on("*",Wu)}},e),a.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[Il]&&i[Il](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Vl];o&&(o(),delete i[Vl])},e)}function ok(t,e,n,r={}){const i=e==="local",o=a.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Be(r.inheritLocale)?r.inheritLocale:!oe(r.locale),l=a.ref(!i||s?n.locale.value:oe(r.locale)?r.locale:Pi),c=a.ref(!i||s?n.fallbackLocale.value:oe(r.fallbackLocale)||We(r.fallbackLocale)||Se(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),d=a.ref(Pl(l.value,r)),u=a.ref(Se(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),f=a.ref(Se(r.numberFormats)?r.numberFormats:{[l.value]:{}}),h=i?n.missingWarn:Be(r.missingWarn)||Wr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Be(r.fallbackWarn)||Wr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Be(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Be(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},S=r.pluralRules||i&&n.pluralRules;function v(){return[l.value,c.value,d.value,u.value,f.value]}const _=a.computed({get:()=>o.value?o.value.locale.value:l.value,set:Q=>{o.value&&(o.value.locale.value=Q),l.value=Q}}),B=a.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),A=a.computed(()=>o.value?o.value.messages.value:d.value),P=a.computed(()=>u.value),$=a.computed(()=>f.value);function L(){return o.value?o.value.getPostTranslationHandler():k}function j(Q){o.value&&o.value.setPostTranslationHandler(Q)}function z(){return o.value?o.value.getMissingHandler():y}function D(Q){o.value&&o.value.setMissingHandler(Q)}function C(Q){return v(),Q()}function I(...Q){return o.value?C(()=>Reflect.apply(o.value.t,null,[...Q])):C(()=>"")}function R(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?C(()=>Reflect.apply(o.value.d,null,[...Q])):C(()=>"")}function te(...Q){return o.value?C(()=>Reflect.apply(o.value.n,null,[...Q])):C(()=>"")}function ce(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function V(Q){return o.value?o.value.getLocaleMessage(Q):{}}function W(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function K(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function q(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function H(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function de(Q,Ee){o.value&&o.value.mergeDateTimeFormat(Q,Ee)}function ae(Q){return o.value?o.value.getNumberFormat(Q):{}}function we(Q,Ee){o.value&&(o.value.setNumberFormat(Q,Ee),f.value[Q]=Ee)}function Ne(Q,Ee){o.value&&o.value.mergeNumberFormat(Q,Ee)}const Ie={get id(){return o.value?o.value.id:-1},locale:_,fallbackLocale:B,messages:A,datetimeFormats:P,numberFormats:$,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(Q){o.value&&(o.value.inheritLocale=Q)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:S},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(Q){o.value&&(o.value.fallbackRoot=Q)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(Q){o.value&&(o.value.fallbackFormat=Q)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(Q){o.value&&(o.value.warnHtmlMessage=Q)},get escapeParameter(){return o.value?o.value.escapeParameter:w},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:I,getPostTranslationHandler:L,setPostTranslationHandler:j,getMissingHandler:z,setMissingHandler:D,rt:R,d:ee,n:te,tm:ce,te:ue,getLocaleMessage:V,setLocaleMessage:W,mergeLocaleMessage:K,getDateTimeFormat:q,setDateTimeFormat:H,mergeDateTimeFormat:de,getNumberFormat:ae,setNumberFormat:we,mergeNumberFormat:Ne};function tt(Q){Q.locale.value=l.value,Q.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{Q.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{Q.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{Q.mergeNumberFormat(Ee,f.value[Ee])}),Q.escapeParameter=w,Q.fallbackFormat=g,Q.fallbackRoot=m,Q.fallbackWarn=p,Q.missingWarn=h,Q.warnHtmlMessage=x}return a.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Q=o.value=t.proxy.$i18n.__composer;e==="global"?(l.value=Q.locale.value,c.value=Q.fallbackLocale.value,d.value=Q.messages.value,u.value=Q.datetimeFormats.value,f.value=Q.numberFormats.value):i&&tt(Q)}),Ie}if(jb(),__INTLIFY_JIT_COMPILATION__?lu($b):lu(Bb),Sb(ob),Ob(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=wn();t.__INTLIFY__=!0,pb(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const sk={},lk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ak=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ck(t,e){return a.openBlock(),a.createElementBlock("svg",lk,ak)}const Uu=be(sk,[["render",ck]]),dk={},uk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},fk=[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 hk(t,e){return a.openBlock(),a.createElementBlock("svg",uk,fk)}const Fl=be(dk,[["render",hk]]),pk={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},mk={class:"flex items-center gap-2"},gk={key:0},yk={class:""},bk={class:"flex justify-end"},kk={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},wk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},vk={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},zi=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,medium: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",pk,[a.createElementVNode("div",mk,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",gk,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",yk,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",bk,[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(he).theme]}`]:!0,"h-6 text-xs":t.small,"h-8 text-sm":t.medium,"h-10":!t.large&&!t.small&&!t.medium,"h-12":t.large,[`${r[a.unref(he).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",kk,[a.createElementVNode("div",wk,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",vk,[a.createVNode(Fr,{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($i,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var Yu=typeof global=="object"&&global&&global.Object===Object&&global,xk=typeof self=="object"&&self&&self.Object===Object&&self,ln=Yu||xk||Function("return this")(),Gr=ln.Symbol,qu=Object.prototype,Ek=qu.hasOwnProperty,Ck=qu.toString,ji=Gr?Gr.toStringTag:void 0;function Sk(t){var e=Ek.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Ck.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var Ok=Object.prototype,_k=Ok.toString;function Tk(t){return _k.call(t)}var Nk="[object Null]",Mk="[object Undefined]",Ku=Gr?Gr.toStringTag:void 0;function Jr(t){return t==null?t===void 0?Mk:Nk:Ku&&Ku in Object(t)?Sk(t):Tk(t)}function Zr(t){return t!=null&&typeof t=="object"}var Ak="[object Symbol]";function Dk(t){return typeof t=="symbol"||Zr(t)&&Jr(t)==Ak}var Go=Array.isArray,Lk=/\s/;function Bk(t){for(var e=t.length;e--&&Lk.test(t.charAt(e)););return e}var $k=/^\s+/;function Ik(t){return t&&t.slice(0,Bk(t)+1).replace($k,"")}function Hi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gu=NaN,Vk=/^[-+]0x[0-9a-f]+$/i,Pk=/^0b[01]+$/i,Rk=/^0o[0-7]+$/i,Fk=parseInt;function Ju(t){if(typeof t=="number")return t;if(Dk(t))return Gu;if(Hi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ik(t);var n=Pk.test(t);return n||Rk.test(t)?Fk(t.slice(2),n?2:8):Vk.test(t)?Gu:+t}var zk="[object AsyncFunction]",jk="[object Function]",Hk="[object GeneratorFunction]",Wk="[object Proxy]";function Zu(t){if(!Hi(t))return!1;var e=Jr(t);return e==jk||e==Hk||e==zk||e==Wk}var zl=ln["__core-js_shared__"],Xu=function(){var t=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Uk(t){return!!Xu&&Xu in t}var Yk=Function.prototype,qk=Yk.toString;function yr(t){if(t!=null){try{return qk.call(t)}catch{}try{return t+""}catch{}}return""}var Kk=/[\\^$.*+?()[\]{}|]/g,Gk=/^\[object .+?Constructor\]$/,Jk=Function.prototype,Zk=Object.prototype,Xk=Jk.toString,Qk=Zk.hasOwnProperty,e2=RegExp("^"+Xk.call(Qk).replace(Kk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t2(t){if(!Hi(t)||Uk(t))return!1;var e=Zu(t)?e2:Gk;return e.test(yr(t))}function n2(t,e){return t==null?void 0:t[e]}function Xr(t,e){var n=n2(t,e);return t2(n)?n:void 0}var jl=Xr(ln,"WeakMap"),r2=9007199254740991,i2=/^(?:0|[1-9]\d*)$/;function o2(t,e){var n=typeof t;return e=e??r2,!!e&&(n=="number"||n!="symbol"&&i2.test(t))&&t>-1&&t%1==0&&t<e}function Qu(t,e){return t===e||t!==t&&e!==e}var s2=9007199254740991;function ef(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s2}function l2(t){return t!=null&&ef(t.length)&&!Zu(t)}var a2=Object.prototype;function c2(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||a2;return t===n}function d2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var u2="[object Arguments]";function tf(t){return Zr(t)&&Jr(t)==u2}var nf=Object.prototype,f2=nf.hasOwnProperty,h2=nf.propertyIsEnumerable,p2=tf(function(){return arguments}())?tf:function(t){return Zr(t)&&f2.call(t,"callee")&&!h2.call(t,"callee")};function m2(){return!1}var rf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,g2=of&&of.exports===rf,sf=g2?ln.Buffer:void 0,y2=sf?sf.isBuffer:void 0,Hl=y2||m2,b2="[object Arguments]",k2="[object Array]",w2="[object Boolean]",v2="[object Date]",x2="[object Error]",E2="[object Function]",C2="[object Map]",S2="[object Number]",O2="[object Object]",_2="[object RegExp]",T2="[object Set]",N2="[object String]",M2="[object WeakMap]",A2="[object ArrayBuffer]",D2="[object DataView]",L2="[object Float32Array]",B2="[object Float64Array]",$2="[object Int8Array]",I2="[object Int16Array]",V2="[object Int32Array]",P2="[object Uint8Array]",R2="[object Uint8ClampedArray]",F2="[object Uint16Array]",z2="[object Uint32Array]",Pe={};Pe[L2]=Pe[B2]=Pe[$2]=Pe[I2]=Pe[V2]=Pe[P2]=Pe[R2]=Pe[F2]=Pe[z2]=!0,Pe[b2]=Pe[k2]=Pe[A2]=Pe[w2]=Pe[D2]=Pe[v2]=Pe[x2]=Pe[E2]=Pe[C2]=Pe[S2]=Pe[O2]=Pe[_2]=Pe[T2]=Pe[N2]=Pe[M2]=!1;function j2(t){return Zr(t)&&ef(t.length)&&!!Pe[Jr(t)]}function H2(t){return function(e){return t(e)}}var lf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Wi=lf&&typeof module=="object"&&module&&!module.nodeType&&module,W2=Wi&&Wi.exports===lf,Wl=W2&&Yu.process,af=function(){try{var t=Wi&&Wi.require&&Wi.require("util").types;return t||Wl&&Wl.binding&&Wl.binding("util")}catch{}}(),cf=af&&af.isTypedArray,df=cf?H2(cf):j2,U2=Object.prototype,Y2=U2.hasOwnProperty;function q2(t,e){var n=Go(t),r=!n&&p2(t),i=!n&&!r&&Hl(t),o=!n&&!r&&!i&&df(t),s=n||r||i||o,l=s?d2(t.length,String):[],c=l.length;for(var d in t)Y2.call(t,d)&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||o2(d,c)))&&l.push(d);return l}function K2(t,e){return function(n){return t(e(n))}}var G2=K2(Object.keys,Object),J2=Object.prototype,Z2=J2.hasOwnProperty;function X2(t){if(!c2(t))return G2(t);var e=[];for(var n in Object(t))Z2.call(t,n)&&n!="constructor"&&e.push(n);return e}function Q2(t){return l2(t)?q2(t):X2(t)}var Ui=Xr(Object,"create");function ew(){this.__data__=Ui?Ui(null):{},this.size=0}function tw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nw="__lodash_hash_undefined__",rw=Object.prototype,iw=rw.hasOwnProperty;function ow(t){var e=this.__data__;if(Ui){var n=e[t];return n===nw?void 0:n}return iw.call(e,t)?e[t]:void 0}var sw=Object.prototype,lw=sw.hasOwnProperty;function aw(t){var e=this.__data__;return Ui?e[t]!==void 0:lw.call(e,t)}var cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ui&&e===void 0?cw:e,this}function br(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])}}br.prototype.clear=ew,br.prototype.delete=tw,br.prototype.get=ow,br.prototype.has=aw,br.prototype.set=dw;function uw(){this.__data__=[],this.size=0}function Jo(t,e){for(var n=t.length;n--;)if(Qu(t[n][0],e))return n;return-1}var fw=Array.prototype,hw=fw.splice;function pw(t){var e=this.__data__,n=Jo(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():hw.call(e,n,1),--this.size,!0}function mw(t){var e=this.__data__,n=Jo(e,t);return n<0?void 0:e[n][1]}function gw(t){return Jo(this.__data__,t)>-1}function yw(t,e){var n=this.__data__,r=Jo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cn(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])}}Cn.prototype.clear=uw,Cn.prototype.delete=pw,Cn.prototype.get=mw,Cn.prototype.has=gw,Cn.prototype.set=yw;var Yi=Xr(ln,"Map");function bw(){this.size=0,this.__data__={hash:new br,map:new(Yi||Cn),string:new br}}function kw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zo(t,e){var n=t.__data__;return kw(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ww(t){var e=Zo(this,t).delete(t);return this.size-=e?1:0,e}function vw(t){return Zo(this,t).get(t)}function xw(t){return Zo(this,t).has(t)}function Ew(t,e){var n=Zo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function kr(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])}}kr.prototype.clear=bw,kr.prototype.delete=ww,kr.prototype.get=vw,kr.prototype.has=xw,kr.prototype.set=Ew;function Cw(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Sw(){this.__data__=new Cn,this.size=0}function Ow(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function _w(t){return this.__data__.get(t)}function Tw(t){return this.__data__.has(t)}var Nw=200;function Mw(t,e){var n=this.__data__;if(n instanceof Cn){var r=n.__data__;if(!Yi||r.length<Nw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kr(r)}return n.set(t,e),this.size=n.size,this}function jn(t){var e=this.__data__=new Cn(t);this.size=e.size}jn.prototype.clear=Sw,jn.prototype.delete=Ow,jn.prototype.get=_w,jn.prototype.has=Tw,jn.prototype.set=Mw;function Aw(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}function Dw(){return[]}var Lw=Object.prototype,Bw=Lw.propertyIsEnumerable,uf=Object.getOwnPropertySymbols,$w=uf?function(t){return t==null?[]:(t=Object(t),Aw(uf(t),function(e){return Bw.call(t,e)}))}:Dw;function Iw(t,e,n){var r=e(t);return Go(t)?r:Cw(r,n(t))}function ff(t){return Iw(t,Q2,$w)}var Ul=Xr(ln,"DataView"),Yl=Xr(ln,"Promise"),ql=Xr(ln,"Set"),hf="[object Map]",Vw="[object Object]",pf="[object Promise]",mf="[object Set]",gf="[object WeakMap]",yf="[object DataView]",Pw=yr(Ul),Rw=yr(Yi),Fw=yr(Yl),zw=yr(ql),jw=yr(jl),Hn=Jr;(Ul&&Hn(new Ul(new ArrayBuffer(1)))!=yf||Yi&&Hn(new Yi)!=hf||Yl&&Hn(Yl.resolve())!=pf||ql&&Hn(new ql)!=mf||jl&&Hn(new jl)!=gf)&&(Hn=function(t){var e=Jr(t),n=e==Vw?t.constructor:void 0,r=n?yr(n):"";if(r)switch(r){case Pw:return yf;case Rw:return hf;case Fw:return pf;case zw:return mf;case jw:return gf}return e});var bf=ln.Uint8Array,Hw="__lodash_hash_undefined__";function Ww(t){return this.__data__.set(t,Hw),this}function Uw(t){return this.__data__.has(t)}function Xo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new kr;++e<n;)this.add(t[e])}Xo.prototype.add=Xo.prototype.push=Ww,Xo.prototype.has=Uw;function Yw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function qw(t,e){return t.has(e)}var Kw=1,Gw=2;function kf(t,e,n,r,i,o){var s=n&Kw,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&Gw?new Xo: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(!Yw(e,function(k,x){if(!qw(p,x)&&(m===k||i(m,k,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}function Jw(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Zw(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Xw=1,Qw=2,ev="[object Boolean]",tv="[object Date]",nv="[object Error]",rv="[object Map]",iv="[object Number]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",av="[object Symbol]",cv="[object ArrayBuffer]",dv="[object DataView]",wf=Gr?Gr.prototype:void 0,Kl=wf?wf.valueOf:void 0;function uv(t,e,n,r,i,o,s){switch(n){case dv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case cv:return!(t.byteLength!=e.byteLength||!o(new bf(t),new bf(e)));case ev:case tv:case iv:return Qu(+t,+e);case nv:return t.name==e.name&&t.message==e.message;case ov:case lv:return t==e+"";case rv:var l=Jw;case sv:var c=r&Xw;if(l||(l=Zw),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=Qw,s.set(t,e);var u=kf(l(t),l(e),r,i,o,s);return s.delete(t),u;case av:if(Kl)return Kl.call(t)==Kl.call(e)}return!1}var fv=1,hv=Object.prototype,pv=hv.hasOwnProperty;function mv(t,e,n,r,i,o){var s=n&fv,l=ff(t),c=l.length,d=ff(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:pv.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 k=t[h],x=e[h];if(r)var w=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(w===void 0?k===x||i(k,x,n,r,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,S=e.constructor;b!=S&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(t),o.delete(e),g}var gv=1,vf="[object Arguments]",xf="[object Array]",Qo="[object Object]",yv=Object.prototype,Ef=yv.hasOwnProperty;function bv(t,e,n,r,i,o){var s=Go(t),l=Go(e),c=s?xf:Hn(t),d=l?xf:Hn(e);c=c==vf?Qo:c,d=d==vf?Qo:d;var u=c==Qo,f=d==Qo,h=c==d;if(h&&Hl(t)){if(!Hl(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new jn),s||df(t)?kf(t,e,n,r,i,o):uv(t,e,c,n,r,i,o);if(!(n&gv)){var p=u&&Ef.call(t,"__wrapped__"),m=f&&Ef.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new jn),i(g,y,n,r,o)}}return h?(o||(o=new jn),mv(t,e,n,r,i,o)):!1}function Cf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Zr(t)&&!Zr(e)?t!==t&&e!==e:bv(t,e,n,r,Cf,i)}var Gl=function(){return ln.Date.now()},kv="Expected a function",wv=Math.max,vv=Math.min;function Jl(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(kv);e=Ju(e)||0,Hi(n)&&(u=!!n.leading,f="maxWait"in n,o=f?wv(Ju(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var _=r,B=i;return r=i=void 0,d=v,s=t.apply(B,_),s}function m(v){return d=v,l=setTimeout(k,e),u?p(v):s}function g(v){var _=v-c,B=v-d,A=e-_;return f?vv(A,o-B):A}function y(v){var _=v-c,B=v-d;return c===void 0||_>=e||_<0||f&&B>=o}function k(){var v=Gl();if(y(v))return x(v);l=setTimeout(k,g(v))}function x(v){return l=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function b(){return l===void 0?s:x(Gl())}function S(){var v=Gl(),_=y(v);if(r=arguments,i=this,c=v,_){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(k,e),p(c)}return l===void 0&&(l=setTimeout(k,e)),s}return S.cancel=w,S.flush=b,S}function qi(t,e){return Cf(t,e)}const xv={},Ev={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Cv=[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 Sv(t,e){return a.openBlock(),a.createElementBlock("svg",Ev,Cv)}const Ov=be(xv,[["render",Sv]]),_v={key:0,class:"leading-none"},Tv={key:1},Nv={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Mv={key:1},Av={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Dv=["onClick"],Lv={class:"select-none flex w-full items-center justify-between"},Bv={class:"flex-1"},$v={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},Iv={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},Sf=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,medium: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,summaryText:String,oneLine:Boolean,total:{type:Number,default:null},groupSelected:{type:Boolean,default:!1}},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=zn(),o=a.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=a.ref(!1),l=a.ref(r.options);a.watch(()=>r.options,()=>{const L=(Array.isArray(r.modelValue)?r.modelValue:r.modelValue!==null&&r.modelValue!==void 0?[r.modelValue]:[]).map(j=>l.value.find(z=>qi(z.value,j))||r.options.find(z=>qi(z.value,j))).filter(Boolean);if(!r.groupSelected||!r.multiple){const j=new Set;l.value=[...r.options,...L].filter(z=>{const D=JSON.stringify(z.value);return j.has(D)?!1:(j.add(D),!0)})}else{const j=[...L];for(const z of r.options)j.some(D=>qi(D.value,z.value))||j.push(z);l.value=j}},{immediate:!0,deep:!0});const c=n,d=a.ref(),u=a.ref();function f($){var L,j;if(r.multiple){if($){let z=r.modelValue||[];z.indexOf($)>=0?z.splice(z.indexOf($),1):z.push($),c("update:modelValue",z),g(z),((L=r.modelValue)==null?void 0:L.length)===((j=r.options)==null?void 0:j.length)?s.value=!0:s.value=!1}}else c("update:modelValue",$),g($),d.value=null,u.value.hide()}async function h($){var L,j;c("update:modelValue",$),g($),await a.nextTick(),((L=r.modelValue)==null?void 0:L.length)===((j=r.options)==null?void 0:j.length)&&(s.value=!0)}function p($){c("update:modelValue",$),s.value=!1,g($)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=Jl(function($){c("change",$)},r.debounce),y=a.computed(()=>{var $,L,j,z;if(r.multiple){const D=(($=l.value)==null?void 0:$.filter(I=>{var R;return(R=r.modelValue)==null?void 0:R.includes(I.value)}))||[],C=((L=r.modelValue)==null?void 0:L.length)||0;if(r.summaryText&&C>0){const I=i(r.summaryText,C);return i("wpiccomponents.summary_items",{count:C,type:I})}if(r.maxDisplay){const I=D.slice(0,r.maxDisplay);return D.length-I.length>0?`${I.map(R=>R.label).join(", ")} (+${D.length-I.length})`:I.map(R=>R.label).join(", ")}else return D.map(I=>I.label).join(", ")}else return((z=(j=l.value)==null?void 0:j.find(D=>D.value===r.modelValue))==null?void 0:z.label)||r.modelValue});function k($){var L;try{return r.multiple?r.modelValue!==null&&((L=r.modelValue)==null?void 0:L.some(j=>qi(j,$))):r.modelValue!==null&&qi($,r.modelValue)}catch(j){return console.log(j),!1}}const x={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"},w=a.computed(()=>{var $,L;return(($=r.modelValue)==null?void 0:$.length)===((L=r.options)==null?void 0:L.length)}),b=a.computed(()=>{var D;const $=l.value||[];if(r.filterable&&!r.remoteMethod&&((D=d.value)!=null&&D.trim().length)){const C=d.value.trim().toLowerCase(),I=$.filter(ce=>{var ue;return(ue=ce.label)==null?void 0:ue.toLowerCase().includes(C)});if(!r.groupSelected||!r.multiple)return I;const R=r.modelValue||[],ee=I.filter(ce=>R.includes(ce.value)),te=I.filter(ce=>!R.includes(ce.value));return[...ee,...te]}if(!r.groupSelected||!r.multiple)return $;const L=r.modelValue||[],j=$.filter(C=>L.includes(C.value)),z=$.filter(C=>!L.includes(C.value));return[...j,...z]});function S(){v.value=1,r.remoteMethod&&(_.value=!0,P(d.value,v.value,()=>{_.value=!1}))}const v=a.ref(1),_=a.ref(!1),B=a.computed(()=>{var $;return r.total!==void 0&&(($=r.options)==null?void 0:$.length)>=r.total});function A($){const L=$.target;L.scrollTop+L.clientHeight>=L.scrollHeight-30&&!_.value&&!B.value&&(_.value=!0,v.value+=1,P(d.value,v.value,()=>{_.value=!1}))}const P=Jl(($,L,j)=>{r.remoteMethod($,L).finally(()=>{j==null||j()})},r.debounce||300);return e({allSelected:s,isAllSelected:w}),($,L)=>(a.openBlock(),a.createBlock(fr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:j})=>[a.createVNode(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,medium:t.medium,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var z,D,C,I,R,ee;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&&((z=t.modelValue)==null?void 0:z.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",_v,[w.value&&((D=t.allSelectedText)!=null&&D.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((C=t.options)==null?void 0:C.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(y.value),1)],64))])):!t.multiple&&((I=t.options)!=null&&I.find(te=>te.value===null))?(a.openBlock(),a.createElementBlock("span",Tv,a.toDisplayString((ee=(R=t.options)==null?void 0:R.find(te=>te.value===null))==null?void 0:ee.label),1)):a.renderSlot($.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(m,["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($i,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Ov,{key:1,class:a.normalizeClass(["h-5 w-5 -mr-[2px]",{"h-4!":t.small||t.medium}])},null,8,["class"])):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","medium","invalid","loading"])]),content:a.withCtx(()=>{var j,z;return[a.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:A},[t.filterable?(a.openBlock(),a.createElementBlock("div",Nv,[a.createVNode(Nf,{slim:"",placeholder:$.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[L[0]||(L[0]=D=>d.value=D),S]},null,8,["placeholder","modelValue"])])):a.createCommentVNode("",!0),!t.options&&((j=t.options)==null?void 0:j.length)==0?(a.openBlock(),a.createElementBlock("span",Mv,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Av,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:L[1]||(L[1]=D=>{var C;return h((C=b.value)==null?void 0:C.filter(I=>I.value).map(I=>I.value))})},a.toDisplayString($.$t("wpiccomponents.select_all")),1),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:L[2]||(L[2]=D=>p([]))},a.toDisplayString($.$t("wpiccomponents.select_none")),1)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,D=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!k(D.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||D.value,[`${x[a.unref(he).theme]}`]:!0}]),onClick:C=>D.disabled?null:f(D.value)},[a.createElementVNode("div",Lv,[a.createElementVNode("div",Bv,[a.createElementVNode("div",{class:a.normalizeClass(["",{"opacity-25":D.disabled,"line-clamp-1":t.oneLine}])},a.toDisplayString(D.label||D.value),3),D.description?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":D.disabled}])},a.toDisplayString(D.description),3)):a.createCommentVNode("",!0)]),t.multiple&&k(D.value)?(a.openBlock(),a.createBlock(Uu,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,Dv)],2))),256)),r.remoteMethod?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[_.value?(a.openBlock(),a.createElementBlock("div",$v,a.toDisplayString($.$t("wpiccomponents.loading_more")),1)):B.value&&((z=t.options)==null?void 0:z.length)>0?(a.openBlock(),a.createElementBlock("div",Iv,a.toDisplayString($.$t("wpiccomponents.no_more_results")),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64))],32)]}),_:3},8,["label","disabled"]))}}),Of=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))}}),Vv={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Pv={class:""},Rv=["value","disabled","rows","placeholder"],_f=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",Vv,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",Pv,[d.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{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,Rv)],64))}}),Fv=["placeholder"],Tf={__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(zi,{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,Fv),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},zv={},jv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Hv=[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 Wv(t,e){return a.openBlock(),a.createElementBlock("svg",jv,Hv)}const Uv=be(zv,[["render",Wv]]),Yv={},qv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Kv=[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 Gv(t,e){return a.openBlock(),a.createElementBlock("svg",qv,Kv)}const Jv=be(Yv,[["render",Gv]]),Zv={},Xv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Qv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function ex(t,e){return a.openBlock(),a.createElementBlock("svg",Xv,Qv)}const tx=be(Zv,[["render",ex]]),nx={class:"flex items-center gap-2"},rx={key:0},ix={class:""},ox=["innerHTML"],sx={class:"flex justify-end"},lx=["name","value","checked"],ax={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},cx={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},dx={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},ux={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Nf=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,medium: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,summaryText:String,oneLine:Boolean,total:Number},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:kl()),l=Y0(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 P;if(o.rules&&typeof o.rules=="string"){let $=(P=o.rules)==null?void 0:P.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(P){let $=P&&P.target?P.target.value:P;x($)}const m=n;function g(P){P===!0||P===!1?m("update:modelValue",!P):m("update:modelValue",P)}function y(P){let $=P&&P.target?P.target.value:P;m("update:modelValue",$),m("onChange",$)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=Jl(function(P){m("update:modelValue",P),m("onChange",P)},o.debounce),w=a.ref(null),b=a.ref();function S(){var P,$;o.textarea?(P=b.value)==null||P.focus():($=w.value)==null||$.$el.focus()}function v(){return w.value.meta.valid}const _=a.ref(),B=a.computed(()=>_.value.allSelected),A=a.computed(()=>_.value.isAllSelected);return e({focus:S,isValid:v,allSelected:B,isAllSelected:A}),(P,$)=>(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",nx,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",rx,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",ix,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,ox)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",sx,[a.renderSlot(P.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:L})=>[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]=j=>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(he).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(Uu,{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(P.$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(cr),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:L})=>[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,"border-lime-600!":t.radioValue==t.modelValue}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-lime-600",{"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]=(...j)=>P.onChange&&P.onChange(...j)),checked:t.radioValue==t.modelValue},null,40,lx),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base text-gray-700 dark:text-gray-300",{"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(cr),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>{var j;return[a.createVNode(Sf,{ref_key:"myChoiceList",ref:_,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,medium:t.medium,oneLine:t.oneLine,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,summaryText:t.summaryText,debounce:t.debounce,total:t.total,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((j=h.value)==null?void 0:j.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","medium","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","debounce","total","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(cr),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>[a.createVNode(Tf,{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(cr),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:L})=>[a.createVNode(Of,{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(he).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)}])},[P.$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",ax,[a.renderSlot(P.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var L;return[a.createVNode(_f,{ref_key:"myTextarea",ref:b,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||((L=h.value)==null?void 0:L.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(cr),{key:2,ref_key:"myInput",ref:w,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":!P.$slots.prepend&&!t.naked,"pl-8":P.$slots.prepend&&!t.naked,"pl-6":P.$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(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(k,["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($i,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),P.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",cx,[a.createElementVNode("div",dx,[a.renderSlot(P.$slots,"append",{},()=>[a.withDirectives(a.createVNode(Uv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(Jv,{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",ux,[a.createVNode(a.unref(U0),{name:s.value},{default:a.withCtx(L=>[a.createTextVNode(a.toDisplayString(L.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),P.$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(P.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),fx=["innerHTML"],Mf=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();kl();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 _d(e.value,n.value,{placement:i.placement,middleware:[Od(),Sd(),Cd(i.offset),qy({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,fx),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),hx={key:1,class:"flex justify-between items-baseline pt-4 px-6"},px={class:""},mx={key:2,class:"flex items-center justify-end py-4 px-6"},gx=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(he).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",hx,[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(he).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",px,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",mx,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),yx={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},bx={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},kx=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(he).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",yx,[a.createElementVNode("div",bx,[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))}}),wx=a.createElementVNode("div",{class:""},null,-1),vx=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),xx=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(he).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(he).theme]}`]:!0}])},[a.createVNode(Mf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[wx]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[vx],64)):a.createCommentVNode("",!0)],2))}}),Ex={class:"leading-none"},Cx=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(he).theme]]:!0}])},[a.createElementVNode("span",Ex,[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($i,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Sx=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))}}),Ox=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),_x={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Tx=[Ox(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Nx=be(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",_x,Tx)):(a.openBlock(),a.createBlock(Fr,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Mx={class:"text-base font-medium select-none"},Ki=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(he).theme]]:!t.active&&!t.disabled,[n[a.unref(he).theme]]:t.active&&!t.disabled,[r[a.unref(he).theme]]:t.disabled}])},[a.createElementVNode("span",Mx,[a.renderSlot(i.$slots,"default")])],2))}}),Ax={},Dx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Lx=[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 Bx(t,e){return a.openBlock(),a.createElementBlock("svg",Dx,Lx)}const Af=be(Ax,[["render",Bx]]),$x={},Ix={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Vx=[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 Px(t,e){return a.openBlock(),a.createElementBlock("svg",Ix,Vx)}const Df=be($x,[["render",Px]]),Rx={},Fx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},zx=[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 jx(t,e){return a.openBlock(),a.createElementBlock("svg",Fx,zx)}const Lf=be(Rx,[["render",jx]]),Hx={},Wx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Ux=[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 Yx(t,e){return a.openBlock(),a.createElementBlock("svg",Wx,Ux)}const Bf=be(Hx,[["render",Yx]]),qx={class:"wpic-pagination flex justify-between"},Kx={key:0,class:"flex items-center"},Gx={key:0},Jx={key:1,class:"flex flex-wrap gap-2"},Zx=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=zn(),i=t,o=a.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,l=a.computed(()=>Math.ceil(i.total/i.perPage)),c=a.computed(()=>{const p=l.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let w=y;w<=k;w++)x.push(w);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=l.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",qx,[t.info?(a.openBlock(),a.createElementBlock("div",Kx,[t.total>0?(a.openBlock(),a.createElementBlock("span",Gx,a.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",Jx,[a.createVNode(Ki,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Af,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Df,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,y=>(a.openBlock(),a.createBlock(Ki,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:l.value==0||!l.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Ki,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Bf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[3]||(m[3]=y=>d(l.value)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Lf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),$f=(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)};$f.props=["column","item","rowIndex"];const es=$f,Xx={},Qx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},eE=[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 tE(t,e){return a.openBlock(),a.createElementBlock("svg",Qx,eE)}const nE=be(Xx,[["render",tE]]),rE={class:"font-semibold"},If={__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",rE,[t.checkable?(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).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(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).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))]))}},iE={},oE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},sE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function lE(t,e){return a.openBlock(),a.createElementBlock("svg",oE,sE)}const aE=be(iE,[["render",lE]]),cE={},dE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},uE=[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 fE(t,e){return a.openBlock(),a.createElementBlock("svg",dE,uE)}const hE=be(cE,[["render",fE]]),pE={class:"wpic-table"},mE={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},gE={class:"flex items-center gap-2"},yE={class:"flex items-center gap-2"},bE={class:"w-full rounded-lg"},kE={key:0,class:"w-16"},wE=["width"],vE=["width"],xE={class:"flex justify-center items-center h-full"},EE=["onClick"],CE={class:"rounded-b-lg relative"},SE={key:0},OE=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],_E={class:"flex justify-center items-center h-full"},TE={key:1},NE={key:0,class:"text-center text-gray-400 py-3"},ME=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 dark:bg-gray-950/75"},f=n;a.onMounted(()=>{k()});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(L=>g.value.includes(L.field)||!L.selectable):m.value.filter(L=>L.visible||!L.selectable));function k(){const L=(D,C)=>{let I={};for(let R in D){if(typeof D[R].default=="boolean"&&C[R]!==void 0){I[R]=C[R]!==!1;continue}if(C[R]!==void 0){I[R]=C[R];continue}if(typeof D[R].default=="function"){I[R]=D[R].default();continue}I[R]=D[R].default}return I};let j=[];(p.default&&p.default()||[]).forEach(D=>{var C,I;((C=D.type)==null?void 0:C.name)==="WpicTableColumn"?j.push(D):(I=D.children)!=null&&I.length&&D.children.forEach(R=>{var ee;((ee=R.type)==null?void 0:ee.name)==="WpicTableColumn"&&j.push(R)})}),m.value=j.map(D=>{let C=D.children,I=D.props||{},{field:R,label:ee,help:te,width:ce,minWidth:ue,maxWidth:V,sortable:W,selectable:K,render:q,type:H,align:de,visible:ae,noPadding:we}=L(D.type.props,I);return R||(R=$(ee)),K&&ae&&g.value.push(R),{label:ee,help:te,width:ce,minWidth:ue,maxWidth:V,type:H,align:de,sortable:W,selectable:K,field:R,render:q,children:C,visible:ae,noPadding:we}})}function x(L){var z,D;let j=(z=r.sortOptions)==null?void 0:z.sortDirection;((D=r.sortOptions)==null?void 0:D.sortBy)===L&&(j=j==="asc"?"desc":"asc"),f("changeSort",{sortDirection:j,sortBy:L})}a.watch(()=>p.default,L=>{k()},{deep:!0});const w=a.reactive({});function b({index:L,item:j}){w[L]?w[L]=null:(w[L]=!0,f("expandRow",{index:L,item:j}))}const S=a.ref([]);function v(L){const j=P(L,r.itemId);S.value.includes(j)?(S.value.splice(S.value.indexOf(j),1),_.value=!1):S.value.push(j)}const _=a.ref(!1);function B(){if(_.value=!_.value,S.value=[],_.value)for(let L of r.data){let j=P(L,r.itemId);S.value.push(j)}}function A(){_.value=!1,S.value=[]}e({buildColumns:k,selectedRows:S,selectedColumns:g,resetSelectedRows:A});function P(L,j){return j.split(".").reduce((z,D)=>z?z[D]:void 0,L)}function $(L){return!L||typeof L!="string"?"":L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(L,j)=>{const z=a.resolveComponent("wpic-choice-list"),D=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",pE,[L.$slots.header||L.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",mE,[a.createElementVNode("div",gE,[a.renderSlot(L.$slots,"header")]),a.createElementVNode("div",yE,[a.renderSlot(L.$slots,"actions"),a.createVNode(z,{multiple:"",modelValue:g.value,"onUpdate:modelValue":j[0]||(j[0]=C=>g.value=C),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(C=>C.selectable).map(C=>({label:C.label,value:C.field}))},{default:a.withCtx(()=>[a.createVNode(Ni,{medium:"",square:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(hE,{class:"w-5 h-5"})]),_: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(he).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",bE,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",kE)):a.createCommentVNode("",!0),y.value.find(C=>C.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(C=>C.type=="expand").minWidth}px`}),width:y.value.find(C=>C.type=="expand").width,class:"w-16"},null,12,wE)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(C=>C.type!="expand"),(C,I)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${C.minWidth}px`,maxWidth:`${C.maxWidth}px`}),width:C.width,key:I},null,12,vE))),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(he).theme]}`]])},[a.createElementVNode("div",xE,[a.createVNode(D,{slim:"","hide-error":"",checkbox:"",modelValue:_.value,"onUpdate:modelValue":B},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(C=>C.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(he).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(C=>C.type!="expand"),(C,I)=>{var R,ee;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(he).theme]}`]:!0,"sticky top-0 left-0":I===0}]),style:a.normalizeStyle({maxWidth:`${C.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{C.sortable&&x(C.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":C.sortable&&C.field,"justify-center":C.align=="center","justify-end":C.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":C.align=="right"}])},a.toDisplayString(C.label),3),C.sortable&&C.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":C.field!=((R=t.sortOptions)==null?void 0:R.sortBy)}])},[a.createVNode(nE,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((ee=t.sortOptions)==null?void 0:ee.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,EE)],6)}),256))])],2)),a.createElementVNode("tbody",CE,[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(he).theme]]])},[a.createVNode(Fr,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",SE,OE))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(If,{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,(C,I)=>{var R,ee,te,ce,ue;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${I}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":I%2==0,"is-even":I%2!=0,[s[a.unref(he).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}])},[a.createElementVNode("div",_E,[a.createVNode(D,{slim:"","hide-error":"",checkbox:"",modelValue:S.value.includes(P(C,t.itemId)),checkboxValue:P(C,t.itemId),"onUpdate:modelValue":V=>v(C)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(V=>V.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(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Ni,{small:"",square:"",onClick:V=>b({item:C,index:I})},{default:a.withCtx(()=>[w[I]?(a.openBlock(),a.createBlock(tx,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(aE,{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(V=>V.type!="expand"),(V,W)=>{var K,q;return a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":W===0,[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!V.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":I===((K=t.data)==null?void 0:K.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":I===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"text-center justify-center":V.align=="center","text-right justify-end":V.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${V.maxWidth}px`}),id:`${I}_${W}`,column:V,item:C,rowIndex:I,key:W},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(V=>V.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(he).theme]]:!t.stripe,[l[a.unref(he).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(es,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(he).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((R=y.value.find(V=>V.type=="expand"))!=null&&R.noPadding),"p-0":(ee=y.value.find(V=>V.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":I===((te=t.data)==null?void 0:te.length)-1&&!t.totalItem,"first:rounded-bl-lg":I===((ce=t.data)==null?void 0:ce.length)-1&&!t.totalItem,"text-center":y.value.find(V=>V.type=="expand").align=="center","text-right":y.value.find(V=>V.type=="expand").align=="right"}]),column:y.value.find(V=>V.type=="expand"),rowIndex:I,colspan:(ue=y.value)==null?void 0:ue.length,item:C},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,w[I]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",TE,[a.createVNode(If,{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",NE," No Data ")):a.createCommentVNode("",!0)],2)])}}}),AE={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 rt(t){this.content=t}rt.prototype={constructor:rt,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 rt(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 rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(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 rt(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=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.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}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Vf(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=Vf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Pf(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=Pf(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class J{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 J(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 J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(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 J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(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 Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Pf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ts(0,e);if(e==this.size)return ts(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?ts(r+1,s):ts(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 J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.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 J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Zl={index:0,offset:0};function ts(t,e){return Zl.index=t,Zl.offset=e,Zl}function ns(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(!ns(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ns(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class Bc{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&&ns(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 Bc.none;if(e instanceof Bc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$e.none=[];class rs extends Error{}class re{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=Ff(this.content,e+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(e,n){return new re(Rf(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 re.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 re(J.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 re(e,r,i)}}re.empty=new re(J.empty,0,0);function Rf(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(Rf(o.content,e-i-1,n-i-1)))}function Ff(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=Ff(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function DE(t,e,n){if(n.openStart>t.depth)throw new rs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new rs("Inconsistent open depths");return zf(t,e,n,0)}function zf(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=zf(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 vr(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=LE(n,t);return vr(o,Hf(t,s,l,e,r))}else return vr(o,is(t,e,r))}function jf(t,e){if(!e.type.compatibleContent(t.type))throw new rs("Cannot join "+e.type.name+" onto "+t.type.name)}function Xl(t,e,n){let r=t.node(n);return jf(r,e.node(n)),r}function wr(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 Gi(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&&(wr(t.nodeAfter,r),o++));for(let l=o;l<s;l++)wr(i.child(l),r);e&&e.depth==n&&e.textOffset&&wr(e.nodeBefore,r)}function vr(t,e){return t.type.checkContent(e),t.copy(e)}function Hf(t,e,n,r,i){let o=t.depth>i&&Xl(t,e,i+1),s=r.depth>i&&Xl(n,r,i+1),l=[];return Gi(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(jf(o,s),wr(vr(o,Hf(t,e,n,r,i+1)),l)):(o&&wr(vr(o,is(t,e,i+1)),l),Gi(e,n,i,l),s&&wr(vr(s,is(n,r,i+1)),l)),Gi(r,null,i,l),new J(l)}function is(t,e,n){let r=[];if(Gi(null,t,n,r),t.depth>n){let i=Xl(t,e,n+1);wr(vr(i,is(t,e,n+1)),r)}return Gi(e,null,n,r),new J(r)}function LE(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(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ji{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 $e.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 ss(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 Ji(n,r,o)}static resolveCached(e,n){let r=Wf.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 Wf.set(e,r=new BE);let i=r.elts[r.i]=Ji.resolve(e,n);return r.i=(r.i+1)%$E,i}}class BE{constructor(){this.elts=[],this.i=0}}const $E=12,Wf=new WeakMap;class ss{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 IE=Object.create(null);let Wn=class $c{constructor(e,n,r,i=$e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||J.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&&ns(this.attrs,n||e.defaultAttrs||IE)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new $c(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new $c(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 re.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 re(d,i.depth-s,o.depth-s)}replace(e,n,r){return DE(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 Ji.resolveCached(this,e)}resolveNoCache(e){return Ji.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Uf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=J.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=$e.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(!$e.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=J.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Wn.prototype.text=void 0;class ls extends Wn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Uf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ls(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Uf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VE(e,n);if(r.next==null)return xr.empty;let i=Yf(r);r.next&&r.err("Unexpected trailing text");let o=WE(HE(i));return UE(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 J.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(`
|
|
28
28
|
`)}}xr.empty=new xr(!0);class VE{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 Yf(t){let e=[];do e.push(PE(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function PE(t){let e=[];do e.push(RE(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function RE(t){let e=jE(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=FE(t,e);else break;return e}function qf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function FE(t,e){let n=qf(t),r=n;return t.eat(",")&&(t.next!="}"?r=qf(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function zE(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 jE(t){if(t.eat("(")){let e=Yf(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=zE(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 HE(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 Kf(t,e){return e-t}function Gf(t,e){let n=[];return r(e),n.sort(Kf);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 WE(t){let e=Object.create(null);return n(Gf(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]);Gf(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new xr(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(Kf);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function UE(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 Jf(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 Zf(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 Xf(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 Qf(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new qE(t,r,e[r]);return n}let eh=class Vg{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=Qf(e,r.attrs),this.defaultAttrs=Jf(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==xr.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:Zf(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Wn(this,this.computeAttrs(e),J.from(n),$e.setFrom(r))}createChecked(e=null,n,r){return n=J.from(n),this.checkContent(n),new Wn(this,this.computeAttrs(e),n,$e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=J.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(J.empty,!0);return o?new Wn(this,e,n.append(o),$e.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){Xf(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:$e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Vg(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 YE(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 qE{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?YE(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class as{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Qf(e,i.attrs),this.excluded=null;let o=Jf(this.attrs);this.instance=o?new $e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new $e(this,Zf(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new as(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){Xf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class th{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=rt.from(e.nodes),n.marks=rt.from(e.marks||{}),this.nodes=eh.compile(this.spec.nodes,this),this.marks=as.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]=xr.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?nh(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==""?[]:nh(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 eh){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new ls(r,r.defaultAttrs,e,$e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Wn.fromJSON(this,e)}markFromJSON(e){return $e.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function nh(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 KE(t){return t.tag!=null}function GE(t){return t.style!=null}class Un{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(KE(i))this.tags.push(i);else if(GE(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 sh(this,n,!1);return r.addAll(e,$e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new sh(this,n,!0);return r.addAll(e,$e.none,n.from,n.to),re.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(XE(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=lh(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=lh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Un(e,Un.schemaRules(e)))}}const rh={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},JE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ih={ol:!0,ul:!0},Zi=1,Ql=2,cs=4;function oh(t,e,n){return e!=null?(e?Zi:0)|(e==="full"?Ql:0):t&&t.whitespace=="pre"?Zi|Ql:n&-5}class ds{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=$e.none,this.match=o||(s&cs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.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&Zi)){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=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.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&&!rh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sh{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=oh(null,n.preserveWhitespace,0)|(r?cs:0);i?o=new ds(i.type,i.attrs,$e.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ds(null,null,$e.none,!0,null,s):o=new ds(e.schema.topNodeType,null,$e.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&Ql?"full":this.localPreserveWS||(i.options&Zi)>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,`
|
|
29
29
|
`);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;ih.hasOwnProperty(s)&&this.parser.normalizeLists&&ZE(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:JE.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(rh.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(`
|
|
30
30
|
`),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=$e.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):ah(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=oh(e,o,s.options);s.options&cs&&s.content.length==0&&(l|=cs);let c=$e.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):ah(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ds(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|=Zi)}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 ZE(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ih.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function XE(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function lh(t){let e={};for(let n in t)e[n]=t[n];return e}function ah(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 Er{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ea(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}=us(ea(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&&us(ea(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return us(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Er(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=ch(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return ch(e.marks)}}function ch(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ea(t){return t.document||window.document}const dh=new WeakMap;function QE(t){let e=dh.get(t);return e===void 0&&dh.set(t,e=eC(t)),e}function eC(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 us(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=QE(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}=us(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 uh=65535,fh=Math.pow(2,16);function tC(t,e){return t+e*fh}function hh(t){return t&uh}function nC(t){return(t-(t&uh))/fh}const ph=1,mh=2,fs=4,gh=8;class ta{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&gh)>0}get deletedBefore(){return(this.delInfo&(ph|fs))>0}get deletedAfter(){return(this.delInfo&(mh|fs))>0}get deletedAcross(){return(this.delInfo&fs)>0}}class Bt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Bt.empty)return Bt.empty}recover(e){let n=0,r=hh(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+nC(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:tC(l/3,e-c),g=e==c?mh:e==f?ph:fs;return(n<0?e!=c:e!=f)&&(g|=gh),new ta(p,g,m)}i+=u-d}return r?e+i:new ta(e+i,0,null)}touches(e,n){let r=0,i=hh(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 Bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Bt.empty:new Bt(e<0?[0,-e,0]:[0,0,e])}}Bt.empty=new Bt([]);class Qr{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Qr(this.maps,this.mirror,e,n)}copy(){return new Qr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Qr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],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 ta(e,i,null)}}const na=Object.create(null);class ut{getMap(){return Bt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=na[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 na)throw new RangeError("Duplicate use of step JSON ID "+e);return na[e]=n,n.prototype.jsonID=e,n}}class Ue{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ue(e,null)}static fail(e){return new Ue(null,e)}static fromReplace(e,n,r,i){try{return Ue.ok(e.replace(n,r,i))}catch(o){if(o instanceof rs)return Ue.fail(o.message);throw o}}}function ra(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ra(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return J.fromArray(r)}class Yn extends ut{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 re(ra(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 Ue.fromReplace(e,this.from,this.to,o)}invert(){return new an(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 Yn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yn(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 Yn(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("addMark",Yn);class an extends ut{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 re(ra(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,r)}invert(){return new Yn(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 an(n.pos,r.pos,this.mark)}merge(e){return e instanceof an&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new an(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 an(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("removeMark",an);class qn extends ut{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new re(J.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 qn(this.pos,n.marks[i]);return new qn(this.pos,this.mark)}}return new ei(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qn(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 qn(n.pos,e.markFromJSON(n.mark))}}ut.jsonID("addNodeMark",qn);class ei extends ut{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new re(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ei(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 ei(n.pos,e.markFromJSON(n.mark))}}ut.jsonID("removeNodeMark",ei);class Ze extends ut{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ia(e,this.from,this.to)?Ue.fail("Structure replace would overwrite content"):Ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Bt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ze(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 Ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ze)||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?re.empty:new re(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ze(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?re.empty:new re(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ze(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 Ze(n.from,n.to,re.fromJSON(e,n.slice),!!n.structure)}}ut.jsonID("replace",Ze);class Xe extends ut{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&&(ia(e,this.from,this.gapFrom)||ia(e,this.gapTo,this.to)))return Ue.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ue.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ue.fromReplace(e,this.from,this.to,r):Ue.fail("Content does not fit in gap")}getMap(){return new Bt([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 Xe(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 Xe(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 Xe(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(e,n.slice),n.insert,!!n.structure)}}ut.jsonID("replaceAround",Xe);function ia(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 rC(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 an(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new Yn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function iC(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 as){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 an(s.from,s.to,s.style)))}function oa(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 Ze(l,u,re.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new an(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 re(J.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Ze(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(J.empty,!0);t.replace(l,l,new re(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function oC(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ti(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||!oC(i,o,s))break}return null}function sC(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=J.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=J.from(r.node(m).copy(u)),f++):c--;let h=J.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=J.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,l,new re(u.append(h),f,p),u.size-f,!0))}function sa(t,e,n=null,r=t){let i=lC(t,e),o=i&&aC(r,e);return o?i.map(yh).concat({type:e,attrs:n}).concat(o.map(yh)):null}function yh(t){return{type:t,attrs:null}}function lC(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 aC(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 cC(t,e,n){let r=J.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=J.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Xe(i,o,i,o,new re(r,0,0),n.length,!0))}function dC(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)&&uC(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&&kh(t,s,l,o),oa(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 Xe(f,h,f+1,h-1,new re(J.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&bh(t,s,l,o),!1}})}function bh(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 kh(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(`
|
|
31
|
-
`))}})}function uC(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function fC(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 Xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new re(J.from(s),0,0),1,!0))}function Sn(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 hC(t,e,n=1,r){let i=t.doc.resolve(e),o=J.empty,s=J.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=J.from(i.node(l).copy(o));let u=r&&r[d];s=J.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new Ze(e,e,new re(o.append(s),n,n),!0))}function Kn(t,e){let n=t.resolve(e),r=n.index();return wh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function pC(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 wh(t,e){return!!(t&&e&&!t.isLeaf&&pC(t,e))}function hs(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&&wh(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 mC(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);kh(t,u.node(),u.before(),l)}s.inlineContent&&oa(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 Ze(d,c.map(e+n,-1),re.empty,!0)),r===!0){let u=t.doc.resolve(d);bh(t,u.node(),u.before(),t.steps.length)}return t}function gC(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 vh(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 ps(t,e,n=e,r=re.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return xh(i,o,r)?new Ze(e,n,r):new yC(i,o,r).fit()}function xh(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class yC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.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=J.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 re(o,s,l);return e>-1?new Xe(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ze(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=la(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(J.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=la(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(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=la(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new re(Xi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new re(Xi(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(Eh(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=Qi(this.placed,n,J.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 k=y.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),y=k.content}this.unplaced=m?e==0?re.empty:new re(Xi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new re(Xi(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||!aa(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=aa(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=aa(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=Qi(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=Qi(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Qi(this.placed,this.frontier.length,n))}}function Xi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xi(t.firstChild.content,e-1,n)))}function Qi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Qi(t.lastChild.content,e-1,n)))}function la(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Eh(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Eh(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(J.empty,!0)))),t.copy(r)}function aa(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&&!bC(n,o.content,s)?l:null}function bC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function kC(t){return t.spec.defining||t.spec.definingForContent}function wC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(xh(i,o,r))return t.step(new Ze(e,n,r));let s=Sh(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=kC(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],k=!0;y<0&&(k=!1,y=-y);let x=i.node(y-1),w=i.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return t.replace(i.before(y),k?o.after(y):n,new re(Ch(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 Ch(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ch(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(J.empty,!0))}return t}function vC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=gC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new re(J.from(r),0,0))}function xC(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Sh(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 Sh(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 ni extends ut{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 Ue.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 Ue.fromReplace(e,this.pos,this.pos+1,new re(J.from(i),0,n.isLeaf?0:1))}getMap(){return Bt.empty}invert(e){return new ni(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 ni(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 ni(n.pos,n.attr,n.value)}}ut.jsonID("attr",ni);class eo extends ut{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 Ue.ok(r)}getMap(){return Bt.empty}invert(e){return new eo(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 eo(n.attr,n.value)}}ut.jsonID("docAttr",eo);let ri=class extends Error{};ri=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ri.prototype=Object.create(Error.prototype),ri.prototype.constructor=ri,ri.prototype.name="TransformError";class EC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ri(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=re.empty){let i=ps(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new re(J.from(r),0,0))}delete(e,n){return this.replace(e,n,re.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return wC(this,e,n,r),this}replaceRangeWith(e,n,r){return vC(this,e,n,r),this}deleteRange(e,n){return xC(this,e,n),this}lift(e,n){return sC(this,e,n),this}join(e,n=1){return mC(this,e,n),this}wrap(e,n){return cC(this,e,n),this}setBlockType(e,n=e,r,i=null){return dC(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return fC(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ni(e,n,r)),this}setDocAttribute(e,n){return this.step(new eo(e,n)),this}addNodeMark(e,n){return this.step(new qn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof $e)){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 ei(e,n)),this}split(e,n=1,r){return hC(this,e,n,r),this}addMark(e,n,r){return rC(this,e,n,r),this}removeMark(e,n,r){return iC(this,e,n,r),this}clearIncompatible(e,n,r){return oa(this,e,n,r),this}}const ca=Object.create(null);class xe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new CC(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=re.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?re.empty:n),l==0&&Th(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),Th(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ke(e):ii(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?ii(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):ii(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 $t(e.node(0))}static atStart(e){return ii(e,e,0,0,1)||new $t(e)}static atEnd(e){return ii(e,e,e.content.size,e.childCount,-1)||new $t(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ca[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return ca[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}xe.prototype.visible=!0;class CC{constructor(e,n){this.$from=e,this.$to=n}}let _h=!1;function Oh(t){!_h&&!t.parent.inlineContent&&(_h=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ke extends xe{constructor(e,n=e){Oh(e),Oh(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 xe.near(r);let i=e.resolve(n.map(this.anchor));return new ke(i.parent.inlineContent?i:r,r)}replace(e,n=re.empty){if(super.replace(e,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ms(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 ke(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=xe.findFrom(n,r,!0)||xe.findFrom(n,-r,!0);if(o)n=o.$head;else return xe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(xe.findFrom(e,-r,!0)||xe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ke(e,n)}}xe.jsonID("text",ke);class ms{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ms(e.map(this.anchor),e.map(this.head))}resolve(e){return ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class pe extends xe{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?xe.near(o):new pe(o)}content(){return new re(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new da(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(e.resolve(n.anchor))}static create(e,n){return new pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}pe.prototype.visible=!1,xe.jsonID("node",pe);class da{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ms(r,r):new da(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):xe.near(n)}}class $t extends xe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=re.empty){if(n==re.empty){e.delete(0,e.doc.content.size);let r=xe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new $t(e)}map(e){return new $t(e)}eq(e){return e instanceof $t}getBookmark(){return SC}}xe.jsonID("all",$t);const SC={map(){return this},resolve(t){return new $t(t)}};function ii(t,e,n,r,i,o=!1){if(e.inlineContent)return ke.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&&pe.isSelectable(l))return pe.create(t,n-(i<0?l.nodeSize:0))}else{let c=ii(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Th(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;let o=t.mapping.maps[r],s;o.forEach((l,c,d,u)=>{s==null&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const Nh=1,Mh=2,Ah=4;class _C extends EC{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|Nh)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Nh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Mh,this}ensureMarks(e){return $e.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&Mh)>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)||$e.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(xe.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|=Ah,this}get scrolledIntoView(){return(this.updated&Ah)>0}}function Dh(t,e){return!e||!t?t:t.bind(e)}class to{constructor(e,n,r){this.name=e,this.init=Dh(n.init,r),this.apply=Dh(n.apply,r)}}const OC=[new to("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new to("selection",{init(t,e){return t.selection||xe.atStart(e.doc)},apply(t){return t.selection}}),new to("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new to("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ua{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=OC.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 to(r.key,r.spec.state,r))})}}class oi{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 oi(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 _C(this)}static create(e){let n=new ua(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new oi(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 ua(this.schema,e.plugins),r=n.fields,i=new oi(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 ua(e.schema,e.plugins),o=new oi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Wn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=xe.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 Lh(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Lh(i,e,{})),n[r]=i}return n}class it{constructor(e){this.spec=e,this.props={},e.props&&Lh(e.props,this,this.props),this.key=e.key?e.key.key:Bh("plugin")}getState(e){return e[this.key]}}const fa=Object.create(null);function Bh(t){return t in fa?t+"$"+ ++fa[t]:(fa[t]=0,t+"$")}class It{constructor(e="key"){this.key=Bh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ot=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},no=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ha=null;const _n=function(t,e,n){let r=ha||(ha=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},TC=function(){ha=null},Cr=function(t,e,n,r){return n&&($h(t,e,n,r,-1)||$h(t,e,n,r,1))},NC=/^(img|br|input|textarea|hr)$/i;function $h(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ro(t)||NC.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?jt(t):0}else return!1}}function jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function MC(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=jt(t)}else if(t.parentNode&&!ro(t))e=ot(t),t=t.parentNode;else return null}}function AC(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&&!ro(t))e=ot(t)+1,t=t.parentNode;else return null}}function DC(t,e,n){for(let r=e==0,i=e==jt(t);r||i;){if(t==n)return!0;let o=ot(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==jt(t)}}function ro(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const gs=function(t){return t.focusNode&&Cr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Sr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function LC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function BC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(jt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(jt(r.startContainer),r.startOffset)}}}const cn=typeof navigator<"u"?navigator:null,Ih=typeof document<"u"?document:null,Gn=cn&&cn.userAgent||"",pa=/Edge\/(\d+)/.exec(Gn),Vh=/MSIE \d/.exec(Gn),ma=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gn),Ot=!!(Vh||ma||pa),Jn=Vh?document.documentMode:ma?+ma[1]:pa?+pa[1]:0,tn=!Ot&&/gecko\/(\d+)/i.test(Gn);tn&&+(/Firefox\/(\d+)/.exec(Gn)||[0,0])[1];const ga=!Ot&&/Chrome\/(\d+)/.exec(Gn),ft=!!ga,Ph=ga?+ga[1]:0,bt=!Ot&&!!cn&&/Apple Computer/.test(cn.vendor),si=bt&&(/Mobile\/\w+/.test(Gn)||!!cn&&cn.maxTouchPoints>2),Ht=si||(cn?/Mac/.test(cn.platform):!1),$C=cn?/Win/.test(cn.platform):!1,On=/Android \d/.test(Gn),io=!!Ih&&"webkitFontSmoothing"in Ih.documentElement.style,IC=io?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function VC(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 Tn(t,e){return typeof t=="number"?t:t[e]}function PC(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 Rh(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=no(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?VC(o):PC(l),u=0,f=0;if(e.top<d.top+Tn(r,"top")?f=-(d.top-e.top+Tn(i,"top")):e.bottom>d.bottom-Tn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Tn(i,"top")-d.top:e.bottom-d.bottom+Tn(i,"bottom")),e.left<d.left+Tn(r,"left")?u=-(d.left-e.left+Tn(i,"left")):e.right>d.right-Tn(r,"right")&&(u=e.right-d.right+Tn(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 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:Fh(t.dom)}}function Fh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=no(r));return e}function FC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;zh(n,r==0?0:r-e)}function zh(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 li=null;function zC(t){if(t.setActive)return t.setActive();if(li)return t.focus(li);let e=Fh(t);t.focus(li==null?{get preventScroll(){return li={preventScroll:!0},!0}}:void 0),li||(li=!1,zh(e,0))}function jh(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=_n(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?jC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:jh(n,i)}function jC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=Zn(r,1);if(o.top!=o.bottom&&ya(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function ya(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function HC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function WC(t,e,n){let{node:r,offset:i}=jh(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 UC(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 Hh(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(ya(e,d))return Hh(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function YC(t,e){let n=t.dom.ownerDocument,r,i=0,o=BC(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(!ya(e,d)||(s=Hh(t.dom,e,d),!s))return null}if(bt)for(let d=s;r&&d;d=no(d))d.draggable&&(r=void 0);if(s=HC(s,e),r){if(tn&&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;io&&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=UC(t,r,i,e))}l==null&&(l=WC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Wh(t){return t.top<t.bottom||t.left<t.right}function Zn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Wh(r))return r}return Array.prototype.find.call(n,Wh)||t.getBoundingClientRect()}const qC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Uh(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=io||tn;if(r.nodeType==3)if(s&&(qC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Zn(_n(r,i,i),n);if(tn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Zn(_n(r,i-1,i-1),-1);if(d.top==c.top){let u=Zn(_n(r,i,i+1),-1);if(u.top!=c.top)return oo(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++,oo(Zn(_n(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return ba(c.getBoundingClientRect(),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];if(c.nodeType==1)return ba(c.getBoundingClientRect(),!0)}return ba(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?_n(c,jt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return oo(Zn(d,1),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?_n(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return oo(Zn(d,-1),!0)}return oo(Zn(r.nodeType==3?_n(r):r,-n),n>=0)}function oo(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 ba(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 Yh(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 KC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Yh(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=Uh(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=_n(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 GC=/[\u0590-\u08ac]/;function JC(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?!GC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:Yh(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 qh=null,Kh=null,Gh=!1;function ZC(t,e,n){return qh==e&&Kh==n?Gh:(qh=e,Kh=n,Gh=n=="up"||n=="down"?KC(t,e,n):JC(t,e,n))}const Wt=0,Jh=1,_r=2,dn=3;class so{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Wt,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>ot(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 Qh){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 Zh&&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?ot(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?ot(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=ot(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=ot(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((tn||bt)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
32
|
-
`),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:ot(y)+1});break}let k=g.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(tn&&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&&bt)&&Cr(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Cr(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?_r:Jh,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=dn:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?_r:dn}r=s}this.dirty=_r}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?_r:Jh;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Zh extends so{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==Wt&&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 so{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 Or extends so{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=Er.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Or(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&dn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Wt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Wt}}slice(e,n,r){let i=Or.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=wa(o,n,s,r)),e>0&&(o=wa(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 Xn extends so{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}=Er.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=np(u,r,n),d?c=new QC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new ys(e,n,r,i,u,h,o):new Xn(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=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Wt&&e.eq(this.node)&&bs(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 tS(this,s&&s.node,e);iS(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?$e.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==_r)&&(s&&this.protectLocalComposition(e,s),ep(this.contentDOM,this.children,e),si&&oS(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||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=sS(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=wa(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==dn||!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=Wt}updateOuterDeco(e){if(bs(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=tp(this.dom,this.nodeDOM,ka(this.outerDeco,this.node,n),ka(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 Xh(t,e,n,r,i){np(r,e,t);let o=new Xn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ys extends Xn{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==dn||this.dirty!=Wt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Wt||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=Wt,!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 ys(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=dn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Qh extends so{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Wt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class QC extends Xn{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==dn)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 ep(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=rp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof Or){let c=r?r.previousSibling:t.lastChild;ep(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=rp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const lo=function(t){t&&(this.nodeName=t)};lo.prototype=Object.create(null);const Tr=[new lo];function ka(t,e,n){if(t.length==0)return Tr;let r=n?Tr[0]:new lo,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new lo(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new lo(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 tp(t,e,n,r){if(n==Tr&&r==Tr)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=Tr[0]),i=c}eS(i,l||Tr[0],s)}return i}function eS(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 np(t,e,n){return tp(t,t,Tr,ka(e,n,t.nodeType!=1))}function bs(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 rp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class tS{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=nS(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=Wt,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=Or.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==dn&&s.dom==s.contentDOM&&(s.dirty=_r),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 Xn){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!=dn&&bs(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=_r,f.updateChildren(i,s+1),f.dirty=Wt),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)||!bs(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=Xn.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=Xn.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 Zh(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 Or;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ys)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((bt||ft)&&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 Qh(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 nS(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 Or)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 rS(t,e){return t.type.side-e.type.side}function iS(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(rS);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 k=0;k<l.length;k++)l[k].to<y&&(y=l[k].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 oS(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 sS(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 wa(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 va(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(gs(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&pe.isSelectable(f)&&i.parent&&!(f.isInline&&DC(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(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=Ea(t,u,l,f)}return d}function ip(t){return t.editable?t.hasFocus():up(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Nn(t,e=!1){let n=t.state.selection;if(ap(t,n),!!ip(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ft){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Cr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)aS(t);else{let{anchor:r,head:i}=n,o,s;op&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=sp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=sp(t,n.to))),t.docView.setSelection(r,i,t,e),op&&(o&&lp(o),s&&lp(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&lS(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const op=bt||ft&&Ph<63;function sp(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(bt&&i&&i.contentEditable=="false")return xa(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return xa(i);if(o)return xa(o)}}function xa(t){return t.contentEditable="true",bt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function lp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function lS(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(()=>{(!ip(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function aS(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,ot(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Ot&&Jn<=11&&(r.disabled=!0,r.disabled=!1)}function ap(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(cp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else cp(t)}function cp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ea(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}function dp(t){return t.editable&&!t.hasFocus()?!1:up(t)}function up(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 cS(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Cr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ca(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&&xe.findFrom(o,e)}function Qn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function fp(t,e,n){let r=t.state.selection;if(r instanceof ke)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 Qn(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ca(t.state,e);return i&&i instanceof pe?Qn(t,i):!1}else if(!(Ht&&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?pe.isSelectable(o)?Qn(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):io?Qn(t,new ke(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return Qn(t,new ke(e>0?r.$to:r.$from));{let i=Ca(t.state,e);return i?Qn(t,i):!1}}}function ks(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ao(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ai(t,e){return e<0?dS(t):uS(t)}function dS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(tn&&n.nodeType==1&&r<ks(n)&&ao(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(ao(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(hp(n))break;{let l=n.previousSibling;for(;l&&ao(l,-1);)i=n.parentNode,o=ot(l),l=l.previousSibling;if(l)n=l,r=ks(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Sa(t,n,r):i&&Sa(t,i,o)}function uS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ks(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(ao(l,1))o=n,s=++r;else break}else{if(hp(n))break;{let l=n.nextSibling;for(;l&&ao(l,1);)o=l.parentNode,s=ot(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ks(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Sa(t,o,s)}function hp(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function fS(t,e){for(;t&&e==t.childNodes.length&&!ro(t);)e=ot(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 hS(t,e){for(;t&&!e&&!ro(t);)e=ot(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 Sa(t,e,n){if(e.nodeType!=3){let o,s;(s=fS(e,n))?(e=s,n=0):(o=hS(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(gs(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&&Nn(t)},50)}function pp(t,e){let n=t.state.doc.resolve(e);if(!(ft||$C)&&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 mp(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||Ht&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ca(t.state,e);if(s&&s instanceof pe)return Qn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof $t?xe.near(s,e):xe.findFrom(s,e);return l?Qn(t,l):!1}return!1}function gp(t,e){if(!(t.state.selection instanceof ke))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 yp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function pS(t){if(!bt||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;yp(t,r,"true"),setTimeout(()=>yp(t,r,"false"),20)}return!1}function mS(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function gS(t,e){let n=e.keyCode,r=mS(e);if(n==8||Ht&&n==72&&r=="c")return gp(t,-1)||ai(t,-1);if(n==46&&!e.shiftKey||Ht&&n==68&&r=="c")return gp(t,1)||ai(t,1);if(n==13||n==27)return!0;if(n==37||Ht&&n==66&&r=="c"){let i=n==37?pp(t,t.state.selection.from)=="ltr"?-1:1:-1;return fp(t,i,r)||ai(t,i)}else if(n==39||Ht&&n==70&&r=="c"){let i=n==39?pp(t,t.state.selection.from)=="ltr"?1:-1:1;return fp(t,i,r)||ai(t,i)}else{if(n==38||Ht&&n==80&&r=="c")return mp(t,-1,r)||ai(t,-1);if(n==40||Ht&&n==78&&r=="c")return pS(t)||mp(t,1,r)||ai(t,1);if(r==(Ht?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function _a(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")||Er.fromSchema(t.state.schema),l=Sp(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Ep[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,`
|
|
31
|
+
`))}})}function uC(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function fC(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 Xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new re(J.from(s),0,0),1,!0))}function Sn(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 hC(t,e,n=1,r){let i=t.doc.resolve(e),o=J.empty,s=J.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=J.from(i.node(l).copy(o));let u=r&&r[d];s=J.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new Ze(e,e,new re(o.append(s),n,n),!0))}function Kn(t,e){let n=t.resolve(e),r=n.index();return wh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function pC(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 wh(t,e){return!!(t&&e&&!t.isLeaf&&pC(t,e))}function hs(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&&wh(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 mC(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);kh(t,u.node(),u.before(),l)}s.inlineContent&&oa(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 Ze(d,c.map(e+n,-1),re.empty,!0)),r===!0){let u=t.doc.resolve(d);bh(t,u.node(),u.before(),t.steps.length)}return t}function gC(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 vh(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 ps(t,e,n=e,r=re.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return xh(i,o,r)?new Ze(e,n,r):new yC(i,o,r).fit()}function xh(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class yC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.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=J.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 re(o,s,l);return e>-1?new Xe(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ze(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=la(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(J.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=la(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(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=la(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new re(Xi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new re(Xi(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(Eh(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=Qi(this.placed,n,J.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 k=y.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),y=k.content}this.unplaced=m?e==0?re.empty:new re(Xi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new re(Xi(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||!aa(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=aa(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=aa(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=Qi(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=Qi(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Qi(this.placed,this.frontier.length,n))}}function Xi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xi(t.firstChild.content,e-1,n)))}function Qi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Qi(t.lastChild.content,e-1,n)))}function la(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Eh(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Eh(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(J.empty,!0)))),t.copy(r)}function aa(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&&!bC(n,o.content,s)?l:null}function bC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function kC(t){return t.spec.defining||t.spec.definingForContent}function wC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(xh(i,o,r))return t.step(new Ze(e,n,r));let s=Sh(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=kC(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],k=!0;y<0&&(k=!1,y=-y);let x=i.node(y-1),w=i.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return t.replace(i.before(y),k?o.after(y):n,new re(Ch(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 Ch(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ch(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(J.empty,!0))}return t}function vC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=gC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new re(J.from(r),0,0))}function xC(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Sh(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 Sh(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 ni extends ut{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 Ue.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 Ue.fromReplace(e,this.pos,this.pos+1,new re(J.from(i),0,n.isLeaf?0:1))}getMap(){return Bt.empty}invert(e){return new ni(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 ni(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 ni(n.pos,n.attr,n.value)}}ut.jsonID("attr",ni);class eo extends ut{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 Ue.ok(r)}getMap(){return Bt.empty}invert(e){return new eo(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 eo(n.attr,n.value)}}ut.jsonID("docAttr",eo);let ri=class extends Error{};ri=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ri.prototype=Object.create(Error.prototype),ri.prototype.constructor=ri,ri.prototype.name="TransformError";class EC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ri(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=re.empty){let i=ps(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new re(J.from(r),0,0))}delete(e,n){return this.replace(e,n,re.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return wC(this,e,n,r),this}replaceRangeWith(e,n,r){return vC(this,e,n,r),this}deleteRange(e,n){return xC(this,e,n),this}lift(e,n){return sC(this,e,n),this}join(e,n=1){return mC(this,e,n),this}wrap(e,n){return cC(this,e,n),this}setBlockType(e,n=e,r,i=null){return dC(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return fC(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ni(e,n,r)),this}setDocAttribute(e,n){return this.step(new eo(e,n)),this}addNodeMark(e,n){return this.step(new qn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof $e)){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 ei(e,n)),this}split(e,n=1,r){return hC(this,e,n,r),this}addMark(e,n,r){return rC(this,e,n,r),this}removeMark(e,n,r){return iC(this,e,n,r),this}clearIncompatible(e,n,r){return oa(this,e,n,r),this}}const ca=Object.create(null);class xe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new CC(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=re.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?re.empty:n),l==0&&Th(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),Th(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ke(e):ii(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?ii(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):ii(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 $t(e.node(0))}static atStart(e){return ii(e,e,0,0,1)||new $t(e)}static atEnd(e){return ii(e,e,e.content.size,e.childCount,-1)||new $t(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ca[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return ca[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}xe.prototype.visible=!0;class CC{constructor(e,n){this.$from=e,this.$to=n}}let Oh=!1;function _h(t){!Oh&&!t.parent.inlineContent&&(Oh=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ke extends xe{constructor(e,n=e){_h(e),_h(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 xe.near(r);let i=e.resolve(n.map(this.anchor));return new ke(i.parent.inlineContent?i:r,r)}replace(e,n=re.empty){if(super.replace(e,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ms(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 ke(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=xe.findFrom(n,r,!0)||xe.findFrom(n,-r,!0);if(o)n=o.$head;else return xe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(xe.findFrom(e,-r,!0)||xe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ke(e,n)}}xe.jsonID("text",ke);class ms{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ms(e.map(this.anchor),e.map(this.head))}resolve(e){return ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class pe extends xe{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?xe.near(o):new pe(o)}content(){return new re(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new da(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(e.resolve(n.anchor))}static create(e,n){return new pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}pe.prototype.visible=!1,xe.jsonID("node",pe);class da{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ms(r,r):new da(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):xe.near(n)}}class $t extends xe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=re.empty){if(n==re.empty){e.delete(0,e.doc.content.size);let r=xe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new $t(e)}map(e){return new $t(e)}eq(e){return e instanceof $t}getBookmark(){return SC}}xe.jsonID("all",$t);const SC={map(){return this},resolve(t){return new $t(t)}};function ii(t,e,n,r,i,o=!1){if(e.inlineContent)return ke.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&&pe.isSelectable(l))return pe.create(t,n-(i<0?l.nodeSize:0))}else{let c=ii(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Th(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;let o=t.mapping.maps[r],s;o.forEach((l,c,d,u)=>{s==null&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const Nh=1,Mh=2,Ah=4;class OC extends EC{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|Nh)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Nh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Mh,this}ensureMarks(e){return $e.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&Mh)>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)||$e.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(xe.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|=Ah,this}get scrolledIntoView(){return(this.updated&Ah)>0}}function Dh(t,e){return!e||!t?t:t.bind(e)}class to{constructor(e,n,r){this.name=e,this.init=Dh(n.init,r),this.apply=Dh(n.apply,r)}}const _C=[new to("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new to("selection",{init(t,e){return t.selection||xe.atStart(e.doc)},apply(t){return t.selection}}),new to("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new to("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ua{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_C.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 to(r.key,r.spec.state,r))})}}class oi{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 oi(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 OC(this)}static create(e){let n=new ua(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new oi(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 ua(this.schema,e.plugins),r=n.fields,i=new oi(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 ua(e.schema,e.plugins),o=new oi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Wn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=xe.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 Lh(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Lh(i,e,{})),n[r]=i}return n}class it{constructor(e){this.spec=e,this.props={},e.props&&Lh(e.props,this,this.props),this.key=e.key?e.key.key:Bh("plugin")}getState(e){return e[this.key]}}const fa=Object.create(null);function Bh(t){return t in fa?t+"$"+ ++fa[t]:(fa[t]=0,t+"$")}class It{constructor(e="key"){this.key=Bh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ot=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},no=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ha=null;const On=function(t,e,n){let r=ha||(ha=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},TC=function(){ha=null},Cr=function(t,e,n,r){return n&&($h(t,e,n,r,-1)||$h(t,e,n,r,1))},NC=/^(img|br|input|textarea|hr)$/i;function $h(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ro(t)||NC.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?jt(t):0}else return!1}}function jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function MC(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=jt(t)}else if(t.parentNode&&!ro(t))e=ot(t),t=t.parentNode;else return null}}function AC(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&&!ro(t))e=ot(t)+1,t=t.parentNode;else return null}}function DC(t,e,n){for(let r=e==0,i=e==jt(t);r||i;){if(t==n)return!0;let o=ot(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==jt(t)}}function ro(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const gs=function(t){return t.focusNode&&Cr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Sr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function LC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function BC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(jt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(jt(r.startContainer),r.startOffset)}}}const cn=typeof navigator<"u"?navigator:null,Ih=typeof document<"u"?document:null,Gn=cn&&cn.userAgent||"",pa=/Edge\/(\d+)/.exec(Gn),Vh=/MSIE \d/.exec(Gn),ma=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gn),_t=!!(Vh||ma||pa),Jn=Vh?document.documentMode:ma?+ma[1]:pa?+pa[1]:0,tn=!_t&&/gecko\/(\d+)/i.test(Gn);tn&&+(/Firefox\/(\d+)/.exec(Gn)||[0,0])[1];const ga=!_t&&/Chrome\/(\d+)/.exec(Gn),ft=!!ga,Ph=ga?+ga[1]:0,bt=!_t&&!!cn&&/Apple Computer/.test(cn.vendor),si=bt&&(/Mobile\/\w+/.test(Gn)||!!cn&&cn.maxTouchPoints>2),Ht=si||(cn?/Mac/.test(cn.platform):!1),$C=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(Gn),io=!!Ih&&"webkitFontSmoothing"in Ih.documentElement.style,IC=io?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function VC(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 Tn(t,e){return typeof t=="number"?t:t[e]}function PC(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 Rh(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=no(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?VC(o):PC(l),u=0,f=0;if(e.top<d.top+Tn(r,"top")?f=-(d.top-e.top+Tn(i,"top")):e.bottom>d.bottom-Tn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Tn(i,"top")-d.top:e.bottom-d.bottom+Tn(i,"bottom")),e.left<d.left+Tn(r,"left")?u=-(d.left-e.left+Tn(i,"left")):e.right>d.right-Tn(r,"right")&&(u=e.right-d.right+Tn(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 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:Fh(t.dom)}}function Fh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=no(r));return e}function FC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;zh(n,r==0?0:r-e)}function zh(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 li=null;function zC(t){if(t.setActive)return t.setActive();if(li)return t.focus(li);let e=Fh(t);t.focus(li==null?{get preventScroll(){return li={preventScroll:!0},!0}}:void 0),li||(li=!1,zh(e,0))}function jh(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=On(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?jC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:jh(n,i)}function jC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=Zn(r,1);if(o.top!=o.bottom&&ya(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function ya(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function HC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function WC(t,e,n){let{node:r,offset:i}=jh(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 UC(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 Hh(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(ya(e,d))return Hh(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function YC(t,e){let n=t.dom.ownerDocument,r,i=0,o=BC(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(!ya(e,d)||(s=Hh(t.dom,e,d),!s))return null}if(bt)for(let d=s;r&&d;d=no(d))d.draggable&&(r=void 0);if(s=HC(s,e),r){if(tn&&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;io&&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=UC(t,r,i,e))}l==null&&(l=WC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Wh(t){return t.top<t.bottom||t.left<t.right}function Zn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Wh(r))return r}return Array.prototype.find.call(n,Wh)||t.getBoundingClientRect()}const qC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Uh(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=io||tn;if(r.nodeType==3)if(s&&(qC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Zn(On(r,i,i),n);if(tn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Zn(On(r,i-1,i-1),-1);if(d.top==c.top){let u=Zn(On(r,i,i+1),-1);if(u.top!=c.top)return oo(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++,oo(Zn(On(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return ba(c.getBoundingClientRect(),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];if(c.nodeType==1)return ba(c.getBoundingClientRect(),!0)}return ba(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?On(c,jt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return oo(Zn(d,1),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?On(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return oo(Zn(d,-1),!0)}return oo(Zn(r.nodeType==3?On(r):r,-n),n>=0)}function oo(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 ba(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 Yh(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 KC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Yh(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=Uh(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=On(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 GC=/[\u0590-\u08ac]/;function JC(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?!GC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:Yh(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 qh=null,Kh=null,Gh=!1;function ZC(t,e,n){return qh==e&&Kh==n?Gh:(qh=e,Kh=n,Gh=n=="up"||n=="down"?KC(t,e,n):JC(t,e,n))}const Wt=0,Jh=1,Or=2,dn=3;class so{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Wt,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>ot(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 Qh){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 Zh&&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?ot(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?ot(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=ot(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=ot(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((tn||bt)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
32
|
+
`),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:ot(y)+1});break}let k=g.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(tn&&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&&bt)&&Cr(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Cr(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?Or:Jh,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=dn:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Or:dn}r=s}this.dirty=Or}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Or:Jh;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Zh extends so{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==Wt&&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 so{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 _r extends so{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=Er.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new _r(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&dn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Wt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Wt}}slice(e,n,r){let i=_r.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=wa(o,n,s,r)),e>0&&(o=wa(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 Xn extends so{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}=Er.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=np(u,r,n),d?c=new QC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new ys(e,n,r,i,u,h,o):new Xn(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=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Wt&&e.eq(this.node)&&bs(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 tS(this,s&&s.node,e);iS(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?$e.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==Or)&&(s&&this.protectLocalComposition(e,s),ep(this.contentDOM,this.children,e),si&&oS(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||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=sS(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=wa(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==dn||!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=Wt}updateOuterDeco(e){if(bs(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=tp(this.dom,this.nodeDOM,ka(this.outerDeco,this.node,n),ka(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 Xh(t,e,n,r,i){np(r,e,t);let o=new Xn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ys extends Xn{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==dn||this.dirty!=Wt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Wt||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=Wt,!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 ys(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=dn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Qh extends so{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Wt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class QC extends Xn{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==dn)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 ep(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=rp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof _r){let c=r?r.previousSibling:t.lastChild;ep(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=rp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const lo=function(t){t&&(this.nodeName=t)};lo.prototype=Object.create(null);const Tr=[new lo];function ka(t,e,n){if(t.length==0)return Tr;let r=n?Tr[0]:new lo,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new lo(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new lo(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 tp(t,e,n,r){if(n==Tr&&r==Tr)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=Tr[0]),i=c}eS(i,l||Tr[0],s)}return i}function eS(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 np(t,e,n){return tp(t,t,Tr,ka(e,n,t.nodeType!=1))}function bs(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 rp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class tS{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=nS(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=Wt,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=_r.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==dn&&s.dom==s.contentDOM&&(s.dirty=Or),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 Xn){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!=dn&&bs(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=Or,f.updateChildren(i,s+1),f.dirty=Wt),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)||!bs(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=Xn.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=Xn.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 Zh(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 _r;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ys)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((bt||ft)&&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 Qh(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 nS(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 _r)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 rS(t,e){return t.type.side-e.type.side}function iS(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(rS);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 k=0;k<l.length;k++)l[k].to<y&&(y=l[k].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 oS(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 sS(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 wa(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 va(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(gs(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&pe.isSelectable(f)&&i.parent&&!(f.isInline&&DC(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(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=Ea(t,u,l,f)}return d}function ip(t){return t.editable?t.hasFocus():up(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Nn(t,e=!1){let n=t.state.selection;if(ap(t,n),!!ip(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ft){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Cr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)aS(t);else{let{anchor:r,head:i}=n,o,s;op&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=sp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=sp(t,n.to))),t.docView.setSelection(r,i,t,e),op&&(o&&lp(o),s&&lp(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&lS(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const op=bt||ft&&Ph<63;function sp(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(bt&&i&&i.contentEditable=="false")return xa(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return xa(i);if(o)return xa(o)}}function xa(t){return t.contentEditable="true",bt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function lp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function lS(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(()=>{(!ip(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function aS(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,ot(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&_t&&Jn<=11&&(r.disabled=!0,r.disabled=!1)}function ap(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(cp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else cp(t)}function cp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ea(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}function dp(t){return t.editable&&!t.hasFocus()?!1:up(t)}function up(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 cS(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Cr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ca(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&&xe.findFrom(o,e)}function Qn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function fp(t,e,n){let r=t.state.selection;if(r instanceof ke)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 Qn(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ca(t.state,e);return i&&i instanceof pe?Qn(t,i):!1}else if(!(Ht&&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?pe.isSelectable(o)?Qn(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):io?Qn(t,new ke(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return Qn(t,new ke(e>0?r.$to:r.$from));{let i=Ca(t.state,e);return i?Qn(t,i):!1}}}function ks(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ao(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ai(t,e){return e<0?dS(t):uS(t)}function dS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(tn&&n.nodeType==1&&r<ks(n)&&ao(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(ao(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(hp(n))break;{let l=n.previousSibling;for(;l&&ao(l,-1);)i=n.parentNode,o=ot(l),l=l.previousSibling;if(l)n=l,r=ks(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Sa(t,n,r):i&&Sa(t,i,o)}function uS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ks(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(ao(l,1))o=n,s=++r;else break}else{if(hp(n))break;{let l=n.nextSibling;for(;l&&ao(l,1);)o=l.parentNode,s=ot(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ks(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Sa(t,o,s)}function hp(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function fS(t,e){for(;t&&e==t.childNodes.length&&!ro(t);)e=ot(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 hS(t,e){for(;t&&!e&&!ro(t);)e=ot(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 Sa(t,e,n){if(e.nodeType!=3){let o,s;(s=fS(e,n))?(e=s,n=0):(o=hS(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(gs(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&&Nn(t)},50)}function pp(t,e){let n=t.state.doc.resolve(e);if(!(ft||$C)&&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 mp(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||Ht&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ca(t.state,e);if(s&&s instanceof pe)return Qn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof $t?xe.near(s,e):xe.findFrom(s,e);return l?Qn(t,l):!1}return!1}function gp(t,e){if(!(t.state.selection instanceof ke))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 yp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function pS(t){if(!bt||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;yp(t,r,"true"),setTimeout(()=>yp(t,r,"false"),20)}return!1}function mS(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function gS(t,e){let n=e.keyCode,r=mS(e);if(n==8||Ht&&n==72&&r=="c")return gp(t,-1)||ai(t,-1);if(n==46&&!e.shiftKey||Ht&&n==68&&r=="c")return gp(t,1)||ai(t,1);if(n==13||n==27)return!0;if(n==37||Ht&&n==66&&r=="c"){let i=n==37?pp(t,t.state.selection.from)=="ltr"?-1:1:-1;return fp(t,i,r)||ai(t,i)}else if(n==39||Ht&&n==70&&r=="c"){let i=n==39?pp(t,t.state.selection.from)=="ltr"?1:-1:1;return fp(t,i,r)||ai(t,i)}else{if(n==38||Ht&&n==80&&r=="c")return mp(t,-1,r)||ai(t,-1);if(n==40||Ht&&n==78&&r=="c")return pS(t)||mp(t,1,r)||ai(t,1);if(r==(Ht?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Oa(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")||Er.fromSchema(t.state.schema),l=Sp(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Ep[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,`
|
|
33
33
|
|
|
34
34
|
`);return{dom:c,text:h,slice:e}}function bp(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 re(J.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
35
|
-
`))),0,0):re.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=Er.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=wS(n),io&&vS(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")||Un.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!yS.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=xS(xp(l,+u[1],+u[2]),u[4]);else if(l=re.maxOpen(bS(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=xp(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const yS=/^(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 bS(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&&wp(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=vp(s[s.length-1],o.length));let u=kp(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return J.from(s)}return t}function kp(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function wp(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=wp(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(J.from(kp(n,t,i+1))))}}function vp(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,vp(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}function Oa(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=Oa(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(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function xp(t,e,n){return e<t.openStart&&(t=new re(Oa(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new re(Oa(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ep={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 Cp=null;function Sp(){return Cp||(Cp=document.implementation.createHTMLDocument("title"))}let Ta=null;function kS(t){let e=window.trustedTypes;return e?(Ta||(Ta=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Ta.createHTML(t)):t}function wS(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Sp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Ep[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=kS(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function vS(t){let e=t.querySelectorAll(ft?"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 xS(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=J.from(c.create(r[l+1],i)),o++,s++}return new re(i,o,s)}const kt={},wt={},ES={touchstart:!0,touchmove:!0};class CS{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 SS(t){for(let e in kt){let n=kt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{OS(t,r)&&!Ma(t,r)&&(t.editable||!(r.type in wt))&&n(t,r)},ES[e]?{passive:!0}:void 0)}bt&&t.dom.addEventListener("input",()=>null),Na(t)}function er(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function _S(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 Na(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ma(t,r))})}function Ma(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function OS(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 TS(t,e){!Ma(t,e)&&kt[e.type]&&(t.editable||!(e.type in wt))&&kt[e.type](t,e)}wt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Op(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(On&&ft&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),si&&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,Sr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||gS(t,n)?n.preventDefault():er(t,"key")},wt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},wt.keypress=(t,e)=>{let n=e;if(Op(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ht&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!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 ws(t){return{left:t.clientX,top:t.clientY}}function NS(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Aa(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 ci(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 MS(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(ci(t,new pe(n)),!0):!1}function AS(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(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(pe.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?(ci(t,pe.create(t.state.doc,i)),!0):!1}function DS(t,e,n,r,i){return Aa(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?AS(t,n):MS(t,n))}function LS(t,e,n,r){return Aa(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function BS(t,e,n,r){return Aa(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||$S(t,n,r)}function $S(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ci(t,ke.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)ci(t,ke.create(r,l+1,l+1+s.content.size));else if(pe.isSelectable(s))ci(t,pe.create(r,l));else continue;return!0}}function Da(t){return vs(t)}const _p=Ht?"metaKey":"ctrlKey";kt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Da(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&NS(n,t.input.lastClick)&&!n[_p]&&(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(ws(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new IS(t,s,n,!!r)):(o=="doubleClick"?LS:BS)(t,s.pos,s.inside,n)?n.preventDefault():er(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[_p],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 pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tn&&!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)),er(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(()=>Nn(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(ws(e))),this.updateAllowDefault(e),this.allowDefault||!n?er(this.view,"pointer"):DS(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||bt&&this.mightDrag&&!this.mightDrag.node.isAtom||ft&&!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)?(ci(this.view,xe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):er(this.view,"pointer")}move(e){this.updateAllowDefault(e),er(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)}}kt.touchstart=t=>{t.input.lastTouch=Date.now(),Da(t),er(t,"pointer")},kt.touchmove=t=>{t.input.lastTouch=Date.now(),er(t,"pointer")},kt.contextmenu=t=>Da(t);function Op(t,e){return t.composing?!0:bt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const VS=On?5e3:-1;wt.compositionstart=wt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),vs(t,!0),t.markCursor=null;else if(vs(t,!e.selection.empty),tn&&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}Tp(t,VS)},wt.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++,Tp(t,20))};function Tp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vs(t),e))}function Np(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=RS());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function PS(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=MC(e.focusNode,e.focusOffset),r=AC(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 vs(t,e=!1){if(!(On&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Np(t),e||t.docView&&t.docView.dirty){let n=va(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 FS(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 co=Ot&&Jn<15||si&&IC<604;kt.copy=wt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=co?null:n.clipboardData,s=r.content(),{dom:l,text:c}=_a(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):FS(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function zS(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function jS(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?uo(t,r.value,null,i,e):uo(t,r.textContent,r.innerHTML,i,e)},50)}function uo(t,e,n,r,i){let o=bp(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||re.empty)))return!0;if(!o)return!1;let s=zS(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 Mp(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," "):""}wt.paste=(t,e)=>{let n=e;if(t.composing&&!On)return;let r=co?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&uo(t,Mp(r),r.getData("text/html"),i,n)?n.preventDefault():jS(t,n)};class Ap{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Dp=Ht?"altKey":"ctrlKey";kt.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(ws(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.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=pe.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=_a(t,l);(!n.dataTransfer.files.length||!ft||Ph>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(co?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",co||n.dataTransfer.setData("text/plain",d),t.dragging=new Ap(u,!n[Dp],s)},kt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},wt.dragover=wt.dragenter=(t,e)=>e.preventDefault(),wt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ws(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=bp(t,Mp(n.dataTransfer),co?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Dp]);if(t.someProp("handleDrop",m=>m(t,n,s||re.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?vh(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&&pe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,k,x)=>m=x),d.setSelection(Ea(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},kt.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())&&Nn(t)},20))},kt.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)},kt.beforeinput=(t,e)=>{if(ft&&On&&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,Sr(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 wt)kt[t]=wt[t];function fo(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 xs{constructor(e,n){this.toDOM=e,this.spec=n||Nr,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 Vt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof xs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&fo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tr{constructor(e,n){this.attrs=e,this.spec=n||Nr}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 Vt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof tr&&fo(this.attrs,e.attrs)&&fo(this.spec,e.spec)}static is(e){return e.type instanceof tr}destroy(){}}class La{constructor(e,n){this.attrs=e,this.spec=n||Nr}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 Vt(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 La&&fo(this.attrs,e.attrs)&&fo(this.spec,e.spec)}destroy(){}}class Vt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Vt(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 Vt(e,e,new xs(n,r))}static inline(e,n,r,i){return new Vt(e,n,new tr(r,i))}static node(e,n,r,i){return new Vt(e,n,new La(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof tr}get widget(){return this.type instanceof xs}}const di=[],Nr={};class Ye{constructor(e,n){this.local=e.length?e:di,this.children=n.length?n:di}static create(e,n){return n.length?Es(n,e,0,Nr):ht}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==ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Nr)}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?HS(this.children,s||[],e,n,r,i,o):s?new Ye(s.sort(Mr),di):ht}add(e,n){return n.length?this==ht?Ye.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=Bp(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,Es(u,l,d+1,Nr)),o+=3}});let s=Lp(o?$p(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ye(s.length?this.local.concat(s).sort(Mr):this.local,i||this.children)}remove(e){return e.length==0||this==ht?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!=ht?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 Ye(i,r):ht}forChild(e,n){if(this==ht)return this;if(n.isLeaf)return Ye.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 tr){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 Ye(i.sort(Mr),di);return r?new nr([l,r]):l}return r||ht}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 Ba(this.localsInner(e))}localsInner(e){if(this==ht)return di;if(e.inlineContent||!this.local.some(tr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof tr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Ba;const ht=Ye.empty;class nr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Nr));return nr.from(r)}forChild(e,n){if(n.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ht&&(o instanceof nr?r=r.concat(o.members):r.push(o))}return nr.from(r)}eq(e){if(!(e instanceof nr)||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?Ba(r?n:n.sort(Mr)):di}static from(e){switch(e.length){case 0:return ht;case 1:return e[0];default:return new nr(e.every(n=>n instanceof Ye)?e:e.reduce((n,r)=>n.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function HS(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 k=0;k<l.length;k+=3){let x=l[k+1];if(x<0||h>x+u-f)continue;let w=l[k]+u-f;p>=w?l[k+1]=h<=w?-2:-1:h>=u&&y&&(l[k]+=y,l[k+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 k=l[d+2].mapInner(n,y,u+1,t[d]+o+1,s);k!=ht?(l[d]=f,l[d+1]=p,l[d+2]=k):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=WS(l,t,e,n,i,o,s),u=Es(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 Ye(e.sort(Mr),l)}function Lp(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 Vt(i.from+e,i.to+e,i.type))}return n}function WS(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 Bp(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 $p(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Es(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=Bp(t,l,c+n);if(d){o=!0;let u=Es(d,l,n+c+1,r);u!=ht&&i.push(c,c+l.nodeSize,u)}});let s=Lp(o?$p(t):t,-n).sort(Mr);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 Ye(s,i):ht}function Mr(t,e){return t.from-e.from||t.to-e.to}function Ba(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),Ip(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),Ip(e,i,r.copy(o.from,r.to)));break}}}return e}function Ip(t,e,n){for(;e<t.length&&Mr(n,t[e])>0;)e++;t.splice(e,0,n)}function $a(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ht&&e.push(r)}),t.cursorWrapper&&e.push(Ye.create(t.state.doc,[t.cursorWrapper.deco])),nr.from(e)}const US={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},YS=Ot&&Jn<=11;class qS{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 KS{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new qS,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]);Ot&&Jn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),YS&&(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,US)),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(dp(this.view)){if(this.suppressingSelectionUpdates)return Nn(this.view);if(Ot&&Jn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Cr(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=no(o))n.add(o);for(let o=e.anchorNode;o;o=no(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)&&dp(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(tn&&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||ZS(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&&gs(r)&&(d=va(e))&&d.eq(xe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Nn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),GS(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Nn(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(Ot&&Jn<=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?ot(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?ot(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 Vp=new WeakMap,Pp=!1;function GS(t){if(!Vp.has(t)&&(Vp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=tn,Pp)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."),Pp=!0}}function Rp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Cr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function JS(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Rp(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?Rp(t,n):null}function ZS(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}],gs(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ft&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let k=r.childNodes[y-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Un.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:QS,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),m={anchor:y+s,head:k+s}}return{doc:g,sel:m,from:s,to:l}}function QS(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(bt&&/^(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||bt&&/^(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 e_=/^(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 t_(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=va(t,A);if(P&&!t.state.selection.eq(P)){if(ft&&On&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,Sr(13,"Enter"))))return;let $=t.state.tr.setSelection(P);A=="pointer"?$.setMeta("pointer",!0):A=="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=i_(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(si&&t.input.lastIOSEnter>Date.now()-225||On)&&i.some(A=>A.nodeType==1&&!e_.test(A.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",A=>A(t,Sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ke&&!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 A=Fp(t,t.state.doc,d.sel);if(A&&!A.eq(t.state.selection)){let P=t.state.tr.setSelection(A);o&&P.setMeta("composition",o),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ke&&(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)),Ot&&Jn<=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),k=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA,w;if((si&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(w=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&w.head==y.pos)&&t.someProp("handleKeyDown",A=>A(t,Sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&r_(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",A=>A(t,Sr(8,"Backspace")))){On&&ft&&t.domObserver.suppressSelectionUpdates();return}ft&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),On&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,Sr(13,"Enter"))})},20));let b=m.start,S=m.endA,v,O,B;if(x){if(g.pos==y.pos)Ot&&Jn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Nn(t),20)),v=t.state.tr.delete(b,S),O=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(B=n_(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))v=t.state.tr,B.type=="add"?v.addMark(b,S,B.mark):v.removeMark(b,S,B.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",P=>P(t,b,S,A)))return;v=t.state.tr.insertText(A,b,S)}}if(v||(v=t.state.tr.replace(b,S,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Fp(t,v.doc,d.sel);A&&!(ft&&t.composing&&A.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==b||A.head==v.mapping.map(S)-1)||Ot&&A.empty&&A.head==b)&&v.setSelection(A)}O&&v.ensureMarks(O),o&&v.setMeta("composition",o),t.dispatch(v.scrollIntoView())}function Fp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ea(t,e.resolve(n.anchor),e.resolve(n.head))}function n_(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(J.from(d).eq(t))return{mark:l,type:s}}function r_(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ia(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(Ia(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Ia(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Ia(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 i_(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&&zp(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&&zp(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function zp(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 o_{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 CS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Yp),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=Wp(this),Hp(this),this.nodeViews=Up(this),this.docView=Xh(this.state.doc,jp(this),$a(this),this.dom,this),this.domObserver=new KS(this,(r,i,o,s)=>t_(this,r,i,o,s)),this.domObserver.start(),SS(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&&Na(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Yp),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&&(Np(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=Up(this);l_(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Na(this),this.editable=Wp(this),Hp(this);let c=$a(this),d=jp(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&&(Ot||ft)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&s_(i.selection,e.selection);if(f){let m=ft?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=PS(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Xh(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&cS(this))?Nn(this,p):(ap(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&&FC(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 pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Rh(this,n.getBoundingClientRect(),e)}else Rh(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 Ap(e.slice,e.move,i<0?void 0:pe.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(Ot){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&&zC(this.dom),Nn(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 YC(this,e)}coordsAtPos(e,n=1){return Uh(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 ZC(this,n||this.state,e)}pasteHTML(e,n){return uo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return uo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return _a(this,e)}destroy(){this.docView&&(_S(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$a(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,TC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return TS(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?bt&&this.root.nodeType===11&&LC(this.dom.ownerDocument)==this.dom&&JS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function jp(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"),[Vt.node(0,t.state.doc.content.size,e)]}function Hp(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:Vt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Wp(t){return!t.someProp("editable",e=>e(t.state)===!1)}function s_(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 Up(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 l_(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 Yp(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 rr={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:"'"},Cs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a_=typeof navigator<"u"&&/Mac/.test(navigator.platform),c_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),st=0;st<10;st++)rr[48+st]=rr[96+st]=String(st);for(var st=1;st<=24;st++)rr[st+111]="F"+st;for(var st=65;st<=90;st++)rr[st]=String.fromCharCode(st+32),Cs[st]=String.fromCharCode(st);for(var Va in rr)Cs.hasOwnProperty(Va)||(Cs[Va]=rr[Va]);function d_(t){var e=a_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||c_&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Cs:rr)[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 u_=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function f_(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))u_?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 h_(t){let e=Object.create(null);for(let n in t)e[f_(n)]=t[n];return e}function Pa(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 p_(t){return new it({props:{handleKeyDown:qp(t)}})}function qp(t){let e=h_(t);return function(n,r){let i=d_(r),o,s=e[Pa(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[Pa(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=rr[r.keyCode])&&o!=i){let l=e[Pa(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Ra=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Kp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Gp=(t,e,n)=>{let r=Kp(t,n);if(!r)return!1;let i=Fa(r);if(!i){let s=r.blockRange(),l=s&&ti(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(im(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ui(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let l=ps(t.doc,r.before(s),r.after(s),re.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(ui(o,"end")?xe.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):pe.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},m_=(t,e,n)=>{let r=Kp(t,n);if(!r)return!1;let i=Fa(r);return i?Jp(t,i,e):!1},g_=(t,e,n)=>{let r=Xp(t,n);if(!r)return!1;let i=za(r);return i?Jp(t,i,e):!1};function Jp(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=ps(t.doc,o,c,re.empty);if(!d||d.from!=o||d instanceof Ze&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ke.create(u.doc,o)),n(u.scrollIntoView())}return!0}function ui(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 Zp=(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=Fa(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Fa(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 Xp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Qp=(t,e,n)=>{let r=Xp(t,n);if(!r)return!1;let i=za(r);if(!i)return!1;let o=i.nodeAfter;if(im(t,i,e,1))return!0;if(r.parent.content.size==0&&(ui(o,"start")||pe.isSelectable(o))){let s=ps(t.doc,r.before(),r.after(),re.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(ui(o,"start")?xe.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):pe.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},em=(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=za(r)}let s=o&&o.nodeAfter;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function za(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 y_=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Kn(t.doc,n.from))return!1;i=n.from}else if(i=hs(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},b_=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Kn(t.doc,n.to))return!1;r=n.to}else if(r=hs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},k_=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&ti(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},tm=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
36
|
-
`).scrollIntoView()),!0)};function ja(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 w_=(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=ja(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(xe.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},nm=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof $t||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ja(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(ke.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},rm=(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(Sn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ti(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function v_(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Sn(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=ja(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 ke||e.selection instanceof $t)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Sn(u.doc,f,o.length,o);if(h||(o[0]=l?{type:l}:null,h=Sn(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 x_=v_(),E_=(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(pe.create(t.doc,i))),!0)};function C_(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||Kn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function im(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&C_(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=J.empty;for(let k=s.length-1;k>=0;k--)m=J.from(s[k].create(null,m));m=J.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new re(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Kn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:xe.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&ti(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&ui(o,"start",!0)&&ui(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 k=J.empty;for(let w=m.length-1;w>=0;w--)k=J.from(m[w].copy(k));let x=t.tr.step(new Xe(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new re(k,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function om(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(ke.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const S_=om(-1),__=om(1);function O_(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&sa(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function sm(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 Ha(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Ha(Ra,Gp,Zp),Ha(Ra,Qp,em),Ha(tm,nm,rm,x_),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function T_(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 N_(l,s,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function N_(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 ss(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ss(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=sa(o,n,r,e);return l?(t&&M_(t,e,l,i,n),!0):!1}function M_(t,e,n,r,i){let o=J.empty;for(let u=n.length-1;u>=0;u--)o=J.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new re(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&&Sn(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function A_(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?D_(e,n,t,o):L_(e,n,o):!0:!1}}function D_(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Xe(o-1,s,o,s,new re(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ss(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=ti(r);if(l==null)return!1;i.lift(r,l);let c=i.mapping.map(o,-1)-1;return Kn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function L_(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?J.empty:J.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Xe(f-(l?1:0),h+(c?1:0),f+1,h-1,new re((l?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function B_(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=J.from(d?t.create():null),f=new re(J.from(t.create(null,J.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Xe(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Ss(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 _s{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),k=p(...g)(y);return l.push(k),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:Ss({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 $_{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 le(t,e,n){return t.config[e]===void 0&&t.parent?le(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?le(t.parent,e,n):null}):t.config[e]}function Os(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 lm(t){const e=[],{nodeExtensions:n,markExtensions:r}=Os(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=le(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=le(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 Qe(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 Fe(...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 Wa(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)=>Fe(n,r),{})}function am(t){return typeof t=="function"}function Ce(t,e=void 0,...n){return am(t)?e?t.bind(e)(...n):t(...n):t}function I_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function V_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function cm(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):V_(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function dm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&I_(n)?!1:n!=null))}function P_(t,e){var n;const r=lm(t),{nodeExtensions:i,markExtensions:o}=Os(t),s=(n=i.find(d=>le(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((k,x)=>{const w=le(x,"extendNodeSchema",f);return{...k,...w?w(d):{}}},{}),p=dm({...h,content:Ce(le(d,"content",f)),marks:Ce(le(d,"marks",f)),group:Ce(le(d,"group",f)),inline:Ce(le(d,"inline",f)),atom:Ce(le(d,"atom",f)),selectable:Ce(le(d,"selectable",f)),draggable:Ce(le(d,"draggable",f)),code:Ce(le(d,"code",f)),whitespace:Ce(le(d,"whitespace",f)),linebreakReplacement:Ce(le(d,"linebreakReplacement",f)),defining:Ce(le(d,"defining",f)),isolating:Ce(le(d,"isolating",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Ce(le(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>cm(k,u)));const g=le(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:Wa(k,u)}));const y=le(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,k)=>{const x=le(k,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=dm({...h,inclusive:Ce(le(d,"inclusive",f)),excludes:Ce(le(d,"excludes",f)),group:Ce(le(d,"group",f)),spanning:Ce(le(d,"spanning",f)),code:Ce(le(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=Ce(le(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>cm(y,u)));const g=le(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Wa(y,u)})),[d.name,p]}));return new th({topNode:s,nodes:l,marks:c})}function Ua(t,e){return e.nodes[t]||e.marks[t]||null}function um(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ya(t,e){const n=Er.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const R_=(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 qa(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}const F_=(t,e)=>{if(qa(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 Ns(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=R_(d)+o;return s.forEach(h=>{if(u)return;const p=F_(f,h.find);if(!p)return;const m=c.state.tr,g=Ss({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:x,can:w}=new _s({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:w})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function z_(t){const{editor:e,rules:n}=t,r=new it({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=Ya(J.from(u),s.schema);const{from:f}=c,h=f+u.length;Ns({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 Ns({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ns({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?Ns({editor:e,from:s.pos,to:s.pos,text:`
|
|
37
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
35
|
+
`))),0,0):re.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=Er.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=wS(n),io&&vS(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")||Un.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!yS.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=xS(xp(l,+u[1],+u[2]),u[4]);else if(l=re.maxOpen(bS(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=xp(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const yS=/^(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 bS(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&&wp(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=vp(s[s.length-1],o.length));let u=kp(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return J.from(s)}return t}function kp(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function wp(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=wp(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(J.from(kp(n,t,i+1))))}}function vp(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,vp(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}function _a(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=_a(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(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function xp(t,e,n){return e<t.openStart&&(t=new re(_a(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new re(_a(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ep={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 Cp=null;function Sp(){return Cp||(Cp=document.implementation.createHTMLDocument("title"))}let Ta=null;function kS(t){let e=window.trustedTypes;return e?(Ta||(Ta=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Ta.createHTML(t)):t}function wS(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Sp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Ep[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=kS(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function vS(t){let e=t.querySelectorAll(ft?"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 xS(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=J.from(c.create(r[l+1],i)),o++,s++}return new re(i,o,s)}const kt={},wt={},ES={touchstart:!0,touchmove:!0};class CS{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 SS(t){for(let e in kt){let n=kt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{_S(t,r)&&!Ma(t,r)&&(t.editable||!(r.type in wt))&&n(t,r)},ES[e]?{passive:!0}:void 0)}bt&&t.dom.addEventListener("input",()=>null),Na(t)}function er(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function OS(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 Na(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ma(t,r))})}function Ma(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function _S(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 TS(t,e){!Ma(t,e)&&kt[e.type]&&(t.editable||!(e.type in wt))&&kt[e.type](t,e)}wt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!_p(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_n&&ft&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),si&&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,Sr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||gS(t,n)?n.preventDefault():er(t,"key")},wt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},wt.keypress=(t,e)=>{let n=e;if(_p(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ht&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!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 ws(t){return{left:t.clientX,top:t.clientY}}function NS(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Aa(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 ci(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 MS(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(ci(t,new pe(n)),!0):!1}function AS(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(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(pe.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?(ci(t,pe.create(t.state.doc,i)),!0):!1}function DS(t,e,n,r,i){return Aa(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?AS(t,n):MS(t,n))}function LS(t,e,n,r){return Aa(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function BS(t,e,n,r){return Aa(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||$S(t,n,r)}function $S(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ci(t,ke.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)ci(t,ke.create(r,l+1,l+1+s.content.size));else if(pe.isSelectable(s))ci(t,pe.create(r,l));else continue;return!0}}function Da(t){return vs(t)}const Op=Ht?"metaKey":"ctrlKey";kt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Da(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&NS(n,t.input.lastClick)&&!n[Op]&&(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(ws(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new IS(t,s,n,!!r)):(o=="doubleClick"?LS:BS)(t,s.pos,s.inside,n)?n.preventDefault():er(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[Op],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 pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tn&&!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)),er(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(()=>Nn(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(ws(e))),this.updateAllowDefault(e),this.allowDefault||!n?er(this.view,"pointer"):DS(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||bt&&this.mightDrag&&!this.mightDrag.node.isAtom||ft&&!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)?(ci(this.view,xe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):er(this.view,"pointer")}move(e){this.updateAllowDefault(e),er(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)}}kt.touchstart=t=>{t.input.lastTouch=Date.now(),Da(t),er(t,"pointer")},kt.touchmove=t=>{t.input.lastTouch=Date.now(),er(t,"pointer")},kt.contextmenu=t=>Da(t);function _p(t,e){return t.composing?!0:bt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const VS=_n?5e3:-1;wt.compositionstart=wt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),vs(t,!0),t.markCursor=null;else if(vs(t,!e.selection.empty),tn&&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}Tp(t,VS)},wt.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++,Tp(t,20))};function Tp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vs(t),e))}function Np(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=RS());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function PS(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=MC(e.focusNode,e.focusOffset),r=AC(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 vs(t,e=!1){if(!(_n&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Np(t),e||t.docView&&t.docView.dirty){let n=va(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 FS(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 co=_t&&Jn<15||si&&IC<604;kt.copy=wt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=co?null:n.clipboardData,s=r.content(),{dom:l,text:c}=Oa(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):FS(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function zS(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function jS(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?uo(t,r.value,null,i,e):uo(t,r.textContent,r.innerHTML,i,e)},50)}function uo(t,e,n,r,i){let o=bp(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||re.empty)))return!0;if(!o)return!1;let s=zS(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 Mp(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," "):""}wt.paste=(t,e)=>{let n=e;if(t.composing&&!_n)return;let r=co?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&uo(t,Mp(r),r.getData("text/html"),i,n)?n.preventDefault():jS(t,n)};class Ap{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Dp=Ht?"altKey":"ctrlKey";kt.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(ws(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.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=pe.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=Oa(t,l);(!n.dataTransfer.files.length||!ft||Ph>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(co?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",co||n.dataTransfer.setData("text/plain",d),t.dragging=new Ap(u,!n[Dp],s)},kt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},wt.dragover=wt.dragenter=(t,e)=>e.preventDefault(),wt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ws(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=bp(t,Mp(n.dataTransfer),co?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Dp]);if(t.someProp("handleDrop",m=>m(t,n,s||re.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?vh(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&&pe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,k,x)=>m=x),d.setSelection(Ea(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},kt.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())&&Nn(t)},20))},kt.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)},kt.beforeinput=(t,e)=>{if(ft&&_n&&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,Sr(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 wt)kt[t]=wt[t];function fo(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 xs{constructor(e,n){this.toDOM=e,this.spec=n||Nr,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 Vt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof xs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&fo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tr{constructor(e,n){this.attrs=e,this.spec=n||Nr}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 Vt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof tr&&fo(this.attrs,e.attrs)&&fo(this.spec,e.spec)}static is(e){return e.type instanceof tr}destroy(){}}class La{constructor(e,n){this.attrs=e,this.spec=n||Nr}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 Vt(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 La&&fo(this.attrs,e.attrs)&&fo(this.spec,e.spec)}destroy(){}}class Vt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Vt(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 Vt(e,e,new xs(n,r))}static inline(e,n,r,i){return new Vt(e,n,new tr(r,i))}static node(e,n,r,i){return new Vt(e,n,new La(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof tr}get widget(){return this.type instanceof xs}}const di=[],Nr={};class Ye{constructor(e,n){this.local=e.length?e:di,this.children=n.length?n:di}static create(e,n){return n.length?Es(n,e,0,Nr):ht}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==ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Nr)}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?HS(this.children,s||[],e,n,r,i,o):s?new Ye(s.sort(Mr),di):ht}add(e,n){return n.length?this==ht?Ye.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=Bp(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,Es(u,l,d+1,Nr)),o+=3}});let s=Lp(o?$p(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ye(s.length?this.local.concat(s).sort(Mr):this.local,i||this.children)}remove(e){return e.length==0||this==ht?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!=ht?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 Ye(i,r):ht}forChild(e,n){if(this==ht)return this;if(n.isLeaf)return Ye.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 tr){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 Ye(i.sort(Mr),di);return r?new nr([l,r]):l}return r||ht}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 Ba(this.localsInner(e))}localsInner(e){if(this==ht)return di;if(e.inlineContent||!this.local.some(tr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof tr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Ba;const ht=Ye.empty;class nr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Nr));return nr.from(r)}forChild(e,n){if(n.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ht&&(o instanceof nr?r=r.concat(o.members):r.push(o))}return nr.from(r)}eq(e){if(!(e instanceof nr)||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?Ba(r?n:n.sort(Mr)):di}static from(e){switch(e.length){case 0:return ht;case 1:return e[0];default:return new nr(e.every(n=>n instanceof Ye)?e:e.reduce((n,r)=>n.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function HS(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 k=0;k<l.length;k+=3){let x=l[k+1];if(x<0||h>x+u-f)continue;let w=l[k]+u-f;p>=w?l[k+1]=h<=w?-2:-1:h>=u&&y&&(l[k]+=y,l[k+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 k=l[d+2].mapInner(n,y,u+1,t[d]+o+1,s);k!=ht?(l[d]=f,l[d+1]=p,l[d+2]=k):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=WS(l,t,e,n,i,o,s),u=Es(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 Ye(e.sort(Mr),l)}function Lp(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 Vt(i.from+e,i.to+e,i.type))}return n}function WS(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 Bp(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 $p(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Es(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=Bp(t,l,c+n);if(d){o=!0;let u=Es(d,l,n+c+1,r);u!=ht&&i.push(c,c+l.nodeSize,u)}});let s=Lp(o?$p(t):t,-n).sort(Mr);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 Ye(s,i):ht}function Mr(t,e){return t.from-e.from||t.to-e.to}function Ba(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),Ip(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),Ip(e,i,r.copy(o.from,r.to)));break}}}return e}function Ip(t,e,n){for(;e<t.length&&Mr(n,t[e])>0;)e++;t.splice(e,0,n)}function $a(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ht&&e.push(r)}),t.cursorWrapper&&e.push(Ye.create(t.state.doc,[t.cursorWrapper.deco])),nr.from(e)}const US={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},YS=_t&&Jn<=11;class qS{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 KS{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new qS,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]);_t&&Jn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),YS&&(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,US)),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(dp(this.view)){if(this.suppressingSelectionUpdates)return Nn(this.view);if(_t&&Jn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Cr(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=no(o))n.add(o);for(let o=e.anchorNode;o;o=no(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)&&dp(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(tn&&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||ZS(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&&gs(r)&&(d=va(e))&&d.eq(xe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Nn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),GS(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Nn(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(_t&&Jn<=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?ot(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?ot(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 Vp=new WeakMap,Pp=!1;function GS(t){if(!Vp.has(t)&&(Vp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=tn,Pp)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."),Pp=!0}}function Rp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Cr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function JS(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Rp(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?Rp(t,n):null}function ZS(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}],gs(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ft&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let k=r.childNodes[y-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Un.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:QS,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),m={anchor:y+s,head:k+s}}return{doc:g,sel:m,from:s,to:l}}function QS(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(bt&&/^(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||bt&&/^(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 eO=/^(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 tO(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=va(t,A);if(P&&!t.state.selection.eq(P)){if(ft&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,Sr(13,"Enter"))))return;let $=t.state.tr.setSelection(P);A=="pointer"?$.setMeta("pointer",!0):A=="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=iO(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(si&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(A=>A.nodeType==1&&!eO.test(A.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",A=>A(t,Sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ke&&!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 A=Fp(t,t.state.doc,d.sel);if(A&&!A.eq(t.state.selection)){let P=t.state.tr.setSelection(A);o&&P.setMeta("composition",o),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ke&&(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)),_t&&Jn<=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),k=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA,w;if((si&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(w=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&w.head==y.pos)&&t.someProp("handleKeyDown",A=>A(t,Sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&rO(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",A=>A(t,Sr(8,"Backspace")))){_n&&ft&&t.domObserver.suppressSelectionUpdates();return}ft&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),_n&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,Sr(13,"Enter"))})},20));let b=m.start,S=m.endA,v,_,B;if(x){if(g.pos==y.pos)_t&&Jn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Nn(t),20)),v=t.state.tr.delete(b,S),_=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(B=nO(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))v=t.state.tr,B.type=="add"?v.addMark(b,S,B.mark):v.removeMark(b,S,B.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",P=>P(t,b,S,A)))return;v=t.state.tr.insertText(A,b,S)}}if(v||(v=t.state.tr.replace(b,S,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Fp(t,v.doc,d.sel);A&&!(ft&&t.composing&&A.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==b||A.head==v.mapping.map(S)-1)||_t&&A.empty&&A.head==b)&&v.setSelection(A)}_&&v.ensureMarks(_),o&&v.setMeta("composition",o),t.dispatch(v.scrollIntoView())}function Fp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ea(t,e.resolve(n.anchor),e.resolve(n.head))}function nO(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(J.from(d).eq(t))return{mark:l,type:s}}function rO(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ia(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(Ia(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Ia(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Ia(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 iO(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&&zp(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&&zp(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function zp(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 oO{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 CS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Yp),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=Wp(this),Hp(this),this.nodeViews=Up(this),this.docView=Xh(this.state.doc,jp(this),$a(this),this.dom,this),this.domObserver=new KS(this,(r,i,o,s)=>tO(this,r,i,o,s)),this.domObserver.start(),SS(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&&Na(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Yp),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&&(Np(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=Up(this);lO(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Na(this),this.editable=Wp(this),Hp(this);let c=$a(this),d=jp(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&&(_t||ft)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&sO(i.selection,e.selection);if(f){let m=ft?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=PS(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Xh(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&cS(this))?Nn(this,p):(ap(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&&FC(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 pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Rh(this,n.getBoundingClientRect(),e)}else Rh(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 Ap(e.slice,e.move,i<0?void 0:pe.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(_t){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&&zC(this.dom),Nn(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 YC(this,e)}coordsAtPos(e,n=1){return Uh(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 ZC(this,n||this.state,e)}pasteHTML(e,n){return uo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return uo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Oa(this,e)}destroy(){this.docView&&(OS(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$a(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,TC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return TS(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?bt&&this.root.nodeType===11&&LC(this.dom.ownerDocument)==this.dom&&JS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function jp(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"),[Vt.node(0,t.state.doc.content.size,e)]}function Hp(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:Vt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Wp(t){return!t.someProp("editable",e=>e(t.state)===!1)}function sO(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 Up(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 lO(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 Yp(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 rr={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:"'"},Cs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aO=typeof navigator<"u"&&/Mac/.test(navigator.platform),cO=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),st=0;st<10;st++)rr[48+st]=rr[96+st]=String(st);for(var st=1;st<=24;st++)rr[st+111]="F"+st;for(var st=65;st<=90;st++)rr[st]=String.fromCharCode(st+32),Cs[st]=String.fromCharCode(st);for(var Va in rr)Cs.hasOwnProperty(Va)||(Cs[Va]=rr[Va]);function dO(t){var e=aO&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||cO&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Cs:rr)[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 uO=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function fO(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))uO?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 hO(t){let e=Object.create(null);for(let n in t)e[fO(n)]=t[n];return e}function Pa(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 pO(t){return new it({props:{handleKeyDown:qp(t)}})}function qp(t){let e=hO(t);return function(n,r){let i=dO(r),o,s=e[Pa(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[Pa(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=rr[r.keyCode])&&o!=i){let l=e[Pa(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Ra=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Kp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Gp=(t,e,n)=>{let r=Kp(t,n);if(!r)return!1;let i=Fa(r);if(!i){let s=r.blockRange(),l=s&&ti(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(im(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ui(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let l=ps(t.doc,r.before(s),r.after(s),re.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(ui(o,"end")?xe.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):pe.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},mO=(t,e,n)=>{let r=Kp(t,n);if(!r)return!1;let i=Fa(r);return i?Jp(t,i,e):!1},gO=(t,e,n)=>{let r=Xp(t,n);if(!r)return!1;let i=za(r);return i?Jp(t,i,e):!1};function Jp(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=ps(t.doc,o,c,re.empty);if(!d||d.from!=o||d instanceof Ze&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ke.create(u.doc,o)),n(u.scrollIntoView())}return!0}function ui(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 Zp=(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=Fa(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Fa(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 Xp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Qp=(t,e,n)=>{let r=Xp(t,n);if(!r)return!1;let i=za(r);if(!i)return!1;let o=i.nodeAfter;if(im(t,i,e,1))return!0;if(r.parent.content.size==0&&(ui(o,"start")||pe.isSelectable(o))){let s=ps(t.doc,r.before(),r.after(),re.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(ui(o,"start")?xe.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):pe.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},em=(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=za(r)}let s=o&&o.nodeAfter;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function za(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 yO=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Kn(t.doc,n.from))return!1;i=n.from}else if(i=hs(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},bO=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Kn(t.doc,n.to))return!1;r=n.to}else if(r=hs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},kO=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&ti(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},tm=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
36
|
+
`).scrollIntoView()),!0)};function ja(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 wO=(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=ja(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(xe.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},nm=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof $t||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ja(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(ke.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},rm=(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(Sn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ti(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function vO(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Sn(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=ja(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 ke||e.selection instanceof $t)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Sn(u.doc,f,o.length,o);if(h||(o[0]=l?{type:l}:null,h=Sn(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 xO=vO(),EO=(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(pe.create(t.doc,i))),!0)};function CO(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||Kn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function im(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&CO(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=J.empty;for(let k=s.length-1;k>=0;k--)m=J.from(s[k].create(null,m));m=J.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new re(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Kn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:xe.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&ti(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&ui(o,"start",!0)&&ui(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 k=J.empty;for(let w=m.length-1;w>=0;w--)k=J.from(m[w].copy(k));let x=t.tr.step(new Xe(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new re(k,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function om(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(ke.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const SO=om(-1),OO=om(1);function _O(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&sa(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function sm(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 Ha(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Ha(Ra,Gp,Zp),Ha(Ra,Qp,em),Ha(tm,nm,rm,xO),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function TO(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 NO(l,s,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function NO(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 ss(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ss(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=sa(o,n,r,e);return l?(t&&MO(t,e,l,i,n),!0):!1}function MO(t,e,n,r,i){let o=J.empty;for(let u=n.length-1;u>=0;u--)o=J.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new re(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&&Sn(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function AO(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?DO(e,n,t,o):LO(e,n,o):!0:!1}}function DO(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Xe(o-1,s,o,s,new re(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ss(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=ti(r);if(l==null)return!1;i.lift(r,l);let c=i.mapping.map(o,-1)-1;return Kn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function LO(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?J.empty:J.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Xe(f-(l?1:0),h+(c?1:0),f+1,h-1,new re((l?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function BO(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=J.from(d?t.create():null),f=new re(J.from(t.create(null,J.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Xe(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Ss(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 Os{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),k=p(...g)(y);return l.push(k),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:Ss({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 $O{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 le(t,e,n){return t.config[e]===void 0&&t.parent?le(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?le(t.parent,e,n):null}):t.config[e]}function _s(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function lm(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=le(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=le(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 Qe(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 Fe(...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 Wa(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)=>Fe(n,r),{})}function am(t){return typeof t=="function"}function Ce(t,e=void 0,...n){return am(t)?e?t.bind(e)(...n):t(...n):t}function IO(t={}){return Object.keys(t).length===0&&t.constructor===Object}function VO(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function cm(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):VO(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function dm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&IO(n)?!1:n!=null))}function PO(t,e){var n;const r=lm(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>le(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((k,x)=>{const w=le(x,"extendNodeSchema",f);return{...k,...w?w(d):{}}},{}),p=dm({...h,content:Ce(le(d,"content",f)),marks:Ce(le(d,"marks",f)),group:Ce(le(d,"group",f)),inline:Ce(le(d,"inline",f)),atom:Ce(le(d,"atom",f)),selectable:Ce(le(d,"selectable",f)),draggable:Ce(le(d,"draggable",f)),code:Ce(le(d,"code",f)),whitespace:Ce(le(d,"whitespace",f)),linebreakReplacement:Ce(le(d,"linebreakReplacement",f)),defining:Ce(le(d,"defining",f)),isolating:Ce(le(d,"isolating",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Ce(le(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>cm(k,u)));const g=le(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:Wa(k,u)}));const y=le(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,k)=>{const x=le(k,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=dm({...h,inclusive:Ce(le(d,"inclusive",f)),excludes:Ce(le(d,"excludes",f)),group:Ce(le(d,"group",f)),spanning:Ce(le(d,"spanning",f)),code:Ce(le(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=Ce(le(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>cm(y,u)));const g=le(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Wa(y,u)})),[d.name,p]}));return new th({topNode:s,nodes:l,marks:c})}function Ua(t,e){return e.nodes[t]||e.marks[t]||null}function um(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ya(t,e){const n=Er.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const RO=(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 qa(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}const FO=(t,e)=>{if(qa(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 Ns(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=RO(d)+o;return s.forEach(h=>{if(u)return;const p=FO(f,h.find);if(!p)return;const m=c.state.tr,g=Ss({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:x,can:w}=new Os({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:w})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function zO(t){const{editor:e,rules:n}=t,r=new it({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=Ya(J.from(u),s.schema);const{from:f}=c,h=f+u.length;Ns({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 Ns({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ns({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?Ns({editor:e,from:s.pos,to:s.pos,text:`
|
|
37
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function jO(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ms(t){return jO(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function As(t,e){const n={...t};return Ms(t)&&Ms(e)&&Object.keys(e).forEach(r=>{Ms(e[r])&&Ms(t[r])?n[r]=As(t[r],e[r]):n[r]=e[r]}),n}class Ut{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=Ce(le(this,"addOptions",{name:this.name}))),this.storage=Ce(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ut(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>As(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ut(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=Ce(le(n,"addOptions",{name:n.name})),n.storage=Ce(le(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 HO(t){return typeof t=="number"}class WO{constructor(e){this.find=e.find,this.handler=e.handler}}const UO=(t,e,n)=>{if(qa(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 YO(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:c,chain:d,can:u}=new Os({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),k=p.textBetween(g-m,y-m,void 0,"");UO(k,o.find,s).forEach(w=>{if(w.index===void 0)return;const b=g+w.index+1,S=b+w[0].length,v={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},_=o.handler({state:n,range:v,match:w,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(_)})}),f.every(p=>p!==null)}let Ds=null;const qO=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 KO(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=Ss({state:u,transaction:g});if(!(!YO({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 it({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&&(Ds=e)},p=()=>{Ds&&(Ds=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=Ds;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,k=m.getMeta("applyPasteRules"),x=!!k;if(!g&&!y&&!x)return;if(x){let{text:S}=k;typeof S=="string"?S=S:S=Ya(J.from(S),p.schema);const{from:v}=k,_=v+S.length,B=qO(S);return c({rule:u,state:p,from:v,to:{b:_},pasteEvt:B})}const w=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!HO(w)||!b||w===b.b))return c({rule:u,state:p,from:w,to:b,pasteEvt:s})}}))}function GO(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class fi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=fi.resolve(e),this.schema=PO(this.extensions,n),this.setupExtensions()}static resolve(e){const n=fi.sort(fi.flatten(e)),r=GO(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=le(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=le(r,"priority")||100,s=le(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:Ua(n.name,this.schema)},i=le(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=fi.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:Ua(s.name,this.schema)},c=[],d=le(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&le(s,"exitable",l)&&(u.ArrowRight=()=>Ut.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,k])=>[y,()=>k({editor:e})]));u={...u,...g}}const f=pO(u);c.push(f);const h=le(s,"addInputRules",l);um(s,e.options.enableInputRules)&&h&&r.push(...h());const p=le(s,"addPasteRules",l);um(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=le(s,"addProseMirrorPlugins",l);if(m){const g=m();c.push(...g)}return c}).flat();return[zO({editor:e,rules:r}),...KO({editor:e,rules:i}),...o]}get attributes(){return lm(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_s(this.extensions);return Object.fromEntries(n.filter(r=>!!le(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:Qe(r.name,this.schema)},s=le(r,"addNodeView",o);if(!s)return[];const l=(c,d,u,f,h)=>{const p=Wa(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:Ua(e.name,this.schema)};e.type==="mark"&&(!((n=Ce(le(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=le(e,"onBeforeCreate",r),o=le(e,"onCreate",r),s=le(e,"onUpdate",r),l=le(e,"onSelectionUpdate",r),c=le(e,"onTransaction",r),d=le(e,"onFocus",r),u=le(e,"onBlur",r),f=le(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 qe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ce(le(this,"addOptions",{name:this.name}))),this.storage=Ce(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>As(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new qe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&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=Ce(le(n,"addOptions",{name:n.name})),n.storage=Ce(le(n,"addStorage",{name:n.name,options:n.options})),n}}function fm(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
38
38
|
|
|
39
|
-
`,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 hm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const J_=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new it({key:new It("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=hm(n);return fm(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Z_=()=>({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),X_=(t=!1)=>({commands:e})=>e.setContent("",t),Q_=()=>({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=ti(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},eO=t=>e=>t(e),tO=()=>({state:t,dispatch:e})=>nm(t,e),nO=(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 ke(r.doc.resolve(s-1))),!0},rO=()=>({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},iO=t=>({tr:e,state:n,dispatch:r})=>{const i=Qe(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},oO=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},sO=()=>({state:t,dispatch:e})=>Ra(t,e),lO=()=>({commands:t})=>t.keyboardShortcut("Enter"),aO=()=>({state:t,dispatch:e})=>w_(t,e);function Ls(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:qa(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function pm(t,e,n={}){return t.find(r=>r.type===e&&Ls(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function mm(t,e,n={}){return!!pm(t,e,n)}function Ka(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),!pm([...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&&mm([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&mm([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function ir(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 cO=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=ir(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=Ka(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ke.create(s,f.from,f.to);n.setSelection(h)}}return!0},dO=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 Ga(t){return t instanceof ke}function Mn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function gm(t,e=null){if(!e)return null;const n=xe.atStart(t),r=xe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ke.create(t,Mn(0,i,o),Mn(t.content.size,i,o)):ke.create(t,Mn(e,i,o),Mn(e,i,o))}function uO(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const fO=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ja()||uO())&&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&&!Ga(n.state.selection))return s(),!0;const l=gm(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},hO=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),pO=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ym=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&&ym(r)}return t};function Bs(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return ym(n)}function $s(t,e,n){if(t instanceof Wn||t instanceof J)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 J.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),$s("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new th({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?Un.fromSchema(c).parseSlice(Bs(t),n.parseOptions):Un.fromSchema(c).parse(Bs(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=Un.fromSchema(e);return n.slice?o.parseSlice(Bs(t),n.parseOptions).content:o.parse(Bs(t),n.parseOptions)}return $s("",e,n)}function mO(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const gO=t=>!("type"in t),yO=(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=$s(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((gO(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 J){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&&mO(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},bO=()=>({state:t,dispatch:e})=>y_(t,e),kO=()=>({state:t,dispatch:e})=>b_(t,e),wO=()=>({state:t,dispatch:e})=>Gp(t,e),vO=()=>({state:t,dispatch:e})=>Qp(t,e),xO=()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},EO=()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},CO=()=>({state:t,dispatch:e})=>m_(t,e),SO=()=>({state:t,dispatch:e})=>g_(t,e);function bm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function _O(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))Ja()||bm()?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 OO=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=_O(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 ho(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Qe(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=>Ls(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const TO=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ho(n,i,e)?k_(n,r):!1},NO=()=>({state:t,dispatch:e})=>rm(t,e),MO=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return A_(r)(e,n)},AO=()=>({state:t,dispatch:e})=>tm(t,e);function Is(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function km(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 DO=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Is(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Qe(t,r.schema)),l==="mark"&&(s=ir(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,km(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(km(f.attrs,e)))})})}),!0):!1},LO=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),BO=()=>({tr:t,dispatch:e})=>{if(e){const n=new $t(t.doc);t.setSelection(n)}return!0},$O=()=>({state:t,dispatch:e})=>Zp(t,e),IO=()=>({state:t,dispatch:e})=>em(t,e),VO=()=>({state:t,dispatch:e})=>E_(t,e),PO=()=>({state:t,dispatch:e})=>__(t,e),RO=()=>({state:t,dispatch:e})=>S_(t,e);function Za(t,e,n={},r={}){return $s(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const FO=(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=Za(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 Vs(t,e){const n=ir(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 zO(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 jO(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 Xa(t){return e=>jO(e.$from,t)}function HO(t,e){const n={from:0,to:t.content.size};return fm(t,n,e)}function WO(t,e){const n=Qe(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 UO(t,e){const n=Is(typeof e=="string"?e:e.name,t.schema);return n==="node"?WO(t,e):n==="mark"?Vs(t,e):{}}function wm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Ka(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 Ps(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 Qa(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?ir(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ls(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 k=Math.max(p,y),x=Math.min(m,y+g.nodeSize),w=x-k;s+=w,l.push(...g.marks.map(b=>({mark:b,from:k,to:x})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ls(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 YO(t,e,n={}){if(!e)return ho(t,null,n)||Qa(t,null,n);const r=Is(e,t.schema);return r==="node"?ho(t,e,n):r==="mark"?Qa(t,e,n):!1}function vm(t,e){const{nodeExtensions:n}=Os(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ce(le(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ec(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&&(ec(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function qO(t){return t instanceof pe}function xm(t,e,n){const i=t.state.doc.content.size,o=Mn(e,0,i),s=Mn(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,k={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...k,toJSON:()=>k}}function KO(t,e,n){var r;const{selection:i}=e;let o=null;if(Ga(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 GO=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=ir(t,r.schema);if(i)if(s){const d=Vs(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(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&n.addMark(m,g,c.create({...k.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return KO(r,n,c)},JO=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ZO=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Qe(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})=>sm(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>sm(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},XO=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Mn(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},QO=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ke.atStart(r).from,l=ke.atEnd(r).to,c=Mn(i,s,l),d=Mn(o,s,l),u=ke.create(r,c,d);e.setSelection(u)}return!0},eT=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return B_(r)(e,n)};function Em(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 tT=({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=Ps(d,l.node().type.name,l.node().attrs);if(o instanceof pe&&o.node.isBlock)return!l.parentOffset||!Sn(s,l.pos)?!1:(r&&(t&&Em(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:zO(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Sn(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&Sn(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 ke&&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&&Em(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},nT=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Qe(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 k=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-x;B>=c.depth-3;B-=1)k=J.from(c.node(B).copy(k));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Ps(h,c.node().type.name,c.node().attrs),...e},S=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;k=k.append(J.from(l.createAndFill(null,S)||void 0));const v=c.before(c.depth-(x-1));n.replace(v,c.after(-w),new re(k,4-x,0));let O=-1;n.doc.nodesBetween(v,n.doc.content.size,(B,A)=>{if(O>-1)return!1;B.isTextblock&&B.content.size===0&&(O=A+1)}),O>-1&&n.setSelection(ke.near(n.doc.resolve(O))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Ps(h,f.type.name,f.attrs),...e},g={...Ps(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(!Sn(n.doc,c.pos,2))return!1;if(i){const{selection:k,storedMarks:x}=r,{splittableMarks:w}=o.extensionManager,b=x||k.$to.parentOffset&&k.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!b||!i)return!0;const S=b.filter(v=>w.includes(v.type.name));n.ensureMarks(S)}return!0},tc=(t,e)=>{const n=Xa(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)&&Kn(t.doc,n.pos)&&t.join(n.pos),!0},nc=(t,e)=>{const n=Xa(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)&&Kn(t.doc,r)&&t.join(r),!0};var rT=Object.freeze({__proto__:null,blur:Z_,clearContent:X_,clearNodes:Q_,command:eO,createParagraphNear:tO,cut:nO,deleteCurrentNode:rO,deleteNode:iO,deleteRange:oO,deleteSelection:sO,enter:lO,exitCode:aO,extendMarkRange:cO,first:dO,focus:fO,forEach:hO,insertContent:pO,insertContentAt:yO,joinBackward:wO,joinDown:kO,joinForward:vO,joinItemBackward:xO,joinItemForward:EO,joinTextblockBackward:CO,joinTextblockForward:SO,joinUp:bO,keyboardShortcut:OO,lift:TO,liftEmptyBlock:NO,liftListItem:MO,newlineInCode:AO,resetAttributes:DO,scrollIntoView:LO,selectAll:BO,selectNodeBackward:$O,selectNodeForward:IO,selectParentNode:VO,selectTextblockEnd:PO,selectTextblockStart:RO,setContent:FO,setMark:GO,setMeta:JO,setNode:ZO,setNodeSelection:XO,setTextSelection:QO,sinkListItem:eT,splitBlock:tT,splitListItem:nT,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=Qe(t,s.schema),m=Qe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:k,$to:x}=g,w=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=Xa(v=>vm(v.type.name,f))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===p)return d.liftListItem(m);if(vm(S.node.type.name,f)&&p.validContent(S.node.content)&&l)return c().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>tc(o,p)).command(()=>nc(o,p)).run()}return!n||!b||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>tc(o,p)).command(()=>nc(o,p)).run():c().command(()=>{const v=u().wrapInList(p,r),O=b.filter(B=>h.includes(B.type.name));return o.ensureMarks(O),v?!0:d.clearNodes()}).wrapInList(p,r).command(()=>tc(o,p)).command(()=>nc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=ir(t,r.schema);return Qa(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Qe(t,r.schema),s=Qe(e,r.schema),l=ho(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=Qe(t,n.schema);return ho(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=ir(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=Ka(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=Is(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Qe(t,r.schema)),l==="mark"&&(s=ir(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(k=>{if(s===k.type){const x=Math.max(y,d),w=Math.min(y+g.nodeSize,u);n.addMark(x,w,s.create({...k.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=Qe(t,n.schema);return O_(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return T_(i,e)(n,r)}});const iT=qe.create({name:"commands",addCommands(){return{...rT}}}),oT=qe.create({name:"drop",addProseMirrorPlugins(){return[new it({key:new It("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),sT=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new It("editable"),props:{editable:()=>this.editor.options.editable}})]}}),lT=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new it({key:new It("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}}}})]}}),aT=qe.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,k=g&&m.parent.childCount===1?y===f.pos:xe.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&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 Ja()||bm()?o:i},addProseMirrorPlugins(){return[new it({key:new It("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=xe.atStart(e.doc).from,d=xe.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!ec(n.doc))return;const h=n.tr,p=Ss({state:n,transaction:h}),{commands:m}=new _s({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),cT=qe.create({name:"paste",addProseMirrorPlugins(){return[new it({key:new It("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),dT=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new it({key:new It("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ar{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 Ar(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 Ar(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 Ar(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 Ar(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Ar(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 uT=`.ProseMirror {
|
|
39
|
+
`,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 hm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const JO=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new it({key:new It("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=hm(n);return fm(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),ZO=()=>({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),XO=(t=!1)=>({commands:e})=>e.setContent("",t),QO=()=>({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=ti(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},e_=t=>e=>t(e),t_=()=>({state:t,dispatch:e})=>nm(t,e),n_=(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 ke(r.doc.resolve(s-1))),!0},r_=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),c=i.after(o);t.delete(l,c).scrollIntoView()}return!0}return!1},i_=t=>({tr:e,state:n,dispatch:r})=>{const i=Qe(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},o_=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},s_=()=>({state:t,dispatch:e})=>Ra(t,e),l_=()=>({commands:t})=>t.keyboardShortcut("Enter"),a_=()=>({state:t,dispatch:e})=>wO(t,e);function Ls(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:qa(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function pm(t,e,n={}){return t.find(r=>r.type===e&&Ls(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function mm(t,e,n={}){return!!pm(t,e,n)}function Ka(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),!pm([...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&&mm([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&mm([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function ir(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 c_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=ir(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=Ka(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ke.create(s,f.from,f.to);n.setSelection(h)}}return!0},d_=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 Ga(t){return t instanceof ke}function Mn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function gm(t,e=null){if(!e)return null;const n=xe.atStart(t),r=xe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ke.create(t,Mn(0,i,o),Mn(t.content.size,i,o)):ke.create(t,Mn(e,i,o),Mn(e,i,o))}function u_(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const f_=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ja()||u_())&&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&&!Ga(n.state.selection))return s(),!0;const l=gm(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},h_=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),p_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ym=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&&ym(r)}return t};function Bs(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return ym(n)}function $s(t,e,n){if(t instanceof Wn||t instanceof J)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 J.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),$s("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new th({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?Un.fromSchema(c).parseSlice(Bs(t),n.parseOptions):Un.fromSchema(c).parse(Bs(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=Un.fromSchema(e);return n.slice?o.parseSlice(Bs(t),n.parseOptions).content:o.parse(Bs(t),n.parseOptions)}return $s("",e,n)}function m_(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const g_=t=>!("type"in t),y_=(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=$s(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((g_(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 J){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&&m_(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},b_=()=>({state:t,dispatch:e})=>yO(t,e),k_=()=>({state:t,dispatch:e})=>bO(t,e),w_=()=>({state:t,dispatch:e})=>Gp(t,e),v_=()=>({state:t,dispatch:e})=>Qp(t,e),x_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},E_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},C_=()=>({state:t,dispatch:e})=>mO(t,e),S_=()=>({state:t,dispatch:e})=>gO(t,e);function bm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function O_(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))Ja()||bm()?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 __=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=O_(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 ho(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Qe(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=>Ls(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const T_=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ho(n,i,e)?kO(n,r):!1},N_=()=>({state:t,dispatch:e})=>rm(t,e),M_=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return AO(r)(e,n)},A_=()=>({state:t,dispatch:e})=>tm(t,e);function Is(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function km(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 D_=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Is(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Qe(t,r.schema)),l==="mark"&&(s=ir(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,km(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(km(f.attrs,e)))})})}),!0):!1},L_=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),B_=()=>({tr:t,dispatch:e})=>{if(e){const n=new $t(t.doc);t.setSelection(n)}return!0},$_=()=>({state:t,dispatch:e})=>Zp(t,e),I_=()=>({state:t,dispatch:e})=>em(t,e),V_=()=>({state:t,dispatch:e})=>EO(t,e),P_=()=>({state:t,dispatch:e})=>OO(t,e),R_=()=>({state:t,dispatch:e})=>SO(t,e);function Za(t,e,n={},r={}){return $s(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const F_=(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=Za(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 Vs(t,e){const n=ir(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 z_(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 j_(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 Xa(t){return e=>j_(e.$from,t)}function H_(t,e){const n={from:0,to:t.content.size};return fm(t,n,e)}function W_(t,e){const n=Qe(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 U_(t,e){const n=Is(typeof e=="string"?e:e.name,t.schema);return n==="node"?W_(t,e):n==="mark"?Vs(t,e):{}}function wm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Ka(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 Ps(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 Qa(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?ir(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ls(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 k=Math.max(p,y),x=Math.min(m,y+g.nodeSize),w=x-k;s+=w,l.push(...g.marks.map(b=>({mark:b,from:k,to:x})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ls(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 Y_(t,e,n={}){if(!e)return ho(t,null,n)||Qa(t,null,n);const r=Is(e,t.schema);return r==="node"?ho(t,e,n):r==="mark"?Qa(t,e,n):!1}function vm(t,e){const{nodeExtensions:n}=_s(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ce(le(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ec(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&&(ec(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function q_(t){return t instanceof pe}function xm(t,e,n){const i=t.state.doc.content.size,o=Mn(e,0,i),s=Mn(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,k={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...k,toJSON:()=>k}}function K_(t,e,n){var r;const{selection:i}=e;let o=null;if(Ga(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 G_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=ir(t,r.schema);if(i)if(s){const d=Vs(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(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&n.addMark(m,g,c.create({...k.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return K_(r,n,c)},J_=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Z_=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Qe(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})=>sm(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>sm(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},X_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Mn(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},Q_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ke.atStart(r).from,l=ke.atEnd(r).to,c=Mn(i,s,l),d=Mn(o,s,l),u=ke.create(r,c,d);e.setSelection(u)}return!0},e5=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return BO(r)(e,n)};function Em(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 t5=({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=Ps(d,l.node().type.name,l.node().attrs);if(o instanceof pe&&o.node.isBlock)return!l.parentOffset||!Sn(s,l.pos)?!1:(r&&(t&&Em(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:z_(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Sn(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&Sn(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 ke&&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&&Em(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},n5=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Qe(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 k=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-x;B>=c.depth-3;B-=1)k=J.from(c.node(B).copy(k));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Ps(h,c.node().type.name,c.node().attrs),...e},S=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;k=k.append(J.from(l.createAndFill(null,S)||void 0));const v=c.before(c.depth-(x-1));n.replace(v,c.after(-w),new re(k,4-x,0));let _=-1;n.doc.nodesBetween(v,n.doc.content.size,(B,A)=>{if(_>-1)return!1;B.isTextblock&&B.content.size===0&&(_=A+1)}),_>-1&&n.setSelection(ke.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Ps(h,f.type.name,f.attrs),...e},g={...Ps(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(!Sn(n.doc,c.pos,2))return!1;if(i){const{selection:k,storedMarks:x}=r,{splittableMarks:w}=o.extensionManager,b=x||k.$to.parentOffset&&k.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!b||!i)return!0;const S=b.filter(v=>w.includes(v.type.name));n.ensureMarks(S)}return!0},tc=(t,e)=>{const n=Xa(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)&&Kn(t.doc,n.pos)&&t.join(n.pos),!0},nc=(t,e)=>{const n=Xa(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)&&Kn(t.doc,r)&&t.join(r),!0};var r5=Object.freeze({__proto__:null,blur:ZO,clearContent:XO,clearNodes:QO,command:e_,createParagraphNear:t_,cut:n_,deleteCurrentNode:r_,deleteNode:i_,deleteRange:o_,deleteSelection:s_,enter:l_,exitCode:a_,extendMarkRange:c_,first:d_,focus:f_,forEach:h_,insertContent:p_,insertContentAt:y_,joinBackward:w_,joinDown:k_,joinForward:v_,joinItemBackward:x_,joinItemForward:E_,joinTextblockBackward:C_,joinTextblockForward:S_,joinUp:b_,keyboardShortcut:__,lift:T_,liftEmptyBlock:N_,liftListItem:M_,newlineInCode:A_,resetAttributes:D_,scrollIntoView:L_,selectAll:B_,selectNodeBackward:$_,selectNodeForward:I_,selectParentNode:V_,selectTextblockEnd:P_,selectTextblockStart:R_,setContent:F_,setMark:G_,setMeta:J_,setNode:Z_,setNodeSelection:X_,setTextSelection:Q_,sinkListItem:e5,splitBlock:t5,splitListItem:n5,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=Qe(t,s.schema),m=Qe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:k,$to:x}=g,w=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=Xa(v=>vm(v.type.name,f))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===p)return d.liftListItem(m);if(vm(S.node.type.name,f)&&p.validContent(S.node.content)&&l)return c().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>tc(o,p)).command(()=>nc(o,p)).run()}return!n||!b||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>tc(o,p)).command(()=>nc(o,p)).run():c().command(()=>{const v=u().wrapInList(p,r),_=b.filter(B=>h.includes(B.type.name));return o.ensureMarks(_),v?!0:d.clearNodes()}).wrapInList(p,r).command(()=>tc(o,p)).command(()=>nc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=ir(t,r.schema);return Qa(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Qe(t,r.schema),s=Qe(e,r.schema),l=ho(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=Qe(t,n.schema);return ho(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=ir(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=Ka(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=Is(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Qe(t,r.schema)),l==="mark"&&(s=ir(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(k=>{if(s===k.type){const x=Math.max(y,d),w=Math.min(y+g.nodeSize,u);n.addMark(x,w,s.create({...k.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=Qe(t,n.schema);return _O(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return TO(i,e)(n,r)}});const i5=qe.create({name:"commands",addCommands(){return{...r5}}}),o5=qe.create({name:"drop",addProseMirrorPlugins(){return[new it({key:new It("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),s5=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new It("editable"),props:{editable:()=>this.editor.options.editable}})]}}),l5=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new it({key:new It("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}}}})]}}),a5=qe.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,k=g&&m.parent.childCount===1?y===f.pos:xe.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&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 Ja()||bm()?o:i},addProseMirrorPlugins(){return[new it({key:new It("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=xe.atStart(e.doc).from,d=xe.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!ec(n.doc))return;const h=n.tr,p=Ss({state:n,transaction:h}),{commands:m}=new Os({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),c5=qe.create({name:"paste",addProseMirrorPlugins(){return[new it({key:new It("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),d5=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new it({key:new It("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ar{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 Ar(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 Ar(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 Ar(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 Ar(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Ar(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 u5=`.ProseMirror {
|
|
40
40
|
position: relative;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -110,36 +110,36 @@ img.ProseMirror-separator {
|
|
|
110
110
|
|
|
111
111
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
112
112
|
opacity: 0
|
|
113
|
-
}`;function
|
|
113
|
+
}`;function f5(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 h5=class extends $O{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=f5(u5,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=am(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?[s5,JO.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),i5,l5,a5,d5,o5,c5].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 fi(i,this)}createCommandManager(){this.commandManager=new Os({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Za(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=Za(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=gm(n,this.options.autofocus);this.view=new oO(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:oi.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 U_(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Y_(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ya(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
114
114
|
|
|
115
|
-
`,textSerializers:r={}}=e||{};return HO(this.state.doc,{blockSeparator:n,textSerializers:{...hm(this.schema),...r}})}get isEmpty(){return ec(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 Ar(n,this)}get $doc(){return this.$pos(0)}};function hi(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(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(wm(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 Cm(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(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 rc(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ce(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 po(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ce(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&sa(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&&Kn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Tt=class Ic{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=Ce(le(this,"addOptions",{name:this.name}))),this.storage=Ce(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ic(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>As(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ic(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=Ce(le(n,"addOptions",{name:n.name})),n.storage=Ce(le(n,"addStorage",{name:n.name,options:n.options})),n}};function pi(t){return new W_({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ce(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(wm(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 Nt="top",Yt="bottom",qt="right",Mt="left",ic="auto",mo=[Nt,Yt,qt,Mt],mi="start",go="end",pT="clippingParents",Sm="viewport",yo="popper",mT="reference",_m=mo.reduce(function(t,e){return t.concat([e+"-"+mi,e+"-"+go])},[]),Om=[].concat(mo,[ic]).reduce(function(t,e){return t.concat([e,e+"-"+mi,e+"-"+go])},[]),gT="beforeRead",yT="read",bT="afterRead",kT="beforeMain",wT="main",vT="afterMain",xT="beforeWrite",ET="write",CT="afterWrite",ST=[gT,yT,bT,kT,wT,vT,xT,ET,CT];function un(t){return t?(t.nodeName||"").toLowerCase():null}function Pt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Dr(t){var e=Pt(t).Element;return t instanceof e||t instanceof Element}function Kt(t){var e=Pt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function oc(t){if(typeof ShadowRoot>"u")return!1;var e=Pt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function _T(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];!Kt(o)||!un(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 OT(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},{});!Kt(i)||!un(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Tm={name:"applyStyles",enabled:!0,phase:"write",fn:_T,effect:OT,requires:["computeStyles"]};function fn(t){return t.split("-")[0]}var Lr=Math.max,Rs=Math.min,gi=Math.round;function sc(){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 Nm(){return!/^((?!chrome|android).)*safari/i.test(sc())}function yi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Kt(t)&&(i=t.offsetWidth>0&&gi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&gi(r.height)/t.offsetHeight||1);var s=Dr(t)?Pt(t):window,l=s.visualViewport,c=!Nm()&&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 lc(t){var e=yi(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 Mm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&oc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return Pt(t).getComputedStyle(t)}function TT(t){return["table","td","th"].indexOf(un(t))>=0}function or(t){return((Dr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Fs(t){return un(t)==="html"?t:t.assignedSlot||t.parentNode||(oc(t)?t.host:null)||or(t)}function Am(t){return!Kt(t)||An(t).position==="fixed"?null:t.offsetParent}function NT(t){var e=/firefox/i.test(sc()),n=/Trident/i.test(sc());if(n&&Kt(t)){var r=An(t);if(r.position==="fixed")return null}var i=Fs(t);for(oc(i)&&(i=i.host);Kt(i)&&["html","body"].indexOf(un(i))<0;){var o=An(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 bo(t){for(var e=Pt(t),n=Am(t);n&&TT(n)&&An(n).position==="static";)n=Am(n);return n&&(un(n)==="html"||un(n)==="body"&&An(n).position==="static")?e:n||NT(t)||e}function ac(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ko(t,e,n){return Lr(t,Rs(e,n))}function MT(t,e,n){var r=ko(t,e,n);return r>n?n:r}function Dm(){return{top:0,right:0,bottom:0,left:0}}function Lm(t){return Object.assign({},Dm(),t)}function Bm(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var AT=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Lm(typeof e!="number"?e:Bm(e,mo))};function DT(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=fn(n.placement),c=ac(l),d=[Mt,qt].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=AT(i.padding,n),h=lc(o),p=c==="y"?Nt:Mt,m=c==="y"?Yt:qt,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],k=bo(o),x=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,w=g/2-y/2,b=f[p],S=x-h[u]-f[m],v=x/2-h[u]/2+w,O=ko(b,v,S),B=c;n.modifiersData[r]=(e={},e[B]=O,e.centerOffset=O-v,e)}}function LT(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)||Mm(e.elements.popper,i)&&(e.elements.arrow=i))}const BT={name:"arrow",enabled:!0,phase:"main",fn:DT,effect:LT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bi(t){return t.split("-")[1]}var $T={top:"auto",right:"auto",bottom:"auto",left:"auto"};function IT(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:gi(n*i)/i||0,y:gi(r*i)/i||0}}function $m(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 k=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),w=Mt,b=Nt,S=window;if(d){var v=bo(n),O="clientHeight",B="clientWidth";if(v===Pt(n)&&(v=or(n),An(v).position!=="static"&&l==="absolute"&&(O="scrollHeight",B="scrollWidth")),v=v,i===Nt||(i===Mt||i===qt)&&o===go){b=Yt;var A=f&&v===S&&S.visualViewport?S.visualViewport.height:v[O];g-=A-r.height,g*=c?1:-1}if(i===Mt||(i===Nt||i===Yt)&&o===go){w=qt;var P=f&&v===S&&S.visualViewport?S.visualViewport.width:v[B];p-=P-r.width,p*=c?1:-1}}var $=Object.assign({position:l},d&&$T),L=u===!0?IT({x:p,y:g},Pt(n)):{x:p,y:g};if(p=L.x,g=L.y,c){var j;return Object.assign({},$,(j={},j[b]=x?"0":"",j[w]=k?"0":"",j.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",j))}return Object.assign({},$,(e={},e[b]=x?g+"px":"",e[w]=k?p+"px":"",e.transform="",e))}function VT(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:fn(e.placement),variation:bi(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,$m(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,$m(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 PT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VT,data:{}};var zs={passive:!0};function RT(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=Pt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,zs)}),l&&c.addEventListener("resize",n.update,zs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,zs)}),l&&c.removeEventListener("resize",n.update,zs)}}const FT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:RT,data:{}};var zT={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return zT[e]})}var jT={start:"end",end:"start"};function Im(t){return t.replace(/start|end/g,function(e){return jT[e]})}function cc(t){var e=Pt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function dc(t){return yi(or(t)).left+cc(t).scrollLeft}function HT(t,e){var n=Pt(t),r=or(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Nm();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+dc(t),y:c}}function WT(t){var e,n=or(t),r=cc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Lr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Lr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+dc(t),c=-r.scrollTop;return An(i||n).direction==="rtl"&&(l+=Lr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function uc(t){var e=An(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Vm(t){return["html","body","#document"].indexOf(un(t))>=0?t.ownerDocument.body:Kt(t)&&uc(t)?t:Vm(Fs(t))}function wo(t,e){var n;e===void 0&&(e=[]);var r=Vm(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Pt(r),s=i?[o].concat(o.visualViewport||[],uc(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wo(Fs(s)))}function fc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function UT(t,e){var n=yi(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 Pm(t,e,n){return e===Sm?fc(HT(t,n)):Dr(e)?UT(e,n):fc(WT(or(t)))}function YT(t){var e=wo(Fs(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Kt(t)?bo(t):t;return Dr(r)?e.filter(function(i){return Dr(i)&&Mm(i,r)&&un(i)!=="body"}):[]}function qT(t,e,n,r){var i=e==="clippingParents"?YT(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=Pm(t,d,r);return c.top=Lr(u.top,c.top),c.right=Rs(u.right,c.right),c.bottom=Rs(u.bottom,c.bottom),c.left=Lr(u.left,c.left),c},Pm(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 Rm(t){var e=t.reference,n=t.element,r=t.placement,i=r?fn(r):null,o=r?bi(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case Nt:c={x:s,y:e.y-n.height};break;case Yt:c={x:s,y:e.y+e.height};break;case qt:c={x:e.x+e.width,y:l};break;case Mt:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?ac(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case mi:c[d]=c[d]-(e[u]/2-n[u]/2);break;case go:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function vo(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?pT:l,d=n.rootBoundary,u=d===void 0?Sm:d,f=n.elementContext,h=f===void 0?yo:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,k=Lm(typeof y!="number"?y:Bm(y,mo)),x=h===yo?mT:yo,w=t.rects.popper,b=t.elements[m?x:h],S=qT(Dr(b)?b:b.contextElement||or(t.elements.popper),c,u,s),v=yi(t.elements.reference),O=Rm({reference:v,element:w,placement:i}),B=fc(Object.assign({},w,O)),A=h===yo?B:v,P={top:S.top-A.top+k.top,bottom:A.bottom-S.bottom+k.bottom,left:S.left-A.left+k.left,right:A.right-S.right+k.right},$=t.modifiersData.offset;if(h===yo&&$){var L=$[i];Object.keys(P).forEach(function(j){var z=[qt,Yt].indexOf(j)>=0?1:-1,D=[Nt,Yt].indexOf(j)>=0?"y":"x";P[j]+=L[D]*z})}return P}function KT(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?Om:c,u=bi(r),f=u?l?_m:_m.filter(function(m){return bi(m)===u}):mo,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]=vo(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function GT(t){if(fn(t)===ic)return[];var e=js(t);return[Im(t),e,Im(e)]}function JT(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,k=fn(y),x=k===y,w=c||(x||!m?[js(y)]:GT(y)),b=[y].concat(w).reduce(function(W,K){return W.concat(fn(K)===ic?KT(e,{placement:K,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),S=e.rects.reference,v=e.rects.popper,O=new Map,B=!0,A=b[0],P=0;P<b.length;P++){var $=b[P],L=fn($),j=bi($)===mi,z=[Nt,Yt].indexOf(L)>=0,D=z?"width":"height",C=vo(e,{placement:$,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),I=z?j?qt:Mt:j?Yt:Nt;S[D]>v[D]&&(I=js(I));var R=js(I),ee=[];if(o&&ee.push(C[L]<=0),l&&ee.push(C[I]<=0,C[R]<=0),ee.every(function(W){return W})){A=$,B=!1;break}O.set($,ee)}if(B)for(var te=m?3:1,ce=function(K){var q=b.find(function(H){var de=O.get(H);if(de)return de.slice(0,K).every(function(ae){return ae})});if(q)return A=q,"break"},ue=te;ue>0;ue--){var V=ce(ue);if(V==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const ZT={name:"flip",enabled:!0,phase:"main",fn:JT,requiresIfExists:["offset"],data:{_skip:!1}};function Fm(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 zm(t){return[Nt,qt,Yt,Mt].some(function(e){return t[e]>=0})}function XT(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=vo(e,{elementContext:"reference"}),l=vo(e,{altBoundary:!0}),c=Fm(s,r),d=Fm(l,i,o),u=zm(c),f=zm(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 QT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XT};function e5(t,e,n){var r=fn(t),i=[Mt,Nt].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,[Mt,qt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function t5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Om.reduce(function(u,f){return u[f]=e5(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 n5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:t5};function r5(t){var e=t.state,n=t.name;e.modifiersData[n]=Rm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const i5={name:"popperOffsets",enabled:!0,phase:"read",fn:r5,data:{}};function o5(t){return t==="x"?"y":"x"}function s5(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=vo(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),k=fn(e.placement),x=bi(e.placement),w=!x,b=ac(k),S=o5(b),v=e.modifiersData.popperOffsets,O=e.rects.reference,B=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(v){if(o){var j,z=b==="y"?Nt:Mt,D=b==="y"?Yt:qt,C=b==="y"?"height":"width",I=v[b],R=I+y[z],ee=I-y[D],te=p?-B[C]/2:0,ce=x===mi?O[C]:B[C],ue=x===mi?-B[C]:-O[C],V=e.elements.arrow,W=p&&V?lc(V):{width:0,height:0},K=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Dm(),q=K[z],H=K[D],de=ko(0,O[C],W[C]),ae=w?O[C]/2-te-de-q-P.mainAxis:ce-de-q-P.mainAxis,we=w?-O[C]/2+te+de+H+P.mainAxis:ue+de+H+P.mainAxis,Ne=e.elements.arrow&&bo(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(j=$==null?void 0:$[b])!=null?j:0,Q=I+ae-tt-Ie,Ee=I+we-tt,At=ko(p?Rs(R,Q):R,I,p?Lr(ee,Ee):ee);v[b]=At,L[b]=At-I}if(l){var lt,at=b==="x"?Nt:Mt,pt=b==="x"?Yt:qt,E=v[S],_=S==="y"?"height":"width",U=E+y[at],se=E-y[pt],Me=[Nt,Mt].indexOf(k)!==-1,_e=(lt=$==null?void 0:$[S])!=null?lt:0,Oe=Me?U:E-O[_]-B[_]-_e+P.altAxis,F=Me?E+O[_]+B[_]-_e-P.altAxis:se,Z=p&&Me?MT(Oe,E,F):ko(p?Oe:U,E,p?F:se);v[S]=Z,L[S]=Z-E}e.modifiersData[r]=L}}const l5={name:"preventOverflow",enabled:!0,phase:"main",fn:s5,requiresIfExists:["offset"]};function a5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function c5(t){return t===Pt(t)||!Kt(t)?cc(t):a5(t)}function d5(t){var e=t.getBoundingClientRect(),n=gi(e.width)/t.offsetWidth||1,r=gi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function u5(t,e,n){n===void 0&&(n=!1);var r=Kt(e),i=Kt(e)&&d5(e),o=or(e),s=yi(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((un(e)!=="body"||uc(o))&&(l=c5(e)),Kt(e)?(c=yi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=dc(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function f5(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 h5(t){var e=f5(t);return ST.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function p5(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function m5(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 jm={placement:"bottom",modifiers:[],strategy:"absolute"};function Hm(){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 g5(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?jm:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},jm,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var x=typeof k=="function"?k(u.options):k;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Dr(l)?wo(l):l.contextElement?wo(l.contextElement):[],popper:wo(c)};var w=h5(m5([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,w=k.popper;if(Hm(x,w)){u.rects={reference:u5(x,bo(w),u.options.strategy==="fixed"),popper:lc(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(P){return u.modifiersData[P.name]=Object.assign({},P.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],v=S.fn,O=S.options,B=O===void 0?{}:O,A=S.name;typeof v=="function"&&(u=v({state:u,options:B,name:A,instance:p})||u)}}}},update:p5(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!Hm(l,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var k=y.name,x=y.options,w=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var S=b({state:u,name:k,instance:p,options:w}),v=function(){};f.push(S||v)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var y5=[FT,i5,PT,Tm,n5,ZT,l5,BT,QT],b5=g5({defaultModifiers:y5}),k5="tippy-box",Wm="tippy-content",w5="tippy-backdrop",Um="tippy-arrow",Ym="tippy-svg-arrow",Br={passive:!0,capture:!0},qm=function(){return document.body};function v5(t,e){return{}.hasOwnProperty.call(t,e)}function hc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function pc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Km(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Gm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function x5(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function E5(t){return t.split(/\s+/).filter(Boolean)}function ki(t){return[].concat(t)}function Jm(t,e){t.indexOf(e)===-1&&t.push(e)}function C5(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function S5(t){return t.split("-")[0]}function Hs(t){return[].slice.call(t)}function Zm(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function xo(){return document.createElement("div")}function Eo(t){return["Element","Fragment"].some(function(e){return pc(t,e)})}function _5(t){return pc(t,"NodeList")}function O5(t){return pc(t,"MouseEvent")}function T5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function N5(t){return Eo(t)?[t]:_5(t)?Hs(t):Array.isArray(t)?t:Hs(document.querySelectorAll(t))}function mc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Xm(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function M5(t){var e,n=ki(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function A5(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=S5(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,k=o.left-n+p>c,x=n-o.right-m>c;return g||y||k||x})}function gc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Qm(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 hn={isTouch:!1},eg=0;function D5(){hn.isTouch||(hn.isTouch=!0,window.performance&&document.addEventListener("mousemove",tg))}function tg(){var t=performance.now();t-eg<20&&(hn.isTouch=!1,document.removeEventListener("mousemove",tg)),eg=t}function L5(){var t=document.activeElement;if(T5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function B5(){document.addEventListener("touchstart",D5,Br),window.addEventListener("blur",L5)}var $5=typeof window<"u"&&typeof document<"u",I5=$5?!!window.msCrypto:!1;function wi(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 ng(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function V5(t){return ng(`
|
|
115
|
+
`,textSerializers:r={}}=e||{};return H_(this.state.doc,{blockSeparator:n,textSerializers:{...hm(this.schema),...r}})}get isEmpty(){return ec(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 Ar(n,this)}get $doc(){return this.$pos(0)}};function hi(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(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(wm(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 Cm(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(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 rc(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ce(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 po(t){return new Ts({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ce(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&sa(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&&Kn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Tt=class Ic{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=Ce(le(this,"addOptions",{name:this.name}))),this.storage=Ce(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ic(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>As(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ic(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=Ce(le(n,"addOptions",{name:n.name})),n.storage=Ce(le(n,"addStorage",{name:n.name,options:n.options})),n}};function pi(t){return new WO({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ce(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(wm(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 Nt="top",Yt="bottom",qt="right",Mt="left",ic="auto",mo=[Nt,Yt,qt,Mt],mi="start",go="end",p5="clippingParents",Sm="viewport",yo="popper",m5="reference",Om=mo.reduce(function(t,e){return t.concat([e+"-"+mi,e+"-"+go])},[]),_m=[].concat(mo,[ic]).reduce(function(t,e){return t.concat([e,e+"-"+mi,e+"-"+go])},[]),g5="beforeRead",y5="read",b5="afterRead",k5="beforeMain",w5="main",v5="afterMain",x5="beforeWrite",E5="write",C5="afterWrite",S5=[g5,y5,b5,k5,w5,v5,x5,E5,C5];function un(t){return t?(t.nodeName||"").toLowerCase():null}function Pt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Dr(t){var e=Pt(t).Element;return t instanceof e||t instanceof Element}function Kt(t){var e=Pt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function oc(t){if(typeof ShadowRoot>"u")return!1;var e=Pt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function O5(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];!Kt(o)||!un(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 _5(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},{});!Kt(i)||!un(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Tm={name:"applyStyles",enabled:!0,phase:"write",fn:O5,effect:_5,requires:["computeStyles"]};function fn(t){return t.split("-")[0]}var Lr=Math.max,Rs=Math.min,gi=Math.round;function sc(){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 Nm(){return!/^((?!chrome|android).)*safari/i.test(sc())}function yi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Kt(t)&&(i=t.offsetWidth>0&&gi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&gi(r.height)/t.offsetHeight||1);var s=Dr(t)?Pt(t):window,l=s.visualViewport,c=!Nm()&&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 lc(t){var e=yi(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 Mm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&oc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return Pt(t).getComputedStyle(t)}function T5(t){return["table","td","th"].indexOf(un(t))>=0}function or(t){return((Dr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Fs(t){return un(t)==="html"?t:t.assignedSlot||t.parentNode||(oc(t)?t.host:null)||or(t)}function Am(t){return!Kt(t)||An(t).position==="fixed"?null:t.offsetParent}function N5(t){var e=/firefox/i.test(sc()),n=/Trident/i.test(sc());if(n&&Kt(t)){var r=An(t);if(r.position==="fixed")return null}var i=Fs(t);for(oc(i)&&(i=i.host);Kt(i)&&["html","body"].indexOf(un(i))<0;){var o=An(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 bo(t){for(var e=Pt(t),n=Am(t);n&&T5(n)&&An(n).position==="static";)n=Am(n);return n&&(un(n)==="html"||un(n)==="body"&&An(n).position==="static")?e:n||N5(t)||e}function ac(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ko(t,e,n){return Lr(t,Rs(e,n))}function M5(t,e,n){var r=ko(t,e,n);return r>n?n:r}function Dm(){return{top:0,right:0,bottom:0,left:0}}function Lm(t){return Object.assign({},Dm(),t)}function Bm(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var A5=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Lm(typeof e!="number"?e:Bm(e,mo))};function D5(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=fn(n.placement),c=ac(l),d=[Mt,qt].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=A5(i.padding,n),h=lc(o),p=c==="y"?Nt:Mt,m=c==="y"?Yt:qt,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],k=bo(o),x=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,w=g/2-y/2,b=f[p],S=x-h[u]-f[m],v=x/2-h[u]/2+w,_=ko(b,v,S),B=c;n.modifiersData[r]=(e={},e[B]=_,e.centerOffset=_-v,e)}}function L5(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)||Mm(e.elements.popper,i)&&(e.elements.arrow=i))}const B5={name:"arrow",enabled:!0,phase:"main",fn:D5,effect:L5,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bi(t){return t.split("-")[1]}var $5={top:"auto",right:"auto",bottom:"auto",left:"auto"};function I5(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:gi(n*i)/i||0,y:gi(r*i)/i||0}}function $m(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 k=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),w=Mt,b=Nt,S=window;if(d){var v=bo(n),_="clientHeight",B="clientWidth";if(v===Pt(n)&&(v=or(n),An(v).position!=="static"&&l==="absolute"&&(_="scrollHeight",B="scrollWidth")),v=v,i===Nt||(i===Mt||i===qt)&&o===go){b=Yt;var A=f&&v===S&&S.visualViewport?S.visualViewport.height:v[_];g-=A-r.height,g*=c?1:-1}if(i===Mt||(i===Nt||i===Yt)&&o===go){w=qt;var P=f&&v===S&&S.visualViewport?S.visualViewport.width:v[B];p-=P-r.width,p*=c?1:-1}}var $=Object.assign({position:l},d&&$5),L=u===!0?I5({x:p,y:g},Pt(n)):{x:p,y:g};if(p=L.x,g=L.y,c){var j;return Object.assign({},$,(j={},j[b]=x?"0":"",j[w]=k?"0":"",j.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",j))}return Object.assign({},$,(e={},e[b]=x?g+"px":"",e[w]=k?p+"px":"",e.transform="",e))}function V5(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:fn(e.placement),variation:bi(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,$m(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,$m(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 P5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:V5,data:{}};var zs={passive:!0};function R5(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=Pt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,zs)}),l&&c.addEventListener("resize",n.update,zs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,zs)}),l&&c.removeEventListener("resize",n.update,zs)}}const F5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:R5,data:{}};var z5={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return z5[e]})}var j5={start:"end",end:"start"};function Im(t){return t.replace(/start|end/g,function(e){return j5[e]})}function cc(t){var e=Pt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function dc(t){return yi(or(t)).left+cc(t).scrollLeft}function H5(t,e){var n=Pt(t),r=or(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Nm();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+dc(t),y:c}}function W5(t){var e,n=or(t),r=cc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Lr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Lr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+dc(t),c=-r.scrollTop;return An(i||n).direction==="rtl"&&(l+=Lr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function uc(t){var e=An(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Vm(t){return["html","body","#document"].indexOf(un(t))>=0?t.ownerDocument.body:Kt(t)&&uc(t)?t:Vm(Fs(t))}function wo(t,e){var n;e===void 0&&(e=[]);var r=Vm(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Pt(r),s=i?[o].concat(o.visualViewport||[],uc(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wo(Fs(s)))}function fc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function U5(t,e){var n=yi(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 Pm(t,e,n){return e===Sm?fc(H5(t,n)):Dr(e)?U5(e,n):fc(W5(or(t)))}function Y5(t){var e=wo(Fs(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Kt(t)?bo(t):t;return Dr(r)?e.filter(function(i){return Dr(i)&&Mm(i,r)&&un(i)!=="body"}):[]}function q5(t,e,n,r){var i=e==="clippingParents"?Y5(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=Pm(t,d,r);return c.top=Lr(u.top,c.top),c.right=Rs(u.right,c.right),c.bottom=Rs(u.bottom,c.bottom),c.left=Lr(u.left,c.left),c},Pm(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 Rm(t){var e=t.reference,n=t.element,r=t.placement,i=r?fn(r):null,o=r?bi(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case Nt:c={x:s,y:e.y-n.height};break;case Yt:c={x:s,y:e.y+e.height};break;case qt:c={x:e.x+e.width,y:l};break;case Mt:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?ac(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case mi:c[d]=c[d]-(e[u]/2-n[u]/2);break;case go:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function vo(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?p5:l,d=n.rootBoundary,u=d===void 0?Sm:d,f=n.elementContext,h=f===void 0?yo:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,k=Lm(typeof y!="number"?y:Bm(y,mo)),x=h===yo?m5:yo,w=t.rects.popper,b=t.elements[m?x:h],S=q5(Dr(b)?b:b.contextElement||or(t.elements.popper),c,u,s),v=yi(t.elements.reference),_=Rm({reference:v,element:w,placement:i}),B=fc(Object.assign({},w,_)),A=h===yo?B:v,P={top:S.top-A.top+k.top,bottom:A.bottom-S.bottom+k.bottom,left:S.left-A.left+k.left,right:A.right-S.right+k.right},$=t.modifiersData.offset;if(h===yo&&$){var L=$[i];Object.keys(P).forEach(function(j){var z=[qt,Yt].indexOf(j)>=0?1:-1,D=[Nt,Yt].indexOf(j)>=0?"y":"x";P[j]+=L[D]*z})}return P}function K5(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?_m:c,u=bi(r),f=u?l?Om:Om.filter(function(m){return bi(m)===u}):mo,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]=vo(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function G5(t){if(fn(t)===ic)return[];var e=js(t);return[Im(t),e,Im(e)]}function J5(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,k=fn(y),x=k===y,w=c||(x||!m?[js(y)]:G5(y)),b=[y].concat(w).reduce(function(W,K){return W.concat(fn(K)===ic?K5(e,{placement:K,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),S=e.rects.reference,v=e.rects.popper,_=new Map,B=!0,A=b[0],P=0;P<b.length;P++){var $=b[P],L=fn($),j=bi($)===mi,z=[Nt,Yt].indexOf(L)>=0,D=z?"width":"height",C=vo(e,{placement:$,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),I=z?j?qt:Mt:j?Yt:Nt;S[D]>v[D]&&(I=js(I));var R=js(I),ee=[];if(o&&ee.push(C[L]<=0),l&&ee.push(C[I]<=0,C[R]<=0),ee.every(function(W){return W})){A=$,B=!1;break}_.set($,ee)}if(B)for(var te=m?3:1,ce=function(K){var q=b.find(function(H){var de=_.get(H);if(de)return de.slice(0,K).every(function(ae){return ae})});if(q)return A=q,"break"},ue=te;ue>0;ue--){var V=ce(ue);if(V==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const Z5={name:"flip",enabled:!0,phase:"main",fn:J5,requiresIfExists:["offset"],data:{_skip:!1}};function Fm(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 zm(t){return[Nt,qt,Yt,Mt].some(function(e){return t[e]>=0})}function X5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=vo(e,{elementContext:"reference"}),l=vo(e,{altBoundary:!0}),c=Fm(s,r),d=Fm(l,i,o),u=zm(c),f=zm(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 Q5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:X5};function eT(t,e,n){var r=fn(t),i=[Mt,Nt].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,[Mt,qt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function tT(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=_m.reduce(function(u,f){return u[f]=eT(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 nT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tT};function rT(t){var e=t.state,n=t.name;e.modifiersData[n]=Rm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const iT={name:"popperOffsets",enabled:!0,phase:"read",fn:rT,data:{}};function oT(t){return t==="x"?"y":"x"}function sT(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=vo(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),k=fn(e.placement),x=bi(e.placement),w=!x,b=ac(k),S=oT(b),v=e.modifiersData.popperOffsets,_=e.rects.reference,B=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(v){if(o){var j,z=b==="y"?Nt:Mt,D=b==="y"?Yt:qt,C=b==="y"?"height":"width",I=v[b],R=I+y[z],ee=I-y[D],te=p?-B[C]/2:0,ce=x===mi?_[C]:B[C],ue=x===mi?-B[C]:-_[C],V=e.elements.arrow,W=p&&V?lc(V):{width:0,height:0},K=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Dm(),q=K[z],H=K[D],de=ko(0,_[C],W[C]),ae=w?_[C]/2-te-de-q-P.mainAxis:ce-de-q-P.mainAxis,we=w?-_[C]/2+te+de+H+P.mainAxis:ue+de+H+P.mainAxis,Ne=e.elements.arrow&&bo(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(j=$==null?void 0:$[b])!=null?j:0,Q=I+ae-tt-Ie,Ee=I+we-tt,At=ko(p?Rs(R,Q):R,I,p?Lr(ee,Ee):ee);v[b]=At,L[b]=At-I}if(l){var lt,at=b==="x"?Nt:Mt,pt=b==="x"?Yt:qt,E=v[S],O=S==="y"?"height":"width",U=E+y[at],se=E-y[pt],Me=[Nt,Mt].indexOf(k)!==-1,Oe=(lt=$==null?void 0:$[S])!=null?lt:0,_e=Me?U:E-_[O]-B[O]-Oe+P.altAxis,F=Me?E+_[O]+B[O]-Oe-P.altAxis:se,Z=p&&Me?M5(_e,E,F):ko(p?_e:U,E,p?F:se);v[S]=Z,L[S]=Z-E}e.modifiersData[r]=L}}const lT={name:"preventOverflow",enabled:!0,phase:"main",fn:sT,requiresIfExists:["offset"]};function aT(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function cT(t){return t===Pt(t)||!Kt(t)?cc(t):aT(t)}function dT(t){var e=t.getBoundingClientRect(),n=gi(e.width)/t.offsetWidth||1,r=gi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function uT(t,e,n){n===void 0&&(n=!1);var r=Kt(e),i=Kt(e)&&dT(e),o=or(e),s=yi(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((un(e)!=="body"||uc(o))&&(l=cT(e)),Kt(e)?(c=yi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=dc(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function fT(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 hT(t){var e=fT(t);return S5.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function pT(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function mT(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 jm={placement:"bottom",modifiers:[],strategy:"absolute"};function Hm(){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 gT(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?jm:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},jm,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var x=typeof k=="function"?k(u.options):k;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Dr(l)?wo(l):l.contextElement?wo(l.contextElement):[],popper:wo(c)};var w=hT(mT([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,w=k.popper;if(Hm(x,w)){u.rects={reference:uT(x,bo(w),u.options.strategy==="fixed"),popper:lc(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(P){return u.modifiersData[P.name]=Object.assign({},P.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],v=S.fn,_=S.options,B=_===void 0?{}:_,A=S.name;typeof v=="function"&&(u=v({state:u,options:B,name:A,instance:p})||u)}}}},update:pT(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!Hm(l,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var k=y.name,x=y.options,w=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var S=b({state:u,name:k,instance:p,options:w}),v=function(){};f.push(S||v)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var yT=[F5,iT,P5,Tm,nT,Z5,lT,B5,Q5],bT=gT({defaultModifiers:yT}),kT="tippy-box",Wm="tippy-content",wT="tippy-backdrop",Um="tippy-arrow",Ym="tippy-svg-arrow",Br={passive:!0,capture:!0},qm=function(){return document.body};function vT(t,e){return{}.hasOwnProperty.call(t,e)}function hc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function pc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Km(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Gm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function xT(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function ET(t){return t.split(/\s+/).filter(Boolean)}function ki(t){return[].concat(t)}function Jm(t,e){t.indexOf(e)===-1&&t.push(e)}function CT(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function ST(t){return t.split("-")[0]}function Hs(t){return[].slice.call(t)}function Zm(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function xo(){return document.createElement("div")}function Eo(t){return["Element","Fragment"].some(function(e){return pc(t,e)})}function OT(t){return pc(t,"NodeList")}function _T(t){return pc(t,"MouseEvent")}function TT(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function NT(t){return Eo(t)?[t]:OT(t)?Hs(t):Array.isArray(t)?t:Hs(document.querySelectorAll(t))}function mc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Xm(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function MT(t){var e,n=ki(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function AT(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=ST(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,k=o.left-n+p>c,x=n-o.right-m>c;return g||y||k||x})}function gc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Qm(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 hn={isTouch:!1},eg=0;function DT(){hn.isTouch||(hn.isTouch=!0,window.performance&&document.addEventListener("mousemove",tg))}function tg(){var t=performance.now();t-eg<20&&(hn.isTouch=!1,document.removeEventListener("mousemove",tg)),eg=t}function LT(){var t=document.activeElement;if(TT(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function BT(){document.addEventListener("touchstart",DT,Br),window.addEventListener("blur",LT)}var $T=typeof window<"u"&&typeof document<"u",IT=$T?!!window.msCrypto:!1;function wi(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 ng(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function VT(t){return ng(`
|
|
116
116
|
%ctippy.js
|
|
117
117
|
|
|
118
118
|
%c`+ng(t)+`
|
|
119
119
|
|
|
120
120
|
%c👷 This is a development-only message. It will be removed in production.
|
|
121
|
-
`)}function rg(t){return[
|
|
121
|
+
`)}function rg(t){return[VT(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Co;process.env.NODE_ENV!=="production"&&PT();function PT(){Co=new Set}function Dn(t,e){if(t&&!Co.has(e)){var n;Co.add(e),(n=console).warn.apply(n,rg(e))}}function yc(t,e){if(t&&!Co.has(e)){var n;Co.add(e),(n=console).error.apply(n,rg(e))}}function RT(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;yc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),yc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var ig={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},FT={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Rt=Object.assign({appendTo:qm,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},ig,FT),zT=Object.keys(Rt),jT=function(e){process.env.NODE_ENV!=="production"&&lg(e,[]);var n=Object.keys(e);n.forEach(function(r){Rt[r]=e[r]})};function og(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=Rt[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function HT(t,e){var n=e?Object.keys(og(Object.assign({},Rt,{plugins:e}))):zT,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 sg(t,e){var n=Object.assign({},e,{content:Km(e.content,[t])},e.ignoreAttributes?{}:HT(t,e.plugins));return n.aria=Object.assign({},Rt.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 lg(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=xT(Rt,Object.keys(ig)),o=!vT(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),Dn(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.",`
|
|
122
122
|
|
|
123
123
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
124
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
124
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var WT=function(){return"innerHTML"};function bc(t,e){t[WT()]=e}function ag(t){var e=xo();return t===!0?e.className=Um:(e.className=Ym,Eo(t)?e.appendChild(t):bc(e,t)),e}function cg(t,e){Eo(e.content)?(bc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?bc(t,e.content):t.textContent=e.content)}function kc(t){var e=t.firstElementChild,n=Hs(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Wm)}),arrow:n.find(function(r){return r.classList.contains(Um)||r.classList.contains(Ym)}),backdrop:n.find(function(r){return r.classList.contains(wT)})}}function dg(t){var e=xo(),n=xo();n.className=kT,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=xo();r.className=Wm,r.setAttribute("data-state","hidden"),cg(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=kc(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)&&cg(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(ag(s.arrow))):c.appendChild(ag(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}dg.$$tippy=!0;var UT=1,Ws=[],wc=[];function YT(t,e){var n=sg(t,Object.assign({},Rt,og(Zm(e)))),r,i,o,s=!1,l=!1,c=!1,d=!1,u,f,h,p=[],m=Gm(Q,n.interactiveDebounce),g,y=UT++,k=null,x=CT(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:xo(),popperInstance:k,props:n,state:w,plugins:x,clearDelayTimeouts:_e,setProps:F,setContent:Z,show:T,hide:M,hideWithInteractivity:Y,enable:Me,disable:Oe,unmount:ne,destroy:fe};if(!n.render)return process.env.NODE_ENV!=="production"&&yc(!0,"render() function has not been supplied."),b;var S=n.render(b),v=S.popper,_=S.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+b.id,b.popper=v,t._tippy=b,v._tippy=b;var B=x.map(function(N){return N.fn(b)}),A=t.hasAttribute("aria-expanded");return Ne(),te(),I(),R("onCreate",[b]),n.showOnCreate&&U(),v.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),v.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",m)}),b;function P(){var N=b.props.touch;return Array.isArray(N)?N:[N,0]}function $(){return P()[0]==="hold"}function L(){var N;return!!((N=b.props.render)!=null&&N.$$tippy)}function j(){return g||t}function z(){var N=j().parentNode;return N?MT(N):document}function D(){return kc(v)}function C(N){return b.state.isMounted&&!b.state.isVisible||hn.isTouch||u&&u.type==="focus"?0:hc(b.props.delay,N?0:1,Rt.delay)}function I(N){N===void 0&&(N=!1),v.style.pointerEvents=b.props.interactive&&!N?"":"none",v.style.zIndex=""+b.props.zIndex}function R(N,X,ie){if(ie===void 0&&(ie=!0),B.forEach(function(ye){ye[N]&&ye[N].apply(ye,X)}),ie){var me;(me=b.props)[N].apply(me,X)}}function ee(){var N=b.props.aria;if(N.content){var X="aria-"+N.content,ie=v.id,me=ki(b.props.triggerTarget||t);me.forEach(function(ye){var ve=ye.getAttribute(X);if(b.state.isVisible)ye.setAttribute(X,ve?ve+" "+ie:ie);else{var Ae=ve&&ve.replace(ie,"").trim();Ae?ye.setAttribute(X,Ae):ye.removeAttribute(X)}})}}function te(){if(!(A||!b.props.aria.expanded)){var N=ki(b.props.triggerTarget||t);N.forEach(function(X){b.props.interactive?X.setAttribute("aria-expanded",b.state.isVisible&&X===j()?"true":"false"):X.removeAttribute("aria-expanded")})}}function ce(){z().removeEventListener("mousemove",m),Ws=Ws.filter(function(N){return N!==m})}function ue(N){if(!(hn.isTouch&&(c||N.type==="mousedown"))){var X=N.composedPath&&N.composedPath()[0]||N.target;if(!(b.props.interactive&&Qm(v,X))){if(ki(b.props.triggerTarget||t).some(function(ie){return Qm(ie,X)})){if(hn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[b,N]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||q())}}}function V(){c=!0}function W(){c=!1}function K(){var N=z();N.addEventListener("mousedown",ue,!0),N.addEventListener("touchend",ue,Br),N.addEventListener("touchstart",W,Br),N.addEventListener("touchmove",V,Br)}function q(){var N=z();N.removeEventListener("mousedown",ue,!0),N.removeEventListener("touchend",ue,Br),N.removeEventListener("touchstart",W,Br),N.removeEventListener("touchmove",V,Br)}function H(N,X){ae(N,function(){!b.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&X()})}function de(N,X){ae(N,X)}function ae(N,X){var ie=D().box;function me(ye){ye.target===ie&&(gc(ie,"remove",me),X())}if(N===0)return X();gc(ie,"remove",f),gc(ie,"add",me),f=me}function we(N,X,ie){ie===void 0&&(ie=!1);var me=ki(b.props.triggerTarget||t);me.forEach(function(ye){ye.addEventListener(N,X,ie),p.push({node:ye,eventType:N,handler:X,options:ie})})}function Ne(){$()&&(we("touchstart",tt,{passive:!0}),we("touchend",Ee,{passive:!0})),ET(b.props.trigger).forEach(function(N){if(N!=="manual")switch(we(N,tt),N){case"mouseenter":we("mouseleave",Ee);break;case"focus":we(IT?"focusout":"blur",At);break;case"focusin":we("focusout",At);break}})}function Ie(){p.forEach(function(N){var X=N.node,ie=N.eventType,me=N.handler,ye=N.options;X.removeEventListener(ie,me,ye)}),p=[]}function tt(N){var X,ie=!1;if(!(!b.state.isEnabled||lt(N)||l)){var me=((X=u)==null?void 0:X.type)==="focus";u=N,g=N.currentTarget,te(),!b.state.isVisible&&_T(N)&&Ws.forEach(function(ye){return ye(N)}),N.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?ie=!0:U(N),N.type==="click"&&(s=!ie),ie&&!me&&se(N)}}function Q(N){var X=N.target,ie=j().contains(X)||v.contains(X);if(!(N.type==="mousemove"&&ie)){var me=O().concat(v).map(function(ye){var ve,Ae=ye._tippy,je=(ve=Ae.popperInstance)==null?void 0:ve.state;return je?{popperRect:ye.getBoundingClientRect(),popperState:je,props:n}:null}).filter(Boolean);AT(me,N)&&(ce(),se(N))}}function Ee(N){var X=lt(N)||b.props.trigger.indexOf("click")>=0&&s;if(!X){if(b.props.interactive){b.hideWithInteractivity(N);return}se(N)}}function At(N){b.props.trigger.indexOf("focusin")<0&&N.target!==j()||b.props.interactive&&N.relatedTarget&&v.contains(N.relatedTarget)||se(N)}function lt(N){return hn.isTouch?$()!==N.type.indexOf("touch")>=0:!1}function at(){pt();var N=b.props,X=N.popperOptions,ie=N.placement,me=N.offset,ye=N.getReferenceClientRect,ve=N.moveTransition,Ae=L()?kc(v).arrow:null,je=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||j()}:t,vt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(lr){var mn=lr.state;if(L()){var So=D(),Lc=So.box;["placement","reference-hidden","escaped"].forEach(function(Gs){Gs==="placement"?Lc.setAttribute("data-placement",mn.placement):mn.attributes.popper["data-popper-"+Gs]?Lc.setAttribute("data-"+Gs,""):Lc.removeAttribute("data-"+Gs)}),mn.attributes.popper={}}}},Ft=[{name:"offset",options:{offset:me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ve}},vt];L()&&Ae&&Ft.push({name:"arrow",options:{element:Ae,padding:3}}),Ft.push.apply(Ft,(X==null?void 0:X.modifiers)||[]),b.popperInstance=bT(je,v,Object.assign({},X,{placement:ie,onFirstUpdate:h,modifiers:Ft}))}function pt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function E(){var N=b.props.appendTo,X,ie=j();b.props.interactive&&N===qm||N==="parent"?X=ie.parentNode:X=Km(N,[ie]),X.contains(v)||X.appendChild(v),b.state.isMounted=!0,at(),process.env.NODE_ENV!=="production"&&Dn(b.props.interactive&&N===Rt.appendTo&&ie.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.",`
|
|
125
125
|
|
|
126
126
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
127
127
|
|
|
128
128
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
129
129
|
|
|
130
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
130
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function O(){return Hs(v.querySelectorAll("[data-tippy-root]"))}function U(N){b.clearDelayTimeouts(),N&&R("onTrigger",[b,N]),K();var X=C(!0),ie=P(),me=ie[0],ye=ie[1];hn.isTouch&&me==="hold"&&ye&&(X=ye),X?r=setTimeout(function(){b.show()},X):b.show()}function se(N){if(b.clearDelayTimeouts(),R("onUntrigger",[b,N]),!b.state.isVisible){q();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(N.type)>=0&&s)){var X=C(!1);X?i=setTimeout(function(){b.state.isVisible&&b.hide()},X):o=requestAnimationFrame(function(){b.hide()})}}function Me(){b.state.isEnabled=!0}function Oe(){b.hide(),b.state.isEnabled=!1}function _e(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function F(N){if(process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("setProps")),!b.state.isDestroyed){R("onBeforeUpdate",[b,N]),Ie();var X=b.props,ie=sg(t,Object.assign({},X,Zm(N),{ignoreAttributes:!0}));b.props=ie,Ne(),X.interactiveDebounce!==ie.interactiveDebounce&&(ce(),m=Gm(Q,ie.interactiveDebounce)),X.triggerTarget&&!ie.triggerTarget?ki(X.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):ie.triggerTarget&&t.removeAttribute("aria-expanded"),te(),I(),_&&_(X,ie),b.popperInstance&&(at(),O().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[b,N])}}function Z(N){b.setProps({content:N})}function T(){process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("show"));var N=b.state.isVisible,X=b.state.isDestroyed,ie=!b.state.isEnabled,me=hn.isTouch&&!b.props.touch,ye=hc(b.props.duration,0,Rt.duration);if(!(N||X||ie||me)&&!j().hasAttribute("disabled")&&(R("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,L()&&(v.style.visibility="visible"),I(),K(),b.state.isMounted||(v.style.transition="none"),L()){var ve=D(),Ae=ve.box,je=ve.content;mc([Ae,je],0)}h=function(){var Ft;if(!(!b.state.isVisible||d)){if(d=!0,v.offsetHeight,v.style.transition=b.props.moveTransition,L()&&b.props.animation){var Ir=D(),lr=Ir.box,mn=Ir.content;mc([lr,mn],ye),Xm([lr,mn],"visible")}ee(),te(),Jm(wc,b),(Ft=b.popperInstance)==null||Ft.forceUpdate(),R("onMount",[b]),b.props.animation&&L()&&de(ye,function(){b.state.isShown=!0,R("onShown",[b])})}},E()}}function M(){process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("hide"));var N=!b.state.isVisible,X=b.state.isDestroyed,ie=!b.state.isEnabled,me=hc(b.props.duration,1,Rt.duration);if(!(N||X||ie)&&(R("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,L()&&(v.style.visibility="hidden"),ce(),q(),I(!0),L()){var ye=D(),ve=ye.box,Ae=ye.content;b.props.animation&&(mc([ve,Ae],me),Xm([ve,Ae],"hidden"))}ee(),te(),b.props.animation?L()&&H(me,b.unmount):b.unmount()}}function Y(N){process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("hideWithInteractivity")),z().addEventListener("mousemove",m),Jm(Ws,m),m(N)}function ne(){process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(pt(),O().forEach(function(N){N._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),wc=wc.filter(function(N){return N!==b}),b.state.isMounted=!1,R("onHidden",[b]))}function fe(){process.env.NODE_ENV!=="production"&&Dn(b.state.isDestroyed,wi("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Ie(),delete t._tippy,b.state.isDestroyed=!0,R("onDestroy",[b]))}}function vi(t,e){e===void 0&&(e={});var n=Rt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(RT(t),lg(e,n)),BT();var r=Object.assign({},e,{plugins:n}),i=NT(t);if(process.env.NODE_ENV!=="production"){var o=Eo(r.content),s=i.length>1;Dn(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.",`
|
|
131
131
|
|
|
132
132
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
133
133
|
|
|
134
134
|
`,`1) content: element.innerHTML
|
|
135
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&Y5(d,r);return u&&c.push(u),c},[]);return Eo(t)?l[0]:l}vi.defaultProps=Rt,vi.setDefaultProps=j5,vi.currentInput=hn,Object.assign({},Tm,{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)}}),vi.setDefaultProps({render:dg});class q5{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&&Ga(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:x}=y,w=Math.min(...x.map(v=>v.$from.pos)),b=Math.max(...x.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:w,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(qO(m.selection)){let v=l.nodeDOM(w);const O=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(O&&(v=O.firstChild),v)return v.getBoundingClientRect()}return xm(l,w,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=vi(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 ug=t=>new it({key:typeof t.pluginKey=="string"?new It(t.pluginKey):t.pluginKey,view:e=>new q5({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ug({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class K5{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=vi(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)||(()=>xm(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 fg=t=>new it({key:typeof t.pluginKey=="string"?new It(t.pluginKey):t.pluginKey,view:e=>new K5({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[fg({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(ug({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 hg(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class G5 extends hT{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=hg(this.view.state),this.reactiveExtensionStorage=hg(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 J5=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(fg({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 Z5=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new G5(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},X5=/^\s*>\s$/,Q5=Tt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Fe(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[po({find:X5,type:this.type})]}}),eN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,tN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,nN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,rN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,iN=Ut.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",Fe(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[hi({find:eN,type:this.type}),hi({find:nN,type:this.type})]},addPasteRules(){return[pi({find:tN,type:this.type}),pi({find:rN,type:this.type})]}}),oN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),pg=Ut.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Vs(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),mg=/^\s*([-+*])\s$/,sN=Tt.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",Fe(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(oN.name,this.editor.getAttributes(pg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=po({find:mg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=po({find:mg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pg.name),editor:this.editor})),[t]}}),lN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,aN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,cN=Ut.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Fe(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[hi({find:lN,type:this.type})]},addPasteRules(){return[pi({find:aN,type:this.type})]}}),dN=/^```([a-z]+)?[\s\n]$/,uN=/^~~~([a-z]+)?[\s\n]$/,fN=Tt.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",Fe(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(`
|
|
135
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&YT(d,r);return u&&c.push(u),c},[]);return Eo(t)?l[0]:l}vi.defaultProps=Rt,vi.setDefaultProps=jT,vi.currentInput=hn,Object.assign({},Tm,{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)}}),vi.setDefaultProps({render:dg});class qT{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&&Ga(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:x}=y,w=Math.min(...x.map(v=>v.$from.pos)),b=Math.max(...x.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:w,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(q_(m.selection)){let v=l.nodeDOM(w);const _=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(_&&(v=_.firstChild),v)return v.getBoundingClientRect()}return xm(l,w,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=vi(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 ug=t=>new it({key:typeof t.pluginKey=="string"?new It(t.pluginKey):t.pluginKey,view:e=>new qT({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ug({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class KT{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=vi(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)||(()=>xm(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 fg=t=>new it({key:typeof t.pluginKey=="string"?new It(t.pluginKey):t.pluginKey,view:e=>new KT({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[fg({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(ug({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 hg(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class GT extends h5{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=hg(this.view.state),this.reactiveExtensionStorage=hg(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 JT=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(fg({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 ZT=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new GT(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},XT=/^\s*>\s$/,QT=Tt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Fe(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[po({find:XT,type:this.type})]}}),eN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,tN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,nN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,rN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,iN=Ut.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",Fe(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[hi({find:eN,type:this.type}),hi({find:nN,type:this.type})]},addPasteRules(){return[pi({find:tN,type:this.type}),pi({find:rN,type:this.type})]}}),oN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),pg=Ut.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Vs(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),mg=/^\s*([-+*])\s$/,sN=Tt.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",Fe(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(oN.name,this.editor.getAttributes(pg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=po({find:mg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=po({find:mg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pg.name),editor:this.editor})),[t]}}),lN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,aN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,cN=Ut.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Fe(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[hi({find:lN,type:this.type})]},addPasteRules(){return[pi({find:aN,type:this.type})]}}),dN=/^```([a-z]+)?[\s\n]$/,uN=/^~~~([a-z]+)?[\s\n]$/,fN=Tt.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",Fe(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(`
|
|
136
136
|
|
|
137
137
|
`);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[rc({find:dN,type:this.type,getAttributes:t=>({language:t[1]})}),rc({find:uN,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new it({key:new It("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(ke.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
|
|
138
138
|
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),hN=Tt.create({name:"doc",topNode:!0,content:"block+"});function pN(t={}){return new it({view(e){return new mN(e,t)}})}class mN{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=vh(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 gN=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[pN(this.options)]}});class ze extends xe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ze.valid(r)?new ze(r):xe.near(r)}content(){return re.empty}eq(e){return e instanceof ze&&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 ze(e.resolve(n.pos))}getBookmark(){return new vc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!yN(e)||!bN(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&&ze.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(ze.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!pe.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(ze.valid(l))return l}return null}}}ze.prototype.visible=!1,ze.findFrom=ze.findGapCursorFrom,xe.jsonID("gapcursor",ze);class vc{constructor(e){this.pos=e}map(e){return new vc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ze.valid(n)?new ze(n):xe.near(n)}}function yN(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 bN(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 kN(){return new it({props:{decorations:EN,createSelectionBetween(t,e,n){return e.pos==n.pos&&ze.valid(n)?new ze(n):null},handleClick:vN,handleKeyDown:wN,handleDOMEvents:{beforeinput:xN}}})}const wN=qp({ArrowLeft:Us("horiz",-1),ArrowRight:Us("horiz",1),ArrowUp:Us("vert",-1),ArrowDown:Us("vert",1)});function Us(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 ke){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=ze.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new ze(d))),!0):!1}}function vN(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ze.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ze(r))),!0)}function xN(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ze))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=J.empty;for(let s=r.length-1;s>=0;s--)i=J.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new re(i,0,0));return o.setSelection(ke.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function EN(t){if(!(t.selection instanceof ze))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ye.create(t.doc,[Vt.widget(t.selection.head,e,{key:"gapcursor"})])}const CN=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[kN()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ce(le(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),SN=Tt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Fe(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
139
|
-
`},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()}}}),_N=Tt.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]}`,Fe(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=>rc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ys=200,et=function(){};et.prototype.append=function(e){return e.length?(e=et.from(e),!this.length&&e||e.length<Ys&&this.leafAppend(e)||this.length<Ys&&e.leafPrepend(this)||this.appendInner(e)):this},et.prototype.prepend=function(e){return e.length?et.from(e).append(this):this},et.prototype.appendInner=function(e){return new ON(this,e)},et.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},et.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},et.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)},et.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},et.from=function(e){return e instanceof et?e:e&&e.length?new gg(e):et.empty};var gg=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<=Ys)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ys)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(et);et.empty=new gg([]);var ON=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}(et);const TN=500;class nn{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 pn(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 pn(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 nn(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 pn(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>MN&&(l=NN(l,d),s-=d),new nn(l.append(o),s)}remapping(e,n){let r=new Qr;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(n=>new pn(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 pn(m,g,y))}else r.push(new pn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new pn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new nn(u,l);return f.emptyItemCount()>TN&&(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 pn(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 nn(et.from(i.reverse()),o)}}nn.empty=new nn(et.empty,0);function NN(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pn{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 pn(n.getMap().invert(),n,this.selection)}}}class sr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const MN=20;function AN(t,e,n,r){let i=n.getMeta($r),o;if(i)return i.historyState;n.getMeta(BN)&&(t=new sr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta($r))return s.getMeta($r).redo?new sr(t.done.addTransform(n,void 0,r,qs(e)),t.undone,yg(n.mapping.maps),t.prevTime,t.prevComposition):new sr(t.done,t.undone.addTransform(n,void 0,r,qs(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||!DN(n,t.prevRanges)),d=s?xc(t.prevRanges,n.mapping):yg(n.mapping.maps);return new sr(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,qs(e)),nn.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new sr(t.done.rebased(n,o),t.undone.rebased(n,o),xc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new sr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),xc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function DN(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 yg(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 xc(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 LN(t,e,n){let r=qs(e),i=$r.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 sr(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta($r,{redo:n,historyState:c})}let Ec=!1,bg=null;function qs(t){let e=t.plugins;if(bg!=e){Ec=!1,bg=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ec=!0;break}}return Ec}const $r=new It("history"),BN=new It("closeHistory");function $N(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new it({key:$r,state:{init(){return new sr(nn.empty,nn.empty,null,0,-1)},apply(e,n,r){return AN(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?wg:r=="historyRedo"?vg:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function kg(t,e){return(n,r)=>{let i=$r.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=LN(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const wg=kg(!1,!0),vg=kg(!0,!0),IN=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wg(t,e),redo:()=>({state:t,dispatch:e})=>vg(t,e)}},addProseMirrorPlugins(){return[$N(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()}}}),VN=Tt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Fe(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(ke.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,l.pos)):i.setSelection(ke.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(ke.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Cm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),PN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,RN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,FN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jN=Ut.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",Fe(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[hi({find:PN,type:this.type}),hi({find:FN,type:this.type})]},addPasteRules(){return[pi({find:RN,type:this.type}),pi({find:zN,type:this.type})]}}),HN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),WN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),xg=Ut.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Vs(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Eg=/^(\d+)\.\s$/,UN=Tt.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",Fe(this.options.HTMLAttributes,n),0]:["ol",Fe(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(WN.name,this.editor.getAttributes(xg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=po({find:Eg,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=po({find:Eg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),YN=Tt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,KN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,GN=Ut.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",Fe(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[hi({find:qN,type:this.type})]},addPasteRules(){return[pi({find:KN,type:this.type})]}}),JN=Tt.create({name:"text",group:"inline"}),ZN=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,g,y,k;const x=[];return this.options.blockquote!==!1&&x.push(Q5.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(iN.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(sN.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(cN.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(fN.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(hN.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(gN.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(CN.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&x.push(SN.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(_N.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(IN.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(VN.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(jN.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(HN.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(UN.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(YN.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(GN.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(JN.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),XN=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new it({key:new It("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=Vt.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}),Ye.create(t,o)}}})]}}),QN=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Tt.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",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Cm({find:QN,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const eM=qe.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")}}}),tM=Ut.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",Fe(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()}}}),nM=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}`)})},rM=Ut.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&nM(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(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}}}}),iM=qe.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()}}}),oM={},sM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},lM=[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 aM(t,e){return a.openBlock(),a.createElementBlock("svg",sM,lM)}const cM=be(oM,[["render",aM]]),dM={},uM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},fM=[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 hM(t,e){return a.openBlock(),a.createElementBlock("svg",uM,fM)}const pM=be(dM,[["render",hM]]),mM={},gM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},yM=[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 bM(t,e){return a.openBlock(),a.createElementBlock("svg",gM,yM)}const kM=be(mM,[["render",bM]]),wM={},vM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},xM=[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 EM(t,e){return a.openBlock(),a.createElementBlock("svg",vM,xM)}const CM=be(wM,[["render",EM]]),SM={},_M={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},OM=[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 TM(t,e){return a.openBlock(),a.createElementBlock("svg",_M,OM)}const NM=be(SM,[["render",TM]]),MM={},AM={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},DM=[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 LM(t,e){return a.openBlock(),a.createElementBlock("svg",AM,DM)}const BM=be(MM,[["render",LM]]),$M={},IM={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"},VM=[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
|
|
139
|
+
`},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()}}}),ON=Tt.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]}`,Fe(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=>rc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ys=200,et=function(){};et.prototype.append=function(e){return e.length?(e=et.from(e),!this.length&&e||e.length<Ys&&this.leafAppend(e)||this.length<Ys&&e.leafPrepend(this)||this.appendInner(e)):this},et.prototype.prepend=function(e){return e.length?et.from(e).append(this):this},et.prototype.appendInner=function(e){return new _N(this,e)},et.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},et.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},et.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)},et.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},et.from=function(e){return e instanceof et?e:e&&e.length?new gg(e):et.empty};var gg=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<=Ys)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ys)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(et);et.empty=new gg([]);var _N=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}(et);const TN=500;class nn{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 pn(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 pn(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 nn(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 pn(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>MN&&(l=NN(l,d),s-=d),new nn(l.append(o),s)}remapping(e,n){let r=new Qr;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(n=>new pn(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 pn(m,g,y))}else r.push(new pn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new pn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new nn(u,l);return f.emptyItemCount()>TN&&(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 pn(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 nn(et.from(i.reverse()),o)}}nn.empty=new nn(et.empty,0);function NN(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pn{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 pn(n.getMap().invert(),n,this.selection)}}}class sr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const MN=20;function AN(t,e,n,r){let i=n.getMeta($r),o;if(i)return i.historyState;n.getMeta(BN)&&(t=new sr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta($r))return s.getMeta($r).redo?new sr(t.done.addTransform(n,void 0,r,qs(e)),t.undone,yg(n.mapping.maps),t.prevTime,t.prevComposition):new sr(t.done,t.undone.addTransform(n,void 0,r,qs(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||!DN(n,t.prevRanges)),d=s?xc(t.prevRanges,n.mapping):yg(n.mapping.maps);return new sr(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,qs(e)),nn.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new sr(t.done.rebased(n,o),t.undone.rebased(n,o),xc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new sr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),xc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function DN(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 yg(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 xc(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 LN(t,e,n){let r=qs(e),i=$r.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 sr(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta($r,{redo:n,historyState:c})}let Ec=!1,bg=null;function qs(t){let e=t.plugins;if(bg!=e){Ec=!1,bg=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ec=!0;break}}return Ec}const $r=new It("history"),BN=new It("closeHistory");function $N(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new it({key:$r,state:{init(){return new sr(nn.empty,nn.empty,null,0,-1)},apply(e,n,r){return AN(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?wg:r=="historyRedo"?vg:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function kg(t,e){return(n,r)=>{let i=$r.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=LN(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const wg=kg(!1,!0),vg=kg(!0,!0),IN=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wg(t,e),redo:()=>({state:t,dispatch:e})=>vg(t,e)}},addProseMirrorPlugins(){return[$N(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()}}}),VN=Tt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Fe(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(ke.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,l.pos)):i.setSelection(ke.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(ke.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Cm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),PN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,RN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,FN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jN=Ut.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",Fe(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[hi({find:PN,type:this.type}),hi({find:FN,type:this.type})]},addPasteRules(){return[pi({find:RN,type:this.type}),pi({find:zN,type:this.type})]}}),HN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),WN=Tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),xg=Ut.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Vs(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Eg=/^(\d+)\.\s$/,UN=Tt.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",Fe(this.options.HTMLAttributes,n),0]:["ol",Fe(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(WN.name,this.editor.getAttributes(xg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=po({find:Eg,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=po({find:Eg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),YN=Tt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,KN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,GN=Ut.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",Fe(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[hi({find:qN,type:this.type})]},addPasteRules(){return[pi({find:KN,type:this.type})]}}),JN=Tt.create({name:"text",group:"inline"}),ZN=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,g,y,k;const x=[];return this.options.blockquote!==!1&&x.push(QT.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(iN.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(sN.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(cN.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(fN.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(hN.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(gN.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(CN.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&x.push(SN.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(ON.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(IN.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(VN.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(jN.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(HN.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(UN.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(YN.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(GN.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(JN.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),XN=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new it({key:new It("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=Vt.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}),Ye.create(t,o)}}})]}}),QN=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Tt.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",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Cm({find:QN,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const eM=qe.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")}}}),tM=Ut.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",Fe(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()}}}),nM=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}`)})},rM=Ut.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&nM(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(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}}}}),iM=qe.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()}}}),oM={},sM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},lM=[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 aM(t,e){return a.openBlock(),a.createElementBlock("svg",sM,lM)}const cM=be(oM,[["render",aM]]),dM={},uM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},fM=[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 hM(t,e){return a.openBlock(),a.createElementBlock("svg",uM,fM)}const pM=be(dM,[["render",hM]]),mM={},gM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},yM=[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 bM(t,e){return a.openBlock(),a.createElementBlock("svg",gM,yM)}const kM=be(mM,[["render",bM]]),wM={},vM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},xM=[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 EM(t,e){return a.openBlock(),a.createElementBlock("svg",vM,xM)}const CM=be(wM,[["render",EM]]),SM={},OM={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},_M=[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 TM(t,e){return a.openBlock(),a.createElementBlock("svg",OM,_M)}const NM=be(SM,[["render",TM]]),MM={},AM={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},DM=[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 LM(t,e){return a.openBlock(),a.createElementBlock("svg",AM,DM)}const BM=be(MM,[["render",LM]]),$M={},IM={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"},VM=[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
|
|
140
140
|
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
|
|
141
141
|
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
|
|
142
|
-
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 PM(t,e){return a.openBlock(),a.createElementBlock("svg",IM,VM)}const RM=be($M,[["render",PM]]),FM={},zM={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"},jM=[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 HM(t,e){return a.openBlock(),a.createElementBlock("svg",zM,jM)}const WM=be(FM,[["render",HM]]),UM={},YM={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"},qM=[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 KM(t,e){return a.openBlock(),a.createElementBlock("svg",YM,qM)}const GM=be(UM,[["render",KM]]),JM={},ZM={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"},XM=[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 QM(t,e){return a.openBlock(),a.createElementBlock("svg",ZM,XM)}const eA=be(JM,[["render",QM]]),tA={},nA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},rA=[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 iA(t,e){return a.openBlock(),a.createElementBlock("svg",nA,rA)}const oA=be(tA,[["render",iA]]),sA={},lA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},aA=[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 cA(t,e){return a.openBlock(),a.createElementBlock("svg",lA,aA)}const dA=be(sA,[["render",cA]]),uA={},fA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},hA=[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 pA(t,e){return a.openBlock(),a.createElementBlock("svg",fA,hA)}const mA=be(uA,[["render",pA]]),gA={},yA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},bA=[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 kA(t,e){return a.openBlock(),a.createElementBlock("svg",yA,bA)}const wA=be(gA,[["render",kA]]),vA={},xA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},EA=[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 CA(t,e){return a.openBlock(),a.createElementBlock("svg",xA,EA)}const SA=be(vA,[["render",CA]]),_A={},OA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},TA=[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 NA(t,e){return a.openBlock(),a.createElementBlock("svg",OA,TA)}const MA=be(_A,[["render",NA]]),AA={},DA={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},LA=[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 BA(t,e){return a.openBlock(),a.createElementBlock("svg",DA,LA)}const $A=be(AA,[["render",BA]]),IA={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},VA={class:"flex gap-px"},PA=["onClick"],RA={key:1,class:"text-sm"},FA=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:BM,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:NM,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:SA,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:MA,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:RM,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:WM,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:GM,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:eA,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:oA,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:dA,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:mA,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:wA,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:cM,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:pM,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:kM,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:CM,disableCheck:!0,active:!0}],c=e,d=Z5({content:n.modelValue,extensions:[ZN,tM,iM,rM,eM.configure({types:["heading","paragraph"]}),XN.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,k){return k?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(he).theme]])},[a.createElementVNode("div",IA,[a.createElementVNode("div",VA,[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($A,{class:"w-5 h-5",style:{}}),a.withDirectives(a.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=k=>r.value=k),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(k=>k.active),k=>(a.openBlock(),a.createElementBlock("div",{key:k.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(k.method,k.type,k.params,k.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":k.label.startsWith("h")?a.unref(d).isActive("heading",{level:k.params.level}):k.method==="setTextAlign"?a.unref(d).isActive({textAlign:k.params}):a.unref(d).isActive(k.label)}]),onClick:x=>u(k.method,k.type,k.params)},[k.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(k.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":k.smallIcon,"w-4 h-4":!k.smallIcon&&!k.largeIcon,"w-5 h-5":k.largeIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",RA,a.toDisplayString(a.unref(t1).capitalize(k.label)),1))],10,PA))),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(J5),{editor:a.unref(d)},null,8,["editor"])],4)],2)):a.createCommentVNode("",!0)}}}),zA={},jA={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HA=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function WA(t,e){return a.openBlock(),a.createElementBlock("svg",jA,HA)}const UA=be(zA,[["render",WA]]),YA={},qA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},KA=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function GA(t,e){return a.openBlock(),a.createElementBlock("svg",qA,KA)}const JA=be(YA,[["render",GA]]),ZA={},XA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},QA=[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 e3(t,e){return a.openBlock(),a.createElementBlock("svg",XA,QA)}const t3=be(ZA,[["render",e3]]),n3={class:"flex-1"},r3=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean,info: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-purple-100 border-purple-200 text-purple-700 dark:border-purple-600/30 dark:bg-purple-800/25 dark:text-purple-500/85":t.info,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.info&&!t.success&&!t.warning&&!t.error}])},[t.complete?(a.openBlock(),a.createBlock(UA,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(JA,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(t3,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.createElementVNode("span",n3,[a.renderSlot(e.$slots,"default")])],2))}}),Cc={__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":`
|
|
142
|
+
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 PM(t,e){return a.openBlock(),a.createElementBlock("svg",IM,VM)}const RM=be($M,[["render",PM]]),FM={},zM={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"},jM=[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 HM(t,e){return a.openBlock(),a.createElementBlock("svg",zM,jM)}const WM=be(FM,[["render",HM]]),UM={},YM={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"},qM=[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 KM(t,e){return a.openBlock(),a.createElementBlock("svg",YM,qM)}const GM=be(UM,[["render",KM]]),JM={},ZM={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"},XM=[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 QM(t,e){return a.openBlock(),a.createElementBlock("svg",ZM,XM)}const eA=be(JM,[["render",QM]]),tA={},nA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},rA=[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 iA(t,e){return a.openBlock(),a.createElementBlock("svg",nA,rA)}const oA=be(tA,[["render",iA]]),sA={},lA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},aA=[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 cA(t,e){return a.openBlock(),a.createElementBlock("svg",lA,aA)}const dA=be(sA,[["render",cA]]),uA={},fA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},hA=[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 pA(t,e){return a.openBlock(),a.createElementBlock("svg",fA,hA)}const mA=be(uA,[["render",pA]]),gA={},yA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},bA=[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 kA(t,e){return a.openBlock(),a.createElementBlock("svg",yA,bA)}const wA=be(gA,[["render",kA]]),vA={},xA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},EA=[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 CA(t,e){return a.openBlock(),a.createElementBlock("svg",xA,EA)}const SA=be(vA,[["render",CA]]),OA={},_A={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},TA=[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 NA(t,e){return a.openBlock(),a.createElementBlock("svg",_A,TA)}const MA=be(OA,[["render",NA]]),AA={},DA={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},LA=[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 BA(t,e){return a.openBlock(),a.createElementBlock("svg",DA,LA)}const $A=be(AA,[["render",BA]]),IA={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},VA={class:"flex gap-px"},PA=["onClick"],RA={key:1,class:"text-sm"},FA=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:BM,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:NM,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:SA,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:MA,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:RM,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:WM,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:GM,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:eA,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:oA,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:dA,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:mA,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:wA,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:cM,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:pM,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:kM,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:CM,disableCheck:!0,active:!0}],c=e,d=ZT({content:n.modelValue,extensions:[ZN,tM,iM,rM,eM.configure({types:["heading","paragraph"]}),XN.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,k){return k?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(he).theme]])},[a.createElementVNode("div",IA,[a.createElementVNode("div",VA,[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($A,{class:"w-5 h-5",style:{}}),a.withDirectives(a.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=k=>r.value=k),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(k=>k.active),k=>(a.openBlock(),a.createElementBlock("div",{key:k.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(k.method,k.type,k.params,k.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":k.label.startsWith("h")?a.unref(d).isActive("heading",{level:k.params.level}):k.method==="setTextAlign"?a.unref(d).isActive({textAlign:k.params}):a.unref(d).isActive(k.label)}]),onClick:x=>u(k.method,k.type,k.params)},[k.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(k.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":k.smallIcon,"w-4 h-4":!k.smallIcon&&!k.largeIcon,"w-5 h-5":k.largeIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",RA,a.toDisplayString(a.unref(t1).capitalize(k.label)),1))],10,PA))),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(JT),{editor:a.unref(d)},null,8,["editor"])],4)],2)):a.createCommentVNode("",!0)}}}),zA={},jA={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HA=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function WA(t,e){return a.openBlock(),a.createElementBlock("svg",jA,HA)}const UA=be(zA,[["render",WA]]),YA={},qA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},KA=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function GA(t,e){return a.openBlock(),a.createElementBlock("svg",qA,KA)}const JA=be(YA,[["render",GA]]),ZA={},XA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},QA=[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 e3(t,e){return a.openBlock(),a.createElementBlock("svg",XA,QA)}const t3=be(ZA,[["render",e3]]),n3={class:"flex-1"},r3=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean,info: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-purple-100 border-purple-200 text-purple-700 dark:border-purple-600/30 dark:bg-purple-800/25 dark:text-purple-500/85":t.info,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.info&&!t.success&&!t.warning&&!t.error}])},[t.complete?(a.openBlock(),a.createBlock(UA,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(JA,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(t3,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.createElementVNode("span",n3,[a.renderSlot(e.$slots,"default")])],2))}}),Cc={__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":`
|
|
143
143
|
hover:text-lime-500
|
|
144
144
|
rounded-full
|
|
145
145
|
|
|
@@ -152,4 +152,4 @@ img.ProseMirror-separator {
|
|
|
152
152
|
group-[.is-off]:text-gray-300
|
|
153
153
|
dark:group-[.is-off]:text-gray-800
|
|
154
154
|
|
|
155
|
-
`},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(he).theme]}`]:t.between,[`${i[a.unref(he).theme]}`]:t.firstDay,[`${o[a.unref(he).theme]}`]:t.lastDay,[`${s[a.unref(he).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(he).theme]}`]:!0,[`${n[a.unref(he).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 xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _c={exports:{}},Cg;function Ks(){return Cg||(Cg=1,function(t,e){(function(n,r){t.exports=r()})(xi,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+)?$/,k=/\[([^\]]+)]|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,x={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(z){var D=["th","st","nd","rd"],C=z%100;return"["+z+(D[(C-20)%10]||D[C]||D[0])+"]"}},w=function(z,D,C){var I=String(z);return!I||I.length>=D?z:""+Array(D+1-I.length).join(C)+z},b={s:w,z:function(z){var D=-z.utcOffset(),C=Math.abs(D),I=Math.floor(C/60),R=C%60;return(D<=0?"+":"-")+w(I,2,"0")+":"+w(R,2,"0")},m:function z(D,C){if(D.date()<C.date())return-z(C,D);var I=12*(C.year()-D.year())+(C.month()-D.month()),R=D.clone().add(I,f),ee=C-R<0,te=D.clone().add(I+(ee?-1:1),f);return+(-(I+(C-R)/(ee?R-te:te-R))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},S="en",v={};v[S]=x;var O="$isDayjsObject",B=function(z){return z instanceof L||!(!z||!z[O])},A=function z(D,C,I){var R;if(!D)return S;if(typeof D=="string"){var ee=D.toLowerCase();v[ee]&&(R=ee),C&&(v[ee]=C,R=ee);var te=D.split("-");if(!R&&te.length>1)return z(te[0])}else{var ce=D.name;v[ce]=D,R=ce}return!I&&R&&(S=R),R||!I&&S},P=function(z,D){if(B(z))return z.clone();var C=typeof D=="object"?D:{};return C.date=z,C.args=arguments,new L(C)},$=b;$.l=A,$.i=B,$.w=function(z,D){return P(z,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var L=function(){function z(C){this.$L=A(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[O]=!0}var D=z.prototype;return D.parse=function(C){this.$d=function(I){var R=I.date,ee=I.utc;if(R===null)return new Date(NaN);if($.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var te=R.match(y);if(te){var ce=te[2]-1||0,ue=(te[7]||"0").substring(0,3);return ee?new Date(Date.UTC(te[1],ce,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)):new Date(te[1],ce,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)}}return new Date(R)}(C),this.init()},D.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()},D.$utils=function(){return $},D.isValid=function(){return this.$d.toString()!==g},D.isSame=function(C,I){var R=P(C);return this.startOf(I)<=R&&R<=this.endOf(I)},D.isAfter=function(C,I){return P(C)<this.startOf(I)},D.isBefore=function(C,I){return this.endOf(I)<P(C)},D.$g=function(C,I,R){return $.u(C)?this[I]:this.set(R,C)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(C,I){var R=this,ee=!!$.u(I)||I,te=$.p(C),ce=function(ae,we){var Ne=$.w(R.$u?Date.UTC(R.$y,we,ae):new Date(R.$y,we,ae),R);return ee?Ne:Ne.endOf(d)},ue=function(ae,we){return $.w(R.toDate()[ae].apply(R.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(we)),R)},V=this.$W,W=this.$M,K=this.$D,q="set"+(this.$u?"UTC":"");switch(te){case p:return ee?ce(1,0):ce(31,11);case f:return ee?ce(1,W):ce(0,W+1);case u:var H=this.$locale().weekStart||0,de=(V<H?V+7:V)-H;return ce(ee?K-de:K+(6-de),W);case d:case m:return ue(q+"Hours",0);case c:return ue(q+"Minutes",1);case l:return ue(q+"Seconds",2);case s:return ue(q+"Milliseconds",3);default:return this.clone()}},D.endOf=function(C){return this.startOf(C,!1)},D.$set=function(C,I){var R,ee=$.p(C),te="set"+(this.$u?"UTC":""),ce=(R={},R[d]=te+"Date",R[m]=te+"Date",R[f]=te+"Month",R[p]=te+"FullYear",R[c]=te+"Hours",R[l]=te+"Minutes",R[s]=te+"Seconds",R[o]=te+"Milliseconds",R)[ee],ue=ee===d?this.$D+(I-this.$W):I;if(ee===f||ee===p){var V=this.clone().set(m,1);V.$d[ce](ue),V.init(),this.$d=V.set(m,Math.min(this.$D,V.daysInMonth())).$d}else ce&&this.$d[ce](ue);return this.init(),this},D.set=function(C,I){return this.clone().$set(C,I)},D.get=function(C){return this[$.p(C)]()},D.add=function(C,I){var R,ee=this;C=Number(C);var te=$.p(I),ce=function(W){var K=P(ee);return $.w(K.date(K.date()+Math.round(W*C)),ee)};if(te===f)return this.set(f,this.$M+C);if(te===p)return this.set(p,this.$y+C);if(te===d)return ce(1);if(te===u)return ce(7);var ue=(R={},R[l]=r,R[c]=i,R[s]=n,R)[te]||1,V=this.$d.getTime()+C*ue;return $.w(V,this)},D.subtract=function(C,I){return this.add(-1*C,I)},D.format=function(C){var I=this,R=this.$locale();if(!this.isValid())return R.invalidDate||g;var ee=C||"YYYY-MM-DDTHH:mm:ssZ",te=$.z(this),ce=this.$H,ue=this.$m,V=this.$M,W=R.weekdays,K=R.months,q=R.meridiem,H=function(we,Ne,Ie,tt){return we&&(we[Ne]||we(I,ee))||Ie[Ne].slice(0,tt)},de=function(we){return $.s(ce%12||12,we,"0")},ae=q||function(we,Ne,Ie){var tt=we<12?"AM":"PM";return Ie?tt.toLowerCase():tt};return ee.replace(k,function(we,Ne){return Ne||function(Ie){switch(Ie){case"YY":return String(I.$y).slice(-2);case"YYYY":return $.s(I.$y,4,"0");case"M":return V+1;case"MM":return $.s(V+1,2,"0");case"MMM":return H(R.monthsShort,V,K,3);case"MMMM":return H(K,V);case"D":return I.$D;case"DD":return $.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return H(R.weekdaysMin,I.$W,W,2);case"ddd":return H(R.weekdaysShort,I.$W,W,3);case"dddd":return W[I.$W];case"H":return String(ce);case"HH":return $.s(ce,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return ae(ce,ue,!0);case"A":return ae(ce,ue,!1);case"m":return String(ue);case"mm":return $.s(ue,2,"0");case"s":return String(I.$s);case"ss":return $.s(I.$s,2,"0");case"SSS":return $.s(I.$ms,3,"0");case"Z":return te}return null}(we)||te.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(C,I,R){var ee,te=this,ce=$.p(I),ue=P(C),V=(ue.utcOffset()-this.utcOffset())*r,W=this-ue,K=function(){return $.m(te,ue)};switch(ce){case p:ee=K()/12;break;case f:ee=K();break;case h:ee=K()/3;break;case u:ee=(W-V)/6048e5;break;case d:ee=(W-V)/864e5;break;case c:ee=W/i;break;case l:ee=W/r;break;case s:ee=W/n;break;default:ee=W}return R?ee:$.a(ee)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return v[this.$L]},D.locale=function(C,I){if(!C)return this.$L;var R=this.clone(),ee=A(C,I,!0);return ee&&(R.$L=ee),R},D.clone=function(){return $.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},z}(),j=L.prototype;return P.prototype=j,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(z){j[z[1]]=function(D){return this.$g(D,z[0],z[1])}}),P.extend=function(z,D){return z.$i||(z(D,L,P),z.$i=!0),P},P.locale=A,P.isDayjs=B,P.unix=function(z){return P(1e3*z)},P.en=v[S],P.Ls=v,P.p={},P})}(_c)),_c.exports}var i3=Ks();const G=Sc(i3);var o3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var c=100*s+l;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o})})(o3);var s3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s){return s+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(s){return s<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return i.default.locale(o,null,!0),o})})(s3);var l3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(s){return s+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(s){return s<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return i.default.locale(o,null,!0),o})})(l3);var Sg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(xi,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)}}})})(Sg);var a3=Sg.exports;const c3=Sc(a3);var _g={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(xi,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))}}})})(_g);var d3=_g.exports;const u3=Sc(d3),f3={class:"w-full dark:text-gray-400"},h3={class:"flex justify-between items-center mb-3"},p3={class:"flex"},m3={class:"font-medium flex items-center gap-2"},g3=["value","onChange"],y3=["value"],b3=["value","onChange"],k3=["value"],w3={class:"flex"},v3={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},Oc=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:G().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=zn();G.extend(u3),G.extend(c3);const r=t,i=a.computed(()=>Array.from({length:7},(W,K)=>G().day((1+K)%7).locale(n.value).format("ddd"))),o=a.ref([G(new Date).subtract(1,"month"),G(new Date)]);a.watch(()=>r.initDates,()=>{var V;if(!r.range&&r.initDates)o.value[0]=G(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=G(new Date);else if(r.range&&((V=r.initDates)==null?void 0:V.length)===2){let W=G(r.initDates[0]),K=G(r.initDates[1]);K.isBefore(W,"month")&&(K=W.add(1,"month")),W.isSame(K,"month")&&(K=W.add(1,"month")),o.value=[W,K]}},{immediate:!0,once:!0}),a.watch(()=>[r.displayYearStart,r.displayMonthStart],([V,W])=>{V&&W&&(o.value[0]=G().year(Number(V)).month(Number(W)).startOf("month"),o.value[1]=G().year(Number(V)).month(Number(W)).startOf("month").add(1,"month"))},{immediate:!0}),a.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([V,W])=>{if(V&&W){const K=o.value[0],q=G().year(Number(V)).month(Number(W)).startOf("month");q.isAfter(K,"month")&&(o.value[1]=q)}},{immediate:!0});const s=e,l=a.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(V){if(r.week)s("update:modelValue",[G(V).startOf("week"),G(V).endOf("week")]);else if(r.range){const W=r.modelValue.filter(K=>K).length;if(W==0)s("update:modelValue",[V]);else if(W==2)s("update:modelValue",[V]);else if(W==1){let K=[G(r.modelValue[0]),G(V)];K=K.sort((q,H)=>q-H),s("update:modelValue",K)}}else s("update:modelValue",G(V))}function d(V){const W=G(V).daysInMonth(),K=[],q=G(V).startOf("month");for(let H=1;H<=W;H++){let de=q.clone().date(H);K.push(de)}return K}function u(V){return G(V).startOf("month").day()}function f(V,W){const K=G(`${V}-${W}-01`,"YYYY-MM-DD"),H=K.day(),de=[];for(let ae=0;ae<H;ae++)de.push(K.clone().subtract(H-ae,"days"));return de}function h(V,W){const K=G(`${V}-${W}`,"YYYY-MM").endOf("month"),H=6-K.day(),de=[];for(let ae=1;ae<=H;ae++)de.push(K.clone().add(ae,"days"));return de}function p(V){const W=G();return G(V).isSame(W,"day")}function m(V){var W,K;if(r.range){if(((W=r.modelValue)==null?void 0:W.length)==1)return G(V).isSame(G(r.modelValue[0]),"day");if(((K=r.modelValue)==null?void 0:K.length)==2)return G(V).isSame(G(r.modelValue[0]),"day")||G(V).isSame(G(r.modelValue[1]),"day")}else if(r.modelValue)return G(V).isSame(G(r.modelValue),"day")}function g(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isBetween(G(r.modelValue[0]),G(r.modelValue[1]))}function y(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isSame(G(r.modelValue[0]),"day")}function k(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isSame(G(r.modelValue[1]),"day")}function x(V){try{return r.minDate?G(V).isBefore(G(r.minDate)):!1}catch(W){return console.log(W),!1}}function w(V){try{return r.maxDate?G(V).isAfter(G(r.maxDate)):!1}catch(W){return console.log(W),!1}}function b(V){L(V,o.value[V].subtract(1,"month"))}function S(V){L(V,o.value[V].add(1,"month"))}function v(V){L(V,o.value[V].subtract(1,"year"))}function O(V){L(V,o.value[V].add(1,"year"))}const B=V=>l.value.length===1||V===0?!0:o.value[V].subtract(1,"month").isAfter(o.value[0],"month"),A=V=>l.value.length===1||V===1?!0:o.value[V].add(1,"month").isBefore(o.value[1],"month"),P=V=>l.value.length===1||V===0?!0:o.value[V].subtract(1,"year").isAfter(o.value[0],"year"),$=V=>l.value.length===1||V===1?!0:o.value[V].add(1,"year").isBefore(o.value[1],"year");function L(V,W){if(V===0){if(!l.value.length===1&&!W.isBefore(o.value[1],"month"))return;o.value=[W,o.value[1]]}else{if(!l.value.length===1&&!W.isAfter(o.value[0],"month"))return;(W.isBefore(o.value[0],"month")||W.isSame(o.value[0],"month"))&&(W=o.value[0].add(1,"month")),o.value=[o.value[0],W]}}const j=a.ref();function z(V){r.week&&(j.value=G(V).week())}function D(V){return G(V).week()===j.value}function C(V){return G(V).week()===j.value?G(V).format("YYYY-MM-DD")===G().week(j.value).startOf("week").format("YYYY-MM-DD"):!1}function I(V){return G(V).week()===j.value?G(V).format("YYYY-MM-DD")===G().week(j.value).endOf("week").format("YYYY-MM-DD"):!1}function R(){j.value=null}function ee(V,W){const K=o.value[V].year(Number(W));L(V,K)}function te(V,W){const K=o.value[V].month(Number(W));L(V,K)}const ce=a.computed(()=>{const V=r.defaultMinYear,W=r.defaultMaxYear,K=[];for(let q=V;q<=W;q++)K.push(q);return K}),ue=a.computed(()=>Array.from({length:12},(V,W)=>G().month(W).locale(n.value).format("MMMM")));return(V,W)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":l.value.length===1,"min-w-192":l.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,K=>{var q;return a.openBlock(),a.createElementBlock("div",f3,[a.createElementVNode("div",h3,[a.createElementVNode("div",p3,[a.createVNode(Af,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!P(K),"hover:opacity-100":P(K)}]),onClick:H=>P(K)?v(K):null},null,8,["class","onClick"]),a.createVNode(Df,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!B(K),"hover:opacity-100":B(K)}]),onClick:H=>B(K)?b(K):null},null,8,["class","onClick"])]),a.createElementVNode("div",m3,[a.createElementVNode("select",{value:o.value[K].format("YYYY"),onChange:H=>ee(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ce.value,H=>(a.openBlock(),a.createElementBlock("option",{key:H,value:H},a.toDisplayString(H),9,y3))),128))],40,g3),a.createElementVNode("select",{value:o.value[K].month(),onChange:H=>te(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ue.value,(H,de)=>(a.openBlock(),a.createElementBlock("option",{key:de,value:de},a.toDisplayString(H),9,k3))),128))],40,b3)]),a.createElementVNode("div",w3,[a.createVNode(Bf,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!A(K),"hover:opacity-100":A(K)}]),onClick:H=>A(K)?S(K):null},null,8,["class","onClick"]),a.createVNode(Lf,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(K),"hover:opacity-100":$(K)}]),onClick:H=>$(K)?O(K):null},null,8,["class","onClick"])])]),a.createElementVNode("div",v3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(H,de)=>(a.openBlock(),a.createElementBlock("div",{key:de,class:"flex justify-center text-sm"},a.toDisplayString(H),1))),128))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:R},[u(o.value[K])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(f(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1),H=>(a.openBlock(),a.createBlock(Cc,{onClick:de=>!w(H)&&!x(H)?c(H):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d(o.value[K].clone()),H=>(a.openBlock(),a.createBlock(Cc,{onMouseover:de=>z(H),onClick:de=>!w(H)&&!x(H)?c(H):null,today:p(H),selected:m(H),firstDay:y(H)||C(H),lastDay:k(H)||I(H),between:g(H),disabled:w(H)||x(H),off:w(H)||x(H),highlight:D(H)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((q=h(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1))==null?void 0:q.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(h(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1),H=>(a.openBlock(),a.createBlock(Cc,{onClick:de=>!w(H)&&!x(H)?c(H):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),x3={},E3={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},C3=[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 S3(t,e){return a.openBlock(),a.createElementBlock("svg",E3,C3)}const Og=be(x3,[["render",S3]]),_3={},O3={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},T3=[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 N3(t,e){return a.openBlock(),a.createElementBlock("svg",O3,T3)}const Tg=be(_3,[["render",N3]]),M3={class:"flex gap-3"},A3={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},D3=["onClick"],L3=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{t:n}=zn(),r=t,i=a.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder),o=e;function s(d){o("update:modelValue",d)}const l=a.computed(()=>{var d;if(r.range)return(d=r.modelValue)==null?void 0:d.map(u=>G(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return G(r.modelValue).format("YYYY-MM-DD")}),c=a.reactive([{text:a.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("month");o("update:modelValue",[f,u])}},{text:a.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=G().startOf("month").subtract(1,"month"),f=G(u).endOf("month");o("update:modelValue",[u,f])}},{text:a.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(a.openBlock(),a.createBlock(fr,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",M3,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",A3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c,f=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:h=>f.onClick()},a.toDisplayString(f.text),9,D3))),256))])):a.createCommentVNode("",!0),a.createVNode(Oc,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":s,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>{var f;return[a.createVNode(zi,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((f=l.value)!=null&&f.length)),onOnClear:u[0]||(u[0]=h=>s(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Og,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Tg,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(l.value||i.value),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),B3={class:"relative inline-block tabular-nums"},$3=["value","placeholder","maxlength"],Tc={__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",B3,[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,$3)]))}},I3={class:"flex items-center gap-0"},V3=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),P3=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),Nc={__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,k=>{n.range?Array.isArray(k)&&k.length===2?(yearStart.value=k[0]?G(k[0]).format("YYYY"):"",monthStart.value=k[0]?G(k[0]).format("MM"):"",dayStart.value=k[0]?G(k[0]).format("DD"):"",yearEnd.value=k[1]?G(k[1]).format("YYYY"):"",monthEnd.value=k[1]?G(k[1]).format("MM"):"",dayEnd.value=k[1]?G(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=G(k).format("YYYY"),o.value=G(k).format("MM"),s.value=G(k).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(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=G().format("YYYY")),u()}function g(){o.value||(o.value=G().format("MM")),u()}function y(){s.value||(s.value=G().format("DD")),u()}return(k,x)=>(a.openBlock(),a.createElementBlock("div",I3,[a.createVNode(Tc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=w=>i.value=w),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),V3,a.createVNode(Tc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=w=>o.value=w),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),P3,a.createVNode(Tc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=w=>s.value=w),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},R3={class:"tabular-nums"},F3={key:1,class:"flex items-center"},z3=a.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),j3={class:"flex gap-3"},H3={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},W3=["onClick"],U3=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{t:n}=zn(),r=t,i=e,o=a.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder);a.ref(!1);const s=a.ref(G().year()),l=a.ref(G().month()),c=a.ref(null),d=a.ref(null);function u(){i("update:modelValue",null)}a.watch(()=>r.initDates,m=>{var g;r.range&&((g=r.initDates)==null?void 0:g.length)==2?(s.value=G(r.initDates[0]).year(),l.value=G(r.initDates[0]).month(),c.value=G(r.initDates[1]).year(),d.value=G(r.initDates[1]).month()):r.initDates&&(s.value=G(r.initDates).year(),l.value=G(r.initDates).month())},{immediate:!0});const f=a.ref(r.range?[]:"");a.watch(()=>r.modelValue,m=>{if(r.range){const g=m!=null&&m[0]?G(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?G(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?G(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),a.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?G(m[0]).toDate():null,x=m[1]&&m[1].length===10?G(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=G(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=a.reactive([{text:a.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("month");i("update:modelValue",[y,g])}},{text:a.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=G().startOf("month").subtract(1,"month"),y=G(g).endOf("month");i("update:modelValue",[g,y])}},{text:a.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(a.openBlock(),a.createBlock(fr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:a.withCtx(()=>[a.createElementVNode("div",j3,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",H3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(p,y=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:k=>y.onClick()},a.toDisplayString(y.text),9,W3))),256))])):a.createCommentVNode("",!0),a.createVNode(Oc,{doubleMonths:t.doubleMonths,displayYearStart:s.value,displayMonthStart:l.value,displayYearEnd:c.value,displayMonthEnd:d.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:r.range?[...f.value]:f.value,"onUpdate:modelValue":h,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(zi,{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:u},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Og,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Tg,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createElementVNode("div",R3,[t.range?t.range?(a.openBlock(),a.createElementBlock("div",F3,[a.createVNode(Nc,{modelValue:f.value[0],"onUpdate:modelValue":g[3]||(g[3]=y=>f.value[0]=y),disabled:t.disabled,"onUpdate:displayYear":g[4]||(g[4]=y=>s.value=y),"onUpdate:displayMonth":g[5]||(g[5]=y=>l.value=y)},null,8,["modelValue","disabled"]),z3,a.createVNode(Nc,{modelValue:f.value[1],"onUpdate:modelValue":g[6]||(g[6]=y=>f.value[1]=y),disabled:t.disabled,"onUpdate:displayYear":g[7]||(g[7]=y=>{c.value=y}),"onUpdate:displayMonth":g[8]||(g[8]=y=>{d.value=y})},null,8,["modelValue","disabled"])])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(o.value),1)],64)):(a.openBlock(),a.createBlock(Nc,{key:0,modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=y=>f.value=y),disabled:t.disabled,"onUpdate:displayYear":g[1]||(g[1]=y=>s.value=y),"onUpdate:displayMonth":g[2]||(g[2]=y=>l.value=y)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),Y3=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/10 dark:bg-black/50 backdrop-blur-md 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(he).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))}}),q3={class:"absolute inset-0 flex items-center justify-center py-12"},K3={class:"text-lg font-medium dark:text-gray-300"},G3={key:0,class:"flex justify-end px-6 pb-4"},J3=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean,blur: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",q3,[a.createElementVNode("div",{class:a.normalizeClass(["absolute transition-opacity inset-0 bg-black/10 dark:bg-black/50 z-10",{"backdrop-blur-md":t.blur}]),onClick:o},null,2),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",K3,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode($i,{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",G3,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),Z3=["onClick"],X3=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,Z3))),128))],2),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),Q3=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)}}),eD={},tD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},nD=[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 rD(t,e){return a.openBlock(),a.createElementBlock("svg",tD,nD)}const iD=be(eD,[["render",rD]]),oD={},sD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},lD=[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 aD(t,e){return a.openBlock(),a.createElementBlock("svg",sD,lD)}const cD=be(oD,[["render",aD]]),dD={},uD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},fD=[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 hD(t,e){return a.openBlock(),a.createElementBlock("svg",uD,fD)}const pD=be(dD,[["render",hD]]),mD={},gD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yD=[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 bD(t,e){return a.openBlock(),a.createElementBlock("svg",gD,yD)}const kD=be(mD,[["render",bD]]),wD={key:0,class:"w-6 opacity-50"},vD={class:"flex-1"},xD={key:0,class:"mb-2"},ED=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",wD,[t.warning?(a.openBlock(),a.createBlock(iD,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock(cD,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(pD,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(kD,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",vD,[t.title?(a.openBlock(),a.createElementBlock("div",xD,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))}}),Mc=a.ref(!1),Ng=a.ref(""),Mg=a.ref(""),Ag=a.ref(!1),Dg=a.ref(!1),Lg=a.ref(!1);let Bg=()=>{},$g=()=>{};function Ac(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{Ng.value=i,Mg.value=o,Ag.value=s,Dg.value=l,Lg.value=u,Bg=c||(()=>{}),$g=d||(()=>{}),Mc.value=!0},e=()=>{Mc.value=!1};return{visible:Mc,title:Ng,text:Mg,positive:Ag,negative:Dg,show:t,onConfirm:()=>{Bg(),e()},onCancel:()=>{$g(),e()},blur:Lg}}const CD={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},SD={class:"text-lg font-semibold mb-6"},_D={class:"mb-12"},OD={class:"flex justify-end"},Dc={WpicColorPicker:Tf,WpicAlert:ED,WpicToggleSwitch:_f,WpicAdvDateField:U3,WpicCalendar:Oc,WpicTextarea:Of,WpicDialog:J3,WpicSlidePanel:Y3,WpicDateField:L3,WpicFormInput:zi,WpicButton:Ni,WpicBadge:r3,WpicTextEditor:FA,WpicInputGroup:fy,WpicButtonGroup:ay,WpicForm:hy,WpicFormField:Nf,WpicSpinner:Fr,WpicTooltip:Mf,WpicPopover:fr,WpicChoiceList:Sf,WpicCard:gx,WpicCardSection:kx,WpicProgressBar:xx,WpicTag:Cx,WpicTagGroup:Sx,WpicPagination:Zx,WpicLoadingPanel:Nx,WpicTable:ME,WpicTableColumn:AE,WpicTabs:X3,WpicTabPane:Q3,WpicConfirm:be(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l,blur:c}=Ac();return(d,u)=>a.unref(e)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["z-40 fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black/10 dark:bg-black/50 transition-opacity",{"backdrop-blur-md":a.unref(c)}])},[a.createElementVNode("div",CD,[a.createElementVNode("div",SD,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",_D,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",OD,[a.createVNode(Ni,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.$t("wpiccomponents.cancel")),1)]),_:1},8,["onClick"]),a.createVNode(Ni,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.$t("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};function Ig(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Ig(t[n],e[n]):t[n]=e[n])}const TD={useConfirm:Ac};function ND(t,e){Ig(he,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const MD={install:ND,composables:TD,options:he};ct.default=MD,ct.useConfirm=Ac,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
155
|
+
`},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(he).theme]}`]:t.between,[`${i[a.unref(he).theme]}`]:t.firstDay,[`${o[a.unref(he).theme]}`]:t.lastDay,[`${s[a.unref(he).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(he).theme]}`]:!0,[`${n[a.unref(he).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 xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Oc={exports:{}},Cg;function Ks(){return Cg||(Cg=1,function(t,e){(function(n,r){t.exports=r()})(xi,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+)?$/,k=/\[([^\]]+)]|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,x={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(z){var D=["th","st","nd","rd"],C=z%100;return"["+z+(D[(C-20)%10]||D[C]||D[0])+"]"}},w=function(z,D,C){var I=String(z);return!I||I.length>=D?z:""+Array(D+1-I.length).join(C)+z},b={s:w,z:function(z){var D=-z.utcOffset(),C=Math.abs(D),I=Math.floor(C/60),R=C%60;return(D<=0?"+":"-")+w(I,2,"0")+":"+w(R,2,"0")},m:function z(D,C){if(D.date()<C.date())return-z(C,D);var I=12*(C.year()-D.year())+(C.month()-D.month()),R=D.clone().add(I,f),ee=C-R<0,te=D.clone().add(I+(ee?-1:1),f);return+(-(I+(C-R)/(ee?R-te:te-R))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},S="en",v={};v[S]=x;var _="$isDayjsObject",B=function(z){return z instanceof L||!(!z||!z[_])},A=function z(D,C,I){var R;if(!D)return S;if(typeof D=="string"){var ee=D.toLowerCase();v[ee]&&(R=ee),C&&(v[ee]=C,R=ee);var te=D.split("-");if(!R&&te.length>1)return z(te[0])}else{var ce=D.name;v[ce]=D,R=ce}return!I&&R&&(S=R),R||!I&&S},P=function(z,D){if(B(z))return z.clone();var C=typeof D=="object"?D:{};return C.date=z,C.args=arguments,new L(C)},$=b;$.l=A,$.i=B,$.w=function(z,D){return P(z,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var L=function(){function z(C){this.$L=A(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[_]=!0}var D=z.prototype;return D.parse=function(C){this.$d=function(I){var R=I.date,ee=I.utc;if(R===null)return new Date(NaN);if($.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var te=R.match(y);if(te){var ce=te[2]-1||0,ue=(te[7]||"0").substring(0,3);return ee?new Date(Date.UTC(te[1],ce,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)):new Date(te[1],ce,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)}}return new Date(R)}(C),this.init()},D.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()},D.$utils=function(){return $},D.isValid=function(){return this.$d.toString()!==g},D.isSame=function(C,I){var R=P(C);return this.startOf(I)<=R&&R<=this.endOf(I)},D.isAfter=function(C,I){return P(C)<this.startOf(I)},D.isBefore=function(C,I){return this.endOf(I)<P(C)},D.$g=function(C,I,R){return $.u(C)?this[I]:this.set(R,C)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(C,I){var R=this,ee=!!$.u(I)||I,te=$.p(C),ce=function(ae,we){var Ne=$.w(R.$u?Date.UTC(R.$y,we,ae):new Date(R.$y,we,ae),R);return ee?Ne:Ne.endOf(d)},ue=function(ae,we){return $.w(R.toDate()[ae].apply(R.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(we)),R)},V=this.$W,W=this.$M,K=this.$D,q="set"+(this.$u?"UTC":"");switch(te){case p:return ee?ce(1,0):ce(31,11);case f:return ee?ce(1,W):ce(0,W+1);case u:var H=this.$locale().weekStart||0,de=(V<H?V+7:V)-H;return ce(ee?K-de:K+(6-de),W);case d:case m:return ue(q+"Hours",0);case c:return ue(q+"Minutes",1);case l:return ue(q+"Seconds",2);case s:return ue(q+"Milliseconds",3);default:return this.clone()}},D.endOf=function(C){return this.startOf(C,!1)},D.$set=function(C,I){var R,ee=$.p(C),te="set"+(this.$u?"UTC":""),ce=(R={},R[d]=te+"Date",R[m]=te+"Date",R[f]=te+"Month",R[p]=te+"FullYear",R[c]=te+"Hours",R[l]=te+"Minutes",R[s]=te+"Seconds",R[o]=te+"Milliseconds",R)[ee],ue=ee===d?this.$D+(I-this.$W):I;if(ee===f||ee===p){var V=this.clone().set(m,1);V.$d[ce](ue),V.init(),this.$d=V.set(m,Math.min(this.$D,V.daysInMonth())).$d}else ce&&this.$d[ce](ue);return this.init(),this},D.set=function(C,I){return this.clone().$set(C,I)},D.get=function(C){return this[$.p(C)]()},D.add=function(C,I){var R,ee=this;C=Number(C);var te=$.p(I),ce=function(W){var K=P(ee);return $.w(K.date(K.date()+Math.round(W*C)),ee)};if(te===f)return this.set(f,this.$M+C);if(te===p)return this.set(p,this.$y+C);if(te===d)return ce(1);if(te===u)return ce(7);var ue=(R={},R[l]=r,R[c]=i,R[s]=n,R)[te]||1,V=this.$d.getTime()+C*ue;return $.w(V,this)},D.subtract=function(C,I){return this.add(-1*C,I)},D.format=function(C){var I=this,R=this.$locale();if(!this.isValid())return R.invalidDate||g;var ee=C||"YYYY-MM-DDTHH:mm:ssZ",te=$.z(this),ce=this.$H,ue=this.$m,V=this.$M,W=R.weekdays,K=R.months,q=R.meridiem,H=function(we,Ne,Ie,tt){return we&&(we[Ne]||we(I,ee))||Ie[Ne].slice(0,tt)},de=function(we){return $.s(ce%12||12,we,"0")},ae=q||function(we,Ne,Ie){var tt=we<12?"AM":"PM";return Ie?tt.toLowerCase():tt};return ee.replace(k,function(we,Ne){return Ne||function(Ie){switch(Ie){case"YY":return String(I.$y).slice(-2);case"YYYY":return $.s(I.$y,4,"0");case"M":return V+1;case"MM":return $.s(V+1,2,"0");case"MMM":return H(R.monthsShort,V,K,3);case"MMMM":return H(K,V);case"D":return I.$D;case"DD":return $.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return H(R.weekdaysMin,I.$W,W,2);case"ddd":return H(R.weekdaysShort,I.$W,W,3);case"dddd":return W[I.$W];case"H":return String(ce);case"HH":return $.s(ce,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return ae(ce,ue,!0);case"A":return ae(ce,ue,!1);case"m":return String(ue);case"mm":return $.s(ue,2,"0");case"s":return String(I.$s);case"ss":return $.s(I.$s,2,"0");case"SSS":return $.s(I.$ms,3,"0");case"Z":return te}return null}(we)||te.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(C,I,R){var ee,te=this,ce=$.p(I),ue=P(C),V=(ue.utcOffset()-this.utcOffset())*r,W=this-ue,K=function(){return $.m(te,ue)};switch(ce){case p:ee=K()/12;break;case f:ee=K();break;case h:ee=K()/3;break;case u:ee=(W-V)/6048e5;break;case d:ee=(W-V)/864e5;break;case c:ee=W/i;break;case l:ee=W/r;break;case s:ee=W/n;break;default:ee=W}return R?ee:$.a(ee)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return v[this.$L]},D.locale=function(C,I){if(!C)return this.$L;var R=this.clone(),ee=A(C,I,!0);return ee&&(R.$L=ee),R},D.clone=function(){return $.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},z}(),j=L.prototype;return P.prototype=j,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(z){j[z[1]]=function(D){return this.$g(D,z[0],z[1])}}),P.extend=function(z,D){return z.$i||(z(D,L,P),z.$i=!0),P},P.locale=A,P.isDayjs=B,P.unix=function(z){return P(1e3*z)},P.en=v[S],P.Ls=v,P.p={},P})}(Oc)),Oc.exports}var i3=Ks();const G=Sc(i3);var o3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var c=100*s+l;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o})})(o3);var s3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s){return s+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(s){return s<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return i.default.locale(o,null,!0),o})})(s3);var l3={exports:{}};(function(t,e){(function(n,r){t.exports=r(Ks())})(xi,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(s){return s+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(s){return s<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return i.default.locale(o,null,!0),o})})(l3);var Sg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(xi,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)}}})})(Sg);var a3=Sg.exports;const c3=Sc(a3);var Og={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(xi,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))}}})})(Og);var d3=Og.exports;const u3=Sc(d3),f3={class:"w-full dark:text-gray-400"},h3={class:"flex justify-between items-center mb-3"},p3={class:"flex"},m3={class:"font-medium flex items-center gap-2"},g3=["value","onChange"],y3=["value"],b3=["value","onChange"],k3=["value"],w3={class:"flex"},v3={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},_c=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:G().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=zn();G.extend(u3),G.extend(c3);const r=t,i=a.computed(()=>Array.from({length:7},(W,K)=>G().day((1+K)%7).locale(n.value).format("ddd"))),o=a.ref([G(new Date).subtract(1,"month"),G(new Date)]);a.watch(()=>r.initDates,()=>{var V;if(!r.range&&r.initDates)o.value[0]=G(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=G(new Date);else if(r.range&&((V=r.initDates)==null?void 0:V.length)===2){let W=G(r.initDates[0]),K=G(r.initDates[1]);K.isBefore(W,"month")&&(K=W.add(1,"month")),W.isSame(K,"month")&&(K=W.add(1,"month")),o.value=[W,K]}},{immediate:!0,once:!0}),a.watch(()=>[r.displayYearStart,r.displayMonthStart],([V,W])=>{V&&W&&(o.value[0]=G().year(Number(V)).month(Number(W)).startOf("month"),o.value[1]=G().year(Number(V)).month(Number(W)).startOf("month").add(1,"month"))},{immediate:!0}),a.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([V,W])=>{if(V&&W){const K=o.value[0],q=G().year(Number(V)).month(Number(W)).startOf("month");q.isAfter(K,"month")&&(o.value[1]=q)}},{immediate:!0});const s=e,l=a.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(V){if(r.week)s("update:modelValue",[G(V).startOf("week"),G(V).endOf("week")]);else if(r.range){const W=r.modelValue.filter(K=>K).length;if(W==0)s("update:modelValue",[V]);else if(W==2)s("update:modelValue",[V]);else if(W==1){let K=[G(r.modelValue[0]),G(V)];K=K.sort((q,H)=>q-H),s("update:modelValue",K)}}else s("update:modelValue",G(V))}function d(V){const W=G(V).daysInMonth(),K=[],q=G(V).startOf("month");for(let H=1;H<=W;H++){let de=q.clone().date(H);K.push(de)}return K}function u(V){return G(V).startOf("month").day()}function f(V,W){const K=G(`${V}-${W}-01`,"YYYY-MM-DD"),H=K.day(),de=[];for(let ae=0;ae<H;ae++)de.push(K.clone().subtract(H-ae,"days"));return de}function h(V,W){const K=G(`${V}-${W}`,"YYYY-MM").endOf("month"),H=6-K.day(),de=[];for(let ae=1;ae<=H;ae++)de.push(K.clone().add(ae,"days"));return de}function p(V){const W=G();return G(V).isSame(W,"day")}function m(V){var W,K;if(r.range){if(((W=r.modelValue)==null?void 0:W.length)==1)return G(V).isSame(G(r.modelValue[0]),"day");if(((K=r.modelValue)==null?void 0:K.length)==2)return G(V).isSame(G(r.modelValue[0]),"day")||G(V).isSame(G(r.modelValue[1]),"day")}else if(r.modelValue)return G(V).isSame(G(r.modelValue),"day")}function g(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isBetween(G(r.modelValue[0]),G(r.modelValue[1]))}function y(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isSame(G(r.modelValue[0]),"day")}function k(V){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(V).isSame(G(r.modelValue[1]),"day")}function x(V){try{return r.minDate?G(V).isBefore(G(r.minDate)):!1}catch(W){return console.log(W),!1}}function w(V){try{return r.maxDate?G(V).isAfter(G(r.maxDate)):!1}catch(W){return console.log(W),!1}}function b(V){L(V,o.value[V].subtract(1,"month"))}function S(V){L(V,o.value[V].add(1,"month"))}function v(V){L(V,o.value[V].subtract(1,"year"))}function _(V){L(V,o.value[V].add(1,"year"))}const B=V=>l.value.length===1||V===0?!0:o.value[V].subtract(1,"month").isAfter(o.value[0],"month"),A=V=>l.value.length===1||V===1?!0:o.value[V].add(1,"month").isBefore(o.value[1],"month"),P=V=>l.value.length===1||V===0?!0:o.value[V].subtract(1,"year").isAfter(o.value[0],"year"),$=V=>l.value.length===1||V===1?!0:o.value[V].add(1,"year").isBefore(o.value[1],"year");function L(V,W){if(V===0){if(!l.value.length===1&&!W.isBefore(o.value[1],"month"))return;o.value=[W,o.value[1]]}else{if(!l.value.length===1&&!W.isAfter(o.value[0],"month"))return;(W.isBefore(o.value[0],"month")||W.isSame(o.value[0],"month"))&&(W=o.value[0].add(1,"month")),o.value=[o.value[0],W]}}const j=a.ref();function z(V){r.week&&(j.value=G(V).week())}function D(V){return G(V).week()===j.value}function C(V){return G(V).week()===j.value?G(V).format("YYYY-MM-DD")===G().week(j.value).startOf("week").format("YYYY-MM-DD"):!1}function I(V){return G(V).week()===j.value?G(V).format("YYYY-MM-DD")===G().week(j.value).endOf("week").format("YYYY-MM-DD"):!1}function R(){j.value=null}function ee(V,W){const K=o.value[V].year(Number(W));L(V,K)}function te(V,W){const K=o.value[V].month(Number(W));L(V,K)}const ce=a.computed(()=>{const V=r.defaultMinYear,W=r.defaultMaxYear,K=[];for(let q=V;q<=W;q++)K.push(q);return K}),ue=a.computed(()=>Array.from({length:12},(V,W)=>G().month(W).locale(n.value).format("MMMM")));return(V,W)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":l.value.length===1,"min-w-192":l.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,K=>{var q;return a.openBlock(),a.createElementBlock("div",f3,[a.createElementVNode("div",h3,[a.createElementVNode("div",p3,[a.createVNode(Af,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!P(K),"hover:opacity-100":P(K)}]),onClick:H=>P(K)?v(K):null},null,8,["class","onClick"]),a.createVNode(Df,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!B(K),"hover:opacity-100":B(K)}]),onClick:H=>B(K)?b(K):null},null,8,["class","onClick"])]),a.createElementVNode("div",m3,[a.createElementVNode("select",{value:o.value[K].format("YYYY"),onChange:H=>ee(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ce.value,H=>(a.openBlock(),a.createElementBlock("option",{key:H,value:H},a.toDisplayString(H),9,y3))),128))],40,g3),a.createElementVNode("select",{value:o.value[K].month(),onChange:H=>te(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ue.value,(H,de)=>(a.openBlock(),a.createElementBlock("option",{key:de,value:de},a.toDisplayString(H),9,k3))),128))],40,b3)]),a.createElementVNode("div",w3,[a.createVNode(Bf,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!A(K),"hover:opacity-100":A(K)}]),onClick:H=>A(K)?S(K):null},null,8,["class","onClick"]),a.createVNode(Lf,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(K),"hover:opacity-100":$(K)}]),onClick:H=>$(K)?_(K):null},null,8,["class","onClick"])])]),a.createElementVNode("div",v3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(H,de)=>(a.openBlock(),a.createElementBlock("div",{key:de,class:"flex justify-center text-sm"},a.toDisplayString(H),1))),128))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:R},[u(o.value[K])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(f(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1),H=>(a.openBlock(),a.createBlock(Cc,{onClick:de=>!w(H)&&!x(H)?c(H):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d(o.value[K].clone()),H=>(a.openBlock(),a.createBlock(Cc,{onMouseover:de=>z(H),onClick:de=>!w(H)&&!x(H)?c(H):null,today:p(H),selected:m(H),firstDay:y(H)||C(H),lastDay:k(H)||I(H),between:g(H),disabled:w(H)||x(H),off:w(H)||x(H),highlight:D(H)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((q=h(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1))==null?void 0:q.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(h(a.unref(G)(o.value[K]).year(),a.unref(G)(o.value[K]).month()+1),H=>(a.openBlock(),a.createBlock(Cc,{onClick:de=>!w(H)&&!x(H)?c(H):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),x3={},E3={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},C3=[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 S3(t,e){return a.openBlock(),a.createElementBlock("svg",E3,C3)}const _g=be(x3,[["render",S3]]),O3={},_3={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},T3=[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 N3(t,e){return a.openBlock(),a.createElementBlock("svg",_3,T3)}const Tg=be(O3,[["render",N3]]),M3={class:"flex gap-3"},A3={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},D3=["onClick"],L3=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{t:n}=zn(),r=t,i=a.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder),o=e;function s(d){o("update:modelValue",d)}const l=a.computed(()=>{var d;if(r.range)return(d=r.modelValue)==null?void 0:d.map(u=>G(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return G(r.modelValue).format("YYYY-MM-DD")}),c=a.reactive([{text:a.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("month");o("update:modelValue",[f,u])}},{text:a.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=G().startOf("month").subtract(1,"month"),f=G(u).endOf("month");o("update:modelValue",[u,f])}},{text:a.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(a.openBlock(),a.createBlock(fr,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",M3,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",A3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c,f=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:h=>f.onClick()},a.toDisplayString(f.text),9,D3))),256))])):a.createCommentVNode("",!0),a.createVNode(_c,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":s,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>{var f;return[a.createVNode(zi,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((f=l.value)!=null&&f.length)),onOnClear:u[0]||(u[0]=h=>s(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(_g,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Tg,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(l.value||i.value),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),B3={class:"relative inline-block tabular-nums"},$3=["value","placeholder","maxlength"],Tc={__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",B3,[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,$3)]))}},I3={class:"flex items-center gap-0"},V3=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),P3=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),Nc={__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,k=>{n.range?Array.isArray(k)&&k.length===2?(yearStart.value=k[0]?G(k[0]).format("YYYY"):"",monthStart.value=k[0]?G(k[0]).format("MM"):"",dayStart.value=k[0]?G(k[0]).format("DD"):"",yearEnd.value=k[1]?G(k[1]).format("YYYY"):"",monthEnd.value=k[1]?G(k[1]).format("MM"):"",dayEnd.value=k[1]?G(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=G(k).format("YYYY"),o.value=G(k).format("MM"),s.value=G(k).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(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=G().format("YYYY")),u()}function g(){o.value||(o.value=G().format("MM")),u()}function y(){s.value||(s.value=G().format("DD")),u()}return(k,x)=>(a.openBlock(),a.createElementBlock("div",I3,[a.createVNode(Tc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=w=>i.value=w),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),V3,a.createVNode(Tc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=w=>o.value=w),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),P3,a.createVNode(Tc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=w=>s.value=w),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},R3={class:"tabular-nums"},F3={key:1,class:"flex items-center"},z3=a.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),j3={class:"flex gap-3"},H3={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},W3=["onClick"],U3=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{t:n}=zn(),r=t,i=e,o=a.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder);a.ref(!1);const s=a.ref(G().year()),l=a.ref(G().month()),c=a.ref(null),d=a.ref(null);function u(){i("update:modelValue",null)}a.watch(()=>r.initDates,m=>{var g;r.range&&((g=r.initDates)==null?void 0:g.length)==2?(s.value=G(r.initDates[0]).year(),l.value=G(r.initDates[0]).month(),c.value=G(r.initDates[1]).year(),d.value=G(r.initDates[1]).month()):r.initDates&&(s.value=G(r.initDates).year(),l.value=G(r.initDates).month())},{immediate:!0});const f=a.ref(r.range?[]:"");a.watch(()=>r.modelValue,m=>{if(r.range){const g=m!=null&&m[0]?G(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?G(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?G(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),a.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?G(m[0]).toDate():null,x=m[1]&&m[1].length===10?G(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=G(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=a.reactive([{text:a.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("month");i("update:modelValue",[y,g])}},{text:a.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=G().startOf("month").subtract(1,"month"),y=G(g).endOf("month");i("update:modelValue",[g,y])}},{text:a.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(a.openBlock(),a.createBlock(fr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:a.withCtx(()=>[a.createElementVNode("div",j3,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",H3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(p,y=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:k=>y.onClick()},a.toDisplayString(y.text),9,W3))),256))])):a.createCommentVNode("",!0),a.createVNode(_c,{doubleMonths:t.doubleMonths,displayYearStart:s.value,displayMonthStart:l.value,displayYearEnd:c.value,displayMonthEnd:d.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:r.range?[...f.value]:f.value,"onUpdate:modelValue":h,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(zi,{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:u},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(_g,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Tg,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createElementVNode("div",R3,[t.range?t.range?(a.openBlock(),a.createElementBlock("div",F3,[a.createVNode(Nc,{modelValue:f.value[0],"onUpdate:modelValue":g[3]||(g[3]=y=>f.value[0]=y),disabled:t.disabled,"onUpdate:displayYear":g[4]||(g[4]=y=>s.value=y),"onUpdate:displayMonth":g[5]||(g[5]=y=>l.value=y)},null,8,["modelValue","disabled"]),z3,a.createVNode(Nc,{modelValue:f.value[1],"onUpdate:modelValue":g[6]||(g[6]=y=>f.value[1]=y),disabled:t.disabled,"onUpdate:displayYear":g[7]||(g[7]=y=>{c.value=y}),"onUpdate:displayMonth":g[8]||(g[8]=y=>{d.value=y})},null,8,["modelValue","disabled"])])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(o.value),1)],64)):(a.openBlock(),a.createBlock(Nc,{key:0,modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=y=>f.value=y),disabled:t.disabled,"onUpdate:displayYear":g[1]||(g[1]=y=>s.value=y),"onUpdate:displayMonth":g[2]||(g[2]=y=>l.value=y)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),Y3=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/10 dark:bg-black/50 backdrop-blur-md 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(he).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))}}),q3={class:"absolute inset-0 flex items-center justify-center py-12"},K3={class:"text-lg font-medium dark:text-gray-300"},G3={key:0,class:"flex justify-end px-6 pb-4"},J3=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean,blur: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",q3,[a.createElementVNode("div",{class:a.normalizeClass(["absolute transition-opacity inset-0 bg-black/10 dark:bg-black/50 z-10",{"backdrop-blur-md":t.blur}]),onClick:o},null,2),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",K3,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode($i,{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",G3,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),Z3=["onClick"],X3=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,Z3))),128))],2),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),Q3=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)}}),eD={},tD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},nD=[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 rD(t,e){return a.openBlock(),a.createElementBlock("svg",tD,nD)}const iD=be(eD,[["render",rD]]),oD={},sD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},lD=[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 aD(t,e){return a.openBlock(),a.createElementBlock("svg",sD,lD)}const cD=be(oD,[["render",aD]]),dD={},uD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},fD=[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 hD(t,e){return a.openBlock(),a.createElementBlock("svg",uD,fD)}const pD=be(dD,[["render",hD]]),mD={},gD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yD=[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 bD(t,e){return a.openBlock(),a.createElementBlock("svg",gD,yD)}const kD=be(mD,[["render",bD]]),wD={key:0,class:"w-6 opacity-50"},vD={class:"flex-1"},xD={key:0,class:"mb-2"},ED=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",wD,[t.warning?(a.openBlock(),a.createBlock(iD,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock(cD,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(pD,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(kD,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",vD,[t.title?(a.openBlock(),a.createElementBlock("div",xD,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))}}),Mc=a.ref(!1),Ng=a.ref(""),Mg=a.ref(""),Ag=a.ref(!1),Dg=a.ref(!1),Lg=a.ref(!1);let Bg=()=>{},$g=()=>{};function Ac(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{Ng.value=i,Mg.value=o,Ag.value=s,Dg.value=l,Lg.value=u,Bg=c||(()=>{}),$g=d||(()=>{}),Mc.value=!0},e=()=>{Mc.value=!1};return{visible:Mc,title:Ng,text:Mg,positive:Ag,negative:Dg,show:t,onConfirm:()=>{Bg(),e()},onCancel:()=>{$g(),e()},blur:Lg}}const CD={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},SD={class:"text-lg font-semibold mb-6"},OD={class:"mb-12"},_D={class:"flex justify-end"},Dc={WpicColorPicker:Tf,WpicAlert:ED,WpicToggleSwitch:Of,WpicAdvDateField:U3,WpicCalendar:_c,WpicTextarea:_f,WpicDialog:J3,WpicSlidePanel:Y3,WpicDateField:L3,WpicFormInput:zi,WpicButton:Ni,WpicBadge:r3,WpicTextEditor:FA,WpicInputGroup:fy,WpicButtonGroup:ay,WpicForm:hy,WpicFormField:Nf,WpicSpinner:Fr,WpicTooltip:Mf,WpicPopover:fr,WpicChoiceList:Sf,WpicCard:gx,WpicCardSection:kx,WpicProgressBar:xx,WpicTag:Cx,WpicTagGroup:Sx,WpicPagination:Zx,WpicLoadingPanel:Nx,WpicTable:ME,WpicTableColumn:AE,WpicTabs:X3,WpicTabPane:Q3,WpicConfirm:be(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l,blur:c}=Ac();return(d,u)=>a.unref(e)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["z-40 fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black/10 dark:bg-black/50 transition-opacity",{"backdrop-blur-md":a.unref(c)}])},[a.createElementVNode("div",CD,[a.createElementVNode("div",SD,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",OD,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",_D,[a.createVNode(Ni,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.$t("wpiccomponents.cancel")),1)]),_:1},8,["onClick"]),a.createVNode(Ni,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.$t("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};function Ig(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Ig(t[n],e[n]):t[n]=e[n])}const TD={useConfirm:Ac};function ND(t,e){Ig(he,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const MD={install:ND,composables:TD,options:he};ct.default=MD,ct.useConfirm=Ac,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|