@romainbx/wpic-components 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/form/FormField.vue.d.ts +2 -0
- package/dist/wpic-components.js +1249 -1244
- package/dist/wpic-components.umd.cjs +21 -21
- package/package.json +1 -1
|
@@ -24,19 +24,19 @@ ${d}`:c)}else throw s},onCacheKey:s=>m1(e,n,s)}}function Zb(t){if(oe(t))return t
|
|
|
24
24
|
* vue-i18n v9.14.4
|
|
25
25
|
* (c) 2025 kazuya kawaguchi
|
|
26
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,v=Ve(t.missing)?ju(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const T=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let $=t.pluralRules||n&&n.pluralRules,D;D=(()=>{i&&fu(null);const j={version:Qb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:T,pluralRules:$,missing:v===null?void 0:v,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};j.datetimeFormats=h.value,j.numberFormats=p.value,j.__datetimeFormatters=Se(D)?D.__datetimeFormatters:void 0,j.__numberFormatters=Se(D)?D.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(j.__v_emitter=Se(D)?D.__v_emitter:void 0);const Z=zb(j);return i&&fu(Z),Z})(),Ii(D,d.value,u.value);function V(){return[d.value,u.value,f.value,h.value,p.value]}const L=l.computed({get:()=>d.value,set:j=>{d.value=j,D.locale=d.value}}),z=l.computed({get:()=>u.value,set:j=>{u.value=j,D.fallbackLocale=u.value,Ii(D,d.value,j)}}),F=l.computed(()=>f.value),I=l.computed(()=>h.value),S=l.computed(()=>p.value);function P(){return Ve(b)?b:null}function R(j){b=j,D.postTranslation=j}function ee(){return x}function ie(j){j!==null&&(v=ju(j)),x=j,D.missing=v}function he(j,Z){return j!=="translate"||!Z.resolvedMessage}const ue=(j,Z,N,A,Y,te)=>{V();let de;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(D.fallbackContext=n?jb():void 0),de=j(D)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(D.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}=D;re&&y&&re.emit("fallback",{type:N,key:M,to:"global",groupId:`${N}:${M}`})}return n&&y?A(n):Y(M)}else{if(te(de))return de;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function B(...j){return ue(Z=>Reflect.apply(xu,null,[Z,...j]),()=>Ta(...j),"translate",Z=>Reflect.apply(Z.t,Z,[...j]),Z=>Z,Z=>oe(Z))}function W(...j){const[Z,N,A]=j;if(A&&!Te(A))throw Fn(Re.INVALID_ARGUMENT);return B(Z,N,ct({resolvedMessage:!0},A||{}))}function K(...j){return ue(Z=>Reflect.apply(Ou,null,[Z,...j]),()=>Na(...j),"datetime format",Z=>Reflect.apply(Z.d,Z,[...j]),()=>jo,Z=>oe(Z))}function q(...j){return ue(Z=>Reflect.apply(Mu,null,[Z,...j]),()=>Ma(...j),"number format",Z=>Reflect.apply(Z.n,Z,[...j]),()=>jo,Z=>oe(Z))}function H(j){return j.map(Z=>oe(Z)||Ge(Z)||Le(Z)?Vu(String(Z)):Z)}const le={normalize:H,interpolate:j=>j,type:"vnode"};function ve(...j){return ue(Z=>{let N;const A=Z;try{A.processor=le,N=Reflect.apply(xu,null,[A,...j])}finally{A.processor=null}return N},()=>Ta(...j),"translate",Z=>Z[Aa](...j),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...j){return ue(Z=>Reflect.apply(Mu,null,[Z,...j]),()=>Ma(...j),"number format",Z=>Z[$a](...j),Ru,Z=>oe(Z)||We(Z))}function Ie(...j){return ue(Z=>Reflect.apply(Ou,null,[Z,...j]),()=>Na(...j),"datetime format",Z=>Z[Da](...j),Ru,Z=>oe(Z)||We(Z))}function tt(j){$=j,D.pluralRules=$}function Q(j,Z){return ue(()=>{if(!j)return!1;const N=oe(Z)?Z:d.value,A=at(N),Y=D.messageResolver(A,j);return a?Y!=null:Qt(Y)||Ft(Y)||oe(Y)},()=>[j],"translate exists",N=>Reflect.apply(N.te,N,[j,Z]),ok,N=>Le(N))}function Ee(j){let Z=null;const N=ru(D,u.value,d.value);for(let A=0;A<N.length;A++){const Y=f.value[N[A]]||{},te=D.messageResolver(Y,j);if(te!=null){Z=te;break}}return Z}function Mt(j){const Z=Ee(j);return Z??(n?n.tm(j)||{}:{})}function at(j){return f.value[j]||{}}function lt(j,Z){if(o){const N={[j]:Z};for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[j]}f.value[j]=Z,D.messages=f.value}function ht(j,Z){f.value[j]=f.value[j]||{};const N={[j]:Z};if(o)for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[j],Io(Z,f.value[j]),D.messages=f.value}function E(j){return h.value[j]||{}}function _(j,Z){h.value[j]=Z,D.datetimeFormats=h.value,Nu(D,j,Z)}function U(j,Z){h.value[j]=ct(h.value[j]||{},Z),D.datetimeFormats=h.value,Nu(D,j,Z)}function se(j){return p.value[j]||{}}function Me(j,Z){p.value[j]=Z,D.numberFormats=p.value,Du(D,j,Z)}function _e(j,Z){p.value[j]=ct(p.value[j]||{},Z),D.numberFormats=p.value,Du(D,j,Z)}Fu++,n&&bn&&(l.watch(n.locale,j=>{c&&(d.value=j,D.locale=j,Ii(D,d.value,u.value))}),l.watch(n.fallbackLocale,j=>{c&&(u.value=j,D.fallbackLocale=j,Ii(D,d.value,u.value))}));const Oe={id:Fu,locale:L,fallbackLocale:z,get inheritLocale(){return c},set inheritLocale(j){c=j,j&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ii(D,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:F,get modifiers(){return T},get pluralRules(){return $||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(j){m=j,D.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(j){g=j,D.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(j){y=j},get fallbackFormat(){return k},set fallbackFormat(j){k=j,D.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(j){C=j,D.warnHtmlMessage=j},get escapeParameter(){return w},set escapeParameter(j){w=j,D.escapeParameter=j},t:B,getLocaleMessage:at,setLocaleMessage:lt,mergeLocaleMessage:ht,getPostTranslationHandler:P,setPostTranslationHandler:R,getMissingHandler:ee,setMissingHandler:ie,[rk]:tt};return Oe.datetimeFormats=I,Oe.numberFormats=S,Oe.rt=W,Oe.te=Q,Oe.tm=Mt,Oe.d=K,Oe.n=q,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=_,Oe.mergeDateTimeFormat=U,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]=j=>{D.__v_emitter=j},Oe[Ba]=()=>{D.__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,v=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function w(){return[a.value,c.value,d.value,u.value,f.value]}const T=l.computed({get:()=>o.value?o.value.locale.value:a.value,set:Q=>{o.value&&(o.value.locale.value=Q),a.value=Q}}),$=l.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),D=l.computed(()=>o.value?o.value.messages.value:d.value),O=l.computed(()=>u.value),V=l.computed(()=>f.value);function L(){return o.value?o.value.getPostTranslationHandler():k}function z(Q){o.value&&o.value.setPostTranslationHandler(Q)}function F(){return o.value?o.value.getMissingHandler():y}function I(Q){o.value&&o.value.setMissingHandler(Q)}function S(Q){return w(),Q()}function P(...Q){return o.value?S(()=>Reflect.apply(o.value.t,null,[...Q])):S(()=>"")}function R(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?S(()=>Reflect.apply(o.value.d,null,[...Q])):S(()=>"")}function ie(...Q){return o.value?S(()=>Reflect.apply(o.value.n,null,[...Q])):S(()=>"")}function he(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function B(Q){return o.value?o.value.getLocaleMessage(Q):{}}function W(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function K(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function q(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function H(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function 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:T,fallbackLocale:$,messages:D,datetimeFormats:O,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:v},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:P,getPostTranslationHandler:L,setPostTranslationHandler:z,getMissingHandler:F,setMissingHandler:I,rt:R,d:ee,n:ie,tm:he,te:ue,getLocaleMessage:B,setLocaleMessage:W,mergeLocaleMessage:K,getDateTimeFormat:q,setDateTimeFormat:H,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=v,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(w){var T=r,$=i;return r=i=void 0,d=w,s=t.apply($,T),s}function m(w){return d=w,a=setTimeout(k,e),u?p(w):s}function g(w){var T=w-c,$=w-d,D=e-T;return f?O2(D,o-$):D}function y(w){var T=w-c,$=w-d;return c===void 0||T>=e||T<0||f&&$>=o}function k(){var w=ja();if(y(w))return x(w);a=setTimeout(k,g(w))}function x(w){return a=void 0,h&&r?p(w):(r=i=void 0,s)}function v(){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 w=ja(),T=y(w);if(r=arguments,i=this,c=w,T){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=v,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 v=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(v===void 0?k===x||i(k,x,n,r,o):v)){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={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},WS={key:1},US={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},YS=["onClick"],qS={class:"select-none flex w-full items-center justify-between"},KS={class:"flex-1"},GS={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},JS={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},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,summaryText:String,oneLine:Boolean,total:{type:Number,default:null}},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("wpiccomponents.placeholder_select"):r.placeholder),s=l.ref(!1),a=l.ref(r.options);l.watch(()=>r.options,()=>{var O;(O=r.options)!=null&&O.length&&(a.value=[...r.options])},{immediate:!0,deep:!0});const c=n,d=l.ref(),u=l.ref();function f(O){var V,L;if(r.multiple){if(O){let z=r.modelValue||[];z.indexOf(O)>=0?z.splice(z.indexOf(O),1):z.push(O),c("update:modelValue",z),g(z),((V=r.modelValue)==null?void 0:V.length)===((L=r.options)==null?void 0:L.length)?s.value=!0:s.value=!1}}else c("update:modelValue",O),g(O),d.value=null,u.value.hide()}async function h(O){var V,L;c("update:modelValue",O),g(O),await l.nextTick(),((V=r.modelValue)==null?void 0:V.length)===((L=r.options)==null?void 0:L.length)&&(s.value=!0)}function p(O){c("update:modelValue",O),s.value=!1,g(O)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=ef(function(O){c("change",O)},r.debounce),y=l.computed(()=>{var O,V,L;if(r.multiple){const z=((O=a.value)==null?void 0:O.filter(F=>{var I;return(I=r.modelValue)==null?void 0:I.includes(F.value)}))||[];if(r.summaryText&&z.length){const F=i(r.summaryText,z.length);return i("wpiccomponents.summary_items",{count:z.length,type:F})}if(r.maxDisplay){const F=z.slice(0,r.maxDisplay);return z.length-F.length>0?`${F.map(I=>I.label).join(", ")} (+${z.length-F.length})`:F.map(I=>I.label).join(", ")}else return z.map(F=>F.label).join(", ")}else return((L=(V=a.value)==null?void 0:V.find(z=>z.value===r.modelValue))==null?void 0:L.label)||r.modelValue});function k(O){var V;try{return r.multiple?r.modelValue!==null&&((V=r.modelValue)==null?void 0:V.some(L=>If(L,O))):r.modelValue!==null&&If(O,r.modelValue)}catch(L){return console.log(L),!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"},v=l.computed(()=>{var O,V;return((O=r.modelValue)==null?void 0:O.length)===((V=r.options)==null?void 0:V.length)}),b=l.computed(()=>{var O;if(r.filterable&&!r.remoteMethod&&((O=d.value)!=null&&O.trim().length)){const V=d.value.trim().toLowerCase();return r.options.filter(L=>{var z;return(z=L.label)==null?void 0:z.toLowerCase().includes(V)})}return r.options});function C(){w.value=1,r.remoteMethod&&r.remoteMethod(d.value,w.value)}const w=l.ref(1),T=l.ref(!1),$=l.computed(()=>{var O;return r.total!==void 0&&((O=r.options)==null?void 0:O.length)>=r.total});function D(O){const V=O.target;V.scrollTop+V.clientHeight>=V.scrollHeight-30&&!T.value&&!$.value&&(T.value=!0,w.value+=1,r.remoteMethod(d.value,w.value).finally(()=>{T.value=!1}))}return e({allSelected:s,isAllSelected:v}),(O,V)=>(l.openBlock(),l.createBlock(dr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:l.withCtx(({isHidden:L})=>[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 z,F,I,S,P,R;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&&((z=t.modelValue)==null?void 0:z.length)>0)&&!t.hideSelect?(l.openBlock(),l.createElementBlock("span",jS,[v.value&&((F=t.allSelectedText)!=null&&F.length)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(t.allSelectedText)+" ("+l.toDisplayString((I=t.options)==null?void 0:I.length)+")",1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(y.value),1)],64))])):!t.multiple&&((S=t.options)!=null&&S.find(ee=>ee.value===null))?(l.openBlock(),l.createElementBlock("span",zS,l.toDisplayString((R=(P=t.options)==null?void 0:P.find(ee=>ee.value===null))==null?void 0:R.label),1)):l.renderSlot(O.$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 L,z;return[l.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:D},[t.filterable?(l.openBlock(),l.createElementBlock("div",HS,[l.createVNode(jf,{slim:"",placeholder:O.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[V[0]||(V[0]=F=>d.value=F),C]},null,8,["placeholder","modelValue"])])):l.createCommentVNode("",!0),!t.options&&((L=t.options)==null?void 0:L.length)==0?(l.openBlock(),l.createElementBlock("span",WS,"No data.")):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[t.multiple&&t.batchSelect?(l.openBlock(),l.createElementBlock("div",US,[l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:V[1]||(V[1]=F=>{var I;return h((I=b.value)==null?void 0:I.filter(S=>S.value).map(S=>S.value))})},l.toDisplayString(O.$t("wpiccomponents.select_all")),1),l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:V[2]||(V[2]=F=>p([]))},l.toDisplayString(O.$t("wpiccomponents.select_none")),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,F=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["group",{"is-selected":!!k(F.value)}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||F.value,[`${x[l.unref(fe).theme]}`]:!0}]),onClick:I=>F.disabled?null:f(F.value)},[l.createElementVNode("div",qS,[l.createElementVNode("div",KS,[l.createElementVNode("div",{class:l.normalizeClass(["",{"opacity-25":F.disabled,"line-clamp-1":t.oneLine}])},l.toDisplayString(F.label||F.value),3),F.description?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":F.disabled}])},l.toDisplayString(F.description),3)):l.createCommentVNode("",!0)]),t.multiple&&k(F.value)?(l.openBlock(),l.createBlock(Uu,{key:0,class:"w-4 h-4"})):l.createCommentVNode("",!0)])],10,YS)],2))),256)),r.remoteMethod?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[T.value?(l.openBlock(),l.createElementBlock("div",GS,l.toDisplayString(O.$t("wpiccomponents.loading_more")),1)):$.value&&((z=t.options)==null?void 0:z.length)>0?(l.openBlock(),l.createElementBlock("div",JS,l.toDisplayString(O.$t("wpiccomponents.no_more_results")),1)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0)],64))],32)]}),_: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))}}),ZS={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},XS={class:""},QS=["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",ZS,[l.createTextVNode(l.toDisplayString(t.label)+" ",1),l.createElementVNode("div",XS,[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,QS)],64))}}),e_=["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,e_),[[l.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},t_={},n_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r_=[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 i_(t,e){return l.openBlock(),l.createElementBlock("svg",n_,r_)}const o_=be(t_,[["render",i_]]),s_={},a_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},l_=[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 c_(t,e){return l.openBlock(),l.createElementBlock("svg",a_,l_)}const d_=be(s_,[["render",c_]]),u_={},f_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},h_=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function p_(t,e){return l.openBlock(),l.createElementBlock("svg",f_,h_)}const m_=be(u_,[["render",p_]]),g_={class:"flex items-center gap-2"},y_={key:0},b_={class:""},k_=["innerHTML"],v_={class:"flex justify-end"},w_=["name","value","checked"],x_={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},E_={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},C_={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},S_={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,summaryText:String,oneLine: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 O;if(o.rules&&typeof o.rules=="string"){let V=(O=o.rules)==null?void 0:O.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(O){let V=O&&O.target?O.target.value:O;x(V)}const m=n;function g(O){O===!0||O===!1?m("update:modelValue",!O):m("update:modelValue",O)}function y(O){let V=O&&O.target?O.target.value:O;m("update:modelValue",V),m("onChange",V)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=ef(function(O){m("update:modelValue",O),m("onChange",O)},o.debounce),v=l.ref(null),b=l.ref();function C(){var O,V;o.textarea?(O=b.value)==null||O.focus():(V=v.value)==null||V.$el.focus()}function w(){return v.value.meta.valid}const T=l.ref(),$=l.computed(()=>T.value.allSelected),D=l.computed(()=>T.value.isAllSelected);return e({focus:C,isValid:w,allSelected:$,isAllSelected:D}),(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",g_,[l.createElementVNode("span",null,l.toDisplayString(c.value),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",y_,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",b_,[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,k_)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",v_,[l.renderSlot(O.$slots,"more")])],2)):l.createCommentVNode("",!0),t.checkbox?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:l.withCtx(({field:L})=>[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]=z=>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(O.$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:v,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:l.withCtx(({field:L})=>[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]=(...z)=>O.onChange&&O.onChange(...z)),checked:t.radioValue==t.modelValue},null,40,w_),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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>{var z;return[l.createVNode(Vf,{ref_key:"myChoiceList",ref:T,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,oneLine:t.oneLine,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,summaryText:t.summaryText,isInvalid:!!(t.error&&l.unref(a)),required:t.required||((z=h.value)==null?void 0:z.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>[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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>[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)}])},[O.$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",x_,[l.renderSlot(O.$slots,"prepend")])],2)):l.createCommentVNode("",!0),t.textarea?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(()=>{var L;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||((L=h.value)==null?void 0:L.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:v,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":!O.$slots.prepend&&!t.naked,"pl-8":O.$slots.prepend&&!t.naked,"pl-6":O.$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),O.$slots.append||t.password||t.type=="password"?(l.openBlock(),l.createElementBlock("div",E_,[l.createElementVNode("div",C_,[l.renderSlot(O.$slots,"append",{},()=>[l.withDirectives(l.createVNode(o_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,d.value]]),l.withDirectives(l.createVNode(d_,{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",S_,[l.createVNode(l.unref(ry),{name:s.value},{default:l.withCtx(L=>[l.createTextVNode(l.toDisplayString(L.message),1)]),_:1},8,["name"])])):l.createCommentVNode("",!0),O.$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(O.$slots,"help",{},()=>[l.createTextVNode(l.toDisplayString(t.help),1)])],2)):l.createCommentVNode("",!0)],2))}}),__=["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,__),l.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),O_={key:1,class:"flex justify-between items-baseline pt-4 px-6"},T_={class:""},N_={key:2,class:"flex items-center justify-end py-4 px-6"},M_=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",O_,[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",T_,[l.renderSlot(r.$slots,"actions")])])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default"),r.$slots.buttons?(l.openBlock(),l.createElementBlock("div",N_,[l.renderSlot(r.$slots,"buttons")])):l.createCommentVNode("",!0)],2)}}}),A_={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},D_={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},$_=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",A_,[l.createElementVNode("div",D_,[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))}}),L_=l.createElementVNode("div",{class:""},null,-1),B_=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),I_=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(()=>[L_]),_:1},8,["text"])],6)):l.createCommentVNode("",!0)],2),t.indicators?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[B_],64)):l.createCommentVNode("",!0)],2))}}),V_={class:"leading-none"},P_=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",V_,[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))}}),R_=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))}}),F_=t=>(l.pushScopeId("data-v-947735f2"),t=t(),l.popScopeId(),t),j_={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},z_=[F_(()=>l.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],H_=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",j_,z_)):(l.openBlock(),l.createBlock(Ir,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),W_={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",W_,[l.renderSlot(i.$slots,"default")])],2))}}),U_={},Y_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},q_=[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 K_(t,e){return l.openBlock(),l.createElementBlock("svg",Y_,q_)}const Hf=be(U_,[["render",K_]]),G_={},J_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Z_=[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 X_(t,e){return l.openBlock(),l.createElementBlock("svg",J_,Z_)}const Wf=be(G_,[["render",X_]]),Q_={},eO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},tO=[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 nO(t,e){return l.openBlock(),l.createElementBlock("svg",eO,tO)}const Uf=be(Q_,[["render",nO]]),rO={},iO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},oO=[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 sO(t,e){return l.openBlock(),l.createElementBlock("svg",iO,oO)}const Yf=be(rO,[["render",sO]]),aO={class:"wpic-pagination flex justify-between"},lO={key:0,class:"flex items-center"},cO={key:0},dO={key:1,class:"flex flex-wrap gap-2"},uO=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("wpiccomponents.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 v=y;v<=k;v++)x.push(v);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",aO,[t.info?(l.openBlock(),l.createElementBlock("div",lO,[t.total>0?(l.openBlock(),l.createElementBlock("span",cO,l.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),t.pages?(l.openBlock(),l.createElementBlock("div",dO,[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,fO={},hO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},pO=[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 mO(t,e){return l.openBlock(),l.createElementBlock("svg",hO,pO)}const gO=be(fO,[["render",mO]]),yO={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",yO,[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))]))}},bO={},kO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},vO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function wO(t,e){return l.openBlock(),l.createElementBlock("svg",kO,vO)}const xO=be(bO,[["render",wO]]),EO={},CO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},SO=[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 _O(t,e){return l.openBlock(),l.createElementBlock("svg",CO,SO)}const OO=be(EO,[["render",_O]]),TO={class:"wpic-table"},NO={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},MO={class:"flex items-center gap-2"},AO={class:"flex items-center gap-2"},DO={class:"w-full rounded-lg"},$O={key:0,class:"w-16"},LO=["width"],BO=["width"],IO={class:"flex justify-center items-center h-full"},VO=["onClick"],PO={class:"rounded-b-lg relative"},RO={key:0},FO=[l.createElementVNode("td",{class:"text-center py-3"}," ",-1)],jO={class:"flex justify-center items-center h-full"},zO={key:1},HO={key:0,class:"text-center text-gray-400 py-3"},WO=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(L=>g.value.includes(L.field)||!L.selectable):m.value.filter(L=>L.visible||!L.selectable));function k(){const L=(I,S)=>{let P={};for(let R in I){if(typeof I[R].default=="boolean"&&S[R]!==void 0){P[R]=S[R]!==!1;continue}if(S[R]!==void 0){P[R]=S[R];continue}if(typeof I[R].default=="function"){P[R]=I[R].default();continue}P[R]=I[R].default}return P};let z=[];(p.default&&p.default()||[]).forEach(I=>{var S,P;((S=I.type)==null?void 0:S.name)==="WpicTableColumn"?z.push(I):(P=I.children)!=null&&P.length&&I.children.forEach(R=>{var ee;((ee=R.type)==null?void 0:ee.name)==="WpicTableColumn"&&z.push(R)})}),m.value=z.map(I=>{let S=I.children,P=I.props||{},{field:R,label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,sortable:W,selectable:K,render:q,type:H,align:ce,visible:le,noPadding:ve}=L(I.type.props,P);return R||(R=V(ee)),K&&le&&g.value.push(R),{label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,type:H,align:ce,sortable:W,selectable:K,field:R,render:q,children:S,visible:le,noPadding:ve}})}function x(L){var F,I;let z=(F=r.sortOptions)==null?void 0:F.sortDirection;((I=r.sortOptions)==null?void 0:I.sortBy)===L&&(z=z==="asc"?"desc":"asc"),f("changeSort",{sortDirection:z,sortBy:L})}l.watch(()=>p.default,L=>{k()},{deep:!0});const v=l.reactive({});function b({index:L,item:z}){v[L]?v[L]=null:(v[L]=!0,f("expandRow",{index:L,item:z}))}const C=l.ref([]);function w(L){const z=O(L,r.itemId);C.value.includes(z)?(C.value.splice(C.value.indexOf(z),1),T.value=!1):C.value.push(z)}const T=l.ref(!1);function $(){if(T.value=!T.value,C.value=[],T.value)for(let L of r.data){let z=O(L,r.itemId);C.value.push(z)}}function D(){T.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:D});function O(L,z){return z.split(".").reduce((F,I)=>F?F[I]:void 0,L)}function V(L){return!L||typeof L!="string"?"":L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(L,z)=>{const F=l.resolveComponent("wpic-choice-list"),I=l.resolveComponent("wpic-form-field");return l.openBlock(),l.createElementBlock("div",TO,[L.$slots.header||L.$slots.actions||t.columnToggleable?(l.openBlock(),l.createElementBlock("div",NO,[l.createElementVNode("div",MO,[l.renderSlot(L.$slots,"header")]),l.createElementVNode("div",AO,[l.renderSlot(L.$slots,"actions"),l.createVNode(F,{multiple:"",modelValue:g.value,"onUpdate:modelValue":z[0]||(z[0]=S=>g.value=S),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(S=>S.selectable).map(S=>({label:S.label,value:S.field}))},{default:l.withCtx(()=>[l.createVNode(_i,{medium:"",square:"",colorless:"",class:"ml-px"},{default:l.withCtx(()=>[l.createVNode(OO,{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",DO,[l.createElementVNode("colgroup",null,[t.checkable?(l.openBlock(),l.createElementBlock("col",$O)):l.createCommentVNode("",!0),y.value.find(S=>S.type=="expand")?(l.openBlock(),l.createElementBlock("col",{key:1,style:l.normalizeStyle({minWidth:`${y.value.find(S=>S.type=="expand").minWidth}px`}),width:y.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,LO)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(S=>S.type!="expand"),(S,P)=>(l.openBlock(),l.createElementBlock("col",{style:l.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:P},null,12,BO))),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",IO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:T.value,"onUpdate:modelValue":$},null,8,["modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(S=>S.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(S=>S.type!="expand"),(S,P)=>{var R,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":P===0}]),style:l.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[l.createElementVNode("div",{onClick:()=>{S.sortable&&x(S.field)},class:l.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[l.createElementVNode("span",{class:l.normalizeClass(["select-none font-medium text-sm",{"text-right":S.align=="right"}])},l.toDisplayString(S.label),3),S.sortable&&S.field?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["ml-1",{"opacity-25":S.field!=((R=t.sortOptions)==null?void 0:R.sortBy)}])},[l.createVNode(gO,{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,VO)],6)}),256))])],2)),l.createElementVNode("tbody",PO,[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",RO,FO))],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,(S,P)=>{var R,ee,ie,he,ue;return l.openBlock(),l.createElementBlock(l.Fragment,{key:`tr_${P}`},[l.createElementVNode("tr",{class:l.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":P%2==0,"is-even":P%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",jO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes(O(S,t.itemId)),checkboxValue:O(S,t.itemId),"onUpdate:modelValue":B=>w(S)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(B=>B.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:B=>b({item:S,index:P})},{default:l.withCtx(()=>[v[P]?(l.openBlock(),l.createBlock(m_,{key:0,class:"w-4 h-4"})):(l.openBlock(),l.createBlock(xO,{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(B=>B.type!="expand"),(B,W)=>{var K,q;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":W===0,[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!B.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((K=t.data)==null?void 0:K.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":P===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"text-center justify-center":B.align=="center","text-right justify-end":B.align=="right","align-top py-5":t.valign=="top"}]),style:l.normalizeStyle({maxWidth:`${B.maxWidth}px`}),id:`${P}_${W}`,column:B,item:S,rowIndex:P,key:W},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(B=>B.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":!((R=y.value.find(B=>B.type=="expand"))!=null&&R.noPadding),"p-0":(ee=y.value.find(B=>B.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((ie=t.data)==null?void 0:ie.length)-1&&!t.totalItem,"first:rounded-bl-lg":P===((he=t.data)==null?void 0:he.length)-1&&!t.totalItem,"text-center":y.value.find(B=>B.type=="expand").align=="center","text-right":y.value.find(B=>B.type=="expand").align=="right"}]),column:y.value.find(B=>B.type=="expand"),rowIndex:P,colspan:(ue=y.value)==null?void 0:ue.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[l.vShow,v[P]]]):l.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(l.openBlock(),l.createElementBlock("tfoot",zO,[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",HO," No Data ")):l.createCommentVNode("",!0)],2)])}}}),UO={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 J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,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 J(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let 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 J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return 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 J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const 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(J.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ne(e,r,i)}}ne.empty=new ne(J.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 YO(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}=qO(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 J(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 J(r)}function qO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class 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 KO);let i=r.elts[r.i]=Ui.resolve(e,n);return r.i=(r.i+1)%GO,i}}class KO{constructor(){this.elts=[],this.i=0}}const GO=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 JO=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||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ts(this.attrs,n||e.defaultAttrs||JO)&&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 YO(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=J.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=J.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 ZO(e,n);if(r.next==null)return br.empty;let i=ih(r);r.next&&r.err("Unexpected trailing text");let o=iT(rT(i));return oT(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 J.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 ZO{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(XO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function XO(t){let e=[];do e.push(QO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function QO(t){let e=nT(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=eT(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 eT(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 tT(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 nT(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=tT(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 rT(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 iT(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 oT(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 aT(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),J.from(n),Be.setFrom(r))}createChecked(e=null,n,r){return n=J.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=J.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(J.empty,!0);return o?new 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 sT(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 aT{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?sT(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 lT(t){return t.tag!=null}function cT(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(lT(i))this.tags.push(i);else if(cT(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(fT(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},dT={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(J.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&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=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!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&&
|
|
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 uT(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 fT(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 hT(t){let e=xh.get(t);return e===void 0&&xh.set(t,e=pT(t)),e}function pT(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=hT(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 mT(t,e){return t+e*Ch}function Sh(t){return t&Eh}function gT(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+gT(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:mT(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 J.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(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new 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(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new 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 yT(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 bT(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(J.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(J.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 kT(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||!kT(i,o,s))break}return null}function vT(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=J.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=J.from(r.node(m).copy(u)),f++):c--;let h=J.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=J.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,a,new ne(u.append(h),f,p),u.size-f,!0))}function al(t,e,n=null,r=t){let i=wT(t,e),o=i&&xT(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 wT(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 xT(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 ET(t,e,n){let r=J.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=J.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Xe(i,o,i,o,new ne(r,0,0),n.length,!0))}function CT(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)&&ST(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(J.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 ST(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function _T(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(J.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 OT(t,e,n=1,r){let i=t.doc.resolve(e),o=J.empty,s=J.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=J.from(i.node(a).copy(o));let u=r&&r[d];s=J.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 TT(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&&TT(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 NT(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 MT(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 AT(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 AT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,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(J.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,J.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=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,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=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(J.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&&!DT(n,o.content,s)?a:null}function DT(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function $T(t){return t.spec.defining||t.spec.definingForContent}function LT(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=$T(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),v=i.index(y-1);if(x.canReplaceWith(v,v,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(J.empty,!0))}return t}function BT(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=MT(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ne(J.from(r),0,0))}function IT(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(J.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 VT{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(J.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 LT(this,e,n,r),this}replaceRangeWith(e,n,r){return BT(this,e,n,r),this}deleteRange(e,n){return IT(this,e,n),this}lift(e,n){return vT(this,e,n),this}join(e,n=1){return NT(this,e,n),this}wrap(e,n){return ET(this,e,n),this}setBlockType(e,n=e,r,i=null){return CT(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return _T(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 OT(this,e,n,r),this}addMark(e,n,r){return yT(this,e,n,r),this}removeMark(e,n,r){return bT(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 PT(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 PT{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(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new 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 RT}}xe.jsonID("all",Lt);const RT={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 FT extends VT{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 jT=[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=jT.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 FT(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},zT=function(){pl=null},vr=function(t,e,n,r){return n&&(qh(t,e,n,r,-1)||qh(t,e,n,r,1))},HT=/^(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)||HT.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 WT(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 UT(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 YT(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 qT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function KT(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),GT=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(qn),Qi=!!Kh&&"webkitFontSmoothing"in Kh.documentElement.style,JT=Qi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ZT(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 XT(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?ZT(o):XT(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 QT(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 e5({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 t5(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?n5(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:ep(n,i)}function n5(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 r5(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function i5(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 o5(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 s5(t,e){let n=t.dom.ownerDocument,r,i=0,o=KT(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=r5(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=o5(t,r,i,e))}a==null&&(a=i5(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 a5=/[\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&&(a5.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 l5(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 c5=/[\u0590-\u08ac]/;function d5(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?!c5.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 u5(t,e,n){return op==e&&sp==n?ap:(op=e,sp=n,ap=n=="up"||n=="down"?l5(t,e,n):d5(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 f5 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 h5(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=()=>J.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 m5(this,s&&s.node,e);b5(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&&k5(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=v5(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 f5(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 h5 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}p5(i,a||Cr[0],s)}return i}function p5(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 m5{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=g5(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 g5(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 y5(t,e){return t.type.side-e.type.side}function b5(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(y5);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 k5(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 v5(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&&YT(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)x5(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&&w5(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 w5(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 x5(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 E5(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?C5(t):S5(t)}function C5(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 S5(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 _5(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 O5(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=_5(e,n))?(e=s,n=0):(o=O5(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||GT)&&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 T5(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 N5(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function M5(t,e){let n=e.keyCode,r=N5(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 T5(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,`
|
|
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,v=Ve(t.missing)?ju(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const T=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let $=t.pluralRules||n&&n.pluralRules,D;D=(()=>{i&&fu(null);const j={version:Qb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:T,pluralRules:$,missing:v===null?void 0:v,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};j.datetimeFormats=h.value,j.numberFormats=p.value,j.__datetimeFormatters=Se(D)?D.__datetimeFormatters:void 0,j.__numberFormatters=Se(D)?D.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(j.__v_emitter=Se(D)?D.__v_emitter:void 0);const Z=zb(j);return i&&fu(Z),Z})(),Ii(D,d.value,u.value);function V(){return[d.value,u.value,f.value,h.value,p.value]}const L=l.computed({get:()=>d.value,set:j=>{d.value=j,D.locale=d.value}}),z=l.computed({get:()=>u.value,set:j=>{u.value=j,D.fallbackLocale=u.value,Ii(D,d.value,j)}}),F=l.computed(()=>f.value),I=l.computed(()=>h.value),S=l.computed(()=>p.value);function P(){return Ve(b)?b:null}function R(j){b=j,D.postTranslation=j}function ee(){return x}function ie(j){j!==null&&(v=ju(j)),x=j,D.missing=v}function he(j,Z){return j!=="translate"||!Z.resolvedMessage}const ue=(j,Z,N,A,Y,te)=>{V();let de;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(D.fallbackContext=n?jb():void 0),de=j(D)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(D.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}=D;re&&y&&re.emit("fallback",{type:N,key:M,to:"global",groupId:`${N}:${M}`})}return n&&y?A(n):Y(M)}else{if(te(de))return de;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function B(...j){return ue(Z=>Reflect.apply(xu,null,[Z,...j]),()=>Ta(...j),"translate",Z=>Reflect.apply(Z.t,Z,[...j]),Z=>Z,Z=>oe(Z))}function W(...j){const[Z,N,A]=j;if(A&&!Te(A))throw Fn(Re.INVALID_ARGUMENT);return B(Z,N,ct({resolvedMessage:!0},A||{}))}function K(...j){return ue(Z=>Reflect.apply(Ou,null,[Z,...j]),()=>Na(...j),"datetime format",Z=>Reflect.apply(Z.d,Z,[...j]),()=>jo,Z=>oe(Z))}function q(...j){return ue(Z=>Reflect.apply(Mu,null,[Z,...j]),()=>Ma(...j),"number format",Z=>Reflect.apply(Z.n,Z,[...j]),()=>jo,Z=>oe(Z))}function H(j){return j.map(Z=>oe(Z)||Ge(Z)||Le(Z)?Vu(String(Z)):Z)}const le={normalize:H,interpolate:j=>j,type:"vnode"};function ve(...j){return ue(Z=>{let N;const A=Z;try{A.processor=le,N=Reflect.apply(xu,null,[A,...j])}finally{A.processor=null}return N},()=>Ta(...j),"translate",Z=>Z[Aa](...j),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...j){return ue(Z=>Reflect.apply(Mu,null,[Z,...j]),()=>Ma(...j),"number format",Z=>Z[$a](...j),Ru,Z=>oe(Z)||We(Z))}function Ie(...j){return ue(Z=>Reflect.apply(Ou,null,[Z,...j]),()=>Na(...j),"datetime format",Z=>Z[Da](...j),Ru,Z=>oe(Z)||We(Z))}function tt(j){$=j,D.pluralRules=$}function Q(j,Z){return ue(()=>{if(!j)return!1;const N=oe(Z)?Z:d.value,A=at(N),Y=D.messageResolver(A,j);return a?Y!=null:Qt(Y)||Ft(Y)||oe(Y)},()=>[j],"translate exists",N=>Reflect.apply(N.te,N,[j,Z]),ok,N=>Le(N))}function Ee(j){let Z=null;const N=ru(D,u.value,d.value);for(let A=0;A<N.length;A++){const Y=f.value[N[A]]||{},te=D.messageResolver(Y,j);if(te!=null){Z=te;break}}return Z}function Mt(j){const Z=Ee(j);return Z??(n?n.tm(j)||{}:{})}function at(j){return f.value[j]||{}}function lt(j,Z){if(o){const N={[j]:Z};for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[j]}f.value[j]=Z,D.messages=f.value}function ht(j,Z){f.value[j]=f.value[j]||{};const N={[j]:Z};if(o)for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[j],Io(Z,f.value[j]),D.messages=f.value}function E(j){return h.value[j]||{}}function _(j,Z){h.value[j]=Z,D.datetimeFormats=h.value,Nu(D,j,Z)}function U(j,Z){h.value[j]=ct(h.value[j]||{},Z),D.datetimeFormats=h.value,Nu(D,j,Z)}function se(j){return p.value[j]||{}}function Me(j,Z){p.value[j]=Z,D.numberFormats=p.value,Du(D,j,Z)}function _e(j,Z){p.value[j]=ct(p.value[j]||{},Z),D.numberFormats=p.value,Du(D,j,Z)}Fu++,n&&bn&&(l.watch(n.locale,j=>{c&&(d.value=j,D.locale=j,Ii(D,d.value,u.value))}),l.watch(n.fallbackLocale,j=>{c&&(u.value=j,D.fallbackLocale=j,Ii(D,d.value,u.value))}));const Oe={id:Fu,locale:L,fallbackLocale:z,get inheritLocale(){return c},set inheritLocale(j){c=j,j&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ii(D,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:F,get modifiers(){return T},get pluralRules(){return $||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(j){m=j,D.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(j){g=j,D.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(j){y=j},get fallbackFormat(){return k},set fallbackFormat(j){k=j,D.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(j){C=j,D.warnHtmlMessage=j},get escapeParameter(){return w},set escapeParameter(j){w=j,D.escapeParameter=j},t:B,getLocaleMessage:at,setLocaleMessage:lt,mergeLocaleMessage:ht,getPostTranslationHandler:P,setPostTranslationHandler:R,getMissingHandler:ee,setMissingHandler:ie,[rk]:tt};return Oe.datetimeFormats=I,Oe.numberFormats=S,Oe.rt=W,Oe.te=Q,Oe.tm=Mt,Oe.d=K,Oe.n=q,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=_,Oe.mergeDateTimeFormat=U,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]=j=>{D.__v_emitter=j},Oe[Ba]=()=>{D.__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,v=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function w(){return[a.value,c.value,d.value,u.value,f.value]}const T=l.computed({get:()=>o.value?o.value.locale.value:a.value,set:Q=>{o.value&&(o.value.locale.value=Q),a.value=Q}}),$=l.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),D=l.computed(()=>o.value?o.value.messages.value:d.value),O=l.computed(()=>u.value),V=l.computed(()=>f.value);function L(){return o.value?o.value.getPostTranslationHandler():k}function z(Q){o.value&&o.value.setPostTranslationHandler(Q)}function F(){return o.value?o.value.getMissingHandler():y}function I(Q){o.value&&o.value.setMissingHandler(Q)}function S(Q){return w(),Q()}function P(...Q){return o.value?S(()=>Reflect.apply(o.value.t,null,[...Q])):S(()=>"")}function R(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?S(()=>Reflect.apply(o.value.d,null,[...Q])):S(()=>"")}function ie(...Q){return o.value?S(()=>Reflect.apply(o.value.n,null,[...Q])):S(()=>"")}function he(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function B(Q){return o.value?o.value.getLocaleMessage(Q):{}}function W(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function K(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function q(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function H(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function 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:T,fallbackLocale:$,messages:D,datetimeFormats:O,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:v},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:P,getPostTranslationHandler:L,setPostTranslationHandler:z,getMissingHandler:F,setMissingHandler:I,rt:R,d:ee,n:ie,tm:he,te:ue,getLocaleMessage:B,setLocaleMessage:W,mergeLocaleMessage:K,getDateTimeFormat:q,setDateTimeFormat:H,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=v,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(w){var T=r,$=i;return r=i=void 0,d=w,s=t.apply($,T),s}function m(w){return d=w,a=setTimeout(k,e),u?p(w):s}function g(w){var T=w-c,$=w-d,D=e-T;return f?O2(D,o-$):D}function y(w){var T=w-c,$=w-d;return c===void 0||T>=e||T<0||f&&$>=o}function k(){var w=ja();if(y(w))return x(w);a=setTimeout(k,g(w))}function x(w){return a=void 0,h&&r?p(w):(r=i=void 0,s)}function v(){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 w=ja(),T=y(w);if(r=arguments,i=this,c=w,T){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=v,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 v=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(v===void 0?k===x||i(k,x,n,r,o):v)){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={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},WS={key:1},US={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},YS=["onClick"],qS={class:"select-none flex w-full items-center justify-between"},KS={class:"flex-1"},GS={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},JS={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},ZS={key:2,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},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,summaryText:String,oneLine:Boolean,total:{type:Number,default:null}},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("wpiccomponents.placeholder_select"):r.placeholder),s=l.ref(!1),a=l.ref(r.options);l.watch(()=>r.options,()=>{var O;(O=r.options)!=null&&O.length&&(a.value=[...r.options])},{immediate:!0,deep:!0});const c=n,d=l.ref(),u=l.ref();function f(O){var V,L;if(r.multiple){if(O){let z=r.modelValue||[];z.indexOf(O)>=0?z.splice(z.indexOf(O),1):z.push(O),c("update:modelValue",z),g(z),((V=r.modelValue)==null?void 0:V.length)===((L=r.options)==null?void 0:L.length)?s.value=!0:s.value=!1}}else c("update:modelValue",O),g(O),d.value=null,u.value.hide()}async function h(O){var V,L;c("update:modelValue",O),g(O),await l.nextTick(),((V=r.modelValue)==null?void 0:V.length)===((L=r.options)==null?void 0:L.length)&&(s.value=!0)}function p(O){c("update:modelValue",O),s.value=!1,g(O)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=ef(function(O){c("change",O)},r.debounce),y=l.computed(()=>{var O,V,L;if(r.multiple){const z=((O=a.value)==null?void 0:O.filter(F=>{var I;return(I=r.modelValue)==null?void 0:I.includes(F.value)}))||[];if(r.summaryText&&z.length){const F=i(r.summaryText,z.length);return i("wpiccomponents.summary_items",{count:z.length,type:F})}if(r.maxDisplay){const F=z.slice(0,r.maxDisplay);return z.length-F.length>0?`${F.map(I=>I.label).join(", ")} (+${z.length-F.length})`:F.map(I=>I.label).join(", ")}else return z.map(F=>F.label).join(", ")}else return((L=(V=a.value)==null?void 0:V.find(z=>z.value===r.modelValue))==null?void 0:L.label)||r.modelValue});function k(O){var V;try{return r.multiple?r.modelValue!==null&&((V=r.modelValue)==null?void 0:V.some(L=>If(L,O))):r.modelValue!==null&&If(O,r.modelValue)}catch(L){return console.log(L),!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"},v=l.computed(()=>{var O,V;return((O=r.modelValue)==null?void 0:O.length)===((V=r.options)==null?void 0:V.length)}),b=l.computed(()=>{var O;if(r.filterable&&!r.remoteMethod&&((O=d.value)!=null&&O.trim().length)){const V=d.value.trim().toLowerCase();return r.options.filter(L=>{var z;return(z=L.label)==null?void 0:z.toLowerCase().includes(V)})}return r.options});function C(){w.value=1,r.remoteMethod&&r.remoteMethod(d.value,w.value)}const w=l.ref(1),T=l.ref(!1),$=l.computed(()=>{var O;return r.total!==void 0&&((O=r.options)==null?void 0:O.length)>=r.total});function D(O){const V=O.target;V.scrollTop+V.clientHeight>=V.scrollHeight-30&&!T.value&&!$.value&&(T.value=!0,w.value+=1,r.remoteMethod(d.value,w.value).finally(()=>{T.value=!1}))}return e({allSelected:s,isAllSelected:v}),(O,V)=>(l.openBlock(),l.createBlock(dr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:l.withCtx(({isHidden:L})=>[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 z,F,I,S,P,R;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&&((z=t.modelValue)==null?void 0:z.length)>0)&&!t.hideSelect?(l.openBlock(),l.createElementBlock("span",jS,[v.value&&((F=t.allSelectedText)!=null&&F.length)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(t.allSelectedText)+" ("+l.toDisplayString((I=t.options)==null?void 0:I.length)+")",1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(y.value),1)],64))])):!t.multiple&&((S=t.options)!=null&&S.find(ee=>ee.value===null))?(l.openBlock(),l.createElementBlock("span",zS,l.toDisplayString((R=(P=t.options)==null?void 0:P.find(ee=>ee.value===null))==null?void 0:R.label),1)):l.renderSlot(O.$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 L,z;return[l.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:D},[t.filterable?(l.openBlock(),l.createElementBlock("div",HS,[l.createVNode(jf,{slim:"",placeholder:O.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[V[0]||(V[0]=F=>d.value=F),C]},null,8,["placeholder","modelValue"])])):l.createCommentVNode("",!0),!t.options&&((L=t.options)==null?void 0:L.length)==0?(l.openBlock(),l.createElementBlock("span",WS,"No data.")):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[t.multiple&&t.batchSelect?(l.openBlock(),l.createElementBlock("div",US,[l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:V[1]||(V[1]=F=>{var I;return h((I=b.value)==null?void 0:I.filter(S=>S.value).map(S=>S.value))})},l.toDisplayString(O.$t("wpiccomponents.select_all")),1),l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:V[2]||(V[2]=F=>p([]))},l.toDisplayString(O.$t("wpiccomponents.select_none")),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,F=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["group",{"is-selected":!!k(F.value)}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||F.value,[`${x[l.unref(fe).theme]}`]:!0}]),onClick:I=>F.disabled?null:f(F.value)},[l.createElementVNode("div",qS,[l.createElementVNode("div",KS,[l.createElementVNode("div",{class:l.normalizeClass(["",{"opacity-25":F.disabled,"line-clamp-1":t.oneLine}])},l.toDisplayString(F.label||F.value),3),F.description?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":F.disabled}])},l.toDisplayString(F.description),3)):l.createCommentVNode("",!0)]),t.multiple&&k(F.value)?(l.openBlock(),l.createBlock(Uu,{key:0,class:"w-4 h-4"})):l.createCommentVNode("",!0)])],10,YS)],2))),256)),r.remoteMethod?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[T.value?(l.openBlock(),l.createElementBlock("div",GS,l.toDisplayString(O.$t("wpiccomponents.loading_more")),1)):$.value&&((z=t.options)==null?void 0:z.length)>0?(l.openBlock(),l.createElementBlock("div",JS,l.toDisplayString(O.$t("wpiccomponents.no_more_results")),1)):(l.openBlock(),l.createElementBlock("div",ZS," - "))],64)):l.createCommentVNode("",!0)],64))],32)]}),_: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))}}),XS={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},QS={class:""},e_=["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",XS,[l.createTextVNode(l.toDisplayString(t.label)+" ",1),l.createElementVNode("div",QS,[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,e_)],64))}}),t_=["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,t_),[[l.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},n_={},r_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},i_=[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 o_(t,e){return l.openBlock(),l.createElementBlock("svg",r_,i_)}const s_=be(n_,[["render",o_]]),a_={},l_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},c_=[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 d_(t,e){return l.openBlock(),l.createElementBlock("svg",l_,c_)}const u_=be(a_,[["render",d_]]),f_={},h_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},p_=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function m_(t,e){return l.openBlock(),l.createElementBlock("svg",h_,p_)}const g_=be(f_,[["render",m_]]),y_={class:"flex items-center gap-2"},b_={key:0},k_={class:""},v_=["innerHTML"],w_={class:"flex justify-end"},x_=["name","value","checked"],E_={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},C_={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},S_={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},__={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,summaryText:String,oneLine:Boolean,total:Number},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=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 O;if(o.rules&&typeof o.rules=="string"){let V=(O=o.rules)==null?void 0:O.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(O){let V=O&&O.target?O.target.value:O;x(V)}const m=n;function g(O){O===!0||O===!1?m("update:modelValue",!O):m("update:modelValue",O)}function y(O){let V=O&&O.target?O.target.value:O;m("update:modelValue",V),m("onChange",V)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=ef(function(O){m("update:modelValue",O),m("onChange",O)},o.debounce),v=l.ref(null),b=l.ref();function C(){var O,V;o.textarea?(O=b.value)==null||O.focus():(V=v.value)==null||V.$el.focus()}function w(){return v.value.meta.valid}const T=l.ref(),$=l.computed(()=>T.value.allSelected),D=l.computed(()=>T.value.isAllSelected);return e({focus:C,isValid:w,allSelected:$,isAllSelected:D}),(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",y_,[l.createElementVNode("span",null,l.toDisplayString(c.value),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",b_,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",k_,[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,v_)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",w_,[l.renderSlot(O.$slots,"more")])],2)):l.createCommentVNode("",!0),t.checkbox?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:l.withCtx(({field:L})=>[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]=z=>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(O.$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:v,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:l.withCtx(({field:L})=>[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]=(...z)=>O.onChange&&O.onChange(...z)),checked:t.radioValue==t.modelValue},null,40,x_),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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>{var z;return[l.createVNode(Vf,{ref_key:"myChoiceList",ref:T,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,oneLine:t.oneLine,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,summaryText:t.summaryText,total:t.total,isInvalid:!!(t.error&&l.unref(a)),required:t.required||((z=h.value)==null?void 0:z.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","total","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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>[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:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:L})=>[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)}])},[O.$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",E_,[l.renderSlot(O.$slots,"prepend")])],2)):l.createCommentVNode("",!0),t.textarea?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(()=>{var L;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||((L=h.value)==null?void 0:L.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:v,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":!O.$slots.prepend&&!t.naked,"pl-8":O.$slots.prepend&&!t.naked,"pl-6":O.$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),O.$slots.append||t.password||t.type=="password"?(l.openBlock(),l.createElementBlock("div",C_,[l.createElementVNode("div",S_,[l.renderSlot(O.$slots,"append",{},()=>[l.withDirectives(l.createVNode(s_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,d.value]]),l.withDirectives(l.createVNode(u_,{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",__,[l.createVNode(l.unref(ry),{name:s.value},{default:l.withCtx(L=>[l.createTextVNode(l.toDisplayString(L.message),1)]),_:1},8,["name"])])):l.createCommentVNode("",!0),O.$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(O.$slots,"help",{},()=>[l.createTextVNode(l.toDisplayString(t.help),1)])],2)):l.createCommentVNode("",!0)],2))}}),O_=["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,O_),l.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),T_={key:1,class:"flex justify-between items-baseline pt-4 px-6"},N_={class:""},M_={key:2,class:"flex items-center justify-end py-4 px-6"},A_=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",T_,[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",N_,[l.renderSlot(r.$slots,"actions")])])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default"),r.$slots.buttons?(l.openBlock(),l.createElementBlock("div",M_,[l.renderSlot(r.$slots,"buttons")])):l.createCommentVNode("",!0)],2)}}}),D_={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},$_={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},L_=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",D_,[l.createElementVNode("div",$_,[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))}}),B_=l.createElementVNode("div",{class:""},null,-1),I_=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),V_=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(()=>[B_]),_:1},8,["text"])],6)):l.createCommentVNode("",!0)],2),t.indicators?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[I_],64)):l.createCommentVNode("",!0)],2))}}),P_={class:"leading-none"},R_=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",P_,[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))}}),F_=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))}}),j_=t=>(l.pushScopeId("data-v-947735f2"),t=t(),l.popScopeId(),t),z_={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},H_=[j_(()=>l.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],W_=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",z_,H_)):(l.openBlock(),l.createBlock(Ir,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),U_={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",U_,[l.renderSlot(i.$slots,"default")])],2))}}),Y_={},q_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},K_=[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 G_(t,e){return l.openBlock(),l.createElementBlock("svg",q_,K_)}const Hf=be(Y_,[["render",G_]]),J_={},Z_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},X_=[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 Q_(t,e){return l.openBlock(),l.createElementBlock("svg",Z_,X_)}const Wf=be(J_,[["render",Q_]]),eO={},tO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nO=[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 rO(t,e){return l.openBlock(),l.createElementBlock("svg",tO,nO)}const Uf=be(eO,[["render",rO]]),iO={},oO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},sO=[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 aO(t,e){return l.openBlock(),l.createElementBlock("svg",oO,sO)}const Yf=be(iO,[["render",aO]]),lO={class:"wpic-pagination flex justify-between"},cO={key:0,class:"flex items-center"},dO={key:0},uO={key:1,class:"flex flex-wrap gap-2"},fO=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("wpiccomponents.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 v=y;v<=k;v++)x.push(v);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",lO,[t.info?(l.openBlock(),l.createElementBlock("div",cO,[t.total>0?(l.openBlock(),l.createElementBlock("span",dO,l.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),t.pages?(l.openBlock(),l.createElementBlock("div",uO,[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,hO={},pO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},mO=[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 gO(t,e){return l.openBlock(),l.createElementBlock("svg",pO,mO)}const yO=be(hO,[["render",gO]]),bO={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",bO,[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))]))}},kO={},vO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},wO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function xO(t,e){return l.openBlock(),l.createElementBlock("svg",vO,wO)}const EO=be(kO,[["render",xO]]),CO={},SO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},_O=[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 OO(t,e){return l.openBlock(),l.createElementBlock("svg",SO,_O)}const TO=be(CO,[["render",OO]]),NO={class:"wpic-table"},MO={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},AO={class:"flex items-center gap-2"},DO={class:"flex items-center gap-2"},$O={class:"w-full rounded-lg"},LO={key:0,class:"w-16"},BO=["width"],IO=["width"],VO={class:"flex justify-center items-center h-full"},PO=["onClick"],RO={class:"rounded-b-lg relative"},FO={key:0},jO=[l.createElementVNode("td",{class:"text-center py-3"}," ",-1)],zO={class:"flex justify-center items-center h-full"},HO={key:1},WO={key:0,class:"text-center text-gray-400 py-3"},UO=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(L=>g.value.includes(L.field)||!L.selectable):m.value.filter(L=>L.visible||!L.selectable));function k(){const L=(I,S)=>{let P={};for(let R in I){if(typeof I[R].default=="boolean"&&S[R]!==void 0){P[R]=S[R]!==!1;continue}if(S[R]!==void 0){P[R]=S[R];continue}if(typeof I[R].default=="function"){P[R]=I[R].default();continue}P[R]=I[R].default}return P};let z=[];(p.default&&p.default()||[]).forEach(I=>{var S,P;((S=I.type)==null?void 0:S.name)==="WpicTableColumn"?z.push(I):(P=I.children)!=null&&P.length&&I.children.forEach(R=>{var ee;((ee=R.type)==null?void 0:ee.name)==="WpicTableColumn"&&z.push(R)})}),m.value=z.map(I=>{let S=I.children,P=I.props||{},{field:R,label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,sortable:W,selectable:K,render:q,type:H,align:ce,visible:le,noPadding:ve}=L(I.type.props,P);return R||(R=V(ee)),K&&le&&g.value.push(R),{label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,type:H,align:ce,sortable:W,selectable:K,field:R,render:q,children:S,visible:le,noPadding:ve}})}function x(L){var F,I;let z=(F=r.sortOptions)==null?void 0:F.sortDirection;((I=r.sortOptions)==null?void 0:I.sortBy)===L&&(z=z==="asc"?"desc":"asc"),f("changeSort",{sortDirection:z,sortBy:L})}l.watch(()=>p.default,L=>{k()},{deep:!0});const v=l.reactive({});function b({index:L,item:z}){v[L]?v[L]=null:(v[L]=!0,f("expandRow",{index:L,item:z}))}const C=l.ref([]);function w(L){const z=O(L,r.itemId);C.value.includes(z)?(C.value.splice(C.value.indexOf(z),1),T.value=!1):C.value.push(z)}const T=l.ref(!1);function $(){if(T.value=!T.value,C.value=[],T.value)for(let L of r.data){let z=O(L,r.itemId);C.value.push(z)}}function D(){T.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:D});function O(L,z){return z.split(".").reduce((F,I)=>F?F[I]:void 0,L)}function V(L){return!L||typeof L!="string"?"":L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(L,z)=>{const F=l.resolveComponent("wpic-choice-list"),I=l.resolveComponent("wpic-form-field");return l.openBlock(),l.createElementBlock("div",NO,[L.$slots.header||L.$slots.actions||t.columnToggleable?(l.openBlock(),l.createElementBlock("div",MO,[l.createElementVNode("div",AO,[l.renderSlot(L.$slots,"header")]),l.createElementVNode("div",DO,[l.renderSlot(L.$slots,"actions"),l.createVNode(F,{multiple:"",modelValue:g.value,"onUpdate:modelValue":z[0]||(z[0]=S=>g.value=S),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(S=>S.selectable).map(S=>({label:S.label,value:S.field}))},{default:l.withCtx(()=>[l.createVNode(_i,{medium:"",square:"",colorless:"",class:"ml-px"},{default:l.withCtx(()=>[l.createVNode(TO,{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",$O,[l.createElementVNode("colgroup",null,[t.checkable?(l.openBlock(),l.createElementBlock("col",LO)):l.createCommentVNode("",!0),y.value.find(S=>S.type=="expand")?(l.openBlock(),l.createElementBlock("col",{key:1,style:l.normalizeStyle({minWidth:`${y.value.find(S=>S.type=="expand").minWidth}px`}),width:y.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,BO)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(S=>S.type!="expand"),(S,P)=>(l.openBlock(),l.createElementBlock("col",{style:l.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:P},null,12,IO))),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",VO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:T.value,"onUpdate:modelValue":$},null,8,["modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(S=>S.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(S=>S.type!="expand"),(S,P)=>{var R,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":P===0}]),style:l.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[l.createElementVNode("div",{onClick:()=>{S.sortable&&x(S.field)},class:l.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[l.createElementVNode("span",{class:l.normalizeClass(["select-none font-medium text-sm",{"text-right":S.align=="right"}])},l.toDisplayString(S.label),3),S.sortable&&S.field?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["ml-1",{"opacity-25":S.field!=((R=t.sortOptions)==null?void 0:R.sortBy)}])},[l.createVNode(yO,{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,PO)],6)}),256))])],2)),l.createElementVNode("tbody",RO,[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",FO,jO))],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,(S,P)=>{var R,ee,ie,he,ue;return l.openBlock(),l.createElementBlock(l.Fragment,{key:`tr_${P}`},[l.createElementVNode("tr",{class:l.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":P%2==0,"is-even":P%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",zO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes(O(S,t.itemId)),checkboxValue:O(S,t.itemId),"onUpdate:modelValue":B=>w(S)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(B=>B.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:B=>b({item:S,index:P})},{default:l.withCtx(()=>[v[P]?(l.openBlock(),l.createBlock(g_,{key:0,class:"w-4 h-4"})):(l.openBlock(),l.createBlock(EO,{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(B=>B.type!="expand"),(B,W)=>{var K,q;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":W===0,[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!B.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((K=t.data)==null?void 0:K.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":P===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(H=>H.type=="expand")&&!t.noRadius,"text-center justify-center":B.align=="center","text-right justify-end":B.align=="right","align-top py-5":t.valign=="top"}]),style:l.normalizeStyle({maxWidth:`${B.maxWidth}px`}),id:`${P}_${W}`,column:B,item:S,rowIndex:P,key:W},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(B=>B.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":!((R=y.value.find(B=>B.type=="expand"))!=null&&R.noPadding),"p-0":(ee=y.value.find(B=>B.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((ie=t.data)==null?void 0:ie.length)-1&&!t.totalItem,"first:rounded-bl-lg":P===((he=t.data)==null?void 0:he.length)-1&&!t.totalItem,"text-center":y.value.find(B=>B.type=="expand").align=="center","text-right":y.value.find(B=>B.type=="expand").align=="right"}]),column:y.value.find(B=>B.type=="expand"),rowIndex:P,colspan:(ue=y.value)==null?void 0:ue.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[l.vShow,v[P]]]):l.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(l.openBlock(),l.createElementBlock("tfoot",HO,[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",WO," No Data ")):l.createCommentVNode("",!0)],2)])}}}),YO={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 J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,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 J(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let 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 J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return 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 J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const 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(J.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ne(e,r,i)}}ne.empty=new ne(J.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 qO(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}=KO(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 J(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 J(r)}function KO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class 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 GO);let i=r.elts[r.i]=Ui.resolve(e,n);return r.i=(r.i+1)%JO,i}}class GO{constructor(){this.elts=[],this.i=0}}const JO=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 ZO=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||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ts(this.attrs,n||e.defaultAttrs||ZO)&&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 qO(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=J.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=J.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 XO(e,n);if(r.next==null)return br.empty;let i=ih(r);r.next&&r.err("Unexpected trailing text");let o=oT(iT(i));return sT(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 J.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 XO{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(QO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function QO(t){let e=[];do e.push(eT(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function eT(t){let e=rT(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=tT(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 tT(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 nT(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 rT(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=nT(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 iT(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 oT(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 sT(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 lT(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),J.from(n),Be.setFrom(r))}createChecked(e=null,n,r){return n=J.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=J.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(J.empty,!0);return o?new 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 aT(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 lT{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?aT(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 cT(t){return t.tag!=null}function dT(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(cT(i))this.tags.push(i);else if(dT(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(hT(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},uT={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(J.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&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=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!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&&fT(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:uT.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 fT(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 hT(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 pT(t){let e=xh.get(t);return e===void 0&&xh.set(t,e=mT(t)),e}function mT(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=pT(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 gT(t,e){return t+e*Ch}function Sh(t){return t&Eh}function yT(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+yT(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:gT(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 J.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(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new 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(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new 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 bT(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 kT(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(J.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(J.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 vT(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||!vT(i,o,s))break}return null}function wT(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=J.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=J.from(r.node(m).copy(u)),f++):c--;let h=J.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=J.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,a,new ne(u.append(h),f,p),u.size-f,!0))}function al(t,e,n=null,r=t){let i=xT(t,e),o=i&&ET(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 xT(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 ET(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 CT(t,e,n){let r=J.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=J.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Xe(i,o,i,o,new ne(r,0,0),n.length,!0))}function ST(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)&&_T(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(J.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 _T(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function OT(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(J.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 TT(t,e,n=1,r){let i=t.doc.resolve(e),o=J.empty,s=J.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=J.from(i.node(a).copy(o));let u=r&&r[d];s=J.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 NT(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&&NT(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 MT(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 AT(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 DT(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 DT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,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(J.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,J.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=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,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=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(J.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&&!$T(n,o.content,s)?a:null}function $T(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function LT(t){return t.spec.defining||t.spec.definingForContent}function BT(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=LT(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),v=i.index(y-1);if(x.canReplaceWith(v,v,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(J.empty,!0))}return t}function IT(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=AT(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ne(J.from(r),0,0))}function VT(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(J.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 PT{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(J.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 BT(this,e,n,r),this}replaceRangeWith(e,n,r){return IT(this,e,n,r),this}deleteRange(e,n){return VT(this,e,n),this}lift(e,n){return wT(this,e,n),this}join(e,n=1){return MT(this,e,n),this}wrap(e,n){return CT(this,e,n),this}setBlockType(e,n=e,r,i=null){return ST(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return OT(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 TT(this,e,n,r),this}addMark(e,n,r){return bT(this,e,n,r),this}removeMark(e,n,r){return kT(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 RT(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 RT{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(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new 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 FT}}xe.jsonID("all",Lt);const FT={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 jT extends PT{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 zT=[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=zT.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 jT(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},HT=function(){pl=null},vr=function(t,e,n,r){return n&&(qh(t,e,n,r,-1)||qh(t,e,n,r,1))},WT=/^(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)||WT.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 UT(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 YT(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 qT(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 KT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function GT(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),JT=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(qn),Qi=!!Kh&&"webkitFontSmoothing"in Kh.documentElement.style,ZT=Qi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function XT(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 QT(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?XT(o):QT(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 e5(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 t5({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 n5(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?r5(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:ep(n,i)}function r5(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 i5(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function o5(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 s5(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 a5(t,e){let n=t.dom.ownerDocument,r,i=0,o=GT(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=i5(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=s5(t,r,i,e))}a==null&&(a=o5(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 l5=/[\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&&(l5.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 c5(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 d5=/[\u0590-\u08ac]/;function u5(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?!d5.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 f5(t,e,n){return op==e&&sp==n?ap:(op=e,sp=n,ap=n=="up"||n=="down"?c5(t,e,n):u5(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 h5 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 p5(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=()=>J.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 g5(this,s&&s.node,e);k5(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&&v5(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=w5(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 h5(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 p5 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}m5(i,a||Cr[0],s)}return i}function m5(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 g5{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=y5(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 y5(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 b5(t,e){return t.type.side-e.type.side}function k5(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(b5);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 v5(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 w5(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&&qT(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)E5(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&&x5(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 x5(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 E5(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 C5(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?S5(t):_5(t)}function S5(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 _5(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 O5(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 T5(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=O5(e,n))?(e=s,n=0):(o=T5(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||JT)&&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 N5(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 M5(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function A5(t,e){let n=e.keyCode,r=M5(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 N5(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
33
|
|
|
34
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(J.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=L5(n),Qi&&B5(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&&!A5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=I5(Lp(a,+u[1],+u[2]),u[4]);else if(a=ne.maxOpen(D5(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 A5=/^(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 D5(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 J.from(s)}return t}function Ap(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.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(J.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(J.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(J.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 $5(t){let e=window.trustedTypes;return e?(Nl||(Nl=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Nl.createHTML(t)):t}function L5(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=$5(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function B5(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 I5(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=J.from(c.create(r[a+1],i)),o++,s++}return new ne(i,o,s)}const bt={},kt={},V5={touchstart:!0,touchmove:!0};class P5{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 R5(t){for(let e in bt){let n=bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{j5(t,r)&&!Al(t,r)&&(t.editable||!(r.type in kt))&&n(t,r)},V5[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 F5(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 j5(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 z5(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))||M5(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 H5(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 W5(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 U5(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 Y5(t,e,n,r,i){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?U5(t,n):W5(t,n))}function q5(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function K5(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||G5(t,n,r)}function G5(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&&H5(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 J5(t,s,n,!!r)):(o=="doubleClick"?q5:K5)(t,s.pos,s.inside,n)?n.preventDefault():Xn(t,"pointer"))};class J5{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"):Y5(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 Z5=_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,Z5)},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=Q5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function X5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=WT(e.focusNode,e.focusOffset),r=UT(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 Q5(){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 eN(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&&JT<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)):eN(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function tN(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function nN(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=tN(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():nN(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?rN(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 rN(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 v=a[k]+u-f;p>=v?a[k+1]=h<=v?-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=iN(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 iN(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 oN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},sN=_t&&Kn<=11;class aN{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 lN{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new aN,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()}),sN&&(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,oN)),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||uN(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),cN(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 cN(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 dN(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 uN(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 fN(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:hN,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 hN(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 pN=/^(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 mN(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=xl(t,D);if(O&&!t.state.selection.eq(O)){if(ut&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,wr(13,"Enter"))))return;let V=t.state.tr.setSelection(O);D=="pointer"?V.setMeta("pointer",!0):D=="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=fN(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=bN(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(ii&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(D=>D.nodeType==1&&!pN.test(D.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",D=>D(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 D=Xp(t,t.state.doc,d.sel);if(D&&!D.eq(t.state.selection)){let O=t.state.tr.setSelection(D);o&&O.setMeta("composition",o),t.dispatch(O)}}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,v;if((ii&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(v=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&v.head==y.pos)&&t.someProp("handleKeyDown",D=>D(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&yN(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",D=>D(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(D){return D(t,wr(13,"Enter"))})},20));let b=m.start,C=m.endA,w,T,$;if(x){if(g.pos==y.pos)_t&&Kn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),w=t.state.tr.delete(b,C),T=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&($=gN(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))w=t.state.tr,$.type=="add"?w.addMark(b,C,$.mark):w.removeMark(b,C,$.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let D=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,C,D)))return;w=t.state.tr.insertText(D,b,C)}}if(w||(w=t.state.tr.replace(b,C,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let D=Xp(t,w.doc,d.sel);D&&!(ut&&t.composing&&D.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(D.head==b||D.head==w.mapping.map(C)-1)||_t&&D.empty&&D.head==b)&&w.setSelection(D)}T&&w.ensureMarks(T),o&&w.setMeta("composition",o),t.dispatch(w.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 gN(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(J.from(d).eq(t))return{mark:a,type:s}}function yN(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 bN(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 kN{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 P5,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 lN(this,(r,i,o,s)=>mN(this,r,i,o,s)),this.domObserver.start(),R5(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);wN(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&&QT(this);if(s){this.domObserver.stop();let p=f&&(_t||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&vN(i.selection,e.selection);if(f){let m=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=X5(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())&&E5(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&&e5(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&&t5(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 s5(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 u5(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&&(F5(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,zT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return z5(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&&qT(this.dom.ownerDocument)==this.dom&&dN(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 vN(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 wN(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:'"'},xN=typeof navigator<"u"&&/Mac/.test(navigator.platform),EN=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 CN(t){var e=xN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||EN&&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 SN=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _N(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))SN?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 ON(t){let e=Object.create(null);for(let n in t)e[_N(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 TN(t){return new it({props:{handleKeyDown:om(t)}})}function om(t){let e=ON(t);return function(n,r){let i=CN(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},NN=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);return i?lm(t,i,e):!1},MN=(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 AN=(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},DN=(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},$N=(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 LN=(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 BN(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 IN=BN(),VN=(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 PN(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&&PN(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=J.empty;for(let k=s.length-1;k>=0;k--)m=J.from(s[k].create(null,m));m=J.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new 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=J.empty;for(let v=m.length-1;v>=0;v--)k=J.from(m[v].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 RN=ym(-1),FN=ym(1);function jN(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,IN),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function zN(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 HN(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function HN(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&&WN(t,e,a,i,n),!0):!1}function WN(t,e,n,r,i){let o=J.empty;for(let u=n.length-1;u>=0;u--)o=J.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new 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 UN(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?YN(e,n,t,o):qN(e,n,o):!0:!1}}function YN(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(J.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 qN(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?J.empty:J.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?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function KN(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=J.from(d?t.create():null),f=new ne(J.from(t.create(null,J.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 GN{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 JN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ZN(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):ZN(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"&&JN(n)?!1:n!=null))}function XN(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 v=ae(x,"extendNodeSchema",f);return{...k,...v?v(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 QN=(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 eM=(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=QN(d)+o;return s.forEach(h=>{if(u)return;const p=eM(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:v}=new Ss({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:v})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function tM(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(J.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
|
|
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=B5(n),Qi&&I5(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&&!D5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=V5(Lp(a,+u[1],+u[2]),u[4]);else if(a=ne.maxOpen($5(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 D5=/^(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 $5(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 J.from(s)}return t}function Ap(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.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(J.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(J.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(J.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 L5(t){let e=window.trustedTypes;return e?(Nl||(Nl=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Nl.createHTML(t)):t}function B5(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=L5(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function I5(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 V5(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=J.from(c.create(r[a+1],i)),o++,s++}return new ne(i,o,s)}const bt={},kt={},P5={touchstart:!0,touchmove:!0};class R5{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 F5(t){for(let e in bt){let n=bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{z5(t,r)&&!Al(t,r)&&(t.editable||!(r.type in kt))&&n(t,r)},P5[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 j5(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 z5(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 H5(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))||A5(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 W5(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 U5(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 Y5(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 q5(t,e,n,r,i){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?Y5(t,n):U5(t,n))}function K5(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function G5(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||J5(t,n,r)}function J5(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&&W5(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 Z5(t,s,n,!!r)):(o=="doubleClick"?K5:G5)(t,s.pos,s.inside,n)?n.preventDefault():Xn(t,"pointer"))};class Z5{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"):q5(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 X5=_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,X5)},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=eN());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Q5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=UT(e.focusNode,e.focusOffset),r=YT(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 eN(){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 tN(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&&ZT<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)):tN(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function nN(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function rN(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=nN(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():rN(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?iN(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 iN(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 v=a[k]+u-f;p>=v?a[k+1]=h<=v?-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=oN(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 oN(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 sN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},aN=_t&&Kn<=11;class lN{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 cN{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new lN,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()}),aN&&(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,sN)),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||fN(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),dN(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 dN(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 uN(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 fN(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 hN(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:pN,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 pN(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 mN=/^(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 gN(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=xl(t,D);if(O&&!t.state.selection.eq(O)){if(ut&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,wr(13,"Enter"))))return;let V=t.state.tr.setSelection(O);D=="pointer"?V.setMeta("pointer",!0):D=="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=hN(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=kN(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(ii&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(D=>D.nodeType==1&&!mN.test(D.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",D=>D(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 D=Xp(t,t.state.doc,d.sel);if(D&&!D.eq(t.state.selection)){let O=t.state.tr.setSelection(D);o&&O.setMeta("composition",o),t.dispatch(O)}}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,v;if((ii&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(v=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&v.head==y.pos)&&t.someProp("handleKeyDown",D=>D(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&bN(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",D=>D(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(D){return D(t,wr(13,"Enter"))})},20));let b=m.start,C=m.endA,w,T,$;if(x){if(g.pos==y.pos)_t&&Kn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),w=t.state.tr.delete(b,C),T=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&($=yN(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))w=t.state.tr,$.type=="add"?w.addMark(b,C,$.mark):w.removeMark(b,C,$.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let D=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,C,D)))return;w=t.state.tr.insertText(D,b,C)}}if(w||(w=t.state.tr.replace(b,C,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let D=Xp(t,w.doc,d.sel);D&&!(ut&&t.composing&&D.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(D.head==b||D.head==w.mapping.map(C)-1)||_t&&D.empty&&D.head==b)&&w.setSelection(D)}T&&w.ensureMarks(T),o&&w.setMeta("composition",o),t.dispatch(w.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 yN(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(J.from(d).eq(t))return{mark:a,type:s}}function bN(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 kN(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 vN{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 R5,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 cN(this,(r,i,o,s)=>gN(this,r,i,o,s)),this.domObserver.start(),F5(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);xN(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&&e5(this);if(s){this.domObserver.stop();let p=f&&(_t||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&wN(i.selection,e.selection);if(f){let m=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Q5(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())&&C5(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&&t5(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&&n5(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 a5(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 f5(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&&(j5(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,HT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return H5(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&&KT(this.dom.ownerDocument)==this.dom&&uN(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 wN(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 xN(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:'"'},EN=typeof navigator<"u"&&/Mac/.test(navigator.platform),CN=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 SN(t){var e=EN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||CN&&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 _N=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function ON(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))_N?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 TN(t){let e=Object.create(null);for(let n in t)e[ON(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 NN(t){return new it({props:{handleKeyDown:om(t)}})}function om(t){let e=TN(t);return function(n,r){let i=SN(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},MN=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);return i?lm(t,i,e):!1},AN=(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 DN=(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},$N=(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},LN=(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 BN=(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 IN(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 VN=IN(),PN=(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 RN(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&&RN(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=J.empty;for(let k=s.length-1;k>=0;k--)m=J.from(s[k].create(null,m));m=J.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new 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=J.empty;for(let v=m.length-1;v>=0;v--)k=J.from(m[v].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 FN=ym(-1),jN=ym(1);function zN(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,VN),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function HN(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 WN(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function WN(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&&UN(t,e,a,i,n),!0):!1}function UN(t,e,n,r,i){let o=J.empty;for(let u=n.length-1;u>=0;u--)o=J.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new 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 YN(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?qN(e,n,t,o):KN(e,n,o):!0:!1}}function qN(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(J.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 KN(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?J.empty:J.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?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function GN(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=J.from(d?t.create():null),f=new ne(J.from(t.create(null,J.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 JN{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 ZN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function XN(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):XN(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"&&ZN(n)?!1:n!=null))}function QN(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 v=ae(x,"extendNodeSchema",f);return{...k,...v?v(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 eM=(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 tM=(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=eM(d)+o;return s.forEach(h=>{if(u)return;const p=tM(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:v}=new Ss({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:v})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function nM(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(J.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 rM(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ns(t){return rM(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 iM(t){return typeof t=="number"}class oM{constructor(e){this.find=e.find,this.handler=e.handler}}const sM=(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 aM(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,"");sM(k,o.find,s).forEach(v=>{if(v.index===void 0)return;const b=g+v.index+1,C=b+v[0].length,w={from:n.tr.mapping.map(b),to:n.tr.mapping.map(C)},T=o.handler({state:n,range:w,match:v,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:a});f.push(T)})}),f.every(p=>p!==null)}let As=null;const lM=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 cM(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(!(!aM({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(J.from(C),p.schema);const{from:w}=k,T=w+C.length,$=lM(C);return c({rule:u,state:p,from:w,to:{b:T},pasteEvt:$})}const v=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!iM(v)||!b||v===b.b))return c({rule:u,state:p,from:v,to:b,pasteEvt:s})}}))}function dM(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=QN(this.extensions,n),this.setupExtensions()}static resolve(e){const n=di.sort(di.flatten(e)),r=dM(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=NN(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[nM({editor:e,rules:r}),...cM({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
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 dM=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})}}})]}}),uM=()=>({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),fM=(t=!1)=>({commands:e})=>e.setContent("",t),hM=()=>({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},pM=t=>e=>t(e),mM=()=>({state:t,dispatch:e})=>pm(t,e),gM=(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},yM=()=>({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},bM=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},kM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},vM=()=>({state:t,dispatch:e})=>Fl(t,e),wM=()=>({commands:t})=>t.keyboardShortcut("Enter"),xM=()=>({state:t,dispatch:e})=>LN(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 EM=(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},CM=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 SM(){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 _M=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Zl()||SM())&&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},OM=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),TM=(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 J)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(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 NM(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 MM=t=>!("type"in t),AM=(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((MM(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 J){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=a,r.replaceWith(c,d,p);n.updateSelection&&NM(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},DM=()=>({state:t,dispatch:e})=>AN(t,e),$M=()=>({state:t,dispatch:e})=>DN(t,e),LM=()=>({state:t,dispatch:e})=>am(t,e),BM=()=>({state:t,dispatch:e})=>um(t,e),IM=()=>({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}},VM=()=>({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}},PM=()=>({state:t,dispatch:e})=>NN(t,e),RM=()=>({state:t,dispatch:e})=>MN(t,e);function Mm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function FM(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 jM=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=FM(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 zM=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?$N(n,r):!1},HM=()=>({state:t,dispatch:e})=>mm(t,e),WM=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return UN(r)(e,n)},UM=()=>({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 YM=(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},qM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),KM=()=>({tr:t,dispatch:e})=>{if(e){const n=new Lt(t.doc);t.setSelection(n)}return!0},GM=()=>({state:t,dispatch:e})=>cm(t,e),JM=()=>({state:t,dispatch:e})=>fm(t,e),ZM=()=>({state:t,dispatch:e})=>VN(t,e),XM=()=>({state:t,dispatch:e})=>FN(t,e),QM=()=>({state:t,dispatch:e})=>RN(t,e);function Xl(t,e,n={},r={}){return Ls(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const eA=(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 tA(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 nA(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=>nA(e.$from,t)}function rA(t,e){const n={from:0,to:t.content.size};return Cm(t,n,e)}function iA(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 oA(t,e){const n=Bs(typeof e=="string"?e:e.name,t.schema);return n==="node"?iA(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),v=x-k;s+=v,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 sA(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 aA(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 lA(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 cA=(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 lA(r,n,c)},dA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),uA=(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)},fA=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},hA=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},pA=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return KN(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 mA=({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:tA(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},gA=(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=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let $=c.depth-x;$>=c.depth-3;$-=1)k=J.from(c.node($).copy(k));const v=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(J.from(a.createAndFill(null,C)||void 0));const w=c.before(c.depth-(x-1));n.replace(w,c.after(-v),new ne(k,4-x,0));let T=-1;n.doc.nodesBetween(w,n.doc.content.size,($,D)=>{if(T>-1)return!1;$.isTextblock&&$.content.size===0&&(T=D+1)}),T>-1&&n.setSelection(ke.near(n.doc.resolve(T))),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:v}=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(w=>v.includes(w.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 yA=Object.freeze({__proto__:null,blur:uM,clearContent:fM,clearNodes:hM,command:pM,createParagraphNear:mM,cut:gM,deleteCurrentNode:yM,deleteNode:bM,deleteRange:kM,deleteSelection:vM,enter:wM,exitCode:xM,extendMarkRange:EM,first:CM,focus:_M,forEach:OM,insertContent:TM,insertContentAt:AM,joinBackward:LM,joinDown:$M,joinForward:BM,joinItemBackward:IM,joinItemForward:VM,joinTextblockBackward:PM,joinTextblockForward:RM,joinUp:DM,keyboardShortcut:jM,lift:zM,liftEmptyBlock:HM,liftListItem:WM,newlineInCode:UM,resetAttributes:YM,scrollIntoView:qM,selectAll:KM,selectNodeBackward:GM,selectNodeForward:JM,selectParentNode:ZM,selectTextblockEnd:XM,selectTextblockStart:QM,setContent:eA,setMark:cA,setMeta:dA,setNode:uA,setNodeSelection:fA,setTextSelection:hA,sinkListItem:pA,splitBlock:mA,splitListItem:gA,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,v=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!v)return!1;const C=Ql(w=>$m(w.type.name,f))(g);if(v.depth>=1&&C&&v.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 w=u().wrapInList(p,r),T=b.filter($=>h.includes($.type.name));return o.ensureMarks(T),w?!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),v=Math.min(y+g.nodeSize,u);n.addMark(x,v,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 jN(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return zN(i,e)(n,r)}});const bA=qe.create({name:"commands",addCommands(){return{...yA}}}),kA=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})}}})]}}),vA=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new Bt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wA=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}}}})]}}),xA=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}})]}}),EA=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})}}})]}}),CA=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 SA=`.ProseMirror {
|
|
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 uM=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})}}})]}}),fM=()=>({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),hM=(t=!1)=>({commands:e})=>e.setContent("",t),pM=()=>({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},mM=t=>e=>t(e),gM=()=>({state:t,dispatch:e})=>pm(t,e),yM=(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},bM=()=>({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},kM=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},vM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},wM=()=>({state:t,dispatch:e})=>Fl(t,e),xM=()=>({commands:t})=>t.keyboardShortcut("Enter"),EM=()=>({state:t,dispatch:e})=>BN(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 CM=(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},SM=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 _M(){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 OM=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Zl()||_M())&&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},TM=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),NM=(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 J)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(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 MM(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 AM=t=>!("type"in t),DM=(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((AM(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 J){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=a,r.replaceWith(c,d,p);n.updateSelection&&MM(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},$M=()=>({state:t,dispatch:e})=>DN(t,e),LM=()=>({state:t,dispatch:e})=>$N(t,e),BM=()=>({state:t,dispatch:e})=>am(t,e),IM=()=>({state:t,dispatch:e})=>um(t,e),VM=()=>({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}},PM=()=>({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}},RM=()=>({state:t,dispatch:e})=>MN(t,e),FM=()=>({state:t,dispatch:e})=>AN(t,e);function Mm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function jM(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 zM=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=jM(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 HM=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?LN(n,r):!1},WM=()=>({state:t,dispatch:e})=>mm(t,e),UM=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return YN(r)(e,n)},YM=()=>({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 qM=(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},KM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),GM=()=>({tr:t,dispatch:e})=>{if(e){const n=new Lt(t.doc);t.setSelection(n)}return!0},JM=()=>({state:t,dispatch:e})=>cm(t,e),ZM=()=>({state:t,dispatch:e})=>fm(t,e),XM=()=>({state:t,dispatch:e})=>PN(t,e),QM=()=>({state:t,dispatch:e})=>jN(t,e),eA=()=>({state:t,dispatch:e})=>FN(t,e);function Xl(t,e,n={},r={}){return Ls(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const tA=(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 nA(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 rA(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=>rA(e.$from,t)}function iA(t,e){const n={from:0,to:t.content.size};return Cm(t,n,e)}function oA(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 sA(t,e){const n=Bs(typeof e=="string"?e:e.name,t.schema);return n==="node"?oA(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),v=x-k;s+=v,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 aA(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 lA(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 cA(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 dA=(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 cA(r,n,c)},uA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),fA=(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)},hA=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},pA=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},mA=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return GN(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 gA=({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:nA(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},yA=(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=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let $=c.depth-x;$>=c.depth-3;$-=1)k=J.from(c.node($).copy(k));const v=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(J.from(a.createAndFill(null,C)||void 0));const w=c.before(c.depth-(x-1));n.replace(w,c.after(-v),new ne(k,4-x,0));let T=-1;n.doc.nodesBetween(w,n.doc.content.size,($,D)=>{if(T>-1)return!1;$.isTextblock&&$.content.size===0&&(T=D+1)}),T>-1&&n.setSelection(ke.near(n.doc.resolve(T))),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:v}=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(w=>v.includes(w.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 bA=Object.freeze({__proto__:null,blur:fM,clearContent:hM,clearNodes:pM,command:mM,createParagraphNear:gM,cut:yM,deleteCurrentNode:bM,deleteNode:kM,deleteRange:vM,deleteSelection:wM,enter:xM,exitCode:EM,extendMarkRange:CM,first:SM,focus:OM,forEach:TM,insertContent:NM,insertContentAt:DM,joinBackward:BM,joinDown:LM,joinForward:IM,joinItemBackward:VM,joinItemForward:PM,joinTextblockBackward:RM,joinTextblockForward:FM,joinUp:$M,keyboardShortcut:zM,lift:HM,liftEmptyBlock:WM,liftListItem:UM,newlineInCode:YM,resetAttributes:qM,scrollIntoView:KM,selectAll:GM,selectNodeBackward:JM,selectNodeForward:ZM,selectParentNode:XM,selectTextblockEnd:QM,selectTextblockStart:eA,setContent:tA,setMark:dA,setMeta:uA,setNode:fA,setNodeSelection:hA,setTextSelection:pA,sinkListItem:mA,splitBlock:gA,splitListItem:yA,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,v=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!v)return!1;const C=Ql(w=>$m(w.type.name,f))(g);if(v.depth>=1&&C&&v.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 w=u().wrapInList(p,r),T=b.filter($=>h.includes($.type.name));return o.ensureMarks(T),w?!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),v=Math.min(y+g.nodeSize,u);n.addMark(x,v,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 zN(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return HN(i,e)(n,r)}});const kA=qe.create({name:"commands",addCommands(){return{...bA}}}),vA=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})}}})]}}),wA=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new Bt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xA=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}}}})]}}),EA=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}})]}}),CA=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})}}})]}}),SA=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 _A=`.ProseMirror {
|
|
40
40
|
position: relative;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -110,36 +110,36 @@ img.ProseMirror-separator {
|
|
|
110
110
|
|
|
111
111
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
112
112
|
opacity: 0
|
|
113
|
-
}`;function
|
|
113
|
+
}`;function OA(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 TA=class extends JN{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=OA(_A,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?[wA,uM.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),kA,xA,EA,SA,vA,CA].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 vN(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 sA(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return aA(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ql(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
114
114
|
|
|
115
|
-
`,textSerializers:r={}}=e||{};return rA(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 iM({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",TA="clippingParents",Vm="viewport",fo="popper",NA="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])},[]),MA="beforeRead",AA="read",DA="afterRead",$A="beforeMain",LA="main",BA="afterMain",IA="beforeWrite",VA="write",PA="afterWrite",RA=[MA,AA,DA,$A,LA,BA,IA,VA,PA];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 FA(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 jA(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:FA,effect:jA,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 zA(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 HA(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&&zA(n)&&Mn(n).position==="static";)n=Hm(n);return n&&(un(n)==="html"||un(n)==="body"&&Mn(n).position==="static")?e:n||HA(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 WA(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 UA=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 YA(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=UA(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,v=g/2-y/2,b=f[p],C=x-h[u]-f[m],w=x/2-h[u]/2+v,T=po(b,w,C),$=c;n.modifiersData[r]=(e={},e[$]=T,e.centerOffset=T-w,e)}}function qA(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 KA={name:"arrow",enabled:!0,phase:"main",fn:YA,effect:qA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var GA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function JA(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"),v=Nt,b=Tt,C=window;if(d){var w=ho(n),T="clientHeight",$="clientWidth";if(w===Vt(n)&&(w=rr(n),Mn(w).position!=="static"&&a==="absolute"&&(T="scrollHeight",$="scrollWidth")),w=w,i===Tt||(i===Nt||i===Yt)&&o===uo){b=Ut;var D=f&&w===C&&C.visualViewport?C.visualViewport.height:w[T];g-=D-r.height,g*=c?1:-1}if(i===Nt||(i===Tt||i===Ut)&&o===uo){v=Yt;var O=f&&w===C&&C.visualViewport?C.visualViewport.width:w[$];p-=O-r.width,p*=c?1:-1}}var V=Object.assign({position:a},d&&GA),L=u===!0?JA({x:p,y:g},Vt(n)):{x:p,y:g};if(p=L.x,g=L.y,c){var z;return Object.assign({},V,(z={},z[b]=x?"0":"",z[v]=k?"0":"",z.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",z))}return Object.assign({},V,(e={},e[b]=x?g+"px":"",e[v]=k?p+"px":"",e.transform="",e))}function ZA(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 XA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ZA,data:{}};var Fs={passive:!0};function QA(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 e3={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:QA,data:{}};var t3={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return t3[e]})}var n3={start:"end",end:"start"};function Km(t){return t.replace(/start|end/g,function(e){return n3[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 r3(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 i3(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 o3(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(r3(t,n)):Tr(e)?o3(e,n):hc(i3(rr(t)))}function s3(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 a3(t,e,n,r){var i=e==="clippingParents"?s3(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?TA: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?NA:fo,v=t.rects.popper,b=t.elements[m?x:h],C=a3(Tr(b)?b:b.contextElement||rr(t.elements.popper),c,u,s),w=mi(t.elements.reference),T=Zm({reference:w,element:v,placement:i}),$=hc(Object.assign({},v,T)),D=h===fo?$:w,O={top:C.top-D.top+k.top,bottom:D.bottom-C.bottom+k.bottom,left:C.left-D.left+k.left,right:D.right-C.right+k.right},V=t.modifiersData.offset;if(h===fo&&V){var L=V[i];Object.keys(O).forEach(function(z){var F=[Yt,Ut].indexOf(z)>=0?1:-1,I=[Tt,Ut].indexOf(z)>=0?"y":"x";O[z]+=L[I]*F})}return O}function l3(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 c3(t){if(fn(t)===oc)return[];var e=js(t);return[Km(t),e,Km(e)]}function d3(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,v=c||(x||!m?[js(y)]:c3(y)),b=[y].concat(v).reduce(function(W,K){return W.concat(fn(K)===oc?l3(e,{placement:K,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),C=e.rects.reference,w=e.rects.popper,T=new Map,$=!0,D=b[0],O=0;O<b.length;O++){var V=b[O],L=fn(V),z=gi(V)===hi,F=[Tt,Ut].indexOf(L)>=0,I=F?"width":"height",S=go(e,{placement:V,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),P=F?z?Yt:Nt:z?Ut:Tt;C[I]>w[I]&&(P=js(P));var R=js(P),ee=[];if(o&&ee.push(S[L]<=0),a&&ee.push(S[P]<=0,S[R]<=0),ee.every(function(W){return W})){D=V,$=!1;break}T.set(V,ee)}if($)for(var ie=m?3:1,he=function(K){var q=b.find(function(H){var ce=T.get(H);if(ce)return ce.slice(0,K).every(function(le){return le})});if(q)return D=q,"break"},ue=ie;ue>0;ue--){var B=he(ue);if(B==="break")break}e.placement!==D&&(e.modifiersData[r]._skip=!0,e.placement=D,e.reset=!0)}}const u3={name:"flip",enabled:!0,phase:"main",fn:d3,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 f3(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 h3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:f3};function p3(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 m3(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]=p3(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 g3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:m3};function y3(t){var e=t.state,n=t.name;e.modifiersData[n]=Zm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const b3={name:"popperOffsets",enabled:!0,phase:"read",fn:y3,data:{}};function k3(t){return t==="x"?"y":"x"}function v3(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),v=!x,b=cc(k),C=k3(b),w=e.modifiersData.popperOffsets,T=e.rects.reference,$=e.rects.popper,D=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(w){if(o){var z,F=b==="y"?Tt:Nt,I=b==="y"?Ut:Yt,S=b==="y"?"height":"width",P=w[b],R=P+y[F],ee=P-y[I],ie=p?-$[S]/2:0,he=x===hi?T[S]:$[S],ue=x===hi?-$[S]:-T[S],B=e.elements.arrow,W=p&&B?lc(B):{width:0,height:0},K=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wm(),q=K[F],H=K[I],ce=po(0,T[S],W[S]),le=v?T[S]/2-ie-ce-q-O.mainAxis:he-ce-q-O.mainAxis,ve=v?-T[S]/2+ie+ce+H+O.mainAxis:ue+ce+H+O.mainAxis,Ne=e.elements.arrow&&ho(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(z=V==null?void 0:V[b])!=null?z:0,Q=P+le-tt-Ie,Ee=P+ve-tt,Mt=po(p?Ps(R,Q):R,P,p?Nr(ee,Ee):ee);w[b]=Mt,L[b]=Mt-P}if(a){var at,lt=b==="x"?Tt:Nt,ht=b==="x"?Ut:Yt,E=w[C],_=C==="y"?"height":"width",U=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?U:E-T[_]-$[_]-_e+O.altAxis,j=Me?E+T[_]+$[_]-_e-O.altAxis:se,Z=p&&Me?WA(Oe,E,j):po(p?Oe:U,E,p?j:se);w[C]=Z,L[C]=Z-E}e.modifiersData[r]=L}}const w3={name:"preventOverflow",enabled:!0,phase:"main",fn:v3,requiresIfExists:["offset"]};function x3(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function E3(t){return t===Vt(t)||!qt(t)?dc(t):x3(t)}function C3(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 S3(t,e,n){n===void 0&&(n=!1);var r=qt(e),i=qt(e)&&C3(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=E3(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 _3(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 O3(t){var e=_3(t);return RA.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function T3(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function N3(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 M3(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 v=O3(N3([].concat(r,u.options.modifiers)));return u.orderedModifiers=v.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,v=k.popper;if(tg(x,v)){u.rects={reference:S3(x,ho(v),u.options.strategy==="fixed"),popper:lc(v)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.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],w=C.fn,T=C.options,$=T===void 0?{}:T,D=C.name;typeof w=="function"&&(u=w({state:u,options:$,name:D,instance:p})||u)}}}},update:T3(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,v=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var C=b({state:u,name:k,instance:p,options:v}),w=function(){};f.push(C||w)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var A3=[e3,b3,XA,Fm,g3,u3,w3,KA,h3],D3=M3({defaultModifiers:A3}),$3="tippy-box",ng="tippy-content",L3="tippy-backdrop",rg="tippy-arrow",ig="tippy-svg-arrow",Mr={passive:!0,capture:!0},og=function(){return document.body};function B3(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 I3(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function V3(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 P3(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function R3(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 F3(t){return mc(t,"NodeList")}function j3(t){return mc(t,"MouseEvent")}function z3(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function H3(t){return bo(t)?[t]:F3(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 W3(t){var e,n=yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function U3(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=R3(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 Y3(){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 q3(){var t=document.activeElement;if(z3(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function K3(){document.addEventListener("touchstart",Y3,Mr),window.addEventListener("blur",q3)}var G3=typeof window<"u"&&typeof document<"u",J3=G3?!!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 Z3(t){return pg(`
|
|
115
|
+
`,textSerializers:r={}}=e||{};return iA(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 oM({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",NA="clippingParents",Vm="viewport",fo="popper",MA="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])},[]),AA="beforeRead",DA="read",$A="afterRead",LA="beforeMain",BA="main",IA="afterMain",VA="beforeWrite",PA="write",RA="afterWrite",FA=[AA,DA,$A,LA,BA,IA,VA,PA,RA];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 jA(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 zA(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:jA,effect:zA,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 HA(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 WA(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&&HA(n)&&Mn(n).position==="static";)n=Hm(n);return n&&(un(n)==="html"||un(n)==="body"&&Mn(n).position==="static")?e:n||WA(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 UA(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 YA=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 qA(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=YA(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,v=g/2-y/2,b=f[p],C=x-h[u]-f[m],w=x/2-h[u]/2+v,T=po(b,w,C),$=c;n.modifiersData[r]=(e={},e[$]=T,e.centerOffset=T-w,e)}}function KA(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 GA={name:"arrow",enabled:!0,phase:"main",fn:qA,effect:KA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var JA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ZA(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"),v=Nt,b=Tt,C=window;if(d){var w=ho(n),T="clientHeight",$="clientWidth";if(w===Vt(n)&&(w=rr(n),Mn(w).position!=="static"&&a==="absolute"&&(T="scrollHeight",$="scrollWidth")),w=w,i===Tt||(i===Nt||i===Yt)&&o===uo){b=Ut;var D=f&&w===C&&C.visualViewport?C.visualViewport.height:w[T];g-=D-r.height,g*=c?1:-1}if(i===Nt||(i===Tt||i===Ut)&&o===uo){v=Yt;var O=f&&w===C&&C.visualViewport?C.visualViewport.width:w[$];p-=O-r.width,p*=c?1:-1}}var V=Object.assign({position:a},d&&JA),L=u===!0?ZA({x:p,y:g},Vt(n)):{x:p,y:g};if(p=L.x,g=L.y,c){var z;return Object.assign({},V,(z={},z[b]=x?"0":"",z[v]=k?"0":"",z.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",z))}return Object.assign({},V,(e={},e[b]=x?g+"px":"",e[v]=k?p+"px":"",e.transform="",e))}function XA(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 QA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XA,data:{}};var Fs={passive:!0};function e3(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 t3={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:e3,data:{}};var n3={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return n3[e]})}var r3={start:"end",end:"start"};function Km(t){return t.replace(/start|end/g,function(e){return r3[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 i3(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 o3(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 s3(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(i3(t,n)):Tr(e)?s3(e,n):hc(o3(rr(t)))}function a3(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 l3(t,e,n,r){var i=e==="clippingParents"?a3(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?NA: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?MA:fo,v=t.rects.popper,b=t.elements[m?x:h],C=l3(Tr(b)?b:b.contextElement||rr(t.elements.popper),c,u,s),w=mi(t.elements.reference),T=Zm({reference:w,element:v,placement:i}),$=hc(Object.assign({},v,T)),D=h===fo?$:w,O={top:C.top-D.top+k.top,bottom:D.bottom-C.bottom+k.bottom,left:C.left-D.left+k.left,right:D.right-C.right+k.right},V=t.modifiersData.offset;if(h===fo&&V){var L=V[i];Object.keys(O).forEach(function(z){var F=[Yt,Ut].indexOf(z)>=0?1:-1,I=[Tt,Ut].indexOf(z)>=0?"y":"x";O[z]+=L[I]*F})}return O}function c3(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 d3(t){if(fn(t)===oc)return[];var e=js(t);return[Km(t),e,Km(e)]}function u3(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,v=c||(x||!m?[js(y)]:d3(y)),b=[y].concat(v).reduce(function(W,K){return W.concat(fn(K)===oc?c3(e,{placement:K,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),C=e.rects.reference,w=e.rects.popper,T=new Map,$=!0,D=b[0],O=0;O<b.length;O++){var V=b[O],L=fn(V),z=gi(V)===hi,F=[Tt,Ut].indexOf(L)>=0,I=F?"width":"height",S=go(e,{placement:V,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),P=F?z?Yt:Nt:z?Ut:Tt;C[I]>w[I]&&(P=js(P));var R=js(P),ee=[];if(o&&ee.push(S[L]<=0),a&&ee.push(S[P]<=0,S[R]<=0),ee.every(function(W){return W})){D=V,$=!1;break}T.set(V,ee)}if($)for(var ie=m?3:1,he=function(K){var q=b.find(function(H){var ce=T.get(H);if(ce)return ce.slice(0,K).every(function(le){return le})});if(q)return D=q,"break"},ue=ie;ue>0;ue--){var B=he(ue);if(B==="break")break}e.placement!==D&&(e.modifiersData[r]._skip=!0,e.placement=D,e.reset=!0)}}const f3={name:"flip",enabled:!0,phase:"main",fn:u3,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 h3(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 p3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:h3};function m3(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 g3(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]=m3(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 y3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:g3};function b3(t){var e=t.state,n=t.name;e.modifiersData[n]=Zm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const k3={name:"popperOffsets",enabled:!0,phase:"read",fn:b3,data:{}};function v3(t){return t==="x"?"y":"x"}function w3(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),v=!x,b=cc(k),C=v3(b),w=e.modifiersData.popperOffsets,T=e.rects.reference,$=e.rects.popper,D=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(w){if(o){var z,F=b==="y"?Tt:Nt,I=b==="y"?Ut:Yt,S=b==="y"?"height":"width",P=w[b],R=P+y[F],ee=P-y[I],ie=p?-$[S]/2:0,he=x===hi?T[S]:$[S],ue=x===hi?-$[S]:-T[S],B=e.elements.arrow,W=p&&B?lc(B):{width:0,height:0},K=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wm(),q=K[F],H=K[I],ce=po(0,T[S],W[S]),le=v?T[S]/2-ie-ce-q-O.mainAxis:he-ce-q-O.mainAxis,ve=v?-T[S]/2+ie+ce+H+O.mainAxis:ue+ce+H+O.mainAxis,Ne=e.elements.arrow&&ho(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(z=V==null?void 0:V[b])!=null?z:0,Q=P+le-tt-Ie,Ee=P+ve-tt,Mt=po(p?Ps(R,Q):R,P,p?Nr(ee,Ee):ee);w[b]=Mt,L[b]=Mt-P}if(a){var at,lt=b==="x"?Tt:Nt,ht=b==="x"?Ut:Yt,E=w[C],_=C==="y"?"height":"width",U=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?U:E-T[_]-$[_]-_e+O.altAxis,j=Me?E+T[_]+$[_]-_e-O.altAxis:se,Z=p&&Me?UA(Oe,E,j):po(p?Oe:U,E,p?j:se);w[C]=Z,L[C]=Z-E}e.modifiersData[r]=L}}const x3={name:"preventOverflow",enabled:!0,phase:"main",fn:w3,requiresIfExists:["offset"]};function E3(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function C3(t){return t===Vt(t)||!qt(t)?dc(t):E3(t)}function S3(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 _3(t,e,n){n===void 0&&(n=!1);var r=qt(e),i=qt(e)&&S3(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=C3(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 O3(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 T3(t){var e=O3(t);return FA.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function N3(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function M3(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 A3(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 v=T3(M3([].concat(r,u.options.modifiers)));return u.orderedModifiers=v.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,v=k.popper;if(tg(x,v)){u.rects={reference:_3(x,ho(v),u.options.strategy==="fixed"),popper:lc(v)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.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],w=C.fn,T=C.options,$=T===void 0?{}:T,D=C.name;typeof w=="function"&&(u=w({state:u,options:$,name:D,instance:p})||u)}}}},update:N3(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,v=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var C=b({state:u,name:k,instance:p,options:v}),w=function(){};f.push(C||w)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var D3=[t3,k3,QA,Fm,y3,f3,x3,GA,p3],$3=A3({defaultModifiers:D3}),L3="tippy-box",ng="tippy-content",B3="tippy-backdrop",rg="tippy-arrow",ig="tippy-svg-arrow",Mr={passive:!0,capture:!0},og=function(){return document.body};function I3(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 V3(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function P3(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 R3(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function F3(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 j3(t){return mc(t,"NodeList")}function z3(t){return mc(t,"MouseEvent")}function H3(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function W3(t){return bo(t)?[t]:j3(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 U3(t){var e,n=yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Y3(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=F3(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 q3(){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 K3(){var t=document.activeElement;if(H3(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function G3(){document.addEventListener("touchstart",q3,Mr),window.addEventListener("blur",K3)}var J3=typeof window<"u"&&typeof document<"u",Z3=J3?!!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 X3(t){return pg(`
|
|
116
116
|
%ctippy.js
|
|
117
117
|
|
|
118
118
|
%c`+pg(t)+`
|
|
119
119
|
|
|
120
120
|
%c👷 This is a development-only message. It will be removed in production.
|
|
121
|
-
`)}function mg(t){return[
|
|
121
|
+
`)}function mg(t){return[X3(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ko;process.env.NODE_ENV!=="production"&&Q3();function Q3(){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 eD(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},tD={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,tD),nD=Object.keys(Pt),rD=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 iD(t,e){var n=e?Object.keys(yg(Object.assign({},Pt,{plugins:e}))):nD,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?{}:iD(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=V3(Pt,Object.keys(gg)),o=!I3(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.",`
|
|
122
122
|
|
|
123
123
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
124
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
124
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var oD=function(){return"innerHTML"};function kc(t,e){t[oD()]=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(B3)})}}function xg(t){var e=yo(),n=yo();n.className=L3,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 sD=1,Hs=[],wc=[];function aD(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=sD++,k=null,x=R3(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:yo(),popperInstance:k,props:n,state:v,plugins:x,clearDelayTimeouts:Oe,setProps:j,setContent:Z,show:N,hide:A,hideWithInteractivity:Y,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),w=C.popper,T=C.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var $=x.map(function(M){return M.fn(b)}),D=t.hasAttribute("aria-expanded");return Ne(),ie(),P(),R("onCreate",[b]),n.showOnCreate&&U(),w.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",m)}),b;function O(){var M=b.props.touch;return Array.isArray(M)?M:[M,0]}function V(){return O()[0]==="hold"}function L(){var M;return!!((M=b.props.render)!=null&&M.$$tippy)}function z(){return g||t}function F(){var M=z().parentNode;return M?U3(M):document}function I(){return vc(w)}function S(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 P(M){M===void 0&&(M=!1),w.style.pointerEvents=b.props.interactive&&!M?"":"none",w.style.zIndex=""+b.props.zIndex}function R(M,X,re){if(re===void 0&&(re=!0),$.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=w.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(!(D||!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===z()?"true":"false"):X.removeAttribute("aria-expanded")})}}function he(){F().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(w,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 R("onClickOutside",[b,M]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||q())}}}function B(){c=!0}function W(){c=!1}function K(){var M=F();M.addEventListener("mousedown",ue,!0),M.addEventListener("touchend",ue,Mr),M.addEventListener("touchstart",W,Mr),M.addEventListener("touchmove",B,Mr)}function q(){var M=F();M.removeEventListener("mousedown",ue,!0),M.removeEventListener("touchend",ue,Mr),M.removeEventListener("touchstart",W,Mr),M.removeEventListener("touchmove",B,Mr)}function H(M,X){le(M,function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&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})),P3(b.props.trigger).forEach(function(M){if(M!=="manual")switch(ve(M,tt),M){case"mouseenter":ve("mouseleave",Ee);break;case"focus":ve(Z3?"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&&z3(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:U(M),M.type==="click"&&(s=!re),re&&!me&&se(M)}}function Q(M){var X=M.target,re=z().contains(X)||w.contains(X);if(!(M.type==="mousemove"&&re)){var me=_().concat(w).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);Y3(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!==z()||b.props.interactive&&M.relatedTarget&&w.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=L()?vc(w).arrow:null,ze=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||z()}:t,vt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(or){var mn=or.state;if(L()){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];L()&&Ae&&Rt.push({name:"arrow",options:{element:Ae,padding:3}}),Rt.push.apply(Rt,(X==null?void 0:X.modifiers)||[]),b.popperInstance=$3(ze,w,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=z();b.props.interactive&&M===og||M==="parent"?X=re.parentNode:X=sg(M,[re]),X.contains(w)||X.appendChild(w),b.state.isMounted=!0,lt(),process.env.NODE_ENV!=="production"&&An(b.props.interactive&&M===Pt.appendTo&&re.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
125
125
|
|
|
126
126
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
127
127
|
|
|
128
128
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
129
129
|
|
|
130
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function _(){return zs(w.querySelectorAll("[data-tippy-root]"))}function U(M){b.clearDelayTimeouts(),M&&R("onTrigger",[b,M]),K();var X=S(!0),re=O(),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(),R("onUntrigger",[b,M]),!b.state.isVisible){q();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var X=S(!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 j(M){if(process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("setProps")),!b.state.isDestroyed){R("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(),P(),T&&T(X,re),b.popperInstance&&(lt(),_().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),R("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)&&!z().hasAttribute("disabled")&&(R("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,L()&&(w.style.visibility="visible"),P(),K(),b.state.isMounted||(w.style.transition="none"),L()){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,w.offsetHeight,w.style.transition=b.props.moveTransition,L()&&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(),R("onMount",[b]),b.props.animation&&L()&&ce(ye,function(){b.state.isShown=!0,R("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)&&(R("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,L()&&(w.style.visibility="hidden"),he(),q(),P(!0),L()){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?L()&&H(me,b.unmount):b.unmount()}}function Y(M){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hideWithInteractivity")),F().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()}),w.parentNode&&w.parentNode.removeChild(w),wc=wc.filter(function(M){return M!==b}),b.state.isMounted=!1,R("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,R("onDestroy",[b]))}}function ki(t,e){e===void 0&&(e={});var n=Pt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(
|
|
130
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function _(){return zs(w.querySelectorAll("[data-tippy-root]"))}function U(M){b.clearDelayTimeouts(),M&&R("onTrigger",[b,M]),K();var X=S(!0),re=O(),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(),R("onUntrigger",[b,M]),!b.state.isVisible){q();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var X=S(!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 j(M){if(process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("setProps")),!b.state.isDestroyed){R("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(),P(),T&&T(X,re),b.popperInstance&&(lt(),_().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),R("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)&&!z().hasAttribute("disabled")&&(R("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,L()&&(w.style.visibility="visible"),P(),K(),b.state.isMounted||(w.style.transition="none"),L()){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,w.offsetHeight,w.style.transition=b.props.moveTransition,L()&&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(),R("onMount",[b]),b.props.animation&&L()&&ce(ye,function(){b.state.isShown=!0,R("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)&&(R("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,L()&&(w.style.visibility="hidden"),he(),q(),P(!0),L()){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?L()&&H(me,b.unmount):b.unmount()}}function Y(M){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hideWithInteractivity")),F().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()}),w.parentNode&&w.parentNode.removeChild(w),wc=wc.filter(function(M){return M!==b}),b.state.isMounted=!1,R("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,R("onDestroy",[b]))}}function ki(t,e){e===void 0&&(e={});var n=Pt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(eD(t),kg(e,n)),G3();var r=Object.assign({},e,{plugins:n}),i=W3(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.",`
|
|
131
131
|
|
|
132
132
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
133
133
|
|
|
134
134
|
`,`1) content: element.innerHTML
|
|
135
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&sD(d,r);return u&&c.push(u),c},[]);return bo(t)?a[0]:a}ki.defaultProps=Pt,ki.setDefaultProps=nD,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 aD{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,v=Math.min(...x.map(w=>w.$from.pos)),b=Math.max(...x.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:v,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(aA(m.selection)){let w=a.nodeDOM(v);const T=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(T&&(w=T.firstChild),w)return w.getBoundingClientRect()}return Lm(a,v,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 aD({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 lD{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 lD({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 cD extends OA{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 dD=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 uD=(t={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new cD(t)}),l.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},fD=/^\s*>\s$/,hD=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:fD,type:this.type})]}}),pD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,mD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,gD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,yD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,bD=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:pD,type:this.type}),ui({find:gD,type:this.type})]},addPasteRules(){return[fi({find:mD,type:this.type}),fi({find:yD,type:this.type})]}}),kD=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$/,vD=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(kD.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]}}),wD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,xD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,ED=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:wD,type:this.type})]},addPasteRules(){return[fi({find:xD,type:this.type})]}}),CD=/^```([a-z]+)?[\s\n]$/,SD=/^~~~([a-z]+)?[\s\n]$/,_D=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(`
|
|
135
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&aD(d,r);return u&&c.push(u),c},[]);return bo(t)?a[0]:a}ki.defaultProps=Pt,ki.setDefaultProps=rD,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 lD{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,v=Math.min(...x.map(w=>w.$from.pos)),b=Math.max(...x.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:v,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(lA(m.selection)){let w=a.nodeDOM(v);const T=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(T&&(w=T.firstChild),w)return w.getBoundingClientRect()}return Lm(a,v,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 lD({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 cD{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 cD({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 dD extends TA{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 uD=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 fD=(t={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new dD(t)}),l.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},hD=/^\s*>\s$/,pD=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:hD,type:this.type})]}}),mD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,kD=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:mD,type:this.type}),ui({find:yD,type:this.type})]},addPasteRules(){return[fi({find:gD,type:this.type}),fi({find:bD,type:this.type})]}}),vD=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$/,wD=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(vD.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]}}),xD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,ED=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,CD=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:xD,type:this.type})]},addPasteRules(){return[fi({find:ED,type:this.type})]}}),SD=/^```([a-z]+)?[\s\n]$/,_D=/^~~~([a-z]+)?[\s\n]$/,OD=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(`
|
|
136
136
|
|
|
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:
|
|
138
|
-
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),
|
|
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()}}}),FD=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 jD(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 jD=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 zD=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>WD&&(a=HD(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()>zD&&(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 HD(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 WD=20;function UD(t,e,n,r){let i=n.getMeta(Ar),o;if(i)return i.historyState;n.getMeta(KD)&&(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||!YD(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 YD(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 qD(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"),KD=new Bt("closeHistory");function GD(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 UD(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=qD(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Dg=Ag(!1,!0),$g=Ag(!0,!0),JD=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[GD(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()}}}),ZD=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})]}}),XD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,QD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,e$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,t$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,n$=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:XD,type:this.type}),ui({find:e$,type:this.type})]},addPasteRules(){return[fi({find:QD,type:this.type}),fi({find:t$,type:this.type})]}}),r$=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)}}}),i$=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$/,o$=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(i$.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]}}),s$=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()}}}),a$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,l$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,c$=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:a$,type:this.type})]},addPasteRules(){return[fi({find:l$,type:this.type})]}}),d$=Ot.create({name:"text",group:"inline"}),u$=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(hD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(bD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(vD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(ED.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(_D.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(OD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(MD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(PD.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(RD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(FD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(JD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(ZD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(n$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(r$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(o$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(s$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(c$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(d$.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),f$=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)}}})]}}),h$=/(?:^|\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:h$,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const p$=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")}}}),m$=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()}}}),g$=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}`)})},y$=Wt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&g$(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}}}}),b$=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()}}}),k$={},v$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},w$=[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 x$(t,e){return l.openBlock(),l.createElementBlock("svg",v$,w$)}const E$=be(k$,[["render",x$]]),C$={},S$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},_$=[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 O$(t,e){return l.openBlock(),l.createElementBlock("svg",S$,_$)}const T$=be(C$,[["render",O$]]),N$={},M$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},A$=[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 D$(t,e){return l.openBlock(),l.createElementBlock("svg",M$,A$)}const $$=be(N$,[["render",D$]]),L$={},B$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},I$=[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 V$(t,e){return l.openBlock(),l.createElementBlock("svg",B$,I$)}const P$=be(L$,[["render",V$]]),R$={},F$={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},j$=[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 z$(t,e){return l.openBlock(),l.createElementBlock("svg",F$,j$)}const H$=be(R$,[["render",z$]]),W$={},U$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},Y$=[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 q$(t,e){return l.openBlock(),l.createElementBlock("svg",U$,Y$)}const K$=be(W$,[["render",q$]]),G$={},J$={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"},Z$=[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
|
|
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:SD,type:this.type,getAttributes:t=>({language:t[1]})}),ic({find:_D,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}}})]}}),TD=Ot.create({name:"doc",topNode:!0,content:"block+"});function ND(t={}){return new it({view(e){return new MD(e,t)}})}class MD{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 AD=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ND(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||!DD(e)||!$D(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 DD(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 $D(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 LD(){return new it({props:{decorations:PD,createSelectionBetween(t,e,n){return e.pos==n.pos&&je.valid(n)?new je(n):null},handleClick:ID,handleKeyDown:BD,handleDOMEvents:{beforeinput:VD}}})}const BD=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 ID(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 VD(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=J.empty;for(let s=r.length-1;s>=0;s--)i=J.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new ne(i,0,0));return o.setSelection(ke.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function PD(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 RD=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[LD()]},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}}}),FD=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()}}}),jD=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 zD(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 zD=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 HD=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>UD&&(a=WD(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()>HD&&(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 WD(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 UD=20;function YD(t,e,n,r){let i=n.getMeta(Ar),o;if(i)return i.historyState;n.getMeta(GD)&&(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||!qD(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 qD(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 KD(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"),GD=new Bt("closeHistory");function JD(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 YD(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=KD(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Dg=Ag(!1,!0),$g=Ag(!0,!0),ZD=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[JD(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()}}}),XD=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})]}}),QD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,e$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,t$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,n$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,r$=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:QD,type:this.type}),ui({find:t$,type:this.type})]},addPasteRules(){return[fi({find:e$,type:this.type}),fi({find:n$,type:this.type})]}}),i$=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)}}}),o$=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$/,s$=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(o$.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]}}),a$=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()}}}),l$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,c$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,d$=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:l$,type:this.type})]},addPasteRules(){return[fi({find:c$,type:this.type})]}}),u$=Ot.create({name:"text",group:"inline"}),f$=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(pD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(kD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(wD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(CD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(OD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(TD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(AD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(RD.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(FD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(jD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(ZD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(XD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(r$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(i$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(s$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(a$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(d$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(u$.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),h$=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)}}})]}}),p$=/(?:^|\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:p$,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const m$=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")}}}),g$=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()}}}),y$=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}`)})},b$=Wt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&y$(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}}}}),k$=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()}}}),v$={},w$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},x$=[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 E$(t,e){return l.openBlock(),l.createElementBlock("svg",w$,x$)}const C$=be(v$,[["render",E$]]),S$={},_$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},O$=[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 T$(t,e){return l.openBlock(),l.createElementBlock("svg",_$,O$)}const N$=be(S$,[["render",T$]]),M$={},A$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},D$=[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 $$(t,e){return l.openBlock(),l.createElementBlock("svg",A$,D$)}const L$=be(M$,[["render",$$]]),B$={},I$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},V$=[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 P$(t,e){return l.openBlock(),l.createElementBlock("svg",I$,V$)}const R$=be(B$,[["render",P$]]),F$={},j$={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},z$=[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 H$(t,e){return l.openBlock(),l.createElementBlock("svg",j$,z$)}const W$=be(F$,[["render",H$]]),U$={},Y$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},q$=[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 K$(t,e){return l.openBlock(),l.createElementBlock("svg",Y$,q$)}const G$=be(U$,[["render",K$]]),J$={},Z$={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"},X$=[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
|
|
140
140
|
c-6.364,5.265-9.594,12.724-9.594,22.167c0,10.367,3.124,18.054,9.547,23.499c6.399,5.423,15.696,8.175,27.63,8.175h10.38v33.051\r
|
|
141
141
|
c0,1.258,1.02,2.277,2.278,2.277h7.096c1.257,0,2.276-1.02,2.276-2.277V14.566h9.146v79.795c0,1.258,1.021,2.276,2.277,2.276\r
|
|
142
|
-
h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function X$(t,e){return l.openBlock(),l.createElementBlock("svg",J$,Z$)}const Q$=be(G$,[["render",X$]]),eL={},tL={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"},nL=[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 rL(t,e){return l.openBlock(),l.createElementBlock("svg",tL,nL)}const iL=be(eL,[["render",rL]]),oL={},sL={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"},aL=[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 lL(t,e){return l.openBlock(),l.createElementBlock("svg",sL,aL)}const cL=be(oL,[["render",lL]]),dL={},uL={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"},fL=[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 hL(t,e){return l.openBlock(),l.createElementBlock("svg",uL,fL)}const pL=be(dL,[["render",hL]]),mL={},gL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},yL=[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 bL(t,e){return l.openBlock(),l.createElementBlock("svg",gL,yL)}const kL=be(mL,[["render",bL]]),vL={},wL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},xL=[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 EL(t,e){return l.openBlock(),l.createElementBlock("svg",wL,xL)}const CL=be(vL,[["render",EL]]),SL={},_L={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},OL=[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 TL(t,e){return l.openBlock(),l.createElementBlock("svg",_L,OL)}const NL=be(SL,[["render",TL]]),ML={},AL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},DL=[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 $L(t,e){return l.openBlock(),l.createElementBlock("svg",AL,DL)}const LL=be(ML,[["render",$L]]),BL={},IL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},VL=[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 PL(t,e){return l.openBlock(),l.createElementBlock("svg",IL,VL)}const RL=be(BL,[["render",PL]]),FL={},jL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},zL=[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 HL(t,e){return l.openBlock(),l.createElementBlock("svg",jL,zL)}const WL=be(FL,[["render",HL]]),UL={},YL={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},qL=[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 KL(t,e){return l.openBlock(),l.createElementBlock("svg",YL,qL)}const GL=be(UL,[["render",KL]]),JL={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},ZL={class:"flex gap-px"},XL=["onClick"],QL={key:1,class:"text-sm"},eB=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:K$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:H$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:RL,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:WL,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:Q$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:iL,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:cL,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:pL,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:kL,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:CL,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:NL,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:LL,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:E$,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:T$,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:$$,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:P$,disableCheck:!0,active:!0}],c=e,d=uD({content:n.modelValue,extensions:[u$,m$,b$,y$,p$.configure({types:["heading","paragraph"]}),f$.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",JL,[l.createElementVNode("div",ZL,[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(GL,{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",QL,l.toDisplayString(l.unref(h1).capitalize(k.label)),1))],10,XL))),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(dD),{editor:l.unref(d)},null,8,["editor"])],4)],2)):l.createCommentVNode("",!0)}}}),tB={},nB={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function iB(t,e){return l.openBlock(),l.createElementBlock("svg",nB,rB)}const oB=be(tB,[["render",iB]]),sB={},aB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},lB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function cB(t,e){return l.openBlock(),l.createElementBlock("svg",aB,lB)}const dB=be(sB,[["render",cB]]),uB={},fB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},hB=[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 pB(t,e){return l.openBlock(),l.createElementBlock("svg",fB,hB)}const mB=be(uB,[["render",pB]]),gB={class:"flex-1"},yB=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(oB,{key:0,class:"w-2.5 h-2.5"})):l.createCommentVNode("",!0),t.incomplete?(l.openBlock(),l.createBlock(dB,{key:1,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),t.partially?(l.openBlock(),l.createBlock(mB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),l.createElementVNode("span",gB,[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":`
|
|
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 Q$(t,e){return l.openBlock(),l.createElementBlock("svg",Z$,X$)}const eL=be(J$,[["render",Q$]]),tL={},nL={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"},rL=[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 iL(t,e){return l.openBlock(),l.createElementBlock("svg",nL,rL)}const oL=be(tL,[["render",iL]]),sL={},aL={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"},lL=[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 cL(t,e){return l.openBlock(),l.createElementBlock("svg",aL,lL)}const dL=be(sL,[["render",cL]]),uL={},fL={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"},hL=[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 pL(t,e){return l.openBlock(),l.createElementBlock("svg",fL,hL)}const mL=be(uL,[["render",pL]]),gL={},yL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},bL=[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 kL(t,e){return l.openBlock(),l.createElementBlock("svg",yL,bL)}const vL=be(gL,[["render",kL]]),wL={},xL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},EL=[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 CL(t,e){return l.openBlock(),l.createElementBlock("svg",xL,EL)}const SL=be(wL,[["render",CL]]),_L={},OL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},TL=[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 NL(t,e){return l.openBlock(),l.createElementBlock("svg",OL,TL)}const ML=be(_L,[["render",NL]]),AL={},DL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},$L=[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 LL(t,e){return l.openBlock(),l.createElementBlock("svg",DL,$L)}const BL=be(AL,[["render",LL]]),IL={},VL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},PL=[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 RL(t,e){return l.openBlock(),l.createElementBlock("svg",VL,PL)}const FL=be(IL,[["render",RL]]),jL={},zL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},HL=[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 WL(t,e){return l.openBlock(),l.createElementBlock("svg",zL,HL)}const UL=be(jL,[["render",WL]]),YL={},qL={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},KL=[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 GL(t,e){return l.openBlock(),l.createElementBlock("svg",qL,KL)}const JL=be(YL,[["render",GL]]),ZL={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},XL={class:"flex gap-px"},QL=["onClick"],eB={key:1,class:"text-sm"},tB=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:G$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:W$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:FL,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:UL,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:eL,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:oL,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:dL,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:mL,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:vL,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:SL,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:ML,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:BL,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:C$,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:N$,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:L$,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:R$,disableCheck:!0,active:!0}],c=e,d=fD({content:n.modelValue,extensions:[f$,g$,k$,b$,m$.configure({types:["heading","paragraph"]}),h$.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",ZL,[l.createElementVNode("div",XL,[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(JL,{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",eB,l.toDisplayString(l.unref(h1).capitalize(k.label)),1))],10,QL))),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(uD),{editor:l.unref(d)},null,8,["editor"])],4)],2)):l.createCommentVNode("",!0)}}}),nB={},rB={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},iB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function oB(t,e){return l.openBlock(),l.createElementBlock("svg",rB,iB)}const sB=be(nB,[["render",oB]]),aB={},lB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},cB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function dB(t,e){return l.openBlock(),l.createElementBlock("svg",lB,cB)}const uB=be(aB,[["render",dB]]),fB={},hB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},pB=[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 mB(t,e){return l.openBlock(),l.createElementBlock("svg",hB,pB)}const gB=be(fB,[["render",mB]]),yB={class:"flex-1"},bB=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(sB,{key:0,class:"w-2.5 h-2.5"})):l.createCommentVNode("",!0),t.incomplete?(l.openBlock(),l.createBlock(uB,{key:1,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),t.partially?(l.openBlock(),l.createBlock(gB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),l.createElementVNode("span",yB,[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":`
|
|
143
143
|
hover:text-lime-500
|
|
144
144
|
rounded-full
|
|
145
145
|
|
|
@@ -152,4 +152,4 @@ img.ProseMirror-separator {
|
|
|
152
152
|
group-[.is-off]:text-gray-300
|
|
153
153
|
dark:group-[.is-off]:text-gray-800
|
|
154
154
|
|
|
155
|
-
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(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(F){var I=["th","st","nd","rd"],S=F%100;return"["+F+(I[(S-20)%10]||I[S]||I[0])+"]"}},v=function(F,I,S){var P=String(F);return!P||P.length>=I?F:""+Array(I+1-P.length).join(S)+F},b={s:v,z:function(F){var I=-F.utcOffset(),S=Math.abs(I),P=Math.floor(S/60),R=S%60;return(I<=0?"+":"-")+v(P,2,"0")+":"+v(R,2,"0")},m:function F(I,S){if(I.date()<S.date())return-F(S,I);var P=12*(S.year()-I.year())+(S.month()-I.month()),R=I.clone().add(P,f),ee=S-R<0,ie=I.clone().add(P+(ee?-1:1),f);return+(-(P+(S-R)/(ee?R-ie:ie-R))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:u,d,D:m,h:c,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},C="en",w={};w[C]=x;var T="$isDayjsObject",$=function(F){return F instanceof L||!(!F||!F[T])},D=function F(I,S,P){var R;if(!I)return C;if(typeof I=="string"){var ee=I.toLowerCase();w[ee]&&(R=ee),S&&(w[ee]=S,R=ee);var ie=I.split("-");if(!R&&ie.length>1)return F(ie[0])}else{var he=I.name;w[he]=I,R=he}return!P&&R&&(C=R),R||!P&&C},O=function(F,I){if($(F))return F.clone();var S=typeof I=="object"?I:{};return S.date=F,S.args=arguments,new L(S)},V=b;V.l=D,V.i=$,V.w=function(F,I){return O(F,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var L=function(){function F(S){this.$L=D(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[T]=!0}var I=F.prototype;return I.parse=function(S){this.$d=function(P){var R=P.date,ee=P.utc;if(R===null)return new Date(NaN);if(V.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var ie=R.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(R)}(S),this.init()},I.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},I.$utils=function(){return V},I.isValid=function(){return this.$d.toString()!==g},I.isSame=function(S,P){var R=O(S);return this.startOf(P)<=R&&R<=this.endOf(P)},I.isAfter=function(S,P){return O(S)<this.startOf(P)},I.isBefore=function(S,P){return this.endOf(P)<O(S)},I.$g=function(S,P,R){return V.u(S)?this[P]:this.set(R,S)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(S,P){var R=this,ee=!!V.u(P)||P,ie=V.p(S),he=function(le,ve){var Ne=V.w(R.$u?Date.UTC(R.$y,ve,le):new Date(R.$y,ve,le),R);return ee?Ne:Ne.endOf(d)},ue=function(le,ve){return V.w(R.toDate()[le].apply(R.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ve)),R)},B=this.$W,W=this.$M,K=this.$D,q="set"+(this.$u?"UTC":"");switch(ie){case p:return ee?he(1,0):he(31,11);case f:return ee?he(1,W):he(0,W+1);case u:var H=this.$locale().weekStart||0,ce=(B<H?B+7:B)-H;return he(ee?K-ce:K+(6-ce),W);case d:case m:return ue(q+"Hours",0);case c:return ue(q+"Minutes",1);case a:return ue(q+"Seconds",2);case s:return ue(q+"Milliseconds",3);default:return this.clone()}},I.endOf=function(S){return this.startOf(S,!1)},I.$set=function(S,P){var R,ee=V.p(S),ie="set"+(this.$u?"UTC":""),he=(R={},R[d]=ie+"Date",R[m]=ie+"Date",R[f]=ie+"Month",R[p]=ie+"FullYear",R[c]=ie+"Hours",R[a]=ie+"Minutes",R[s]=ie+"Seconds",R[o]=ie+"Milliseconds",R)[ee],ue=ee===d?this.$D+(P-this.$W):P;if(ee===f||ee===p){var B=this.clone().set(m,1);B.$d[he](ue),B.init(),this.$d=B.set(m,Math.min(this.$D,B.daysInMonth())).$d}else he&&this.$d[he](ue);return this.init(),this},I.set=function(S,P){return this.clone().$set(S,P)},I.get=function(S){return this[V.p(S)]()},I.add=function(S,P){var R,ee=this;S=Number(S);var ie=V.p(P),he=function(W){var K=O(ee);return V.w(K.date(K.date()+Math.round(W*S)),ee)};if(ie===f)return this.set(f,this.$M+S);if(ie===p)return this.set(p,this.$y+S);if(ie===d)return he(1);if(ie===u)return he(7);var ue=(R={},R[a]=r,R[c]=i,R[s]=n,R)[ie]||1,B=this.$d.getTime()+S*ue;return V.w(B,this)},I.subtract=function(S,P){return this.add(-1*S,P)},I.format=function(S){var P=this,R=this.$locale();if(!this.isValid())return R.invalidDate||g;var ee=S||"YYYY-MM-DDTHH:mm:ssZ",ie=V.z(this),he=this.$H,ue=this.$m,B=this.$M,W=R.weekdays,K=R.months,q=R.meridiem,H=function(ve,Ne,Ie,tt){return ve&&(ve[Ne]||ve(P,ee))||Ie[Ne].slice(0,tt)},ce=function(ve){return V.s(he%12||12,ve,"0")},le=q||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(P.$y).slice(-2);case"YYYY":return V.s(P.$y,4,"0");case"M":return B+1;case"MM":return V.s(B+1,2,"0");case"MMM":return H(R.monthsShort,B,K,3);case"MMMM":return H(K,B);case"D":return P.$D;case"DD":return V.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return H(R.weekdaysMin,P.$W,W,2);case"ddd":return H(R.weekdaysShort,P.$W,W,3);case"dddd":return W[P.$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(P.$s);case"ss":return V.s(P.$s,2,"0");case"SSS":return V.s(P.$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(S,P,R){var ee,ie=this,he=V.p(P),ue=O(S),B=(ue.utcOffset()-this.utcOffset())*r,W=this-ue,K=function(){return V.m(ie,ue)};switch(he){case p:ee=K()/12;break;case f:ee=K();break;case h:ee=K()/3;break;case u:ee=(W-B)/6048e5;break;case d:ee=(W-B)/864e5;break;case c:ee=W/i;break;case a:ee=W/r;break;case s:ee=W/n;break;default:ee=W}return R?ee:V.a(ee)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return w[this.$L]},I.locale=function(S,P){if(!S)return this.$L;var R=this.clone(),ee=D(S,P,!0);return ee&&(R.$L=ee),R},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()},F}(),z=L.prototype;return O.prototype=z,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){z[F[1]]=function(I){return this.$g(I,F[0],F[1])}}),O.extend=function(F,I){return F.$i||(F(I,L,O),F.$i=!0),O},O.locale=D,O.isDayjs=$,O.unix=function(F){return O(1e3*F)},O.en=w[C],O.Ls=w,O.p={},O})}(_c)),_c.exports}var bB=qs();const G=Ri(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:"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})})(kB);var vB={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})})(vB);var wB={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})})(wB);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 xB=Vg.exports;const EB=Ri(xB);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 CB=Pg.exports;const SB=Ri(CB),_B={class:"w-full dark:text-gray-400"},OB={class:"flex justify-between items-center mb-3"},TB={class:"flex"},NB={class:"font-medium flex items-center gap-2"},MB=["value","onChange"],AB=["value"],DB=["value","onChange"],$B=["value"],LB={class:"flex"},BB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},Oc=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:G().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=jn();G.extend(SB),G.extend(EB);const r=t,i=l.computed(()=>Array.from({length:7},(W,K)=>G().day((1+K)%7).locale(n.value).format("ddd"))),o=l.ref([G(new Date).subtract(1,"month"),G(new Date)]);l.watch(()=>r.initDates,()=>{var B;if(!r.range&&r.initDates)o.value[0]=G(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=G(new Date);else if(r.range&&((B=r.initDates)==null?void 0:B.length)===2){let W=G(r.initDates[0]),K=G(r.initDates[1]);K.isBefore(W,"month")&&(K=W.add(1,"month")),W.isSame(K,"month")&&(K=W.add(1,"month")),o.value=[W,K]}},{immediate:!0,once:!0}),l.watch(()=>[r.displayYearStart,r.displayMonthStart],([B,W])=>{B&&W&&(o.value[0]=G().year(Number(B)).month(Number(W)).startOf("month"),o.value[1]=G().year(Number(B)).month(Number(W)).startOf("month").add(1,"month"))},{immediate:!0}),l.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([B,W])=>{if(B&&W){const K=o.value[0],q=G().year(Number(B)).month(Number(W)).startOf("month");q.isAfter(K,"month")&&(o.value[1]=q)}},{immediate:!0});const s=e,a=l.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(B){if(r.week)s("update:modelValue",[G(B).startOf("week"),G(B).endOf("week")]);else if(r.range){const W=r.modelValue.filter(K=>K).length;if(W==0)s("update:modelValue",[B]);else if(W==2)s("update:modelValue",[B]);else if(W==1){let K=[G(r.modelValue[0]),G(B)];K=K.sort((q,H)=>q-H),s("update:modelValue",K)}}else s("update:modelValue",G(B))}function d(B){const W=G(B).daysInMonth(),K=[],q=G(B).startOf("month");for(let H=1;H<=W;H++){let ce=q.clone().date(H);K.push(ce)}return K}function u(B){return G(B).startOf("month").day()}function f(B,W){const K=G(`${B}-${W}-01`,"YYYY-MM-DD"),H=K.day(),ce=[];for(let le=0;le<H;le++)ce.push(K.clone().subtract(H-le,"days"));return ce}function h(B,W){const K=G(`${B}-${W}`,"YYYY-MM").endOf("month"),H=6-K.day(),ce=[];for(let le=1;le<=H;le++)ce.push(K.clone().add(le,"days"));return ce}function p(B){const W=G();return G(B).isSame(W,"day")}function m(B){var W,K;if(r.range){if(((W=r.modelValue)==null?void 0:W.length)==1)return G(B).isSame(G(r.modelValue[0]),"day");if(((K=r.modelValue)==null?void 0:K.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")||G(B).isSame(G(r.modelValue[1]),"day")}else if(r.modelValue)return G(B).isSame(G(r.modelValue),"day")}function g(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isBetween(G(r.modelValue[0]),G(r.modelValue[1]))}function y(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")}function k(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isSame(G(r.modelValue[1]),"day")}function x(B){try{return r.minDate?G(B).isBefore(G(r.minDate)):!1}catch(W){return console.log(W),!1}}function v(B){try{return r.maxDate?G(B).isAfter(G(r.maxDate)):!1}catch(W){return console.log(W),!1}}function b(B){L(B,o.value[B].subtract(1,"month"))}function C(B){L(B,o.value[B].add(1,"month"))}function w(B){L(B,o.value[B].subtract(1,"year"))}function T(B){L(B,o.value[B].add(1,"year"))}const $=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"month").isAfter(o.value[0],"month"),D=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"month").isBefore(o.value[1],"month"),O=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"year").isAfter(o.value[0],"year"),V=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"year").isBefore(o.value[1],"year");function L(B,W){if(B===0){if(!a.value.length===1&&!W.isBefore(o.value[1],"month"))return;o.value=[W,o.value[1]]}else{if(!a.value.length===1&&!W.isAfter(o.value[0],"month"))return;(W.isBefore(o.value[0],"month")||W.isSame(o.value[0],"month"))&&(W=o.value[0].add(1,"month")),o.value=[o.value[0],W]}}const z=l.ref();function F(B){r.week&&(z.value=G(B).week())}function I(B){return G(B).week()===z.value}function S(B){return G(B).week()===z.value?G(B).format("YYYY-MM-DD")===G().week(z.value).startOf("week").format("YYYY-MM-DD"):!1}function P(B){return G(B).week()===z.value?G(B).format("YYYY-MM-DD")===G().week(z.value).endOf("week").format("YYYY-MM-DD"):!1}function R(){z.value=null}function ee(B,W){const K=o.value[B].year(Number(W));L(B,K)}function ie(B,W){const K=o.value[B].month(Number(W));L(B,K)}const he=l.computed(()=>{const B=r.defaultMinYear,W=r.defaultMaxYear,K=[];for(let q=B;q<=W;q++)K.push(q);return K}),ue=l.computed(()=>Array.from({length:12},(B,W)=>G().month(W).locale(n.value).format("MMMM")));return(B,W)=>(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,K=>{var q;return l.openBlock(),l.createElementBlock("div",_B,[l.createElementVNode("div",OB,[l.createElementVNode("div",TB,[l.createVNode(Hf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!O(K),"hover:opacity-100":O(K)}]),onClick:H=>O(K)?w(K):null},null,8,["class","onClick"]),l.createVNode(Wf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(K),"hover:opacity-100":$(K)}]),onClick:H=>$(K)?b(K):null},null,8,["class","onClick"])]),l.createElementVNode("div",NB,[l.createElementVNode("select",{value:o.value[K].format("YYYY"),onChange:H=>ee(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(he.value,H=>(l.openBlock(),l.createElementBlock("option",{key:H,value:H},l.toDisplayString(H),9,AB))),128))],40,MB),l.createElementVNode("select",{value:o.value[K].month(),onChange:H=>ie(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ue.value,(H,ce)=>(l.openBlock(),l.createElementBlock("option",{key:ce,value:ce},l.toDisplayString(H),9,$B))),128))],40,DB)]),l.createElementVNode("div",LB,[l.createVNode(Yf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!D(K),"hover:opacity-100":D(K)}]),onClick:H=>D(K)?C(K):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(K),"hover:opacity-100":V(K)}]),onClick:H=>V(K)?T(K):null},null,8,["class","onClick"])])]),l.createElementVNode("div",BB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(H,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"flex justify-center text-sm"},l.toDisplayString(H),1))),128))]),l.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:R},[u(o.value[K])>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(f(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),H=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(H)&&!x(H)?c(H):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d(o.value[K].clone()),H=>(l.openBlock(),l.createBlock(Sc,{onMouseover:ce=>F(H),onClick:ce=>!v(H)&&!x(H)?c(H):null,today:p(H),selected:m(H),firstDay:y(H)||S(H),lastDay:k(H)||P(H),between:g(H),disabled:v(H)||x(H),off:v(H)||x(H),highlight:I(H)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((q=h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1))==null?void 0:q.length)>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),H=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(H)&&!x(H)?c(H):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0)],32)])}),256))],2))}}),IB={},VB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},PB=[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 RB(t,e){return l.openBlock(),l.createElementBlock("svg",VB,PB)}const Rg=be(IB,[["render",RB]]),FB={},jB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},zB=[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 HB(t,e){return l.openBlock(),l.createElementBlock("svg",jB,zB)}const Fg=be(FB,[["render",HB]]),WB={class:"flex gap-3"},UB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},YB=["onClick"],qB=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("wpiccomponents.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=>G(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return G(r.modelValue).format("YYYY-MM-DD")}),c=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("month");o("update:modelValue",[f,u])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=G().startOf("month").subtract(1,"month"),f=G(u).endOf("month");o("update:modelValue",[u,f])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px"},{content:l.withCtx(()=>[l.createElementVNode("div",WB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",UB,[(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,YB))),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"]))}}),KB={class:"relative inline-block tabular-nums"},GB=["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",KB,[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,GB)]))}},JB={class:"flex items-center gap-0"},ZB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),XB=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]?G(k[0]).format("YYYY"):"",monthStart.value=k[0]?G(k[0]).format("MM"):"",dayStart.value=k[0]?G(k[0]).format("DD"):"",yearEnd.value=k[1]?G(k[1]).format("YYYY"):"",monthEnd.value=k[1]?G(k[1]).format("MM"):"",dayEnd.value=k[1]?G(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=G(k).format("YYYY"),o.value=G(k).format("MM"),s.value=G(k).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=G().format("YYYY")),u()}function g(){o.value||(o.value=G().format("MM")),u()}function y(){s.value||(s.value=G().format("DD")),u()}return(k,x)=>(l.openBlock(),l.createElementBlock("div",JB,[l.createVNode(Tc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=v=>i.value=v),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:a},null,8,["modelValue","disabled"]),ZB,l.createVNode(Tc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=v=>o.value=v),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),XB,l.createVNode(Tc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=v=>s.value=v),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},QB={class:"tabular-nums"},eI={key:1,class:"flex items-center"},tI=l.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),nI={class:"flex gap-3"},rI={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},iI=["onClick"],oI=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("wpiccomponents.select_date"):r.placeholder);l.ref(!1);const s=l.ref(G().year()),a=l.ref(G().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=G(r.initDates[0]).year(),a.value=G(r.initDates[0]).month(),c.value=G(r.initDates[1]).year(),d.value=G(r.initDates[1]).month()):r.initDates&&(s.value=G(r.initDates).year(),a.value=G(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]?G(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?G(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?G(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),l.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?G(m[0]).toDate():null,x=m[1]&&m[1].length===10?G(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=G(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("month");i("update:modelValue",[y,g])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=G().startOf("month").subtract(1,"month"),y=G(g).endOf("month");i("update:modelValue",[g,y])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:l.withCtx(()=>[l.createElementVNode("div",nI,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",rI,[(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,iI))),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",QB,[t.range?t.range?(l.openBlock(),l.createElementBlock("div",eI,[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"]),tI,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"]))}}),sI=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))}}),aI={class:"absolute inset-0 flex items-center justify-center py-12"},lI={class:"text-lg font-medium dark:text-gray-300"},cI={key:0,class:"flex justify-end px-6 pb-4"},dI=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",aI,[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",lI,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",cI,[l.renderSlot(f.$slots,"buttons")])):l.createCommentVNode("",!0)],2)])],2))}}),uI=["onClick"],fI=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,uI))),128))],2),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"default")])],64))}}),hI=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)}}),pI={},mI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},gI=[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 yI(t,e){return l.openBlock(),l.createElementBlock("svg",mI,gI)}const bI=be(pI,[["render",yI]]),kI={},vI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},wI=[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 xI(t,e){return l.openBlock(),l.createElementBlock("svg",vI,wI)}const EI=be(kI,[["render",xI]]),CI={},SI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},_I=[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 OI(t,e){return l.openBlock(),l.createElementBlock("svg",SI,_I)}const TI=be(CI,[["render",OI]]),NI={},MI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},AI=[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 DI(t,e){return l.openBlock(),l.createElementBlock("svg",MI,AI)}const $I=be(NI,[["render",DI]]),LI={key:0,class:"w-6 opacity-50"},BI={class:"flex-1"},II={key:0,class:"mb-2"},VI=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",LI,[t.warning?(l.openBlock(),l.createBlock(bI,{key:0,class:"w-full aspect-square"})):t.info?(l.openBlock(),l.createBlock(EI,{key:1,class:"w-full aspect-square"})):t.success?(l.openBlock(),l.createBlock(TI,{key:2,class:"w-full aspect-square"})):t.error?(l.openBlock(),l.createBlock($I,{key:3,class:"w-full aspect-square"})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",BI,[t.title?(l.openBlock(),l.createElementBlock("div",II,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 PI={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},RI={class:"text-lg font-semibold mb-6"},FI={class:"mb-12"},jI={class:"flex justify-end"},Dc={WpicColorPicker:Ff,WpicAlert:VI,WpicToggleSwitch:Pf,WpicAdvDateField:oI,WpicCalendar:Oc,WpicTextarea:Rf,WpicDialog:dI,WpicSlidePanel:sI,WpicDateField:qB,WpicFormInput:Pi,WpicButton:_i,WpicBadge:yB,WpicTextEditor:eB,WpicInputGroup:Cy,WpicButtonGroup:vy,WpicForm:Sy,WpicFormField:jf,WpicSpinner:Ir,WpicTooltip:zf,WpicPopover:dr,WpicChoiceList:Vf,WpicCard:M_,WpicCardSection:$_,WpicProgressBar:I_,WpicTag:P_,WpicTagGroup:R_,WpicPagination:uO,WpicLoadingPanel:H_,WpicTable:WO,WpicTableColumn:UO,WpicTabs:fI,WpicTabPane:hI,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",PI,[l.createElementVNode("div",RI,l.toDisplayString(l.unref(n)),1),l.createElementVNode("div",FI,l.toDisplayString(l.unref(r)),1),l.createElementVNode("div",jI,[l.createVNode(_i,{onClick:l.unref(a)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.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("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};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 zI={useConfirm:Ac};function HI(t,e){Kg(fe,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const WI={install:HI,composables:zI,options:fe};Dn.default=WI,Dn.useConfirm=Ac,Object.defineProperties(Dn,{__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(F){var I=["th","st","nd","rd"],S=F%100;return"["+F+(I[(S-20)%10]||I[S]||I[0])+"]"}},v=function(F,I,S){var P=String(F);return!P||P.length>=I?F:""+Array(I+1-P.length).join(S)+F},b={s:v,z:function(F){var I=-F.utcOffset(),S=Math.abs(I),P=Math.floor(S/60),R=S%60;return(I<=0?"+":"-")+v(P,2,"0")+":"+v(R,2,"0")},m:function F(I,S){if(I.date()<S.date())return-F(S,I);var P=12*(S.year()-I.year())+(S.month()-I.month()),R=I.clone().add(P,f),ee=S-R<0,ie=I.clone().add(P+(ee?-1:1),f);return+(-(P+(S-R)/(ee?R-ie:ie-R))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:u,d,D:m,h:c,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},C="en",w={};w[C]=x;var T="$isDayjsObject",$=function(F){return F instanceof L||!(!F||!F[T])},D=function F(I,S,P){var R;if(!I)return C;if(typeof I=="string"){var ee=I.toLowerCase();w[ee]&&(R=ee),S&&(w[ee]=S,R=ee);var ie=I.split("-");if(!R&&ie.length>1)return F(ie[0])}else{var he=I.name;w[he]=I,R=he}return!P&&R&&(C=R),R||!P&&C},O=function(F,I){if($(F))return F.clone();var S=typeof I=="object"?I:{};return S.date=F,S.args=arguments,new L(S)},V=b;V.l=D,V.i=$,V.w=function(F,I){return O(F,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var L=function(){function F(S){this.$L=D(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[T]=!0}var I=F.prototype;return I.parse=function(S){this.$d=function(P){var R=P.date,ee=P.utc;if(R===null)return new Date(NaN);if(V.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var ie=R.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(R)}(S),this.init()},I.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},I.$utils=function(){return V},I.isValid=function(){return this.$d.toString()!==g},I.isSame=function(S,P){var R=O(S);return this.startOf(P)<=R&&R<=this.endOf(P)},I.isAfter=function(S,P){return O(S)<this.startOf(P)},I.isBefore=function(S,P){return this.endOf(P)<O(S)},I.$g=function(S,P,R){return V.u(S)?this[P]:this.set(R,S)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(S,P){var R=this,ee=!!V.u(P)||P,ie=V.p(S),he=function(le,ve){var Ne=V.w(R.$u?Date.UTC(R.$y,ve,le):new Date(R.$y,ve,le),R);return ee?Ne:Ne.endOf(d)},ue=function(le,ve){return V.w(R.toDate()[le].apply(R.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ve)),R)},B=this.$W,W=this.$M,K=this.$D,q="set"+(this.$u?"UTC":"");switch(ie){case p:return ee?he(1,0):he(31,11);case f:return ee?he(1,W):he(0,W+1);case u:var H=this.$locale().weekStart||0,ce=(B<H?B+7:B)-H;return he(ee?K-ce:K+(6-ce),W);case d:case m:return ue(q+"Hours",0);case c:return ue(q+"Minutes",1);case a:return ue(q+"Seconds",2);case s:return ue(q+"Milliseconds",3);default:return this.clone()}},I.endOf=function(S){return this.startOf(S,!1)},I.$set=function(S,P){var R,ee=V.p(S),ie="set"+(this.$u?"UTC":""),he=(R={},R[d]=ie+"Date",R[m]=ie+"Date",R[f]=ie+"Month",R[p]=ie+"FullYear",R[c]=ie+"Hours",R[a]=ie+"Minutes",R[s]=ie+"Seconds",R[o]=ie+"Milliseconds",R)[ee],ue=ee===d?this.$D+(P-this.$W):P;if(ee===f||ee===p){var B=this.clone().set(m,1);B.$d[he](ue),B.init(),this.$d=B.set(m,Math.min(this.$D,B.daysInMonth())).$d}else he&&this.$d[he](ue);return this.init(),this},I.set=function(S,P){return this.clone().$set(S,P)},I.get=function(S){return this[V.p(S)]()},I.add=function(S,P){var R,ee=this;S=Number(S);var ie=V.p(P),he=function(W){var K=O(ee);return V.w(K.date(K.date()+Math.round(W*S)),ee)};if(ie===f)return this.set(f,this.$M+S);if(ie===p)return this.set(p,this.$y+S);if(ie===d)return he(1);if(ie===u)return he(7);var ue=(R={},R[a]=r,R[c]=i,R[s]=n,R)[ie]||1,B=this.$d.getTime()+S*ue;return V.w(B,this)},I.subtract=function(S,P){return this.add(-1*S,P)},I.format=function(S){var P=this,R=this.$locale();if(!this.isValid())return R.invalidDate||g;var ee=S||"YYYY-MM-DDTHH:mm:ssZ",ie=V.z(this),he=this.$H,ue=this.$m,B=this.$M,W=R.weekdays,K=R.months,q=R.meridiem,H=function(ve,Ne,Ie,tt){return ve&&(ve[Ne]||ve(P,ee))||Ie[Ne].slice(0,tt)},ce=function(ve){return V.s(he%12||12,ve,"0")},le=q||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(P.$y).slice(-2);case"YYYY":return V.s(P.$y,4,"0");case"M":return B+1;case"MM":return V.s(B+1,2,"0");case"MMM":return H(R.monthsShort,B,K,3);case"MMMM":return H(K,B);case"D":return P.$D;case"DD":return V.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return H(R.weekdaysMin,P.$W,W,2);case"ddd":return H(R.weekdaysShort,P.$W,W,3);case"dddd":return W[P.$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(P.$s);case"ss":return V.s(P.$s,2,"0");case"SSS":return V.s(P.$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(S,P,R){var ee,ie=this,he=V.p(P),ue=O(S),B=(ue.utcOffset()-this.utcOffset())*r,W=this-ue,K=function(){return V.m(ie,ue)};switch(he){case p:ee=K()/12;break;case f:ee=K();break;case h:ee=K()/3;break;case u:ee=(W-B)/6048e5;break;case d:ee=(W-B)/864e5;break;case c:ee=W/i;break;case a:ee=W/r;break;case s:ee=W/n;break;default:ee=W}return R?ee:V.a(ee)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return w[this.$L]},I.locale=function(S,P){if(!S)return this.$L;var R=this.clone(),ee=D(S,P,!0);return ee&&(R.$L=ee),R},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()},F}(),z=L.prototype;return O.prototype=z,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){z[F[1]]=function(I){return this.$g(I,F[0],F[1])}}),O.extend=function(F,I){return F.$i||(F(I,L,O),F.$i=!0),O},O.locale=D,O.isDayjs=$,O.unix=function(F){return O(1e3*F)},O.en=w[C],O.Ls=w,O.p={},O})}(_c)),_c.exports}var kB=qs();const G=Ri(kB);var vB={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})})(vB);var wB={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})})(wB);var xB={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})})(xB);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 EB=Vg.exports;const CB=Ri(EB);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 SB=Pg.exports;const _B=Ri(SB),OB={class:"w-full dark:text-gray-400"},TB={class:"flex justify-between items-center mb-3"},NB={class:"flex"},MB={class:"font-medium flex items-center gap-2"},AB=["value","onChange"],DB=["value"],$B=["value","onChange"],LB=["value"],BB={class:"flex"},IB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},Oc=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:G().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=jn();G.extend(_B),G.extend(CB);const r=t,i=l.computed(()=>Array.from({length:7},(W,K)=>G().day((1+K)%7).locale(n.value).format("ddd"))),o=l.ref([G(new Date).subtract(1,"month"),G(new Date)]);l.watch(()=>r.initDates,()=>{var B;if(!r.range&&r.initDates)o.value[0]=G(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=G(new Date);else if(r.range&&((B=r.initDates)==null?void 0:B.length)===2){let W=G(r.initDates[0]),K=G(r.initDates[1]);K.isBefore(W,"month")&&(K=W.add(1,"month")),W.isSame(K,"month")&&(K=W.add(1,"month")),o.value=[W,K]}},{immediate:!0,once:!0}),l.watch(()=>[r.displayYearStart,r.displayMonthStart],([B,W])=>{B&&W&&(o.value[0]=G().year(Number(B)).month(Number(W)).startOf("month"),o.value[1]=G().year(Number(B)).month(Number(W)).startOf("month").add(1,"month"))},{immediate:!0}),l.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([B,W])=>{if(B&&W){const K=o.value[0],q=G().year(Number(B)).month(Number(W)).startOf("month");q.isAfter(K,"month")&&(o.value[1]=q)}},{immediate:!0});const s=e,a=l.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(B){if(r.week)s("update:modelValue",[G(B).startOf("week"),G(B).endOf("week")]);else if(r.range){const W=r.modelValue.filter(K=>K).length;if(W==0)s("update:modelValue",[B]);else if(W==2)s("update:modelValue",[B]);else if(W==1){let K=[G(r.modelValue[0]),G(B)];K=K.sort((q,H)=>q-H),s("update:modelValue",K)}}else s("update:modelValue",G(B))}function d(B){const W=G(B).daysInMonth(),K=[],q=G(B).startOf("month");for(let H=1;H<=W;H++){let ce=q.clone().date(H);K.push(ce)}return K}function u(B){return G(B).startOf("month").day()}function f(B,W){const K=G(`${B}-${W}-01`,"YYYY-MM-DD"),H=K.day(),ce=[];for(let le=0;le<H;le++)ce.push(K.clone().subtract(H-le,"days"));return ce}function h(B,W){const K=G(`${B}-${W}`,"YYYY-MM").endOf("month"),H=6-K.day(),ce=[];for(let le=1;le<=H;le++)ce.push(K.clone().add(le,"days"));return ce}function p(B){const W=G();return G(B).isSame(W,"day")}function m(B){var W,K;if(r.range){if(((W=r.modelValue)==null?void 0:W.length)==1)return G(B).isSame(G(r.modelValue[0]),"day");if(((K=r.modelValue)==null?void 0:K.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")||G(B).isSame(G(r.modelValue[1]),"day")}else if(r.modelValue)return G(B).isSame(G(r.modelValue),"day")}function g(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isBetween(G(r.modelValue[0]),G(r.modelValue[1]))}function y(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")}function k(B){var W;if(r.range&&((W=r.modelValue)==null?void 0:W.length)==2)return G(B).isSame(G(r.modelValue[1]),"day")}function x(B){try{return r.minDate?G(B).isBefore(G(r.minDate)):!1}catch(W){return console.log(W),!1}}function v(B){try{return r.maxDate?G(B).isAfter(G(r.maxDate)):!1}catch(W){return console.log(W),!1}}function b(B){L(B,o.value[B].subtract(1,"month"))}function C(B){L(B,o.value[B].add(1,"month"))}function w(B){L(B,o.value[B].subtract(1,"year"))}function T(B){L(B,o.value[B].add(1,"year"))}const $=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"month").isAfter(o.value[0],"month"),D=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"month").isBefore(o.value[1],"month"),O=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"year").isAfter(o.value[0],"year"),V=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"year").isBefore(o.value[1],"year");function L(B,W){if(B===0){if(!a.value.length===1&&!W.isBefore(o.value[1],"month"))return;o.value=[W,o.value[1]]}else{if(!a.value.length===1&&!W.isAfter(o.value[0],"month"))return;(W.isBefore(o.value[0],"month")||W.isSame(o.value[0],"month"))&&(W=o.value[0].add(1,"month")),o.value=[o.value[0],W]}}const z=l.ref();function F(B){r.week&&(z.value=G(B).week())}function I(B){return G(B).week()===z.value}function S(B){return G(B).week()===z.value?G(B).format("YYYY-MM-DD")===G().week(z.value).startOf("week").format("YYYY-MM-DD"):!1}function P(B){return G(B).week()===z.value?G(B).format("YYYY-MM-DD")===G().week(z.value).endOf("week").format("YYYY-MM-DD"):!1}function R(){z.value=null}function ee(B,W){const K=o.value[B].year(Number(W));L(B,K)}function ie(B,W){const K=o.value[B].month(Number(W));L(B,K)}const he=l.computed(()=>{const B=r.defaultMinYear,W=r.defaultMaxYear,K=[];for(let q=B;q<=W;q++)K.push(q);return K}),ue=l.computed(()=>Array.from({length:12},(B,W)=>G().month(W).locale(n.value).format("MMMM")));return(B,W)=>(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,K=>{var q;return l.openBlock(),l.createElementBlock("div",OB,[l.createElementVNode("div",TB,[l.createElementVNode("div",NB,[l.createVNode(Hf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!O(K),"hover:opacity-100":O(K)}]),onClick:H=>O(K)?w(K):null},null,8,["class","onClick"]),l.createVNode(Wf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(K),"hover:opacity-100":$(K)}]),onClick:H=>$(K)?b(K):null},null,8,["class","onClick"])]),l.createElementVNode("div",MB,[l.createElementVNode("select",{value:o.value[K].format("YYYY"),onChange:H=>ee(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(he.value,H=>(l.openBlock(),l.createElementBlock("option",{key:H,value:H},l.toDisplayString(H),9,DB))),128))],40,AB),l.createElementVNode("select",{value:o.value[K].month(),onChange:H=>ie(K,H.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ue.value,(H,ce)=>(l.openBlock(),l.createElementBlock("option",{key:ce,value:ce},l.toDisplayString(H),9,LB))),128))],40,$B)]),l.createElementVNode("div",BB,[l.createVNode(Yf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!D(K),"hover:opacity-100":D(K)}]),onClick:H=>D(K)?C(K):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(K),"hover:opacity-100":V(K)}]),onClick:H=>V(K)?T(K):null},null,8,["class","onClick"])])]),l.createElementVNode("div",IB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(H,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"flex justify-center text-sm"},l.toDisplayString(H),1))),128))]),l.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:R},[u(o.value[K])>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(f(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),H=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(H)&&!x(H)?c(H):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d(o.value[K].clone()),H=>(l.openBlock(),l.createBlock(Sc,{onMouseover:ce=>F(H),onClick:ce=>!v(H)&&!x(H)?c(H):null,today:p(H),selected:m(H),firstDay:y(H)||S(H),lastDay:k(H)||P(H),between:g(H),disabled:v(H)||x(H),off:v(H)||x(H),highlight:I(H)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((q=h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1))==null?void 0:q.length)>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),H=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(H)&&!x(H)?c(H):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(H).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0)],32)])}),256))],2))}}),VB={},PB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},RB=[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 FB(t,e){return l.openBlock(),l.createElementBlock("svg",PB,RB)}const Rg=be(VB,[["render",FB]]),jB={},zB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},HB=[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 WB(t,e){return l.openBlock(),l.createElementBlock("svg",zB,HB)}const Fg=be(jB,[["render",WB]]),UB={class:"flex gap-3"},YB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},qB=["onClick"],KB=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("wpiccomponents.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=>G(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return G(r.modelValue).format("YYYY-MM-DD")}),c=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("month");o("update:modelValue",[f,u])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=G().startOf("month").subtract(1,"month"),f=G(u).endOf("month");o("update:modelValue",[u,f])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px"},{content:l.withCtx(()=>[l.createElementVNode("div",UB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",YB,[(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,qB))),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"]))}}),GB={class:"relative inline-block tabular-nums"},JB=["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",GB,[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,JB)]))}},ZB={class:"flex items-center gap-0"},XB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),QB=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]?G(k[0]).format("YYYY"):"",monthStart.value=k[0]?G(k[0]).format("MM"):"",dayStart.value=k[0]?G(k[0]).format("DD"):"",yearEnd.value=k[1]?G(k[1]).format("YYYY"):"",monthEnd.value=k[1]?G(k[1]).format("MM"):"",dayEnd.value=k[1]?G(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=G(k).format("YYYY"),o.value=G(k).format("MM"),s.value=G(k).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=G().format("YYYY")),u()}function g(){o.value||(o.value=G().format("MM")),u()}function y(){s.value||(s.value=G().format("DD")),u()}return(k,x)=>(l.openBlock(),l.createElementBlock("div",ZB,[l.createVNode(Tc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=v=>i.value=v),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:a},null,8,["modelValue","disabled"]),XB,l.createVNode(Tc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=v=>o.value=v),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),QB,l.createVNode(Tc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=v=>s.value=v),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},eI={class:"tabular-nums"},tI={key:1,class:"flex items-center"},nI=l.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),rI={class:"flex gap-3"},iI={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},oI=["onClick"],sI=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("wpiccomponents.select_date"):r.placeholder);l.ref(!1);const s=l.ref(G().year()),a=l.ref(G().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=G(r.initDates[0]).year(),a.value=G(r.initDates[0]).month(),c.value=G(r.initDates[1]).year(),d.value=G(r.initDates[1]).month()):r.initDates&&(s.value=G(r.initDates).year(),a.value=G(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]?G(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?G(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?G(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),l.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?G(m[0]).toDate():null,x=m[1]&&m[1].length===10?G(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=G(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("month");i("update:modelValue",[y,g])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=G().startOf("month").subtract(1,"month"),y=G(g).endOf("month");i("update:modelValue",[g,y])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:l.withCtx(()=>[l.createElementVNode("div",rI,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",iI,[(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,oI))),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",eI,[t.range?t.range?(l.openBlock(),l.createElementBlock("div",tI,[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"]),nI,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"]))}}),aI=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))}}),lI={class:"absolute inset-0 flex items-center justify-center py-12"},cI={class:"text-lg font-medium dark:text-gray-300"},dI={key:0,class:"flex justify-end px-6 pb-4"},uI=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",lI,[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",cI,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",dI,[l.renderSlot(f.$slots,"buttons")])):l.createCommentVNode("",!0)],2)])],2))}}),fI=["onClick"],hI=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,fI))),128))],2),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"default")])],64))}}),pI=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)}}),mI={},gI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yI=[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 bI(t,e){return l.openBlock(),l.createElementBlock("svg",gI,yI)}const kI=be(mI,[["render",bI]]),vI={},wI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},xI=[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 EI(t,e){return l.openBlock(),l.createElementBlock("svg",wI,xI)}const CI=be(vI,[["render",EI]]),SI={},_I={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},OI=[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 TI(t,e){return l.openBlock(),l.createElementBlock("svg",_I,OI)}const NI=be(SI,[["render",TI]]),MI={},AI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},DI=[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 $I(t,e){return l.openBlock(),l.createElementBlock("svg",AI,DI)}const LI=be(MI,[["render",$I]]),BI={key:0,class:"w-6 opacity-50"},II={class:"flex-1"},VI={key:0,class:"mb-2"},PI=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",BI,[t.warning?(l.openBlock(),l.createBlock(kI,{key:0,class:"w-full aspect-square"})):t.info?(l.openBlock(),l.createBlock(CI,{key:1,class:"w-full aspect-square"})):t.success?(l.openBlock(),l.createBlock(NI,{key:2,class:"w-full aspect-square"})):t.error?(l.openBlock(),l.createBlock(LI,{key:3,class:"w-full aspect-square"})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",II,[t.title?(l.openBlock(),l.createElementBlock("div",VI,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 RI={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},FI={class:"text-lg font-semibold mb-6"},jI={class:"mb-12"},zI={class:"flex justify-end"},Dc={WpicColorPicker:Ff,WpicAlert:PI,WpicToggleSwitch:Pf,WpicAdvDateField:sI,WpicCalendar:Oc,WpicTextarea:Rf,WpicDialog:uI,WpicSlidePanel:aI,WpicDateField:KB,WpicFormInput:Pi,WpicButton:_i,WpicBadge:bB,WpicTextEditor:tB,WpicInputGroup:Cy,WpicButtonGroup:vy,WpicForm:Sy,WpicFormField:jf,WpicSpinner:Ir,WpicTooltip:zf,WpicPopover:dr,WpicChoiceList:Vf,WpicCard:A_,WpicCardSection:L_,WpicProgressBar:V_,WpicTag:R_,WpicTagGroup:F_,WpicPagination:fO,WpicLoadingPanel:W_,WpicTable:UO,WpicTableColumn:YO,WpicTabs:hI,WpicTabPane:pI,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",RI,[l.createElementVNode("div",FI,l.toDisplayString(l.unref(n)),1),l.createElementVNode("div",jI,l.toDisplayString(l.unref(r)),1),l.createElementVNode("div",zI,[l.createVNode(_i,{onClick:l.unref(a)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.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("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};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 HI={useConfirm:Ac};function WI(t,e){Kg(fe,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const UI={install:WI,composables:HI,options:fe};Dn.default=UI,Dn.useConfirm=Ac,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|