PageSourceSearch

https://app.genwrite.co/assets/PublicBlogReader-UZzboupk.js

js genwrite.co collected 2026-10-04 17:12:19 UTC 16,802 bytes, 1 lines download raw bytes

1import{o as I}from"./rolldown-runtime-YEGeZWSl.js";import{d as M,u as W}from"./vendor-v2_4x8_I.js";import{O as E,y as R}from"./tiptap-DtyGFwt0.js";import{d as z,f as L}from"./utils-Cuy-9wux.js";import{d as P}from"./typedClient-CTpabYmL.js";import{a as U,o as F,t as K}from"./TipTapEditor-BNHcMumz.js";import{t as Q}from"./chevron-right-CUPLUJjL.js";import{t as A}from"./file-text-rEv9ponK.js";import{t as O}from"./share-2-oxUymAox.js";import{t as V}from"./sparkles-77hk2Xu7.js";import{t as H}from"./trending-up-DimBCyBo.js";import{U as J,_ as Y,l as B,v as D}from"./index-ChXLzLUx.js";import{a as X,t as Z}from"./useAuthStore-CfHIzgH8.js";import{t as ee}from"./Blog.query-DeqtNZEv.js";var c=I(E(),1),e=R();L();var ge=()=>{var h,g,b,v,f,j;const{id:i}=M(),n=W(),_=J(),{user:a,token:x,loadAuthenticatedUser:T}=Z(),{selectedBlog:s,setSelectedBlog:S}=X(),[N,w]=(0,c.useState)(!x),{data:m,isLoading:G,isError:C,error:u}=P({queryKey:["blog",i,"public"],queryFn:()=>ee.getPublicly(i!=null?i:""),enabled:!!i,retry:!1}),l=(t=>{var o;if(!t)return{name:"GenWrite Author",avatar:null};const r=t.author||t.user||t.createdBy||{};return{name:r.name||r.displayName||t.authorName||"GenWrite Author",avatar:r.avatar||r.photoURL||r.image||t.authorAvatar||null,id:r._id||r.id||t.authorId||t.userId||((o=t.createdBy)===null||o===void 0?void 0:o._id)||null}})(s);(0,c.useEffect)(()=>{let t=!0;return(function(){var o=z(function*(){if(!x){t&&w(!0);return}if(a!=null&&a._id){t&&w(!0);return}try{yield T()}catch(r){}finally{t&&w(!0)}});return function(){return o.apply(this,arguments)}})()(),()=>{t=!1}},[T,x,a==null?void 0:a._id]);const $=(s==null?void 0:s._id)===i;(0,c.useEffect)(()=>{if(m){S(m);const t=l.id;N&&(a!=null&&a._id)&&t&&a._id===t&&(_.setQueryData(["blog",i],m),n(`/editor/${i}`,{replace:!0}))}},[m,N,i,n,_,S,a==null?void 0:a._id,l.id]),(0,c.useEffect)(()=>{if(C){var t;const o=((u==null||(t=u.response)===null||t===void 0?void 0:t.status)||404)===403?"Access Restricted: This blog is not public.":"Blog Not Available: The requested blog doesn't exist or has been deleted.";B.error(o),n("/login",{replace:!0})}},[C,u,n]),(0,c.useEffect)(()=>{window.scrollTo(0,0)},[]);const q=t=>t?new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";if(G||x&&!N||!$||(s==null?void 0:s.status)==="pending")return(0,e.jsx)("div",{className:"fixed inset-0 z-999 flex items-center justify-center bg-white/90 backdrop-blur-sm",children:(0,e.jsx)(D,{})});const y=(s==null?void 0:s.content)||"",k=(s==null?void 0:s.title)||"",d=(s==null?void 0:s.keywords)||[],p=(s==null?void 0:s.focusKeywords)||[];return(0,e.jsxs)("div",{className:"min-h-screen bg-slate-50/30 selection:bg-indigo-100 selection:text-indigo-900",children:[(0,e.jsxs)(Y,{children:[(0,e.jsxs)("title",{children:[k||"Blog"," | GenWrite"]}),(0,e.jsx)("meta",{name:"description",content:(s==null||(h=s.seoMetadata)===null||h===void 0?void 0:h.description)||(s==null?void 0:s.summary)||""}),(0,e.jsx)("meta",{property:"og:title",content:`${k} | GenWrite`}),(0,e.jsx)("meta",{property:"og:description",content:(s==null||(g=s.seoMetadata)===null||g===void 0?void 0:g.description)||(s==null?void 0:s.summary)||""}),(0,e.jsx)("meta",{property:"og:type",content:"article"})]}),!(a!=null&&a._id)&&(0,e.jsxs)("nav",{className:"fixed top-0 w-full z-100 bg-white/70 backdrop-blur-xl border-b border-slate-100 h-16 sm:h-20 flex items-center justify-between px-4 md:px-12 transition-all",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>n("/"),"aria-label":"GenWrite home",className:"flex items-center gap-2 cursor-pointer group",children:[(0,e.jsx)("img",{src:"/Images/genwriteIcon.webp",alt:"GenWrite",className:"w-8 h-8 object-contain"}),(0,e.jsxs)("span",{className:"font-black text-xl sm:text-2xl tracking-tighter text-slate-900",children:["Gen",(0,e.jsx)("span",{className:"text-blue-600",children:"Write"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3 sm:gap-6",children:[(0,e.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(window.location.href),B.success("Link copied to clipboard!")},className:"p-2.5 hover:bg-slate-100 rounded-md transition-colors group border border-transparent hover:border-slate-200",title:"Share Link",children:(0,e.jsx)(O,{className:"w-5 h-5 text-slate-500 group-hover:text-blue-600"})}),(0,e.jsx)("div",{className:"h-6 w-px bg-slate-200 hidden sm:block"}),(0,e.jsx)("button",{type:"button",onClick:()=>n("/signup"),className:"px-5 sm:px-7 py-2.5 bg-slate-900 text-white font-bold rounded-md text-sm hover:bg-slate-800 transition-all hover:shadow-xl hover:shadow-slate-200 active:scale-95",children:"Get Started"})]})]}),(0,e.jsxs)("div",{className:`max-w-7xl mx-auto px-4 pb-20 ${a!=null&&a._id?"pt-10":"pt-32"}`,children:[(0,e.jsxs)("div",{className:"flex flex-col lg:flex-row gap-12",children:[(0,e.jsx)("main",{className:"flex-1 min-w-0",children:(0,e.jsxs)("article",{className:"max-w-3xl",children:[(0,e.jsxs)("header",{className:"mb-12 space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-black text-slate-900 leading-[1.05] tracking-tight text-pretty wrap-break-words",children:k}),(s==null?void 0:s.summary)&&(0,e.jsx)("p",{className:"text-base sm:text-lg text-slate-500 font-medium leading-relaxed max-w-3xl italic",children:s.summary})]}),(0,e.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 py-8 border-y border-slate-100",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4 shrink-0",children:[(0,e.jsx)("div",{className:"w-12 h-12 rounded-full overflow-hidden border border-slate-100 shrink-0 bg-slate-50 shadow-xs ring-2 ring-white",children:l!=null&&l.avatar?(0,e.jsx)("img",{src:l.avatar,alt:l.name,className:"w-full h-full object-cover"}):(0,e.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-100 text-slate-400",children:(0,e.jsx)(A,{size:20})})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"text-base font-black text-slate-900 tracking-tight leading-none mb-1.5",children:l==null?void 0:l.name}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest leading-none",children:"Article Author"})]})]}),(0,e.jsx)("div",{className:"hidden sm:block h-8 w-px bg-slate-100 mx-2"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest leading-none mb-1.5",children:"Published"}),(0,e.jsx)("span",{className:"text-sm font-bold text-slate-700",children:q(s==null?void 0:s.createdAt)})]}),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest leading-none mb-1.5",children:"Read Time"}),(0,e.jsxs)("span",{className:"text-sm font-bold text-slate-700",children:[U(y)," min"]})]}),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest leading-none mb-1.5",children:"Word Count"}),(0,e.jsxs)("span",{className:"text-sm font-bold text-slate-700",children:[F(y).toLocaleStr
1ing()," words"]})]})]})]})]}),(0,e.jsxs)("div",{className:a!=null&&a._id?"":"relative mb-30",children:[(0,e.jsx)("div",{className:`prose prose-lg sm:prose-xl prose-slate max-w-none prose-headings:font-black prose-headings:tracking-tight prose-a:text-blue-600 prose-img:rounded-md prose-img:shadow-none prose-blockquote:border-l-blue-600 prose-blockquote:bg-blue-50/30 prose-blockquote:py-2 prose-blockquote:px-8 prose-blockquote:rounded-md ${a!=null&&a._id?"":"select-none pointer-events-none"}`,children:(0,e.jsx)(K,{blog:s,content:y,setContent:()=>{},setUnsavedChanges:()=>{},isPublicMode:!0})}),!(a!=null&&a._id)&&(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{className:"space-y-6 blur-[10px] opacity-20 select-none pointer-events-none pt-4",children:[(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-full"}),(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-[94%]"}),(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-[98%]"}),(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-[91%]"}),(0,e.jsx)("div",{className:"h-8 bg-slate-400 rounded-lg w-[40%] mt-8 mb-4"}),(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-full"}),(0,e.jsx)("div",{className:"h-4 bg-slate-300 rounded-full w-[96%]"})]}),(0,e.jsx)("div",{className:"absolute inset-0 z-20 flex items-start justify-center",children:(0,e.jsxs)("div",{className:"bg-white/95 backdrop-blur-3xl border border-slate-200 p-8 md:p-10 rounded-[2.5rem] shadow-[0_40px_80px_-15px_rgba(0,0,0,0.15)] text-center max-w-lg mx-4 group transition-all duration-500 hover:shadow-[0_48px_96px_-12px_rgba(0,0,0,0.2)]",children:[(0,e.jsx)("h3",{className:"text-3xl font-black text-slate-900 mb-4 tracking-tight",children:"Continue Reading Full Blog"}),(0,e.jsx)("p",{className:"text-slate-500 mb-10 leading-relaxed text-base",children:"This article preview is limited. Join GenWrite now to unlock the complete article, detailed SEO insights, and high-resolution images."}),(0,e.jsxs)("button",{type:"button",onClick:()=>n("/signup"),className:"w-full py-4 bg-slate-900 text-white font-black rounded-2xl hover:bg-black transition-all shadow-xl shadow-slate-200 hover:shadow-2xl active:scale-[0.98] flex items-center justify-center gap-3 group/btn text-lg",children:["Sign Up to Read Full Blog",(0,e.jsx)(Q,{className:"w-5 h-5 group-hover/btn:translate-x-1.5 transition-transform"})]})]})})]})]}),(p.length>0||d.length>0)&&(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"w-8 h-px bg-slate-200"}),(0,e.jsx)("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em]",children:"Article Context"}),(0,e.jsx)("div",{className:"flex-1 h-px bg-slate-200"})]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p.map(t=>(0,e.jsxs)("span",{className:"px-4 py-2 bg-blue-600 text-white border border-blue-700 text-sm font-black rounded-md shadow-sm cursor-default",children:["#",t]},`focus-${t}`)),d.map(t=>(0,e.jsxs)("span",{className:"px-4 py-2 bg-slate-100 text-slate-600 border border-slate-200 text-sm font-bold rounded-md hover:bg-slate-200 transition-colors cursor-default",children:["#",t]},`keyword-${t}`))]})]})]})}),(0,e.jsx)("aside",{className:"lg:w-96 shrink-0 h-fit lg:sticky lg:top-32 space-y-6",children:(0,e.jsxs)("div",{className:"bg-white border border-slate-100 overflow-hidden p-8 space-y-10",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2.5 bg-blue-600 shadow-none border border-blue-700 rounded-md",children:(0,e.jsx)(H,{className:"w-4 h-4 text-white"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-xl font-bold text-slate-900 tracking-tight",children:"Technical Data"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:"Optimized Profile"})]})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("div",{className:"flex items-center justify-between",children:(0,e.jsx)("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest leading-none",children:"Slug"})}),(0,e.jsxs)("div",{className:"p-5 bg-slate-50/50 rounded-md border border-slate-100 group transition-all",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,e.jsx)("div",{className:"w-4 h-4 bg-white border border-slate-200 rounded-md flex items-center justify-center p-0.5",children:(0,e.jsx)("img",{src:"/Images/genwriteIcon.webp",alt:"",className:"w-full h-full object-contain"})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-400 truncate",children:"genwrite.ai › article"})]}),(0,e.jsx)("p",{className:"text-sm font-bold text-blue-600 break-all leading-relaxed line-clamp-2 hover:underline cursor-pointer",children:(s==null?void 0:s.slug)||"when-a-song-goes-viral-breaking-down-its-hidden-success-story"}),(0,e.jsx)("p",{className:"text-[11px] text-slate-500 mt-2 line-clamp-2",children:"Exploring the deep mechanics behind viral song success and distribution strategies..."})]})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{className:"p-5 bg-linear-to-br from-slate-50 to-white border border-slate-100 rounded-md space-y-2 group transition-all relative overflow-hidden",children:[(0,e.jsx)(A,{className:"w-4 h-4 text-slate-400 group-hover:text-blue-500 transition-colors"}),(0,e.jsx)("img",{src:"/images/genwriteIcon.webp",alt:"",className:"absolute -right-2 -bottom-2 w-10 h-10 opacity-[0.03] group-hover:opacity-[0.08] transition-opacity"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-0.5",children:"Template"}),(0,e.jsx)("p",{className:"text-sm font-black text-slate-900 capitalize tracking-tight",children:(s==null?void 0:s.template)||"Case Study"})]})]}),(0,e.jsxs)("div",{className:"p-5 bg-linear-to-br from-slate-50 to-white border border-slate-100 rounded-md space-y-2 group transition-all relative overflow-hidden",children:[(0,e.jsx)(V,{className:"w-4 h-4 text-slate-400 group-hover:text-indigo-500 transition-colors"}),(0,e.jsx)("img",{src:"/Images/genwriteIcon.webp",alt:"",className:"absolute -right-2 -bottom-2 w-10 h-10 opacity-[0.03] group-hover:opacity-[0.08] transition-opacity"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-0.5",children:"Category"}),(0,e.jsx)("p",{className:"text-sm font-black text-slate-900 capitalize tracking-tight",children:(s==null?void 0:s.category)||"Music Marketing"})]})]})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Metadata Tags"}),(0,e.jsxs)("span",{className:"text-[10px] font-bold text-slate-300",children:[(s==null||(b=s.tags)===null||b===void 0?void 0:b.length)||10," Tags"]})]}),(0,e.jsx)("div",{className:"flex flex-wrap gap-x-2 gap-y-3",children:(((v=s==null||(f=s.tags)===null||f===void 0?void 0:f.length)!==null&&v!==void 0?v:0)>0?(j=s==null?void 0:s.tags)!==null&&j!==void 0?j:[]:["viral music","music marketing strategy","song success factors","music trend anal
1ysis","artist breakout story","sonic meme","conversion gap","music industry analysis","hit song case study","algorithm trap"]).map(t=>(0,e.jsxs)("span",{className:"px-3.5 py-1.5 bg-white text-slate-600 text-[11px] font-bold border border-slate-100 rounded-md hover:border-blue-200 transition-all cursor-default",children:["#",t.replace(/\s+/g,"")]},t))})]}),(0,e.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded"}),(0,e.jsx)("span",{className:"text-[10px] font-black text-slate-900 uppercase tracking-widest",children:"Primary focus"})]}),(0,e.jsx)("div",{className:"flex flex-col gap-2",children:(p.length>0?p:d.slice(0,3)).map(t=>(0,e.jsxs)("div",{className:"group relative flex items-center gap-3 p-3 bg-blue-600 text-white border border-blue-700 rounded-md shadow-lg shadow-blue-100/50",children:[(0,e.jsx)("div",{className:"w-1.5 h-1.5 bg-white rounded animate-pulse"}),(0,e.jsx)("span",{className:"text-[11px] font-black uppercase tracking-tight",children:t})]},t))})]}),d.length>0&&(0,e.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"w-1.5 h-1.5 bg-slate-400 rounded"}),(0,e.jsx)("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:"Secondary Keywords"})]}),(0,e.jsx)("div",{className:"flex flex-col gap-2",children:d.map(t=>(0,e.jsxs)("div",{className:"group relative flex items-center gap-3 p-3 bg-slate-50 border border-slate-100 rounded-md hover:border-blue-200 transition-all duration-300",children:[(0,e.jsx)("div",{className:"w-1.5 h-1.5 bg-slate-300 group-hover:bg-blue-600 transition-colors rounded"}),(0,e.jsx)("span",{className:"text-[11px] font-bold text-slate-600 group-hover:text-blue-900 transition-colors tracking-tight",children:t})]},t))})]})]})})]}),!(a!=null&&a._id)&&(0,e.jsxs)("div",{className:"mt-20 text-center text-slate-400 text-[10px] font-black uppercase tracking-[0.2em] pb-20",children:["© ",new Date().getFullYear()," GenWrite Intelligence. All rights reserved."]})]})]})};export{ge 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.