import{r as t,d as e,w as n,h as i,H as a,e as o}from"./p-03169580.js";import{i as s,a as r,j as d,k as l,l as h}from"./p-e05250ba.js";import{g as c}from"./p-4cb16df5.js";import{startFocusVisible as p}from"./p-924b2917.js";import{r as u,m,l as g}from"./p-7cbdb4ea.js";import{b as f,p as y}from"./p-b5cdbd99.js";import{i as b}from"./p-506221fe.js";import{c as x}from"./p-0e4de1d0.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const w=(t,e)=>t.month===e.month&&t.day===e.day&&t.year===e.year;const v=(t,e)=>t.year<e.year||t.year===e.year&&t.month<e.month||t.year===e.year&&t.month===e.month&&t.day&&t.day<e.day;const k=(t,e)=>t.year>e.year||t.year===e.year&&t.month>e.month||t.year===e.year&&t.month===e.month&&t.day&&t.day>e.day;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const O=t=>t%4===0&&t%100!==0||t%400===0;const j=(t,e)=>{if(e!==undefined){return e==="h23"}const n=new Intl.DateTimeFormat(t,{hour:"numeric"});const i=n.resolvedOptions();if(i.hourCycle!==undefined){return i.hourCycle==="h23"}const a=new Date("5/18/2021 00:00");const o=n.formatToParts(a);const s=o.find((t=>t.type==="hour"));if(!s){throw new Error("Hour value not found from DateTimeFormat")}return s.value==="00"};const C=(t,e)=>t===4||t===6||t===9||t===11?30:t===2?O(e)?29:28:31;const $=t=>{const e=new Intl.DateTimeFormat(t,{month:"numeric",year:"numeric"}).formatToParts(new Date);return e[0].type==="month"};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const I=t=>("0"+(t!==undefined?Math.abs(t):"0")).slice(-2);const z=t=>("000"+(t!==undefined?Math.abs(t):"0")).slice(-4);const P=t=>{let e="";if(t.year!==undefined){e=z(t.year);if(t.month!==undefined){e+="-"+I(t.month);if(t.day!==undefined){e+="-"+I(t.day);if(t.hour!==undefined){e+=`T${I(t.hour)}:${I(t.minute)}:00`;if(t.tzOffset===undefined){e+="Z"}else{e+=(t.tzOffset>0?"+":"-")+I(Math.floor(Math.abs(t.tzOffset/60)))+":"+I(t.tzOffset%60)}}}}}else if(t.hour!==undefined){e=I(t.hour)+":"+I(t.minute)}return e};const T=(t,e)=>{if(e===undefined){return t}if(e==="am"){if(t===12){return 0}return t}if(t===12){return 12}return t+12};const D=t=>{const{dayOfWeek:e}=t;if(e===null||e===undefined){throw new Error("No day of week provided")}return S(t,e)};const M=t=>{const{dayOfWeek:e}=t;if(e===null||e===undefined){throw new Error("No day of week provided")}return U(t,6-e)};const V=t=>U(t,1);const A=t=>S(t,1);const E=t=>S(t,7);const F=t=>U(t,7);const S=(t,e)=>{const{month:n,day:i,year:a}=t;if(i===null){throw new Error("No day provided")}const o={month:n,day:i,year:a};o.day=i-e;if(o.day<1){o.month-=1}if(o.month<1){o.month=12;o.year-=1}if(o.day<1){const t=C(o.month,o.year);o.day=t+o.day}return o};const U=(t,e)=>{const{month:n,day:i,year:a}=t;if(i===null){throw new Error("No day provided")}const o={month:n,day:i,year:a};const s=C(n,a);o.day=i+e;if(o.day>s){o.day-=s;o.month+=1}if(o.month>12){o.month=1;o.year+=1}return o};const W=t=>{const e=t.month===1?12:t.month-1;const n=t.month===1?t.year-1:t.year;const i=C(e,n);const a=i<t.day?i:t.day;return{month:e,year:n,day:a}};const Z=t=>{const e=t.month===12?1:t.month+1;const n=t.month===12?t.year+1:t.year;const i=C(e,n);const a=i<t.day?i:t.day;return{month:e,year:n,day:a}};const L=(t,e)=>{const n=t.month;const i=t.year+e;const a=C(n,i);const o=a<t.day?a:t.day;return{month:n,year:i,day:o}};const B=t=>L(t,-1);const G=t=>L(t,1);const H=(t,e,n)=>{if(e){return t}return T(t,n)};const R=(t,e)=>{const{ampm:n,hour:i}=t;let a=i;if(n==="am"&&e==="pm"){a=T(a,"pm")}else if(n==="pm"&&e==="am"){a=Math.abs(a-12)}return a};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const N=()=>{const t=new Date;const e=t.getTimezoneOffset();t.setMinutes(t.getMinutes()-e);return t.toISOString()};const Y=[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];const q=[12,1,2,3,4,5,6,7,8,9,10,11];const K=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];const _=(t,e,n=0)=>{const i=e==="ios"?"short":"narrow";const a=new Intl.DateTimeFormat(t,{weekday:i});const o=new Date("11/01/2020");const s=[];for(let t=n;t<n+7;t++){const e=new Date(o);e.setDate(e.getDate()+t);s.push(a.format(e))}return s};const J=(t,e,n)=>{const i=C(t,e);const a=new Date(`${t}/1/${e}`).getDay();const o=a>=n?a-(n+1):6-(n-a);let s=[];for(let t=1;t<=i;t++){s.push({day:t,dayOfWeek:(o+t)%7})}for(let t=0;t<=o;t++){s=[{day:null,dayOfWeek:null},...s]}return s};const Q=(t,e="h12",n,i,a,o)=>{const s=e==="h23";let r=s?K:q;let d=Y;let l=true;let h=true;if(a){r=r.filter((t=>a.includes(t)))}if(o){d=d.filter((t=>o.includes(t)))}if(n){if(w(t,n)){if(n.hour!==undefined){r=r.filter((e=>{const i=t.ampm==="pm"?(e+12)%24:e;return(s?e:i)>=n.hour}));l=n.hour<13}if(n.minute!==undefined){let e=false;if(n.hour!==undefined&&t.hour!==undefined){if(t.hour>n.hour){e=true}}d=d.filter((t=>{if(e){return true}return t>=n.minute}))}}else if(v(t,n)){r=[];d=[];l=h=false}}if(i){if(w(t,i)){if(i.hour!==undefined){r=r.filter((e=>{const n=t.ampm==="pm"?(e+12)%24:e;return(s?e:n)<=i.hour}));h=i.hour>=13}if(i.minute!==undefined&&t.hour===i.hour){d=d.filter((t=>t<=i.minute))}}else if(k(t,i)){r=[];d=[];l=h=false}}return{hours:r,minutes:d,am:l,pm:h}};const X=t=>[W(t),{month:t.month,year:t.year,day:t.day},Z(t)];const tt=(t,e,n,i,a)=>{const{year:o}=e;const s=[];if(a!==undefined){let e=a;if((i===null||i===void 0?void 0:i.month)!==undefined){e=e.filter((t=>t<=i.month))}if((n===null||n===void 0?void 0:n.month)!==undefined){e=e.filter((t=>t>=n.month))}e.forEach((e=>{const n=new Date(`${e}/1/${o} GMT+0000`);const i=new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(n);s.push({text:i,value:e})}))}else{const e=i&&i.year===o?i.month:12;const a=n&&n.year===o?n.month:1;for(let n=a;n<=e;n++){const e=new Date(`${n}/1/${o} GMT+0000`);const i=new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(e);s.push({text:i,value:n})}}return s};const et=(t,e,n,i)=>{if(i!==undefined){let t=i;if((n===null||n===void 0?void 0:n.year)!==undefined){t=t.filter((t=>t<=n.year))}if((e===null||e===void 0?void 0:e.year)!==undefined){t=t.filter((t=>t>=e.year))}return t}else{const{year:i}=t;const a=(n===null||n===void 0?void 0:n.year)||i;const o=(e===null||e===void 0?void 0:e.year)||i-100;const s=[];for(let t=a;t>=o;t--){s.push(t)}return s}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const nt=t=>t%12||12;const it=t=>{if(t===undefined){return""}return t.toUpperCase()};const at=(t,e)=>{if(t.hour===undefined||t.minute===undefined){return"Invalid Time"}const n=e?st(t.hour,e):nt(t.hour);const i=ot(t.minute);if(e){return`${n}:${i}`}return`${n}:${i} ${it(t.ampm)}`};const ot=t=>{const e=t.toString();if(e.length>1){return e}return`0${e}`};const st=(t,e)=>{if(!e){return t.toString()}return ot(t)};const rt=(t,e,n)=>{if(n.day===null){return null}const i=new Date(`${n.month}/${n.day}/${n.year} GMT+0000`);const a=new Intl.DateTimeFormat(t,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}).format(i);return e?`Today, ${a}`:a};const dt=(t,e)=>{const n=new Date(`${e.month}/${e.day}/${e.year} GMT+0000`);return new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(n)};const lt=(t,e)=>{const n=new Date(`${e.month}/${e.day}/${e.year} GMT+0000`);return new Intl.DateTimeFormat(t,{month:"long",year:"numeric",timeZone:"UTC"}).format(n)};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const ht=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;const ct=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;const pt=t=>{if(t===undefined){return}let e=t;if(typeof t==="string"){e=t.replace(/\[|\]|\s/g,"").split(",")}let n;if(Array.isArray(e)){n=e.map((t=>parseInt(t,10))).filter(isFinite)}else{n=[e]}return n};const ut=t=>({month:parseInt(t.getAttribute("data-month"),10),day:parseInt(t.getAttribute("data-day"),10),year:parseInt(t.getAttribute("data-year"),10),dayOfWeek:parseInt(t.getAttribute("data-day-of-week"),10)});const mt=t=>{let e=null;if(t!=null&&t!==""){e=ct.exec(t);if(e){e.unshift(undefined,undefined);e[2]=e[3]=undefined}else{e=ht.exec(t)}}if(e===null){return undefined}for(let t=1;t<8;t++){e[t]=e[t]!==undefined?parseInt(e[t],10):undefined}let n=0;if(e[9]&&e[10]){n=parseInt(e[10],10)*60;if(e[11]){n+=parseInt(e[11],10)}if(e[9]==="-"){n*=-1}}return{year:e[1],month:e[2],day:e[3],hour:e[4],minute:e[5],second:e[6],millisecond:e[7],tzOffset:n}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const gt=(t,e,n)=>{if(e&&e.year>t){return true}if(n&&n.year<t){return true}return false};const ft=(t,e,n,i)=>{if(t.day===null){return true}if(i!==undefined&&!i.includes(t.day)){return true}if(e&&v(t,e)){return true}if(n&&k(t,n)){return true}return false};const yt=(t,e,n,i,a,o,s)=>{const r=w(e,n);const d=w(e,i);const l=ft(e,a,o,s);return{disabled:l,isActive:r,isToday:d,ariaSelected:r?"true":null,ariaLabel:rt(t,d,e)}};const bt=(t,{minParts:e,maxParts:n})=>{if(gt(t.year,e,n)){return true}if(e&&v(t,e)||n&&k(t,n)){return true}return false};const xt=(t,e,n)=>{const i=Object.assign(Object.assign({},W(t)),{day:null});return bt(i,{minParts:e,maxParts:n})};const wt=(t,e)=>{const n=Object.assign(Object.assign({},Z(t)),{day:null});return bt(n,{maxParts:e})};const vt=':host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;max-width:350px;height:auto}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .datetime-year .order-month-first .month-column{order:1}:host .datetime-year .order-month-first .year-column{order:2}:host .datetime-year .order-year-first .month-column{order:2;text-align:end}:host .datetime-year .order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr);height:100%}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;cursor:pointer;appearance:none;z-index:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;left:50%;top:50%;position:absolute;width:32px;height:32px;transform:translate(-50%, -50%);content:" ";z-index:-1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host-context([dir=rtl]){left:unset;right:unset;right:50%}:host .datetime-time{display:flex;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:flex;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}:host(.datetime-presentation-date-time),:host(.datetime-presentation-time-date),:host(.datetime-presentation-date){min-height:350px}:host .datetime-header{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-header .datetime-title{color:var(--title-color);font-size:14px}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:16px;font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:12px;font-weight:600;line-height:24px;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;height:calc(100% - 16px)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-day{font-size:20px}:host .calendar-day:after{opacity:0.2}:host .calendar-day:focus:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-active:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-today.calendar-day-active:after{background:var(--ion-color-base);opacity:1}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:16px;font-size:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:flex;align-items:center;justify-content:space-between}:host .datetime-action-buttons{width:100%}';const kt=':host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;max-width:350px;height:auto}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .datetime-year .order-month-first .month-column{order:1}:host .datetime-year .order-month-first .year-column{order:2}:host .datetime-year .order-year-first .month-column{order:2;text-align:end}:host .datetime-year .order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr);height:100%}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;cursor:pointer;appearance:none;z-index:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;left:50%;top:50%;position:absolute;width:32px;height:32px;transform:translate(-50%, -50%);content:" ";z-index:-1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host-context([dir=rtl]){left:unset;right:unset;right:50%}:host .datetime-time{display:flex;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:flex;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-step-100, #ffffff);--title-color:var(--ion-color-contrast)}:host .datetime-header{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host .datetime-header .datetime-title{font-size:12px;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:34px}:host .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{color:var(--ion-color-step-650, #595959)}:host .calendar-days-of-week{padding-left:10px;padding-right:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:14px;line-height:36px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:10px;padding-right:10px;padding-top:3px;padding-bottom:0px;grid-template-rows:repeat(6, 1fr)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-day{padding-left:0px;padding-right:0;padding-top:13px;padding-bottom:13px;font-size:14px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-day:focus:after{background:rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today:after{border:1px solid var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-active:after{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .time-header{color:var(--ion-color-step-650, #595959)}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;display:flex;align-items:center;justify-content:flex-end}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .datetime-view-buttons ion-button{color:var(--ion-color-step-800, #333333)}';let Ot=class{constructor(i){t(this,i);this.ionCancel=e(this,"ionCancel",7);this.ionChange=e(this,"ionChange",7);this.ionFocus=e(this,"ionFocus",7);this.ionBlur=e(this,"ionBlur",7);this.ionStyle=e(this,"ionStyle",7);this.inputId=`ion-dt-${jt++}`;this.overlayIsPresenting=false;this.highlightActiveParts=false;this.todayParts=mt(N());this.prevPresentation=null;this.showMonthAndYear=false;this.activeParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm"};this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm"};this.isPresented=false;this.isTimePopoverOpen=false;this.color="primary";this.name=this.inputId;this.disabled=false;this.readonly=false;this.presentation="date-time";this.cancelText="Cancel";this.doneText="Done";this.clearText="Clear";this.locale="default";this.firstDayOfWeek=0;this.showDefaultTitle=false;this.showDefaultButtons=false;this.showClearButton=false;this.showDefaultTimeLabel=true;this.size="fixed";this.closeParentOverlay=()=>{const t=this.el.closest("ion-modal, ion-popover");if(t){t.dismiss()}};this.setWorkingParts=t=>{this.workingParts=Object.assign({},t)};this.setActiveParts=t=>{this.activeParts=Object.assign({},t);const e=this.el.querySelector('[slot="buttons"]')!==null;if(e||this.showDefaultButtons){return}this.confirm()};this.getCalendarBodyEl=()=>{var t;return this.calendarBodyRef||((t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".calendar-body"))};this.initializeKeyboardListeners=()=>{const t=this.getCalendarBodyEl();if(!t){return}const e=this.el.shadowRoot;const n=t.querySelector(".calendar-month:nth-of-type(2)");const i=e=>{var i;const a=e[0];if(((i=a.oldValue)===null||i===void 0?void 0:i.includes("ion-focused"))||!t.classList.contains("ion-focused")){return}this.focusWorkingDay(n)};const a=new MutationObserver(i);a.observe(t,{attributeFilter:["class"],attributeOldValue:true});this.destroyKeyboardMO=()=>{a===null||a===void 0?void 0:a.disconnect()};t.addEventListener("keydown",(t=>{const i=e.activeElement;if(!i||!i.classList.contains("calendar-day")){return}const a=ut(i);let o;switch(t.key){case"ArrowDown":t.preventDefault();o=F(a);break;case"ArrowUp":t.preventDefault();o=E(a);break;case"ArrowRight":t.preventDefault();o=V(a);break;case"ArrowLeft":t.preventDefault();o=A(a);break;case"Home":t.preventDefault();o=D(a);break;case"End":t.preventDefault();o=M(a);break;case"PageUp":t.preventDefault();o=t.shiftKey?B(a):W(a);break;case"PageDown":t.preventDefault();o=t.shiftKey?G(a):Z(a);break;default:return}if(ft(o,this.minParts,this.maxParts)){return}this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),o));requestAnimationFrame((()=>this.focusWorkingDay(n)))}))};this.focusWorkingDay=t=>{const e=t.querySelectorAll(".calendar-day-padding");const{day:n}=this.workingParts;if(n===null){return}const i=t.querySelector(`.calendar-day:nth-of-type(${e.length+n})`);if(i){i.focus()}};this.processMinParts=()=>{if(this.min===undefined){this.minParts=undefined;return}const{month:t,day:e,year:n,hour:i,minute:a}=mt(this.min);this.minParts={month:t,day:e,year:n,hour:i,minute:a}};this.processMaxParts=()=>{if(this.max===undefined){this.maxParts=undefined;return}const{month:t,day:e,year:n,hour:i,minute:a}=mt(this.max);this.maxParts={month:t,day:e,year:n,hour:i,minute:a}};this.initializeCalendarIOListeners=()=>{const t=this.getCalendarBodyEl();if(!t){return}const e=c(this);const i=t.querySelectorAll(".calendar-month");const a=i[0];const o=i[1];const s=i[2];let r;let d;n((()=>{t.scrollLeft=a.clientWidth*(b(this.el)?-1:1);const i=(i,l)=>{const h=i==="start"?d:r;const c=i==="start"?a:s;const p=i==="start"?W:Z;const m=l[0];if(!m.isIntersecting){return}if(this.overlayIsPresenting){this.overlayIsPresenting=false;return}const{month:g,year:f,day:y}=p(this.workingParts);if(bt({month:g,year:f,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})){return}if(e==="ios"){const e=m.intersectionRatio;const n=Math.abs(e-.7)<=.1&&navigator.maxTouchPoints>1;if(n){t.style.setProperty("pointer-events","none");return}}t.style.setProperty("overflow","hidden");if(h===undefined){return}h.disconnect();n((()=>{if(this.destroyCalendarIO){this.destroyCalendarIO()}u((()=>{this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:g,day:y,year:f}));t.scrollLeft=o.clientWidth*(b(this.el)?-1:1);t.style.removeProperty("overflow");t.style.removeProperty("pointer-events");r===null||r===void 0?void 0:r.observe(s);d===null||d===void 0?void 0:d.observe(a)}));if(h===undefined){return}h.observe(c)}))};const l=e==="ios"&&typeof navigator!=="undefined"&&navigator.maxTouchPoints>1?[.7,1]:1;const h="1px";r=new IntersectionObserver((t=>i("end",t)),{threshold:l,root:t,rootMargin:h});r.observe(s);d=new IntersectionObserver((t=>i("start",t)),{threshold:l,root:t,rootMargin:h});d.observe(a);this.destroyCalendarIO=()=>{r===null||r===void 0?void 0:r.disconnect();d===null||d===void 0?void 0:d.disconnect()}}))};this.destroyInteractionListeners=()=>{const{destroyCalendarIO:t,destroyKeyboardMO:e}=this;if(t!==undefined){t()}if(e!==undefined){e()}};this.initializeOverlayListener=()=>{const t=this.el.closest("ion-popover, ion-modal");if(t===null){return}const e=()=>{this.overlayIsPresenting=true};t.addEventListener("willPresent",e);this.destroyOverlayListener=()=>{t.removeEventListener("willPresent",e)}};this.processValue=t=>{this.highlightActiveParts=!!t;const e=t||N();const{month:n,day:i,year:a,hour:o,minute:s,tzOffset:r}=mt(e);this.setWorkingParts({month:n,day:i,year:a,hour:o,minute:s,tzOffset:r,ampm:o>=12?"pm":"am"});this.activeParts={month:n,day:i,year:a,hour:o,minute:s,tzOffset:r,ampm:o>=12?"pm":"am"}};this.onFocus=()=>{this.ionFocus.emit()};this.onBlur=()=>{this.ionBlur.emit()};this.hasValue=()=>this.value!=null&&this.value!=="";this.nextMonth=()=>{const t=this.getCalendarBodyEl();if(!t){return}const e=t.querySelector(".calendar-month:last-of-type");if(!e){return}const n=e.offsetWidth*2;t.scrollTo({top:0,left:n*(b(this.el)?-1:1),behavior:"smooth"})};this.prevMonth=()=>{const t=this.getCalendarBodyEl();if(!t){return}const e=t.querySelector(".calendar-month:first-of-type");if(!e){return}t.scrollTo({top:0,left:0,behavior:"smooth"})};this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}yearValuesChanged(){this.parsedYearValues=pt(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=pt(this.monthValues)}dayValuesChanged(){this.parsedDayValues=pt(this.dayValues)}hourValuesChanged(){this.parsedHourValues=pt(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=pt(this.minuteValues)}activePartsChanged(){this.activePartsClone=this.activeParts}valueChanged(){if(this.hasValue()){const t=mt(this.value);if(t){const{month:e,day:n,year:i,hour:a,minute:o}=t;const s=a>=12?"pm":"am";this.activePartsClone=Object.assign(Object.assign({},this.activeParts),{month:e,day:n,year:i,hour:a,minute:o,ampm:s});this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{ampm:s}))}else{f(`Unable to parse date string: ${this.value}. Please provide a valid ISO 8601 datetime string.`)}}this.emitStyle();this.ionChange.emit({value:this.value})}async confirm(t=false){if(this.highlightActiveParts){const t=new Date(P(this.activeParts));this.activeParts.tzOffset=t.getTimezoneOffset()*-1;this.value=P(this.activeParts)}if(t){this.closeParentOverlay()}}async reset(t){this.processValue(t)}async cancel(t=false){this.ionCancel.emit();if(t){this.closeParentOverlay()}}connectedCallback(){this.clearFocusVisible=p(this.el).destroy}disconnectedCallback(){if(this.clearFocusVisible){this.clearFocusVisible();this.clearFocusVisible=undefined}}initializeListeners(){this.initializeCalendarIOListeners();this.initializeKeyboardListeners();this.initializeOverlayListener()}componentDidLoad(){const t=t=>{const e=t[0];if(!e.isIntersecting){return}this.initializeListeners();n((()=>{this.el.classList.add("datetime-ready")}))};const e=new IntersectionObserver(t,{threshold:.01});u((()=>e===null||e===void 0?void 0:e.observe(this.el)));const i=t=>{const e=t[0];if(e.isIntersecting){return}this.destroyInteractionListeners();n((()=>{this.el.classList.remove("datetime-ready")}))};const a=new IntersectionObserver(i,{threshold:0});u((()=>a===null||a===void 0?void 0:a.observe(this.el)));const o=g(this.el);o.addEventListener("ionFocus",(t=>t.stopPropagation()));o.addEventListener("ionBlur",(t=>t.stopPropagation()))}componentDidRender(){const{presentation:t,prevPresentation:e}=this;if(e===null){this.prevPresentation=t;return}if(t===e){return}this.prevPresentation=t;this.destroyInteractionListeners();if(this.destroyOverlayListener!==undefined){this.destroyOverlayListener()}this.initializeListeners()}componentWillLoad(){this.processMinParts();this.processMaxParts();this.processValue(this.value);this.parsedHourValues=pt(this.hourValues);this.parsedMinuteValues=pt(this.minuteValues);this.parsedMonthValues=pt(this.monthValues);this.parsedYearValues=pt(this.yearValues);this.parsedDayValues=pt(this.dayValues);this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:true,datetime:true,"interactive-disabled":this.disabled})}renderFooter(){const{showDefaultButtons:t,showClearButton:e}=this;const n=this.el.querySelector('[slot="buttons"]')!==null;if(!n&&!t&&!e){return}const a=()=>{this.reset();this.value=undefined};return i("div",{class:"datetime-footer"},i("div",{class:"datetime-buttons"},i("div",{class:{["datetime-action-buttons"]:true,["has-clear-button"]:this.showClearButton}},i("slot",{name:"buttons"},i("ion-buttons",null,t&&i("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(true)},this.cancelText),i("div",null,e&&i("ion-button",{id:"clear-button",color:this.color,onClick:()=>a()},this.clearText),t&&i("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(true)},this.doneText)))))))}renderYearView(){const{presentation:t,workingParts:e,locale:n}=this;const a=et(this.todayParts,this.minParts,this.maxParts,this.parsedYearValues);const o=t!=="year";const s=t!=="month";const r=tt(n,e,this.minParts,this.maxParts,this.parsedMonthValues);const d=a.map((t=>({text:`${t}`,value:t})));const l=$(n);const h=l?"month-first":"year-first";return i("div",{class:"datetime-year"},i("div",{class:{"datetime-year-body":true,[`order-${h}`]:true}},i("ion-picker-internal",null,o&&i("ion-picker-column-internal",{class:"month-column",color:this.color,items:r,value:e.month,onIonChange:e=>{if(this.destroyCalendarIO){this.destroyCalendarIO()}this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:e.detail.value}));if(t==="month"||t==="month-year"){this.setActiveParts(Object.assign(Object.assign({},this.activeParts),{month:e.detail.value}))}this.initializeCalendarIOListeners();e.stopPropagation()}}),s&&i("ion-picker-column-internal",{class:"year-column",color:this.color,items:d,value:e.year,onIonChange:e=>{if(this.destroyCalendarIO){this.destroyCalendarIO()}this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{year:e.detail.value}));if(t==="year"||t==="month-year"){this.setActiveParts(Object.assign(Object.assign({},this.activeParts),{year:e.detail.value}))}this.initializeCalendarIOListeners();e.stopPropagation()}}))))}renderCalendarHeader(t){const e=t==="ios"?d:l;const n=t==="ios"?r:h;const a=xt(this.workingParts,this.minParts,this.maxParts);const o=wt(this.workingParts,this.maxParts);return i("div",{class:"calendar-header"},i("div",{class:"calendar-action-buttons"},i("div",{class:"calendar-month-year"},i("ion-item",{button:true,detail:false,lines:"none",onClick:()=>this.toggleMonthAndYearView()},i("ion-label",null,lt(this.locale,this.workingParts)," ",i("ion-icon",{icon:this.showMonthAndYear?e:n,lazy:false})))),i("div",{class:"calendar-next-prev"},i("ion-buttons",null,i("ion-button",{disabled:a,onClick:()=>this.prevMonth()},i("ion-icon",{slot:"icon-only",icon:s,lazy:false,flipRtl:true})),i("ion-button",{disabled:o,onClick:()=>this.nextMonth()},i("ion-icon",{slot:"icon-only",icon:r,lazy:false,flipRtl:true}))))),i("div",{class:"calendar-days-of-week"},_(this.locale,t,this.firstDayOfWeek%7).map((t=>i("div",{class:"day-of-week"},t)))))}renderMonth(t,e){const{highlightActiveParts:n}=this;const a=this.parsedYearValues===undefined||this.parsedYearValues.includes(e);const o=this.parsedMonthValues===undefined||this.parsedMonthValues.includes(t);const s=!a||!o;const r=bt({month:t,year:e,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})});const d=this.workingParts.month===t&&this.workingParts.year===e;return i("div",{class:{"calendar-month":true,"calendar-month-disabled":!d&&r}},i("div",{class:"calendar-month-grid"},J(t,e,this.firstDayOfWeek%7).map(((a,o)=>{const{day:r,dayOfWeek:d}=a;const{isDateEnabled:l}=this;const h={month:t,day:r,year:e};const{isActive:c,isToday:p,ariaLabel:u,ariaSelected:m,disabled:g}=yt(this.locale,h,this.activePartsClone,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues);let f=s||g;if(!f&&l!==undefined){try{f=!l(P(h))}catch(t){y("Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}}return i("button",{tabindex:"-1","data-day":r,"data-month":t,"data-year":e,"data-index":o,"data-day-of-week":d,disabled:f,class:{"calendar-day-padding":r===null,"calendar-day":true,"calendar-day-active":c&&n,"calendar-day-today":p},"aria-selected":m,"aria-label":u,onClick:()=>{if(r===null){return}this.highlightActiveParts=true;this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:t,day:r,year:e}));this.setActiveParts(Object.assign(Object.assign({},this.activeParts),{month:t,day:r,year:e}))}},r)}))))}renderCalendarBody(){return i("div",{class:"calendar-body ion-focusable",ref:t=>this.calendarBodyRef=t,tabindex:"0"},X(this.workingParts).map((({month:t,year:e})=>this.renderMonth(t,e))))}renderCalendar(t){return i("div",{class:"datetime-calendar"},this.renderCalendarHeader(t),this.renderCalendarBody())}renderTimeLabel(){const t=this.el.querySelector('[slot="time-label"]')!==null;if(!t&&!this.showDefaultTimeLabel){return}return i("slot",{name:"time-label"},"Time")}renderTimePicker(t,e,n,a){const{color:o,activePartsClone:s,workingParts:r}=this;return i("ion-picker-internal",null,i("ion-picker-column-internal",{color:o,value:s.hour,items:t,numericInput:true,onIonChange:t=>{this.setWorkingParts(Object.assign(Object.assign({},r),{hour:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},s),{hour:t.detail.value}));t.stopPropagation()}}),i("ion-picker-column-internal",{color:o,value:s.minute,items:e,numericInput:true,onIonChange:t=>{this.setWorkingParts(Object.assign(Object.assign({},r),{minute:t.detail.value}));this.setActiveParts(Object.assign(Object.assign({},s),{minute:t.detail.value}));t.stopPropagation()}}),!a&&i("ion-picker-column-internal",{color:o,value:s.ampm,items:n,onIonChange:t=>{const e=R(r,t.detail.value);this.setWorkingParts(Object.assign(Object.assign({},r),{ampm:t.detail.value,hour:e}));this.setActiveParts(Object.assign(Object.assign({},s),{ampm:t.detail.value,hour:e}));t.stopPropagation()}}))}renderTimeOverlay(t,e,n,a){return[i("div",{class:"time-header"},this.renderTimeLabel()),i("button",{class:{"time-body":true,"time-body-active":this.isTimePopoverOpen},"aria-expanded":"false","aria-haspopup":"true",onClick:async t=>{const{popoverRef:e}=this;if(e){this.isTimePopoverOpen=true;e.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:t.target}}));await e.onWillDismiss();this.isTimePopoverOpen=false}}},at(this.activePartsClone,a)),i("ion-popover",{alignment:"center",translucent:true,overlayIndex:1,arrow:false,onWillPresent:t=>{const e=t.target.querySelectorAll("ion-picker-column-internal");e.forEach((t=>t.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px"},keyboardEvents:true,ref:t=>this.popoverRef=t},this.renderTimePicker(t,e,n,a))]}renderTime(){const{workingParts:t,presentation:e}=this;const n=e==="time";const a=j(this.locale,this.hourCycle);const{hours:o,minutes:s,am:r,pm:d}=Q(t,a?"h23":"h12",this.minParts,this.maxParts,this.parsedHourValues,this.parsedMinuteValues);const l=o.map((e=>({text:st(e,a),value:H(e,a,t.ampm)})));const h=s.map((t=>({text:ot(t),value:t})));const c=[];if(r){c.push({text:"AM",value:"am"})}if(d){c.push({text:"PM",value:"pm"})}return i("div",{class:"datetime-time"},n?this.renderTimePicker(l,h,c,a):this.renderTimeOverlay(l,h,c,a))}renderCalendarViewHeader(t){const e=this.el.querySelector('[slot="title"]')!==null;if(!e&&!this.showDefaultTitle){return}return i("div",{class:"datetime-header"},i("div",{class:"datetime-title"},i("slot",{name:"title"},"Select Date")),t==="md"&&i("div",{class:"datetime-selected-date"},dt(this.locale,this.activeParts)))}renderDatetime(t){const{presentation:e}=this;switch(e){case"date-time":return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderYearView(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderCalendarViewHeader(t),this.renderTime(),this.renderCalendar(t),this.renderYearView(),this.renderFooter()];case"time":return[this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderYearView(),this.renderFooter()];default:return[this.renderCalendarViewHeader(t),this.renderCalendar(t),this.renderYearView(),this.renderFooter()]}}render(){const{name:t,value:e,disabled:n,el:o,color:s,isPresented:r,readonly:d,showMonthAndYear:l,presentation:h,size:p}=this;const u=c(this);const g=h==="year"||h==="month"||h==="month-year";const f=l||g;const y=l&&!g;m(true,o,t,e,n);return i(a,{"aria-disabled":n?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},x(s,{[u]:true,["datetime-presented"]:r,["datetime-readonly"]:d,["datetime-disabled"]:n,"show-month-and-year":f,"month-year-picker-open":y,[`datetime-presentation-${h}`]:true,[`datetime-size-${p}`]:true}))},this.renderDatetime(u))}get el(){return o(this)}static get watchers(){return{disabled:["disabledChanged"],min:["minChanged"],max:["maxChanged"],yearValues:["yearValuesChanged"],monthValues:["monthValuesChanged"],dayValues:["dayValuesChanged"],hourValues:["hourValuesChanged"],minuteValues:["minuteValuesChanged"],activeParts:["activePartsChanged"],value:["valueChanged"]}}};let jt=0;Ot.style={ios:vt,md:kt};export{Ot as ion_datetime};
//# sourceMappingURL=p-70d755e8.entry.js.map