1import{j as e}from"./crypto-BhrlFu3K.js";import{r as d}from"./routing-BWf71gZX.js";import{z as S}from"./notifications-CP6RlmgK.js";import{D as B}from"./DiscardChangesDialog-Dk_5SqVL.js";import{f as _,i as I,n as A,r as T,a as W,b as q,c as H,I as Y}from"./InfluencerProfileForm-S6gUwlTd.js";import{X as G,a as f}from"./index-D9Fb1lmT.js";import{f as F}from"./businessForm-DDk0ohn6.js";import{Q,al as X,j as J,o as v,ad as K,ae as Z,a9 as ee,aj as se,U as te,L as ae}from"./ui-CIKeZNy-.js";import{u as re}from"./useFrontendConfigOptions-CBUrxOxy.js";import"./date-CROXBL6n.js";import"./utils-Dtd7kdR7.js";import"./state-BY8jJeYO.js";const ne="https://img.magnific.com/free-photo/person-with-books-digital-art-style-education-day_23-2151164356.jpg?semt=ais_hybrid&w=740&q=80";function le({action:t,leading:s}){return e.jsxs("div",{className:"relative h-32 overflow-hidden rounded-t-[22px] bg-[#0b1220] sm:h-40 md:h-48",children:[e.jsx("img",{src:ne,alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full object-cover object-center",loading:"lazy",decoding:"async"}),e.jsx("div",{className:"absolute inset-0 bg-black/20","aria-hidden":!0}),s?e.jsx("div",{className:"absolute left-3 top-3 z-10 sm:left-4 sm:top-4",children:s}):null,t?e.jsx("div",{className:"absolute right-3 top-3 z-10 sm:right-4 sm:top-4",children:t}):null]})}function oe({label:t}){return e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-white/70 bg-white/90 px-3 py-1 para-font text-[12px] font-[600] text-[#111827] shadow-sm backdrop-blur-sm",children:[e.jsx("span",{children:t}),e.jsx(se,{className:"h-3 w-3 shrink-0 text-[#9ca3af]","aria-hidden":!0})]})}function ie({displayName:t}){return e.jsxs("div",{className:"flex h-[84px] w-[84px] shrink-0 items-center justify-center overflow-hidden rounded-full bg-gradient-to-br from-[#fce7f3] via-[#f3e8ff] to-[#dbeafe] shadow-[0_2px_10px_rgba(15,23,42,0.14)] ring-4 ring-white sm:h-[104px] sm:w-[104px]","aria-hidden":!0,children:[e.jsx(te,{className:"h-10 w-10 text-[#6366f1] sm:h-12 sm:w-12",strokeWidth:1.75}),e.jsxs("span",{className:"sr-only",children:[t," avatar"]})]})}function j({icon:t,children:s,href:r,external:l}){const n=r?e.jsx("a",{href:r,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,className:"break-all text-[#1d9bf0] hover:underline",children:s}):e.jsx("span",{className:"break-words",children:s});return e.jsxs("span",{className:"inline-flex max-w-full items-start gap-1 para-font text-[13px] text-[#536471]",children:[e.jsx(t,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:2,"aria-hidden":!0}),n]})}function D({icon:t,children:s}){return e.jsxs("h4",{className:"main-font flex items-center gap-2 text-[14px] font-[700] text-black",children:[e.jsx(t,{className:"h-4 w-4 shrink-0 text-[#536471]",strokeWidth:2,"aria-hidden":!0}),s]})}function w({label:t,value:s,href:r,external:l}){const n=s==null||s===""||s==="â",p=n?"â":s,i=!n&&r?e.jsx("a",{href:r,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,className:"break-all text-[#1d9bf0] hover:underline",children:p}):p;return e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 py-2 sm:flex-row sm:gap-2 sm:py-1",children:[e.jsx("span",{className:"flex w-full shrink-0 items-start para-font text-[11px] font-[600] uppercase tracking-wide text-[#9ca3af] sm:w-36 sm:text-[12px] sm:font-[400] sm:normal-case sm:tracking-normal sm:text-[#536471]",children:t}),e.jsx("span",{className:`min-w-0 flex-1 break-words para-font text-[14px] leading-snug sm:text-[13px] ${n?"text-[#9ca3af]":"text-[#0f1419]"}`,children:i})]})}function ce(t){const s=t.trim();return s?s.startsWith("http://")||s.startsWith("https://")?s:`https://${s}`:""}function P(t){var s;return((s=G.find(r=>r.value===t))==null?void 0:s.label)??t}function de(t){var n;const s=P(t.platform),r=((n=t.handle)==null?void 0:n.trim().replace(/^@/,""))||"",l=_(t.followerCount);return r&&l?`${s} · @${r} · ${l}`:r?`${s} · @${r}`:s}function R({displayName:t,categoryLabel:s,isVerified:r,onEdit:l,onBack:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-0 overflow-visible",children:[e.jsx(le,{leading:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pr-16 sm:pr-20",children:[n?e.jsx("button",{type:"button",onClick:n,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-white/70 bg-white/90 text-[#0f1419] shadow-sm backdrop-blur-sm transition-colors hover:bg-white","aria-label":"Back to profile",children:e.jsx(ee,{className:"h-4 w-4","aria-hidden":!0})}):null,e.jsx(oe,{label:s})]}),action:l?e.jsxs("button",{type:"button",onClick:l,className:"pointer-events-auto inline-flex min-h-[34px] items-center justify-center gap-1.5 rounded-full border border-white/70 bg-white/90 px-3.5 para-font text-[12px] font-[600] text-[#0f1419] shadow-sm backdrop-blur-sm transition-colors hover:bg-white sm:px-4 sm:text-[13px] sm:font-[500]",children:[e.jsx(Z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Edit"]}):null}),e.jsx("div",{className:"absolute bottom-0 left-3 z-30 translate-y-1/2 sm:left-6",children:e.jsx(ie,{displayName:t})})]}),e.jsx("div",{className:"overflow-visible px-3 pt-12 sm:px-6 sm:pt-[3.75rem]",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"main-font text-[15px] font-[800] leading-tight text-black sm:text-[20px]",children:t}),r?e.jsx("span",{className:"inline-flex items-center rounded-full bg-emerald-50 px-2.5 py-0.5 para-font text-[11px] font-[500] text-emerald-700",children:"Verified"}):null]})})]})}function me({influencer:t,profileInitial:s,categoryLabel:r,displayName:l,onEdit:n}){var g;const p=[s.locationCity,s.locationCountry].map(o=>
1o.trim()).filter(Boolean).join(", "),i=s.bio.trim(),b=(t==null?void 0:t.totalFollowers)??0,h=((g=t==null?void 0:t.socialHandles)==null?void 0:g.filter(o=>{var c;return(c=o.handle)==null?void 0:c.trim()}))??[],u=[p?e.jsx(j,{icon:Q,children:p},"location"):null,s.primaryLanguage.trim()?e.jsx(j,{icon:X,children:s.primaryLanguage.trim()},"language"):null,b>0?e.jsxs(j,{icon:J,children:[_(b)," followers"]},"followers"):null].filter(Boolean);return e.jsxs("div",{className:"flex flex-col overflow-visible",children:[e.jsx(R,{displayName:l,categoryLabel:r,isVerified:t==null?void 0:t.isVerified,onEdit:n}),e.jsxs("div",{className:"overflow-visible px-3 pb-6 sm:px-6 sm:pb-10",children:[u.length>0?e.jsx("div",{className:"mt-3 flex flex-col gap-1.5 sm:flex-row sm:flex-wrap sm:items-center sm:gap-x-4 sm:gap-y-1.5",children:u}):null,i?e.jsx("p",{className:"para-font mt-2 text-[12px] leading-relaxed text-[#536471] sm:text-[13px]",children:i}):null,e.jsxs("div",{className:"mt-5 border-t border-[#eff3f4] pt-4",children:[e.jsx(D,{icon:v,children:"Creator profile"}),e.jsxs("div",{className:"mt-2 flex flex-col gap-0",children:[e.jsx(w,{label:"Niches",value:s.niches.length?F(s.niches):null}),e.jsx(w,{label:"Content types",value:s.contentTypes.length?F(s.contentTypes):null})]})]}),h.length>0?e.jsxs("div",{className:"mt-5 border-t border-[#eff3f4] pt-4",children:[e.jsx(D,{icon:K,children:"Social profiles"}),e.jsx("div",{className:"mt-2 flex flex-col gap-0",children:h.map((o,c)=>{var x;return e.jsx(w,{label:P(o.platform),value:de(o),href:(x=o.profileUrl)!=null&&x.trim()?ce(o.profileUrl):void 0,external:!0},`${o.platform}-${o.handle}-${c}`)})})]}):null]})]})}const E="influencer-profile-edit-form";function ke(){const t=f(a=>a.user),s=f(a=>a.influencer),r=f(a=>a.memberVerticals),l=f(a=>a.isInfluencerLoaded),n=f(a=>a.loadInfluencer),p=f(a=>a.saveInfluencerDetails),i=f(a=>a.isLoading),{verticals:b}=re(),[h,u]=d.useState(!1),[g,o]=d.useState(!1),[c,x]=d.useState(()=>I(s));d.useEffect(()=>{n()},[n]);const m=d.useMemo(()=>I(s),[s]);d.useEffect(()=>{x(m)},[m]);const N=d.useMemo(()=>{const a=A(s,r);return T(a,b)},[s,r,b]),M=d.useMemo(()=>W(s,t==null?void 0:t.name),[s,t==null?void 0:t.name]),U=d.useMemo(()=>q(c,t==null?void 0:t.name),[c,t==null?void 0:t.name]),y=d.useMemo(()=>!H(c,m),[c,m]),$=()=>{x(m),o(!1),u(!0)},k=()=>{x(m),o(!1),u(!1)},L=()=>
1{if(y){o(!0);return}k()},z=()=>{x(m)},O=()=>{var a;(a=document.getElementById(E))==null||a.requestSubmit()},V=async a=>{const C=await p(a);return C?(S.success("Profile saved successfully."),u(!1)):S.error(f.getState().error??"Failed to save profile. Please try again."),C};return l?e.jsxs("section",{className:"Main-container mx-auto flex !h-auto min-h-0 w-full max-w-5xl flex-col overflow-visible !px-3 !pt-4 pb-8 md:w-[85%] lg:!px-12 lg:!pt-10",children:[e.jsxs("div",{className:"mb-4 flex items-start gap-3",children:[e.jsx("div",{className:"hidden h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[#f3f4f6] sm:flex",children:e.jsx(v,{className:"h-5 w-5 text-[#374151]","aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"main-font text-[15px] font-[800] text-black lg:text-[24px] lg:font-[1000]",children:h?"Update profile":"Influencer profile"}),e.jsx("p",{className:"para-font mt-0.5 text-[11px] text-[#9ca3af] sm:text-[12px]",children:h?"Edit details and save when done.":"Your creator profile for brands."})]})]}),e.jsxs("div",{className:"mb-6 min-w-0 w-full overflow-visible rounded-[22px] border border-[#e8eaed] bg-white shadow-[0_1px_3px_rgba(15,23,42,0.06)]",children:[h?e.jsxs("div",{className:"flex flex-col overflow-visible",children:[e.jsx(R,{displayName:U,categoryLabel:N,isVerified:s==null?void 0:s.isVerified,onBack:L}),e.jsx("div",{className:"border-t border-[#eff3f4] px-3 pb-20 pt-4 sm:px-6 sm:pb-6",children:e.jsx(Y,{formId:E,initialState:m,form:c,onFormChange:x,disabled:i,hideSubmit:!0,onSubmit:V})})]}):e.jsx(me,{influencer:s,profileInitial:m,categoryLabel:N,displayName:M,onEdit:$}),h?e.jsxs("div",{className:"sticky bottom-0 z-20 mx-0 mt-2 flex flex-col-reverse gap-2 border-t border-[#e8eaed] bg-white/95 px-3 py-3 backdrop-blur-sm sm:static sm:mx-6 sm:mb-5 sm:mt-2 sm:flex-row sm:items-center sm:justify-end sm:gap-3 sm:bg-transparent sm:px-0 sm:py-0 sm:pt-6 sm:backdrop-blur-none",children:[e.jsx("button",{type:"button",className:"min-h-[42px] rounded-full border border-[#c9c9c9] bg-white px-5 para-font text-[14px] font-[500] text-black transition-colors hover:bg-[#fafafa] disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-[40px] sm:font-[400]",onClick:L,disabled:i,children:"Cancel"}),e.jsx("button",{type:"button",className:"hidden min-h-[40px] rounded-full border border-[#c9c9c9] bg-white px-5 para-font text-[14px] font-[400] text-black transition-colors hover:bg-[#fafafa] disabled:cursor-not-allowed disabled:opacity-50 sm:inline-flex sm:items-center",onClick:z,disabled:i,children:"Reset"}),e.jsx("button",{type:"button",className:"min-h-[42px] rounded-full bg-black px-6 para-font text-[14px] font-[600] text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 sm:min-h-[40px] sm:bg-[#1f1f1f] sm:font-[400]",onClick:O,disabled:i||!y,children:i?"Savingâ¦":"Save changes"})]}):null]}),e.jsx(B,{isOpen:g,onClose:()=>o(!1),onDiscard:k,title:"Discard changes?",description:"You have unsaved profile changes. If you go back now, your edits will be lost.",confirmLabel:"Discard changes"})]}):e.jsxs("section",{className:"Main-container mx-auto flex !h-auto min-h-0 w-full max-w-5xl flex-col overflow-visible !px-3 !pt-4 md:w-[85%] lg:!px-12 lg:!pt-10",children:[e.jsxs("div",{className:"mb-5 flex items-start gap-3",children:[e.jsx("div",{className:"hidden h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[#f3f4f6] sm:flex",children:e.jsx(v,{className:"h-5 w-5 text-[#374151]","aria-hidden":!0})}),e.jsx("div",{children:e.jsx("h2",{className:"main-font text-[15px] font-[800] text-black lg:text-[24px] lg:font-[1000]",children:"Influencer profile"})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-16",children:[e.jsx(ae,{className:"h-8 w-8 animate-spin text-black","aria-hidden":!0}),e.jsx("p",{className:"para-font text-[14px] text-[#616161]",children:"Loading profileâ¦"})]})]})}export{ke as default};
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.