import{__awaiter,__generator}from"tslib"; /*! * (C) Ionic http://ionicframework.com - MIT License */import{r as registerInstance,d as createEvent,h,f as Host,i as getElement,j as forceUpdate}from"./index-6e4709ff.js";import{c as createNotchController}from"./notch-controller-55b09e11.js";import{i as isOptionSelected,c as compareOptions}from"./compare-with-utils-a96ff2ea.js";import{h as inheritAttributes,f as focusVisibleElement,d as renderHiddenInput}from"./helpers-da915de8.js";import{c as popoverController,b as actionSheetController,a as alertController,s as safeCall}from"./overlays-9472c98b.js";import{i as isRTL}from"./dir-babeabeb.js";import{h as hostContext,c as createColorClasses,g as getClassMap}from"./theme-01f3f29c.js";import{w as watchForOptions}from"./watch-options-c2911ace.js";import{w as chevronExpand,q as caretDownSharp}from"./index-e2cf2ceb.js";import{b as getIonMode}from"./ionic-global-c4e0c089.js";import"./index-a5d50daf.js";import"./hardware-back-button-329c81fd.js";import"./framework-delegate-63d1a679.js";import"./gesture-controller-314a54f6.js";import"./index-9b0d46f4.js";var selectIosCss=":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--placeholder-color:currentColor;--placeholder-opacity:var(--ion-placeholder-opacity, 0.6);--background:transparent;--border-style:solid;--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);display:block;position:relative;width:100%;min-height:44px;font-family:var(--ion-font-family, inherit);white-space:nowrap;cursor:pointer;z-index:2}:host(.select-label-placement-floating),:host(.select-label-placement-stacked){min-height:56px}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0}:host(.select-disabled){pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}:host([slot=start]),:host([slot=end]){width:auto}.select-placeholder{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}button{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.select-icon{-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0;position:relative;-ms-flex-negative:0;flex-shrink:0}:host(.in-item-color) .select-icon{color:inherit}:host(.select-label-placement-stacked) .select-icon,:host(.select-label-placement-floating) .select-icon{position:absolute;height:100%}:host(.select-ltr.select-label-placement-stacked) .select-icon,:host(.select-ltr.select-label-placement-floating) .select-icon{right:var(--padding-end, 0)}:host(.select-rtl.select-label-placement-stacked) .select-icon,:host(.select-rtl.select-label-placement-floating) .select-icon{left:var(--padding-start, 0)}.select-text{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:inherit;overflow:hidden}.select-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal;cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.select-wrapper .select-placeholder{-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.select-wrapper-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;overflow:hidden}:host(.select-label-placement-stacked) .select-wrapper-inner,:host(.select-label-placement-floating) .select-wrapper-inner{-ms-flex-positive:1;flex-grow:1}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.label-text-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;max-width:200px;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden,.select-outline-notch-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}:host(.select-justify-space-between) .select-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.select-justify-start) .select-wrapper{-ms-flex-pack:start;justify-content:start}:host(.select-justify-end) .select-wrapper{-ms-flex-pack:end;justify-content:end}:host(.select-label-placement-start) .select-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.select-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-end) .select-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.select-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.select-label-placement-stacked) .select-wrapper,:host(.select-label-placement-floating) .select-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.select-label-placement-stacked) .label-text-wrapper,:host(.select-label-placement-floating) .label-text-wrapper{max-width:100%}:host(.select-ltr.select-label-placement-stacked) .label-text-wrapper,:host(.select-ltr.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host(.select-rtl.select-label-placement-stacked) .label-text-wrapper,:host(.select-rtl.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}:host(.select-label-placement-stacked) .native-wrapper,:host(.select-label-placement-floating) .native-wrapper{margin-left:0;margin-right:0;margin-top:1px;margin-bottom:0;-ms-flex-positive:1;flex-grow:1;width:100%}:host(.select-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.select-label-placement-floating:not(.label-floating)) .native-wrapper .select-placeholder{opacity:0}:host(.select-expanded.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.ion-focused.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.has-value.select-label-placement-floating) .native-wrapper .select-placeholder{opacity:1}:host(.label-floating) .label-text-wrapper{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);max-width:calc(100% / 0.75)}::slotted([slot=start]),::slotted([slot=end]){-ms-flex-negative:0;flex-shrink:0}::slotted([slot=start]:last-of-type){-webkit-margin-end:16px;margin-inline-end:16px;-webkit-margin-start:0;margin-inline-start:0}::slotted([slot=end]:first-of-type){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host{--highlight-height:0px}.select-icon{width:1.125rem;height:1.125rem;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.select-label-placement-stacked) .select-wrapper-inner,:host(.select-label-placement-floating) .select-wrapper-inner{width:calc(100% - 1.125rem - 4px)}:host(.select-disabled){opacity:0.3}::slotted(ion-button[slot=start].button-has-icon-only),::slotted(ion-button[slot=end].button-has-icon-only){--border-radius:50%;--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;aspect-ratio:1}";var IonSelectIosStyle0=selectIosCss;var selectMdCss=":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--placeholder-color:currentColor;--placeholder-opacity:var(--ion-placeholder-opacity, 0.6);--background:transparent;--border-style:solid;--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);--highlight-color:var(--highlight-color-focused);display:block;position:relative;width:100%;min-height:44px;font-family:var(--ion-font-family, inherit);white-space:nowrap;cursor:pointer;z-index:2}:host(.select-label-placement-floating),:host(.select-label-placement-stacked){min-height:56px}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0}:host(.select-disabled){pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}:host([slot=start]),:host([slot=end]){width:auto}.select-placeholder{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}button{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.select-icon{-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0;position:relative;-ms-flex-negative:0;flex-shrink:0}:host(.in-item-color) .select-icon{color:inherit}:host(.select-label-placement-stacked) .select-icon,:host(.select-label-placement-floating) .select-icon{position:absolute;height:100%}:host(.select-ltr.select-label-placement-stacked) .select-icon,:host(.select-ltr.select-label-placement-floating) .select-icon{right:var(--padding-end, 0)}:host(.select-rtl.select-label-placement-stacked) .select-icon,:host(.select-rtl.select-label-placement-floating) .select-icon{left:var(--padding-start, 0)}.select-text{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:inherit;overflow:hidden}.select-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal;cursor:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.select-wrapper .select-placeholder{-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.select-wrapper-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;overflow:hidden}:host(.select-label-placement-stacked) .select-wrapper-inner,:host(.select-label-placement-floating) .select-wrapper-inner{-ms-flex-positive:1;flex-grow:1}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.label-text-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;max-width:200px;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden,.select-outline-notch-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}:host(.select-justify-space-between) .select-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.select-justify-start) .select-wrapper{-ms-flex-pack:start;justify-content:start}:host(.select-justify-end) .select-wrapper{-ms-flex-pack:end;justify-content:end}:host(.select-label-placement-start) .select-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.select-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-end) .select-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.select-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.select-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.select-label-placement-stacked) .select-wrapper,:host(.select-label-placement-floating) .select-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.select-label-placement-stacked) .label-text-wrapper,:host(.select-label-placement-floating) .label-text-wrapper{max-width:100%}:host(.select-ltr.select-label-placement-stacked) .label-text-wrapper,:host(.select-ltr.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host(.select-rtl.select-label-placement-stacked) .label-text-wrapper,:host(.select-rtl.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}:host(.select-label-placement-stacked) .native-wrapper,:host(.select-label-placement-floating) .native-wrapper{margin-left:0;margin-right:0;margin-top:1px;margin-bottom:0;-ms-flex-positive:1;flex-grow:1;width:100%}:host(.select-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.select-label-placement-floating:not(.label-floating)) .native-wrapper .select-placeholder{opacity:0}:host(.select-expanded.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.ion-focused.select-label-placement-floating) .native-wrapper .select-placeholder,:host(.has-value.select-label-placement-floating) .native-wrapper .select-placeholder{opacity:1}:host(.label-floating) .label-text-wrapper{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);max-width:calc(100% / 0.75)}::slotted([slot=start]),::slotted([slot=end]){-ms-flex-negative:0;flex-shrink:0}::slotted([slot=start]:last-of-type){-webkit-margin-end:16px;margin-inline-end:16px;-webkit-margin-start:0;margin-inline-start:0}::slotted([slot=end]:first-of-type){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.select-fill-solid){--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-color:var(--ion-color-step-500, var(--ion-background-color-step-500, gray));--border-radius:4px;--padding-start:16px;--padding-end:16px;min-height:56px}:host(.select-fill-solid) .select-wrapper{border-bottom:var(--border-width) var(--border-style) var(--border-color)}:host(.has-focus.select-fill-solid.ion-valid),:host(.select-fill-solid.ion-touched.ion-invalid){--border-color:var(--highlight-color)}:host(.select-fill-solid) .select-bottom{border-top:none}@media (any-hover: hover){:host(.select-fill-solid:hover){--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}}:host(.select-fill-solid.select-expanded),:host(.select-fill-solid.ion-focused){--background:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}:host(.select-fill-solid) .select-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0px;border-end-start-radius:0px}:host(.label-floating.select-fill-solid) .label-text-wrapper{max-width:calc(100% / 0.75)}:host(.select-fill-outline){--border-color:var(--ion-color-step-300, var(--ion-background-color-step-300, #b3b3b3));--border-radius:4px;--padding-start:16px;--padding-end:16px;min-height:56px}:host(.select-fill-outline.select-shape-round){--border-radius:28px;--padding-start:32px;--padding-end:32px}:host(.has-focus.select-fill-outline.ion-valid),:host(.select-fill-outline.ion-touched.ion-invalid){--border-color:var(--highlight-color)}@media (any-hover: hover){:host(.select-fill-outline:hover){--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}}:host(.select-fill-outline.select-expanded),:host(.select-fill-outline.ion-focused){--border-width:var(--highlight-height);--border-color:var(--highlight-color)}:host(.select-fill-outline) .select-bottom{border-top:none}:host(.select-fill-outline) .select-wrapper{border-bottom:none}:host(.select-ltr.select-fill-outline.select-label-placement-stacked) .label-text-wrapper,:host(.select-ltr.select-fill-outline.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host(.select-rtl.select-fill-outline.select-label-placement-stacked) .label-text-wrapper,:host(.select-rtl.select-fill-outline.select-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}:host(.select-fill-outline.select-label-placement-stacked) .label-text-wrapper,:host(.select-fill-outline.select-label-placement-floating) .label-text-wrapper{position:absolute;max-width:calc(100% - var(--padding-start) - var(--padding-end))}:host(.select-fill-outline) .label-text-wrapper{position:relative;z-index:1}:host(.label-floating.select-fill-outline) .label-text-wrapper{-webkit-transform:translateY(-32%) scale(0.75);transform:translateY(-32%) scale(0.75);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;max-width:calc((100% - var(--padding-start) - var(--padding-end) - 8px) / 0.75)}:host(.select-fill-outline.select-label-placement-stacked) select,:host(.select-fill-outline.select-label-placement-floating) select{margin-left:0;margin-right:0;margin-top:6px;margin-bottom:6px}:host(.select-fill-outline) .select-outline-container{left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;width:100%;height:100%}:host(.select-fill-outline) .select-outline-start,:host(.select-fill-outline) .select-outline-end{pointer-events:none}:host(.select-fill-outline) .select-outline-start,:host(.select-fill-outline) .select-outline-notch,:host(.select-fill-outline) .select-outline-end{border-top:var(--border-width) var(--border-style) var(--border-color);border-bottom:var(--border-width) var(--border-style) var(--border-color);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.select-fill-outline) .select-outline-notch{max-width:calc(100% - var(--padding-start) - var(--padding-end))}:host(.select-fill-outline) .notch-spacer{-webkit-padding-end:8px;padding-inline-end:8px;font-size:calc(1em * 0.75);opacity:0;pointer-events:none}:host(.select-fill-outline) .select-outline-start{-webkit-border-start:var(--border-width) var(--border-style) var(--border-color);border-inline-start:var(--border-width) var(--border-style) var(--border-color)}:host(.select-fill-outline) .select-outline-start{border-start-start-radius:var(--border-radius);border-start-end-radius:0px;border-end-end-radius:0px;border-end-start-radius:var(--border-radius)}:host(.select-fill-outline) .select-outline-start{width:calc(var(--padding-start) - 4px)}:host(.select-fill-outline) .select-outline-end{-webkit-border-end:var(--border-width) var(--border-style) var(--border-color);border-inline-end:var(--border-width) var(--border-style) var(--border-color)}:host(.select-fill-outline) .select-outline-end{border-start-start-radius:0px;border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius);border-end-start-radius:0px}:host(.select-fill-outline) .select-outline-end{-ms-flex-positive:1;flex-grow:1}:host(.label-floating.select-fill-outline) .select-outline-notch{border-top:none}:host{--border-width:1px;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--highlight-height:2px}.select-icon{width:0.8125rem;-webkit-transition:-webkit-transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host(.select-label-placement-floating.select-expanded) .label-text-wrapper,:host(.select-label-placement-floating.ion-focused) .label-text-wrapper,:host(.select-label-placement-stacked.select-expanded) .label-text-wrapper,:host(.select-label-placement-stacked.ion-focused) .label-text-wrapper{color:var(--highlight-color)}:host(.has-focus.select-label-placement-floating.ion-valid) .label-text-wrapper,:host(.select-label-placement-floating.ion-touched.ion-invalid) .label-text-wrapper,:host(.has-focus.select-label-placement-stacked.ion-valid) .label-text-wrapper,:host(.select-label-placement-stacked.ion-touched.ion-invalid) .label-text-wrapper{color:var(--highlight-color)}.select-highlight{bottom:-1px;position:absolute;width:100%;height:var(--highlight-height);-webkit-transform:scale(0);transform:scale(0);-webkit-transition:-webkit-transform 200ms;transition:-webkit-transform 200ms;transition:transform 200ms;transition:transform 200ms, -webkit-transform 200ms;background:var(--highlight-color)}.select-highlight{inset-inline-start:0}:host(.select-expanded) .select-highlight,:host(.ion-focused) .select-highlight{-webkit-transform:scale(1);transform:scale(1)}:host(.in-item) .select-highlight{bottom:0}:host(.in-item) .select-highlight{inset-inline-start:0}:host(.select-expanded:not(.has-expanded-icon)) .select-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.select-expanded) .select-wrapper .select-icon,:host(.has-focus.ion-valid) .select-wrapper .select-icon,:host(.ion-touched.ion-invalid) .select-wrapper .select-icon,:host(.ion-focused) .select-wrapper .select-icon{color:var(--highlight-color)}:host(.select-shape-round){--border-radius:16px}:host(.select-label-placement-stacked) .select-wrapper-inner,:host(.select-label-placement-floating) .select-wrapper-inner{width:calc(100% - 0.8125rem - 4px)}:host(.select-disabled){opacity:0.38}::slotted(ion-button[slot=start].button-has-icon-only),::slotted(ion-button[slot=end].button-has-icon-only){--border-radius:50%;--padding-start:8px;--padding-end:8px;--padding-top:8px;--padding-bottom:8px;aspect-ratio:1;min-height:40px}";var IonSelectMdStyle0=selectMdCss;var Select=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionCancel=createEvent(this,"ionCancel",7);this.ionDismiss=createEvent(this,"ionDismiss",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionStyle=createEvent(this,"ionStyle",7);this.inputId="ion-sel-".concat(selectIds++);this.inheritedAttributes={};this.onClick=function(e){var i=e.target;var r=i.closest('[slot="start"], [slot="end"]');if(i===t.el||r===null){t.setFocus();t.open(e)}else{e.preventDefault()}};this.onFocus=function(){t.ionFocus.emit()};this.onBlur=function(){t.ionBlur.emit()};this.isExpanded=false;this.cancelText="Cancel";this.color=undefined;this.compareWith=undefined;this.disabled=false;this.fill=undefined;this.interface="alert";this.interfaceOptions={};this.justify="space-between";this.label=undefined;this.labelPlacement="start";this.multiple=false;this.name=this.inputId;this.okText="OK";this.placeholder=undefined;this.selectedText=undefined;this.toggleIcon=undefined;this.expandedIcon=undefined;this.shape=undefined;this.value=undefined}e.prototype.styleChanged=function(){this.emitStyle()};e.prototype.setValue=function(e){this.value=e;this.ionChange.emit({value:e})};e.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label"])};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(i){e=this.el;this.notchController=createNotchController(e,(function(){return t.notchSpacerEl}),(function(){return t.labelSlot}));this.updateOverlayOptions();this.emitStyle();this.mutationO=watchForOptions(this.el,"ion-select-option",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){this.updateOverlayOptions();forceUpdate(this);return[2]}))}))}));return[2]}))}))};e.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}if(this.notchController){this.notchController.destroy();this.notchController=undefined}};e.prototype.open=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,r,o,l,n;var a=this;return __generator(this,(function(s){switch(s.label){case 0:if(this.disabled||this.isExpanded){return[2,undefined]}this.isExpanded=true;i=this;return[4,this.createOverlay(e)];case 1:t=i.overlay=s.sent();t.onDidDismiss().then((function(){a.overlay=undefined;a.isExpanded=false;a.ionDismiss.emit();a.setFocus()}));return[4,t.present()];case 2:s.sent();if(this.interface==="popover"){r=this.childOpts.map((function(e){return e.value})).indexOf(this.value);if(r>-1){o=t.querySelector(".select-interface-option:nth-child(".concat(r+1,")"));if(o){focusVisibleElement(o);l=o.querySelector("ion-radio, ion-checkbox");if(l){l.focus()}}}else{n=t.querySelector("ion-radio:not(.radio-disabled), ion-checkbox:not(.checkbox-disabled)");if(n){focusVisibleElement(n.closest("ion-item"));n.focus()}}}return[2,t]}}))}))};e.prototype.createOverlay=function(e){var t=this.interface;if(t==="action-sheet"&&this.multiple){console.warn('Select interface cannot be "'.concat(t,'" with a multi-value select. Using the "alert" interface instead.'));t="alert"}if(t==="popover"&&!e){console.warn('Select interface cannot be a "'.concat(t,'" without passing an event. Using the "alert" interface instead.'));t="alert"}if(t==="action-sheet"){return this.openActionSheet()}if(t==="popover"){return this.openPopover(e)}return this.openAlert()};e.prototype.updateOverlayOptions=function(){var e=this.overlay;if(!e){return}var t=this.childOpts;var i=this.value;switch(this.interface){case"action-sheet":e.buttons=this.createActionSheetButtons(t,i);break;case"popover":var r=e.querySelector("ion-select-popover");if(r){r.options=this.createPopoverOptions(t,i)}break;case"alert":var o=this.multiple?"checkbox":"radio";e.inputs=this.createAlertInputs(t,o,i);break}};e.prototype.createActionSheetButtons=function(e,t){var i=this;var r=e.map((function(e){var r=getOptionValue(e);var o=Array.from(e.classList).filter((function(e){return e!=="hydrated"})).join(" ");var l="".concat(OPTION_CLASS," ").concat(o);return{role:isOptionSelected(t,r,i.compareWith)?"selected":"",text:e.textContent,cssClass:l,handler:function(){i.setValue(r)}}}));r.push({text:this.cancelText,role:"cancel",handler:function(){i.ionCancel.emit()}});return r};e.prototype.createAlertInputs=function(e,t,i){var r=this;var o=e.map((function(e){var o=getOptionValue(e);var l=Array.from(e.classList).filter((function(e){return e!=="hydrated"})).join(" ");var n="".concat(OPTION_CLASS," ").concat(l);return{type:t,cssClass:n,label:e.textContent||"",value:o,checked:isOptionSelected(i,o,r.compareWith),disabled:e.disabled}}));return o};e.prototype.createPopoverOptions=function(e,t){var i=this;var r=e.map((function(e){var r=getOptionValue(e);var o=Array.from(e.classList).filter((function(e){return e!=="hydrated"})).join(" ");var l="".concat(OPTION_CLASS," ").concat(o);return{text:e.textContent||"",cssClass:l,value:r,checked:isOptionSelected(t,r,i.compareWith),disabled:e.disabled,handler:function(e){i.setValue(e);if(!i.multiple){i.close()}}}}));return r};e.prototype.openPopover=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,r,o,l,n,a,s,c,d,p,h;return __generator(this,(function(b){t=this,i=t.fill,r=t.labelPlacement;o=this.interfaceOptions;l=getIonMode(this);n=l==="md"?false:true;a=this.multiple;s=this.value;c=e;d="auto";p=r==="floating"||r==="stacked";if(p||l==="md"&&i!==undefined){d="cover"}else{c=Object.assign(Object.assign({},e),{detail:{ionShadowTarget:this.nativeWrapperEl}})}h=Object.assign(Object.assign({mode:l,event:c,alignment:"center",size:d,showBackdrop:n},o),{component:"ion-select-popover",cssClass:["select-popover",o.cssClass],componentProps:{header:o.header,subHeader:o.subHeader,message:o.message,multiple:a,value:s,options:this.createPopoverOptions(this.childOpts,s)}});return[2,popoverController.create(h)]}))}))};e.prototype.openActionSheet=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(r){e=getIonMode(this);t=this.interfaceOptions;i=Object.assign(Object.assign({mode:e},t),{buttons:this.createActionSheetButtons(this.childOpts,this.value),cssClass:["select-action-sheet",t.cssClass]});return[2,actionSheetController.create(i)]}))}))};e.prototype.openAlert=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,r;var o=this;return __generator(this,(function(l){e=this.interfaceOptions;t=this.multiple?"checkbox":"radio";i=getIonMode(this);r=Object.assign(Object.assign({mode:i},e),{header:e.header?e.header:this.labelText,inputs:this.createAlertInputs(this.childOpts,t,this.value),buttons:[{text:this.cancelText,role:"cancel",handler:function(){o.ionCancel.emit()}},{text:this.okText,handler:function(e){o.setValue(e)}}],cssClass:["select-alert",e.cssClass,this.multiple?"multiple-select-alert":"single-select-alert"]});return[2,alertController.create(r)]}))}))};e.prototype.close=function(){if(!this.overlay){return Promise.resolve(false)}return this.overlay.dismiss()};e.prototype.hasValue=function(){return this.getText()!==""};Object.defineProperty(e.prototype,"childOpts",{get:function(){return Array.from(this.el.querySelectorAll("ion-select-option"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"labelText",{get:function(){var e=this.label;if(e!==undefined){return e}var t=this.labelSlot;if(t!==null){return t.textContent}return},enumerable:false,configurable:true});e.prototype.getText=function(){var e=this.selectedText;if(e!=null&&e!==""){return e}return generateText(this.childOpts,this.value,this.compareWith)};e.prototype.setFocus=function(){if(this.focusEl){this.focusEl.focus()}};e.prototype.emitStyle=function(){var e=this.disabled;var t={"interactive-disabled":e};this.ionStyle.emit(t)};e.prototype.renderLabel=function(){var e=this.label;return h("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!this.hasLabel},part:"label"},e===undefined?h("slot",{name:"label"}):h("div",{class:"label-text"},e))};e.prototype.componentDidRender=function(){var e;(e=this.notchController)===null||e===void 0?void 0:e.calculateNotchWidth()};Object.defineProperty(e.prototype,"labelSlot",{get:function(){return this.el.querySelector('[slot="label"]')},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hasLabel",{get:function(){return this.label!==undefined||this.labelSlot!==null},enumerable:false,configurable:true});e.prototype.renderLabelContainer=function(){var e=this;var t=getIonMode(this);var i=t==="md"&&this.fill==="outline";if(i){return[h("div",{class:"select-outline-container"},h("div",{class:"select-outline-start"}),h("div",{class:{"select-outline-notch":true,"select-outline-notch-hidden":!this.hasLabel}},h("div",{class:"notch-spacer","aria-hidden":"true",ref:function(t){return e.notchSpacerEl=t}},this.label)),h("div",{class:"select-outline-end"})),this.renderLabel()]}return this.renderLabel()};e.prototype.renderSelectText=function(){var e=this.placeholder;var t=this.getText();var i=false;var r=t;if(r===""&&e!==undefined){r=e;i=true}var o={"select-text":true,"select-placeholder":i};var l=i?"placeholder":"text";return h("div",{"aria-hidden":"true",class:o,part:l},r)};e.prototype.renderSelectIcon=function(){var e=getIonMode(this);var t=this,i=t.isExpanded,r=t.toggleIcon,o=t.expandedIcon;var l;if(i&&o!==undefined){l=o}else{var n=e==="ios"?chevronExpand:caretDownSharp;l=r!==null&&r!==void 0?r:n}return h("ion-icon",{class:"select-icon",part:"icon","aria-hidden":"true",icon:l})};Object.defineProperty(e.prototype,"ariaLabel",{get:function(){var e;var t=this,i=t.placeholder,r=t.inheritedAttributes;var o=this.getText();var l=(e=r["aria-label"])!==null&&e!==void 0?e:this.labelText;var n=o;if(n===""&&i!==undefined){n=i}if(l!==undefined){n=n===""?l:"".concat(l,", ").concat(n)}return n},enumerable:false,configurable:true});e.prototype.renderListbox=function(){var e=this;var t=this,i=t.disabled,r=t.inputId,o=t.isExpanded;return h("button",{disabled:i,id:r,"aria-label":this.ariaLabel,"aria-haspopup":"dialog","aria-expanded":"".concat(o),onFocus:this.onFocus,onBlur:this.onBlur,ref:function(t){return e.focusEl=t}})};e.prototype.render=function(){var e;var t=this;var i=this,r=i.disabled,o=i.el,l=i.isExpanded,n=i.expandedIcon,a=i.labelPlacement,s=i.justify,c=i.placeholder,d=i.fill,p=i.shape,b=i.name,f=i.value;var u=getIonMode(this);var m=a==="floating"||a==="stacked";var g=!m;var v=isRTL(o)?"rtl":"ltr";var x=hostContext("ion-item",this.el);var w=u==="md"&&d!=="outline"&&!x;var k=this.hasValue();var y=o.querySelector('[slot="start"], [slot="end"]')!==null;renderHiddenInput(true,o,b,parseValue(f),r);var C=a==="stacked"||a==="floating"&&(k||l||y);return h(Host,{key:"34a8ad246debbd7f1220ba1816d6cf427a24df8f",onClick:this.onClick,class:createColorClasses(this.color,(e={},e[u]=true,e["in-item"]=x,e["in-item-color"]=hostContext("ion-item.ion-color",o),e["select-disabled"]=r,e["select-expanded"]=l,e["has-expanded-icon"]=n!==undefined,e["has-value"]=k,e["label-floating"]=C,e["has-placeholder"]=c!==undefined,e["ion-focusable"]=true,e["select-".concat(v)]=true,e["select-fill-".concat(d)]=d!==undefined,e["select-justify-".concat(s)]=g,e["select-shape-".concat(p)]=p!==undefined,e["select-label-placement-".concat(a)]=true,e))},h("label",{key:"b4deb5c56fd7d97d8d09850e9b2758cecc59160a",class:"select-wrapper",id:"select-label"},this.renderLabelContainer(),h("div",{key:"5608f30189b941e8d737480308633376d7c554ec",class:"select-wrapper-inner"},h("slot",{key:"5448dcd362880effebec59b84ca81b140bf078b7",name:"start"}),h("div",{key:"ee140365597d0857621b4c4cd0577e0c51355f85",class:"native-wrapper",ref:function(e){return t.nativeWrapperEl=e},part:"container"},this.renderSelectText(),this.renderListbox()),h("slot",{key:"0aff40616a2ffaae06dfbb1282072d48435b220f",name:"end"}),!m&&this.renderSelectIcon()),m&&this.renderSelectIcon(),w&&h("div",{class:"select-highlight"})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["styleChanged"],isExpanded:["styleChanged"],placeholder:["styleChanged"],value:["styleChanged"]}},enumerable:false,configurable:true});return e}();var getOptionValue=function(e){var t=e.value;return t===undefined?e.textContent||"":t};var parseValue=function(e){if(e==null){return undefined}if(Array.isArray(e)){return e.join(",")}return e.toString()};var generateText=function(e,t,i){if(t===undefined){return""}if(Array.isArray(t)){return t.map((function(t){return textForValue(e,t,i)})).filter((function(e){return e!==null})).join(", ")}else{return textForValue(e,t,i)||""}};var textForValue=function(e,t,i){var r=e.find((function(e){return compareOptions(t,getOptionValue(e),i)}));return r?r.textContent:null};var selectIds=0;var OPTION_CLASS="select-interface-option";Select.style={ios:IonSelectIosStyle0,md:IonSelectMdStyle0};var selectOptionCss=":host{display:none}";var IonSelectOptionStyle0=selectOptionCss;var SelectOption=function(){function e(e){registerInstance(this,e);this.inputId="ion-selopt-".concat(selectOptionIds++);this.disabled=false;this.value=undefined}e.prototype.render=function(){return h(Host,{key:"7830b6152ba185b327d02fe96fd415cdcd16f48d",role:"option",id:this.inputId,class:getIonMode(this)})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var selectOptionIds=0;SelectOption.style=IonSelectOptionStyle0;var selectPopoverIosCss=".sc-ion-select-popover-ios-h ion-list.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-ios,ion-label.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-select-popover-ios-h{overflow-y:auto}";var IonSelectPopoverIosStyle0=selectPopoverIosCss;var selectPopoverMdCss=".sc-ion-select-popover-md-h ion-list.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-md,ion-label.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-select-popover-md-h{overflow-y:auto}ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md::part(container){opacity:0}ion-item.sc-ion-select-popover-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-popover-md{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-popover-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}";var IonSelectPopoverMdStyle0=selectPopoverMdCss;var SelectPopover=function(){function e(e){registerInstance(this,e);this.header=undefined;this.subHeader=undefined;this.message=undefined;this.multiple=undefined;this.options=[]}e.prototype.findOptionFromEvent=function(e){var t=this.options;return t.find((function(t){return t.value===e.target.value}))};e.prototype.callOptionHandler=function(e){var t=this.findOptionFromEvent(e);var i=this.getValues(e);if(t===null||t===void 0?void 0:t.handler){safeCall(t.handler,i)}};e.prototype.dismissParentPopover=function(){var e=this.el.closest("ion-popover");if(e){e.dismiss()}};e.prototype.setChecked=function(e){var t=this.multiple;var i=this.findOptionFromEvent(e);if(t&&i){i.checked=e.detail.checked}};e.prototype.getValues=function(e){var t=this,i=t.multiple,r=t.options;if(i){return r.filter((function(e){return e.checked})).map((function(e){return e.value}))}var o=this.findOptionFromEvent(e);return o?o.value:undefined};e.prototype.renderOptions=function(e){var t=this.multiple;switch(t){case true:return this.renderCheckboxOptions(e);default:return this.renderRadioOptions(e)}};e.prototype.renderCheckboxOptions=function(e){var t=this;return e.map((function(e){return h("ion-item",{class:Object.assign({"item-checkbox-checked":e.checked},getClassMap(e.cssClass))},h("ion-checkbox",{value:e.value,disabled:e.disabled,checked:e.checked,justify:"start",labelPlacement:"end",onIonChange:function(e){t.setChecked(e);t.callOptionHandler(e);forceUpdate(t)}},e.text))}))};e.prototype.renderRadioOptions=function(e){var t=this;var i=e.filter((function(e){return e.checked})).map((function(e){return e.value}))[0];return h("ion-radio-group",{value:i,onIonChange:function(e){return t.callOptionHandler(e)}},e.map((function(e){return h("ion-item",{class:Object.assign({"item-radio-checked":e.value===i},getClassMap(e.cssClass))},h("ion-radio",{value:e.value,disabled:e.disabled,onClick:function(){return t.dismissParentPopover()},onKeyUp:function(e){if(e.key===" "){t.dismissParentPopover()}}},e.text))})))};e.prototype.render=function(){var e=this,t=e.header,i=e.message,r=e.options,o=e.subHeader;var l=o!==undefined||i!==undefined;return h(Host,{key:"81e4df60ad6dab49bdde30f4c3e460ba425f0c89",class:getIonMode(this)},h("ion-list",{key:"940f13aab8c6cebbeb7d4b6d4d64b3c67d4c953d"},t!==undefined&&h("ion-list-header",null,t),l&&h("ion-item",null,h("ion-label",{class:"ion-text-wrap"},o!==undefined&&h("h3",null,o),i!==undefined&&h("p",null,i))),this.renderOptions(r)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SelectPopover.style={ios:IonSelectPopoverIosStyle0,md:IonSelectPopoverMdStyle0};export{Select as ion_select,SelectOption as ion_select_option,SelectPopover as ion_select_popover};