"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[61686],{61686:(e,o,t)=>{t.r(o),t.d(o,{CorePasswordModalComponent:()=>g});var r=t(10467),n=t(52749),s=t(63153),a=t(79555),i=t(33014),d=t(2469),l=t(69901),p=t(88246),c=t(86198),m=t(58197),u=t(43570),w=t(54438),C=t(89417),b=t(2910),f=t(73955);const h=["passwordForm"];function CorePasswordModalComponent_Conditional_19_Template(e,o){if(1&e&&(w.j41(0,"ion-item",8),w.nrm(1,"core-format-text",11),w.nI1(2,"translate"),w.k0s()),2&e){const e=w.XpG();w.R7$(),w.Y8G("text",w.bMT(2,1,e.error))}}let g=(()=>{var e;class CorePasswordModalComponent{constructor(){this.title="core.login.password",this.placeholder="core.login.password",this.submit="core.submit",this.password=""}submitPassword(e){var o=this;return(0,r.A)((function*(){e.preventDefault(),e.stopPropagation(),s.R.triggerFormSubmittedEvent(o.formElement,!1,n.CoreSites.getCurrentSiteId());const t=yield o.validatePassword(o.password);void 0===t.validated&&a.W3.dismiss(t),t.validated&&a.W3.dismiss(t),"string"==typeof t.error?o.error=t.error:t.error&&a.W3.dismiss(t.error)}))()}validatePassword(e){var o=this;return(0,r.A)((function*(){const t={password:e};if(!o.validator)return t;const r=yield i.CoreLoadings.show("core.loading",!0);try{return yield o.validator(e)}catch(e){t.validated=!1,t.error=e}finally{r.dismiss()}return t}))()}closeModal(){s.R.triggerFormCancelledEvent(this.formElement,n.CoreSites.getCurrentSiteId()),a.W3.dismiss()}}return(e=CorePasswordModalComponent).ɵfac=function CorePasswordModalComponent_Factory(o){return new(o||e)},e.ɵcmp=w.VBU({type:e,selectors:[["core-password-modal"]],viewQuery:function CorePasswordModalComponent_Query(e,o){if(1&e&&w.GBs(h,5),2&e){let e;w.mGM(e=w.lsd())&&(o.formElement=e.first)}},inputs:{title:"title",placeholder:"placeholder",submit:"submit",validator:"validator"},standalone:!0,features:[w.aNF],decls:24,vars:19,consts:[["passwordForm",""],["slot","end"],["fill","clear",3,"click","ariaLabel"],["slot","icon-only","name","fas-xmark","aria-hidden","true"],[1,"ion-padding"],[3,"ngSubmit"],["name","password","type","password","core-auto-focus","",1,"ion-text-wrap","core-ioninput-password",3,"ngModelChange","ariaLabel","placeholder","ngModel","clearOnEdit"],["slot","end","showIcon","fas-eye","hideIcon","fas-eye-slash"],[1,"ion-text-wrap","ion-padding-top","text-danger"],["expand","block","type","submit",3,"disabled"],["type","submit",1,"core-submit-hidden-enter"],[3,"text"]],template:function CorePasswordModalComponent_Template(e,o){if(1&e){const e=w.RV6();w.j41(0,"ion-header")(1,"ion-toolbar")(2,"ion-title")(3,"h1"),w.EFF(4),w.nI1(5,"translate"),w.k0s()(),w.j41(6,"ion-buttons",1)(7,"ion-button",2),w.nI1(8,"translate"),w.bIt("click",(function CorePasswordModalComponent_Template_ion_button_click_7_listener(){return w.eBV(e),w.Njj(o.closeModal())})),w.nrm(9,"ion-icon",3),w.k0s()()()(),w.j41(10,"ion-content",4)(11,"form",5,0),w.bIt("ngSubmit",(function CorePasswordModalComponent_Template_form_ngSubmit_11_listener(t){return w.eBV(e),w.Njj(o.submitPassword(t))})),w.j41(13,"div")(14,"ion-item")(15,"ion-input",6),w.nI1(16,"translate"),w.nI1(17,"translate"),w.mxI("ngModelChange",(function CorePasswordModalComponent_Template_ion_input_ngModelChange_15_listener(t){return w.eBV(e),w.DH7(o.password,t)||(o.password=t),w.Njj(t)})),w.nrm(18,"ion-input-password-toggle",7),w.k0s()(),w.DNE(19,CorePasswordModalComponent_Conditional_19_Template,3,3,"ion-item",8),w.k0s(),w.j41(20,"ion-button",9),w.EFF(21),w.nI1(22,"translate"),w.k0s(),w.nrm(23,"input",10),w.k0s()()}2&e&&(w.R7$(4),w.JRh(w.bMT(5,9,o.title)),w.R7$(3),w.Y8G("ariaLabel",w.bMT(8,11,"core.close")),w.R7$(8),w.FS9("placeholder",w.bMT(16,13,o.placeholder)),w.Y8G("ariaLabel",w.bMT(17,15,o.placeholder)),w.R50("ngModel",o.password),w.Y8G("clearOnEdit",!1),w.R7$(4),w.vxM(19,o.error?19:-1),w.R7$(),w.Y8G("disabled",!o.password),w.R7$(),w.SpI(" ",w.bMT(22,17,o.submit)," "))},dependencies:[d.V,C.qT,C.BC,C.cb,C.vS,C.cV,b.Jm,b.QW,b.W9,b.eU,b.iq,b.$w,b.Wv,b.uz,b.BC,b.ai,b.Gw,f.D9,u.T,c.t,p.i,l.i,m.B],encapsulation:2}),CorePasswordModalComponent})()}}]);