PageSourceSearch

https://snapto.link/build/assets/DesignCompact-S8Cxt-TV.js

js snapto.link collected 2026-09-24 09:54:21 UTC 8,020 bytes, 1 lines download raw bytes

1import{j as e,a as M,K as Q,r as d,m as K,$ as S,S as k}from"./app-DDm4dLCY.js";import{I as _}from"./input-error-Wh-X1cuu.js";import{D as V}from"./DefaultAvatar-Be0CD7yV.js";import{B as o}from"./button-D9X3vUxO.js";import{C as Y,d as q}from"./card-DifmMaC0.js";import{D as T,a as P,b as L,c as E,e as D}from"./dialog-CEzzDisZ.js";import{I as J,a as W}from"./input-group-D1JyTM92.js";import{L as z}from"./label-ByReZhaM.js";import{S as c}from"./separator-Bv-q5VPM.js";import{S as X}from"./switch-BT-Lzq3Z.js";import Z from"./ChangeAvatar-CCgaak9t.js";import{L as ee}from"./lock-BXAuzEcX.js";/* empty css            */import"./x-CHtAT9W1.js";import"./index-Cdxa91Ef.js";import"./input-BjisokTd.js";import"./index-AnRJGDGt.js";import"./dropdown-menu-BJ85x3F3.js";import"./index-BT5q4viw.js";function re({className:s,...n}){return e.jsx("textarea",{"data-slot":"textarea",className:M("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",s),...n})}function Ne({profile:s,templates:n,flat:x=!1,onUpdated:g}){const l=Q(),a=d.useRef(null),t=K({_method:"PUT",id:s.id,title:s.title,bio:s.bio}),[$,h]=d.useState(s.hide_logo),[R,m]=d.useState(!1),[U,u]=d.useState(!1),B=l.props.auth.user.features.allow_remove_snapto_logo,f=l.props.auth.user.features.allow_premium_templates,j=l.props.auth.user.features.allow_custom_design_options,F=`${l.props.app.url}/${s.url}`,v=n.find(r=>r.id===s.template_id),i=()=>{g&&g()},I=r=>{t.setError(r)},A=()=>{t.clearErrors(),t.delete(route("profile.avatar.remove",{profile:t.data.id}),{preserveScroll:!0,onSuccess:()=>{i()},onError:()=>{}})},b=()=>{t.post(route("profile.update",{profile:t.data.id}),{preserveScroll:!0,onSuccess:()=>{i()},onError:()=>{}})},H=(r,p,C)=>{if(C=="Premium"&&!f||C=="Custom"&&!j){const O=r.currentTarget;return u(!0),setTimeout(()=>{a.current&&a.current.focus()},150),O.blur(),!1}k.post(route("profile.update.template",{profile:s.id}),{_method:"PUT",id:s.id,template_id:p},{preserveScroll:!0,onSuccess:()=>{i()},onError:()=>{}})},G=r=>{if(h(r),!B)return m(!0),setTimeout(()=>{a.current&&a.current.focus(),h(!1)},150),!1;k.post(route("profile.update",{profile:s.id}),{_method:"PUT",id:s.id,hide_logo:r},{preserveScroll:!0,onSuccess:()=>{i()},onError:()=>{}})},N=e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.avatar?e.jsx("img",{className:"size-12 rounded-full object-cover object-center",src:s.avatar,alt:""}):e.jsx(V,{className:"size-12 rounded-full"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{profile:s,onUpdated:i,onError:I,children:"Change"}),e.jsx(o,{type:"button",variant:"ghost",size:"sm",onClick:A,children:"Remove"})]}),e.jsx(_,{message:t.errors.avatar})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"flex-1",children:e.jsx(W,{id:"title",placeholder:s.name,"aria-label":"Title","aria-invalid":t.errors.title?!0:void 0,onBlur:b,value:t.data.title??"",onChange:r=>t.setData("title",r.target.value)})}),!s.verified&&e.jsx(o,{asChild:!0,variant:"outline",size:"sm",children:e.jsx("a",{href:`https://twitter.com/intent/tweet?text=Hey @snaptolink 👋 Please verify my profile and add my verified badge - ${F}&hashtags=linkinbio,snaptoverified`,target:"_blank",children:"Get Verified"})})]}),e.jsx(_,{message:t.errors.title}),e.jsx(re,{id:"bio",rows:2,maxLength:100,placeholder:"Bio","aria-label":"Bio",className:"resize-none",onBlur:b,value:t.data.bio??"",onChange:r=>t.setData("bio",r.target.value)})]}),y=e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-baseline justify-between",children:[!x&&e.jsx(z,{children:"Template"}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:v?v.name:""})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2 sm:grid-cols-5 lg:grid-cols-6",children:n.map(r=>e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:p=>H(p,r.id,r.type),className:`${s.template_id===r.id?"ring-primary ring-2 ring-offset-2":""} ${r.type==="Custom"?"border-border border border-dashed":""} focus:ring-ring relative block w-full overflow-hidden rounded-lg bg-cover bg-center transition-shadow focus:ring-2 focus:ring-offset-2 focus:outline-none`,children:[(r.type==="Premium"&&!f||r.type==="Custom"&&!j)&&e.jsx("div",{className:"absolute inset-0 z-10 bg-white/75 p-1 text-left",children:e.jsx(ee,{className:"bg-primary text-primary-foreground size-4 rounded p-0.5"})}),r.type==="Custom"&&e.jsx("div",{className:"absolute inset-0 z-0 flex items-center justify-center p-1",children:e.jsx("span",{className:"text-foreground text-xs font-medium",children:"Create Yours"})}),e.jsx("img",{src:r.screenshot,alt:r.name,className:"w-full"}),r.type!=="Custom"&&e.jsx("div",{className:"absolute inset-0 rounded-lg border border-black/10"})]}),e.jsx("p",{className:"text-muted-foreground mt-1 block truncate text-center text-[11px]",children:r.name})]},r.id))})]}),w=e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(z,{htmlFor:"remove-snapto-logo",children:"Remove Snapto Logo"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Hide the Snapto badge on your public page."})]}),e.jsx(X,{id:"remove-snapto-logo",checked:!!$,onCheckedChange:G})]});return e.jsxs(e.Fragment,{children:[x?e.jsxs("div",{children:[e.jsxs("div",{className:"gap-6 md:grid md:grid-cols-[140px_1fr]",children:[e.jsx("h3",{className:"text-foreground text-sm font-medium",children:"Profile"}),e.jsx("div",{className:"mt-3 md:mt-0",children:N})]}),e.jsx(c,{className:"my-6"}),e.jsxs("div",{className:"gap-6 md:grid md:grid-cols-[140px_1fr]",children:[e.jsx("h3",{className:"text-foreground text-sm font-medium",children:"Template"}),e.jsx("div",{className:"mt-3 min-w-0 md:mt-0",children:y})]}),e.jsx(c,{className:"my-6"}),e.jsxs("div",{className:"gap-6 md:grid md:grid-cols-[140px_1fr]",children:[e.jsx("h3",{className:"text-foreground text-sm font-medium",children:"Snapto logo"}),e.jsx("div",{className:"mt-3 md:mt-0",children:w})]})]}):e.jsx(Y,{children:e.jsxs(q,{children:[N,e.jsx(c,{className:"my-6"}),y,e.jsx(c,{className:"my-6"}),w]})}),e.jsx(T,{open:U,onOpenChange:r=>!r&&u(!1),children:e.jsxs(P,{className:"sm:max-w-md",children:[e.jsx("img",{src:"/img/pro-feature-header.png",alt:"",className:"-mx-4 -mt-4 w-[calc(100%+2rem)] max-w-none rounded-t-xl"}),e.jsx(L,{children:e.jsx(E,{className:"text-center leading-normal font-medium",children:"The Snapto Free Plan allows you to select Free templates only. Upgrade to the Snapto Pro Plan for only $5 per month to unlock Premium templates and much more!"})}),e.jsxs(D,{className:"flex-col sm:flex-col",children:[e.jsx(o,{asChild:!0,children:e.jsx(S,{ref:a,href:route("subscription.upgrade"),children:"Lets Upgrade!"})}),e.jsx(o,{variant:"ghost",onClick:()=>u(!1),children:"Maybe later"})]})]})}),e.jsx(T,{open:R,onOpenChange:r=>!r&&m(!1),children:e.jsxs(P,{className:"sm:max-w-md",children:[e.jsx("img",{src:"/img/pro-feature-header.png",alt:"",className:"-mx-4 -mt-4 w-[calc(100%+2rem)] max-w-none rounded-t-xl"}),e.jsx(L,{children:e.jsx(E,{className:"text-center leading-normal font-medium",children:"The Snapto Free Plan does not allow you to remove the logo. Upgrade to the Snapto Pro Plan for only $5 per month to unlock this feature and much more!"})}),e.jsxs(D,{className:"flex-col sm:flex-col",children:[e.jsx(o,{asChild:!0,children:e.jsx(S,{ref:a,href:route("subscription.upgrade"),children:"Lets Upgrade!"})}),e.jsx(o,{variant:"ghost",onClick:()=>m(!1),children:"Maybe later"})]})]})})]})}export{Ne 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.