/*! * (C) Ionic http://ionicframework.com - MIT License */ import{r as t,h as o,f as s,i as e}from"./p-9ad82dba.js";import{p as i}from"./p-06fee233.js";import{c as n}from"./p-47794def.js";import{x as a,y as r}from"./p-da2b833b.js";import{b as c}from"./p-6994c97a.js";const p=class{constructor(o){t(this,o),this.togglePasswordVisibility=()=>{const{inputElRef:t}=this;t&&(t.type="text"===t.type?"password":"text")},this.color=void 0,this.showIcon=void 0,this.hideIcon=void 0,this.type="password"}onTypeChange(t){"text"===t||"password"===t||i(`ion-input-password-toggle only supports inputs of type "text" or "password". Input of type "${t}" is not compatible.`,this.el)}connectedCallback(){const{el:t}=this,o=this.inputElRef=t.closest("ion-input");o?this.type=o.type:i("No ancestor ion-input found for ion-input-password-toggle. This component must be slotted inside of an ion-input.",t)}disconnectedCallback(){this.inputElRef=null}render(){var t,e;const{color:i,type:p}=this,d=c(this),l=null!==(t=this.showIcon)&&void 0!==t?t:a,f=null!==(e=this.hideIcon)&&void 0!==e?e:r,h="text"===p;return o(s,{key:"1cb075999e41c2fde3a3d6cafe6f37c9b5429299",class:n(i,{[d]:!0})},o("ion-button",{key:"cfaaec221f530ecc475690b6508c2333e32ff609",mode:d,color:i,fill:"clear",shape:"round","aria-checked":h?"true":"false","aria-label":"show password",role:"switch",type:"button",onPointerDown:t=>{t.preventDefault()},onClick:this.togglePasswordVisibility},o("ion-icon",{key:"dc0fc5fe8df4df4c145e29b30e589f159aab9cd9",slot:"icon-only","aria-hidden":"true",icon:h?f:l})))}get el(){return e(this)}static get watchers(){return{type:["onTypeChange"]}}};p.style={ios:"",md:""};export{p as ion_input_password_toggle}