@romainbx/wpic-components 0.0.102 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components → src/components}/floating/Popover.vue.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/wpic-components.js +9628 -6513
- package/dist/wpic-components.umd.cjs +48 -26
- package/locales/en.json +16 -0
- package/locales/ja.json +16 -0
- package/locales/ko.json +16 -0
- package/locales/zh-CN.json +16 -0
- package/package.json +8 -3
- /package/dist/{components → src/components}/Alert.vue.d.ts +0 -0
- /package/dist/{components → src/components}/Badge.vue.d.ts +0 -0
- /package/dist/{components → src/components}/LoadingPanel.vue.d.ts +0 -0
- /package/dist/{components → src/components}/ProgressBar.vue.d.ts +0 -0
- /package/dist/{components → src/components}/SlidePanel.vue.d.ts +0 -0
- /package/dist/{components → src/components}/Spinner.vue.d.ts +0 -0
- /package/dist/{components → src/components}/TextEditor.vue.d.ts +0 -0
- /package/dist/{components → src/components}/card/Card.vue.d.ts +0 -0
- /package/dist/{components → src/components}/card/CardSection.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/AdvancedDateField.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/Calendar.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/DateField.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/DateInput.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/DateSegment.vue.d.ts +0 -0
- /package/dist/{components → src/components}/date/DayItem.vue.d.ts +0 -0
- /package/dist/{components → src/components}/floating/Tooltip.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/Button.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/ButtonGroup.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/ChoiceList.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/ColorPicker.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/Form.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/FormField.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/FormInput.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/InputGroup.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/Textarea.vue.d.ts +0 -0
- /package/dist/{components → src/components}/form/ToggleSwitch.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Bars3.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Bars3BottomLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Bars3BottomRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Bold.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/CalendarDateRange.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/CalendarDays.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Check.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/CheckCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ChevronDown.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ChevronLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ChevronUpDown.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Circle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/CodeBracket.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Complete.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ExclamationCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ExclamationTriangle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Eye.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/EyeOff.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Heading1.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Heading2.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Heading3.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Incomplete.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/InformationCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Italic2.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Minus.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/OrderedList.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Paragraph.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Partially.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Pencil.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/Plus.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/QuestionMarkCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/SpinnerThird.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/TextColor.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/ViewColumns.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/XCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/XMark.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/ArrowUturnLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/ArrowUturnRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Bars3.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Bars3BottomCenter.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Bars3BottomLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Bars3BottomRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/ChevronDown.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/ChevronRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/ListBullet.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/NumberedList.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Strikethrough.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/micro/Underline.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/CheckCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/ChevronDoubleLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/ChevronDoubleRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/ChevronLeft.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/ChevronRight.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/ExclamationTriangle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/InformationCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/mini/XCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/solid/Eye.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/solid/EyeOff.vue.d.ts +0 -0
- /package/dist/{components → src/components}/icons/solid/InformationCircle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/modal/Confirm.vue.d.ts +0 -0
- /package/dist/{components → src/components}/modal/Dialog.vue.d.ts +0 -0
- /package/dist/{components → src/components}/pagination/Item.vue.d.ts +0 -0
- /package/dist/{components → src/components}/pagination/Pagination.vue.d.ts +0 -0
- /package/dist/{components → src/components}/tab/TabPane.vue.d.ts +0 -0
- /package/dist/{components → src/components}/tab/Tabs.vue.d.ts +0 -0
- /package/dist/{components → src/components}/table/Table.vue.d.ts +0 -0
- /package/dist/{components → src/components}/table/TableCell.vue.d.ts +0 -0
- /package/dist/{components → src/components}/table/TableColumn.vue.d.ts +0 -0
- /package/dist/{components → src/components}/table/TotalRow.vue.d.ts +0 -0
- /package/dist/{components → src/components}/tag/Tag.vue.d.ts +0 -0
- /package/dist/{components → src/components}/tag/TagGroup.vue.d.ts +0 -0
- /package/dist/{config.d.ts → src/config.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Dn,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(Dn=typeof globalThis<"u"?globalThis:Dn||self,l(Dn.WpicComponents={},Dn.Vue))})(this,function(Dn,l){"use strict";function Jg(){return Vc().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Vc(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Zg=typeof Proxy=="function",Xg="devtools-plugin:setup",Qg="plugin:settings:set";let $r,Gs;function e0(){var t;return $r!==void 0||(typeof window<"u"&&window.performance?($r=!0,Gs=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?($r=!0,Gs=globalThis.perf_hooks.performance):$r=!1),$r}function t0(){return e0()?Gs.now():Date.now()}class n0{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(i),a=JSON.parse(s);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(i,JSON.stringify(s))}catch{}o=s},now(){return t0()}},n&&n.on(Qg,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:a,args:c,resolve:d})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function r0(t,e){const n=t,r=Vc(),i=Jg(),o=Zg&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Xg,t,e);else{const s=o?new n0(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/**
|
|
2
2
|
* vee-validate v4.12.8
|
|
3
3
|
* (c) 2024 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Te(t){return typeof t=="function"}function fa(t){return t==null}const Jt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Wo(t){return Number(t)>=0}function gp(t){const e=parseFloat(t);return isNaN(e)?t:e}function yp(t){return typeof t=="object"&&t!==null}function bp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ha(t){if(!yp(t)||bp(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ar(t,e){return Object.keys(e).forEach(n=>{if(ha(e[n])&&ha(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Vr(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Wo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const pa={};function yt(t,e){xp(t,e),pa[t]=e}function kp(t){return pa[t]}function xp(t,e){if(!Te(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ma(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(ge(l),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)ma(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||ma(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),ga=Symbol("vee-validate-field-instance"),Mi=Symbol("Default empty value"),wp=typeof window<"u";function Uo(t){return Te(t)&&!!t.__locatorRef}function bt(t){return!!t&&Te(t.parse)&&t.__type==="VVTypedSchema"}function Ti(t){return!!t&&Te(t.validate)}function _r(t){return t==="checkbox"||t==="radio"}function vp(t){return Jt(t)||Array.isArray(t)}function Cp(t){return Array.isArray(t)?t.length===0:Jt(t)&&Object.keys(t).length===0}function $i(t){return/^\[.+\]$/i.test(t)}function Sp(t){return ya(t)&&t.multiple}function ya(t){return t.tagName==="SELECT"}function Ep(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Op(t,e){return!Ep(t,e)&&e.type!=="file"&&!_r(e.type)}function ba(t){return qo(t)&&t.target&&"submit"in t.target}function qo(t){return t?!!(typeof Event<"u"&&Te(Event)&&t instanceof Event||t&&t.srcElement):!1}function ka(t,e){return e in t&&t[e]!==Mi}function je(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!je(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!je(r[1],e.get(r[0])))return!1;return!0}if(xa(t)&&xa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function xa(t){return wp?t instanceof File:!1}function Ko(t){return $i(t)?t.replace(/\[|\]/gi,""):t}function qe(t,e,n){return t?$i(e)?t[Ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>vp(i)&&o in i?i[o]:n,t):n}function Lt(t,e,n){if($i(e)){t[Ko(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||fa(i[r[o]]))&&(i[r[o]]=Wo(r[o+1])?[]:{}),i=i[r[o]]}}function Yo(t,e){if(Array.isArray(t)&&Wo(e)){t.splice(Number(e),1);return}Jt(t)&&delete t[e]}function wa(t,e){if($i(e)){delete t[Ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){Yo(r,n[o]);break}if(!(n[o]in r)||fa(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>qe(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Cp(i[o])){if(o===0){Yo(t,n[0]);continue}Yo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Jo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function va(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return je(t,e)?n:e}function Mp(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Ca(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function Tp(t,e){return Jt(e)&&e.number?gp(t):t}function Go(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Zo(t){return Array.isArray(t)?t:t?[t]:[]}function Ni(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function $p(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Xo(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Qo(t){if(Sa(t))return t._value}function Sa(t){return"_value"in t}function Np(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Bi(t){if(!qo(t))return t;const e=t.target;if(_r(e.type)&&Sa(e))return Qo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Sp(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Qo);if(ya(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Qo(n):e.value}return Np(e)}function Ea(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Jt(t)&&t._$$isNormalized?t:Jt(t)?Object.keys(t).reduce((n,r)=>{const i=Bp(t[r]);return t[r]!==!1&&(n[r]=Oa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Ap(r);return i.name&&(n[i.name]=Oa(i.params)),n},e):e}function Bp(t){return t===!0?[]:Array.isArray(t)||Jt(t)?t:[t]}function Oa(t){const e=n=>typeof n=="string"&&n[0]==="@"?Vp(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 Ap=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Vp(t){const e=n=>qe(n,t)||n[t];return e.__locatorRef=t,e}function Dp(t){return Array.isArray(t)?t.filter(Uo):Ke(t).filter(e=>Uo(t[e])).map(e=>t[e])}let _p=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const wn=()=>_p;async function Ma(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await Lp(i,t)).errors;return{errors:s,valid:!s.length}}async function Lp(t,e){if(bt(t.rules)||Ti(t.rules))return Pp(e,t.rules);if(Te(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:$a(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Ea(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Rp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function Ip(t){return!!t&&t.name==="ValidationError"}function Ta(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Ip(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 Pp(t,e){const r=await(bt(e)?e:Ta(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Rp(t,e,n){const r=kp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=zp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:$a(o)}}function $a(t){const e=wn().generateMessage;return e?e(t):"Field is invalid"}function zp(t,e){const n=r=>Uo(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function jp(t,e){const r=await(bt(t)?t:Ta(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function Fp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Ma(qe(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Na=0;function Hp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Wp(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}=Kp(),u=Na>=Number.MAX_SAFE_INTEGER?0:++Na,f=qp(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 Wp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?qe(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=Up(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return qe(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Up(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:qe(e.values,a.unref(r),a.unref(n))}function qp(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!je(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function Kp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Zo(e)}}}function Ba(t){process.env.NODE_ENV!=="production"&&mp({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"},Gp)}const Lr={},Ir={};let It;const Kn=Mp(()=>{setTimeout(async()=>{await a.nextTick(),It==null||It.sendInspectorState(Yn),It==null||It.sendInspectorTree(Yn)},100)},100);function Yp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Lr[t.formId]=Object.assign({},t),Lr[t.formId]._vm=e,a.onUnmounted(()=>{delete Lr[t.formId],Kn()}),Kn()}function Jp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],Kn()}),Kn()}const Yn="vee-validate-inspector",Ye={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Gp(t){It=t,t.addInspector({id:Yn,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){await Ce.field.validate();return}if(Ce.type==="form"){await Ce.form.validate();return}Ce.type==="pathState"&&await Ce.form.validateField(Ce.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){Ce.field.resetField();return}Ce.type==="form"&&Ce.form.resetForm(),Ce.type==="pathState"&&Ce.form.resetField(Ce.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Yn)return;const n=Object.values(Lr),r=Object.values(Ir);e.rootNodes=[...n.map(Zp),...r.map(i=>Qp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Yn||n.currentTab!==`custom-inspector:${Yn}`)return;const{form:r,field:i,state:o,type:s}=em(e.nodeId);if(r&&s==="form"){e.state=tm(r),Ce={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Va(o),Ce={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Va({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ce={field:i,type:"field"};return}Ce=null})}function Zp(t){const{textColor:e,bgColor:n}=Da(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Lt(r,a.unref(s.path),Xp(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Jt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:es(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ye.white,backgroundColor:Ye.unknown}]}}function Xp(t,e){return{id:es(e,t),label:a.unref(t.path),tags:Aa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Qp(t,e){return{id:es(e,t),label:a.unref(t.name),tags:Aa(!1,1,t.type,t.meta.valid,e)}}function Aa(t,e,n,r,i){const{textColor:o,bgColor:s}=Da(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ye.black,backgroundColor:Ye.gray},n==="checkbox"?{label:"Checkbox",textColor:Ye.white,backgroundColor:Ye.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ye.white,backgroundColor:Ye.purple}:void 0,t?{label:"Multiple",textColor:Ye.black,backgroundColor:Ye.orange}:void 0].filter(Boolean)}function es(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function em(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Lr[e.f];if(!n&&e.ff){const i=Ir[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Va(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function tm(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Da(t){return{bgColor:t?Ye.success:Ye.error,textColor:t?Ye.black:Ye.white}}function nm(t,e,n){return _r(n==null?void 0:n.type)?im(t,e,n):_a(t,e,n)}function _a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=rm(n),g=f?Jo(Dr):void 0,y=m||g,b=a.computed(()=>Vr(a.toValue(t))),v=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const X=a.unref(e);return Ti(X)||bt(X)||Te(X)||Array.isArray(X)?X:Ea(X)}),M=!Te(v.value)&&bt(a.toValue(e)),{id:k,value:O,initialValue:C,meta:B,setState:I,errors:_,flags:T}=Hp(b,{modelValue:r,form:y,bails:o,label:c,type:s,validate:v.value?x:void 0,schema:M?e:void 0}),L=a.computed(()=>_.value[0]);p&&om({value:O,prop:p,handleChange:A,shouldValidate:()=>d&&!T.pendingReset});const H=(P,X=!1)=>{B.touched=!0,X&&W()};async function Y(P){var X,he;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(P);return(X=le[a.toValue(b)])!==null&&X!==void 0?X:{valid:!0,errors:[]}}return v.value?Ma(O.value,v.value,{name:a.toValue(b),label:a.toValue(c),values:(he=y==null?void 0:y.values)!==null&&he!==void 0?he:{},bails:o}):{valid:!0,errors:[]}}const W=Go(async()=>(B.pending=!0,B.validated=!0,Y("validated-only")),P=>(T.pendingUnmount[ee.id]||(I({errors:P.errors}),B.pending=!1,B.valid=P.valid),P)),N=Go(async()=>Y("silent"),P=>(B.valid=P.valid,P));function x(P){return(P==null?void 0:P.mode)==="silent"?N():W()}function A(P,X=!0){const he=Bi(P);$(he,X)}a.onMounted(()=>{if(i)return W();(!y||!y.validateSchema)&&N()});function V(P){B.touched=P}function K(P){var X;const he=P&&"value"in P?P.value:C.value;I({value:ge(he),initialValue:ge(he),touched:(X=P==null?void 0:P.touched)!==null&&X!==void 0?X:!1,errors:(P==null?void 0:P.errors)||[]}),B.pending=!1,B.validated=!1,N()}const Q=a.getCurrentInstance();function $(P,X=!0){O.value=Q&&p?Tp(P,Q.props.modelModifiers):P,(X?W:N)()}function F(P){I({errors:Array.isArray(P)?P:[P]})}const D=a.computed({get(){return O.value},set(P){$(P,d)}}),ee={id:k,name:b,label:c,value:D,meta:B,errors:_,errorMessage:L,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:K,handleReset:()=>K(),validate:x,handleChange:A,handleBlur:H,setState:I,setTouched:V,setErrors:F,setValue:$};if(a.provide(ga,ee),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(P,X)=>{je(P,X)||(B.validated?W():N())},{deep:!0}),process.env.NODE_ENV!=="production"&&(ee._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:_.value},B),{value:O.value}),Kn,{deep:!0}),y||Jp(ee)),!y)return ee;const q=a.computed(()=>{const P=v.value;return!P||Te(P)||Ti(P)||bt(P)||Array.isArray(P)?{}:Object.keys(P).reduce((X,he)=>{const le=Dp(P[he]).map(pe=>pe.__locatorRef).reduce((pe,be)=>{const Me=qe(y.values,be)||y.values[be];return Me!==void 0&&(pe[be]=Me),pe},{});return Object.assign(X,le),X},{})});return a.watch(q,(P,X)=>{if(!Object.keys(P).length)return;!je(P,X)&&(B.validated?W():N())}),a.onBeforeUnmount(()=>{var P;const X=(P=a.toValue(ee.keepValueOnUnmount))!==null&&P!==void 0?P:a.toValue(y.keepValuesOnUnmount),he=a.toValue(b);if(X||!y||T.pendingUnmount[ee.id]){y==null||y.removePathState(he,k);return}T.pendingUnmount[ee.id]=!0;const le=y.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(ee.id):(le==null?void 0:le.id)===ee.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const be=le.value.findIndex(Me=>je(Me,a.toValue(ee.checkedValue)));if(be>-1){const Me=[...le.value];Me.splice(be,1),y.setFieldValue(he,Me)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(ee.id),1)}else y.unsetPathValue(a.toValue(b));y.removePathState(he,k)}}),ee}function rm(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?ts(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function im(t,e,n){const r=n!=null&&n.standalone?void 0:Jo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>je(p,h))>=0:je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),b=Bi(f);let v=(m=a.toValue(i))!==null&&m!==void 0?m:b;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?v=va(qe(r.values,g)||[],v,void 0):(n==null?void 0:n.type)==="checkbox"&&(v=va(a.toValue(l.value),v,a.toValue(o))),c(v,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(_a(t,e,n))}function om({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{je(l,ts(i,o))||i.emit(s,l)}),a.watch(()=>ts(i,o),l=>{if(l===Mi&&e.value===void 0)return;const c=l===Mi?void 0:l;je(c,e.value)||n(c,r())}))}function ts(t,e){if(t)return t.props[e]}const sm=a.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>wn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Mi},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:b,setErrors:v}=nm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:am(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),M=function(_,T=!0){f(_,T)},k=a.computed(()=>{const{validateOnInput:I,validateOnChange:_,validateOnBlur:T,validateOnModelUpdate:L}=lm(t);function H(x){h(x,T),Te(e.attrs.onBlur)&&e.attrs.onBlur(x)}function Y(x){M(x,I),Te(e.attrs.onInput)&&e.attrs.onInput(x)}function W(x){M(x,_),Te(e.attrs.onChange)&&e.attrs.onChange(x)}const N={name:t.name,onBlur:H,onInput:Y,onChange:W};return N["onUpdate:modelValue"]=x=>M(x,L),N}),O=a.computed(()=>{const I=Object.assign({},k.value);_r(e.attrs.type)&&b&&(I.checked=b.value);const _=La(t,e);return Op(_,e.attrs)&&(I.value=c.value),I}),C=a.computed(()=>Object.assign(Object.assign({},k.value),{modelValue:c.value}));function B(){return{field:O.value,componentField:C.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:M,handleInput:I=>M(I,!1),handleReset:g,handleBlur:k.value.onBlur,setTouched:p,setErrors:v}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:v,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const I=a.resolveDynamicComponent(La(t,e)),_=Xo(I,e,B);return I?a.h(I,Object.assign(Object.assign({},e.attrs),O.value),_):_}}});function La(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function lm(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=wn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function am(t,e){return _r(e.attrs.type)?ka(t,"modelValue")?t.modelValue:void 0:ka(t,"modelValue")?t.modelValue:e.attrs.value}const vn=sm;let cm=0;const Ai=["bails","fieldsCount","id","multiple","type","validate"];function Ia(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&bt(r)&&Te(r.cast)?ge(r.cast(n)||{}):ge(n)}function dm(t){var e;const n=cm++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ia(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=$p(()=>{f.value=d.value.reduce((E,S)=>(E[Vr(a.toValue(S.path))]=S,E),{})});function p(E,S){const R=x(E);if(!R){typeof E=="string"&&(u.value[Vr(E)]=Zo(S));return}if(typeof E=="string"){const G=Vr(E);u.value[G]&&delete u.value[G]}R.errors=Zo(S),R.valid=!R.errors.length}function m(E){Ke(E).forEach(S=>{p(S,E[S])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const E=d.value.reduce((S,R)=>(R.errors.length&&(S[R.path]=R.errors),S),{});return Object.assign(Object.assign({},u.value),E)}),y=a.computed(()=>Ke(g.value).reduce((E,S)=>{const R=g.value[S];return R!=null&&R.length&&(E[S]=R[0]),E},{})),b=a.computed(()=>d.value.reduce((E,S)=>(E[S.path]={name:S.path||"",label:S.label||""},E),{})),v=a.computed(()=>d.value.reduce((E,S)=>{var R;return E[S.path]=(R=S.bails)!==null&&R!==void 0?R:!0,E},{})),M=Object.assign({},(t==null?void 0:t.initialErrors)||{}),k=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:O,originalInitialValues:C,setInitialValues:B}=fm(d,c,t),I=um(d,c,C,y),_=a.computed(()=>d.value.reduce((E,S)=>{const R=qe(c,S.path);return Lt(E,S.path,R),E},{})),T=t==null?void 0:t.validationSchema;function L(E,S){var R,G;const oe=a.computed(()=>qe(O.value,a.toValue(E))),w=f.value[a.toValue(E)],U=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(w&&U){w.multiple=!0;const Ue=r++;return Array.isArray(w.id)?w.id.push(Ue):w.id=[w.id,Ue],w.fieldsCount++,w.__flags.pendingUnmount[Ue]=!1,w}const Z=a.computed(()=>qe(c,a.toValue(E))),ie=a.toValue(E),se=V.findIndex(Ue=>Ue===ie);se!==-1&&V.splice(se,1);const de=a.computed(()=>{var Ue,st,Un,xn;const _t=a.toValue(T);if(bt(_t))return(st=(Ue=_t.describe)===null||Ue===void 0?void 0:Ue.call(_t,a.toValue(E)).required)!==null&&st!==void 0?st:!1;const Oi=a.toValue(S==null?void 0:S.schema);return bt(Oi)&&(xn=(Un=Oi.describe)===null||Un===void 0?void 0:Un.call(Oi).required)!==null&&xn!==void 0?xn:!1}),me=r++,ve=a.reactive({id:me,path:E,touched:!1,pending:!1,valid:!0,validated:!!(!((R=M[ie])===null||R===void 0)&&R.length),required:de,initialValue:oe,errors:a.shallowRef([]),bails:(G=S==null?void 0:S.bails)!==null&&G!==void 0?G:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:Z,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:a.computed(()=>!je(a.unref(Z),a.unref(oe)))});return d.value.push(ve),f.value[ie]=ve,h(),y.value[ie]&&!M[ie]&&a.nextTick(()=>{mt(ie,{mode:"silent"})}),a.isRef(E)&&a.watch(E,Ue=>{h();const st=ge(Z.value);f.value[Ue]=ve,a.nextTick(()=>{Lt(c,Ue,st)})}),ve}const H=Ca(Dt,5),Y=Ca(Dt,5),W=Go(async E=>await(E==="silent"?H():Y()),(E,[S])=>{const R=Ke(P.errorBag.value),oe=[...new Set([...Ke(E.results),...d.value.map(w=>w.path),...R])].sort().reduce((w,U)=>{var Z;const ie=U,se=x(ie)||A(ie),de=((Z=E.results[ie])===null||Z===void 0?void 0:Z.errors)||[],me=a.toValue(se==null?void 0:se.path)||ie,ve=hm({errors:de,valid:!de.length},w.results[me]);return w.results[me]=ve,ve.valid||(w.errors[me]=ve.errors[0]),se&&u.value[me]&&delete u.value[me],se?(se.valid=ve.valid,S==="silent"||S==="validated-only"&&!se.validated||p(se,ve.errors),w):(p(me,de),w)},{valid:E.valid,results:{},errors:{}});return E.values&&(oe.values=E.values),Ke(oe.results).forEach(w=>{var U;const Z=x(w);Z&&S!=="silent"&&(S==="validated-only"&&!Z.validated||p(Z,(U=oe.results[w])===null||U===void 0?void 0:U.errors))}),oe});function N(E){d.value.forEach(E)}function x(E){const S=typeof E=="string"?Vr(E):E;return typeof S=="string"?f.value[S]:S}function A(E){return d.value.filter(R=>E.startsWith(R.path)).reduce((R,G)=>R?G.path.length>R.path.length?G:R:G,void 0)}let V=[],K;function Q(E){return V.push(E),K||(K=a.nextTick(()=>{[...V].sort().reverse().forEach(R=>{wa(c,R)}),V=[],K=null})),K}function $(E){return function(R,G){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),N(U=>U.touched=!0),i.value=!0,s.value++,vt().then(U=>{const Z=ge(c);if(U.valid&&typeof R=="function"){const ie=ge(_.value);let se=E?ie:Z;return U.values&&(se=U.values),R(se,{evt:w,controlledValues:ie,setErrors:m,setFieldError:p,setTouched:yn,setFieldTouched:be,setValues:le,setFieldValue:X,resetForm:qt,resetField:bn})}!U.valid&&typeof G=="function"&&G({values:Z,evt:w,errors:U.errors,results:U.results})}).then(U=>(i.value=!1,U),U=>{throw i.value=!1,U})}}}const D=$(!1);D.withControlled=$(!0);function ee(E,S){const R=d.value.findIndex(oe=>oe.path===E&&(Array.isArray(oe.id)?oe.id.includes(S):oe.id===S)),G=d.value[R];if(!(R===-1||!G)){if(a.nextTick(()=>{mt(E,{mode:"silent",warn:!1})}),G.multiple&&G.fieldsCount&&G.fieldsCount--,Array.isArray(G.id)){const oe=G.id.indexOf(S);oe>=0&&G.id.splice(oe,1),delete G.__flags.pendingUnmount[S]}(!G.multiple||G.fieldsCount<=0)&&(d.value.splice(R,1),gt(E),h(),delete f.value[E])}}function q(E){Ke(f.value).forEach(S=>{S.startsWith(E)&&delete f.value[S]}),d.value=d.value.filter(S=>!S.path.startsWith(E)),a.nextTick(()=>{h()})}const P={formId:n,values:c,controlledValues:_,errorBag:g,errors:y,schema:T,submitCount:s,meta:I,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:k,validateSchema:a.unref(T)?W:void 0,validate:vt,setFieldError:p,validateField:mt,setFieldValue:X,setValues:le,setErrors:m,setFieldTouched:be,setTouched:yn,resetForm:qt,resetField:bn,handleSubmit:D,useFieldModel:$r,defineInputBinds:Nr,defineComponentBinds:Br,defineField:kn,stageInitialValue:Vt,unsetInitialValue:gt,setFieldInitialValue:Kt,createPathState:L,getPathState:x,unsetPathValue:Q,removePathState:ee,initialValues:O,getAllPathStates:()=>d.value,destroyPath:q,isFieldTouched:Me,isFieldDirty:pt,isFieldValid:Tr};function X(E,S,R=!0){const G=ge(S),oe=typeof E=="string"?E:E.path;x(oe)||L(oe),Lt(c,oe,G),R&&mt(oe)}function he(E,S=!0){Ke(c).forEach(R=>{delete c[R]}),Ke(E).forEach(R=>{X(R,E[R],!1)}),S&&vt()}function le(E,S=!0){Ar(c,E),l.forEach(R=>R&&R.reset()),S&&vt()}function pe(E,S){const R=x(a.toValue(E))||L(E);return a.computed({get(){return R.value},set(G){var oe;const w=a.toValue(E);X(w,G,(oe=a.toValue(S))!==null&&oe!==void 0?oe:!1)}})}function be(E,S){const R=x(E);R&&(R.touched=S)}function Me(E){const S=x(E);return S?S.touched:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.touched)}function pt(E){const S=x(E);return S?S.dirty:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.dirty)}function Tr(E){const S=x(E);return S?S.valid:d.value.filter(R=>R.path.startsWith(E)).every(R=>R.valid)}function yn(E){if(typeof E=="boolean"){N(S=>{S.touched=E});return}Ke(E).forEach(S=>{be(S,!!E[S])})}function bn(E,S){var R;const G=S&&"value"in S?S.value:qe(O.value,E),oe=x(E);oe&&(oe.__flags.pendingReset=!0),Kt(E,ge(G),!0),X(E,G,!1),be(E,(R=S==null?void 0:S.touched)!==null&&R!==void 0?R:!1),p(E,(S==null?void 0:S.errors)||[]),a.nextTick(()=>{oe&&(oe.__flags.pendingReset=!1)})}function qt(E,S){let R=ge(E!=null&&E.values?E.values:C.value);R=S!=null&&S.force?R:Ar(C.value,R),R=bt(T)&&Te(T.cast)?T.cast(R):R,B(R),N(G=>{var oe;G.__flags.pendingReset=!0,G.validated=!1,G.touched=((oe=E==null?void 0:E.touched)===null||oe===void 0?void 0:oe[G.path])||!1,X(G.path,qe(R,G.path),!1),p(G.path,void 0)}),S!=null&&S.force?he(R,!1):le(R,!1),m((E==null?void 0:E.errors)||{}),s.value=(E==null?void 0:E.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),N(G=>{G.__flags.pendingReset=!1})})}async function vt(E){const S=(E==null?void 0:E.mode)||"force";if(S==="force"&&N(w=>w.validated=!0),P.validateSchema)return P.validateSchema(S);o.value=!0;const R=await Promise.all(d.value.map(w=>w.validate?w.validate(E).then(U=>({key:w.path,valid:U.valid,errors:U.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));o.value=!1;const G={},oe={};for(const w of R)G[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(oe[w.key]=w.errors[0]);return{valid:R.every(w=>w.valid),results:G,errors:oe}}async function mt(E,S){var R;const G=x(E);if(G&&(S==null?void 0:S.mode)!=="silent"&&(G.validated=!0),T){const{results:w}=await W((S==null?void 0:S.mode)||"validated-only");return w[E]||{errors:[],valid:!0}}return G!=null&&G.validate?G.validate(S):(!G&&((R=S==null?void 0:S.warn)!==null&&R!==void 0?R:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${E} was not found`),Promise.resolve({errors:[],valid:!0}))}function gt(E){wa(O.value,E)}function Vt(E,S,R=!1){Kt(E,S),Lt(c,E,S),R&&!(t!=null&&t.initialValues)&&Lt(C.value,E,ge(S))}function Kt(E,S,R=!1){Lt(O.value,E,ge(S)),R&&Lt(C.value,E,ge(S))}async function Dt(){const E=a.unref(T);if(!E)return{valid:!0,results:{},errors:{}};o.value=!0;const S=Ti(E)||bt(E)?await jp(E,c):await Fp(E,c,{names:b.value,bailsMap:v.value});return o.value=!1,S}const Wn=D((E,{evt:S})=>{ba(S)&&S.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&yn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}P.validateSchema&&P.validateSchema("silent")}),a.isRef(T)&&a.watch(T,()=>{var E;(E=P.validateSchema)===null||E===void 0||E.call(P,"validated-only")}),a.provide(Dr,P),process.env.NODE_ENV!=="production"&&(Yp(P),a.watch(()=>Object.assign(Object.assign({errors:g.value},I.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Kn,{deep:!0}));function kn(E,S){const R=Te(S)||S==null?void 0:S.label,G=x(a.toValue(E))||L(E,{label:R}),oe=()=>Te(S)?S(Ni(G,Ai)):S||{};function w(){var de;G.touched=!0,((de=oe().validateOnBlur)!==null&&de!==void 0?de:wn().validateOnBlur)&&mt(G.path)}function U(){var de;((de=oe().validateOnInput)!==null&&de!==void 0?de:wn().validateOnInput)&&a.nextTick(()=>{mt(G.path)})}function Z(){var de;((de=oe().validateOnChange)!==null&&de!==void 0?de:wn().validateOnChange)&&a.nextTick(()=>{mt(G.path)})}const ie=a.computed(()=>{const de={onChange:Z,onInput:U,onBlur:w};return Te(S)?Object.assign(Object.assign({},de),S(Ni(G,Ai)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},de),S.props(Ni(G,Ai))):de});return[pe(E,()=>{var de,me,ve;return(ve=(de=oe().validateOnModelUpdate)!==null&&de!==void 0?de:(me=wn())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),ie]}function $r(E){return Array.isArray(E)?E.map(S=>pe(S,!0)):pe(E)}function Nr(E,S){const[R,G]=kn(E,S);function oe(){G.value.onBlur()}function w(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onInput()}function U(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},G.value),{onBlur:oe,onInput:w,onChange:U,value:R.value}))}function Br(E,S){const[R,G]=kn(E,S),oe=x(a.toValue(E));function w(U){R.value=U}return a.computed(()=>{const U=Te(S)?S(Ni(oe,Ai)):S||{};return Object.assign({[U.model||"modelValue"]:R.value,[`onUpdate:${U.model||"modelValue"}`]:w},G.value)})}return Object.assign(Object.assign({},P),{values:a.readonly(c),handleReset:()=>qt(),submitForm:Wn})}function um(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!je(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function fm(t,e,n){const r=Ia(n),i=a.ref(r),o=a.ref(ge(r));function s(l,c=!1){i.value=Ar(ge(i.value)||{},ge(l)),o.value=Ar(ge(o.value)||{},ge(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=qe(i.value,d.path);Lt(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function hm(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const pm=a.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetField:B}=dm({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),I=y((x,{evt:A})=>{ba(A)&&A.target.submit()},t.onInvalidSubmit),_=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):I;function T(x){qo(x)&&x.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function L(x,A){return y(typeof x=="function"&&!A?x:A,t.onInvalidSubmit)(x)}function H(){return ge(s)}function Y(){return ge(l.value)}function W(){return ge(i.value)}function N(){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:L,handleReset:m,submitForm:I,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,resetField:B,getValues:H,getMeta:Y,getErrors:W}}return e.expose({setFieldError:v,setErrors:b,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,validate:h,validateField:p,resetField:B,getValues:H,getMeta:Y,getErrors:W,values:s,meta:l,errors:i}),function(){const A=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,V=Xo(A,e,N);if(!A)return V;const K=A==="form"?{novalidate:!0}:{};return a.h(A,Object.assign(Object.assign(Object.assign({},K),e.attrs),{onSubmit:_,onReset:T}),V)}}}),mm=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=Xo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function gm(t){const e=Jo(Dr),n=t?void 0:a.inject(ga);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}yt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),yt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),yt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),yt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),yt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),yt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),yt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),yt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),yt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),yt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),yt("number",t=>parseFloat(t)?!0:"This field must be a number");const ae=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},ym={},bm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},km=[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 xm(t,e){return a.openBlock(),a.createElementBlock("svg",bm,km)}const wm=ae(ym,[["render",xm]]),vm={},Cm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Sm=[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 Em(t,e){return a.openBlock(),a.createElementBlock("svg",Cm,Sm)}const Om=ae(vm,[["render",Em]]),Mm={class:"relative"},Jn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",Mm,[a.createVNode(wm,{class:"absolute opacity-25"}),a.createVNode(Om,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ne={theme:"wpic-tools",popoverTarget:"body"};const Tm=["is","type","disabled"],$m={key:0,class:"absolute inset-0 flex justify-center items-center"},Nm={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},Bm=["onClick"],Pr=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=b=>{r.value&&!r.value.contains(b.target)&&n.value&&!n.value.contains(b.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"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(b,v)=>{var M;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:v[0]||(v[0]=k=>{var O;return(O=t.actions)!=null&&O.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(ne).theme]}`]:!0,[`${u[a.unref(ne).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(ne).theme]}`]:t.secondary,[`${p[a.unref(ne).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(ne).theme]}`]:t.primary&&t.plain,[`${y[a.unref(ne).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(ne).theme]}`]:t.colorless,[`${h[a.unref(ne).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(ne).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(ne).theme]}`]:t.destructive&&t.colorless,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",$m,[a.createVNode(Jn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(M=t.actions)!=null&&M.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",Nm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,k=>(a.openBlock(),a.createElementBlock("div",{onClick:k.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(k.label),9,Bm))),256))])],512)):a.createCommentVNode("",!0)],10,Tm)}}}),Am=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(ne).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),Vm={name:"WpicInputGroup"},Dm={class:"wpic-input-group flex w-full"};function _m(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",Dm,[a.renderSlot(t.$slots,"default")])}const Lm=ae(Vm,[["render",_m]]),Im=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(pm),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Gn=Math.max,Vi=Math.round,Gt=t=>({x:t,y:t}),Pm={left:"right",right:"left",bottom:"top",top:"bottom"},Rm={start:"end",end:"start"};function ns(t,e,n){return Gn(t,Rr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function Pa(t){return t==="x"?"y":"x"}function rs(t){return t==="y"?"height":"width"}function Di(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function is(t){return Pa(Di(t))}function zm(t,e,n){n===void 0&&(n=!1);const r=jr(t),i=is(t),o=rs(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_i(s)),[s,_i(s)]}function jm(t){const e=_i(t);return[ss(t),e,ss(e)]}function ss(t){return t.replace(/start|end/g,e=>Rm[e])}function Fm(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 Hm(t,e,n,r){const i=jr(t);let o=Fm(Cn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ss)))),o}function _i(t){return t.replace(/left|right|bottom|top/g,e=>Pm[e])}function Wm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ra(t){return typeof t!="number"?Wm(t):{top:t,right:t,bottom:t,left:t}}function Li(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function za(t,e,n){let{reference:r,floating:i}=t;const o=Di(e),s=is(e),l=rs(s),c=Cn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(jr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Um=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=za(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:v,y:M,data:k,reset:O}=await b({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=v??u,f=M??f,p={...p,[y]:{...p[y],...k}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(d=O.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=za(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ja(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zr(e,t),m=Ra(p),y=l[h?f==="floating"?"reference":"floating":f],b=Li(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(M))?await(o.getScale==null?void 0:o.getScale(M))||{x:1,y:1}:{x:1,y:1},O=Li(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:M,strategy:c}):v);return{top:(b.top-O.top+m.top)/k.y,bottom:(O.bottom-b.bottom+m.bottom)/k.y,left:(b.left-O.left+m.left)/k.x,right:(O.right-b.right+m.right)/k.x}}const qm=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=zr(t,e)||{};if(d==null)return{};const f=Ra(u),h={x:n,y:r},p=is(i),m=rs(p),g=await s.getDimensions(d),y=p==="y",b=y?"top":"left",v=y?"bottom":"right",M=y?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-h[p]-o.floating[m],O=h[p]-o.reference[p],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let B=C?C[M]:0;(!B||!await(s.isElement==null?void 0:s.isElement(C)))&&(B=l.floating[M]||o.floating[m]);const I=k/2-O/2,_=B/2-g[m]/2-1,T=Rr(f[b],_),L=Rr(f[v],_),H=T,Y=B-g[m]-L,W=B/2-g[m]/2+I,N=ns(H,W,Y),x=!c.arrow&&jr(i)!=null&&W!==N&&o.reference[m]/2-(W<H?T:L)-g[m]/2<0,A=x?W<H?W-H:W-Y:0;return{[p]:h[p]+A,data:{[p]:N,centerOffset:W-N-A,...x&&{alignmentOffset:A}},reset:x}}}),Km=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=zr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Cn(i),v=Cn(l)===l,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=h||(v||!g?[_i(l)]:jm(l));!h&&m!=="none"&&k.push(...Hm(l,g,m,M));const O=[l,...k],C=await ja(e,y),B=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&B.push(C[b]),f){const H=zm(i,s,M);B.push(C[H[0]],C[H[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(H=>H<=0)){var _,T;const H=(((_=o.flip)==null?void 0:_.index)||0)+1,Y=O[H];if(Y)return{data:{index:H,overflows:I},reset:{placement:Y}};let W=(T=I.filter(N=>N.overflows[0]<=0).sort((N,x)=>N.overflows[1]-x.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var L;const N=(L=I.map(x=>[x.placement,x.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((x,A)=>x[1]-A[1])[0])==null?void 0:L[0];N&&(W=N);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function Ym(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Cn(n),l=jr(n),c=Di(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=zr(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Jm=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 Ym(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}}}}},Gm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...c}=zr(t,e),d={x:n,y:r},u=await ja(e,c),f=Di(Cn(i)),h=Pa(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[y],M=p-u[b];p=ns(v,p,M)}if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=m+u[y],M=m-u[b];m=ns(v,m,M)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function Sn(t){return ls(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zt(t){var e;return(e=(ls(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ls(t){return t instanceof Node||t instanceof Qe(t).Node}function Ct(t){return t instanceof Element||t instanceof Qe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function Fa(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Zm(t){return["table","td","th"].includes(Sn(t))}function as(t){const e=cs(),n=kt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Xm(t){let e=Xt(t);for(;St(e)&&!Zn(e);){if(as(e))return e;e=Xt(e)}return null}function cs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(t){return["html","body","#document"].includes(Sn(t))}function kt(t){return Qe(t).getComputedStyle(t)}function Ii(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xt(t){if(Sn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||Zt(t);return Fa(e)?e.host:e}function Ha(t){const e=Xt(t);return Zn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Ha(e)}function ds(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ha(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?ds(s.frameElement):[]):e.concat(i,ds(i,[],n))}function Wa(t){const e=kt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Vi(n)!==o||Vi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ua(t){return Ct(t)?t:t.contextElement}function Xn(t){const e=Ua(t);if(!St(e))return Gt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wa(e);let s=(o?Vi(n.width):n.width)/r,l=(o?Vi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Qm=Gt(0);function qa(t){const e=Qe(t);return!cs()||!e.visualViewport?Qm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function eg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ua(t);let s=Gt(1);e&&(r?Ct(r)&&(s=Xn(r)):s=Xn(t));const l=eg(o,n,r)?qa(o):Gt(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Qe(o),p=r&&Ct(r)?Qe(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Xn(g),b=g.getBoundingClientRect(),v=kt(g),M=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,k=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=M,d+=k,m=Qe(g),g=m.frameElement}}return Li({width:u,height:f,x:c,y:d})}const tg=[":popover-open",":modal"];function us(t){return tg.some(e=>{try{return t.matches(e)}catch{return!1}})}function ng(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Zt(r),l=e?us(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=St(r);if((f||!f&&!o)&&((Sn(r)!=="body"||Fr(s))&&(c=Ii(r)),St(r))){const h=Hr(r);d=Xn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function rg(t){return Array.from(t.getClientRects())}function Ka(t){return Hr(Zt(t)).left+Ii(t).scrollLeft}function ig(t){const e=Zt(t),n=Ii(t),r=t.ownerDocument.body,i=Gn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(t);const l=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=Gn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function og(t,e){const n=Qe(t),r=Zt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=cs();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function sg(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Xn(t):Gt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function Ya(t,e,n){let r;if(e==="viewport")r=og(t,n);else if(e==="document")r=ig(Zt(t));else if(Ct(e))r=sg(e,n);else{const i=qa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Li(r)}function Ja(t,e){const n=Xt(t);return n===e||!Ct(n)||Zn(n)?!1:kt(n).position==="fixed"||Ja(n,e)}function lg(t,e){const n=e.get(t);if(n)return n;let r=ds(t,[],!1).filter(l=>Ct(l)&&Sn(l)!=="body"),i=null;const o=kt(t).position==="fixed";let s=o?Xt(t):t;for(;Ct(s)&&!Zn(s);){const l=kt(s),c=as(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ja(t,s))?r=r.filter(u=>u!==s):i=l,s=Xt(s)}return e.set(t,r),r}function ag(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?us(e)?[]:lg(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=Ya(e,u,i);return d.top=Gn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Gn(f.left,d.left),d},Ya(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function cg(t){const{width:e,height:n}=Wa(t);return{width:e,height:n}}function dg(t,e,n){const r=St(e),i=Zt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);if(r||!r&&!o)if((Sn(e)!=="body"||Fr(i))&&(l=Ii(e)),r){const f=Hr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Ka(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function fs(t){return kt(t).position==="static"}function Ga(t,e){return!St(t)||kt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Za(t,e){const n=Qe(t);if(us(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!Zn(i);){if(Ct(i)&&!fs(i))return i;i=Xt(i)}return n}let r=Ga(t,e);for(;r&&Zm(r)&&fs(r);)r=Ga(r,e);return r&&Zn(r)&&fs(r)&&!as(r)?n:r||Xm(t)||n}const ug=async function(t){const e=this.getOffsetParent||Za,n=this.getDimensions,r=await n(t.floating);return{reference:dg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fg(t){return kt(t).direction==="rtl"}const hg={convertOffsetParentRelativeRectToViewportRelativeRect:ng,getDocumentElement:Zt,getClippingRect:ag,getOffsetParent:Za,getElementRects:ug,getClientRects:rg,getDimensions:cg,getScale:Xn,isElement:Ct,isRTL:fg},Xa=Jm,Qa=Gm,ec=Km,pg=qm,tc=(t,e,n)=>{const r=new Map,i={platform:hg,...n},o={...i.platform,_c:r};return Um(t,e,{...i,platform:o})};function mg(t){return t!=null&&typeof t=="object"&&"$el"in t}function gg(t){if(mg(t)){const e=t.$el;return ls(e)&&Sn(e)==="#comment"?null:e}return t}function yg(t){return{name:"arrow",options:t,fn(e){const n=gg(a.unref(t.element));return n==null?{}:pg({element:n,padding:t.padding}).fn(e)}}}const bg={},kg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},xg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function wg(t,e){return a.openBlock(),a.createElementBlock("svg",kg,xg)}const Wr=ae(bg,[["render",wg]]);let Pi;const vg=new Uint8Array(16);function Cg(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(vg)}const Ve=[];for(let t=0;t<256;++t)Ve.push((t+256).toString(16).slice(1));function Sg(t,e=0){return Ve[t[e+0]]+Ve[t[e+1]]+Ve[t[e+2]]+Ve[t[e+3]]+"-"+Ve[t[e+4]]+Ve[t[e+5]]+"-"+Ve[t[e+6]]+Ve[t[e+7]]+"-"+Ve[t[e+8]]+Ve[t[e+9]]+"-"+Ve[t[e+10]]+Ve[t[e+11]]+Ve[t[e+12]]+Ve[t[e+13]]+Ve[t[e+14]]+Ve[t[e+15]]}const nc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hs(t,e,n){if(nc.randomUUID&&!t)return nc.randomUUID();t=t||{};const r=t.random||(t.rng||Cg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Sg(r)}let Eg={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const En=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=hs(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(b){if(d.value)u();else{if(o.noCloseClasses.some(v=>b.target.closest(`.${v}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const b=await tc(l.value,c.value,{placement:o.placement,middleware:[ec(),Qa(),Xa(o.offset)]});c.value.style.left=`${b.x}px`,c.value.style.top=`${b.y}px`}const m=b=>{c.value&&!c.value.contains(b.target)&&l.value&&!l.value.contains(b.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",b=>{b.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(b,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:g,onMouseleave:y,onClick:v[0]||(v[0]=a.withModifiers(M=>f(M),["stop"]))},[a.renderSlot(b.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(ne).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(ne).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(b.$slots,"content")],6))],8,["to"]))],64))}}),Og={},Mg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Tg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function $g(t,e){return a.openBlock(),a.createElementBlock("svg",Mg,Tg)}const rc=ae(Og,[["render",$g]]),Ng={},Bg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ag=[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 Vg(t,e){return a.openBlock(),a.createElementBlock("svg",Bg,Ag)}const ps=ae(Ng,[["render",Vg]]),Dg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},_g={class:"flex items-center gap-2"},Lg={key:0},Ig={class:""},Pg={class:"flex justify-end"},Rg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},zg={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},jg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Ur=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",Dg,[a.createElementVNode("div",_g,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Lg,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Ig,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Pg,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(ne).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(ne).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Rg,[a.createElementVNode("div",zg,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",jg,[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=Fg,Hg=typeof On=="object"&&On&&On.Object===Object&&On,ic=Hg,Wg=ic,Ug=typeof self=="object"&&self&&self.Object===Object&&self,qg=Wg||Ug||Function("return this")(),Et=qg,Kg=Et,Yg=function(){return Kg.Date.now()},Jg=Yg,Gg=/\s/;function Zg(t){for(var e=t.length;e--&&Gg.test(t.charAt(e)););return e}var Xg=Zg,Qg=Xg,e0=/^\s+/;function t0(t){return t&&t.slice(0,Qg(t)+1).replace(e0,"")}var n0=t0,r0=Et,i0=r0.Symbol,ms=i0,oc=ms,sc=Object.prototype,o0=sc.hasOwnProperty,s0=sc.toString,Kr=oc?oc.toStringTag:void 0;function l0(t){var e=o0.call(t,Kr),n=t[Kr];try{t[Kr]=void 0;var r=!0}catch{}var i=s0.call(t);return r&&(e?t[Kr]=n:delete t[Kr]),i}var a0=l0,c0=Object.prototype,d0=c0.toString;function u0(t){return d0.call(t)}var f0=u0,lc=ms,h0=a0,p0=f0,m0="[object Null]",g0="[object Undefined]",ac=lc?lc.toStringTag:void 0;function y0(t){return t==null?t===void 0?g0:m0:ac&&ac in Object(t)?h0(t):p0(t)}var Yr=y0;function b0(t){return t!=null&&typeof t=="object"}var Jr=b0,k0=Yr,x0=Jr,w0="[object Symbol]";function v0(t){return typeof t=="symbol"||x0(t)&&k0(t)==w0}var C0=v0,S0=n0,cc=Ri,E0=C0,dc=NaN,O0=/^[-+]0x[0-9a-f]+$/i,M0=/^0b[01]+$/i,T0=/^0o[0-7]+$/i,$0=parseInt;function N0(t){if(typeof t=="number")return t;if(E0(t))return dc;if(cc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=S0(t);var n=M0.test(t);return n||T0.test(t)?$0(t.slice(2),n?2:8):O0.test(t)?dc:+t}var B0=N0,A0=Ri,gs=Jg,uc=B0,V0="Expected a function",D0=Math.max,_0=Math.min;function L0(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(V0);e=uc(e)||0,A0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?D0(uc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(C){var B=r,I=i;return r=i=void 0,d=C,s=t.apply(I,B),s}function m(C){return d=C,l=setTimeout(b,e),u?p(C):s}function g(C){var B=C-c,I=C-d,_=e-B;return f?_0(_,o-I):_}function y(C){var B=C-c,I=C-d;return c===void 0||B>=e||B<0||f&&I>=o}function b(){var C=gs();if(y(C))return v(C);l=setTimeout(b,g(C))}function v(C){return l=void 0,h&&r?p(C):(r=i=void 0,s)}function M(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function k(){return l===void 0?s:v(gs())}function O(){var C=gs(),B=y(C);if(r=arguments,i=this,c=C,B){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),s}return O.cancel=M,O.flush=k,O}var I0=L0;const fc=qr(I0);function P0(){this.__data__=[],this.size=0}var R0=P0;function z0(t,e){return t===e||t!==t&&e!==e}var hc=z0,j0=hc;function F0(t,e){for(var n=t.length;n--;)if(j0(t[n][0],e))return n;return-1}var zi=F0,H0=zi,W0=Array.prototype,U0=W0.splice;function q0(t){var e=this.__data__,n=H0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():U0.call(e,n,1),--this.size,!0}var K0=q0,Y0=zi;function J0(t){var e=this.__data__,n=Y0(e,t);return n<0?void 0:e[n][1]}var G0=J0,Z0=zi;function X0(t){return Z0(this.__data__,t)>-1}var Q0=X0,ey=zi;function ty(t,e){var n=this.__data__,r=ey(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ny=ty,ry=R0,iy=K0,oy=G0,sy=Q0,ly=ny;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=ry,Qn.prototype.delete=iy,Qn.prototype.get=oy,Qn.prototype.has=sy,Qn.prototype.set=ly;var ji=Qn,ay=ji;function cy(){this.__data__=new ay,this.size=0}var dy=cy;function uy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var fy=uy;function hy(t){return this.__data__.get(t)}var py=hy;function my(t){return this.__data__.has(t)}var gy=my,yy=Yr,by=Ri,ky="[object AsyncFunction]",xy="[object Function]",wy="[object GeneratorFunction]",vy="[object Proxy]";function Cy(t){if(!by(t))return!1;var e=yy(t);return e==xy||e==wy||e==ky||e==vy}var pc=Cy,Sy=Et,Ey=Sy["__core-js_shared__"],Oy=Ey,ys=Oy,mc=function(){var t=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function My(t){return!!mc&&mc in t}var Ty=My,$y=Function.prototype,Ny=$y.toString;function By(t){if(t!=null){try{return Ny.call(t)}catch{}try{return t+""}catch{}}return""}var gc=By,Ay=pc,Vy=Ty,Dy=Ri,_y=gc,Ly=/[\\^$.*+?()[\]{}|]/g,Iy=/^\[object .+?Constructor\]$/,Py=Function.prototype,Ry=Object.prototype,zy=Py.toString,jy=Ry.hasOwnProperty,Fy=RegExp("^"+zy.call(jy).replace(Ly,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hy(t){if(!Dy(t)||Vy(t))return!1;var e=Ay(t)?Fy:Iy;return e.test(_y(t))}var Wy=Hy;function Uy(t,e){return t==null?void 0:t[e]}var qy=Uy,Ky=Wy,Yy=qy;function Jy(t,e){var n=Yy(t,e);return Ky(n)?n:void 0}var er=Jy,Gy=er,Zy=Et,Xy=Gy(Zy,"Map"),bs=Xy,Qy=er,e1=Qy(Object,"create"),Fi=e1,yc=Fi;function t1(){this.__data__=yc?yc(null):{},this.size=0}var n1=t1;function r1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var i1=r1,o1=Fi,s1="__lodash_hash_undefined__",l1=Object.prototype,a1=l1.hasOwnProperty;function c1(t){var e=this.__data__;if(o1){var n=e[t];return n===s1?void 0:n}return a1.call(e,t)?e[t]:void 0}var d1=c1,u1=Fi,f1=Object.prototype,h1=f1.hasOwnProperty;function p1(t){var e=this.__data__;return u1?e[t]!==void 0:h1.call(e,t)}var m1=p1,g1=Fi,y1="__lodash_hash_undefined__";function b1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=g1&&e===void 0?y1:e,this}var k1=b1,x1=n1,w1=i1,v1=d1,C1=m1,S1=k1;function tr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}tr.prototype.clear=x1,tr.prototype.delete=w1,tr.prototype.get=v1,tr.prototype.has=C1,tr.prototype.set=S1;var E1=tr,bc=E1,O1=ji,M1=bs;function T1(){this.size=0,this.__data__={hash:new bc,map:new(M1||O1),string:new bc}}var $1=T1;function N1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var B1=N1,A1=B1;function V1(t,e){var n=t.__data__;return A1(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Hi=V1,D1=Hi;function _1(t){var e=D1(this,t).delete(t);return this.size-=e?1:0,e}var L1=_1,I1=Hi;function P1(t){return I1(this,t).get(t)}var R1=P1,z1=Hi;function j1(t){return z1(this,t).has(t)}var F1=j1,H1=Hi;function W1(t,e){var n=H1(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var U1=W1,q1=$1,K1=L1,Y1=R1,J1=F1,G1=U1;function nr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=q1,nr.prototype.delete=K1,nr.prototype.get=Y1,nr.prototype.has=J1,nr.prototype.set=G1;var kc=nr,Z1=ji,X1=bs,Q1=kc,eb=200;function tb(t,e){var n=this.__data__;if(n instanceof Z1){var r=n.__data__;if(!X1||r.length<eb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Q1(r)}return n.set(t,e),this.size=n.size,this}var nb=tb,rb=ji,ib=dy,ob=fy,sb=py,lb=gy,ab=nb;function rr(t){var e=this.__data__=new rb(t);this.size=e.size}rr.prototype.clear=ib,rr.prototype.delete=ob,rr.prototype.get=sb,rr.prototype.has=lb,rr.prototype.set=ab;var cb=rr,db="__lodash_hash_undefined__";function ub(t){return this.__data__.set(t,db),this}var fb=ub;function hb(t){return this.__data__.has(t)}var pb=hb,mb=kc,gb=fb,yb=pb;function Wi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new mb;++e<n;)this.add(t[e])}Wi.prototype.add=Wi.prototype.push=gb,Wi.prototype.has=yb;var bb=Wi;function kb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var xb=kb;function wb(t,e){return t.has(e)}var vb=wb,Cb=bb,Sb=xb,Eb=vb,Ob=1,Mb=2;function Tb(t,e,n,r,i,o){var s=n&Ob,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&Mb?new Cb: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(!Sb(e,function(b,v){if(!Eb(p,v)&&(m===b||i(m,b,n,r,o)))return p.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var xc=Tb,$b=Et,Nb=$b.Uint8Array,Bb=Nb;function Ab(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Vb=Ab;function Db(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _b=Db,wc=ms,vc=Bb,Lb=hc,Ib=xc,Pb=Vb,Rb=_b,zb=1,jb=2,Fb="[object Boolean]",Hb="[object Date]",Wb="[object Error]",Ub="[object Map]",qb="[object Number]",Kb="[object RegExp]",Yb="[object Set]",Jb="[object String]",Gb="[object Symbol]",Zb="[object ArrayBuffer]",Xb="[object DataView]",Cc=wc?wc.prototype:void 0,ks=Cc?Cc.valueOf:void 0;function Qb(t,e,n,r,i,o,s){switch(n){case Xb:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Zb:return!(t.byteLength!=e.byteLength||!o(new vc(t),new vc(e)));case Fb:case Hb:case qb:return Lb(+t,+e);case Wb:return t.name==e.name&&t.message==e.message;case Kb:case Jb:return t==e+"";case Ub:var l=Pb;case Yb:var c=r&zb;if(l||(l=Rb),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=jb,s.set(t,e);var u=Ib(l(t),l(e),r,i,o,s);return s.delete(t),u;case Gb:if(ks)return ks.call(t)==ks.call(e)}return!1}var e2=Qb;function t2(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var n2=t2,r2=Array.isArray,xs=r2,i2=n2,o2=xs;function s2(t,e,n){var r=e(t);return o2(t)?r:i2(r,n(t))}var l2=s2;function a2(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var c2=a2;function d2(){return[]}var u2=d2,f2=c2,h2=u2,p2=Object.prototype,m2=p2.propertyIsEnumerable,Sc=Object.getOwnPropertySymbols,g2=Sc?function(t){return t==null?[]:(t=Object(t),f2(Sc(t),function(e){return m2.call(t,e)}))}:h2,y2=g2;function b2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var k2=b2,x2=Yr,w2=Jr,v2="[object Arguments]";function C2(t){return w2(t)&&x2(t)==v2}var S2=C2,Ec=S2,E2=Jr,Oc=Object.prototype,O2=Oc.hasOwnProperty,M2=Oc.propertyIsEnumerable,T2=Ec(function(){return arguments}())?Ec:function(t){return E2(t)&&O2.call(t,"callee")&&!M2.call(t,"callee")},$2=T2,Ui={exports:{}};function N2(){return!1}var B2=N2;Ui.exports,function(t,e){var n=Et,r=B2,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Ui,Ui.exports);var Mc=Ui.exports,A2=9007199254740991,V2=/^(?:0|[1-9]\d*)$/;function D2(t,e){var n=typeof t;return e=e??A2,!!e&&(n=="number"||n!="symbol"&&V2.test(t))&&t>-1&&t%1==0&&t<e}var _2=D2,L2=9007199254740991;function I2(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=L2}var Tc=I2,P2=Yr,R2=Tc,z2=Jr,j2="[object Arguments]",F2="[object Array]",H2="[object Boolean]",W2="[object Date]",U2="[object Error]",q2="[object Function]",K2="[object Map]",Y2="[object Number]",J2="[object Object]",G2="[object RegExp]",Z2="[object Set]",X2="[object String]",Q2="[object WeakMap]",ek="[object ArrayBuffer]",tk="[object DataView]",nk="[object Float32Array]",rk="[object Float64Array]",ik="[object Int8Array]",ok="[object Int16Array]",sk="[object Int32Array]",lk="[object Uint8Array]",ak="[object Uint8ClampedArray]",ck="[object Uint16Array]",dk="[object Uint32Array]",ke={};ke[nk]=ke[rk]=ke[ik]=ke[ok]=ke[sk]=ke[lk]=ke[ak]=ke[ck]=ke[dk]=!0,ke[j2]=ke[F2]=ke[ek]=ke[H2]=ke[tk]=ke[W2]=ke[U2]=ke[q2]=ke[K2]=ke[Y2]=ke[J2]=ke[G2]=ke[Z2]=ke[X2]=ke[Q2]=!1;function uk(t){return z2(t)&&R2(t.length)&&!!ke[P2(t)]}var fk=uk;function hk(t){return function(e){return t(e)}}var pk=hk,qi={exports:{}};qi.exports,function(t,e){var n=ic,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var mk=qi.exports,gk=fk,yk=pk,$c=mk,Nc=$c&&$c.isTypedArray,bk=Nc?yk(Nc):gk,Bc=bk,kk=k2,xk=$2,wk=xs,vk=Mc,Ck=_2,Sk=Bc,Ek=Object.prototype,Ok=Ek.hasOwnProperty;function Mk(t,e){var n=wk(t),r=!n&&xk(t),i=!n&&!r&&vk(t),o=!n&&!r&&!i&&Sk(t),s=n||r||i||o,l=s?kk(t.length,String):[],c=l.length;for(var d in t)(e||Ok.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ck(d,c)))&&l.push(d);return l}var Tk=Mk,$k=Object.prototype;function Nk(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$k;return t===n}var Bk=Nk;function Ak(t,e){return function(n){return t(e(n))}}var Vk=Ak,Dk=Vk,_k=Dk(Object.keys,Object),Lk=_k,Ik=Bk,Pk=Lk,Rk=Object.prototype,zk=Rk.hasOwnProperty;function jk(t){if(!Ik(t))return Pk(t);var e=[];for(var n in Object(t))zk.call(t,n)&&n!="constructor"&&e.push(n);return e}var Fk=jk,Hk=pc,Wk=Tc;function Uk(t){return t!=null&&Wk(t.length)&&!Hk(t)}var qk=Uk,Kk=Tk,Yk=Fk,Jk=qk;function Gk(t){return Jk(t)?Kk(t):Yk(t)}var Zk=Gk,Xk=l2,Qk=y2,ex=Zk;function tx(t){return Xk(t,ex,Qk)}var nx=tx,Ac=nx,rx=1,ix=Object.prototype,ox=ix.hasOwnProperty;function sx(t,e,n,r,i,o){var s=n&rx,l=Ac(t),c=l.length,d=Ac(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:ox.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var b=t[h],v=e[h];if(r)var M=s?r(v,b,h,e,t,o):r(b,v,h,t,e,o);if(!(M===void 0?b===v||i(b,v,n,r,o):M)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var k=t.constructor,O=e.constructor;k!=O&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof O=="function"&&O instanceof O)&&(g=!1)}return o.delete(t),o.delete(e),g}var lx=sx,ax=er,cx=Et,dx=ax(cx,"DataView"),ux=dx,fx=er,hx=Et,px=fx(hx,"Promise"),mx=px,gx=er,yx=Et,bx=gx(yx,"Set"),kx=bx,xx=er,wx=Et,vx=xx(wx,"WeakMap"),Cx=vx,ws=ux,vs=bs,Cs=mx,Ss=kx,Es=Cx,Vc=Yr,ir=gc,Dc="[object Map]",Sx="[object Object]",_c="[object Promise]",Lc="[object Set]",Ic="[object WeakMap]",Pc="[object DataView]",Ex=ir(ws),Ox=ir(vs),Mx=ir(Cs),Tx=ir(Ss),$x=ir(Es),Mn=Vc;(ws&&Mn(new ws(new ArrayBuffer(1)))!=Pc||vs&&Mn(new vs)!=Dc||Cs&&Mn(Cs.resolve())!=_c||Ss&&Mn(new Ss)!=Lc||Es&&Mn(new Es)!=Ic)&&(Mn=function(t){var e=Vc(t),n=e==Sx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case Ex:return Pc;case Ox:return Dc;case Mx:return _c;case Tx:return Lc;case $x:return Ic}return e});var Nx=Mn,Os=cb,Bx=xc,Ax=e2,Vx=lx,Rc=Nx,zc=xs,jc=Mc,Dx=Bc,_x=1,Fc="[object Arguments]",Hc="[object Array]",Ki="[object Object]",Lx=Object.prototype,Wc=Lx.hasOwnProperty;function Ix(t,e,n,r,i,o){var s=zc(t),l=zc(e),c=s?Hc:Rc(t),d=l?Hc:Rc(e);c=c==Fc?Ki:c,d=d==Fc?Ki:d;var u=c==Ki,f=d==Ki,h=c==d;if(h&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Os),s||Dx(t)?Bx(t,e,n,r,i,o):Ax(t,e,c,n,r,i,o);if(!(n&_x)){var p=u&&Wc.call(t,"__wrapped__"),m=f&&Wc.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Os),i(g,y,n,r,o)}}return h?(o||(o=new Os),Vx(t,e,n,r,i,o)):!1}var Px=Ix,Rx=Px,Uc=Jr;function qc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Uc(t)&&!Uc(e)?t!==t&&e!==e:Rx(t,e,n,r,qc,i)}var zx=qc,jx=zx;function Fx(t,e){return jx(t,e)}var Hx=Fx;const Kc=qr(Hx),Wx={},Ux={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},qx=[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 Kx(t,e){return a.openBlock(),a.createElementBlock("svg",Ux,qx)}const Yx=ae(Wx,[["render",Kx]]),Jx={key:0,class:"leading-none"},Gx={key:1},Zx={class:"flex flex-col max-h-80 overflow-y-auto"},Xx={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Qx={key:1},ew={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},tw=["onClick"],nw={class:"select-none flex w-full items-center justify-between"},Yc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var k;(k=r.options)!=null&&k.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(k){var O,C;if(r.multiple){if(k){let B=r.modelValue||[];B.indexOf(k)>=0?B.splice(B.indexOf(k),1):B.push(k),s("update:modelValue",B),p(B),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)?i.value=!0:i.value=!1}}else s("update:modelValue",k),p(k),l.value=null,c.value.hide()}async function u(k){var O,C;s("update:modelValue",k),p(k),await a.nextTick(),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)&&(i.value=!0)}function f(k){s("update:modelValue",k),i.value=!1,p(k)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=fc(function(k){s("change",k)},r.debounce),m=a.computed(()=>{var k,O,C,B;if(r.multiple)if(r.maxDisplay){let I=(O=o.value)==null?void 0:O.filter(T=>{var L;return((L=r.modelValue)==null?void 0:L.indexOf(T.value))>=0}).map(T=>T.label),_=I==null?void 0:I.slice(0,r.maxDisplay);return(I==null?void 0:I.length)-(_==null?void 0:_.length)>0?(_==null?void 0:_.join(", "))+` (+${(I==null?void 0:I.length)-_.length})`:_==null?void 0:_.join(", ")}else return(k=o.value)==null?void 0:k.filter(I=>{var _;return((_=r.modelValue)==null?void 0:_.indexOf(I.value))>=0}).map(I=>I.label).join(", ");else return((B=(C=o.value)==null?void 0:C.find(I=>I.value===r.modelValue))==null?void 0:B.label)||r.modelValue});function g(k){var O;try{return r.multiple?r.modelValue!==null&&((O=r.modelValue)==null?void 0:O.some(C=>Kc(C,k))):r.modelValue!==null&&Kc(k,r.modelValue)}catch(C){return console.log(C),!1}}const y={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},b=a.computed(()=>{var k,O;return((k=r.modelValue)==null?void 0:k.length)===((O=r.options)==null?void 0:O.length)}),v=a.computed(()=>{var k;if(r.filterable&&!r.remoteMethod&&((k=l.value)!=null&&k.trim().length)){const O=l.value.trim().toLowerCase();return r.options.filter(C=>{var B;return(B=C.label)==null?void 0:B.toLowerCase().includes(O)})}return r.options});function M(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:b}),(k,O)=>(a.openBlock(),a.createBlock(En,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:C})=>[a.createVNode(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var B,I,_,T,L,H;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&&((B=t.modelValue)==null?void 0:B.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Jx,[b.value&&((I=t.allSelectedText)!=null&&I.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((_=t.options)==null?void 0:_.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((T=t.options)!=null&&T.find(Y=>Y.value===null))?(a.openBlock(),a.createElementBlock("span",Gx,a.toDisplayString((H=(L=t.options)==null?void 0:L.find(Y=>Y.value===null))==null?void 0:H.label),1)):a.renderSlot(k.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Yx,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var C;return[a.createElementVNode("div",Zx,[t.filterable?(a.openBlock(),a.createElementBlock("div",Xx,[a.createVNode(Xc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[O[0]||(O[0]=B=>l.value=B),M]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((C=t.options)==null?void 0:C.length)==0?(a.openBlock(),a.createElementBlock("span",Qx,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",ew,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[1]||(O[1]=B=>{var I;return u((I=v.value)==null?void 0:I.filter(_=>_.value).map(_=>_.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[2]||(O[2]=B=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.value,B=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!g(B.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||B.value,[`${y[a.unref(ne).theme]}`]:!0}]),onClick:I=>B.disabled?null:d(B.value)},[a.createElementVNode("div",nw,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":B.disabled}])},a.toDisplayString(B.label||B.value),3),t.multiple&&g(B.value)?(a.openBlock(),a.createBlock(rc,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,tw)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Jc=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),rw={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},iw={class:""},ow=["value","disabled","rows","placeholder"],Gc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",rw,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",iw,[d.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:a.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,ow)],64))}}),sw=["placeholder"],Zc={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,sw),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},lw={},aw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},cw=[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 dw(t,e){return a.openBlock(),a.createElementBlock("svg",aw,cw)}const uw=ae(lw,[["render",dw]]),fw={},hw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},pw=[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 mw(t,e){return a.openBlock(),a.createElementBlock("svg",hw,pw)}const gw=ae(fw,[["render",mw]]),yw={},bw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function xw(t,e){return a.openBlock(),a.createElementBlock("svg",bw,kw)}const ww=ae(yw,[["render",xw]]),vw={class:"flex items-center gap-2"},Cw={key:0},Sw={class:""},Ew=["innerHTML"],Ow={class:"flex justify-end"},Mw=["name","value","checked"],Tw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},$w={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Nw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},Bw={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Xc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:hs()),l=gm(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 T;if(o.rules&&typeof o.rules=="string"){let L=(T=o.rules)==null?void 0:T.split("|");return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}else if(!o.rules){let L=[];return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}return"required"});function p(T){let L=T&&T.target?T.target.value:T;v(L)}const m=n;function g(T){T===!0||T===!1?m("update:modelValue",!T):m("update:modelValue",T)}function y(T){let L=T&&T.target?T.target.value:T;m("update:modelValue",L),m("onChange",L)}function b(){m("update:modelValue",null),m("onChange",null),m("onClear")}const v=fc(function(T){m("update:modelValue",T),m("onChange",T)},o.debounce),M=a.ref(null),k=a.ref();function O(){var T,L;o.textarea?(T=k.value)==null||T.focus():(L=M.value)==null||L.$el.focus()}function C(){return M.value.meta.valid}const B=a.ref(),I=a.computed(()=>B.value.allSelected),_=a.computed(()=>B.value.isAllSelected);return e({focus:O,isValid:C,allSelected:I,isAllSelected:_}),(T,L)=>(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",vw,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Cw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Sw,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,Ew)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ow,[a.renderSlot(T.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[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:L[0]||(L[0]=Y=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(ne).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(rc,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(T.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[a.createElementVNode("div",{onClick:L[2]||(L[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:L[1]||(L[1]=(...Y)=>T.onChange&&T.onChange(...Y)),checked:t.radioValue==t.modelValue},null,40,Mw),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(vn),{key:3,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>{var Y;return[a.createVNode(Yc,{ref_key:"myChoiceList",ref:B,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((Y=h.value)==null?void 0:Y.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(vn),{key:4,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Zc,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(vn),{key:5,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Jc,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(ne).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[T.$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",Tw,[a.renderSlot(T.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var H;return[a.createVNode(Gc,{ref_key:"myTextarea",ref:k,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((H=h.value)==null?void 0:H.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,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":!T.$slots.prepend&&!t.naked,"pl-8":T.$slots.prepend&&!t.naked,"pl-6":T.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(b,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(b,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),T.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",$w,[a.createElementVNode("div",Nw,[a.renderSlot(T.$slots,"append",{},()=>[a.withDirectives(a.createVNode(uw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(gw,{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",Bw,[a.createVNode(a.unref(mm),{name:s.value},{default:a.withCtx(H=>[a.createTextVNode(a.toDisplayString(H.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),T.$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(T.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),Aw=["innerHTML"],Qc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();hs();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await tc(e.value,n.value,{placement:i.placement,middleware:[ec(),Qa(),Xa(i.offset),yg({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,Aw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),Vw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},Dw={class:""},_w={key:2,class:"flex items-center justify-end py-4 px-6"},Lw=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(ne).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",Vw,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(ne).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",Dw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",_w,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),Iw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Pw={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},Rw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(ne).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",Iw,[a.createElementVNode("div",Pw,[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))}}),zw=a.createElementVNode("div",{class:""},null,-1),jw=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),Fw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(ne).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createVNode(Qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[zw]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[jw],64)):a.createCommentVNode("",!0)],2))}}),Hw={class:"leading-none"},Ww=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(ne).theme]]:!0}])},[a.createElementVNode("span",Hw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Uw=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))}}),qw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),Kw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Yw=[qw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Jw=ae(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",Kw,Yw)):(a.openBlock(),a.createBlock(Jn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Gw={class:"text-base font-medium select-none"},Gr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(ne).theme]]:!t.active&&!t.disabled,[n[a.unref(ne).theme]]:t.active&&!t.disabled,[r[a.unref(ne).theme]]:t.disabled}])},[a.createElementVNode("span",Gw,[a.renderSlot(i.$slots,"default")])],2))}}),Zw={},Xw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Qw=[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 ev(t,e){return a.openBlock(),a.createElementBlock("svg",Xw,Qw)}const ed=ae(Zw,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},rv=[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 iv(t,e){return a.openBlock(),a.createElementBlock("svg",nv,rv)}const td=ae(tv,[["render",iv]]),ov={},sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},lv=[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 av(t,e){return a.openBlock(),a.createElementBlock("svg",sv,lv)}const nd=ae(ov,[["render",av]]),cv={},dv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},uv=[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 fv(t,e){return a.openBlock(),a.createElementBlock("svg",dv,uv)}const rd=ae(cv,[["render",fv]]),hv={class:"wpic-pagination flex justify-between"},pv={key:0,class:"flex items-center"},mv={class:"font-medium"},gv=a.createElementVNode("span",{class:"px-1"},"to",-1),yv={class:"font-medium"},bv=a.createElementVNode("span",{class:"px-1"},"of",-1),kv={class:"font-medium"},xv={class:"pl-1"},wv={key:1,class:"flex flex-wrap gap-2"},vv=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 r=t,i=a.computed(()=>r.perPageOptions.map(h=>({value:Number(h),label:`${h} per page`}))),o=n,s=a.computed(()=>Math.ceil(r.total/r.perPage)),l=a.computed(()=>{const h=s.value;if(!h||h===1)return[1];const p=r.currentPage,m=1;let g=Math.max(2,p-m),y=Math.min(h-1,p+m);p<=m+2&&(g=2,y=Math.min(2*m+2,h-1)),p>=h-m-1&&(g=Math.max(2,h-2*m-1),y=h-1);const b=[];for(let v=g;v<=y;v++)b.push(v);return g>2&&b.unshift("..."),y<h-1&&b.push("..."),[1,...b,h]});function c(h){h>=1&&h<=s.value&&o("update:currentPage",h)}function d(){return r.perPage*(r.currentPage-1)+1}function u(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}async function f(h){o("update:perPage",h),o("update:currentPage",1)}return e({getStart:d,getEnd:u}),(h,p)=>{const m=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",hv,[t.info?(a.openBlock(),a.createElementBlock("div",pv,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",mv,a.toDisplayString(d()),1),gv,a.createElementVNode("span",yv,a.toDisplayString(u()),1),t.total?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[bv,a.createElementVNode("span",kv,a.toDisplayString(t.total),1),a.createElementVNode("span",xv,"result"+a.toDisplayString(t.total>1?"s":""),1)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",wv,[a.createVNode(Gr,{onClick:p[0]||(p[0]=g=>c(1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(ed,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[1]||(p[1]=g=>c(t.currentPage-1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(td,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,g=>(a.openBlock(),a.createBlock(Gr,{key:`page_${g}`,onClick:y=>c(g),active:g===t.currentPage,disabled:s.value==0||!s.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(g),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Gr,{onClick:p[2]||(p[2]=g=>c(t.currentPage+1)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(rd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[3]||(p[3]=g=>c(s.value)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(nd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(m,{key:0,modelValue:t.perPage,"onUpdate:modelValue":f,options:i.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),id=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return a.h("td",e.attrs,n)};id.props=["column","item","rowIndex"];const Yi=id,Cv={},Sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Ev=[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 Ov(t,e){return a.openBlock(),a.createElementBlock("svg",Sv,Ev)}const Mv=ae(Cv,[["render",Ov]]),Tv={class:"font-semibold"},od={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",Tv,[t.checkable?(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},$v={},Nv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},Bv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function Av(t,e){return a.openBlock(),a.createElementBlock("svg",Nv,Bv)}const Vv=ae($v,[["render",Av]]),Dv={},_v={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Lv=[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 Iv(t,e){return a.openBlock(),a.createElementBlock("svg",_v,Lv)}const Pv=ae(Dv,[["render",Iv]]),Rv={class:"wpic-table"},zv={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},jv={class:"flex items-center gap-2"},Fv={class:"flex items-center gap-2"},Hv={class:"w-full rounded-lg"},Wv={key:0,class:"w-16"},Uv=["width"],qv=["width"],Kv={class:"flex justify-center items-center h-full"},Yv=["onClick"],Jv={class:"rounded-b-lg relative"},Gv={key:0},Zv=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],Xv={class:"flex justify-center items-center h-full"},Qv={key:1},e5={key:0,class:"text-center text-gray-400 py-3"},t5=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;a.onMounted(()=>{b()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter(H=>g.value.includes(H.field)||!H.selectable):m.value.filter(H=>H.visible||!H.selectable));function b(){const H=(N,x)=>{let A={};for(let V in N){if(typeof N[V].default=="boolean"&&x[V]!==void 0){A[V]=x[V]!==!1;continue}if(x[V]!==void 0){A[V]=x[V];continue}if(typeof N[V].default=="function"){A[V]=N[V].default();continue}A[V]=N[V].default}return A};let Y=[];(p.default&&p.default()||[]).forEach(N=>{var x,A;((x=N.type)==null?void 0:x.name)==="WpicTableColumn"?Y.push(N):(A=N.children)!=null&&A.length&&N.children.forEach(V=>{var K;((K=V.type)==null?void 0:K.name)==="WpicTableColumn"&&Y.push(V)})}),m.value=Y.map(N=>{let x=N.children,A=N.props||{},{field:V,label:K,help:Q,width:$,minWidth:F,maxWidth:D,sortable:ee,selectable:q,render:P,type:X,align:he,visible:le,noPadding:pe}=H(N.type.props,A);return V||(V=L(K)),q&&le&&g.value.push(V),{label:K,help:Q,width:$,minWidth:F,maxWidth:D,type:X,align:he,sortable:ee,selectable:q,field:V,render:P,children:x,visible:le,noPadding:pe}})}function v(H){var W,N;let Y=(W=r.sortOptions)==null?void 0:W.sortDirection;((N=r.sortOptions)==null?void 0:N.sortBy)===H&&(Y=Y==="asc"?"desc":"asc"),f("changeSort",{sortDirection:Y,sortBy:H})}a.watch(()=>p.default,H=>{b()},{deep:!0});const M=a.reactive({});function k({index:H,item:Y}){M[H]?M[H]=null:(M[H]=!0,f("expandRow",{index:H,item:Y}))}const O=a.ref([]);function C(H){const Y=T(H,r.itemId);O.value.includes(Y)?(O.value.splice(O.value.indexOf(Y),1),B.value=!1):O.value.push(Y)}const B=a.ref(!1);function I(){if(B.value=!B.value,O.value=[],B.value)for(let H of r.data){let Y=T(H,r.itemId);O.value.push(Y)}}function _(){B.value=!1,O.value=[]}e({buildColumns:b,selectedRows:O,selectedColumns:g,resetSelectedRows:_});function T(H,Y){return Y.split(".").reduce((W,N)=>W?W[N]:void 0,H)}function L(H){return!H||typeof H!="string"?"":H.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(H,Y)=>{const W=a.resolveComponent("wpic-choice-list"),N=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",Rv,[H.$slots.header||H.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",zv,[a.createElementVNode("div",jv,[a.renderSlot(H.$slots,"header")]),a.createElementVNode("div",Fv,[a.renderSlot(H.$slots,"actions"),a.createVNode(W,{multiple:"",modelValue:g.value,"onUpdate:modelValue":Y[0]||(Y[0]=x=>g.value=x),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(x=>x.selectable).map(x=>({label:x.label,value:x.field}))},{default:a.withCtx(()=>[a.createVNode(Pr,{medium:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(Pv,{class:"w-5 h-5 mr-2"}),a.createTextVNode(" Columns ")]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",Hv,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",Wv)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(x=>x.type=="expand").minWidth}px`}),width:y.value.find(x=>x.type=="expand").width,class:"w-16"},null,12,Uv)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${x.minWidth}px`,maxWidth:`${x.maxWidth}px`}),width:x.width,key:A},null,12,qv))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},[a.createElementVNode("div",Kv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:B.value,"onUpdate:modelValue":I},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>{var V,K;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(ne).theme]}`]:!0,"sticky top-0 left-0":A===0}]),style:a.normalizeStyle({maxWidth:`${x.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{x.sortable&&v(x.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":x.sortable&&x.field,"justify-center":x.align=="center","justify-end":x.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":x.align=="right"}])},a.toDisplayString(x.label),3),x.sortable&&x.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":x.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[a.createVNode(Mv,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((K=t.sortOptions)==null?void 0:K.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,Yv)],6)}),256))])],2)),a.createElementVNode("tbody",Jv,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(ne).theme]]])},[a.createVNode(Jn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",Gv,Zv))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(od,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(x,A)=>{var V,K,Q,$,F;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${A}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":A%2==0,"is-even":A%2!=0,[s[a.unref(ne).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}])},[a.createElementVNode("div",Xv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:O.value.includes(T(x,t.itemId)),checkboxValue:T(x,t.itemId),"onUpdate:modelValue":D=>C(x)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(D=>D.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Pr,{small:"",square:"",onClick:D=>k({item:x,index:A})},{default:a.withCtx(()=>[M[A]?(a.openBlock(),a.createBlock(ww,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(Vv,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(D=>D.type!="expand"),(D,ee)=>{var q,P;return a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":ee===0,[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":A===((P=t.data)==null?void 0:P.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"text-center justify-center":D.align=="center","text-right justify-end":D.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${D.maxWidth}px`}),id:`${A}_${ee}`,column:D,item:x,rowIndex:A,key:ee},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(D=>D.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(ne).theme]]:!t.stripe,[l[a.unref(ne).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Yi,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(ne).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=y.value.find(D=>D.type=="expand"))!=null&&V.noPadding),"p-0":(K=y.value.find(D=>D.type=="expand"))==null?void 0:K.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((Q=t.data)==null?void 0:Q.length)-1&&!t.totalItem,"first:rounded-bl-lg":A===(($=t.data)==null?void 0:$.length)-1&&!t.totalItem,"text-center":y.value.find(D=>D.type=="expand").align=="center","text-right":y.value.find(D=>D.type=="expand").align=="right"}]),column:y.value.find(D=>D.type=="expand"),rowIndex:A,colspan:(F=y.value)==null?void 0:F.length,item:x},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,M[A]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",Qv,[a.createVNode(od,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",e5," No Data ")):a.createCommentVNode("",!0)],2)])}}}),n5={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function sd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=sd(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ld(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=ld(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class z{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 z(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 z(r,i)}cutByIndex(e,n){return e==n?z.empty:e==0&&n==this.content.length?this:new z(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 z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return sd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ld(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ji(0,e);if(e==this.size)return Ji(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ji(r+1,s):Ji(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.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 z(n||e,r)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const Ms={index:0,offset:0};function Ji(t,e){return Ms.index=t,Ms.offset=e,Ms}function Gi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Gi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Gi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class aa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return aa.none;if(e instanceof aa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class Zi extends Error{}class J{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cd(this.content,e+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(e,n){return new J(ad(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return J.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 J(z.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 J(e,r,i)}}J.empty=new J(z.empty,0,0);function ad(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ad(o.content,e-i-1,n-i-1)))}function cd(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=cd(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function r5(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return dd(t,e,n,0)}function dd(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=dd(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $n(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=i5(n,t);return $n(o,fd(t,s,l,e,r))}else return $n(o,Xi(t,e,r))}function ud(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return ud(r,e.node(n)),r}function Tn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Tn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Tn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Tn(e.nodeBefore,r)}function $n(t,e){return t.type.checkContent(e),t.copy(e)}function fd(t,e,n,r,i){let o=t.depth>i&&Ts(t,e,i+1),s=r.depth>i&&Ts(n,r,i+1),l=[];return Zr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ud(o,s),Tn($n(o,fd(t,e,n,r,i+1)),l)):(o&&Tn($n(o,Xi(t,e,i+1)),l),Zr(e,n,i,l),s&&Tn($n(s,Xi(n,r,i+1)),l)),Zr(r,null,i,l),new z(l)}function Xi(t,e,n){let r=[];if(Zr(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);Tn($n(i,Xi(t,e,n+1)),r)}return Zr(e,null,n,r),new z(r)}function i5(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(z.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Xr(n,r,o)}static resolveCached(e,n){let r=hd.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else hd.set(e,r=new o5);let i=r.elts[r.i]=Xr.resolve(e,n);return r.i=(r.i+1)%s5,i}}class o5{constructor(){this.elts=[],this.i=0}}const s5=12,hd=new WeakMap;class Qi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const l5=Object.create(null);let Qt=class ca{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Gi(this.attrs,n||e.defaultAttrs||l5)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ca(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ca(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return J.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 J(d,i.depth-s,o.depth-s)}replace(e,n,r){return r5(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Xr.resolveCached(this,e)}resolveNoCache(e){return Xr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),pd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=z.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=z.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Qt.prototype.text=void 0;class eo extends Qt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new eo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function pd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new a5(e,n);if(r.next==null)return Nn.empty;let i=md(r);r.next&&r.err("Unexpected trailing text");let o=m5(p5(i));return g5(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 z.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
6
|
-
`)}}Nn.empty=new Nn(!0);class a5{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function md(t){let e=[];do e.push(c5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function c5(t){let e=[];do e.push(d5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function d5(t){let e=h5(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=u5(t,e);else break;return e}function gd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function u5(t,e){let n=gd(t),r=n;return t.eat(",")&&(t.next!="}"?r=gd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function f5(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 h5(t){if(t.eat("(")){let e=md(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=f5(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 p5(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function yd(t,e){return e-t}function bd(t,e){let n=[];return r(e),n.sort(yd);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function m5(t){let e=Object.create(null);return n(bd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);bd(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Nn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(yd);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function g5(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function kd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function xd(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wd(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function vd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new b5(t,r,e[r]);return n}let Cd=class lp{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=vd(e,r.attrs),this.defaultAttrs=kd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Nn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:xd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qt(this,this.computeAttrs(e),z.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=z.from(n),this.checkContent(n),new Qt(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=z.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(z.empty,!0);return o?new Qt(this,e,n.append(o),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new lp(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 y5(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 b5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?y5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class to{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vd(e,i.attrs),this.excluded=null;let o=kd(this.attrs);this.instance=o?new ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,xd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new to(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Sd{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Cd.compile(this.spec.nodes,this),this.marks=to.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?Ed(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ed(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Cd){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new eo(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Qt.fromJSON(this,e)}markFromJSON(e){return ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ed(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function k5(t){return t.tag!=null}function x5(t){return t.style!=null}class en{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(k5(i))this.tags.push(i);else if(x5(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new $d(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $d(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),J.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(C5(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new en(e,en.schemaRules(e)))}}const Od={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},w5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Md={ol:!0,ul:!0},Qr=1,$s=2,no=4;function Td(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?$s:0):t&&t.whitespace=="pre"?Qr|$s:n&-5}class ro{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ye.none,this.match=o||(s&no?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(z.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=z.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Od.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $d{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Td(null,n.preserveWhitespace,0)|(r?no:0);i?o=new ro(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ro(null,null,ye.none,!0,null,s):o=new ro(e.schema.topNodeType,null,ye.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&$s?"full":this.localPreserveWS||(i.options&Qr)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
7
|
-
|
|
8
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ye.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Bd(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Td(e,o,s.options);s.options&no&&s.content.length==0&&(l|=no);let c=ye.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Bd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ro(e,n,c,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function v5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Md.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function C5(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Nd(t){let e={};for(let n in t)e[n]=t[n];return e}function Bd(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Bn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ns(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=io(Ns(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&io(Ns(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return io(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ad(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ad(e.marks)}}function Ad(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ns(t){return t.document||window.document}const Vd=new WeakMap;function S5(t){let e=Vd.get(t);return e===void 0&&Vd.set(t,e=E5(t)),e}function E5(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function io(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=S5(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=io(t,h,n,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Dd=65535,_d=Math.pow(2,16);function O5(t,e){return t+e*_d}function Ld(t){return t&Dd}function M5(t){return(t-(t&Dd))/_d}const Id=1,Pd=2,oo=4,Rd=8;class Bs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Rd)>0}get deletedBefore(){return(this.delInfo&(Id|oo))>0}get deletedAfter(){return(this.delInfo&(Pd|oo))>0}get deletedAcross(){return(this.delInfo&oo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=Ld(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+M5(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:O5(l/3,e-c),g=e==c?Pd:e==f?Id:oo;return(n<0?e!=c:e!=f)&&(g|=Rd),new Bs(p,g,m)}i+=u-d}return r?e+i:new Bs(e+i,0,null)}touches(e,n){let r=0,i=Ld(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class or{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new or(this.maps,this.mirror,e,n)}copy(){return new or(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new or;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Bs(e,i,null)}}const As=Object.create(null);class Pe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=As[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in As)throw new RangeError("Duplicate use of step JSON ID "+e);return As[e]=n,n.prototype.jsonID=e,n}}class Se{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Se(e,null)}static fail(e){return new Se(null,e)}static fromReplace(e,n,r,i){try{return Se.ok(e.replace(n,r,i))}catch(o){if(o instanceof Zi)return Se.fail(o.message);throw o}}}function Vs(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Vs(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return z.fromArray(r)}class tn extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new J(Vs(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,o)}invert(){return new Ot(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new tn(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("addMark",tn);class Ot extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new J(Vs(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,r)}invert(){return new tn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ot(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ot(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("removeMark",Ot);class nn extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new J(z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new nn(this.pos,n.marks[i]);return new nn(this.pos,this.mark)}}return new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new nn(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("addNodeMark",nn);class sr extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new J(z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new nn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new sr(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("removeNodeMark",sr);class $e extends Pe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ds(e,this.from,this.to)?Se.fail("Structure replace would overwrite content"):Se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new $e(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new $e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof $e)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $e(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $e(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new $e(n.from,n.to,J.fromJSON(e,n.slice),!!n.structure)}}Pe.jsonID("replace",$e);class Ne extends Pe{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Ds(e,this.from,this.gapFrom)||Ds(e,this.gapTo,this.to)))return Se.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Se.fromReplace(e,this.from,this.to,r):Se.fail("Content does not fit in gap")}getMap(){return new et([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ne(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ne(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pe.jsonID("replaceAround",Ne);function Ds(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function T5(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new Ot(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new tn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function $5(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof to){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Ot(s.from,s.to,s.style)))}function _s(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new $e(l,u,J.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ot(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new J(z.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new $e(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(z.empty,!0);t.replace(l,l,new J(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function N5(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!N5(i,o,s))break}return null}function B5(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=z.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=z.from(r.node(m).copy(u)),f++):c--;let h=z.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=z.from(i.node(m).copy(h)),p++):d++;t.step(new Ne(c,d,s,l,new J(u.append(h),f,p),u.size-f,!0))}function Ls(t,e,n=null,r=t){let i=A5(t,e),o=i&&V5(r,e);return o?i.map(zd).concat({type:e,attrs:n}).concat(o.map(zd)):null}function zd(t){return{type:t,attrs:null}}function A5(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 V5(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 D5(t,e,n){let r=z.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=z.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new J(r,0,0),n.length,!0))}function _5(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)&&L5(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Fd(t,s,l,o),_s(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return t.step(new Ne(f,h,f+1,h-1,new J(z.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&jd(t,s,l,o),!1}})}function jd(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Fd(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
9
|
-
`))}})}function L5(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function I5(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ne(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new J(z.from(s),0,0),1,!0))}function Pt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let l=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function P5(t,e,n=1,r){let i=t.doc.resolve(e),o=z.empty,s=z.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=z.from(i.node(l).copy(o));let u=r&&r[d];s=z.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new $e(e,e,new J(o.append(s),n,n),!0))}function rn(t,e){let n=t.resolve(e),r=n.index();return Hd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function R5(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Hd(t,e){return!!(t&&e&&!t.isLeaf&&R5(t,e))}function so(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Hd(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function z5(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Fd(t,u.node(),u.before(),l)}s.inlineContent&&_s(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(l),d=c.map(e-n);if(t.step(new $e(d,c.map(e+n,-1),J.empty,!0)),r===!0){let u=t.doc.resolve(d);jd(t,u.node(),u.before(),t.steps.length)}return t}function j5(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Wd(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function lo(t,e,n=e,r=J.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ud(i,o,r)?new $e(e,n,r):new F5(i,o,r).fit()}function Ud(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class F5{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=z.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=z.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 J(o,s,l);return e>-1?new Ne(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new $e(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Is(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(z.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Is(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new J(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Is(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new J(ei(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new J(ei(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,l=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let g=l.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||c==0||g.content.size)&&(f=y,u.push(qd(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=ti(this.placed,n,z.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=l;g<p;g++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=m?e==0?J.empty:new J(ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new J(ei(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ps(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ps(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=Ps(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ti(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ti(this.placed,this.depth,z.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(z.empty,!0);n.childCount&&(this.placed=ti(this.placed,this.frontier.length,n))}}function ei(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ei(t.firstChild.content,e-1,n)))}function ti(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ti(t.lastChild.content,e-1,n)))}function Is(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function qd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,qd(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),t.copy(r)}function Ps(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!H5(n,o.content,s)?l:null}function H5(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function W5(t){return t.spec.defining||t.spec.definingForContent}function U5(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Ud(i,o,r))return t.step(new $e(e,n,r));let s=Yd(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(l),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=W5(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+c)%s.length],b=!0;y<0&&(b=!1,y=-y);let v=i.node(y-1),M=i.index(y-1);if(v.canReplaceWith(M,M,m.type,m.marks))return t.replace(i.before(y),b?o.after(y):n,new J(Kd(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Kd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Kd(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(z.empty,!0))}return t}function q5(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=j5(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new J(z.from(r),0,0))}function K5(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Yd(r,i);for(let s=0;s<o.length;s++){let l=o[s],c=s==o.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Yd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class ar extends Pe{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Se.fromReplace(e,this.pos,this.pos+1,new J(z.from(i),0,n.isLeaf?0:1))}getMap(){return et.empty}invert(e){return new ar(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ar(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ar(n.pos,n.attr,n.value)}}Pe.jsonID("attr",ar);class ni extends Pe{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Se.ok(r)}getMap(){return et.empty}invert(e){return new ni(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ni(n.attr,n.value)}}Pe.jsonID("docAttr",ni);let cr=class extends Error{};cr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},cr.prototype=Object.create(Error.prototype),cr.prototype.constructor=cr,cr.prototype.name="TransformError";class Y5{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new or}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=J.empty){let i=lo(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new J(z.from(r),0,0))}delete(e,n){return this.replace(e,n,J.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return U5(this,e,n,r),this}replaceRangeWith(e,n,r){return q5(this,e,n,r),this}deleteRange(e,n){return K5(this,e,n),this}lift(e,n){return B5(this,e,n),this}join(e,n=1){return z5(this,e,n),this}wrap(e,n){return D5(this,e,n),this}setBlockType(e,n=e,r,i=null){return _5(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return I5(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ar(e,n,r)),this}setDocAttribute(e,n){return this.step(new ni(e,n)),this}addNodeMark(e,n){return this.step(new nn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ye)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new sr(e,n)),this}split(e,n=1,r){return P5(this,e,n,r),this}addMark(e,n,r){return T5(this,e,n,r),this}removeMark(e,n,r){return $5(this,e,n,r),this}clearIncompatible(e,n,r){return _s(this,e,n,r),this}}const Rs=Object.create(null);class ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new J5(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=J.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?J.empty:n),l==0&&Zd(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(l.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Zd(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ce(e):dr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?dr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):dr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new tt(e.node(0))}static atStart(e){return dr(e,e,0,0,1)||new tt(e)}static atEnd(e){return dr(e,e,e.content.size,e.childCount,-1)||new tt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Rs[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Rs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rs[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}}ue.prototype.visible=!0;class J5{constructor(e,n){this.$from=e,this.$to=n}}let Jd=!1;function Gd(t){!Jd&&!t.parent.inlineContent&&(Jd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ce extends ue{constructor(e,n=e){Gd(e),Gd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new ce(i.parent.inlineContent?i:r,r)}replace(e,n=J.empty){if(super.replace(e,n),n==J.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ao(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ce(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ce(e,n)}}ue.jsonID("text",ce);class ao{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ao(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class re extends ue{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ue.near(o):new re(o)}content(){return new J(z.from(this.node),0,0)}eq(e){return e instanceof re&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zs(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new re(e.resolve(n.anchor))}static create(e,n){return new re(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}re.prototype.visible=!1,ue.jsonID("node",re);class zs{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ao(r,r):new zs(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&re.isSelectable(r)?new re(n):ue.near(n)}}class tt extends ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=J.empty){if(n==J.empty){e.delete(0,e.doc.content.size);let r=ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new tt(e)}map(e){return new tt(e)}eq(e){return e instanceof tt}getBookmark(){return G5}}ue.jsonID("all",tt);const G5={map(){return this},resolve(t){return new tt(t)}};function dr(t,e,n,r,i,o=!1){if(e.inlineContent)return ce.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&re.isSelectable(l))return re.create(t,n-(i<0?l.nodeSize:0))}else{let c=dr(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Zd(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;let o=t.mapping.maps[r],s;o.forEach((l,c,d,u)=>{s==null&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const Xd=1,Qd=2,eu=4;class Z5 extends Y5{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Xd)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Xd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qd,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Qd)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=eu,this}get scrolledIntoView(){return(this.updated&eu)>0}}function tu(t,e){return!e||!t?t:t.bind(e)}class ri{constructor(e,n,r){this.name=e,this.init=tu(n.init,r),this.apply=tu(n.apply,r)}}const X5=[new ri("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ri("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new ri("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ri("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class js{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=X5.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ri(r.key,r.spec.state,r))})}}class ur{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new Z5(this)}static create(e){let n=new js(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new js(this.schema,e.plugins),r=n.fields,i=new ur(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new js(e.schema,e.plugins),o=new ur(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Qt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function nu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=nu(i,e,{})),n[r]=i}return n}class _e{constructor(e){this.spec=e,this.props={},e.props&&nu(e.props,this,this.props),this.key=e.key?e.key.key:ru("plugin")}getState(e){return e[this.key]}}const Fs=Object.create(null);function ru(t){return t in Fs?t+"$"+ ++Fs[t]:(Fs[t]=0,t+"$")}class nt{constructor(e="key"){this.key=ru(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Le=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ii=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Hs=null;const Rt=function(t,e,n){let r=Hs||(Hs=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Q5=function(){Hs=null},An=function(t,e,n,r){return n&&(iu(t,e,n,r,-1)||iu(t,e,n,r,1))},eC=/^(img|br|input|textarea|hr)$/i;function iu(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:lt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||oi(t)||eC.test(t.nodeName)||t.contentEditable=="false")return!1;e=Le(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?lt(t):0}else return!1}}function lt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function tC(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=lt(t)}else if(t.parentNode&&!oi(t))e=Le(t),t=t.parentNode;else return null}}function nC(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!oi(t))e=Le(t)+1,t=t.parentNode;else return null}}function rC(t,e,n){for(let r=e==0,i=e==lt(t);r||i;){if(t==n)return!0;let o=Le(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==lt(t)}}function oi(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const co=function(t){return t.focusNode&&An(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Vn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function iC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function oC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(lt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(lt(r.startContainer),r.startOffset)}}}const Mt=typeof navigator<"u"?navigator:null,ou=typeof document<"u"?document:null,on=Mt&&Mt.userAgent||"",Ws=/Edge\/(\d+)/.exec(on),su=/MSIE \d/.exec(on),Us=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(on),Je=!!(su||Us||Ws),sn=su?document.documentMode:Us?+Us[1]:Ws?+Ws[1]:0,xt=!Je&&/gecko\/(\d+)/i.test(on);xt&&+(/Firefox\/(\d+)/.exec(on)||[0,0])[1];const qs=!Je&&/Chrome\/(\d+)/.exec(on),Re=!!qs,lu=qs?+qs[1]:0,Fe=!Je&&!!Mt&&/Apple Computer/.test(Mt.vendor),fr=Fe&&(/Mobile\/\w+/.test(on)||!!Mt&&Mt.maxTouchPoints>2),at=fr||(Mt?/Mac/.test(Mt.platform):!1),sC=Mt?/Win/.test(Mt.platform):!1,zt=/Android \d/.test(on),si=!!ou&&"webkitFontSmoothing"in ou.documentElement.style,lC=si?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function aC(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function jt(t,e){return typeof t=="number"?t:t[e]}function cC(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function au(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=ii(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?aC(o):cC(l),u=0,f=0;if(e.top<d.top+jt(r,"top")?f=-(d.top-e.top+jt(i,"top")):e.bottom>d.bottom-jt(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+jt(i,"top")-d.top:e.bottom-d.bottom+jt(i,"bottom")),e.left<d.left+jt(r,"left")?u=-(d.left-e.left+jt(i,"left")):e.right>d.right-jt(r,"right")&&(u=e.right-d.right+jt(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function dC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:cu(t.dom)}}function cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ii(r));return e}function uC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;du(n,r==0?0:r-e)}function du(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let hr=null;function fC(t){if(t.setActive)return t.setActive();if(hr)return t.focus(hr);let e=cu(t);t.focus(hr==null?{get preventScroll(){return hr={preventScroll:!0},!0}}:void 0),hr||(hr=!1,du(e,0))}function uu(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,c,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Rt(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?hC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:uu(n,i)}function hC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=ln(r,1);if(o.top!=o.bottom&&Ks(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ks(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function pC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function mC(t,e,n){let{node:r,offset:i}=uu(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function gC(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function fu(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Ks(e,d))return fu(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function yC(t,e){let n=t.dom.ownerDocument,r,i=0,o=oC(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!Ks(e,d)||(s=fu(t.dom,e,d),!s))return null}if(Fe)for(let d=s;r&&d;d=ii(d))d.draggable&&(r=void 0);if(s=pC(s,e),r){if(xt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;si&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=gC(t,r,i,e))}l==null&&(l=mC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function hu(t){return t.top<t.bottom||t.left<t.right}function ln(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(hu(r))return r}return Array.prototype.find.call(n,hu)||t.getBoundingClientRect()}const bC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function pu(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=si||xt;if(r.nodeType==3)if(s&&(bC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=ln(Rt(r,i,i),n);if(xt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=ln(Rt(r,i-1,i-1),-1);if(d.top==c.top){let u=ln(Rt(r,i,i+1),-1);if(u.top!=c.top)return li(u,u.left<d.left)}}return c}else{let c=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(c--,u=1):n<0?c--:d++,li(ln(Rt(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];if(c.nodeType==1)return Ys(c.getBoundingClientRect(),!0)}return Ys(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==lt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Rt(c,lt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return li(ln(d,1),!1)}if(o==null&&i<lt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Rt(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return li(ln(d,-1),!0)}return li(ln(r.nodeType==3?Rt(r):r,-n),n>=0)}function li(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ys(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function mu(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function kC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return mu(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=pu(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Rt(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const xC=/[\u0590-\u08ac]/;function wC(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?!xC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:mu(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{l.collapse(u,f),c&&(c!=u||d!=f)&&l.extend&&l.extend(c,d)}catch{}return h!=null&&(l.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let gu=null,yu=null,bu=!1;function vC(t,e,n){return gu==e&&yu==n?bu:(gu=e,yu=n,bu=n=="up"||n=="down"?kC(t,e,n):wC(t,e,n))}const ct=0,ku=1,Dn=2,Tt=3;class ai{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ct,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Le(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let l=i.children[s];if(l.size){i=l;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof vu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof xu&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Le(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Le(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let c=this.children[l],d=s+c.size;if(i==-1&&e<=d){let u=s+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Le(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Le(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],y=m+g.size;if(o>m&&s<y)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=y}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((xt||Fe)&&e==n){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
10
|
-
`),f&&m==p.nodeValue.length)for(let g=p,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(l=c={node:y.parentNode,offset:Le(y)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(xt&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&Fe)&&An(l.node,l.offset,u.anchorNode,u.anchorOffset)&&An(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,c=s-o.border;if(e>=l&&n<=c){this.dirty=e==r||n==s?Dn:ku,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Tt:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Dn:Tt}r=s}this.dirty=Dn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Dn:ku;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class xu extends ai{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==ct&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class CC extends ai{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class _n extends ai{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Bn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new _n(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Tt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ct){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ct}}slice(e,n,r){let i=_n.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Gs(o,n,s,r)),e>0&&(o=Gs(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class an extends ai{constructor(e,n,r,i,o,s,l,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],c,d=l&&l(n,o,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Bn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Eu(u,r,n),d?c=new SC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new uo(e,n,r,i,u,h,o):new an(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>z.empty)}return e}matchesNode(e,n,r){return this.dirty==ct&&e.eq(this.node)&&fo(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,c=new OC(this,s&&s.node,e);$C(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?ye.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,h)=>{c.syncToMarks(d.marks,r,e);let p;c.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,p,e)||c.updateNextNode(d,u,f,e,h,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Dn)&&(s&&this.protectLocalComposition(e,s),Cu(this.contentDOM,this.children,e),fr&&NC(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=BC(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 CC(this,o,n,i);e.input.compositionNodes.push(s),this.children=Gs(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Tt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ct}updateOuterDeco(e){if(fo(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Su(this.dom,this.nodeDOM,Js(this.outerDeco,this.node,n),Js(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function wu(t,e,n,r,i){Eu(r,e,t);let o=new an(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class uo extends an{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Tt||this.dirty!=ct&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ct||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ct,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new uo(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vu extends ai{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ct&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class SC extends an{constructor(e,n,r,i,o,s,l,c,d,u){super(e,n,r,i,o,s,l,d,u),this.spec=c}update(e,n,r,i){if(this.dirty==Tt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Cu(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Ou(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof _n){let c=r?r.previousSibling:t.lastChild;Cu(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=Ou(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const ci=function(t){t&&(this.nodeName=t)};ci.prototype=Object.create(null);const Ln=[new ci];function Js(t,e,n){if(t.length==0)return Ln;let r=n?Ln[0]:new ci,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new ci(s.nodeName));for(let l in s){let c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new ci(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function Su(t,e,n,r){if(n==Ln&&r==Ln)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let c;l&&l.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=Ln[0]),i=c}EC(i,l||Ln[0],s)}return i}function EC(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Eu(t,e,n){return Su(t,t,Ln,Js(e,n,t.nodeType!=1))}function fo(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Ou(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class OC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=MC(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=ct,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=_n.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Tt&&s.dom==s.contentDOM&&(s.dirty=Dn),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof an){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,h=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Tt&&fo(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Dn,f.updateChildren(i,s+1),f.dirty=ct),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!fo(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=an.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,r,i,o){let s=an.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new xu(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof _n;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof uo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fe||Re)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new vu(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function MC(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof _n)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function TC(t,e){return t.type.side-e.type.side}function $C(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(TC);for(let y=0;y<f.length;y++)n(f[y],d,!!c)}else n(u,d,!!c);let h,p;if(c)p=-1,h=c,c=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let y=0;y<l.length;y++)l[y].to<=o&&l.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let b=0;b<l.length;b++)l[b].to<y&&(y=l[b].to);y<m&&(c=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?l.filter(y=>!y.inline):l.slice();r(h,g,e.forChild(o,h),p),o=m}}function NC(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 BC(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let c=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?c.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function Gs(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let c=t[s],d=l,u=l+=c.size;d>=n||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(c.slice(n-d,c.size,r)))}return o}function Zs(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(co(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&re.isSelectable(f)&&i.parent&&!(f.isInline&&rC(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new re(s==h?l:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==t.state.selection.anchor?[h,f]:[f,h],l=r.resolve(s)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=Qs(t,u,l,f)}return d}function Mu(t){return t.editable?t.hasFocus():Du(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ft(t,e=!1){let n=t.state.selection;if(Bu(t,n),!!Mu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Re){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&An(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)VC(t);else{let{anchor:r,head:i}=n,o,s;Tu&&!(n instanceof ce)&&(n.$from.parent.inlineContent||(o=$u(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=$u(t,n.to))),t.docView.setSelection(r,i,t,e),Tu&&(o&&Nu(o),s&&Nu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&AC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tu=Fe||Re&&lu<63;function $u(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Fe&&i&&i.contentEditable=="false")return Xs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xs(i);if(o)return Xs(o)}}function Xs(t){return t.contentEditable="true",Fe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Nu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function AC(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Mu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function VC(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Le(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Je&&sn<=11&&(r.disabled=!0,r.disabled=!1)}function Bu(t,e){if(e instanceof re){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Au(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Au(t)}function Au(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Qs(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function Vu(t){return t.editable&&!t.hasFocus()?!1:Du(t)}function Du(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function DC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return An(e.node,e.offset,n.anchorNode,n.anchorOffset)}function el(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function cn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function _u(t,e,n){let r=t.state.selection;if(r instanceof ce)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return cn(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=el(t.state,e);return i&&i instanceof re?cn(t,i):!1}else if(!(at&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?re.isSelectable(o)?cn(t,new re(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):si?cn(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof re&&r.node.isInline)return cn(t,new ce(e>0?r.$to:r.$from));{let i=el(t.state,e);return i?cn(t,i):!1}}}function ho(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function di(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function pr(t,e){return e<0?_C(t):LC(t)}function _C(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(xt&&n.nodeType==1&&r<ho(n)&&di(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(di(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Lu(n))break;{let l=n.previousSibling;for(;l&&di(l,-1);)i=n.parentNode,o=Le(l),l=l.previousSibling;if(l)n=l,r=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?tl(t,n,r):i&&tl(t,i,o)}function LC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ho(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(di(l,1))o=n,s=++r;else break}else{if(Lu(n))break;{let l=n.nextSibling;for(;l&&di(l,1);)o=l.parentNode,s=Le(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=ho(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&tl(t,o,s)}function Lu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function IC(t,e){for(;t&&e==t.childNodes.length&&!oi(t);)e=Le(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function PC(t,e){for(;t&&!e&&!oi(t);)e=Le(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function tl(t,e,n){if(e.nodeType!=3){let o,s;(s=IC(e,n))?(e=s,n=0):(o=PC(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(co(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ft(t)},50)}function Iu(t,e){let n=t.state.doc.resolve(e);if(!(Re||sC)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Pu(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||at&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=el(t.state,e);if(s&&s instanceof re)return cn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof tt?ue.near(s,e):ue.findFrom(s,e);return l?cn(t,l):!1}return!1}function Ru(t,e){if(!(t.state.selection instanceof ce))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function zu(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function RC(t){if(!Fe||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;zu(t,r,"true"),setTimeout(()=>zu(t,r,"false"),20)}return!1}function zC(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function jC(t,e){let n=e.keyCode,r=zC(e);if(n==8||at&&n==72&&r=="c")return Ru(t,-1)||pr(t,-1);if(n==46&&!e.shiftKey||at&&n==68&&r=="c")return Ru(t,1)||pr(t,1);if(n==13||n==27)return!0;if(n==37||at&&n==66&&r=="c"){let i=n==37?Iu(t,t.state.selection.from)=="ltr"?-1:1:-1;return _u(t,i,r)||pr(t,i)}else if(n==39||at&&n==70&&r=="c"){let i=n==39?Iu(t,t.state.selection.from)=="ltr"?1:-1:1;return _u(t,i,r)||pr(t,i)}else{if(n==38||at&&n==80&&r=="c")return Pu(t,-1,r)||pr(t,-1);if(n==40||at&&n==78&&r=="c")return RC(t)||Pu(t,1,r)||pr(t,1);if(r==(at?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function nl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Bn.fromSchema(t.state.schema),l=Yu(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=qu[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`))),0,0):J.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)l=f;else{let h=i.marks(),{schema:p}=t.state,m=Bn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=UC(n),si&&qC(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||en.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!FC.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=KC(Uu(l,+u[1],+u[2]),u[4]);else if(l=J.maxOpen(HC(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Uu(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const FC=/^(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 HC(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Hu(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Wu(s[s.length-1],o.length));let u=Fu(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return z.from(s)}return t}function Fu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,z.from(t));return t}function Hu(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Hu(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(z.from(Fu(n,t,i+1))))}}function Wu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Wu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(z.empty,!0);return t.copy(n.append(r))}function rl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=rl(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(z.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Uu(t,e,n){return e<t.openStart&&(t=new J(rl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J(rl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const qu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ku=null;function Yu(){return Ku||(Ku=document.implementation.createHTMLDocument("title"))}let il=null;function WC(t){let e=window.trustedTypes;return e?(il||(il=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),il.createHTML(t)):t}function UC(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Yu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&qu[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=WC(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function qC(t){let e=t.querySelectorAll(Re?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function KC(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=z.from(c.create(r[l+1],i)),o++,s++}return new J(i,o,s)}const He={},We={},YC={touchstart:!0,touchmove:!0};class JC{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 GC(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{XC(t,r)&&!sl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},YC[e]?{passive:!0}:void 0)}Fe&&t.dom.addEventListener("input",()=>null),ol(t)}function dn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ZC(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function ol(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>sl(t,r))})}function sl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function XC(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function QC(t,e){!sl(t,e)&&He[e.type]&&(t.editable||!(e.type in We))&&He[e.type](t,e)}We.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Gu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(zt&&Re&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Vn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||jC(t,n)?n.preventDefault():dn(t,"key")},We.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},We.keypress=(t,e)=>{let n=e;if(Gu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||at&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function po(t){return{left:t.clientX,top:t.clientY}}function eS(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ll(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function mr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function tS(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&re.isSelectable(r)?(mr(t,new re(n)),!0):!1}function nS(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof re&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(re.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(mr(t,re.create(t.state.doc,i)),!0):!1}function rS(t,e,n,r,i){return ll(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?nS(t,n):tS(t,n))}function iS(t,e,n,r){return ll(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function oS(t,e,n,r){return ll(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||sS(t,n,r)}function sS(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mr(t,ce.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)mr(t,ce.create(r,l+1,l+1+s.content.size));else if(re.isSelectable(s))mr(t,re.create(r,l));else continue;return!0}}function al(t){return mo(t)}const Ju=at?"metaKey":"ctrlKey";He.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=al(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&eS(n,t.input.lastClick)&&!n[Ju]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(po(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new lS(t,s,n,!!r)):(o=="doubleClick"?iS:oS)(t,s.pos,s.inside,n)?n.preventDefault():dn(t,"pointer"))};class lS{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Ju],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof re&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),dn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ft(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(po(e))),this.updateAllowDefault(e),this.allowDefault||!n?dn(this.view,"pointer"):rS(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fe&&this.mightDrag&&!this.mightDrag.node.isAtom||Re&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(mr(this.view,ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),dn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}He.touchstart=t=>{t.input.lastTouch=Date.now(),al(t),dn(t,"pointer")},He.touchmove=t=>{t.input.lastTouch=Date.now(),dn(t,"pointer")},He.contextmenu=t=>al(t);function Gu(t,e){return t.composing?!0:Fe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const aS=zt?5e3:-1;We.compositionstart=We.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),mo(t,!0),t.markCursor=null;else if(mo(t,!e.selection.empty),xt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Zu(t,aS)},We.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Zu(t,20))};function Zu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>mo(t),e))}function Xu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dS());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function cS(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=tC(e.focusNode,e.focusOffset),r=nC(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 dS(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function mo(t,e=!1){if(!(zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Xu(t),e||t.docView&&t.docView.dirty){let n=Zs(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function uS(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ui=Je&&sn<15||fr&&lC<604;He.copy=We.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ui?null:n.clipboardData,s=r.content(),{dom:l,text:c}=nl(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):uS(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function fS(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hS(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?fi(t,r.value,null,i,e):fi(t,r.textContent,r.innerHTML,i,e)},50)}function fi(t,e,n,r,i){let o=ju(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||J.empty)))return!0;if(!o)return!1;let s=fS(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qu(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}We.paste=(t,e)=>{let n=e;if(t.composing&&!zt)return;let r=ui?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&fi(t,Qu(r),r.getData("text/html"),i,n)?n.preventDefault():hS(t,n)};class ef{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const tf=at?"altKey":"ctrlKey";He.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(po(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof re?i.to-1:i.to))){if(r&&r.mightDrag)s=re.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=re.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=nl(t,l);(!n.dataTransfer.files.length||!Re||lu>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ui?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ui||n.dataTransfer.setData("text/plain",d),t.dragging=new ef(u,!n[tf],s)},He.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},We.dragover=We.dragenter=(t,e)=>e.preventDefault(),We.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(po(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=ju(t,Qu(n.dataTransfer),ui?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[tf]);if(t.someProp("handleDrop",m=>m(t,n,s||J.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Wd(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(l){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&re.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new re(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,b,v)=>m=v),d.setSelection(Qs(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},He.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ft(t)},20))},He.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},He.beforeinput=(t,e)=>{if(Re&&zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Vn(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in We)He[t]=We[t];function hi(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class go{constructor(e,n){this.toDOM=e,this.spec=n||In,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new rt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof go&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&hi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class un{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new rt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof un&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}static is(e){return e.type instanceof un}destroy(){}}class cl{constructor(e,n){this.attrs=e,this.spec=n||In}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new rt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof cl&&hi(this.attrs,e.attrs)&&hi(this.spec,e.spec)}destroy(){}}class rt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new rt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new rt(e,e,new go(n,r))}static inline(e,n,r,i){return new rt(e,n,new un(r,i))}static node(e,n,r,i){return new rt(e,n,new cl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof un}get widget(){return this.type instanceof go}}const gr=[],In={};class Ee{constructor(e,n){this.local=e.length?e:gr,this.children=n.length?n:gr}static create(e,n){return n.length?yo(n,e,0,In):ze}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==ze||e.maps.length==0?this:this.mapInner(e,n,0,0,r||In)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?pS(this.children,s||[],e,n,r,i,o):s?new Ee(s.sort(Pn),gr):ze}add(e,n){return n.length?this==ze?Ee.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,c)=>{let d=c+r,u;if(u=rf(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,c,c+l.nodeSize,yo(u,l,d+1,In)),o+=3}});let s=nf(o?of(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ee(s.length?this.local.concat(s).sort(Pn):this.local,i||this.children)}remove(e){return e.length==0||this==ze?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=ze?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):ze}forChild(e,n){if(this==ze)return this;if(n.isLeaf)return Ee.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof un){let d=Math.max(o,c.from)-o,u=Math.min(s,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Ee(i.sort(Pn),gr);return r?new fn([l,r]):l}return r||ze}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return dl(this.localsInner(e))}localsInner(e){if(this==ze)return gr;if(e.inlineContent||!this.local.some(un.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof un||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]),Ee.removeOverlap=dl;const ze=Ee.empty;class fn{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,In));return fn.from(r)}forChild(e,n){if(n.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ze&&(o instanceof fn?r=r.concat(o.members):r.push(o))}return fn.from(r)}eq(e){if(!(e instanceof fn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?dl(r?n:n.sort(Pn)):gr}static from(e){switch(e.length){case 0:return ze;case 1:return e[0];default:return new fn(e.every(n=>n instanceof Ee)?e:e.reduce((n,r)=>n.concat(r instanceof Ee?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function pS(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let b=0;b<l.length;b+=3){let v=l[b+1];if(v<0||h>v+u-f)continue;let M=l[b]+u-f;p>=M?l[b+1]=h<=M?-2:-1:h>=u&&y&&(l[b]+=y,l[b+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let h=n.map(t[d+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let b=l[d+2].mapInner(n,y,u+1,t[d]+o+1,s);b!=ze?(l[d]=f,l[d+1]=p,l[d+2]=b):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=mS(l,t,e,n,i,o,s),u=yo(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ee(e.sort(Pn),l)}function nf(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new rt(i.from+e,i.to+e,i.type))}return n}function mS(t,e,n,r,i,o,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+o+1);return n}function rf(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function of(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function yo(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=rf(t,l,c+n);if(d){o=!0;let u=yo(d,l,n+c+1,r);u!=ze&&i.push(c,c+l.nodeSize,u)}});let s=nf(o?of(t):t,-n).sort(Pn);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new Ee(s,i):ze}function Pn(t,e){return t.from-e.from||t.to-e.to}function dl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),sf(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),sf(e,i,r.copy(o.from,r.to)));break}}}return e}function sf(t,e,n){for(;e<t.length&&Pn(n,t[e])>0;)e++;t.splice(e,0,n)}function ul(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ze&&e.push(r)}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),fn.from(e)}const gS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yS=Je&&sn<=11;class bS{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 bS,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Je&&sn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),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,gS)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Vu(this.view)){if(this.suppressingSelectionUpdates)return Ft(this.view);if(Je&&sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&An(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=ii(o))n.add(o);for(let o=e.anchorNode;o;o=ii(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Vu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(xt&&c.length){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||vS(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&co(r)&&(d=Zs(e))&&d.eq(ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ft(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),xS(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ft(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Je&&sn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?Le(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?Le(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let lf=new WeakMap,af=!1;function xS(t){if(!lf.has(t)&&(lf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=xt,af)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),af=!0}}function cf(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return An(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function wS(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return cf(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?cf(t,n):null}function vS(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 CS(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],co(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Re&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let b=r.childNodes[y-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){o=y;break}if(!v||v.size)break}let f=t.state.doc,h=t.someProp("domParser")||en.fromSchema(t.state.schema),p=f.resolve(s),m=null,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:SS,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,b=d[1]&&d[1].pos;b==null&&(b=y),m={anchor:y+s,head:b+s}}return{doc:g,sel:m,from:s,to:l}}function SS(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Fe&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Fe&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ES=/^(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 OS(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,T=Zs(t,_);if(T&&!t.state.selection.eq(T)){if(Re&&zt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",H=>H(t,Vn(13,"Enter"))))return;let L=t.state.tr.setSelection(T);_=="pointer"?L.setMeta("pointer",!0):_=="key"&&L.scrollIntoView(),o&&L.setMeta("composition",o),t.dispatch(L)}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=CS(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=$S(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(fr&&t.input.lastIOSEnter>Date.now()-225||zt)&&i.some(_=>_.nodeType==1&&!ES.test(_.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ce&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let _=df(t,t.state.doc,d.sel);if(_&&!_.eq(t.state.selection)){let T=t.state.tr.setSelection(_);o&&T.setMeta("composition",o),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ce&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Je&&sn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),b=u.resolve(m.start),v=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,M;if((fr&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!v&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(M=ue.findFrom(d.doc.resolve(g.pos+1),1,!0))&&M.head==y.pos)&&t.someProp("handleKeyDown",_=>_(t,Vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&TS(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",_=>_(t,Vn(8,"Backspace")))){zt&&Re&&t.domObserver.suppressSelectionUpdates();return}Re&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),zt&&!v&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,Vn(13,"Enter"))})},20));let k=m.start,O=m.endA,C,B,I;if(v){if(g.pos==y.pos)Je&&sn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ft(t),20)),C=t.state.tr.delete(k,O),B=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(I=MS(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))C=t.state.tr,I.type=="add"?C.addMark(k,O,I.mark):C.removeMark(k,O,I.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let _=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",T=>T(t,k,O,_)))return;C=t.state.tr.insertText(_,k,O)}}if(C||(C=t.state.tr.replace(k,O,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let _=df(t,C.doc,d.sel);_&&!(Re&&t.composing&&_.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==k||_.head==C.mapping.map(O)-1)||Je&&_.empty&&_.head==k)&&C.setSelection(_)}B&&C.ensureMarks(B),o&&C.setMeta("composition",o),t.dispatch(C.scrollIntoView())}function df(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Qs(t,e.resolve(n.anchor),e.resolve(n.head))}function MS(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(z.from(d).eq(t))return{mark:l,type:s}}function TS(t,e,n,r,i){if(n-e<=i.pos-r.pos||fl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(fl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||fl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function fl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function $S(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&t.size<e.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<e.size&&uf(e.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<t.size&&uf(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function uf(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class NS{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 JC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(gf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=pf(this),hf(this),this.nodeViews=mf(this),this.docView=wu(this.state.doc,ff(this),ul(this),this.dom,this),this.domObserver=new kS(this,(r,i,o,s)=>OS(this,r,i,o,s)),this.domObserver.start(),GC(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ol(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(gf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Xu(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=mf(this);AS(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&ol(this),this.editable=pf(this),hf(this);let c=ul(this),d=ff(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,c);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&dC(this);if(s){this.domObserver.stop();let p=f&&(Je||Re)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&BS(i.selection,e.selection);if(f){let m=Re?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=cS(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=wu(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&DC(this))?Ft(this,p):(Bu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&uC(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&au(this,n.getBoundingClientRect(),e)}else au(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new ef(e.slice,e.move,i<0?void 0:re.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Je){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&fC(this.dom),Ft(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return yC(this,e)}coordsAtPos(e,n=1){return pu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return vC(this,n||this.state,e)}pasteHTML(e,n){return fi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return fi(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return nl(this,e)}destroy(){this.docView&&(ZC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ul(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Q5())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return QC(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Fe&&this.root.nodeType===11&&iC(this.dom.ownerDocument)==this.dom&&wS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ff(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[rt.node(0,t.state.doc.content.size,e)]}function hf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:rt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function pf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function BS(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function mf(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function AS(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function gf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var hn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},bo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},VS=typeof navigator<"u"&&/Mac/.test(navigator.platform),DS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ie=0;Ie<10;Ie++)hn[48+Ie]=hn[96+Ie]=String(Ie);for(var Ie=1;Ie<=24;Ie++)hn[Ie+111]="F"+Ie;for(var Ie=65;Ie<=90;Ie++)hn[Ie]=String.fromCharCode(Ie+32),bo[Ie]=String.fromCharCode(Ie);for(var hl in hn)bo.hasOwnProperty(hl)||(bo[hl]=hn[hl]);function _S(t){var e=VS&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||DS&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?bo:hn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const LS=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function IS(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))LS?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 PS(t){let e=Object.create(null);for(let n in t)e[IS(n)]=t[n];return e}function pl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function RS(t){return new _e({props:{handleKeyDown:yf(t)}})}function yf(t){let e=PS(t);return function(n,r){let i=_S(r),o,s=e[pl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[pl(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=hn[r.keyCode])&&o!=i){let l=e[pl(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ml=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function bf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const kf=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);if(!i){let s=r.blockRange(),l=s&&lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(Tf(t,i,e,-1))return!0;if(r.parent.content.size==0&&(yr(o,"end")||re.isSelectable(o)))for(let s=r.depth;;s--){let l=lo(t.doc,r.before(s),r.after(s),J.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(yr(o,"end")?ue.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):re.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},zS=(t,e,n)=>{let r=bf(t,n);if(!r)return!1;let i=gl(r);return i?xf(t,i,e):!1},jS=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);return i?xf(t,i,e):!1};function xf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=lo(t.doc,o,c,J.empty);if(!d||d.from!=o||d instanceof $e&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ce.create(u.doc,o)),n(u.scrollIntoView())}return!0}function yr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const wf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=gl(r)}let s=o&&o.nodeBefore;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function gl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function vf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Cf=(t,e,n)=>{let r=vf(t,n);if(!r)return!1;let i=yl(r);if(!i)return!1;let o=i.nodeAfter;if(Tf(t,i,e,1))return!0;if(r.parent.content.size==0&&(yr(o,"start")||re.isSelectable(o))){let s=lo(t.doc,r.before(),r.after(),J.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(yr(o,"start")?ue.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):re.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Sf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=yl(r)}let s=o&&o.nodeAfter;return!s||!re.isSelectable(s)?!1:(e&&e(t.tr.setSelection(re.create(t.doc,o.pos)).scrollIntoView()),!0)};function yl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const FS=(t,e)=>{let n=t.selection,r=n instanceof re,i;if(r){if(n.node.isTextblock||!rn(t.doc,n.from))return!1;i=n.from}else if(i=so(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(re.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},HS=(t,e)=>{let n=t.selection,r;if(n instanceof re){if(n.node.isTextblock||!rn(t.doc,n.to))return!1;r=n.to}else if(r=so(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},WS=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Ef=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
14
|
-
`).scrollIntoView()),!0)};function bl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const US=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=bl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(ue.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},Of=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof tt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(ce.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},Mf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Pt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function qS(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof re&&e.selection.node.isBlock)return!r.parentOffset||!Pt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),l=bl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&l?{type:l}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ce||e.selection instanceof tt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Pt(u.doc,f,o.length,o);if(h||(o[0]=l?{type:l}:null,h=Pt(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=l){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);l&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return n&&n(u.scrollIntoView()),!0}}const KS=qS(),YS=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(re.create(t.doc,i))),!0)};function JS(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Tf(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&JS(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=z.empty;for(let b=s.length-1;b>=0;b--)m=z.from(s[b].create(null,m));m=z.from(i.copy(m));let g=t.tr.step(new Ne(e.pos-1,p,e.pos,p,new J(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&rn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:ue.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&lr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&yr(o,"start",!0)&&yr(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=z.empty;for(let M=m.length-1;M>=0;M--)b=z.from(m[M].copy(b));let v=t.tr.step(new Ne(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new J(b,m.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function $f(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(ce.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const GS=$f(-1),ZS=$f(1);function XS(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Ls(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Nf(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(l,c,t,e)}r(o.scrollIntoView())}return!0}}function kl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}kl(ml,kf,wf),kl(ml,Cf,Sf),kl(Ef,Of,Mf,KS),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function QS(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let l=r?n.tr:null;return eE(l,s,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function eE(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);o=new Qi(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Qi(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=Ls(o,n,r,e);return l?(t&&tE(t,e,l,i,n),!0):!1}function tE(t,e,n,r,i){let o=z.empty;for(let u=n.length-1;u>=0;u--)o=z.from(n[u].type.create(n[u].attrs,o));t.step(new Ne(e.start-(r?2:0),e.end,e.start,e.end,new J(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let l=n.length-s,c=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Pt(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function nE(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?rE(e,n,t,o):iE(e,n,o):!0:!1}}function rE(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ne(o-1,s,o,s,new J(z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Qi(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=lr(r);if(l==null)return!1;i.lift(r,l);let c=i.mapping.map(o,-1)-1;return rn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function iE(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?z.empty:z.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Ne(f-(l?1:0),h+(c?1:0),f+1,h-1,new J((l?z.empty:z.from(i.copy(z.empty))).append(c?z.empty:z.from(i.copy(z.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function oE(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=z.from(d?t.create():null),f=new J(z.from(t.create(null,z.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ne(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function ko(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class xo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>{const f=c(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),b=p(...g)(y);return l.push(b),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ko({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}}class sE{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 te(t,e,n){return t.config[e]===void 0&&t.parent?te(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?te(t.parent,e,n):null}):t.config[e]}function wo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Bf(t){const e=[],{nodeExtensions:n,markExtensions:r}=wo(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=te(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=te(s,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Be(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function xe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),l.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function xl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>xe(n,r),{})}function Af(t){return typeof t=="function"}function fe(t,e=void 0,...n){return Af(t)?e?t.bind(e)(...n):t(...n):t}function lE(t={}){return Object.keys(t).length===0&&t.constructor===Object}function aE(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Vf(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):aE(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function Df(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&lE(n)?!1:n!=null))}function cE(t,e){var n;const r=Bf(t),{nodeExtensions:i,markExtensions:o}=wo(t),s=(n=i.find(d=>te(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(b=>b.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((b,v)=>{const M=te(v,"extendNodeSchema",f);return{...b,...M?M(d):{}}},{}),p=Df({...h,content:fe(te(d,"content",f)),marks:fe(te(d,"marks",f)),group:fe(te(d,"group",f)),inline:fe(te(d,"inline",f)),atom:fe(te(d,"atom",f)),selectable:fe(te(d,"selectable",f)),draggable:fe(te(d,"draggable",f)),code:fe(te(d,"code",f)),whitespace:fe(te(d,"whitespace",f)),linebreakReplacement:fe(te(d,"linebreakReplacement",f)),defining:fe(te(d,"defining",f)),isolating:fe(te(d,"isolating",f)),attrs:Object.fromEntries(u.map(b=>{var v;return[b.name,{default:(v=b==null?void 0:b.attribute)===null||v===void 0?void 0:v.default}]}))}),m=fe(te(d,"parseHTML",f));m&&(p.parseDOM=m.map(b=>Vf(b,u)));const g=te(d,"renderHTML",f);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:xl(b,u)}));const y=te(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((y,b)=>{const v=te(b,"extendMarkSchema",f);return{...y,...v?v(d):{}}},{}),p=Df({...h,inclusive:fe(te(d,"inclusive",f)),excludes:fe(te(d,"excludes",f)),group:fe(te(d,"group",f)),spanning:fe(te(d,"spanning",f)),code:fe(te(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),m=fe(te(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>Vf(y,u)));const g=te(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:xl(y,u)})),[d.name,p]}));return new Sd({topNode:s,nodes:l,marks:c})}function wl(t,e){return e.nodes[t]||e.marks[t]||null}function _f(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function vl(t,e){const n=Bn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const dE=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Cl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class vo{constructor(e){this.find=e.find,this.handler=e.handler}}const uE=(t,e)=>{if(Cl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Co(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=dE(d)+o;return s.forEach(h=>{if(u)return;const p=uE(f,h.find);if(!p)return;const m=c.state.tr,g=ko({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:v,can:M}=new xo({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:b,chain:v,can:M})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function fE(t){const{editor:e,rules:n}=t,r=new _e({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=vl(z.from(u),s.schema);const{from:f}=c,h=f+u.length;Co({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Co({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Co({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Co({editor:e,from:s.pos,to:s.pos,text:`
|
|
15
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function hE(t){return Object.prototype.toString.call(t).slice(8,-1)}function So(t){return hE(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Eo(t,e){const n={...t};return So(t)&&So(e)&&Object.keys(e).forEach(r=>{So(e[r])&&So(t[r])?n[r]=Eo(t[r],e[r]):n[r]=e[r]}),n}class dt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(te(this,"addOptions",{name:this.name}))),this.storage=fe(te(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new dt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new dt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(te(n,"addOptions",{name:n.name})),n.storage=fe(te(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 pE(t){return typeof t=="number"}class mE{constructor(e){this.find=e.find,this.handler=e.handler}}const gE=(t,e,n)=>{if(Cl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function yE(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:c,chain:d,can:u}=new xo({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{if(!p.isTextblock||p.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+p.content.size),b=p.textBetween(g-m,y-m,void 0,"");gE(b,o.find,s).forEach(M=>{if(M.index===void 0)return;const k=g+M.index+1,O=k+M[0].length,C={from:n.tr.mapping.map(k),to:n.tr.mapping.map(O)},B=o.handler({state:n,range:C,match:M,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(B)})}),f.every(p=>p!==null)}let Oo=null;const bE=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 kE(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=ko({state:u,transaction:g});if(!(!yE({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new _e({view(f){const h=m=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null,r&&(Oo=e)},p=()=>{Oo&&(Oo=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(o=r===f.dom.parentElement,l=h,!o){const p=Oo;p&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,b=m.getMeta("applyPasteRules"),v=!!b;if(!g&&!y&&!v)return;if(v){let{text:O}=b;typeof O=="string"?O=O:O=vl(z.from(O),p.schema);const{from:C}=b,B=C+O.length,I=bE(O);return c({rule:u,state:p,from:C,to:{b:B},pasteEvt:I})}const M=h.doc.content.findDiffStart(p.doc.content),k=h.doc.content.findDiffEnd(p.doc.content);if(!(!pE(M)||!k||M===k.b))return c({rule:u,state:p,from:M,to:k,pasteEvt:s})}}))}function xE(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class br{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=br.resolve(e),this.schema=cE(this.extensions,n),this.setupExtensions()}static resolve(e){const n=br.sort(br.flatten(e)),r=xE(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=te(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=te(r,"priority")||100,s=te(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:wl(n.name,this.schema)},i=te(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=br.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:wl(s.name,this.schema)},c=[],d=te(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&te(s,"exitable",l)&&(u.ArrowRight=()=>dt.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,b])=>[y,()=>b({editor:e})]));u={...u,...g}}const f=RS(u);c.push(f);const h=te(s,"addInputRules",l);_f(s,e.options.enableInputRules)&&h&&r.push(...h());const p=te(s,"addPasteRules",l);_f(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=te(s,"addProseMirrorPlugins",l);if(m){const g=m();c.push(...g)}return c}).flat();return[fE({editor:e,rules:r}),...kE({editor:e,rules:i}),...o]}get attributes(){return Bf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=wo(this.extensions);return Object.fromEntries(n.filter(r=>!!te(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Be(r.name,this.schema)},s=te(r,"addNodeView",o);if(!s)return[];const l=(c,d,u,f,h)=>{const p=xl(c,i);return s()({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:e,extension:r,HTMLAttributes:p})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:wl(e.name,this.schema)};e.type==="mark"&&(!((n=fe(te(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=te(e,"onBeforeCreate",r),o=te(e,"onCreate",r),s=te(e,"onUpdate",r),l=te(e,"onSelectionUpdate",r),c=te(e,"onTransaction",r),d=te(e,"onFocus",r),u=te(e,"onBlur",r),f=te(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class Oe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(te(this,"addOptions",{name:this.name}))),this.storage=fe(te(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Oe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Oe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(te(n,"addOptions",{name:n.name})),n.storage=fe(te(n,"addStorage",{name:n.name,options:n.options})),n}}function Lf(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
16
|
-
|
|
17
|
-
`,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function If(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const wE=Oe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new _e({key:new nt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),c=If(n);return Lf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),vE=()=>({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),CE=(t=!1)=>({commands:e})=>e.setContent("",t),SE=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=lr(p);if(l.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},EE=t=>e=>t(e),OE=()=>({state:t,dispatch:e})=>Of(t,e),ME=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new ce(r.doc.resolve(s-1))),!0},TE=()=>({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},$E=t=>({tr:e,state:n,dispatch:r})=>{const i=Be(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},NE=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},BE=()=>({state:t,dispatch:e})=>ml(t,e),AE=()=>({commands:t})=>t.keyboardShortcut("Enter"),VE=()=>({state:t,dispatch:e})=>US(t,e);function Mo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Pf(t,e,n={}){return t.find(r=>r.type===e&&Mo(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Rf(t,e,n={}){return!!Pf(t,e,n)}function Sl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Pf([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,c=s+1,d=l+i.node.nodeSize;for(;s>0&&Rf([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&Rf([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function pn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const DE=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=pn(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=Sl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ce.create(s,f.from,f.to);n.setSelection(h)}}return!0},_E=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function El(t){return t instanceof ce}function Ht(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function zf(t,e=null){if(!e)return null;const n=ue.atStart(t),r=ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ce.create(t,Ht(0,i,o),Ht(t.content.size,i,o)):ce.create(t,Ht(e,i,o),Ht(e,i,o))}function LE(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ol(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const IE=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ol()||LE())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!El(n.state.selection))return s(),!0;const l=zf(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},PE=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),RE=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jf=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jf(r)}return t};function To(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jf(n)}function $o(t,e,n){if(t instanceof Qt||t instanceof z)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 z.fromArray(t.map(l=>e.nodeFromJSON(l)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),$o("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const c=new Sd({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?en.fromSchema(c).parseSlice(To(t),n.parseOptions):en.fromSchema(c).parse(To(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=en.fromSchema(e);return n.slice?o.parseSlice(To(t),n.parseOptions).content:o.parse(To(t),n.parseOptions)}return $o("",e,n)}function zE(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof $e||i instanceof Ne))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),t.setSelection(ue.near(t.doc.resolve(s),n))}const jE=t=>!("type"in t),FE=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=$o(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((jE(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 z){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&&zE(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},HE=()=>({state:t,dispatch:e})=>FS(t,e),WE=()=>({state:t,dispatch:e})=>HS(t,e),UE=()=>({state:t,dispatch:e})=>kf(t,e),qE=()=>({state:t,dispatch:e})=>Cf(t,e),KE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},YE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=so(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},JE=()=>({state:t,dispatch:e})=>zS(t,e),GE=()=>({state:t,dispatch:e})=>jS(t,e);function Ff(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ZE(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Ol()||Ff()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const XE=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=ZE(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function pi(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Be(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);l.push({node:f,from:p,to:m})});const c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Mo(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const QE=(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?WS(n,r):!1},e3=()=>({state:t,dispatch:e})=>Mf(t,e),t3=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return nE(r)(e,n)},n3=()=>({state:t,dispatch:e})=>Ef(t,e);function No(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Hf(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const r3=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Hf(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Hf(f.attrs,e)))})})}),!0):!1},i3=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),o3=()=>({tr:t,dispatch:e})=>{if(e){const n=new tt(t.doc);t.setSelection(n)}return!0},s3=()=>({state:t,dispatch:e})=>wf(t,e),l3=()=>({state:t,dispatch:e})=>Sf(t,e),a3=()=>({state:t,dispatch:e})=>YS(t,e),c3=()=>({state:t,dispatch:e})=>ZS(t,e),d3=()=>({state:t,dispatch:e})=>GS(t,e);function Ml(t,e,n={},r={}){return $o(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const u3=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Ml(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Bo(t,e){const n=pn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function f3(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 h3(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Tl(t){return e=>h3(e.$from,t)}function p3(t,e){const n={from:0,to:t.content.size};return Lf(t,n,e)}function m3(t,e){const n=Be(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function g3(t,e){const n=No(typeof e=="string"?e:e.name,t.schema);return n==="node"?m3(t,e):n==="mark"?Bo(t,e):{}}function Wf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Sl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ao(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $l(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?pn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Mo(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(p,y),v=Math.min(m,y+g.nodeSize),M=v-b;s+=M,l.push(...g.marks.map(k=>({mark:k,from:b,to:v})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Mo(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function y3(t,e,n={}){if(!e)return pi(t,null,n)||$l(t,null,n);const r=No(e,t.schema);return r==="node"?pi(t,e,n):r==="mark"?$l(t,e,n):!1}function Uf(t,e){const{nodeExtensions:n}=wo(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=fe(te(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Nl(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Nl(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function b3(t){return t instanceof re}function qf(t,e,n){const i=t.state.doc.content.size,o=Ht(e,0,i),s=Ht(n,0,i),l=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(l.top,c.top),u=Math.max(l.bottom,c.bottom),f=Math.min(l.left,c.left),h=Math.max(l.right,c.right),p=h-f,m=u-d,b={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...b,toJSON:()=>b}}function k3(t,e,n){var r;const{selection:i}=e;let o=null;if(El(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,c.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const x3=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=pn(t,r.schema);if(i)if(s){const d=Bo(r,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(b=>b.type===c)?h.marks.forEach(b=>{c===b.type&&n.addMark(m,g,c.create({...b.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return k3(r,n,c)},w3=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),v3=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Be(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Nf(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Nf(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},C3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ht(t,0,r.content.size),o=re.create(r,i);e.setSelection(o)}return!0},S3=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ce.atStart(r).from,l=ce.atEnd(r).to,c=Ht(i,s,l),d=Ht(o,s,l),u=ce.create(r,c,d);e.setSelection(u)}return!0},E3=t=>({state:e,dispatch:n})=>{const r=Be(t,e.schema);return oE(r)(e,n)};function Kf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const O3=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,u=Ao(d,l.node().type.name,l.node().attrs);if(o instanceof re&&o.node.isBlock)return!l.parentOffset||!Pt(s,l.pos)?!1:(r&&(t&&Kf(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:f3(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Pt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&Pt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const g=e.mapping.map(l.before()),y=e.doc.resolve(g);l.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}t&&Kf(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},M3=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=Be(t,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=z.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let I=c.depth-v;I>=c.depth-3;I-=1)b=z.from(c.node(I).copy(b));const M=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,k={...Ao(h,c.node().type.name,c.node().attrs),...e},O=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(k))||void 0;b=b.append(z.from(l.createAndFill(null,O)||void 0));const C=c.before(c.depth-(v-1));n.replace(C,c.after(-M),new J(b,4-v,0));let B=-1;n.doc.nodesBetween(C,n.doc.content.size,(I,_)=>{if(B>-1)return!1;I.isTextblock&&I.content.size===0&&(B=_+1)}),B>-1&&n.setSelection(ce.near(n.doc.resolve(B))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Ao(h,f.type.name,f.attrs),...e},g={...Ao(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const y=p?[{type:l,attrs:m},{type:p,attrs:g}]:[{type:l,attrs:m}];if(!Pt(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:v}=r,{splittableMarks:M}=o.extensionManager,k=v||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!k||!i)return!0;const O=k.filter(C=>M.includes(C.type.name));n.ensureMarks(O)}return!0},Bl=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,n.pos)&&t.join(n.pos),!0},Al=(t,e)=>{const n=Tl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&rn(t.doc,r)&&t.join(r),!0};var T3=Object.freeze({__proto__:null,blur:vE,clearContent:CE,clearNodes:SE,command:EE,createParagraphNear:OE,cut:ME,deleteCurrentNode:TE,deleteNode:$E,deleteRange:NE,deleteSelection:BE,enter:AE,exitCode:VE,extendMarkRange:DE,first:_E,focus:IE,forEach:PE,insertContent:RE,insertContentAt:FE,joinBackward:UE,joinDown:WE,joinForward:qE,joinItemBackward:KE,joinItemForward:YE,joinTextblockBackward:JE,joinTextblockForward:GE,joinUp:HE,keyboardShortcut:XE,lift:QE,liftEmptyBlock:e3,liftListItem:t3,newlineInCode:n3,resetAttributes:r3,scrollIntoView:i3,selectAll:o3,selectNodeBackward:s3,selectNodeForward:l3,selectParentNode:a3,selectTextblockEnd:c3,selectTextblockStart:d3,setContent:u3,setMark:x3,setMeta:w3,setNode:v3,setNodeSelection:C3,setTextSelection:S3,sinkListItem:E3,splitBlock:O3,splitListItem:M3,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Be(t,s.schema),m=Be(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:v}=g,M=b.blockRange(v),k=y||g.$to.parentOffset&&g.$from.marks();if(!M)return!1;const O=Tl(C=>Uf(C.type.name,f))(g);if(M.depth>=1&&O&&M.depth-O.depth<=1){if(O.node.type===p)return d.liftListItem(m);if(Uf(O.node.type.name,f)&&p.validContent(O.node.content)&&l)return c().command(()=>(o.setNodeMarkup(O.pos,p),!0)).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()}return!n||!k||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run():c().command(()=>{const C=u().wrapInList(p,r),B=k.filter(I=>h.includes(I.type.name));return o.ensureMarks(B),C?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Bl(o,p)).command(()=>Al(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=pn(t,r.schema);return $l(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Be(t,r.schema),s=Be(e,r.schema),l=pi(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Be(t,n.schema);return pi(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,l=o.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,c=pn(t,r.schema),{$from:d,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:h,to:p}=l;const m=(o=d.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=Sl(d,c,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,c)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=No(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Be(t,r.schema)),l==="mark"&&(s=pn(t,r.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g),y>=d&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(b=>{if(s===b.type){const v=Math.max(y,d),M=Math.min(y+g.nodeSize,u);n.addMark(v,M,s.create({...b.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(p,m,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return XS(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Be(t,n.schema);return QS(i,e)(n,r)}});const $3=Oe.create({name:"commands",addCommands(){return{...T3}}}),N3=Oe.create({name:"drop",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),B3=Oe.create({name:"editable",addProseMirrorPlugins(){return[new _e({key:new nt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),A3=Oe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new _e({key:new nt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),V3=Oe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,b=g&&m.parent.childCount===1?y===f.pos:ue.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ol()||Ff()?o:i},addProseMirrorPlugins(){return[new _e({key:new nt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=e.selection,c=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!Nl(n.doc))return;const h=n.tr,p=ko({state:n,transaction:h}),{commands:m}=new xo({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),D3=Oe.create({name:"paste",addProseMirrorPlugins(){return[new _e({key:new nt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_3=Oe.create({name:"tabindex",addProseMirrorPlugins(){return[new _e({key:new nt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Rn{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Rn(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Rn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Rn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const c=new Rn(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Rn(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const c=s[l];if(o[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(c=>n[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const L3=`.ProseMirror {
|
|
5
|
+
*/function Ke(t){return typeof t=="function"}function Pc(t){return t==null}const $n=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Js(t){return Number(t)>=0}function i0(t){const e=parseFloat(t);return isNaN(e)?t:e}function o0(t){return typeof t=="object"&&t!==null}function s0(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!o0(t)||s0(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 vi(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),vi(t[n],e[n]);return}t[n]=e[n]}),t}function wi(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Js(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Kt(t,e){l0(t,e),Fc[t]=e}function a0(t){return Fc[t]}function l0(t,e){if(!Ke(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function jc(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,a){i.set(De(a),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++)jc(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]||jc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const xi=Symbol("vee-validate-form"),zc=Symbol("vee-validate-field-instance"),wo=Symbol("Default empty value"),c0=typeof window<"u";function Zs(t){return Ke(t)&&!!t.__locatorRef}function Gt(t){return!!t&&Ke(t.parse)&&t.__type==="VVTypedSchema"}function xo(t){return!!t&&Ke(t.validate)}function Ei(t){return t==="checkbox"||t==="radio"}function d0(t){return $n(t)||Array.isArray(t)}function u0(t){return Array.isArray(t)?t.length===0:$n(t)&&Object.keys(t).length===0}function Eo(t){return/^\[.+\]$/i.test(t)}function f0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function h0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function p0(t,e){return!h0(t,e)&&e.type!=="file"&&!Ei(e.type)}function Wc(t){return Xs(t)&&t.target&&"submit"in t.target}function Xs(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]!==wo}function pt(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(!pt(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(!pt(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(!pt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return c0?t instanceof File:!1}function Qs(t){return Eo(t)?t.replace(/\[|\]/gi,""):t}function wt(t,e,n){return t?Eo(e)?t[Qs(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>d0(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(Eo(e)){t[Qs(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]]=Js(r[o+1])?[]:{}),i=i[r[o]]}}function ea(t,e){if(Array.isArray(t)&&Js(e)){t.splice(Number(e),1);return}$n(t)&&delete t[e]}function qc(t,e){if(Eo(e)){delete t[Qs(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){ea(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>wt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(u0(i[o])){if(o===0){ea(t,n[0]);continue}ea(i[o-1],n[o-1])}}function xt(t){return Object.keys(t)}function ta(t,e=void 0){const n=l.getCurrentInstance();return(n==null?void 0:n.provides[t])||l.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>pt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return pt(t,e)?n:e}function m0(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 g0(t,e){return $n(e)&&e.number?i0(t):t}function na(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 ra(t){return Array.isArray(t)?t:t?[t]:[]}function Co(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function y0(t){let e=null,n=[];return function(...r){const i=l.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 ia(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 oa(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function b0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function So(t){if(!Xs(t))return t;const e=t.target;if(Ei(e.type)&&Jc(e))return oa(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(f0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(oa);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?oa(n):e.value}return b0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?$n(t)&&t._$$isNormalized?t:$n(t)?Object.keys(t).reduce((n,r)=>{const i=k0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=v0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function k0(t){return t===!0?[]:Array.isArray(t)||$n(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?w0(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 v0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function w0(t){const e=n=>wt(n,t)||n[t];return e.__locatorRef=t,e}function x0(t){return Array.isArray(t)?t.filter(Zs):xt(t).filter(e=>Zs(t[e])).map(e=>t[e])}let E0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const sr=()=>E0;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 C0(i,t)).errors;return{errors:s,valid:!s.length}}async function C0(t,e){if(Gt(t.rules)||xo(t.rules))return _0(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},a=Array.isArray(t.rules)?t.rules:[t.rules],c=a.length,d=[];for(let u=0;u<c;u++){const f=a[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h: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 a=i[s],c=await O0(n,e,{name:a,params:n.rules[a]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function S0(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(!S0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,a)=>{const c=a.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...a.errors),s},{});return{errors:Object.values(o)}}}}}async function _0(t,e){const r=await(Gt(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 O0(t,e,n){const r=a0(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=T0(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=sr().generateMessage;return e?e(t):"Field is invalid"}function T0(t,e){const n=r=>Zs(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 N0(t,e){const r=await(Gt(t)?t:ed(t)).parse(De(e)),i={},o={};for(const s of r.errors){const a=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!a.length,errors:a},a.length&&(o[c]=a[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function M0(t,e,n){const i=xt(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(wt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),a={},c={};for(const d of s)a[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:a,errors:c}}let nd=0;function A0(t,e){const{value:n,initialValue:r,setInitialValue:i}=D0(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}=B0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=L0(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=l.computed(()=>o.errors);function a(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(l.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(l.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:a}}function D0(t,e,n){const r=l.ref(l.unref(e));function i(){return n?wt(n.initialValues.value,l.unref(t),l.unref(r)):l.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(l.unref(t),d,!0)}const s=l.computed(i);if(!n)return{value:l.ref(i()),initialValue:s,setInitialValue:o};const a=$0(e,n,s,t);return n.stageInitialValue(l.unref(t),a,!0),{value:l.computed({get(){return wt(n.values,l.unref(t))},set(d){n.setFieldValue(l.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function $0(t,e,n,r){return l.isRef(t)?l.unref(t):t!==void 0?t:wt(e.values,l.unref(r),l.unref(n))}function L0(t,e,n,r){const i=l.computed(()=>{var s,a,c;return(c=(a=(s=l.toValue(r))===null||s===void 0?void 0:s.describe)===null||a===void 0?void 0:a.call(s).required)!==null&&c!==void 0?c:!1}),o=l.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!l.unref(n).length,initialValue:l.computed(()=>l.unref(e)),dirty:l.computed(()=>!pt(l.unref(t),l.unref(e)))});return l.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function B0(){const t=l.ref([]);return{errors:t,setErrors:e=>{t.value=ra(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&r0({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"},P0)}const Ci={},Si={};let yn;const Lr=m0(()=>{setTimeout(async()=>{await l.nextTick(),yn==null||yn.sendInspectorState(Br),yn==null||yn.sendInspectorTree(Br)},100)},100);function I0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ci[t.formId]=Object.assign({},t),Ci[t.formId]._vm=e,l.onUnmounted(()=>{delete Ci[t.formId],Lr()}),Lr()}function V0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Si[t.id]=Object.assign({},t),Si[t.id]._vm=e,l.onUnmounted(()=>{delete Si[t.id],Lr()}),Lr()}const Br="vee-validate-inspector",Et={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let He=null;function P0(t){yn=t,t.addInspector({id:Br,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!==Br)return;const n=Object.values(Ci),r=Object.values(Si);e.rootNodes=[...n.map(R0),...r.map(i=>j0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Br||n.currentTab!==`custom-inspector:${Br}`)return;const{form:r,field:i,state:o,type:s}=z0(e.nodeId);if(r&&s==="form"){e.state=H0(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 R0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,l.unref(s.path),F0(s,t))});function i(s,a=[]){const c=[...a].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):$n(s)?{id:`${a.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...a,d]))}:Array.isArray(s)?{id:`${a.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:sa(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Et.white,backgroundColor:Et.unknown}]}}function F0(t,e){return{id:sa(e,t),label:l.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function j0(t,e){return{id:sa(e,t),label:l.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:Et.black,backgroundColor:Et.gray},n==="checkbox"?{label:"Checkbox",textColor:Et.white,backgroundColor:Et.blue}:void 0,n==="radio"?{label:"Radio",textColor:Et.white,backgroundColor:Et.purple}:void 0,t?{label:"Multiple",textColor:Et.black,backgroundColor:Et.orange}:void 0].filter(Boolean)}function sa(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:l.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 z0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Ci[e.f];if(!n&&e.ff){const i=Si[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function 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 H0(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:xt(e.value).reduce((a,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(a[c]=u),a},{})}]}}function sd(t){return{bgColor:t?Et.success:Et.error,textColor:t?Et.black:Et.white}}function W0(t,e,n){return Ei(n==null?void 0:n.type)?Y0(t,e,n):ad(t,e,n)}function ad(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:a,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=U0(n),g=f?ta(xi):void 0,y=m||g,k=l.computed(()=>wi(l.toValue(t))),x=l.computed(()=>{if(l.toValue(y==null?void 0:y.schema))return;const j=l.unref(e);return xo(j)||Gt(j)||Ke(j)||Array.isArray(j)?j:Zc(j)}),w=!Ke(x.value)&&Gt(l.toValue(e)),{id:b,value:C,initialValue:v,meta:S,setState:D,errors:O,flags:$}=A0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?T:void 0,schema:w?e:void 0}),V=l.computed(()=>O.value[0]);p&&q0({value:C,prop:p,handleChange:R,shouldValidate:()=>d&&!$.pendingReset});const B=(U,j=!1)=>{S.touched=!0,j&&Y()};async function J(U){var j,ce;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(U);return(j=le[l.toValue(k)])!==null&&j!==void 0?j:{valid:!0,errors:[]}}return x.value?Qc(C.value,x.value,{name:l.toValue(k),label:l.toValue(c),values:(ce=y==null?void 0:y.values)!==null&&ce!==void 0?ce:{},bails:o}):{valid:!0,errors:[]}}const Y=na(async()=>(S.pending=!0,S.validated=!0,J("validated-only")),U=>($.pendingUnmount[z.id]||(D({errors:U.errors}),S.pending=!1,S.valid=U.valid),U)),I=na(async()=>J("silent"),U=>(S.valid=U.valid,U));function T(U){return(U==null?void 0:U.mode)==="silent"?I():Y()}function R(U,j=!0){const ce=So(U);he(ce,j)}l.onMounted(()=>{if(i)return Y();(!y||!y.validateSchema)&&I()});function F(U){S.touched=U}function ee(U){var j;const ce=U&&"value"in U?U.value:v.value;D({value:De(ce),initialValue:De(ce),touched:(j=U==null?void 0:U.touched)!==null&&j!==void 0?j:!1,errors:(U==null?void 0:U.errors)||[]}),S.pending=!1,S.validated=!1,I()}const ie=l.getCurrentInstance();function he(U,j=!0){C.value=ie&&p?g0(U,ie.props.modelModifiers):U,(j?Y:I)()}function ue(U){D({errors:Array.isArray(U)?U:[U]})}const L=l.computed({get(){return C.value},set(U){he(U,d)}}),z={id:b,name:k,label:c,value:L,meta:S,errors:O,errorMessage:V,type:s,checkedValue:a,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:ee,handleReset:()=>ee(),validate:T,handleChange:R,handleBlur:B,setState:D,setTouched:F,setErrors:ue,setValue:he};if(l.provide(zc,z),l.isRef(e)&&typeof l.unref(e)!="function"&&l.watch(e,(U,j)=>{pt(U,j)||(S.validated?Y():I())},{deep:!0}),process.env.NODE_ENV!=="production"&&(z._vm=l.getCurrentInstance(),l.watch(()=>Object.assign(Object.assign({errors:O.value},S),{value:C.value}),Lr,{deep:!0}),y||V0(z)),!y)return z;const q=l.computed(()=>{const U=x.value;return!U||Ke(U)||xo(U)||Gt(U)||Array.isArray(U)?{}:Object.keys(U).reduce((j,ce)=>{const le=x0(U[ce]).map(ve=>ve.__locatorRef).reduce((ve,Ne)=>{const Ie=wt(y.values,Ne)||y.values[Ne];return Ie!==void 0&&(ve[Ne]=Ie),ve},{});return Object.assign(j,le),j},{})});return l.watch(q,(U,j)=>{if(!Object.keys(U).length)return;!pt(U,j)&&(S.validated?Y():I())}),l.onBeforeUnmount(()=>{var U;const j=(U=l.toValue(z.keepValueOnUnmount))!==null&&U!==void 0?U:l.toValue(y.keepValuesOnUnmount),ce=l.toValue(k);if(j||!y||$.pendingUnmount[z.id]){y==null||y.removePathState(ce,b);return}$.pendingUnmount[z.id]=!0;const le=y.getPathState(ce);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(z.id):(le==null?void 0:le.id)===z.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const Ne=le.value.findIndex(Ie=>pt(Ie,l.toValue(z.checkedValue)));if(Ne>-1){const Ie=[...le.value];Ie.splice(Ne,1),y.setFieldValue(ce,Ie)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(z.id),1)}else y.unsetPathValue(l.toValue(k));y.removePathState(ce,b)}}),z}function U0(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||{}))?aa(l.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:a})}function Y0(t,e,n){const r=n!=null&&n.standalone?void 0:ta(xi),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(a){const c=a.handleChange,d=l.computed(()=>{const f=l.toValue(a.value),h=l.toValue(i);return Array.isArray(f)?f.findIndex(p=>pt(p,h))>=0:pt(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const g=l.toValue(t),y=r==null?void 0:r.getPathState(g),k=So(f);let x=(m=l.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(wt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(l.toValue(a.value),x,l.toValue(o))),c(x,h)}return Object.assign(Object.assign({},a),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ad(t,e,n))}function q0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=l.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&&(l.watch(e,a=>{pt(a,aa(i,o))||i.emit(s,a)}),l.watch(()=>aa(i,o),a=>{if(a===wo&&e.value===void 0)return;const c=a===wo?void 0:a;pt(c,e.value)||n(c,r())}))}function aa(t,e){if(t)return t.props[e]}const K0=l.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:()=>sr().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:wo},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=l.toRef(t,"rules"),r=l.toRef(t,"name"),i=l.toRef(t,"label"),o=l.toRef(t,"uncheckedValue"),s=l.toRef(t,"keepValue"),{errors:a,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:k,setErrors:x}=W0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:J0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(O,$=!0){f(O,$)},b=l.computed(()=>{const{validateOnInput:D,validateOnChange:O,validateOnBlur:$,validateOnModelUpdate:V}=G0(t);function B(T){h(T,$),Ke(e.attrs.onBlur)&&e.attrs.onBlur(T)}function J(T){w(T,D),Ke(e.attrs.onInput)&&e.attrs.onInput(T)}function Y(T){w(T,O),Ke(e.attrs.onChange)&&e.attrs.onChange(T)}const I={name:t.name,onBlur:B,onInput:J,onChange:Y};return I["onUpdate:modelValue"]=T=>w(T,V),I}),C=l.computed(()=>{const D=Object.assign({},b.value);Ei(e.attrs.type)&&k&&(D.checked=k.value);const O=ld(t,e);return p0(O,e.attrs)&&(D.value=c.value),D}),v=l.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function S(){return{field:C.value,componentField:v.value,value:c.value,meta:y,errors:a.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:D=>w(D,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:a,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const D=l.resolveDynamicComponent(ld(t,e)),O=ia(D,e,S);return D?l.h(D,Object.assign(Object.assign({},e.attrs),C.value),O):O}}});function ld(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function G0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:a,validateOnModelUpdate:c}=sr();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function J0(t,e){return Ei(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const ar=K0;let Z0=0;const _o=["bails","fieldsCount","id","multiple","type","validate"];function cd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},l.toValue(e)),r=l.unref(t==null?void 0:t.validationSchema);return r&&Gt(r)&&Ke(r.cast)?De(r.cast(n)||{}):De(n)}function X0(t){var e;const n=Z0++;let r=0;const i=l.ref(!1),o=l.ref(!1),s=l.ref(0),a=[],c=l.reactive(cd(t)),d=l.ref([]),u=l.ref({}),f=l.ref({}),h=y0(()=>{f.value=d.value.reduce((N,A)=>(N[wi(l.toValue(A.path))]=A,N),{})});function p(N,A){const W=T(N);if(!W){typeof N=="string"&&(u.value[wi(N)]=ra(A));return}if(typeof N=="string"){const te=wi(N);u.value[te]&&delete u.value[te]}W.errors=ra(A),W.valid=!W.errors.length}function m(N){xt(N).forEach(A=>{p(A,N[A])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=l.computed(()=>{const N=d.value.reduce((A,W)=>(W.errors.length&&(A[W.path]=W.errors),A),{});return Object.assign(Object.assign({},u.value),N)}),y=l.computed(()=>xt(g.value).reduce((N,A)=>{const W=g.value[A];return W!=null&&W.length&&(N[A]=W[0]),N},{})),k=l.computed(()=>d.value.reduce((N,A)=>(N[A.path]={name:A.path||"",label:A.label||""},N),{})),x=l.computed(()=>d.value.reduce((N,A)=>{var W;return N[A.path]=(W=A.bails)!==null&&W!==void 0?W:!0,N},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:v,setInitialValues:S}=ey(d,c,t),D=Q0(d,c,v,y),O=l.computed(()=>d.value.reduce((N,A)=>{const W=wt(c,A.path);return gn(N,A.path,W),N},{})),$=t==null?void 0:t.validationSchema;function V(N,A){var W,te;const de=l.computed(()=>wt(C.value,l.toValue(N))),M=f.value[l.toValue(N)],X=(A==null?void 0:A.type)==="checkbox"||(A==null?void 0:A.type)==="radio";if(M&&X){M.multiple=!0;const vt=r++;return Array.isArray(M.id)?M.id.push(vt):M.id=[M.id,vt],M.fieldsCount++,M.__flags.pendingUnmount[vt]=!1,M}const re=l.computed(()=>wt(c,l.toValue(N))),me=l.toValue(N),ye=F.findIndex(vt=>vt===me);ye!==-1&&F.splice(ye,1);const we=l.computed(()=>{var vt,Rt,Dr,or;const mn=l.toValue($);if(Gt(mn))return(Rt=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,l.toValue(N)).required)!==null&&Rt!==void 0?Rt:!1;const vo=l.toValue(A==null?void 0:A.schema);return Gt(vo)&&(or=(Dr=vo.describe)===null||Dr===void 0?void 0:Dr.call(vo).required)!==null&&or!==void 0?or:!1}),Ae=r++,ze=l.reactive({id:Ae,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((W=w[me])===null||W===void 0)&&W.length),required:we,initialValue:de,errors:l.shallowRef([]),bails:(te=A==null?void 0:A.bails)!==null&&te!==void 0?te:!1,label:A==null?void 0:A.label,type:(A==null?void 0:A.type)||"default",value:re,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:A==null?void 0:A.validate,dirty:l.computed(()=>!pt(l.unref(re),l.unref(de)))});return d.value.push(ze),f.value[me]=ze,h(),y.value[me]&&!w[me]&&l.nextTick(()=>{ht(me,{mode:"silent"})}),l.isRef(N)&&l.watch(N,vt=>{h();const Rt=De(re.value);f.value[vt]=ze,l.nextTick(()=>{gn(c,vt,Rt)})}),ze}const B=Gc(se,5),J=Gc(se,5),Y=na(async N=>await(N==="silent"?B():J()),(N,[A])=>{const W=xt(U.errorBag.value),de=[...new Set([...xt(N.results),...d.value.map(M=>M.path),...W])].sort().reduce((M,X)=>{var re;const me=X,ye=T(me)||R(me),we=((re=N.results[me])===null||re===void 0?void 0:re.errors)||[],Ae=l.toValue(ye==null?void 0:ye.path)||me,ze=ty({errors:we,valid:!we.length},M.results[Ae]);return M.results[Ae]=ze,ze.valid||(M.errors[Ae]=ze.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=ze.valid,A==="silent"||A==="validated-only"&&!ye.validated||p(ye,ze.errors),M):(p(Ae,we),M)},{valid:N.valid,results:{},errors:{}});return N.values&&(de.values=N.values),xt(de.results).forEach(M=>{var X;const re=T(M);re&&A!=="silent"&&(A==="validated-only"&&!re.validated||p(re,(X=de.results[M])===null||X===void 0?void 0:X.errors))}),de});function I(N){d.value.forEach(N)}function T(N){const A=typeof N=="string"?wi(N):N;return typeof A=="string"?f.value[A]:A}function R(N){return d.value.filter(W=>N.startsWith(W.path)).reduce((W,te)=>W?te.path.length>W.path.length?te:W:te,void 0)}let F=[],ee;function ie(N){return F.push(N),ee||(ee=l.nextTick(()=>{[...F].sort().reverse().forEach(W=>{qc(c,W)}),F=[],ee=null})),ee}function he(N){return function(W,te){return function(M){return M instanceof Event&&(M.preventDefault(),M.stopPropagation()),I(X=>X.touched=!0),i.value=!0,s.value++,lt().then(X=>{const re=De(c);if(X.valid&&typeof W=="function"){const me=De(O.value);let ye=N?me:re;return X.values&&(ye=X.values),W(ye,{evt:M,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Ne,setValues:le,setFieldValue:j,resetForm:at,resetField:Mt})}!X.valid&&typeof te=="function"&&te({values:re,evt:M,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const L=he(!1);L.withControlled=he(!0);function z(N,A){const W=d.value.findIndex(de=>de.path===N&&(Array.isArray(de.id)?de.id.includes(A):de.id===A)),te=d.value[W];if(!(W===-1||!te)){if(l.nextTick(()=>{ht(N,{mode:"silent",warn:!1})}),te.multiple&&te.fieldsCount&&te.fieldsCount--,Array.isArray(te.id)){const de=te.id.indexOf(A);de>=0&&te.id.splice(de,1),delete te.__flags.pendingUnmount[A]}(!te.multiple||te.fieldsCount<=0)&&(d.value.splice(W,1),E(N),h(),delete f.value[N])}}function q(N){xt(f.value).forEach(A=>{A.startsWith(N)&&delete f.value[A]}),d.value=d.value.filter(A=>!A.path.startsWith(N)),l.nextTick(()=>{h()})}const U={formId:n,values:c,controlledValues:O,errorBag:g,errors:y,schema:$,submitCount:s,meta:D,isSubmitting:i,isValidating:o,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:l.unref($)?Y:void 0,validate:lt,setFieldError:p,validateField:ht,setFieldValue:j,setValues:le,setErrors:m,setFieldTouched:Ne,setTouched:Ee,resetForm:at,resetField:Mt,handleSubmit:L,useFieldModel:Oe,defineInputBinds:P,defineComponentBinds:Z,defineField:_e,stageInitialValue:_,unsetInitialValue:E,setFieldInitialValue:H,createPathState:V,getPathState:T,unsetPathValue:ie,removePathState:z,initialValues:C,getAllPathStates:()=>d.value,destroyPath:q,isFieldTouched:Ie,isFieldDirty:tt,isFieldValid:Q};function j(N,A,W=!0){const te=De(A),de=typeof N=="string"?N:N.path;T(de)||V(de),gn(c,de,te),W&&ht(de)}function ce(N,A=!0){xt(c).forEach(W=>{delete c[W]}),xt(N).forEach(W=>{j(W,N[W],!1)}),A&<()}function le(N,A=!0){vi(c,N),a.forEach(W=>W&&W.reset()),A&<()}function ve(N,A){const W=T(l.toValue(N))||V(N);return l.computed({get(){return W.value},set(te){var de;const M=l.toValue(N);j(M,te,(de=l.toValue(A))!==null&&de!==void 0?de:!1)}})}function Ne(N,A){const W=T(N);W&&(W.touched=A)}function Ie(N){const A=T(N);return A?A.touched:d.value.filter(W=>W.path.startsWith(N)).some(W=>W.touched)}function tt(N){const A=T(N);return A?A.dirty:d.value.filter(W=>W.path.startsWith(N)).some(W=>W.dirty)}function Q(N){const A=T(N);return A?A.valid:d.value.filter(W=>W.path.startsWith(N)).every(W=>W.valid)}function Ee(N){if(typeof N=="boolean"){I(A=>{A.touched=N});return}xt(N).forEach(A=>{Ne(A,!!N[A])})}function Mt(N,A){var W;const te=A&&"value"in A?A.value:wt(C.value,N),de=T(N);de&&(de.__flags.pendingReset=!0),H(N,De(te),!0),j(N,te,!1),Ne(N,(W=A==null?void 0:A.touched)!==null&&W!==void 0?W:!1),p(N,(A==null?void 0:A.errors)||[]),l.nextTick(()=>{de&&(de.__flags.pendingReset=!1)})}function at(N,A){let W=De(N!=null&&N.values?N.values:v.value);W=A!=null&&A.force?W:vi(v.value,W),W=Gt($)&&Ke($.cast)?$.cast(W):W,S(W),I(te=>{var de;te.__flags.pendingReset=!0,te.validated=!1,te.touched=((de=N==null?void 0:N.touched)===null||de===void 0?void 0:de[te.path])||!1,j(te.path,wt(W,te.path),!1),p(te.path,void 0)}),A!=null&&A.force?ce(W,!1):le(W,!1),m((N==null?void 0:N.errors)||{}),s.value=(N==null?void 0:N.submitCount)||0,l.nextTick(()=>{lt({mode:"silent"}),I(te=>{te.__flags.pendingReset=!1})})}async function lt(N){const A=(N==null?void 0:N.mode)||"force";if(A==="force"&&I(M=>M.validated=!0),U.validateSchema)return U.validateSchema(A);o.value=!0;const W=await Promise.all(d.value.map(M=>M.validate?M.validate(N).then(X=>({key:M.path,valid:X.valid,errors:X.errors})):Promise.resolve({key:M.path,valid:!0,errors:[]})));o.value=!1;const te={},de={};for(const M of W)te[M.key]={valid:M.valid,errors:M.errors},M.errors.length&&(de[M.key]=M.errors[0]);return{valid:W.every(M=>M.valid),results:te,errors:de}}async function ht(N,A){var W;const te=T(N);if(te&&(A==null?void 0:A.mode)!=="silent"&&(te.validated=!0),$){const{results:M}=await Y((A==null?void 0:A.mode)||"validated-only");return M[N]||{errors:[],valid:!0}}return te!=null&&te.validate?te.validate(A):(!te&&((W=A==null?void 0:A.warn)!==null&&W!==void 0?W:!0)&&process.env.NODE_ENV!=="production"&&l.warn(`field with path ${N} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(N){qc(C.value,N)}function _(N,A,W=!1){H(N,A),gn(c,N,A),W&&!(t!=null&&t.initialValues)&&gn(v.value,N,De(A))}function H(N,A,W=!1){gn(C.value,N,De(A)),W&&gn(v.value,N,De(A))}async function se(){const N=l.unref($);if(!N)return{valid:!0,results:{},errors:{}};o.value=!0;const A=xo(N)||Gt(N)?await N0(N,c):await M0(N,c,{names:k.value,bailsMap:x.value});return o.value=!1,A}const Me=L((N,{evt:A})=>{Wc(A)&&A.target.submit()});l.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){lt();return}U.validateSchema&&U.validateSchema("silent")}),l.isRef($)&&l.watch($,()=>{var N;(N=U.validateSchema)===null||N===void 0||N.call(U,"validated-only")}),l.provide(xi,U),process.env.NODE_ENV!=="production"&&(I0(U),l.watch(()=>Object.assign(Object.assign({errors:g.value},D.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Lr,{deep:!0}));function _e(N,A){const W=Ke(A)||A==null?void 0:A.label,te=T(l.toValue(N))||V(N,{label:W}),de=()=>Ke(A)?A(Co(te,_o)):A||{};function M(){var we;te.touched=!0,((we=de().validateOnBlur)!==null&&we!==void 0?we:sr().validateOnBlur)&&ht(te.path)}function X(){var we;((we=de().validateOnInput)!==null&&we!==void 0?we:sr().validateOnInput)&&l.nextTick(()=>{ht(te.path)})}function re(){var we;((we=de().validateOnChange)!==null&&we!==void 0?we:sr().validateOnChange)&&l.nextTick(()=>{ht(te.path)})}const me=l.computed(()=>{const we={onChange:re,onInput:X,onBlur:M};return Ke(A)?Object.assign(Object.assign({},we),A(Co(te,_o)).props||{}):A!=null&&A.props?Object.assign(Object.assign({},we),A.props(Co(te,_o))):we});return[ve(N,()=>{var we,Ae,ze;return(ze=(we=de().validateOnModelUpdate)!==null&&we!==void 0?we:(Ae=sr())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&ze!==void 0?ze:!0}),me]}function Oe(N){return Array.isArray(N)?N.map(A=>ve(A,!0)):ve(N)}function P(N,A){const[W,te]=_e(N,A);function de(){te.value.onBlur()}function M(re){const me=So(re);j(l.toValue(N),me,!1),te.value.onInput()}function X(re){const me=So(re);j(l.toValue(N),me,!1),te.value.onChange()}return l.computed(()=>Object.assign(Object.assign({},te.value),{onBlur:de,onInput:M,onChange:X,value:W.value}))}function Z(N,A){const[W,te]=_e(N,A),de=T(l.toValue(N));function M(X){W.value=X}return l.computed(()=>{const X=Ke(A)?A(Co(de,_o)):A||{};return Object.assign({[X.model||"modelValue"]:W.value,[`onUpdate:${X.model||"modelValue"}`]:M},te.value)})}return Object.assign(Object.assign({},U),{values:l.readonly(c),handleReset:()=>at(),submitForm:Me})}function Q0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=l.computed(()=>!pt(e,l.unref(n)));function s(){const c=t.value;return xt(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const a=l.reactive(s());return l.watchEffect(()=>{const c=s();a.touched=c.touched,a.valid=c.valid,a.pending=c.pending}),l.computed(()=>Object.assign(Object.assign({initialValues:l.unref(n)},a),{valid:a.valid&&!xt(r.value).length,dirty:o.value}))}function ey(t,e,n){const r=cd(n),i=l.ref(r),o=l.ref(De(r));function s(a,c=!1){i.value=vi(De(i.value)||{},De(a)),o.value=vi(De(o.value)||{},De(a)),c&&t.value.forEach(d=>{if(d.touched)return;const f=wt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function ty(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const ny=l.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=l.toRef(t,"validationSchema"),r=l.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:a,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:C,setTouched:v,resetField:S}=X0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=y((T,{evt:R})=>{Wc(R)&&R.target.submit()},t.onInvalidSubmit),O=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):D;function $(T){Xs(T)&&T.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function V(T,R){return y(typeof T=="function"&&!R?T:R,t.onInvalidSubmit)(T)}function B(){return De(s)}function J(){return De(a.value)}function Y(){return De(i.value)}function I(){return{meta:a.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:V,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,resetField:S,getValues:B,getMeta:J,getErrors:Y}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:S,getValues:B,getMeta:J,getErrors:Y,values:s,meta:a,errors:i}),function(){const R=t.as==="form"?t.as:t.as?l.resolveDynamicComponent(t.as):null,F=ia(R,e,I);if(!R)return F;const ee=R==="form"?{novalidate:!0}:{};return l.h(R,Object.assign(Object.assign(Object.assign({},ee),e.attrs),{onSubmit:O,onReset:$}),F)}}}),ry=l.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=l.inject(xi,void 0),r=l.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?l.resolveDynamicComponent(t.as):t.as,s=ia(o,e,i),a=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?l.h(o||"span",a,r.value):l.h(o,a,s)}}});function iy(t){const e=ta(xi),n=t?void 0:l.inject(zc);return l.computed(()=>t?e==null?void 0:e.errors.value[l.toValue(t)]:n==null?void 0:n.errorMessage.value)}Kt("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),Kt("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"}),Kt("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"),Kt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Kt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Kt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Kt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Kt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Kt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Kt("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"}),Kt("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},oy={},sy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ay=[l.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 ly(t,e){return l.openBlock(),l.createElementBlock("svg",sy,ay)}const cy=be(oy,[["render",ly]]),dy={},uy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},fy=[l.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 hy(t,e){return l.openBlock(),l.createElementBlock("svg",uy,fy)}const py=be(dy,[["render",hy]]),my={class:"relative"},Ir=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",my,[l.createVNode(cy,{class:"absolute opacity-25"}),l.createVNode(py,{class:l.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let fe={theme:"wpic-tools",popoverTarget:"body"};const gy=["is","type","disabled"],yy={key:0,class:"absolute inset-0 flex justify-center items-center"},by={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ky=["onClick"],_i=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=l.ref(null),r=l.ref(null),i=l.ref(!1),o=l.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)};l.onMounted(()=>{document.addEventListener("click",s)}),l.onUnmounted(()=>{document.removeEventListener("click",s)});const a={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 l.openBlock(),l.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var C;return(C=t.actions)!=null&&C.length?i.value=!i.value:null}),class:l.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,[`${a[l.unref(fe).theme]}`]:!0,[`${u[l.unref(fe).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[l.unref(fe).theme]}`]:t.secondary,[`${p[l.unref(fe).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[l.unref(fe).theme]}`]:t.primary&&t.plain,[`${y[l.unref(fe).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[l.unref(fe).theme]}`]:t.colorless,[`${h[l.unref(fe).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[l.unref(fe).theme]}`]:t.destructive&&t.plain,[`${d[l.unref(fe).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?(l.openBlock(),l.createElementBlock("div",yy,[l.createVNode(Ir,{class:"w-6 h-6"})])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(o.value),{to:t.to,class:l.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:l.withCtx(()=>[l.renderSlot(k.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.length&&i.value?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[l.createElementVNode("div",by,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.actions,b=>(l.openBlock(),l.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},l.toDisplayString(b.label),9,ky))),256))])],512)):l.createCommentVNode("",!0)],10,gy)}}}),vy=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[l.unref(fe).theme]]])},[l.renderSlot(n.$slots,"default")],2))}}),wy={name:"WpicInputGroup"},xy={class:"wpic-input-group flex w-full"};function Ey(t,e,n,r,i,o){return l.openBlock(),l.createElementBlock("div",xy,[l.renderSlot(t.$slots,"default")])}const Cy=be(wy,[["render",Ey]]),Sy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=l.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(ny),{ref_key:"myForm",ref:n},{default:l.withCtx(({values:d,meta:u,errors:f})=>[l.renderSlot(a.$slots,"default")]),_:3},512))}}),Oi=Math.min,Vr=Math.max,Oo=Math.round,Ln=t=>({x:t,y:t}),_y={left:"right",right:"left",bottom:"top",top:"bottom"},Oy={start:"end",end:"start"};function la(t,e,n){return Vr(t,Oi(e,n))}function Ti(t,e){return typeof t=="function"?t(e):t}function lr(t){return t.split("-")[0]}function Ni(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function ca(t){return t==="y"?"height":"width"}function To(t){return["top","bottom"].includes(lr(t))?"y":"x"}function da(t){return dd(To(t))}function Ty(t,e,n){n===void 0&&(n=!1);const r=Ni(t),i=da(t),o=ca(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=No(s)),[s,No(s)]}function Ny(t){const e=No(t);return[ua(t),e,ua(e)]}function ua(t){return t.replace(/start|end/g,e=>Oy[e])}function My(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Ay(t,e,n,r){const i=Ni(t);let o=My(lr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ua)))),o}function No(t){return t.replace(/left|right|bottom|top/g,e=>_y[e])}function Dy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?Dy(t):{top:t,right:t,bottom:t,left:t}}function Mo(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=To(e),s=da(e),a=ca(s),c=lr(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(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(Ni(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const $y=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=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<a.length;g++){const{name:y,fn:k}=a[g],{x,y:w,data:b,reset:C}=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}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.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:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ti(e,t),m=ud(p),y=a[h?f==="floating"?"reference":"floating":f],k=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy: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(a.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},C=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-C.top+m.top)/b.y,bottom:(C.bottom-k.bottom+m.bottom)/b.y,left:(k.left-C.left+m.left)/b.x,right:(C.right-k.right+m.right)/b.x}}const Ly=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=Ti(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=da(i),m=ca(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],C=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=v?v[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(v)))&&(S=a.floating[w]||o.floating[m]);const D=b/2-C/2,O=S/2-g[m]/2-1,$=Oi(f[k],O),V=Oi(f[x],O),B=$,J=S-g[m]-V,Y=S/2-g[m]/2+D,I=la(B,Y,J),T=!c.arrow&&Ni(i)!=null&&Y!==I&&o.reference[m]/2-(Y<B?$:V)-g[m]/2<0,R=T?Y<B?Y-B:Y-J:0;return{[p]:h[p]+R,data:{[p]:I,centerOffset:Y-I-R,...T&&{alignmentOffset:R}},reset:T}}}),By=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ti(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=lr(i),x=lr(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[No(a)]:Ny(a));!h&&m!=="none"&&b.push(...Ay(a,g,m,w));const C=[a,...b],v=await hd(e,y),S=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&S.push(v[k]),f){const B=Ty(i,s,w);S.push(v[B[0]],v[B[1]])}if(D=[...D,{placement:i,overflows:S}],!S.every(B=>B<=0)){var O,$;const B=(((O=o.flip)==null?void 0:O.index)||0)+1,J=C[B];if(J)return{data:{index:B,overflows:D},reset:{placement:J}};let Y=($=D.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!Y)switch(p){case"bestFit":{var V;const I=(V=D.map(T=>[T.placement,T.overflows.filter(R=>R>0).reduce((R,F)=>R+F,0)]).sort((T,R)=>T[1]-R[1])[0])==null?void 0:V[0];I&&(Y=I);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function Iy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=lr(n),a=Ni(n),c=To(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ti(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Vy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,c=await Iy(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Py=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...c}=Ti(t,e),d={x:n,y:r},u=await hd(e,c),f=To(lr(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=la(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=la(x,m,w)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function cr(t){return fa(t)?(t.nodeName||"").toLowerCase():"#document"}function At(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(fa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fa(t){return t instanceof Node||t instanceof At(t).Node}function nn(t){return t instanceof Element||t instanceof At(t).Element}function rn(t){return t instanceof HTMLElement||t instanceof At(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof At(t).ShadowRoot}function Mi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Jt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Ry(t){return["table","td","th"].includes(cr(t))}function ha(t){const e=pa(),n=Jt(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 Fy(t){let e=In(t);for(;rn(e)&&!Pr(e);){if(ha(e))return e;e=In(e)}return null}function pa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pr(t){return["html","body","#document"].includes(cr(t))}function Jt(t){return At(t).getComputedStyle(t)}function Ao(t){return nn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function In(t){if(cr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||Bn(t);return pd(e)?e.host:e}function md(t){const e=In(t);return Pr(e)?t.ownerDocument?t.ownerDocument.body:t.body:rn(e)&&Mi(e)?e:md(e)}function ma(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=At(i);return o?e.concat(s,s.visualViewport||[],Mi(i)?i:[],s.frameElement&&n?ma(s.frameElement):[]):e.concat(i,ma(i,[],n))}function gd(t){const e=Jt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Oo(n)!==o||Oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function yd(t){return nn(t)?t:t.contextElement}function Rr(t){const e=yd(t);if(!rn(e))return Ln(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Oo(n.width):n.width)/r,a=(o?Oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const jy=Ln(0);function bd(t){const e=At(t);return!pa()||!e.visualViewport?jy:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function zy(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==At(t)?!1:e}function Ai(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Ln(1);e&&(r?nn(r)&&(s=Rr(r)):s=Rr(t));const a=zy(o,n,r)?bd(o):Ln(0);let c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=At(o),p=r&&nn(r)?At(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Rr(g),k=g.getBoundingClientRect(),x=Jt(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=At(g),g=m.frameElement}}return Mo({width:u,height:f,x:c,y:d})}const Hy=[":popover-open",":modal"];function ga(t){return Hy.some(e=>{try{return t.matches(e)}catch{return!1}})}function Wy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Bn(r),a=e?ga(e.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Ln(1);const u=Ln(0),f=rn(r);if((f||!f&&!o)&&((cr(r)!=="body"||Mi(s))&&(c=Ao(r)),rn(r))){const h=Ai(r);d=Rr(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 Uy(t){return Array.from(t.getClientRects())}function kd(t){return Ai(Bn(t)).left+Ao(t).scrollLeft}function Yy(t){const e=Bn(t),n=Ao(t),r=t.ownerDocument.body,i=Vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const a=-n.scrollTop;return Jt(r).direction==="rtl"&&(s+=Vr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function qy(t,e){const n=At(t),r=Bn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const d=pa();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function Ky(t,e){const n=Ai(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=rn(t)?Rr(t):Ln(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:a,x:c,y:d}}function vd(t,e,n){let r;if(e==="viewport")r=qy(t,n);else if(e==="document")r=Yy(Bn(t));else if(nn(e))r=Ky(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Mo(r)}function wd(t,e){const n=In(t);return n===e||!nn(n)||Pr(n)?!1:Jt(n).position==="fixed"||wd(n,e)}function Gy(t,e){const n=e.get(t);if(n)return n;let r=ma(t,[],!1).filter(a=>nn(a)&&cr(a)!=="body"),i=null;const o=Jt(t).position==="fixed";let s=o?In(t):t;for(;nn(s)&&!Pr(s);){const a=Jt(s),c=ha(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mi(s)&&!c&&wd(t,s))?r=r.filter(u=>u!==s):i=a,s=In(s)}return e.set(t,r),r}function Jy(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?ga(e)?[]:Gy(e,this._c):[].concat(n),r],a=s[0],c=s.reduce((d,u)=>{const f=vd(e,u,i);return d.top=Vr(f.top,d.top),d.right=Oi(f.right,d.right),d.bottom=Oi(f.bottom,d.bottom),d.left=Vr(f.left,d.left),d},vd(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zy(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Xy(t,e,n){const r=rn(e),i=Bn(e),o=n==="fixed",s=Ai(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=Ln(0);if(r||!r&&!o)if((cr(e)!=="body"||Mi(i))&&(a=Ao(e)),r){const f=Ai(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+a.scrollLeft-c.x,u=s.top+a.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function ya(t){return Jt(t).position==="static"}function xd(t,e){return!rn(t)||Jt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=At(t);if(ga(t))return n;if(!rn(t)){let i=In(t);for(;i&&!Pr(i);){if(nn(i)&&!ya(i))return i;i=In(i)}return n}let r=xd(t,e);for(;r&&Ry(r)&&ya(r);)r=xd(r,e);return r&&Pr(r)&&ya(r)&&!ha(r)?n:r||Fy(t)||n}const Qy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Xy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function e1(t){return Jt(t).direction==="rtl"}const t1={convertOffsetParentRelativeRectToViewportRelativeRect:Wy,getDocumentElement:Bn,getClippingRect:Jy,getOffsetParent:Ed,getElementRects:Qy,getClientRects:Uy,getDimensions:Zy,getScale:Rr,isElement:nn,isRTL:e1},Cd=Vy,Sd=Py,_d=By,n1=Ly,Od=(t,e,n)=>{const r=new Map,i={platform:t1,...n},o={...i.platform,_c:r};return $y(t,e,{...i,platform:o})};function r1(t){return t!=null&&typeof t=="object"&&"$el"in t}function i1(t){if(r1(t)){const e=t.$el;return fa(e)&&cr(e)==="#comment"?null:e}return t}function o1(t){return{name:"arrow",options:t,fn(e){const n=i1(l.unref(t.element));return n==null?{}:n1({element:n,padding:t.padding}).fn(e)}}}const s1={},a1={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},l1=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function c1(t,e){return l.openBlock(),l.createElementBlock("svg",a1,l1)}const Di=be(s1,[["render",c1]]);let Do;const d1=new Uint8Array(16);function u1(){if(!Do&&(Do=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Do))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Do(d1)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function f1(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 ba(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||u1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,f1(r)}let h1={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 a=!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(a&&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 dr=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=ba(),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"},a=l.ref(null),c=l.ref(null),d=l.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(a.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)&&a.value&&!a.value.contains(k.target)&&h()};l.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.detail.uuid!==r&&h()})}),l.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)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[(l.openBlock(),l.createElementBlock("div",{class:"flex-1",key:`reference_${l.unref(r)}`,ref_key:"reference",ref:a,onMouseenter:g,onMouseleave:y,onClick:x[0]||(x[0]=l.withModifiers(w=>f(w),["stop"]))},[l.renderSlot(k.$slots,"default",{isHidden:d.value})],32)),(l.openBlock(),l.createBlock(l.Teleport,{to:l.unref(fe).popoverTarget},[(l.openBlock(),l.createElementBlock("div",{key:`floating_${l.unref(r)}`,ref_key:"floating",ref:c,style:l.normalizeStyle({maxWidth:t.maxWidth}),class:l.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[l.unref(fe).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}])},[l.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
|
|
6
|
+
* shared v9.14.4
|
|
7
|
+
* (c) 2025 kazuya kawaguchi
|
|
8
|
+
* Released under the MIT License.
|
|
9
|
+
*/const bn=typeof window<"u";let Dt,ur;if(process.env.NODE_ENV!=="production"){const t=bn&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(Dt=e=>{t.mark(e)},ur=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const p1=/\{([0-9a-zA-Z]+)\}/g;function ka(t,...e){return e.length===1&&Te(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(p1,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const kn=(t,e=!1)=>e?Symbol.for(t):Symbol(t),m1=(t,e,n)=>g1({l:t,k:e,s:n}),g1=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ge=t=>typeof t=="number"&&isFinite(t),y1=t=>Dd(t)==="[object Date]",Fr=t=>Dd(t)==="[object RegExp]",$o=t=>Se(t)&&Object.keys(t).length===0,ct=Object.assign,b1=Object.create,$e=(t=null)=>b1(t);let Nd;const vn=()=>Nd||(Nd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:$e());function Md(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const k1=Object.prototype.hasOwnProperty;function Zt(t,e){return k1.call(t,e)}const We=Array.isArray,Ve=t=>typeof t=="function",oe=t=>typeof t=="string",Le=t=>typeof t=="boolean",Te=t=>t!==null&&typeof t=="object",v1=t=>Te(t)&&Ve(t.then)&&Ve(t.catch),Ad=Object.prototype.toString,Dd=t=>Ad.call(t),Se=t=>{if(!Te(t))return!1;const e=Object.getPrototypeOf(t);return e===null||e.constructor===Object},w1=t=>t==null?"":We(t)||Se(t)&&t.toString===Ad?JSON.stringify(t,null,2):String(t);function x1(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}const $d=2;function E1(t,e=0,n=t.length){const r=t.split(/\r?\n/);let i=0;const o=[];for(let s=0;s<r.length;s++)if(i+=r[s].length+1,i>=e){for(let a=s-$d;a<=s+$d||n>i;a++){if(a<0||a>=r.length)continue;const c=a+1;o.push(`${c}${" ".repeat(3-String(c).length)}| ${r[a]}`);const d=r[a].length;if(a===s){const u=e-(i-d)+1,f=Math.max(1,n>i?d-u:n-e);o.push(" | "+" ".repeat(u)+"^".repeat(f))}else if(a>s){if(n>i){const u=Math.max(Math.min(n-i,d),1);o.push(" | "+"^".repeat(u))}i+=d+1}}break}return o.join(`
|
|
10
|
+
`)}function Lo(t){let e=t;return()=>++e}function wn(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const Ld={};function Bd(t){Ld[t]||(Ld[t]=!0,wn(t))}function C1(){const t=new Map;return{events:t,on(n,r){const i=t.get(n);i&&i.push(r)||t.set(n,[r])},off(n,r){const i=t.get(n);i&&i.splice(i.indexOf(r)>>>0,1)},emit(n,r){(t.get(n)||[]).slice().map(i=>i(r)),(t.get("*")||[]).slice().map(i=>i(n,r))}}}const Bo=t=>!Te(t)||We(t);function Io(t,e){if(Bo(t)||Bo(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:i}=n.pop();Object.keys(r).forEach(o=>{o!=="__proto__"&&(Te(r[o])&&!Te(i[o])&&(i[o]=Array.isArray(r[o])?[]:$e()),Bo(i[o])||Bo(r[o])?i[o]=r[o]:n.push({src:r[o],des:i[o]}))})}}/*!
|
|
11
|
+
* message-compiler v9.14.4
|
|
12
|
+
* (c) 2025 kazuya kawaguchi
|
|
13
|
+
* Released under the MIT License.
|
|
14
|
+
*/function S1(t,e,n){return{line:t,column:e,offset:n}}function Vo(t,e,n){return{start:t,end:e}}const _1=/\{([0-9a-zA-Z]+)\}/g;function Id(t,...e){return e.length===1&&O1(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(_1,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const Vd=Object.assign,Pd=t=>typeof t=="string",O1=t=>t!==null&&typeof t=="object";function Rd(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}const Po={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},T1={[Po.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function N1(t,e,...n){const r=Id(T1[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},M1={[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 jr(t,e,n={}){const{domain:r,messages:i,args:o}=n,s=Id((i||M1)[t]||"",...o||[]),a=new SyntaxError(String(s));return a.code=t,e&&(a.location=e),a.domain=r,a}function A1(t){throw t}const D1=/<\/?[\w\s="/.':;#-\/]+>/,$1=t=>D1.test(t),xn=" ",L1="\r",mt=`
|
|
15
|
+
`,B1="\u2028",I1="\u2029";function V1(t){const e=t;let n=0,r=1,i=1,o=0;const s=S=>e[S]===L1&&e[S+1]===mt,a=S=>e[S]===mt,c=S=>e[S]===I1,d=S=>e[S]===B1,u=S=>s(S)||a(S)||c(S)||d(S),f=()=>n,h=()=>r,p=()=>i,m=()=>o,g=S=>s(S)||c(S)||d(S)?mt:e[S],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 C(S=0){o=S}function v(){const S=n+o;for(;S!==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:C,skipToPeek:v}}const Vn=void 0,P1=".",Fd="'",R1="tokenizer";function F1(t,e={}){const n=e.location!==!1,r=V1(t),i=()=>r.index(),o=()=>S1(r.line(),r.column(),r.index()),s=o(),a=i(),c={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=e;function f(E,_,H,...se){const Me=d();if(_.column+=H,_.offset+=H,u){const _e=n?Vo(Me.startLoc,_):null,Oe=jr(E,_e,{domain:R1,args:se});u(Oe)}}function h(E,_,H){E.endLoc=o(),E.currentType=_;const se={type:_};return n&&(se.loc=Vo(E.startLoc,E.endLoc)),H!=null&&(se.value=H),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()===mt;)_+=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:H}=_;if(H!==2)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function b(E,_){const{currentType:H}=_;if(H!==2)return!1;g(E);const se=E.currentPeek()==="-"?E.peek():E.currentPeek(),Me=x(se);return E.resetPeek(),Me}function C(E,_){const{currentType:H}=_;if(H!==2)return!1;g(E);const se=E.currentPeek()===Fd;return E.resetPeek(),se}function v(E,_){const{currentType:H}=_;if(H!==8)return!1;g(E);const se=E.currentPeek()===".";return E.resetPeek(),se}function S(E,_){const{currentType:H}=_;if(H!==9)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function D(E,_){const{currentType:H}=_;if(!(H===8||H===12))return!1;g(E);const se=E.currentPeek()===":";return E.resetPeek(),se}function O(E,_){const{currentType:H}=_;if(H!==10)return!1;const se=()=>{const _e=E.currentPeek();return _e==="{"?k(E.peek()):_e==="@"||_e==="%"||_e==="|"||_e===":"||_e==="."||_e===xn||!_e?!1:_e===mt?(E.peek(),se()):B(E,!1)},Me=se();return E.resetPeek(),Me}function $(E){g(E);const _=E.currentPeek()==="|";return E.resetPeek(),_}function V(E){const _=g(E),H=E.currentPeek()==="%"&&E.peek()==="{";return E.resetPeek(),{isModulo:H,hasSpace:_.length>0}}function B(E,_=!0){const H=(Me=!1,_e="",Oe=!1)=>{const P=E.currentPeek();return P==="{"?_e==="%"?!1:Me:P==="@"||!P?_e==="%"?!0:Me:P==="%"?(E.peek(),H(Me,"%",!0)):P==="|"?_e==="%"||Oe?!0:!(_e===xn||_e===mt):P===xn?(E.peek(),H(!0,xn,Oe)):P===mt?(E.peek(),H(!0,mt,Oe)):!0},se=H();return _&&E.resetPeek(),se}function J(E,_){const H=E.currentChar();return H===Vn?Vn:_(H)?(E.next(),H):null}function Y(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36}function I(E){return J(E,Y)}function T(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36||_===45}function R(E){return J(E,T)}function F(E){const _=E.charCodeAt(0);return _>=48&&_<=57}function ee(E){return J(E,F)}function ie(E){const _=E.charCodeAt(0);return _>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102}function he(E){return J(E,ie)}function ue(E){let _="",H="";for(;_=ee(E);)H+=_;return H}function L(E){y(E);const _=E.currentChar();return _!=="%"&&f(ge.EXPECTED_TOKEN,o(),0,_),E.next(),"%"}function z(E){let _="";for(;;){const H=E.currentChar();if(H==="{"||H==="}"||H==="@"||H==="|"||!H)break;if(H==="%")if(B(E))_+=H,E.next();else break;else if(H===xn||H===mt)if(B(E))_+=H,E.next();else{if($(E))break;_+=H,E.next()}else _+=H,E.next()}return _}function q(E){y(E);let _="",H="";for(;_=R(E);)H+=_;return E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H}function U(E){y(E);let _="";return E.currentChar()==="-"?(E.next(),_+=`-${ue(E)}`):_+=ue(E),E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_}function j(E){return E!==Fd&&E!==mt}function ce(E){y(E),m(E,"'");let _="",H="";for(;_=J(E,j);)_==="\\"?H+=le(E):H+=_;const se=E.currentChar();return se===mt||se===Vn?(f(ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),se===mt&&(E.next(),m(E,"'")),H):(m(E,"'"),H)}function le(E){const _=E.currentChar();switch(_){case"\\":case"'":return E.next(),`\\${_}`;case"u":return ve(E,_,4);case"U":return ve(E,_,6);default:return f(ge.UNKNOWN_ESCAPE_SEQUENCE,o(),0,_),""}}function ve(E,_,H){m(E,_);let se="";for(let Me=0;Me<H;Me++){const _e=he(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!==mt}function Ie(E){y(E);let _="",H="";for(;_=J(E,Ne);)H+=_;return H}function tt(E){let _="",H="";for(;_=I(E);)H+=_;return H}function Q(E){const _=H=>{const se=E.currentChar();return se==="{"||se==="%"||se==="@"||se==="|"||se==="("||se===")"||!se||se===xn?H:(H+=se,E.next(),_(H))};return _("")}function Ee(E){y(E);const _=m(E,"|");return y(E),_}function Mt(E,_){let H=null;switch(E.currentChar()){case"{":return _.braceNest>=1&&f(ge.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),E.next(),H=h(_,2,"{"),y(E),_.braceNest++,H;case"}":return _.braceNest>0&&_.currentType===2&&f(ge.EMPTY_PLACEHOLDER,o(),0),E.next(),H=h(_,3,"}"),_.braceNest--,_.braceNest>0&&y(E),_.inLinked&&_.braceNest===0&&(_.inLinked=!1),H;case"@":return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H=at(E,_)||p(_),_.braceNest=0,H;default:{let Me=!0,_e=!0,Oe=!0;if($(E))return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,H;if(_.braceNest>0&&(_.currentType===5||_.currentType===6||_.currentType===7))return f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_.braceNest=0,lt(E,_);if(Me=w(E,_))return H=h(_,5,q(E)),y(E),H;if(_e=b(E,_))return H=h(_,6,U(E)),y(E),H;if(Oe=C(E,_))return H=h(_,7,ce(E)),y(E),H;if(!Me&&!_e&&!Oe)return H=h(_,13,Ie(E)),f(ge.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,H.value),y(E),H;break}}return H}function at(E,_){const{currentType:H}=_;let se=null;const Me=E.currentChar();switch((H===8||H===9||H===12||H===10)&&(Me===mt||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 $(E)?(se=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,se):v(E,_)||D(E,_)?(y(E),at(E,_)):S(E,_)?(y(E),h(_,12,tt(E))):O(E,_)?(y(E),Me==="{"?Mt(E,_)||se:h(_,11,Q(E))):(H===8&&f(ge.INVALID_LINKED_FORMAT,o(),0),_.braceNest=0,_.inLinked=!1,lt(E,_))}}function lt(E,_){let H={type:14};if(_.braceNest>0)return Mt(E,_)||p(_);if(_.inLinked)return at(E,_)||p(_);switch(E.currentChar()){case"{":return Mt(E,_)||p(_);case"}":return f(ge.UNBALANCED_CLOSING_BRACE,o(),0),E.next(),h(_,3,"}");case"@":return at(E,_)||p(_);default:{if($(E))return H=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,H;const{isModulo:Me,hasSpace:_e}=V(E);if(Me)return _e?h(_,0,z(E)):h(_,4,L(E));if(B(E))return h(_,0,z(E));break}}return H}function ht(){const{currentType:E,offset:_,startLoc:H,endLoc:se}=c;return c.lastType=E,c.lastOffset=_,c.lastStartLoc=H,c.lastEndLoc=se,c.offset=i(),c.startLoc=o(),r.currentChar()===Vn?h(c,14):lt(r,c)}return{nextToken:ht,currentOffset:i,currentPosition:o,context:d}}const j1="parser",z1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function H1(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 W1(t={}){const e=t.location!==!1,{onError:n,onWarn:r}=t;function i(w,b,C,v,...S){const D=w.currentPosition();if(D.offset+=v,D.column+=v,n){const O=e?Vo(C,D):null,$=jr(b,O,{domain:j1,args:S});n($)}}function o(w,b,C,v,...S){const D=w.currentPosition();if(D.offset+=v,D.column+=v,r){const O=e?Vo(C,D):null;r(N1(b,O,S))}}function s(w,b,C){const v={type:w};return e&&(v.start=b,v.end=b,v.loc={start:C,end:C}),v}function a(w,b,C,v){e&&(w.end=b,w.loc&&(w.loc.end=C))}function c(w,b){const C=w.context(),v=s(3,C.offset,C.startLoc);return v.value=b,a(v,w.currentOffset(),w.currentPosition()),v}function d(w,b){const C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(5,v,S);return D.index=parseInt(b,10),w.nextToken(),a(D,w.currentOffset(),w.currentPosition()),D}function u(w,b,C){const v=w.context(),{lastOffset:S,lastStartLoc:D}=v,O=s(4,S,D);return O.key=b,C===!0&&(O.modulo=!0),w.nextToken(),a(O,w.currentOffset(),w.currentPosition()),O}function f(w,b){const C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(9,v,S);return D.value=b.replace(z1,H1),w.nextToken(),a(D,w.currentOffset(),w.currentPosition()),D}function h(w){const b=w.nextToken(),C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(8,v,S);return b.type!==12?(i(w,ge.UNEXPECTED_EMPTY_LINKED_MODIFIER,C.lastStartLoc,0),D.value="",a(D,v,S),{nextConsumeToken:b,node:D}):(b.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,Xt(b)),D.value=b.value||"",a(D,w.currentOffset(),w.currentPosition()),{node:D})}function p(w,b){const C=w.context(),v=s(7,C.offset,C.startLoc);return v.value=b,a(v,w.currentOffset(),w.currentPosition()),v}function m(w){const b=w.context(),C=s(6,b.offset,b.startLoc);let v=w.nextToken();if(v.type===9){const S=h(w);C.modifier=S.node,v=S.nextConsumeToken||w.nextToken()}switch(v.type!==10&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(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,Xt(v)),C.key=p(w,v.value||"");break;case 5:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=u(w,v.value||"");break;case 6:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=d(w,v.value||"");break;case 7:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=f(w,v.value||"");break;default:{i(w,ge.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const S=w.context(),D=s(7,S.offset,S.startLoc);return D.value="",a(D,S.offset,S.startLoc),C.key=D,a(C,S.offset,S.startLoc),{nextConsumeToken:v,node:C}}}return a(C,w.currentOffset(),w.currentPosition()),{node:C}}function g(w){const b=w.context(),C=b.currentType===1?w.currentOffset():b.offset,v=b.currentType===1?b.endLoc:b.startLoc,S=s(2,C,v);S.items=[];let D=null,O=null;do{const B=D||w.nextToken();switch(D=null,B.type){case 0:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(c(w,B.value||""));break;case 6:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(d(w,B.value||""));break;case 4:O=!0;break;case 5:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(u(w,B.value||"",!!O)),O&&(o(w,Po.USE_MODULO_SYNTAX,b.lastStartLoc,0,Xt(B)),O=null);break;case 7:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(f(w,B.value||""));break;case 8:{const J=m(w);S.items.push(J.node),D=J.nextConsumeToken||null;break}}}while(b.currentType!==14&&b.currentType!==1);const $=b.currentType===1?b.lastOffset:w.currentOffset(),V=b.currentType===1?b.lastEndLoc:w.currentPosition();return a(S,$,V),S}function y(w,b,C,v){const S=w.context();let D=v.items.length===0;const O=s(1,b,C);O.cases=[],O.cases.push(v);do{const $=g(w);D||(D=$.items.length===0),O.cases.push($)}while(S.currentType!==14);return D&&i(w,ge.MUST_HAVE_MESSAGES_IN_PLURAL,C,0),a(O,w.currentOffset(),w.currentPosition()),O}function k(w){const b=w.context(),{offset:C,startLoc:v}=b,S=g(w);return b.currentType===14?S:y(w,C,v,S)}function x(w){const b=F1(w,Vd({},t)),C=b.context(),v=s(0,C.offset,C.startLoc);return e&&v.loc&&(v.loc.source=w),v.body=k(b),t.onCacheKey&&(v.cacheKey=t.onCacheKey(w)),C.currentType!==14&&i(b,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,w[C.offset]||""),a(v,b.currentOffset(),b.currentPosition()),v}return{parse:x}}function Xt(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 U1(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function jd(t,e){for(let n=0;n<t.length;n++)va(t[n],e)}function va(t,e){switch(t.type){case 1:jd(t.cases,e),e.helper("plural");break;case 2:jd(t.items,e);break;case 6:{va(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 Y1(t,e={}){const n=U1(t);n.helper("normalize"),t.body&&va(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function q1(t){const e=t.body;return e.type===2?zd(e):e.cases.forEach(n=>zd(n)),t}function zd(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 K1="minifier";function zr(t){switch(t.t=t.type,t.type){case 0:{const e=t;zr(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++)zr(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++)zr(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;zr(e.key),e.k=e.key,delete e.key,e.modifier&&(zr(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 jr(ge.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:K1,args:[t.type]})}delete t.type}const G1="parser";function J1(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 a=()=>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:a,push:c,indent:u,deindent:f,newline:h,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function Z1(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Hr(t,e.key),e.modifier?(t.push(", "),Hr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function X1(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&&(Hr(t,e.items[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}function Q1(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&&(Hr(t,e.cases[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}}function eb(t,e){e.body?Hr(t,e.body):t.push("null")}function Hr(t,e){const{helper:n}=t;switch(e.type){case 0:eb(t,e);break;case 1:Q1(t,e);break;case 2:X1(t,e);break;case 6:Z1(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 jr(ge.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:G1,args:[e.type]})}}const tb=(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
|
+
`,o=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],a=J1(t,{filename:r,breakLineCode:i,needIndent:o});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(o),s.length>0&&(a.push(`const { ${Rd(s.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Hr(a,t),a.deindent(o),a.push("}"),delete t.helpers;const{code:c,map:d}=a.context();return{ast:t,code:c,map:d?d.toJSON():void 0}};function nb(t,e={}){const n=Vd({},e),r=!!n.jit,i=!!n.minify,o=n.optimize==null?!0:n.optimize,a=W1(n).parse(t);return r?(o&&q1(a),i&&zr(a),{ast:a,code:""}):(Y1(a,n),tb(a,n))}/*!
|
|
17
|
+
* core-base v9.14.4
|
|
18
|
+
* (c) 2025 kazuya kawaguchi
|
|
19
|
+
* Released under the MIT License.
|
|
20
|
+
*/function rb(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Qt(t){return Te(t)&&wa(t)===0&&(Zt(t,"b")||Zt(t,"body"))}const Hd=["b","body"];function ib(t){return Pn(t,Hd)}const Wd=["c","cases"];function ob(t){return Pn(t,Wd,[])}const Ud=["s","static"];function sb(t){return Pn(t,Ud)}const Yd=["i","items"];function ab(t){return Pn(t,Yd,[])}const qd=["t","type"];function wa(t){return Pn(t,qd)}const Kd=["v","value"];function Ro(t,e){const n=Pn(t,Kd);if(n!=null)return n;throw $i(e)}const Gd=["m","modifier"];function lb(t){return Pn(t,Gd)}const Jd=["k","key"];function cb(t){const e=Pn(t,Jd);if(e)return e;throw $i(6)}function Pn(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(Zt(t,i)&&t[i]!=null)return t[i]}return n}const Zd=[...Hd,...Wd,...Ud,...Yd,...Jd,...Gd,...Kd,...qd];function $i(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 db=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function ub(t){return db.test(t)}function fb(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 hb(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 pb(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:ub(e)?fb(e):"*"+e}function mb(t){const e=[];let n=-1,r=0,i=0,o,s,a,c,d,u,f;const h=[];h[0]=()=>{s===void 0?s=a:s+=a},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=pb(s),s===!1))return!1;h[1]()}};function p(){const m=t[n+1];if(r===5&&m==="'"||r===6&&m==='"')return n++,a="\\"+m,h[0](),!0}for(;r!==null;)if(n++,o=t[n],!(o==="\\"&&p())){if(c=hb(o),f=Rn[r],d=f[c]||f.l||8,d===8||(r=d[0],d[1]!==void 0&&(u=h[d[1]],u&&(a=o,u()===!1))))return;if(r===7)return e}}const Xd=new Map;function gb(t,e){return Te(t)?t[e]:null}function yb(t,e){if(!Te(t))return null;let n=Xd.get(e);if(n||(n=mb(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)&&Qt(i))return null;const a=i[s];if(a===void 0||Ve(i))return null;i=a,o++}return i}const bb=t=>t,kb=t=>"",vb="text",wb=t=>t.length===0?"":x1(t),xb=w1;function Qd(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function Eb(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 Cb(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Sb(t={}){const e=t.locale,n=Eb(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||[],a=k=>s[k],c=t.named||$e();Ge(t.pluralIndex)&&Cb(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):kb)}const f=k=>t.modifiers?t.modifiers[k]:bb,h=Se(t.processor)&&Ve(t.processor.normalize)?t.processor.normalize:wb,p=Se(t.processor)&&Ve(t.processor.interpolate)?t.processor.interpolate:xb,m=Se(t.processor)&&oe(t.processor.type)?t.processor.type:vb,y={list:a,named:d,plural:o,linked:(k,...x)=>{const[w,b]=x;let C="text",v="";x.length===1?Te(w)?(v=w.modifier||v,C=w.type||C):oe(w)&&(v=w||v):x.length===2&&(oe(w)&&(v=w||v),oe(b)&&(C=b||C));const S=u(k)(y),D=C==="vnode"&&We(S)&&v?S[0]:S;return v?f(v)(D,C):D},message:u,type:m,interpolate:p,normalize:h,values:ct($e(),s,c)};return y}let Li=null;function _b(t){Li=t}function Ob(t,e,n){Li&&Li.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const Tb=Nb("function:translate");function Nb(t){return e=>Li&&Li.emit(t,e)}const eu=Po.__EXTEND_POINT__,fr=Lo(eu),gt={NOT_FOUND_KEY:eu,FALLBACK_TO_TRANSLATE:fr(),CANNOT_FORMAT_NUMBER:fr(),FALLBACK_TO_NUMBER_FORMAT:fr(),CANNOT_FORMAT_DATE:fr(),FALLBACK_TO_DATE_FORMAT:fr(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:fr(),__EXTEND_POINT__:fr()},Mb={[gt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[gt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[gt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[gt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[gt.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 hr(t,...e){return ka(Mb[t],...e)}const tu=ge.__EXTEND_POINT__,pr=Lo(tu),Je={INVALID_ARGUMENT:tu,INVALID_DATE_ARGUMENT:pr(),INVALID_ISO_DATE_ARGUMENT:pr(),NOT_SUPPORT_NON_STRING_MESSAGE:pr(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:pr(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:pr(),NOT_SUPPORT_LOCALE_TYPE:pr(),__EXTEND_POINT__:pr()};function on(t){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:Ab}:void 0)}const Ab={[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 xa(t,e){return e.locale!=null?nu(e.locale):nu(t.locale)}let Ea;function nu(t){if(oe(t))return t;if(Ve(t)){if(t.resolvedOnce&&Ea!=null)return Ea;if(t.constructor.name==="Function"){const e=t();if(v1(e))throw on(Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ea=e}else throw on(Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw on(Je.NOT_SUPPORT_LOCALE_TYPE)}function Db(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:Bi,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 a=We(e)||!Se(e)?e:e.default?e.default:null;s=oe(a)?[a]:a,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&&Le(r);i++){const o=e[i];oe(o)&&(r=$b(t,e[i],n))}return r}function $b(t,e,n){let r;const i=e.split("-");do{const o=i.join("-");r=Lb(t,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function Lb(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 Bb="9.14.4",Fo=-1,Bi="en-US",jo="",ou=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Ib(){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 au(t){su=t}let lu;function Vb(t){lu=t}let cu;function Pb(t){cu=t}let du=null;const Rb=t=>{du=t},Fb=()=>du;let uu=null;const fu=t=>{uu=t},jb=()=>uu;let hu=0;function zb(t={}){const e=Ve(t.onWarn)?t.onWarn:wn,n=oe(t.version)?t.version:Bb,r=oe(t.locale)||Ve(t.locale)?t.locale:Bi,i=Ve(r)?Bi:r,o=We(t.fallbackLocale)||Se(t.fallbackLocale)||oe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,s=Se(t.messages)?t.messages:Ca(i),a=Se(t.datetimeFormats)?t.datetimeFormats:Ca(i),c=Se(t.numberFormats)?t.numberFormats:Ca(i),d=ct($e(),t.modifiers,Ib()),u=t.pluralRules||$e(),f=Ve(t.missing)?t.missing:null,h=Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,p=Le(t.fallbackWarn)||Fr(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=Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=Ve(t.messageCompiler)?t.messageCompiler:su;process.env.NODE_ENV!=="production"&&Ve(t.messageCompiler)&&Bd(hr(gt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const C=Ve(t.messageResolver)?t.messageResolver:lu||gb,v=Ve(t.localeFallbacker)?t.localeFallbacker:cu||Db,S=Te(t.fallbackContext)?t.fallbackContext:void 0,D=t,O=Te(D.__datetimeFormatters)?D.__datetimeFormatters:new Map,$=Te(D.__numberFormatters)?D.__numberFormatters:new Map,V=Te(D.__meta)?D.__meta:{};hu++;const B={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:C,localeFallbacker:v,fallbackContext:S,onWarn:e,__meta:V};return B.datetimeFormats=a,B.numberFormats=c,B.__datetimeFormatters=O,B.__numberFormatters=$,process.env.NODE_ENV!=="production"&&(B.__v_emitter=D.__v_emitter!=null?D.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&Ob(B,n,V),B}const Ca=t=>({[t]:$e()});function zo(t,e){return t instanceof RegExp?t.test(e):t}function pu(t,e){return t instanceof RegExp?t.test(e):t}function Sa(t,e,n,r,i){const{missing:o,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:i,groupId:`${i}:${e}`})}if(o!==null){const a=o(t,n,e,i);return oe(a)?a:e}else return process.env.NODE_ENV!=="production"&&pu(r,e)&&s(hr(gt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Ii(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 Hb(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 _a(t){return n=>Wb(n,t)}function Wb(t,e){const n=ib(e);if(n==null)throw $i(0);if(wa(n)===1){const o=ob(n);return t.plural(o.reduce((s,a)=>[...s,gu(t,a)],[]))}else return gu(t,n)}function gu(t,e){const n=sb(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=ab(e).reduce((i,o)=>[...i,Oa(t,o)],[]);return t.normalize(r)}}function Oa(t,e){const n=wa(e);switch(n){case 3:return Ro(e,n);case 9:return Ro(e,n);case 4:{const r=e;if(Zt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Zt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw $i(n)}case 5:{const r=e;if(Zt(r,"i")&&Ge(r.i))return t.interpolate(t.list(r.i));if(Zt(r,"index")&&Ge(r.index))return t.interpolate(t.list(r.index));throw $i(n)}case 6:{const r=e,i=lb(r),o=cb(r);return t.linked(Oa(t,o),i?Oa(t,i):void 0,t.type)}case 7:return Ro(e,n);case 8:return Ro(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Ub="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function yu(t,e){e&&$1(t)&&wn(ka(Ub,{source:t}))}const bu=t=>t;let Wr=$e();function ku(t){t.code===Po.USE_MODULO_SYNTAX&&wn(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
|
|
21
|
+
reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format
|
|
22
|
+
(message compiler warning message: ${t.message})`)}function vu(t,e={}){let n=!1;const r=e.onError||A1;return e.onError=i=>{n=!0,r(i)},{...nb(t,e),detectError:n}}const Yb=(t,e)=>{if(!oe(t))throw on(Je.NOT_SUPPORT_NON_STRING_MESSAGE);process.env.NODE_ENV!=="production"&&(e.onWarn=ku);{const n=Le(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Wr[i];if(o)return o;const{code:s,detectError:a}=vu(t,e),c=new Function(`return ${s}`)();return a?c:Wr[i]=c}};function qb(t,e){if(process.env.NODE_ENV!=="production"&&(e.onWarn=ku),__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&oe(t)){const n=Le(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yu(t,n);const i=(e.onCacheKey||bu)(t),o=Wr[i];if(o)return o;const{ast:s,detectError:a}=vu(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),c=_a(s);return a?c:Wr[i]=c}else{if(process.env.NODE_ENV!=="production"&&!Qt(t))return wn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Wr[n];return r||(Wr[n]=_a(t))}else return _a(t)}}const wu=()=>"",Ft=t=>Ve(t);function xu(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:o,fallbackLocale:s,messages:a}=t,[c,d]=Ta(...e),u=Le(d.missingWarn)?d.missingWarn:t.missingWarn,f=Le(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn,h=Le(d.escapeParameter)?d.escapeParameter:t.escapeParameter,p=!!d.resolvedMessage,m=oe(d.default)||Le(d.default)?Le(d.default)?o?c:()=>c:d.default:n?o?c:()=>c:"",g=n||m!=="",y=xa(t,d);h&&Kb(d);let[k,x,w]=p?[c,y,a[y]||$e()]:Eu(t,c,y,s,f,u),b=k,C=c;if(!p&&!(oe(b)||Qt(b)||Ft(b))&&g&&(b=m,C=b),!p&&(!(oe(b)||Qt(b)||Ft(b))||!oe(x)))return i?Fo:c;if(process.env.NODE_ENV!=="production"&&oe(b)&&t.messageCompiler==null)return wn(`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 S=()=>{v=!0},D=Ft(b)?b:Cu(t,c,x,b,C,S);if(v)return b;const O=Xb(t,x,w,d),$=Sb(O),V=Gb(t,D,$),B=r?r(V,c):V;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const J={timestamp:Date.now(),key:oe(c)?c:Ft(b)?b.key:"",locale:x||(Ft(b)?b.locale:""),format:oe(b)?b:Ft(b)?b.source:"",message:B};J.meta=ct({},t.__meta,Fb()||{}),Tb(J)}return B}function Kb(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:a,messageResolver:c,localeFallbacker:d}=t,u=d(t,r,n);let f=$e(),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)&&zo(i,e)&&a(hr(gt.FALLBACK_TO_TRANSLATE,{key:e,target:h})),process.env.NODE_ENV!=="production"&&n!==h){const C=t.__v_emitter;C&&C.emit("fallback",{type:y,key:e,from:m,to:g,groupId:`${y}:${e}`})}f=s[h]||$e();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",Dt&&Dt(w)),(p=c(f,e))===null&&(p=f[e]),process.env.NODE_ENV!=="production"&&bn){const C=window.performance.now(),v=t.__v_emitter;v&&x&&p&&v.emit("message-resolve",{type:"message-resolve",key:e,message:p,time:C-x,groupId:`${y}:${e}`}),w&&b&&Dt&&ur&&(Dt(b),ur("intlify message resolve",w,b))}if(oe(p)||Qt(p)||Ft(p))break;if(!Hb(h,u)){const C=Sa(t,e,h,o,y);C!==e&&(p=C)}m=g}return[p,h,f]}function Cu(t,e,n,r,i,o){const{messageCompiler:s,warnHtmlMessage:a}=t;if(Ft(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",Dt&&Dt(d));const f=s(r,Jb(t,n,i,r,a,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&&Dt&&ur&&(Dt(u),ur("intlify message compilation",d,u))}return f.locale=n,f.key=e,f.source=r,f}function Gb(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",Dt&&Dt(i));const s=e(n);if(process.env.NODE_ENV!=="production"&&bn){const a=window.performance.now(),c=t.__v_emitter;c&&r&&c.emit("message-evaluation",{type:"message-evaluation",value:s,time:a-r,groupId:`translate:${e.key}`}),i&&o&&Dt&&ur&&(Dt(o),ur("intlify message evaluation",i,o))}return s}function Ta(...t){const[e,n,r]=t,i=$e();if(!oe(e)&&!Ge(e)&&!Ft(e)&&!Qt(e))throw on(Je.INVALID_ARGUMENT);const o=Ge(e)?String(e):(Ft(e),e);return Ge(n)?i.plural=n:oe(n)?i.default=n:Se(n)&&!$o(n)?i.named=n:We(n)&&(i.list=n),Ge(r)?i.plural=r:oe(r)?i.default=r:Se(r)&&ct(i,r),[o,i]}function Jb(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 a=Zb(r),c=`Message compilation error: ${s.message}`,d=s.location&&a&&E1(a,s.location.start.offset,s.location.end.offset),u=t.__v_emitter;u&&a&&u.emit("compile-error",{message:a,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=>m1(e,n,s)}}function Zb(t){if(oe(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function Xb(t,e,n,r){const{modifiers:i,pluralRules:o,messageResolver:s,fallbackLocale:a,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,a,c,d);m=s(g,p)}if(oe(m)||Qt(m)){let g=!1;const k=Cu(t,p,e,m,p,()=>{g=!0});return g?wu:k}else return Ft(m)?m:wu}};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",_u={dateTimeFormat:Su&&typeof Intl.DateTimeFormat<"u",numberFormat:Su&&typeof Intl.NumberFormat<"u"};function Ou(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:s}=t,{__datetimeFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!_u.dateTimeFormat)return o(hr(gt.CANNOT_FORMAT_DATE)),jo;const[c,d,u,f]=Na(...e),h=Le(u.missingWarn)?u.missingWarn:t.missingWarn,p=Le(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=xa(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,C=null;const v="datetime format";for(let O=0;O<y.length;O++){if(x=C=y[O],process.env.NODE_ENV!=="production"&&g!==x&&zo(p,c)&&o(hr(gt.FALLBACK_TO_DATE_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const $=t.__v_emitter;$&&$.emit("fallback",{type:v,key:c,from:b,to:C,groupId:`${v}:${c}`})}if(k=n[x]||{},w=k[c],Se(w))break;Sa(t,c,x,h,v),b=C}if(!Se(w)||!oe(x))return r?Fo:c;let S=`${x}__${c}`;$o(f)||(S=`${S}__${JSON.stringify(f)}`);let D=a.get(S);return D||(D=new Intl.DateTimeFormat(x,ct({},w,f)),a.set(S,D)),m?D.formatToParts(d):D.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 Na(...t){const[e,n,r,i]=t,o=$e();let s=$e(),a;if(oe(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw on(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();a=new Date(d);try{a.toISOString()}catch{throw on(Je.INVALID_ISO_DATE_ARGUMENT)}}else if(y1(e)){if(isNaN(e.getTime()))throw on(Je.INVALID_DATE_ARGUMENT);a=e}else if(Ge(e))a=e;else throw on(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||"",a,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:a}=t;if(process.env.NODE_ENV!=="production"&&!_u.numberFormat)return o(hr(gt.CANNOT_FORMAT_NUMBER)),jo;const[c,d,u,f]=Ma(...e),h=Le(u.missingWarn)?u.missingWarn:t.missingWarn,p=Le(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=xa(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,C=null;const v="number format";for(let O=0;O<y.length;O++){if(x=C=y[O],process.env.NODE_ENV!=="production"&&g!==x&&zo(p,c)&&o(hr(gt.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const $=t.__v_emitter;$&&$.emit("fallback",{type:v,key:c,from:b,to:C,groupId:`${v}:${c}`})}if(k=n[x]||{},w=k[c],Se(w))break;Sa(t,c,x,h,v),b=C}if(!Se(w)||!oe(x))return r?Fo:c;let S=`${x}__${c}`;$o(f)||(S=`${S}__${JSON.stringify(f)}`);let D=a.get(S);return D||(D=new Intl.NumberFormat(x,ct({},w,f)),a.set(S,D)),m?D.formatToParts(d):D.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 Ma(...t){const[e,n,r,i]=t,o=$e();let s=$e();if(!Ge(e))throw on(Je.INVALID_ARGUMENT);const a=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||"",a,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)}}rb();/*!
|
|
24
|
+
* vue-i18n v9.14.4
|
|
25
|
+
* (c) 2025 kazuya kawaguchi
|
|
26
|
+
* Released under the MIT License.
|
|
27
|
+
*/const Qb="9.14.4";function ek(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(vn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(vn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1)}const $u=gt.__EXTEND_POINT__,En=Lo($u),Ct={FALLBACK_TO_ROOT:$u,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()},tk={[Ct.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Ct.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Ct.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Ct.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Ct.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Ct.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Ct.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Ct.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Ct.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ho(t,...e){return ka(tk[t],...e)}const Lu=Je.__EXTEND_POINT__,St=Lo(Lu),Re={UNEXPECTED_RETURN_TYPE:Lu,INVALID_ARGUMENT:St(),MUST_BE_CALL_SETUP_TOP:St(),NOT_INSTALLED:St(),NOT_AVAILABLE_IN_LEGACY_MODE:St(),REQUIRED_VALUE:St(),INVALID_VALUE:St(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:St(),NOT_INSTALLED_WITH_PROVIDE:St(),UNEXPECTED_ERROR:St(),NOT_COMPATIBLE_LEGACY_VUE_I18N:St(),BRIDGE_SUPPORT_VUE_2_ONLY:St(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:St(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:St(),__EXTEND_POINT__:St()};function Fn(t,...e){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:nk,args:e}:void 0)}const nk={[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"},Aa=kn("__translateVNode"),Da=kn("__datetimeParts"),$a=kn("__numberParts"),La=kn("__enableEmitter"),Ba=kn("__disableEmitter"),rk=kn("__setPluralRules"),Bu=kn("__injectWithOption"),Ia=kn("__dispose");function Vi(t){if(!Te(t)||Qt(t))return t;for(const e in t)if(Zt(t,e))if(!e.includes("."))Te(t[e])&&Vi(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]]=$e()),!Te(i[n[s]])){process.env.NODE_ENV!=="production"&&wn(Ho(Ct.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(Qt(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!Qt(i)){const s=i[n[r]];Te(s)&&Vi(s)}}return t}function Va(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=Se(n)?n:We(r)?$e():{[t]:$e()};if(We(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:d}=a;c?(s[c]=s[c]||$e(),Io(d,s[c])):Io(d,s)}else oe(a)&&Io(JSON.parse(a),s)}),i==null&&o)for(const a in s)Zt(s,a)&&Vi(s[a]);return s}function Iu(t){return t.type}function ik(t,e,n){let r=Te(e.messages)?e.messages:$e();"__i18nGlobal"in n&&(r=Va(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 l.createVNode(l.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],ok=()=>!1;let Fu=0;function ju(t){return(e,n,r,i)=>t(n,r,l.getCurrentInstance()||void 0,i)}const sk=()=>{const t=l.getCurrentInstance();let e=null;return t&&(e=Iu(t)[Pu])?{[Pu]:e}:null};function ak(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?l.ref:l.shallowRef,a=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&a&&Bd(Ho(Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Le(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:oe(t.locale)?t.locale:Bi),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(Va(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:Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Le(t.fallbackWarn)||Fr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Le(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?ju(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const S=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let D=t.pluralRules||n&&n.pluralRules,O;O=(()=>{i&&fu(null);const P={version:Qb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:S,pluralRules:D,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};P.datetimeFormats=h.value,P.numberFormats=p.value,P.__datetimeFormatters=Se(O)?O.__datetimeFormatters:void 0,P.__numberFormatters=Se(O)?O.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(P.__v_emitter=Se(O)?O.__v_emitter:void 0);const Z=zb(P);return i&&fu(Z),Z})(),Ii(O,d.value,u.value);function V(){return[d.value,u.value,f.value,h.value,p.value]}const B=l.computed({get:()=>d.value,set:P=>{d.value=P,O.locale=d.value}}),J=l.computed({get:()=>u.value,set:P=>{u.value=P,O.fallbackLocale=u.value,Ii(O,d.value,P)}}),Y=l.computed(()=>f.value),I=l.computed(()=>h.value),T=l.computed(()=>p.value);function R(){return Ve(b)?b:null}function F(P){b=P,O.postTranslation=P}function ee(){return x}function ie(P){P!==null&&(w=ju(P)),x=P,O.missing=w}function he(P,Z){return P!=="translate"||!Z.resolvedMessage}const ue=(P,Z,N,A,W,te)=>{V();let de;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(O.fallbackContext=n?jb():void 0),de=P(O)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(O.fallbackContext=void 0)}if(N!=="translate exists"&&Ge(de)&&de===Fo||N==="translate exists"&&!de){const[M,X]=Z();if(process.env.NODE_ENV!=="production"&&n&&oe(M)&&he(N,X)&&(y&&(zo(g,M)||pu(m,M))&&wn(Ho(Ct.FALLBACK_TO_ROOT,{key:M,type:N})),process.env.NODE_ENV!=="production")){const{__v_emitter:re}=O;re&&y&&re.emit("fallback",{type:N,key:M,to:"global",groupId:`${N}:${M}`})}return n&&y?A(n):W(M)}else{if(te(de))return de;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function L(...P){return ue(Z=>Reflect.apply(xu,null,[Z,...P]),()=>Ta(...P),"translate",Z=>Reflect.apply(Z.t,Z,[...P]),Z=>Z,Z=>oe(Z))}function z(...P){const[Z,N,A]=P;if(A&&!Te(A))throw Fn(Re.INVALID_ARGUMENT);return L(Z,N,ct({resolvedMessage:!0},A||{}))}function q(...P){return ue(Z=>Reflect.apply(Ou,null,[Z,...P]),()=>Na(...P),"datetime format",Z=>Reflect.apply(Z.d,Z,[...P]),()=>jo,Z=>oe(Z))}function U(...P){return ue(Z=>Reflect.apply(Mu,null,[Z,...P]),()=>Ma(...P),"number format",Z=>Reflect.apply(Z.n,Z,[...P]),()=>jo,Z=>oe(Z))}function j(P){return P.map(Z=>oe(Z)||Ge(Z)||Le(Z)?Vu(String(Z)):Z)}const le={normalize:j,interpolate:P=>P,type:"vnode"};function ve(...P){return ue(Z=>{let N;const A=Z;try{A.processor=le,N=Reflect.apply(xu,null,[A,...P])}finally{A.processor=null}return N},()=>Ta(...P),"translate",Z=>Z[Aa](...P),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...P){return ue(Z=>Reflect.apply(Mu,null,[Z,...P]),()=>Ma(...P),"number format",Z=>Z[$a](...P),Ru,Z=>oe(Z)||We(Z))}function Ie(...P){return ue(Z=>Reflect.apply(Ou,null,[Z,...P]),()=>Na(...P),"datetime format",Z=>Z[Da](...P),Ru,Z=>oe(Z)||We(Z))}function tt(P){D=P,O.pluralRules=D}function Q(P,Z){return ue(()=>{if(!P)return!1;const N=oe(Z)?Z:d.value,A=at(N),W=O.messageResolver(A,P);return a?W!=null:Qt(W)||Ft(W)||oe(W)},()=>[P],"translate exists",N=>Reflect.apply(N.te,N,[P,Z]),ok,N=>Le(N))}function Ee(P){let Z=null;const N=ru(O,u.value,d.value);for(let A=0;A<N.length;A++){const W=f.value[N[A]]||{},te=O.messageResolver(W,P);if(te!=null){Z=te;break}}return Z}function Mt(P){const Z=Ee(P);return Z??(n?n.tm(P)||{}:{})}function at(P){return f.value[P]||{}}function lt(P,Z){if(o){const N={[P]:Z};for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[P]}f.value[P]=Z,O.messages=f.value}function ht(P,Z){f.value[P]=f.value[P]||{};const N={[P]:Z};if(o)for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[P],Io(Z,f.value[P]),O.messages=f.value}function E(P){return h.value[P]||{}}function _(P,Z){h.value[P]=Z,O.datetimeFormats=h.value,Nu(O,P,Z)}function H(P,Z){h.value[P]=ct(h.value[P]||{},Z),O.datetimeFormats=h.value,Nu(O,P,Z)}function se(P){return p.value[P]||{}}function Me(P,Z){p.value[P]=Z,O.numberFormats=p.value,Du(O,P,Z)}function _e(P,Z){p.value[P]=ct(p.value[P]||{},Z),O.numberFormats=p.value,Du(O,P,Z)}Fu++,n&&bn&&(l.watch(n.locale,P=>{c&&(d.value=P,O.locale=P,Ii(O,d.value,u.value))}),l.watch(n.fallbackLocale,P=>{c&&(u.value=P,O.fallbackLocale=P,Ii(O,d.value,u.value))}));const Oe={id:Fu,locale:B,fallbackLocale:J,get inheritLocale(){return c},set inheritLocale(P){c=P,P&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ii(O,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:Y,get modifiers(){return S},get pluralRules(){return D||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(P){m=P,O.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(P){g=P,O.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(P){y=P},get fallbackFormat(){return k},set fallbackFormat(P){k=P,O.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(P){C=P,O.warnHtmlMessage=P},get escapeParameter(){return v},set escapeParameter(P){v=P,O.escapeParameter=P},t:L,getLocaleMessage:at,setLocaleMessage:lt,mergeLocaleMessage:ht,getPostTranslationHandler:R,setPostTranslationHandler:F,getMissingHandler:ee,setMissingHandler:ie,[rk]:tt};return Oe.datetimeFormats=I,Oe.numberFormats=T,Oe.rt=z,Oe.te=Q,Oe.tm=Mt,Oe.d=q,Oe.n=U,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=_,Oe.mergeDateTimeFormat=H,Oe.getNumberFormat=se,Oe.setNumberFormat=Me,Oe.mergeNumberFormat=_e,Oe[Bu]=r,Oe[Aa]=ve,Oe[Da]=Ie,Oe[$a]=Ne,process.env.NODE_ENV!=="production"&&(Oe[La]=P=>{O.__v_emitter=P},Oe[Ba]=()=>{O.__v_emitter=void 0}),Oe}const Pa={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function lk({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===l.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},$e())}function zu(t){return l.Fragment}ct({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ge(t)||!isNaN(t)}},Pa);function ck(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 a=$e();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),a=Object.keys(t.format).reduce((h,p)=>n.includes(p)?ct($e(),h,{[p]:t.format[p]}):h,$e()));const c=r(t.value,s,a);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 ck(g)&&(g[0].key=`${h.type}-${p}`),g}):oe(c)&&(d=[c]);const u=ct($e(),o),f=oe(t.tag)||Te(t.tag)?t.tag:zu();return l.h(f,u,d)}}ct({value:{type:Number,required:!0},format:{type:[String,Object]}},Pa),ct({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Pa);function Wu(t,e){}const dk=kn("global-vue-i18n");function jn(t={}){const e=l.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=uk(e),r=hk(n),i=Iu(e),o=fk(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return yk(e,o,r,t)}if(o==="global")return ik(r,t,i),r;if(o==="parent"){let c=pk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&wn(Ho(Ct.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let a=s.__getInstance(e);if(a==null){const c=ct({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),a=ak(c),s.__composerExtend&&(a[Ia]=s.__composerExtend(a)),gk(s,e,a),s.__setInstance(e,a)}return a}function uk(t){{const e=l.inject(t.isCE?dk:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function fk(t,e){return $o(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function hk(t){return t.mode==="composition"?t.global:t.global.__composer}function pk(t,e,n=!1){let r=null;const i=e.root;let o=mk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(o);a!=null&&(r=a.__composer,n&&r&&!r[Bu]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function mk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function gk(t,e,n){let r=null;l.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=C1();const i=n;i[La]&&i[La](r),r.on("*",Wu)}},e),l.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[Ba]&&i[Ba](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Ia];o&&(o(),delete i[Ia])},e)}function yk(t,e,n,r={}){const i=e==="local",o=l.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=Le(r.inheritLocale)?r.inheritLocale:!oe(r.locale),a=l.ref(!i||s?n.locale.value:oe(r.locale)?r.locale:Bi),c=l.ref(!i||s?n.fallbackLocale.value:oe(r.fallbackLocale)||We(r.fallbackLocale)||Se(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),d=l.ref(Va(a.value,r)),u=l.ref(Se(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),f=l.ref(Se(r.numberFormats)?r.numberFormats:{[a.value]:{}}),h=i?n.missingWarn:Le(r.missingWarn)||Fr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Le(r.fallbackWarn)||Fr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Le(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:Le(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function v(){return[a.value,c.value,d.value,u.value,f.value]}const S=l.computed({get:()=>o.value?o.value.locale.value:a.value,set:Q=>{o.value&&(o.value.locale.value=Q),a.value=Q}}),D=l.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),O=l.computed(()=>o.value?o.value.messages.value:d.value),$=l.computed(()=>u.value),V=l.computed(()=>f.value);function B(){return o.value?o.value.getPostTranslationHandler():k}function J(Q){o.value&&o.value.setPostTranslationHandler(Q)}function Y(){return o.value?o.value.getMissingHandler():y}function I(Q){o.value&&o.value.setMissingHandler(Q)}function T(Q){return v(),Q()}function R(...Q){return o.value?T(()=>Reflect.apply(o.value.t,null,[...Q])):T(()=>"")}function F(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?T(()=>Reflect.apply(o.value.d,null,[...Q])):T(()=>"")}function ie(...Q){return o.value?T(()=>Reflect.apply(o.value.n,null,[...Q])):T(()=>"")}function he(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function L(Q){return o.value?o.value.getLocaleMessage(Q):{}}function z(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function q(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function U(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function j(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function ce(Q,Ee){o.value&&o.value.mergeDateTimeFormat(Q,Ee)}function le(Q){return o.value?o.value.getNumberFormat(Q):{}}function ve(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:S,fallbackLocale:D,messages:O,datetimeFormats:$,numberFormats:V,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:C},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:R,getPostTranslationHandler:B,setPostTranslationHandler:J,getMissingHandler:Y,setMissingHandler:I,rt:F,d:ee,n:ie,tm:he,te:ue,getLocaleMessage:L,setLocaleMessage:z,mergeLocaleMessage:q,getDateTimeFormat:U,setDateTimeFormat:j,mergeDateTimeFormat:ce,getNumberFormat:le,setNumberFormat:ve,mergeNumberFormat:Ne};function tt(Q){Q.locale.value=a.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 l.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"?(a.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(ek(),__INTLIFY_JIT_COMPILATION__?au(qb):au(Yb),Vb(yb),Pb(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=vn();t.__INTLIFY__=!0,_b(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const bk={},kk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},vk=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function wk(t,e){return l.openBlock(),l.createElementBlock("svg",kk,vk)}const Uu=be(bk,[["render",wk]]),xk={},Ek={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ck=[l.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 Sk(t,e){return l.openBlock(),l.createElementBlock("svg",Ek,Ck)}const Ra=be(xk,[["render",Sk]]),_k={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},Ok={class:"flex items-center gap-2"},Tk={key:0},Nk={class:""},Mk={class:"flex justify-end"},Ak={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},Dk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},$k={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Pi=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,a)=>(l.openBlock(),l.createElementBlock("div",null,[t.label?(l.openBlock(),l.createElementBlock("div",_k,[l.createElementVNode("div",Ok,[l.createElementVNode("span",null,l.toDisplayString(t.label),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",Tk,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",Nk,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",Mk,[l.renderSlot(s.$slots,"more")])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.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[l.unref(fe).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[l.unref(fe).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(l.openBlock(),l.createElementBlock("div",Ak,[l.createElementVNode("div",Dk,[l.renderSlot(s.$slots,"prepend")])])):l.createCommentVNode("",!0),l.renderSlot(s.$slots,"default"),t.loading?(l.openBlock(),l.createElementBlock("div",$k,[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable?(l.openBlock(),l.createElementBlock("div",{key:2,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0)],2)]))}});var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ri(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lk(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Wo=Lk,Bk=typeof sn=="object"&&sn&&sn.Object===Object&&sn,Yu=Bk,Ik=Yu,Vk=typeof self=="object"&&self&&self.Object===Object&&self,Pk=Ik||Vk||Function("return this")(),an=Pk,Rk=an,Fk=function(){return Rk.Date.now()},jk=Fk,zk=/\s/;function Hk(t){for(var e=t.length;e--&&zk.test(t.charAt(e)););return e}var Wk=Hk,Uk=Wk,Yk=/^\s+/;function qk(t){return t&&t.slice(0,Uk(t)+1).replace(Yk,"")}var Kk=qk,Gk=an,Jk=Gk.Symbol,Fa=Jk,qu=Fa,Ku=Object.prototype,Zk=Ku.hasOwnProperty,Xk=Ku.toString,Fi=qu?qu.toStringTag:void 0;function Qk(t){var e=Zk.call(t,Fi),n=t[Fi];try{t[Fi]=void 0;var r=!0}catch{}var i=Xk.call(t);return r&&(e?t[Fi]=n:delete t[Fi]),i}var e2=Qk,t2=Object.prototype,n2=t2.toString;function r2(t){return n2.call(t)}var i2=r2,Gu=Fa,o2=e2,s2=i2,a2="[object Null]",l2="[object Undefined]",Ju=Gu?Gu.toStringTag:void 0;function c2(t){return t==null?t===void 0?l2:a2:Ju&&Ju in Object(t)?o2(t):s2(t)}var ji=c2;function d2(t){return t!=null&&typeof t=="object"}var zi=d2,u2=ji,f2=zi,h2="[object Symbol]";function p2(t){return typeof t=="symbol"||f2(t)&&u2(t)==h2}var m2=p2,g2=Kk,Zu=Wo,y2=m2,Xu=NaN,b2=/^[-+]0x[0-9a-f]+$/i,k2=/^0b[01]+$/i,v2=/^0o[0-7]+$/i,w2=parseInt;function x2(t){if(typeof t=="number")return t;if(y2(t))return Xu;if(Zu(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zu(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=g2(t);var n=k2.test(t);return n||v2.test(t)?w2(t.slice(2),n?2:8):b2.test(t)?Xu:+t}var E2=x2,C2=Wo,ja=jk,Qu=E2,S2="Expected a function",_2=Math.max,O2=Math.min;function T2(t,e,n){var r,i,o,s,a,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(S2);e=Qu(e)||0,C2(n)&&(u=!!n.leading,f="maxWait"in n,o=f?_2(Qu(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var S=r,D=i;return r=i=void 0,d=v,s=t.apply(D,S),s}function m(v){return d=v,a=setTimeout(k,e),u?p(v):s}function g(v){var S=v-c,D=v-d,O=e-S;return f?O2(O,o-D):O}function y(v){var S=v-c,D=v-d;return c===void 0||S>=e||S<0||f&&D>=o}function k(){var v=ja();if(y(v))return x(v);a=setTimeout(k,g(v))}function x(v){return a=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){a!==void 0&&clearTimeout(a),d=0,r=c=i=a=void 0}function b(){return a===void 0?s:x(ja())}function C(){var v=ja(),S=y(v);if(r=arguments,i=this,c=v,S){if(a===void 0)return m(c);if(f)return clearTimeout(a),a=setTimeout(k,e),p(c)}return a===void 0&&(a=setTimeout(k,e)),s}return C.cancel=w,C.flush=b,C}var N2=T2;const ef=Ri(N2);function M2(){this.__data__=[],this.size=0}var A2=M2;function D2(t,e){return t===e||t!==t&&e!==e}var tf=D2,$2=tf;function L2(t,e){for(var n=t.length;n--;)if($2(t[n][0],e))return n;return-1}var Uo=L2,B2=Uo,I2=Array.prototype,V2=I2.splice;function P2(t){var e=this.__data__,n=B2(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():V2.call(e,n,1),--this.size,!0}var R2=P2,F2=Uo;function j2(t){var e=this.__data__,n=F2(e,t);return n<0?void 0:e[n][1]}var z2=j2,H2=Uo;function W2(t){return H2(this.__data__,t)>-1}var U2=W2,Y2=Uo;function q2(t,e){var n=this.__data__,r=Y2(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var K2=q2,G2=A2,J2=R2,Z2=z2,X2=U2,Q2=K2;function Ur(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])}}Ur.prototype.clear=G2,Ur.prototype.delete=J2,Ur.prototype.get=Z2,Ur.prototype.has=X2,Ur.prototype.set=Q2;var Yo=Ur,ev=Yo;function tv(){this.__data__=new ev,this.size=0}var nv=tv;function rv(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var iv=rv;function ov(t){return this.__data__.get(t)}var sv=ov;function av(t){return this.__data__.has(t)}var lv=av,cv=ji,dv=Wo,uv="[object AsyncFunction]",fv="[object Function]",hv="[object GeneratorFunction]",pv="[object Proxy]";function mv(t){if(!dv(t))return!1;var e=cv(t);return e==fv||e==hv||e==uv||e==pv}var nf=mv,gv=an,yv=gv["__core-js_shared__"],bv=yv,za=bv,rf=function(){var t=/[^.]+$/.exec(za&&za.keys&&za.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kv(t){return!!rf&&rf in t}var vv=kv,wv=Function.prototype,xv=wv.toString;function Ev(t){if(t!=null){try{return xv.call(t)}catch{}try{return t+""}catch{}}return""}var of=Ev,Cv=nf,Sv=vv,_v=Wo,Ov=of,Tv=/[\\^$.*+?()[\]{}|]/g,Nv=/^\[object .+?Constructor\]$/,Mv=Function.prototype,Av=Object.prototype,Dv=Mv.toString,$v=Av.hasOwnProperty,Lv=RegExp("^"+Dv.call($v).replace(Tv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bv(t){if(!_v(t)||Sv(t))return!1;var e=Cv(t)?Lv:Nv;return e.test(Ov(t))}var Iv=Bv;function Vv(t,e){return t==null?void 0:t[e]}var Pv=Vv,Rv=Iv,Fv=Pv;function jv(t,e){var n=Fv(t,e);return Rv(n)?n:void 0}var Yr=jv,zv=Yr,Hv=an,Wv=zv(Hv,"Map"),Ha=Wv,Uv=Yr,Yv=Uv(Object,"create"),qo=Yv,sf=qo;function qv(){this.__data__=sf?sf(null):{},this.size=0}var Kv=qv;function Gv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Jv=Gv,Zv=qo,Xv="__lodash_hash_undefined__",Qv=Object.prototype,ew=Qv.hasOwnProperty;function tw(t){var e=this.__data__;if(Zv){var n=e[t];return n===Xv?void 0:n}return ew.call(e,t)?e[t]:void 0}var nw=tw,rw=qo,iw=Object.prototype,ow=iw.hasOwnProperty;function sw(t){var e=this.__data__;return rw?e[t]!==void 0:ow.call(e,t)}var aw=sw,lw=qo,cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=lw&&e===void 0?cw:e,this}var uw=dw,fw=Kv,hw=Jv,pw=nw,mw=aw,gw=uw;function qr(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])}}qr.prototype.clear=fw,qr.prototype.delete=hw,qr.prototype.get=pw,qr.prototype.has=mw,qr.prototype.set=gw;var yw=qr,af=yw,bw=Yo,kw=Ha;function vw(){this.size=0,this.__data__={hash:new af,map:new(kw||bw),string:new af}}var ww=vw;function xw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ew=xw,Cw=Ew;function Sw(t,e){var n=t.__data__;return Cw(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Ko=Sw,_w=Ko;function Ow(t){var e=_w(this,t).delete(t);return this.size-=e?1:0,e}var Tw=Ow,Nw=Ko;function Mw(t){return Nw(this,t).get(t)}var Aw=Mw,Dw=Ko;function $w(t){return Dw(this,t).has(t)}var Lw=$w,Bw=Ko;function Iw(t,e){var n=Bw(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Vw=Iw,Pw=ww,Rw=Tw,Fw=Aw,jw=Lw,zw=Vw;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=Pw,Kr.prototype.delete=Rw,Kr.prototype.get=Fw,Kr.prototype.has=jw,Kr.prototype.set=zw;var lf=Kr,Hw=Yo,Ww=Ha,Uw=lf,Yw=200;function qw(t,e){var n=this.__data__;if(n instanceof Hw){var r=n.__data__;if(!Ww||r.length<Yw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Uw(r)}return n.set(t,e),this.size=n.size,this}var Kw=qw,Gw=Yo,Jw=nv,Zw=iv,Xw=sv,Qw=lv,ex=Kw;function Gr(t){var e=this.__data__=new Gw(t);this.size=e.size}Gr.prototype.clear=Jw,Gr.prototype.delete=Zw,Gr.prototype.get=Xw,Gr.prototype.has=Qw,Gr.prototype.set=ex;var tx=Gr,nx="__lodash_hash_undefined__";function rx(t){return this.__data__.set(t,nx),this}var ix=rx;function ox(t){return this.__data__.has(t)}var sx=ox,ax=lf,lx=ix,cx=sx;function Go(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ax;++e<n;)this.add(t[e])}Go.prototype.add=Go.prototype.push=lx,Go.prototype.has=cx;var dx=Go;function ux(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var fx=ux;function hx(t,e){return t.has(e)}var px=hx,mx=dx,gx=fx,yx=px,bx=1,kx=2;function vx(t,e,n,r,i,o){var s=n&bx,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&kx?new mx:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!gx(e,function(k,x){if(!yx(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}var cf=vx,wx=an,xx=wx.Uint8Array,Ex=xx;function Cx(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Sx=Cx;function _x(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Ox=_x,df=Fa,uf=Ex,Tx=tf,Nx=cf,Mx=Sx,Ax=Ox,Dx=1,$x=2,Lx="[object Boolean]",Bx="[object Date]",Ix="[object Error]",Vx="[object Map]",Px="[object Number]",Rx="[object RegExp]",Fx="[object Set]",jx="[object String]",zx="[object Symbol]",Hx="[object ArrayBuffer]",Wx="[object DataView]",ff=df?df.prototype:void 0,Wa=ff?ff.valueOf:void 0;function Ux(t,e,n,r,i,o,s){switch(n){case Wx:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Hx:return!(t.byteLength!=e.byteLength||!o(new uf(t),new uf(e)));case Lx:case Bx:case Px:return Tx(+t,+e);case Ix:return t.name==e.name&&t.message==e.message;case Rx:case jx:return t==e+"";case Vx:var a=Mx;case Fx:var c=r&Dx;if(a||(a=Ax),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=$x,s.set(t,e);var u=Nx(a(t),a(e),r,i,o,s);return s.delete(t),u;case zx:if(Wa)return Wa.call(t)==Wa.call(e)}return!1}var Yx=Ux;function qx(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Kx=qx,Gx=Array.isArray,Ua=Gx,Jx=Kx,Zx=Ua;function Xx(t,e,n){var r=e(t);return Zx(t)?r:Jx(r,n(t))}var Qx=Xx;function eE(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var tE=eE;function nE(){return[]}var rE=nE,iE=tE,oE=rE,sE=Object.prototype,aE=sE.propertyIsEnumerable,hf=Object.getOwnPropertySymbols,lE=hf?function(t){return t==null?[]:(t=Object(t),iE(hf(t),function(e){return aE.call(t,e)}))}:oE,cE=lE;function dE(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var uE=dE,fE=ji,hE=zi,pE="[object Arguments]";function mE(t){return hE(t)&&fE(t)==pE}var gE=mE,pf=gE,yE=zi,mf=Object.prototype,bE=mf.hasOwnProperty,kE=mf.propertyIsEnumerable,vE=pf(function(){return arguments}())?pf:function(t){return yE(t)&&bE.call(t,"callee")&&!kE.call(t,"callee")},wE=vE,Jo={exports:{}};function xE(){return!1}var EE=xE;Jo.exports,function(t,e){var n=an,r=EE,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,c=a?a.isBuffer:void 0,d=c||r;t.exports=d}(Jo,Jo.exports);var gf=Jo.exports,CE=9007199254740991,SE=/^(?:0|[1-9]\d*)$/;function _E(t,e){var n=typeof t;return e=e??CE,!!e&&(n=="number"||n!="symbol"&&SE.test(t))&&t>-1&&t%1==0&&t<e}var OE=_E,TE=9007199254740991;function NE(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=TE}var yf=NE,ME=ji,AE=yf,DE=zi,$E="[object Arguments]",LE="[object Array]",BE="[object Boolean]",IE="[object Date]",VE="[object Error]",PE="[object Function]",RE="[object Map]",FE="[object Number]",jE="[object Object]",zE="[object RegExp]",HE="[object Set]",WE="[object String]",UE="[object WeakMap]",YE="[object ArrayBuffer]",qE="[object DataView]",KE="[object Float32Array]",GE="[object Float64Array]",JE="[object Int8Array]",ZE="[object Int16Array]",XE="[object Int32Array]",QE="[object Uint8Array]",eC="[object Uint8ClampedArray]",tC="[object Uint16Array]",nC="[object Uint32Array]",Pe={};Pe[KE]=Pe[GE]=Pe[JE]=Pe[ZE]=Pe[XE]=Pe[QE]=Pe[eC]=Pe[tC]=Pe[nC]=!0,Pe[$E]=Pe[LE]=Pe[YE]=Pe[BE]=Pe[qE]=Pe[IE]=Pe[VE]=Pe[PE]=Pe[RE]=Pe[FE]=Pe[jE]=Pe[zE]=Pe[HE]=Pe[WE]=Pe[UE]=!1;function rC(t){return DE(t)&&AE(t.length)&&!!Pe[ME(t)]}var iC=rC;function oC(t){return function(e){return t(e)}}var sC=oC,Zo={exports:{}};Zo.exports,function(t,e){var n=Yu,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(Zo,Zo.exports);var aC=Zo.exports,lC=iC,cC=sC,bf=aC,kf=bf&&bf.isTypedArray,dC=kf?cC(kf):lC,vf=dC,uC=uE,fC=wE,hC=Ua,pC=gf,mC=OE,gC=vf,yC=Object.prototype,bC=yC.hasOwnProperty;function kC(t,e){var n=hC(t),r=!n&&fC(t),i=!n&&!r&&pC(t),o=!n&&!r&&!i&&gC(t),s=n||r||i||o,a=s?uC(t.length,String):[],c=a.length;for(var d in t)(e||bC.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||mC(d,c)))&&a.push(d);return a}var vC=kC,wC=Object.prototype;function xC(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||wC;return t===n}var EC=xC;function CC(t,e){return function(n){return t(e(n))}}var SC=CC,_C=SC,OC=_C(Object.keys,Object),TC=OC,NC=EC,MC=TC,AC=Object.prototype,DC=AC.hasOwnProperty;function $C(t){if(!NC(t))return MC(t);var e=[];for(var n in Object(t))DC.call(t,n)&&n!="constructor"&&e.push(n);return e}var LC=$C,BC=nf,IC=yf;function VC(t){return t!=null&&IC(t.length)&&!BC(t)}var PC=VC,RC=vC,FC=LC,jC=PC;function zC(t){return jC(t)?RC(t):FC(t)}var HC=zC,WC=Qx,UC=cE,YC=HC;function qC(t){return WC(t,YC,UC)}var KC=qC,wf=KC,GC=1,JC=Object.prototype,ZC=JC.hasOwnProperty;function XC(t,e,n,r,i,o){var s=n&GC,a=wf(t),c=a.length,d=wf(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=a[f];if(!(s?h in e:ZC.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=a[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,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(g=!1)}return o.delete(t),o.delete(e),g}var QC=XC,eS=Yr,tS=an,nS=eS(tS,"DataView"),rS=nS,iS=Yr,oS=an,sS=iS(oS,"Promise"),aS=sS,lS=Yr,cS=an,dS=lS(cS,"Set"),uS=dS,fS=Yr,hS=an,pS=fS(hS,"WeakMap"),mS=pS,Ya=rS,qa=Ha,Ka=aS,Ga=uS,Ja=mS,xf=ji,Jr=of,Ef="[object Map]",gS="[object Object]",Cf="[object Promise]",Sf="[object Set]",_f="[object WeakMap]",Of="[object DataView]",yS=Jr(Ya),bS=Jr(qa),kS=Jr(Ka),vS=Jr(Ga),wS=Jr(Ja),mr=xf;(Ya&&mr(new Ya(new ArrayBuffer(1)))!=Of||qa&&mr(new qa)!=Ef||Ka&&mr(Ka.resolve())!=Cf||Ga&&mr(new Ga)!=Sf||Ja&&mr(new Ja)!=_f)&&(mr=function(t){var e=xf(t),n=e==gS?t.constructor:void 0,r=n?Jr(n):"";if(r)switch(r){case yS:return Of;case bS:return Ef;case kS:return Cf;case vS:return Sf;case wS:return _f}return e});var xS=mr,Za=tx,ES=cf,CS=Yx,SS=QC,Tf=xS,Nf=Ua,Mf=gf,_S=vf,OS=1,Af="[object Arguments]",Df="[object Array]",Xo="[object Object]",TS=Object.prototype,$f=TS.hasOwnProperty;function NS(t,e,n,r,i,o){var s=Nf(t),a=Nf(e),c=s?Df:Tf(t),d=a?Df:Tf(e);c=c==Af?Xo:c,d=d==Af?Xo:d;var u=c==Xo,f=d==Xo,h=c==d;if(h&&Mf(t)){if(!Mf(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Za),s||_S(t)?ES(t,e,n,r,i,o):CS(t,e,c,n,r,i,o);if(!(n&OS)){var p=u&&$f.call(t,"__wrapped__"),m=f&&$f.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Za),i(g,y,n,r,o)}}return h?(o||(o=new Za),SS(t,e,n,r,i,o)):!1}var MS=NS,AS=MS,Lf=zi;function Bf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Lf(t)&&!Lf(e)?t!==t&&e!==e:AS(t,e,n,r,Bf,i)}var DS=Bf,$S=DS;function LS(t,e){return $S(t,e)}var BS=LS;const If=Ri(BS),IS={},VS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},PS=[l.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 RS(t,e){return l.openBlock(),l.createElementBlock("svg",VS,PS)}const FS=be(IS,[["render",RS]]),jS={key:0,class:"leading-none"},zS={key:1},HS={class:"flex flex-col max-h-80 overflow-y-auto"},WS={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},US={key:1},YS={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},qS=["onClick"],KS={class:"select-none flex w-full items-center justify-between"},Vf=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=jn(),o=l.computed(()=>r.placeholder==="Select..."?i("ui.placeholder_select"):r.placeholder),s=l.ref(!1),a=l.ref(r.options);l.watch(()=>r.options,()=>{var v;(v=r.options)!=null&&v.length&&(a.value=[...r.options])},{immediate:!0,deep:!0});const c=n,d=l.ref(),u=l.ref();function f(v){var S,D;if(r.multiple){if(v){let O=r.modelValue||[];O.indexOf(v)>=0?O.splice(O.indexOf(v),1):O.push(v),c("update:modelValue",O),g(O),((S=r.modelValue)==null?void 0:S.length)===((D=r.options)==null?void 0:D.length)?s.value=!0:s.value=!1}}else c("update:modelValue",v),g(v),d.value=null,u.value.hide()}async function h(v){var S,D;c("update:modelValue",v),g(v),await l.nextTick(),((S=r.modelValue)==null?void 0:S.length)===((D=r.options)==null?void 0:D.length)&&(s.value=!0)}function p(v){c("update:modelValue",v),s.value=!1,g(v)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=ef(function(v){c("change",v)},r.debounce),y=l.computed(()=>{var v,S,D,O;if(r.multiple)if(r.maxDisplay){let $=(S=a.value)==null?void 0:S.filter(B=>{var J;return((J=r.modelValue)==null?void 0:J.indexOf(B.value))>=0}).map(B=>B.label),V=$==null?void 0:$.slice(0,r.maxDisplay);return($==null?void 0:$.length)-(V==null?void 0:V.length)>0?(V==null?void 0:V.join(", "))+` (+${($==null?void 0:$.length)-V.length})`:V==null?void 0:V.join(", ")}else return(v=a.value)==null?void 0:v.filter($=>{var V;return((V=r.modelValue)==null?void 0:V.indexOf($.value))>=0}).map($=>$.label).join(", ");else return((O=(D=a.value)==null?void 0:D.find($=>$.value===r.modelValue))==null?void 0:O.label)||r.modelValue});function k(v){var S;try{return r.multiple?r.modelValue!==null&&((S=r.modelValue)==null?void 0:S.some(D=>If(D,v))):r.modelValue!==null&&If(v,r.modelValue)}catch(D){return console.log(D),!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=l.computed(()=>{var v,S;return((v=r.modelValue)==null?void 0:v.length)===((S=r.options)==null?void 0:S.length)}),b=l.computed(()=>{var v;if(r.filterable&&!r.remoteMethod&&((v=d.value)!=null&&v.trim().length)){const S=d.value.trim().toLowerCase();return r.options.filter(D=>{var O;return(O=D.label)==null?void 0:O.toLowerCase().includes(S)})}return r.options});function C(){r.remoteMethod&&r.remoteMethod(d.value)}return e({allSelected:s,isAllSelected:w}),(v,S)=>(l.openBlock(),l.createBlock(dr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:l.withCtx(({isHidden:D})=>[l.createVNode(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>{var O,$,V,B,J,Y;return[l.createElementVNode("span",{class:l.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((O=t.modelValue)==null?void 0:O.length)>0)&&!t.hideSelect?(l.openBlock(),l.createElementBlock("span",jS,[w.value&&(($=t.allSelectedText)!=null&&$.length)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(t.allSelectedText)+" ("+l.toDisplayString((V=t.options)==null?void 0:V.length)+")",1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(y.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(I=>I.value===null))?(l.openBlock(),l.createElementBlock("span",zS,l.toDisplayString((Y=(J=t.options)==null?void 0:J.find(I=>I.value===null))==null?void 0:Y.label),1)):l.renderSlot(v.$slots,"default",{key:2},()=>[l.createTextVNode(l.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(l.openBlock(),l.createElementBlock("div",{key:0,onClick:l.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"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(l.openBlock(),l.createBlock(FS,{key:1,class:"h-5 w-5 -mr-[2px]"})):l.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:l.withCtx(()=>{var D;return[l.createElementVNode("div",HS,[t.filterable?(l.openBlock(),l.createElementBlock("div",WS,[l.createVNode(jf,{slim:"",placeholder:v.$t("ui.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[S[0]||(S[0]=O=>d.value=O),C]},null,8,["placeholder","modelValue"])])):l.createCommentVNode("",!0),!t.options&&((D=t.options)==null?void 0:D.length)==0?(l.openBlock(),l.createElementBlock("span",US,"No data.")):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[t.multiple&&t.batchSelect?(l.openBlock(),l.createElementBlock("div",YS,[l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:S[1]||(S[1]=O=>{var $;return h(($=b.value)==null?void 0:$.filter(V=>V.value).map(V=>V.value))})},l.toDisplayString(v.$t("ui.select_all")),1),l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:S[2]||(S[2]=O=>p([]))},l.toDisplayString(v.$t("ui.select_none")),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,O=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["group",{"is-selected":!!k(O.value)}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||O.value,[`${x[l.unref(fe).theme]}`]:!0}]),onClick:$=>O.disabled?null:f(O.value)},[l.createElementVNode("div",KS,[l.createElementVNode("span",{class:l.normalizeClass(["",{"opacity-25":O.disabled}])},l.toDisplayString(O.label||O.value),3),t.multiple&&k(O.value)?(l.openBlock(),l.createBlock(Uu,{key:0,class:"w-4 h-4"})):l.createCommentVNode("",!0)])],10,qS)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Pf=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[l.createElementVNode("div",{class:l.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}])},[l.createElementVNode("div",{class:l.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),l.createElementVNode("span",{class:l.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},l.toDisplayString(t.label),3)],2))}}),GS={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},JS={class:""},ZS=["value","disabled","rows","placeholder"],Rf=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=l.ref(null),o=l.ref(!1);l.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&l.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function a(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[t.label?(l.openBlock(),l.createElementBlock("div",GS,[l.createTextVNode(l.toDisplayString(t.label)+" ",1),l.createElementVNode("div",JS,[d.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])])):l.createCommentVNode("",!0),l.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:l.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:l.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:a,placeholder:t.placeholder},null,46,ZS)],64))}}),XS=["placeholder"],Ff={__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=l.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return l.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,a)=>(l.openBlock(),l.createBlock(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("input",{type:"color","onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[l.vModelText,i.value]]),l.withDirectives(l.createElementVNode("input",{type:"text","onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,XS),[[l.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},QS={},e_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t_=[l.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),l.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 n_(t,e){return l.openBlock(),l.createElementBlock("svg",e_,t_)}const r_=be(QS,[["render",n_]]),i_={},o_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},s_=[l.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),l.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),l.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 a_(t,e){return l.openBlock(),l.createElementBlock("svg",o_,s_)}const l_=be(i_,[["render",a_]]),c_={},d_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},u_=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function f_(t,e){return l.openBlock(),l.createElementBlock("svg",d_,u_)}const h_=be(c_,[["render",f_]]),p_={class:"flex items-center gap-2"},m_={key:0},g_={class:""},y_=["innerHTML"],b_={class:"flex justify-end"},k_=["name","value","checked"],v_={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},w_={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},x_={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},E_={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},jf=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=l.computed(()=>o.name?o.name:ba()),a=iy(s.value),c=l.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=l.ref(!0),u=l.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=l.computed(()=>{var $;if(o.rules&&typeof o.rules=="string"){let V=($=o.rules)==null?void 0:$.split("|");return o.required&&V.push("required"),o.email&&V.push("email"),V.join("|")}else if(!o.rules){let V=[];return o.required&&V.push("required"),o.email&&V.push("email"),V.join("|")}return"required"});function p($){let V=$&&$.target?$.target.value:$;x(V)}const m=n;function g($){$===!0||$===!1?m("update:modelValue",!$):m("update:modelValue",$)}function y($){let V=$&&$.target?$.target.value:$;m("update:modelValue",V),m("onChange",V)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=ef(function($){m("update:modelValue",$),m("onChange",$)},o.debounce),w=l.ref(null),b=l.ref();function C(){var $,V;o.textarea?($=b.value)==null||$.focus():(V=w.value)==null||V.$el.focus()}function v(){return w.value.meta.valid}const S=l.ref(),D=l.computed(()=>S.value.allSelected),O=l.computed(()=>S.value.isAllSelected);return e({focus:C,isValid:v,allSelected:D,isAllSelected:O}),($,V)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.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"])},[l.createElementVNode("div",p_,[l.createElementVNode("span",null,l.toDisplayString(c.value),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",m_,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",g_,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,y_)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",b_,[l.renderSlot($.$slots,"more")])],2)):l.createCommentVNode("",!0),t.checkbox?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:l.withCtx(({field:B})=>[l.createElementVNode("div",{class:l.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:V[0]||(V[0]=J=>t.disabled?void 0:g(t.modelValue))},[l.createElementVNode("div",{class:l.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[l.unref(fe).theme]}`]:!0}])},[t.modelValue===!0?(l.openBlock(),l.createBlock(Uu,{key:0})):l.createCommentVNode("",!0)],2),l.createElementVNode("span",{class:l.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}])},[l.renderSlot($.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:l.withCtx(({field:B})=>[l.createElementVNode("div",{onClick:V[2]||(V[2]=()=>{t.disabled||y(t.radioValue)}),class:l.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[l.createElementVNode("span",{class:l.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):l.createCommentVNode("",!0)],2),l.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:V[1]||(V[1]=(...J)=>$.onChange&&$.onChange(...J)),checked:t.radioValue==t.modelValue},null,40,k_),c.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["text-base",{"opacity-50":t.disabled}])},l.toDisplayString(c.value),3)):l.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(l.openBlock(),l.createBlock(l.unref(ar),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>{var J;return[l.createVNode(Vf,{ref_key:"myChoiceList",ref:S,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&l.unref(a)),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","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(l.openBlock(),l.createBlock(l.unref(ar),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>[l.createVNode(Ff,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(l.openBlock(),l.createBlock(l.unref(ar),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>[l.createVNode(Pf,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createElementBlock("div",{key:6,class:l.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[l.unref(fe).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!":l.unref(a)}])},[$.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[l.createElementVNode("div",v_,[l.renderSlot($.$slots,"prepend")])],2)):l.createCommentVNode("",!0),t.textarea?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(()=>{var B;return[l.createVNode(Rf,{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&&l.unref(a)),required:t.required||((B=h.value)==null?void 0:B.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:w,autocomplete:"off",style:{"z-index":"1"},class:l.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":!$.$slots.prepend&&!t.naked,"pl-8":$.$slots.prepend&&!t.naked,"pl-6":$.$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:!!l.unref(a),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(l.openBlock(),l.createElementBlock("div",{key:3,onClick:l.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(l.openBlock(),l.createElementBlock("div",{key:4,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0),$.$slots.append||t.password||t.type=="password"?(l.openBlock(),l.createElementBlock("div",w_,[l.createElementVNode("div",x_,[l.renderSlot($.$slots,"append",{},()=>[l.withDirectives(l.createVNode(r_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,d.value]]),l.withDirectives(l.createVNode(l_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,!d.value]])])])])):l.createCommentVNode("",!0)],2)),t.error&&l.unref(a)?(l.openBlock(),l.createElementBlock("div",E_,[l.createVNode(l.unref(ry),{name:s.value},{default:l.withCtx(B=>[l.createTextVNode(l.toDisplayString(B.message),1)]),_:1},8,["name"])])):l.createCommentVNode("",!0),$.$slots.help||t.help?(l.openBlock(),l.createElementBlock("div",{key:8,class:l.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[l.renderSlot($.$slots,"help",{},()=>[l.createTextVNode(l.toDisplayString(t.help),1)])],2)):l.createCommentVNode("",!0)],2))}}),C_=["innerHTML"],zf=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=l.ref(),n=l.ref(),r=l.ref();ba();const i=t;function o(){i.text&&(n.value.style.display="block",a())}function s(){n.value.style.display=""}async function a(){var h,p;await l.nextTick();const c=await Od(e.value,n.value,{placement:i.placement,middleware:[_d(),Sd(),Cd(i.offset),o1({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)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("span",{ref_key:"button",ref:e,class:l.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[l.renderSlot(c.$slots,"default")],34),l.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"},[l.createElementVNode("span",{innerHTML:t.text},null,8,C_),l.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),S_={key:1,class:"flex justify-between items-baseline pt-4 px-6"},__={class:""},O_={key:2,class:"flex items-center justify-end py-4 px-6"},T_=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=l.resolveComponent("wpic-loading-panel");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["rounded-lg wpic-card relative",{[e[l.unref(fe).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(l.openBlock(),l.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):l.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",S_,[t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[l.unref(fe).theme]]])},[l.renderSlot(r.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])],2)):l.createCommentVNode("",!0),l.createElementVNode("div",__,[l.renderSlot(r.$slots,"actions")])])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default"),r.$slots.buttons?(l.openBlock(),l.createElementBlock("div",O_,[l.renderSlot(r.$slots,"buttons")])):l.createCommentVNode("",!0)],2)}}}),N_={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},M_={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},A_=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[l.unref(fe).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?(l.openBlock(),l.createElementBlock("div",N_,[l.createElementVNode("div",M_,[l.renderSlot(n.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])]),l.renderSlot(n.$slots,"actions")])):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default")],2))}}),D_=l.createElementVNode("div",{class:""},null,-1),$_=l.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),L_=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=l.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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex w-full relative",r[l.unref(fe).theme]]),style:{"z-index":"1"}},[n.value>0?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({width:`${n.value}%`}),class:l.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createVNode(zf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:l.withCtx(()=>[D_]),_:1},8,["text"])],6)):l.createCommentVNode("",!0)],2),t.indicators?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[$_],64)):l.createCommentVNode("",!0)],2))}}),B_={class:"leading-none"},I_=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("span",B_,[l.renderSlot(o.$slots,"default")]),t.clearable?(l.openBlock(),l.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0)],2))}}),V_=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"w-full":t.full})},[l.createElementVNode("div",{class:l.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[l.renderSlot(e.$slots,"default")],2)],2))}}),P_=t=>(l.pushScopeId("data-v-947735f2"),t=t(),l.popScopeId(),t),R_={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},F_=[P_(()=>l.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],j_=be(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(l.openBlock(),l.createElementBlock("div",R_,F_)):(l.openBlock(),l.createBlock(Ir,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),z_={class:"text-base font-medium select-none"},Hi=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[l.unref(fe).theme]]:!t.active&&!t.disabled,[n[l.unref(fe).theme]]:t.active&&!t.disabled,[r[l.unref(fe).theme]]:t.disabled}])},[l.createElementVNode("span",z_,[l.renderSlot(i.$slots,"default")])],2))}}),H_={},W_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},U_=[l.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 Y_(t,e){return l.openBlock(),l.createElementBlock("svg",W_,U_)}const Hf=be(H_,[["render",Y_]]),q_={},K_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},G_=[l.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 J_(t,e){return l.openBlock(),l.createElementBlock("svg",K_,G_)}const Wf=be(q_,[["render",J_]]),Z_={},X_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Q_=[l.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 eO(t,e){return l.openBlock(),l.createElementBlock("svg",X_,Q_)}const Uf=be(Z_,[["render",eO]]),tO={},nO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},rO=[l.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 iO(t,e){return l.openBlock(),l.createElementBlock("svg",nO,rO)}const Yf=be(tO,[["render",iO]]),oO={class:"wpic-pagination flex justify-between"},sO={key:0,class:"flex items-center"},aO={key:0},lO={key:1,class:"flex flex-wrap gap-2"},cO=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}=jn(),i=t,o=l.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("ui.per_page",{count:p})}))),s=n,a=l.computed(()=>Math.ceil(i.total/i.perPage)),c=l.computed(()=>{const p=a.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<=a.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=l.resolveComponent("wpic-choice-list");return l.openBlock(),l.createElementBlock("div",oO,[t.info?(l.openBlock(),l.createElementBlock("div",sO,[t.total>0?(l.openBlock(),l.createElementBlock("span",aO,l.toDisplayString(p.$t("ui.pagination",{start:u(),end:f(),total:t.total})),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),t.pages?(l.openBlock(),l.createElementBlock("div",lO,[l.createVNode(Hi,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Hf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Wf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,y=>(l.openBlock(),l.createBlock(Hi,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:a.value==0||!a.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),l.createVNode(Hi,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Yf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[3]||(m[3]=y=>d(a.value)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Uf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(l.openBlock(),l.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),qf=(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 l.h("td",e.attrs,n)};qf.props=["column","item","rowIndex"];const Qo=qf,dO={},uO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},fO=[l.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 hO(t,e){return l.openBlock(),l.createElementBlock("svg",uO,fO)}const pO=be(dO,[["render",hO]]),mO={class:"font-semibold"},Kf={__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)=>(l.openBlock(),l.createElementBlock("tr",mO,[t.checkable?(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).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"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.columns,(i,o)=>(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).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))]))}},gO={},yO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},bO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function kO(t,e){return l.openBlock(),l.createElementBlock("svg",yO,bO)}const vO=be(gO,[["render",kO]]),wO={},xO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},EO=[l.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 CO(t,e){return l.openBlock(),l.createElementBlock("svg",xO,EO)}const SO=be(wO,[["render",CO]]),_O={class:"wpic-table"},OO={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},TO={class:"flex items-center gap-2"},NO={class:"flex items-center gap-2"},MO={class:"w-full rounded-lg"},AO={key:0,class:"w-16"},DO=["width"],$O=["width"],LO={class:"flex justify-center items-center h-full"},BO=["onClick"],IO={class:"rounded-b-lg relative"},VO={key:0},PO=[l.createElementVNode("td",{class:"text-center py-3"}," ",-1)],RO={class:"flex justify-center items-center h-full"},FO={key:1},jO={key:0,class:"text-center text-gray-400 py-3"},zO=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"},a={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;l.onMounted(()=>{k()});const h=l.getCurrentInstance();l.provide("wtable",h==null?void 0:h.proxy);const p=l.useSlots(),m=l.ref([]),g=l.ref([]),y=l.computed(()=>r.columnToggleable?m.value.filter(B=>g.value.includes(B.field)||!B.selectable):m.value.filter(B=>B.visible||!B.selectable));function k(){const B=(I,T)=>{let R={};for(let F in I){if(typeof I[F].default=="boolean"&&T[F]!==void 0){R[F]=T[F]!==!1;continue}if(T[F]!==void 0){R[F]=T[F];continue}if(typeof I[F].default=="function"){R[F]=I[F].default();continue}R[F]=I[F].default}return R};let J=[];(p.default&&p.default()||[]).forEach(I=>{var T,R;((T=I.type)==null?void 0:T.name)==="WpicTableColumn"?J.push(I):(R=I.children)!=null&&R.length&&I.children.forEach(F=>{var ee;((ee=F.type)==null?void 0:ee.name)==="WpicTableColumn"&&J.push(F)})}),m.value=J.map(I=>{let T=I.children,R=I.props||{},{field:F,label:ee,help:ie,width:he,minWidth:ue,maxWidth:L,sortable:z,selectable:q,render:U,type:j,align:ce,visible:le,noPadding:ve}=B(I.type.props,R);return F||(F=V(ee)),q&&le&&g.value.push(F),{label:ee,help:ie,width:he,minWidth:ue,maxWidth:L,type:j,align:ce,sortable:z,selectable:q,field:F,render:U,children:T,visible:le,noPadding:ve}})}function x(B){var Y,I;let J=(Y=r.sortOptions)==null?void 0:Y.sortDirection;((I=r.sortOptions)==null?void 0:I.sortBy)===B&&(J=J==="asc"?"desc":"asc"),f("changeSort",{sortDirection:J,sortBy:B})}l.watch(()=>p.default,B=>{k()},{deep:!0});const w=l.reactive({});function b({index:B,item:J}){w[B]?w[B]=null:(w[B]=!0,f("expandRow",{index:B,item:J}))}const C=l.ref([]);function v(B){const J=$(B,r.itemId);C.value.includes(J)?(C.value.splice(C.value.indexOf(J),1),S.value=!1):C.value.push(J)}const S=l.ref(!1);function D(){if(S.value=!S.value,C.value=[],S.value)for(let B of r.data){let J=$(B,r.itemId);C.value.push(J)}}function O(){S.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:O});function $(B,J){return J.split(".").reduce((Y,I)=>Y?Y[I]:void 0,B)}function V(B){return!B||typeof B!="string"?"":B.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(B,J)=>{const Y=l.resolveComponent("wpic-choice-list"),I=l.resolveComponent("wpic-form-field");return l.openBlock(),l.createElementBlock("div",_O,[B.$slots.header||B.$slots.actions||t.columnToggleable?(l.openBlock(),l.createElementBlock("div",OO,[l.createElementVNode("div",TO,[l.renderSlot(B.$slots,"header")]),l.createElementVNode("div",NO,[l.renderSlot(B.$slots,"actions"),l.createVNode(Y,{multiple:"",modelValue:g.value,"onUpdate:modelValue":J[0]||(J[0]=T=>g.value=T),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(T=>T.selectable).map(T=>({label:T.label,value:T.field}))},{default:l.withCtx(()=>[l.createVNode(_i,{medium:"",square:"",colorless:"",class:"ml-px"},{default:l.withCtx(()=>[l.createVNode(SO,{class:"w-5 h-5"})]),_:1})]),_:1},8,["modelValue","options"])])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createElementVNode("div",{class:l.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[l.createElementVNode("table",MO,[l.createElementVNode("colgroup",null,[t.checkable?(l.openBlock(),l.createElementBlock("col",AO)):l.createCommentVNode("",!0),y.value.find(T=>T.type=="expand")?(l.openBlock(),l.createElementBlock("col",{key:1,style:l.normalizeStyle({minWidth:`${y.value.find(T=>T.type=="expand").minWidth}px`}),width:y.value.find(T=>T.type=="expand").width,class:"w-16"},null,12,DO)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(T=>T.type!="expand"),(T,R)=>(l.openBlock(),l.createElementBlock("col",{style:l.normalizeStyle({minWidth:`${T.minWidth}px`,maxWidth:`${T.maxWidth}px`}),width:T.width,key:R},null,12,$O))),128))]),t.hideHeaders?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("thead",{key:0,class:l.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[l.createElementVNode("tr",null,[t.checkable?(l.openBlock(),l.createElementBlock("th",{key:0,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},[l.createElementVNode("div",LO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:S.value,"onUpdate:modelValue":D},null,8,["modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(T=>T.type=="expand")?(l.openBlock(),l.createElementBlock("th",{key:1,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},null,2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(T=>T.type!="expand"),(T,R)=>{var F,ee;return l.openBlock(),l.createElementBlock("th",{class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[l.unref(fe).theme]}`]:!0,"sticky top-0 left-0":R===0}]),style:l.normalizeStyle({maxWidth:`${T.maxWidth}px`})},[l.createElementVNode("div",{onClick:()=>{T.sortable&&x(T.field)},class:l.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":T.sortable&&T.field,"justify-center":T.align=="center","justify-end":T.align=="right"}])},[l.createElementVNode("span",{class:l.normalizeClass(["select-none font-medium text-sm",{"text-right":T.align=="right"}])},l.toDisplayString(T.label),3),T.sortable&&T.field?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["ml-1",{"opacity-25":T.field!=((F=t.sortOptions)==null?void 0:F.sortBy)}])},[l.createVNode(pO,{class:l.normalizeClass(["w-4 h-4",{"rotate-180":((ee=t.sortOptions)==null?void 0:ee.sortDirection)==="asc"}])},null,8,["class"])],2)):l.createCommentVNode("",!0)],10,BO)],6)}),256))])],2)),l.createElementVNode("tbody",IO,[t.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:l.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[l.unref(fe).theme]]])},[l.createVNode(Ir,{class:"w-6 h-6"})],2),t.data.length?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("tr",VO,PO))],64)):l.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(l.openBlock(),l.createBlock(Kf,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.data,(T,R)=>{var F,ee,ie,he,ue;return l.openBlock(),l.createElementBlock(l.Fragment,{key:`tr_${R}`},[l.createElementVNode("tr",{class:l.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":R%2==0,"is-even":R%2!=0,[s[l.unref(fe).theme]]:!0}])},[t.checkable?(l.openBlock(),l.createElementBlock("td",{key:0,class:l.normalizeClass([{[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}])},[l.createElementVNode("div",RO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes($(T,t.itemId)),checkboxValue:$(T,t.itemId),"onUpdate:modelValue":L=>v(T)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(L=>L.type=="expand")?(l.openBlock(),l.createElementBlock("td",{key:1,class:l.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[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[l.createVNode(_i,{small:"",square:"",onClick:L=>b({item:T,index:R})},{default:l.withCtx(()=>[w[R]?(l.openBlock(),l.createBlock(h_,{key:0,class:"w-4 h-4"})):(l.openBlock(),l.createBlock(vO,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(L=>L.type!="expand"),(L,z)=>{var q,U;return l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":z===0,[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!L.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":R===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":R===((U=t.data)==null?void 0:U.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"text-center justify-center":L.align=="center","text-right justify-end":L.align=="right","align-top py-5":t.valign=="top"}]),style:l.normalizeStyle({maxWidth:`${L.maxWidth}px`}),id:`${R}_${z}`,column:L,item:T,rowIndex:R,key:z},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(L=>L.type=="expand")?l.withDirectives((l.openBlock(),l.createElementBlock("tr",{key:0,class:l.normalizeClass([{[s[l.unref(fe).theme]]:!t.stripe,[a[l.unref(fe).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[l.createVNode(Qo,{class:l.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[l.unref(fe).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((F=y.value.find(L=>L.type=="expand"))!=null&&F.noPadding),"p-0":(ee=y.value.find(L=>L.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":R===((ie=t.data)==null?void 0:ie.length)-1&&!t.totalItem,"first:rounded-bl-lg":R===((he=t.data)==null?void 0:he.length)-1&&!t.totalItem,"text-center":y.value.find(L=>L.type=="expand").align=="center","text-right":y.value.find(L=>L.type=="expand").align=="right"}]),column:y.value.find(L=>L.type=="expand"),rowIndex:R,colspan:(ue=y.value)==null?void 0:ue.length,item:T},null,8,["class","column","rowIndex","colspan","item"])],2)),[[l.vShow,w[R]]]):l.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(l.openBlock(),l.createElementBlock("tfoot",FO,[l.createVNode(Kf,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):l.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(l.openBlock(),l.createElementBlock("div",jO," No Data ")):l.createCommentVNode("",!0)],2)])}}}),HO={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 Gf(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=Gf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Jf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),c=s.nodeSize;if(s==a){n-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=Jf(s.content,a.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class G{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let c=this.content[s],d=a+c.nodeSize;if(d>e&&r(c,i+a,o||null,s)!==!1&&c.content.size){let u=a+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new G(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=c}return new G(r,i)}cutByIndex(e,n){return e==n?G.empty:e==0&&n==this.content.length?this:new G(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 G(i,o)}addToStart(e){return new G([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new G(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 Gf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Jf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return es(0,e);if(e==this.size)return es(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?es(r+1,s):es(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 G.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return G.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 G(n||e,r)}static from(e){if(!e)return G.empty;if(e instanceof G)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new G([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const Xa={index:0,offset:0};function es(t,e){return Xa.index=t,Xa.offset=e,Xa}function ts(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(!ts(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ts(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Be=class Lc{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&&ts(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 Lc.none;if(e instanceof Lc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Be.none=[];class ns extends Error{}class ne{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=Xf(this.content,e+this.openStart,n);return r&&new ne(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ne(Zf(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 ne.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 ne(G.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 ne(e,r,i)}}ne.empty=new ne(G.empty,0,0);function Zf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Zf(o.content,e-i-1,n-i-1)))}function Xf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Xf(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function WO(t,e,n){if(n.openStart>t.depth)throw new ns("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ns("Inconsistent open depths");return Qf(t,e,n,0)}function Qf(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=Qf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return yr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=UO(n,t);return yr(o,th(t,s,a,e,r))}else return yr(o,rs(t,e,r))}function eh(t,e){if(!e.type.compatibleContent(t.type))throw new ns("Cannot join "+e.type.name+" onto "+t.type.name)}function Qa(t,e,n){let r=t.node(n);return eh(r,e.node(n)),r}function gr(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 Wi(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&&(gr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)gr(i.child(a),r);e&&e.depth==n&&e.textOffset&&gr(e.nodeBefore,r)}function yr(t,e){return t.type.checkContent(e),t.copy(e)}function th(t,e,n,r,i){let o=t.depth>i&&Qa(t,e,i+1),s=r.depth>i&&Qa(n,r,i+1),a=[];return Wi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(eh(o,s),gr(yr(o,th(t,e,n,r,i+1)),a)):(o&&gr(yr(o,rs(t,e,i+1)),a),Wi(e,n,i,a),s&&gr(yr(s,rs(n,r,i+1)),a)),Wi(r,null,i,a),new G(a)}function rs(t,e,n){let r=[];if(Wi(null,t,n,r),t.depth>n){let i=Qa(t,e,n+1);gr(yr(i,rs(t,e,n+1)),r)}return Wi(e,null,n,r),new G(r)}function UO(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(G.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ui{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 Be.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new is(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,a,i+c),!d||(s=s.child(a),s.isText))break;o=d-1,i+=c+1}return new Ui(n,r,o)}static resolveCached(e,n){let r=nh.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 nh.set(e,r=new YO);let i=r.elts[r.i]=Ui.resolve(e,n);return r.i=(r.i+1)%qO,i}}class YO{constructor(){this.elts=[],this.i=0}}const qO=12,nh=new WeakMap;class is{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 KO=Object.create(null);let zn=class Bc{constructor(e,n,r,i=Be.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||G.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&&ts(this.attrs,n||e.defaultAttrs||KO)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new Bc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Bc(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ne.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new ne(d,i.depth-s,o.depth-s)}replace(e,n,r){return WO(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 Ui.resolveCached(this,e)}resolveNoCache(e){return Ui.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()+")"),rh(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=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let 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=Be.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(!Be.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=G.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};zn.prototype.text=void 0;class ss extends zn{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):rh(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 ss(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ss(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 rh(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class br{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new GO(e,n);if(r.next==null)return br.empty;let i=ih(r);r.next&&r.err("Unexpected trailing text");let o=nT(tT(i));return rT(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return G.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:c}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
28
|
+
`)}}br.empty=new br(!0);class GO{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 ih(t){let e=[];do e.push(JO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function JO(t){let e=[];do e.push(ZO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ZO(t){let e=eT(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=XO(t,e);else break;return e}function oh(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function XO(t,e){let n=oh(t),r=n;return t.eat(",")&&(t.next!="}"?r=oh(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function QO(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 eT(t){if(t.eat("(")){let e=ih(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=QO(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 tT(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,c){let d={term:c,to:a};return e[s].push(d),d}function i(s,a){s.forEach(c=>c.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,a)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],a);if(c==s.exprs.length-1)return d;i(d,a=n())}else if(s.type=="star"){let c=n();return r(a,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,a),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let c=a;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(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function sh(t,e){return e-t}function ah(t,e){let n=[];return r(e),n.sort(sh);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:c}=o[s];!a&&n.indexOf(c)==-1&&r(c)}}}function nT(t){let e=Object.create(null);return n(ah(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);ah(t,c).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new br(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(sh);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function rT(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:c,next:d}=i.next[a];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 lh(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 ch(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 dh(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 uh(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new oT(t,r,e[r]);return n}let fh=class Gg{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=uh(e,r.attrs),this.defaultAttrs=lh(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==br.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:ch(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zn(this,this.computeAttrs(e),G.from(n),Be.setFrom(r))}createChecked(e=null,n,r){return n=G.from(n),this.checkContent(n),new zn(this,this.computeAttrs(e),n,Be.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=G.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(G.empty,!0);return o?new zn(this,e,n.append(o),Be.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){dh(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:Be.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Gg(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 iT(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 oT{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?iT(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=uh(e,i.attrs),this.excluded=null;let o=lh(this.attrs);this.instance=o?new Be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,ch(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){dh(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class hh{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=fh.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||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=br.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?ph(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ph(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 fh){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 ss(r,r.defaultAttrs,e,Be.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return zn.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ph(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let c=t.marks[a];(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 sT(t){return t.tag!=null}function aT(t){return t.style!=null}class Hn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(sT(i))this.tags.push(i);else if(aT(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 bh(this,n,!1);return r.addAll(e,Be.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new bh(this,n,!0);return r.addAll(e,Be.none,n.from,n.to),ne.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(dT(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let 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 a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=kh(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=kh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Hn(e,Hn.schemaRules(e)))}}const mh={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},lT={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gh={ol:!0,ul:!0},Yi=1,el=2,ls=4;function yh(t,e,n){return e!=null?(e?Yi:0)|(e==="full"?el:0):t&&t.whitespace=="pre"?Yi|el:n&-5}class cs{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=Be.none,this.match=o||(s&ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.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&Yi)){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=G.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(G.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&&!mh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class bh{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=yh(null,n.preserveWhitespace,0)|(r?ls:0);i?o=new cs(i.type,i.attrs,Be.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new cs(null,null,Be.none,!0,null,s):o=new cs(e.schema.topNodeType,null,Be.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&el?"full":this.localPreserveWS||(i.options&Yi)>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
|
+
`);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],a=e.previousSibling;(!s||a&&a.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(),a;gh.hasOwnProperty(s)&&this.parser.normalizeLists&&cT(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:lT.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(mh.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?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
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 a=void 0;;){let c=this.parser.matchStyle(o,s,this,a);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)a=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 a=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(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;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],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.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=Be.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):vh(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 a=yh(e,o,s.options);s.options&ls&&s.content.length==0&&(a|=ls);let c=Be.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):vh(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new cs(e,n,c,i,null,a)),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|=Yi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,c)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;c>=o;c--)if(s(a-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 cT(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&gh.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function dT(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function kh(t){let e={};for(let n in t)e[n]=t[n];return e}function vh(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:u}=a.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class kr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=tl(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,c=0;for(;a<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<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}=ds(tl(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&&ds(tl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ds(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new kr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=wh(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return wh(e.marks)}}function wh(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tl(t){return t.document||window.document}const xh=new WeakMap;function uT(t){let e=xh.get(t);return e===void 0&&xh.set(t,e=fT(t)),e}function fT(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 ds(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=uT(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 a,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}=ds(t,h,n,r);if(c.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Eh=65535,Ch=Math.pow(2,16);function hT(t,e){return t+e*Ch}function Sh(t){return t&Eh}function pT(t){return(t-(t&Eh))/Ch}const _h=1,Oh=2,us=4,Th=8;class nl{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Th)>0}get deletedBefore(){return(this.delInfo&(_h|us))>0}get deletedAfter(){return(this.delInfo&(Oh|us))>0}get deletedAcross(){return(this.delInfo&us)>0}}class $t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&$t.empty)return $t.empty}recover(e){let n=0,r=Sh(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+pT(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[a+o],u=this.ranges[a+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:hT(a/3,e-c),g=e==c?Oh:e==f?_h:us;return(n<0?e!=c:e!=f)&&(g|=Th),new nl(p,g,m)}i+=u-d}return r?e+i:new nl(e+i,0,null)}touches(e,n){let r=0,i=Sh(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+o],u=c+d;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(a,a+d,c,c+u),o+=u-d}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);class Zr{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 Zr(this.maps,this.mirror,e,n)}copy(){return new Zr(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 Zr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new nl(e,i,null)}}const rl=Object.create(null);class dt{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=rl[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 rl)throw new RangeError("Duplicate use of step JSON ID "+e);return rl[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 ns)return Ue.fail(o.message);throw o}}}function il(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(il(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return G.fromArray(r)}class Wn extends dt{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 ne(il(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,o)}invert(){return new ln(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 Wn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wn(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 Wn(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("addMark",Wn);class ln extends dt{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 ne(il(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 Wn(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 ln(n.pos,r.pos,this.mark)}merge(e){return e instanceof ln&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ln(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 ln(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("removeMark",ln);class Un extends dt{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 ne(G.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 Un(this.pos,n.marks[i]);return new Un(this.pos,this.mark)}}return new Xr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Un(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 Un(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("addNodeMark",Un);class Xr extends dt{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 ne(G.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Un(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xr(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 Xr(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("removeNodeMark",Xr);class Ze extends dt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ol(e,this.from,this.to)?Ue.fail("Structure replace would overwrite content"):Ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([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?ne.empty:new ne(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?ne.empty:new ne(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,ne.fromJSON(e,n.slice),!!n.structure)}}dt.jsonID("replace",Ze);class Xe extends dt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(ol(e,this.from,this.gapFrom)||ol(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 $t([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,ne.fromJSON(e,n.slice),n.insert,!!n.structure)}}dt.jsonID("replaceAround",Xe);function ol(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 mT(t,e,n,r){let i=[],o=[],s,a;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 ln(h,p,f[g])));a&&a.to==h?a.to=p:o.push(a=new Wn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function gT(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{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(a+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(a,e),to:d,step:o})}}}),i.forEach(s=>t.step(new ln(s.from,s.to,s.style)))}function sl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=a+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Ze(a,u,ne.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new ln(a,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new ne(G.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Ze(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let c=r.fillBefore(G.empty,!0);t.replace(a,a,new ne(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function yT(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qr(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||!yT(i,o,s))break}return null}function bT(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),c=s,d=a,u=G.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=G.from(r.node(m).copy(u)),f++):c--;let h=G.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=G.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,a,new ne(u.append(h),f,p),u.size-f,!0))}function al(t,e,n=null,r=t){let i=kT(t,e),o=i&&vT(r,e);return o?i.map(Nh).concat({type:e,attrs:n}).concat(o.map(Nh)):null}function Nh(t){return{type:t,attrs:null}}function kT(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 vT(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 wT(t,e,n){let r=G.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=G.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 ne(r,0,0),n.length,!0))}function xT(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&ET(t.doc,t.mapping.slice(o).map(a),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&&Ah(t,s,a,o),sl(t,t.mapping.slice(o).map(a,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new Xe(f,h,f+1,h-1,new ne(G.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Mh(t,s,a,o),!1}})}function Mh(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Ah(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 ET(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function CT(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 ne(G.from(s),0,0),1,!0))}function Cn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(a,a,c?c.type:i.node(o+1).type)}function ST(t,e,n=1,r){let i=t.doc.resolve(e),o=G.empty,s=G.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=G.from(i.node(a).copy(o));let u=r&&r[d];s=G.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Ze(e,e,new ne(o.append(s),n,n),!0))}function Yn(t,e){let n=t.resolve(e),r=n.index();return Dh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _T(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 Dh(t,e){return!!(t&&e&&!t.isLeaf&&_T(t,e))}function fs(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Dh(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function OT(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 a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Ah(t,u.node(),u.before(),a)}s.inlineContent&&sl(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(a),d=c.map(e-n);if(t.step(new Ze(d,c.map(e+n,-1),ne.empty,!0)),r===!0){let u=t.doc.resolve(d);Mh(t,u.node(),u.before(),t.steps.length)}return t}function TT(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 $h(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>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 a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function hs(t,e,n=e,r=ne.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Lh(i,o,r)?new Ze(e,n,r):new NT(i,o,r).fit()}function Lh(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class NT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.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=G.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let c=new ne(o,s,a);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=ll(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:d}=this.frontier[a],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(G.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ll(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ne(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=ll(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new ne(qi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ne(qi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,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=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||c==0||g.content.size)&&(f=y,u.push(Bh(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?p:-1)))}let m=d==a.childCount;m||(p=-1),this.placed=Ki(this.placed,n,G.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let k=y.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),y=k.content}this.unplaced=m?e==0?ne.empty:new ne(qi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new ne(qi(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||!cl(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=cl(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=cl(e,a,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=Ki(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=Ki(this.placed,this.depth,G.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Ki(this.placed,this.frontier.length,n))}}function qi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(qi(t.firstChild.content,e-1,n)))}function Ki(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ki(t.lastChild.content,e-1,n)))}function ll(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Bh(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Bh(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(G.empty,!0)))),t.copy(r)}function cl(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!MT(n,o.content,s)?a:null}function MT(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function AT(t){return t.spec.defining||t.spec.definingForContent}function DT(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Lh(i,o,r))return t.step(new Ze(e,n,r));let s=Vh(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(a),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=AT(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+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 ne(Ih(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 Ih(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ih(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(G.empty,!0))}return t}function $T(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=TT(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ne(G.from(r),0,0))}function LT(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Vh(r,i);for(let s=0;s<o.length;s++){let a=o[s],c=s==o.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&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 Vh(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 ei extends dt{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 ne(G.from(i),0,n.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new ei(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 ei(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 ei(n.pos,n.attr,n.value)}}dt.jsonID("attr",ei);class Gi extends dt{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 $t.empty}invert(e){return new Gi(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 Gi(n.attr,n.value)}}dt.jsonID("docAttr",Gi);let ti=class extends Error{};ti=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ti.prototype=Object.create(Error.prototype),ti.prototype.constructor=ti,ti.prototype.name="TransformError";class BT{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ti(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=ne.empty){let i=hs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new ne(G.from(r),0,0))}delete(e,n){return this.replace(e,n,ne.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return DT(this,e,n,r),this}replaceRangeWith(e,n,r){return $T(this,e,n,r),this}deleteRange(e,n){return LT(this,e,n),this}lift(e,n){return bT(this,e,n),this}join(e,n=1){return OT(this,e,n),this}wrap(e,n){return wT(this,e,n),this}setBlockType(e,n=e,r,i=null){return xT(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return CT(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ei(e,n,r)),this}setDocAttribute(e,n){return this.step(new Gi(e,n)),this}addNodeMark(e,n){return this.step(new Un(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Be)){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 Xr(e,n)),this}split(e,n=1,r){return ST(this,e,n,r),this}addMark(e,n,r){return mT(this,e,n,r),this}removeMark(e,n,r){return gT(this,e,n,r),this}clearIncompatible(e,n,r){return sl(this,e,n,r),this}}const dl=Object.create(null);class xe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new IT(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=ne.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:c,$to:d}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),a?ne.empty:n),a==0&&Fh(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(a.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Fh(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ke(e):ni(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?ni(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):ni(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 Lt(e.node(0))}static atStart(e){return ni(e,e,0,0,1)||new Lt(e)}static atEnd(e){return ni(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=dl[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 dl)throw new RangeError("Duplicate use of selection JSON ID "+e);return dl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}xe.prototype.visible=!0;class IT{constructor(e,n){this.$from=e,this.$to=n}}let Ph=!1;function Rh(t){!Ph&&!t.parent.inlineContent&&(Ph=!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){Rh(e),Rh(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=ne.empty){if(super.replace(e,n),n==ne.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 ps(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 ps{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ps(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 ne(G.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 ul(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 ul{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ps(r,r):new ul(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):xe.near(n)}}class Lt extends xe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ne.empty){if(n==ne.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 Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return VT}}xe.jsonID("all",Lt);const VT={map(){return this},resolve(t){return new Lt(t)}};function ni(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 a=e.child(s);if(a.isAtom){if(!o&&pe.isSelectable(a))return pe.create(t,n-(i<0?a.nodeSize:0))}else{let c=ni(t,a,n+i,i<0?a.childCount:0,i,o);if(c)return c}n+=a.nodeSize*i}return null}function Fh(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((a,c,d,u)=>{s==null&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const jh=1,zh=2,Hh=4;class PT extends BT{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|jh)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&jh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=zh,this}ensureMarks(e){return Be.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&zh)>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)||Be.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|=Hh,this}get scrolledIntoView(){return(this.updated&Hh)>0}}function Wh(t,e){return!e||!t?t:t.bind(e)}class Ji{constructor(e,n,r){this.name=e,this.init=Wh(n.init,r),this.apply=Wh(n.apply,r)}}const RT=[new Ji("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ji("selection",{init(t,e){return t.selection||xe.atStart(e.doc)},apply(t){return t.selection}}),new Ji("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ji("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class fl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=RT.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ji(r.key,r.spec.state,r))})}}class ri{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&a.spec.appendTransaction.call(a,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 ri(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 PT(this)}static create(e){let n=new fl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ri(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 fl(this.schema,e.plugins),r=n.fields,i=new ri(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 fl(e.schema,e.plugins),o=new ri(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=zn.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 a in r){let c=r[a],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(c,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Uh(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Uh(i,e,{})),n[r]=i}return n}class it{constructor(e){this.spec=e,this.props={},e.props&&Uh(e.props,this,this.props),this.key=e.key?e.key.key:Yh("plugin")}getState(e){return e[this.key]}}const hl=Object.create(null);function Yh(t){return t in hl?t+"$"+ ++hl[t]:(hl[t]=0,t+"$")}class Bt{constructor(e="key"){this.key=Yh(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},Zi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let pl=null;const Sn=function(t,e,n){let r=pl||(pl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},FT=function(){pl=null},vr=function(t,e,n,r){return n&&(qh(t,e,n,r,-1)||qh(t,e,n,r,1))},jT=/^(img|br|input|textarea|hr)$/i;function qh(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||Xi(t)||jT.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 zT(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&&!Xi(t))e=ot(t),t=t.parentNode;else return null}}function HT(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&&!Xi(t))e=ot(t)+1,t=t.parentNode;else return null}}function WT(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 Xi(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 ms=function(t){return t.focusNode&&vr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function wr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function UT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function YT(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,Kh=typeof document<"u"?document:null,qn=cn&&cn.userAgent||"",ml=/Edge\/(\d+)/.exec(qn),Gh=/MSIE \d/.exec(qn),gl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qn),_t=!!(Gh||gl||ml),Kn=Gh?document.documentMode:gl?+gl[1]:ml?+ml[1]:0,en=!_t&&/gecko\/(\d+)/i.test(qn);en&&+(/Firefox\/(\d+)/.exec(qn)||[0,0])[1];const yl=!_t&&/Chrome\/(\d+)/.exec(qn),ut=!!yl,Jh=yl?+yl[1]:0,yt=!_t&&!!cn&&/Apple Computer/.test(cn.vendor),ii=yt&&(/Mobile\/\w+/.test(qn)||!!cn&&cn.maxTouchPoints>2),zt=ii||(cn?/Mac/.test(cn.platform):!1),qT=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(qn),Qi=!!Kh&&"webkitFontSmoothing"in Kh.documentElement.style,KT=Qi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function GT(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 On(t,e){return typeof t=="number"?t:t[e]}function JT(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 Zh(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=Zi(s)){if(s.nodeType!=1)continue;let a=s,c=a==o.body,d=c?GT(o):JT(a),u=0,f=0;if(e.top<d.top+On(r,"top")?f=-(d.top-e.top+On(i,"top")):e.bottom>d.bottom-On(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+On(i,"top")-d.top:e.bottom-d.bottom+On(i,"bottom")),e.left<d.left+On(r,"left")?u=-(d.left-e.left+On(i,"left")):e.right>d.right-On(r,"right")&&(u=e.right-d.right+On(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ZT(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){r=a,i=c.top;break}}return{refDOM:r,refTop:i,stack:Xh(t.dom)}}function Xh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zi(r));return e}function XT({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Qh(n,r==0?0:r-e)}function Qh(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 oi=null;function QT(t){if(t.setActive)return t.setActive();if(oi)return t.focus(oi);let e=Xh(t);t.focus(oi==null?{get preventScroll(){return oi={preventScroll:!0},!0}}:void 0),oi||(oi=!1,Qh(e,0))}function ep(t,e){let n,r=2e8,i,o=0,s=e.top,a=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=Sn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!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?e5(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:ep(n,i)}function e5(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=Gn(r,1);if(o.top!=o.bottom&&bl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function bl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function t5(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function n5(t,e,n){let{node:r,offset:i}=ep(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 r5(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&(!s&&c.left>r.left||c.top>r.top?i=a.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function tp(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(bl(e,d))return tp(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function i5(t,e){let n=t.dom.ownerDocument,r,i=0,o=YT(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!bl(e,d)||(s=tp(t.dom,e,d),!s))return null}if(yt)for(let d=s;r&&d;d=Zi(d))d.draggable&&(r=void 0);if(s=t5(s,e),r){if(en&&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;Qi&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=r5(t,r,i,e))}a==null&&(a=n5(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function np(t){return t.top<t.bottom||t.left<t.right}function Gn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(np(r))return r}return Array.prototype.find.call(n,np)||t.getBoundingClientRect()}const o5=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function rp(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Qi||en;if(r.nodeType==3)if(s&&(o5.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Gn(Sn(r,i,i),n);if(en&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Gn(Sn(r,i-1,i-1),-1);if(d.top==c.top){let u=Gn(Sn(r,i,i+1),-1);if(u.top!=c.top)return eo(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++,eo(Gn(Sn(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 kl(c.getBoundingClientRect(),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];if(c.nodeType==1)return kl(c.getBoundingClientRect(),!0)}return kl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Sn(c,jt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return eo(Gn(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?Sn(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return eo(Gn(d,-1),!0)}return eo(Gn(r.nodeType==3?Sn(r):r,-n),n>=0)}function eo(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 kl(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 ip(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 s5(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return ip(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=rp(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=Sn(a,0,a.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 a5=/[\u0590-\u08ac]/;function l5(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!a5.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:ip(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{a.collapse(u,f),c&&(c!=u||d!=f)&&a.extend&&a.extend(c,d)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let op=null,sp=null,ap=!1;function c5(t,e,n){return op==e&&sp==n?ap:(op=e,sp=n,ap=n=="up"||n=="down"?s5(t,e,n):l5(t,e,n))}const Ht=0,lp=1,xr=2,dn=3;class to{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ht,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 a=i.children[s];if(a.size){i=a;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],a=o+s.size;if(a>e||s instanceof up){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof cp&&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,a=0;;a++){let c=this.children[a],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=a;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||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=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 a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((en||yt)&&e==n){let{node:p,offset:m}=a;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"&&(a=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(en&&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&&yt)&&vr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&vr(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(a.node,a.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=a;a=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(a.node,a.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 a=r+o.border,c=s-o.border;if(e>=a&&n<=c){this.dirty=e==r||n==s?xr:lp,e==a&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=dn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?xr:dn}r=s}this.dirty=xr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?xr:lp;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class cp extends to{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ht&&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 d5 extends to{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 Er extends to{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=kr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Er(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!=Ht){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ht}}slice(e,n,r){let i=Er.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=wl(o,n,s,r)),e>0&&(o=wl(o,0,e,r));for(let a=0;a<o.length;a++)o[a].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 Jn extends to{constructor(e,n,r,i,o,s,a,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],c,d=a&&a(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}=kr.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=pp(u,r,n),d?c=new u5(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new gs(e,n,r,i,u,h,o):new Jn(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>G.empty)}return e}matchesNode(e,n,r){return this.dirty==Ht&&e.eq(this.node)&&ys(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,c=new h5(this,s&&s.node,e);g5(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?Be.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)||a&&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==xr)&&(s&&this.protectLocalComposition(e,s),fp(this.contentDOM,this.children,e),ii&&y5(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,a=b5(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new d5(this,o,n,i);e.input.compositionNodes.push(s),this.children=wl(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=Ht}updateOuterDeco(e){if(ys(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=hp(this.dom,this.nodeDOM,vl(this.outerDeco,this.node,n),vl(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 dp(t,e,n,r,i){pp(r,e,t);let o=new Jn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class gs extends Jn{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==dn||this.dirty!=Ht&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ht||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=Ht,!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 gs(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 up extends to{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ht&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class u5 extends Jn{constructor(e,n,r,i,o,s,a,c,d,u){super(e,n,r,i,o,s,a,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 fp(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=mp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof Er){let c=r?r.previousSibling:t.lastChild;fp(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=mp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const no=function(t){t&&(this.nodeName=t)};no.prototype=Object.create(null);const Cr=[new no];function vl(t,e,n){if(t.length==0)return Cr;let r=n?Cr[0]:new no,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new no(s.nodeName));for(let a in s){let c=s[a];c!=null&&(n&&i.length==1&&i.push(r=new no(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return i}function hp(t,e,n,r){if(n==Cr&&r==Cr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let c;a&&a.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),a=Cr[0]),i=c}f5(i,a||Cr[0],s)}return i}function f5(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 pp(t,e,n){return hp(t,t,Cr,vl(e,n,t.nodeType!=1))}function ys(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 mp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class h5{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=p5(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=Ht,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let 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)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=Er.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 a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==dn&&s.dom==s.contentDOM&&(s.dirty=xr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof Jn){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&&ys(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,a),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,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=xr,f.updateChildren(i,s+1),f.dirty=Ht),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)||!ys(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Jn.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=Jn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new cp(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 Er;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof gs)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((yt||ut)&&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 up(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 p5(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof Er)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function m5(t,e){return t.type.side-e.type.side}function g5(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,a=[],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(m5);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<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let k=0;k<a.length;k++)a[k].to<y&&(y=a[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?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(o,h),p),o=m}}function y5(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 b5(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let 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-a,r-a)==e)return r-e.length;let d=a<r?c.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function wl(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let c=t[s],d=a,u=a+=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 xl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,d;if(ms(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&&WT(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(s==h?a: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],a=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<a.pos&&!o?1:-1;d=Cl(t,u,a,f)}return d}function gp(t){return t.editable?t.hasFocus():Ep(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tn(t,e=!1){let n=t.state.selection;if(vp(t,n),!!gp(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ut){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&vr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)v5(t);else{let{anchor:r,head:i}=n,o,s;yp&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=bp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=bp(t,n.to))),t.docView.setSelection(r,i,t,e),yp&&(o&&kp(o),s&&kp(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&k5(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const yp=yt||ut&&Jh<63;function bp(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(yt&&i&&i.contentEditable=="false")return El(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return El(i);if(o)return El(o)}}function El(t){return t.contentEditable="true",yt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function kp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function k5(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(()=>{(!gp(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function v5(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&&Kn<=11&&(r.disabled=!0,r.disabled=!1)}function vp(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(wp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else wp(t)}function wp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Cl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}function xp(t){return t.editable&&!t.hasFocus()?!1:Ep(t)}function Ep(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 w5(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sl(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 Zn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Cp(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 Zn(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Sl(t.state,e);return i&&i instanceof pe?Zn(t,i):!1}else if(!(zt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?pe.isSelectable(o)?Zn(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Qi?Zn(t,new ke(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return Zn(t,new ke(e>0?r.$to:r.$from));{let i=Sl(t.state,e);return i?Zn(t,i):!1}}}function bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ro(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function si(t,e){return e<0?x5(t):E5(t)}function x5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(en&&n.nodeType==1&&r<bs(n)&&ro(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ro(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Sp(n))break;{let a=n.previousSibling;for(;a&&ro(a,-1);)i=n.parentNode,o=ot(a),a=a.previousSibling;if(a)n=a,r=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?_l(t,n,r):i&&_l(t,i,o)}function E5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=bs(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(ro(a,1))o=n,s=++r;else break}else{if(Sp(n))break;{let a=n.nextSibling;for(;a&&ro(a,1);)o=a.parentNode,s=ot(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&_l(t,o,s)}function Sp(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function C5(t,e){for(;t&&e==t.childNodes.length&&!Xi(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 S5(t,e){for(;t&&!e&&!Xi(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 _l(t,e,n){if(e.nodeType!=3){let o,s;(s=C5(e,n))?(e=s,n=0):(o=S5(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ms(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&&Tn(t)},50)}function _p(t,e){let n=t.state.doc.resolve(e);if(!(ut||qT)&&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 Op(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||zt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sl(t.state,e);if(s&&s instanceof pe)return Zn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Lt?xe.near(s,e):xe.findFrom(s,e);return a?Zn(t,a):!1}return!1}function Tp(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 Np(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function _5(t){if(!yt||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;Np(t,r,"true"),setTimeout(()=>Np(t,r,"false"),20)}return!1}function O5(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function T5(t,e){let n=e.keyCode,r=O5(e);if(n==8||zt&&n==72&&r=="c")return Tp(t,-1)||si(t,-1);if(n==46&&!e.shiftKey||zt&&n==68&&r=="c")return Tp(t,1)||si(t,1);if(n==13||n==27)return!0;if(n==37||zt&&n==66&&r=="c"){let i=n==37?_p(t,t.state.selection.from)=="ltr"?-1:1:-1;return Cp(t,i,r)||si(t,i)}else if(n==39||zt&&n==70&&r=="c"){let i=n==39?_p(t,t.state.selection.from)=="ltr"?1:-1:1;return Cp(t,i,r)||si(t,i)}else{if(n==38||zt&&n==80&&r=="c")return Op(t,-1,r)||si(t,-1);if(n==40||zt&&n==78&&r=="c")return _5(t)||Op(t,1,r)||si(t,1);if(r==(zt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ol(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")||kr.fromSchema(t.state.schema),a=Vp(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Bp[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.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
|
+
|
|
34
|
+
`);return{dom:c,text:h,slice:e}}function Mp(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;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 ne(G.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
35
|
+
`))),0,0):ne.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=kr.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=D5(n),Qi&&$5(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Hn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!N5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=L5(Lp(a,+u[1],+u[2]),u[4]);else if(a=ne.maxOpen(M5(a.content,i),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=Lp(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const N5=/^(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 M5(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let c=i.findWrapping(a.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Dp(c,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=$p(s[s.length-1],o.length));let u=Ap(a,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return G.from(s)}return t}function Ap(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,G.from(t));return t}function Dp(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Dp(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(G.from(Ap(n,t,i+1))))}}function $p(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,$p(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(G.empty,!0);return t.copy(n.append(r))}function Tl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Tl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(G.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Lp(t,e,n){return e<t.openStart&&(t=new ne(Tl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ne(Tl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Bp={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 Ip=null;function Vp(){return Ip||(Ip=document.implementation.createHTMLDocument("title"))}let Nl=null;function A5(t){let e=window.trustedTypes;return e?(Nl||(Nl=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Nl.createHTML(t)):t}function D5(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Bp[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=A5(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function $5(t){let e=t.querySelectorAll(ut?"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 L5(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;i=G.from(c.create(r[a+1],i)),o++,s++}return new ne(i,o,s)}const bt={},kt={},B5={touchstart:!0,touchmove:!0};class I5{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 V5(t){for(let e in bt){let n=bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{R5(t,r)&&!Al(t,r)&&(t.editable||!(r.type in kt))&&n(t,r)},B5[e]?{passive:!0}:void 0)}yt&&t.dom.addEventListener("input",()=>null),Ml(t)}function Xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function P5(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 Ml(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Al(t,r))})}function Al(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function R5(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 F5(t,e){!Al(t,e)&&bt[e.type]&&(t.editable||!(e.type in kt))&&bt[e.type](t,e)}kt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Rp(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_n&&ut&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ii&&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,wr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||T5(t,n)?n.preventDefault():Xn(t,"key")},kt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},kt.keypress=(t,e)=>{let n=e;if(Rp(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||zt&&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 ks(t){return{left:t.clientX,top:t.clientY}}function j5(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Dl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ai(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 z5(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(ai(t,new pe(n)),!0):!1}function H5(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 a=s>o.depth?o.nodeAfter:o.node(s);if(pe.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ai(t,pe.create(t.state.doc,i)),!0):!1}function W5(t,e,n,r,i){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?H5(t,n):z5(t,n))}function U5(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Y5(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||q5(t,n,r)}function q5(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ai(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),a=i.before(o);if(s.inlineContent)ai(t,ke.create(r,a+1,a+1+s.content.size));else if(pe.isSelectable(s))ai(t,pe.create(r,a));else continue;return!0}}function $l(t){return vs(t)}const Pp=zt?"metaKey":"ctrlKey";bt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$l(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&j5(n,t.input.lastClick)&&!n[Pp]&&(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(ks(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new K5(t,s,n,!!r)):(o=="doubleClick"?U5:Y5)(t,s.pos,s.inside,n)?n.preventDefault():Xn(t,"pointer"))};class K5{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[Pp],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,c=a?e.docView.nearestDesc(a,!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&&en&&!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)),Xn(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(()=>Tn(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(ks(e))),this.updateAllowDefault(e),this.allowDefault||!n?Xn(this.view,"pointer"):W5(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||yt&&this.mightDrag&&!this.mightDrag.node.isAtom||ut&&!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)?(ai(this.view,xe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Xn(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)}}bt.touchstart=t=>{t.input.lastTouch=Date.now(),$l(t),Xn(t,"pointer")},bt.touchmove=t=>{t.input.lastTouch=Date.now(),Xn(t,"pointer")},bt.contextmenu=t=>$l(t);function Rp(t,e){return t.composing?!0:yt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const G5=_n?5e3:-1;kt.compositionstart=kt.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),en&&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 a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Fp(t,G5)},kt.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++,Fp(t,20))};function Fp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vs(t),e))}function jp(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Z5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function J5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=zT(e.focusNode,e.focusOffset),r=HT(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 Z5(){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(),jp(t),e||t.docView&&t.docView.dirty){let n=xl(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 X5(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 io=_t&&Kn<15||ii&&KT<604;bt.copy=kt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=io?null:n.clipboardData,s=r.content(),{dom:a,text:c}=Ol(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):X5(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Q5(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function eN(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?oo(t,r.value,null,i,e):oo(t,r.textContent,r.innerHTML,i,e)},50)}function oo(t,e,n,r,i){let o=Mp(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||ne.empty)))return!0;if(!o)return!1;let s=Q5(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function zp(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," "):""}kt.paste=(t,e)=>{let n=e;if(t.composing&&!_n)return;let r=io?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&oo(t,zp(r),r.getData("text/html"),i,n)?n.preventDefault():eN(t,n)};class Hp{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Wp=zt?"altKey":"ctrlKey";bt.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(ks(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 a=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=Ol(t,a);(!n.dataTransfer.files.length||!ut||Jh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(io?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",io||n.dataTransfer.setData("text/plain",d),t.dragging=new Hp(u,!n[Wp],s)},bt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},kt.dragover=kt.dragenter=(t,e)=>e.preventDefault(),kt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ks(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=Mp(t,zp(n.dataTransfer),io?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[Wp]);if(t.someProp("handleDrop",m=>m(t,n,s||ne.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?$h(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){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(Cl(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},bt.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())&&Tn(t)},20))},bt.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)},bt.beforeinput=(t,e)=>{if(ut&&_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,wr(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 kt)bt[t]=kt[t];function so(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 ws{constructor(e,n){this.toDOM=e,this.spec=n||Sr,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 It(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ws&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&so(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Qn{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Qn&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}static is(e){return e.type instanceof Qn}destroy(){}}class Ll{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(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 Ll&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}destroy(){}}class It{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new It(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 It(e,e,new ws(n,r))}static inline(e,n,r,i){return new It(e,n,new Qn(r,i))}static node(e,n,r,i){return new It(e,n,new Ll(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Qn}get widget(){return this.type instanceof ws}}const li=[],Sr={};class Ye{constructor(e,n){this.local=e.length?e:li,this.children=n.length?n:li}static create(e,n){return n.length?xs(n,e,0,Sr):ft}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==ft||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Sr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?tN(this.children,s||[],e,n,r,i,o):s?new Ye(s.sort(_r),li):ft}add(e,n){return n.length?this==ft?Ye.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,c)=>{let d=c+r,u;if(u=Yp(n,a,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(a,u,d+1):i.splice(o,0,c,c+a.nodeSize,xs(u,a,d+1,Sr)),o+=3}});let s=Up(o?qp(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ye(s.length?this.local.concat(s).sort(_r):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&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,a+1);d!=ft?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ye(i,r):ft}forChild(e,n){if(this==ft)return this;if(n.isLeaf)return Ye.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<s&&c.to>o&&c.type instanceof Qn){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 a=new Ye(i.sort(_r),li);return r?new er([a,r]):a}return r||ft}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 Bl(this.localsInner(e))}localsInner(e){if(this==ft)return li;if(e.inlineContent||!this.local.some(Qn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Qn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Bl;const ft=Ye.empty;class er{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Sr));return er.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!=ft&&(o instanceof er?r=r.concat(o.members):r.push(o))}return er.from(r)}eq(e){if(!(e instanceof er)||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?Bl(r?n:n.sort(_r)):li}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new er(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 tN(t,e,n,r,i,o,s){let a=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let k=0;k<a.length;k+=3){let x=a[k+1];if(x<0||h>x+u-f)continue;let w=a[k]+u-f;p>=w?a[k+1]=h<=w?-2:-1:h>=u&&y&&(a[k]+=y,a[k+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[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=a[d+2].mapInner(n,y,u+1,t[d]+o+1,s);k!=ft?(a[d]=f,a[d+1]=p,a[d+2]=k):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=nN(a,t,e,n,i,o,s),u=xs(d,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ye(e.sort(_r),a)}function Up(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 It(i.from+e,i.to+e,i.type))}return n}function nN(t,e,n,r,i,o,s){function a(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)a(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+o+1);return n}function Yp(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 qp(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function xs(t,e,n,r){let i=[],o=!1;e.forEach((a,c)=>{let d=Yp(t,a,c+n);if(d){o=!0;let u=xs(d,a,n+c+1,r);u!=ft&&i.push(c,c+a.nodeSize,u)}});let s=Up(o?qp(t):t,-n).sort(_r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ye(s,i):ft}function _r(t,e){return t.from-e.from||t.to-e.to}function Bl(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),Kp(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),Kp(e,i,r.copy(o.from,r.to)));break}}}return e}function Kp(t,e,n){for(;e<t.length&&_r(n,t[e])>0;)e++;t.splice(e,0,n)}function Il(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ft&&e.push(r)}),t.cursorWrapper&&e.push(Ye.create(t.state.doc,[t.cursorWrapper.deco])),er.from(e)}const rN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iN=_t&&Kn<=11;class oN{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 sN{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oN,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&&Kn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),iN&&(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,rN)),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(xp(this.view)){if(this.suppressingSelectionUpdates)return Tn(this.view);if(_t&&Kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vr(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=Zi(o))n.add(o);for(let o=e.anchorNode;o;o=Zi(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)&&xp(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!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&&(a=!0))}if(en&&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||cN(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&&ms(r)&&(d=xl(e))&&d.eq(xe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),aN(e)),this.handleDOMChange(o,s,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tn(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&&Kn<=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,a=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:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Gp=new WeakMap,Jp=!1;function aN(t){if(!Gp.has(t)&&(Gp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=en,Jp)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."),Jp=!0}}function Zp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return vr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function lN(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Zp(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?Zp(t,n):null}function cN(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 dN(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=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}],ms(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ut&&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")||Hn.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:uN,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:a}}function uN(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(yt&&/^(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||yt&&/^(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 fN=/^(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 hN(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,$=xl(t,O);if($&&!t.state.selection.eq($)){if(ut&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",B=>B(t,wr(13,"Enter"))))return;let V=t.state.tr.setSelection($);O=="pointer"?V.setMeta("pointer",!0):O=="key"&&V.scrollIntoView(),o&&V.setMeta("composition",o),t.dispatch(V)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,d=dN(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=gN(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(ii&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(O=>O.nodeType==1&&!fN.test(O.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",O=>O(t,wr(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 O=Xp(t,t.state.doc,d.sel);if(O&&!O.eq(t.state.selection)){let $=t.state.tr.setSelection(O);o&&$.setMeta("composition",o),t.dispatch($)}}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&&Kn<=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((ii&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(O=>O.nodeName=="DIV"||O.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",O=>O(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&mN(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",O=>O(t,wr(8,"Backspace")))){_n&&ut&&t.domObserver.suppressSelectionUpdates();return}ut&&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(O){return O(t,wr(13,"Enter"))})},20));let b=m.start,C=m.endA,v,S,D;if(x){if(g.pos==y.pos)_t&&Kn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),v=t.state.tr.delete(b,C),S=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(D=pN(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))v=t.state.tr,D.type=="add"?v.addMark(b,C,D.mark):v.removeMark(b,C,D.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",$=>$(t,b,C,O)))return;v=t.state.tr.insertText(O,b,C)}}if(v||(v=t.state.tr.replace(b,C,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let O=Xp(t,v.doc,d.sel);O&&!(ut&&t.composing&&O.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==b||O.head==v.mapping.map(C)-1)||_t&&O.empty&&O.head==b)&&v.setSelection(O)}S&&v.ensureMarks(S),o&&v.setMeta("composition",o),t.dispatch(v.scrollIntoView())}function Xp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Cl(t,e.resolve(n.anchor),e.resolve(n.head))}function pN(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,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)a=i[0],s="add",c=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",c=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(G.from(d).eq(t))return{mark:a,type:s}}function mN(t,e,n,r,i){if(n-e<=i.pos-r.pos||Vl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Vl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Vl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Vl(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 gN(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,a));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&&Qp(e.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-s),s=o}else if(a<o){let c=r<=o&&r>=a?o-r:0;o-=c,o&&o<t.size&&Qp(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function Qp(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 yN{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 I5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(im),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=nm(this),tm(this),this.nodeViews=rm(this),this.docView=dp(this.state.doc,em(this),Il(this),this.dom,this),this.domObserver=new sN(this,(r,i,o,s)=>hN(this,r,i,o,s)),this.domObserver.start(),V5(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&&Ml(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(im),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&&(jp(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=rm(this);kN(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ml(this),this.editable=nm(this),tm(this);let c=Il(this),d=em(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&&ZT(this);if(s){this.domObserver.stop();let p=f&&(_t||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&bN(i.selection,e.selection);if(f){let m=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=J5(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=dp(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&w5(this))?Tn(this,p):(vp(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&&XT(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&&Zh(this,n.getBoundingClientRect(),e)}else Zh(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 Hp(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 a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(_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&&QT(this.dom),Tn(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 i5(this,e)}coordsAtPos(e,n=1){return rp(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 c5(this,n||this.state,e)}pasteHTML(e,n){return oo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return oo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ol(this,e)}destroy(){this.docView&&(P5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Il(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,FT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return F5(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?yt&&this.root.nodeType===11&&UT(this.dom.ownerDocument)==this.dom&&lN(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function em(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"),[It.node(0,t.state.doc.content.size,e)]}function tm(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:It.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function nm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function bN(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 rm(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 kN(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 im(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 tr={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:"'"},Es={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vN=typeof navigator<"u"&&/Mac/.test(navigator.platform),wN=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),st=0;st<10;st++)tr[48+st]=tr[96+st]=String(st);for(var st=1;st<=24;st++)tr[st+111]="F"+st;for(var st=65;st<=90;st++)tr[st]=String.fromCharCode(st+32),Es[st]=String.fromCharCode(st);for(var Pl in tr)Es.hasOwnProperty(Pl)||(Es[Pl]=tr[Pl]);function xN(t){var e=vN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||wN&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Es:tr)[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 EN=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function CN(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let c=e[a];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))EN?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 SN(t){let e=Object.create(null);for(let n in t)e[CN(n)]=t[n];return e}function Rl(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 _N(t){return new it({props:{handleKeyDown:om(t)}})}function om(t){let e=SN(t);return function(n,r){let i=xN(r),o,s=e[Rl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Rl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=tr[r.keyCode])&&o!=i){let a=e[Rl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Fl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function sm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const am=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);if(!i){let s=r.blockRange(),a=s&&Qr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(gm(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ci(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let a=hs(t.doc,r.before(s),r.after(s),ne.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(ci(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},ON=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);return i?lm(t,i,e):!1},TN=(t,e,n)=>{let r=dm(t,n);if(!r)return!1;let i=zl(r);return i?lm(t,i,e):!1};function lm(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=hs(t.doc,o,c,ne.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 ci(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 cm=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=jl(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function jl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function dm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const um=(t,e,n)=>{let r=dm(t,n);if(!r)return!1;let i=zl(r);if(!i)return!1;let o=i.nodeAfter;if(gm(t,i,e,1))return!0;if(r.parent.content.size==0&&(ci(o,"start")||pe.isSelectable(o))){let s=hs(t.doc,r.before(),r.after(),ne.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(ci(o,"start")?xe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):pe.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},fm=(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=zl(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 zl(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 NN=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Yn(t.doc,n.from))return!1;i=n.from}else if(i=fs(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},MN=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Yn(t.doc,n.to))return!1;r=n.to}else if(r=fs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},AN=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Qr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},hm=(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 Hl(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 DN=(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=Hl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),c=t.tr.replaceWith(a,a,s.createAndFill());c.setSelection(xe.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},pm=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Lt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Hl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(ke.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},mm=(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(Cn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function $N(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Cn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,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),a=Hl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ke||e.selection instanceof Lt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Cn(u.doc,f,o.length,o);if(h||(o[0]=a?{type:a}:null,h=Cn(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const LN=$N(),BN=(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 IN(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||Yn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function gm(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&IN(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=G.empty;for(let k=s.length-1;k>=0;k--)m=G.from(s[k].create(null,m));m=G.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new ne(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Yn(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&&Qr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&ci(o,"start",!0)&&ci(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=G.empty;for(let w=m.length-1;w>=0;w--)k=G.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 ne(k,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function ym(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 VN=ym(-1),PN=ym(1);function RN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&al(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function bm(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(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:a},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(a,c,t,e)}r(o.scrollIntoView())}return!0}}function Wl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Wl(Fl,am,cm),Wl(Fl,um,fm),Wl(hm,pm,mm,LN),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function FN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return jN(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function jN(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 is(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new is(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=al(o,n,r,e);return a?(t&&zN(t,e,a,i,n),!0):!1}function zN(t,e,n,r,i){let o=G.empty;for(let u=n.length-1;u>=0;u--)o=G.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 ne(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,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&&Cn(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=d.child(u).nodeSize;return t}function HN(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?WN(e,n,t,o):UN(e,n,o):!0:!1}}function WN(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 ne(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new is(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Qr(r);if(a==null)return!1;i.lift(r,a);let c=i.mapping.map(o,-1)-1;return Yn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function UN(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(c?G.empty:G.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Xe(f-(a?1:0),h+(c?1:0),f+1,h-1,new ne((a?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function YN(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,c=a.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==a.type,u=G.from(d?t.create():null),f=new ne(G.from(t.create(null,G.from(a.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 Cs(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 Ss{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...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,a=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),k=p(...g)(y);return a.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,a={tr:e,editor:i,view:s,state:Cs({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)(a)]))}};return a}}class qN{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 ae(t,e,n){return t.config[e]===void 0&&t.parent?ae(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ae(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 km(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},c=ae(s,"addGlobalAttributes",a);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 a={name:s.name,options:s.options,storage:s.storage},c=ae(s,"addAttributes",a);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 a=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=a.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const a=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)}),a.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 Ul(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 vm(t){return typeof t=="function"}function Ce(t,e=void 0,...n){return vm(t)?e?t.bind(e)(...n):t(...n):t}function KN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GN(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function wm(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 a=s.attribute.parseHTML?s.attribute.parseHTML(n):GN(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function xm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&KN(n)?!1:n!=null))}function JN(t,e){var n;const r=km(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>ae(d,"topNode")))===null||n===void 0?void 0:n.name,a=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=ae(x,"extendNodeSchema",f);return{...k,...w?w(d):{}}},{}),p=xm({...h,content:Ce(ae(d,"content",f)),marks:Ce(ae(d,"marks",f)),group:Ce(ae(d,"group",f)),inline:Ce(ae(d,"inline",f)),atom:Ce(ae(d,"atom",f)),selectable:Ce(ae(d,"selectable",f)),draggable:Ce(ae(d,"draggable",f)),code:Ce(ae(d,"code",f)),whitespace:Ce(ae(d,"whitespace",f)),linebreakReplacement:Ce(ae(d,"linebreakReplacement",f)),defining:Ce(ae(d,"defining",f)),isolating:Ce(ae(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(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>wm(k,u)));const g=ae(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:Ul(k,u)}));const y=ae(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=ae(k,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=xm({...h,inclusive:Ce(ae(d,"inclusive",f)),excludes:Ce(ae(d,"excludes",f)),group:Ce(ae(d,"group",f)),spanning:Ce(ae(d,"spanning",f)),code:Ce(ae(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(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>wm(y,u)));const g=ae(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Ul(y,u)})),[d.name,p]}));return new hh({topNode:s,nodes:a,marks:c})}function Yl(t,e){return e.nodes[t]||e.marks[t]||null}function Em(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function ql(t,e){const n=kr.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const ZN=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{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:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Kl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Os{constructor(e){this.find=e.find,this.handler=e.handler}}const XN=(t,e)=>{if(Kl(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 Ts(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=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=ZN(d)+o;return s.forEach(h=>{if(u)return;const p=XN(f,h.find);if(!p)return;const m=c.state.tr,g=Cs({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:x,can:w}=new Ss({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:w})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function QN(t){const{editor:e,rules:n}=t,r=new it({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=ql(G.from(u),s.schema);const{from:f}=c,h=f+u.length;Ts({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ts({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ts({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?Ts({editor:e,from:s.pos,to:s.pos,text:`
|
|
37
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function eM(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ns(t){return eM(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ms(t,e){const n={...t};return Ns(t)&&Ns(e)&&Object.keys(e).forEach(r=>{Ns(e[r])&&Ns(t[r])?n[r]=Ms(t[r],e[r]):n[r]=e[r]}),n}class Wt{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(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Wt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Wt(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(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(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 tM(t){return typeof t=="number"}class nM{constructor(e){this.find=e.find,this.handler=e.handler}}const rM=(t,e,n)=>{if(Kl(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 iM(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:c,chain:d,can:u}=new Ss({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,"");rM(k,o.find,s).forEach(w=>{if(w.index===void 0)return;const b=g+w.index+1,C=b+w[0].length,v={from:n.tr.mapping.map(b),to:n.tr.mapping.map(C)},S=o.handler({state:n,range:v,match:w,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:a});f.push(S)})}),f.every(p=>p!==null)}let As=null;const oM=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 sM(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Cs({state:u,transaction:g});if(!(!iM({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=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&&(As=e)},p=()=>{As&&(As=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,a=h,!o){const p=As;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:C}=k;typeof C=="string"?C=C:C=ql(G.from(C),p.schema);const{from:v}=k,S=v+C.length,D=oM(C);return c({rule:u,state:p,from:v,to:{b:S},pasteEvt:D})}const w=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!tM(w)||!b||w===b.b))return c({rule:u,state:p,from:w,to:b,pasteEvt:s})}}))}function aM(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class di{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=di.resolve(e),this.schema=JN(this.extensions,n),this.setupExtensions()}static resolve(e){const n=di.sort(di.flatten(e)),r=aM(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=ae(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=ae(r,"priority")||100,s=ae(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Yl(n.name,this.schema)},i=ae(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=di.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Yl(s.name,this.schema)},c=[],d=ae(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&ae(s,"exitable",a)&&(u.ArrowRight=()=>Wt.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=_N(u);c.push(f);const h=ae(s,"addInputRules",a);Em(s,e.options.enableInputRules)&&h&&r.push(...h());const p=ae(s,"addPasteRules",a);Em(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=ae(s,"addProseMirrorPlugins",a);if(m){const g=m();c.push(...g)}return c}).flat();return[QN({editor:e,rules:r}),...sM({editor:e,rules:i}),...o]}get attributes(){return km(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_s(this.extensions);return Object.fromEntries(n.filter(r=>!!ae(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=ae(r,"addNodeView",o);if(!s)return[];const a=(c,d,u,f,h)=>{const p=Ul(c,i);return s()({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:e,extension:r,HTMLAttributes:p})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Yl(e.name,this.schema)};e.type==="mark"&&(!((n=Ce(ae(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ae(e,"onBeforeCreate",r),o=ae(e,"onCreate",r),s=ae(e,"onUpdate",r),a=ae(e,"onSelectionUpdate",r),c=ae(e,"onTransaction",r),d=ae(e,"onFocus",r),u=ae(e,"onBlur",r),f=ae(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),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(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(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(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(n,"addStorage",{name:n.name,options:n.options})),n}}function Cm(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
38
|
+
|
|
39
|
+
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(a+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(a+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),a}function Sm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const lM=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new it({key:new Bt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),c=Sm(n);return Cm(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),cM=()=>({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),dM=(t=!1)=>({commands:e})=>e.setContent("",t),uM=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Qr(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},fM=t=>e=>t(e),hM=()=>({state:t,dispatch:e})=>pm(t,e),pM=(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},mM=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),c=i.after(o);t.delete(a,c).scrollIntoView()}return!0}return!1},gM=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},yM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},bM=()=>({state:t,dispatch:e})=>Fl(t,e),kM=()=>({commands:t})=>t.keyboardShortcut("Enter"),vM=()=>({state:t,dispatch:e})=>DN(t,e);function Ds(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Kl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _m(t,e,n={}){return t.find(r=>r.type===e&&Ds(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Om(t,e,n={}){return!!_m(t,e,n)}function Gl(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),!_m([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,c=s+1,d=a+i.node.nodeSize;for(;s>0&&Om([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&Om([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:a,to:d}}function nr(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 wM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=nr(t,r.schema),{doc:s,selection:a}=n,{$from:c,from:d,to:u}=a;if(i){const f=Gl(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},xM=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Jl(t){return t instanceof ke}function Nn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Tm(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,Nn(0,i,o),Nn(t.content.size,i,o)):ke.create(t,Nn(e,i,o),Nn(e,i,o))}function EM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Zl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const CM=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Zl()||EM())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Jl(n.state.selection))return s(),!0;const a=Tm(i.doc,t)||n.state.selection,c=n.state.selection.eq(a);return o&&(c||i.setSelection(a),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},SM=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),_M=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Nm=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&&Nm(r)}return t};function $s(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Nm(n)}function Ls(t,e,n){if(t instanceof zn||t instanceof G)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 G.fromArray(t.map(a=>e.nodeFromJSON(a)));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),Ls("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const c=new hh({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,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Hn.fromSchema(c).parseSlice($s(t),n.parseOptions):Hn.fromSchema(c).parse($s(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Hn.fromSchema(e);return n.slice?o.parseSlice($s(t),n.parseOptions).content:o.parse($s(t),n.parseOptions)}return Ls("",e,n)}function OM(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((a,c,d,u)=>{s===0&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const TM=t=>!("type"in t),NM=(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 a;try{a=Ls(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((TM(a)?a:[a]).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 G){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=a,r.replaceWith(c,d,p);n.updateSelection&&OM(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},MM=()=>({state:t,dispatch:e})=>NN(t,e),AM=()=>({state:t,dispatch:e})=>MN(t,e),DM=()=>({state:t,dispatch:e})=>am(t,e),$M=()=>({state:t,dispatch:e})=>um(t,e),LM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},BM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},IM=()=>({state:t,dispatch:e})=>ON(t,e),VM=()=>({state:t,dispatch:e})=>TN(t,e);function Mm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function PM(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const c=e[a];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))Zl()||Mm()?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 RM=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=PM(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ao(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Qe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const c=i-r,d=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Ds(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const FM=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?AN(n,r):!1},jM=()=>({state:t,dispatch:e})=>mm(t,e),zM=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return HN(r)(e,n)},HM=()=>({state:t,dispatch:e})=>hm(t,e);function Bs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Am(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 WM=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(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,Am(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Am(f.attrs,e)))})})}),!0):!1},UM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),YM=()=>({tr:t,dispatch:e})=>{if(e){const n=new Lt(t.doc);t.setSelection(n)}return!0},qM=()=>({state:t,dispatch:e})=>cm(t,e),KM=()=>({state:t,dispatch:e})=>fm(t,e),GM=()=>({state:t,dispatch:e})=>BN(t,e),JM=()=>({state:t,dispatch:e})=>PN(t,e),ZM=()=>({state:t,dispatch:e})=>VN(t,e);function Xl(t,e,n={},r={}){return Ls(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const XM=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Xl(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),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Is(t,e){const n=nr(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 a=s.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function QM(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 eA(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 Ql(t){return e=>eA(e.$from,t)}function tA(t,e){const n={from:0,to:t.content.size};return Cm(t,n,e)}function nA(t,e){const n=Qe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function rA(t,e){const n=Bs(typeof e=="string"?e:e.name,t.schema);return n==="node"?nA(t,e):n==="mark"?Is(t,e):{}}function Dm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Gl(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 Vs(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 ec(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?nr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ds(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(p,y),x=Math.min(m,y+g.nodeSize),w=x-k;s+=w,a.push(...g.marks.map(b=>({mark:b,from:k,to:x})))})}),s===0)return!1;const c=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ds(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function iA(t,e,n={}){if(!e)return ao(t,null,n)||ec(t,null,n);const r=Bs(e,t.schema);return r==="node"?ao(t,e,n):r==="mark"?ec(t,e,n):!1}function $m(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(ae(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function tc(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&&(tc(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function oA(t){return t instanceof pe}function Lm(t,e,n){const i=t.state.doc.content.size,o=Nn(e,0,i),s=Nn(n,0,i),a=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),f=Math.min(a.left,c.left),h=Math.max(a.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 sA(t,e,n){var r;const{selection:i}=e;let o=null;if(Jl(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:c})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.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 aA=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,c=nr(t,r.schema);if(i)if(s){const d=Is(r,c);n.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(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 sA(r,n,c)},lA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),cA=(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:a})=>bm(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>bm(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},dA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Nn(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},uA=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,a=ke.atEnd(r).to,c=Nn(i,s,a),d=Nn(o,s,a),u=ke.create(r,c,d);e.setSelection(u)}return!0},fA=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return YN(r)(e,n)};function Bm(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 hA=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:c}=o,d=i.extensionManager.attributes,u=Vs(d,a.node().type.name,a.node().attrs);if(o instanceof pe&&o.node.isBlock)return!a.parentOffset||!Cn(s,a.pos)?!1:(r&&(t&&Bm(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=a.depth===0?void 0:QM(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Cn(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Cn(e.doc,e.mapping.map(a.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(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Bm(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},pA=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=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!==a)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!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let k=G.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let D=c.depth-x;D>=c.depth-3;D-=1)k=G.from(c.node(D).copy(k));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Vs(h,c.node().type.name,c.node().attrs),...e},C=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;k=k.append(G.from(a.createAndFill(null,C)||void 0));const v=c.before(c.depth-(x-1));n.replace(v,c.after(-w),new ne(k,4-x,0));let S=-1;n.doc.nodesBetween(v,n.doc.content.size,(D,O)=>{if(S>-1)return!1;D.isTextblock&&D.content.size===0&&(S=O+1)}),S>-1&&n.setSelection(ke.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Vs(h,f.type.name,f.attrs),...e},g={...Vs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const y=p?[{type:a,attrs:m},{type:p,attrs:g}]:[{type:a,attrs:m}];if(!Cn(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 C=b.filter(v=>w.includes(v.type.name));n.ensureMarks(C)}return!0},nc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,n.pos)&&t.join(n.pos),!0},rc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,r)&&t.join(r),!0};var mA=Object.freeze({__proto__:null,blur:cM,clearContent:dM,clearNodes:uM,command:fM,createParagraphNear:hM,cut:pM,deleteCurrentNode:mM,deleteNode:gM,deleteRange:yM,deleteSelection:bM,enter:kM,exitCode:vM,extendMarkRange:wM,first:xM,focus:CM,forEach:SM,insertContent:_M,insertContentAt:NM,joinBackward:DM,joinDown:AM,joinForward:$M,joinItemBackward:LM,joinItemForward:BM,joinTextblockBackward:IM,joinTextblockForward:VM,joinUp:MM,keyboardShortcut:RM,lift:FM,liftEmptyBlock:jM,liftListItem:zM,newlineInCode:HM,resetAttributes:WM,scrollIntoView:UM,selectAll:YM,selectNodeBackward:qM,selectNodeForward:KM,selectParentNode:GM,selectTextblockEnd:JM,selectTextblockStart:ZM,setContent:XM,setMark:aA,setMeta:lA,setNode:cA,setNodeSelection:dA,setTextSelection:uA,sinkListItem:fA,splitBlock:hA,splitListItem:pA,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,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 C=Ql(v=>$m(v.type.name,f))(g);if(w.depth>=1&&C&&w.depth-C.depth<=1){if(C.node.type===p)return d.liftListItem(m);if($m(C.node.type.name,f)&&p.validContent(C.node.content)&&a)return c().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>nc(o,p)).command(()=>rc(o,p)).run()}return!n||!b||!a?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run():c().command(()=>{const v=u().wrapInList(p,r),S=b.filter(D=>h.includes(D.type.name));return o.ensureMarks(S),v?!0:d.clearNodes()}).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=nr(t,r.schema);return ec(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),a=ao(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let c=a.steps.length-1;c>=0;c-=1)s.step(a.steps[c].invert(a.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:a}=n,c=nr(t,r.schema),{$from:d,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:h,to:p}=a;const m=(o=d.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=Gl(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 a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(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 RN(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return FN(i,e)(n,r)}});const gA=qe.create({name:"commands",addCommands(){return{...mA}}}),yA=qe.create({name:"drop",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),bA=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new Bt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kA=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new it({key:new Bt("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}}}})]}}),vA=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,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 Zl()||Mm()?o:i},addProseMirrorPlugins(){return[new it({key:new Bt("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:a}=e.selection,c=xe.atStart(e.doc).from,d=xe.atEnd(e.doc).to;if(o||!(s===c&&a===d)||!tc(n.doc))return;const h=n.tr,p=Cs({state:n,transaction:h}),{commands:m}=new Ss({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),wA=qe.create({name:"paste",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xA=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new it({key:new Bt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Or{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 Or(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 Or(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 Or(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),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const c=new Or(a,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Or(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const c=s[a];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 EA=`.ProseMirror {
|
|
18
40
|
position: relative;
|
|
19
41
|
}
|
|
20
42
|
|
|
@@ -88,36 +110,36 @@ img.ProseMirror-separator {
|
|
|
88
110
|
|
|
89
111
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
90
112
|
opacity: 0
|
|
91
|
-
}`;function
|
|
113
|
+
}`;function CA(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 SA=class extends qN{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=CA(EA,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=vm(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(a=>!a.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?[bA,lM.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),gA,kA,vA,xA,yA,wA].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 di(i,this)}createCommandManager(){this.commandManager=new Ss({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Xl(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(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Xl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Tm(n,this.options.autofocus);this.view=new yN(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:ri.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 a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.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 rA(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return iA(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ql(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
92
114
|
|
|
93
|
-
`,textSerializers:r={}}=e||{};return p3(this.state.doc,{blockSeparator:n,textSerializers:{...If(this.schema),...r}})}get isEmpty(){return Nl(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Rn(n,this)}get $doc(){return this.$pos(0)}};function kr(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=n.from+l.indexOf(s),u=d+s.length;if(Wf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Yf(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=fe(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,c)}else if(r[0]){const d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function Vl(t){return new vo({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=fe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function mi(t){return new vo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=fe(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&Ls(c,t.type,o);if(!d)return null;if(s.wrap(c,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&rn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ge=class da{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=fe(te(this,"addOptions",{name:this.name}))),this.storage=fe(te(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new da(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Eo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new da(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=fe(te(n,"addOptions",{name:n.name})),n.storage=fe(te(n,"addStorage",{name:n.name,options:n.options})),n}};function xr(t){return new mE({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=fe(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=n.to;if(l){const u=c.search(/\S/),f=n.from+c.indexOf(l),h=f+l.length;if(Wf(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+l.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Ze="top",ut="bottom",ft="right",Xe="left",Dl="auto",gi=[Ze,ut,ft,Xe],wr="start",yi="end",R3="clippingParents",Jf="viewport",bi="popper",z3="reference",Gf=gi.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+yi])},[]),Zf=[].concat(gi,[Dl]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+yi])},[]),j3="beforeRead",F3="read",H3="afterRead",W3="beforeMain",U3="main",q3="afterMain",K3="beforeWrite",Y3="write",J3="afterWrite",G3=[j3,F3,H3,W3,U3,q3,K3,Y3,J3];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function it(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function zn(t){var e=it(t).Element;return t instanceof e||t instanceof Element}function ht(t){var e=it(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _l(t){if(typeof ShadowRoot>"u")return!1;var e=it(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Z3(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!ht(o)||!$t(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function X3(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,d){return c[d]="",c},{});!ht(i)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Xf={name:"applyStyles",enabled:!0,phase:"write",fn:Z3,effect:X3,requires:["computeStyles"]};function Nt(t){return t.split("-")[0]}var jn=Math.max,Vo=Math.min,vr=Math.round;function Ll(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qf(){return!/^((?!chrome|android).)*safari/i.test(Ll())}function Cr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&ht(t)&&(i=t.offsetWidth>0&&vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&vr(r.height)/t.offsetHeight||1);var s=zn(t)?it(t):window,l=s.visualViewport,c=!Qf()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/i,u=(r.top+(c&&l?l.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function Il(t){var e=Cr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function eh(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_l(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wt(t){return it(t).getComputedStyle(t)}function Q3(t){return["table","td","th"].indexOf($t(t))>=0}function mn(t){return((zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Do(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(_l(t)?t.host:null)||mn(t)}function th(t){return!ht(t)||Wt(t).position==="fixed"?null:t.offsetParent}function eO(t){var e=/firefox/i.test(Ll()),n=/Trident/i.test(Ll());if(n&&ht(t)){var r=Wt(t);if(r.position==="fixed")return null}var i=Do(t);for(_l(i)&&(i=i.host);ht(i)&&["html","body"].indexOf($t(i))<0;){var o=Wt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ki(t){for(var e=it(t),n=th(t);n&&Q3(n)&&Wt(n).position==="static";)n=th(n);return n&&($t(n)==="html"||$t(n)==="body"&&Wt(n).position==="static")?e:n||eO(t)||e}function Pl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function xi(t,e,n){return jn(t,Vo(e,n))}function tO(t,e,n){var r=xi(t,e,n);return r>n?n:r}function nh(){return{top:0,right:0,bottom:0,left:0}}function rh(t){return Object.assign({},nh(),t)}function ih(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var nO=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,rh(typeof e!="number"?e:ih(e,gi))};function rO(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Nt(n.placement),c=Pl(l),d=[Xe,ft].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=nO(i.padding,n),h=Il(o),p=c==="y"?Ze:Xe,m=c==="y"?ut:ft,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],b=ki(o),v=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,M=g/2-y/2,k=f[p],O=v-h[u]-f[m],C=v/2-h[u]/2+M,B=xi(k,C,O),I=c;n.modifiersData[r]=(e={},e[I]=B,e.centerOffset=B-C,e)}}function iO(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||eh(e.elements.popper,i)&&(e.elements.arrow=i))}const oO={name:"arrow",enabled:!0,phase:"main",fn:rO,effect:iO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(t){return t.split("-")[1]}var sO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lO(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:vr(n*i)/i||0,y:vr(r*i)/i||0}}function oh(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,g=m===void 0?0:m,y=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),M=Xe,k=Ze,O=window;if(d){var C=ki(n),B="clientHeight",I="clientWidth";if(C===it(n)&&(C=mn(n),Wt(C).position!=="static"&&l==="absolute"&&(B="scrollHeight",I="scrollWidth")),C=C,i===Ze||(i===Xe||i===ft)&&o===yi){k=ut;var _=f&&C===O&&O.visualViewport?O.visualViewport.height:C[B];g-=_-r.height,g*=c?1:-1}if(i===Xe||(i===Ze||i===ut)&&o===yi){M=ft;var T=f&&C===O&&O.visualViewport?O.visualViewport.width:C[I];p-=T-r.width,p*=c?1:-1}}var L=Object.assign({position:l},d&&sO),H=u===!0?lO({x:p,y:g},it(n)):{x:p,y:g};if(p=H.x,g=H.y,c){var Y;return Object.assign({},L,(Y={},Y[k]=v?"0":"",Y[M]=b?"0":"",Y.transform=(O.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",Y))}return Object.assign({},L,(e={},e[k]=v?g+"px":"",e[M]=b?p+"px":"",e.transform="",e))}function aO(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Nt(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,oh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,oh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const cO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:aO,data:{}};var _o={passive:!0};function dO(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,c=it(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,_o)}),l&&c.addEventListener("resize",n.update,_o),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,_o)}),l&&c.removeEventListener("resize",n.update,_o)}}const uO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dO,data:{}};var fO={left:"right",right:"left",bottom:"top",top:"bottom"};function Lo(t){return t.replace(/left|right|bottom|top/g,function(e){return fO[e]})}var hO={start:"end",end:"start"};function sh(t){return t.replace(/start|end/g,function(e){return hO[e]})}function Rl(t){var e=it(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function zl(t){return Cr(mn(t)).left+Rl(t).scrollLeft}function pO(t,e){var n=it(t),r=mn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Qf();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+zl(t),y:c}}function mO(t){var e,n=mn(t),r=Rl(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=jn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=jn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+zl(t),c=-r.scrollTop;return Wt(i||n).direction==="rtl"&&(l+=jn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function jl(t){var e=Wt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function lh(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:ht(t)&&jl(t)?t:lh(Do(t))}function wi(t,e){var n;e===void 0&&(e=[]);var r=lh(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=it(r),s=i?[o].concat(o.visualViewport||[],jl(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wi(Do(s)))}function Fl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gO(t,e){var n=Cr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function ah(t,e,n){return e===Jf?Fl(pO(t,n)):zn(e)?gO(e,n):Fl(mO(mn(t)))}function yO(t){var e=wi(Do(t)),n=["absolute","fixed"].indexOf(Wt(t).position)>=0,r=n&&ht(t)?ki(t):t;return zn(r)?e.filter(function(i){return zn(i)&&eh(i,r)&&$t(i)!=="body"}):[]}function bO(t,e,n,r){var i=e==="clippingParents"?yO(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=ah(t,d,r);return c.top=jn(u.top,c.top),c.right=Vo(u.right,c.right),c.bottom=Vo(u.bottom,c.bottom),c.left=jn(u.left,c.left),c},ah(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ch(t){var e=t.reference,n=t.element,r=t.placement,i=r?Nt(r):null,o=r?Sr(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case Ze:c={x:s,y:e.y-n.height};break;case ut:c={x:s,y:e.y+e.height};break;case ft:c={x:e.x+e.width,y:l};break;case Xe:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?Pl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case wr:c[d]=c[d]-(e[u]/2-n[u]/2);break;case yi:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function vi(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,c=l===void 0?R3:l,d=n.rootBoundary,u=d===void 0?Jf:d,f=n.elementContext,h=f===void 0?bi:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,b=rh(typeof y!="number"?y:ih(y,gi)),v=h===bi?z3:bi,M=t.rects.popper,k=t.elements[m?v:h],O=bO(zn(k)?k:k.contextElement||mn(t.elements.popper),c,u,s),C=Cr(t.elements.reference),B=ch({reference:C,element:M,placement:i}),I=Fl(Object.assign({},M,B)),_=h===bi?I:C,T={top:O.top-_.top+b.top,bottom:_.bottom-O.bottom+b.bottom,left:O.left-_.left+b.left,right:_.right-O.right+b.right},L=t.modifiersData.offset;if(h===bi&&L){var H=L[i];Object.keys(T).forEach(function(Y){var W=[ft,ut].indexOf(Y)>=0?1:-1,N=[Ze,ut].indexOf(Y)>=0?"y":"x";T[Y]+=H[N]*W})}return T}function kO(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Zf:c,u=Sr(r),f=u?l?Gf:Gf.filter(function(m){return Sr(m)===u}):gi,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=vi(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[Nt(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function xO(t){if(Nt(t)===Dl)return[];var e=Lo(t);return[sh(t),e,sh(e)]}function wO(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=e.options.placement,b=Nt(y),v=b===y,M=c||(v||!m?[Lo(y)]:xO(y)),k=[y].concat(M).reduce(function(ee,q){return ee.concat(Nt(q)===Dl?kO(e,{placement:q,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),O=e.rects.reference,C=e.rects.popper,B=new Map,I=!0,_=k[0],T=0;T<k.length;T++){var L=k[T],H=Nt(L),Y=Sr(L)===wr,W=[Ze,ut].indexOf(H)>=0,N=W?"width":"height",x=vi(e,{placement:L,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),A=W?Y?ft:Xe:Y?ut:Ze;O[N]>C[N]&&(A=Lo(A));var V=Lo(A),K=[];if(o&&K.push(x[H]<=0),l&&K.push(x[A]<=0,x[V]<=0),K.every(function(ee){return ee})){_=L,I=!1;break}B.set(L,K)}if(I)for(var Q=m?3:1,$=function(q){var P=k.find(function(X){var he=B.get(X);if(he)return he.slice(0,q).every(function(le){return le})});if(P)return _=P,"break"},F=Q;F>0;F--){var D=$(F);if(D==="break")break}e.placement!==_&&(e.modifiersData[r]._skip=!0,e.placement=_,e.reset=!0)}}const vO={name:"flip",enabled:!0,phase:"main",fn:wO,requiresIfExists:["offset"],data:{_skip:!1}};function dh(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function uh(t){return[Ze,ft,ut,Xe].some(function(e){return t[e]>=0})}function CO(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=vi(e,{elementContext:"reference"}),l=vi(e,{altBoundary:!0}),c=dh(s,r),d=dh(l,i,o),u=uh(c),f=uh(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const SO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:CO};function EO(t,e,n){var r=Nt(t),i=[Xe,Ze].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Xe,ft].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function OO(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Zf.reduce(function(u,f){return u[f]=EO(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 MO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:OO};function TO(t){var e=t.state,n=t.name;e.modifiersData[n]=ch({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const $O={name:"popperOffsets",enabled:!0,phase:"read",fn:TO,data:{}};function NO(t){return t==="x"?"y":"x"}function BO(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=vi(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),b=Nt(e.placement),v=Sr(e.placement),M=!v,k=Pl(b),O=NO(k),C=e.modifiersData.popperOffsets,B=e.rects.reference,I=e.rects.popper,_=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,T=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,H={x:0,y:0};if(C){if(o){var Y,W=k==="y"?Ze:Xe,N=k==="y"?ut:ft,x=k==="y"?"height":"width",A=C[k],V=A+y[W],K=A-y[N],Q=p?-I[x]/2:0,$=v===wr?B[x]:I[x],F=v===wr?-I[x]:-B[x],D=e.elements.arrow,ee=p&&D?Il(D):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:nh(),P=q[W],X=q[N],he=xi(0,B[x],ee[x]),le=M?B[x]/2-Q-he-P-T.mainAxis:$-he-P-T.mainAxis,pe=M?-B[x]/2+Q+he+X+T.mainAxis:F+he+X+T.mainAxis,be=e.elements.arrow&&ki(e.elements.arrow),Me=be?k==="y"?be.clientTop||0:be.clientLeft||0:0,pt=(Y=L==null?void 0:L[k])!=null?Y:0,Tr=A+le-pt-Me,yn=A+pe-pt,bn=xi(p?Vo(V,Tr):V,A,p?jn(K,yn):K);C[k]=bn,H[k]=bn-A}if(l){var qt,vt=k==="x"?Ze:Xe,mt=k==="x"?ut:ft,gt=C[O],Vt=O==="y"?"height":"width",Kt=gt+y[vt],Dt=gt-y[mt],Wn=[Ze,Xe].indexOf(b)!==-1,kn=(qt=L==null?void 0:L[O])!=null?qt:0,$r=Wn?Kt:gt-B[Vt]-I[Vt]-kn+T.altAxis,Nr=Wn?gt+B[Vt]+I[Vt]-kn-T.altAxis:Dt,Br=p&&Wn?tO($r,gt,Nr):xi(p?$r:Kt,gt,p?Nr:Dt);C[O]=Br,H[O]=Br-gt}e.modifiersData[r]=H}}const AO={name:"preventOverflow",enabled:!0,phase:"main",fn:BO,requiresIfExists:["offset"]};function VO(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function DO(t){return t===it(t)||!ht(t)?Rl(t):VO(t)}function _O(t){var e=t.getBoundingClientRect(),n=vr(e.width)/t.offsetWidth||1,r=vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function LO(t,e,n){n===void 0&&(n=!1);var r=ht(e),i=ht(e)&&_O(e),o=mn(e),s=Cr(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||jl(o))&&(l=DO(e)),ht(e)?(c=Cr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=zl(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function IO(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 PO(t){var e=IO(t);return G3.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function RO(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function zO(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var fh={placement:"bottom",modifiers:[],strategy:"absolute"};function hh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function jO(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?fh:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},fh,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(b){var v=typeof b=="function"?b(u.options):b;g(),u.options=Object.assign({},o,u.options,v),u.scrollParents={reference:zn(l)?wi(l):l.contextElement?wi(l.contextElement):[],popper:wi(c)};var M=PO(zO([].concat(r,u.options.modifiers)));return u.orderedModifiers=M.filter(function(k){return k.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var b=u.elements,v=b.reference,M=b.popper;if(hh(v,M)){u.rects={reference:LO(v,ki(M),u.options.strategy==="fixed"),popper:Il(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(T){return u.modifiersData[T.name]=Object.assign({},T.data)});for(var k=0;k<u.orderedModifiers.length;k++){if(u.reset===!0){u.reset=!1,k=-1;continue}var O=u.orderedModifiers[k],C=O.fn,B=O.options,I=B===void 0?{}:B,_=O.name;typeof C=="function"&&(u=C({state:u,options:I,name:_,instance:p})||u)}}}},update:RO(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!hh(l,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var b=y.name,v=y.options,M=v===void 0?{}:v,k=y.effect;if(typeof k=="function"){var O=k({state:u,name:b,instance:p,options:M}),C=function(){};f.push(O||C)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var FO=[uO,$O,cO,Xf,MO,vO,AO,oO,SO],HO=jO({defaultModifiers:FO}),WO="tippy-box",ph="tippy-content",UO="tippy-backdrop",mh="tippy-arrow",gh="tippy-svg-arrow",Fn={passive:!0,capture:!0},yh=function(){return document.body};function qO(t,e){return{}.hasOwnProperty.call(t,e)}function Hl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Wl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function bh(t,e){return typeof t=="function"?t.apply(void 0,e):t}function kh(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function KO(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function YO(t){return t.split(/\s+/).filter(Boolean)}function Er(t){return[].concat(t)}function xh(t,e){t.indexOf(e)===-1&&t.push(e)}function JO(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function GO(t){return t.split("-")[0]}function Io(t){return[].slice.call(t)}function wh(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ci(){return document.createElement("div")}function Si(t){return["Element","Fragment"].some(function(e){return Wl(t,e)})}function ZO(t){return Wl(t,"NodeList")}function XO(t){return Wl(t,"MouseEvent")}function QO(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function eM(t){return Si(t)?[t]:ZO(t)?Io(t):Array.isArray(t)?t:Io(document.querySelectorAll(t))}function Ul(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function vh(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function tM(t){var e,n=Er(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function nM(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=GO(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>c,y=r-o.bottom-h>c,b=o.left-n+p>c,v=n-o.right-m>c;return g||y||b||v})}function ql(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ch(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Bt={isTouch:!1},Sh=0;function rM(){Bt.isTouch||(Bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Eh))}function Eh(){var t=performance.now();t-Sh<20&&(Bt.isTouch=!1,document.removeEventListener("mousemove",Eh)),Sh=t}function iM(){var t=document.activeElement;if(QO(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function oM(){document.addEventListener("touchstart",rM,Fn),window.addEventListener("blur",iM)}var sM=typeof window<"u"&&typeof document<"u",lM=sM?!!window.msCrypto:!1;function Or(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Oh(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function aM(t){return Oh(`
|
|
115
|
+
`,textSerializers:r={}}=e||{};return tA(this.state.doc,{blockSeparator:n,textSerializers:{...Sm(this.schema),...r}})}get isEmpty(){return tc(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 Or(n,this)}get $doc(){return this.$pos(0)}};function ui(t){return new Os({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],a=r[0];if(s){const c=a.search(/\S/),d=n.from+a.indexOf(s),u=d+s.length;if(Dm(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 Im(t){return new Os({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 a=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,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(a))}o.scrollIntoView()}})}function ic(t){return new Os({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 lo(t){return new Os({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&&al(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&&Yn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ot=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(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ic(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(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(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(n,"addStorage",{name:n.name,options:n.options})),n}};function fi(t){return new nM({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,a=r[r.length-1],c=r[0];let d=n.to;if(a){const u=c.search(/\S/),f=n.from+c.indexOf(a),h=f+a.length;if(Dm(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+a.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Tt="top",Ut="bottom",Yt="right",Nt="left",oc="auto",co=[Tt,Ut,Yt,Nt],hi="start",uo="end",_A="clippingParents",Vm="viewport",fo="popper",OA="reference",Pm=co.reduce(function(t,e){return t.concat([e+"-"+hi,e+"-"+uo])},[]),Rm=[].concat(co,[oc]).reduce(function(t,e){return t.concat([e,e+"-"+hi,e+"-"+uo])},[]),TA="beforeRead",NA="read",MA="afterRead",AA="beforeMain",DA="main",$A="afterMain",LA="beforeWrite",BA="write",IA="afterWrite",VA=[TA,NA,MA,AA,DA,$A,LA,BA,IA];function un(t){return t?(t.nodeName||"").toLowerCase():null}function Vt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Tr(t){var e=Vt(t).Element;return t instanceof e||t instanceof Element}function qt(t){var e=Vt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function sc(t){if(typeof ShadowRoot>"u")return!1;var e=Vt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function PA(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];!qt(o)||!un(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function RA(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!qt(i)||!un(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Fm={name:"applyStyles",enabled:!0,phase:"write",fn:PA,effect:RA,requires:["computeStyles"]};function fn(t){return t.split("-")[0]}var Nr=Math.max,Ps=Math.min,pi=Math.round;function ac(){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 jm(){return!/^((?!chrome|android).)*safari/i.test(ac())}function mi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&qt(t)&&(i=t.offsetWidth>0&&pi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&pi(r.height)/t.offsetHeight||1);var s=Tr(t)?Vt(t):window,a=s.visualViewport,c=!jm()&&n,d=(r.left+(c&&a?a.offsetLeft:0))/i,u=(r.top+(c&&a?a.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function lc(t){var e=mi(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 zm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Mn(t){return Vt(t).getComputedStyle(t)}function FA(t){return["table","td","th"].indexOf(un(t))>=0}function rr(t){return((Tr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Rs(t){return un(t)==="html"?t:t.assignedSlot||t.parentNode||(sc(t)?t.host:null)||rr(t)}function Hm(t){return!qt(t)||Mn(t).position==="fixed"?null:t.offsetParent}function jA(t){var e=/firefox/i.test(ac()),n=/Trident/i.test(ac());if(n&&qt(t)){var r=Mn(t);if(r.position==="fixed")return null}var i=Rs(t);for(sc(i)&&(i=i.host);qt(i)&&["html","body"].indexOf(un(i))<0;){var o=Mn(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 ho(t){for(var e=Vt(t),n=Hm(t);n&&FA(n)&&Mn(n).position==="static";)n=Hm(n);return n&&(un(n)==="html"||un(n)==="body"&&Mn(n).position==="static")?e:n||jA(t)||e}function cc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function po(t,e,n){return Nr(t,Ps(e,n))}function zA(t,e,n){var r=po(t,e,n);return r>n?n:r}function Wm(){return{top:0,right:0,bottom:0,left:0}}function Um(t){return Object.assign({},Wm(),t)}function Ym(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var HA=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Um(typeof e!="number"?e:Ym(e,co))};function WA(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fn(n.placement),c=cc(a),d=[Nt,Yt].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=HA(i.padding,n),h=lc(o),p=c==="y"?Tt:Nt,m=c==="y"?Ut:Yt,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],k=ho(o),x=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,w=g/2-y/2,b=f[p],C=x-h[u]-f[m],v=x/2-h[u]/2+w,S=po(b,v,C),D=c;n.modifiersData[r]=(e={},e[D]=S,e.centerOffset=S-v,e)}}function UA(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)||zm(e.elements.popper,i)&&(e.elements.arrow=i))}const YA={name:"arrow",enabled:!0,phase:"main",fn:WA,effect:UA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var qA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KA(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:pi(n*i)/i||0,y:pi(r*i)/i||0}}function qm(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=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=Nt,b=Tt,C=window;if(d){var v=ho(n),S="clientHeight",D="clientWidth";if(v===Vt(n)&&(v=rr(n),Mn(v).position!=="static"&&a==="absolute"&&(S="scrollHeight",D="scrollWidth")),v=v,i===Tt||(i===Nt||i===Yt)&&o===uo){b=Ut;var O=f&&v===C&&C.visualViewport?C.visualViewport.height:v[S];g-=O-r.height,g*=c?1:-1}if(i===Nt||(i===Tt||i===Ut)&&o===uo){w=Yt;var $=f&&v===C&&C.visualViewport?C.visualViewport.width:v[D];p-=$-r.width,p*=c?1:-1}}var V=Object.assign({position:a},d&&qA),B=u===!0?KA({x:p,y:g},Vt(n)):{x:p,y:g};if(p=B.x,g=B.y,c){var J;return Object.assign({},V,(J={},J[b]=x?"0":"",J[w]=k?"0":"",J.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",J))}return Object.assign({},V,(e={},e[b]=x?g+"px":"",e[w]=k?p+"px":"",e.transform="",e))}function GA(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,c=a===void 0?!0:a,d={placement:fn(e.placement),variation:gi(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,qm(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,qm(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 JA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:GA,data:{}};var Fs={passive:!0};function ZA(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,c=Vt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&c.addEventListener("resize",n.update,Fs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&c.removeEventListener("resize",n.update,Fs)}}const XA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ZA,data:{}};var QA={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return QA[e]})}var e3={start:"end",end:"start"};function Km(t){return t.replace(/start|end/g,function(e){return e3[e]})}function dc(t){var e=Vt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function uc(t){return mi(rr(t)).left+dc(t).scrollLeft}function t3(t,e){var n=Vt(t),r=rr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var d=jm();(d||!d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+uc(t),y:c}}function n3(t){var e,n=rr(t),r=dc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Nr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Nr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+uc(t),c=-r.scrollTop;return Mn(i||n).direction==="rtl"&&(a+=Nr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}function fc(t){var e=Mn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Gm(t){return["html","body","#document"].indexOf(un(t))>=0?t.ownerDocument.body:qt(t)&&fc(t)?t:Gm(Rs(t))}function mo(t,e){var n;e===void 0&&(e=[]);var r=Gm(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Vt(r),s=i?[o].concat(o.visualViewport||[],fc(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(mo(Rs(s)))}function hc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function r3(t,e){var n=mi(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 Jm(t,e,n){return e===Vm?hc(t3(t,n)):Tr(e)?r3(e,n):hc(n3(rr(t)))}function i3(t){var e=mo(Rs(t)),n=["absolute","fixed"].indexOf(Mn(t).position)>=0,r=n&&qt(t)?ho(t):t;return Tr(r)?e.filter(function(i){return Tr(i)&&zm(i,r)&&un(i)!=="body"}):[]}function o3(t,e,n,r){var i=e==="clippingParents"?i3(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(c,d){var u=Jm(t,d,r);return c.top=Nr(u.top,c.top),c.right=Ps(u.right,c.right),c.bottom=Ps(u.bottom,c.bottom),c.left=Nr(u.left,c.left),c},Jm(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Zm(t){var e=t.reference,n=t.element,r=t.placement,i=r?fn(r):null,o=r?gi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,c;switch(i){case Tt:c={x:s,y:e.y-n.height};break;case Ut:c={x:s,y:e.y+e.height};break;case Yt:c={x:e.x+e.width,y:a};break;case Nt:c={x:e.x-n.width,y:a};break;default:c={x:e.x,y:e.y}}var d=i?cc(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case hi:c[d]=c[d]-(e[u]/2-n[u]/2);break;case uo:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function go(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,c=a===void 0?_A:a,d=n.rootBoundary,u=d===void 0?Vm:d,f=n.elementContext,h=f===void 0?fo:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,k=Um(typeof y!="number"?y:Ym(y,co)),x=h===fo?OA:fo,w=t.rects.popper,b=t.elements[m?x:h],C=o3(Tr(b)?b:b.contextElement||rr(t.elements.popper),c,u,s),v=mi(t.elements.reference),S=Zm({reference:v,element:w,placement:i}),D=hc(Object.assign({},w,S)),O=h===fo?D:v,$={top:C.top-O.top+k.top,bottom:O.bottom-C.bottom+k.bottom,left:C.left-O.left+k.left,right:O.right-C.right+k.right},V=t.modifiersData.offset;if(h===fo&&V){var B=V[i];Object.keys($).forEach(function(J){var Y=[Yt,Ut].indexOf(J)>=0?1:-1,I=[Tt,Ut].indexOf(J)>=0?"y":"x";$[J]+=B[I]*Y})}return $}function s3(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Rm:c,u=gi(r),f=u?a?Pm:Pm.filter(function(m){return gi(m)===u}):co,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]=go(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 a3(t){if(fn(t)===oc)return[];var e=js(t);return[Km(t),e,Km(e)]}function l3(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,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)]:a3(y)),b=[y].concat(w).reduce(function(z,q){return z.concat(fn(q)===oc?s3(e,{placement:q,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),C=e.rects.reference,v=e.rects.popper,S=new Map,D=!0,O=b[0],$=0;$<b.length;$++){var V=b[$],B=fn(V),J=gi(V)===hi,Y=[Tt,Ut].indexOf(B)>=0,I=Y?"width":"height",T=go(e,{placement:V,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),R=Y?J?Yt:Nt:J?Ut:Tt;C[I]>v[I]&&(R=js(R));var F=js(R),ee=[];if(o&&ee.push(T[B]<=0),a&&ee.push(T[R]<=0,T[F]<=0),ee.every(function(z){return z})){O=V,D=!1;break}S.set(V,ee)}if(D)for(var ie=m?3:1,he=function(q){var U=b.find(function(j){var ce=S.get(j);if(ce)return ce.slice(0,q).every(function(le){return le})});if(U)return O=U,"break"},ue=ie;ue>0;ue--){var L=he(ue);if(L==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const c3={name:"flip",enabled:!0,phase:"main",fn:l3,requiresIfExists:["offset"],data:{_skip:!1}};function Xm(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 Qm(t){return[Tt,Yt,Ut,Nt].some(function(e){return t[e]>=0})}function d3(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=go(e,{elementContext:"reference"}),a=go(e,{altBoundary:!0}),c=Xm(s,r),d=Xm(a,i,o),u=Qm(c),f=Qm(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 u3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:d3};function f3(t,e,n){var r=fn(t),i=[Nt,Tt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Nt,Yt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function h3(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Rm.reduce(function(u,f){return u[f]=f3(f,e.rects,o),u},{}),a=s[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const p3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h3};function m3(t){var e=t.state,n=t.name;e.modifiersData[n]=Zm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const g3={name:"popperOffsets",enabled:!0,phase:"read",fn:m3,data:{}};function y3(t){return t==="x"?"y":"x"}function b3(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,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=go(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),k=fn(e.placement),x=gi(e.placement),w=!x,b=cc(k),C=y3(b),v=e.modifiersData.popperOffsets,S=e.rects.reference,D=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,$=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(v){if(o){var J,Y=b==="y"?Tt:Nt,I=b==="y"?Ut:Yt,T=b==="y"?"height":"width",R=v[b],F=R+y[Y],ee=R-y[I],ie=p?-D[T]/2:0,he=x===hi?S[T]:D[T],ue=x===hi?-D[T]:-S[T],L=e.elements.arrow,z=p&&L?lc(L):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wm(),U=q[Y],j=q[I],ce=po(0,S[T],z[T]),le=w?S[T]/2-ie-ce-U-$.mainAxis:he-ce-U-$.mainAxis,ve=w?-S[T]/2+ie+ce+j+$.mainAxis:ue+ce+j+$.mainAxis,Ne=e.elements.arrow&&ho(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(J=V==null?void 0:V[b])!=null?J:0,Q=R+le-tt-Ie,Ee=R+ve-tt,Mt=po(p?Ps(F,Q):F,R,p?Nr(ee,Ee):ee);v[b]=Mt,B[b]=Mt-R}if(a){var at,lt=b==="x"?Tt:Nt,ht=b==="x"?Ut:Yt,E=v[C],_=C==="y"?"height":"width",H=E+y[lt],se=E-y[ht],Me=[Tt,Nt].indexOf(k)!==-1,_e=(at=V==null?void 0:V[C])!=null?at:0,Oe=Me?H:E-S[_]-D[_]-_e+$.altAxis,P=Me?E+S[_]+D[_]-_e-$.altAxis:se,Z=p&&Me?zA(Oe,E,P):po(p?Oe:H,E,p?P:se);v[C]=Z,B[C]=Z-E}e.modifiersData[r]=B}}const k3={name:"preventOverflow",enabled:!0,phase:"main",fn:b3,requiresIfExists:["offset"]};function v3(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function w3(t){return t===Vt(t)||!qt(t)?dc(t):v3(t)}function x3(t){var e=t.getBoundingClientRect(),n=pi(e.width)/t.offsetWidth||1,r=pi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function E3(t,e,n){n===void 0&&(n=!1);var r=qt(e),i=qt(e)&&x3(e),o=rr(e),s=mi(t,i,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((un(e)!=="body"||fc(o))&&(a=w3(e)),qt(e)?(c=mi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=uc(o))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function C3(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var c=e.get(a);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function S3(t){var e=C3(t);return VA.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function _3(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function O3(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 eg={placement:"bottom",modifiers:[],strategy:"absolute"};function tg(){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 T3(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?eg:i;return function(a,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},eg,o),modifiersData:{},elements:{reference:a,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:Tr(a)?mo(a):a.contextElement?mo(a.contextElement):[],popper:mo(c)};var w=S3(O3([].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(tg(x,w)){u.rects={reference:E3(x,ho(w),u.options.strategy==="fixed"),popper:lc(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var C=u.orderedModifiers[b],v=C.fn,S=C.options,D=S===void 0?{}:S,O=C.name;typeof v=="function"&&(u=v({state:u,options:D,name:O,instance:p})||u)}}}},update:_3(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!tg(a,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 C=b({state:u,name:k,instance:p,options:w}),v=function(){};f.push(C||v)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var N3=[XA,g3,JA,Fm,p3,c3,k3,YA,u3],M3=T3({defaultModifiers:N3}),A3="tippy-box",ng="tippy-content",D3="tippy-backdrop",rg="tippy-arrow",ig="tippy-svg-arrow",Mr={passive:!0,capture:!0},og=function(){return document.body};function $3(t,e){return{}.hasOwnProperty.call(t,e)}function pc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function mc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function sg(t,e){return typeof t=="function"?t.apply(void 0,e):t}function ag(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function L3(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function B3(t){return t.split(/\s+/).filter(Boolean)}function yi(t){return[].concat(t)}function lg(t,e){t.indexOf(e)===-1&&t.push(e)}function I3(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function V3(t){return t.split("-")[0]}function zs(t){return[].slice.call(t)}function cg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function yo(){return document.createElement("div")}function bo(t){return["Element","Fragment"].some(function(e){return mc(t,e)})}function P3(t){return mc(t,"NodeList")}function R3(t){return mc(t,"MouseEvent")}function F3(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function j3(t){return bo(t)?[t]:P3(t)?zs(t):Array.isArray(t)?t:zs(document.querySelectorAll(t))}function gc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function dg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function z3(t){var e,n=yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function H3(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,c=a.interactiveBorder,d=V3(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 yc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function ug(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},fg=0;function W3(){hn.isTouch||(hn.isTouch=!0,window.performance&&document.addEventListener("mousemove",hg))}function hg(){var t=performance.now();t-fg<20&&(hn.isTouch=!1,document.removeEventListener("mousemove",hg)),fg=t}function U3(){var t=document.activeElement;if(F3(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Y3(){document.addEventListener("touchstart",W3,Mr),window.addEventListener("blur",U3)}var q3=typeof window<"u"&&typeof document<"u",K3=q3?!!window.msCrypto:!1;function bi(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 pg(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function G3(t){return pg(`
|
|
94
116
|
%ctippy.js
|
|
95
117
|
|
|
96
|
-
%c`+
|
|
118
|
+
%c`+pg(t)+`
|
|
97
119
|
|
|
98
120
|
%c👷 This is a development-only message. It will be removed in production.
|
|
99
|
-
`)}function
|
|
121
|
+
`)}function mg(t){return[G3(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ko;process.env.NODE_ENV!=="production"&&J3();function J3(){ko=new Set}function An(t,e){if(t&&!ko.has(e)){var n;ko.add(e),(n=console).warn.apply(n,mg(e))}}function bc(t,e){if(t&&!ko.has(e)){var n;ko.add(e),(n=console).error.apply(n,mg(e))}}function Z3(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;bc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),bc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var gg={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},X3={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Pt=Object.assign({appendTo:og,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},gg,X3),Q3=Object.keys(Pt),eD=function(e){process.env.NODE_ENV!=="production"&&kg(e,[]);var n=Object.keys(e);n.forEach(function(r){Pt[r]=e[r]})};function yg(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Pt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function tD(t,e){var n=e?Object.keys(yg(Object.assign({},Pt,{plugins:e}))):Q3,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 bg(t,e){var n=Object.assign({},e,{content:sg(e.content,[t])},e.ignoreAttributes?{}:tD(t,e.plugins));return n.aria=Object.assign({},Pt.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 kg(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=L3(Pt,Object.keys(gg)),o=!$3(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),An(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
100
122
|
|
|
101
123
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
102
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
124
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var nD=function(){return"innerHTML"};function kc(t,e){t[nD()]=e}function vg(t){var e=yo();return t===!0?e.className=rg:(e.className=ig,bo(t)?e.appendChild(t):kc(e,t)),e}function wg(t,e){bo(e.content)?(kc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?kc(t,e.content):t.textContent=e.content)}function vc(t){var e=t.firstElementChild,n=zs(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(ng)}),arrow:n.find(function(r){return r.classList.contains(rg)||r.classList.contains(ig)}),backdrop:n.find(function(r){return r.classList.contains(D3)})}}function xg(t){var e=yo(),n=yo();n.className=A3,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=yo();r.className=ng,r.setAttribute("data-state","hidden"),wg(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=vc(e),c=a.box,d=a.content,u=a.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)&&wg(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(vg(s.arrow))):c.appendChild(vg(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}xg.$$tippy=!0;var rD=1,Hs=[],wc=[];function iD(t,e){var n=bg(t,Object.assign({},Pt,yg(cg(e)))),r,i,o,s=!1,a=!1,c=!1,d=!1,u,f,h,p=[],m=ag(Q,n.interactiveDebounce),g,y=rD++,k=null,x=I3(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:yo(),popperInstance:k,props:n,state:w,plugins:x,clearDelayTimeouts:Oe,setProps:P,setContent:Z,show:N,hide:A,hideWithInteractivity:W,enable:Me,disable:_e,unmount:te,destroy:de};if(!n.render)return process.env.NODE_ENV!=="production"&&bc(!0,"render() function has not been supplied."),b;var C=n.render(b),v=C.popper,S=C.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+b.id,b.popper=v,t._tippy=b,v._tippy=b;var D=x.map(function(M){return M.fn(b)}),O=t.hasAttribute("aria-expanded");return Ne(),ie(),R(),F("onCreate",[b]),n.showOnCreate&&H(),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&&Y().addEventListener("mousemove",m)}),b;function $(){var M=b.props.touch;return Array.isArray(M)?M:[M,0]}function V(){return $()[0]==="hold"}function B(){var M;return!!((M=b.props.render)!=null&&M.$$tippy)}function J(){return g||t}function Y(){var M=J().parentNode;return M?z3(M):document}function I(){return vc(v)}function T(M){return b.state.isMounted&&!b.state.isVisible||hn.isTouch||u&&u.type==="focus"?0:pc(b.props.delay,M?0:1,Pt.delay)}function R(M){M===void 0&&(M=!1),v.style.pointerEvents=b.props.interactive&&!M?"":"none",v.style.zIndex=""+b.props.zIndex}function F(M,X,re){if(re===void 0&&(re=!0),D.forEach(function(ye){ye[M]&&ye[M].apply(ye,X)}),re){var me;(me=b.props)[M].apply(me,X)}}function ee(){var M=b.props.aria;if(M.content){var X="aria-"+M.content,re=v.id,me=yi(b.props.triggerTarget||t);me.forEach(function(ye){var we=ye.getAttribute(X);if(b.state.isVisible)ye.setAttribute(X,we?we+" "+re:re);else{var Ae=we&&we.replace(re,"").trim();Ae?ye.setAttribute(X,Ae):ye.removeAttribute(X)}})}}function ie(){if(!(O||!b.props.aria.expanded)){var M=yi(b.props.triggerTarget||t);M.forEach(function(X){b.props.interactive?X.setAttribute("aria-expanded",b.state.isVisible&&X===J()?"true":"false"):X.removeAttribute("aria-expanded")})}}function he(){Y().removeEventListener("mousemove",m),Hs=Hs.filter(function(M){return M!==m})}function ue(M){if(!(hn.isTouch&&(c||M.type==="mousedown"))){var X=M.composedPath&&M.composedPath()[0]||M.target;if(!(b.props.interactive&&ug(v,X))){if(yi(b.props.triggerTarget||t).some(function(re){return ug(re,X)})){if(hn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else F("onClickOutside",[b,M]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||U())}}}function L(){c=!0}function z(){c=!1}function q(){var M=Y();M.addEventListener("mousedown",ue,!0),M.addEventListener("touchend",ue,Mr),M.addEventListener("touchstart",z,Mr),M.addEventListener("touchmove",L,Mr)}function U(){var M=Y();M.removeEventListener("mousedown",ue,!0),M.removeEventListener("touchend",ue,Mr),M.removeEventListener("touchstart",z,Mr),M.removeEventListener("touchmove",L,Mr)}function j(M,X){le(M,function(){!b.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&X()})}function ce(M,X){le(M,X)}function le(M,X){var re=I().box;function me(ye){ye.target===re&&(yc(re,"remove",me),X())}if(M===0)return X();yc(re,"remove",f),yc(re,"add",me),f=me}function ve(M,X,re){re===void 0&&(re=!1);var me=yi(b.props.triggerTarget||t);me.forEach(function(ye){ye.addEventListener(M,X,re),p.push({node:ye,eventType:M,handler:X,options:re})})}function Ne(){V()&&(ve("touchstart",tt,{passive:!0}),ve("touchend",Ee,{passive:!0})),B3(b.props.trigger).forEach(function(M){if(M!=="manual")switch(ve(M,tt),M){case"mouseenter":ve("mouseleave",Ee);break;case"focus":ve(K3?"focusout":"blur",Mt);break;case"focusin":ve("focusout",Mt);break}})}function Ie(){p.forEach(function(M){var X=M.node,re=M.eventType,me=M.handler,ye=M.options;X.removeEventListener(re,me,ye)}),p=[]}function tt(M){var X,re=!1;if(!(!b.state.isEnabled||at(M)||a)){var me=((X=u)==null?void 0:X.type)==="focus";u=M,g=M.currentTarget,ie(),!b.state.isVisible&&R3(M)&&Hs.forEach(function(ye){return ye(M)}),M.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?re=!0:H(M),M.type==="click"&&(s=!re),re&&!me&&se(M)}}function Q(M){var X=M.target,re=J().contains(X)||v.contains(X);if(!(M.type==="mousemove"&&re)){var me=_().concat(v).map(function(ye){var we,Ae=ye._tippy,ze=(we=Ae.popperInstance)==null?void 0:we.state;return ze?{popperRect:ye.getBoundingClientRect(),popperState:ze,props:n}:null}).filter(Boolean);H3(me,M)&&(he(),se(M))}}function Ee(M){var X=at(M)||b.props.trigger.indexOf("click")>=0&&s;if(!X){if(b.props.interactive){b.hideWithInteractivity(M);return}se(M)}}function Mt(M){b.props.trigger.indexOf("focusin")<0&&M.target!==J()||b.props.interactive&&M.relatedTarget&&v.contains(M.relatedTarget)||se(M)}function at(M){return hn.isTouch?V()!==M.type.indexOf("touch")>=0:!1}function lt(){ht();var M=b.props,X=M.popperOptions,re=M.placement,me=M.offset,ye=M.getReferenceClientRect,we=M.moveTransition,Ae=B()?vc(v).arrow:null,ze=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||J()}:t,vt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(or){var mn=or.state;if(B()){var vo=I(),$c=vo.box;["placement","reference-hidden","escaped"].forEach(function(Ks){Ks==="placement"?$c.setAttribute("data-placement",mn.placement):mn.attributes.popper["data-popper-"+Ks]?$c.setAttribute("data-"+Ks,""):$c.removeAttribute("data-"+Ks)}),mn.attributes.popper={}}}},Rt=[{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:!we}},vt];B()&&Ae&&Rt.push({name:"arrow",options:{element:Ae,padding:3}}),Rt.push.apply(Rt,(X==null?void 0:X.modifiers)||[]),b.popperInstance=M3(ze,v,Object.assign({},X,{placement:re,onFirstUpdate:h,modifiers:Rt}))}function ht(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function E(){var M=b.props.appendTo,X,re=J();b.props.interactive&&M===og||M==="parent"?X=re.parentNode:X=sg(M,[re]),X.contains(v)||X.appendChild(v),b.state.isMounted=!0,lt(),process.env.NODE_ENV!=="production"&&An(b.props.interactive&&M===Pt.appendTo&&re.nextElementSibling!==v,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
103
125
|
|
|
104
126
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
105
127
|
|
|
106
128
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
107
129
|
|
|
108
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
130
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function _(){return zs(v.querySelectorAll("[data-tippy-root]"))}function H(M){b.clearDelayTimeouts(),M&&F("onTrigger",[b,M]),q();var X=T(!0),re=$(),me=re[0],ye=re[1];hn.isTouch&&me==="hold"&&ye&&(X=ye),X?r=setTimeout(function(){b.show()},X):b.show()}function se(M){if(b.clearDelayTimeouts(),F("onUntrigger",[b,M]),!b.state.isVisible){U();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var X=T(!1);X?i=setTimeout(function(){b.state.isVisible&&b.hide()},X):o=requestAnimationFrame(function(){b.hide()})}}function Me(){b.state.isEnabled=!0}function _e(){b.hide(),b.state.isEnabled=!1}function Oe(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function P(M){if(process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("setProps")),!b.state.isDestroyed){F("onBeforeUpdate",[b,M]),Ie();var X=b.props,re=bg(t,Object.assign({},X,cg(M),{ignoreAttributes:!0}));b.props=re,Ne(),X.interactiveDebounce!==re.interactiveDebounce&&(he(),m=ag(Q,re.interactiveDebounce)),X.triggerTarget&&!re.triggerTarget?yi(X.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),ie(),R(),S&&S(X,re),b.popperInstance&&(lt(),_().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),F("onAfterUpdate",[b,M])}}function Z(M){b.setProps({content:M})}function N(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("show"));var M=b.state.isVisible,X=b.state.isDestroyed,re=!b.state.isEnabled,me=hn.isTouch&&!b.props.touch,ye=pc(b.props.duration,0,Pt.duration);if(!(M||X||re||me)&&!J().hasAttribute("disabled")&&(F("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,B()&&(v.style.visibility="visible"),R(),q(),b.state.isMounted||(v.style.transition="none"),B()){var we=I(),Ae=we.box,ze=we.content;gc([Ae,ze],0)}h=function(){var Rt;if(!(!b.state.isVisible||d)){if(d=!0,v.offsetHeight,v.style.transition=b.props.moveTransition,B()&&b.props.animation){var Dr=I(),or=Dr.box,mn=Dr.content;gc([or,mn],ye),dg([or,mn],"visible")}ee(),ie(),lg(wc,b),(Rt=b.popperInstance)==null||Rt.forceUpdate(),F("onMount",[b]),b.props.animation&&B()&&ce(ye,function(){b.state.isShown=!0,F("onShown",[b])})}},E()}}function A(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hide"));var M=!b.state.isVisible,X=b.state.isDestroyed,re=!b.state.isEnabled,me=pc(b.props.duration,1,Pt.duration);if(!(M||X||re)&&(F("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,B()&&(v.style.visibility="hidden"),he(),U(),R(!0),B()){var ye=I(),we=ye.box,Ae=ye.content;b.props.animation&&(gc([we,Ae],me),dg([we,Ae],"hidden"))}ee(),ie(),b.props.animation?B()&&j(me,b.unmount):b.unmount()}}function W(M){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hideWithInteractivity")),Y().addEventListener("mousemove",m),lg(Hs,m),m(M)}function te(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ht(),_().forEach(function(M){M._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),wc=wc.filter(function(M){return M!==b}),b.state.isMounted=!1,F("onHidden",[b]))}function de(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Ie(),delete t._tippy,b.state.isDestroyed=!0,F("onDestroy",[b]))}}function ki(t,e){e===void 0&&(e={});var n=Pt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(Z3(t),kg(e,n)),Y3();var r=Object.assign({},e,{plugins:n}),i=j3(t);if(process.env.NODE_ENV!=="production"){var o=bo(r.content),s=i.length>1;An(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
109
131
|
|
|
110
132
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
111
133
|
|
|
112
134
|
`,`1) content: element.innerHTML
|
|
113
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&yM(d,r);return u&&c.push(u),c},[]);return Si(t)?l[0]:l}Mr.defaultProps=ot,Mr.setDefaultProps=hM,Mr.currentInput=Bt,Object.assign({},Xf,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Mr.setDefaultProps({render:Dh});class bM{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&El(c.selection),g=this.element.contains(document.activeElement);return!(!(l.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var c;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,c)=>{const d=!(c!=null&&c.selection.eq(l.state.selection)),u=!(c!=null&&c.doc.eq(l.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,u,c)},this.updateDelay))},this.updateHandler=(l,c,d,u)=>{var f,h,p;const{state:m,composing:g}=l,{selection:y}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:v}=y,M=Math.min(...v.map(C=>C.$from.pos)),k=Math.max(...v.map(C=>C.$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:M,to:k}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(b3(m.selection)){let C=l.nodeDOM(M);const B=C.dataset.nodeViewWrapper?C:C.querySelector("[data-node-view-wrapper]");if(B&&(C=B.firstChild),C)return C.getBoundingClientRect()}return qf(l,M,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const _h=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new bM({view:e,...t})});Oe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[_h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class kM{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{const{selection:c}=l,{$anchor:d,empty:u}=c,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Mr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:l,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(l)&&n.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>qf(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Lh=t=>new _e({key:typeof t.pluginKey=="string"?new nt(t.pluginKey):t.pluginKey,view:e=>new kM({view:e,...t})});Oe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Lh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),a.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:l}=t;i.registerPlugin(_h({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:l}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Ih(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class xM extends P3{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=Ih(this.view.state),this.reactiveExtensionStorage=Ih(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),a.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const wM=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=a.ref(),n=a.getCurrentInstance();return a.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=a.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),a.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=a.h(a.Teleport,{to:e.teleportElement,key:e.id},a.h(e.component,{ref:e.id,...e.props}));t.push(n)}),a.h("div",{ref:e=>{this.rootEl=e}},...t)}});a.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=a.ref(null);return a.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Lh({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return a.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const vM=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new xM(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},CM=/^\s*>\s$/,SM=Ge.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[mi({find:CM,type:this.type})]}}),EM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,OM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,MM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,TM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$M=dt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[kr({find:EM,type:this.type}),kr({find:MM,type:this.type})]},addPasteRules(){return[xr({find:OM,type:this.type}),xr({find:TM,type:this.type})]}}),NM=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ph=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Rh=/^\s*([-+*])\s$/,BM=Ge.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(NM.name,this.editor.getAttributes(Ph.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=mi({find:Rh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mi({find:Rh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ph.name),editor:this.editor})),[t]}}),AM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,VM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,DM=dt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[kr({find:AM,type:this.type})]},addPasteRules(){return[xr({find:VM,type:this.type})]}}),_M=/^```([a-z]+)?[\s\n]$/,LM=/^~~~([a-z]+)?[\s\n]$/,IM=Ge.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",xe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
135
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&iD(d,r);return u&&c.push(u),c},[]);return bo(t)?a[0]:a}ki.defaultProps=Pt,ki.setDefaultProps=eD,ki.currentInput=hn,Object.assign({},Fm,{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)}}),ki.setDefaultProps({render:xg});class oD{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&Jl(c.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var c;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,c)=>{const d=!(c!=null&&c.selection.eq(a.state.selection)),u=!(c!=null&&c.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,c)},this.updateDelay))},this.updateHandler=(a,c,d,u)=>{var f,h,p;const{state:m,composing:g}=a,{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:a,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(oA(m.selection)){let v=a.nodeDOM(w);const S=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(S&&(v=S.firstChild),v)return v.getBoundingClientRect()}return Lm(a,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=ki(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 Eg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new oD({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Eg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class sD{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:c}=a,{$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 a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(a)&&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)||(()=>Lm(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 Cg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new sD({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Cg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.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=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=t;i.registerPlugin(Eg({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Sg(t){return l.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class aD extends SA{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Sg(this.view.state),this.reactiveExtensionStorage=Sg(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.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 lD=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=l.ref(),n=l.getCurrentInstance();return l.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.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=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));t.push(n)}),l.h("div",{ref:e=>{this.rootEl=e}},...t)}});l.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=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Cg({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return l.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 cD=(t={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new aD(t)}),l.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},dD=/^\s*>\s$/,uD=Ot.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[lo({find:dD,type:this.type})]}}),fD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,hD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,mD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,gD=Wt.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[ui({find:fD,type:this.type}),ui({find:pD,type:this.type})]},addPasteRules(){return[fi({find:hD,type:this.type}),fi({find:mD,type:this.type})]}}),yD=Ot.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)}}}),_g=Wt.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=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Og=/^\s*([-+*])\s$/,bD=Ot.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(yD.name,this.editor.getAttributes(_g.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=lo({find:Og,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lo({find:Og,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(_g.name),editor:this.editor})),[t]}}),kD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,vD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,wD=Wt.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[ui({find:kD,type:this.type})]},addPasteRules(){return[fi({find:vD,type:this.type})]}}),xD=/^```([a-z]+)?[\s\n]$/,ED=/^~~~([a-z]+)?[\s\n]$/,CD=Ot.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(`
|
|
114
136
|
|
|
115
|
-
`);return!o||!s?!1:t.chain().command(({tr:
|
|
116
|
-
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),
|
|
117
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ZM=Ge.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,xe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Vl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var zo=200,Ae=function(){};Ae.prototype.append=function(e){return e.length?(e=Ae.from(e),!this.length&&e||e.length<zo&&this.leafAppend(e)||this.length<zo&&e.leafPrepend(this)||this.appendInner(e)):this},Ae.prototype.prepend=function(e){return e.length?Ae.from(e).append(this):this},Ae.prototype.appendInner=function(e){return new XM(this,e)},Ae.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ae.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ae.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ae.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Ae.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Ae.from=function(e){return e instanceof Ae?e:e&&e.length?new zh(e):Ae.empty};var zh=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=zo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=zo)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ae);Ae.empty=new zh([]);var XM=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ae);const QM=500;class wt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new At(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new At(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new wt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new At(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>tT&&(l=eT(l,d),s-=d),new wt(l.append(o),s)}remapping(e,n){let r=new or;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new wt(this.items.append(e.map(n=>new At(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let p=o.getMirror(--c);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&l++,r.push(new At(m,g,y))}else r.push(new At(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new At(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new wt(u,l);return f.emptyItemCount()>QM&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new At(d.invert(),c,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new wt(Ae.from(i.reverse()),o)}}wt.empty=new wt(Ae.empty,0);function eT(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class At{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new At(n.getMap().invert(),n,this.selection)}}}class gn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const tT=20;function nT(t,e,n,r){let i=n.getMeta(Hn),o;if(i)return i.historyState;n.getMeta(oT)&&(t=new gn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Hn))return s.getMeta(Hn).redo?new gn(t.done.addTransform(n,void 0,r,jo(e)),t.undone,jh(n.mapping.maps),t.prevTime,t.prevComposition):new gn(t.done,t.undone.addTransform(n,void 0,r,jo(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!rT(n,t.prevRanges)),d=s?Xl(t.prevRanges,n.mapping):jh(n.mapping.maps);return new gn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,jo(e)),wt.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gn(t.done.rebased(n,o),t.undone.rebased(n,o),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Xl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function rT(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function jh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Xl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function iT(t,e,n){let r=jo(e),i=Hn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new gn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Hn,{redo:n,historyState:c})}let Ql=!1,Fh=null;function jo(t){let e=t.plugins;if(Fh!=e){Ql=!1,Fh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ql=!0;break}}return Ql}const Hn=new nt("history"),oT=new nt("closeHistory");function sT(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _e({key:Hn,state:{init(){return new gn(wt.empty,wt.empty,null,0,-1)},apply(e,n,r){return nT(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Wh:r=="historyRedo"?Uh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Hh(t,e){return(n,r)=>{let i=Hn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=iT(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Wh=Hh(!1,!0),Uh=Hh(!0,!0),lT=Oe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Wh(t,e),redo:()=>({state:t,dispatch:e})=>Uh(t,e)}},addProseMirrorPlugins(){return[sT(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()}}}),aT=Ge.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ce.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(re.create(i.doc,l.pos)):i.setSelection(ce.create(i.doc,l.pos));else{const d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ce.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Yf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),cT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,dT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,uT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,hT=dt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[kr({find:cT,type:this.type}),kr({find:uT,type:this.type})]},addPasteRules(){return[xr({find:dT,type:this.type}),xr({find:fT,type:this.type})]}}),pT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),mT=Ge.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",xe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qh=dt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Bo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Kh=/^(\d+)\.\s$/,gT=Ge.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",xe(this.options.HTMLAttributes,n),0]:["ol",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(mT.name,this.editor.getAttributes(qh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=mi({find:Kh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mi({find:Kh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),yT=Ge.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,kT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,xT=dt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[kr({find:bT,type:this.type})]},addPasteRules(){return[xr({find:kT,type:this.type})]}}),wT=Ge.create({name:"text",group:"inline"}),vT=Oe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,g,y,b;const v=[];return this.options.blockquote!==!1&&v.push(SM.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&v.push($M.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&v.push(BM.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(DM.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(IM.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(PM.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(jM.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(JM.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&v.push(GM.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&v.push(ZM.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&v.push(lT.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&v.push(aT.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&v.push(hT.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&v.push(pT.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&v.push(gT.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&v.push(yT.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&v.push(xT.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&v.push(wT.configure((b=this.options)===null||b===void 0?void 0:b.text)),v}}),CT=Oe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new _e({key:new nt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,l=s&&s.type.isLeaf,c=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!l||!c);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=rt.node(h,h+f.nodeSize,{class:g.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});o.push(y)}return this.options.includeChildren}),Ee.create(t,o)}}})]}}),ST=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ge.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",xe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Yf({find:ST,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const ET=Oe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),OT=dt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),MT=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}`)})},TT=dt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&MT(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",xe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),$T=Oe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),NT={},BT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},AT=[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 VT(t,e){return a.openBlock(),a.createElementBlock("svg",BT,AT)}const DT=ae(NT,[["render",VT]]),_T={},LT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},IT=[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 PT(t,e){return a.openBlock(),a.createElementBlock("svg",LT,IT)}const RT=ae(_T,[["render",PT]]),zT={},jT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},FT=[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 HT(t,e){return a.openBlock(),a.createElementBlock("svg",jT,FT)}const WT=ae(zT,[["render",HT]]),UT={},qT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},KT=[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 YT(t,e){return a.openBlock(),a.createElementBlock("svg",qT,KT)}const JT=ae(UT,[["render",YT]]),GT={},ZT={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},XT=[a.createElementVNode("path",{d:"M754.429 0v274.423h235.885L647.457 1645.85H343V1920h822.994v-274.149H930.11l342.857-1371.428h304.32V0z","fill-rule":"evenodd"},null,-1)];function QT(t,e){return a.openBlock(),a.createElementBlock("svg",ZT,XT)}const e$=ae(GT,[["render",QT]]),t$={},n$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},r$=[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 i$(t,e){return a.openBlock(),a.createElementBlock("svg",n$,r$)}const o$=ae(t$,[["render",i$]]),s$={},l$={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"},a$=[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
|
|
137
|
+
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[ic({find:xD,type:this.type,getAttributes:t=>({language:t[1]})}),ic({find:ED,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new it({key:new Bt("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
|
+
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),SD=Ot.create({name:"doc",topNode:!0,content:"block+"});function _D(t={}){return new it({view(e){return new OD(e,t)}})}class OD{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,c=e.nodeAfter;if(a||c){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=a?u.bottom:u.top;a&&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 a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=$h(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const TD=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[_D(this.options)]}});class je extends xe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return je.valid(r)?new je(r):xe.near(r)}content(){return ne.empty}eq(e){return e instanceof je&&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 je(e.resolve(n.pos))}getBookmark(){return new xc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!ND(e)||!MD(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&&je.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let c=e.doc.resolve(i);if(je.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 a=e.doc.resolve(i);if(je.valid(a))return a}return null}}}je.prototype.visible=!1,je.findFrom=je.findGapCursorFrom,xe.jsonID("gapcursor",je);class xc{constructor(e){this.pos=e}map(e){return new xc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return je.valid(n)?new je(n):xe.near(n)}}function ND(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 MD(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 AD(){return new it({props:{decorations:BD,createSelectionBetween(t,e,n){return e.pos==n.pos&&je.valid(n)?new je(n):null},handleClick:$D,handleKeyDown:DD,handleDOMEvents:{beforeinput:LD}}})}const DD=om({ArrowLeft:Ws("horiz",-1),ArrowRight:Ws("horiz",1),ArrowUp:Ws("vert",-1),ArrowDown:Ws("vert",1)});function Ws(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,c=s.empty;if(s instanceof ke){if(!o.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=je.findGapCursorFrom(a,e,c);return d?(i&&i(r.tr.setSelection(new je(d))),!0):!1}}function $D(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!je.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 je(r))),!0)}function LD(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof je))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=G.empty;for(let s=r.length-1;s>=0;s--)i=G.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new ne(i,0,0));return o.setSelection(ke.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function BD(t){if(!(t.selection instanceof je))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ye.create(t.doc,[It.widget(t.selection.head,e,{key:"gapcursor"})])}const ID=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[AD()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ce(ae(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),VD=Ot.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:a}=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=>a.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),PD=Ot.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=>ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Us=200,et=function(){};et.prototype.append=function(e){return e.length?(e=et.from(e),!this.length&&e||e.length<Us&&this.leafAppend(e)||this.length<Us&&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 RD(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 Tg(e):et.empty};var Tg=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var c=o;c<s;c++)if(i(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var c=o-1;c>=s;c--)if(i(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Us)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Us)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 Tg([]);var RD=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(et);const FD=500;class tn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,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 a=i?f.selection.map(i.slice(o)):f.selection,c=new tn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,c=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new pn(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>zD&&(a=jD(a,d),s-=d),new tn(a.append(o),s)}remapping(e,n){let r=new Zr;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 tn(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,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},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&&a++,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 tn(u,a);return f.emptyItemCount()>FD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let 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 tn(et.from(i.reverse()),o)}}tn.empty=new tn(et.empty,0);function jD(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 ir{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const zD=20;function HD(t,e,n,r){let i=n.getMeta(Ar),o;if(i)return i.historyState;n.getMeta(YD)&&(t=new ir(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Ar))return s.getMeta(Ar).redo?new ir(t.done.addTransform(n,void 0,r,Ys(e)),t.undone,Ng(n.mapping.maps),t.prevTime,t.prevComposition):new ir(t.done,t.undone.addTransform(n,void 0,r,Ys(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!WD(n,t.prevRanges)),d=s?Ec(t.prevRanges,n.mapping):Ng(n.mapping.maps);return new ir(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Ys(e)),tn.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new ir(t.done.rebased(n,o),t.undone.rebased(n,o),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ir(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function WD(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 Ng(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 Ec(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 UD(t,e,n){let r=Ys(e),i=Ar.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new ir(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ar,{redo:n,historyState:c})}let Cc=!1,Mg=null;function Ys(t){let e=t.plugins;if(Mg!=e){Cc=!1,Mg=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Cc=!0;break}}return Cc}const Ar=new Bt("history"),YD=new Bt("closeHistory");function qD(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new it({key:Ar,state:{init(){return new ir(tn.empty,tn.empty,null,0,-1)},apply(e,n,r){return HD(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Dg:r=="historyRedo"?$g:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Ag(t,e){return(n,r)=>{let i=Ar.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=UD(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Dg=Ag(!1,!0),$g=Ag(!0,!0),KD=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Dg(t,e),redo:()=>({state:t,dispatch:e})=>$g(t,e)}},addProseMirrorPlugins(){return[qD(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()}}}),GD=Ot.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:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(ke.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,a.pos)):i.setSelection(ke.create(i.doc,a.pos));else{const d=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ke.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Im({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),JD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ZD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,XD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,e$=Wt.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[ui({find:JD,type:this.type}),ui({find:XD,type:this.type})]},addPasteRules(){return[fi({find:ZD,type:this.type}),fi({find:QD,type:this.type})]}}),t$=Ot.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)}}}),n$=Ot.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)}}}),Lg=Wt.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=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Bg=/^(\d+)\.\s$/,r$=Ot.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(n$.name,this.editor.getAttributes(Lg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=lo({find:Bg,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=lo({find:Bg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Lg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),i$=Ot.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()}}}),o$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,s$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,a$=Wt.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[ui({find:o$,type:this.type})]},addPasteRules(){return[fi({find:s$,type:this.type})]}}),l$=Ot.create({name:"text",group:"inline"}),c$=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,c,d,u,f,h,p,m,g,y,k;const x=[];return this.options.blockquote!==!1&&x.push(uD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(gD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(bD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(wD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(CD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(SD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(TD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(ID.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(VD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(PD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(KD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(GD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(e$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(t$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(r$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(i$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(a$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(l$.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),d$=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 Bt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,a=s&&s.type.isLeaf,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&&(!a||!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=It.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)}}})]}}),u$=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ot.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[Im({find:u$,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const f$=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")}}}),h$=Wt.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()}}}),p$=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}`)})},m$=Wt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&p$(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}}}}),g$=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()}}}),y$={},b$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},k$=[l.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 v$(t,e){return l.openBlock(),l.createElementBlock("svg",b$,k$)}const w$=be(y$,[["render",v$]]),x$={},E$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},C$=[l.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 S$(t,e){return l.openBlock(),l.createElementBlock("svg",E$,C$)}const _$=be(x$,[["render",S$]]),O$={},T$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},N$=[l.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 M$(t,e){return l.openBlock(),l.createElementBlock("svg",T$,N$)}const A$=be(O$,[["render",M$]]),D$={},$$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},L$=[l.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 B$(t,e){return l.openBlock(),l.createElementBlock("svg",$$,L$)}const I$=be(D$,[["render",B$]]),V$={},P$={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},R$=[l.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 F$(t,e){return l.openBlock(),l.createElementBlock("svg",P$,R$)}const j$=be(V$,[["render",F$]]),z$={},H$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},W$=[l.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 U$(t,e){return l.openBlock(),l.createElementBlock("svg",H$,W$)}const Y$=be(z$,[["render",U$]]),q$={},K$={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"},G$=[l.createElementVNode("g",null,[l.createElementVNode("g",null,[l.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
|
|
118
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
|
|
119
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
|
|
120
|
-
h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function c$(t,e){return a.openBlock(),a.createElementBlock("svg",l$,a$)}const d$=ae(s$,[["render",c$]]),u$={},f$={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"},h$=[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 p$(t,e){return a.openBlock(),a.createElementBlock("svg",f$,h$)}const m$=ae(u$,[["render",p$]]),g$={},y$={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"},b$=[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 k$(t,e){return a.openBlock(),a.createElementBlock("svg",y$,b$)}const x$=ae(g$,[["render",k$]]),w$={},v$={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"},C$=[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 S$(t,e){return a.openBlock(),a.createElementBlock("svg",v$,C$)}const E$=ae(w$,[["render",S$]]),O$={},M$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},T$=[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 $$(t,e){return a.openBlock(),a.createElementBlock("svg",M$,T$)}const N$=ae(O$,[["render",$$]]),B$={},A$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},V$=[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 D$(t,e){return a.openBlock(),a.createElementBlock("svg",A$,V$)}const _$=ae(B$,[["render",D$]]),L$={},I$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},P$=[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 R$(t,e){return a.openBlock(),a.createElementBlock("svg",I$,P$)}const z$=ae(L$,[["render",R$]]),j$={},F$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},H$=[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 W$(t,e){return a.openBlock(),a.createElementBlock("svg",F$,H$)}const U$=ae(j$,[["render",W$]]),q$={},K$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Y$=[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 J$(t,e){return a.openBlock(),a.createElementBlock("svg",K$,Y$)}const G$=ae(q$,[["render",J$]]),Z$={},X$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Q$=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.165 3.654c-.95-.255-1.921-.273-2.693-.042-.769.231-1.087.624-1.173.947-.087.323-.008.822.543 1.407.389.412.927.77 1.55 1.034H13a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 3 7h1.756l-.006-.006c-.787-.835-1.161-1.849-.9-2.823.26-.975 1.092-1.666 2.191-1.995 1.097-.33 2.36-.28 3.512.029.75.2 1.478.518 2.11.939a.75.75 0 0 1-.833 1.248 5.682 5.682 0 0 0-1.665-.738Zm2.074 6.365a.75.75 0 0 1 .91.543 2.44 2.44 0 0 1-.35 2.024c-.405.585-1.052 1.003-1.84 1.24-1.098.329-2.36.279-3.512-.03-1.152-.308-2.27-.897-3.056-1.73a.75.75 0 0 1 1.092-1.029c.552.586 1.403 1.056 2.352 1.31.95.255 1.92.273 2.692.042.55-.165.873-.417 1.038-.656a.942.942 0 0 0 .13-.803.75.75 0 0 1 .544-.91Z","clip-rule":"evenodd"},null,-1)];function eN(t,e){return a.openBlock(),a.createElementBlock("svg",X$,Q$)}const tN=ae(Z$,[["render",eN]]),nN={},rN={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},iN=[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 oN(t,e){return a.openBlock(),a.createElementBlock("svg",rN,iN)}const sN=ae(nN,[["render",oN]]),lN={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},aN={class:"flex gap-px"},cN=["onClick"],dN={key:1,class:"text-sm"},uN=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:o$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:e$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:G$,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:tN,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:d$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:m$,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:x$,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:E$,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:N$,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:_$,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:z$,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:U$,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:DT,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:RT,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:WT,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:JT,disableCheck:!0,active:!0}],c=e,d=vM({content:n.modelValue,extensions:[vT,OT,$T,TT,ET.configure({types:["heading","paragraph"]}),CT.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});a.onBeforeUnmount(()=>{d.value.destroy()}),a.watch(()=>n.modelValue,m=>{m!==d.value.getHTML()&&d.value.commands.setContent(m,!1)});function u(m,g,y){if(m==="setTextAlign"){d.value.isActive({textAlign:y})?d.value.chain().focus().unsetTextAlign().run():d.value.chain().focus().setTextAlign(y).run();return}g==="chain"?y?d.value.chain().focus()[m](y).run():d.value.chain().focus()[m]().run():d.value[m]()()}function f(m,g,y,b){return b?g==="chain"?y?!d.value.can().chain().focus()[m](y).run():!d.value.can().chain().focus()[m]().run():!d.value.can()[m]().run():!1}const h=()=>{d.value.chain().focus().setColor(r.value).run(),i.value=!1},p=()=>{o.value.click()};return(m,g)=>{var y;return a.unref(d)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[a.unref(ne).theme]])},[a.createElementVNode("div",lN,[a.createElementVNode("div",aN,[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(sN,{class:"w-5 h-5",style:{}}),a.withDirectives(a.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=b=>r.value=b),class:"w-0",onInput:h},null,544),[[a.vModelText,r.value]])])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.filter(b=>b.active),b=>(a.openBlock(),a.createElementBlock("div",{key:b.method,class:a.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10",{"cursor-pointer":!f(b.method,b.type,b.params,b.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":b.label.startsWith("h")?a.unref(d).isActive("heading",{level:b.params.level}):b.method==="setTextAlign"?a.unref(d).isActive({textAlign:b.params}):a.unref(d).isActive(b.label)}]),onClick:v=>u(b.method,b.type,b.params)},[b.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":b.smallIcon,"w-4 h-4":!b.smallIcon&&!b.largeIcon,"w-5 h-5":b.largeIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",dN,a.toDisplayString(a.unref(Eg).capitalize(b.label)),1))],10,cN))),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(wM),{editor:a.unref(d)},null,8,["editor"])],4)],2)):a.createCommentVNode("",!0)}}}),fN={},hN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function mN(t,e){return a.openBlock(),a.createElementBlock("svg",hN,pN)}const gN=ae(fN,[["render",mN]]),yN={},bN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},kN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function xN(t,e){return a.openBlock(),a.createElementBlock("svg",bN,kN)}const wN=ae(yN,[["render",xN]]),vN={},CN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},SN=[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 EN(t,e){return a.openBlock(),a.createElementBlock("svg",CN,SN)}const ON=ae(vN,[["render",EN]]),MN={class:"flex-1"},TN=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(gN,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(wN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(ON,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.createElementVNode("span",MN,[a.renderSlot(e.$slots,"default")])],2))}}),ea={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":`
|
|
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 J$(t,e){return l.openBlock(),l.createElementBlock("svg",K$,G$)}const Z$=be(q$,[["render",J$]]),X$={},Q$={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"},eL=[l.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 tL(t,e){return l.openBlock(),l.createElementBlock("svg",Q$,eL)}const nL=be(X$,[["render",tL]]),rL={},iL={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"},oL=[l.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 sL(t,e){return l.openBlock(),l.createElementBlock("svg",iL,oL)}const aL=be(rL,[["render",sL]]),lL={},cL={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"},dL=[l.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 uL(t,e){return l.openBlock(),l.createElementBlock("svg",cL,dL)}const fL=be(lL,[["render",uL]]),hL={},pL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},mL=[l.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 gL(t,e){return l.openBlock(),l.createElementBlock("svg",pL,mL)}const yL=be(hL,[["render",gL]]),bL={},kL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},vL=[l.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 wL(t,e){return l.openBlock(),l.createElementBlock("svg",kL,vL)}const xL=be(bL,[["render",wL]]),EL={},CL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},SL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm6 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function _L(t,e){return l.openBlock(),l.createElementBlock("svg",CL,SL)}const OL=be(EL,[["render",_L]]),TL={},NL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},ML=[l.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 AL(t,e){return l.openBlock(),l.createElementBlock("svg",NL,ML)}const DL=be(TL,[["render",AL]]),$L={},LL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},BL=[l.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 IL(t,e){return l.openBlock(),l.createElementBlock("svg",LL,BL)}const VL=be($L,[["render",IL]]),PL={},RL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},FL=[l.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 jL(t,e){return l.openBlock(),l.createElementBlock("svg",RL,FL)}const zL=be(PL,[["render",jL]]),HL={},WL={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},UL=[l.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"},null,-1),l.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),l.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[l.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 YL(t,e){return l.openBlock(),l.createElementBlock("svg",WL,UL)}const qL=be(HL,[["render",YL]]),KL={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},GL={class:"flex gap-px"},JL=["onClick"],ZL={key:1,class:"text-sm"},XL=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=l.ref("#000000"),i=l.ref(!1),o=l.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"},a=[{method:"toggleBold",type:"chain",label:"bold",icon:Y$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:j$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:VL,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:zL,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:Z$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:nL,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:aL,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:fL,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:yL,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:xL,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:OL,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:DL,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:w$,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:_$,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:A$,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:I$,disableCheck:!0,active:!0}],c=e,d=cD({content:n.modelValue,extensions:[c$,h$,g$,m$,f$.configure({types:["heading","paragraph"]}),d$.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});l.onBeforeUnmount(()=>{d.value.destroy()}),l.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 l.unref(d)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[l.unref(fe).theme]])},[l.createElementVNode("div",KL,[l.createElementVNode("div",GL,[t.color?(l.openBlock(),l.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"},[l.createVNode(qL,{class:"w-5 h-5",style:{}}),l.withDirectives(l.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),[[l.vModelText,r.value]])])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.filter(k=>k.active),k=>(l.openBlock(),l.createElementBlock("div",{key:k.method,class:l.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")?l.unref(d).isActive("heading",{level:k.params.level}):k.method==="setTextAlign"?l.unref(d).isActive({textAlign:k.params}):l.unref(d).isActive(k.label)}]),onClick:x=>u(k.method,k.type,k.params)},[k.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(k.icon),{key:0,class:l.normalizeClass(["",{"w-3 h-3":k.smallIcon,"w-4 h-4":!k.smallIcon&&!k.largeIcon,"w-5 h-5":k.largeIcon}])},null,8,["class"])):(l.openBlock(),l.createElementBlock("span",ZL,l.toDisplayString(l.unref(h1).capitalize(k.label)),1))],10,JL))),128))])]),l.createElementVNode("div",{class:"max-h-72 w-full overflow-auto px-4 py-3 rounded-b-sm",style:l.normalizeStyle({backgroundColor:(y=t.customStyles)==null?void 0:y.backgroundColor})},[l.createVNode(l.unref(lD),{editor:l.unref(d)},null,8,["editor"])],4)],2)):l.createCommentVNode("",!0)}}}),QL={},eB={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function nB(t,e){return l.openBlock(),l.createElementBlock("svg",eB,tB)}const rB=be(QL,[["render",nB]]),iB={},oB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},sB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function aB(t,e){return l.openBlock(),l.createElementBlock("svg",oB,sB)}const lB=be(iB,[["render",aB]]),cB={},dB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},uB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),l.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),l.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function fB(t,e){return l.openBlock(),l.createElementBlock("svg",dB,uB)}const hB=be(cB,[["render",fB]]),pB={class:"flex-1"},mB=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("span",{class:l.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?(l.openBlock(),l.createBlock(rB,{key:0,class:"w-2.5 h-2.5"})):l.createCommentVNode("",!0),t.incomplete?(l.openBlock(),l.createBlock(lB,{key:1,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),t.partially?(l.openBlock(),l.createBlock(hB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),l.createElementVNode("span",pB,[l.renderSlot(e.$slots,"default")])],2))}}),Sc={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":`
|
|
121
143
|
hover:text-lime-500
|
|
122
144
|
rounded-full
|
|
123
145
|
|
|
@@ -130,4 +152,4 @@ img.ProseMirror-separator {
|
|
|
130
152
|
group-[.is-off]:text-gray-300
|
|
131
153
|
dark:group-[.is-off]:text-gray-800
|
|
132
154
|
|
|
133
|
-
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(l,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected&&!t.off,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[a.createElementVNode("div",{class:a.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[a.unref(ne).theme]}`]:t.between,[`${i[a.unref(ne).theme]}`]:t.firstDay,[`${o[a.unref(ne).theme]}`]:t.lastDay,[`${s[a.unref(ne).theme]}`]:t.highlight}]),style:a.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[a.createElementVNode("span",{class:a.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[a.unref(ne).theme]}`]:!0,[`${n[a.unref(ne).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[a.renderSlot(l.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.day),1)])],2)],6)],2))}};var Yh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",l="minute",c="hour",d="day",u="week",f="month",h="quarter",p="year",m="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(W){var N=["th","st","nd","rd"],x=W%100;return"["+W+(N[(x-20)%10]||N[x]||N[0])+"]"}},M=function(W,N,x){var A=String(W);return!A||A.length>=N?W:""+Array(N+1-A.length).join(x)+W},k={s:M,z:function(W){var N=-W.utcOffset(),x=Math.abs(N),A=Math.floor(x/60),V=x%60;return(N<=0?"+":"-")+M(A,2,"0")+":"+M(V,2,"0")},m:function W(N,x){if(N.date()<x.date())return-W(x,N);var A=12*(x.year()-N.year())+(x.month()-N.month()),V=N.clone().add(A,f),K=x-V<0,Q=N.clone().add(A+(K?-1:1),f);return+(-(A+(x-V)/(K?V-Q:Q-V))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},O="en",C={};C[O]=v;var B="$isDayjsObject",I=function(W){return W instanceof H||!(!W||!W[B])},_=function W(N,x,A){var V;if(!N)return O;if(typeof N=="string"){var K=N.toLowerCase();C[K]&&(V=K),x&&(C[K]=x,V=K);var Q=N.split("-");if(!V&&Q.length>1)return W(Q[0])}else{var $=N.name;C[$]=N,V=$}return!A&&V&&(O=V),V||!A&&O},T=function(W,N){if(I(W))return W.clone();var x=typeof N=="object"?N:{};return x.date=W,x.args=arguments,new H(x)},L=k;L.l=_,L.i=I,L.w=function(W,N){return T(W,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var H=function(){function W(x){this.$L=_(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[B]=!0}var N=W.prototype;return N.parse=function(x){this.$d=function(A){var V=A.date,K=A.utc;if(V===null)return new Date(NaN);if(L.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var Q=V.match(y);if(Q){var $=Q[2]-1||0,F=(Q[7]||"0").substring(0,3);return K?new Date(Date.UTC(Q[1],$,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,F)):new Date(Q[1],$,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,F)}}return new Date(V)}(x),this.init()},N.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},N.$utils=function(){return L},N.isValid=function(){return this.$d.toString()!==g},N.isSame=function(x,A){var V=T(x);return this.startOf(A)<=V&&V<=this.endOf(A)},N.isAfter=function(x,A){return T(x)<this.startOf(A)},N.isBefore=function(x,A){return this.endOf(A)<T(x)},N.$g=function(x,A,V){return L.u(x)?this[A]:this.set(V,x)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(x,A){var V=this,K=!!L.u(A)||A,Q=L.p(x),$=function(le,pe){var be=L.w(V.$u?Date.UTC(V.$y,pe,le):new Date(V.$y,pe,le),V);return K?be:be.endOf(d)},F=function(le,pe){return L.w(V.toDate()[le].apply(V.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(pe)),V)},D=this.$W,ee=this.$M,q=this.$D,P="set"+(this.$u?"UTC":"");switch(Q){case p:return K?$(1,0):$(31,11);case f:return K?$(1,ee):$(0,ee+1);case u:var X=this.$locale().weekStart||0,he=(D<X?D+7:D)-X;return $(K?q-he:q+(6-he),ee);case d:case m:return F(P+"Hours",0);case c:return F(P+"Minutes",1);case l:return F(P+"Seconds",2);case s:return F(P+"Milliseconds",3);default:return this.clone()}},N.endOf=function(x){return this.startOf(x,!1)},N.$set=function(x,A){var V,K=L.p(x),Q="set"+(this.$u?"UTC":""),$=(V={},V[d]=Q+"Date",V[m]=Q+"Date",V[f]=Q+"Month",V[p]=Q+"FullYear",V[c]=Q+"Hours",V[l]=Q+"Minutes",V[s]=Q+"Seconds",V[o]=Q+"Milliseconds",V)[K],F=K===d?this.$D+(A-this.$W):A;if(K===f||K===p){var D=this.clone().set(m,1);D.$d[$](F),D.init(),this.$d=D.set(m,Math.min(this.$D,D.daysInMonth())).$d}else $&&this.$d[$](F);return this.init(),this},N.set=function(x,A){return this.clone().$set(x,A)},N.get=function(x){return this[L.p(x)]()},N.add=function(x,A){var V,K=this;x=Number(x);var Q=L.p(A),$=function(ee){var q=T(K);return L.w(q.date(q.date()+Math.round(ee*x)),K)};if(Q===f)return this.set(f,this.$M+x);if(Q===p)return this.set(p,this.$y+x);if(Q===d)return $(1);if(Q===u)return $(7);var F=(V={},V[l]=r,V[c]=i,V[s]=n,V)[Q]||1,D=this.$d.getTime()+x*F;return L.w(D,this)},N.subtract=function(x,A){return this.add(-1*x,A)},N.format=function(x){var A=this,V=this.$locale();if(!this.isValid())return V.invalidDate||g;var K=x||"YYYY-MM-DDTHH:mm:ssZ",Q=L.z(this),$=this.$H,F=this.$m,D=this.$M,ee=V.weekdays,q=V.months,P=V.meridiem,X=function(pe,be,Me,pt){return pe&&(pe[be]||pe(A,K))||Me[be].slice(0,pt)},he=function(pe){return L.s($%12||12,pe,"0")},le=P||function(pe,be,Me){var pt=pe<12?"AM":"PM";return Me?pt.toLowerCase():pt};return K.replace(b,function(pe,be){return be||function(Me){switch(Me){case"YY":return String(A.$y).slice(-2);case"YYYY":return L.s(A.$y,4,"0");case"M":return D+1;case"MM":return L.s(D+1,2,"0");case"MMM":return X(V.monthsShort,D,q,3);case"MMMM":return X(q,D);case"D":return A.$D;case"DD":return L.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return X(V.weekdaysMin,A.$W,ee,2);case"ddd":return X(V.weekdaysShort,A.$W,ee,3);case"dddd":return ee[A.$W];case"H":return String($);case"HH":return L.s($,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return le($,F,!0);case"A":return le($,F,!1);case"m":return String(F);case"mm":return L.s(F,2,"0");case"s":return String(A.$s);case"ss":return L.s(A.$s,2,"0");case"SSS":return L.s(A.$ms,3,"0");case"Z":return Q}return null}(pe)||Q.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(x,A,V){var K,Q=this,$=L.p(A),F=T(x),D=(F.utcOffset()-this.utcOffset())*r,ee=this-F,q=function(){return L.m(Q,F)};switch($){case p:K=q()/12;break;case f:K=q();break;case h:K=q()/3;break;case u:K=(ee-D)/6048e5;break;case d:K=(ee-D)/864e5;break;case c:K=ee/i;break;case l:K=ee/r;break;case s:K=ee/n;break;default:K=ee}return V?K:L.a(K)},N.daysInMonth=function(){return this.endOf(f).$D},N.$locale=function(){return C[this.$L]},N.locale=function(x,A){if(!x)return this.$L;var V=this.clone(),K=_(x,A,!0);return K&&(V.$L=K),V},N.clone=function(){return L.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},W}(),Y=H.prototype;return T.prototype=Y,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(W){Y[W[1]]=function(N){return this.$g(N,W[0],W[1])}}),T.extend=function(W,N){return W.$i||(W(N,H,T),W.$i=!0),T},T.locale=_,T.isDayjs=I,T.unix=function(W){return T(1e3*W)},T.en=C[O],T.Ls=C,T.p={},T})})(Yh);var $N=Yh.exports;const j=qr($N);var Jh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){var n="week",r="year";return function(i,o,s){var l=o.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(r).add(1,r).date(d),f=s(this).endOf(n);if(u.isBefore(f))return 1}var h=s(this).startOf(r).date(d).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Jh);var NN=Jh.exports;const BN=qr(NN);var Gh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(On,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,l,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,l):!this.isBefore(d,l))&&(h?this.isBefore(u,l):!this.isAfter(u,l))||(f?this.isBefore(d,l):!this.isAfter(d,l))&&(h?this.isAfter(u,l):!this.isBefore(u,l))}}})})(Gh);var AN=Gh.exports;const VN=qr(AN),DN={class:"w-full dark:text-gray-400"},_N={class:"flex justify-between items-center mb-3"},LN={class:"flex"},IN={class:"font-medium flex items-center gap-2"},PN=["value","onChange"],RN=["value"],zN=["value","onChange"],jN=["value"],FN={class:"flex"},HN={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},WN={class:"flex justify-center text-sm"},ta=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:j().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){j.extend(VN),j.extend(BN);const n=t,r=a.ref([j(new Date).subtract(1,"month"),j(new Date)]);a.watch(()=>n.initDates,()=>{var $;if(!n.range&&n.initDates)r.value[0]=j(n.initDates);else if(!n.range&&!n.initDates)r.value[0]=j(new Date);else if(n.range&&(($=n.initDates)==null?void 0:$.length)===2){let F=j(n.initDates[0]),D=j(n.initDates[1]);D.isBefore(F,"month")&&(D=F.add(1,"month")),F.isSame(D,"month")&&(D=F.add(1,"month")),r.value=[F,D]}},{immediate:!0,once:!0}),a.watch(()=>[n.displayYearStart,n.displayMonthStart],([$,F])=>{$&&F&&(r.value[0]=j().year(Number($)).month(Number(F)).startOf("month"),r.value[1]=j().year(Number($)).month(Number(F)).startOf("month").add(1,"month"))},{immediate:!0}),a.watch(()=>[n.displayYearEnd,n.displayMonthEnd],([$,F])=>{if($&&F){const D=r.value[0],ee=j().year(Number($)).month(Number(F)).startOf("month");ee.isAfter(D,"month")&&(r.value[1]=ee)}},{immediate:!0});const i=e,o=a.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s($){if(n.week)i("update:modelValue",[j($).startOf("week"),j($).endOf("week")]);else if(n.range){const F=n.modelValue.filter(D=>D).length;if(F==0)i("update:modelValue",[$]);else if(F==2)i("update:modelValue",[$]);else if(F==1){let D=[j(n.modelValue[0]),j($)];D=D.sort((ee,q)=>ee-q),i("update:modelValue",D)}}else i("update:modelValue",j($))}function l($){const F=j($).daysInMonth(),D=[],ee=j($).startOf("month");for(let q=1;q<=F;q++){let P=ee.clone().date(q);D.push(P)}return D}function c($){return j($).startOf("month").day()}function d($,F){const D=j(`${$}-${F}-01`,"YYYY-MM-DD"),q=D.day(),P=[];for(let X=0;X<q;X++)P.push(D.clone().subtract(q-X,"days"));return P}function u($,F){const D=j(`${$}-${F}`,"YYYY-MM").endOf("month"),q=6-D.day(),P=[];for(let X=1;X<=q;X++)P.push(D.clone().add(X,"days"));return P}function f($){const F=j();return j($).isSame(F,"day")}function h($){var F,D;if(n.range){if(((F=n.modelValue)==null?void 0:F.length)==1)return j($).isSame(j(n.modelValue[0]),"day");if(((D=n.modelValue)==null?void 0:D.length)==2)return j($).isSame(j(n.modelValue[0]),"day")||j($).isSame(j(n.modelValue[1]),"day")}else if(n.modelValue)return j($).isSame(j(n.modelValue),"day")}function p($){var F;if(n.range&&((F=n.modelValue)==null?void 0:F.length)==2)return j($).isBetween(j(n.modelValue[0]),j(n.modelValue[1]))}function m($){var F;if(n.range&&((F=n.modelValue)==null?void 0:F.length)==2)return j($).isSame(j(n.modelValue[0]),"day")}function g($){var F;if(n.range&&((F=n.modelValue)==null?void 0:F.length)==2)return j($).isSame(j(n.modelValue[1]),"day")}function y($){try{return n.minDate?j($).isBefore(j(n.minDate)):!1}catch(F){return console.log(F),!1}}function b($){try{return n.maxDate?j($).isAfter(j(n.maxDate)):!1}catch(F){return console.log(F),!1}}function v($){T($,r.value[$].subtract(1,"month"))}function M($){T($,r.value[$].add(1,"month"))}function k($){T($,r.value[$].subtract(1,"year"))}function O($){T($,r.value[$].add(1,"year"))}const C=$=>o.value.length===1||$===0?!0:r.value[$].subtract(1,"month").isAfter(r.value[0],"month"),B=$=>o.value.length===1||$===1?!0:r.value[$].add(1,"month").isBefore(r.value[1],"month"),I=$=>o.value.length===1||$===0?!0:r.value[$].subtract(1,"year").isAfter(r.value[0],"year"),_=$=>o.value.length===1||$===1?!0:r.value[$].add(1,"year").isBefore(r.value[1],"year");function T($,F){if($===0){if(!o.value.length===1&&!F.isBefore(r.value[1],"month"))return;r.value=[F,r.value[1]]}else{if(!o.value.length===1&&!F.isAfter(r.value[0],"month"))return;(F.isBefore(r.value[0],"month")||F.isSame(r.value[0],"month"))&&(F=r.value[0].add(1,"month")),r.value=[r.value[0],F]}}const L=a.ref();function H($){n.week&&(L.value=j($).week())}function Y($){return j($).week()===L.value}function W($){return j($).week()===L.value?j($).format("YYYY-MM-DD")===j().week(L.value).startOf("week").format("YYYY-MM-DD"):!1}function N($){return j($).week()===L.value?j($).format("YYYY-MM-DD")===j().week(L.value).endOf("week").format("YYYY-MM-DD"):!1}function x(){L.value=null}function A($,F){const D=r.value[$].year(Number(F));T($,D)}function V($,F){const D=r.value[$].month(Number(F));T($,D)}const K=a.computed(()=>{const $=n.defaultMinYear,F=n.defaultMaxYear,D=[];for(let ee=$;ee<=F;ee++)D.push(ee);return D}),Q=["January","February","March","April","May","June","July","August","September","October","November","December"];return($,F)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,D=>{var ee;return a.openBlock(),a.createElementBlock("div",DN,[a.createElementVNode("div",_N,[a.createElementVNode("div",LN,[a.createVNode(ed,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!I(D),"hover:opacity-100":I(D)}]),onClick:q=>I(D)?k(D):null},null,8,["class","onClick"]),a.createVNode(td,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!C(D),"hover:opacity-100":C(D)}]),onClick:q=>C(D)?v(D):null},null,8,["class","onClick"])]),a.createElementVNode("div",IN,[a.createElementVNode("select",{value:r.value[D].format("YYYY"),onChange:q=>A(D,q.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K.value,q=>(a.openBlock(),a.createElementBlock("option",{key:q,value:q},a.toDisplayString(q),9,RN))),128))],40,PN),a.createElementVNode("select",{value:r.value[D].month(),onChange:q=>V(D,q.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(Q,(q,P)=>a.createElementVNode("option",{key:P,value:P},a.toDisplayString(q),9,jN)),64))],40,zN)]),a.createElementVNode("div",FN,[a.createVNode(rd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!B(D),"hover:opacity-100":B(D)}]),onClick:q=>B(D)?M(D):null},null,8,["class","onClick"]),a.createVNode(nd,{class:a.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!_(D),"hover:opacity-100":_(D)}]),onClick:q=>_(D)?O(D):null},null,8,["class","onClick"])])]),a.createElementVNode("div",HN,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(7,q=>{var P;return a.createElementVNode("div",WN,a.toDisplayString((P=r.value[D])==null?void 0:P.clone().startOf("week").subtract(1,"days").add(q,"days").format("ddd")),1)}),64))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:x},[c(r.value[D])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(d(a.unref(j)(r.value[D]).year(),a.unref(j)(r.value[D]).month()+1),q=>(a.openBlock(),a.createBlock(ea,{onClick:P=>!b(q)&&!y(q)?s(q):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(j)(q).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l(r.value[D].clone()),q=>(a.openBlock(),a.createBlock(ea,{onMouseover:P=>H(q),onClick:P=>!b(q)&&!y(q)?s(q):null,today:f(q),selected:h(q),firstDay:m(q)||W(q),lastDay:g(q)||N(q),between:p(q),disabled:b(q)||y(q),off:b(q)||y(q),highlight:Y(q)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(j)(q).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((ee=u(a.unref(j)(r.value[D]).year(),a.unref(j)(r.value[D]).month()+1))==null?void 0:ee.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(u(a.unref(j)(r.value[D]).year(),a.unref(j)(r.value[D]).month()+1),q=>(a.openBlock(),a.createBlock(ea,{onClick:P=>!b(q)&&!y(q)?s(q):null,off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(j)(q).format("D")),1)]),_:2},1032,["onClick"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),UN={},qN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},KN=[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 YN(t,e){return a.openBlock(),a.createElementBlock("svg",qN,KN)}const Zh=ae(UN,[["render",YN]]),JN={},GN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},ZN=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 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 XN(t,e){return a.openBlock(),a.createElementBlock("svg",GN,ZN)}const Xh=ae(JN,[["render",XN]]),QN={class:"flex gap-3"},eB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},tB=["onClick"],nB=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(l){r("update:modelValue",l)}const o=a.computed(()=>{var l;if(n.range)return(l=n.modelValue)==null?void 0:l.map(c=>j(c).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return j(n.modelValue).format("YYYY-MM-DD")}),s=a.reactive([{text:"Month to Date",onClick(l){const c=j().subtract(1,"day"),d=j().startOf("month");r("update:modelValue",[d,c])}},{text:"Last Month",onClick(l){const c=j().startOf("month").subtract(1,"month"),d=j(c).endOf("month");r("update:modelValue",[c,d])}},{text:"Year to Date",onClick(l){const c=j().subtract(1,"day"),d=j().startOf("year");r("update:modelValue",[d,c])}}]);return(l,c)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",QN,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",eB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s,d=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},a.toDisplayString(d.text),9,tB))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>{var d;return[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=o.value)!=null&&d.length)),onOnClear:c[0]||(c[0]=u=>i(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),rB={class:"relative inline-block tabular-nums"},iB=["value","placeholder","maxlength"],na={__name:"DateSegment",props:{modelValue:String,placeholder:String,segment:{type:String,default:"monthOrDay"},disabled:Boolean},emits:["update:modelValue","blur"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(null),o=a.computed(()=>n.segment==="year"?4:2);function s(c){const d=c.target.value.replace(/\D/g,"");r("update:modelValue",d.slice(0,o.value)),d.length>=o.value&&n.nextRef&&a.nextTick(()=>{n.nextRef.focus()})}function l(){r("blur")}return(c,d)=>(a.openBlock(),a.createElementBlock("div",rB,[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,iB)]))}},oB={class:"flex items-center gap-0"},sB=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),lB=a.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),ra={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue","update:initDates","update:displayYear","update:displayMonth"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(""),o=a.ref(""),s=a.ref(""),l=a.ref(null),c=a.ref(null),d=a.ref(null);a.watch(()=>n.modelValue,b=>{n.range?Array.isArray(b)&&b.length===2?(yearStart.value=b[0]?j(b[0]).format("YYYY"):"",monthStart.value=b[0]?j(b[0]).format("MM"):"",dayStart.value=b[0]?j(b[0]).format("DD"):"",yearEnd.value=b[1]?j(b[1]).format("YYYY"):"",monthEnd.value=b[1]?j(b[1]).format("MM"):"",dayEnd.value=b[1]?j(b[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):b?(i.value=j(b).format("YYYY"),o.value=j(b).format("MM"),s.value=j(b).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(b){b.length===4&&r("update:displayYear",Number(b)),u()}function h(b){b.length===2&&r("update:displayMonth",Number(b)-1),u()}function p(b){s.value=b,u()}function m(){i.value||(i.value=j().format("YYYY")),u()}function g(){o.value||(o.value=j().format("MM")),u()}function y(){s.value||(s.value=j().format("DD")),u()}return(b,v)=>(a.openBlock(),a.createElementBlock("div",oB,[a.createVNode(na,{modelValue:i.value,"onUpdate:modelValue":[v[0]||(v[0]=M=>i.value=M),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),sB,a.createVNode(na,{modelValue:o.value,"onUpdate:modelValue":[v[1]||(v[1]=M=>o.value=M),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),lB,a.createVNode(na,{modelValue:s.value,"onUpdate:modelValue":[v[2]||(v[2]=M=>s.value=M),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},aB={class:"tabular-nums"},cB={key:1,class:"flex items-center"},dB=a.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),uB={class:"flex gap-3"},fB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},hB=["onClick"],pB=Object.assign({name:"WpicAdvDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;a.ref(!1);const i=a.ref(j().year()),o=a.ref(j().month()),s=a.ref(null),l=a.ref(null);function c(){r("update:modelValue",null)}a.watch(()=>n.initDates,h=>{var p;n.range&&((p=n.initDates)==null?void 0:p.length)==2?(i.value=j(n.initDates[0]).year(),o.value=j(n.initDates[0]).month(),s.value=j(n.initDates[1]).year(),l.value=j(n.initDates[1]).month()):n.initDates&&(i.value=j(n.initDates).year(),o.value=j(n.initDates).month())},{immediate:!0});const d=a.ref(n.range?[]:"");a.watch(()=>n.modelValue,h=>{if(n.range){const p=h!=null&&h[0]?j(h[0]).format("YYYY-MM-DD"):"",m=h!=null&&h[1]?j(h[1]).format("YYYY-MM-DD"):"";(d.value[0]!==p||d.value[1]!==m)&&(d.value=[p,m])}else{const p=h?j(h).format("YYYY-MM-DD"):"";d.value!==p&&(d.value=p)}},{immediate:!0}),a.watch(()=>d.value,h=>{var p,m;if(n.range){const g=h[0]&&h[0].length===10?j(h[0]).toDate():null,y=h[1]&&h[1].length===10?j(h[1]).toDate():null;(!((p=n.modelValue)!=null&&p[0])||n.modelValue[0]!==g||!((m=n.modelValue)!=null&&m[1])||n.modelValue[1]!==y)&&r("update:modelValue",[g,y])}else if(h&&h.length===10){const g=j(h,"YYYY-MM-DD",!0);g.isValid()&&n.modelValue!==g.toDate()&&r("update:modelValue",g.toDate())}},{deep:!0});function u(h){r("update:modelValue",h)}const f=a.reactive([{text:"Month to Date",onClick(h){const p=j().subtract(1,"day"),m=j().startOf("month");r("update:modelValue",[m,p])}},{text:"Last Month",onClick(h){const p=j().startOf("month").subtract(1,"month"),m=j(p).endOf("month");r("update:modelValue",[p,m])}},{text:"Year to Date",onClick(h){const p=j().subtract(1,"day"),m=j().startOf("year");r("update:modelValue",[m,p])}}]);return(h,p)=>(a.openBlock(),a.createBlock(En,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:a.withCtx(()=>[a.createElementVNode("div",uB,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",fB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f,m=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:g=>m.onClick()},a.toDisplayString(m.text),9,hB))),256))])):a.createCommentVNode("",!0),a.createVNode(ta,{doubleMonths:t.doubleMonths,displayYearStart:i.value,displayMonthStart:o.value,displayYearEnd:s.value,displayMonthEnd:l.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:n.range?[...d.value]:d.value,"onUpdate:modelValue":u,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(Ur,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:t.clearable&&!!t.modelValue,onOnClear:c},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Zh,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Xh,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createElementVNode("div",aB,[t.range?t.range?(a.openBlock(),a.createElementBlock("div",cB,[a.createVNode(ra,{modelValue:d.value[0],"onUpdate:modelValue":p[3]||(p[3]=m=>d.value[0]=m),disabled:t.disabled,"onUpdate:displayYear":p[4]||(p[4]=m=>i.value=m),"onUpdate:displayMonth":p[5]||(p[5]=m=>o.value=m)},null,8,["modelValue","disabled"]),dB,a.createVNode(ra,{modelValue:d.value[1],"onUpdate:modelValue":p[6]||(p[6]=m=>d.value[1]=m),disabled:t.disabled,"onUpdate:displayYear":p[7]||(p[7]=m=>{s.value=m}),"onUpdate:displayMonth":p[8]||(p[8]=m=>{l.value=m})},null,8,["modelValue","disabled"])])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(t.placeholder),1)],64)):(a.openBlock(),a.createBlock(ra,{key:0,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),disabled:t.disabled,"onUpdate:displayYear":p[1]||(p[1]=m=>i.value=m),"onUpdate:displayMonth":p[2]||(p[2]=m=>o.value=m)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),mB=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(ne).theme]]:!0}])},[a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[a.renderSlot(d.$slots,"default")],2)],2)],2))}}),gB={class:"absolute inset-0 flex items-center justify-center py-12"},yB={class:"text-lg font-medium dark:text-gray-300"},bB={key:0,class:"flex justify-end px-6 pb-4"},kB=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",gB,[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",yB,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode(Wr,{class:"w-6 h-6"})])],2),a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[a.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(a.openBlock(),a.createElementBlock("div",bB,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),xB=["onClick"],wB=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,xB))),128))],2),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),vB=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)}}),CB={},SB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},EB=[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 OB(t,e){return a.openBlock(),a.createElementBlock("svg",SB,EB)}const MB=ae(CB,[["render",OB]]),TB={},$B={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},NB=[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 BB(t,e){return a.openBlock(),a.createElementBlock("svg",$B,NB)}const AB=ae(TB,[["render",BB]]),VB={},DB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},_B=[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 LB(t,e){return a.openBlock(),a.createElementBlock("svg",DB,_B)}const IB=ae(VB,[["render",LB]]),PB={},RB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},zB=[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 jB(t,e){return a.openBlock(),a.createElementBlock("svg",RB,zB)}const FB=ae(PB,[["render",jB]]),HB={key:0,class:"w-6 opacity-50"},WB={class:"flex-1"},UB={key:0,class:"mb-2"},qB=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",HB,[t.warning?(a.openBlock(),a.createBlock(MB,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock(AB,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(IB,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(FB,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",WB,[t.title?(a.openBlock(),a.createElementBlock("div",UB,a.toDisplayString(t.title),1)):a.createCommentVNode("",!0),a.createElementVNode("span",{class:a.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[a.renderSlot(e.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.text),1)])],2)])],2))}}),ia=a.ref(!1),Qh=a.ref(""),ep=a.ref(""),tp=a.ref(!1),np=a.ref(!1),rp=a.ref(!1);let ip=()=>{},op=()=>{};function oa(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{Qh.value=i,ep.value=o,tp.value=s,np.value=l,rp.value=u,ip=c||(()=>{}),op=d||(()=>{}),ia.value=!0},e=()=>{ia.value=!1};return{visible:ia,title:Qh,text:ep,positive:tp,negative:np,show:t,onConfirm:()=>{ip(),e()},onCancel:()=>{op(),e()},blur:rp}}const KB={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},YB={class:"text-lg font-semibold mb-6"},JB={class:"mb-12"},GB={class:"flex justify-end"},sa={WpicColorPicker:Zc,WpicAlert:qB,WpicToggleSwitch:Jc,WpicAdvDateField:pB,WpicCalendar:ta,WpicTextarea:Gc,WpicDialog:kB,WpicSlidePanel:mB,WpicDateField:nB,WpicFormInput:Ur,WpicButton:Pr,WpicBadge:TN,WpicTextEditor:uN,WpicInputGroup:Lm,WpicButtonGroup:Am,WpicForm:Im,WpicFormField:Xc,WpicSpinner:Jn,WpicTooltip:Qc,WpicPopover:En,WpicChoiceList:Yc,WpicCard:Lw,WpicCardSection:Rw,WpicProgressBar:Fw,WpicTag:Ww,WpicTagGroup:Uw,WpicPagination:vv,WpicLoadingPanel:Jw,WpicTable:t5,WpicTableColumn:n5,WpicTabs:wB,WpicTabPane:vB,WpicConfirm:ae(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l,blur:c}=oa();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",KB,[a.createElementVNode("div",YB,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",JB,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",GB,[a.createVNode(Pr,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode("Cancel")]),_:1},8,["onClick"]),a.createVNode(Pr,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-5a5fff11"]])};function sp(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?sp(t[n],e[n]):t[n]=e[n])}const ZB={useConfirm:oa};function XB(t,e){sp(ne,e);for(const n in sa)if(sa.hasOwnProperty(n)){const r=sa[n];t.component(r.name,r)}}const QB={install:XB,composables:ZB,options:ne};Yt.default=QB,Yt.useConfirm=oa,Object.defineProperties(Yt,{__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(a,c)=>(l.openBlock(),l.createElementBlock("div",{class:l.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}])},[l.createElementVNode("div",{class:l.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[l.unref(fe).theme]}`]:t.between,[`${i[l.unref(fe).theme]}`]:t.firstDay,[`${o[l.unref(fe).theme]}`]:t.lastDay,[`${s[l.unref(fe).theme]}`]:t.highlight}]),style:l.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[l.createElementVNode("span",{class:l.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[l.unref(fe).theme]}`]:!0,[`${n[l.unref(fe).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[l.renderSlot(a.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.day),1)])],2)],6)],2))}};var _c={exports:{}},Ig;function qs(){return Ig||(Ig=1,function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="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(Y){var I=["th","st","nd","rd"],T=Y%100;return"["+Y+(I[(T-20)%10]||I[T]||I[0])+"]"}},w=function(Y,I,T){var R=String(Y);return!R||R.length>=I?Y:""+Array(I+1-R.length).join(T)+Y},b={s:w,z:function(Y){var I=-Y.utcOffset(),T=Math.abs(I),R=Math.floor(T/60),F=T%60;return(I<=0?"+":"-")+w(R,2,"0")+":"+w(F,2,"0")},m:function Y(I,T){if(I.date()<T.date())return-Y(T,I);var R=12*(T.year()-I.year())+(T.month()-I.month()),F=I.clone().add(R,f),ee=T-F<0,ie=I.clone().add(R+(ee?-1:1),f);return+(-(R+(T-F)/(ee?F-ie:ie-F))||0)},a:function(Y){return Y<0?Math.ceil(Y)||0:Math.floor(Y)},p:function(Y){return{M:f,y:p,w:u,d,D:m,h:c,m:a,s,ms:o,Q:h}[Y]||String(Y||"").toLowerCase().replace(/s$/,"")},u:function(Y){return Y===void 0}},C="en",v={};v[C]=x;var S="$isDayjsObject",D=function(Y){return Y instanceof B||!(!Y||!Y[S])},O=function Y(I,T,R){var F;if(!I)return C;if(typeof I=="string"){var ee=I.toLowerCase();v[ee]&&(F=ee),T&&(v[ee]=T,F=ee);var ie=I.split("-");if(!F&&ie.length>1)return Y(ie[0])}else{var he=I.name;v[he]=I,F=he}return!R&&F&&(C=F),F||!R&&C},$=function(Y,I){if(D(Y))return Y.clone();var T=typeof I=="object"?I:{};return T.date=Y,T.args=arguments,new B(T)},V=b;V.l=O,V.i=D,V.w=function(Y,I){return $(Y,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var B=function(){function Y(T){this.$L=O(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[S]=!0}var I=Y.prototype;return I.parse=function(T){this.$d=function(R){var F=R.date,ee=R.utc;if(F===null)return new Date(NaN);if(V.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var ie=F.match(y);if(ie){var he=ie[2]-1||0,ue=(ie[7]||"0").substring(0,3);return ee?new Date(Date.UTC(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)):new Date(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)}}return new Date(F)}(T),this.init()},I.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},I.$utils=function(){return V},I.isValid=function(){return this.$d.toString()!==g},I.isSame=function(T,R){var F=$(T);return this.startOf(R)<=F&&F<=this.endOf(R)},I.isAfter=function(T,R){return $(T)<this.startOf(R)},I.isBefore=function(T,R){return this.endOf(R)<$(T)},I.$g=function(T,R,F){return V.u(T)?this[R]:this.set(F,T)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(T,R){var F=this,ee=!!V.u(R)||R,ie=V.p(T),he=function(le,ve){var Ne=V.w(F.$u?Date.UTC(F.$y,ve,le):new Date(F.$y,ve,le),F);return ee?Ne:Ne.endOf(d)},ue=function(le,ve){return V.w(F.toDate()[le].apply(F.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ve)),F)},L=this.$W,z=this.$M,q=this.$D,U="set"+(this.$u?"UTC":"");switch(ie){case p:return ee?he(1,0):he(31,11);case f:return ee?he(1,z):he(0,z+1);case u:var j=this.$locale().weekStart||0,ce=(L<j?L+7:L)-j;return he(ee?q-ce:q+(6-ce),z);case d:case m:return ue(U+"Hours",0);case c:return ue(U+"Minutes",1);case a:return ue(U+"Seconds",2);case s:return ue(U+"Milliseconds",3);default:return this.clone()}},I.endOf=function(T){return this.startOf(T,!1)},I.$set=function(T,R){var F,ee=V.p(T),ie="set"+(this.$u?"UTC":""),he=(F={},F[d]=ie+"Date",F[m]=ie+"Date",F[f]=ie+"Month",F[p]=ie+"FullYear",F[c]=ie+"Hours",F[a]=ie+"Minutes",F[s]=ie+"Seconds",F[o]=ie+"Milliseconds",F)[ee],ue=ee===d?this.$D+(R-this.$W):R;if(ee===f||ee===p){var L=this.clone().set(m,1);L.$d[he](ue),L.init(),this.$d=L.set(m,Math.min(this.$D,L.daysInMonth())).$d}else he&&this.$d[he](ue);return this.init(),this},I.set=function(T,R){return this.clone().$set(T,R)},I.get=function(T){return this[V.p(T)]()},I.add=function(T,R){var F,ee=this;T=Number(T);var ie=V.p(R),he=function(z){var q=$(ee);return V.w(q.date(q.date()+Math.round(z*T)),ee)};if(ie===f)return this.set(f,this.$M+T);if(ie===p)return this.set(p,this.$y+T);if(ie===d)return he(1);if(ie===u)return he(7);var ue=(F={},F[a]=r,F[c]=i,F[s]=n,F)[ie]||1,L=this.$d.getTime()+T*ue;return V.w(L,this)},I.subtract=function(T,R){return this.add(-1*T,R)},I.format=function(T){var R=this,F=this.$locale();if(!this.isValid())return F.invalidDate||g;var ee=T||"YYYY-MM-DDTHH:mm:ssZ",ie=V.z(this),he=this.$H,ue=this.$m,L=this.$M,z=F.weekdays,q=F.months,U=F.meridiem,j=function(ve,Ne,Ie,tt){return ve&&(ve[Ne]||ve(R,ee))||Ie[Ne].slice(0,tt)},ce=function(ve){return V.s(he%12||12,ve,"0")},le=U||function(ve,Ne,Ie){var tt=ve<12?"AM":"PM";return Ie?tt.toLowerCase():tt};return ee.replace(k,function(ve,Ne){return Ne||function(Ie){switch(Ie){case"YY":return String(R.$y).slice(-2);case"YYYY":return V.s(R.$y,4,"0");case"M":return L+1;case"MM":return V.s(L+1,2,"0");case"MMM":return j(F.monthsShort,L,q,3);case"MMMM":return j(q,L);case"D":return R.$D;case"DD":return V.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return j(F.weekdaysMin,R.$W,z,2);case"ddd":return j(F.weekdaysShort,R.$W,z,3);case"dddd":return z[R.$W];case"H":return String(he);case"HH":return V.s(he,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return le(he,ue,!0);case"A":return le(he,ue,!1);case"m":return String(ue);case"mm":return V.s(ue,2,"0");case"s":return String(R.$s);case"ss":return V.s(R.$s,2,"0");case"SSS":return V.s(R.$ms,3,"0");case"Z":return ie}return null}(ve)||ie.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(T,R,F){var ee,ie=this,he=V.p(R),ue=$(T),L=(ue.utcOffset()-this.utcOffset())*r,z=this-ue,q=function(){return V.m(ie,ue)};switch(he){case p:ee=q()/12;break;case f:ee=q();break;case h:ee=q()/3;break;case u:ee=(z-L)/6048e5;break;case d:ee=(z-L)/864e5;break;case c:ee=z/i;break;case a:ee=z/r;break;case s:ee=z/n;break;default:ee=z}return F?ee:V.a(ee)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return v[this.$L]},I.locale=function(T,R){if(!T)return this.$L;var F=this.clone(),ee=O(T,R,!0);return ee&&(F.$L=ee),F},I.clone=function(){return V.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},Y}(),J=B.prototype;return $.prototype=J,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(Y){J[Y[1]]=function(I){return this.$g(I,Y[0],Y[1])}}),$.extend=function(Y,I){return Y.$i||(Y(I,B,$),Y.$i=!0),$},$.locale=O,$.isDayjs=D,$.unix=function(Y){return $(1e3*Y)},$.en=v[C],$.Ls=v,$.p={},$})}(_c)),_c.exports}var gB=qs();const K=Ri(gB);var yB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,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,a){return a==="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,a){var c=100*s+a;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o})})(yB);var bB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,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})})(bB);var kB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,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})})(kB);var Vg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n="week",r="year";return function(i,o,s){var a=o.prototype;a.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)},a.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Vg);var vB=Vg.exports;const wB=Ri(vB);var Pg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,a,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,a):!this.isBefore(d,a))&&(h?this.isBefore(u,a):!this.isAfter(u,a))||(f?this.isBefore(d,a):!this.isAfter(d,a))&&(h?this.isAfter(u,a):!this.isBefore(u,a))}}})})(Pg);var xB=Pg.exports;const EB=Ri(xB),CB={class:"w-full dark:text-gray-400"},SB={class:"flex justify-between items-center mb-3"},_B={class:"flex"},OB={class:"font-medium flex items-center gap-2"},TB=["value","onChange"],NB=["value"],MB=["value","onChange"],AB=["value"],DB={class:"flex"},$B={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:K().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=jn();K.extend(EB),K.extend(wB);const r=t,i=l.computed(()=>Array.from({length:7},(z,q)=>K().day((1+q)%7).locale(n.value).format("ddd"))),o=l.ref([K(new Date).subtract(1,"month"),K(new Date)]);l.watch(()=>r.initDates,()=>{var L;if(!r.range&&r.initDates)o.value[0]=K(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=K(new Date);else if(r.range&&((L=r.initDates)==null?void 0:L.length)===2){let z=K(r.initDates[0]),q=K(r.initDates[1]);q.isBefore(z,"month")&&(q=z.add(1,"month")),z.isSame(q,"month")&&(q=z.add(1,"month")),o.value=[z,q]}},{immediate:!0,once:!0}),l.watch(()=>[r.displayYearStart,r.displayMonthStart],([L,z])=>{L&&z&&(o.value[0]=K().year(Number(L)).month(Number(z)).startOf("month"),o.value[1]=K().year(Number(L)).month(Number(z)).startOf("month").add(1,"month"))},{immediate:!0}),l.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([L,z])=>{if(L&&z){const q=o.value[0],U=K().year(Number(L)).month(Number(z)).startOf("month");U.isAfter(q,"month")&&(o.value[1]=U)}},{immediate:!0});const s=e,a=l.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(L){if(r.week)s("update:modelValue",[K(L).startOf("week"),K(L).endOf("week")]);else if(r.range){const z=r.modelValue.filter(q=>q).length;if(z==0)s("update:modelValue",[L]);else if(z==2)s("update:modelValue",[L]);else if(z==1){let q=[K(r.modelValue[0]),K(L)];q=q.sort((U,j)=>U-j),s("update:modelValue",q)}}else s("update:modelValue",K(L))}function d(L){const z=K(L).daysInMonth(),q=[],U=K(L).startOf("month");for(let j=1;j<=z;j++){let ce=U.clone().date(j);q.push(ce)}return q}function u(L){return K(L).startOf("month").day()}function f(L,z){const q=K(`${L}-${z}-01`,"YYYY-MM-DD"),j=q.day(),ce=[];for(let le=0;le<j;le++)ce.push(q.clone().subtract(j-le,"days"));return ce}function h(L,z){const q=K(`${L}-${z}`,"YYYY-MM").endOf("month"),j=6-q.day(),ce=[];for(let le=1;le<=j;le++)ce.push(q.clone().add(le,"days"));return ce}function p(L){const z=K();return K(L).isSame(z,"day")}function m(L){var z,q;if(r.range){if(((z=r.modelValue)==null?void 0:z.length)==1)return K(L).isSame(K(r.modelValue[0]),"day");if(((q=r.modelValue)==null?void 0:q.length)==2)return K(L).isSame(K(r.modelValue[0]),"day")||K(L).isSame(K(r.modelValue[1]),"day")}else if(r.modelValue)return K(L).isSame(K(r.modelValue),"day")}function g(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isBetween(K(r.modelValue[0]),K(r.modelValue[1]))}function y(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isSame(K(r.modelValue[0]),"day")}function k(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isSame(K(r.modelValue[1]),"day")}function x(L){try{return r.minDate?K(L).isBefore(K(r.minDate)):!1}catch(z){return console.log(z),!1}}function w(L){try{return r.maxDate?K(L).isAfter(K(r.maxDate)):!1}catch(z){return console.log(z),!1}}function b(L){B(L,o.value[L].subtract(1,"month"))}function C(L){B(L,o.value[L].add(1,"month"))}function v(L){B(L,o.value[L].subtract(1,"year"))}function S(L){B(L,o.value[L].add(1,"year"))}const D=L=>a.value.length===1||L===0?!0:o.value[L].subtract(1,"month").isAfter(o.value[0],"month"),O=L=>a.value.length===1||L===1?!0:o.value[L].add(1,"month").isBefore(o.value[1],"month"),$=L=>a.value.length===1||L===0?!0:o.value[L].subtract(1,"year").isAfter(o.value[0],"year"),V=L=>a.value.length===1||L===1?!0:o.value[L].add(1,"year").isBefore(o.value[1],"year");function B(L,z){if(L===0){if(!a.value.length===1&&!z.isBefore(o.value[1],"month"))return;o.value=[z,o.value[1]]}else{if(!a.value.length===1&&!z.isAfter(o.value[0],"month"))return;(z.isBefore(o.value[0],"month")||z.isSame(o.value[0],"month"))&&(z=o.value[0].add(1,"month")),o.value=[o.value[0],z]}}const J=l.ref();function Y(L){r.week&&(J.value=K(L).week())}function I(L){return K(L).week()===J.value}function T(L){return K(L).week()===J.value?K(L).format("YYYY-MM-DD")===K().week(J.value).startOf("week").format("YYYY-MM-DD"):!1}function R(L){return K(L).week()===J.value?K(L).format("YYYY-MM-DD")===K().week(J.value).endOf("week").format("YYYY-MM-DD"):!1}function F(){J.value=null}function ee(L,z){const q=o.value[L].year(Number(z));B(L,q)}function ie(L,z){const q=o.value[L].month(Number(z));B(L,q)}const he=l.computed(()=>{const L=r.defaultMinYear,z=r.defaultMaxYear,q=[];for(let U=L;U<=z;U++)q.push(U);return q}),ue=l.computed(()=>Array.from({length:12},(L,z)=>K().month(z).locale(n.value).format("MMMM")));return(L,z)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":a.value.length===1,"min-w-192":a.value.length===2}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,q=>{var U;return l.openBlock(),l.createElementBlock("div",CB,[l.createElementVNode("div",SB,[l.createElementVNode("div",_B,[l.createVNode(Hf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(q),"hover:opacity-100":$(q)}]),onClick:j=>$(q)?v(q):null},null,8,["class","onClick"]),l.createVNode(Wf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!D(q),"hover:opacity-100":D(q)}]),onClick:j=>D(q)?b(q):null},null,8,["class","onClick"])]),l.createElementVNode("div",OB,[l.createElementVNode("select",{value:o.value[q].format("YYYY"),onChange:j=>ee(q,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(he.value,j=>(l.openBlock(),l.createElementBlock("option",{key:j,value:j},l.toDisplayString(j),9,NB))),128))],40,TB),l.createElementVNode("select",{value:o.value[q].month(),onChange:j=>ie(q,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ue.value,(j,ce)=>(l.openBlock(),l.createElementBlock("option",{key:ce,value:ce},l.toDisplayString(j),9,AB))),128))],40,MB)]),l.createElementVNode("div",DB,[l.createVNode(Yf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!O(q),"hover:opacity-100":O(q)}]),onClick:j=>O(q)?C(q):null},null,8,["class","onClick"]),l.createVNode(Uf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!V(q),"hover:opacity-100":V(q)}]),onClick:j=>V(q)?S(q):null},null,8,["class","onClick"])])]),l.createElementVNode("div",$B,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(j,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"flex justify-center text-sm"},l.toDisplayString(j),1))),128))]),l.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:F},[u(o.value[q])>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(f(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!w(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d(o.value[q].clone()),j=>(l.openBlock(),l.createBlock(Sc,{onMouseover:ce=>Y(j),onClick:ce=>!w(j)&&!x(j)?c(j):null,today:p(j),selected:m(j),firstDay:y(j)||T(j),lastDay:k(j)||R(j),between:g(j),disabled:w(j)||x(j),off:w(j)||x(j),highlight:I(j)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((U=h(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1))==null?void 0:U.length)>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(h(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!w(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0)],32)])}),256))],2))}}),LB={},BB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},IB=[l.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 VB(t,e){return l.openBlock(),l.createElementBlock("svg",BB,IB)}const Rg=be(LB,[["render",VB]]),PB={},RB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},FB=[l.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 jB(t,e){return l.openBlock(),l.createElementBlock("svg",RB,FB)}const Fg=be(PB,[["render",jB]]),zB={class:"flex gap-3"},HB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},WB=["onClick"],UB=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}=jn(),r=t,i=l.computed(()=>r.placeholder==="Select date"?n("ui.select_date"):r.placeholder),o=e;function s(d){o("update:modelValue",d)}const a=l.computed(()=>{var d;if(r.range)return(d=r.modelValue)==null?void 0:d.map(u=>K(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return K(r.modelValue).format("YYYY-MM-DD")}),c=l.reactive([{text:l.computed(()=>n("ui.month_to_date")),onClick(d){const u=K().subtract(1,"day"),f=K().startOf("month");o("update:modelValue",[f,u])}},{text:l.computed(()=>n("ui.last_month")),onClick(d){const u=K().startOf("month").subtract(1,"month"),f=K(u).endOf("month");o("update:modelValue",[u,f])}},{text:l.computed(()=>n("ui.year_to_date")),onClick(d){const u=K().subtract(1,"day"),f=K().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px"},{content:l.withCtx(()=>[l.createElementVNode("div",zB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",HB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,f=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:h=>f.onClick()},l.toDisplayString(f.text),9,WB))),256))])):l.createCommentVNode("",!0),l.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:l.withCtx(()=>{var f;return[l.createVNode(Pi,{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=a.value)!=null&&f.length)),onOnClear:u[0]||(u[0]=h=>s(null))},{prepend:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Rg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Fg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(a.value||i.value),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),YB={class:"relative inline-block tabular-nums"},qB=["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=l.ref(null),o=l.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&&l.nextTick(()=>{n.nextRef.focus()})}function a(){r("blur")}return(c,d)=>(l.openBlock(),l.createElementBlock("div",YB,[l.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:a,placeholder:t.placeholder,class:l.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,qB)]))}},KB={class:"flex items-center gap-0"},GB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),JB=l.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=l.ref(""),o=l.ref(""),s=l.ref(""),a=l.ref(null),c=l.ref(null),d=l.ref(null);l.watch(()=>n.modelValue,k=>{n.range?Array.isArray(k)&&k.length===2?(yearStart.value=k[0]?K(k[0]).format("YYYY"):"",monthStart.value=k[0]?K(k[0]).format("MM"):"",dayStart.value=k[0]?K(k[0]).format("DD"):"",yearEnd.value=k[1]?K(k[1]).format("YYYY"):"",monthEnd.value=k[1]?K(k[1]).format("MM"):"",dayEnd.value=k[1]?K(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=K(k).format("YYYY"),o.value=K(k).format("MM"),s.value=K(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=K().format("YYYY")),u()}function g(){o.value||(o.value=K().format("MM")),u()}function y(){s.value||(s.value=K().format("DD")),u()}return(k,x)=>(l.openBlock(),l.createElementBlock("div",KB,[l.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:a},null,8,["modelValue","disabled"]),GB,l.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"]),JB,l.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"])]))}},ZB={class:"tabular-nums"},XB={key:1,class:"flex items-center"},QB=l.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),eI={class:"flex gap-3"},tI={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},nI=["onClick"],rI=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}=jn(),r=t,i=e,o=l.computed(()=>r.placeholder==="Select date"?n("ui.select_date"):r.placeholder);l.ref(!1);const s=l.ref(K().year()),a=l.ref(K().month()),c=l.ref(null),d=l.ref(null);function u(){i("update:modelValue",null)}l.watch(()=>r.initDates,m=>{var g;r.range&&((g=r.initDates)==null?void 0:g.length)==2?(s.value=K(r.initDates[0]).year(),a.value=K(r.initDates[0]).month(),c.value=K(r.initDates[1]).year(),d.value=K(r.initDates[1]).month()):r.initDates&&(s.value=K(r.initDates).year(),a.value=K(r.initDates).month())},{immediate:!0});const f=l.ref(r.range?[]:"");l.watch(()=>r.modelValue,m=>{if(r.range){const g=m!=null&&m[0]?K(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?K(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?K(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),l.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?K(m[0]).toDate():null,x=m[1]&&m[1].length===10?K(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=K(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=l.reactive([{text:l.computed(()=>n("ui.month_to_date")),onClick(m){const g=K().subtract(1,"day"),y=K().startOf("month");i("update:modelValue",[y,g])}},{text:l.computed(()=>n("ui.last_month")),onClick(m){const g=K().startOf("month").subtract(1,"month"),y=K(g).endOf("month");i("update:modelValue",[g,y])}},{text:l.computed(()=>n("ui.year_to_date")),onClick(m){const g=K().subtract(1,"day"),y=K().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:l.withCtx(()=>[l.createElementVNode("div",eI,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",tI,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p,y=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:k=>y.onClick()},l.toDisplayString(y.text),9,nI))),256))])):l.createCommentVNode("",!0),l.createVNode(Oc,{doubleMonths:t.doubleMonths,displayYearStart:s.value,displayMonthStart:a.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:l.withCtx(()=>[l.createVNode(Pi,{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:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Rg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Fg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createElementVNode("div",ZB,[t.range?t.range?(l.openBlock(),l.createElementBlock("div",XB,[l.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=>a.value=y)},null,8,["modelValue","disabled"]),QB,l.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"])])):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[l.createTextVNode(l.toDisplayString(o.value),1)],64)):(l.openBlock(),l.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=>a.value=y)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),iI=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:a});const s=l.ref(null);function a(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.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:l.withModifiers(o,["self"])},[l.createElementVNode("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[l.renderSlot(d.$slots,"default")],2)],2)],2))}}),oI={class:"absolute inset-0 flex items-center justify-center py-12"},sI={class:"text-lg font-medium dark:text-gray-300"},aI={key:0,class:"flex justify-end px-6 pb-4"},lI=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=l.ref(null),a=l.ref(!1);function c(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(a.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return l.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),l.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:a}),(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[l.createElementVNode("div",oI,[l.createElementVNode("div",{class:l.normalizeClass(["absolute transition-opacity inset-0 bg-black/10 dark:bg-black/50 z-10",{"backdrop-blur-md":t.blur}]),onClick:o},null,2),l.createElementVNode("div",{class:l.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}])},[l.createElementVNode("div",{class:l.normalizeClass(["px-6 pt-4 pb-4 flex items-center justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[l.createElementVNode("span",sI,l.toDisplayString(t.title),1),l.createElementVNode("span",{class:"cursor-pointer",onClick:o},[l.createVNode(Di,{class:"w-6 h-6"})])],2),l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[l.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(l.openBlock(),l.createElementBlock("div",aI,[l.renderSlot(f.$slots,"buttons")])):l.createCommentVNode("",!0)],2)])],2))}}),cI=["onClick"],dI=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=l.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},a=l.computed(()=>n.modelValue);return l.provide("addTab",s),l.provide("modelValue",a),(c,d)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",{class:l.normalizeClass(["wpic-tabs flex dark:border-gray-930 overflow-x-auto overflow-y-hidden",{"border-b-[1px]":!t.pills}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,u=>(l.openBlock(),l.createElementBlock("div",{key:u.name,class:l.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)},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(u.labelSlot||"span"),{class:l.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},{default:l.withCtx(()=>[u.labelSlot?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(u.label),1)],64))]),_:2},1032,["class"]))],10,cI))),128))],2),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"default")])],64))}}),uI=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=l.ref(!1),r=l.inject("addTab"),i=l.inject("modelValue"),o=l.useSlots();return l.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled,labelSlot:o.label})}),l.watch(()=>i.value,s=>{n.value=s===e.name},{immediate:!0,deep:!0}),(s,a)=>n.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[l.renderSlot(s.$slots,"default")],2)):l.createCommentVNode("",!0)}}),fI={},hI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},pI=[l.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 mI(t,e){return l.openBlock(),l.createElementBlock("svg",hI,pI)}const gI=be(fI,[["render",mI]]),yI={},bI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},kI=[l.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 vI(t,e){return l.openBlock(),l.createElementBlock("svg",bI,kI)}const wI=be(yI,[["render",vI]]),xI={},EI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},CI=[l.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 SI(t,e){return l.openBlock(),l.createElementBlock("svg",EI,CI)}const _I=be(xI,[["render",SI]]),OI={},TI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},NI=[l.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 MI(t,e){return l.openBlock(),l.createElementBlock("svg",TI,NI)}const AI=be(OI,[["render",MI]]),DI={key:0,class:"w-6 opacity-50"},$I={class:"flex-1"},LI={key:0,class:"mb-2"},BI=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.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?(l.openBlock(),l.createElementBlock("div",DI,[t.warning?(l.openBlock(),l.createBlock(gI,{key:0,class:"w-full aspect-square"})):t.info?(l.openBlock(),l.createBlock(wI,{key:1,class:"w-full aspect-square"})):t.success?(l.openBlock(),l.createBlock(_I,{key:2,class:"w-full aspect-square"})):t.error?(l.openBlock(),l.createBlock(AI,{key:3,class:"w-full aspect-square"})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",$I,[t.title?(l.openBlock(),l.createElementBlock("div",LI,l.toDisplayString(t.title),1)):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.text),1)])],2)])],2))}}),Mc=l.ref(!1),jg=l.ref(""),zg=l.ref(""),Hg=l.ref(!1),Wg=l.ref(!1),Ug=l.ref(!1);let Yg=()=>{},qg=()=>{};function Ac(){const t=({title:i,text:o,positive:s=!1,negative:a=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{jg.value=i,zg.value=o,Hg.value=s,Wg.value=a,Ug.value=u,Yg=c||(()=>{}),qg=d||(()=>{}),Mc.value=!0},e=()=>{Mc.value=!1};return{visible:Mc,title:jg,text:zg,positive:Hg,negative:Wg,show:t,onConfirm:()=>{Yg(),e()},onCancel:()=>{qg(),e()},blur:Ug}}const II={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},VI={class:"text-lg font-semibold mb-6"},PI={class:"mb-12"},RI={class:"flex justify-end"},Dc={WpicColorPicker:Ff,WpicAlert:BI,WpicToggleSwitch:Pf,WpicAdvDateField:rI,WpicCalendar:Oc,WpicTextarea:Rf,WpicDialog:lI,WpicSlidePanel:iI,WpicDateField:UB,WpicFormInput:Pi,WpicButton:_i,WpicBadge:mB,WpicTextEditor:XL,WpicInputGroup:Cy,WpicButtonGroup:vy,WpicForm:Sy,WpicFormField:jf,WpicSpinner:Ir,WpicTooltip:zf,WpicPopover:dr,WpicChoiceList:Vf,WpicCard:T_,WpicCardSection:A_,WpicProgressBar:L_,WpicTag:I_,WpicTagGroup:V_,WpicPagination:cO,WpicLoadingPanel:j_,WpicTable:zO,WpicTableColumn:HO,WpicTabs:dI,WpicTabPane:uI,WpicConfirm:be(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:a,blur:c}=Ac();return(d,u)=>l.unref(e)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.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":l.unref(c)}])},[l.createElementVNode("div",II,[l.createElementVNode("div",VI,l.toDisplayString(l.unref(n)),1),l.createElementVNode("div",PI,l.toDisplayString(l.unref(r)),1),l.createElementVNode("div",RI,[l.createVNode(_i,{onClick:l.unref(a)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("ui.cancel")),1)]),_:1},8,["onClick"]),l.createVNode(_i,{primary:l.unref(i),destructive:l.unref(o),onClick:l.unref(s)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("ui.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-49a8e46b"]])};function Kg(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Kg(t[n],e[n]):t[n]=e[n])}const FI={useConfirm:Ac};function jI(t,e){Kg(fe,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const zI={install:jI,composables:FI,options:fe};Dn.default=zI,Dn.useConfirm=Ac,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|