vue-spear-tip 0.2.15 → 0.2.16-beta.0
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/.vite/manifest.json +32 -32
- package/dist/{Button-DjuvVLMq.cjs → Button-CegdAQx1.cjs} +1 -1
- package/dist/{Button-BkzQb0g8.js → Button-b6rBibUU.js} +1 -1
- package/dist/{CodeHighlight-C8Y-gfDc.cjs → CodeHighlight-D8u7i5q3.cjs} +1 -1
- package/dist/{CodeHighlight-Bh23z1uf.js → CodeHighlight-DK_itct_.js} +1 -1
- package/dist/{DateField-Bw053ye0.js → DateField-DzpU2RzG.js} +38 -7
- package/dist/DateField-TSP3qae_.cjs +31 -0
- package/dist/{FieldComponent.vue_vue_type_script_lang-CeH-5wkc.cjs → FieldComponent.vue_vue_type_script_lang-CMmfE7TT.cjs} +1 -1
- package/dist/{FieldComponent.vue_vue_type_script_lang-Cz840qnG.js → FieldComponent.vue_vue_type_script_lang-CnnnJaoS.js} +1 -1
- package/dist/Interfaces/IBaseVueComponent.d.ts +1 -1
- package/dist/Interfaces/IFieldComponent.d.ts +2 -1
- package/dist/Interfaces/IGlobalVST.d.ts +1 -1
- package/dist/Interfaces/IVueClass.d.ts +15 -3
- package/dist/{SelectField-CTGlQluA.cjs → SelectField-Cos_iPFh.cjs} +1 -1
- package/dist/{SelectField-CAXhi6l3.js → SelectField-Nf4hj-Jx.js} +2 -2
- package/dist/StringField-0X0z4bJq.js +2947 -0
- package/dist/StringField-EHq_XTp1.cjs +1 -0
- package/dist/SwitchField-Bys_uVdf.cjs +1 -0
- package/dist/SwitchField-DtXJEtoV.js +247 -0
- package/dist/{Tabs-Be4PuSkW.js → Tabs-B0rOz5l4.js} +1 -1
- package/dist/{Tabs-DkxUPHsT.cjs → Tabs-zIXIin4o.cjs} +1 -1
- package/dist/{TextField-DPh0d_BF.js → TextField-CEmB9He5.js} +2 -2
- package/dist/{TextField-Cd89tDiv.cjs → TextField-OQmwJdtJ.cjs} +1 -1
- package/dist/components/Elements/Button/ButtonInherited.d.ts +1 -1
- package/dist/components/Fields/DateField/IDateField.d.ts +1 -1
- package/dist/core/Props.d.ts +1 -1
- package/dist/core/VST.lib.d.ts +4 -0
- package/dist/core/VueClass.d.ts +10 -2
- package/dist/core/VueClassComponent.d.ts +2 -2
- package/dist/core/index.d.ts +2 -13
- package/dist/index-BN_QKlXx.cjs +1 -0
- package/dist/{index-C3iH518C.js → index-DtaxH9ox.js} +2089 -2050
- package/dist/replaceable/BaseComponent.vue +8 -80
- package/dist/replaceable/Elements/Button/ButtonInherited.d.ts +1 -1
- package/dist/replaceable/FieldComponent.vue +1 -1
- package/dist/vue-spear-tip.cjs.js +1 -1
- package/dist/vue-spear-tip.css +1 -1
- package/dist/vue-spear-tip.d.ts +3 -0
- package/dist/vue-spear-tip.es.js +1 -1
- package/docs/index.html +2 -2
- package/docs/static/{Button-sUI9KqkY.js → Button-CeDK-PBR.js} +1 -1
- package/docs/static/{CodeHighlight-DaitPlT0.js → CodeHighlight-CwVuCJVt.js} +1 -1
- package/docs/static/DateField-D4RyJiyD.js +31 -0
- package/docs/static/{FieldComponent.vue_vue_type_script_lang-Bta9r3fM.js → FieldComponent.vue_vue_type_script_lang-GFnG0VWx.js} +1 -1
- package/docs/static/{NoSymbolIcon-CkMqcao3.js → NoSymbolIcon-Dq590q9t.js} +1 -1
- package/docs/static/{SelectField-CU1j3fu_.js → SelectField-61XgjABZ.js} +1 -1
- package/docs/static/StringField-4jEXE2Iq.js +1 -0
- package/docs/static/StringField-DkTD1rGV.css +1 -0
- package/docs/static/SwitchField-CIYufM5H.js +1 -0
- package/docs/static/{Tabs-xXm2jMOr.js → Tabs-DdDx4FlO.js} +1 -1
- package/docs/static/{TextField-CGJzy2V1.js → TextField-BifW_QMR.js} +1 -1
- package/docs/static/index-DuaCcUUh.js +2 -0
- package/docs/static/main-BGO0apQg.js +119 -0
- package/docs/static/main-CPQng82-.css +1 -0
- package/package.json +2 -1
- package/dist/DateField-B82HWIBS.cjs +0 -5
- package/dist/StringField-CVG8C0Va.cjs +0 -1
- package/dist/StringField-s9Wz67z0.js +0 -2949
- package/dist/SwitchField-B3U3kL7v.js +0 -255
- package/dist/SwitchField-CLF9MHBX.cjs +0 -1
- package/dist/index-_vuPJ0dk.cjs +0 -1
- package/docs/static/DateField-qDHcnTNL.js +0 -5
- package/docs/static/StringField-BJ5e1NcF.css +0 -1
- package/docs/static/StringField-DrzuLoiI.js +0 -1
- package/docs/static/SwitchField-CYjiGtTW.js +0 -1
- package/docs/static/index-YY1vacQn.js +0 -2
- package/docs/static/main-CjwB_FDy.js +0 -95
- package/docs/static/main-CkcC65yN.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Lt=Object.defineProperty;var p=(r,t)=>Lt(r,"name",{value:t,configurable:!0});import{c as b,o as A,a as x,P as C,C as ft,V as Nt,r as st,e as Y,f as K,w as Pt,n as it,g as Ut,t as at,h as $t,i as Yt,j as Kt,b as jt}from"./main-BGO0apQg.js";import{F as zt}from"./FieldComponent.vue_vue_type_script_lang-GFnG0VWx.js";import{r as Ht}from"./NoSymbolIcon-Dq590q9t.js";function B(r){return typeof r=="string"||r instanceof String}p(B,"isString");function Vt(r){var t;return typeof r=="object"&&r!=null&&(r==null||(t=r.constructor)==null?void 0:t.name)==="Object"}p(Vt,"isObject");function Dt(r,t){return Array.isArray(t)?Dt(r,(e,s)=>t.includes(s)):Object.entries(r).reduce((e,s)=>{let[i,a]=s;return t(a,i)&&(e[i]=a),e},{})}p(Dt,"pick");const o={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Gt(r){switch(r){case o.LEFT:return o.FORCE_LEFT;case o.RIGHT:return o.FORCE_RIGHT;default:return r}}p(Gt,"forceDirection");function nt(r){return r.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}p(nt,"escapeRegExp");function j(r,t){if(t===r)return!0;const e=Array.isArray(t),s=Array.isArray(r);let i;if(e&&s){if(t.length!=r.length)return!1;for(i=0;i<t.length;i++)if(!j(t[i],r[i]))return!1;return!0}if(e!=s)return!1;if(t&&r&&typeof t=="object"&&typeof r=="object"){const a=t instanceof Date,n=r instanceof Date;if(a&&n)return t.getTime()==r.getTime();if(a!=n)return!1;const u=t instanceof RegExp,h=r instanceof RegExp;if(u&&h)return t.toString()==r.toString();if(u!=h)return!1;const l=Object.keys(t);for(i=0;i<l.length;i++)if(!Object.prototype.hasOwnProperty.call(r,l[i]))return!1;for(i=0;i<l.length;i++)if(!j(r[l[i]],t[l[i]]))return!1;return!0}else if(t&&r&&typeof t=="function"&&typeof r=="function")return t.toString()===r.toString();return!1}p(j,"objectIncludes");const mt=class mt{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?o.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?o.RIGHT:o.LEFT}};p(mt,"ActionDetails");let rt=mt;function d(r,t){return new d.InputMask(r,t)}p(d,"IMask");function Mt(r){if(r==null)throw new Error("mask property should be defined");return r instanceof RegExp?d.MaskedRegExp:B(r)?d.MaskedPattern:r===Date?d.MaskedDate:r===Number?d.MaskedNumber:Array.isArray(r)||r===Array?d.MaskedDynamic:d.Masked&&r.prototype instanceof d.Masked?r:d.Masked&&r instanceof d.Masked?r.constructor:r instanceof Function?d.MaskedFunction:(console.warn("Mask not found for mask",r),d.Masked)}p(Mt,"maskedClass");function N(r){if(!r)throw new Error("Options in not defined");if(d.Masked){if(r.prototype instanceof d.Masked)return{mask:r};const{mask:t=void 0,...e}=r instanceof d.Masked?{mask:r}:Vt(r)&&r.mask instanceof d.Masked?r:{};if(t){const s=t.mask;return{...Dt(t,(i,a)=>!a.startsWith("_")),mask:t.constructor,_mask:s,...e}}}return Vt(r)?{...r}:{mask:r}}p(N,"normalizeOpts");function y(r){if(d.Masked&&r instanceof d.Masked)return r;const t=N(r),e=Mt(t.mask);if(!e)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===e&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new e(t)}p(y,"createMask");d.createMask=y;const kt=class kt{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,e){if(!(t==null||e==null||t===this.selectionStart&&e===this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}};p(kt,"MaskElement");let P=kt;d.MaskElement=P;const wt=90,qt=89,gt=class gt extends P{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,s;return(t=(e=(s=this.input).getRootNode)==null?void 0:e.call(s))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===wt&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===qt&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===wt&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}};p(gt,"HTMLMaskElement");let O=gt;d.HTMLMaskElement=O;const _t=class _t extends O{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}};p(_t,"HTMLInputMaskElement");let ut=_t;d.HTMLMaskElement=O;const vt=class vt extends O{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),s=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||s==null||s<i?s:i}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),s=e&&e.anchorOffset,i=e&&e.focusOffset;return i==null||s==null||s>i?s:i}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,t),s.setEnd(this.input.lastChild||this.input,e);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}};p(vt,"HTMLContenteditableMaskElement");let z=vt;d.HTMLContenteditableMaskElement=z;const X=class X{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>X.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}};p(X,"InputHistory");let H=X;H.MAX_LENGTH=100;const Ct=class Ct{constructor(t,e){this.el=t instanceof P?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new z(t):new ut(t),this.masked=y(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new H,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return t==null||((e=this.masked)==null?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof d.Masked)&&this.masked.constructor===Mt(t)){this.masked.updateOptions({mask:t});return}const e=t instanceof d.Masked?t:y({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const s=this._listeners[t];s&&s.forEach(i=>i(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,s=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,n=this.unmaskedValue!==e||this.value!==s||this._rawInputValue!==i;this._unmaskedValue=e,this._value=s,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),n&&this._fireChangeEvents(),!this._historyChanging&&(n||this.history.isEmpty)&&this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...s}=t,i=!this.maskEquals(e),a=this.masked.optionsIsChanged(s);i&&(this.mask=e),a&&this.masked.updateOptions(s),(i||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,o.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const s=this._listeners[t].indexOf(e);return s>=0&&this._listeners[t].splice(s,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new rt({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?e.removeDirection:o.NONE;let n=this.masked.nearestInputPos(e.startChangePos+i,a);a!==o.NONE&&(n=this.masked.nearestInputPos(n,o.NONE)),this.updateControl(n),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};p(Ct,"InputMask");let ht=Ct;d.InputMask=ht;const J=class J{static normalize(t){return Array.isArray(t)?t:[t,new J]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}};p(J,"ChangeDetails");let c=J;d.ChangeDetails=c;const Et=class Et{constructor(t,e,s){t===void 0&&(t=""),e===void 0&&(e=0),this.value=t,this.from=e,this.stop=s}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}};p(Et,"ContinuousTailDetails");let F=Et;const D=class D{constructor(t){this._value="",this._update({...D.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){e===void 0&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,s){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new F(this.extractInput(t,e),t)}appendTail(t){return B(t)&&(t=new F(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new c({inserted:t,rawInserted:t})):new c}_appendChar(t,e,s){e===void 0&&(e={});const i=this.state;let a;if([t,a]=this.doPrepareChar(t,e),t&&(a=a.aggregate(this._appendCharRaw(t,e)),!a.rawInserted&&this.autofix==="pad")){const n=this.state;this.state=i;let u=this.pad(e);const h=this._appendCharRaw(t,e);u=u.aggregate(h),h.rawInserted||u.equals(a)?a=u:this.state=n}if(a.inserted){let n,u=this.doValidate(e)!==!1;if(u&&s!=null){const h=this.state;if(this.overwrite===!0){n=s.state;for(let f=0;f<a.rawInserted.length;++f)s.unshift(this.displayValue.length-a.tailShift)}let l=this.appendTail(s);if(u=l.rawInserted.length===s.toString().length,!(u&&l.inserted)&&this.overwrite==="shift"){this.state=h,n=s.state;for(let f=0;f<a.rawInserted.length;++f)s.shift();l=this.appendTail(s),u=l.rawInserted.length===s.toString().length}u&&l.inserted&&(this.state=h)}u||(a=new c,this.state=i,s&&n&&(s.state=n))}return a}_appendPlaceholder(){return new c}_appendEager(){return new c}append(t,e,s){if(!B(t))throw new Error("value should be string");const i=B(s)?new F(String(s)):s;e!=null&&e.tail&&(e._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,e);for(let n=0;n<t.length;++n){const u=this._appendChar(t[n],e,i);if(!u.rawInserted&&!this.doSkipInvalid(t[n],e,i))break;a.aggregate(u)}return(this.eager===!0||this.eager==="append")&&e!=null&&e.input&&t&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new c}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,s=this.value,i=t();return this.rawInputValue=e,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,s=t(this);return this.state=e,delete this._isolated,s}doSkipInvalid(t,e,s){return!!this.skipInvalid}doPrepare(t,e){return e===void 0&&(e={}),c.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return e===void 0&&(e={}),c.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,s,i,a){s===void 0&&(s=""),i===void 0&&(i=o.NONE),a===void 0&&(a={input:!0});const n=t+e,u=this.extractTail(n),h=this.eager===!0||this.eager==="remove";let l;h&&(i=Gt(i),l=this.extractInput(0,n,{raw:!0}));let f=t;const g=new c;if(i!==o.NONE&&(f=this.nearestInputPos(t,e>1&&t!==0&&!h?o.NONE:i),g.tailShift=f-t),g.aggregate(this.remove(f)),h&&i!==o.NONE&&l===this.rawInputValue)if(i===o.FORCE_LEFT){let E;for(;l===this.rawInputValue&&(E=this.displayValue.length);)g.aggregate(new c({tailShift:-1})).aggregate(this.remove(E-1))}else i===o.FORCE_RIGHT&&u.unshift();return g.aggregate(this.append(s,a,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!j(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||D.EMPTY_VALUES.includes(t)&&D.EMPTY_VALUES.includes(e)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new c}};p(D,"Masked");let _=D;_.DEFAULTS={skipInvalid:!0};_.EMPTY_VALUES=[void 0,null,""];d.Masked=_;const V=class V{constructor(t,e){t===void 0&&(t=[]),e===void 0&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=B(t)?new F(String(t)):t;const e=this.chunks[this.chunks.length-1],s=e&&(e.stop===t.stop||t.stop==null)&&t.from===e.from+e.toString().length;if(t instanceof F)s?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof V){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof d.MaskedPattern))return new F(this.toString()).appendTo(t);const e=new c;for(let s=0;s<this.chunks.length;++s){const i=this.chunks[s],a=t._mapPosToBlock(t.displayValue.length),n=i.stop;let u;if(n!=null&&(!a||a.index<=n)&&((i instanceof V||t._stops.indexOf(n)>=0)&&e.aggregate(t._appendPlaceholder(n)),u=i instanceof V&&t._blocks[n]),u){const h=u.appendTail(i);e.aggregate(h);const l=i.toString().slice(h.rawInserted.length);l&&e.aggregate(t.append(l,{tail:!0}))}else e.aggregate(t.append(i.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...s}=t;Object.assign(this,s),this.chunks=e.map(i=>{const a="chunks"in i?new V:new F;return a.state=i,a})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const e=t!=null?t-this.from:t;let s=0;for(;s<this.chunks.length;){const i=this.chunks[s],a=i.unshift(e);if(i.toString()){if(!a)break;++s}else this.chunks.splice(s,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],s=e.shift();if(e.toString()){if(!s)break;--t}else this.chunks.splice(t,1);if(s)return s}return""}};p(V,"ChunksTailDetails");let G=V;const Ft=class Ft{constructor(t,e){this.masked=t,this._log=[];const{offset:s,index:i}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((e=this.block)==null?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,o.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,o.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,o.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,o.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,o.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,o.NONE),!0})}};p(Ft,"PatternCursor");let lt=Ft;const At=class At{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new c}nearestInputPos(t,e){e===void 0&&(e=o.NONE);const s=0,i=this._value.length;switch(e){case o.LEFT:case o.FORCE_LEFT:return s;case o.NONE:case o.RIGHT:case o.FORCE_RIGHT:default:return i}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,s){return t===void 0&&(t=0),e===void 0&&(e=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new c;const s=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!s)&&!e.tail,n=new c({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(e.raw||e.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new c;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new F("")}appendTail(t){return B(t)&&(t=new F(String(t))),t.appendTo(this)}append(t,e,s){const i=this._appendChar(t[0],e);return s!=null&&(i.tailShift+=this.appendTail(s).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}};p(At,"PatternFixedDefinition");let q=At;const It=class It{constructor(t){const{parent:e,isOptional:s,placeholderChar:i,displayChar:a,lazy:n,eager:u,...h}=t;this.masked=y(h),Object.assign(this,{parent:e,isOptional:s,placeholderChar:i,displayChar:a,lazy:n,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),t===0&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new c}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,e){if(e===void 0&&(e={}),this.isFilled)return new c;const s=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(e));return i.inserted&&this.doValidate(e)===!1&&(i=new c,this.masked.state=s),!i.inserted&&!this.isOptional&&!this.lazy&&!e.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,e,s){return this.masked.append(t,this.currentMaskFlags(e),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new c:(this.isFilled=!0,new c({inserted:this.placeholderChar}))}_appendEager(){return new c}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,s){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.masked.extractInput(t,e,s)}nearestInputPos(t,e){e===void 0&&(e=o.NONE);const s=0,i=this.value.length,a=Math.min(Math.max(t,s),i);switch(e){case o.LEFT:case o.FORCE_LEFT:return this.isComplete?a:s;case o.RIGHT:case o.FORCE_RIGHT:return this.isComplete?a:i;case o.NONE:default:return a}}totalInputPositions(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(t==null||(e=t._beforeTailState)==null?void 0:e.masked)||t?._beforeTailState}}pad(t){return new c}};p(It,"PatternInputDefinition");let L=It;L.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};const yt=class yt extends _{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=s=>s.search(e)>=0),super._update(t)}};p(yt,"MaskedRegExp");let ot=yt;d.MaskedRegExp=ot;const M=class M extends _{constructor(t){super({...M.DEFAULTS,...t,definitions:Object.assign({},L.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let s=!1,i=!1;for(let a=0;a<e.length;++a){if(this.blocks){const l=e.slice(a),f=Object.keys(this.blocks).filter(E=>l.indexOf(E)===0);f.sort((E,$)=>$.length-E.length);const g=f[0];if(g){const{expose:E,repeat:$,...Ot}=N(this.blocks[g]),bt={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...Ot,repeat:$,parent:this},et=$!=null?new d.RepeatBlock(bt):y(bt);et&&(this._blocks.push(et),E&&(this.exposeBlock=et),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),a+=g.length-1;continue}}let n=e[a],u=n in t;if(n===M.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(n==="{"||n==="}"){s=!s;continue}if(n==="["||n==="]"){i=!i;continue}if(n===M.ESCAPE_CHAR){if(++a,n=e[a],!n)break;u=!1}const h=u?new L({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...N(t[n]),parent:this}):new q({char:n,eager:this.eager,isUnmasking:s});this._blocks.push(h)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:e,...s}=t;this._blocks.forEach((i,a)=>i.state=e[a]),super.state=s}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+=e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+=e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+=e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new c;let s=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(s==null)return e;this._blocks[s].isFilled&&++s;for(let i=s;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;e.aggregate(a)}return e}_appendCharRaw(t,e){e===void 0&&(e={});const s=this._mapPosToBlock(this.displayValue.length),i=new c;if(!s)return i;for(let n=s.index,u;u=this._blocks[n];++n){var a;const h=u._appendChar(t,{...e,_beforeTailState:(a=e._beforeTailState)==null||(a=a._blocks)==null?void 0:a[n]});if(i.aggregate(h),h.consumed)break}return i}extractTail(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const s=new G;return t===e||this._forEachBlocksInRange(t,e,(i,a,n,u)=>{const h=i.extractTail(n,u);h.stop=this._findStopBefore(a),h.from=this._blockStartPos(a),h instanceof G&&(h.blockIndex=a),s.extend(h)}),s}extractInput(t,e,s){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),s===void 0&&(s={}),t===e)return"";let i="";return this._forEachBlocksInRange(t,e,(a,n,u,h)=>{i+=a.extractInput(u,h,s)}),i}_findStopBefore(t){let e;for(let s=0;s<this._stops.length;++s){const i=this._stops[s];if(i<=t)e=i;else break}return e}_appendPlaceholder(t){const e=new c;if(this.lazy&&t==null)return e;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return e;const i=s.index,a=t??this._blocks.length;return this._blocks.slice(i,a).forEach(n=>{if(!n.lazy||t!=null){var u;e.aggregate(n._appendPlaceholder((u=n._blocks)==null?void 0:u.length))}}),e}_mapPosToBlock(t){let e="";for(let s=0;s<this._blocks.length;++s){const i=this._blocks[s],a=e.length;if(e+=i.displayValue,t<=e.length)return{index:s,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((e,s)=>e+=s.displayValue.length,0)}_forEachBlocksInRange(t,e,s){e===void 0&&(e=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const a=this._mapPosToBlock(e),n=a&&i.index===a.index,u=i.offset,h=a&&n?a.offset:this._blocks[i.index].displayValue.length;if(s(this._blocks[i.index],i.index,u,h),a&&!n){for(let l=i.index+1;l<a.index;++l)s(this._blocks[l],l,0,this._blocks[l].displayValue.length);s(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const s=super.remove(t,e);return this._forEachBlocksInRange(t,e,(i,a,n,u)=>{s.aggregate(i.remove(n,u))}),s}nearestInputPos(t,e){if(e===void 0&&(e=o.NONE),!this._blocks.length)return 0;const s=new lt(this,t);if(e===o.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(e===o.LEFT||e===o.FORCE_LEFT){if(e===o.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===t)return t;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),e===o.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=t||(s.popState(),s.ok&&s.pos<=t))return s.pos;s.popState()}return s.ok?s.pos:e===o.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return e===o.RIGHT||e===o.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:e===o.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(t,o.LEFT))):t}totalInputPositions(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);let s=0;return this._forEachBlocksInRange(t,e,(i,a,n,u)=>{s+=i.totalInputPositions(n,u)}),s}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(s=>this._blocks[s]):[]}pad(t){const e=new c;return this._forEachBlocksInRange(0,this.displayValue.length,s=>e.aggregate(s.pad(t))),e}};p(M,"MaskedPattern");let v=M;v.DEFAULTS={..._.DEFAULTS,lazy:!0,placeholderChar:"_"};v.STOP_CHAR="`";v.ESCAPE_CHAR="\\";v.InputDefinition=L;v.FixedDefinition=q;d.MaskedPattern=v;const St=class St extends v{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:s=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...n}=t;this.to=e,this.from=s,this.maxLength=Math.max(String(e).length,i),this.autofix=a;const u=String(this.from).padStart(this.maxLength,"0"),h=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<h.length&&h[l]===u[l];)++l;n.mask=h.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let e="",s="";const[,i,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(e="0".repeat(i.length)+a,s="9".repeat(i.length)+a),e=e.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[e,s]}doPrepareChar(t,e){e===void 0&&(e={});let s;return[t,s]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(s.skip=!this.isComplete),[t,s]}_appendCharRaw(t,e){if(e===void 0&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const s=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,n]=this.boundaries(this.value+t);return Number(n)<this.from?super._appendCharRaw(s[this.value.length],e):Number(a)>this.to?!e.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(i[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(e.search(/[^0]/)===-1&&e.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(e);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const e=new c;if(this.value.length===this.maxLength)return e;const s=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let a=0;a<i;++a)e.aggregate(super._appendCharRaw("0",t));s.split("").forEach(a=>this._appendCharRaw(a))}return e}};p(St,"MaskedRange");let T=St;d.MaskedRange=T;const Zt="d{.}`m{.}`Y",S=class S extends v{static extractPatternOptions(t){const{mask:e,pattern:s,...i}=t;return{...i,mask:B(e)?e:s}}constructor(t){super(S.extractPatternOptions({...S.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:s,blocks:i,...a}={...S.DEFAULTS,...t},n=Object.assign({},S.GET_DEFAULT_BLOCKS());t.min&&(n.Y.from=t.min.getFullYear()),t.max&&(n.Y.to=t.max.getFullYear()),t.min&&t.max&&n.Y.from===n.Y.to&&(n.m.from=t.min.getMonth()+1,n.m.to=t.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=t.min.getDate(),n.d.to=t.max.getDate())),Object.assign(n,this.blocks,i),super._update({...a,mask:B(e)?e:s,blocks:n})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(S.extractPatternOptions(t))}};p(S,"MaskedDate");let U=S;U.GET_DEFAULT_BLOCKS=()=>({d:{mask:T,from:1,to:31,maxLength:2},m:{mask:T,from:1,to:12,maxLength:2},Y:{mask:T,from:1900,to:9999}});U.DEFAULTS={...v.DEFAULTS,mask:Date,pattern:Zt,format:p((r,t)=>{if(!r)return"";const e=String(r.getDate()).padStart(2,"0"),s=String(r.getMonth()+1).padStart(2,"0"),i=r.getFullYear();return[e,s,i].join(".")},"format"),parse:p((r,t)=>{const[e,s,i]=r.split(".").map(Number);return new Date(i,s-1,e)},"parse")};d.MaskedDate=U;const Q=class Q extends _{constructor(t){super({...Q.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(e=>{const{expose:s,...i}=N(e),a=y({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return s&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,e){e===void 0&&(e={});const s=this._applyDispatch(t,e);return this.currentMask&&s.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),s}_applyDispatch(t,e,s){t===void 0&&(t=""),e===void 0&&(e={}),s===void 0&&(s="");const i=e.tail&&e._beforeTailState!=null?e._beforeTailState._value:this.value,a=this.rawInputValue,n=e.tail&&e._beforeTailState!=null?e._beforeTailState._rawInputValue:a,u=a.slice(n.length),h=this.currentMask,l=new c,f=h?.state;return this.currentMask=this.doDispatch(t,{...e},s),this.currentMask&&(this.currentMask!==h?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-i.length),u&&(l.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):f&&(this.currentMask.state=f)),l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new c;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,s;return{...t,_beforeTailState:((e=t._beforeTailState)==null?void 0:e.currentMaskRef)===this.currentMask&&((s=t._beforeTailState)==null?void 0:s.currentMask)||t._beforeTailState}}doDispatch(t,e,s){return e===void 0&&(e={}),s===void 0&&(s=""),this.dispatch(t,this,e,s)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){e===void 0&&(e={});let[s,i]=super.doPrepare(t,e);if(this.currentMask){let a;[s,a]=super.doPrepare(s,this.currentMaskFlags(e)),i=i.aggregate(a)}return[s,i]}doPrepareChar(t,e){e===void 0&&(e={});let[s,i]=super.doPrepareChar(t,e);if(this.currentMask){let a;[s,a]=super.doPrepareChar(s,this.currentMaskFlags(e)),i=i.aggregate(a)}return[s,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,e){const s=new c;return this.currentMask&&s.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),s}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:s,currentMask:i,...a}=t;e&&this.compiledMasks.forEach((n,u)=>n.state=e[u]),s!=null&&(this.currentMask=s,this.currentMask.state=i),super.state=a}extractInput(t,e,s){return this.currentMask?this.currentMask.extractInput(t,e,s):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,s)=>{if(!t[s])return;const{mask:i,...a}=t[s];return j(e,a)&&e.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var e;return!!((e=this.currentMask)!=null&&e.typedValueEquals(t))}};p(Q,"MaskedDynamic");let Z=Q;Z.DEFAULTS={..._.DEFAULTS,dispatch:p((r,t,e,s)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,a=t.compiledMasks.map((n,u)=>{const h=t.currentMask===n,l=h?n.displayValue.length:n.nearestInputPos(n.displayValue.length,o.FORCE_LEFT);return n.rawInputValue!==i?(n.reset(),n.append(i,{raw:!0})):h||n.remove(l),n.append(r,t.currentMaskFlags(e)),n.appendTail(s),{index:u,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(l,n.nearestInputPos(n.displayValue.length,o.FORCE_LEFT)))}});return a.sort((n,u)=>u.weight-n.weight||u.totalInputPositions-n.totalInputPositions),t.compiledMasks[a[0].index]},"dispatch")};d.MaskedDynamic=Z;const tt=class tt extends v{constructor(t){super({...tt.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...s}=t;if(e){const i=e.map(u=>u.length),a=Math.min(...i),n=Math.max(...i)-a;s.mask="*".repeat(a),n&&(s.mask+="["+"*".repeat(n)+"]"),this.enum=e}super._update(s)}_appendCharRaw(t,e){e===void 0&&(e={});const s=Math.min(this.nearestInputPos(0,o.FORCE_RIGHT),this.value.length),i=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,s));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(n,u)=>{const h=i[0][u];u>=this.value.length||h===n.value||(n.reset(),n._appendChar(h,e))});const a=super._appendCharRaw(i[0][this.value.length],e);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(n=>a.aggregate(super._appendCharRaw(n))),a}return new c({skip:!this.isComplete})}extractTail(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),new F("",t)}remove(t,e){if(t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),t===e)return new c;const s=Math.min(super.nearestInputPos(0,o.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(s,i),s)).length>1);--i);const a=super.remove(i,e);return a.tailShift+=i-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}};p(tt,"MaskedEnum");let W=tt;W.DEFAULTS={...v.DEFAULTS,matchValue:p((r,t,e)=>r.indexOf(t,e)===e,"matchValue")};d.MaskedEnum=W;const xt=class xt extends _{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};p(xt,"MaskedFunction");let pt=xt;d.MaskedFunction=pt;var Tt;const I=class I extends _{constructor(t){super({...I.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e="\\d*",s=(this.scale?"("+nt(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+e+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(nt).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(nt(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){e===void 0&&(e={});const[s,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!s&&(i.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&i.aggregate(this._appendChar("-")),[s,i]}_separatorsCount(t,e){e===void 0&&(e=!1);let s=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++s,e&&(t+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,s){return t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,s))}_appendCharRaw(t,e){e===void 0&&(e={});const s=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const n=this.number;let u=!isNaN(n),h=!1;if(u){let E;this.min!=null&&this.min<0&&this.number<this.min&&(E=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(E=this.max),E!=null&&(this.autofix?(this._value=this.format(E,this).replace(I.UNMASKED_RADIX,this.radix),h||(h=a===this._value&&!e.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let l;u?l=new c({inserted:this._value.slice(a.length),rawInserted:h?"":t,skip:h}):(this._value=a,l=new c),this._value=this._insertThousandsSeparators(this._value);const f=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,g=this._separatorsCountFromSlice(f);return l.tailShift+=(g-i)*this.thousandsSeparator.length,l}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,e);if(s<=t)return s}return-1}_adjustRangeWithSeparators(t,e){const s=this._findSeparatorAround(t);s>=0&&(t=s);const i=this._findSeparatorAround(e);return i>=0&&(e=i+this.thousandsSeparator.length),[t,e]}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const s=this.value.slice(0,t),i=this.value.slice(e),a=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+i));const n=this._separatorsCountFromSlice(s);return new c({tailShift:(n-a)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case o.NONE:case o.LEFT:case o.FORCE_LEFT:{const s=this._findSeparatorAround(t-1);if(s>=0){const i=s+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===o.FORCE_LEFT)return s}break}case o.RIGHT:case o.FORCE_RIGHT:{const s=this._findSeparatorAround(t);if(s>=0)return s+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;this.min!=null&&(e=Math.max(e,this.min)),this.max!=null&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(s,i,a,n)=>i+n),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,s){e===void 0&&(e={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===I.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,s)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,I.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(I.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||I.EMPTY_VALUES.includes(t)&&I.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}};p(I,"MaskedNumber");let w=I;Tt=w;w.UNMASKED_RADIX=".";w.EMPTY_VALUES=[..._.EMPTY_VALUES,0];w.DEFAULTS={..._.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Tt.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:p(r=>r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20}),"format")};d.MaskedNumber=w;const dt={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Rt(r,t,e){t===void 0&&(t=dt.MASKED),e===void 0&&(e=dt.MASKED);const s=y(r);return i=>s.runIsolated(a=>(a[t]=i,a[e]))}p(Rt,"createPipe");function Wt(r,t,e,s){return Rt(t,e,s)(r)}p(Wt,"pipe");d.PIPE_TYPE=dt;d.createPipe=Rt;d.pipe=Wt;const Bt=class Bt extends v{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,s,i;const{repeat:a,...n}=N(t);this._blockOpts=Object.assign({},this._blockOpts,n);const u=y(this._blockOpts);this.repeat=(e=(s=a??u.repeat)!=null?s:this.repeat)!=null?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(y(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,e){e===void 0&&(e={});const s=new c;for(let h=(i=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?i:Math.max(this._blocks.length-1,0),l,f;l=(n=this._blocks[h])!=null?n:f=!f&&this._allocateBlock(h);++h){var i,a,n,u;const g=l._appendChar(t,{...e,_beforeTailState:(u=e._beforeTailState)==null||(u=u._blocks)==null?void 0:u[h]});if(g.skip&&f){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(g),g.consumed)break}return s}_trimEmptyTail(t,e){var s,i;t===void 0&&(t=0);const a=Math.max(((s=this._mapPosToBlock(t))==null?void 0:s.index)||0,this.repeatFrom,0);let n;e!=null&&(n=(i=this._mapPosToBlock(e))==null?void 0:i.index),n==null&&(n=this._blocks.length-1);let u=0;for(let h=n;a<=h&&!this._blocks[h].unmaskedValue;--h,++u);u&&(this._blocks.splice(n-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){t===void 0&&(t=0),e===void 0&&(e=this.displayValue.length);const s=super.remove(t,e);return this._trimEmptyTail(t,e),s}totalInputPositions(t,e){return t===void 0&&(t=0),e==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};p(Bt,"RepeatBlock");let ct=Bt;d.RepeatBlock=ct;try{globalThis.IMask=d}catch{}function Xt(r,t){return A(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[x("path",{"fill-rule":"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})])}p(Xt,"render$2");function Jt(r,t){return A(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[x("path",{"fill-rule":"evenodd",d:"M7.502 6h7.128A3.375 3.375 0 0 1 18 9.375v9.375a3 3 0 0 0 3-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 0 0-.673-.05A3 3 0 0 0 15 1.5h-1.5a3 3 0 0 0-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6ZM13.5 3A1.5 1.5 0 0 0 12 4.5h4.5A1.5 1.5 0 0 0 15 3h-1.5Z","clip-rule":"evenodd"}),x("path",{"fill-rule":"evenodd",d:"M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V9.375ZM6 12a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V12Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 15a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V15Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 18a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V18Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"})])}p(Jt,"render$1");var Qt=Object.defineProperty,te=Object.getOwnPropertyDescriptor,k=p((r,t,e,s)=>{for(var i=s>1?void 0:s?te(t,e):t,a=r.length-1,n;a>=0;a--)(n=r[a])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Qt(t,e,i),i},"__decorateClass"),R;let m=(R=class extends zt{maskPreset=null;force12hours=!1;alwaysCopyIcon=!1;disabled=!1;asNumber=!1;radix=",";mask=null;mapToRadix=[".",";","/"];dtPresetLocale="";thousandsSeparator=" ";step=1;min=0;max=null;emitsParent=["input","change","focus","blur","update:modelValue","dateMaskChange","keypress.enter","reset"];componentsParent={ClipboardDocumentListIcon:Jt,CheckBadgeIcon:Xt,NoSymbolIcon:Ht};maskInner=null;maskBlocks={};utc="UTC";_numVal=0;_asNum=!1;_iMaskInput(t){console.log(t?.srcElement?.value.replaceAll(this.thousandsSeparator,"").replace(new RegExp(`^[W\\${this.radix}]+$`,"g"),""),parseInt(t?.srcElement?.value)),this._asNum||(this.value=t?.srcElement?.value||"")}placeholder="Введите текст";is12hours=!1;_randKey="";_iMaskedInst;setup(t,e,s){let i=null;return{initIMask:p(l=>{if(l)return console.log("self.maskInner",s.maskInner),i=d(l,{mask:s.maskInner||String}),i.on("accept",()=>{}),i.on("complete",()=>{}),i},"initIMask"),updateIMaskOptions:p(l=>{i&&i.updateOptions(l)},"updateIMaskOptions"),setIMaskValue:p(l=>{i&&(i.value=l)},"setIMaskValue"),getUnmaskedValue:p(()=>i?i.unmaskedValue:"","getUnmaskedValue"),imaskInstance:p(()=>i,"imaskInstance")}}createdParent(){if(!this.is12hours&&this.isDateTime)try{const t=new Intl.DateTimeFormat(this.dtPresetLocale||this.VST.$r.locale,{hour:"numeric"}).resolvedOptions();this.is12hours=t.hourCycle==="h11"||t.hourCycle==="h12"}catch{this.is12hours=!1}else this.force12hours&&(this.is12hours=!0);this._asNum&&(this.maskInner=Number)}beforeMountParent(){let t=this.modelValue||this.inputValue||"";if(typeof t!="string"&&(t=""),this._preResetValue="",this.value=t,this.isDateTime){const e=new Intl.DateTimeFormat(this.dtPresetLocale||this.VST.$r.locale,{year:"numeric",month:"2-digit",day:"2-digit",hour:this.maskPreset=="datetime"||this.maskPreset=="datetimeSec"?"2-digit":void 0,minute:this.maskPreset=="datetime"||this.maskPreset=="datetimeSec"?"2-digit":void 0,second:this.maskPreset=="datetimeSec"?"2-digit":void 0,timeZoneName:"longOffset"}).formatToParts(new Date($VST.DT().epochMilliseconds));if(this.maskInner=e.map(s=>{switch(s.type){case"year":return"YYYY";case"month":return"MM";case"day":return"DD";case"hour":return"hh";case"second":return"ss";case"minute":return"mm";case"literal":return s.value;case"timeZoneName":return this.utc=s.value,"";default:return""}}).join(""),this.is12hours&&this.maskPreset!=="date")this.maskInner+="!";else if(this.maskPreset==="date"){const s=this._extractDateOnly(this.maskInner);s&&(this.maskInner=s)}this.maskInner=this.maskInner.replace(/\s+/g," "),this.maskBlocks={YYYY:{mask:d.MaskedRange,from:1e3,to:2300,validate:p((s,i)=>this.dateMaskValidateWithReplaceDays(i),"validate"),overwrite:!0},MM:{mask:d.MaskedRange,from:1,to:12,validate:p((s,i)=>this.dateMaskValidateWithReplaceDays(i),"validate"),overwrite:!0},DD:{mask:d.MaskedRange,from:1,to:31,validate:p((s,i)=>this.dateMaskValidateWithReplaceDays(i),"validate"),overwrite:!0},hh:{mask:d.MaskedRange,from:this.is12hours?1:0,to:this.is12hours?12:23,overwrite:!0},mm:{mask:d.MaskedRange,from:0,to:59,overwrite:!0},ss:{mask:d.MaskedRange,from:0,to:59,overwrite:!0},"!":{mask:d.MaskedEnum,enum:["AM","PM","am","pm"],overwrite:!0}}}else this.mask&&(this.maskInner=this.mask);this._asNum=this.asNumber,this._randKey=$VST.generateRandomKey(),console.log("_asNum",this._asNum,this.asNumber)}mountedParent(){console.log("_asNum",this._asNum,this.asNumber),this._asNum=this.asNumber,this.nextTick(()=>{this.selectInput&&(this.selectInput.addEventListener("focus",this._onFocus),this.selectInput.addEventListener("blur",this._onBlur),this.selectInput.addEventListener("wheel",this._onWheel.bind(this)),this.isDateTime||(this.selectInput.addEventListener("input",this._onInput),this.selectInput.addEventListener("keydown",this._onKeydown)))},5)}beforeUnmountParent(){this.selectInput&&(this.selectInput.removeEventListener("focus",this._onFocus),this.selectInput.removeEventListener("blur",this._onBlur),this.selectInput.removeEventListener("wheel",this._onWheel.bind(this)),this.isDateTime||(this.selectInput.removeEventListener("input",this._onInput),this.selectInput.removeEventListener("keydown",this._onKeydown)))}onAcceptUnmasked(t){}onAccept(t){const e=this.getFromMask(this.maskInner,t,"MM"),s=this.getFromMask(this.maskInner,t,"YYYY"),i=this.getFromMask(this.maskInner,t,"DD");let a=this.getFromMask(this.maskInner,t,"hh");const n=this.getFromMask(this.maskInner,t,"mm"),u=this.getFromMask(this.maskInner,t,"ss"),h=this.is12hours?t.toLowerCase().includes("am")?"am":"pm":"";this.$emit("dateMaskChange",{month:e,year:s,day:i,hour:a,minute:n,seconds:u,AmPm:h})}focus(t=0,e=0){const s=this.$el.querySelector("input.inputMask");s?.focus?.(),s?.setSelectionRange&&s?.value?.trim?.()&&s?.setSelectionRange?.(t,e>t?e||t:e)}blur(){this.$el.querySelector("input.inputMask")?.blur?.()}_preResetValue="";_onReset(){this._preResetValue=this.value,this.$emit("reset"),this._onInput("",!0),this.selectInput?.focus?.()}restore(){this._preResetValue&&(this.setValue(this._preResetValue),this.nextTick(()=>{["string","number"].includes(typeof this.value)&&(this.$emit("input",this.value),this.$emit("change",this.value),this.$emit("update:modelValue",this.value)),this._preResetValue="",this.selectInput?.focus?.()}))}selectInput;_setupIMask(t){const e=!!this.selectInput;this.selectInput=t,t&&(e&&this.updateIMaskOptions({mask:this.maskInner||String,scale:typeof this.asNumber=="number"?this._asNum:0,autofix:!0,min:this.min,max:this.max,radix:this.radix,placeholder:this.placeholder,thousandsSeparator:" ",padFractionalZeros:!0,overwrite:!0,lazy:!1,autocomplete:this.maskPreset==="email"?"email":"off",blocks:this.maskBlocks}),!this.maskInner&&this.mask&&(this.maskInner=this.mask),this.initIMask(t))}_onFocus(){this.$emit("focus")}_onBlur(){this.nextTick(()=>this.$emit("blur",this.selectInput?.value))}_onWheel=p(t=>{if(console.log("wheel",this._asNum,this.asNumber),this.disabled||!this._asNum)return;t.preventDefault();let e=parseFloat(this.value.replace(this.radix,"."));isNaN(e)&&(e=0);const s=this.step||1;t.deltaY<0?e+=s:e-=s,this.min!==void 0&&e<this.min&&(e=this.min),this.max!==void 0&&e>this.max&&(e=this.max),this.step&&(e=parseFloat(e.toFixed(this.step))),this.setValue(e),this.$emit("input",e),this.$emit("update:modelValue",e),this.$emit("change",e)},"_onWheel");_onKeydown(t){const e=t?.ctrlKey||t?.metaKey;this._preResetValue&&e&&t.key==="z"&&this.restore()}_onInput(t,e=!1){const s=t?.target?.value?.trim?.()||t;if(typeof s!="string"){this.isDateTime||(this.$emit("input",this.value="",e),this.$emit("change","",e),this.$emit("update:modelValue",""));return}else s&&(this._preResetValue="");["string","number"].includes(typeof(this.value=s))&&(this.$emit("input",this.value,e),this.$emit("change",this.value,e),this.$emit("update:modelValue",this.value))}_extractDateOnly(t){const e=/([\d\w]{2,4}[./_-][\d\w]{2,4}[./_-][\d\w]{2,4})/,s=t.match(e);return s?s?.[0]??null:null}getFromMask(t,e,s="MM"){const i=t?.toString().indexOf(s);if(i===-1)return 0;const a=e.slice(i,i+s.length),n=parseInt(a,10);return isNaN(n)?0:n}setValue(t){this.selectInput?.maskRef&&(this.selectInput.maskRef.unmaskedValue=t),super.setValue(t)}getValue(){return this._asNum?parseInt(this.value):this.value}_prepareIMask(t){if(this.isDateTime)return t.toUpperCase()}replaceInMask(t,e,s,i="MM"){const a=t.indexOf(i);if(a===-1)return e;const n=s.toString().padStart(2,"0");return e.slice(0,a)+n+e.slice(a+i.length)}dateMaskValidateWithReplaceDays(t){const e=this.getFromMask(t.parent.mask,t.parent.displayValue,"MM"),s=this.getFromMask(t.parent.mask,t.parent.displayValue,"YYYY"),i=this.getFromMask(t.parent.mask,t.parent.displayValue,"DD");let a=i;return e&&(e==2&&(!s||s&&s%4==0)?a=29:e==2&&s&&s.toString().length==4&&s%4!=0?a=28:[1,3,5,7,8,10,12].includes(e)?a=31:a=30,a<i&&this.nextTick(()=>{this.selectInput&&(this.selectInput.value=this.replaceInMask(t.parent.mask,t.parent.displayValue,a.toString(),"DD"),this.selectInput.blur(),this.nextTick(()=>{this.selectInput?.focus()}))})),!0}_isOnlyValueCopied=!1;_copyValueToClipboard(){this.value&&$VST.copyToClipboard(this.value),this._isOnlyValueCopied=!0,setTimeout(()=>this._isOnlyValueCopied=!1,500)}_canIncrementComputed(){if(!this._asNum||this.disabled)return!1;const t=parseFloat(this.value);return!this.max||t<this.max}_canDecrementComputed(){if(!this._asNum||this.disabled)return!1;const t=parseFloat(this.value);return!this.min||t>this.min}_valueComputed(){return["date","datetime","datetimeSec"].includes(this.maskPreset??"")}},p(R,"StringField"),R);k([C(String)],m.prototype,"maskPreset",2);k([C(Boolean)],m.prototype,"force12hours",2);k([C(Boolean)],m.prototype,"alwaysCopyIcon",2);k([C(Boolean)],m.prototype,"disabled",2);k([C(Boolean,Number)],m.prototype,"asNumber",2);k([C(String)],m.prototype,"radix",2);k([C(String)],m.prototype,"mask",2);k([C(Array)],m.prototype,"mapToRadix",2);k([C(String)],m.prototype,"dtPresetLocale",2);k([C(String)],m.prototype,"thousandsSeparator",2);k([C(Number)],m.prototype,"step",2);k([C(Number)],m.prototype,"min",2);k([C(Number)],m.prototype,"max",2);k([C(String)],m.prototype,"placeholder",2);k([ft("canIncrement")],m.prototype,"_canIncrementComputed",1);k([ft("canDecrement")],m.prototype,"_canDecrementComputed",1);k([ft("isDateTime")],m.prototype,"_valueComputed",1);m=k([Nt],m);const ee={class:"relative w100%"},se=["value","disabled","placeholder","prepare","autocomplete"],ie={key:0,class:"w22px h22px text-stone absolute t-11px l-12px z4 cursor-pointer hover:scale-130"};function ae(r,t,e,s,i,a){const n=st("ClipboardDocumentListIcon"),u=st("CheckBadgeIcon"),h=st("NoSymbolIcon");return A(),b("div",{class:it(["d-inline-block my2px w100% relative",{["sf"+r._randKey]:!0}])},[x("div",ee,[x("input",{class:it(["w100% inputMask",{"hover:bg-white":!r.disabled,"user-select-none!":r.disabled}]),value:r.value,disabled:r.disabled,placeholder:r.placeholder,prepare:r._prepareIMask,ref:r._setupIMask,onInput:t[0]||(t[0]=l=>r._iMaskInput(l)),onKeypress:t[1]||(t[1]=Pt(l=>r.$emit("keypress.enter"),["enter"])),autocomplete:r.maskPreset=="email"?"email":"off",onsubmit:"return false",autocorrect:"off",autocapitalize:"off"},null,42,se),r.maskPreset=="datetime"||r.maskPreset=="datetimeSec"?(A(),b("div",{key:0,class:"absolute! r-15px! t-2 fs-0.7rem text-stone-500 hover:scale-110 hover:fw-bold",style:Ut({pointerEvents:r.disabled?"none !important":void 0})},at(r.utc),5)):Y("",!0)]),(r.disabled||r.alwaysCopyIcon)&&r.value?.toString?.()?.trim?.()?(A(),b("div",ie,[r._isOnlyValueCopied?(A(),K(u,{key:1,class:"text-emerald-500"})):(A(),K(n,{key:0,onClick:t[2]||(t[2]=l=>r._copyValueToClipboard())}))])):Y("",!0),!r.disabled&&(r.value||r._preResetValue)?(A(),b("div",{key:1,class:it(["w25px h25px text-stone absolute r-12px z4 cursor-pointer hover:scale-130",{"t-15px":r.maskPreset=="datetime"||r.maskPreset=="datetimeSec","t-9px":r.maskPreset!="datetime"&&r.maskPreset!="datetimeSec"}])},[r._preResetValue?(A(),b("svg",{key:0,class:"icon icon-tabler icons-tabler-outline icon-tabler-arrow-back-up text-teal-500",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",onClick:t[3]||(t[3]=(...l)=>r.restore&&r.restore(...l))},[...t[5]||(t[5]=[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),x("path",{d:"M9 14l-4 -4l4 -4"},null,-1),x("path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"},null,-1)])])):(A(),K(h,{key:1,onClick:t[4]||(t[4]=l=>r._onReset())}))],2)):Y("",!0),(r.disabled||r.alwaysCopyIcon)&&r.value?.toString?.()?.trim?.()?(A(),K(Kt("style"),{key:2},{default:$t(()=>[Yt(".sf"+at(r._randKey)+"["+at(r.$options.__scopeId)+"] input { padding-left: 40px !important; }",1)]),_:1})):Y("",!0)],2)}p(ae,"render");const le=jt(m,[["render",ae],["__scopeId","data-v-ce56a62a"]]);export{le as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
input[data-v-ce56a62a]{width:100%!important;min-height:44px;border-radius:1.5rem;padding-left:25px;padding-right:35px;border-width:1px!important;border-style:solid;border-color:#c1c7cf;font-size:1rem;outline-width:1px;--un-outline-color-opacity:1;outline-color:rgb(168 162 158 / var(--un-outline-color-opacity));background-color:#fff}input[data-v-ce56a62a]:focus{background-color:#fff}input[disabled][data-v-ce56a62a]{--un-bg-opacity:1;background-color:rgb(231 229 228 / var(--un-bg-opacity));--un-text-opacity:1 !important;color:rgb(120 113 108 / var(--un-text-opacity))!important}input[data-v-ce56a62a]::placeholder{color:#c1c7cf!important;font-size:1rem}input[disabled][data-v-ce56a62a]::placeholder{--un-bg-opacity:1;background-color:rgb(231 229 228 / var(--un-bg-opacity));--un-text-opacity:1 !important;color:rgb(168 162 158 / var(--un-text-opacity))!important;opacity:.8}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var V=Object.defineProperty;var f=(e,l)=>V(e,"name",{value:l,configurable:!0});import{P as d,W as c,V as $,c as p,o as s,i as u,e as m,f as w,n as g,a as r,k as T,l as I,v as C,h as S,t as a,j as k,b as B}from"./main-BGO0apQg.js";import{F as N}from"./FieldComponent.vue_vue_type_script_lang-GFnG0VWx.js";var W=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,t=f((e,l,v,h)=>{for(var n=h>1?void 0:h?Y(l,v):l,y=e.length-1,i;y>=0;y--)(i=e[y])&&(n=(h?i(l,v,n):i(n))||n);return h&&n&&W(l,v,n),n},"__decorateClass"),b;let o=(b=class extends N{disabled=!1;bg="linear-gradient(330deg, #0aa86d 0%, #4eb18d 50%, #0ca86e 100%)";bgInactive="#a1a1a1";title=null;titleTheme="info";bgTogglerY="#3db37e";bgTogglerN="#FF3A19";titleTogglerY="Active";titleTogglerN="Inactive";togglerWidth="100px";togglerWidthActive="100px";togglerRevertColors=null;boxShadow="0 0 2px #1ca95e";disabledTitle="Disabled";disabledTitleTheme="grey";boxShadowHover="0 0 2px #9eeda8";labelColor="#fff";labelBoxShadow="0 0 4px #a4a4a4";type="switcher";modelValue=!1;value=!1;beforeMount(){this.value=this.modelValue||this.inputValue,this.randomId=$VST.generateRandomKey(32)}emits=["update:modelValue","change"];onValueChange(){this.$emit("update:modelValue",this.value),this.$emit("change",this.value)}randomId="";_modelValueChanged(l){this.setValue(l)}},f(b,"SwitchField"),b);t([d(Boolean)],o.prototype,"disabled",2);t([d(String)],o.prototype,"bg",2);t([d(String)],o.prototype,"bgInactive",2);t([d(String)],o.prototype,"title",2);t([d(String)],o.prototype,"titleTheme",2);t([d(String)],o.prototype,"bgTogglerY",2);t([d(String)],o.prototype,"bgTogglerN",2);t([d(String)],o.prototype,"titleTogglerY",2);t([d(String)],o.prototype,"titleTogglerN",2);t([d(String)],o.prototype,"togglerWidth",2);t([d(String)],o.prototype,"togglerWidthActive",2);t([d(Boolean)],o.prototype,"togglerRevertColors",2);t([d(String)],o.prototype,"boxShadow",2);t([d(String)],o.prototype,"disabledTitle",2);t([d(String)],o.prototype,"disabledTitleTheme",2);t([d(String)],o.prototype,"boxShadowHover",2);t([d(String)],o.prototype,"labelColor",2);t([d(String)],o.prototype,"labelBoxShadow",2);t([d(String)],o.prototype,"type",2);t([d(Boolean,null)],o.prototype,"modelValue",2);t([c("modelValue",!0)],o.prototype,"_modelValueChanged",1);o=t([$],o);const A=["title","data-theme"],D={class:"switch_box"},F=["id","disabled"],P=["for"],L=["id","disabled"],R=["data-tg-off","data-tg-on","for"],O=["id","disabled"],U=["for"];function j(e,l,v,h,n,y){return s(),p("div",{class:g(["container-switch",{"min-w64px":e.type!="checkbox"}]),title:e.disabled?e.disabledTitle:e.title,"data-theme":e.disabled?e.disabledTitleTheme:e.titleTheme,"data-offset":"[-15, 15]"},[l[6]||(l[6]=u(" ",-1)),e.type=="switcher"?(s(),p("div",{key:0,class:g(["switch",e.disabled?"disabled":""])},[r("div",D,[r("div",{class:"cursor-pointer fs-1rem mb2px",onClick:l[0]||(l[0]=i=>e.disabled?null:e.value=!e.value)},[I(e.$slots,"default")]),T(r("input",{id:"switch-"+e.randomId,type:"checkbox","onUpdate:modelValue":l[1]||(l[1]=i=>e.value=i),disabled:e.disabled},null,8,F),[[C,e.value]]),r("label",{for:"switch-"+e.randomId,class:g({disabled:e.disabled})},null,10,P)])],2)):e.type=="toggler"?(s(),p("div",{key:1,class:g(["hybrid-checkbox",{["toggler-"+e.randomId]:!0}])},[T(r("input",{class:"tgl tgl-flip",id:"toggler-"+e.randomId,type:"checkbox","onUpdate:modelValue":l[2]||(l[2]=i=>e.value=i),disabled:e.disabled},null,8,L),[[C,e.value]]),r("label",{class:"tgl-btn","data-tg-off":e.titleTogglerN,"data-tg-on":e.titleTogglerY,for:"toggler-"+e.randomId},null,8,R)],2)):e.type=="checkbox"?(s(),p("div",{key:2,class:g(["typical-checkbox",{disabled:e.disabled}])},[r("span",null,[T(r("input",{type:"checkbox",id:"checkbox-"+e.randomId,"onUpdate:modelValue":l[3]||(l[3]=i=>e.value=i),disabled:e.disabled},null,8,O),[[C,e.value]]),r("label",{class:g(["check pb3px! w20px! p0!",{"bg-white":e.value,"mt3px!":!e.value}]),for:"checkbox-"+e.randomId},[(s(),p("svg",{class:g(["w20px",{"svg-unchecked bg-white":!e.value}]),width:"20px",height:"20px",viewBox:"0 0 18 18"},[...l[5]||(l[5]=[r("path",{d:"M1,9 L1,3.5 C1,2 2,1 3.5,1 L14.5,1 C16,1 17,2 17,3.5 L17,14.5 C17,16 16,17 14.5,17 L3.5,17 C2,17 1,16 1,14.5 L1,9 Z"},null,-1),r("polyline",{points:"1 9 7 14 15 4"},null,-1)])],2))],10,U)]),e.$slots.default?(s(),p("span",{key:0,class:g(["cursor-pointer fs-1rem mx15px my2px whitespace-nowrap",{"fw-bold underline underline-black":e.value}]),onClick:l[4]||(l[4]=i=>e.disabled?null:e.value=!e.value)},[I(e.$slots,"default")],2)):m("",!0)],2)):m("",!0),e.type=="toggler"?(s(),w(k("style"),{key:3},{default:S(()=>[u(".toggler-"+a(e.randomId)+" .tgl-flip + .tgl-btn { perspective: "+a(e.value?e.togglerWidthActive:e.togglerWidth)+" !important; width: "+a(e.value?e.togglerWidthActive:e.togglerWidth)+" !important; } .toggler-"+a(e.randomId)+" .tgl-flip + .tgl-btn:before { background: "+a(e.togglerRevertColors?e.bgTogglerY:e.bgTogglerN)+" } .toggler-"+a(e.randomId)+" .tgl-flip:checked + .tgl-btn:after { background: "+a(e.togglerRevertColors?e.bgTogglerN:e.bgTogglerY)+" }",1)]),_:1})):m("",!0),e.type=="toggler"&&e.disabled?(s(),w(k("style"),{key:4},{default:S(()=>[u(".toggler-"+a(e.randomId)+" { opacity: 0.5 !important; }",1)]),_:1})):m("",!0),e.type=="checkbox"?(s(),w(k("style"),{key:5},{default:S(()=>[u("#checkbox-"+a(e.randomId)+" { display: none; visibility: hidden; } #checkbox-"+a(e.randomId)+" + label { box-sizing: content-box !important; }",1)]),_:1})):m("",!0),(s(),w(k("style"),null,{default:S(()=>[u('[for="switch-'+a(e.randomId)+'"]::before { background: '+a(e.bg)+"; box-shadow: "+a(e.boxShadow)+' !important; } [for="switch-'+a(e.randomId)+'"]:not(.disabled):hover { box-shadow: '+a(e.boxShadowHover)+'; } .switch_box [for="switch-'+a(e.randomId)+'"]::after { background: '+a(e.labelColor)+" !important; box-shadow: "+a(e.labelBoxShadow)+'; } .switch_box [for="switch-'+a(e.randomId)+'"] input { display: none !important; } .switch_box label[for="switch-'+a(e.randomId)+'"] { background: '+a(e.bgInactive)+" !important; }",1)]),_:1}))],10,A)}f(j,"render");const E=B(o,[["render",j]]);export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var C=Object.defineProperty;var o=(t,a)=>C(t,"name",{value:a,configurable:!0});import{
|
|
1
|
+
var C=Object.defineProperty;var o=(t,a)=>C(t,"name",{value:a,configurable:!0});import{N as f,V as k,c as s,o as r,a as g,M as l,O as b,e as _,n as $,l as v,t as y,k as m,I as w,b as B}from"./main-BGO0apQg.js";var D=Object.getOwnPropertyDescriptor,O=o((t,a,p,c)=>{for(var i=c>1?void 0:c?D(a,p):a,d=t.length-1,u;d>=0;d--)(u=t[d])&&(i=u(i)||i);return i},"__decorateClass"),n;let h=(n=class extends f{currentTab="default";CommentT=Comment;mounted(){}setCurrentTab(a){this.currentTab=a}getTabTitle(a){return a.props?.title||"Без названия"}},o(n,"Tabs"),n);h=O([k],h);const S={class:"tabs"},V={class:"tabs__headers"},N=["onClick"],W=["onClick"],I={key:0,class:"tabs__content"};function P(t,a,p,c,i,d){return r(),s("div",S,[g("div",V,[(r(!0),s(l,null,b(t.$slots,(u,e)=>(r(),s(l,null,[e.startsWith("$title-")?(r(),s("div",{key:0,class:$(["tabs__header",{"tabs__header--active":t.currentTab===e.split("-")[1]}]),onClick:o(T=>t.setCurrentTab(e.split("-")[1]),"onClick")},[v(t.$slots,e,{},void 0,!0)],10,N)):_("",!0)],64))),256)),(r(!0),s(l,null,b(t.$slots,(u,e)=>(r(),s(l,null,[!e.startsWith("$title")&&!t.$slots?.[`$title-${e}`]?(r(),s("div",{key:0,class:$(["tabs__header",{"tabs__header--active":t.currentTab===e}]),onClick:o(T=>t.setCurrentTab(e),"onClick")},y(e),11,W)):_("",!0)],64))),256))]),(r(!0),s(l,null,b(t.$slots,(u,e)=>(r(),s(l,null,[e.startsWith("$")?_("",!0):m((r(),s("div",I,[v(t.$slots,e,{},void 0,!0)],512)),[[w,t.currentTab==e]])],64))),256))])}o(P,"render");const E=B(h,[["render",P],["__scopeId","data-v-f8d3de0a"]]);export{E as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U0=Object.defineProperty;var a=(t,e)=>U0(t,"name",{value:e,configurable:!0});import{h as xf,j as ku,r as W0,D as K0,E as kf,F as J0,G as G0,H as wf,I as Z0,J as X0,e as Y0,T as Q0,K as em,L as tm,P as fs,W as nm,V as rm,k as vr,c as Is,o as Ar,m as dc,l as Rs,p as De,a as G,v as qe,n as at,x as Fs,s as im,z as om,M as sm,y as um,b as lm}from"./main-CjwB_FDy.js";import{F as am}from"./FieldComponent.vue_vue_type_script_lang-Bta9r3fM.js";import{g as cm}from"./_commonjsHelpers-CV2jkJYL.js";import{r as dm}from"./NoSymbolIcon-CkMqcao3.js";function se(t){this.content=t}a(se,"OrderedMap");se.prototype={constructor:se,find:a(function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},"find"),get:a(function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},"get"),update:a(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 se(o)},"update"),remove:a(function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},"remove"),addToStart:a(function(t,e){return new se([t,e].concat(this.remove(t).content))},"addToStart"),addToEnd:a(function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},"addToEnd"),addBefore:a(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 se(i)},"addBefore"),forEach:a(function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},"forEach"),prepend:a(function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},"prepend"),append:a(function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},"append"),subtract:a(function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},"subtract"),toObject:a(function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},"toObject"),get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function Cf(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=Cf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}a(Cf,"findDiffStart");function Ef(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),u=e.child(--o),l=s.nodeSize;if(s==u){n-=l,r-=l;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let c=0,d=Math.min(s.text.length,u.text.length);for(;c<d&&s.text[s.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let c=Ef(s.content,u.content,n-1,r-1);if(c)return c}n-=l,r-=l}}a(Ef,"findDiffEnd");const oe=class oe{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,u=0;u<n;s++){let l=this.content[s],c=u+l.nodeSize;if(c>e&&r(l,i+u,o||null,s)!==!1&&l.content.size){let d=u+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}u=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(u,l)=>{let c=u.isText?u.text.slice(Math.max(e,l)-l,n-l):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&c||u.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},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 oe(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 u=this.content[o],l=s+u.nodeSize;l>e&&((s<e||l>n)&&(u.isText?u=u.cut(Math.max(0,e-s),Math.min(u.text.length,n-s)):u=u.cut(Math.max(0,e-s-1),Math.min(u.content.size,n-s-1))),r.push(u),i+=u.nodeSize),s=l}return new oe(r,i)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(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 oe(i,o)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(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 Cf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ef(this,e,n,r)}findIndex(e){if(e==0)return Si(0,e);if(e==this.size)return Si(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?Si(n+1,o):Si(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.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 oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};a(oe,"Fragment");let A=oe;A.empty=new A([],0);const Ls={index:0,offset:0};function Si(t,e){return Ls.index=t,Ls.offset=e,Ls}a(Si,"retIndex");function Ui(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(!Ui(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ui(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}a(Ui,"compareDeep");var jt;let B=(jt=class{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&&Ui(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 jt.none;if(e instanceof jt)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}},a(jt,"Mark"),jt);B.none=[];const Ma=class Ma extends Error{};a(Ma,"ReplaceError");let sr=Ma;const _t=class _t{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=vf(this.content,e+this.openStart,n);return r&&new _t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new _t(Sf(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 _t.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 _t(A.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 _t(e,r,i)}};a(_t,"Slice");let M=_t;M.empty=new M(A.empty,0,0);function Sf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:u}=t.findIndex(n);if(i==e||o.isText){if(u!=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(Sf(o.content,e-i-1,n-i-1)))}a(Sf,"removeRange");function vf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=vf(s.content,e-o-1,n,s);return u&&t.replaceChild(i,s.copy(u))}a(vf,"insertInto");function fm(t,e,n){if(n.openStart>t.depth)throw new sr("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sr("Inconsistent open depths");return Af(t,e,n,0)}a(fm,"replace$1");function Af(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=Af(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,u=s.content;return mn(s,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:s,end:u}=hm(n,t);return mn(o,Tf(t,s,u,e,r))}else return mn(o,Wi(t,e,r))}a(Af,"replaceOuter");function Mf(t,e){if(!e.type.compatibleContent(t.type))throw new sr("Cannot join "+e.type.name+" onto "+t.type.name)}a(Mf,"checkJoin");function wu(t,e,n){let r=t.node(n);return Mf(r,e.node(n)),r}a(wu,"joinable$1");function pn(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)}a(pn,"addNode");function Ir(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&&(pn(t.nodeAfter,r),o++));for(let u=o;u<s;u++)pn(i.child(u),r);e&&e.depth==n&&e.textOffset&&pn(e.nodeBefore,r)}a(Ir,"addRange");function mn(t,e){return t.type.checkContent(e),t.copy(e)}a(mn,"close");function Tf(t,e,n,r,i){let o=t.depth>i&&wu(t,e,i+1),s=r.depth>i&&wu(n,r,i+1),u=[];return Ir(null,t,i,u),o&&s&&e.index(i)==n.index(i)?(Mf(o,s),pn(mn(o,Tf(t,e,n,r,i+1)),u)):(o&&pn(mn(o,Wi(t,e,i+1)),u),Ir(e,n,i,u),s&&pn(mn(s,Wi(n,r,i+1)),u)),Ir(r,null,i,u),new A(u)}a(Tf,"replaceThreeWay");function Wi(t,e,n){let r=[];if(Ir(null,t,n,r),t.depth>n){let i=wu(t,e,n+1);pn(mn(i,Wi(t,e,n+1)),r)}return Ir(e,null,n,r),new A(r)}a(Wi,"replaceTwoWay");function hm(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(A.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}a(hm,"prepareSliceForReplace");const qr=class qr{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 B.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let u=r;r=i,i=u}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 ur(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:u,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,u,i+l),!c||(s=s.child(u),s.isText))break;o=c-1,i+=l+1}return new qr(n,r,o)}static resolveCached(e,n){let r=fc.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 fc.set(e,r=new Cu);let i=r.elts[r.i]=qr.resolve(e,n);return r.i=(r.i+1)%pm,i}};a(qr,"ResolvedPos");let Ki=qr;const Ta=class Ta{constructor(){this.elts=[],this.i=0}};a(Ta,"ResolveCache");let Cu=Ta;const pm=12,fc=new WeakMap,Da=class Da{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)}};a(Da,"NodeRange");let ur=Da;const mm=Object.create(null);var qt;let zt=(qt=class{constructor(e,n,r,i=B.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||A.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&&Ui(this.attrs,n||e.defaultAttrs||mm)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new qt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qt(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 M.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),u=i.start(s),c=i.node(s).content.cut(i.pos-u,o.pos-u);return new M(c,i.depth-s,o.depth-s)}replace(e,n,r){return fm(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 Ki.resolveCached(this,e)}resolveNoCache(e){return Ki.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()+")"),Df(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=A.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),u=s&&s.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let 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=B.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(!B.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=A.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}},a(qt,"Node"),qt);zt.prototype.text=void 0;const Ur=class Ur extends zt{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):Df(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 Ur(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ur(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}};a(Ur,"TextNode");let Eu=Ur;function Df(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}a(Df,"wrapMarks");const es=class es{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Su(e,n);if(r.next==null)return es.empty;let i=Of(r);r.next&&r.err("Unexpected trailing text");let o=Cm(wm(i));return Em(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,u){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return A.from(u.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:f}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,u.concat(d));if(p)return p}}return null}return a(o,"search"),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 u=i;u.type;u=u.via)s.push(u.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:u,next:l}=o.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||l.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.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 a(n,"scan"),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(`
|
|
1
|
+
var U0=Object.defineProperty;var a=(t,e)=>U0(t,"name",{value:e,configurable:!0});import{m as xf,p as ku,q as W0,s as K0,u as kf,x as J0,y as G0,z as wf,A as Z0,B as X0,D as Y0,T as Q0,E as em,F as tm,P as fs,W as nm,V as rm,r as vr,c as Is,o as Ar,f as dc,e as Rs,G as De,a as G,h as qe,n as at,i as Fs,g as im,k as om,H as sm,j as um,b as lm}from"./main-BGO0apQg.js";import{F as am}from"./FieldComponent.vue_vue_type_script_lang-GFnG0VWx.js";import{g as cm}from"./_commonjsHelpers-CV2jkJYL.js";import{r as dm}from"./NoSymbolIcon-Dq590q9t.js";function se(t){this.content=t}a(se,"OrderedMap");se.prototype={constructor:se,find:a(function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},"find"),get:a(function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},"get"),update:a(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 se(o)},"update"),remove:a(function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},"remove"),addToStart:a(function(t,e){return new se([t,e].concat(this.remove(t).content))},"addToStart"),addToEnd:a(function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},"addToEnd"),addBefore:a(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 se(i)},"addBefore"),forEach:a(function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},"forEach"),prepend:a(function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},"prepend"),append:a(function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},"append"),subtract:a(function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},"subtract"),toObject:a(function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},"toObject"),get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function Cf(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=Cf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}a(Cf,"findDiffStart");function Ef(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),u=e.child(--o),l=s.nodeSize;if(s==u){n-=l,r-=l;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let c=0,d=Math.min(s.text.length,u.text.length);for(;c<d&&s.text[s.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let c=Ef(s.content,u.content,n-1,r-1);if(c)return c}n-=l,r-=l}}a(Ef,"findDiffEnd");const oe=class oe{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,u=0;u<n;s++){let l=this.content[s],c=u+l.nodeSize;if(c>e&&r(l,i+u,o||null,s)!==!1&&l.content.size){let d=u+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}u=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(u,l)=>{let c=u.isText?u.text.slice(Math.max(e,l)-l,n-l):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&c||u.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},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 oe(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 u=this.content[o],l=s+u.nodeSize;l>e&&((s<e||l>n)&&(u.isText?u=u.cut(Math.max(0,e-s),Math.min(u.text.length,n-s)):u=u.cut(Math.max(0,e-s-1),Math.min(u.content.size,n-s-1))),r.push(u),i+=u.nodeSize),s=l}return new oe(r,i)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(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 oe(i,o)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(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 Cf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ef(this,e,n,r)}findIndex(e){if(e==0)return Si(0,e);if(e==this.size)return Si(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?Si(n+1,o):Si(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.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 oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};a(oe,"Fragment");let A=oe;A.empty=new A([],0);const Ls={index:0,offset:0};function Si(t,e){return Ls.index=t,Ls.offset=e,Ls}a(Si,"retIndex");function Ui(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(!Ui(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ui(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}a(Ui,"compareDeep");var jt;let B=(jt=class{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&&Ui(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 jt.none;if(e instanceof jt)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}},a(jt,"Mark"),jt);B.none=[];const Ma=class Ma extends Error{};a(Ma,"ReplaceError");let sr=Ma;const _t=class _t{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=vf(this.content,e+this.openStart,n);return r&&new _t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new _t(Sf(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 _t.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 _t(A.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 _t(e,r,i)}};a(_t,"Slice");let M=_t;M.empty=new M(A.empty,0,0);function Sf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:u}=t.findIndex(n);if(i==e||o.isText){if(u!=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(Sf(o.content,e-i-1,n-i-1)))}a(Sf,"removeRange");function vf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=vf(s.content,e-o-1,n,s);return u&&t.replaceChild(i,s.copy(u))}a(vf,"insertInto");function fm(t,e,n){if(n.openStart>t.depth)throw new sr("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sr("Inconsistent open depths");return Af(t,e,n,0)}a(fm,"replace$1");function Af(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=Af(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,u=s.content;return mn(s,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:s,end:u}=hm(n,t);return mn(o,Tf(t,s,u,e,r))}else return mn(o,Wi(t,e,r))}a(Af,"replaceOuter");function Mf(t,e){if(!e.type.compatibleContent(t.type))throw new sr("Cannot join "+e.type.name+" onto "+t.type.name)}a(Mf,"checkJoin");function wu(t,e,n){let r=t.node(n);return Mf(r,e.node(n)),r}a(wu,"joinable$1");function pn(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)}a(pn,"addNode");function Ir(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&&(pn(t.nodeAfter,r),o++));for(let u=o;u<s;u++)pn(i.child(u),r);e&&e.depth==n&&e.textOffset&&pn(e.nodeBefore,r)}a(Ir,"addRange");function mn(t,e){return t.type.checkContent(e),t.copy(e)}a(mn,"close");function Tf(t,e,n,r,i){let o=t.depth>i&&wu(t,e,i+1),s=r.depth>i&&wu(n,r,i+1),u=[];return Ir(null,t,i,u),o&&s&&e.index(i)==n.index(i)?(Mf(o,s),pn(mn(o,Tf(t,e,n,r,i+1)),u)):(o&&pn(mn(o,Wi(t,e,i+1)),u),Ir(e,n,i,u),s&&pn(mn(s,Wi(n,r,i+1)),u)),Ir(r,null,i,u),new A(u)}a(Tf,"replaceThreeWay");function Wi(t,e,n){let r=[];if(Ir(null,t,n,r),t.depth>n){let i=wu(t,e,n+1);pn(mn(i,Wi(t,e,n+1)),r)}return Ir(e,null,n,r),new A(r)}a(Wi,"replaceTwoWay");function hm(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(A.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}a(hm,"prepareSliceForReplace");const qr=class qr{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 B.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let u=r;r=i,i=u}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 ur(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:u,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,u,i+l),!c||(s=s.child(u),s.isText))break;o=c-1,i+=l+1}return new qr(n,r,o)}static resolveCached(e,n){let r=fc.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 fc.set(e,r=new Cu);let i=r.elts[r.i]=qr.resolve(e,n);return r.i=(r.i+1)%pm,i}};a(qr,"ResolvedPos");let Ki=qr;const Ta=class Ta{constructor(){this.elts=[],this.i=0}};a(Ta,"ResolveCache");let Cu=Ta;const pm=12,fc=new WeakMap,Da=class Da{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)}};a(Da,"NodeRange");let ur=Da;const mm=Object.create(null);var qt;let zt=(qt=class{constructor(e,n,r,i=B.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||A.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&&Ui(this.attrs,n||e.defaultAttrs||mm)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new qt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qt(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 M.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),u=i.start(s),c=i.node(s).content.cut(i.pos-u,o.pos-u);return new M(c,i.depth-s,o.depth-s)}replace(e,n,r){return fm(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 Ki.resolveCached(this,e)}resolveNoCache(e){return Ki.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()+")"),Df(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=A.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),u=s&&s.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let 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=B.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(!B.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=A.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}},a(qt,"Node"),qt);zt.prototype.text=void 0;const Ur=class Ur extends zt{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):Df(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 Ur(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ur(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}};a(Ur,"TextNode");let Eu=Ur;function Df(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}a(Df,"wrapMarks");const es=class es{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Su(e,n);if(r.next==null)return es.empty;let i=Of(r);r.next&&r.err("Unexpected trailing text");let o=Cm(wm(i));return Em(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,u){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return A.from(u.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:f}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,u.concat(d));if(p)return p}}return null}return a(o,"search"),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 u=i;u.type;u=u.via)s.push(u.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:u,next:l}=o.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||l.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.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 a(n,"scan"),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(`
|
|
2
2
|
`)}};a(es,"ContentMatch");let vn=es;vn.empty=new vn(!0);const Oa=class Oa{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+"')")}};a(Oa,"TokenStream");let Su=Oa;function Of(t){let e=[];do e.push(gm(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}a(Of,"parseExpr");function gm(t){let e=[];do e.push(bm(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}a(gm,"parseExprSeq");function bm(t){let e=km(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=ym(t,e);else break;return e}a(bm,"parseExprSubscript");function hc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}a(hc,"parseNum");function ym(t,e){let n=hc(t),r=n;return t.eat(",")&&(t.next!="}"?r=hc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}a(ym,"parseExprRange");function xm(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}a(xm,"resolveName");function km(t){if(t.eat("(")){let e=Of(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=xm(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}}}a(km,"parseExprAtom");function wm(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}a(n,"node");function r(s,u,l){let c={term:l,to:u};return e[s].push(c),c}a(r,"edge");function i(s,u){s.forEach(l=>l.to=u)}a(i,"connect");function o(s,u){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,u)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],u);if(l==s.exprs.length-1)return c;i(c,u=n())}else if(s.type=="star"){let l=n();return r(u,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,u),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(u)].concat(o(s.expr,u));if(s.type=="range"){let l=u;for(let c=0;c<s.min;c++){let d=n();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=n();r(l,d),i(o(s.expr,l),d),l=d}return[r(l)]}else{if(s.type=="name")return[r(u,void 0,s.value)];throw new Error("Unknown expr type")}}}a(o,"compile")}a(wm,"nfa");function _f(t,e){return e-t}a(_f,"cmp");function pc(t,e){let n=[];return r(e),n.sort(_f);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:u,to:l}=o[s];!u&&n.indexOf(l)==-1&&r(l)}}a(r,"scan")}a(pc,"nullFrom");function Cm(t){let e=Object.create(null);return n(pc(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:u,to:l})=>{if(!u)return;let c;for(let d=0;d<i.length;d++)i[d][0]==u&&(c=i[d][1]);pc(t,l).forEach(d=>{c||i.push([u,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[r.join(",")]=new vn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let u=i[s][1].sort(_f);o.next.push({type:i[s][0],next:e[u.join(",")]||n(u)})}return o}}a(Cm,"dfa");function Em(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let u=0;u<i.next.length;u++){let{type:l,next:c}=i.next[u];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}a(Em,"checkForDeadEnds");function Nf(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}a(Nf,"defaultAttrs");function If(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}a(If,"computeAttrs");function Rf(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])}}a(Rf,"checkAttrs");function Ff(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new vu(t,r,e[r]);return n}a(Ff,"initAttrs");var kn;let mc=(kn=class{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=Ff(e,r.attrs),this.defaultAttrs=Nf(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==vn.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:If(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zt(this,this.computeAttrs(e),A.from(n),B.setFrom(r))}createChecked(e=null,n,r){return n=A.from(n),this.checkContent(n),new zt(this,this.computeAttrs(e),n,B.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=A.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(A.empty,!0);return o?new zt(this,e,n.append(o),B.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){Rf(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:B.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new kn(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}},a(kn,"NodeType"),kn);function Sm(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}`)}}a(Sm,"validateType");const _a=class _a{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Sm(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};a(_a,"Attribute");let vu=_a;const ts=class ts{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Ff(e,i.attrs),this.excluded=null;let o=Nf(this.attrs);this.instance=o?new B(this,o):null}create(e=null){return!e&&this.instance?this.instance:new B(this,If(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ts(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){Rf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}};a(ts,"MarkType");let Ji=ts;const Na=class Na{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=se.from(e.nodes),n.marks=se.from(e.marks||{}),this.nodes=mc.compile(this.spec.nodes,this),this.marks=Ji.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||"",u=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=vn.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=u=="_"?null:u?gc(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:gc(this,s.split(" "))}this.nodeFromJSON=i=>zt.fromJSON(this,i),this.markFromJSON=i=>B.fromJSON(this,i),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 mc){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 Eu(r,r.defaultAttrs,e,B.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};a(Na,"Schema");let Yr=Na;function gc(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 u in t.marks){let l=t.marks[u];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}a(gc,"gatherMarks");function vm(t){return t.tag!=null}a(vm,"isTagRule");function Am(t){return t.style!=null}a(Am,"isStyleRule");const Wr=class Wr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(vm(i))this.tags.push(i);else if(Am(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 Gi(this,n,!1);return r.addAll(e,B.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Gi(this,n,!0);return r.addAll(e,B.none,n.from,n.to),M.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(Dm(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],u=s.style;if(!(u.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||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 u=n[s];if((u.priority==null?50:u.priority)<o)break}n.splice(s,0,i)}a(r,"insert");for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=yc(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=yc(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Wr(e,Wr.schemaRules(e)))}};a(Wr,"DOMParser");let $t=Wr;const Lf={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},Mm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Pf={ol:!0,ul:!0},Qr=1,Au=2,Rr=4;function bc(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?Au:0):t&&t.whitespace=="pre"?Qr|Au:n&~Rr}a(bc,"wsOptionsFor");const Ia=class Ia{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=B.none,this.match=o||(s&Rr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(A.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=A.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(A.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&&!Lf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};a(Ia,"NodeContext");let Pn=Ia;const Ra=class Ra{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=bc(null,n.preserveWhitespace,0)|(r?Rr:0);i?o=new Pn(i.type,i.attrs,B.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Pn(null,null,B.none,!0,null,s):o=new Pn(e.schema.topNodeType,null,B.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&Au?"full":this.localPreserveWS||(i.options&Qr)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let u=r.split(/\r?\n|\r/);for(let l=0;l<u.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),u[l]&&this.insertNode(s.text(u[l]),n,!/\S/.test(u[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let u=i.content[i.content.length-1],l=e.previousSibling;(!u||l&&l.nodeName=="BR"||u.isText&&/[ \t\r\n\u000c]$/.test(u.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),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(),u;Pf.hasOwnProperty(s)&&this.parser.normalizeLists&&Tm(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Mm.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(Lf.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?u:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}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 u=void 0;;){let l=this.parser.matchStyle(o,s,this,u);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)u=l;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,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let u=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(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(u)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];s!=u;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,r){let i,o;for(let s=this.open,u=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+u)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;u+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=B.none;for(let u of i.concat(e.marks))(o.type?o.type.allowsMarkType(u.type):xc(u.type,e.type))&&(s=u.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);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 u=bc(e,o,s.options);s.options&Rr&&s.content.length==0&&(u|=Rr);let l=B.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):xc(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Pn(e,n,l,i,null,u)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=a((u,l)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;l>=o;l--)if(s(u-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0},"match");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}}};a(Ra,"ParseContext");let Gi=Ra;function Tm(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Pf.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}a(Tm,"normalizeList");function Dm(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}a(Dm,"matches");function yc(t){let e={};for(let n in t)e[n]=t[n];return e}a(yc,"copy");function xc(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(u=>{o.push(u);for(let l=0;l<u.edgeCount;l++){let{type:c,next:d}=u.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return!0}},"scan");if(s(i.contentMatch))return!0}}a(xc,"markMayApply");const ns=class ns{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ps(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let u=0,l=0;for(;u<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,l++}for(;u<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=zi(Ps(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&&zi(Ps(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return zi(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ns(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=kc(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return kc(e.marks)}};a(ns,"DOMSerializer");let An=ns;function kc(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}a(kc,"gatherToDOM");function Ps(t){return t.document||window.document}a(Ps,"doc$1");const wc=new WeakMap;function Om(t){let e=wc.get(t);return e===void 0&&wc.set(t,e=_m(t)),e}a(Om,"suspiciousAttributes");function _m(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 a(n,"scan"),n(t),e}a(_m,"suspiciousAttributesInner");function zi(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=Om(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 u,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=zi(t,p,n,r);if(l.appendChild(h),m){if(u)throw new RangeError("Multiple content holes");u=m}}}return{dom:l,contentDOM:u}}a(zi,"renderSpec");const Bf=65535,zf=Math.pow(2,16);function Nm(t,e){return t+e*zf}a(Nm,"makeRecover");function Cc(t){return t&Bf}a(Cc,"recoverIndex");function Im(t){return(t-(t&Bf))/zf}a(Im,"recoverOffset");const $f=1,Hf=2,$i=4,Vf=8,Fa=class Fa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Vf)>0}get deletedBefore(){return(this.delInfo&($f|$i))>0}get deletedAfter(){return(this.delInfo&(Hf|$i))>0}get deletedAcross(){return(this.delInfo&$i)>0}};a(Fa,"MapResult");let ei=Fa;const Nt=class Nt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Nt.empty)return Nt.empty}recover(e){let n=0,r=Cc(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+Im(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 u=0;u<this.ranges.length;u+=3){let l=this.ranges[u]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[u+o],d=this.ranges[u+s],f=l+c;if(e<=f){let p=c?e==l?-1:e==f?1:n:n,h=l+i+(p<0?0:d);if(r)return h;let m=e==(n<0?l:f)?null:Nm(u/3,e-l),g=e==l?Hf:e==f?$f:$i;return(n<0?e!=l:e!=f)&&(g|=Vf),new ei(h,g,m)}i+=d-c}return r?e+i:new ei(e+i,0,null)}touches(e,n){let r=0,i=Cc(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let l=this.ranges[u]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[u+o],d=l+c;if(e<=d&&u==i*3)return!0;r+=this.ranges[u+s]-c}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],u=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];e(u,u+c,l,l+d),o+=d-c}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}};a(Nt,"StepMap");let wt=Nt;wt.empty=new wt([]);const Kr=class Kr{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Kr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),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 Kr;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],u=s.mapResult(e,n);if(u.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new ei(e,i,null)}};a(Kr,"Mapping");let Zi=Kr;const Bs=Object.create(null),La=class La{getMap(){return wt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Bs[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 Bs)throw new RangeError("Duplicate use of step JSON ID "+e);return Bs[e]=n,n.prototype.jsonID=e,n}};a(La,"Step");let ie=La;const tn=class tn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new tn(e,null)}static fail(e){return new tn(null,e)}static fromReplace(e,n,r,i){try{return tn.ok(e.replace(n,r,i))}catch(o){if(o instanceof sr)return tn.fail(o.message);throw o}}};a(tn,"StepResult");let ae=tn;function Sl(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Sl(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return A.fromArray(r)}a(Sl,"mapFragment");const nn=class nn extends ie{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 M(Sl(n.content,(s,u)=>!s.isAtom||!u.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return ae.fromReplace(e,this.from,this.to,o)}invert(){return new Ut(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 nn(n.pos,r.pos,this.mark)}merge(e){return e instanceof nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nn(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 nn(n.from,n.to,e.markFromJSON(n.mark))}};a(nn,"AddMarkStep");let ti=nn;ie.jsonID("addMark",ti);const rn=class rn extends ie{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 M(Sl(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ae.fromReplace(e,this.from,this.to,r)}invert(){return new ti(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 rn(n.pos,r.pos,this.mark)}merge(e){return e instanceof rn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rn(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 rn(n.from,n.to,e.markFromJSON(n.mark))}};a(rn,"RemoveMarkStep");let Ut=rn;ie.jsonID("removeMark",Ut);const on=class on extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new M(A.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 on(this.pos,n.marks[i]);return new on(this.pos,this.mark)}}return new lr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new on(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 on(n.pos,e.markFromJSON(n.mark))}};a(on,"AddNodeMarkStep");let ni=on;ie.jsonID("addNodeMark",ni);const Jr=class Jr extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new M(A.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ni(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Jr(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 Jr(n.pos,e.markFromJSON(n.mark))}};a(Jr,"RemoveNodeMarkStep");let lr=Jr;ie.jsonID("removeNodeMark",lr);const mt=class mt extends ie{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Mu(e,this.from,this.to)?ae.fail("Structure replace would overwrite content"):ae.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wt([this.from,this.to-this.from,this.slice.size])}invert(e){return new mt(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 mt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof mt)||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?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new mt(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?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new mt(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 mt(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}};a(mt,"ReplaceStep");let Ae=mt;ie.jsonID("replace",Ae);const Bn=class Bn extends ie{constructor(e,n,r,i,o,s,u=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=u}apply(e){if(this.structure&&(Mu(e,this.from,this.gapFrom)||Mu(e,this.gapTo,this.to)))return ae.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ae.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ae.fromReplace(e,this.from,this.to,r):ae.fail("Content does not fit in gap")}getMap(){return new wt([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 Bn(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 Bn(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 Bn(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}};a(Bn,"ReplaceAroundStep");let he=Bn;ie.jsonID("replaceAround",he);function Mu(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}a(Mu,"contentBetween");function Rm(t,e,n,r){let i=[],o=[],s,u;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let p=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==p&&s.mark.eq(f[g])?s.to=h:i.push(s=new Ut(p,h,f[g])));u&&u.to==p?u.to=h:o.push(u=new ti(p,h,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}a(Rm,"addMark");function Fm(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,u)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Ji){let c=s.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(u+s.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=c,p.step=o):i.push({style:f,from:Math.max(u,e),to:c,step:o})}}}),i.forEach(s=>t.step(new Ut(s.from,s.to,s.style)))}a(Fm,"removeMark");function vl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],u=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=u+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new Ae(u,d,M.empty));else{r=f;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Ut(u,d,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,m;for(;p=h.exec(c.text);)m||(m=new M(A.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Ae(u+p.index,u+p.index+p[0].length,m))}}u=d}if(!r.validEnd){let l=r.fillBefore(A.empty,!0);t.replace(u,u,new M(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}a(vl,"clearIncompatible");function Lm(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}a(Lm,"canCut");function wr(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||!Lm(i,o,s))break}return null}a(wr,"liftTarget");function Pm(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),u=i.after(o+1),l=s,c=u,d=A.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,d=A.from(r.node(m).copy(d)),f++):l--;let p=A.empty,h=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=A.from(i.node(m).copy(p)),h++):c++;t.step(new he(l,c,s,u,new M(d.append(p),f,h),d.size-f,!0))}a(Pm,"lift$2");function Al(t,e,n=null,r=t){let i=Bm(t,e),o=i&&zm(r,e);return o?i.map(Ec).concat({type:e,attrs:n}).concat(o.map(Ec)):null}a(Al,"findWrapping");function Ec(t){return{type:t,attrs:null}}a(Ec,"withAttrs");function Bm(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}a(Bm,"findWrappingOutside");function zm(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 l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}a(zm,"findWrappingInside");function $m(t,e,n){let r=A.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let u=n[s].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=A.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new he(i,o,i,o,new M(r,0,0),n.length,!0))}a($m,"wrap");function Hm(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,u)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&Vm(t.doc,t.mapping.slice(o).map(u),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&qf(t,s,u,o),vl(t,t.mapping.slice(o).map(u,1),r,void 0,c===null);let d=t.mapping.slice(o),f=d.map(u,1),p=d.map(u+s.nodeSize,1);return t.step(new he(f,p,f+1,p-1,new M(A.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&jf(t,s,u,o),!1}})}a(Hm,"setBlockType$1");function jf(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,u=/\r?\n|\r/g;for(;s=u.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}a(jf,"replaceNewlines");function qf(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(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/CodeHighlight-CwVuCJVt.js","static/main-BGO0apQg.js","static/main-CPQng82-.css","static/CodeHighlight-CGrGqjhz.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as e,_ as o}from"./main-BGO0apQg.js";const _=e(()=>o(()=>import("./CodeHighlight-CwVuCJVt.js"),__vite__mapDeps([0,1,2,3])));export{_ as default};
|