1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4660],{ 2/***/79176: 3/***/function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile-settings",function(){return s(89203)}])}, 4/***/89203: 5/***/function(e,a,s){"use strict";s.r(a), 6/* harmony export */s.d(a,{ 7/* harmony export */__N_SSP:function(){/* binding */return y}, 8/* harmony export */default:function(){/* binding */return N} 9/* harmony export */}); 10/* harmony import */var t=s(85893),i=s(69399),n=s(61801),l=s(21188),r=s(21480),o=s(4319),c=s(32706),d=s(18622),_=s(75618),h=s(52017),u=s(42053),m=s(87066),p=s(11163),v=s(57858),f=s(6339),b=s(36001),w=s(67294),x=s(94910),g=s(88442),j=s.n(g),y=!0; 11/* harmony import */function N(e){let{filmelier_session_user:a,top_bar_newsletter_data:s,translations:g,meta_locale:y,policy_center_url:N}=e;const S=(0,p.useRouter)(),{setToastData:I}=(0,c/* .useToastContext */.a)(),k=(0,d/* .useMediaQuery */.a)({minWidth:1366}),[C,V]=(0,w.useState)(-1),[P,Z]=(0,w.useState)(null),[E,D]=(0,w.useState)(""),[z,B]=(0,w.useState)(),[F,G]=(0,w.useState)(""),[R,T]=(0,w.useState)(!0),[U,W]=(0,w.useState)(void 0),[J,O]=(0,w.useState)(!0),[A,H]=(0,w.useState)(""),[Q,M]=(0,w.useState)(!0),[X,K]=(0,w.useState)(""),[Y,q]=(0,w.useState)(!0),[L,$]=(0,w.useState)(""),[ee,ae]=(0,w.useState)(""),[se,te]=(0,w.useState)(!0),[ie,ne]=(0,w.useState)(""),[le,re]=(0,w.useState)(!0),[oe,ce]=(0,w.useState)(!1),[de,_e]=(0,w.useState)(!1),[he,ue]=(0,w.useState)(!1),[me,pe]=(0,w.useState)(!1),[ve,fe]=(0,w.useState)(!1),[be,we]=(0,w.useState)(null);return(0,w.useEffect)((()=>{const e=F.length>0&&R&&A.length>0&&Q&&X.length>0&&Y,a=L.length>5&&ee.length>5&&se&&ie.length>5&&le&&ie===ee;_e(e),ue(a)})),(0,w.useEffect)((()=>{if(a){if(G(a.name),W(a.nickname),K(a.email),a.birthday){const[e,s,t]=a.birthday.split("-").map(Number),i=new Date(e,s-1,t),n=new Intl.DateTimeFormat(y,{year:"numeric",month:"2-digit",day:"2-digit"}).format(i);H(n)}else M(!1);D(a.photo),Z(a.photo),ce(a.allow_newsletter_notifications)}V(k?0:-1),(async()=>{await(0,_/* .get_global_settings_client_side */.H)(window.location.href).then((e=>{we(e)}))})()}),[]),(0,w.useEffect)((()=>{(async()=>{if(E&&E.length>0&&E!==P&&(null==a?void 0:a.id)&&z)try{const e=new FormData;e.append("hash_id",a.id),e.append("photo",E),e.append("current_url",window.location.href),e.append("profile_photo",z),200===(await m/* ["default"] */.Z.post("/api/user/upload-profile-photo",e,{headers:{"Content-Type":"multipart/form-data"},withCredentials:!0})).status?(I([{message:g.photo_updated,icon:"success"}]),await(0,u/* .refreshSession */.d)()):I([{message:g.photo_updated_error,icon:"error"}])}catch(e){console.error("Erro ao enviar imagem:",e),I([{message:g.photo_updated_error,icon:"error"}])}})()}),[E]),(0,w.useEffect)((()=>{(0,h/* .createCustomEvent */.t)({name:"User area",action:"Profile",platform:oe?"Activate newsletter":"Disable newsletter"})}),[oe]),(0,w.useEffect)((()=>{1===C&&($(""),ae(""),te(!0),ne(""),re(!0))}),[C]),(0/* ["default"] */,t.jsx)(i.Z,{top_bar_newsletter_data:s,children:(0,t.jsx)("div",{className:j()["profile-settings-container"],children:(0/* .TabView */,t.jsxs)(b.f,{panelContainerClassName:j()["tabview-container"],className:j()["tab-view-custom"],pt:{nav:{className:j()["header-tab-view"]},inkbar:{style:{display:"none"}}},onTabChange:e=>{3===e.index?window.open(N[S.locale],"_blank"):V(e.index)},activeIndex:C,renderActiveOnly:!1,children:[ 12 13(0/* .TabPanel */,t.jsx)(b.x,{header:(0,t.jsx)("h2",{children:g.edit_personal_data}),contentClassName:j()["".concat(0===C?"":"hidden-tab")],contentStyle:{display:k?"unset":"none !important"},className:0===C?j()["header-tab-panel-active"]:j()["header-tab-panel"],leftIcon:(0/* .FilmEdit */,t.jsx)(l.AU,{}),rightIcon:(0/* .FilmArrowRight */,t.jsx)(l.RJ,{}),children:(0,t.jsx)("div",{className:j()["header-tab-panel-active-content"],children:(()=>{const e=async()=>{pe(!0);const e=A.split("/");let[a,s,t]=e.map(Number);"en"===S.locale&&([s,a,t]=e.map(Number));const i="".concat(t,"-").concat(s.toString().padStart(2,"0"),"-").concat(a.toString().padStart(2,"0")),n={name:F,nickname:null!=U?U:null,birthdate:i};try{const e=await m/* ["default"] */.Z.patch("/api/user/update-profile",n,{headers:{"current-page-url":window.location.href},withCredentials:!0});200===e.status?(I([{message:g.saved_changes,icon:"success"}]),k||V(-1),await(0,u/* .refreshSession */.d)()):400===e.status&&I([{message:x/* ["default"] */.Z.t("modalRegistrationUser.errors.".concat(e.data.error)),icon:"error"}])}catch(e){I([{message:x/* ["default"] */.Z.t("modalRegistrationUser.errors.".concat(e.response.data.error)),icon:"error"}])}finally{pe(!1)}},s=async()=>
13{if(!ve){fe(!0);try{const e=await m/* ["default"] */.Z.patch("/api/user/resend-verification-email",{},{headers:{"current-page-url":window.location.href},withCredentials:!0});200===e.status?I([{message:g.resend_verification_email_success,icon:"success"}]):400===e.status&&I([{message:g.resend_verification_email_error,icon:"error"}])}catch(e){console.error("Erro ao reenviar email:",e),I([{message:g.resend_verification_email_error,icon:"error"}])}finally{fe(!1)}}};return k?(0,t.jsxs)(t.Fragment,{children:[ 14 15(0,t.jsx)("h1",{className:j()["h1-title"],children:g.edit_personal_data}),be&&be.filmelier_auth_provider_email===(null==a?void 0:a.provider_id)&&(0/* ["default"] */,t.jsx)(o.Z,{setImageUrl:D,setProfilePhoto:B,preload_image_src:null!=P?P:null==a?void 0:a.photo}), 16 17(0,t.jsxs)("div",{className:j()["filmelier-user-fields"],children:[ 18 19(0/* .FilmelierFullNameField */,t.jsx)(n.kQ,{value:F,setValue:G,is_valid:R,setIsValid:T,locale:S.locale}), 20 21(0/* .FilmelierNickNameField */,t.jsx)(n._b,{value:U,setValue:W,is_valid:J,setIsValid:O,locale:S.locale}), 22 23(0/* .FilmelierBirthDateField */,t.jsx)(n.nZ,{value:A,setValue:H,is_valid:Q,setIsValid:M,locale:S.locale}), 24 25(0/* .FilmelierEmailField */,t.jsx)(n.Bd,{value:X,setValue:K,is_valid:Y,setIsValid:q,locale:S.locale,disabled:!0}),!(null==a?void 0:a.email_validated_at)&&(0,t.jsxs)("button",{type:"button",className:j()["resend-verification-email"],onClick:s,children:[ve?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):(0/* .FilmRefresh */,t.jsx)(l.km,{viewBoxSize:18,color:"#c4c4c4"}),g.resend_verification_email]}), 26 27(0,t.jsx)("div",{className:j()["btn-continuar"],children:(0,t.jsx)("button",{type:"button",className:"".concat(!de&&j()["btn-disabled"]," ").concat(me&&j()["is-loading"]),onClick:e,disabled:!de,children:me?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):g.btn_save})})]})]}):(0/* .Dialog */,t.jsxs)(v.V,{onHide:()=>{V(-1)},visible:0===C,header:(0,t.jsx)("div",{className:j().header,children:(0,t.jsx)("div",{children:(0/* ["default"] */,t.jsx)(r.Z,{src:"/images/optimized/filmelier-logo_153x20.webp",alt:"Filmelier",width:153,height:20})})}),contentClassName:j().content,headerClassName:j().header_background_color,className:j().container,pt:{closeButtonIcon:{className:j()["close-icon"]}},children:[ 28 29(0,t.jsx)("h1",{className:j()["h1-title"],children:g.edit_personal_data}),be&&be.filmelier_auth_provider_email===(null==a?void 0:a.provider_id)&&(0/* ["default"] */,t.jsx)(o.Z,{setImageUrl:D,setProfilePhoto:B,preload_image_src:null!=P?P:null==a?void 0:a.photo}), 30 31(0,t.jsxs)("div",{className:j()["filmelier-user-fields"],children:[ 32 33(0/* .FilmelierFullNameField */,t.jsx)(n.kQ,{value:F,setValue:G,is_valid:R,setIsValid:T,locale:S.locale}), 34 35(0/* .FilmelierNickNameField */,t.jsx)(n._b,{value:U,setValue:W,is_valid:J,setIsValid:O,locale:S.locale}), 36 37(0/* .FilmelierBirthDateField */,t.jsx)(n.nZ,{value:A,setValue:H,is_valid:Q,setIsValid:M,locale:S.locale}), 38 39(0/* .FilmelierEmailField */,t.jsx)(n.Bd,{value:X,setValue:K,is_valid:Y,setIsValid:q,locale:S.locale,disabled:!0}),!(null==a?void 0:a.email_validated_at)&&(0,t.jsxs)("button",{type:"button",className:j()["resend-verification-email"],onClick:s,children:[ve?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):(0/* .FilmRefresh */,t.jsx)(l.km,{viewBoxSize:18,color:"#c4c4c4"}),g.resend_verification_email]}), 40 41(0,t.jsx)("div",{className:j()["btn-continuar"],children:(0,t.jsx)("button",{type:"button",className:"".concat(!de&&j()["btn-disabled"]," ").concat(me&&j()["is-loading"]),onClick:e,disabled:!de,children:me?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):g.btn_save})})]})]})})()})}),be&&be.filmelier_auth_provider_email===(null==a?void 0:a.provider_id)&&(0/* .TabPanel */,t.jsx)(b.x,{header:(0,t.jsx)("h2",{children:g.change_password}),contentClassName:j()["".concat(1===C?"":"hidden-tab")],contentStyle:{display:k?"unset":"none !important"},className:1===C?j()["header-tab-panel-active"]:j()["header-tab-panel"],leftIcon:(0/* .FilmLock */,t.jsx)(l.QJ,{}),rightIcon:(0/* .FilmArrowRight */,t.jsx)(l.RJ,{}),children:(0,t.jsx)("div",{className:j()["header-tab-panel-active-content"],
41children:(()=>{const e=async()=>{pe(!0);const e={current_password:L,new_password:ee};(0,h/* .createCustomEvent */.t)({name:"User area",action:"Profile",platform:"Edit-Password"});try{200===(await m/* ["default"] */.Z.patch("/api/user/change-password",{current_url:window.location.href,body_data:e},{withCredentials:!0})).status&&((0,h/* .createCustomEvent */.t)({name:"User area",action:"Profile",platform:"New-Password"}),I([{message:g.password_changed,icon:"success"}]),k||V(-1),$(""),ae(""),ne(""))}catch(e){var a,s,t;const i=null==e||null===(s=e.response)||void 0===s||null===(a=s.data)||void 0===a?void 0:a.message;400===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)?I([{message:"Provider is Google or Facebook"===i?g.password_changed_social_media:g.password_changed_wrong,icon:"error"}]):I([{message:g.password_changed_error,icon:"error"}])}finally{pe(!1)}};return k?(0,t.jsxs)(t.Fragment,{children:[ 42 43(0,t.jsx)("h1",{className:j()["h1-title"],children:g.change_password}), 44 45(0,t.jsxs)("div",{className:j()["filmelier-user-fields"],children:[ 46 47(0/* .FilmelierPasswordField */,t.jsx)(n.Iz,{value:L,setValue:$,is_valid:!0,setIsValid:e=>console.log(""),translations:{label:g.current_password,placeholder:g.current_password_placeholder,error_message:""}}), 48 49(0/* .FilmelierPasswordField */,t.jsx)(n.Iz,{value:ee,setValue:ae,is_valid:se,setIsValid:te,translations:{label:g.new_password,placeholder:g.new_password_placeholder,error_message:g.new_password_invalid_value}}), 50 51(0/* .FilmelierConfirmPasswordField */,t.jsx)(n.dP,{value:ie,setValue:ne,is_valid:le,setIsValid:re,password_to_compare_value:ee,translations:{label:g.confirm_password,placeholder:g.confirm_password_placeholder,error_message:g.confirm_password_invalid_value}}), 52 53(0,t.jsx)("div",{className:j()["btn-continuar"],children:(0,t.jsx)("button",{type:"button",className:"".concat(!he&&j()["btn-disabled"]," ").concat(me&&j()["is-loading"]),onClick:e,disabled:!he,children:me?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):g.btn_save})})]})]}):(0/* .Dialog */,t.jsxs)(v.V,{onHide:()=>{V(-1)},visible:1===C,header:(0,t.jsx)("div",{className:j().header,children:(0,t.jsx)("div",{children:(0/* ["default"] */,t.jsx)(r.Z,{src:"/images/optimized/filmelier-logo_153x20.webp",alt:"Filmelier",width:153,height:20})})}),contentClassName:j().content,headerClassName:j().header_background_color,className:j().container,pt:{closeButtonIcon:{className:j()["close-icon"]}},children:[ 54 55(0,t.jsx)("h1",{className:j()["h1-title"],children:g.change_password}), 56 57(0,t.jsxs)("div",{className:j()["filmelier-user-fields"],children:[ 58 59(0/* .FilmelierPasswordField */,t.jsx)(n.Iz,{value:L,setValue:$,is_valid:!0,setIsValid:e=>console.log(""),translations:{label:g.current_password,placeholder:g.current_password_placeholder,error_message:""}}), 60 61(0/* .FilmelierPasswordField */,t.jsx)(n.Iz,{value:ee,setValue:ae,is_valid:se,setIsValid:te,translations:{label:g.new_password,placeholder:g.new_password_placeholder,error_message:g.new_password_invalid_value}}), 62 63(0/* .FilmelierConfirmPasswordField */,t.jsx)(n.dP,{value:ie,setValue:ne,is_valid:le,setIsValid:re,password_to_compare_value:ee,translations:{label:g.confirm_password,placeholder:g.confirm_password_placeholder,error_message:g.confirm_password_invalid_value}}), 64 65(0,t.jsx)("div",{className:j()["btn-continuar"],children:(0,t.jsx)("button",{type:"button",className:"".concat(!he&&j()["btn-disabled"]," ").concat(me&&j()["is-loading"]),onClick:e,disabled:!he,children:me?(0/* .ProgressSpinner */,t.jsx)(f.G,{style:{width:"20px",margin:"0px",height:"fit-content"},strokeWidth:"8",animationDuration:".5s",className:j().spinner}):g.btn_save})})]})]})})()})}), 66 67(0/* .TabPanel */,t.jsx)(b.x,{header:(0,t.jsx)("h2",{children:g.notifications_and_permissions}),contentClassName:j()["".concat(2===C?"":"hidden-tab")],contentStyle:{display:k?"unset":"none !important"},className:2===C?j()["header-tab-panel-active"]:j()["header-tab-panel"],leftIcon:(0/* .FilmNotificationImportant */,t.jsx)(l.PP,{}),rightIcon:(0/* .FilmArrowRight */,t.jsx)(l.RJ,{}),style:{display:"br"!==S.locale&&"mx"!==S.locale?"none":""},children:(0,t.jsx)("div",{className:j()["header-tab-panel-active-content"],
67children:(()=>{const e=async()=>{pe(!0);try{200===(await m/* ["default"] */.Z.patch("/api/user/change-allow-notifications",{current_url:window.location.href},{withCredentials:!0})).status&&(I([{message:"".concat(g.saved_changes),icon:"success"}]),k||V(-1))}catch(e){I([{message:"".concat(g.saved_changes_error),icon:"error"}])}finally{pe(!1)}};return k?(0,t.jsxs)(t.Fragment,{children:[ 68 69(0,t.jsx)("h1",{className:j()["h1-title"],children:g.notifications_and_permissions}), 70 71(0,t.jsx)("div",{className:j()["toggle-field"],style:{display:2===C?"":"none"},children:(0/* .FilmelierToggleField */,t.jsx)(n.Cv,{label:oe?g.activated_newsletter:g.deactivated_newsletter,value:oe,setValue:ce,onChange:e,confirm_modal_description:g.description_modal_confirmation_newsletter,confirm_modal_description_yes:g.description_modal_confirmation_newsletter_action_yes_label,confirm_modal_description_no:g.description_modal_confirmation_newsletter_action_no_label})})]}):(0/* .Dialog */,t.jsxs)(v.V,{onHide:()=>{V(-1)},visible:2===C,header:(0,t.jsx)("div",{className:j().header,children:(0,t.jsx)("div",{children:(0/* ["default"] */,t.jsx)(r.Z,{src:"/images/optimized/filmelier-logo_153x20.webp",alt:"Filmelier",width:153,height:20})})}),contentClassName:j().content,headerClassName:j().header_background_color,className:j().container,pt:{closeButtonIcon:{className:j()["close-icon"]}},children:[ 72 73(0,t.jsx)("h1",{className:j()["h1-title"],children:g.notifications_and_permissions}), 74 75(0,t.jsx)("div",{className:j()["toggle-field"],children:(0/* .FilmelierToggleField */,t.jsx)(n.Cv,{label:oe?g.activated_newsletter:g.deactivated_newsletter,value:oe,setValue:ce,onChange:e})})]})})()})}), 76 77(0/* .TabPanel */,t.jsx)(b.x,{header:(0,t.jsx)("h2",{children:g.policy_center}),contentClassName:j()["".concat(3===C?"":"hidden-tab")],contentStyle:{display:k?"unset":"none !important"},className:3===C?j()["header-tab-panel-active"]:j()["header-tab-panel"],leftIcon:(0/* .FilmEditNote */,t.jsx)(l.bu,{}),rightIcon:(0/* .FilmArrowRight */,t.jsx)(l.RJ,{})})]})})})} 78/***/}, 79/***/88442: 80/***/function(e){ 81// extracted by mini-css-extract-plugin 82e.exports={"profile-settings-container":"styles_profile-settings-container__h2EEZ","tab-view-custom":"styles_tab-view-custom__52m0D","header-tab-view":"styles_header-tab-view__i9bCm","header-tab-panel":"styles_header-tab-panel__iAy_5","header-tab-panel-active":"styles_header-tab-panel-active__1kMwO","tabview-container":"styles_tabview-container__TmSr3","hidden-tab":"styles_hidden-tab__seJFP","header-tab-panel-active-content":"styles_header-tab-panel-active-content__PuvRx","toggle-field":"styles_toggle-field__MTdOb","h1-title":"styles_h1-title__Ry72N",content:"styles_content__Iyd0f","filmelier-user-fields":"styles_filmelier-user-fields__BwIG9",header_background_color:"styles_header_background_color__9D_i0",header:"styles_header__35blk","close-icon":"styles_close-icon__KcxlP","btn-continuar":"styles_btn-continuar__P7BYW","btn-disabled":"styles_btn-disabled__8Sk5_",spinner:"styles_spinner__zfaP8","resend-verification-email":"styles_resend-verification-email__rBkfG","is-loading":"styles_is-loading__Cp7hG"}; 83/***/}}, 84/******/function(e){ 85/******/e.O(0,[6001,2888,9774,179],(function(){return e(e.s=79176)})); 86/******/var a=e.O(); 87/******/_N_E=a}]);
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.