1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[49588],{SikY:function(e,s,n){n.r(s);var r=n("sViW"),t=n("M5j3"),i=n("5ene"),a=n("jg1C"),l=n("ERkP"),c=n("aWzz"),N=n.n(c),_=n("+hKN"),o=n("ogaj"),d=n("yaX/"),u=n("n/Bz"),O=n("/y3p"),T=n("vIJK"),S=n("+8Zr"),E=n("k0sV");function m(e){var s=e.regToken,n=e.uid,c=e.provider,N=e.isNewUser,m=void 0!==N&&N,C=e.onClose,L=e.onSuccess,f=(0,l.useState)(!1),h=f[0],I=f[1],x=(0,l.useState)(!1),g=x[0],A=x[1],p=(0,l.useState)(!1),v=p[0],D=p[1],j=(0,l.useState)(!1),R=j[0],k=j[1],G=(0,l.useRef)(!1),M=(0,_.sn)(),b=(0,_.Ul)(),y=(0,_.Jd)(),U=(0,d.QJ)(),K=(0,_.UK)("taggingLoginProviders")[0],P=(0,o.A)(),w=P.TRACKING_EVENTS,z=P.trackEvent,B=w.SEGMENT;(0,l.useEffect)((function(){!1===G.current&&(z({eventName:B.CONSENT_FORM_SHOWED,form_name:"consent_form"}),G.current=!0)}),[B.CONSENT_FORM_SHOWED,z]);var F=(0,_.s9)(),H=(0,r.A)((function(){var e,r,a,l;return(0,i.YH)(this,(function(i){switch(i.label){case 0:if(k(!0),!h)return A(!0),k(!1),z({eventName:B.CONSENT_BUTTON_CLICKED,label:"consent_clicked",configuration:"consent_declined"}),[2];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,M.get("complete_registration_use_case").execute({consentsAccepted:h,regToken:s,uid:n})];case 2:return i.sent(),z({eventName:B.CONSENT_BUTTON_CLICKED,label:"consent_clicked",configuration:"consent_accepted"}),y.updateUser(),z(!0===m?{eventName:null==B?void 0:B.SIGNED_UP,form_name:"sign_up_form",user_id:y.id?"sdrn:fotocasa.es:user:"+y.id:null,auth_type:void 0===c?null==K?void 0:K.email:c,email:null==y?void 0:y.email}:{eventName:null==B?void 0:B.SIGNED_IN,form_name:"sign_in_form",user_id:y.id?"sdrn:fotocasa.es:user:"+y.id:null,auth_type:void 0===c?null==K?void 0:K.email:c,email:null==y?void 0:y.email}),y.id?(e="sdrn:fotocasa.es:user:"+y.id,[4,M.get("get_user_assets_use_case").execute({userId:y.id})]):[3,4];case 3:r=i.sent(),a=(0,t.A)({email:y.email,id:e},r),u.Ay.identify(e,a),i.label=4;case 4:return null==L||L(),[3,6];case 5:return l=i.sent(),D(!0),k(!1),b.error({name:"complete_registration_use_case",message:l.message,stack:l.stack}),[3,6];case 6:return[2]}}
1))}));return(0,a.jsx)("div",{children:(0,a.jsx)(S.lG,{open:!0,onOpenChange:function(){z({eventName:B.CONSENT_FORM_CLOSED,label:"consent_form_closed"}),null==C||C()},children:(0,a.jsxs)(S.ZJ,{children:[(0,a.jsx)(S.LC,{className:"!z-modal"}),(0,a.jsxs)(S.Cf,{size:U?"fullscreen":"sm","aria-describedby":null,children:[(0,a.jsx)(S.c7,{children:(0,a.jsx)(S.L3,{className:"sr-only",children:F.t("LOGIN_CONSENTS_MODAL.TITLE")})}),(0,a.jsxs)(S.R4,{className:"pb-2xl pt-2xl",children:[(0,a.jsx)("h2",{children:F.t("LOGIN_CONSENTS_MODAL.TITLE")}),(0,a.jsx)("p",{children:F.t("LOGIN_CONSENTS_MODAL.CONTENT.TEXT_1")}),(0,a.jsx)("p",{className:"pb-xl",children:F.t("LOGIN_CONSENTS_MODAL.CONTENT.TEXT_2")}),(0,a.jsx)("div",{className:"mb-xl",children:(0,a.jsxs)(E.D0,{state:g&&"error",isRequired:!0,children:[(0,a.jsxs)("div",{className:"flex gap-md items-center",children:[(0,a.jsx)(T.S,{checked:h,onCheckedChange:function(e){I(e),g&&e&&A(!1)},"aria-errormessage":g&&F.t("LOGIN_CONSENTS_MODAL.CONSENTS_ERROR"),"aria-label":F.t("LOGIN_CONSENTS_MODAL.I_ACCEPT")}),(0,a.jsxs)(E.dh,{children:[F.t("LOGIN_CONSENTS_MODAL.I_ACCEPT")," ",(0,a.jsxs)("a",{href:F.t("LEGAL_NOTICE_LINK"),target:"_blank",rel:"noopener noreferrer",className:"no-underline text-main visited:text-main",children:[F.t("LOGIN_CONSENTS_MODAL.TERMS_AND_CONDITIONS")," "]}),F.t("LOGIN_CONSENTS_MODAL.AND_THE")," ",(0,a.jsx)("a",{href:F.t("DATA_PROTECTION_CONTACT_LINK"),target:"_blank",rel:"noopener noreferrer",className:"no-underline text-main visited:text-main",children:F.t("LOGIN_CONSENTS_MODAL.PRIVACY_POLICY")})]})]}),g&&(0,a.jsx)(E.sG,{children:F.t("LOGIN_CONSENTS_MODAL.CONSENTS_ERROR")})]})}),(0,a.jsx)(O.$,{className:"w-full",onClick:H,size:"lg",isLoading:R,children:F.t("LOGIN_CONSENTS_MODAL.SUBMIT")}),v&&(0,a.jsx)("p",{className:"text-error mb-none",children:F.t("LOGIN_CONSENTS_MODAL.DEFAULT_ERROR_LITERAL")})]}),(0,a.jsx)(S.De,{"aria-label":F.t("close")})]})]})})})}m.displayName="AuthConsents",m.propTypes={regToken:N().string.isRequired,uid:N().string.isRequired,provider:N().string,isNewUser:N().bool,onSuccess:N().func,onClose:N().func},s.default=m}}]);
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.