@cat-of-summer/st-script 1.4.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app/datepicker.min.js +3 -3
- package/dist/app/datepicker.min.js.map +3 -3
- package/dist/app/form.min.js +1 -1
- package/dist/app/form.min.js.map +3 -3
- package/dist/app.esm.min.js +1 -1
- package/dist/app.esm.min.js.map +3 -3
- package/dist/app.min.js +1 -1
- package/dist/app.min.js.map +3 -3
- package/dist/core.esm.min.js +1 -1
- package/dist/core.esm.min.js.map +3 -3
- package/dist/core.min.js +1 -1
- package/dist/core.min.js.map +3 -3
- package/dist/loader.esm.min.js +1 -1
- package/dist/loader.esm.min.js.map +3 -3
- package/dist/loader.min.js +1 -1
- package/dist/loader.min.js.map +3 -3
- package/dist/mask.esm.min.js +1 -1
- package/dist/mask.esm.min.js.map +3 -3
- package/dist/mask.min.js +1 -1
- package/dist/mask.min.js.map +3 -3
- package/dist/modal.esm.min.js +1 -1
- package/dist/modal.esm.min.js.map +3 -3
- package/dist/modal.min.js +1 -1
- package/dist/modal.min.js.map +3 -3
- package/dist/observer.esm.min.js +1 -1
- package/dist/observer.esm.min.js.map +3 -3
- package/dist/observer.min.js +1 -1
- package/dist/observer.min.js.map +3 -3
- package/dist/route.esm.min.js.map +2 -2
- package/dist/route.min.js +1 -1
- package/dist/route.min.js.map +2 -2
- package/dist/select.esm.min.js +1 -1
- package/dist/select.esm.min.js.map +3 -3
- package/dist/select.min.js +1 -1
- package/dist/select.min.js.map +3 -3
- package/dist/shape.esm.min.js +2 -0
- package/dist/shape.esm.min.js.map +7 -0
- package/dist/shape.min.js +2 -0
- package/dist/shape.min.js.map +7 -0
- package/dist/toggle.esm.min.js +1 -1
- package/dist/toggle.esm.min.js.map +3 -3
- package/dist/toggle.min.js +1 -1
- package/dist/toggle.min.js.map +3 -3
- package/dist/typograf.esm.min.js +1 -1
- package/dist/typograf.esm.min.js.map +3 -3
- package/dist/typograf.min.js +1 -1
- package/dist/typograf.min.js.map +3 -3
- package/dist/uploader.esm.min.js +1 -1
- package/dist/uploader.esm.min.js.map +3 -3
- package/dist/uploader.min.js +1 -1
- package/dist/uploader.min.js.map +3 -3
- package/dist/validator.esm.min.js +1 -1
- package/dist/validator.esm.min.js.map +3 -3
- package/dist/validator.min.js +1 -1
- package/dist/validator.min.js.map +3 -3
- package/docs/README.md +90 -0
- package/docs/src/README.md +29 -0
- package/docs/src/_traits/README.md +8 -0
- package/docs/src/_traits/hasInstanceSymbol.js.md +57 -0
- package/docs/src/app/README.md +13 -0
- package/docs/src/app/datepicker/README.md +9 -0
- package/docs/src/app/datepicker/_calendar.js.md +1 -0
- package/docs/src/app/datepicker/index.js.md +153 -0
- package/docs/src/app/form/README.md +8 -0
- package/docs/src/app/form/index.js.md +560 -0
- package/docs/src/app/index.js.md +1386 -0
- package/docs/src/cookie/README.md +8 -0
- package/docs/src/cookie/index.js.md +80 -0
- package/docs/src/core/README.md +8 -0
- package/docs/src/core/index.js.md +224 -0
- package/docs/src/index.js.md +1 -0
- package/docs/src/loader/README.md +8 -0
- package/docs/src/loader/index.js.md +126 -0
- package/docs/src/mask/README.md +10 -0
- package/docs/src/mask/_engine.js.md +1 -0
- package/docs/src/mask/_groups.js.md +1 -0
- package/docs/src/mask/index.js.md +412 -0
- package/docs/src/modal/README.md +8 -0
- package/docs/src/modal/index.js.md +821 -0
- package/docs/src/observer/README.md +9 -0
- package/docs/src/observer/_engine.js.md +28 -0
- package/docs/src/observer/index.js.md +259 -0
- package/docs/src/route/README.md +8 -0
- package/docs/src/route/index.js.md +385 -0
- package/docs/src/select/README.md +8 -0
- package/docs/src/select/index.js.md +115 -0
- package/docs/src/shape/README.md +9 -0
- package/docs/src/shape/_engine.js.md +1 -0
- package/docs/src/shape/index.js.md +99 -0
- package/docs/src/st_button_widget/README.md +9 -0
- package/docs/src/st_button_widget/README.txt.md +4 -0
- package/docs/src/st_button_widget/index.js.md +68 -0
- package/docs/src/st_links_widget/README.md +9 -0
- package/docs/src/st_links_widget/README.txt.md +4 -0
- package/docs/src/st_links_widget/index.js.md +46 -0
- package/docs/src/st_widget/README.md +8 -0
- package/docs/src/st_widget/button/README.md +4 -0
- package/docs/src/toggle/README.md +8 -0
- package/docs/src/toggle/index.js.md +604 -0
- package/docs/src/typograf/README.md +9 -0
- package/docs/src/typograf/_engine.js.md +75 -0
- package/docs/src/typograf/index.js.md +165 -0
- package/docs/src/uploader/README.md +8 -0
- package/docs/src/uploader/index.js.md +113 -0
- package/docs/src/validator/README.md +8 -0
- package/docs/src/validator/index.js.md +114 -0
- package/package.json +3 -2
- package/src/_traits/hasInstanceSymbol.js +14 -1
- package/src/app/index.js +102 -15
- package/src/core/index.js +83 -13
- package/src/index.js +1 -1
- package/src/loader/index.js +13 -3
- package/src/mask/index.js +21 -2
- package/src/modal/index.js +16 -6
- package/src/observer/index.js +3 -3
- package/src/select/index.js +24 -4
- package/src/{cut → shape}/_engine.js +1 -1
- package/src/{cut → shape}/index.js +19 -10
- package/src/toggle/index.js +85 -28
- package/src/typograf/index.js +3 -3
- package/src/uploader/index.js +32 -9
- package/src/validator/index.js +20 -2
- package/dist/cut.esm.min.js +0 -2
- package/dist/cut.esm.min.js.map +0 -7
- package/dist/cut.min.js +0 -2
- package/dist/cut.min.js.map +0 -7
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ two flavours per module:
|
|
|
29
29
|
| `route` | `window.Route` | URL reactions; SPA mode (`history` / `hash`). |
|
|
30
30
|
| `app/form` | `window.Form` | Form app **config object** — register with `App.create(form)`; `app` is not bundled. |
|
|
31
31
|
| `app/datepicker` | `window.Datepicker` | Calendar app **config object** (masked `ДД.ММ.ГГГГ` field, range, `min`/`max`, inline) — `App.create(datepicker)`; bundles `mask`, not `app`. |
|
|
32
|
-
| `
|
|
32
|
+
| `shape` | `window.Shape` | Shapes from Figma paths (corners keep their size, edges stretch): SVG background + `clip-path`, per-breakpoint variants. |
|
|
33
33
|
|
|
34
34
|
Документация по каждому модулю — `docs/src/<module>/index.js.md`, например
|
|
35
35
|
[`docs/src/app/index.js.md`](docs/src/app/index.js.md): директивы шаблона, `watch()` (в том
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var Datepicker=(()=>{var F=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var Te=(l,e)=>{for(var t in e)F(l,t,{get:e[t],enumerable:!0})},Ce=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of je(e))!Me.call(l,r)&&r!==t&&F(l,r,{get:()=>e[r],enumerable:!(i=$e(e,r))||i.enumerable});return l};var Oe=l=>Ce(F({},"__esModule",{value:!0}),l);var He={};Te(He,{default:()=>Ge});var D=Symbol(),le=Symbol(),I=l=>{try{return l instanceof Element?l:document.querySelector(l)}catch{return}},M=l=>{if(l==null)return[];if(l instanceof Element)return[l];if(l instanceof NodeList||l instanceof HTMLCollection)return[...l];if(Array.isArray(l))return l.flatMap(M);try{return[...document.querySelectorAll(l)]}catch{return[]}},W=l=>I(l)?.[D],ie=(l,e)=>(l&&(l[D]=e),l),re=(l,e)=>{if(!l)return l;let t=l[le]??=new Set;for(let[i,r]of Object.entries(e)){if(i in l&&!t.has(i)){console.warn(`\u0418\u043C\u044F "${i}" \u0443\u0436\u0435 \u0437\u0430\u043D\u044F\u0442\u043E \u043D\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0435 \u2014 \u043C\u0435\u0442\u043E\u0434 \u043D\u0435 \u043E\u043F\u0443\u0431\u043B\u0438\u043A\u043E\u0432\u0430\u043D`,l);continue}Object.defineProperty(l,i,{value:r,writable:!0,configurable:!0,enumerable:!1}),t.add(i)}return l},se=(l,e,t=[])=>{if(!l)return l;l[D]===e&&delete l[D];let i=l[le];for(let r of t)i?.has(r)&&(delete l[r],i.delete(r));return l};var ne={0:/^[0-9]$/,a:/^\p{L}$/u,"*":/^[^\n]$/},V=/^[\p{L}\p{N}]$/u,ae=l=>l.replace(/\\(.)/g,"$1"),oe=l=>l.global?new RegExp(l.source,l.flags.replace("g","")):l;function B(l,e){let t=l[e],i=t=="{"?"}":"]",r=0;for(let s=e;s<l.length;s++){let n=l[s];if(n=="\\"){s++;continue}if(t=="["&&n=="{"){if((s=B(l,s))<0)return-1}else if(n==t)r++;else if(n==i&&--r==0)return s}return-1}function fe(l,e){let t=0,i=-1;for(let r=0;r<l.length;r++){if(l[r]=="\\"){r++;continue}l[r]=="{"||l[r]=="["?t++:l[r]=="}"||l[r]=="]"?t--:t==0&&l.startsWith(e,r)&&(i=r)}return i}function ue(l,e){return l.every(t=>t.group==null&&(t.group=e,!t.children||ue(t.children,e)))}function Le(l){let e=()=>(console.warn("\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0431\u043B\u043E\u043A \u043C\u0430\u0441\u043A\u0438",`{${l}}`),[...`{${l}}`].map(s=>({type:"literal",char:s}))),t=/^([A-Za-z_]\w*):/.exec(l);if(t){let s=P(l.slice(t[0].length));return ue(s,t[1])?s:e()}let i=fe(l,";");if(i>0){let s=l.slice(i+1);if(/^(\d+|\d*-\d*)$/.test(s)&&s!="-"){let[n,a]=/^\d+$/.test(s)?[+s,+s]:s.split("-").map((u,h)=>u===""?h?1/0:0:+u);return a<n?e():[{type:"repeat",children:P(l.slice(0,i)),min:n,max:a}]}}if(l[0]=="{"&&l.at(-1)=="}")try{return[{type:"slot",test:new RegExp(`^(?:${l.slice(1,-1)})$`,"u")}]}catch{return e()}let r=fe(l,"=>");if(r>0){let s=ae(l.slice(0,r)),n=ae(l.slice(r+2));return s.length!=1||!n?e():[{type:"transform",from:s,to:n}]}return e()}function P(l){let e=[];for(let t=0;t<l.length;t++){let i=l[t],r;i=="\\"?e.push({type:"literal",char:l[++t]??"\\"}):i=="["&&(r=B(l,t))>=0?(e.push({type:"optional",children:P(l.slice(t+1,r))}),t=r):i=="{"&&(r=B(l,t))>=0?(e.push(...Le(l.slice(t+1,r))),t=r):e.push(ne[i]?{type:"slot",test:ne[i]}:{type:"literal",char:i})}return e}function he(l){return l.every(e=>e.type=="literal"||e.type=="slot"||e.type=="repeat"&&e.min==e.max&&he(e.children))}function ce(l,e=new Set){for(let t of l)t.group!=null&&e.add(t.group),t.children&&ce(t.children,e);return e}function v(l,e={}){if(l&&typeof l=="object"&&!Array.isArray(l)&&!(l instanceof RegExp)&&l.pattern==null&&l.filter==null&&l.numeral==null)return Object.entries(l).flatMap(([i,r])=>v(r,e).map(s=>({...s,key:i})));let t=(Array.isArray(l)?l:[l]).map(i=>{if(typeof i=="function")return{fn:i,base:e};if(i instanceof RegExp&&(i={filter:i}),typeof i=="string"&&(i={pattern:i}),i.numeral){let n={fraction:0,group:" ",decimal:",",prefix:"",suffix:"",sign:!1,...i.numeral};return{numeral:n,fixed:!1,valid:null,message:i.message??n.message,filler:i.filler??e.filler,before_char:null,before_slot:null}}let r=i.pattern!=null?P(i.pattern):[{type:"repeat",min:0,max:i.max_length??1/0,greedy:!0,children:[{type:"slot",test:oe(i.filter)}]}],s=i.groups??e.groups??{};return{nodes:r,names:[...ce(r)],fills:Object.fromEntries(Object.entries(s).filter(([,n])=>n?.filler!=null).map(([n,a])=>[n,a.filler])),fixed:i.pattern!=null&&he(r),valid:i.valid?oe(i.valid):i.filter?/./:null,message:i.message,filler:i.filler??e.filler,before_char:i.before_char??e.before_char,before_slot:i.before_slot??e.before_slot}});return t.forEach((i,r)=>i.key??=r),t}function G(l,e,t,i){let r=l.fills?.[t];return r==null&&(r=l.filler??"_",i=e),r[i]??r.at(-1)??"_"}function E(l,e,t){let i=[...String(e??"")];return l.before_char?i.flatMap(r=>{let s=l.before_char(t?.input,{char:r});return s===!1||s===""||s===null?[]:typeof s=="string"?[...s]:[r]}):i}function De(l,e,t){return l.type=="slot"?l.test.test(e):l.type=="transform"?l.from===e||t.input.slice(t.ip,t.ip+l.to.length).join("")===l.to:l.type=="repeat"?C(l.children,e,t):!1}function C(l,e,t,i){for(let r of l){if(r.type=="literal"){if(!i&&r.char===e)return!0;continue}if(r.type=="optional"||r.type=="repeat"&&r.min==0){if(C(r.children,e,t,i))return!0;continue}return De(r,e,t)}return i?l.some(r=>r.type=="literal"&&r.char===e):!1}function N(l,e,t,i="char",r=null,s=null){l.units.push({kind:i,ordinal:r,group:s,stream_start:l.stream.length,stream_end:l.stream.length+e.length,fmt_start:l.formatted.length,fmt_end:l.formatted.length+t.length}),l.stream+=e,i=="char"&&(l.raw+=e),i=="char"&&s!=null&&(l.groups[s]+=e),r!=null&&(l.cells[r]=i=="char"?e:null),l.formatted+=t}function H(l){l.stop_fmt<0&&(l.stop_fmt=l.formatted.length+l.tail.length)}function T(l,e=null){l.rejected.push({at:l.ip,slot:e}),l.ip++}function K(l){l.complete=!1,l.done=!0,H(l)}function k(l,e,t){for(let i=0;i<l.length;i++){let r=l[i];if(r.type=="literal")e.done?e.ph+=r.char:e.ip<e.input.length?e.input[e.ip]===r.char?(e.ip++,e.consumed++,!e.diverged&&V.test(r.char)&&e.lead++,N(e,r.char,r.char,"literal")):(V.test(r.char)&&(!e.diverged&&e.raw===""&&(e.lead=0),e.diverged=!0),e.formatted+=r.char):e.tail+=r.char;else if(r.type=="slot"){let s=e.ordinal++,n=r.group??null,a=n==null?null:e.local[n]=(e.local[n]??-1)+1,u=G(t,s,n,a);if(e.done){e.ph_slots.push({fmt:e.formatted.length+e.tail.length+e.ph.length,node:r,fill:u}),e.ph+=u;continue}let h=!1;for(;;){if(e.ip>=e.input.length){K(e),e.ph_slots.push({fmt:e.formatted.length+e.tail.length,node:r,fill:u}),e.ph+=u;break}let o=e.input[e.ip];if(r.test.test(o)){if(t.before_slot&&!h){let f=t.before_slot(e.ctx?.input,{char:o,slot:s,cells:e.cells,raw:e.raw,node:r});if(f===!1){T(e,s);continue}if(typeof f=="string"&&f!==o){e.input.splice(e.ip,1,...f),h=!0;continue}}N(e,o,o,"char",s,n)}else if(o===u&&e.ctx?.holes!==!1)e.complete=!1,N(e,o,o,"hole",s,n);else{T(e,s);continue}e.ip++,e.consumed++;break}}else if(r.type=="transform"){if(e.done){e.ph+=r.to;continue}for(;;){if(e.ip>=e.input.length){K(e),e.ph+=r.to;break}if(e.input.slice(e.ip,e.ip+r.to.length).join("")===r.to)e.ip+=r.to.length,e.consumed+=r.to.length;else if(e.input[e.ip]===r.from)e.ip++,e.consumed++;else{T(e);continue}e.diverged||e.lead++,N(e,r.to,r.to);break}}else if(r.type=="repeat"){if(e.done){for(let n=0;n<r.min;n++)k(r.children,e,t);continue}let s=0;for(;s<r.max;){if(e.ip>=e.input.length){if(s<r.min){K(e);for(let a=s;a<r.min;a++)k(r.children,e,t)}else H(e);break}if(!C(r.children,e.input[e.ip],e)){if(!r.greedy&&s>=r.min)break;T(e);continue}let n=e.ip;if(k(r.children,e,t),e.done){for(let a=s+1;a<r.min;a++)k(r.children,e,t);break}if(e.ip===n)break;s++}}else if(r.type=="optional"){if(e.done)continue;let s=l.slice(i+1),n=!1;for(;e.ip<e.input.length;){let a=e.input[e.ip];if(C(r.children,a,e,!0)){n=!0,k(r.children,e,t);break}if(C(s,a,e))break;T(e)}!n&&e.ip>=e.input.length&&H(e)}}}function Ie(l,e){let t=l.numeral,i=String(e??""),r=t.sign&&i.includes("-"),s;if(t.decimal&&(i.includes(t.decimal)||i.includes("."))){let g=Ae=>Ae.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=i.replace(new RegExp(`[^0-9${g(t.decimal)}.]`,"g"),"").replace(t.decimal,"."),te=parseFloat(j);s=Number.isFinite(te)?String(Math.round(te*10**t.fraction)):""}else{let g=i.replace(/\D/g,"");s=g===""?"":g.replace(/^0+/,"")||"0"}if(!s){let g=t.prefix+G(l,0);if(t.fraction){g+=t.decimal;for(let j=1;j<=t.fraction;j++)g+=G(l,j)}return{stream:"",raw:"",formatted:"",tail:"",ph:g+t.suffix,ph_slots:[],complete:!1,consumed:0,lead:0,units:[],cells:[],groups:{},stop_fmt:g.length}}let n=t.fraction,a=s.padStart(n+1,"0"),u=(n?a.slice(0,-n):a).replace(/^0+(?=\d)/,""),h=n?a.slice(-n):"",o=u.length+h.length-s.length,f=(r?"-":"")+s,p="",m=[],d=0,c=0,y=g=>{p+=g},b=g=>{m.push({kind:"char",ordinal:null,stream_start:d,stream_end:d+1,fmt_start:p.length,fmt_end:p.length+1}),p+=g,d++};y(t.prefix),r&&b("-");for(let g=0;g<u.length;g++,c++)g&&(u.length-g)%3==0&&y(t.group),c>=o?b(u[g]):y(u[g]);if(n){y(t.decimal);for(let g=0;g<h.length;g++,c++)c>=o?b(h[g]):y(h[g])}let L=p.length;y(t.suffix);let _=(r?-1:1)*parseFloat(u+(n?"."+h:"")),x=(t.min==null||_>=t.min)&&(t.max==null||_<=t.max);return{stream:f,raw:f,formatted:p,tail:"",ph:"",ph_slots:[],complete:x,consumed:f.length,lead:0,units:m,cells:[],groups:{},stop_fmt:L}}function S(l,e,t){if(l.numeral)return Ie(l,e);let i={input:E(l,e,t),ctx:t,ip:0,stream:"",raw:"",formatted:"",tail:"",ph:"",ph_slots:[],units:[],cells:[],groups:Object.fromEntries((l.names??[]).map(n=>[n,""])),local:{},consumed:0,lead:0,diverged:!1,ordinal:0,complete:!0,done:!1,stop_fmt:-1,rejected:[]};k(l.nodes,i,l),i.stop_fmt<0&&(i.stop_fmt=i.formatted.length),l.valid&&(i.complete=i.complete&&l.valid.test(i.raw));let r=l.seps??=de(l.nodes),s=i.rejected.map(({at:n,slot:a})=>({at:n,char:i.input[n],slot:a,reason:r.has(i.input[n])?"literal":"slot"}));for(let n=i.ip;n<i.input.length;n++)s.push({at:n,char:i.input[n],slot:null,reason:"full"});return{stream:i.stream,raw:i.raw,formatted:i.formatted,tail:i.tail,ph:i.ph,ph_slots:i.ph_slots,complete:i.complete,consumed:i.consumed,lead:i.lead,units:i.units,cells:i.cells,groups:i.groups,stop_fmt:i.stop_fmt,rejected:s}}function de(l,e=new Set){for(let t of l)t.type=="literal"&&!V.test(t.char)&&e.add(t.char),t.children&&de(t.children,e);return e}function Y(l,e,t={}){let i=[];t={...t,stream:String(e??"")};for(let s of l)s.fn?i.push(...v(s.fn(t),s.base).map(n=>({...n,key:s.key??n.key}))):i.push(s);let r=null;for(let s of i){let n=S(s,e,t);(!r||Ne(n,r.result))&&(r={result:n,def:s,mask_id:s.key})}return r}function Ne(l,e){return l.consumed!=e.consumed?l.consumed>e.consumed:l.lead>e.lead}function A(l,e){return e=="always"?l.formatted+l.tail+l.ph:e===!1?l.formatted:l.formatted+l.tail}function pe(l,e){for(let t of l.units)if(t.kind!="literal"&&(e<=t.stream_start||e<t.stream_end))return t.fmt_start;return l.stop_fmt}function me(l,e){let t=l.units.filter(i=>i.kind=="char");return t.length>e?t[e-1].stream_end:l.stream.length}var Pe=["edit","pad","align","min","max"];function ge(l,e){let t=[];l.slots.forEach((i,r)=>{let s=i.node.group??null,n=t.at(-1);if(!n||n.name!==s){let a=Object.fromEntries(Pe.map(u=>[u,e[u]]));s!=null&&Object.assign(a,e.groups?.[s]),t.push(n={name:s,first:r,fmts:[],digits:!0,opts:a})}n.fmts.push(i.fmt),n.last=r,n.digits&&=i.node.test.test("0")&&!i.node.test.test("a")});for(let i of t)[i.start,i.end]=[i.fmts[0],i.fmts.at(-1)+1];return t}function z(l,e){let t=l.fmts.length,i=[...e].slice(-t),r=Array(t-i.length).fill(l.opts.pad??null);return l.opts.align=="right"?[...r,...i]:[...i,...r]}function _e(l,e,t){let{max:i}=l.opts,r=l.digits&&i!=null;return e+=t,r&&+e>i&&(e=String(i)),{buffer:e,cells:z(l,e),advance:e.length>=l.fmts.length||r&&+e*10>i}}function q(l,e){let{min:t}=l.opts,i=l.fmts.length;return!l.digits||t==null||e.includes(null)||+e.join("")>=t?e:z(l,String(t).padStart(i,"0"))}function ye(l,e,t){if(!l.digits)return null;let i=l.fmts.length,r=e.join(""),{min:s=null,max:n=null}=l.opts;s??=0,n??=10**i-1;let a=r===""?t>0?s:n:+r+t;return a>n?a=s:a<s&&(a=n),z(l,String(a).padStart(i,"0"))}function be(l,e,t){return(l.length?l:[null]).every(i=>{let r={min:t.min,max:t.max,...i!=null&&t.groups?.[i]},s=e[i];return r.min==null&&r.max==null||!/^\d+$/.test(s??"")?!0:(r.min==null||+s>=r.min)&&(r.max==null||+s<=r.max)})}var qe=["before_init","on_init","before_char","before_slot","before_input","on_input","before_paste","on_paste","on_accept","on_complete","on_incomplete","on_mask_change","on_reject"],O=class l{static#w=["target","mask"];static#k=["text","search","tel","url","password"];static#E(e){let t=S(e,""),i=0;return t.slots=t.ph_slots,t.parts=t.slots.map((r,s)=>s&&r.fmt>t.slots[s-1].fmt+1?++i:i),t.template=A(t,"always"),t}static#S(e){if(!/^\s*[[{]/.test(e))return e;let t=i=>typeof i=="string"||Array.isArray(i)&&i.every(r=>typeof r=="string");try{let i=JSON.parse(e);if(Array.isArray(i)?t(i):i&&typeof i=="object"&&Object.values(i).every(t))return i}catch{}return e}#e={};#g={};#o=null;#t=new WeakMap;#r=[];#_=new AbortController;static find=W;get params(){return this.#e}get value(){return this.#r.map(e=>e.value)}clone(e){return new l({...this.#e,...this.#g,...e,parent:this})}constructor(e){e={target:"input[mask]",mask:null,numeral:null,filler:"_",placeholder:!0,edit:"free",pad:null,align:"left",min:null,max:null,groups:{},caret:!0,coerce_type:!0,max_raw:null,validate:null,validation_message:null,...Object.fromEntries(qe.map(t=>[t,()=>{}])),...e};for(let[t,i]of Object.entries(e))typeof i=="function"&&!l.#w.includes(t)?(this[t]=i.bind(this),this.#g[t]=i):this.#e[t]=i;this.before_init(this.#e),this.#e.numeral!=null?this.#o=v({numeral:this.#e.numeral},this.#s()):this.#e.mask!=null&&(this.#o=v(this.#e.mask,this.#s()));for(let t of M(this.#e.target))this.#$(t);this.on_init(this.#e)}raw(e=this.#d()){return this.#t.get(I(e))?.result?.raw??""}state(e=this.#d()){let t=I(e),i=this.#t.get(t);return i?.result?this.#c(t,i):null}set(e,t){arguments.length<2&&([e,t]=[this.#d(),e]);for(let i of M(e))if(this.#t.has(i)){let r=i.value;this.#i(i,String(t??""),{prefix:String(t??"")}),this.#f(i,r,"insertReplacementText")}}clear(e=this.#r){this.set(e,"")}destroy(){this.#_.abort();for(let e of this.#r){let{original:t}=this.#t.get(e)??{};t&&(e.type!=t.type&&(e.type=t.type),t.maxlength!=null&&e.setAttribute("maxlength",t.maxlength),e.style.removeProperty("caret-color"),t.caret[0]&&e.style.setProperty("caret-color",...t.caret)),this.#t.delete(e),se(e,this,["raw","state","set","clear","set_mask"])}this.#r=[]}#d(){if(this.#r.length!=1)throw new Error(`Mask: \u043C\u0430\u0441\u043A\u0430 \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u0430 \u043A ${this.#r.length} \u043F\u043E\u043B\u044F\u043C \u2014 \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u043E\u043B\u0435 \u044F\u0432\u043D\u043E`);return this.#r[0]}set_mask(e,t=null){let i=v(e,this.#s());t||(this.#o=i);for(let r of t?M(t):this.#r){let s=this.#t.get(r);if(!s)continue;s.defs=i,s.seg=null;let n=r.value;this.#i(r,s.stream,{}),this.#f(r,n,"insertReplacementText")}}#f(e,t,i,r=null){e.value!==t&&(this.#t.get(e).handled=!0,e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:i,data:r})))}#s(){return{filler:this.#e.filler,groups:this.#e.groups,before_char:this.before_char,before_slot:this.before_slot}}#A(e){return e=="email"?v({filter:/[a-z0-9@._%+-]/i,valid:/^[^@\s]+@[^@\s]+\.[^@\s]{2,}$/},this.#s()):e=="number"?v({numeral:{}},this.#s()):null}#$(e){if(W(e))throw new Error("\u041C\u0430\u0441\u043A\u0430 \u0443\u0436\u0435 \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u0430 \u043A \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u043B\u044E");ie(e,this);let t=this.#_.signal,i={type:e.type,maxlength:e.getAttribute("maxlength"),caret:[e.style.getPropertyValue("caret-color"),e.style.getPropertyPriority("caret-color")]},r=null;this.#e.coerce_type!==!1&&(e.type=="number"||e.type=="email")&&(r=e.type,e.inputMode=r=="number"?"numeric":"email",e.type="text"),l.#k.includes(e.type)||console.warn(`Mask: \u043F\u043E\u043B\u0435 type="${e.type}" \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043A\u0430\u0440\u0435\u0442\u043A\u043E\u0439 \u2014 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 type="text" \u0438\u043B\u0438 "tel"`,e);let s=e.getAttribute("maxlength");s!=null&&e.removeAttribute("maxlength");let n=this.#e.max_raw??(s!=null?+s:null),a=e.getAttribute("mask"),u=this.#o??(a?v(l.#S(a),this.#s()):this.#A(r));if(!u){console.warn("Mask: \u0434\u043B\u044F \u043F\u043E\u043B\u044F \u043D\u0435 \u0437\u0430\u0434\u0430\u043D\u0430 \u043C\u0430\u0441\u043A\u0430 (\u043D\u0438 \u0432 params.mask, \u043D\u0438 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 mask)",e);return}let h=r=="number"||this.#e.numeral!=null,o={defs:u,def:null,stream:"",result:null,mask_id:null,rendered:"",seg:null,composing:!1,handled:!1,coerced:r,max_raw:n,numeric:h,original:i};this.#t.set(e,o),this.#r.push(e),re(e,{raw:()=>this.raw(e),state:()=>this.state(e),set:d=>this.set(e,d),clear:()=>this.clear(e),set_mask:d=>this.set_mask(d,e)});let f=()=>this.#e.caret=="hide"&&e.style.setProperty("caret-color","transparent","important");f(),e.addEventListener("beforeinput",d=>this.#j(e,d),{signal:t});let p=[this.#e.edit,...Object.values(this.#e.groups??{}).map(d=>d?.edit)];if(p.includes("whole")&&(this.#e.placeholder!="always"||u.length>1||u.some(d=>!d.fixed&&!d.fn))&&console.warn("Mask: edit: 'whole' \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0441 \u043E\u0434\u043D\u043E\u0439 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0439 \u043C\u0430\u0441\u043A\u043E\u0439 \u0438 placeholder: 'always' - \u0438\u043D\u0430\u0447\u0435 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044F \u043A\u0430\u043A 'end'",e),p.some(d=>d&&d!="free")){let d=c=>this.#I(e,c.type=="click");for(let c of["selectionchange","click","keyup","select"])e.addEventListener(c,d,{signal:t});e.addEventListener("keydown",c=>this.#L(e,c),{signal:t})}let m=()=>{if(o.handled){o.handled=!1;return}o.composing||this.#m(e)};e.addEventListener("input",m,{signal:t}),e.addEventListener("change",m,{signal:t}),e.addEventListener("compositionstart",()=>o.composing=!0,{signal:t}),e.addEventListener("compositionend",()=>{o.composing=!1,this.#m(e)},{signal:t}),e.addEventListener("focus",d=>{f(),this.#i(e,o.stream,{prefix:o.stream,silent:!0}),this.#D(e,d.relatedTarget)},{signal:t}),e.addEventListener("blur",()=>{this.#p(e),o.seg=null,this.#i(e,o.stream,{silent:!0})},{signal:t}),e.closest("form")?.addEventListener("reset",()=>queueMicrotask(()=>this.#m(e)),{signal:t}),this.#i(e,e.value,{silent:!0})}#j(e,t){let i=this.#t.get(e),r=t.inputType??"insertText";if(t.isComposing||r=="insertCompositionText"||r=="deleteCompositionText"){i.composing=!0;return}if(r=="historyUndo"||r=="historyRedo")return;let s=e.selectionStart??0,n=e.selectionEnd??s,{g:a,edit:u}=this.#a(i,s,n);u=="end"&&i.result&&!(s==0&&n==e.value.length)&&!(a&&s==a.start&&n==a.end)&&(s=n=this.#v(e,i,a)),t.preventDefault();let h=r.startsWith("delete"),o="",f=[];if(!h){if(r=="insertLineBreak"||r=="insertParagraph")return;if(o=t.data??t.dataTransfer?.getData("text/plain")??"",r=="insertFromPaste"){let m=this.before_paste(e,o);if(m===!1)return;typeof m=="string"&&(o=m)}if(i.numeric){let m=i.defs.some(c=>c.numeral?.sign),d="";for(let c of o)c>="0"&&c<="9"||m&&c=="-"?d+=c:f.push({char:c,slot:null,reason:"slot"});o=d}}if(this.before_input(e,{type:r,insert:o,start:s,end:n})===!1)return;let p=e.value;u=="whole"?f.push(...this.#O(e,r,h?"":o)):this.#l(i)?f.push(...this.#C(e,r,s,n,h?"":o)):f.push(...this.#T(e,s,n,h?"":o,r)),r=="insertFromPaste"&&this.on_paste(e,this.#c(e,i));for(let m of f)this.on_reject(e,{...m,type:r});t.defaultPrevented&&this.#f(e,p,r,o||null)}#M(e,{def:t,full:i,cut:r},s,n){let a={input:e},u=E(t,s,a).length,h=E(t,n,a),o=u+h.length,f=(i.rejected??[]).filter(p=>p.at>=u&&p.at<o);if(r!=null){let p=Math.max(0,r-S(t,s,a).stream.length),m=h.map((d,c)=>u+c).filter(d=>!f.some(c=>c.at==d));for(let d of m.slice(p))f.push({at:d,char:h[d-u],slot:null,reason:"full"});f.sort((d,c)=>d.at-c.at)}return f.map(({char:p,slot:m,reason:d})=>({char:p,slot:m,reason:d}))}#T(e,t,i,r,s){let n=this.#t.get(e),a=n.result?.units??[],u,h,o;if(t!=i){let d=a.filter(c=>c.fmt_start<i&&c.fmt_end>t);u=d.length?d[0].stream_start:this.#x(a,t),h=d.length?d.at(-1).stream_end:u}else if(!s.startsWith("delete"))u=h=this.#x(a,t);else{if(s.includes("Forward"))o=a.find(d=>d.fmt_end>t&&d.kind!="literal")??a.find(d=>d.fmt_end>t);else{let d;for(let c of a)c.fmt_start<t&&(c.kind=="literal"?d=c:o=c);o??=d}if(!o)return[];u=o.stream_start,h=o.stream_end}let f=n.stream.slice(0,u),p=f+r,m=this.#i(e,p+n.stream.slice(h),{prefix:p});return r&&m?this.#M(e,m,f,r):[]}#C(e,t,i,r,s){let n=this.#t.get(e),a=n.def,u=this.#l(n),{slots:h,parts:o}=u,f=h.length,p=this.#u(n,u),m=_=>{let x=h.findIndex(g=>g.fmt>=_);return x<0?f:x},d=_=>u.template.slice(h[_-1].fmt+1,h[_].fmt),c;if(i!=r){c=m(i);for(let _=c;_<f&&h[_].fmt<r;_++)p[_]=null}else if(!s&&t.startsWith("delete")){if(t.includes("Forward")){for(c=m(i);c<f&&p[c]==null;)c++;if(c>=f)return[]}else{c=-1;for(let _=0;_<f;_++)h[_].fmt<i&&(c=_);for(;c>=0&&p[c]==null;)c--;if(c<0)return[]}p[c]=null}else c=m(i),c>=f&&(c=p.indexOf(null))<0&&(c=f);let y=[];for(let _ of E(a,s,{input:e})){if(c>=f){y.push({char:_,slot:null,reason:"full"});continue}if(!h[c].node.test.test(_)){let x=o.lastIndexOf(o[c]);x+1<f&&d(x+1).includes(_)?c=x+1:y.push(l.#y(a,_,c));continue}p[c++]=_}let b=this.#h(u,p),L=Math.min(S(a,b.slice(0,c),{input:e}).stream.length,f);return this.#i(e,b,{caret_fmt:L<f?h[L].fmt:h[f-1].fmt+1}),y}static#y(e,t,i){return{char:t,slot:i,reason:e.seps?.has(t)?"literal":"slot"}}#O(e,t,i){let r=this.#t.get(e),s=this.#l(r),n=s.spans,a=this.#b(e,r),u=this.#u(r,s),h=m=>u.slice(m.first,m.last+1),o=(m,d)=>u.splice(m.first,d.length,...d),f=n[a.gi],p=[];if(t.startsWith("delete")){if(h(f).every(m=>m==null))return t.includes("Backward")&&a.gi>0&&this.#n(e,a.gi-1),[];o(f,h(f).fill(null)),a.buffer=""}else{t=="insertFromPaste"&&(a.buffer="");for(let m of E(r.def,i,{input:e})){f=n[a.gi];let d=n[a.gi+1];if(d&&s.template.slice(f.end,d.start).includes(m)){a.buffer&&(o(f,q(f,h(f))),a.gi++,a.buffer="");continue}let c=f.first+Math.min(a.buffer.length,f.fmts.length-1);if(!s.slots[c].node.test.test(m)){p.push(l.#y(r.def,m,c));continue}let y=_e(f,a.buffer,m);o(f,y.cells),a.buffer=y.buffer,y.advance&&(o(f,q(f,h(f))),a.buffer="",d&&a.gi++)}}return this.#i(e,this.#h(s,u),{}),this.#n(e,a.gi,!1),p}#L(e,t){let i=this.#t.get(e);if(t.altKey||t.ctrlKey||t.metaKey||!i?.result)return;let{g:r,edit:s}=this.#a(i,e.selectionStart??0,e.selectionEnd??0);if(s!="whole")return;let n=this.#l(i).spans,a=n.length-1,u=this.#b(e,i).gi,h;switch(t.key){case"ArrowLeft":h=u-1;break;case"ArrowRight":h=u+1;break;case"Home":h=0;break;case"End":h=a;break;case"Tab":if(h=u+(t.shiftKey?-1:1),h<0||h>a)return;break;case"ArrowUp":case"ArrowDown":{t.preventDefault();let o=this.#l(i),f=this.#u(i,o),p=ye(n[u],f.slice(n[u].first,n[u].last+1),t.key=="ArrowUp"?1:-1);if(!p)return;f.splice(n[u].first,p.length,...p);let m=e.value;this.#i(e,this.#h(o,f),{}),this.#n(e,u),this.#f(e,m,"insertReplacementText");return}default:return}t.preventDefault(),this.#n(e,Math.max(0,Math.min(h,a)))}#n(e,t,i=!0){let r=this.#t.get(e);r.seg&&r.seg.gi!==t&&this.#p(e),(i||r.seg?.gi!==t)&&(r.seg={gi:t,buffer:""});let s=this.#l(r).spans[t];document.activeElement===e&&e.setSelectionRange(s.start,s.end)}#b(e,t){let{g:i}=this.#a(t,e.selectionStart??0,e.selectionEnd??0),r=this.#l(t).spans.indexOf(i);return t.seg?.gi!==r&&(this.#p(e),t.seg={gi:r,buffer:""}),t.seg}#p(e){let t=this.#t.get(e),i=this.#l(t);if(!t.seg?.buffer||!i)return;let r=i.spans[t.seg.gi],s=this.#u(t,i),n=s.slice(r.first,r.last+1),a=q(r,n);t.seg.buffer="",a!==n&&(s.splice(r.first,a.length,...a),this.#i(e,this.#h(i,s),{}))}#D(e,t){let i=this.#t.get(e),r=this.#l(i);if(!r||this.#a(i,0).edit!="whole")return;let s=t&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING;this.#n(e,s?r.spans.length-1:0)}#I(e,t=!1){let i=this.#t.get(e);if(document.activeElement!==e||!i?.result)return;let r=e.selectionStart,s=e.selectionEnd;if(r==null)return;let{g:n,edit:a}=this.#a(i,r,s);if(a=="whole"){let h=this.#l(i).spans.indexOf(n);return!t&&i.seg?.gi===h&&r==n.start&&s==n.end?void 0:this.#n(e,h,t||i.seg?.gi!==h)}if(a!="end")return;if(r!==s){let[h,o]=n?[n.start,n.end]:[0,e.value.length];(r!=0||s!=e.value.length)&&(r!=h||s!=o)&&e.setSelectionRange(h,o);return}if(r===i.caret)return;let u=this.#v(e,i,n);r!==u&&e.setSelectionRange(u,u),i.caret=u}#v(e,t,i){if(i){let r=this.#l(t).slots;for(let s=i.first;s<r.length;s++)if(t.result.cells?.[s]==null)return r[s].fmt;return r.at(-1).fmt+1}return Math.min(t.result.stop_fmt,e.value.length)}#l(e){let t=e.def;if(this.#e.placeholder!="always"||e.defs.length>1||!t?.fixed)return null;let i=t.layout??=l.#E(t);return i.spans??=ge(i,this.#e),i}#a(e,t,i=t){let r=this.#l(e)?.spans??[],s=r.find(a=>t!=i&&a.start==t&&a.end==i)??r.find(a=>t<=a.end)??r.at(-1)??null,n=s?s.opts.edit:this.#e.edit;return{g:s,edit:n=="whole"&&!s?"end":n}}#u(e,t){return t.slots.map((i,r)=>e.result?.cells?.[r]??null)}#h(e,t){let i=t.reduce((r,s,n)=>s!=null?n:r,-1);return t.slice(0,i+1).map((r,s)=>r??e.slots[s].fill).join("")}#x(e,t){let i=0;for(let r of e)(r.fmt_end<=t||r.fmt_start<t)&&(i=r.stream_end);return i}#m(e){let t=this.#t.get(e);if(e.value===t.rendered)return;t.seg=null;let i=e.selectionStart??e.value.length;this.#i(e,e.value,{prefix:e.value.slice(0,i)})}#i(e,t,{prefix:i=null,caret_fmt:r=null,silent:s=!1}={}){let n=this.#t.get(e),a=this.#N(n),u={raw:n.result?.raw??"",value:e.value,input:e,holes:a},h=Y(n.defs,t,u);if(!h)return null;let{result:o,def:f,mask_id:p}=h,m={def:f,full:o,cut:null};n.max_raw!=null&&o.raw.length>n.max_raw&&(m.cut=me(o,n.max_raw),h=Y(n.defs,o.stream.slice(0,m.cut),u),{result:o,def:f,mask_id:p}=h),!f.numeral&&!be(f.names,{...o.groups,null:o.raw},this.#e)&&(o.complete=!1);let d=this.#P(e,o);e.value!==d&&(e.value=d),n.rendered=d,r==null&&i!=null&&document.activeElement===e&&(r=pe(o,S(f,i,{input:e,holes:a}).stream.length)),r!=null&&document.activeElement===e&&(r=Math.min(r,d.length),e.setSelectionRange(r,r),n.caret=r);let c=n.result,y=n.mask_id;if(n.result=o,n.stream=o.stream,n.def=f,n.mask_id=p,e.setAttribute("mask_id",p),e.setAttribute("progress",o.raw.length),e.setAttribute("is_complete",o.complete),this.#q(n)&&e.setCustomValidity&&e.setCustomValidity(!o.stream||o.complete?"":this.#R(e,n)),s)return m;let b=this.#c(e,n);return this.on_input(e,b),o.raw!==(c?.raw??"")&&this.on_accept(e,b),o.complete&&!c?.complete&&this.on_complete(e,b),!o.complete&&c?.complete&&this.on_incomplete(e,b),c&&p!==y&&this.on_mask_change(e,b),m}#N(e){let[t]=e.defs;return this.#e.placeholder=="always"&&e.defs.length==1&&!!(t.fixed||t.fn)}#P(e,t){let{placeholder:i}=this.#e;return t.stream?A(t,i):document.activeElement!==e?"":i=="always"?A(t,"always"):i==!1||i=="typed"?"":A(t,!0)}#c(e,t){return{raw:t.result?.raw??"",formatted:e.value,complete:t.result?.complete??!1,mask_id:t.mask_id,progress:t.result?.raw.length??0,groups:{...t.result?.groups},empty:!t.stream,skeleton:t.result?A(t.result,"always"):""}}#q(e){let t=this.#e.validate;return t===!0||t==null&&e.coerced!=null}#R(e,t){let i=typeof this.validation_message=="function"?this.validation_message:this.#e.validation_message??t.def?.message;return typeof i=="function"?i(e,this.#c(e,t))||"":typeof i=="string"?i:t.coerced=="email"?"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B":t.coerced=="number"||t.def?.numeral?"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0447\u0438\u0441\u043B\u043E \u0432 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u043C \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0435":"\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043F\u043E\u043B\u0435 \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E"}};var Re=["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],Ue=["\u044F\u043D\u0432\u0430\u0440\u044F","\u0444\u0435\u0432\u0440\u0430\u043B\u044F","\u043C\u0430\u0440\u0442\u0430","\u0430\u043F\u0440\u0435\u043B\u044F","\u043C\u0430\u044F","\u0438\u044E\u043D\u044F","\u0438\u044E\u043B\u044F","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F","\u043E\u043A\u0442\u044F\u0431\u0440\u044F","\u043D\u043E\u044F\u0431\u0440\u044F","\u0434\u0435\u043A\u0430\u0431\u0440\u044F"],ve=["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"],$=(l,e=2)=>String(l).padStart(e,"0"),Fe=(l,e)=>new Date(Date.UTC(l,e,0)).getUTCDate(),xe=(l,e,t)=>Number.isInteger(l)&&Number.isInteger(e)&&Number.isInteger(t)&&l>=1&&l<=9999&&e>=1&&e<=12&&t>=1&&t<=Fe(l,e),J=(l,e,t)=>`${$(l,4)}-${$(e)}-${$(t)}`,w=l=>{let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(l??"").trim());if(!e)return null;let[t,i,r]=e.slice(1).map(Number);return xe(t,i,r)?{year:t,month:i,day:r}:null},Z=(l=new Date)=>J(l.getFullYear(),l.getMonth()+1,l.getDate()),R=l=>{let e=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(String(l??"").trim());if(!e)return null;let[t,i,r]=e.slice(1).map(Number);return xe(r,i,t)?J(r,i,t):null},Q=l=>{let e=w(l);return e?`${$(e.day)}.${$(e.month)}.${$(e.year,4)}`:""},We=l=>{let e=w(l);return e?`${e.day} ${Ue[e.month-1]} ${e.year}`:""},we=(l,e)=>`${Re[e-1]} ${l}`,ke=(l,e,t)=>{let i=l*12+(e-1)+t;return{year:Math.floor(i/12),month:i%12+1}},Ke=(l,e,t)=>!(e&&l<e)&&!(t&&l>t),U=(l,e,t)=>w(l)?e&&l<e?"min":t&&l>t?"max":null:"invalid",Ee=(l,e,{from:t=null,to:i=null,min:r=null,max:s=null,now:n=Z()}={})=>{let a=(new Date(Date.UTC(l,e-1,1)).getUTCDay()+6)%7,u=[];for(let h=0;h<42;h++){let o=new Date(Date.UTC(l,e-1,1-a+h)),f=J(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()),p=!!(t&&i);u.push({iso:f,day:o.getUTCDate(),label:We(f),other:o.getUTCMonth()+1!=e,today:f==n,disabled:!Ke(f,r,s),selected:f==t||f==i,in_range:p&&f>t&&f<i,range_from:p&&f==t,range_to:p&&f==i})}return u},Se=({from:l=null,to:e=null},t,i=!1)=>!i||!l||e?{from:t,to:null}:t<l?{from:t,to:l}:{from:l,to:t},X=l=>{let[e,t]=String(l??"").split("/");return{from:w(e)?e.trim():null,to:w(t)?t.trim():null}},ee=({from:l,to:e},t=!1)=>t?l||e?`${l??""}/${e??""}`:"":l??"";var Ve={mask:"{dd:00}.{mm:00}.{yyyy:0000}",placeholder:"always",edit:"whole",align:"right",pad:"0",validate:!1,groups:{dd:{filler:"\u0414\u0414",min:1,max:31},mm:{filler:"\u041C\u041C",min:1,max:12},yyyy:{filler:"\u0413\u0413\u0413\u0413",min:1}}},Be='<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="3.5" y="5" width="17" height="15.5" rx="2"/><path d="M3.5 10h17M8 3v4M16 3v4"/></svg>',Ge={app:"datepicker",name:"",range:!1,inline:!1,required:!1,value:"",min:"",max:"",inputId:"",messages:{required:"\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043F\u043E\u043B\u0435",incomplete:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0430\u0442\u0443 \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E",invalid:"\u0422\u0430\u043A\u043E\u0439 \u0434\u0430\u0442\u044B \u043D\u0435\u0442",min:"\u0414\u0430\u0442\u0430 \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 {date}",max:"\u0414\u0430\u0442\u0430 \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 {date}",order:"\u041A\u043E\u043D\u0435\u0446 \u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0440\u0430\u043D\u044C\u0448\u0435 \u043D\u0430\u0447\u0430\u043B\u0430"},from:null,to:null,year:0,month:0,is_open:!1,invalid:!1,days:[],weekdays:ve,get caption(){return this.year?we(this.year,this.month):""},template:`
|
|
1
|
+
var Datepicker=(()=>{var W=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var Le=(l,e)=>{for(var t in e)W(l,t,{get:e[t],enumerable:!0})},Oe=(l,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ce(e))!Te.call(l,r)&&r!==t&&W(l,r,{get:()=>e[r],enumerable:!(i=je(e,r))||i.enumerable});return l};var De=l=>Oe(W({},"__esModule",{value:!0}),l);var ze={};Le(ze,{default:()=>Ye});var D=Symbol(),ie=Symbol(),I=l=>{try{return l instanceof Element?l:document.querySelector(l)}catch{return}},k=l=>{if(l==null)return[];if(typeof l=="function")return k(l());if(l instanceof Element)return[l];if(l instanceof NodeList||l instanceof HTMLCollection)return[...l];if(Array.isArray(l))return l.flatMap(k);try{return[...document.querySelectorAll(l)]}catch{return[]}},re=l=>typeof l=="string"||typeof l=="function",se=l=>{let e=new AbortController;return l.addEventListener("abort",()=>e.abort(),{once:!0,signal:e.signal}),e},N=l=>I(l)?.[D],ne=(l,e)=>(l&&(l[D]=e),l),ae=(l,e)=>{if(!l)return l;let t=l[ie]??=new Set;for(let[i,r]of Object.entries(e)){if(i in l&&!t.has(i)){console.warn(`\u0418\u043C\u044F "${i}" \u0443\u0436\u0435 \u0437\u0430\u043D\u044F\u0442\u043E \u043D\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0435 \u2014 \u043C\u0435\u0442\u043E\u0434 \u043D\u0435 \u043E\u043F\u0443\u0431\u043B\u0438\u043A\u043E\u0432\u0430\u043D`,l);continue}Object.defineProperty(l,i,{value:r,writable:!0,configurable:!0,enumerable:!1}),t.add(i)}return l},K=(l,e,t=[])=>{if(!l)return l;l[D]===e&&delete l[D];let i=l[ie];for(let r of t)i?.has(r)&&(delete l[r],i.delete(r));return l};var oe={0:/^[0-9]$/,a:/^\p{L}$/u,"*":/^[^\n]$/},B=/^[\p{L}\p{N}]$/u,fe=l=>l.replace(/\\(.)/g,"$1"),ue=l=>l.global?new RegExp(l.source,l.flags.replace("g","")):l;function G(l,e){let t=l[e],i=t=="{"?"}":"]",r=0;for(let s=e;s<l.length;s++){let n=l[s];if(n=="\\"){s++;continue}if(t=="["&&n=="{"){if((s=G(l,s))<0)return-1}else if(n==t)r++;else if(n==i&&--r==0)return s}return-1}function he(l,e){let t=0,i=-1;for(let r=0;r<l.length;r++){if(l[r]=="\\"){r++;continue}l[r]=="{"||l[r]=="["?t++:l[r]=="}"||l[r]=="]"?t--:t==0&&l.startsWith(e,r)&&(i=r)}return i}function ce(l,e){return l.every(t=>t.group==null&&(t.group=e,!t.children||ce(t.children,e)))}function Ie(l){let e=()=>(console.warn("\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0431\u043B\u043E\u043A \u043C\u0430\u0441\u043A\u0438",`{${l}}`),[...`{${l}}`].map(s=>({type:"literal",char:s}))),t=/^([A-Za-z_]\w*):/.exec(l);if(t){let s=q(l.slice(t[0].length));return ce(s,t[1])?s:e()}let i=he(l,";");if(i>0){let s=l.slice(i+1);if(/^(\d+|\d*-\d*)$/.test(s)&&s!="-"){let[n,a]=/^\d+$/.test(s)?[+s,+s]:s.split("-").map((c,h)=>c===""?h?1/0:0:+c);return a<n?e():[{type:"repeat",children:q(l.slice(0,i)),min:n,max:a}]}}if(l[0]=="{"&&l.at(-1)=="}")try{return[{type:"slot",test:new RegExp(`^(?:${l.slice(1,-1)})$`,"u")}]}catch{return e()}let r=he(l,"=>");if(r>0){let s=fe(l.slice(0,r)),n=fe(l.slice(r+2));return s.length!=1||!n?e():[{type:"transform",from:s,to:n}]}return e()}function q(l){let e=[];for(let t=0;t<l.length;t++){let i=l[t],r;i=="\\"?e.push({type:"literal",char:l[++t]??"\\"}):i=="["&&(r=G(l,t))>=0?(e.push({type:"optional",children:q(l.slice(t+1,r))}),t=r):i=="{"&&(r=G(l,t))>=0?(e.push(...Ie(l.slice(t+1,r))),t=r):e.push(oe[i]?{type:"slot",test:oe[i]}:{type:"literal",char:i})}return e}function de(l){return l.every(e=>e.type=="literal"||e.type=="slot"||e.type=="repeat"&&e.min==e.max&&de(e.children))}function pe(l,e=new Set){for(let t of l)t.group!=null&&e.add(t.group),t.children&&pe(t.children,e);return e}function v(l,e={}){if(l&&typeof l=="object"&&!Array.isArray(l)&&!(l instanceof RegExp)&&l.pattern==null&&l.filter==null&&l.numeral==null)return Object.entries(l).flatMap(([i,r])=>v(r,e).map(s=>({...s,key:i})));let t=(Array.isArray(l)?l:[l]).map(i=>{if(typeof i=="function")return{fn:i,base:e};if(i instanceof RegExp&&(i={filter:i}),typeof i=="string"&&(i={pattern:i}),i.numeral){let n={fraction:0,group:" ",decimal:",",prefix:"",suffix:"",sign:!1,...i.numeral};return{numeral:n,fixed:!1,valid:null,message:i.message??n.message,filler:i.filler??e.filler,before_char:null,before_slot:null}}let r=i.pattern!=null?q(i.pattern):[{type:"repeat",min:0,max:i.max_length??1/0,greedy:!0,children:[{type:"slot",test:ue(i.filter)}]}],s=i.groups??e.groups??{};return{nodes:r,names:[...pe(r)],fills:Object.fromEntries(Object.entries(s).filter(([,n])=>n?.filler!=null).map(([n,a])=>[n,a.filler])),fixed:i.pattern!=null&&de(r),valid:i.valid?ue(i.valid):i.filter?/./:null,message:i.message,filler:i.filler??e.filler,before_char:i.before_char??e.before_char,before_slot:i.before_slot??e.before_slot}});return t.forEach((i,r)=>i.key??=r),t}function H(l,e,t,i){let r=l.fills?.[t];return r==null&&(r=l.filler??"_",i=e),r[i]??r.at(-1)??"_"}function S(l,e,t){let i=[...String(e??"")];return l.before_char?i.flatMap(r=>{let s=l.before_char(t?.input,{char:r});return s===!1||s===""||s===null?[]:typeof s=="string"?[...s]:[r]}):i}function Ne(l,e,t){return l.type=="slot"?l.test.test(e):l.type=="transform"?l.from===e||t.input.slice(t.ip,t.ip+l.to.length).join("")===l.to:l.type=="repeat"?T(l.children,e,t):!1}function T(l,e,t,i){for(let r of l){if(r.type=="literal"){if(!i&&r.char===e)return!0;continue}if(r.type=="optional"||r.type=="repeat"&&r.min==0){if(T(r.children,e,t,i))return!0;continue}return Ne(r,e,t)}return i?l.some(r=>r.type=="literal"&&r.char===e):!1}function P(l,e,t,i="char",r=null,s=null){l.units.push({kind:i,ordinal:r,group:s,stream_start:l.stream.length,stream_end:l.stream.length+e.length,fmt_start:l.formatted.length,fmt_end:l.formatted.length+t.length}),l.stream+=e,i=="char"&&(l.raw+=e),i=="char"&&s!=null&&(l.groups[s]+=e),r!=null&&(l.cells[r]=i=="char"?e:null),l.formatted+=t}function Y(l){l.stop_fmt<0&&(l.stop_fmt=l.formatted.length+l.tail.length)}function C(l,e=null){l.rejected.push({at:l.ip,slot:e}),l.ip++}function V(l){l.complete=!1,l.done=!0,Y(l)}function E(l,e,t){for(let i=0;i<l.length;i++){let r=l[i];if(r.type=="literal")e.done?e.ph+=r.char:e.ip<e.input.length?e.input[e.ip]===r.char?(e.ip++,e.consumed++,!e.diverged&&B.test(r.char)&&e.lead++,P(e,r.char,r.char,"literal")):(B.test(r.char)&&(!e.diverged&&e.raw===""&&(e.lead=0),e.diverged=!0),e.formatted+=r.char):e.tail+=r.char;else if(r.type=="slot"){let s=e.ordinal++,n=r.group??null,a=n==null?null:e.local[n]=(e.local[n]??-1)+1,c=H(t,s,n,a);if(e.done){e.ph_slots.push({fmt:e.formatted.length+e.tail.length+e.ph.length,node:r,fill:c}),e.ph+=c;continue}let h=!1;for(;;){if(e.ip>=e.input.length){V(e),e.ph_slots.push({fmt:e.formatted.length+e.tail.length,node:r,fill:c}),e.ph+=c;break}let u=e.input[e.ip];if(r.test.test(u)){if(t.before_slot&&!h){let o=t.before_slot(e.ctx?.input,{char:u,slot:s,cells:e.cells,raw:e.raw,node:r});if(o===!1){C(e,s);continue}if(typeof o=="string"&&o!==u){e.input.splice(e.ip,1,...o),h=!0;continue}}P(e,u,u,"char",s,n)}else if(u===c&&e.ctx?.holes!==!1)e.complete=!1,P(e,u,u,"hole",s,n);else{C(e,s);continue}e.ip++,e.consumed++;break}}else if(r.type=="transform"){if(e.done){e.ph+=r.to;continue}for(;;){if(e.ip>=e.input.length){V(e),e.ph+=r.to;break}if(e.input.slice(e.ip,e.ip+r.to.length).join("")===r.to)e.ip+=r.to.length,e.consumed+=r.to.length;else if(e.input[e.ip]===r.from)e.ip++,e.consumed++;else{C(e);continue}e.diverged||e.lead++,P(e,r.to,r.to);break}}else if(r.type=="repeat"){if(e.done){for(let n=0;n<r.min;n++)E(r.children,e,t);continue}let s=0;for(;s<r.max;){if(e.ip>=e.input.length){if(s<r.min){V(e);for(let a=s;a<r.min;a++)E(r.children,e,t)}else Y(e);break}if(!T(r.children,e.input[e.ip],e)){if(!r.greedy&&s>=r.min)break;C(e);continue}let n=e.ip;if(E(r.children,e,t),e.done){for(let a=s+1;a<r.min;a++)E(r.children,e,t);break}if(e.ip===n)break;s++}}else if(r.type=="optional"){if(e.done)continue;let s=l.slice(i+1),n=!1;for(;e.ip<e.input.length;){let a=e.input[e.ip];if(T(r.children,a,e,!0)){n=!0,E(r.children,e,t);break}if(T(s,a,e))break;C(e)}!n&&e.ip>=e.input.length&&Y(e)}}}function Pe(l,e){let t=l.numeral,i=String(e??""),r=t.sign&&i.includes("-"),s;if(t.decimal&&(i.includes(t.decimal)||i.includes("."))){let g=Me=>Me.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=i.replace(new RegExp(`[^0-9${g(t.decimal)}.]`,"g"),"").replace(t.decimal,"."),le=parseFloat(j);s=Number.isFinite(le)?String(Math.round(le*10**t.fraction)):""}else{let g=i.replace(/\D/g,"");s=g===""?"":g.replace(/^0+/,"")||"0"}if(!s){let g=t.prefix+H(l,0);if(t.fraction){g+=t.decimal;for(let j=1;j<=t.fraction;j++)g+=H(l,j)}return{stream:"",raw:"",formatted:"",tail:"",ph:g+t.suffix,ph_slots:[],complete:!1,consumed:0,lead:0,units:[],cells:[],groups:{},stop_fmt:g.length}}let n=t.fraction,a=s.padStart(n+1,"0"),c=(n?a.slice(0,-n):a).replace(/^0+(?=\d)/,""),h=n?a.slice(-n):"",u=c.length+h.length-s.length,o=(r?"-":"")+s,p="",m=[],d=0,f=0,y=g=>{p+=g},b=g=>{m.push({kind:"char",ordinal:null,stream_start:d,stream_end:d+1,fmt_start:p.length,fmt_end:p.length+1}),p+=g,d++};y(t.prefix),r&&b("-");for(let g=0;g<c.length;g++,f++)g&&(c.length-g)%3==0&&y(t.group),f>=u?b(c[g]):y(c[g]);if(n){y(t.decimal);for(let g=0;g<h.length;g++,f++)f>=u?b(h[g]):y(h[g])}let O=p.length;y(t.suffix);let _=(r?-1:1)*parseFloat(c+(n?"."+h:"")),x=(t.min==null||_>=t.min)&&(t.max==null||_<=t.max);return{stream:o,raw:o,formatted:p,tail:"",ph:"",ph_slots:[],complete:x,consumed:o.length,lead:0,units:m,cells:[],groups:{},stop_fmt:O}}function A(l,e,t){if(l.numeral)return Pe(l,e);let i={input:S(l,e,t),ctx:t,ip:0,stream:"",raw:"",formatted:"",tail:"",ph:"",ph_slots:[],units:[],cells:[],groups:Object.fromEntries((l.names??[]).map(n=>[n,""])),local:{},consumed:0,lead:0,diverged:!1,ordinal:0,complete:!0,done:!1,stop_fmt:-1,rejected:[]};E(l.nodes,i,l),i.stop_fmt<0&&(i.stop_fmt=i.formatted.length),l.valid&&(i.complete=i.complete&&l.valid.test(i.raw));let r=l.seps??=me(l.nodes),s=i.rejected.map(({at:n,slot:a})=>({at:n,char:i.input[n],slot:a,reason:r.has(i.input[n])?"literal":"slot"}));for(let n=i.ip;n<i.input.length;n++)s.push({at:n,char:i.input[n],slot:null,reason:"full"});return{stream:i.stream,raw:i.raw,formatted:i.formatted,tail:i.tail,ph:i.ph,ph_slots:i.ph_slots,complete:i.complete,consumed:i.consumed,lead:i.lead,units:i.units,cells:i.cells,groups:i.groups,stop_fmt:i.stop_fmt,rejected:s}}function me(l,e=new Set){for(let t of l)t.type=="literal"&&!B.test(t.char)&&e.add(t.char),t.children&&me(t.children,e);return e}function z(l,e,t={}){let i=[];t={...t,stream:String(e??"")};for(let s of l)s.fn?i.push(...v(s.fn(t),s.base).map(n=>({...n,key:s.key??n.key}))):i.push(s);let r=null;for(let s of i){let n=A(s,e,t);(!r||qe(n,r.result))&&(r={result:n,def:s,mask_id:s.key})}return r}function qe(l,e){return l.consumed!=e.consumed?l.consumed>e.consumed:l.lead>e.lead}function $(l,e){return e=="always"?l.formatted+l.tail+l.ph:e===!1?l.formatted:l.formatted+l.tail}function ge(l,e){for(let t of l.units)if(t.kind!="literal"&&(e<=t.stream_start||e<t.stream_end))return t.fmt_start;return l.stop_fmt}function _e(l,e){let t=l.units.filter(i=>i.kind=="char");return t.length>e?t[e-1].stream_end:l.stream.length}var Re=["edit","pad","align","min","max"];function ye(l,e){let t=[];l.slots.forEach((i,r)=>{let s=i.node.group??null,n=t.at(-1);if(!n||n.name!==s){let a=Object.fromEntries(Re.map(c=>[c,e[c]]));s!=null&&Object.assign(a,e.groups?.[s]),t.push(n={name:s,first:r,fmts:[],digits:!0,opts:a})}n.fmts.push(i.fmt),n.last=r,n.digits&&=i.node.test.test("0")&&!i.node.test.test("a")});for(let i of t)[i.start,i.end]=[i.fmts[0],i.fmts.at(-1)+1];return t}function J(l,e){let t=l.fmts.length,i=[...e].slice(-t),r=Array(t-i.length).fill(l.opts.pad??null);return l.opts.align=="right"?[...r,...i]:[...i,...r]}function be(l,e,t){let{max:i}=l.opts,r=l.digits&&i!=null;return e+=t,r&&+e>i&&(e=String(i)),{buffer:e,cells:J(l,e),advance:e.length>=l.fmts.length||r&&+e*10>i}}function R(l,e){let{min:t}=l.opts,i=l.fmts.length;return!l.digits||t==null||e.includes(null)||+e.join("")>=t?e:J(l,String(t).padStart(i,"0"))}function ve(l,e,t){if(!l.digits)return null;let i=l.fmts.length,r=e.join(""),{min:s=null,max:n=null}=l.opts;s??=0,n??=10**i-1;let a=r===""?t>0?s:n:+r+t;return a>n?a=s:a<s&&(a=n),J(l,String(a).padStart(i,"0"))}function xe(l,e,t){return(l.length?l:[null]).every(i=>{let r={min:t.min,max:t.max,...i!=null&&t.groups?.[i]},s=e[i];return r.min==null&&r.max==null||!/^\d+$/.test(s??"")?!0:(r.min==null||+s>=r.min)&&(r.max==null||+s<=r.max)})}var Ue=["before_init","on_init","before_char","before_slot","before_input","on_input","before_paste","on_paste","on_accept","on_complete","on_incomplete","on_mask_change","on_reject"],L=class l{static#E=["target","mask"];static#S=["text","search","tel","url","password"];static#A(e){let t=A(e,""),i=0;return t.slots=t.ph_slots,t.parts=t.slots.map((r,s)=>s&&r.fmt>t.slots[s-1].fmt+1?++i:i),t.template=$(t,"always"),t}static#$(e){if(!/^\s*[[{]/.test(e))return e;let t=i=>typeof i=="string"||Array.isArray(i)&&i.every(r=>typeof r=="string");try{let i=JSON.parse(e);if(Array.isArray(i)?t(i):i&&typeof i=="object"&&Object.values(i).every(t))return i}catch{}return e}#e={};#g={};#o=null;#t=new WeakMap;#l=[];#_=new AbortController;#y=new WeakMap;static find=N;get params(){return this.#e}get value(){return this.#l.map(e=>e.value)}clone(e){return new l({...this.#e,...this.#g,...e,parent:this})}constructor(e){e={target:"input[mask]",mask:null,numeral:null,filler:"_",placeholder:!0,edit:"free",pad:null,align:"left",min:null,max:null,groups:{},caret:!0,coerce_type:!0,max_raw:null,validate:null,validation_message:null,...Object.fromEntries(Ue.map(t=>[t,()=>{}])),...e};for(let[t,i]of Object.entries(e))typeof i=="function"&&!l.#E.includes(t)?(this[t]=i.bind(this),this.#g[t]=i):this.#e[t]=i;this.before_init(this.#e),this.#e.numeral!=null?this.#o=v({numeral:this.#e.numeral},this.#s()):this.#e.mask!=null&&(this.#o=v(this.#e.mask,this.#s()));for(let t of k(this.#e.target))this.#b(t);this.on_init(this.#e)}raw(e=this.#d()){return this.#t.get(I(e))?.result?.raw??""}state(e=this.#d()){let t=I(e),i=this.#t.get(t);return i?.result?this.#c(t,i):null}set(e,t){arguments.length<2&&([e,t]=[this.#d(),e]);for(let i of k(e))if(this.#t.has(i)){let r=i.value;this.#r(i,String(t??""),{prefix:String(t??"")}),this.#f(i,r,"insertReplacementText")}}clear(e=this.#l){this.set(e,"")}destroy(){this.#_.abort();for(let e of this.#l){let{original:t}=this.#t.get(e)??{};t&&(e.type!=t.type&&(e.type=t.type),t.maxlength!=null&&e.setAttribute("maxlength",t.maxlength),e.style.removeProperty("caret-color"),t.caret[0]&&e.style.setProperty("caret-color",...t.caret)),this.#t.delete(e),K(e,this,["raw","state","set","clear","set_mask"])}this.#l=[]}refresh(){for(let e of this.#l.filter(t=>!t.isConnected))this.#y.get(e)?.abort(),this.#t.delete(e),K(e,this,["raw","state","set","clear","set_mask"]);if(this.#l=this.#l.filter(e=>e.isConnected),re(this.#e.target))for(let e of k(this.#e.target))N(e)||this.#b(e);return this}#d(){if(this.#l.length!=1)throw new Error(`Mask: \u043C\u0430\u0441\u043A\u0430 \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u0430 \u043A ${this.#l.length} \u043F\u043E\u043B\u044F\u043C \u2014 \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u043E\u043B\u0435 \u044F\u0432\u043D\u043E`);return this.#l[0]}set_mask(e,t=null){let i=v(e,this.#s());t||(this.#o=i);for(let r of t?k(t):this.#l){let s=this.#t.get(r);if(!s)continue;s.defs=i,s.seg=null;let n=r.value;this.#r(r,s.stream,{}),this.#f(r,n,"insertReplacementText")}}#f(e,t,i,r=null){e.value!==t&&(this.#t.get(e).handled=!0,e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:i,data:r})))}#s(){return{filler:this.#e.filler,groups:this.#e.groups,before_char:this.before_char,before_slot:this.before_slot}}#M(e){return e=="email"?v({filter:/[a-z0-9@._%+-]/i,valid:/^[^@\s]+@[^@\s]+\.[^@\s]{2,}$/},this.#s()):e=="number"?v({numeral:{}},this.#s()):null}#b(e){if(N(e))throw new Error("\u041C\u0430\u0441\u043A\u0430 \u0443\u0436\u0435 \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u0430 \u043A \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u043B\u044E");ne(e,this);let t=se(this.#_.signal),i=t.signal;this.#y.set(e,t);let r={type:e.type,maxlength:e.getAttribute("maxlength"),caret:[e.style.getPropertyValue("caret-color"),e.style.getPropertyPriority("caret-color")]},s=null;this.#e.coerce_type!==!1&&(e.type=="number"||e.type=="email")&&(s=e.type,e.inputMode=s=="number"?"numeric":"email",e.type="text"),l.#S.includes(e.type)||console.warn(`Mask: \u043F\u043E\u043B\u0435 type="${e.type}" \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043A\u0430\u0440\u0435\u0442\u043A\u043E\u0439 \u2014 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 type="text" \u0438\u043B\u0438 "tel"`,e);let n=e.getAttribute("maxlength");n!=null&&e.removeAttribute("maxlength");let a=this.#e.max_raw??(n!=null?+n:null),c=e.getAttribute("mask"),h=this.#o??(c?v(l.#$(c),this.#s()):this.#M(s));if(!h){console.warn("Mask: \u0434\u043B\u044F \u043F\u043E\u043B\u044F \u043D\u0435 \u0437\u0430\u0434\u0430\u043D\u0430 \u043C\u0430\u0441\u043A\u0430 (\u043D\u0438 \u0432 params.mask, \u043D\u0438 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 mask)",e);return}let u=s=="number"||this.#e.numeral!=null,o={defs:h,def:null,stream:"",result:null,mask_id:null,rendered:"",seg:null,composing:!1,handled:!1,coerced:s,max_raw:a,numeric:u,original:r};this.#t.set(e,o),this.#l.push(e),ae(e,{raw:()=>this.raw(e),state:()=>this.state(e),set:f=>this.set(e,f),clear:()=>this.clear(e),set_mask:f=>this.set_mask(f,e)});let p=()=>this.#e.caret=="hide"&&e.style.setProperty("caret-color","transparent","important");p(),e.addEventListener("beforeinput",f=>this.#j(e,f),{signal:i});let m=[this.#e.edit,...Object.values(this.#e.groups??{}).map(f=>f?.edit)];if(m.includes("whole")&&(this.#e.placeholder!="always"||h.length>1||h.some(f=>!f.fixed&&!f.fn))&&console.warn("Mask: edit: 'whole' \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0441 \u043E\u0434\u043D\u043E\u0439 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0439 \u043C\u0430\u0441\u043A\u043E\u0439 \u0438 placeholder: 'always' - \u0438\u043D\u0430\u0447\u0435 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044F \u043A\u0430\u043A 'end'",e),m.some(f=>f&&f!="free")){let f=y=>this.#N(e,y.type=="click");for(let y of["selectionchange","click","keyup","select"])e.addEventListener(y,f,{signal:i});e.addEventListener("keydown",y=>this.#D(e,y),{signal:i})}let d=()=>{if(o.handled){o.handled=!1;return}o.composing||this.#m(e)};e.addEventListener("input",d,{signal:i}),e.addEventListener("change",d,{signal:i}),e.addEventListener("compositionstart",()=>o.composing=!0,{signal:i}),e.addEventListener("compositionend",()=>{o.composing=!1,this.#m(e)},{signal:i}),e.addEventListener("focus",f=>{p(),this.#r(e,o.stream,{prefix:o.stream,silent:!0}),this.#I(e,f.relatedTarget)},{signal:i}),e.addEventListener("blur",()=>{this.#p(e),o.seg=null,this.#r(e,o.stream,{silent:!0})},{signal:i}),e.closest("form")?.addEventListener("reset",()=>queueMicrotask(()=>this.#m(e)),{signal:i}),this.#r(e,e.value,{silent:!0})}#j(e,t){let i=this.#t.get(e),r=t.inputType??"insertText";if(t.isComposing||r=="insertCompositionText"||r=="deleteCompositionText"){i.composing=!0;return}if(r=="historyUndo"||r=="historyRedo")return;let s=e.selectionStart??0,n=e.selectionEnd??s,{g:a,edit:c}=this.#a(i,s,n);c=="end"&&i.result&&!(s==0&&n==e.value.length)&&!(a&&s==a.start&&n==a.end)&&(s=n=this.#w(e,i,a)),t.preventDefault();let h=r.startsWith("delete"),u="",o=[];if(!h){if(r=="insertLineBreak"||r=="insertParagraph")return;if(u=t.data??t.dataTransfer?.getData("text/plain")??"",r=="insertFromPaste"){let m=this.before_paste(e,u);if(m===!1)return;typeof m=="string"&&(u=m)}if(i.numeric){let m=i.defs.some(f=>f.numeral?.sign),d="";for(let f of u)f>="0"&&f<="9"||m&&f=="-"?d+=f:o.push({char:f,slot:null,reason:"slot"});u=d}}if(this.before_input(e,{type:r,insert:u,start:s,end:n})===!1)return;let p=e.value;c=="whole"?o.push(...this.#O(e,r,h?"":u)):this.#i(i)?o.push(...this.#L(e,r,s,n,h?"":u)):o.push(...this.#T(e,s,n,h?"":u,r)),r=="insertFromPaste"&&this.on_paste(e,this.#c(e,i));for(let m of o)this.on_reject(e,{...m,type:r});t.defaultPrevented&&this.#f(e,p,r,u||null)}#C(e,{def:t,full:i,cut:r},s,n){let a={input:e},c=S(t,s,a).length,h=S(t,n,a),u=c+h.length,o=(i.rejected??[]).filter(p=>p.at>=c&&p.at<u);if(r!=null){let p=Math.max(0,r-A(t,s,a).stream.length),m=h.map((d,f)=>c+f).filter(d=>!o.some(f=>f.at==d));for(let d of m.slice(p))o.push({at:d,char:h[d-c],slot:null,reason:"full"});o.sort((d,f)=>d.at-f.at)}return o.map(({char:p,slot:m,reason:d})=>({char:p,slot:m,reason:d}))}#T(e,t,i,r,s){let n=this.#t.get(e),a=n.result?.units??[],c,h,u;if(t!=i){let d=a.filter(f=>f.fmt_start<i&&f.fmt_end>t);c=d.length?d[0].stream_start:this.#k(a,t),h=d.length?d.at(-1).stream_end:c}else if(!s.startsWith("delete"))c=h=this.#k(a,t);else{if(s.includes("Forward"))u=a.find(d=>d.fmt_end>t&&d.kind!="literal")??a.find(d=>d.fmt_end>t);else{let d;for(let f of a)f.fmt_start<t&&(f.kind=="literal"?d=f:u=f);u??=d}if(!u)return[];c=u.stream_start,h=u.stream_end}let o=n.stream.slice(0,c),p=o+r,m=this.#r(e,p+n.stream.slice(h),{prefix:p});return r&&m?this.#C(e,m,o,r):[]}#L(e,t,i,r,s){let n=this.#t.get(e),a=n.def,c=this.#i(n),{slots:h,parts:u}=c,o=h.length,p=this.#u(n,c),m=_=>{let x=h.findIndex(g=>g.fmt>=_);return x<0?o:x},d=_=>c.template.slice(h[_-1].fmt+1,h[_].fmt),f;if(i!=r){f=m(i);for(let _=f;_<o&&h[_].fmt<r;_++)p[_]=null}else if(!s&&t.startsWith("delete")){if(t.includes("Forward")){for(f=m(i);f<o&&p[f]==null;)f++;if(f>=o)return[]}else{f=-1;for(let _=0;_<o;_++)h[_].fmt<i&&(f=_);for(;f>=0&&p[f]==null;)f--;if(f<0)return[]}p[f]=null}else f=m(i),f>=o&&(f=p.indexOf(null))<0&&(f=o);let y=[];for(let _ of S(a,s,{input:e})){if(f>=o){y.push({char:_,slot:null,reason:"full"});continue}if(!h[f].node.test.test(_)){let x=u.lastIndexOf(u[f]);x+1<o&&d(x+1).includes(_)?f=x+1:y.push(l.#v(a,_,f));continue}p[f++]=_}let b=this.#h(c,p),O=Math.min(A(a,b.slice(0,f),{input:e}).stream.length,o);return this.#r(e,b,{caret_fmt:O<o?h[O].fmt:h[o-1].fmt+1}),y}static#v(e,t,i){return{char:t,slot:i,reason:e.seps?.has(t)?"literal":"slot"}}#O(e,t,i){let r=this.#t.get(e),s=this.#i(r),n=s.spans,a=this.#x(e,r),c=this.#u(r,s),h=m=>c.slice(m.first,m.last+1),u=(m,d)=>c.splice(m.first,d.length,...d),o=n[a.gi],p=[];if(t.startsWith("delete")){if(h(o).every(m=>m==null))return t.includes("Backward")&&a.gi>0&&this.#n(e,a.gi-1),[];u(o,h(o).fill(null)),a.buffer=""}else{t=="insertFromPaste"&&(a.buffer="");for(let m of S(r.def,i,{input:e})){o=n[a.gi];let d=n[a.gi+1];if(d&&s.template.slice(o.end,d.start).includes(m)){a.buffer&&(u(o,R(o,h(o))),a.gi++,a.buffer="");continue}let f=o.first+Math.min(a.buffer.length,o.fmts.length-1);if(!s.slots[f].node.test.test(m)){p.push(l.#v(r.def,m,f));continue}let y=be(o,a.buffer,m);u(o,y.cells),a.buffer=y.buffer,y.advance&&(u(o,R(o,h(o))),a.buffer="",d&&a.gi++)}}return this.#r(e,this.#h(s,c),{}),this.#n(e,a.gi,!1),p}#D(e,t){let i=this.#t.get(e);if(t.altKey||t.ctrlKey||t.metaKey||!i?.result)return;let{g:r,edit:s}=this.#a(i,e.selectionStart??0,e.selectionEnd??0);if(s!="whole")return;let n=this.#i(i).spans,a=n.length-1,c=this.#x(e,i).gi,h;switch(t.key){case"ArrowLeft":h=c-1;break;case"ArrowRight":h=c+1;break;case"Home":h=0;break;case"End":h=a;break;case"Tab":if(h=c+(t.shiftKey?-1:1),h<0||h>a)return;break;case"ArrowUp":case"ArrowDown":{t.preventDefault();let u=this.#i(i),o=this.#u(i,u),p=ve(n[c],o.slice(n[c].first,n[c].last+1),t.key=="ArrowUp"?1:-1);if(!p)return;o.splice(n[c].first,p.length,...p);let m=e.value;this.#r(e,this.#h(u,o),{}),this.#n(e,c),this.#f(e,m,"insertReplacementText");return}default:return}t.preventDefault(),this.#n(e,Math.max(0,Math.min(h,a)))}#n(e,t,i=!0){let r=this.#t.get(e);r.seg&&r.seg.gi!==t&&this.#p(e),(i||r.seg?.gi!==t)&&(r.seg={gi:t,buffer:""});let s=this.#i(r).spans[t];document.activeElement===e&&e.setSelectionRange(s.start,s.end)}#x(e,t){let{g:i}=this.#a(t,e.selectionStart??0,e.selectionEnd??0),r=this.#i(t).spans.indexOf(i);return t.seg?.gi!==r&&(this.#p(e),t.seg={gi:r,buffer:""}),t.seg}#p(e){let t=this.#t.get(e),i=this.#i(t);if(!t.seg?.buffer||!i)return;let r=i.spans[t.seg.gi],s=this.#u(t,i),n=s.slice(r.first,r.last+1),a=R(r,n);t.seg.buffer="",a!==n&&(s.splice(r.first,a.length,...a),this.#r(e,this.#h(i,s),{}))}#I(e,t){let i=this.#t.get(e),r=this.#i(i);if(!r||this.#a(i,0).edit!="whole")return;let s=t&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING;this.#n(e,s?r.spans.length-1:0)}#N(e,t=!1){let i=this.#t.get(e);if(document.activeElement!==e||!i?.result)return;let r=e.selectionStart,s=e.selectionEnd;if(r==null)return;let{g:n,edit:a}=this.#a(i,r,s);if(a=="whole"){let h=this.#i(i).spans.indexOf(n);return!t&&i.seg?.gi===h&&r==n.start&&s==n.end?void 0:this.#n(e,h,t||i.seg?.gi!==h)}if(a!="end")return;if(r!==s){let[h,u]=n?[n.start,n.end]:[0,e.value.length];(r!=0||s!=e.value.length)&&(r!=h||s!=u)&&e.setSelectionRange(h,u);return}if(r===i.caret)return;let c=this.#w(e,i,n);r!==c&&e.setSelectionRange(c,c),i.caret=c}#w(e,t,i){if(i){let r=this.#i(t).slots;for(let s=i.first;s<r.length;s++)if(t.result.cells?.[s]==null)return r[s].fmt;return r.at(-1).fmt+1}return Math.min(t.result.stop_fmt,e.value.length)}#i(e){let t=e.def;if(this.#e.placeholder!="always"||e.defs.length>1||!t?.fixed)return null;let i=t.layout??=l.#A(t);return i.spans??=ye(i,this.#e),i}#a(e,t,i=t){let r=this.#i(e)?.spans??[],s=r.find(a=>t!=i&&a.start==t&&a.end==i)??r.find(a=>t<=a.end)??r.at(-1)??null,n=s?s.opts.edit:this.#e.edit;return{g:s,edit:n=="whole"&&!s?"end":n}}#u(e,t){return t.slots.map((i,r)=>e.result?.cells?.[r]??null)}#h(e,t){let i=t.reduce((r,s,n)=>s!=null?n:r,-1);return t.slice(0,i+1).map((r,s)=>r??e.slots[s].fill).join("")}#k(e,t){let i=0;for(let r of e)(r.fmt_end<=t||r.fmt_start<t)&&(i=r.stream_end);return i}#m(e){let t=this.#t.get(e);if(e.value===t.rendered)return;t.seg=null;let i=e.selectionStart??e.value.length;this.#r(e,e.value,{prefix:e.value.slice(0,i)})}#r(e,t,{prefix:i=null,caret_fmt:r=null,silent:s=!1}={}){let n=this.#t.get(e),a=this.#P(n),c={raw:n.result?.raw??"",value:e.value,input:e,holes:a},h=z(n.defs,t,c);if(!h)return null;let{result:u,def:o,mask_id:p}=h,m={def:o,full:u,cut:null};n.max_raw!=null&&u.raw.length>n.max_raw&&(m.cut=_e(u,n.max_raw),h=z(n.defs,u.stream.slice(0,m.cut),c),{result:u,def:o,mask_id:p}=h),!o.numeral&&!xe(o.names,{...u.groups,null:u.raw},this.#e)&&(u.complete=!1);let d=this.#q(e,u);e.value!==d&&(e.value=d),n.rendered=d,r==null&&i!=null&&document.activeElement===e&&(r=ge(u,A(o,i,{input:e,holes:a}).stream.length)),r!=null&&document.activeElement===e&&(r=Math.min(r,d.length),e.setSelectionRange(r,r),n.caret=r);let f=n.result,y=n.mask_id;if(n.result=u,n.stream=u.stream,n.def=o,n.mask_id=p,e.setAttribute("mask_id",p),e.setAttribute("progress",u.raw.length),e.setAttribute("is_complete",u.complete),this.#R(n)&&e.setCustomValidity&&e.setCustomValidity(!u.stream||u.complete?"":this.#U(e,n)),s)return m;let b=this.#c(e,n);return this.on_input(e,b),u.raw!==(f?.raw??"")&&this.on_accept(e,b),u.complete&&!f?.complete&&this.on_complete(e,b),!u.complete&&f?.complete&&this.on_incomplete(e,b),f&&p!==y&&this.on_mask_change(e,b),m}#P(e){let[t]=e.defs;return this.#e.placeholder=="always"&&e.defs.length==1&&!!(t.fixed||t.fn)}#q(e,t){let{placeholder:i}=this.#e;return t.stream?$(t,i):document.activeElement!==e?"":i=="always"?$(t,"always"):i==!1||i=="typed"?"":$(t,!0)}#c(e,t){return{raw:t.result?.raw??"",formatted:e.value,complete:t.result?.complete??!1,mask_id:t.mask_id,progress:t.result?.raw.length??0,groups:{...t.result?.groups},empty:!t.stream,skeleton:t.result?$(t.result,"always"):""}}#R(e){let t=this.#e.validate;return t===!0||t==null&&e.coerced!=null}#U(e,t){let i=typeof this.validation_message=="function"?this.validation_message:this.#e.validation_message??t.def?.message;return typeof i=="function"?i(e,this.#c(e,t))||"":typeof i=="string"?i:t.coerced=="email"?"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B":t.coerced=="number"||t.def?.numeral?"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0447\u0438\u0441\u043B\u043E \u0432 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u043C \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0435":"\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043F\u043E\u043B\u0435 \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E"}};var Fe=["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],We=["\u044F\u043D\u0432\u0430\u0440\u044F","\u0444\u0435\u0432\u0440\u0430\u043B\u044F","\u043C\u0430\u0440\u0442\u0430","\u0430\u043F\u0440\u0435\u043B\u044F","\u043C\u0430\u044F","\u0438\u044E\u043D\u044F","\u0438\u044E\u043B\u044F","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F","\u043E\u043A\u0442\u044F\u0431\u0440\u044F","\u043D\u043E\u044F\u0431\u0440\u044F","\u0434\u0435\u043A\u0430\u0431\u0440\u044F"],we=["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"],M=(l,e=2)=>String(l).padStart(e,"0"),Ke=(l,e)=>new Date(Date.UTC(l,e,0)).getUTCDate(),ke=(l,e,t)=>Number.isInteger(l)&&Number.isInteger(e)&&Number.isInteger(t)&&l>=1&&l<=9999&&e>=1&&e<=12&&t>=1&&t<=Ke(l,e),Z=(l,e,t)=>`${M(l,4)}-${M(e)}-${M(t)}`,w=l=>{let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(l??"").trim());if(!e)return null;let[t,i,r]=e.slice(1).map(Number);return ke(t,i,r)?{year:t,month:i,day:r}:null},Q=(l=new Date)=>Z(l.getFullYear(),l.getMonth()+1,l.getDate()),U=l=>{let e=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(String(l??"").trim());if(!e)return null;let[t,i,r]=e.slice(1).map(Number);return ke(r,i,t)?Z(r,i,t):null},X=l=>{let e=w(l);return e?`${M(e.day)}.${M(e.month)}.${M(e.year,4)}`:""},Ve=l=>{let e=w(l);return e?`${e.day} ${We[e.month-1]} ${e.year}`:""},Ee=(l,e)=>`${Fe[e-1]} ${l}`,Se=(l,e,t)=>{let i=l*12+(e-1)+t;return{year:Math.floor(i/12),month:i%12+1}},Be=(l,e,t)=>!(e&&l<e)&&!(t&&l>t),F=(l,e,t)=>w(l)?e&&l<e?"min":t&&l>t?"max":null:"invalid",Ae=(l,e,{from:t=null,to:i=null,min:r=null,max:s=null,now:n=Q()}={})=>{let a=(new Date(Date.UTC(l,e-1,1)).getUTCDay()+6)%7,c=[];for(let h=0;h<42;h++){let u=new Date(Date.UTC(l,e-1,1-a+h)),o=Z(u.getUTCFullYear(),u.getUTCMonth()+1,u.getUTCDate()),p=!!(t&&i);c.push({iso:o,day:u.getUTCDate(),label:Ve(o),other:u.getUTCMonth()+1!=e,today:o==n,disabled:!Be(o,r,s),selected:o==t||o==i,in_range:p&&o>t&&o<i,range_from:p&&o==t,range_to:p&&o==i})}return c},$e=({from:l=null,to:e=null},t,i=!1)=>!i||!l||e?{from:t,to:null}:t<l?{from:t,to:l}:{from:l,to:t},ee=l=>{let[e,t]=String(l??"").split("/");return{from:w(e)?e.trim():null,to:w(t)?t.trim():null}},te=({from:l,to:e},t=!1)=>t?l||e?`${l??""}/${e??""}`:"":l??"";var Ge={mask:"{dd:00}.{mm:00}.{yyyy:0000}",placeholder:"always",edit:"whole",align:"right",pad:"0",validate:!1,groups:{dd:{filler:"\u0414\u0414",min:1,max:31},mm:{filler:"\u041C\u041C",min:1,max:12},yyyy:{filler:"\u0413\u0413\u0413\u0413",min:1}}},He='<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="3.5" y="5" width="17" height="15.5" rx="2"/><path d="M3.5 10h17M8 3v4M16 3v4"/></svg>',Ye={app:"datepicker",name:"",range:!1,inline:!1,required:!1,value:"",min:"",max:"",inputId:"",messages:{required:"\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043F\u043E\u043B\u0435",incomplete:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0430\u0442\u0443 \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E",invalid:"\u0422\u0430\u043A\u043E\u0439 \u0434\u0430\u0442\u044B \u043D\u0435\u0442",min:"\u0414\u0430\u0442\u0430 \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 {date}",max:"\u0414\u0430\u0442\u0430 \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 {date}",order:"\u041A\u043E\u043D\u0435\u0446 \u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0440\u0430\u043D\u044C\u0448\u0435 \u043D\u0430\u0447\u0430\u043B\u0430"},from:null,to:null,year:0,month:0,is_open:!1,invalid:!1,days:[],weekdays:we,get caption(){return this.year?Ee(this.year,this.month):""},template:`
|
|
2
2
|
<div class="datepicker__field" #class="{ 'datepicker__field--invalid': invalid }" #show="!inline">
|
|
3
3
|
<input class="datepicker__input" datepicker-from type="text" inputmode="numeric" autocomplete="off" id="{{ inputId }}" required="{{ required }}">
|
|
4
4
|
<span class="datepicker__dash" #show="range" aria-hidden="true">\u2014</span>
|
|
5
5
|
<input class="datepicker__input" datepicker-to type="text" inputmode="numeric" autocomplete="off" aria-label="\u041A\u043E\u043D\u0435\u0446 \u043F\u0435\u0440\u0438\u043E\u0434\u0430" #show="range" required="{{ required && range }}">
|
|
6
|
-
<button class="datepicker__toggle" type="button" aria-label="\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C" aria-haspopup="dialog" aria-expanded="{{ is_open }}" @click="toggle()">${
|
|
6
|
+
<button class="datepicker__toggle" type="button" aria-label="\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C" aria-haspopup="dialog" aria-expanded="{{ is_open }}" @click="toggle()">${He}</button>
|
|
7
7
|
</div>
|
|
8
8
|
<input type="hidden" datepicker-value="from" name="{{ name ? (range ? name + '_from' : name) : '' }}">
|
|
9
9
|
<input type="hidden" datepicker-value="to" name="{{ name && range ? name + '_to' : '' }}" disabled="{{ !range }}">
|
|
@@ -24,5 +24,5 @@ var Datepicker=(()=>{var F=Object.defineProperty;var $e=Object.getOwnPropertyDes
|
|
|
24
24
|
<button class="datepicker__reset" type="button" @click="clear()">\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C</button>
|
|
25
25
|
<button class="datepicker__apply" type="button" @click="apply()">\u0412\u044B\u0431\u0440\u0430\u0442\u044C</button>
|
|
26
26
|
</div>
|
|
27
|
-
</div>`,setup(){this.days=Array.from({length:42},()=>({iso:"",day:0,label:"",other:!1,today:!1,disabled:!1,selected:!1,in_range:!1,range_from:!1,range_to:!1}))},events:{rendered:function(){let l=this;l._abort?.abort(),l._abort=new AbortController;let e=l._abort.signal;l._inputs=[l.querySelector("[datepicker-from]"),l.querySelector("[datepicker-to]")],l._hidden=[l.querySelector('[datepicker-value="from"]'),l.querySelector('[datepicker-value="to"]')],l._mask=new
|
|
27
|
+
</div>`,setup(){this.days=Array.from({length:42},()=>({iso:"",day:0,label:"",other:!1,today:!1,disabled:!1,selected:!1,in_range:!1,range_from:!1,range_to:!1}))},events:{rendered:function(){let l=this;l._abort?.abort(),l._abort=new AbortController;let e=l._abort.signal;l._inputs=[l.querySelector("[datepicker-from]"),l.querySelector("[datepicker-to]")],l._hidden=[l.querySelector('[datepicker-value="from"]'),l.querySelector('[datepicker-value="to"]')],l._mask=new L({target:l._inputs,...Ge}),l._initial=l.value;for(let t of l._inputs)t.addEventListener("input",()=>l._typed(),{signal:e}),t.addEventListener("blur",()=>{l.invalid=!l._valid()},{signal:e}),t.addEventListener("invalid",()=>{l.invalid=!0},{signal:e});l.addEventListener("keydown",t=>{t.key=="Escape"&&l.is_open&&(l.close(),l.querySelector(".datepicker__toggle")?.focus())},{signal:e}),document.addEventListener("click",t=>{if(!l.isConnected)return l._abort.abort();l.is_open&&!t.composedPath().includes(l)&&l.close()},{signal:e}),l.closest("form")?.addEventListener("reset",()=>setTimeout(()=>{l._load(l._initial),l.invalid=!1}),{signal:e}),l._watching||(l._watching=l.watch("value",t=>{t!==l._value&&l._load(t)})),l._load(l.value)}},refresh(){let[l,e]=this._hidden.map(t=>t.value);this._load(this.range?te({from:l,to:e},!0):l)},open(){this.inline||this.is_open||(this._view(this.from),this.is_open=!0,this.dispatchEvent("datepicker:open",null,{bubbles:!0}))},close(){this.inline||!this.is_open||(this.is_open=!1,this._select(ee(this._value)),this.dispatchEvent("datepicker:close",null,{bubbles:!0}))},toggle(){this.is_open?this.close():this.open()},go(l){let{year:e,month:t}=Se(this.year,this.month,l);this.year=e,this.month=t,this._paint()},pick(l){let e=$e({from:this.from,to:this.to},l,this.range);this._select(e),!(this.inline||this.range&&!e.to)&&(this._commit(),this.close())},apply(){this._commit()},clear(){this._select({from:null,to:null}),this._commit(),this.close()},_load(l){let{from:e,to:t}=ee(l);this.range||(t=null),this._select({from:e,to:t}),this._view(e),this._write({from:e,to:t}),this._emitted=this._value,this._check()},_select({from:l,to:e}){this.from=l,this.to=e,this._paint()},_commit(){let l={from:this.from,to:this.range?this.to:null};this._write(l),this._check(),this.invalid=!this._valid(),this._emit(l)},_write({from:l,to:e},t=!0){this._value=te({from:l,to:e},this.range),this.value=this._value,this._hidden[0].value=l??"",this._hidden[1].value=e??"",t&&(this._silent=!0,this._inputs.forEach((i,r)=>this._mask.set(i,X(r?e:l).replace(/\D/g,""))),this._silent=!1)},_emit(l){if(this._emitted!==this._value){this._emitted=this._value;for(let e of this._hidden.filter(t=>!t.disabled))e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}));this.dispatchEvent("datepicker:change",{...l,value:this._value},{bubbles:!0})}},_typed(){if(this._silent)return;let[l,e]=this._inputs.map(t=>U(t.value));l&&F(l,this.min,this.max)&&(l=null),e&&F(e,this.min,this.max)&&(e=null),this.range||(e=null),this._write({from:l,to:e},!1),this._select({from:l,to:e}),this._view(e??l),this._check(),this.invalid&&(this.invalid=!this._valid()),this._emit({from:l,to:e})},_check(){let[l,e]=this._inputs;if(l.setCustomValidity(this._problem(l)),e.setCustomValidity(this.range?this._problem(e):""),this.range&&!l.validationMessage&&!e.validationMessage){let[t,i]=this._inputs.map(r=>U(r.value));t&&i&&i<t&&e.setCustomValidity(this.messages.order)}},_problem(l){let e=this._mask.state(l);if(!e||e.empty)return this.required?this.messages.required:"";if(!e.complete)return this.messages.incomplete;let t=U(l.value),i=t?F(t,this.min,this.max):"invalid";return i?this.messages[i].replace("{date}",X(i=="min"?this.min:this.max)):""},_valid(){return this._inputs.every(l=>!l.validationMessage)},_view(l){let e=Q();this.min&&e<this.min&&(e=this.min),this.max&&e>this.max&&(e=this.max);let{year:t,month:i}=w(l)??w(e);this.year=t,this.month=i,this._paint()},_paint(){if(!this.year||this.days.length!=42)return;Ae(this.year,this.month,{from:this.from,to:this.to,min:this.min,max:this.max}).forEach((e,t)=>Object.assign(this.days[t],e))}};return De(ze);})();
|
|
28
28
|
if(typeof Datepicker!=="undefined"&&Datepicker&&Datepicker.default)globalThis.Datepicker=Datepicker.default;
|