var Le=Object.defineProperty;var Ce=(n,r,e)=>r in n?Le(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var o=(n,r,e)=>Ce(n,typeof r!="symbol"?r+"":r,e);import qe from"./BNUXqe9z.js";import Ye from"./DcOwllJ6.js";import{ak as Te,al as F,am as A,an as Re,ao as Ne,ap as Qe,aq as Fe,ar as ae,as as ve,at as Ae,au as We,av as De,aw as ze,ax as ue,ay as Ge,az as de,aA as $e,aB as Xe,e as oe,aC as J,aD as Ve,aE as Ue,c as Ke,d as je,u as Ze,a as Je,aj as Se,r as Q,w as et,aF as tt,s as he,f as K,h as L,i as S,C as fe,v as re,g as p,aG as we,x as st,z as pe,A as rt,aH as nt,aI as me,aJ as at,F as ot,y as it,aK as ct,aL as ye,o as j,aM as lt,aN as ut,aO as dt,aP as ht,aQ as _e,n as ne,aR as be,_ as ft}from"./BxiWQxwE.js";import wt from"./D2slXjIl.js";import pt from"./BzMiIgh9.js";import{u as mt}from"./C2dOrIeI.js";import{a as ke}from"./Bo9XA6rV.js";import{i as yt}from"./Cgs-mdcL.js";import"./C-_VXZri.js";import"./BZI46otX.js";import"./DbZappjS.js";import"./BkokwQMS.js";import"./D4QCjprS.js";import"./JithwCjz.js";function _t(){return Object.assign({},Te())}function bt(n,r){const e=F(n,r==null?void 0:r.in).getDay();return e===0?7:e}function gt(n,r){return+F(n)>+F(r)}function xt(n,r){const e=Tt(r)?new r(0):A(r,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function Tt(n){var r;return typeof n=="function"&&((r=n.prototype)==null?void 0:r.constructor)===n}const vt=10;class Me{constructor(){o(this,"subPriority",0)}validate(r,e){return!0}}class Dt extends Me{constructor(r,e,s,t,a){super(),this.value=r,this.validateValue=e,this.setValue=s,this.priority=t,a&&(this.subPriority=a)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,s){return this.setValue(r,e,this.value,s)}}class kt extends Me{constructor(e,s){super();o(this,"priority",vt);o(this,"subPriority",-1);this.context=e||(t=>A(s,t))}set(e,s){return s.timestampIsSet?e:A(e,xt(e,this.context))}}class f{run(r,e,s,t){const a=this.parse(r,e,s,t);return a?{setter:new Dt(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,e,s){return!0}}class Mt extends f{constructor(){super(...arguments);o(this,"priority",140);o(this,"incompatibleTokens",["R","u","t","T"])}parse(e,s,t){switch(s){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,s,t){return s.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}}const g={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Y={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function x(n,r){return n&&{value:r(n.value),rest:n.rest}}function _(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function R(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const s=e[1]==="+"?1:-1,t=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:s*(t*Re+a*Ne+i*Qe),rest:r.slice(e[0].length)}}function Pe(n){return _(g.anyDigitsSigned,n)}function b(n,r){switch(n){case 1:return _(g.singleDigit,r);case 2:return _(g.twoDigits,r);case 3:return _(g.threeDigits,r);case 4:return _(g.fourDigits,r);default:return _(new RegExp("^\\d{1,"+n+"}"),r)}}function se(n,r){switch(n){case 1:return _(g.singleDigitSigned,r);case 2:return _(g.twoDigitsSigned,r);case 3:return _(g.threeDigitsSigned,r);case 4:return _(g.fourDigitsSigned,r);default:return _(new RegExp("^-?\\d{1,"+n+"}"),r)}}function ie(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Oe(n,r){const e=r>0,s=e?r:1-r;let t;if(s<=50)t=n||100;else{const a=s+50,i=Math.trunc(a/100)*100,w=n>=a%100;t=n+i-(w?100:0)}return e?t:1-t}function Ee(n){return n%400===0||n%4===0&&n%100!==0}class Pt extends f{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,s,t){const a=i=>({year:i,isTwoDigitYear:s==="yy"});switch(s){case"y":return x(b(4,e),a);case"yo":return x(t.ordinalNumber(e,{unit:"year"}),a);default:return x(b(s.length,e),a)}}validate(e,s){return s.isTwoDigitYear||s.year>0}set(e,s,t){const a=e.getFullYear();if(t.isTwoDigitYear){const w=Oe(t.year,a);return e.setFullYear(w,0,1),e.setHours(0,0,0,0),e}const i=!("era"in s)||s.era===1?t.year:1-t.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class Ot extends f{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,s,t){const a=i=>({year:i,isTwoDigitYear:s==="YY"});switch(s){case"Y":return x(b(4,e),a);case"Yo":return x(t.ordinalNumber(e,{unit:"year"}),a);default:return x(b(s.length,e),a)}}validate(e,s){return s.isTwoDigitYear||s.year>0}set(e,s,t,a){const i=Fe(e,a);if(t.isTwoDigitYear){const u=Oe(t.year,i);return e.setFullYear(u,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ae(e,a)}const w=!("era"in s)||s.era===1?t.year:1-t.year;return e.setFullYear(w,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ae(e,a)}}class Et extends f{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,s){return se(s==="R"?4:s.length,e)}set(e,s,t){const a=A(e,0);return a.setFullYear(t,0,4),a.setHours(0,0,0,0),ve(a)}}class Bt extends f{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,s){return se(s==="u"?4:s.length,e)}set(e,s,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}}class Ht extends f{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,s,t){switch(s){case"Q":case"QQ":return b(s.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,s){return s>=1&&s<=4}set(e,s,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}}class It extends f{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,s,t){switch(s){case"q":case"qq":return b(s.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,s){return s>=1&&s<=4}set(e,s,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}}class Lt extends f{constructor(){super(...arguments);o(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);o(this,"priority",110)}parse(e,s,t){const a=i=>i-1;switch(s){case"M":return x(_(g.month,e),a);case"MM":return x(b(2,e),a);case"Mo":return x(t.ordinalNumber(e,{unit:"month"}),a);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,s){return s>=0&&s<=11}set(e,s,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class Ct extends f{constructor(){super(...arguments);o(this,"priority",110);o(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,s,t){const a=i=>i-1;switch(s){case"L":return x(_(g.month,e),a);case"LL":return x(b(2,e),a);case"Lo":return x(t.ordinalNumber(e,{unit:"month"}),a);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,s){return s>=0&&s<=11}set(e,s,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}function qt(n,r,e){const s=F(n,e==null?void 0:e.in),t=Ae(s,e)-r;return s.setDate(s.getDate()-t*7),F(s,e==null?void 0:e.in)}class Yt extends f{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,s,t){switch(s){case"w":return _(g.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return b(s.length,e)}}validate(e,s){return s>=1&&s<=53}set(e,s,t,a){return ae(qt(e,t,a),a)}}function Rt(n,r,e){const s=F(n,e==null?void 0:e.in),t=We(s,e)-r;return s.setDate(s.getDate()-t*7),s}class Nt extends f{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,s,t){switch(s){case"I":return _(g.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return b(s.length,e)}}validate(e,s){return s>=1&&s<=53}set(e,s,t){return ve(Rt(e,t))}}const Qt=[31,28,31,30,31,30,31,31,30,31,30,31],Ft=[31,29,31,30,31,30,31,31,30,31,30,31];class At extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"subPriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,s,t){switch(s){case"d":return _(g.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return b(s.length,e)}}validate(e,s){const t=e.getFullYear(),a=Ee(t),i=e.getMonth();return a?s>=1&&s<=Ft[i]:s>=1&&s<=Qt[i]}set(e,s,t){return e.setDate(t),e.setHours(0,0,0,0),e}}class Wt extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"subpriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,s,t){switch(s){case"D":case"DD":return _(g.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return b(s.length,e)}}validate(e,s){const t=e.getFullYear();return Ee(t)?s>=1&&s<=366:s>=1&&s<=365}set(e,s,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}}function ce(n,r,e){var T,D,m,P;const s=Te(),t=(e==null?void 0:e.weekStartsOn)??((D=(T=e==null?void 0:e.locale)==null?void 0:T.options)==null?void 0:D.weekStartsOn)??s.weekStartsOn??((P=(m=s.locale)==null?void 0:m.options)==null?void 0:P.weekStartsOn)??0,a=F(n,e==null?void 0:e.in),i=a.getDay(),u=(r%7+7)%7,y=7-t,M=r<0||r>6?r-(i+y)%7:(u+y)%7-(i+y)%7;return ke(a,M,e)}class zt extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,s,t){switch(s){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,s){return s>=0&&s<=6}set(e,s,t,a){return e=ce(e,t,a),e.setHours(0,0,0,0),e}}class Gt extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,s,t,a){const i=w=>{const u=Math.floor((w-1)/7)*7;return(w+a.weekStartsOn+6)%7+u};switch(s){case"e":case"ee":return x(b(s.length,e),i);case"eo":return x(t.ordinalNumber(e,{unit:"day"}),i);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,s){return s>=0&&s<=6}set(e,s,t,a){return e=ce(e,t,a),e.setHours(0,0,0,0),e}}class $t extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,s,t,a){const i=w=>{const u=Math.floor((w-1)/7)*7;return(w+a.weekStartsOn+6)%7+u};switch(s){case"c":case"cc":return x(b(s.length,e),i);case"co":return x(t.ordinalNumber(e,{unit:"day"}),i);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,s){return s>=0&&s<=6}set(e,s,t,a){return e=ce(e,t,a),e.setHours(0,0,0,0),e}}function Xt(n,r,e){const s=F(n,e==null?void 0:e.in),t=bt(s,e),a=r-t;return ke(s,a,e)}class Vt extends f{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,s,t){const a=i=>i===0?7:i;switch(s){case"i":case"ii":return b(s.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return x(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return x(t.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return x(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return x(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,s){return s>=1&&s<=7}set(e,s,t){return e=Xt(e,t),e.setHours(0,0,0,0),e}}class Ut extends f{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,s,t){switch(s){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,s,t){return e.setHours(ie(t),0,0,0),e}}class Kt extends f{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,s,t){switch(s){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,s,t){return e.setHours(ie(t),0,0,0),e}}class jt extends f{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","b","t","T"])}parse(e,s,t){switch(s){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,s,t){return e.setHours(ie(t),0,0,0),e}}class Zt extends f{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,s,t){switch(s){case"h":return _(g.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return b(s.length,e)}}validate(e,s){return s>=1&&s<=12}set(e,s,t){const a=e.getHours()>=12;return a&&t<12?e.setHours(t+12,0,0,0):!a&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}}class Jt extends f{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,s,t){switch(s){case"H":return _(g.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return b(s.length,e)}}validate(e,s){return s>=0&&s<=23}set(e,s,t){return e.setHours(t,0,0,0),e}}class St extends f{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,s,t){switch(s){case"K":return _(g.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return b(s.length,e)}}validate(e,s){return s>=0&&s<=11}set(e,s,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}}class es extends f{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,s,t){switch(s){case"k":return _(g.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return b(s.length,e)}}validate(e,s){return s>=1&&s<=24}set(e,s,t){const a=t<=24?t%24:t;return e.setHours(a,0,0,0),e}}class ts extends f{constructor(){super(...arguments);o(this,"priority",60);o(this,"incompatibleTokens",["t","T"])}parse(e,s,t){switch(s){case"m":return _(g.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return b(s.length,e)}}validate(e,s){return s>=0&&s<=59}set(e,s,t){return e.setMinutes(t,0,0),e}}class ss extends f{constructor(){super(...arguments);o(this,"priority",50);o(this,"incompatibleTokens",["t","T"])}parse(e,s,t){switch(s){case"s":return _(g.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return b(s.length,e)}}validate(e,s){return s>=0&&s<=59}set(e,s,t){return e.setSeconds(t,0),e}}class rs extends f{constructor(){super(...arguments);o(this,"priority",30);o(this,"incompatibleTokens",["t","T"])}parse(e,s){const t=a=>Math.trunc(a*Math.pow(10,-s.length+3));return x(b(s.length,e),t)}set(e,s,t){return e.setMilliseconds(t),e}}class ns extends f{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","x"])}parse(e,s){switch(s){case"X":return R(Y.basicOptionalMinutes,e);case"XX":return R(Y.basic,e);case"XXXX":return R(Y.basicOptionalSeconds,e);case"XXXXX":return R(Y.extendedOptionalSeconds,e);case"XXX":default:return R(Y.extended,e)}}set(e,s,t){return s.timestampIsSet?e:A(e,e.getTime()-De(e)-t)}}class as extends f{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","X"])}parse(e,s){switch(s){case"x":return R(Y.basicOptionalMinutes,e);case"xx":return R(Y.basic,e);case"xxxx":return R(Y.basicOptionalSeconds,e);case"xxxxx":return R(Y.extendedOptionalSeconds,e);case"xxx":default:return R(Y.extended,e)}}set(e,s,t){return s.timestampIsSet?e:A(e,e.getTime()-De(e)-t)}}class os extends f{constructor(){super(...arguments);o(this,"priority",40);o(this,"incompatibleTokens","*")}parse(e){return Pe(e)}set(e,s,t){return[A(e,t*1e3),{timestampIsSet:!0}]}}class is extends f{constructor(){super(...arguments);o(this,"priority",20);o(this,"incompatibleTokens","*")}parse(e){return Pe(e)}set(e,s,t){return[A(e,t),{timestampIsSet:!0}]}}const cs={G:new Mt,y:new Pt,Y:new Ot,R:new Et,u:new Bt,Q:new Ht,q:new It,M:new Lt,L:new Ct,w:new Yt,I:new Nt,d:new At,D:new Wt,E:new zt,e:new Gt,c:new $t,i:new Vt,a:new Ut,b:new Kt,B:new jt,h:new Zt,H:new Jt,K:new St,k:new es,m:new ts,s:new ss,S:new rs,X:new ns,x:new as,t:new os,T:new is},ls=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,us=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ds=/^'([^]*?)'?$/,hs=/''/g,fs=/\S/,ws=/[a-zA-Z]/;function ge(n,r,e,s){var z,G,B,C;const t=()=>A(e,NaN),a=_t(),i=a.locale??ze,w=a.firstWeekContainsDate??((G=(z=a.locale)==null?void 0:z.options)==null?void 0:G.firstWeekContainsDate)??1,u=a.weekStartsOn??((C=(B=a.locale)==null?void 0:B.options)==null?void 0:C.weekStartsOn)??0,y={firstWeekContainsDate:w,weekStartsOn:u,locale:i},M=[new kt(s==null?void 0:s.in,e)],T=r.match(us).map(d=>{const h=d[0];if(h in ue){const v=ue[h];return v(d,i.formatLong)}return d}).join("").match(ls),D=[];for(let d of T){Ge(d)&&de(d,r,n),$e(d)&&de(d,r,n);const h=d[0],v=cs[h];if(v){const{incompatibleTokens:q}=v;if(Array.isArray(q)){const X=D.find(N=>q.includes(N.token)||N.token===h);if(X)throw new RangeError(`The format string mustn't contain \`${X.fullToken}\` and \`${d}\` at the same time`)}else if(v.incompatibleTokens==="*"&&D.length>0)throw new RangeError(`The format string mustn't contain \`${d}\` and any other token at the same time`);D.push({token:h,fullToken:d});const I=v.run(n,d,i.match,y);if(!I)return t();M.push(I.setter),n=I.rest}else{if(h.match(ws))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");if(d==="''"?d="'":h==="'"&&(d=ps(d)),n.indexOf(d)===0)n=n.slice(d.length);else return t()}}if(n.length>0&&fs.test(n))return t();const m=M.map(d=>d.priority).sort((d,h)=>h-d).filter((d,h,v)=>v.indexOf(d)===h).map(d=>M.filter(h=>h.priority===d).sort((h,v)=>v.subPriority-h.subPriority)).map(d=>d[0]);let P=F(e,s==null?void 0:s.in);if(isNaN(+P))return t();const W={};for(const d of m){if(!d.validate(P,y))return t();const h=d.set(P,W,y);Array.isArray(h)?(P=h[0],Object.assign(W,h[1])):P=h}return P}function ps(n){return n.match(ds)[1].replace(hs,"'")}class ${constructor(r,e){o(this,"words");o(this,"sigBytes");r=this.words=r||[],this.sigBytes=e===void 0?r.length*4:e}toString(r){return(r||ms).stringify(this)}concat(r){if(this.clamp(),this.sigBytes%4)for(let e=0;e<r.sigBytes;e++){const s=r.words[e>>>2]>>>24-e%4*8&255;this.words[this.sigBytes+e>>>2]|=s<<24-(this.sigBytes+e)%4*8}else for(let e=0;e<r.sigBytes;e+=4)this.words[this.sigBytes+e>>>2]=r.words[e>>>2];return this.sigBytes+=r.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new $([...this.words])}}const ms={stringify(n){const r=[];for(let e=0;e<n.sigBytes;e++){const s=n.words[e>>>2]>>>24-e%4*8&255;r.push((s>>>4).toString(16),(s&15).toString(16))}return r.join("")}},ys={stringify(n){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=[];for(let s=0;s<n.sigBytes;s+=3){const t=n.words[s>>>2]>>>24-s%4*8&255,a=n.words[s+1>>>2]>>>24-(s+1)%4*8&255,i=n.words[s+2>>>2]>>>24-(s+2)%4*8&255,w=t<<16|a<<8|i;for(let u=0;u<4&&s*8+u*6<n.sigBytes*8;u++)e.push(r.charAt(w>>>6*(3-u)&63))}return e.join("")}},_s={parse(n){const r=n.length,e=[];for(let s=0;s<r;s++)e[s>>>2]|=(n.charCodeAt(s)&255)<<24-s%4*8;return new $(e,r)}},bs={parse(n){return _s.parse(unescape(encodeURIComponent(n)))}};class gs{constructor(){o(this,"_data",new $);o(this,"_nDataBytes",0);o(this,"_minBufferSize",0);o(this,"blockSize",512/32)}reset(){this._data=new $,this._nDataBytes=0}_append(r){typeof r=="string"&&(r=bs.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes}_doProcessBlock(r,e){}_process(r){let e,s=this._data.sigBytes/(this.blockSize*4);r?s=Math.ceil(s):s=Math.max((s|0)-this._minBufferSize,0);const t=s*this.blockSize,a=Math.min(t*4,this._data.sigBytes);if(t){for(let i=0;i<t;i+=this.blockSize)this._doProcessBlock(this._data.words,i);e=this._data.words.splice(0,t),this._data.sigBytes-=a}return new $(e,a)}}class xs extends gs{update(r){return this._append(r),this._process(),this}finalize(r){r&&this._append(r)}}const xe=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Ts=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Z=[];class vs extends xs{constructor(){super(...arguments);o(this,"_hash",new $([...xe]))}reset(){super.reset(),this._hash=new $([...xe])}_doProcessBlock(e,s){const t=this._hash.words;let a=t[0],i=t[1],w=t[2],u=t[3],y=t[4],M=t[5],T=t[6],D=t[7];for(let m=0;m<64;m++){if(m<16)Z[m]=e[s+m]|0;else{const d=Z[m-15],h=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=Z[m-2],q=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;Z[m]=h+Z[m-7]+q+Z[m-16]}const P=y&M^~y&T,W=a&i^a&w^i&w,z=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),G=(y<<26|y>>>6)^(y<<21|y>>>11)^(y<<7|y>>>25),B=D+G+P+Ts[m]+Z[m],C=z+W;D=T,T=M,M=y,y=u+B|0,u=w,w=i,i=a,a=B+C|0}t[0]=t[0]+a|0,t[1]=t[1]+i|0,t[2]=t[2]+w|0,t[3]=t[3]+u|0,t[4]=t[4]+y|0,t[5]=t[5]+M|0,t[6]=t[6]+T|0,t[7]=t[7]+D|0}finalize(e){super.finalize(e);const s=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(s/4294967296),this._data.words[(t+64>>>9<<4)+15]=s,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function Ds(n){return new vs().finalize(n).toString(ys)}function ks(n,r={}){const e=typeof n=="string"?n:Xe(n,r);return Ds(e).slice(0,10)}function Ms(n,r,e){const[s={},t]=[{},r],a=oe(()=>J(n)),i=s.key||ks([t,typeof a.value=="string"?a.value:"",...Ps(s)]);if(!i||typeof i!="string")throw new TypeError("[nuxt] [useFetch] key must be a string: "+i);const w=i===t?"$f"+i:i;if(!s.baseURL&&typeof a.value=="string"&&a.value[0]==="/"&&a.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:u,lazy:y,default:M,transform:T,pick:D,watch:m,immediate:P,getCachedData:W,deep:z,dedupe:G,...B}=s,C=Ve({...Ue,...B,cache:typeof s.cache=="boolean"?void 0:s.cache}),d={server:u,lazy:y,default:M,transform:T,pick:D,immediate:P,getCachedData:W,deep:z,dedupe:G,watch:m===!1?[]:[C,a,...m||[]]};let h;return Ke(w,()=>{var N;(N=h==null?void 0:h.abort)==null||N.call(h,new DOMException("Request aborted as another request to the same endpoint was initiated.","AbortError")),h=typeof AbortController<"u"?new AbortController:{};const q=J(s.timeout);let I;return q&&(I=setTimeout(()=>h.abort(new DOMException("Request aborted due to timeout.","AbortError")),q),h.signal.onabort=()=>clearTimeout(I)),(s.$fetch||globalThis.$fetch)(a.value,{signal:h.signal,...C}).finally(()=>{clearTimeout(I)})},d)}function Ps(n){var e;const r=[((e=J(n.method))==null?void 0:e.toUpperCase())||"GET",J(n.baseURL)];for(const s of[n.params||n.query]){const t=J(s);if(!t)continue;const a={};for(const[i,w]of Object.entries(t))a[J(i)]=J(w);r.push(a)}return r}const Os={class:"container"},Es={class:"stores"},Bs={class:"stores__map"},Hs={class:"stores__list"},Is={class:"stores__list--search"},Ls=["aria-label"],Cs=["aria-label","placeholder"],qs=["aria-label"],Ys={key:0,class:"stores__list--search--autocomplete"},Rs=["onClick","innerHTML"],Ns={key:0,class:"stores__list--overview"},Qs={key:1,class:"stores__list--noresults"},Fs=60,As=je({__name:"index",async setup(n){let r,e;const s=Ze(),{$messages:t,$gtm:a}=Je(),{autoCompleteLocation:i,searchStore:w}=Se(),u=Q(""),y=Q(),M=Q(!1),T=Q([]),D=Q(!1),m=Q(be),{data:P}=([r,e]=et(()=>Ms("/api/stores","$vxX1Bs8BK5")),r=await r,e(),r);mt({title:t("stores.seo.title"),description:t("stores.seo.description"),ogDescription:t("stores.seo.ogDescription"),ogTitle:t("stores.seo.ogTitle"),ogImage:t("stores.seo.ogImage"),twitterCard:"summary_large_image"});const W=c=>{m.value={lat:c.coords.latitude,lng:c.coords.longitude}},z=c=>console.error(`Error getting user location: (${c.code}): ${c.message}`),G=Q([{id:1,value:1,label:t("stores.filters.openNow")??"",active:!1},{id:2,value:2,label:t("stores.filters.openTill",{time:"21:00"})??"",active:!1},{id:3,value:3,label:t("stores.filters.openSunday")??"",active:!1}]),B=Q(new Set),C=c=>{const l=new Set(B.value);l.has(c.value)?l.delete(c.value):l.add(c.value),a("stores.location_filter",{search_filter:c.label}),B.value=l},d=oe(()=>(P.value??[]).reduce((c,l)=>{var V;if(!l)return c;const O=new Date;let k=(V=l.openingHours)==null?void 0:V.find(U=>yt(O,new Date(U.date))),H;if(!k)H=t("stores.storeClosed")??"",k={close:null,date:O.toISOString().split("T")[0],open:null,special:!1};else if(k.close==="00:00:00"||!k.close)H=t("stores.storeClosed")??"";else{const U=typeof k.close=="string"?k.close.substring(0,5):null;H=t("stores.openTill",{time:U??""})??"";const te=O.toLocaleTimeString("en-GB").substring(0,5),E=typeof k.open=="string"?k.open.substring(0,5):"00:00";te<E?H=t("stores.opensIn",{time:E})??"":U&&te>U&&(H=t("stores.storeClosed")??"")}return c.push({...l,openClose:H,openToday:k,fullName:l.city+(l.street?" "+l.street:""),to:`/winkels/${ye(l.city??"")}/${ye(l.street??"")}/${l.storeId}`}),c},[])),h={1:"isOpenNow",2:"isOpenUntil2100",3:"isOpenOnSunday"},v={isOpenNow:(c,l)=>{var H,V;const O=new Date(l).setTime((H=c.openToday)==null?void 0:H.close),k=new Date(l).setTime((V=c.openToday)==null?void 0:V.open);return _e(l,O)&&gt(l,k)},isOpenUntil2100:c=>{var k;const l=ge((k=c.openToday)==null?void 0:k.close,"HH:mm:ss",new Date),O=ge("20:00:00","HH:mm:ss",new Date);return _e(O,l)},isOpenOnSunday:c=>{var l;return((l=c.openingHours)==null?void 0:l[6].open)!=="00:00:00"}},q=oe(()=>{var c;return(c=d.value)==null?void 0:c.filter(l=>{const O=new Date;return Array.from(B.value).every(k=>{const H=h[k];return!H||v[H](l,O)})})}),I=Q(q.value),X=()=>{M.value=!1,u.value="",T.value=[]},N=ut(()=>{if(u.value.length===0){X();return}i(u.value).then(c=>{var l;T.value=((l=c==null?void 0:c.autoCompleteLocation)==null?void 0:l.locations)??[]}).catch(c=>{console.error(c),T.value=[]})},300),Be=()=>{a("stores.search_location",{searchterm:u.value.toLowerCase()})},He=async c=>{c.to&&(a("stores.select_location",{location_name:c.fullName.toLowerCase(),location_id:c.storeId}),await ne(c.to))},le=async()=>{if(u.value===""){await ne({path:s.path,query:{}},{replace:!0});return}u.value!==s.query.searchterm&&await ne({path:s.path,query:{...s.query,searchterm:u.value}},{replace:!0})},Ie=async()=>{var l;const c=await w(u.value);!((l=c==null?void 0:c.searchStore)!=null&&l.latitude)||!c.searchStore.longitude||(m.value={lat:c.searchStore.latitude,lng:c.searchStore.longitude},D.value=!1)},ee=async(c=null)=>{var l,O;u.value.length&&(typeof c=="string"&&c.length>0?u.value=c:(await N(),((l=T.value)==null?void 0:l.length)>0&&(u.value=T.value[0])),D.value=!1,M.value=!0,Be(),await Ie(),await le(),(O=y.value)==null||O.blur(),a("stores.search_location",{search_term:u.value.toLowerCase()}))};return tt(()=>X()),he(()=>u.value,async()=>{u.value===""&&(m.value=be,M.value=!1,await le())}),he(()=>s.query.searchterm,async c=>{c&&c!==u.value?(u.value=String(c),await ee()):c||X()},{deep:!0,immediate:!0}),(c,l)=>{const O=qe,k=Ye,H=ct,V=dt,U=wt,te=pt;return j(),K("section",null,[L("div",Os,[L("div",Es,[L("div",Bs,[S(H,null,{default:fe(()=>[S(O,{modelValue:p(B),"onUpdate:modelValue":l[0]||(l[0]=E=>me(B)?B.value=E:null),title:p(t)("stores.filters.title")??"",filters:p(G),onFilterChange:C,onFilterMobileChange:C},null,8,["modelValue","title","filters"]),S(k,{stores:p(q),center:p(m),"search-input":p(u),"has-searched":p(M),onVisibleStores:l[1]||(l[1]=E=>I.value=E),onUpdateLocation:W,onErrorLocation:z},null,8,["stores","center","search-input","has-searched"])]),_:1})]),L("div",Hs,[L("h1",null,re(p(t)("stores.title")),1),L("div",Is,[we((j(),K("form",{class:rt({autocomplete:p(T).length>0}),onSubmit:pe(ee,["prevent"])},[L("label",{class:"visually-hidden",for:"searchInputField","aria-label":p(t)("aria.searchTerm")??""},re(p(t)("stores.placeholder")??""),9,Ls),we(L("input",{ref_key:"searchInputField",ref:y,"onUpdate:modelValue":l[2]||(l[2]=E=>me(u)?u.value=E:null),type:"text","aria-label":p(t)("aria.searchTerm")??"",placeholder:p(t)("stores.placeholder")??"",maxlength:Fs,onInput:l[3]||(l[3]=(...E)=>p(N)&&p(N)(...E)),onFocus:l[4]||(l[4]=E=>D.value=!0),onKeyup:nt(ee,["enter"])},null,40,Cs),[[at,p(u)]]),L("button",{type:"submit","aria-label":p(t)("aria.googleMaps.search"),onClick:pe(ee,["prevent"])},[S(V)],8,qs)],34)),[[p(lt),()=>D.value=!1]]),p(D)&&p(T).length>0?(j(),K("div",Ys,[L("ul",null,[(j(!0),K(ot,null,it(p(T),E=>(j(),K("li",{key:E},[L("button",{onClick:Ws=>ee(E),innerHTML:p(ht)(E??"",p(u))},null,8,Rs)]))),128))])])):st("",!0)]),S(te,{bottom:!0},{default:fe(()=>[p(I).length>0?(j(),K("div",Ns,[S(U,{stores:p(I),onSelected:He},null,8,["stores"])])):(j(),K("p",Qs,re(p(t)("stores.noStoresFound")??""),1))]),_:1})])])])])}}}),nr=ft(As,[["__scopeId","data-v-24870b62"]]);export{nr as default};
