@zydon/common 1.1.34 → 1.1.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MaskedInput/index.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4GAmChB,CAAC;AAIF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MaskedInput/index.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4GA4BhB,CAAC;AAIF,eAAe,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-119d91cb.js";
1
+ import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-e9c71489.js";
2
2
  import Hn, { useContext as ie, useId as Pi, useEffect as Ti } from "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -5612,7 +5612,7 @@ const y6 = (t, e, n) => {
5612
5612
  ...r,
5613
5613
  children: n
5614
5614
  }
5615
- ), T6 = () => import("./features-1ed148bd.js").then((t) => t.default), C6 = ({ children: t }) => /* @__PURE__ */ O.jsx(s5, { strict: !0, features: T6, children: /* @__PURE__ */ O.jsxs(Dr.div, { style: { height: "100%" }, children: [
5615
+ ), T6 = () => import("./features-5f68ae75.js").then((t) => t.default), C6 = ({ children: t }) => /* @__PURE__ */ O.jsx(s5, { strict: !0, features: T6, children: /* @__PURE__ */ O.jsxs(Dr.div, { style: { height: "100%" }, children: [
5616
5616
  " ",
5617
5617
  t,
5618
5618
  " "
@@ -85590,11 +85590,7 @@ const i2 = sn(
85590
85590
  });
85591
85591
  return Ke(() => {
85592
85592
  c.current.value = e || "";
85593
- }, [c, e]), Ke(() => {
85594
- r({
85595
- target: { name: t, value: s || e || "" }
85596
- });
85597
- }, [t, s, e]), /* @__PURE__ */ O.jsx(
85593
+ }, [c, e]), /* @__PURE__ */ O.jsx(
85598
85594
  qa,
85599
85595
  {
85600
85596
  inputRef: a,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a1 as p, aC as u, aD as v, aF as c, aG as C, a2 as k, a3 as S, a4 as P, a5 as F, a6 as g, a7 as A, aH as T, aI as I, aJ as D, a8 as E, aV as M, a9 as h, aa as f, aK as B, ab as x, aX as w, aL as y, ac as N, aM as L, aY as R, ad as U, ae as G, af as H, ag as z, ah as V, ai as W, aN as q, bh as Q, aj as j, ak as J, al as K, a_ as O, a$ as Z, aZ as X, aE as Y, av as _, aw as $, ax as aa, am as sa, aO as ea, ao as oa, an as ra, aP as ta, ap as ia, aQ as na, aq as ba, ar as la, bi as da, bj as ma, as as pa, aR as ua, b0 as va, at as ca, aW as Ca, au as ka, aS as Sa, bk as Pa, ay as Fa, az as ga, aU as Aa, aA as Ta, aB as Ia, aT as Da, bl as Ea, bC as Ma, bm as ha, bz as fa, bA as Ba, bB as xa, bJ as wa, bH as ya, bG as Na, bD as La, bE as Ra, bo as Ua, bp as Ga, bq as Ha, br as za, bs as Va, bt as Wa, bu as qa, by as Qa, bv as ja, bn as Ja, bw as Ka, bx as Oa, bI as Za, bF as Xa, be as Ya, bf as _a, bg as $a, b7 as as, ba as ss, b2 as es, b4 as os, b9 as rs, b1 as ts, b8 as is, b6 as ns, b5 as bs, bc as ls, bd as ds, bb as ms, b3 as ps } from "./index-119d91cb.js";
1
+ import { a1 as p, aC as u, aD as v, aF as c, aG as C, a2 as k, a3 as S, a4 as P, a5 as F, a6 as g, a7 as A, aH as T, aI as I, aJ as D, a8 as E, aV as M, a9 as h, aa as f, aK as B, ab as x, aX as w, aL as y, ac as N, aM as L, aY as R, ad as U, ae as G, af as H, ag as z, ah as V, ai as W, aN as q, bh as Q, aj as j, ak as J, al as K, a_ as O, a$ as Z, aZ as X, aE as Y, av as _, aw as $, ax as aa, am as sa, aO as ea, ao as oa, an as ra, aP as ta, ap as ia, aQ as na, aq as ba, ar as la, bi as da, bj as ma, as as pa, aR as ua, b0 as va, at as ca, aW as Ca, au as ka, aS as Sa, bk as Pa, ay as Fa, az as ga, aU as Aa, aA as Ta, aB as Ia, aT as Da, bl as Ea, bC as Ma, bm as ha, bz as fa, bA as Ba, bB as xa, bJ as wa, bH as ya, bG as Na, bD as La, bE as Ra, bo as Ua, bp as Ga, bq as Ha, br as za, bs as Va, bt as Wa, bu as qa, by as Qa, bv as ja, bn as Ja, bw as Ka, bx as Oa, bI as Za, bF as Xa, be as Ya, bf as _a, bg as $a, b7 as as, ba as ss, b2 as es, b4 as os, b9 as rs, b1 as ts, b8 as is, b6 as ns, b5 as bs, bc as ls, bd as ds, bb as ms, b3 as ps } from "./index-e9c71489.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -301,7 +301,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=F,M=W),$===void 0&&(
301
301
  Prefix can't start with '-' when allowNegative is true.
302
302
  prefix: `+i+`
303
303
  allowNegative: `+a+`
304
- `),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function nSe(t){t=tSe(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,i=t.onKeyDown;i===void 0&&(i=Ji);var a=t.onBlur;a===void 0&&(a=Ji);var o=t.thousandSeparator,s=t.decimalScale,l=t.fixedDecimalScale,c=t.prefix;c===void 0&&(c="");var u=t.defaultValue,d=t.value,f=t.valueIsNumericString,p=t.onValueChange,h=RP(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=Nf(t),g=m.decimalSeparator,_=m.allowedDecimalSeparators,b=function(G){return FP(G,t)},S=function(G,F){return JEe(G,F,t)},v=As(d)?u:d,E=f??ZEe(v,c,e);As(d)?As(u)||(E=E||typeof u=="number"):E=E||typeof d=="number";var T=function(G){return AP(G)?G:(typeof G=="number"&&(G=DP(G)),E&&typeof s=="number"?MP(G,s,!!l):G)},y=LP(T(d),T(u),!!E,b,S,p),C=y[0],N=C.numAsString,A=C.formattedValue,O=y[1],w=function(G){var F=G.target,W=G.key,$=F.selectionStart,M=F.selectionEnd,I=F.value;if(I===void 0&&(I=""),$!==M){i(G);return}W==="Backspace"&&I[0]==="-"&&$===c.length+1&&n&&ja(F,1),s&&l&&(W==="Backspace"&&I[$-1]===g?(ja(F,$-1),G.preventDefault()):W==="Delete"&&I[$]===g&&G.preventDefault()),_!=null&&_.includes(W)&&I[$]===g&&ja(F,$+1);var L=o===!0?",":o;W==="Backspace"&&I[$-1]===L&&ja(F,$-1),W==="Delete"&&I[$]===L&&ja(F,$+1),i(G)},D=function(G){var F=N;if(F.match(/\d/g)||(F=""),r||(F=GEe(F)),l&&s&&(F=MP(F,s,l)),F!==N){var W=FP(F,t);O({formattedValue:W,value:F,floatValue:parseFloat(F)},{event:G,source:_c.event})}a(G)},k=function(G){return G===g?!0:bc(G)},P=function(G){var F=G.currentValue,W=G.lastValue,$=G.formattedValue,M=G.currentValueIndex,I=G.formattedValueIndex,L=F[M],U=$[I],Y=kP(W,F),V=Y.to;return M>=V.start&&M<V.end&&_&&_.includes(L)&&U===g?!0:L===U};return Object.assign(Object.assign({},h),{value:A,valueIsNumericString:!1,isValidInputCharacter:k,isCharacterSame:P,onValueChange:O,format:b,removeFormatting:S,getCaretBoundary:function(G){return eSe(G,t)},onKeyDown:w,onBlur:D})}function rSe(t){var e=nSe(t);return R.createElement(KEe,Object.assign({},e))}const YS=R.forwardRef(({decimalScale:t=0,fixedDecimalScale:e=!0,prefix:n,allowNegative:r,minValue:i,maxValue:a=1/0,maxLength:o,value:s,inputProps:l,InputProps:c,size:u,disabled:d,name:f,helperText:p,error:h,fullWidth:m,label:g,required:_,onChange:b},S)=>{const v=R.useRef(null),E=T=>{b&&(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{const{floatValue:y}=T,C=y||0;if(i!==void 0&&i>C){b({target:{name:f,value:i}});return}if(y!==void 0&&a<C){b({target:{name:f,value:a}});return}b({target:{name:f,value:y}})},600))};return R.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),x.jsx(rSe,{getInputRef:S,value:s,prefix:n,decimalSeparator:",",thousandSeparator:".",decimalScale:t,fixedDecimalScale:e,autoComplete:"off",allowNegative:r,maxLength:o,onValueChange:E,customInput:K.TextField,InputProps:{...c},inputProps:l,disabled:d,size:u,helperText:p,error:h,fullWidth:m,label:g,required:_})});YS.displayName="NumberInput";const BP=R.forwardRef(({name:t,increment:e=1,updadteForMultiple:n,allowNegative:r=!1,value:i=0,onChange:a,minValue:o,maxValue:s,decimalScale:l,disabled:c,...u},d)=>{const f=OP(i,e,l),p=()=>{if(!r&&i-e<0)return;const g=i-e,_=Math.floor(i/e)*e,b=!f&&n?_:g;o!==void 0&&g<o?a(o):a($S(b))},h=()=>{const g=Number(i)+e,_=Math.ceil(i/e)*e,S=$S(!f&&n?_:g);s!==void 0&&g>=s?a(s):a(o!==void 0&&S<=o?o:S)},m=g=>{const _=Number(g.target.value),b=Math.ceil(_/e)*e,S=n?b:_;if(o!==void 0&&_<=o){a(o);return}if(s!==void 0&&_>=s){a(s);return}a(S)};return x.jsx(YS,{ref:d,name:t,value:i,minValue:o,maxValue:s,allowNegative:r,decimalScale:l,InputProps:{startAdornment:x.jsx(K.InputAdornment,{position:"start",children:x.jsx(K.IconButton,{size:"medium",disabled:c||(r?!1:!i),onClick:p,children:x.jsx(Ct,{icon:"eva:minus-fill",width:14,height:14,color:"primary.main"})})}),endAdornment:x.jsx(K.InputAdornment,{position:"end",children:x.jsx(K.IconButton,{size:"medium",onClick:h,disabled:c,children:x.jsx(Ct,{icon:"eva:plus-fill",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},onChange:m,disabled:c,...u})});BP.displayName="Incrementer";const iSe=cn(K.Box)(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=e.variant==="filled",i=e.variant==="outlined",a=e.variant==="soft",o={...e.color==="default"&&{...i&&{backgroundColor:"transparent",color:t.palette.text.primary,border:`1px solid ${ye(t.palette.grey[500],.32)}`},...a&&{color:n?t.palette.text.primary:t.palette.common.white,backgroundColor:ye(t.palette.grey[500],.16)}}},s={...e.color!=="default"&&{...r&&{color:t.palette[e.color].contrastText,backgroundColor:t.palette[e.color].main},...i&&{backgroundColor:"transparent",color:t.palette[e.color].main,border:`1px solid ${t.palette[e.color].main}`},...a&&{color:t.palette[e.color][n?"dark":"light"],backgroundColor:ye(t.palette[e.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"none",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...o}}),UP=R.forwardRef(({children:t,color:e="default",variant:n="soft",startIcon:r,endIcon:i,sx:a,...o},s)=>{const l=xa(),c={width:16,height:16,"& svg, img":{width:1,height:1,objectFit:"cover"}};return x.jsxs(iSe,{ref:s,component:"span",ownerState:{color:e,variant:n},sx:{...r&&{pl:.75},...i&&{pr:.75},...a},theme:l,...o,children:[r&&x.jsxs(K.Box,{sx:{mr:.75,...c},children:[" ",r," "]}),t,i&&x.jsxs(K.Box,{sx:{ml:.75,...c},children:[" ",i," "]})]})});UP.displayName="Label";function ea(t){return typeof t=="string"||t instanceof String}function GP(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function $P(t,e){return Array.isArray(e)?$P(t,(n,r)=>e.includes(r)):Object.entries(t).reduce((n,r)=>{let[i,a]=r;return e(a,i)&&(n[i]=a),n},{})}const qe={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function aSe(t){switch(t){case qe.LEFT:return qe.FORCE_LEFT;case qe.RIGHT:return qe.FORCE_RIGHT;default:return t}}function HS(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function wf(t,e){if(e===t)return!0;const n=Array.isArray(e),r=Array.isArray(t);let i;if(n&&r){if(e.length!=t.length)return!1;for(i=0;i<e.length;i++)if(!wf(e[i],t[i]))return!1;return!0}if(n!=r)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const a=e instanceof Date,o=t instanceof Date;if(a&&o)return e.getTime()==t.getTime();if(a!=o)return!1;const s=e instanceof RegExp,l=t instanceof RegExp;if(s&&l)return e.toString()==t.toString();if(s!=l)return!1;const c=Object.keys(e);for(i=0;i<c.length;i++)if(!Object.prototype.hasOwnProperty.call(t,c[i]))return!1;for(i=0;i<c.length;i++)if(!wf(t[c[i]],e[c[i]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class oSe{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}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?qe.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?qe.RIGHT:qe.LEFT}}function Ke(t,e){return new Ke.InputMask(t,e)}function qP(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?Ke.MaskedRegExp:ea(t)?Ke.MaskedPattern:t===Date?Ke.MaskedDate:t===Number?Ke.MaskedNumber:Array.isArray(t)||t===Array?Ke.MaskedDynamic:Ke.Masked&&t.prototype instanceof Ke.Masked?t:Ke.Masked&&t instanceof Ke.Masked?t.constructor:t instanceof Function?Ke.MaskedFunction:(console.warn("Mask not found for mask",t),Ke.Masked)}function If(t){if(!t)throw new Error("Options in not defined");if(Ke.Masked){if(t.prototype instanceof Ke.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof Ke.Masked?{mask:t}:GP(t)&&t.mask instanceof Ke.Masked?t:{};if(e){const r=e.mask;return{...$P(e,(i,a)=>!a.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return GP(t)?{...t}:{mask:t}}function Ka(t){if(Ke.Masked&&t instanceof Ke.Masked)return t;const e=If(t),n=qP(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}Ke.createMask=Ka;class zS{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}Ke.MaskElement=zS;class Qa extends zS{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,r;return(e=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(Qa.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}Qa.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},Ke.HTMLMaskElement=Qa;class sSe extends Qa{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}Ke.HTMLMaskElement=Qa;class VP extends Qa{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Ke.HTMLContenteditableMaskElement=VP;class lSe{constructor(e,n){this.el=e instanceof zS?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new VP(e):new sSe(e),this.masked=Ka(n),this._listeners={},this._value="",this._unmaskedValue="",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.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof Ke.Masked)&&this.masked.constructor===qP(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof Ke.Masked?e:Ka({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}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})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const r=this._listeners[e];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),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}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,r=this.displayValue,i=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==r&&(this.el.value=r),i&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...r}=e,i=!this.maskEquals(n),a=!wf(this.masked,r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,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,qe.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(n);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new oSe({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:qe.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==qe.NONE&&(o=this.masked.nearestInputPos(o,qe.NONE)),this.updateControl(),this.updateCursor(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}Ke.InputMask=lSe;class Nt{static normalize(e){return Array.isArray(e)?e:[e,new Nt]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}Ke.ChangeDetails=Nt;class Oi{constructor(e,n,r){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class ir{constructor(e){this._value="",this._update({...ir.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new Oi(this.extractInput(e,n),e)}appendTail(e){return ea(e)&&(e=new Oi(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new Nt({inserted:e,rawInserted:e})):new Nt}_appendChar(e,n,r){n===void 0&&(n={});const i=this.state;let a;if([e,a]=this.doPrepareChar(e,n),a=a.aggregate(this._appendCharRaw(e,n)),a.inserted){let o,s=this.doValidate(n)!==!1;if(s&&r!=null){const l=this.state;this.overwrite===!0&&(o=r.state,r.unshift(this.displayValue.length-a.tailShift));let c=this.appendTail(r);s=c.rawInserted===r.toString(),!(s&&c.inserted)&&this.overwrite==="shift"&&(this.state=l,o=r.state,r.shift(),c=this.appendTail(r),s=c.rawInserted===r.toString()),s&&c.inserted&&(this.state=l)}s||(a=new Nt,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new Nt}_appendEager(){return new Nt}append(e,n,r){if(!ea(e))throw new Error("value should be string");const i=ea(r)?new Oi(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,n);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],n,i);if(!s.rawInserted&&!this.doSkipInvalid(e[o],n,i))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new Nt}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=e();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&this.append(r.slice(this.displayValue.length),{},""),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,r=e(this);return this.state=n,delete this._isolated,r}doSkipInvalid(e,n,r){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),Nt.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),Nt.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,r,i,a){i===void 0&&(i=qe.NONE),a===void 0&&(a={input:!0});const o=e+n,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(i=aSe(i),c=this.extractInput(0,o,{raw:!0}));let u=e;const d=new Nt;if(i!==qe.NONE&&(u=this.nearestInputPos(e,n>1&&e!==0&&!l?qe.NONE:i),d.tailShift=u-e),d.aggregate(this.remove(u)),l&&i!==qe.NONE&&c===this.rawInputValue)if(i===qe.FORCE_LEFT){let f;for(;c===this.rawInputValue&&(f=this.displayValue.length);)d.aggregate(new Nt({tailShift:-1})).aggregate(this.remove(f-1))}else i===qe.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(r,a,s))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||ir.EMPTY_VALUES.includes(e)&&ir.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}ir.DEFAULTS={skipInvalid:!0},ir.EMPTY_VALUES=[void 0,null,""],Ke.Masked=ir;class Xa{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ea(e)?new Oi(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof Oi)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof Xa){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Ke.MaskedPattern))return new Oi(this.toString()).appendTo(e);const n=new Nt;for(let r=0;r<this.chunks.length&&!n.skip;++r){const i=this.chunks[r],a=e._mapPosToBlock(e.displayValue.length),o=i.stop;let s;if(o!=null&&(!a||a.index<=o)){if(i instanceof Xa||e._stops.indexOf(o)>=0){const l=e._appendPlaceholder(o);n.aggregate(l)}s=i instanceof Xa&&e._blocks[o]}if(s){const l=s.appendTail(i);l.skip=!1,n.aggregate(l),e._value+=l.inserted;const c=i.toString().slice(l.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...r}=e;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new Xa:new Oi;return a.state=i,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],r=n.shift();if(n.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class cSe{constructor(e,n){this.masked=e,this._log=[];const{offset:r,index:i}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,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(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}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(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())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,qe.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,qe.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,qe.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,qe.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,qe.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,qe.NONE),!0})}}class YP{constructor(e){Object.assign(this,e),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(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new Nt}nearestInputPos(e,n){n===void 0&&(n=qe.NONE);const r=0,i=this._value.length;switch(n){case qe.LEFT:case qe.FORCE_LEFT:return r;case qe.NONE:case qe.RIGHT:case qe.FORCE_RIGHT:default:return i}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const r=new Nt;if(this.isFilled)return r;const i=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!i)&&!n.tail;return o&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new Nt;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Oi("")}appendTail(e){return ea(e)&&(e=new Oi(String(e))),e.appendTo(this)}append(e,n,r){const i=this._appendChar(e[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class Df{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s,...l}=e;this.masked=Ka(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new Nt}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(e,n){if(n===void 0&&(n={}),this.isFilled)return new Nt;const r=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i.inserted=i.rawInserted="",this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,n,r){return this.masked.append(e,this.currentMaskFlags(n),r)}_appendPlaceholder(){const e=new Nt;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new Nt}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,r)}nearestInputPos(e,n){n===void 0&&(n=qe.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(e,r),i);switch(n){case qe.LEFT:case qe.FORCE_LEFT:return this.isComplete?a:r;case qe.RIGHT:case qe.FORCE_RIGHT:return this.isComplete?a:i;case qe.NONE:default:return a}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||(e==null?void 0:e._beforeTailState)}}}Df.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]/,"*":/./};class uSe extends ir{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}Ke.MaskedRegExp=uSe;class ar extends ir{constructor(e){super({...ar.DEFAULTS,...e,definitions:Object.assign({},Df.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const c=n.slice(a),u=Object.keys(this.blocks).filter(f=>c.indexOf(f)===0);u.sort((f,p)=>p.length-f.length);const d=u[0];if(d){const{expose:f,...p}=If(this.blocks[d]),h=Ka({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...p,parent:this});h&&(this._blocks.push(h),f&&(this.exposeBlock=h),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),a+=d.length-1;continue}}let o=n[a],s=o in e;if(o===ar.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===ar.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}const l=s?new Df({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...If(e[o]),parent:this}):new YP({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...r}=e;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new Nt;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new Nt;if(!r)return i;for(let o=r.index;;++o){var a;const s=this._blocks[o];if(!s)break;const l=s._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]}),c=l.skip;if(i.aggregate(l),c||l.rawInserted)break}return i}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=new Xa;return e===n||this._forEachBlocksInRange(e,n,(i,a,o,s)=>{const l=i.extractTail(o,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof Xa&&(l.blockIndex=a),r.extend(l)}),r}extractInput(e,n,r){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),e===n)return"";let i="";return this._forEachBlocksInRange(e,n,(a,o,s,l)=>{i+=a.extractInput(s,l,r)}),i}_findStopBefore(e){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=e)n=i;else break}return n}_appendPlaceholder(e){const n=new Nt;if(this.lazy&&e==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=e??this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||e!=null){var s;const l=o._appendPlaceholder((s=o._blocks)==null?void 0:s.length);this._value+=l.inserted,n.aggregate(l)}}),n}_mapPosToBlock(e){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,e<=n.length)return{index:r,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(e,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,s=i.offset,l=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,s,l),a&&!o){for(let c=i.index+1;c<a.index;++c)r(this._blocks[c],c,0,this._blocks[c].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r.aggregate(i.remove(o,s))}),r}nearestInputPos(e,n){if(n===void 0&&(n=qe.NONE),!this._blocks.length)return 0;const r=new cSe(this,e);if(n===qe.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===qe.LEFT||n===qe.FORCE_LEFT){if(n===qe.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===qe.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:n===qe.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===qe.RIGHT||n===qe.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===qe.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,qe.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r+=i.totalInputPositions(o,s)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(r=>this._blocks[r]):[]}}ar.DEFAULTS={lazy:!0,placeholderChar:"_"},ar.STOP_CHAR="`",ar.ESCAPE_CHAR="\\",ar.InputDefinition=Df,ar.FixedDefinition=YP,Ke.MaskedPattern=ar;class Mf extends ar{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=e;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===s[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",r="";const[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(e,n){n===void 0&&(n={});let r;if([e,r]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,r];const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),o=this.value+e;if(o.length>this.maxLength)return["",r];const[s,l]=this.boundaries(o);return Number(l)<this.from?[i[o.length-1],r]:Number(s)>this.to?this.autofix==="pad"&&o.length<this.maxLength?["",r.aggregate(this.append(i[o.length-1]+e,n))]:[a[o.length-1],r]:[e,r]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(e)}}Ke.MaskedRange=Mf;class Za extends ar{constructor(e){const{mask:n,pattern:r,...i}={...Za.DEFAULTS,...e};super({...i,mask:ea(n)?n:r})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...a}={...Za.DEFAULTS,...e},o=Object.assign({},Za.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,i),Object.keys(o).forEach(s=>{const l=o[s];!("autofix"in l)&&"autofix"in e&&(l.autofix=e.autofix)}),super._update({...a,mask:ea(n)?n:r,blocks:o})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}Za.GET_DEFAULT_BLOCKS=()=>({d:{mask:Mf,from:1,to:31,maxLength:2},m:{mask:Mf,from:1,to:12,maxLength:2},Y:{mask:Mf,from:1900,to:9999}}),Za.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear();return[n,r,i].join(".")},parse:(t,e)=>{const[n,r,i]=t.split(".").map(Number);return new Date(i,r-1,n)}},Ke.MaskedDate=Za;class vc extends ir{constructor(e){super({...vc.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:r,...i}=If(n),a=Ka({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._applyDispatch(e,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),r}_applyDispatch(e,n,r){e===void 0&&(e=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,s=a.slice(o.length),l=this.currentMask,c=new Nt,u=l==null?void 0:l.state;if(this.currentMask=this.doDispatch(e,{...n},r),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),o){const d=this.currentMask.append(o,{raw:!0});c.tailShift=d.inserted.length-i.length}s&&(c.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)}else u&&(this.currentMask.state=u);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new Nt;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,r;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(e,this,n,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[r,i]=super.doPrepare(e,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(e,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(e,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const r=new Nt;return this.currentMask&&r.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=e;n&&this.compiledMasks.forEach((o,s)=>o.state=n[s]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(e,n,r){return this.currentMask?this.currentMask.extractInput(e,n,r):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,r)=>{if(!e[r])return;const{mask:i,...a}=e[r];return wf(n,a)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}vc.DEFAULTS=void 0,vc.DEFAULTS={dispatch:(t,e,n,r)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,a=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,qe.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(c),o.append(t,e.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,qe.FORCE_LEFT)))}});return a.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[a[0].index]}},Ke.MaskedDynamic=vc;class dSe extends ar{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...r}=e;if(n){const i=n.map(s=>s.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}Ke.MaskedEnum=dSe;class fSe extends ir{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Ke.MaskedFunction=fSe;class gr extends ir{constructor(e){super({...gr.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+HS(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(HS).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(HS(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(e,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,r))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return a.tailShift+=(s-i)*this.thousandsSeparator.length,a.skip=!a.rawInserted&&e===this.thousandsSeparator,a}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,n){const r=this._findSeparatorAround(e);r>=0&&(e=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const r=this.value.slice(0,e),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new Nt({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case qe.NONE:case qe.LEFT:case qe.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(e<i||this.value.length<=i||n===qe.FORCE_LEFT)return r}break}case qe.RIGHT:case qe.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const r=this.number;n=n&&!isNaN(r)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,r){n===void 0&&(n={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===gr.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,gr.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(gr.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}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(e){return(super.typedValueEquals(e)||gr.EMPTY_VALUES.includes(e)&&gr.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}gr.UNMASKED_RADIX=".",gr.EMPTY_VALUES=[...ir.EMPTY_VALUES,0],gr.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[gr.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Ke.MaskedNumber=gr;const WS={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function HP(t,e,n){e===void 0&&(e=WS.MASKED),n===void 0&&(n=WS.MASKED);const r=Ka(t);return i=>r.runIsolated(a=>(a[e]=i,a[n]))}function pSe(t,e,n,r){return HP(e,n,r)(t)}Ke.PIPE_TYPE=WS,Ke.createPipe=HP,Ke.pipe=pSe;try{globalThis.IMask=Ke}catch{}const zP={mask:te.oneOfType([te.array,te.func,te.string,te.instanceOf(RegExp),te.oneOf([Date,Number,Ke.Masked]),te.instanceOf(Ke.Masked)]),value:te.any,unmask:te.oneOfType([te.bool,te.oneOf(["typed"])]),prepare:te.func,prepareChar:te.func,validate:te.func,commit:te.func,overwrite:te.oneOfType([te.bool,te.oneOf(["shift"])]),eager:te.oneOfType([te.bool,te.oneOf(["append","remove"])]),skipInvalid:te.bool,onAccept:te.func,onComplete:te.func,placeholderChar:te.string,displayChar:te.string,lazy:te.bool,definitions:te.object,blocks:te.object,enum:te.arrayOf(te.string),maxLength:te.number,from:te.number,to:te.number,pattern:te.string,format:te.func,parse:te.func,autofix:te.oneOfType([te.bool,te.oneOf(["pad"])]),radix:te.string,thousandsSeparator:te.string,mapToRadix:te.arrayOf(te.string),scale:te.number,normalizeZeros:te.bool,padFractionalZeros:te.bool,min:te.oneOfType([te.number,te.instanceOf(Date)]),max:te.oneOfType([te.number,te.instanceOf(Date)]),dispatch:te.func,inputRef:te.oneOfType([te.func,te.shape({current:te.object})])},WP=Object.keys(zP).filter(t=>t!=="value"),hSe=["value","unmask","onAccept","onComplete","inputRef"],mSe=WP.filter(t=>hSe.indexOf(t)<0);function gSe(t){var e;const n=(e=class extends R.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Ke(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(s=>mSe.indexOf(s)<0).forEach(s=>{delete o[s]}),o}_extractNonMaskProps(a){const{...o}=a;return WP.forEach(s=>{delete o[s]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return R.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),r=t.displayName||t.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=zP,R.forwardRef((i,a)=>R.createElement(n,{...i,ref:a}))}const _Se=gSe(t=>{let{inputRef:e,...n}=t;return R.createElement("input",{...n,ref:e})}),bSe=(t,e)=>R.createElement(_Se,{...t,ref:e});R.forwardRef(bSe);function vSe(t,e){let{onAccept:n,onComplete:r}=e===void 0?{}:e;const i=R.useRef(null),a=R.useRef(null),[o,s]=R.useState(!1),[l,c]=R.useState({}),[u,d]=R.useState(""),[f,p]=R.useState(""),[h,m]=R.useState(),g=R.useCallback(()=>{var S;o&&((S=a.current)==null||S.destroy(),a.current=null)},[]),_=R.useCallback(S=>{const v=a.current;v&&(c({value:v.value,unmaskedValue:v.unmaskedValue,typedValue:v.typedValue}),m(v.typedValue),p(v.unmaskedValue),d(v.value),n==null||n(v.value,v,S))},[n]),b=R.useCallback(()=>a.current&&(r==null?void 0:r(a.current.value,a.current)),[r]);return R.useEffect(()=>{const S=i.current;if(!S||!(t!=null&&t.mask))return g();const v=a.current;v?v==null||v.updateOptions(t):S&&t!=null&&t.mask&&(a.current=Ke(S,t),_()),s(!!a.current)},[t,g,_]),R.useEffect(()=>{if(!a.current)return;const S=a.current;return S.on("accept",_),S.on("complete",b),()=>{S.off("accept",_),S.off("complete",b)}},[_,b]),R.useEffect(()=>{const{value:S,...v}=l,E=a.current;E&&o&&(S!==u&&(E.value=u),c(v))},[u]),R.useEffect(()=>{const{unmaskedValue:S,...v}=l,E=a.current;E&&o&&(S!==f&&(E.unmaskedValue=f),c(v))},[f]),R.useEffect(()=>{const{typedValue:S,...v}=l,E=a.current;E&&o&&(S!==h&&(E.typedValue=h),c(v))},[h]),R.useEffect(()=>g,[g]),{ref:i,maskRef:a,value:u,setValue:d,unmaskedValue:f,setUnmaskedValue:p,typedValue:h,setTypedValue:m}}const jS=R.forwardRef(({name:t,value:e,mask:n,onChange:r,...i},a)=>{const{ref:o,unmaskedValue:s,value:l,maskRef:c}=vSe({mask:n});return R.useEffect(()=>{c.current.value=e||""},[c,e]),R.useEffect(()=>{r({target:{name:t,value:s||e||""}})},[t,s,e]),x.jsx(K.TextField,{inputRef:a,inputProps:{ref:o},name:t,value:l,onChange:()=>r({target:{name:t,value:s}}),...i})});jS.displayName="MaskedInput";function ESe(t){let e;switch(t){case"top-left":e={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":e={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":e={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":e={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":e={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":e={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":e={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return e}const SSe=cn("span")(({arrow:t,theme:e})=>{const i=`solid 1px ${ye(e.palette.grey[500],.12)}`,a={borderRadius:"0 0 3px 0",top:-6,borderBottom:i,borderRight:i},o={borderRadius:"3px 0 0 0",bottom:-6,borderTop:i,borderLeft:i},s={borderRadius:"0 3px 0 0",left:-6,borderTop:i,borderRight:i},l={borderRadius:"0 0 0 3px",right:-6,borderBottom:i,borderLeft:i};return{display:"none",[e.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:'""',display:"block",position:"absolute",transform:"rotate(-135deg)",background:e.palette.background.paper},...t==="top-left"&&{...a,left:20},...t==="top-center"&&{...a,left:0,right:0,margin:"auto"},...t==="top-right"&&{...a,right:20},...t==="bottom-left"&&{...o,left:20},...t==="bottom-center"&&{...o,left:0,right:0,margin:"auto"},...t==="bottom-right"&&{...o,right:20},...t==="left-top"&&{...s,top:20},...t==="left-center"&&{...s,top:0,bottom:0,margin:"auto"},...t==="left-bottom"&&{...s,bottom:20},...t==="right-top"&&{...l,top:20},...t==="right-center"&&{...l,top:0,bottom:0,margin:"auto"},...t==="right-bottom"&&{...l,bottom:20}}}),ySe=({open:t,children:e,arrow:n="top-right",disabledArrow:r,sx:i,...a})=>{const{style:o,anchorOrigin:s,transformOrigin:l}=ESe(n);return x.jsxs(K.Popover,{open:!!t,anchorEl:t,anchorOrigin:s,transformOrigin:l,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...o,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...i}},...a,children:[!r&&x.jsx(SSe,{arrow:n}),e]})},TSe=K.styled(K.Stack)(({theme:t})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${t.palette.grey[300]}`,button:{marginRight:24}})),CSe=K.styled(K.DialogContent)({padding:"24px !important"}),OSe=K.styled(K.DialogActions)(({theme:t})=>({borderTop:`1px solid ${t.palette.grey[300]}`,backgroundColor:t.palette.grey[50]})),xSe=({children:t,actionsProps:e})=>x.jsx(OSe,{sx:{borderTop:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},...e,children:t}),jP=({actions:t,actionsProps:e,children:n,dialogContentProps:r,dialogTitle:i,dialogTitleProps:a,onClose:o,id:s,...l})=>{const c=s||"modal-actions";return x.jsxs(K.Dialog,{id:s,scroll:"body",...l,onClose:o,children:[x.jsxs(TSe,{children:[i&&x.jsx(K.DialogTitle,{variant:"subtitle1",...a,children:i}),x.jsx(K.IconButton,{onClick:o,children:x.jsx(Ct,{icon:"ic:round-close"})})]}),x.jsx(CSe,{...r,children:n}),t&&x.jsx(xSe,{actionsProps:{...e,id:c},children:t})]})},KP=({children:t,container:e,waitBeforeShow:n=50})=>{const[r,i]=R.useState(!1);return R.useEffect(()=>{const a=setTimeout(()=>i(!0),n);return()=>clearTimeout(a)},[n]),r?su.createPortal(t,document.getElementById(e)||document.body):null},RSe=({children:t,id:e="modal-actions"})=>x.jsx(KP,{container:e,children:t}),ASe=t=>{if(!t||(t=t==null?void 0:t.replace(/[^\d]+/g,""),t.length!==11||t==="00000000000"||t==="11111111111"||t==="22222222222"||t==="33333333333"||t==="44444444444"||t==="55555555555"||t==="66666666666"||t==="77777777777"||t==="88888888888"||t==="99999999999"))return!1;let e=0;for(let r=0;r<9;r++)e+=parseInt(t.charAt(r))*(10-r);let n=11-e%11;if((n===10||n===11)&&(n=0),n!==parseInt(t.charAt(9)))return!1;e=0;for(let r=0;r<10;r++)e+=parseInt(t.charAt(r))*(11-r);return n=11-e%11,(n===10||n===11)&&(n=0),n===parseInt(t.charAt(10))},NSe=t=>{if(!t||(t=t.replace(/[^\d]+/g,""),t.length!==14)||t==="00000000000000"||t==="11111111111111"||t==="22222222222222"||t==="33333333333333"||t==="44444444444444"||t==="55555555555555"||t==="66666666666666"||t==="77777777777777"||t==="88888888888888"||t==="99999999999999")return!1;let e=t.length-2,n=t.substring(0,e);const r=t.substring(e);let i=0,a=e-7;for(let s=e;s>=1;s--)i+=parseInt(n.charAt(e-s))*a--,a<2&&(a=9);let o=i%11<2?0:11-i%11;if(o!==parseInt(r.charAt(0)))return!1;e+=1,n=t.substring(0,e),i=0,a=e-7;for(let s=e;s>=1;s--)i+=parseInt(n.charAt(e-s))*a--,a<2&&(a=9);return o=i%11<2?0:11-i%11,o===parseInt(r.charAt(1))},kf=(t="",e=[8,20],n=!1,r=!1,i=!1)=>{const a=t.length>=e[0]&&t.length<=e[1],o=!i||/[A-Z]/.test(t),s=!r||/[!@#$%^&*(),.?":{}|<>]/.test(t),l=!n||/\d/.test(t);return{isLengthValid:a,hasUpperCaseChar:o,hasSpecialCharacter:s,hasNumberChar:l}},wSe=Object.freeze(Object.defineProperty({__proto__:null,cnpjIsValid:NSe,cpfIsValid:ASe,validatePassword:kf},Symbol.toStringTag,{value:"Module"})),ISe=K.styled(K.Stack)(({theme:t})=>({width:"100%",border:`solid 1px ${K.alpha(t.palette.grey[500],.32)}`,padding:16,borderRadius:8,gap:8})),DSe=K.styled(K.Stack)(()=>({gap:4})),Pf=K.styled(K.Stack)(({theme:t})=>({flexDirection:"row",alignItems:"center",gap:8,color:t.palette.text.secondary,div:{fontSize:12},strong:{fontWeight:700,color:t.palette.text.primary}})),Lf=({passed:t})=>t?x.jsx(Ct,{icon:"ic:round-check",color:"success.main"}):x.jsx(Ct,{icon:"ic:outline-warning",color:"warning.main"}),MSe=({password:t,passwordSize:e,numberChar:n=!1,specialCharacter:r=!1,upperCaseChar:i=!1})=>{const{hasSpecialCharacter:a,hasUpperCaseChar:o,isLengthValid:s,hasNumberChar:l}=kf(t,e,n,r,i);return x.jsxs(ISe,{children:[x.jsx(K.Typography,{color:"text.secondary",variant:"body2",children:"Sua senha deve conter:"}),x.jsxs(DSe,{children:[x.jsxs(Pf,{children:[x.jsx(Lf,{passed:s}),x.jsxs(K.Typography,{component:"div",children:[x.jsxs("strong",{children:[e[0],"-",e[1]]})," ","caracteres"]})]}),i&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:o}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos uma ",x.jsx("strong",{children:"letra maiúscula"})]})]}),n&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:l}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos ",x.jsx("strong",{children:"um número"})]})]}),r&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:a}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos um ",x.jsx("strong",{children:"caracter especial"})," ",x.jsx("span",{children:"(#,@,!,?)"})]})]})]})]})},QP=1024;let kSe=0,KS=class{constructor(e,n){this.from=e,this.to=n}};class it{constructor(e={}){this.id=kSe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Hn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}it.closedBy=new it({deserialize:t=>t.split(" ")}),it.openedBy=new it({deserialize:t=>t.split(" ")}),it.group=new it({deserialize:t=>t.split(" ")}),it.contextHash=new it({perNode:!0}),it.lookAhead=new it({perNode:!0}),it.mounted=new it({perNode:!0});class Ff{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[it.mounted.id]}}const PSe=Object.create(null);class Hn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):PSe,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Hn(e.name||"",n,e.id,r);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(it.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(it.group),a=-1;a<(i?i.length:0);a++){let o=n[a<0?r.name:i[a]];if(o)return o}}}}Hn.none=new Hn("",Object.create(null),0,8);class QS{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let a of e){let o=a(r);o&&(i||(i=Object.assign({},r.props)),i[o[0].id]=o[1])}n.push(i?new Hn(r.name,i,r.id,r.flags):r)}return new QS(n)}}const Bf=new WeakMap,XP=new WeakMap;var bn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(bn||(bn={}));class un{constructor(e,n,r,i,a){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,a&&a.length){this.props=Object.create(null);for(let[o,s]of a)this.props[typeof o=="number"?o:o.id]=s}}toString(){let e=Ff.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new JS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Bf.get(this)||this.topNode,a=new JS(i);return a.moveTo(e,n),Bf.set(this,a._tree),a}get topNode(){return new _r(this,0,0,null)}resolve(e,n=0){let r=Ec(Bf.get(this)||this.topNode,e,n,!1);return Bf.set(this,r),r}resolveInner(e,n=0){let r=Ec(XP.get(this)||this.topNode,e,n,!0);return XP.set(this,r),r}resolveStack(e,n=0){return BSe(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:a=this.length}=e,o=e.mode||0,s=(o&bn.IncludeAnonymous)>0;for(let l=this.cursor(o|bn.IncludeAnonymous);;){let c=!1;if(l.from<=a&&l.to>=i&&(!s&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(s||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:ty(Hn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new un(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new un(Hn.none,n,r,i)))}static build(e){return USe(e)}}un.empty=new un(Hn.none,[],[],0);class XS{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new XS(this.buffer,this.index)}}class ta{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Hn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],a=i.name;if(/\W/.test(a)&&!i.isError&&(a=JSON.stringify(a)),e+=4,r==e)return a;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return a+"("+o.join(",")+")"}findChild(e,n,r,i,a){let{buffer:o}=this,s=-1;for(let l=e;l!=n&&!(ZP(a,i,o[l+1],o[l+2])&&(s=l,r>0));l=o[l+3]);return s}slice(e,n,r){let i=this.buffer,a=new Uint16Array(n-e),o=0;for(let s=e,l=0;s<n;){a[l++]=i[s++],a[l++]=i[s++]-r;let c=a[l++]=i[s++]-r;a[l++]=i[s++]-e,o=Math.max(o,c)}return new ta(a,o,this.set)}}function ZP(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ec(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!r&&t instanceof _r&&t.index<0?null:t.parent;if(!o)return t;t=o}let a=r?0:bn.IgnoreOverlays;if(r)for(let o=t,s=o.parent;s;o=s,s=o.parent)o instanceof _r&&o.index<0&&((i=s.enter(e,n,a))===null||i===void 0?void 0:i.from)!=o.from&&(t=s);for(;;){let o=t.enter(e,n,a);if(!o)return t;t=o}}class JP{cursor(e=0){return new JS(this,e)}getChild(e,n=null,r=null){let i=eL(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return eL(this,e,n,r)}resolve(e,n=0){return Ec(this,e,n,!1)}resolveInner(e,n=0){return Ec(this,e,n,!0)}matchContext(e){return ZS(this,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class _r extends JP{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:l}=o._tree,c=n>0?s.length:-1;e!=c;e+=n){let u=s[e],d=l[e]+o.from;if(ZP(i,r,d,d+u.length)){if(u instanceof ta){if(a&bn.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,n,r-d,i);if(f>-1)return new na(new LSe(o,u,e,d),null,f)}else if(a&bn.IncludeAnonymous||!u.type.isAnonymous||ey(u)){let f;if(!(a&bn.IgnoreMounts)&&(f=Ff.get(u))&&!f.overlay)return new _r(f.tree,d,e,o);let p=new _r(u,d,e,o);return a&bn.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(a&bn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&bn.IgnoreOverlays)&&(i=Ff.get(this._tree))&&i.overlay){let a=e-this.from;for(let{from:o,to:s}of i.overlay)if((n>0?o<=a:o<a)&&(n<0?s>=a:s>a))return new _r(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function eL(t,e,n,r){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(;!i.type.is(n);)if(!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function ZS(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class LSe{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class na extends JP{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return a<0?null:new na(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&bn.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new na(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new na(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new na(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,a=r.buffer[this.index+3];if(a>i){let o=r.buffer[this.index+1];e.push(r.slice(i,a,o)),n.push(0)}return new un(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function tL(t){if(!t.length)return null;let e=0,n=t[0];for(let a=1;a<t.length;a++){let o=t[a];(o.from>n.from||o.to<n.to)&&(n=o,e=a)}let r=n instanceof _r&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new FSe(i,n)}class FSe{constructor(e,n){this.heads=e,this.node=n}get next(){return tL(this.heads)}}function BSe(t,e,n){let r=t.resolveInner(e,n),i=null;for(let a=r instanceof _r?r:r.context.parent;a;a=a.parent)if(a.index<0){let o=a.parent;(i||(i=[r])).push(o.resolve(e,n)),a=o}else{let o=Ff.get(a.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let s=new _r(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(Ec(s,e,n,!1))}}return i?tL(i):r}class JS{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof _r)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof _r?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&bn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&bn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&bn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(i.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+e,o=e<0?-1:r._tree.children.length;a!=o;a+=e){let s=r._tree.children[a];if(this.mode&bn.IncludeAnonymous||s instanceof ta||!s.type.isAnonymous||ey(s))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,a=this.stack.length;a>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=a+1;break e}i=this.stack[--a]}for(let i=r;i<this.stack.length;i++)n=new na(this.buffer,n,this.stack[i]);return this.bufferNode=new na(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return ZS(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,a=this.stack.length-1;i>=0;a--){if(a<0)return ZS(this.node,e,i);let o=r[n.buffer[this.stack[a]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function ey(t){return t.children.some(e=>e instanceof ta||!e.type.isAnonymous||ey(e))}function USe(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=QP,reused:a=[],minRepeatType:o=r.types.length}=t,s=Array.isArray(n)?new XS(n,n.length):n,l=r.types,c=0,u=0;function d(E,T,y,C,N,A){let{id:O,start:w,end:D,size:k}=s,P=u;for(;k<0;)if(s.next(),k==-1){let M=a[O];y.push(M),C.push(w-E);return}else if(k==-3){c=O;return}else if(k==-4){u=O;return}else throw new RangeError(`Unrecognized record size: ${k}`);let G=l[O],F,W,$=w-E;if(D-w<=i&&(W=g(s.pos-T,N))){let M=new Uint16Array(W.size-W.skip),I=s.pos-W.size,L=M.length;for(;s.pos>I;)L=_(W.start,M,L);F=new ta(M,D-W.start,r),$=W.start-E}else{let M=s.pos-k;s.next();let I=[],L=[],U=O>=o?O:-1,Y=0,V=D;for(;s.pos>M;)U>=0&&s.id==U&&s.size>=0?(s.end<=V-i&&(h(I,L,w,Y,s.end,V,U,P),Y=I.length,V=s.end),s.next()):A>2500?f(w,M,I,L):d(w,M,I,L,U,A+1);if(U>=0&&Y>0&&Y<I.length&&h(I,L,w,Y,w,V,U,P),I.reverse(),L.reverse(),U>-1&&Y>0){let B=p(G);F=ty(G,I,L,0,I.length,0,D-w,B,B)}else F=m(G,I,L,D-w,P-D)}y.push(F),C.push($)}function f(E,T,y,C){let N=[],A=0,O=-1;for(;s.pos>T;){let{id:w,start:D,end:k,size:P}=s;if(P>4)s.next();else{if(O>-1&&D<O)break;O<0&&(O=k-i),N.push(w,D,k),A++,s.next()}}if(A){let w=new Uint16Array(A*4),D=N[N.length-2];for(let k=N.length-3,P=0;k>=0;k-=3)w[P++]=N[k],w[P++]=N[k+1]-D,w[P++]=N[k+2]-D,w[P++]=P;y.push(new ta(w,N[2]-D,r)),C.push(D-E)}}function p(E){return(T,y,C)=>{let N=0,A=T.length-1,O,w;if(A>=0&&(O=T[A])instanceof un){if(!A&&O.type==E&&O.length==C)return O;(w=O.prop(it.lookAhead))&&(N=y[A]+O.length+w)}return m(E,T,y,C,N)}}function h(E,T,y,C,N,A,O,w){let D=[],k=[];for(;E.length>C;)D.push(E.pop()),k.push(T.pop()+y-N);E.push(m(r.types[O],D,k,A-N,w-A)),T.push(N-y)}function m(E,T,y,C,N=0,A){if(c){let O=[it.contextHash,c];A=A?[O].concat(A):[O]}if(N>25){let O=[it.lookAhead,N];A=A?[O].concat(A):[O]}return new un(E,T,y,C,A)}function g(E,T){let y=s.fork(),C=0,N=0,A=0,O=y.end-i,w={size:0,start:0,skip:0};e:for(let D=y.pos-E;y.pos>D;){let k=y.size;if(y.id==T&&k>=0){w.size=C,w.start=N,w.skip=A,A+=4,C+=4,y.next();continue}let P=y.pos-k;if(k<0||P<D||y.start<O)break;let G=y.id>=o?4:0,F=y.start;for(y.next();y.pos>P;){if(y.size<0)if(y.size==-3)G+=4;else break e;else y.id>=o&&(G+=4);y.next()}N=F,C+=k,A+=G}return(T<0||C==E)&&(w.size=C,w.start=N,w.skip=A),w.size>4?w:void 0}function _(E,T,y){let{id:C,start:N,end:A,size:O}=s;if(s.next(),O>=0&&C<o){let w=y;if(O>4){let D=s.pos-(O-4);for(;s.pos>D;)y=_(E,T,y)}T[--y]=w,T[--y]=A-E,T[--y]=N-E,T[--y]=C}else O==-3?c=C:O==-4&&(u=C);return y}let b=[],S=[];for(;s.pos>0;)d(t.start||0,t.bufferStart||0,b,S,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:b.length?S[0]+b[0].length:0;return new un(l[t.topID],b.reverse(),S.reverse(),v)}const nL=new WeakMap;function Uf(t,e){if(!t.isAnonymous||e instanceof ta||e.type!=t)return 1;let n=nL.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof un)){n=1;break}n+=Uf(t,r)}nL.set(e,n)}return n}function ty(t,e,n,r,i,a,o,s,l){let c=0;for(let h=r;h<i;h++)c+=Uf(t,e[h]);let u=Math.ceil(c*1.5/8),d=[],f=[];function p(h,m,g,_,b){for(let S=g;S<_;){let v=S,E=m[S],T=Uf(t,h[S]);for(S++;S<_;S++){let y=Uf(t,h[S]);if(T+y>=u)break;T+=y}if(S==v+1){if(T>u){let y=h[v];p(y.children,y.positions,0,y.children.length,m[v]+b);continue}d.push(h[v])}else{let y=m[S-1]+h[S-1].length-E;d.push(ty(t,h,m,v,S,E,y,null,l))}f.push(E+b-a)}}return p(e,n,r,i,0),(s||l)(d,f,o)}class Ja{constructor(e,n,r,i,a=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(a?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Ja(0,e.length,e,0,!1,r)];for(let a of n)a.to>e.length&&i.push(a);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],a=1,o=e.length?e[0]:null;for(let s=0,l=0,c=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-l>=r)for(;o&&o.from<d;){let f=o;if(l>=f.from||d<=f.to||c){let p=Math.max(f.from,l)-c,h=Math.min(f.to,d)-c;f=p>=h?null:new Ja(p,h,f.tree,f.offset+c,s>0,!!u)}if(f&&i.push(f),o.to>d)break;o=a<e.length?e[a++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class rL{startParse(e,n,r){return typeof e=="string"&&(e=new GSe(e)),r=r?r.length?r.map(i=>new KS(i.from,i.to)):[new KS(0,0)]:[new KS(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let a=i.advance();if(a)return a}}}class GSe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new it({perNode:!0});let Ot=class tU{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Kr.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){let r=[];return this.decompose(e,n,r,0),Kr.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Sc(this),a=new Sc(e);for(let o=n,s=n;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new Sc(this,e)}iterRange(e,n=this.length){return new aL(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new oL(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?tU.empty:e.length<=32?new an(e):Kr.from(an.split(e,[]))}};class an extends Ot{constructor(e,n=$Se(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.text[a],s=i+o.length;if((n?r:s)>=e)return new qSe(i,s,r,o);i=s+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new an(iL(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),s=Gf(a.text,o.text.slice(),0,a.length);if(s.length<=32)r.push(new an(s,o.length+a.length));else{let l=s.length>>1;r.push(new an(s.slice(0,l)),new an(s.slice(l)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof an))return super.replace(e,n,r);let i=Gf(this.text,Gf(r.text,iL(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new an(i,a):Kr.from(an.split(i,[]),a)}sliceString(e,n=this.length,r=`
304
+ `),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function nSe(t){t=tSe(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,i=t.onKeyDown;i===void 0&&(i=Ji);var a=t.onBlur;a===void 0&&(a=Ji);var o=t.thousandSeparator,s=t.decimalScale,l=t.fixedDecimalScale,c=t.prefix;c===void 0&&(c="");var u=t.defaultValue,d=t.value,f=t.valueIsNumericString,p=t.onValueChange,h=RP(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=Nf(t),g=m.decimalSeparator,_=m.allowedDecimalSeparators,b=function(G){return FP(G,t)},S=function(G,F){return JEe(G,F,t)},v=As(d)?u:d,E=f??ZEe(v,c,e);As(d)?As(u)||(E=E||typeof u=="number"):E=E||typeof d=="number";var T=function(G){return AP(G)?G:(typeof G=="number"&&(G=DP(G)),E&&typeof s=="number"?MP(G,s,!!l):G)},y=LP(T(d),T(u),!!E,b,S,p),C=y[0],N=C.numAsString,A=C.formattedValue,O=y[1],w=function(G){var F=G.target,W=G.key,$=F.selectionStart,M=F.selectionEnd,I=F.value;if(I===void 0&&(I=""),$!==M){i(G);return}W==="Backspace"&&I[0]==="-"&&$===c.length+1&&n&&ja(F,1),s&&l&&(W==="Backspace"&&I[$-1]===g?(ja(F,$-1),G.preventDefault()):W==="Delete"&&I[$]===g&&G.preventDefault()),_!=null&&_.includes(W)&&I[$]===g&&ja(F,$+1);var L=o===!0?",":o;W==="Backspace"&&I[$-1]===L&&ja(F,$-1),W==="Delete"&&I[$]===L&&ja(F,$+1),i(G)},D=function(G){var F=N;if(F.match(/\d/g)||(F=""),r||(F=GEe(F)),l&&s&&(F=MP(F,s,l)),F!==N){var W=FP(F,t);O({formattedValue:W,value:F,floatValue:parseFloat(F)},{event:G,source:_c.event})}a(G)},k=function(G){return G===g?!0:bc(G)},P=function(G){var F=G.currentValue,W=G.lastValue,$=G.formattedValue,M=G.currentValueIndex,I=G.formattedValueIndex,L=F[M],U=$[I],Y=kP(W,F),V=Y.to;return M>=V.start&&M<V.end&&_&&_.includes(L)&&U===g?!0:L===U};return Object.assign(Object.assign({},h),{value:A,valueIsNumericString:!1,isValidInputCharacter:k,isCharacterSame:P,onValueChange:O,format:b,removeFormatting:S,getCaretBoundary:function(G){return eSe(G,t)},onKeyDown:w,onBlur:D})}function rSe(t){var e=nSe(t);return R.createElement(KEe,Object.assign({},e))}const YS=R.forwardRef(({decimalScale:t=0,fixedDecimalScale:e=!0,prefix:n,allowNegative:r,minValue:i,maxValue:a=1/0,maxLength:o,value:s,inputProps:l,InputProps:c,size:u,disabled:d,name:f,helperText:p,error:h,fullWidth:m,label:g,required:_,onChange:b},S)=>{const v=R.useRef(null),E=T=>{b&&(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{const{floatValue:y}=T,C=y||0;if(i!==void 0&&i>C){b({target:{name:f,value:i}});return}if(y!==void 0&&a<C){b({target:{name:f,value:a}});return}b({target:{name:f,value:y}})},600))};return R.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),x.jsx(rSe,{getInputRef:S,value:s,prefix:n,decimalSeparator:",",thousandSeparator:".",decimalScale:t,fixedDecimalScale:e,autoComplete:"off",allowNegative:r,maxLength:o,onValueChange:E,customInput:K.TextField,InputProps:{...c},inputProps:l,disabled:d,size:u,helperText:p,error:h,fullWidth:m,label:g,required:_})});YS.displayName="NumberInput";const BP=R.forwardRef(({name:t,increment:e=1,updadteForMultiple:n,allowNegative:r=!1,value:i=0,onChange:a,minValue:o,maxValue:s,decimalScale:l,disabled:c,...u},d)=>{const f=OP(i,e,l),p=()=>{if(!r&&i-e<0)return;const g=i-e,_=Math.floor(i/e)*e,b=!f&&n?_:g;o!==void 0&&g<o?a(o):a($S(b))},h=()=>{const g=Number(i)+e,_=Math.ceil(i/e)*e,S=$S(!f&&n?_:g);s!==void 0&&g>=s?a(s):a(o!==void 0&&S<=o?o:S)},m=g=>{const _=Number(g.target.value),b=Math.ceil(_/e)*e,S=n?b:_;if(o!==void 0&&_<=o){a(o);return}if(s!==void 0&&_>=s){a(s);return}a(S)};return x.jsx(YS,{ref:d,name:t,value:i,minValue:o,maxValue:s,allowNegative:r,decimalScale:l,InputProps:{startAdornment:x.jsx(K.InputAdornment,{position:"start",children:x.jsx(K.IconButton,{size:"medium",disabled:c||(r?!1:!i),onClick:p,children:x.jsx(Ct,{icon:"eva:minus-fill",width:14,height:14,color:"primary.main"})})}),endAdornment:x.jsx(K.InputAdornment,{position:"end",children:x.jsx(K.IconButton,{size:"medium",onClick:h,disabled:c,children:x.jsx(Ct,{icon:"eva:plus-fill",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},onChange:m,disabled:c,...u})});BP.displayName="Incrementer";const iSe=cn(K.Box)(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=e.variant==="filled",i=e.variant==="outlined",a=e.variant==="soft",o={...e.color==="default"&&{...i&&{backgroundColor:"transparent",color:t.palette.text.primary,border:`1px solid ${ye(t.palette.grey[500],.32)}`},...a&&{color:n?t.palette.text.primary:t.palette.common.white,backgroundColor:ye(t.palette.grey[500],.16)}}},s={...e.color!=="default"&&{...r&&{color:t.palette[e.color].contrastText,backgroundColor:t.palette[e.color].main},...i&&{backgroundColor:"transparent",color:t.palette[e.color].main,border:`1px solid ${t.palette[e.color].main}`},...a&&{color:t.palette[e.color][n?"dark":"light"],backgroundColor:ye(t.palette[e.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"none",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...o}}),UP=R.forwardRef(({children:t,color:e="default",variant:n="soft",startIcon:r,endIcon:i,sx:a,...o},s)=>{const l=xa(),c={width:16,height:16,"& svg, img":{width:1,height:1,objectFit:"cover"}};return x.jsxs(iSe,{ref:s,component:"span",ownerState:{color:e,variant:n},sx:{...r&&{pl:.75},...i&&{pr:.75},...a},theme:l,...o,children:[r&&x.jsxs(K.Box,{sx:{mr:.75,...c},children:[" ",r," "]}),t,i&&x.jsxs(K.Box,{sx:{ml:.75,...c},children:[" ",i," "]})]})});UP.displayName="Label";function ea(t){return typeof t=="string"||t instanceof String}function GP(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function $P(t,e){return Array.isArray(e)?$P(t,(n,r)=>e.includes(r)):Object.entries(t).reduce((n,r)=>{let[i,a]=r;return e(a,i)&&(n[i]=a),n},{})}const qe={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function aSe(t){switch(t){case qe.LEFT:return qe.FORCE_LEFT;case qe.RIGHT:return qe.FORCE_RIGHT;default:return t}}function HS(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function wf(t,e){if(e===t)return!0;const n=Array.isArray(e),r=Array.isArray(t);let i;if(n&&r){if(e.length!=t.length)return!1;for(i=0;i<e.length;i++)if(!wf(e[i],t[i]))return!1;return!0}if(n!=r)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const a=e instanceof Date,o=t instanceof Date;if(a&&o)return e.getTime()==t.getTime();if(a!=o)return!1;const s=e instanceof RegExp,l=t instanceof RegExp;if(s&&l)return e.toString()==t.toString();if(s!=l)return!1;const c=Object.keys(e);for(i=0;i<c.length;i++)if(!Object.prototype.hasOwnProperty.call(t,c[i]))return!1;for(i=0;i<c.length;i++)if(!wf(t[c[i]],e[c[i]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class oSe{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}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?qe.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?qe.RIGHT:qe.LEFT}}function Ke(t,e){return new Ke.InputMask(t,e)}function qP(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?Ke.MaskedRegExp:ea(t)?Ke.MaskedPattern:t===Date?Ke.MaskedDate:t===Number?Ke.MaskedNumber:Array.isArray(t)||t===Array?Ke.MaskedDynamic:Ke.Masked&&t.prototype instanceof Ke.Masked?t:Ke.Masked&&t instanceof Ke.Masked?t.constructor:t instanceof Function?Ke.MaskedFunction:(console.warn("Mask not found for mask",t),Ke.Masked)}function If(t){if(!t)throw new Error("Options in not defined");if(Ke.Masked){if(t.prototype instanceof Ke.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof Ke.Masked?{mask:t}:GP(t)&&t.mask instanceof Ke.Masked?t:{};if(e){const r=e.mask;return{...$P(e,(i,a)=>!a.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return GP(t)?{...t}:{mask:t}}function Ka(t){if(Ke.Masked&&t instanceof Ke.Masked)return t;const e=If(t),n=qP(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}Ke.createMask=Ka;class zS{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}Ke.MaskElement=zS;class Qa extends zS{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,r;return(e=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(Qa.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}Qa.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},Ke.HTMLMaskElement=Qa;class sSe extends Qa{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}Ke.HTMLMaskElement=Qa;class VP extends Qa{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Ke.HTMLContenteditableMaskElement=VP;class lSe{constructor(e,n){this.el=e instanceof zS?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new VP(e):new sSe(e),this.masked=Ka(n),this._listeners={},this._value="",this._unmaskedValue="",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.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof Ke.Masked)&&this.masked.constructor===qP(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof Ke.Masked?e:Ka({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}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})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const r=this._listeners[e];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),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}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,r=this.displayValue,i=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==r&&(this.el.value=r),i&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...r}=e,i=!this.maskEquals(n),a=!wf(this.masked,r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,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,qe.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(n);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new oSe({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:qe.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==qe.NONE&&(o=this.masked.nearestInputPos(o,qe.NONE)),this.updateControl(),this.updateCursor(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}Ke.InputMask=lSe;class Nt{static normalize(e){return Array.isArray(e)?e:[e,new Nt]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}Ke.ChangeDetails=Nt;class Oi{constructor(e,n,r){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class ir{constructor(e){this._value="",this._update({...ir.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new Oi(this.extractInput(e,n),e)}appendTail(e){return ea(e)&&(e=new Oi(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new Nt({inserted:e,rawInserted:e})):new Nt}_appendChar(e,n,r){n===void 0&&(n={});const i=this.state;let a;if([e,a]=this.doPrepareChar(e,n),a=a.aggregate(this._appendCharRaw(e,n)),a.inserted){let o,s=this.doValidate(n)!==!1;if(s&&r!=null){const l=this.state;this.overwrite===!0&&(o=r.state,r.unshift(this.displayValue.length-a.tailShift));let c=this.appendTail(r);s=c.rawInserted===r.toString(),!(s&&c.inserted)&&this.overwrite==="shift"&&(this.state=l,o=r.state,r.shift(),c=this.appendTail(r),s=c.rawInserted===r.toString()),s&&c.inserted&&(this.state=l)}s||(a=new Nt,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new Nt}_appendEager(){return new Nt}append(e,n,r){if(!ea(e))throw new Error("value should be string");const i=ea(r)?new Oi(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,n);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],n,i);if(!s.rawInserted&&!this.doSkipInvalid(e[o],n,i))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new Nt}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=e();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&this.append(r.slice(this.displayValue.length),{},""),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,r=e(this);return this.state=n,delete this._isolated,r}doSkipInvalid(e,n,r){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),Nt.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),Nt.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,r,i,a){i===void 0&&(i=qe.NONE),a===void 0&&(a={input:!0});const o=e+n,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(i=aSe(i),c=this.extractInput(0,o,{raw:!0}));let u=e;const d=new Nt;if(i!==qe.NONE&&(u=this.nearestInputPos(e,n>1&&e!==0&&!l?qe.NONE:i),d.tailShift=u-e),d.aggregate(this.remove(u)),l&&i!==qe.NONE&&c===this.rawInputValue)if(i===qe.FORCE_LEFT){let f;for(;c===this.rawInputValue&&(f=this.displayValue.length);)d.aggregate(new Nt({tailShift:-1})).aggregate(this.remove(f-1))}else i===qe.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(r,a,s))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||ir.EMPTY_VALUES.includes(e)&&ir.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}ir.DEFAULTS={skipInvalid:!0},ir.EMPTY_VALUES=[void 0,null,""],Ke.Masked=ir;class Xa{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ea(e)?new Oi(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof Oi)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof Xa){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Ke.MaskedPattern))return new Oi(this.toString()).appendTo(e);const n=new Nt;for(let r=0;r<this.chunks.length&&!n.skip;++r){const i=this.chunks[r],a=e._mapPosToBlock(e.displayValue.length),o=i.stop;let s;if(o!=null&&(!a||a.index<=o)){if(i instanceof Xa||e._stops.indexOf(o)>=0){const l=e._appendPlaceholder(o);n.aggregate(l)}s=i instanceof Xa&&e._blocks[o]}if(s){const l=s.appendTail(i);l.skip=!1,n.aggregate(l),e._value+=l.inserted;const c=i.toString().slice(l.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...r}=e;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new Xa:new Oi;return a.state=i,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],r=n.shift();if(n.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class cSe{constructor(e,n){this.masked=e,this._log=[];const{offset:r,index:i}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,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(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}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(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())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,qe.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,qe.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,qe.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,qe.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,qe.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,qe.NONE),!0})}}class YP{constructor(e){Object.assign(this,e),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(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new Nt}nearestInputPos(e,n){n===void 0&&(n=qe.NONE);const r=0,i=this._value.length;switch(n){case qe.LEFT:case qe.FORCE_LEFT:return r;case qe.NONE:case qe.RIGHT:case qe.FORCE_RIGHT:default:return i}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const r=new Nt;if(this.isFilled)return r;const i=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!i)&&!n.tail;return o&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new Nt;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Oi("")}appendTail(e){return ea(e)&&(e=new Oi(String(e))),e.appendTo(this)}append(e,n,r){const i=this._appendChar(e[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class Df{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s,...l}=e;this.masked=Ka(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new Nt}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(e,n){if(n===void 0&&(n={}),this.isFilled)return new Nt;const r=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i.inserted=i.rawInserted="",this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,n,r){return this.masked.append(e,this.currentMaskFlags(n),r)}_appendPlaceholder(){const e=new Nt;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new Nt}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,r)}nearestInputPos(e,n){n===void 0&&(n=qe.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(e,r),i);switch(n){case qe.LEFT:case qe.FORCE_LEFT:return this.isComplete?a:r;case qe.RIGHT:case qe.FORCE_RIGHT:return this.isComplete?a:i;case qe.NONE:default:return a}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||(e==null?void 0:e._beforeTailState)}}}Df.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]/,"*":/./};class uSe extends ir{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}Ke.MaskedRegExp=uSe;class ar extends ir{constructor(e){super({...ar.DEFAULTS,...e,definitions:Object.assign({},Df.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const c=n.slice(a),u=Object.keys(this.blocks).filter(f=>c.indexOf(f)===0);u.sort((f,p)=>p.length-f.length);const d=u[0];if(d){const{expose:f,...p}=If(this.blocks[d]),h=Ka({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...p,parent:this});h&&(this._blocks.push(h),f&&(this.exposeBlock=h),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),a+=d.length-1;continue}}let o=n[a],s=o in e;if(o===ar.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===ar.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}const l=s?new Df({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...If(e[o]),parent:this}):new YP({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...r}=e;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new Nt;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new Nt;if(!r)return i;for(let o=r.index;;++o){var a;const s=this._blocks[o];if(!s)break;const l=s._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]}),c=l.skip;if(i.aggregate(l),c||l.rawInserted)break}return i}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=new Xa;return e===n||this._forEachBlocksInRange(e,n,(i,a,o,s)=>{const l=i.extractTail(o,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof Xa&&(l.blockIndex=a),r.extend(l)}),r}extractInput(e,n,r){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),e===n)return"";let i="";return this._forEachBlocksInRange(e,n,(a,o,s,l)=>{i+=a.extractInput(s,l,r)}),i}_findStopBefore(e){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=e)n=i;else break}return n}_appendPlaceholder(e){const n=new Nt;if(this.lazy&&e==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=e??this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||e!=null){var s;const l=o._appendPlaceholder((s=o._blocks)==null?void 0:s.length);this._value+=l.inserted,n.aggregate(l)}}),n}_mapPosToBlock(e){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,e<=n.length)return{index:r,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(e,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,s=i.offset,l=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,s,l),a&&!o){for(let c=i.index+1;c<a.index;++c)r(this._blocks[c],c,0,this._blocks[c].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r.aggregate(i.remove(o,s))}),r}nearestInputPos(e,n){if(n===void 0&&(n=qe.NONE),!this._blocks.length)return 0;const r=new cSe(this,e);if(n===qe.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===qe.LEFT||n===qe.FORCE_LEFT){if(n===qe.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===qe.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:n===qe.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===qe.RIGHT||n===qe.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===qe.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,qe.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r+=i.totalInputPositions(o,s)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(r=>this._blocks[r]):[]}}ar.DEFAULTS={lazy:!0,placeholderChar:"_"},ar.STOP_CHAR="`",ar.ESCAPE_CHAR="\\",ar.InputDefinition=Df,ar.FixedDefinition=YP,Ke.MaskedPattern=ar;class Mf extends ar{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=e;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===s[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",r="";const[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(e,n){n===void 0&&(n={});let r;if([e,r]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,r];const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),o=this.value+e;if(o.length>this.maxLength)return["",r];const[s,l]=this.boundaries(o);return Number(l)<this.from?[i[o.length-1],r]:Number(s)>this.to?this.autofix==="pad"&&o.length<this.maxLength?["",r.aggregate(this.append(i[o.length-1]+e,n))]:[a[o.length-1],r]:[e,r]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(e)}}Ke.MaskedRange=Mf;class Za extends ar{constructor(e){const{mask:n,pattern:r,...i}={...Za.DEFAULTS,...e};super({...i,mask:ea(n)?n:r})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...a}={...Za.DEFAULTS,...e},o=Object.assign({},Za.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,i),Object.keys(o).forEach(s=>{const l=o[s];!("autofix"in l)&&"autofix"in e&&(l.autofix=e.autofix)}),super._update({...a,mask:ea(n)?n:r,blocks:o})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}Za.GET_DEFAULT_BLOCKS=()=>({d:{mask:Mf,from:1,to:31,maxLength:2},m:{mask:Mf,from:1,to:12,maxLength:2},Y:{mask:Mf,from:1900,to:9999}}),Za.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear();return[n,r,i].join(".")},parse:(t,e)=>{const[n,r,i]=t.split(".").map(Number);return new Date(i,r-1,n)}},Ke.MaskedDate=Za;class vc extends ir{constructor(e){super({...vc.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:r,...i}=If(n),a=Ka({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._applyDispatch(e,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),r}_applyDispatch(e,n,r){e===void 0&&(e=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,s=a.slice(o.length),l=this.currentMask,c=new Nt,u=l==null?void 0:l.state;if(this.currentMask=this.doDispatch(e,{...n},r),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),o){const d=this.currentMask.append(o,{raw:!0});c.tailShift=d.inserted.length-i.length}s&&(c.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)}else u&&(this.currentMask.state=u);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new Nt;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,r;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(e,this,n,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[r,i]=super.doPrepare(e,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(e,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(e,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const r=new Nt;return this.currentMask&&r.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=e;n&&this.compiledMasks.forEach((o,s)=>o.state=n[s]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(e,n,r){return this.currentMask?this.currentMask.extractInput(e,n,r):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,r)=>{if(!e[r])return;const{mask:i,...a}=e[r];return wf(n,a)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}vc.DEFAULTS=void 0,vc.DEFAULTS={dispatch:(t,e,n,r)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,a=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,qe.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(c),o.append(t,e.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,qe.FORCE_LEFT)))}});return a.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[a[0].index]}},Ke.MaskedDynamic=vc;class dSe extends ar{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...r}=e;if(n){const i=n.map(s=>s.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}Ke.MaskedEnum=dSe;class fSe extends ir{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Ke.MaskedFunction=fSe;class gr extends ir{constructor(e){super({...gr.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+HS(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(HS).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(HS(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(e,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,r))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return a.tailShift+=(s-i)*this.thousandsSeparator.length,a.skip=!a.rawInserted&&e===this.thousandsSeparator,a}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,n){const r=this._findSeparatorAround(e);r>=0&&(e=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const r=this.value.slice(0,e),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new Nt({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case qe.NONE:case qe.LEFT:case qe.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(e<i||this.value.length<=i||n===qe.FORCE_LEFT)return r}break}case qe.RIGHT:case qe.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const r=this.number;n=n&&!isNaN(r)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,r){n===void 0&&(n={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===gr.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,gr.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(gr.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}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(e){return(super.typedValueEquals(e)||gr.EMPTY_VALUES.includes(e)&&gr.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}gr.UNMASKED_RADIX=".",gr.EMPTY_VALUES=[...ir.EMPTY_VALUES,0],gr.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[gr.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Ke.MaskedNumber=gr;const WS={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function HP(t,e,n){e===void 0&&(e=WS.MASKED),n===void 0&&(n=WS.MASKED);const r=Ka(t);return i=>r.runIsolated(a=>(a[e]=i,a[n]))}function pSe(t,e,n,r){return HP(e,n,r)(t)}Ke.PIPE_TYPE=WS,Ke.createPipe=HP,Ke.pipe=pSe;try{globalThis.IMask=Ke}catch{}const zP={mask:te.oneOfType([te.array,te.func,te.string,te.instanceOf(RegExp),te.oneOf([Date,Number,Ke.Masked]),te.instanceOf(Ke.Masked)]),value:te.any,unmask:te.oneOfType([te.bool,te.oneOf(["typed"])]),prepare:te.func,prepareChar:te.func,validate:te.func,commit:te.func,overwrite:te.oneOfType([te.bool,te.oneOf(["shift"])]),eager:te.oneOfType([te.bool,te.oneOf(["append","remove"])]),skipInvalid:te.bool,onAccept:te.func,onComplete:te.func,placeholderChar:te.string,displayChar:te.string,lazy:te.bool,definitions:te.object,blocks:te.object,enum:te.arrayOf(te.string),maxLength:te.number,from:te.number,to:te.number,pattern:te.string,format:te.func,parse:te.func,autofix:te.oneOfType([te.bool,te.oneOf(["pad"])]),radix:te.string,thousandsSeparator:te.string,mapToRadix:te.arrayOf(te.string),scale:te.number,normalizeZeros:te.bool,padFractionalZeros:te.bool,min:te.oneOfType([te.number,te.instanceOf(Date)]),max:te.oneOfType([te.number,te.instanceOf(Date)]),dispatch:te.func,inputRef:te.oneOfType([te.func,te.shape({current:te.object})])},WP=Object.keys(zP).filter(t=>t!=="value"),hSe=["value","unmask","onAccept","onComplete","inputRef"],mSe=WP.filter(t=>hSe.indexOf(t)<0);function gSe(t){var e;const n=(e=class extends R.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Ke(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(s=>mSe.indexOf(s)<0).forEach(s=>{delete o[s]}),o}_extractNonMaskProps(a){const{...o}=a;return WP.forEach(s=>{delete o[s]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return R.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),r=t.displayName||t.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=zP,R.forwardRef((i,a)=>R.createElement(n,{...i,ref:a}))}const _Se=gSe(t=>{let{inputRef:e,...n}=t;return R.createElement("input",{...n,ref:e})}),bSe=(t,e)=>R.createElement(_Se,{...t,ref:e});R.forwardRef(bSe);function vSe(t,e){let{onAccept:n,onComplete:r}=e===void 0?{}:e;const i=R.useRef(null),a=R.useRef(null),[o,s]=R.useState(!1),[l,c]=R.useState({}),[u,d]=R.useState(""),[f,p]=R.useState(""),[h,m]=R.useState(),g=R.useCallback(()=>{var S;o&&((S=a.current)==null||S.destroy(),a.current=null)},[]),_=R.useCallback(S=>{const v=a.current;v&&(c({value:v.value,unmaskedValue:v.unmaskedValue,typedValue:v.typedValue}),m(v.typedValue),p(v.unmaskedValue),d(v.value),n==null||n(v.value,v,S))},[n]),b=R.useCallback(()=>a.current&&(r==null?void 0:r(a.current.value,a.current)),[r]);return R.useEffect(()=>{const S=i.current;if(!S||!(t!=null&&t.mask))return g();const v=a.current;v?v==null||v.updateOptions(t):S&&t!=null&&t.mask&&(a.current=Ke(S,t),_()),s(!!a.current)},[t,g,_]),R.useEffect(()=>{if(!a.current)return;const S=a.current;return S.on("accept",_),S.on("complete",b),()=>{S.off("accept",_),S.off("complete",b)}},[_,b]),R.useEffect(()=>{const{value:S,...v}=l,E=a.current;E&&o&&(S!==u&&(E.value=u),c(v))},[u]),R.useEffect(()=>{const{unmaskedValue:S,...v}=l,E=a.current;E&&o&&(S!==f&&(E.unmaskedValue=f),c(v))},[f]),R.useEffect(()=>{const{typedValue:S,...v}=l,E=a.current;E&&o&&(S!==h&&(E.typedValue=h),c(v))},[h]),R.useEffect(()=>g,[g]),{ref:i,maskRef:a,value:u,setValue:d,unmaskedValue:f,setUnmaskedValue:p,typedValue:h,setTypedValue:m}}const jS=R.forwardRef(({name:t,value:e,mask:n,onChange:r,...i},a)=>{const{ref:o,unmaskedValue:s,value:l,maskRef:c}=vSe({mask:n});return R.useEffect(()=>{c.current.value=e||""},[c,e]),x.jsx(K.TextField,{inputRef:a,inputProps:{ref:o},name:t,value:l,onChange:()=>r({target:{name:t,value:s}}),...i})});jS.displayName="MaskedInput";function ESe(t){let e;switch(t){case"top-left":e={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":e={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":e={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":e={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":e={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":e={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":e={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return e}const SSe=cn("span")(({arrow:t,theme:e})=>{const i=`solid 1px ${ye(e.palette.grey[500],.12)}`,a={borderRadius:"0 0 3px 0",top:-6,borderBottom:i,borderRight:i},o={borderRadius:"3px 0 0 0",bottom:-6,borderTop:i,borderLeft:i},s={borderRadius:"0 3px 0 0",left:-6,borderTop:i,borderRight:i},l={borderRadius:"0 0 0 3px",right:-6,borderBottom:i,borderLeft:i};return{display:"none",[e.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:'""',display:"block",position:"absolute",transform:"rotate(-135deg)",background:e.palette.background.paper},...t==="top-left"&&{...a,left:20},...t==="top-center"&&{...a,left:0,right:0,margin:"auto"},...t==="top-right"&&{...a,right:20},...t==="bottom-left"&&{...o,left:20},...t==="bottom-center"&&{...o,left:0,right:0,margin:"auto"},...t==="bottom-right"&&{...o,right:20},...t==="left-top"&&{...s,top:20},...t==="left-center"&&{...s,top:0,bottom:0,margin:"auto"},...t==="left-bottom"&&{...s,bottom:20},...t==="right-top"&&{...l,top:20},...t==="right-center"&&{...l,top:0,bottom:0,margin:"auto"},...t==="right-bottom"&&{...l,bottom:20}}}),ySe=({open:t,children:e,arrow:n="top-right",disabledArrow:r,sx:i,...a})=>{const{style:o,anchorOrigin:s,transformOrigin:l}=ESe(n);return x.jsxs(K.Popover,{open:!!t,anchorEl:t,anchorOrigin:s,transformOrigin:l,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...o,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...i}},...a,children:[!r&&x.jsx(SSe,{arrow:n}),e]})},TSe=K.styled(K.Stack)(({theme:t})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${t.palette.grey[300]}`,button:{marginRight:24}})),CSe=K.styled(K.DialogContent)({padding:"24px !important"}),OSe=K.styled(K.DialogActions)(({theme:t})=>({borderTop:`1px solid ${t.palette.grey[300]}`,backgroundColor:t.palette.grey[50]})),xSe=({children:t,actionsProps:e})=>x.jsx(OSe,{sx:{borderTop:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},...e,children:t}),jP=({actions:t,actionsProps:e,children:n,dialogContentProps:r,dialogTitle:i,dialogTitleProps:a,onClose:o,id:s,...l})=>{const c=s||"modal-actions";return x.jsxs(K.Dialog,{id:s,scroll:"body",...l,onClose:o,children:[x.jsxs(TSe,{children:[i&&x.jsx(K.DialogTitle,{variant:"subtitle1",...a,children:i}),x.jsx(K.IconButton,{onClick:o,children:x.jsx(Ct,{icon:"ic:round-close"})})]}),x.jsx(CSe,{...r,children:n}),t&&x.jsx(xSe,{actionsProps:{...e,id:c},children:t})]})},KP=({children:t,container:e,waitBeforeShow:n=50})=>{const[r,i]=R.useState(!1);return R.useEffect(()=>{const a=setTimeout(()=>i(!0),n);return()=>clearTimeout(a)},[n]),r?su.createPortal(t,document.getElementById(e)||document.body):null},RSe=({children:t,id:e="modal-actions"})=>x.jsx(KP,{container:e,children:t}),ASe=t=>{if(!t||(t=t==null?void 0:t.replace(/[^\d]+/g,""),t.length!==11||t==="00000000000"||t==="11111111111"||t==="22222222222"||t==="33333333333"||t==="44444444444"||t==="55555555555"||t==="66666666666"||t==="77777777777"||t==="88888888888"||t==="99999999999"))return!1;let e=0;for(let r=0;r<9;r++)e+=parseInt(t.charAt(r))*(10-r);let n=11-e%11;if((n===10||n===11)&&(n=0),n!==parseInt(t.charAt(9)))return!1;e=0;for(let r=0;r<10;r++)e+=parseInt(t.charAt(r))*(11-r);return n=11-e%11,(n===10||n===11)&&(n=0),n===parseInt(t.charAt(10))},NSe=t=>{if(!t||(t=t.replace(/[^\d]+/g,""),t.length!==14)||t==="00000000000000"||t==="11111111111111"||t==="22222222222222"||t==="33333333333333"||t==="44444444444444"||t==="55555555555555"||t==="66666666666666"||t==="77777777777777"||t==="88888888888888"||t==="99999999999999")return!1;let e=t.length-2,n=t.substring(0,e);const r=t.substring(e);let i=0,a=e-7;for(let s=e;s>=1;s--)i+=parseInt(n.charAt(e-s))*a--,a<2&&(a=9);let o=i%11<2?0:11-i%11;if(o!==parseInt(r.charAt(0)))return!1;e+=1,n=t.substring(0,e),i=0,a=e-7;for(let s=e;s>=1;s--)i+=parseInt(n.charAt(e-s))*a--,a<2&&(a=9);return o=i%11<2?0:11-i%11,o===parseInt(r.charAt(1))},kf=(t="",e=[8,20],n=!1,r=!1,i=!1)=>{const a=t.length>=e[0]&&t.length<=e[1],o=!i||/[A-Z]/.test(t),s=!r||/[!@#$%^&*(),.?":{}|<>]/.test(t),l=!n||/\d/.test(t);return{isLengthValid:a,hasUpperCaseChar:o,hasSpecialCharacter:s,hasNumberChar:l}},wSe=Object.freeze(Object.defineProperty({__proto__:null,cnpjIsValid:NSe,cpfIsValid:ASe,validatePassword:kf},Symbol.toStringTag,{value:"Module"})),ISe=K.styled(K.Stack)(({theme:t})=>({width:"100%",border:`solid 1px ${K.alpha(t.palette.grey[500],.32)}`,padding:16,borderRadius:8,gap:8})),DSe=K.styled(K.Stack)(()=>({gap:4})),Pf=K.styled(K.Stack)(({theme:t})=>({flexDirection:"row",alignItems:"center",gap:8,color:t.palette.text.secondary,div:{fontSize:12},strong:{fontWeight:700,color:t.palette.text.primary}})),Lf=({passed:t})=>t?x.jsx(Ct,{icon:"ic:round-check",color:"success.main"}):x.jsx(Ct,{icon:"ic:outline-warning",color:"warning.main"}),MSe=({password:t,passwordSize:e,numberChar:n=!1,specialCharacter:r=!1,upperCaseChar:i=!1})=>{const{hasSpecialCharacter:a,hasUpperCaseChar:o,isLengthValid:s,hasNumberChar:l}=kf(t,e,n,r,i);return x.jsxs(ISe,{children:[x.jsx(K.Typography,{color:"text.secondary",variant:"body2",children:"Sua senha deve conter:"}),x.jsxs(DSe,{children:[x.jsxs(Pf,{children:[x.jsx(Lf,{passed:s}),x.jsxs(K.Typography,{component:"div",children:[x.jsxs("strong",{children:[e[0],"-",e[1]]})," ","caracteres"]})]}),i&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:o}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos uma ",x.jsx("strong",{children:"letra maiúscula"})]})]}),n&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:l}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos ",x.jsx("strong",{children:"um número"})]})]}),r&&x.jsxs(Pf,{children:[x.jsx(Lf,{passed:a}),x.jsxs(K.Typography,{component:"div",children:["Pelo menos um ",x.jsx("strong",{children:"caracter especial"})," ",x.jsx("span",{children:"(#,@,!,?)"})]})]})]})]})},QP=1024;let kSe=0,KS=class{constructor(e,n){this.from=e,this.to=n}};class it{constructor(e={}){this.id=kSe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Hn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}it.closedBy=new it({deserialize:t=>t.split(" ")}),it.openedBy=new it({deserialize:t=>t.split(" ")}),it.group=new it({deserialize:t=>t.split(" ")}),it.contextHash=new it({perNode:!0}),it.lookAhead=new it({perNode:!0}),it.mounted=new it({perNode:!0});class Ff{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[it.mounted.id]}}const PSe=Object.create(null);class Hn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):PSe,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Hn(e.name||"",n,e.id,r);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(it.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(it.group),a=-1;a<(i?i.length:0);a++){let o=n[a<0?r.name:i[a]];if(o)return o}}}}Hn.none=new Hn("",Object.create(null),0,8);class QS{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let a of e){let o=a(r);o&&(i||(i=Object.assign({},r.props)),i[o[0].id]=o[1])}n.push(i?new Hn(r.name,i,r.id,r.flags):r)}return new QS(n)}}const Bf=new WeakMap,XP=new WeakMap;var bn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(bn||(bn={}));class un{constructor(e,n,r,i,a){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,a&&a.length){this.props=Object.create(null);for(let[o,s]of a)this.props[typeof o=="number"?o:o.id]=s}}toString(){let e=Ff.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new JS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Bf.get(this)||this.topNode,a=new JS(i);return a.moveTo(e,n),Bf.set(this,a._tree),a}get topNode(){return new _r(this,0,0,null)}resolve(e,n=0){let r=Ec(Bf.get(this)||this.topNode,e,n,!1);return Bf.set(this,r),r}resolveInner(e,n=0){let r=Ec(XP.get(this)||this.topNode,e,n,!0);return XP.set(this,r),r}resolveStack(e,n=0){return BSe(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:a=this.length}=e,o=e.mode||0,s=(o&bn.IncludeAnonymous)>0;for(let l=this.cursor(o|bn.IncludeAnonymous);;){let c=!1;if(l.from<=a&&l.to>=i&&(!s&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(s||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:ty(Hn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new un(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new un(Hn.none,n,r,i)))}static build(e){return USe(e)}}un.empty=new un(Hn.none,[],[],0);class XS{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new XS(this.buffer,this.index)}}class ta{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Hn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],a=i.name;if(/\W/.test(a)&&!i.isError&&(a=JSON.stringify(a)),e+=4,r==e)return a;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return a+"("+o.join(",")+")"}findChild(e,n,r,i,a){let{buffer:o}=this,s=-1;for(let l=e;l!=n&&!(ZP(a,i,o[l+1],o[l+2])&&(s=l,r>0));l=o[l+3]);return s}slice(e,n,r){let i=this.buffer,a=new Uint16Array(n-e),o=0;for(let s=e,l=0;s<n;){a[l++]=i[s++],a[l++]=i[s++]-r;let c=a[l++]=i[s++]-r;a[l++]=i[s++]-e,o=Math.max(o,c)}return new ta(a,o,this.set)}}function ZP(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ec(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!r&&t instanceof _r&&t.index<0?null:t.parent;if(!o)return t;t=o}let a=r?0:bn.IgnoreOverlays;if(r)for(let o=t,s=o.parent;s;o=s,s=o.parent)o instanceof _r&&o.index<0&&((i=s.enter(e,n,a))===null||i===void 0?void 0:i.from)!=o.from&&(t=s);for(;;){let o=t.enter(e,n,a);if(!o)return t;t=o}}class JP{cursor(e=0){return new JS(this,e)}getChild(e,n=null,r=null){let i=eL(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return eL(this,e,n,r)}resolve(e,n=0){return Ec(this,e,n,!1)}resolveInner(e,n=0){return Ec(this,e,n,!0)}matchContext(e){return ZS(this,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class _r extends JP{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:l}=o._tree,c=n>0?s.length:-1;e!=c;e+=n){let u=s[e],d=l[e]+o.from;if(ZP(i,r,d,d+u.length)){if(u instanceof ta){if(a&bn.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,n,r-d,i);if(f>-1)return new na(new LSe(o,u,e,d),null,f)}else if(a&bn.IncludeAnonymous||!u.type.isAnonymous||ey(u)){let f;if(!(a&bn.IgnoreMounts)&&(f=Ff.get(u))&&!f.overlay)return new _r(f.tree,d,e,o);let p=new _r(u,d,e,o);return a&bn.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(a&bn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&bn.IgnoreOverlays)&&(i=Ff.get(this._tree))&&i.overlay){let a=e-this.from;for(let{from:o,to:s}of i.overlay)if((n>0?o<=a:o<a)&&(n<0?s>=a:s>a))return new _r(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function eL(t,e,n,r){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(;!i.type.is(n);)if(!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function ZS(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class LSe{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class na extends JP{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return a<0?null:new na(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&bn.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new na(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new na(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new na(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,a=r.buffer[this.index+3];if(a>i){let o=r.buffer[this.index+1];e.push(r.slice(i,a,o)),n.push(0)}return new un(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function tL(t){if(!t.length)return null;let e=0,n=t[0];for(let a=1;a<t.length;a++){let o=t[a];(o.from>n.from||o.to<n.to)&&(n=o,e=a)}let r=n instanceof _r&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new FSe(i,n)}class FSe{constructor(e,n){this.heads=e,this.node=n}get next(){return tL(this.heads)}}function BSe(t,e,n){let r=t.resolveInner(e,n),i=null;for(let a=r instanceof _r?r:r.context.parent;a;a=a.parent)if(a.index<0){let o=a.parent;(i||(i=[r])).push(o.resolve(e,n)),a=o}else{let o=Ff.get(a.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let s=new _r(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(Ec(s,e,n,!1))}}return i?tL(i):r}class JS{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof _r)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof _r?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&bn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&bn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&bn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(i.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+e,o=e<0?-1:r._tree.children.length;a!=o;a+=e){let s=r._tree.children[a];if(this.mode&bn.IncludeAnonymous||s instanceof ta||!s.type.isAnonymous||ey(s))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,a=this.stack.length;a>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=a+1;break e}i=this.stack[--a]}for(let i=r;i<this.stack.length;i++)n=new na(this.buffer,n,this.stack[i]);return this.bufferNode=new na(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return ZS(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,a=this.stack.length-1;i>=0;a--){if(a<0)return ZS(this.node,e,i);let o=r[n.buffer[this.stack[a]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function ey(t){return t.children.some(e=>e instanceof ta||!e.type.isAnonymous||ey(e))}function USe(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=QP,reused:a=[],minRepeatType:o=r.types.length}=t,s=Array.isArray(n)?new XS(n,n.length):n,l=r.types,c=0,u=0;function d(E,T,y,C,N,A){let{id:O,start:w,end:D,size:k}=s,P=u;for(;k<0;)if(s.next(),k==-1){let M=a[O];y.push(M),C.push(w-E);return}else if(k==-3){c=O;return}else if(k==-4){u=O;return}else throw new RangeError(`Unrecognized record size: ${k}`);let G=l[O],F,W,$=w-E;if(D-w<=i&&(W=g(s.pos-T,N))){let M=new Uint16Array(W.size-W.skip),I=s.pos-W.size,L=M.length;for(;s.pos>I;)L=_(W.start,M,L);F=new ta(M,D-W.start,r),$=W.start-E}else{let M=s.pos-k;s.next();let I=[],L=[],U=O>=o?O:-1,Y=0,V=D;for(;s.pos>M;)U>=0&&s.id==U&&s.size>=0?(s.end<=V-i&&(h(I,L,w,Y,s.end,V,U,P),Y=I.length,V=s.end),s.next()):A>2500?f(w,M,I,L):d(w,M,I,L,U,A+1);if(U>=0&&Y>0&&Y<I.length&&h(I,L,w,Y,w,V,U,P),I.reverse(),L.reverse(),U>-1&&Y>0){let B=p(G);F=ty(G,I,L,0,I.length,0,D-w,B,B)}else F=m(G,I,L,D-w,P-D)}y.push(F),C.push($)}function f(E,T,y,C){let N=[],A=0,O=-1;for(;s.pos>T;){let{id:w,start:D,end:k,size:P}=s;if(P>4)s.next();else{if(O>-1&&D<O)break;O<0&&(O=k-i),N.push(w,D,k),A++,s.next()}}if(A){let w=new Uint16Array(A*4),D=N[N.length-2];for(let k=N.length-3,P=0;k>=0;k-=3)w[P++]=N[k],w[P++]=N[k+1]-D,w[P++]=N[k+2]-D,w[P++]=P;y.push(new ta(w,N[2]-D,r)),C.push(D-E)}}function p(E){return(T,y,C)=>{let N=0,A=T.length-1,O,w;if(A>=0&&(O=T[A])instanceof un){if(!A&&O.type==E&&O.length==C)return O;(w=O.prop(it.lookAhead))&&(N=y[A]+O.length+w)}return m(E,T,y,C,N)}}function h(E,T,y,C,N,A,O,w){let D=[],k=[];for(;E.length>C;)D.push(E.pop()),k.push(T.pop()+y-N);E.push(m(r.types[O],D,k,A-N,w-A)),T.push(N-y)}function m(E,T,y,C,N=0,A){if(c){let O=[it.contextHash,c];A=A?[O].concat(A):[O]}if(N>25){let O=[it.lookAhead,N];A=A?[O].concat(A):[O]}return new un(E,T,y,C,A)}function g(E,T){let y=s.fork(),C=0,N=0,A=0,O=y.end-i,w={size:0,start:0,skip:0};e:for(let D=y.pos-E;y.pos>D;){let k=y.size;if(y.id==T&&k>=0){w.size=C,w.start=N,w.skip=A,A+=4,C+=4,y.next();continue}let P=y.pos-k;if(k<0||P<D||y.start<O)break;let G=y.id>=o?4:0,F=y.start;for(y.next();y.pos>P;){if(y.size<0)if(y.size==-3)G+=4;else break e;else y.id>=o&&(G+=4);y.next()}N=F,C+=k,A+=G}return(T<0||C==E)&&(w.size=C,w.start=N,w.skip=A),w.size>4?w:void 0}function _(E,T,y){let{id:C,start:N,end:A,size:O}=s;if(s.next(),O>=0&&C<o){let w=y;if(O>4){let D=s.pos-(O-4);for(;s.pos>D;)y=_(E,T,y)}T[--y]=w,T[--y]=A-E,T[--y]=N-E,T[--y]=C}else O==-3?c=C:O==-4&&(u=C);return y}let b=[],S=[];for(;s.pos>0;)d(t.start||0,t.bufferStart||0,b,S,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:b.length?S[0]+b[0].length:0;return new un(l[t.topID],b.reverse(),S.reverse(),v)}const nL=new WeakMap;function Uf(t,e){if(!t.isAnonymous||e instanceof ta||e.type!=t)return 1;let n=nL.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof un)){n=1;break}n+=Uf(t,r)}nL.set(e,n)}return n}function ty(t,e,n,r,i,a,o,s,l){let c=0;for(let h=r;h<i;h++)c+=Uf(t,e[h]);let u=Math.ceil(c*1.5/8),d=[],f=[];function p(h,m,g,_,b){for(let S=g;S<_;){let v=S,E=m[S],T=Uf(t,h[S]);for(S++;S<_;S++){let y=Uf(t,h[S]);if(T+y>=u)break;T+=y}if(S==v+1){if(T>u){let y=h[v];p(y.children,y.positions,0,y.children.length,m[v]+b);continue}d.push(h[v])}else{let y=m[S-1]+h[S-1].length-E;d.push(ty(t,h,m,v,S,E,y,null,l))}f.push(E+b-a)}}return p(e,n,r,i,0),(s||l)(d,f,o)}class Ja{constructor(e,n,r,i,a=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(a?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Ja(0,e.length,e,0,!1,r)];for(let a of n)a.to>e.length&&i.push(a);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],a=1,o=e.length?e[0]:null;for(let s=0,l=0,c=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-l>=r)for(;o&&o.from<d;){let f=o;if(l>=f.from||d<=f.to||c){let p=Math.max(f.from,l)-c,h=Math.min(f.to,d)-c;f=p>=h?null:new Ja(p,h,f.tree,f.offset+c,s>0,!!u)}if(f&&i.push(f),o.to>d)break;o=a<e.length?e[a++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class rL{startParse(e,n,r){return typeof e=="string"&&(e=new GSe(e)),r=r?r.length?r.map(i=>new KS(i.from,i.to)):[new KS(0,0)]:[new KS(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let a=i.advance();if(a)return a}}}class GSe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new it({perNode:!0});let Ot=class tU{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Kr.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){let r=[];return this.decompose(e,n,r,0),Kr.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Sc(this),a=new Sc(e);for(let o=n,s=n;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new Sc(this,e)}iterRange(e,n=this.length){return new aL(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new oL(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?tU.empty:e.length<=32?new an(e):Kr.from(an.split(e,[]))}};class an extends Ot{constructor(e,n=$Se(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.text[a],s=i+o.length;if((n?r:s)>=e)return new qSe(i,s,r,o);i=s+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new an(iL(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),s=Gf(a.text,o.text.slice(),0,a.length);if(s.length<=32)r.push(new an(s,o.length+a.length));else{let l=s.length>>1;r.push(new an(s.slice(0,l)),new an(s.slice(l)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof an))return super.replace(e,n,r);let i=Gf(this.text,Gf(r.text,iL(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new an(i,a):Kr.from(an.split(i,[]),a)}sliceString(e,n=this.length,r=`
305
305
  `){let i="";for(let a=0,o=0;a<=n&&o<this.text.length;o++){let s=this.text[o],l=a+s.length;a>e&&o&&(i+=r),e<l&&n>a&&(i+=s.slice(Math.max(0,e-a),n-a)),a=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let a of e)r.push(a),i+=a.length+1,r.length==32&&(n.push(new an(r,i)),r=[],i=-1);return i>-1&&n.push(new an(r,i)),n}}class Kr extends Ot{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.children[a],s=i+o.length,l=r+o.lines-1;if((n?l:s)>=e)return o.lineInner(e,n,r,i);i=s+1,r=l+1}}decompose(e,n,r,i){for(let a=0,o=0;o<=n&&a<this.children.length;a++){let s=this.children[a],l=o+s.length;if(e<=l&&n>=o){let c=i&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!c?r.push(s):s.decompose(e-o,n-o,r,c)}o=l+1}}replace(e,n,r){if(r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e>=a&&n<=s){let l=o.replace(e-a,n-a,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new Kr(u,this.length-(n-e)+r.length)}return super.replace(a,s,l)}a=s+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
306
306
  `){let i="";for(let a=0,o=0;a<this.children.length&&o<=n;a++){let s=this.children[a],l=o+s.length;o>e&&a&&(i+=r),e<l&&n>o&&(i+=s.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Kr))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let l=this.children[i],c=e.children[a];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let p of e)r+=p.lines;if(r<32){let p=[];for(let h of e)h.flatten(p);return new an(p,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],l=0,c=-1,u=[];function d(p){let h;if(p.lines>a&&p instanceof Kr)for(let m of p.children)d(m);else p.lines>o&&(l>o||!l)?(f(),s.push(p)):p instanceof an&&l&&(h=u[u.length-1])instanceof an&&p.lines+h.lines<=32?(l+=p.lines,c+=p.length+1,u[u.length-1]=new an(h.text.concat(p.text),h.length+1+p.length)):(l+p.lines>i&&f(),l+=p.lines,c+=p.length+1,u.push(p))}function f(){l!=0&&(s.push(u.length==1?u[0]:Kr.from(u,c)),c=-1,l=u.length=0)}for(let p of e)d(p);return f(),s.length==1?s[0]:new Kr(s,n)}}Ot.empty=new an([""],0);function $Se(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Gf(t,e,n=0,r=1e9){for(let i=0,a=0,o=!0;a<t.length&&i<=r;a++){let s=t[a],l=i+s.length;l>=n&&(l>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(e[e.length-1]+=s,o=!1):e.push(s)),i=l+1}return e}function iL(t,e,n){return Gf(t,[""],e,n)}class Sc{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof an?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],a=this.offsets[r],o=a>>1,s=i instanceof an?i.text.length:i.children.length;if(o==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
307
307
  `,this;e--}else if(i instanceof an){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof an?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class aL{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Sc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class oL{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ot.prototype[Symbol.iterator]=function(){return this.iter()},Sc.prototype[Symbol.iterator]=aL.prototype[Symbol.iterator]=oL.prototype[Symbol.iterator]=function(){return this});class qSe{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}let Ns="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;t<Ns.length;t++)Ns[t]+=Ns[t-1];function VSe(t){for(let e=1;e<Ns.length;e+=2)if(Ns[e]>t)return Ns[e-1]<=t;return!1}function sL(t){return t>=127462&&t<=127487}const lL=8205;function Nn(t,e,n=!0,r=!0){return(n?cL:YSe)(t,e,r)}function cL(t,e,n){if(e==t.length)return e;e&&uL(t.charCodeAt(e))&&dL(t.charCodeAt(e-1))&&e--;let r=Sn(t,e);for(e+=br(r);e<t.length;){let i=Sn(t,e);if(r==lL||i==lL||n&&VSe(i))e+=br(i),r=i;else if(sL(i)){let a=0,o=e-2;for(;o>=0&&sL(Sn(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function YSe(t,e,n){for(;e>0;){let r=cL(t,e-2,n);if(r<e)return r;e--}return 0}function uL(t){return t>=56320&&t<57344}function dL(t){return t>=55296&&t<56320}function Sn(t,e){let n=t.charCodeAt(e);if(!dL(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return uL(r)?(n-55296<<10)+(r-56320)+65536:n}function ny(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function br(t){return t<65536?1:2}const ry=/\r\n?|\n/;var Pn=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Pn||(Pn={}));class Qr{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let a=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,a),i+=a):i+=o,r+=a}}iterChangedRanges(e,n=!1){iy(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Qr(e)}composeDesc(e){return this.empty?e:e.empty?this:fL(this,e)}mapDesc(e,n=!1){return e.empty?this:ay(this,e,n)}mapPos(e,n=-1,r=Pn.Simple){let i=0,a=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],l=this.sections[o++],c=i+s;if(l<0){if(c>e)return a+(e-i);a+=s}else{if(r!=Pn.Simple&&c>=e&&(r==Pn.TrackDel&&i<e&&c>e||r==Pn.TrackBefore&&i<e||r==Pn.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!s)return e==i||n<0?a:a+l;a+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let a=this.sections[r++],o=this.sections[r++],s=i+a;if(o>=0&&i<=n&&s>=e)return i<e&&s>n?"cover":!0;i=s}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qr(e)}static create(e){return new Qr(e)}}class pn extends Qr{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return iy(this,(n,r,i,a,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return ay(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,a=0;i<n.length;i+=2){let o=n[i],s=n[i+1];if(s>=0){n[i]=s,n[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(Ot.empty);r.push(o?e.slice(a,a+o):Ot.empty)}a+=o}return new pn(n,r)}compose(e){return this.empty?e:e.empty?this:fL(this,e,!0)}map(e,n=!1){return e.empty?this:ay(this,e,n,!0)}iterChanges(e,n=!1){iy(this,e,n)}get desc(){return Qr.create(this.sections)}filter(e){let n=[],r=[],i=[],a=new yc(this);e:for(let o=0,s=0;;){let l=o==e.length?1e9:e[o++];for(;s<l||s==l&&a.len==0;){if(a.done)break e;let u=Math.min(a.len,l-s);wn(i,u,-1);let d=a.ins==-1?-1:a.off==0?a.ins:0;wn(n,u,d),d>0&&ra(r,n,a.text),a.forward(u),s+=u}let c=e[o++];for(;s<c;){if(a.done)break e;let u=Math.min(a.len,c-s);wn(n,u,-1),wn(i,u,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(u),s+=u}}return{changes:new pn(n,r),filtered:Qr.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],a=[],o=0,s=null;function l(u=!1){if(!u&&!i.length)return;o<n&&wn(i,n-o,-1);let d=new pn(i,a);s=s?s.compose(d.map(s)):d,i=[],a=[],o=0}function c(u){if(Array.isArray(u))for(let d of u)c(d);else if(u instanceof pn){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),s=s?s.compose(u.map(s)):u}else{let{from:d,to:f=d,insert:p}=u;if(d>f||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let h=p?typeof p=="string"?Ot.of(p.split(r||ry)):p:Ot.empty,m=h.length;if(d==f&&m==0)return;d<o&&l(),d>o&&wn(i,d-o,-1),wn(i,f-d,m),ra(a,i,h),o=f}}return c(e),l(!s),s}static empty(e){return new pn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((o,s)=>s&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<i;)r.push(Ot.empty);r[i]=Ot.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new pn(n,r)}static createSet(e,n){return new pn(e,n)}}function wn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function ra(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Ot.empty);t.push(n)}}function iy(t,e,n){let r=t.inserted;for(let i=0,a=0,o=0;o<t.sections.length;){let s=t.sections[o++],l=t.sections[o++];if(l<0)i+=s,a+=s;else{let c=i,u=a,d=Ot.empty;for(;c+=s,u+=l,l&&r&&(d=d.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)s=t.sections[o++],l=t.sections[o++];e(i,c,a,u,d),i=c,a=u}}}function ay(t,e,n,r=!1){let i=[],a=r?[]:null,o=new yc(t),s=new yc(e);for(let l=-1;;)if(o.ins==-1&&s.ins==-1){let c=Math.min(o.len,s.len);wn(i,c,-1),o.forward(c),s.forward(c)}else if(s.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let c=s.len;for(wn(i,s.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(wn(i,0,o.ins),a&&ra(a,i,o.text),l=o.i),o.forward(u),c-=u}s.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(s.ins==-1){let d=Math.min(u,s.len);c+=d,u-=d,s.forward(d)}else if(s.ins==0&&s.len<u)u-=s.len,s.next();else break;wn(i,c,l<o.i?o.ins:0),a&&l<o.i&&ra(a,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&s.done)return a?pn.createSet(i,a):Qr.create(i);throw new Error("Mismatched change set lengths")}}function fL(t,e,n=!1){let r=[],i=n?[]:null,a=new yc(t),o=new yc(e);for(let s=!1;;){if(a.done&&o.done)return i?pn.createSet(r,i):Qr.create(r);if(a.ins==0)wn(r,a.len,0,s),a.next();else if(o.len==0&&!o.done)wn(r,0,o.ins,s),i&&ra(i,r,o.text),o.next();else{if(a.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(a.len2,o.len),c=r.length;if(a.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;wn(r,l,u,s),i&&u&&ra(i,r,o.text)}else o.ins==-1?(wn(r,a.off?0:a.len,l,s),i&&ra(i,r,a.textBit(l))):(wn(r,a.off?0:a.len,o.off?0:o.ins,s),i&&!o.off&&ra(i,r,o.text));s=(a.ins>l||o.ins>=0&&o.len>l)&&(s||r.length>c),a.forward2(l),o.forward(l)}}}}class yc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Ot.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Ot.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class eo{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new eo(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return ge.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ge.range(this.anchor,r)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ge.range(e.anchor,e.head)}static create(e,n,r){return new eo(e,n,r)}}class ge{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ge.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ge([this.main],0)}addRange(e,n=!0){return ge.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,ge.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ge(e.ranges.map(n=>eo.fromJSON(n)),e.main)}static single(e,n=e){return new ge([ge.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let a=e[i];if(a.empty?a.from<=r:a.from<r)return ge.normalized(e.slice(),n);r=a.to}return new ge(e,n)}static cursor(e,n=0,r,i){return eo.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?eo.create(n,e,48|a):eo.create(e,n,(n>e?8:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,a)=>i.from-a.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let a=e[i],o=e[i-1];if(a.empty?a.from<=o.to:a.from<o.to){let s=o.from,l=Math.max(a.to,o.to);i<=n&&n--,e.splice(--i,2,a.anchor>a.head?ge.range(l,s):ge.range(s,l))}}return new ge(e,n)}}function pL(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let oy=0;class Pe{constructor(e,n,r,i,a){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=oy++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new Pe(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:sy),!!e.static,e.enables)}of(e){return new $f([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $f(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $f(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function sy(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class $f{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=oy++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,a=this.id,o=e[a]>>1,s=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:((n=e[d.id])!==null&&n!==void 0?n:1)&1||u.push(e[d.id]);return{create(d){return d.values[o]=r(d),1},update(d,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||ly(d,u)){let p=r(d);if(s?!hL(p,d.values[o],i):!i(p,d.values[o]))return d.values[o]=p,1}return 0},reconfigure:(d,f)=>{let p,h=f.config.address[a];if(h!=null){let m=Yf(f,h);if(this.dependencies.every(g=>g instanceof Pe?f.facet(g)===d.facet(g):g instanceof yn?f.field(g,!1)==d.field(g,!1):!0)||(s?hL(p=r(d),m,i):i(p=r(d),m)))return d.values[o]=m,0}else p=r(d);return d.values[o]=p,1}}}}function hL(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function ly(t,e){let n=!1;for(let r of e)Cc(t,r)&1&&(n=!0);return n}function HSe(t,e,n){let r=n.map(l=>t[l.id]),i=n.map(l=>l.type),a=r.filter(l=>!(l&1)),o=t[e.id]>>1;function s(l){let c=[];for(let u=0;u<r.length;u++){let d=Yf(l,r[u]);if(i[u]==2)for(let f of d)c.push(f);else c.push(d)}return e.combine(c)}return{create(l){for(let c of r)Cc(l,c);return l.values[o]=s(l),1},update(l,c){if(!ly(l,a))return 0;let u=s(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=ly(l,r),d=c.config.facets[e.id],f=c.facet(e);if(d&&!u&&sy(n,d))return l.values[o]=f,0;let p=s(l);return e.compare(p,f)?(l.values[o]=f,0):(l.values[o]=p,1)}}}const mL=Pe.define({static:!0});class yn{constructor(e,n,r,i,a){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=a,this.provides=void 0}static define(e){let n=new yn(oy++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(mL).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let a=r.values[n],o=this.updateF(a,i);return this.compareF(a,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,mL.of({field:this,create:e})]}get extension(){return this}}const to={lowest:4,low:3,default:2,high:1,highest:0};function Tc(t){return e=>new gL(e,t)}const ws={highest:Tc(to.highest),high:Tc(to.high),default:Tc(to.default),low:Tc(to.low),lowest:Tc(to.lowest)};class gL{constructor(e,n){this.inner=e,this.prec=n}}class qf{of(e){return new cy(this,e)}reconfigure(e){return qf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class cy{constructor(e,n){this.compartment=e,this.inner=n}}class Vf{constructor(e,n,r,i,a,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],a=Object.create(null),o=new Map;for(let f of zSe(e,n,o))f instanceof yn?i.push(f):(a[f.facet.id]||(a[f.facet.id]=[])).push(f);let s=Object.create(null),l=[],c=[];for(let f of i)s[f.id]=c.length<<1,c.push(p=>f.slot(p));let u=r==null?void 0:r.config.facets;for(let f in a){let p=a[f],h=p[0].facet,m=u&&u[f]||[];if(p.every(g=>g.type==0))if(s[h.id]=l.length<<1|1,sy(m,p))l.push(r.facet(h));else{let g=h.combine(p.map(_=>_.value));l.push(r&&h.compare(g,r.facet(h))?r.facet(h):g)}else{for(let g of p)g.type==0?(s[g.id]=l.length<<1|1,l.push(g.value)):(s[g.id]=c.length<<1,c.push(_=>g.dynamicSlot(_)));s[h.id]=c.length<<1,c.push(g=>HSe(g,h,p))}}let d=c.map(f=>f(s));return new Vf(e,o,d,s,l,a)}}function zSe(t,e,n){let r=[[],[],[],[],[]],i=new Map;function a(o,s){let l=i.get(o);if(l!=null){if(l<=s)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof cy&&n.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let c of o)a(c,s);else if(o instanceof cy){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),a(c,s)}else if(o instanceof gL)a(o.inner,o.prec);else if(o instanceof yn)r[s].push(o),o.provides&&a(o.provides,s);else if(o instanceof $f)r[s].push(o),o.facet.extensions&&a(o.facet.extensions,to.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(c,s)}}return a(t,to.default),r.reduce((o,s)=>o.concat(s))}function Cc(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Yf(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const _L=Pe.define(),bL=Pe.define({combine:t=>t.some(e=>e),static:!0}),vL=Pe.define({combine:t=>t.length?t[0]:void 0,static:!0}),EL=Pe.define(),SL=Pe.define(),yL=Pe.define(),TL=Pe.define({combine:t=>t.length?t[0]:!1});class Xr{constructor(e,n){this.type=e,this.value=n}static define(){return new WSe}}class WSe{of(e){return new Xr(this,e)}}class jSe{constructor(e){this.map=e}of(e){return new Je(this,e)}}class Je{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Je(this.type,n)}is(e){return this.type==e}static define(e={}){return new jSe(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let a=i.map(n);a&&r.push(a)}return r}}Je.reconfigure=Je.define(),Je.appendConfig=Je.define();class hn{constructor(e,n,r,i,a,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&pL(r,n.newLength),a.some(s=>s.type==hn.time)||(this.annotations=a.concat(hn.time.of(Date.now())))}static create(e,n,r,i,a,o){return new hn(e,n,r,i,a,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(hn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}hn.time=Xr.define(),hn.userEvent=Xr.define(),hn.addToHistory=Xr.define(),hn.remote=Xr.define();function KSe(t,e){let n=[];for(let r=0,i=0;;){let a,o;if(r<t.length&&(i==e.length||e[i]>=t[r]))a=t[r++],o=t[r++];else if(i<e.length)a=e[i++],o=e[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function CL(t,e,n){var r;let i,a,o;return n?(i=e.changes,a=pn.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),a=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(a):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Je.mapEffects(t.effects,i).concat(Je.mapEffects(e.effects,a)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function uy(t,e,n){let r=e.selection,i=Is(e.annotations);return e.userEvent&&(i=i.concat(hn.userEvent.of(e.userEvent))),{changes:e.changes instanceof pn?e.changes:pn.of(e.changes||[],n,t.facet(vL)),selection:r&&(r instanceof ge?r:ge.single(r.anchor,r.head)),effects:Is(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function OL(t,e,n){let r=uy(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(n=!1);let o=!!e[a].sequential;r=CL(r,uy(t,e[a],o?r.changes.newLength:t.doc.length),o)}let i=hn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return XSe(n?QSe(i):i)}function QSe(t){let e=t.startState,n=!0;for(let i of e.facet(EL)){let a=i(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:KSe(n,a))}if(n!==!0){let i,a;if(n===!1)a=t.changes.invertedDesc,i=pn.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,a=o.filtered.mapDesc(o.changes).invertedDesc}t=hn.create(e,i,t.selection&&t.selection.map(a),Je.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(SL);for(let i=r.length-1;i>=0;i--){let a=r[i](t);a instanceof hn?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof hn?t=a[0]:t=OL(e,Is(a),!1)}return t}function XSe(t){let e=t.startState,n=e.facet(yL),r=t;for(let i=n.length-1;i>=0;i--){let a=n[i](t);a&&Object.keys(a).length&&(r=CL(r,uy(e,a,t.changes.newLength),!0))}return r==t?t:hn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const ZSe=[];function Is(t){return t==null?ZSe:Array.isArray(t)?t:[t]}var Vt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Vt||(Vt={}));const JSe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let dy;try{dy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function eye(t){if(dy)return dy.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||JSe.test(n)))return!0}return!1}function tye(t){return e=>{if(!/\S/.test(e))return Vt.Space;if(eye(e))return Vt.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Vt.Word;return Vt.Other}}class ct{constructor(e,n,r,i,a,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,o&&(o._state=this);for(let s=0;s<this.config.dynamicSlots.length;s++)Cc(this,s<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Cc(this,r),Yf(this,r)}update(...e){return OL(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let o of e.effects)o.is(qf.reconfigure)?(n&&(i=new Map,n.compartments.forEach((s,l)=>i.set(l,s)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(Je.reconfigure)?(n=null,r=o.value):o.is(Je.appendConfig)&&(n=null,r=Is(r).concat(o.value));let a;n?a=e.startState.values.slice():(n=Vf.resolve(r,i,this),a=new ct(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(s,l)=>l.reconfigure(s,this),null).values),new ct(n,e.newDoc,e.newSelection,a,(o,s)=>s.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ge.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),a=[r.range],o=Is(r.effects);for(let s=1;s<n.ranges.length;s++){let l=e(n.ranges[s]),c=this.changes(l.changes),u=c.map(i);for(let f=0;f<s;f++)a[f]=a[f].map(u);let d=i.mapDesc(c,!0);a.push(l.range.map(d)),i=i.compose(u),o=Je.mapEffects(o,u).concat(Je.mapEffects(Is(l.effects),d))}return{changes:i,selection:ge.create(a,n.mainIndex),effects:o}}changes(e=[]){return e instanceof pn?e:pn.of(e,this.doc.length,this.facet(ct.lineSeparator))}toText(e){return Ot.of(e.split(this.facet(ct.lineSeparator)||ry))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Cc(this,n),Yf(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof yn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(e,a)){let o=r[a],s=e[a];i.push(o.init(l=>o.spec.fromJSON(s,l)))}}return ct.create({doc:e.doc,selection:ge.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Vf.resolve(e.extensions||[],new Map),r=e.doc instanceof Ot?e.doc:Ot.of((e.doc||"").split(n.staticFacet(ct.lineSeparator)||ry)),i=e.selection?e.selection instanceof ge?e.selection:ge.single(e.selection.anchor,e.selection.head):ge.single(0);return pL(i,r.length),n.staticFacet(bL)||(i=i.asSingle()),new ct(n,r,i,n.dynamicSlots.map(()=>null),(a,o)=>o.create(a),null)}get tabSize(){return this.facet(ct.tabSize)}get lineBreak(){return this.facet(ct.lineSeparator)||`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
3
  "private": false,
4
- "version": "1.1.34",
4
+ "version": "1.1.36",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",