PageSourceSearch

https://cheeppy.com/assets/Studio-DqtpY5_l.js

js cheeppy.com collected 2026-09-25 20:27:15 UTC 16,812 bytes, 21 lines download raw bytes

1import{T as _,a3 as V,W as e,af as U,ag as F,ae as q,am as G,a6 as $,V as n,bo as W,ak as H,bc as M,aM as Q,a0 as z,ai as y,bp as X}from"./index-B3jPZcUH.js";import{u as Y}from"./usePageTitle-CZzhwc_L.js";import{S as Z}from"./Spinner-DCNyLZtW.js";import{T as I}from"./trash-2-Bl91BM6s.js";import{M as J}from"./MasonryGrid-CZ3IrMQr.js";import{C as K}from"./CoverVideoLoop-C10JTzvI.js";import{P as D}from"./plus-BXrSG1Fh.js";import{S as ee}from"./search-B0sYF4HZ.js";import{C as B}from"./chevron-down-Cx4FUH_U.js";import{P as te}from"./package-BY7x3DUb.js";import{E as se}from"./eye-CBVjUe-L.js";import{D as ae}from"./dollar-sign-BlNf_6yv.js";import{S as re}from"./star-BJDAo3fa.js";import{P as ie}from"./play-zcdjrcQf.js";/**
2 * @license lucide-react v0.303.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ne=_("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
7 * @license lucide-react v0.303.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const oe=_("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
12 * @license lucide-react v0.303.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const le=_("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
17 * @license lucide-react v0.303.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ce=_("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]),de=({isOpen:b,onClose:o,onConfirm:h,recipeName:c,isDeleting:d})=>{const{t:i}=V();return e.jsx(U,{children:b&&e.jsxs(e.Fragment,{children:[e.jsx(F.div,{initial:{opacity:0}
21,animate:{opacity:1},exit:{opacity:0},onClick:o,className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50"}),e.jsx(F.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-[#1a1b21] rounded-2xl shadow-2xl max-w-sm w-full p-6 relative",children:[e.jsx("button",{onClick:o,disabled:d,className:"absolute top-4 right-4 p-2 rounded-full hover:bg-slate-100 dark:hover:bg-white/10 transition-colors disabled:opacity-50",children:e.jsx(q,{className:"w-5 h-5 text-slate-400"})}),e.jsx("div",{className:"w-12 h-12 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center mb-4",children:e.jsx(I,{className:"w-6 h-6 text-red-600 dark:text-red-400"})}),e.jsx("h2",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:i("deleteRecipe.title")}),e.jsx("p",{className:"text-slate-500 dark:text-white/60 mb-6 text-sm",children:c?e.jsxs(e.Fragment,{children:[i("deleteRecipe.confirmNamed").split("{{name}}")[0],e.jsxs("span",{className:"font-medium text-slate-700 dark:text-white/80",children:['"',c,'"']}),i("deleteRecipe.confirmNamed").split("{{name}}")[1]]}):e.jsx(e.Fragment,{children:i("settings.deleteCannotUndone")})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:o,disabled:d,className:"flex-1 py-2.5 px-4 rounded-xl border border-slate-200 dark:border-white/10 text-slate-700 dark:text-white font-medium hover:bg-slate-50 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:i("common.cancel")}),e.jsx("button",{onClick:h,disabled:d,className:"flex-1 py-2.5 px-4 rounded-xl bg-red-600 hover:bg-red-700 text-white font-medium transition-colors flex items-center justify-center gap-2 disabled:opacity-50",children:d?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 animate-spin"}),i("common.loading")]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"w-4 h-4"}),i("common.delete")]})})]})]})})]})})},xe=.01,he=({src:b,alt:o,className:h,imageDimensions:c})=>{const[d,i]=n.useState(!1),[m,k]=n.useState(!1),p=n.useRef(null);n.useEffect(()=>{const t=new IntersectionObserver(([f])=>{f.isIntersecting&&(k(!0),t.disconnect())},{rootMargin:"100px"});return p.current&&t.observe(p.current),()=>t.disconnect()},[]);const l=c?c.height/c.width*100:133;return e.jsx("div",{ref:p,className:"relative w-full bg-mist/60 dark:bg-white/5",style:{paddingBottom:`${l}%`},children:m&&e.jsx("img",{src:b,alt:o,onLoad:()=>i(!0),className:`absolute inset-0 w-full h-full ${h} transition-opacity duration-300 ${d?"opacity-100":"opacity-0"}`})})},Pe=()=>{Y("Creator Studio");const b=$(),[o,h]=n.useState([]),[c,d]=n.useState(!0),[i,m]=n.useState(null),[k,p]=n.useState(null),[l,t]=n.useState(null),[f,w]=n.useState(""),[g,R]=n.useState("all"),[j,P]=n.useState("recent");n.useEffect(()=>{L()},[]),n.useEffect(()=>{const s=()=>m(null);return i&&document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[i]);const L=async()=>{try{const{data:s}=await W.getMyRecipes();h(s.recipes||[])}catch(s){H.warn("Fetch recipes failed:",s.message)}finally{d(!1)}},N=s=>{t(s),m(null)},S=async()=>{var a,r;if(!l)return;const s=l.id||l._id;p(s);try{await W.delete(s),h(u=>u.filter(x=>(x.id||x._id)!==s)),y.success("Style deleted"),t(null)}catch(u){y.error(((r=(a=u.response)==null?void 0:a.data)==null?void 0:r.error)||"Failed to delete")}finally{p(null)}},C=async(s,a)=>{const r=a==="active"?"paused":"active";try{await W.updateStatus(s,r),h(u=>u.map(x=>(x.id||x._id)===s?{...x,status:r}:x)),y.success(r==="active"?"Style is now live":"Style paused")}catch{y.error("Failed to update status")}finally{m(null)}},v=o.filter(s=>!(g!=="all"&&s.status!==g||f&&!s.title.toLowerCase().includes(f.toLowerCase()))).sort((s,a)=>{var r,u,x,E,T,A;switch(j){case"popular":return(((r=a.stats)==null?void 0:r.usageCount)||0)-(((u=s.stats)==null?void 0:u.usageCount)||0);case"revenue":return(((x=a.stats)==null?void 0:x.revenue)||0)-(((E=s.stats)==null?void 0:E.revenue)||0);case"rating":const O=((T=s.stats)==null?void 0:T.totalRatings)>0?s.stats.ratingSum/s.stats.totalRatings:0;return(((A=a.stats)==null?void 0:A.totalRatings)>0?a.stats.ratingSum/a.stats.totalRatings:0)-O;default:return new Date(a.createdAt)-new Date(s.createdAt)}});return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"font-serif text-[32px] leading-[1.05] tracking-[-0.02em] text-ink dark:text-white",children:"Creator Studio"}),e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.1em] text-ink/50 dark:text-white/50 mt-2",children:"Manage your styles"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(M,{to:"/studio/analytics",className:"flex items-center justify-center w-10 h-10 bg-card dark:bg-white/5 border border-line dark:border-white/10 rounded-[4px] text-ink/70 dark:text-white hover:border-sage/50 hover:text-sage-deep dark:hover:border-white/20 transition-colors",title:"Analytics & Earnings",children:e.jsx(Q,{className:"w-4 h-4",strokeWidth:1.6})}),e.jsxs(M,{to:"/studio/new",className:"flex items-center gap-2 whitespace-nowrap bg-sage hover:bg-sage-deep text-card px-4 py-2.5 rounded-[6px] font-mono text-[11px] uppercase tracking-[0.12em] transition-colors",children:[e.jsx(D,{className:"w-4 h-4",strokeWidth:1.8}),"New Style"]})]})]}),e.jsx("div",{children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ee,{className:"absolute left-3.5 to
21p-1/2 -translate-y-1/2 w-4 h-4 text-ink/40 dark:text-white/40",strokeWidth:1.6}),e.jsx("input",{type:"text",value:f,onChange:s=>w(s.target.value),placeholder:"Search your styles…",className:"w-full pl-10 pr-4 py-2.5 bg-card dark:bg-white/5 border border-line dark:border-white/10 rounded-[4px] text-[13.5px] text-ink dark:text-white placeholder:text-ink/40 focus:outline-none focus:border-sage focus:ring-2 focus:ring-sage/15 transition-colors"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:g,onChange:s=>R(s.target.value),className:"appearance-none pl-3 pr-8 py-2.5 bg-card dark:bg-white/5 border border-line dark:border-white/10 rounded-[4px] font-mono text-[11px] uppercase tracking-[0.08em] text-ink/70 dark:text-white/80 hover:border-ink/30 focus:outline-none focus:border-sage transition-colors cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"active",children:"Live"}),e.jsx("option",{value:"paused",children:"Paused"}),e.jsx("option",{value:"draft",children:"Drafts"}),e.jsx("option",{value:"pending",children:"Pending Review"}),e.jsx("option",{value:"rejected",children:"Rejected"})]}),e.jsx(B,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-ink/45 dark:text-white/45",strokeWidth:1.6})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:j,onChange:s=>P(s.target.value),className:"appearance-none pl-3 pr-8 py-2.5 bg-card dark:bg-white/5 border border-line dark:border-white/10 rounded-[4px] font-mono text-[11px] uppercase tracking-[0.08em] text-ink/70 dark:text-white/80 hover:border-ink/30 focus:outline-none focus:border-sage transition-colors cursor-pointer",children:[e.jsx("option",{value:"recent",children:"Most Recent"}),e.jsx("option",{value:"popular",children:"Most Popular"}),e.jsx("option",{value:"revenue",children:"Highest Revenue"}),e.jsx("option",{value:"rating",children:"Best Rated"})]}),e.jsx(B,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-ink/45 dark:text-white/45",strokeWidth:1.6})]})]})]}),v.length===0&&!c?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 px-6 text-center bg-card dark:bg-white/[0.03] border border-line dark:border-white/10 rounded-[6px]",children:[e.jsx("div",{className:"w-14 h-14 bg-sage-pill dark:bg-white/5 border border-line dark:border-white/10 rounded-[6px] flex items-center justify-center mb-5",children:e.jsx(z,{className:"w-[22px] h-[22px] text-sage-deep dark:text-white/60",strokeWidth:1.5})}),e.jsx("h3",{className:"font-serif text-[24px] leading-[1.1] tracking-[-0.02em] text-ink dark:text-white mb-2",children:o.length===0?"No styles yet":"No matching styles"}),e.jsx("p",{className:"text-[13.5px] leading-[1.55] text-ink/65 dark:text-white/60 max-w-[320px] mb-6",children:o.length===0?"Create your first style to start earning":"Try adjusting your filters"}),o.length===0&&e.jsxs(M,{to:"/studio/new",className:"inline-flex items-center gap-2 bg-sage hover:bg-sage-deep text-card px-6 py-2.5 rounded-[6px] font-mono text-[11px] uppercase tracking-[0.12em] transition-colors",children:[e.jsx(D,{className:"w-4 h-4",strokeWidth:1.8}),"Create Your First Style"]})]}):e.jsx(J,{getAspectRatio:s=>{const a=s.props.recipe;return a!=null&&a.cover_image_width&&(a!=null&&a.cover_image_height)?a.cover_image_height/a.cover_image_width:4/3},children:v.map((s,a)=>{const r=s.id||s._id;return e.jsx(pe,{recipe:s,index:a,menuOpen:i===r,onMenuToggle:()=>m(i===r?null:r),onEdit:()=>b(`/studio/edit/${r}`),onDelete:()=>N(s),onToggleStatus:()=>C(r,s.status),onAnalytics:()=>y("Analytics coming soon!"),deleting:k===r},r)})})]})}),e.jsx(de,{isOpen:!!l,onClose:()=>t(null),onConfirm:S,recipeName:l==null?void 0:l.title,isDeleting:!!k})]})},pe=({recipe:b,index:o,menuOpen:h,onMenuToggle:c,onEdit:d,onDelete:i,onToggleStatus:m,onAnalytics:k,deleting:p})=>{var N,S,C;const l=$(),t=b,f=t.id||t._id,w=t.cover_image||t.coverImage,g=t.product_slots||t.productSlots||[],R=t.cover_image_width&&t.cover_image_height?{width:t.cover_image_width,height:t.cover_image_height}:null,j=((N=t.stats)==null?void 0:N.totalRatings)>0?(t.stats.ratingSum/t.stats.totalRatings).toFixed(1):null,P=((S=t.stats)==null?void 0:S.usageCount)||0,L=((((C=t.stats)==null?void 0:C.revenue)||0)*xe).toFixed(2);return e.jsxs(F.div,{initial:{opacity:0}
21,animate:{opacity:1},transition:{delay:o*.02},className:"masonry-item group relative rounded-[6px] overflow-hidden bg-mist/60 dark:bg-white/5 cursor-pointer",onClick:()=>l(`/studio/edit/${f}`),children:[e.jsxs("div",{className:`relative ${t.status==="paused"||t.status==="rejected"?"opacity-50":""}`,children:[w?e.jsx(he,{src:X(w),alt:t.title,className:"object-cover group-hover:scale-105 transition-transform duration-500",imageDimensions:R}):e.jsx("div",{className:"aspect-[3/4] w-full flex items-center justify-center bg-sage-pill dark:bg-white/5",children:e.jsx(z,{className:"w-7 h-7 text-sage-deep/50 dark:text-white/30",strokeWidth:1.4})}),t.media_type==="video"&&t.cover_video&&w&&e.jsx(K,{src:t.cover_video}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/0 to-transparent"}),e.jsxs("div",{className:"absolute top-2 left-2 flex items-center gap-1.5",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-[3px] font-mono text-[10px] uppercase tracking-[0.1em] backdrop-blur-sm ${t.status==="active"?"bg-sage text-card":t.status==="paused"?"bg-orange-500/90 text-white":t.status==="pending"?"bg-amber-500/90 text-white":t.status==="rejected"?"bg-red-500/90 text-white":"bg-card/90 text-ink/70"}`,children:t.status==="active"?"Live":t.status==="paused"?"Paused":t.status==="pending"?"Pending":t.status==="rejected"?"Rejected":t.status}),(g==null?void 0:g.length)>1&&e.jsxs("span",{className:"px-2 py-0.5 bg-ink/55 backdrop-blur-sm text-paper font-mono text-[10px] uppercase tracking-[0.1em] rounded-[3px] flex items-center gap-1",children:[e.jsx(te,{className:"w-3 h-3",strokeWidth:1.6}),g.length]})]}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-2.5",children:[e.jsx("p",{className:"text-white text-xs font-medium truncate",children:t.title}),e.jsxs("div",{className:"flex items-center gap-3 text-white/90 text-[11px] mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(se,{className:"w-3 h-3"}),P]}),e.jsxs("span",{className:"flex items-center gap-1 text-white/90",children:[e.jsx(ae,{className:"w-3 h-3"}),L]}),j&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3 text-white/70"}),j]})]})]})]}),e.jsxs("div",{className:"absolute top-2.5 right-2.5",children:[e.jsx("button",{onClick:v=>{v.stopPropagation(),c()},className:"p-1.5 bg-card/90 dark:bg-ink/60 backdrop-blur-sm border border-line dark:border-white/10 rounded-[4px] opacity-0 group-hover:opacity-100 hover:bg-card dark:hover:bg-ink/80 transition-all",children:e.jsx(oe,{className:"w-4 h-4 text-ink dark:text-white",strokeWidth:1.6})}),h&&e.jsxs("div",{className:"absolute top-full right-0 mt-1.5 w-44 bg-card dark:bg-[#1a1b21] rounded-[6px] border border-line dark:border-white/10 shadow-[0_16px_40px_-16px_rgba(26,26,23,0.22)] z-10 overflow-hidden py-1",onClick:v=>v.stopPropagation(),children:[e.jsxs("button",{onClick:d,className:"w-full flex items-center gap-2.5 px-3 py-2 hover:bg-sidebar dark:hover:bg-white/5 text-[12.5px] text-ink/80 dark:text-white/80 hover:text-ink dark:hover:text-white transition-colors",children:[e.jsx(ce,{className:"w-3.5 h-3.5",strokeWidth:1.6})," Edit"]}),(t.status==="active"||t.status==="paused")&&e.jsx("button",{onClick:m,className:"w-full flex items-center gap-2.5 px-3 py-2 hover:bg-sidebar dark:hover:bg-white/5 text-[12.5px] text-ink/80 dark:text-white/80 hover:text-ink dark:hover:text-white transition-colors",children:t.status==="active"?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-3.5 h-3.5",strokeWidth:1.6})," Pause"]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-3.5 h-3.5",strokeWidth:1.6})," Go Live"]})}),e.jsxs("button",{onClick:k,className:"w-full flex items-center gap-2.5 px-3 py-2 hover:bg-sidebar dark:hover:bg-white/5 text-[12.5px] text-ink/80 dark:text-white/80 hover:text-ink dark:hover:text-white transition-colors",children:[e.jsx(ne,{className:"w-3.5 h-3.5",strokeWidth:1.6})," Analytics"]}),e.jsx("div",{className:"border-t border-line dark:border-white/10 my-1"}),e.jsxs("button",{onClick:i,disabled:p,className:"w-full flex items-center gap-2.5 px-3 py-2 hover:bg-red-50 dark:hover:bg-red-500/10 text-[12.5px] text-red-600 dark:text-red-400 transition-colors",children:[p?e.jsx(Z,{size:"xs"}):e.jsx(I,{className:"w-3.5 h-3.5",strokeWidth:1.6})," Delete"]})]})]})]})};export{Pe 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.