1import{j as t}from"./query-Ck99ITfZ.js";import{r as l,f as L,L as x}from"./vendor-BonDNu1N.js";import{c as S,N as q,Q as I,L as A}from"./index-CgVZ0MTT.js";import{B as P}from"./badge-tcy30Ic9.js";import{p as O,f as B}from"./cmsHtml-BXELxiaz.js";import{P as f}from"./PlatformLayout-BYP2rLw_.js";import{u as M}from"./usePageMeta-DcEeGcyb.js";import{u as T}from"./useJsonLd-GorKfr83.js";import{A as b}from"./arrow-left-BuT7jyHl.js";import"./supabase-MEHSyf2E.js";import"./motion-BvWTr0fu.js";import"./utobo-logo-JTs7vTJO.js";import"./phone-DtheAH-L.js";import"./map-pin-DtKWeuxo.js";import"./dialog-BAptZVfJ.js";/** 2 * @license lucide-react v0.462.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 $=S("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);function y(r,e,o,n){let a=document.head.querySelector(r);a||(a=e(),document.head.appendChild(a)),a.setAttribute(o,n)}function C({title:r,description:e,canonical:o,ogImage:n="https://utobo.com/og-cover.png",schema:a}){const m=" â utobo",g=/utobo/i.test(r)?r:r.length+m.length<=60?`${r}${m}`:r;return M(g,e),l.useEffect(()=>{for(const[i,c]of[["property","og:image"],["name","twitter:image"]])y(`meta[${i}="${c}"]`,()=>{const d=document.createElement("meta");return d.setAttribute(i,c),d},"content",n);o&&(y('link[rel="canonical"]',()=>{const i=document.createElement("link");return i.setAttribute("rel","canonical"),i},"href",o),y('meta[property="og:url"]',()=>{const i=document.createElement("meta");return i.setAttribute("property","og:url"),i},"content",o))},[n,o]),T("page",a??null),null}const j=r=>r?r.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim():"";function D(r,e=155){if(r.length<=e)return r;const o=r.slice(0,e),n=Math.max(o.lastIndexOf(". "),o.lastIndexOf("! "),o.lastIndexOf("? "));if(n>=e/2)return o.slice(0,n+1);const a=o.lastIndexOf(" ");return(a>0?o.slice(0,a):o).replace(/[,;:\-ââ]+$/,"")+"â¦"}function F(r){if(!r)return 1;const e=j(r).split(/\s+/).filter(Boolean).length;return Math.max(1,Math.round(e/200))}function re(){const{slug:r}=L(),[e,o]=l.useState(null),[n,a]=l.useState(!0),[m,g]=l.useState(!1);l.useEffect(()=>{r&&q.from("blogs").select("*").eq("slug",r).not("published_at","is",null).lte("published_at",new Date().toISOString()).maybeSingle().then(({data:s})=>{s?o(s):g(!0),a(!1)})},[r]),I(!n&&(m||!e)),l.useEffect(()=>{if(n)return;const s=setTimeout(()=>document.dispatchEvent(new Event("custom-render-trigger")),100);return()=>clearTimeout(s)},[n]);const i=s=>s?new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";if(n)return t.jsx(f,{children:t.jsx("div",{className:"flex min-h-[40vh] items-center justify-center",children:t.jsx(A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})});if(m||!e)return t.jsx(f,{children:t.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-24 text-center",children:[t.jsx("h1",{className:"text-4xl font-bold",children:"Post not found"}),t.jsx("p",{className:"mt-3 text-muted-foreground",children:"This post may have been removed or the URL is incorrect."}),t.jsxs(x,{to:"/blog",className:"mt-6 inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[t.jsx(b,{className:"h-4 w-4"})," Back to blog"]})]})});const c=F(e.content),d=e.meta_title||e.title,k=e.meta_description||D(j(e.short_intro)),u=e.og_image||e.image_url||void 0,N=`https://utobo.com/blog/${e.slug}`,h=u?u.startsWith("http")?u:`https://utobo.com${u}`:void 0,v={"@context":"https://schema.org","@type":"BlogPosting",headline:e.title,...h?{image:[h]}:{},datePublished:e.published_at??void 0,dateModified:e.updated_at??e.published_at??void 0,mainEntityOfPage:N,author:[{"@type":"Organization",name:"utobo",url:"https://utobo.com/"}],publisher:{"@type":"Organization",name:"utobo",logo:{"@type":"ImageObject",url:"https://utobo.com/utobo-logo.png"}}},w={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Blog",item:"https://utobo.com/blog"},{"@type":"ListItem",position:2,name:e.title}]},p=Array.isArray(e.faqs)?e.faqs.filter(s=>s&&s.q&&s.a):[],_=p.length>0?{"@context":"https://schema.org","@type":"FAQPage",mainEntity:p.map(s=>
6({"@type":"Question",name:s.q,acceptedAnswer:{"@type":"Answer",text:s.a}}))}:null;return t.jsxs(f,{children:[t.jsx(C,{title:d,description:k,canonical:N,ogImage:h,schema:_?[v,w,_]:[v,w]}),t.jsxs("article",{className:"mx-auto max-w-3xl overflow-x-hidden px-4 pb-20 pt-24 md:px-6",children:[t.jsxs(x,{to:"/blog",className:"mb-8 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(b,{className:"h-4 w-4"})," All posts"]}),t.jsxs("header",{className:"mb-8",children:[e.tag&&t.jsx(P,{variant:"outline",className:"mb-4 text-xs",style:e.tag_color?{color:e.tag_color,borderColor:e.tag_color}:void 0,children:e.tag}),t.jsx("h1",{className:"text-3xl font-bold tracking-tight leading-tight md:text-5xl text-heading",children:e.title}),e.short_intro&&t.jsx("p",{className:"mt-4 text-lg text-muted-foreground leading-relaxed",children:j(e.short_intro)}),t.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:i(e.published_at)}),t.jsx("span",{className:"text-muted-foreground/40",children:"·"}),t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx($,{className:"h-3.5 w-3.5"}),c," min read"]})]})]}),e.image_url&&t.jsx("img",{src:e.image_url,alt:e.title,className:"mb-10 h-auto w-full rounded-2xl border border-border"}),t.jsx("div",{className:`cms-content prose prose-lg dark:prose-invert max-w-none 7 prose-headings:font-semibold prose-headings:tracking-tight prose-headings:text-heading 8 prose-p:text-foreground prose-p:leading-relaxed 9 prose-li:text-foreground 10 prose-strong:text-foreground prose-strong:font-semibold 11 prose-a:text-primary prose-a:no-underline hover:prose-a:underline 12 prose-blockquote:border-primary prose-blockquote:text-muted-foreground 13 prose-code:text-primary prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm 14 prose-pre:bg-muted prose-pre:border prose-pre:border-border 15 prose-img:rounded-xl prose-img:shadow-sm 16 prose-hr:border-border`,dangerouslySetInnerHTML:{__html:O.sanitize(B(e.content??""))}}),p.length>0&&t.jsxs("section",{className:"mt-14 border-t border-border pt-10","aria-labelledby":"faq-heading",children:[t.jsx("h2",{id:"faq-heading",className:"text-2xl font-bold tracking-tight text-heading md:text-3xl",children:"Frequently asked questions"}),t.jsx("div",{className:"mt-6 space-y-6",children:p.map((s,E)=>t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-semibold text-foreground",children:s.q}),t.jsx("p",{className:"mt-2 text-muted-foreground leading-relaxed",children:s.a})]},E))})]}),t.jsxs("div",{className:"mt-16 rounded-2xl border border-border bg-muted/30 p-8 text-center",children:[t.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Enjoyed this article?"}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Get product updates, tips, and company news â no spam."}),t.jsx(x,{to:"/#subscribe",className:"mt-4 inline-flex items-center justify-center rounded-full bg-primary px-6 py-2.5 text-sm font-semibold text-primary-foreground hover:brightness-105 transition-all",children:"Subscribe to the newsletter"}),t.jsx("div",{className:"mt-6 border-t border-border pt-6",children:t.jsxs(x,{to:"/blog",className:"inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[t.jsx(b,{className:"h-4 w-4"})," Back to all posts"]})})]})]})]})}export{re 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.