(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1544],{3227:()=>{},5085:()=>{},14051:(e,t,s)=>{e.exports=s(34701)()},22855:(e,t,s)=>{"use strict";s.d(t,{C:()=>m});var i=s(95155),a=s(12115),r=s(24548),n=s(29722),l=s(7596);let u={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},o={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},h=e=>a.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function p({className:e,style:t,boxSize:s,size:i,onClick:r}){return a.createElement("span",{className:e,style:{...u,...r&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...r?{role:"button",tabIndex:"0",onClick:r}:{}},a.createElement(h,{viewBox:"0 0 24 24",style:o}))}p.displayName="IconFdsArrowUpRightSmallO";let d=(0,l.g)("check-all","sc"),c=Object.freeze({wrapper:`${d}__wrapper`,link:`${d}__link`,icon:`${d}__icon`,iconGray:`${d}__icon--gray`}),m=({children:e,className:t,linkClassName:s,iconGrayBackground:a,Link:l,event:u,href:o,dataLayerPush:h})=>{let d=l??r.N;return(0,i.jsx)("div",{className:(0,n.A)(c.wrapper,t),onClick:()=>{u&&h(u)},children:(0,i.jsxs)(d,{className:(0,n.A)(c.link,s),href:o,children:[e,(0,i.jsx)("span",{className:(0,n.A)(c.icon,{[c.iconGray]:a}),children:(0,i.jsx)(p,{size:24})})]})})}},24278:(e,t,s)=>{"use strict";s.d(t,{E:()=>u});var i=s(95155),a=s(29722),r=s(83640);s(3227);let n=(0,r.g)("skeleton"),l=Object.freeze({skeleton:n,states:{inline:`${n}--inline`,rounded:`${n}--rounded`,inverted:`${n}--inverted`,suspend:`${n}--suspend`}});function u({as:e,className:t="",width:s,height:r,inline:n=!1,rounded:o=!1,inverted:h=!1,suspend:p=!1,children:d,style:c,...m}){let g={...s&&{width:`${s}px`},...r&&{height:`${r}px`},...c};return(0,i.jsx)(e||"div",{className:(0,a.A)(l.skeleton,t,{[l.states.inline]:n,[l.states.rounded]:o,[l.states.inverted]:h,[l.states.suspend]:p}),style:g,"aria-hidden":"true",...m,children:d})}u.displayName="Skeleton"},24769:()=>{},25007:()=>{},26111:(e,t,s)=>{"use strict";s.d(t,{E:()=>w}),s(89190);var i=s(95155),a=s(66216),r=s(79253),n=s(29722),l=s(12115),u=s(24691),o=s(14347),h=s(17573),p=s(7596);let d={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},c={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},m=e=>l.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function g({className:e,style:t,boxSize:s,size:i,onClick:a}){return l.createElement("span",{className:e,style:{...d,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},l.createElement(m,{viewBox:"0 0 24 24",style:c}))}g.displayName="IconFdsArrowUpRightSmallO";let f=(0,p.g)("support","sc"),k=Object.freeze({support:f,title:`${f}__title`,cardsContainer:`${f}__cards-container`}),_="cb-support",v=(0,p.g)("support-app-card","sc"),x=Object.freeze({supportAppCard:v,textWrapper:`${v}__text-wrapper`,imageContainer:`${v}__image-container`,title:`${v}__title`,description:`${v}__description`,button:`${v}__button`,imageWrapper:`${v}__image-wrapper`,image:`${v}__image`}),C=({title:e,linkUrl:t,s3Assets:s,description:a})=>{let r=(0,o.nu)("s");return(0,i.jsxs)("div",{className:x.supportAppCard,onClick:()=>{r&&((0,h.h)({eventCategory:_,eventActionType:h.D.banner,eventActionText:e,eventLabel:t}),window.open(t,"_blank","noreferrer"))},children:[(0,i.jsx)(u.$,{className:x.button,iconLeft:(0,i.jsx)(g,{size:24}),shape:"circle-icon",size:"xs"}),(0,i.jsxs)("div",{className:x.textWrapper,children:[(0,i.jsx)("div",{className:x.title,children:e}),!!a&&(0,i.jsx)("div",{className:x.description,children:a})]}),(0,i.jsx)("div",{className:x.imageContainer,children:(0,i.jsxs)("picture",{className:x.imageWrapper,children:[(0,i.jsx)("source",{media:"(max-width: 767px)",srcSet:`${s}/mp-assets/widgets/SupportBlock/mobile-app.png 1x, ${s}/mp-assets/widgets/SupportBlock/mobile-app@2x.png 2x`}),(0,i.jsx)("img",{className:x.image,loading:"lazy",src:`${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg`,srcSet:`${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg 1x, ${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app@2x.jpg 2x`})]})})]})},b=(0,p.g)("support-phone-card","sc"),y=Object.freeze({supportPhoneCard:b,contacts:`${b}__contacts`,contactsExtra:`${b}__contacts-extra`,phone:`${b}__phone`,phonesExtra:`${b}__phones-extra`,phoneExtra:`${b}__phone-extra`,chat:`${b}__chat`,text:`${b}__text`,image:`${b}__image`}),A=({phones:e,phonesExtra:t,description:s,s3Assets:a})=>{let r=(0,l.useCallback)(()=>{var e,t,s;null==(s=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)||s.call(t),(0,h.h)({eventCategory:_,eventActionType:h.D.button,eventActionText:"messenger",eventLabel:"chat"})},[]),n=e=>{let t=e.replace(/[\s-]/g,"");(0,h.h)({eventCategory:_,eventActionType:h.D.link,eventActionText:"phone",eventLabel:t})};return(0,i.jsxs)("div",{className:y.supportPhoneCard,children:[(0,i.jsxs)("div",{className:y.contacts,children:[e.map(e=>(0,i.jsx)("a",{className:y.phone,href:e.href,onClick:()=>n(e.label),children:e.label},e.label)),(0,i.jsx)("span",{className:y.chat,onClick:r,children:"Онлайн чат"})]}),(null==t?void 0:t.length)>0&&(0,i.jsxs)("div",{className:y.contactsExtra,children:[(0,i.jsx)("p",{className:y.text,children:"Дополнительные телефоны"}),(0,i.jsx)("div",{className:y.phonesExtra,children:t.map(e=>(0,i.jsx)("a",{className:y.phoneExtra,href:e.href,onClick:()=>n(e.label),children:e.label},e.label))})]}),(0,i.jsx)("p",{className:y.text,children:s}),(0,i.jsx)("img",{className:y.image,src:`${a}/mp-assets/widgets/SupportBlock/bannerSupportGirl.png`,loading:"lazy"})]})},E=({className:e,phoneCard:t,appCard:s,s3Assets:l})=>t&&s?(0,i.jsx)("section",{className:(0,n.A)(k.support,e),children:(0,i.jsxs)(a.m,{children:[(0,i.jsx)(r.D,{as:"h2",type:"display",weight:"bold",className:k.title,children:"Поддержка"}),(0,i.jsxs)("div",{className:k.cardsContainer,children:[(0,i.jsx)(A,{s3Assets:l,...t}),(0,i.jsx)(C,{s3Assets:l,...s})]})]})}):null;E.displayName="Support";let w=E},28994:()=>{},30804:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var i=s(95155),a=s(12115),r=s(29722),n=s(83640);s(28994);let l=(0,n.g)("tag"),u=Object.freeze({tag:l,label:`${l}__label`,icon:`${l}__icon`,rounded:`${l}--rounded`,variant:{primary:`${l}--primary`,secondary:`${l}--secondary`,tertiary:`${l}--tertiary`,pink:`${l}--pink`,green:`${l}--green`,blue:`${l}--blue`,purple:`${l}--purple`,violet:`${l}--violet`,blur:`${l}--blur`},size:{s:`${l}--s`,m:`${l}--m`,l:`${l}--l`},iconMargin:{left:`${l}__icon--left`,right:`${l}__icon--right`}}),o=(0,a.forwardRef)(({label:e,size:t="m",rounded:s,variant:a="primary",iconLeft:n,iconRight:l,onIconLeftClick:o,onIconRightClick:h,className:p,style:d,dataQa:c,dataId:m,...g},f)=>(0,i.jsx)(i.Fragment,{children:e&&(0,i.jsxs)("div",{ref:f,className:(0,r.A)(u.tag,u.variant[a],u.size[t],{[u.rounded]:s},p),style:d,...g,"data-id":m,"data-qa":c,children:[n&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(u.icon,u.iconMargin.left,{[u.size.l]:"l"===t}),onClick:e=>null==o?void 0:o(e),disabled:!o,children:n}),(0,i.jsx)("span",{className:(0,r.A)(u.label,u.size[t]),children:e}),l&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(u.icon,u.iconMargin.right,{[u.size.l]:"l"===t}),onClick:e=>null==h?void 0:h(e),disabled:!h,children:l})]})}));o.displayName="Tag"},33715:(e,t,s)=>{"use strict";s.d(t,{m:()=>m});var i=s(95155),a=s(12115),r=s(76701),n=s(17294),l=s(9683),u=s(29722),o=s(37370),h=s(92681);let p=(0,s(83640).g)("tooltip"),d=Object.freeze({tooltip:p,text:`${p}__text`,wrapper:`${p}__wrapper`,inverted:`${p}--inverted`});s(25007);let c=({children:e,moveToBody:t})=>t?(0,i.jsx)(r.XF,{id:o.T,children:e}):(0,i.jsx)(i.Fragment,{children:e}),m=(0,a.forwardRef)(({position:e="top",text:t,zIndex:s=1,inverted:o,withoutTail:p,children:m,boundingOffset:g=12,boundaryPadding:f,moveToBody:k=!1,hideWhenOutOfBounds:_=!1,style:v,className:x,dataQa:C,dataId:b,...y},A)=>{let[E,w]=(0,a.useState)(!1),F=(0,a.useRef)(null),{refs:S,floatingStyles:B,context:V,middlewareData:D}=(0,r.we)({open:E,onOpenChange:w,placement:e,whileElementsMounted:n.ll,middleware:[(0,l.cY)({mainAxis:g}),(0,l.UU)({fallbackAxisSideDirection:"start",crossAxis:!1,...void 0!==f&&{padding:f}}),(0,l.BN)({...void 0!==f&&{padding:f}}),(0,l.UE)({element:F,padding:8}),..._?[(0,l.jD)({strategy:"escaped",padding:-24})]:[]]}),I=(0,r.Mk)(V,{delay:300}),{getReferenceProps:M,getFloatingProps:T}=(0,r.bv)([I]),P=(0,r.DL)(V,{duration:300});return(0,a.useImperativeHandle)(A,()=>({getActivatorElement:S.reference,getTooltipElement:S.floating})),(0,a.useEffect)(()=>{var e;(null==(e=D.hide)?void 0:e.escaped)&&w(!1)},[D.hide]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{"data-qa":(0,h.g)(`${C}-activator`,!!C),ref:S.setReference,...M,className:d.wrapper,children:m}),P.isMounted&&(0,i.jsx)(c,{moveToBody:k,children:(0,i.jsxs)("div",{role:"tooltip",ref:S.setFloating,style:{...B,...P.styles,...v,zIndex:s},className:(0,u.A)(d.tooltip,x,{[d.inverted]:o}),...T,...y,"data-qa":C,"data-id":b,children:[(0,i.jsx)("span",{className:(0,u.A)(d.text,{[d.inverted]:o}),children:t}),!p&&(0,i.jsx)(r.ie,{ref:F,context:V,width:16,d:"M8 10C6 12.58 3.43 16 0 16L16 16C12.58 16 10 12.58 8 10Z",fill:o?"var(--color-white)":"var(--color-black-500)"})]})})]})});m.displayName="Tooltip"},34701:(e,t,s)=>{"use strict";var i=s(82114);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,s,a,r,n){if(n!==i){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:a};return s.PropTypes=s,s}},48616:(e,t,s)=>{"use strict";let i;s.d(t,{g3:()=>en}),s(24769);var a=s(95155),r=s(12115),n=s(66216),l=s(79253),u=s(43780),o=s(29722),h=s(22855),p=s(17281),d=s(8260),c=s(7596),m=s(24691),g=s(17194),f=s(33715),k=s(30804),_=s(92694),v=s(51288);let x=(0,r.forwardRef)(({maskOpts:e,value:t="",autoFocus:s=!1,onChange:i,onKeyDown:n,...l},u)=>{let[o,h]=(0,r.useState)(""),{ref:p,setValue:d,unmaskedValue:c}=(0,_.$o)(e,{onAccept:(e,t)=>{h(e),null==i||i(t.unmaskedValue,e)}});return(0,r.useEffect)(()=>{t!==c&&(d(t),h(t))},[t,d,c]),(0,r.useImperativeHandle)(u,()=>p.current),(0,a.jsx)(v.I,{...l,autoFocus:s,inputRef:p,value:o,onKeyDown:e=>{("Escape"===e.key||"Esc"===e.key)&&(e.preventDefault(),d(""),h(""),null==i||i("","")),null==n||n(e)}})});x.displayName="InputMasked";var C=s(24548),b=s(66627),y=s(17806);let A={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},E={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},w=e=>r.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function F({className:e,style:t,boxSize:s,size:i,onClick:a}){return r.createElement("span",{className:e,style:{...A,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},r.createElement(w,{viewBox:"0 0 24 24",style:E}))}F.displayName="IconFdsArrowUpRightSmallO";var S=((i=S||{}).light="light",i.gray="gray",i);let B=(0,c.g)("best-offers-banner","sc"),V=Object.freeze({bestOffersBaner:B,wrapper:`${B}__wrapper`,wideWrapper:`${B}__wrapper--wide`,whiteWrapper:`${B}__wrapper--white`,content:`${B}__content`,header:`${B}__header`,title:`${B}__title`,subtitle:`${B}__subtitle`,icon:`${B}__icon`,iconBlack:`${B}__icon--black`,iconWhite:`${B}__icon--white`,image:`${B}__image`}),D=({title:e,image:t,url:s,description:i,backgroundColor:r,textColor:n,wide:l,theme:h,handleBannerDataLayerPush:p,className:d})=>{let c=h===S.gray,m={"--bg-base":(null==r?void 0:r.base)??(c?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==r?void 0:r.hover)??"var(--color-gray-500)"};return(0,a.jsxs)("div",{className:(0,o.A)(V.wrapper,d,{[V.wideWrapper]:l}),style:m,onClick:()=>{p(),window.open(s,"_blank")},children:[(0,a.jsxs)("div",{className:V.content,children:[(0,a.jsxs)("div",{className:V.header,children:[(0,a.jsx)(u.E,{weight:"medium",size:"24",className:V.title,style:{color:n},children:e}),(0,a.jsx)("div",{className:(0,o.A)(V.icon,{[V.iconBlack]:c&&!(null!=n&&n.includes("color-white")),[V.iconWhite]:c&&!!(null!=n&&n.includes("color-white"))}),children:(0,a.jsx)(F,{size:32})})]}),i&&(0,a.jsx)(u.E,{size:"16",style:{color:n},children:i})]}),(null==t?void 0:t.url)&&(0,a.jsx)("picture",{className:V.image,children:(0,a.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},I=(0,c.g)("offer-card","sc"),M=Object.freeze({offerCard:I,wrapper:`${I}__wrapper`,whiteWrapper:`${I}__wrapper--white`,bankInfo:`${I}__bankInfo`,units:`${I}__units`,unitsColumn:`${I}__units--column`,unit:`${I}__unit`,unitRow:`${I}__unit--row`,unitTitleWrapper:`${I}__unitTitleWrapper`,unitTitle:`${I}__unitTitle`,tooltipIcon:`${I}__tooltipIcon`,unitValue:`${I}__unitValue`,bottomBlock:`${I}__bottomBlock`,tags:`${I}__tags`,tag:`${I}__tag`,button:`${I}__button`,buttonRounded:`${I}__button--rounded`,buttonAdditional:`${I}__button--additional`}),T={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},P={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"};function R(e){return{width:`${e}px`,height:`${e}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"}}let j=e=>r.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10a9.971 9.971 0 007.071-2.929A9.97 9.97 0 0022 12c0-5.523-4.477-10-10-10zM3.5 12a8.5 8.5 0 1117 0 8.5 8.5 0 01-17 0zm8.872-4.977C13.657 7.18 15 8.15 15 9.761c0 .698-.179 1.238-.504 1.665-.307.401-.704.644-.98.812-.313.191-.477.293-.595.43-.083.096-.17.246-.17.584a.75.75 0 01-1.5 0c0-.66.193-1.164.531-1.558.28-.326.64-.544.89-.695l.062-.037c.287-.175.452-.29.568-.442.096-.126.198-.335.198-.759 0-.633-.532-1.158-1.309-1.252-.716-.087-1.454.236-1.717 1.2a.75.75 0 01-1.447-.394c.486-1.78 1.998-2.454 3.345-2.292zM11.999 15a1 1 0 10.002 2 1 1 0 00-.002-2z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function $({className:e,style:t,boxSize:s,size:i,onClick:a}){return r.createElement("span",{className:e,style:{...T,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&R(s),...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},r.createElement(j,{viewBox:"0 0 24 24",style:P}))}$.displayName="IconFdsQuestionCircleO";let N=e=>r.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M13.328 2.869a1.444 1.444 0 00-2.65 0A694.174 694.174 0 008.47 7.85a648.96 648.96 0 00-5.196.656c-1.266.165-1.673 1.722-.823 2.553a641.289 641.289 0 003.856 3.748A704.06 704.06 0 005.29 20.22c-.214 1.16.995 2.24 2.15 1.572a650.04 650.04 0 004.562-2.66c1.504.887 3.346 1.956 4.564 2.66 1.154.667 2.363-.411 2.15-1.572a702.887 702.887 0 00-1.017-5.412 664.068 664.068 0 003.856-3.748c.85-.832.443-2.389-.824-2.553-1.383-.18-3.479-.45-5.195-.657a696.41 696.41 0 00-2.208-4.982z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function O({className:e,style:t,boxSize:s,size:i,onClick:a}){return r.createElement("span",{className:e,style:{...T,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&R(s),...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},r.createElement(N,{viewBox:"0 0 24 24",style:P}))}O.displayName="IconFdsStarF";let L=({title:e,value:t,tooltip:s,textColor:i,unitsAsColumn:n,isTitleUnit:l})=>{let h;return(0,a.jsxs)("div",{className:(0,o.A)(M.unit,{[M.unitRow]:n}),children:[(0,a.jsxs)("div",{className:M.unitTitleWrapper,children:[(0,a.jsx)(u.E,{size:"14",className:M.unitTitle,children:e}),s&&(0,a.jsx)(f.m,{text:s,children:(0,a.jsx)($,{className:M.tooltipIcon})})]}),(0,a.jsx)(u.E,{weight:"medium",size:l?"18":n?"16":"24",className:M.unitValue,style:{color:i},children:e.includes("Рейтинг")?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):(h=t.split("₽")).map((e,t)=>(0,a.jsxs)(r.Fragment,{children:[e,t<h.length-1&&(0,a.jsx)(u.E,{weight:"regular",children:"₽"})]},`${e}-${t}`))})]})},z=({tags:e,isGrayTheme:t})=>{let s=t?"secondary":"primary";return(0,a.jsx)("div",{className:M.tags,children:e.sort((e,t)=>e.order-t.order).map(e=>(0,a.jsx)(k.v,{className:M.tag,label:e.label,variant:e.variant?e.variant:s,rounded:!0},e.label))})},U=({companyName:e,name:t,url:s,logo:i,units:r,tags:n,additionalButton:l,unitsAsColumn:u,dataLayerPush:h,eventCategory:p,productType:d,theme:c,buttonClassName:f,eventValueByUnitTitle:k})=>{let _=c===S.gray,v=s=>{let i={event:"data-event",eventCategory:p,eventAction:`click_button_${(0,g.t)(s)}_${d}`,eventLabel:(0,g.t)(`${e}_${t}`)};if(k){let e=r.find(e=>e.title.toLowerCase()===k.toLowerCase());e&&(i.eventValue=(0,g.t)(e.value))}h(i)};return(0,a.jsxs)("div",{className:(0,o.A)(M.wrapper,{[M.whiteWrapper]:_}),children:[(0,a.jsxs)("div",{className:M.bankInfo,children:[i&&(0,a.jsx)("img",{src:i,width:56,height:56,alt:`${e} logo`,loading:"lazy"}),(0,a.jsx)(L,{title:t,value:e,isTitleUnit:!0})]}),(0,a.jsx)("div",{className:(0,o.A)(M.units,{[M.unitsColumn]:u}),children:r.map(e=>(0,a.jsx)(L,{title:e.title,value:e.value,tooltip:e.tooltip,textColor:e.textColor,unitsAsColumn:u},`${e.title}-${e.value}`))}),(0,a.jsxs)("div",{className:M.bottomBlock,children:[n&&(0,a.jsx)(z,{tags:n,isGrayTheme:_}),l&&l.text.trim().length>0&&(0,a.jsx)(m.$,{as:"a",className:(0,o.A)(M.button,M.buttonRounded,M.buttonAdditional),size:"xs",label:l.text,href:null==l?void 0:l.url,variant:_?"secondary":"white",onClick:()=>v(l.text)}),(0,a.jsx)(m.$,{as:"a",className:(0,o.A)(M.button,f),size:"xs",label:"Подробнее",href:s,onClick:()=>v("podrobnee_o_kartochke_iz")})]})]})},q=(0,c.g)("offers-list","sc"),W=Object.freeze({offersList:q,wrapper:`${q}__wrapper`,sliderWrapper:`${q}__sliderWrapper`,offerItem:`${q}__offerItem`,compact:`${q}__offerItem--compact`,bannerItem:`${q}__bannerItem`}),H=({offers:e,banner:t,dataLayerPush:s,eventCategory:i,productType:r,theme:n,singleProduct:l})=>{let u=e.length<=2;return(0,a.jsxs)(d.A,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:W.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,a.jsx)(d.D,{className:(0,o.A)(W.offerItem,{[W.compact]:l}),children:(0,a.jsx)(U,{...e,dataLayerPush:s,eventCategory:i,productType:r,theme:n})},e.id)),t&&(0,a.jsx)(d.D,{className:W.bannerItem,children:(0,a.jsx)(D,{...t,handleBannerDataLayerPush:()=>{s({event:"data-event",eventCategory:i,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:r})},wide:u,theme:n})})]},r)},K=(0,c.g)("osago-tab","sc"),Y=Object.freeze({osagoTab:K,wrapper:`${K}__wrapper`,card:`${K}__card`,whiteCard:`${K}__card--white`,image:`${K}__image`,content:`${K}__content`,inputWrapper:`${K}__inputWrapper`,select:`${K}__select`,input:`${K}__input`,buttonLinkWrapper:`${K}__buttonLinkWrapper`,button:`${K}__button`,banner:`${K}__banner`}),G={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},X=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],Z=Object.fromEntries(X.map(e=>[e.value,e])),Q={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},J="АВЕКМНОРСТУХ",ee=RegExp(`[${J}]`,"i"),et=RegExp(`[^0-9${J}]`,"gi"),es=({type:e,baseUrl:t,s3Assets:s,banner:i,dataLayerPush:n,eventCategory:h,theme:p})=>{let d="osago"===e,c=(0,y.oq)(t,"osago"),f=(0,y.oq)(c,"step-car"),k=(0,y.oq)(t,"kasko"),_=(0,y.oq)(k,"vehicle"),v=d?f:_,[A,E]=(0,r.useState)(""),[w,F]=(0,r.useState)("auto"),{mask:B,placeholder:V}=Q[w],I=p===S.gray,M=`?${new URLSearchParams({type:d?w:"auto",license:A})}`,T=(0,y.oq)(v,M),P=i??{...G[e],url:d?c:k,image:s?{url:(0,y.oq)(s,`widgets/BestOffers/${d?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},R=Z[w].label,j=(t,s)=>{n({event:"data-event",eventCategory:h,eventAction:t,eventLabel:s??e})};return(0,a.jsxs)("div",{className:Y.wrapper,children:[(0,a.jsxs)("div",{className:(0,o.A)(Y.card,{[Y.whiteCard]:I}),children:[s&&(0,a.jsx)("picture",{children:(0,a.jsx)("img",{src:`${s}/widgets/BestOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:Y.image})}),(0,a.jsxs)("div",{className:Y.content,children:[(0,a.jsxs)(l.D,{as:"h3",type:"h3",children:["Онлайн калькулятор ",d?"ОСАГО":"Каско"]}),(0,a.jsxs)("div",{className:Y.inputWrapper,children:[d&&(0,a.jsx)(b.l,{options:X,value:Z[w],label:"Тип транспорта",variant:I?"primary":"secondary",className:Y.select,onChange:e=>{E(""),F(e.value),j(`selector_item_${(0,g.t)(e.label)}`)}}),(0,a.jsx)(x,{label:"Госномер",variant:I?"primary":"secondary",maskOpts:{mask:B,definitions:{a:ee}},maskPlaceholder:V,value:A,className:Y.input,onChange:(e,t)=>{E(t.replace(et,"").toUpperCase())},onClick:()=>j(`message_field_${(0,g.t)(R)}`),onBlur:()=>j(`on_message_field_${(0,g.t)(R)}`)}),(0,a.jsxs)(u.E,{children:["У меня"," ",(0,a.jsx)(C.N,{href:v,onClick:()=>{j("click_link_net_nomera",v)},children:"нет номера"})]})]}),(0,a.jsx)(m.$,{as:"a",href:T,size:"s",className:Y.button,onClick:()=>{j(`click_button_rasschitat_${(0,g.t)(R)}`,T)},children:"Рассчитать"})]})]}),(0,a.jsx)("div",{className:Y.banner,children:(0,a.jsx)(D,{...P,theme:p,handleBannerDataLayerPush:()=>{j("click_bnr_banner_top_predlozheniy")}})})]})},ei=(0,c.g)("best-offers","sc"),ea=Object.freeze({bestOffers:ei,graySection:`${ei}--gray`,singleProduct:`${ei}--singleProduct`,titleWrapper:`${ei}__title-wrapper`,singleProductTitleWrapper:`${ei}__title-wrapper--singleProduct`,title:`${ei}__title`,singleProductTitle:`${ei}__title--singleProduct`,chips:`${ei}__chips`,warning:`${ei}__warning`,allOffersLink:`${ei}__allOffersLink`}),er={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","Кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам"},en=({tabs:e,baseUrl:t,s3Assets:s,eventCategory:i="best-offers",dataLayerPush:d,singleProduct:c=!1,theme:m=S.light,className:g,initialActiveChipId:f})=>{var k;let _,v=m===S.gray,x=Array.isArray(e)?e.filter(({banner:e,offers:t,productType:s})=>!!e||!!(null!=t&&t.length)||"osago"===s||"kasko"===s).map(e=>({...e,offers:Array.isArray(e.offers)?e.offers:[]})):[],C=x.map(e=>({url:e.productType,title:e.name})),b=(null==(k=C[0])?void 0:k.url)??"",[y,A]=(0,r.useState)(f??b),E=y&&x.some(e=>e.productType===y)?y:b,w=x.find(e=>e.productType===E)??x[0];if(!w)return null;let F=er[w.name.toLowerCase()],B=F?`по ${F}`:w.name,V=("kasko"===(_=null==w?void 0:w.productType)||"osago"===_)&&t?(0,a.jsx)(es,{type:w.productType,banner:w.banner,baseUrl:t,s3Assets:s,dataLayerPush:d,eventCategory:i,theme:m}):null;return(0,a.jsx)("section",{className:(0,o.A)(ea.bestOffers,g,{[ea.singleProduct]:c,[ea.graySection]:v}),children:(0,a.jsxs)(n.m,{children:[(0,a.jsx)("div",{className:(0,o.A)(ea.titleWrapper,c&&ea.singleProductTitleWrapper),children:(0,a.jsxs)(l.D,{as:"h2",type:c?"h2":"display",className:(0,o.A)(ea.title,c&&ea.singleProductTitle),children:["Лучшие предложения ",c?B:"сегодня"]})}),!c&&(0,a.jsx)(p.N,{items:C,maxNumberOfLines:2,activeChipId:E,variant:v?"white":"gray",className:ea.chips,onClick:e=>{A(e);let t=x.find(t=>t.productType===e);d({event:"data-event",eventCategory:i,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==t?void 0:t.productType})}}),(0,a.jsxs)("div",{children:[V??(0,a.jsx)(H,{offers:w.offers,banner:w.banner,dataLayerPush:d,eventCategory:i,productType:w.productType,theme:m,singleProduct:c}),w.hasWarning&&(0,a.jsx)(u.E,{as:"p",size:"16",className:ea.warning,children:w.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),w.checkAllUrl&&(0,a.jsx)(h.C,{href:w.checkAllUrl,event:{event:"data-event",eventCategory:i,eventAction:"link",eventLabel:`Показать все предложения ${w.productType}`},dataLayerPush:d,iconGrayBackground:!v,className:ea.allOffersLink,linkClassName:w.checkAllLinkClassName,children:"Показать все предложения"})]})})}},73321:(e,t,s)=>{"use strict";var i=s(74645);s.o(i,"notFound")&&s.d(t,{notFound:function(){return i.notFound}}),s.o(i,"usePathname")&&s.d(t,{usePathname:function(){return i.usePathname}}),s.o(i,"useRouter")&&s.d(t,{useRouter:function(){return i.useRouter}}),s.o(i,"useSearchParams")&&s.d(t,{useSearchParams:function(){return i.useSearchParams}})},79253:(e,t,s)=>{"use strict";s.d(t,{D:()=>h});var i=s(95155),a=s(29722),r=s(86253),n=s(83640);s(95124);let l={display:"h1",hero:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},u=(0,n.g)("heading"),o=Object.freeze({heading:u,states:Object.freeze({display:`${u}--display`,hero:`${u}--hero`,h1:`${u}--h1`,h2:`${u}--h2`,h3:`${u}--h3`,h4:`${u}--h4`,h5:`${u}--h5`,h6:`${u}--h6`})}),h=({as:e,children:t,weight:s,type:n,lineClamp:u,className:h,style:p,dataQa:d,dataId:c,...m})=>{var g;let f=e||l[n]||"div",k=/^h[1-6]$/.test(f),_=(null==(g=n.match(/\d+/))?void 0:g[0])||1;return(0,i.jsx)(f,{className:(0,a.A)(o.heading,o.states[n],h),style:{...s?{fontWeight:`var(--font-weight-${s})`}:void 0,...u?{WebkitLineClamp:u,lineClamp:u,...r.l}:void 0,...p},role:k?null:"heading","aria-level":k?null:_,...m,"data-id":c,"data-qa":d,children:t})};h.displayName="Heading"},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},89190:()=>{},89584:(e,t,s)=>{"use strict";s.d(t,{s:()=>c});var i=s(95155),a=s(12115),r=s(29722),n=s(66424),l=s(86969),u=s(70179),o=s(26048),h=s(83640);s(97903);let p=(0,h.g)("radio"),d=Object.freeze({radio:p,input:`${p}__input`,marker:`${p}__marker`,wrapper:`${p}__wrapper`,label:`${p}__label`,caption:`${p}__caption`,icon:`${p}__icon`,iconButton:`${p}__icon-button`,states:{error:`${p}--error`,disabled:`${p}--disabled`,inverted:`${p}--inverted`},sizes:{xs:`${p}--xs`,s:`${p}--s`,m:`${p}--m`},variants:{primary:`${p}--primary`,secondary:`${p}--secondary`}}),c=(0,a.forwardRef)(({value:e,variant:t="primary",checked:s=!1,state:h="default",label:p,disabled:c=!1,caption:m,className:g,style:f,icon:k,withIcon:_=!1,size:v="m",inverted:x=!1,children:C,inputRef:b,onChange:y,onIconClick:A,dataQa:E,dataId:w,...F},S)=>{let B=(0,a.useId)(),V=C||p;return(0,i.jsxs)("label",{ref:S,htmlFor:B,"data-marker-label":"",className:(0,r.A)(g,d.radio,{[d.states.disabled]:c,[d.states.inverted]:x,[d.states.error]:"error"===h,[d.sizes[v]]:!0,[d.variants[t]]:!0}),style:f,"data-id":w,"data-qa":E,children:[(0,i.jsx)("input",{id:B,value:e,checked:s,className:d.input,type:"radio",disabled:c,onChange:e=>{null==y||y(e.target.value,e)},ref:b,...F}),(0,i.jsx)("span",{className:d.marker,children:(0,i.jsx)(u.C,{type:"radio",checked:s,inverted:x,state:h,disabled:c})}),V&&(0,i.jsxs)("span",{className:d.wrapper,children:[(0,i.jsx)("span",{className:d.label,children:V}),m&&(0,i.jsx)(l.C,{className:d.caption,withoutIcon:!0,children:m})]}),_&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(d.iconButton),onClick:c?void 0:A,children:(0,i.jsx)(o.P,{className:(0,r.A)(d.icon),children:k?(0,i.jsx)(i.Fragment,{children:k}):(0,i.jsx)(n.S,{})})})]})});c.displayName="Radio"},91501:(e,t,s)=>{"use strict";s.d(t,{g:()=>i});let i=()=>Date.now().toString()+Math.random().toString(36).slice(2,9)},92694:(e,t,s)=>{"use strict";let i;function a(e){return"string"==typeof e||e instanceof String}function r(e){var t;return"object"==typeof e&&null!=e&&(null==e||null==(t=e.constructor)?void 0:t.name)==="Object"}s.d(t,{g5:()=>m,$o:()=>Z});let n="NONE",l="LEFT",u="FORCE_LEFT",o="RIGHT",h="FORCE_RIGHT";function p(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function d(e,t){let s;if(t===e)return!0;let i=Array.isArray(t),a=Array.isArray(e);if(i&&a){if(t.length!=e.length)return!1;for(s=0;s<t.length;s++)if(!d(t[s],e[s]))return!1;return!0}if(i!=a)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){let i=t instanceof Date,a=e instanceof Date;if(i&&a)return t.getTime()==e.getTime();if(i!=a)return!1;let r=t instanceof RegExp,n=e instanceof RegExp;if(r&&n)return t.toString()==e.toString();if(r!=n)return!1;let l=Object.keys(t);for(s=0;s<l.length;s++)if(!Object.prototype.hasOwnProperty.call(e,l[s]))return!1;for(s=0;s<l.length;s++)if(!d(e[l[s]],t[l[s]]))return!1;return!0}return!!t&&!!e&&"function"==typeof t&&"function"==typeof e&&t.toString()===e.toString()}class c{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?n:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?o:l}}function m(e,t){return new m.InputMask(e,t)}function g(e){if(null==e)throw Error("mask property should be defined");return e instanceof RegExp?m.MaskedRegExp:a(e)?m.MaskedPattern:e===Date?m.MaskedDate:e===Number?m.MaskedNumber:Array.isArray(e)||e===Array?m.MaskedDynamic:m.Masked&&e.prototype instanceof m.Masked?e:m.Masked&&e instanceof m.Masked?e.constructor:e instanceof Function?m.MaskedFunction:(console.warn("Mask not found for mask",e),m.Masked)}function f(e){if(!e)throw Error("Options in not defined");if(m.Masked){if(e.prototype instanceof m.Masked)return{mask:e};let{mask:t,...s}=e instanceof m.Masked?{mask:e}:r(e)&&e.mask instanceof m.Masked?e:{};if(t){let e=t.mask;return{...function e(t,s){return Array.isArray(s)?e(t,(e,t)=>s.includes(t)):Object.entries(t).reduce((e,t)=>{let[i,a]=t;return s(a,i)&&(e[i]=a),e},{})}(t,(e,t)=>!t.startsWith("_")),mask:t.constructor,_mask:e,...s}}}return r(e)?{...e}:{mask:e}}function k(e){if(m.Masked&&e instanceof m.Masked)return e;let t=f(e),s=g(t.mask);if(!s)throw Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===s&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new s(t)}m.createMask=k;class _{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}m.MaskElement=_;class v extends _{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return null!=(e=null==(t=(s=this.input).getRootNode)?void 0:t.call(s))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(90===e.keyCode&&e.shiftKey&&(e.metaKey||e.ctrlKey)||89===e.keyCode&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&90===e.keyCode&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(!e.isComposing&&this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}m.HTMLMaskElement=v;class x extends v{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}m.HTMLMaskElement=v;class C extends v{get _unsafeSelectionStart(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s<i?s:i}get _unsafeSelectionEnd(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s>i?s:i}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;let s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);let i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}m.HTMLContenteditableMaskElement=C;class b{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>b.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}b.MAX_LENGTH=100;class y{constructor(e,t){this.el=e instanceof _?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new C(e):new x(e),this.masked=k(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new b,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof m.Masked)&&this.masked.constructor===g(e))return void this.masked.updateOptions({mask:e});let t=e instanceof m.Masked?e:k({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){let s=this._listeners[e];s&&s.forEach(e=>e(t))}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,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){let t=this.masked.unmaskedValue,s=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,r=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==i;this._unmaskedValue=t,this._value=s,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){let{mask:t,...s}=e,i=!this.maskEquals(t),a=this.masked.optionsIsChanged(s);i&&(this.mask=t),a&&this.masked.updateOptions(s),(i||a)&&this.updateControl()}updateCursor(e){null!=e&&(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,l))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;let s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();let t=new c({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,i=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?t.removeDirection:n,r=this.masked.nearestInputPos(t.startChangePos+i,a);a!==n&&(r=this.masked.nearestInputPos(r,n)),this.updateControl(r),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()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}m.InputMask=y;class A{static normalize(e){return Array.isArray(e)?e:[e,new A]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}m.ChangeDetails=A;class E{constructor(e,t,s){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=s}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||null!=e&&this.from>=e)return"";let t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";let e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class w{constructor(e){this._value="",this._update({...w.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&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,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),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,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new E(this.extractInput(e,t),e)}appendTail(e){return a(e)&&(e=new E(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new A({inserted:e,rawInserted:e})):new A}_appendChar(e,t,s){let i;void 0===t&&(t={});let a=this.state;if([e,i]=this.doPrepareChar(e,t),e&&!(i=i.aggregate(this._appendCharRaw(e,t))).rawInserted&&"pad"===this.autofix){let s=this.state;this.state=a;let r=this.pad(t),n=this._appendCharRaw(e,t);r=r.aggregate(n),n.rawInserted||r.equals(i)?i=r:this.state=s}if(i.inserted){let e,r=!1!==this.doValidate(t);if(r&&null!=s){let t=this.state;if(!0===this.overwrite){e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.unshift(this.displayValue.length-i.tailShift)}let a=this.appendTail(s);if(!((r=a.rawInserted.length===s.toString().length)&&a.inserted)&&"shift"===this.overwrite){this.state=t,e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.shift();r=(a=this.appendTail(s)).rawInserted.length===s.toString().length}r&&a.inserted&&(this.state=t)}!r&&(i=new A,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new A}_appendEager(){return new A}append(e,t,s){let i;if(!a(e))throw Error("value should be string");let r=a(s)?new E(String(s)):s;null!=t&&t.tail&&(t._beforeTailState=this.state),[e,i]=this.doPrepare(e,t);for(let s=0;s<e.length;++s){let a=this._appendChar(e[s],t,r);if(!a.rawInserted&&!this.doSkipInvalid(e[s],t,r))break;i.aggregate(a)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&i.aggregate(this._appendEager()),null!=r&&(i.tailShift+=this.appendTail(r).tailShift),i}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new A}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;let t=this.rawInputValue,s=this.value,i=e();return this.rawInputValue=t,this.value&&this.value!==s&&0===s.indexOf(this.value)&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;let t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return void 0===t&&(t={}),A.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),A.normalize(this.prepareChar?this.prepareChar(e,this,t):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,t,s,i,a){let r;void 0===s&&(s=""),void 0===i&&(i=n),void 0===a&&(a={input:!0});let p=e+t,d=this.extractTail(p),c=!0===this.eager||"remove"===this.eager;c&&(i=function(e){switch(e){case l:return u;case o:return h;default:return e}}(i),r=this.extractInput(0,p,{raw:!0}));let m=e,g=new A;if(i!==n&&(g.tailShift=(m=this.nearestInputPos(e,t>1&&0!==e&&!c?n:i))-e),g.aggregate(this.remove(m)),c&&i!==n&&r===this.rawInputValue)if(i===u){let e;for(;r===this.rawInputValue&&(e=this.displayValue.length);)g.aggregate(new A({tailShift:-1})).aggregate(this.remove(e-1))}else i===h&&d.unshift();return g.aggregate(this.append(s,a,d))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!d(this,e)}typedValueEquals(e){let t=this.typedValue;return e===t||w.EMPTY_VALUES.includes(e)&&w.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new A}}w.DEFAULTS={skipInvalid:!0},w.EMPTY_VALUES=[void 0,null,""],m.Masked=w;class F{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=a(e)?new E(String(e)):e;let t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof E)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof F){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof m.MaskedPattern))return new E(this.toString()).appendTo(e);let t=new A;for(let s=0;s<this.chunks.length;++s){let i,a=this.chunks[s],r=e._mapPosToBlock(e.displayValue.length),n=a.stop;if(null!=n&&(!r||r.index<=n)&&((a instanceof F||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),i=a instanceof F&&e._blocks[n]),i){let s=i.appendTail(a);t.aggregate(s);let r=a.toString().slice(s.rawInserted.length);r&&t.aggregate(e.append(r,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){let{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(e=>{let t="chunks"in e?new F:new E;return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";let t=null!=e?e-this.from:e,s=0;for(;s<this.chunks.length;){let e=this.chunks[s],i=e.unshift(t);if(e.toString()){if(!i)break;++s}else this.chunks.splice(s,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){let t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class S{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:i}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){let 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=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;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,u),0!==this.offset))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,l),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,l),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,h),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,n),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,n),!0})}}class B{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,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new A}nearestInputPos(e,t){void 0===t&&(t=n);let s=this._value.length;switch(t){case l:case u:return 0;default:return s}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===s&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new A;let s=!0===this.eager||"append"===this.eager,i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,a=new A({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let e=new A;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new E("")}appendTail(e){return a(e)&&(e=new E(String(e))),e.appendTo(this)}append(e,t,s){let i=this._appendChar(e[0],t);return null!=s&&(i.tailShift+=this.appendTail(s).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class V{constructor(e){const{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n,...l}=e;this.masked=k(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1)?(this.isFilled=!1,this.masked.remove(e,t)):new A}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,t){if(void 0===t&&(t={}),this.isFilled)return new A;let s=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&!1===this.doValidate(t)&&(i=new A,this.masked.state=s),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new A:(this.isFilled=!0,new A({inserted:this.placeholderChar}))}_appendEager(){return new A}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){void 0===t&&(t=n);let s=this.value.length,i=Math.min(Math.max(e,0),s);switch(t){case l:case u:return this.isComplete?i:0;case o:case h:return this.isComplete?i:s;default:return i}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).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 t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new A}}V.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 D extends w{updateOptions(e){super.updateOptions(e)}_update(e){let t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}m.MaskedRegExp=D;class I extends w{constructor(e){super({...I.DEFAULTS,...e,definitions:Object.assign({},V.DEFAULT_DEFINITIONS,null==e?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(){let e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let t=this.mask;if(!t||!e)return;let s=!1,i=!1;for(let a=0;a<t.length;++a){if(this.blocks){let e=t.slice(a),s=Object.keys(this.blocks).filter(t=>0===e.indexOf(t));s.sort((e,t)=>t.length-e.length);let i=s[0];if(i){let{expose:e,repeat:t,...s}=f(this.blocks[i]),r={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:t,parent:this},n=null!=t?new m.RepeatBlock(r):k(r);n&&(this._blocks.push(n),e&&(this.exposeBlock=n),this._maskedBlocks[i]||(this._maskedBlocks[i]=[]),this._maskedBlocks[i].push(this._blocks.length-1)),a+=i.length-1;continue}}let r=t[a],n=r in e;if(r===I.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===r||"}"===r){s=!s;continue}if("["===r||"]"===r){i=!i;continue}if(r===I.ESCAPE_CHAR){if(!(r=t[++a]))break;n=!1}let l=n?new V({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...f(e[r]),parent:this}):new B({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e)return void this.reset();let{_blocks:t,...s}=e;this._blocks.forEach((e,s)=>e.state=t[s]),super.state=s}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,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;let t=new A,s=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==s)return t;this._blocks[s].isFilled&&++s;for(let e=s;e<this._blocks.length;++e){let s=this._blocks[e]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._mapPosToBlock(this.displayValue.length),i=new A;if(!s)return i;for(let r=s.index,n;n=this._blocks[r];++r){var a;let s=n._appendChar(e,{...t,_beforeTailState:null==(a=t._beforeTailState)||null==(a=a._blocks)?void 0:a[r]});if(i.aggregate(s),s.consumed)break}return i}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=new F;return e===t||this._forEachBlocksInRange(e,t,(e,t,i,a)=>{let r=e.extractTail(i,a);r.stop=this._findStopBefore(t),r.from=this._blockStartPos(t),r instanceof F&&(r.blockIndex=t),s.extend(r)}),s}extractInput(e,t,s){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===s&&(s={}),e===t)return"";let i="";return this._forEachBlocksInRange(e,t,(e,t,a,r)=>{i+=e.extractInput(a,r,s)}),i}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){let i=this._stops[s];if(i<=e)t=i;else break}return t}_appendPlaceholder(e){let t=new A;if(this.lazy&&null==e)return t;let s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;let i=s.index,a=null!=e?e:this._blocks.length;return this._blocks.slice(i,a).forEach(s=>{if(!s.lazy||null!=e){var i;t.aggregate(s._appendPlaceholder(null==(i=s._blocks)?void 0:i.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){let i=this._blocks[s],a=t.length;if(e<=(t+=i.displayValue).length)return{index:s,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+=t.displayValue.length,0)}_forEachBlocksInRange(e,t,s){void 0===t&&(t=this.displayValue.length);let i=this._mapPosToBlock(e);if(i){let e=this._mapPosToBlock(t),a=e&&i.index===e.index,r=i.offset,n=e&&a?e.offset:this._blocks[i.index].displayValue.length;if(s(this._blocks[i.index],i.index,r,n),e&&!a){for(let t=i.index+1;t<e.index;++t)s(this._blocks[t],t,0,this._blocks[t].displayValue.length);s(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s.aggregate(e.remove(i,a))}),s}nearestInputPos(e,t){if(void 0===t&&(t=n),!this._blocks.length)return 0;let s=new S(this,e);if(t===n)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===l||t===u){if(t===l){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===l){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===u?0:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:0}return t===o||t===h?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled())?s.pos:t===h?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:this.nearestInputPos(e,l):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s+=e.totalInputPositions(i,a)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){let t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){let t=new A;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}I.DEFAULTS={...w.DEFAULTS,lazy:!0,placeholderChar:"_"},I.STOP_CHAR="`",I.ESCAPE_CHAR="\\",I.InputDefinition=V,I.FixedDefinition=B,m.MaskedPattern=I;class M extends I{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){let{to:t=this.to||0,from:s=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...r}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,i),this.autofix=a;let n=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),u=0;for(;u<l.length&&l[u]===n[u];)++u;r.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="",[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(t="0".repeat(i.length)+a,s="9".repeat(i.length)+a),[t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9")]}doPrepareChar(e,t){let s;return void 0===t&&(t={}),[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);let s=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],t):Number(a)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(i[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){let t=this.value;if(-1===t.search(/[^0]/)&&t.length<=this._matchFrom)return!0;let[s,i]=this.boundaries(t);return this.from<=Number(i)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){let t=new A;if(this.value.length===this.maxLength)return t;let s=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let s=0;s<i;++s)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(e=>this._appendCharRaw(e))}return t}}m.MaskedRange=M;class T extends I{static extractPatternOptions(e){let{mask:t,pattern:s,...i}=e;return{...i,mask:a(t)?t:s}}constructor(e){super(T.extractPatternOptions({...T.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){let{mask:t,pattern:s,blocks:i,...r}={...T.DEFAULTS,...e},n=Object.assign({},T.GET_DEFAULT_BLOCKS());e.min&&(n.Y.from=e.min.getFullYear()),e.max&&(n.Y.to=e.max.getFullYear()),e.min&&e.max&&n.Y.from===n.Y.to&&(n.m.from=e.min.getMonth()+1,n.m.to=e.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=e.min.getDate(),n.d.to=e.max.getDate())),Object.assign(n,this.blocks,i),super._update({...r,mask:a(t)?t:s,blocks:n})}doValidate(e){let t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=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)}optionsIsChanged(e){return super.optionsIsChanged(T.extractPatternOptions(e))}}T.GET_DEFAULT_BLOCKS=()=>({d:{mask:M,from:1,to:31,maxLength:2},m:{mask:M,from:1,to:12,maxLength:2},Y:{mask:M,from:1900,to:9999}}),T.DEFAULTS={...I.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:(e,t)=>{let[s,i,a]=e.split(".").map(Number);return new Date(a,i-1,s)}},m.MaskedDate=T;class P extends w{constructor(e){super({...P.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(e=>{let{expose:t,...s}=f(e),i=k({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return t&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){void 0===e&&(e=""),void 0===t&&(t={}),void 0===s&&(s="");let i=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,a=this.rawInputValue,r=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:a,n=a.slice(r.length),l=this.currentMask,u=new A,o=null==l?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),u.tailShift=this.currentMask.value.length-i.length),n&&(u.tailShift+=this.currentMask.append(n,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),u}_appendPlaceholder(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){let t=new A;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(s=e._beforeTailState)?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return void 0===t&&(t={}),void 0===s&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[s,i]=super.doPrepare(e,t);if(this.currentMask){let e;[s,e]=super.doPrepare(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(e,t);if(this.currentMask){let e;[s,e]=super.doPrepareChar(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.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 t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return!!(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){let s=new A;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){let{compiledMasks:t,currentMaskRef:s,currentMask:i,...a}=e;t&&this.compiledMasks.forEach((e,s)=>e.state=t[s]),null!=s&&(this.currentMask=s,this.currentMask.state=i),super.state=a}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}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}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;let{mask:i,...a}=e[s];return d(t,a)&&t.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}P.DEFAULTS={...w.DEFAULTS,dispatch:(e,t,s,i)=>{if(!t.compiledMasks.length)return;let a=t.rawInputValue,r=t.compiledMasks.map((r,n)=>{let l=t.currentMask===r,o=l?r.displayValue.length:r.nearestInputPos(r.displayValue.length,u);return r.rawInputValue!==a?(r.reset(),r.append(a,{raw:!0})):l||r.remove(o),r.append(e,t.currentMaskFlags(s)),r.appendTail(i),{index:n,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(o,r.nearestInputPos(r.displayValue.length,u)))}});return r.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[r[0].index]}},m.MaskedDynamic=P;class R extends I{constructor(e){super({...R.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){let{enum:t,...s}=e;if(t){let e=t.map(e=>e.length),i=Math.min(...e),a=Math.max(...e)-i;s.mask="*".repeat(i),a&&(s.mask+="["+"*".repeat(a)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){void 0===t&&(t={});let s=Math.min(this.nearestInputPos(0,h),this.value.length),i=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,s));if(i.length){1===i.length&&this._forEachBlocksInRange(0,this.value.length,(e,s)=>{let a=i[0][s];s>=this.value.length||a===e.value||(e.reset(),e._appendChar(a,t))});let e=super._appendCharRaw(i[0][this.value.length],t);return 1===i.length&&i[0].slice(this.unmaskedValue.length).split("").forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new A({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new E("",e)}remove(e,t){let s;if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new A;let i=Math.min(super.nearestInputPos(0,h),this.value.length);for(s=e;s>=0&&!(this.enum.filter(e=>this.matchValue(e,this.value.slice(i,s),i)).length>1);--s);let a=super.remove(s,t);return a.tailShift+=s-e,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}R.DEFAULTS={...I.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},m.MaskedEnum=R;class j extends w{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}m.MaskedFunction=j;class $ extends w{constructor(e){super({...$.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+p(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=RegExp(e+"\\d*"+t),this._mapToRadixRegExp=RegExp("["+this.mapToRadix.map(p).join("")+"]","g"),this._thousandsSeparatorRegExp=RegExp(p(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){let t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(i.skip=!0),!s||this.allowPositive||this.value||"-"===s||i.aggregate(this._appendChar("-")),[s,i]}_separatorsCount(e,t){void 0===t&&(t=!1);let s=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){let s;void 0===t&&(t={});let i=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);let r=this._value;this._value+=e;let n=!isNaN(this.number),l=!1;if(n){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace($.UNMASKED_RADIX,this.radix),l||(l=r===this._value&&!t.tail)):n=!1),n&&(n=!!this._value.match(this._numberRegExp))}n?s=new A({inserted:this._value.slice(r.length),rawInserted:l?"":e,skip:l}):(this._value=r,s=new A),this._value=this._insertThousandsSeparators(this._value);let u=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(u);return s.tailShift+=(o-a)*this.thousandsSeparator.length,s}_findSeparatorAround(e){if(this.thousandsSeparator){let t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return -1}_adjustRangeWithSeparators(e,t){let s=this._findSeparatorAround(e);s>=0&&(e=s);let i=this._findSeparatorAround(t);return i>=0&&(t=i+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);let s=this.value.slice(0,e),i=this.value.slice(t),a=this._separatorsCount(s.length);return this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+i)),new A({tailShift:(this._separatorsCountFromSlice(s)-a)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case n:case l:case u:{let s=this._findSeparatorAround(e-1);if(s>=0){let i=s+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===u)return s}break}case o:case h:{let t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){let e=this.number,t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){let t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,s,i)=>t+i),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;let t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){void 0===t&&(t={});let i=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===$.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,$.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($.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||$.EMPTY_VALUES.includes(e)&&$.EMPTY_VALUES.includes(this.typedValue))&&(0!==e||""!==this.value)}}$.UNMASKED_RADIX=".",$.EMPTY_VALUES=[...w.EMPTY_VALUES,0],$.DEFAULTS={...w.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[$.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},m.MaskedNumber=$;let N={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function O(e,t,s){void 0===t&&(t=N.MASKED),void 0===s&&(s=N.MASKED);let i=k(e);return e=>i.runIsolated(i=>(i[t]=e,i[s]))}m.PIPE_TYPE=N,m.createPipe=O,m.pipe=function(e,t,s,i){return O(t,s,i)(e)};class L extends I{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,i;let{repeat:a,...r}=f(e);this._blockOpts=Object.assign({},this._blockOpts,r);let n=k(this._blockOpts);this.repeat=null!=(t=null!=(s=null!=a?a:n.repeat)?s:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(i=this._blocks)?void 0:i.length)||0,this.repeatFrom)),blocks:{m:n},eager:n.eager,overwrite:n.overwrite,skipInvalid:n.skipInvalid,lazy:n.lazy,placeholderChar:n.placeholderChar,displayChar:n.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(k(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});let s=new A;for(let l=null!=(i=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?i:Math.max(this._blocks.length-1,0),u,o;u=null!=(r=this._blocks[l])?r:o=!o&&this._allocateBlock(l);++l){var i,a,r,n;let h=u._appendChar(e,{...t,_beforeTailState:null==(n=t._beforeTailState)||null==(n=n._blocks)?void 0:n[l]});if(h.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,i;let a;void 0===e&&(e=0);let r=Math.max((null==(s=this._mapPosToBlock(e))?void 0:s.index)||0,this.repeatFrom,0);null!=t&&(a=null==(i=this._mapPosToBlock(t))?void 0:i.index),null==a&&(a=this._blocks.length-1);let n=0;for(let e=a;r<=e&&!this._blocks[e].unmaskedValue;--e,++n);n&&(this._blocks.splice(a-n+1,n),this.mask=this.mask.slice(n))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return(void 0===e&&(e=0),null==t&&this.repeatTo===1/0)?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}m.RepeatBlock=L;try{globalThis.IMask=m}catch{}var z,U,q=s(12115),W=s(14051);let H={mask:W.oneOfType([W.array,W.func,W.string,W.instanceOf(RegExp),W.oneOf([Date,Number,m.Masked]),W.instanceOf(m.Masked)]),value:W.any,unmask:W.oneOfType([W.bool,W.oneOf(["typed"])]),prepare:W.func,prepareChar:W.func,validate:W.func,commit:W.func,overwrite:W.oneOfType([W.bool,W.oneOf(["shift"])]),eager:W.oneOfType([W.bool,W.oneOf(["append","remove"])]),skipInvalid:W.bool,onAccept:W.func,onComplete:W.func,placeholderChar:W.string,displayChar:W.string,lazy:W.bool,definitions:W.object,blocks:W.object,enum:W.arrayOf(W.string),maxLength:W.number,from:W.number,to:W.number,pattern:W.string,format:W.func,parse:W.func,autofix:W.oneOfType([W.bool,W.oneOf(["pad"])]),radix:W.string,thousandsSeparator:W.string,mapToRadix:W.arrayOf(W.string),scale:W.number,normalizeZeros:W.bool,padFractionalZeros:W.bool,min:W.oneOfType([W.number,W.instanceOf(Date)]),max:W.oneOfType([W.number,W.instanceOf(Date)]),dispatch:W.func,inputRef:W.oneOfType([W.func,W.shape({current:W.object})])},K=Object.keys(H).filter(e=>"value"!==e),Y=["value","unmask","onAccept","onComplete","inputRef"],G=K.filter(e=>0>Y.indexOf(e)),X=(z=e=>{let{inputRef:t,...s}=e;return q.createElement("input",{...s,ref:t})},(U=class extends q.Component{constructor(e){super(e),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let e=this.props,t=this._extractMaskOptionsFromProps(e);if(t.mask)this.maskRef?(this.maskRef.updateOptions(t),"value"in e&&void 0!==e.value&&(this.maskValue=e.value)):this.initMask(t);else if(this.destroyMask(),"value"in e&&void 0!==e.value){var s;null!=(s=this.element)&&s.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=e.value:this.element.value=e.value}}componentWillUnmount(){this.destroyMask()}_inputRef(e){this.element=e,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=e:this.props.inputRef(e))}initMask(e){void 0===e&&(e=this._extractMaskOptionsFromProps(this.props)),this.maskRef=m(this.element,e).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(e){let{...t}=e;return Object.keys(t).filter(e=>0>G.indexOf(e)).forEach(e=>{delete t[e]}),t}_extractNonMaskProps(e){let{...t}=e;return K.forEach(e=>{"maxLength"!==e&&delete t[e]}),"defaultValue"in t||(t.defaultValue=e.mask?"":t.value),delete t.value,t}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(e){this.maskRef&&(e=null==e&&"typed"!==this.props.unmask?"":e,"typed"===this.props.unmask?this.maskRef.typedValue=e:this.props.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e)}_onAccept(e){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,e)}_onComplete(e){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,e)}render(){return q.createElement(z,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,U.propTypes=void 0,(i=U).displayName="IMask("+(z.displayName||z.name||"Component")+")",i.propTypes=H,q.forwardRef((e,t)=>q.createElement(i,{...e,ref:t})));function Z(e,t){let{onAccept:s,onComplete:i,ref:a=(0,q.useRef)(null),defaultValue:r,defaultUnmaskedValue:n,defaultTypedValue:l}=void 0===t?{}:t,u=(0,q.useRef)(null),[o,h]=(0,q.useState)({}),[p,d]=(0,q.useState)(""),[c,g]=(0,q.useState)(""),[f,k]=(0,q.useState)(),_=(0,q.useCallback)(()=>{var e;null==(e=u.current)||e.destroy(),u.current=null},[]),v=(0,q.useCallback)(()=>{let e=u.current;e&&(h({value:e.value,unmaskedValue:e.unmaskedValue,typedValue:e.typedValue}),k(e.typedValue),g(e.unmaskedValue),d(e.value))},[]),x=(0,q.useCallback)(e=>{let t=u.current;t&&(v(),null==s||s(t.value,t,e))},[s]),C=(0,q.useCallback)(e=>u.current&&(null==i?void 0:i(u.current.value,u.current,e)),[i]);return(0,q.useEffect)(()=>{let{value:e,...t}=o,s=u.current;s&&void 0!==p&&(e!==p&&(s.value=p,s.value!==p&&x()),h(t))},[p]),(0,q.useEffect)(()=>{let{unmaskedValue:e,...t}=o,s=u.current;s&&void 0!==c&&(e!==c&&(s.unmaskedValue=c,s.unmaskedValue!==c&&x()),h(t))},[c]),(0,q.useEffect)(()=>{let{typedValue:e,...t}=o,s=u.current;s&&void 0!==f&&(e!==f&&(s.typedValue=f,s.masked.typedValueEquals(f)||x()),h(t))},[f]),(0,q.useEffect)(()=>{let t=a.current;if(!t||!(null!=e&&e.mask))return _();let s=u.current;s?null==s||s.updateOptions(e):t&&null!=e&&e.mask&&(u.current=m(t,e),v(),void 0!==r&&d(r),void 0!==n&&g(n),void 0!==l&&k(l))},[e,_,x]),(0,q.useEffect)(()=>{if(!u.current)return;let e=u.current;return e.on("accept",x),e.on("complete",C),()=>{e.off("accept",x),e.off("complete",C)}},[x,C]),(0,q.useEffect)(()=>_,[_]),{ref:a,maskRef:u,value:p,setValue:d,unmaskedValue:c,setUnmaskedValue:g,typedValue:f,setTypedValue:k}}q.forwardRef((e,t)=>q.createElement(X,{...e,ref:t}))},95124:()=>{},97903:()=>{}}]);