File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@ionic/core/dist/ionic/p-9e6e9863.js
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/
import{p as e}from"./p-d2917828.js";const t=(e,t)=>e.month===t.month&&e.day===t.day&&e.year===t.year,n=(e,t)=>!!(e.year<t.year||e.year===t.year&&e.month<t.month||e.year===t.year&&e.month===t.month&&null!==e.day&&e.day<t.day),o=(e,t)=>!!(e.year>t.year||e.year===t.year&&e.month>t.month||e.year===t.year&&e.month===t.month&&null!==e.day&&e.day>t.day),r=(t,r,a)=>{const d=Array.isArray(t)?t:[t];for(const i of d)if(void 0!==r&&n(i,r)||void 0!==a&&o(i,a)){e(`The value provided to ion-datetime is out of bounds.\n\nMin: ${JSON.stringify(r)}\nMax: ${JSON.stringify(a)}\nValue: ${JSON.stringify(t)}`);break}},a=(e,t)=>{if(void 0!==t)return"h23"===t;const n=new Intl.DateTimeFormat(e,{hour:"numeric"}),o=n.resolvedOptions();if(void 0!==o.hourCycle)return"h23"===o.hourCycle;const r=new Date("5/18/2021 00:00"),a=n.formatToParts(r).find((e=>"hour"===e.type));if(!a)throw new Error("Hour value not found from DateTimeFormat");return"00"===a.value},d=(e,t)=>4===e||6===e||9===e||11===e?30:2===e?(e=>e%4==0&&e%100!=0||e%400==0)(t)?29:28:31,i=(e,t={month:"numeric",year:"numeric"})=>"month"===new Intl.DateTimeFormat(e,t).formatToParts(new Date)[0].type,u=e=>"dayPeriod"===new Intl.DateTimeFormat(e,{hour:"numeric"}).formatToParts(new Date)[0].type,l=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,s=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/,m=e=>{if(void 0===e)return;let t,n=e;return"string"==typeof e&&(n=e.replace(/\[|\]|\s/g,"").split(",")),t=Array.isArray(n)?n.map((e=>parseInt(e,10))).filter(isFinite):[n],t},v=e=>({month:parseInt(e.getAttribute("data-month"),10),day:parseInt(e.getAttribute("data-day"),10),year:parseInt(e.getAttribute("data-year"),10),dayOfWeek:parseInt(e.getAttribute("data-day-of-week"),10)});function y(e){if(Array.isArray(e))return e.map((e=>y(e)));let t=null;if(null!=e&&""!==e&&(t=s.exec(e),t?(t.unshift(void 0,void 0),t[2]=t[3]=void 0):t=l.exec(e)),null===t)return;for(let e=1;e<8;e++)t[e]=void 0!==t[e]?parseInt(t[e],10):void 0;let n=0;return t[9]&&t[10]&&(n=60*parseInt(t[10],10),t[11]&&(n+=parseInt(t[11],10)),"-"===t[9]&&(n*=-1)),{year:t[1],month:t[2],day:t[3],hour:t[4],minute:t[5],tzOffset:n,ampm:t[4]<12?"am":"pm"}}const c=(e,t,r)=>t&&n(e,t)?t:r&&o(e,r)?r:e,h=e=>e>=12?"pm":"am",f=(e,t)=>{const{month:n,day:o,year:r,hour:a,minute:i}=y(e),u=null!=r?r:t.year,l=null!=n?n:12;return{month:l,day:null!=o?o:d(l,u),year:u,hour:null!=a?a:23,minute:null!=i?i:59}},w=(e,t)=>{const{month:n,day:o,year:r,hour:a,minute:d}=y(e);return{month:null!=n?n:1,day:null!=o?o:1,year:null!=r?r:t.year,hour:null!=a?a:0,minute:null!=d?d:0}},$=e=>("0"+(void 0!==e?Math.abs(e):"0")).slice(-2);function p(e){if(Array.isArray(e))return e.map((e=>p(e)));let t="";var n;return void 0!==e.year?(t=("000"+(void 0!==(n=e.year)?Math.abs(n):"0")).slice(-4),void 0!==e.month&&(t+="-"+$(e.month),void 0!==e.day&&(t+="-"+$(e.day),void 0!==e.hour&&(t+=`T${$(e.hour)}:${$(e.minute)}:00`,t+=void 0===e.tzOffset?"Z":(e.tzOffset>0?"+":"-")+$(Math.floor(Math.abs(e.tzOffset/60)))+":"+$(e.tzOffset%60))))):void 0!==e.hour&&(t=$(e.hour)+":"+$(e.minute)),t}const O=(e,t)=>void 0===t?e:"am"===t?12===e?0:e:12===e?12:e+12,T=e=>{const{dayOfWeek:t}=e;if(null==t)throw new Error("No day of week provided");return k(e,t)},I=e=>{const{dayOfWeek:t}=e;if(null==t)throw new Error("No day of week provided");return x(e,6-t)},D=e=>x(e,1),b=e=>k(e,1),j=e=>k(e,7),M=e=>x(e,7),k=(e,t)=>{const{month:n,day:o,year:r}=e;if(null===o)throw new Error("No day provided");const a={month:n,day:o,year:r};if(a.day=o-t,a.day<1&&(a.month-=1),a.month<1&&(a.month=12,a.year-=1),a.day<1){const e=d(a.month,a.year);a.day=e+a.day}return a},x=(e,t)=>{const{month:n,day:o,year:r}=e;if(null===o)throw new Error("No day provided");const a={month:n,day:o,year:r},i=d(n,r);return a.day=o+t,a.day>i&&(a.day-=i,a.month+=1),a.month>12&&(a.month=1,a.year+=1),a},Z=e=>{const t=1===e.month?12:e.month-1,n=1===e.month?e.year-1:e.year,o=d(t,n);return{month:t,year:n,day:o<e.day?o:e.day}},C=e=>{const t=12===e.month?1:e.month+1,n=12===e.month?e.year+1:e.year,o=d(t,n);return{month:t,year:n,day:o<e.day?o:e.day}},U=(e,t)=>{const n=e.month,o=e.year+t,r=d(n,o);return{month:n,year:o,day:r<e.day?r:e.day}},G=e=>U(e,-1),N=e=>U(e,1),g=(e,t,n)=>t?e:O(e,n),A=(e,t)=>{const{ampm:n,hour:o}=e;let r=o;return"am"===n&&"pm"===t?r=O(r,"pm"):"pm"===n&&"am"===t&&(r=Math.abs(r-12)),r},E=(e,n,o)=>{const{month:r,day:a,year:i}=e,u=Object.assign({},e),l=d(r,i);return null!==a&&l<a&&(u.day=l),void 0!==n&&t(u,n)&&void 0!==u.hour&&void 0!==n.hour&&(u.hour<n.hour?(u.hour=n.hour,u.minute=n.minute):u.hour===n.hour&&void 0!==u.minute&&void 0!==n.minute&&u.minute<n.minute&&(u.minute=n.minute)),void 0!==o&&t(e,o)&&void 0!==u.hour&&void 0!==o.hour&&(u.hour>o.hour?(u.hour=o.hour,u.minute=o.minute):u.hour===o.hour&&void 0!==u.minute&&void 0!==o.minute&&u.minute>o.minute&&(u.minute=o.minute)),u},W=(e,t,n,o,r,a)=>{const{hour:d,minute:i,day:u,month:l,year:s}=e,m=Object.assign(Object.assign({},e),{dayOfWeek:void 0});return void 0!==t&&(m.month=F(l,t)),null!==u&&void 0!==n&&(m.day=F(u,n)),void 0!==o&&(m.year=F(s,o)),void 0!==d&&void 0!==r&&(m.hour=F(d,r),m.ampm=h(m.hour)),void 0!==i&&void 0!==a&&(m.minute=F(i,a)),m},F=(e,t)=>{let n=t[0],o=Math.abs(n-e);for(let r=1;r<t.length;r++){const a=t[r],d=Math.abs(a-e);d<o&&(n=a,o=d)}return n},J=(e,t,n)=>{const o={hour:t.hour,minute:t.minute};return void 0===o.hour||void 0===o.minute?"Invalid Time":new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric",timeZone:"UTC",hourCycle:n?"h23":"h12"}).format(new Date(p(Object.assign(Object.assign({year:2023,day:1,month:1},o),{tzOffset:void 0}))))},P=e=>{const t=e.toString();return t.length>1?t:`0${t}`},S=(e,t)=>t?P(e):0===e?"12":e.toString(),z=(e,t,n)=>{if(null===n.day)return null;const o=new Date(`${n.month}/${n.day}/${n.year} GMT+0000`),r=new Intl.DateTimeFormat(e,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}).format(o);return t?`Today, ${r}`:r},H=(e,t)=>{const n=new Date(`${t.month}/${t.day}/${t.year} GMT+0000`);return new Intl.DateTimeFormat(e,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(n)},R=(e,t)=>{const n=new Date(`${t.month}/${t.day}/${t.year} GMT+0000`);return new Intl.DateTimeFormat(e,{month:"long",year:"numeric",timeZone:"UTC"}).format(n)},q=(e,t)=>Q(e,t,{month:"short",day:"numeric",year:"numeric"}),B=(e,t)=>V(e,t,{day:"numeric"}).find((e=>"day"===e.type)).value,K=(e,t)=>Q(e,t,{year:"numeric"}),L=e=>new Date(`${e.month}/${e.day}/${e.year}${void 0!==e.hour&&void 0!==e.minute?` ${e.hour}:${e.minute}`:""} GMT+0000`),Q=(e,t,n)=>{const o=L(t);return X(e,n).format(o)},V=(e,t,n)=>{const o=L(t);return X(e,n).formatToParts(o)},X=(e,t)=>new Intl.DateTimeFormat(e,Object.assign(Object.assign({},t),{timeZone:"UTC"})),Y=e=>{if("RelativeTimeFormat"in Intl){const t=new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"day");return t.charAt(0).toUpperCase()+t.slice(1)}return"Today"},_=e=>{const t=e.getTimezoneOffset();return e.setMinutes(e.getMinutes()-t),e},ee=_(new Date("2022T01:00")),te=_(new Date("2022T13:00")),ne=(e,t)=>{const n="am"===t?ee:te,o=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}).formatToParts(n).find((e=>"dayPeriod"===e.type));return o?o.value:(e=>void 0===e?"":e.toUpperCase())(t)},oe=e=>Array.isArray(e)?e.join(","):e,re=()=>_(new Date).toISOString(),ae=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],de=[0,1,2,3,4,5,6,7,8,9,10,11],ie=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],ue=(e,t,n=0)=>{const o=new Intl.DateTimeFormat(e,{weekday:"ios"===t?"short":"narrow"}),r=new Date("11/01/2020"),a=[];for(let e=n;e<n+7;e++){const t=new Date(r);t.setDate(t.getDate()+e),a.push(o.format(t))}return a},le=(e,t,n)=>{const o=d(e,t),r=new Date(`${e}/1/${t}`).getDay(),a=r>=n?r-(n+1):6-(n-r);let i=[];for(let e=1;e<=o;e++)i.push({day:e,dayOfWeek:(a+e)%7});for(let e=0;e<=a;e++)i=[{day:null,dayOfWeek:null},...i];return i},se=(e,r="h12",a,d,i,u)=>{const l="h23"===r;let s=l?ie:de,m=ae,v=!0,y=!0;if(i&&(s=s.filter((e=>i.includes(e)))),u&&(m=m.filter((e=>u.includes(e)))),a)if(t(e,a)){if(void 0!==a.hour&&(s=s.filter((t=>(l?t:"pm"===e.ampm?(t+12)%24:t)>=a.hour)),v=a.hour<13),void 0!==a.minute){let t=!1;void 0!==a.hour&&void 0!==e.hour&&e.hour>a.hour&&(t=!0),m=m.filter((e=>!!t||e>=a.minute))}}else n(e,a)&&(s=[],m=[],v=y=!1);return d&&(t(e,d)?(void 0!==d.hour&&(s=s.filter((t=>(l?t:"pm"===e.ampm?(t+12)%24:t)<=d.hour)),y=d.hour>=12),void 0!==d.minute&&e.hour===d.hour&&(m=m.filter((e=>e<=d.minute)))):o(e,d)&&(s=[],m=[],v=y=!1)),{hours:s,minutes:m,am:v,pm:y}},me=e=>[Z(e),{month:e.month,year:e.year,day:e.day},C(e)],ve=(e,t,n,o,r,a={month:"long"})=>{const{year:d}=t,i=[];if(void 0!==r){let t=r;void 0!==(null==o?void 0:o.month)&&(t=t.filter((e=>e<=o.month))),void 0!==(null==n?void 0:n.month)&&(t=t.filter((e=>e>=n.month))),t.forEach((t=>{const n=new Date(`${t}/1/${d} GMT+0000`),o=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},a),{timeZone:"UTC"})).format(n);i.push({text:o,value:t})}))}else{const t=o&&o.year===d?o.month:12;for(let o=n&&n.year===d?n.month:1;o<=t;o++){const t=new Date(`${o}/1/${d} GMT+0000`),n=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},a),{timeZone:"UTC"})).format(t);i.push({text:n,value:o})}}return i},ye=(e,t,n,o,r,a={day:"numeric"})=>{const{month:i,year:u}=t,l=[],s=d(i,u),m=null!=(null==o?void 0:o.day)&&o.year===u&&o.month===i?o.day:s,v=null!=(null==n?void 0:n.day)&&n.year===u&&n.month===i?n.day:1;if(void 0!==r){let t=r;t=t.filter((e=>e>=v&&e<=m)),t.forEach((t=>{const n=new Date(`${i}/${t}/${u} GMT+0000`),o=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},a),{timeZone:"UTC"})).format(n);l.push({text:o,value:t})}))}else for(let t=v;t<=m;t++){const n=new Date(`${i}/${t}/${u} GMT+0000`),o=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},a),{timeZone:"UTC"})).format(n);l.push({text:o,value:t})}return l},ce=(e,t,n,o,r)=>{var a,d;let i=[];if(void 0!==r)i=r,void 0!==(null==o?void 0:o.year)&&(i=i.filter((e=>e<=o.year))),void 0!==(null==n?void 0:n.year)&&(i=i.filter((e=>e>=n.year)));else{const{year:e}=t,r=null!==(a=null==o?void 0:o.year)&&void 0!==a?a:e,u=null!==(d=null==n?void 0:n.year)&&void 0!==d?d:e-100;for(let e=r;e>=u;e--)i.push(e)}return i.map((n=>({text:K(e,{year:n,month:t.month,day:t.day}),value:n})))},he=(e,t)=>e.month===t.month&&e.year===t.year?[e]:[e,...he(C(e),t)],fe=(e,n,o,r,a,d)=>{let i=[],u=[],l=he(o,r);return d&&(l=l.filter((({month:e})=>d.includes(e)))),l.forEach((d=>{const l={month:d.month,day:null,year:d.year},s=ye(e,l,o,r,a,{month:"short",day:"numeric",weekday:"short"}),m=[],v=[];s.forEach((o=>{const r=t(Object.assign(Object.assign({},l),{day:o.value}),n);v.push({text:r?Y(e):o.text,value:`${l.year}-${l.month}-${o.value}`}),m.push({month:l.month,year:l.year,day:o.value})})),u=[...u,...m],i=[...i,...v]})),{parts:u,items:i}},we=(e,t,n,o,r,d,i)=>{const u=a(e,n),{hours:l,minutes:s,am:m,pm:v}=se(t,u?"h23":"h12",o,r,d,i),y=l.map((e=>({text:S(e,u),value:g(e,u,t.ampm)}))),c=s.map((e=>({text:P(e),value:e}))),h=[];return m&&!u&&h.push({text:ne(e,"am"),value:"am"}),v&&!u&&h.push({text:ne(e,"pm"),value:"pm"}),{minutesData:c,hoursData:y,dayPeriodData:h}};export{ye as A,ce as B,i as C,we as D,u as E,ue as F,R as G,le as H,me as I,a as J,J as K,H as L,oe as M,N,G as O,c as P,h as Q,A as R,Q as S,q as T,B as a,o as b,t as c,Z as d,C as e,v as f,z as g,I as h,n as i,T as j,b as k,D as l,j as m,M as n,f as o,w as p,y as q,m as r,p as s,re as t,W as u,E as v,r as w,d as x,fe as y,ve as z}