PageSourceSearch

https://slostr.com/_next/static/chunks/4439.510e73277be61c2d.js

js slostr.com collected 2026-10-02 00:57:38 UTC 7,727 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4439],{94439:(e,s,t)=>{t.r(s),t.d(s,{default:()=>v});var a=t(95155),r=t(12115),l=t(99783),i=t(62523),n=t(88539),o=t(78749),c=t(92657),d=t(81284),u=t(47863),m=t(66474),x=t(75684),p=t(10488),h=t(2925),b=t(34869),g=t(43453),j=t(55552),f=t(80368);function v(e){var s;let{messages:t}=e,v=(0,r.useContext)(f.c),{user:y,setUser:S}=v||{},[_,A]=(0,r.useState)(""),[k,C]=(0,r.useState)(""),[q,O]=(0,r.useState)(""),[T,z]=(0,r.useState)(""),[E,I]=(0,r.useState)(""),[P,D]=(0,r.useState)(""),[F,L]=(0,r.useState)(""),[U,X]=(0,r.useState)(null),[B,J]=(0,r.useState)(null),[K,Q]=(0,r.useState)(null),[W,Y]=(0,r.useState)(null),[Z,$]=(0,r.useState)([]),G=null==y?void 0:y.is_social_account,[H,M]=(0,r.useState)({}),[R,V]=(0,r.useState)(!1),[ee,es]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,el]=(0,r.useState)(""),[ei,en]=(0,r.useState)(!1);(0,r.useEffect)(()=>{y&&(A(y.first_name||""),C(y.last_name||""),O(y.username||""),z(y.username||""),L(y.bio||""),X(y.insta),J(y.facebook),Q(y.youtube),Y(y.web))},[y]);let eo=async e=>{e.preventDefault();try{Z.length>0&&await (0,l.Qx)(null==y?void 0:y.id,{profile_picture:Z[0].file});let e={first_name:_,last_name:k,username:q,bio:F,insta:U,facebook:B,youtube:K,web:W};if(E&&P&&E===P){let s=ec(E);""===s&&(e.new_password=E,e.new_password_confirm=P)}let s=await (0,l.TK)(null==y?void 0:y.id,e);null==v||v.setUser(s),M({}),V(!0)}catch(e){var s;(null==(s=e.response)?void 0:s.data)?M(e.response.data):M({general:"An unknown error occurred."})}};(0,r.useEffect)(()=>{let e;return R&&(e=setTimeout(()=>V(!1),3e3)),()=>clearTimeout(e)},[R]);let ec=e=>e.length<8?t["password-req-1"]:/[A-Z]/.test(e)?/[a-z]/.test(e)?/[0-9]/.test(e)?/[" !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/.test(e)?"":t["password-req-5"]:t["password-req-4"]:t["password-req-3"]:t["password-req-2"];(0,r.useEffect)(()=>{let e=ec(E);""!==E&&""!==P&&el(e),ea(E===P&&""===e&&""!==q&&""!==T&&""!==_&&""!==k)},[E,P,q,T,_,k]);let ed="string"==typeof(null==y?void 0:y.profile_picture)&&y.profile_picture.includes("?X-Amz-Algorithm")?y.profile_picture.split("?X-Amz-Algorithm")[0]:(null==y?void 0:y.profile_picture)||"/travel-blogger-profile.jpg";return(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsxs)("div",{className:"mx-auto max-w-2xl px-4 py-10",children:[(0,a.jsx)("h1",{className:"text-xl font-bold text-foreground mb-8",children:t.settings||"Settings"}),(0,a.jsxs)("form",{onSubmit:eo,className:"space-y-2",children:[(0,a.jsxs)(w,{label:t["profile-info"]||"Profile",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-5",children:[(0,a.jsx)("img",{src:ed,alt:"".concat(_," ").concat(k),className:"w-16 h-16 rounded-2xl object-cover border border-border/40 shrink-0"}),(0,a.jsx)(j.A,{maxImages:1,initialImages:Z,onImageChange:e=>$(e)})]}),(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(N,{label:"".concat(t["user-first-name"]||"First name"," *"),children:(0,a.jsx)(i.p,{id:"firstName",required:!0,value:_,onChange:e=>A(e.target.value),placeholder:"John"})}),(0,a.jsx)(N,{label:"".concat(t["user-last-name"]||"Last name"," *"),children:(0,a.jsx)(i.p,{id:"lastName",required:!0,value:k,onChange:e=>C(e.target.value),placeholder:"Doe"})})]}),(0,a.jsx)(N,{label:"".concat(t.username||"Username"," *"),children:(0,a.jsx)(i.p,{id:"username",required:!0,value:q,onChange:e=>O(e.target.value),placeholder:"johndoe"})}),(0,a.jsxs)(N,{label:t["user-bio"]||"Bio",children:[(0,a.jsx)(n.T,{id:"bio",value:F,onChange:e=>L(e.target.value),placeholder:"Tell us about yourself…",rows:3,maxLength:255,className:"resize-none"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground text-right mt-1",children:[null!=(s=null==F?void 0:F.length)?s:0,"/255"]})]})]}),!G&&(0,a.jsxs)(w,{label:"Security",children:[(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(N,{label:t.password||"New password",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(i.p,{id:"password1",type:ee?"text":"password",value:E,onChange:e=>I(e.target.value),placeholder:"New password"}),(0,a.jsx)("button",{type:"button",onClick:()=>es(!ee),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:ee?(0,a.jsx)(o.A,{className:"h-4 w-4"}):(0,a.jsx)(c.A,{className:"h-4 w-4"})})]})}),(0,a.jsx)(N,{label:t["password-confirm"]||"Confirm password",children:(0,a.jsx)(i.p,{id:"password2",type:"password",value:P,onChange:e=>D(e.target.value),placeholder:"Confirm password"})})]}),er&&(0,a.jsx)("p",{className:"text-xs text-destructive mt-1",children:er}),E&&P&&E!==P&&(0,a.jsx)("p",{className:"text-xs text-destructive mt-1",children:t["password-no-match"]||"Passwords do not match"}),(0,a.jsxs)("button",{type:"button",onClick:()=>en(!ei),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground mt-2",children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Password requirements",ei?(0,a.jsx)(u.A,{className:"h-3 w-3"}):(0,a.jsx)(m.A,{className:"h-3 w-3"})]}),ei&&(0,a.jsxs)("ul",{className:"mt-2 space-y-1 text-xs text-muted-foreground list-disc list-inside pl-1",children:[(0,a.jsx)("li",{children:t["password-req-1"]||"At least 8 characters"}),(0,a.jsx)("li",{children:t["password-req-2"]||"One uppercase letter"}),(0,a.jsx)("li",{children:t["password-req-3"]||"One lowercase letter"}),(0,a.jsx)("li",{children:t["password-req-4"]||"One number"}),(0,a.jsx)("li",{children:t["password-req-5"]||"One special character"})]})]}),(0,a.jsx)(w,{label:t.socials||"Social links",children:(0,a.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:[{id:"instagram",icon:x.A,val:U,set:X,label:t["social-insta"]||"Instagram",ph:"@username"}
1,{id:"facebook",icon:p.A,val:B,set:J,label:t["social-fb"]||"Facebook",ph:"facebook.com/username"},{id:"youtube",icon:h.A,val:K,set:Q,label:t["social-yt"]||"YouTube",ph:"youtube.com/@channel"},{id:"website",icon:b.A,val:W,set:Y,label:t["social-web"]||"Website",ph:"https://example.com"}].map(e=>{let{id:s,icon:t,val:r,set:l,label:n,ph:o}=e;return(0,a.jsx)(N,{label:n,icon:(0,a.jsx)(t,{className:"h-3.5 w-3.5"}),children:(0,a.jsx)(i.p,{id:s,value:r||"",onChange:e=>l(e.target.value),placeholder:o})},s)})})}),Object.keys(H).length>0&&(0,a.jsx)("div",{className:"rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3",children:(0,a.jsx)("ul",{className:"space-y-1 text-xs text-destructive",children:Object.entries(H).map(e=>{let[s,t]=e;return(0,a.jsx)("li",{children:"".concat(s,": ").concat(t.join(", "))},s)})})}),(0,a.jsx)("div",{className:"flex justify-end pt-6",children:(0,a.jsx)("button",{type:"submit",className:"px-5 py-2.5 rounded-xl bg-primary text-white text-sm font-semibold hover:bg-primary/90 transition-colors",children:t.save||"Save changes"})})]})]}),R&&(0,a.jsx)("div",{className:"fixed top-4 right-4 z-50 animate-in fade-in slide-in-from-top-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-2.5 bg-white border border-border rounded-xl shadow-lg px-4 py-3",children:[(0,a.jsx)(g.A,{className:"h-4 w-4 text-primary shrink-0"}),(0,a.jsx)("p",{className:"text-sm font-medium text-foreground",children:t["user-updated"]||"Profile updated!"})]})})]})}function w(e){let{label:s,children:t}=e;return(0,a.jsxs)("div",{className:"rounded-2xl border border-border/60 bg-white px-5 py-5 space-y-4 mb-4",children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:s}),t]})}function N(e){let{label:s,icon:t,children:r}=e;return(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs font-medium text-foreground",children:[t,s]}),r]})}}}]);

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.