1import{a as W}from"./chunk-DDWO7UT6.js";import{a as z}from"./chunk-NI37FYAP.js";import"./chunk-SB5L2XE4.js";import{A as k,B as q,D as A,c as U,g as B,h as D,j,l as I,m as T,x as L}from"./chunk-ICJV4PL6.js";import{a as M}from"./chunk-RIRGXRXY.js";import{a as x}from"./chunk-3GN2FC7K.js";import{t as F}from"./chunk-47CSRN7C.js";import"./chunk-SKH2MXBC.js";import"./chunk-BQLJE42W.js";import{$b as N,Db as w,Ib as _,Jb as C,Sb as m,Tb as s,Xa as o,Ya as d,Zb as E,_b as y,bc as V,da as g,ib as b,mb as h,na as f,oa as v,sb as c,xb as t,yb as n,zb as S}from"./chunk-YE3BF7DR.js";import"./chunk-4IDNTCH7.js";function P(i,a){i&1&&(t(0,"span"),s(1,"Debes ingresar el correo electr\xF3nico"),n())}function Z(i,a){i&1&&(t(0,"span"),s(1,"Debes ingresar un correo electr\xF3nico v\xE1lido"),n())}function R(i,a){if(i&1&&(t(0,"div",10),b(1,P,2,0,"span")(2,Z,2,0,"span"),n()),i&2){C();let e=m(14);o(),c(!(e==null||e.errors==null)&&e.errors.requiredEmpty?1:-1),o(),c(!(e==null||e.errors==null)&&e.errors.pattern?2:-1)}}function G(i,a){i&1&&(t(0,"div",10)(1,"span"),s(2,"El correo electr\xF3nico que ingresaste no se encuentra"),n()())}function Q(i,a){i&1&&(t(0,"div",10)(1,"span"),s(2,"Debes ingresar el Captcha"),n()())}var H=class i{constructor(a,e,r,l){this.modalService=a;this.helperService=e;this.newsletterEmailService=r;this.eventEmitterService=l}model={};captchaValid=!1;form;notFound=!1;isLoading=!1;send(){this.isLoading=!0;var a=!0,e=window.sessionStorage.getItem("keyValueCaptcha");this.captchaValid=!1,window.sessionStorage.getItem("visibleCaptcha")==="true"&&(e=hcaptcha.getResponse(window.sessionStorage.getItem("captchaWidgetID")),e?.length===0&&(this.captchaValid=!0,a=!1)),a&&(this.model.captcha=e,this.form.$valid&&!this.form.isBusy?this.modalService.showConfirm("\xBFEstas seguro de darte de baja?").subscribe({next:()=>{this.form.isBusy=!0,this.newsletterEmailService.down(this.model).subscribe({next:()=>{this.form.isBusy=!1,this.notFound=!1,this.form.submitted=!1,this.eventEmitterService.reloadCaptchaEvent.emit(),this.model={},this.modalService.showExit("Tu correo ha sido eliminado de nuestra lista de correos de la entidad","Correo eliminado")},error:r=>{this.eventEmitterService.reloadCaptchaEvent.emit(),this.form.isBusy=!1,r.status===404?this.notFound=!0:this.helperService.handlerException(r)}})}}):this.form.submitted=!0),this.isLoading=!1}static \u0275fac=function(e){return new(e||i)(d(F),d(M),d(W),d(x))};static \u0275cmp=g({type:i,selectors:[["app-news-unsubscribe"]],standalone:!0,features:[V],decls:20,vars:6,consts:[["form","ngForm"],["email","ngModel"],[1,"content_all"],[3,"seedValue"],[1,"bg-gray"],["name","form","novalidate","",1,"frontBlock-wUnsub",3,"ngSubmit"],[1,"frontBlock-colUnsub"],[1,"icon-mail","frontBlock-iconUnsub"],[1,"frontBlock__titUnsub"],["autocomplete","off","required","","aria-required","true","maxlength","150","type","email","pattern","[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","name","email","placeholder","Correo electr\xF3nico",3,"ngModelChange","ngModel"],[1,"error"],["type","submit",1,"btn-main","btn-main--publicar",3,"disabled"]],template:function(e,r){if(e&1){let l=w();t(0,"div",2),S(1,"app-seed",3),n(),t(2,"div",4)(3,"div",2)(4,"form",5,0),_("ngSubmit",function(){return f(l),v(r.send())}),t(6,"div",6),S(7,"i",7),n(),t(8,"div",6)(9,"h3",8),s(10,"\xBFQuieres darte de baja de nuestro listado de correos?"),n(),t(11,"p"),s(12," Escribe tu correo electr\xF3nico y confirma darte de baja para no recibir correos electr\xF3nicos de la entidad "),n(),t(13,"input",9,1),N("ngModelChange",function(p){return f(l),y(r.model.email,p)||(r.model.email=p),v(p)}),n(),b(15,R,3,2,"div",10)(16,G,3,0,"div",10)(17,Q,3,0,"div",10),t(18,"button",11),s(19,"Darme de baja"),n()()()()()}if(e&2){let l=m(5),u=m(14);o(),h("seedValue","Darse de baja"),o(12),E("ngModel",r.model.email),o(2),c(u.invalid&&l.submitted?15:-1),o(),c(r.notFound?16:-1),o(),c(l.submitted&&r.captchaValid?17:-1),o(),h("disabled",l.invalid||r.isLoading)}},dependencies:[A,T,U,B,D,L,k,q,I,j,z]})};export{H as NewsUnsubscribeComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.