1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5898],{92510:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog/[category]/[slug]",function(){return r(27563)}])},27563:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return P},generateMetadata:function(){return L},generateStaticParams:function(){return C}});var l=r(85893),n=r(11163),a=r(67294),i=r(25675),s=r.n(i),c=r(87828),o=r(95135);let d=e=>{let{data:t}=e;return(0,l.jsx)("div",{className:"slide-container",children:(0,l.jsx)(o.pT,{children:t.files.data.map(e=>{let t=(0,c.$0)(e.attributes.url);return t?(0,l.jsx)("div",{children:t&&(0,l.jsx)(s(),{className:"w-full h-96 object-cover rounded-lg",height:400,width:600,alt:"alt text",src:t})},e.attributes.url):(console.error("[ImageSlider/Slideshow] imageUrl is null"),(0,l.jsx)(l.Fragment,{}))})})})},u=e=>{let{data:t}=e,r=(0,c.$0)(t.file.data.attributes.url);return r?(0,l.jsx)("div",{className:"flex items-center justify-center mt-8 lg:mt-0 h-72 sm:h-80 lg:h-96 xl:h-112 2xl:h-128",children:(0,l.jsx)(s(),{src:null!=r?r:"",alt:t.file.data.attributes.alternativeText||"none provided",className:"object-cover w-full h-full rounded-lg overflow-hidden",width:400,height:400})}):(console.error("[blog/Media] imgUrl is null"),(0,l.jsx)(l.Fragment,{children:"Missing image"}))},m=e=>{let{data:t}=e,{title:r,body:n,author:a}=t;return(0,l.jsxs)("div",{className:"flex flex-col items-center mx-12 lg:mx-0 py-44",children:[r&&(0,l.jsx)("h2",{className:"my-4",children:r}),(0,l.jsxs)("div",{className:"relative text-center",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",className:"absolute top-0 -left-4 w-4 h-4 dark:text-gray-700",children:[(0,l.jsx)("path",{d:"M232,246.857V16H16V416H54.4ZM48,48H200V233.143L48,377.905Z"}),(0,l.jsx)("path",{d:"M280,416h38.4L496,246.857V16H280ZM312,48H464V233.143L312,377.905Z"})]}),(0,l.jsx)("p",{className:"px-6 py-1 text-lg italic",children:n}),(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",className:"absolute bottom-0 -right-4 w-4 h-4 dark:text-gray-700",children:[(0,l.jsx)("path",{d:"M280,185.143V416H496V16H457.6ZM464,384H312V198.857L464,54.1Z"}),(0,l.jsx)("path",{d:"M232,16H193.6L16,185.143V416H232ZM200,384H48V198.857L200,54.1Z"})]})]}),(0,l.jsx)("span",{className:"w-12 h-1 my-2 rounded-lg dark:bg-violet-400"}),a&&(0,l.jsx)("p",{children:a})]})};var h=r(1673),x=r(8477);let g=e=>{let{data:t}=e;return(0,l.jsx)("div",{className:"rich-text py-6 ",children:(0,l.jsx)(h.U,{remarkPlugins:[x.Z],children:t.body})})},f=e=>{let t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|watch\?v%3D)([\w-]{11}).*/.exec(e);return t&&11===t[2].length?"https://www.youtube.com/embed/".concat(t[2]):null},p=e=>{var t,r;let{data:n}=e,a=f(n.url);return a?(0,l.jsx)("div",{className:"video-embed relative pb-56.25 h-72 lg:h-[450px] overflow-hidden my-8",children:(0,l.jsx)("iframe",{title:"video",src:null!=a?a:"",width:null!==(t=n.width)&&void 0!==t?t:"100%",height:null!==(r=n.height)&&void 0!==r?r:"100%",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute top-0 left-0 w-full h-full"})}):(0,l.jsx)("div",{children:"Invalid video URL"})},b=()=>{let[e,t]=(0,a.useState)(""),[r,n]=(0,a.useState)("idle"),i=async r=>{if(r.preventDefault(),e){n("loading");try{let r=(0,c.pK)("/api/lead-form-submissions");if(!r)throw Error("Strapi URL not configured");let l=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{email:e}})});l.ok?(n("success"),t("")):n("error")}catch(e){n("error")}}};return(0,l.jsxs)("div",{className:"border border-border rounded-xl p-6 my-10 bg-primary text-center space-y-3",children:[(0,l.jsx)("h3",{className:"text-xl font-semibold text-foreground",children:"Get future essays in your inbox"}),(0,l.jsx)("p",{className:"text-muted-foreground text-sm",children:"No noise â only when we publish something worth reading."}),"success"===r?(0,l.jsx)("p",{className:"text-secondary font-medium",children:"You're subscribed. Thank y
1ou!"}):(0,l.jsxs)("form",{onSubmit:i,className:"flex flex-col sm:flex-row gap-2 justify-center",children:[(0,l.jsx)("input",{type:"email",placeholder:"[email protected]",value:e,onChange:e=>t(e.target.value),required:!0,className:"border border-border rounded-md px-4 py-2 text-sm bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-secondary w-full sm:w-72"}),(0,l.jsx)("button",{type:"submit",disabled:"loading"===r,className:"bg-secondary text-white px-5 py-2 rounded-md text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:"loading"===r?"Subscribingâ¦":"Subscribe"})]}),"error"===r&&(0,l.jsx)("p",{className:"text-red-500 text-sm",children:"Something went wrong. Please try again."})]})},v=e=>{var t,r,n;let{article:a,viewCount:i}=e,{title:o,description:h,publishedAt:x,cover:f,authorsBio:v,blocks:j}=a,y=null===(t=v.data)||void 0===t?void 0:t.attributes,w=(0,c.$0)(null===(r=f.data)||void 0===r?void 0:r.attributes.url),k=(0,c.$0)(null===(n=v.data)||void 0===n?void 0:n.attributes.avatar.data.attributes.url);return(null===w||null===k)&&console.error("[blog/Post] imageUrl = ".concat(w,", authorImgUrl = ").concat(k)),(0,l.jsxs)("div",{className:"space-y-8",children:[w&&(0,l.jsx)(s(),{src:w,alt:"article cover image",width:400,height:400,className:"w-full h-96 object-cover rounded-lg"}),(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)("h1",{className:"leading-tight text-5xl font-bold",children:o}),(0,l.jsxs)("div",{className:"flex flex-col items-start justify-between w-full md:flex-row md:items-center text-primary-foreground",children:[(0,l.jsxs)("div",{className:"flex items-center md:space-x-2",children:[k&&(0,l.jsx)(s(),{src:k,alt:"article cover image",width:400,height:400,className:"w-14 h-14 border rounded-full bg-muted border-border"}),(0,l.jsxs)("p",{className:"text-md text-secondary",children:[null==y?void 0:y.name," ⢠",(0,c.p6)(x)]})]}),null!=i&&(0,l.jsxs)("p",{className:"text-sm text-muted-foreground mt-2 md:mt-0",children:[i.toLocaleString()," ",1===i?"read":"reads"]})]})]}),(0,l.jsxs)("div",{className:"text-muted-foreground",children:[(0,l.jsx)("p",{children:h}),j.map((e,t)=>(function(e,t){switch(e.__component){case"shared.rich-text":return(0,l.jsx)(g,{data:e},t);case"shared.slider":return(0,l.jsx)(d,{data:e},t);case"shared.quote":return(0,l.jsx)(m,{data:e},t);case"shared.media":return(0,l.jsx)(u,{data:e},t);case"shared.video-embed":return(0,l.jsx)(p,{data:e},t);default:return null}})(e,t))]}),(0,l.jsx)(b,{})]})};var j=r(60932),y=r(92183),w=r(67019),k=r(73924),N=r(60855);async function E(e){let t=await (0,w.I)("/articles",{filters:{slug:e},populate:{cover:{fields:["url"]},authorsBio:{populate:"*"},category:{fields:["name"]},blocks:{populate:"*"}}});return t}async function S(e){let t=await (0,w.I)("/articles",{filters:{slug:e},populate:{seo:{populate:"*"}}});return t.data}async function L(e){let{params:t}=e,r=await S(t.slug),l=r[0].attributes.seo;return{title:l.metaTitle,description:l.metaDescription}}let Z=()=>{let[e,t]=(0,a.useState)(),[r,i]=(0,a.useState)(null),s=(0,n.useRouter)(),{rudderEventMethods:o}=(0,a.useContext)(y.Z);return((0,a.useEffect)(()=>{let e=s.query.slug;e&&E(e).then(e=>{let r=e.data[0];t(r);let l=(0,c.pK)("/api/articles/".concat(r.id,"/view"));l&&fetch(l,{method:"POST"}).then(e=>e.json()).then(e=>{void 0!==e.viewCount&&i(e.viewCount)}).catch(e=>console.error("[PostRoute] Failed to increment view count",e))}).catch(t=>{console.error("[PostRoute] Unable to get post by slug ".concat(e),t)})},[s.query.slug]),(0,a.useEffect)(()=>{let e=s.query.slug;if(!e||!o)return;let t=(0,k.e)();o.track("absent","page-visit",{type:"blog-article-page",category:s.query.category,slug:e},t)},[o,s.query.slug,s.query.category]),e)?(0,l.jsxs)("div",{className:"overflow-hidden",children:[(0,l.jsx)(N.Z,{transparent:!0}),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)("div",{className:"mx-auto max-w-3xl px-6 lg:px-0",children:(0,l.jsx)(v,{article:e.attributes,viewCount:r})})}),(0,l.jsx)(j.Z,{})]}):(0,l.jsx)("h2",{children:"Post not found"})};async function C(){try{let e=await (0,w.I)("/articles",{populate:["category"]});return e.data.map(e=>({slug:e.attributes.slug,category:e.attributes.slug}))}catch(e){return console.error("[generateStaticParams] Failed to get articles",e),null}}var P=Z},87828:function(e,t,r){"use strict";function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"https://".concat("blog-api.vibinex.com").concat(e)}function n(e){return null===e?null:e.startsWith("http")||e.startsWith("//")?e:l(e)}function a(e){let t=new Date(e);return t.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}r.d(t,{$0:function(){return n},p6:function(){return a},pK:function(){return l}})},67019:function(e,t,r){"use strict";r.d(t,{I:function(){return s}});var l=r(92729),n=r(80129),a=r.n(n),i=r(87828);async function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{let n={next:{revalidate:60},headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat("1ed2efd960ce6d47
171a81d8b80cd170fdff2c728e1b68241bfff6be8510a54b17256e78cc784d9bbf1e6224dc61081fadcb60cc10350d438d006bd590689e82814ef504b8ff78d9d165d0c3ae4ad942f44946b8fe00f58b5ed4e0e144492ff4fe51899762418e8e180de0dbfc766a97542e63978efb83add735647bf0d9a6a82")},...r},s=a().stringify(t),c=s?"/api".concat(e,"?").concat(s):"/api".concat(e),o="".concat((0,i.pK)(c)),d=await (0,l.Z)(o,n);return d.data}catch(t){throw console.error("[fetchApi] Unable to call api ".concat(e),t),Error("Please check if your server is running and you set all the required tokens.")}}},60855:function(e,t,r){"use strict";var l=r(85893),n=r(67294),a=r(33299),i=r(41664),s=r.n(i),c=r(8193),o=r(28478),d=r(83277),u=r(25675),m=r.n(u),h=r(92183),x=r(73924),g=r(64947),f=r(53385),p=r(85637),b=r(18726);let v=e=>{let{rudderEventMethods:t}=n.useContext(h.Z),r=(0,a.useSession)().data,[i,u]=(0,n.useState)(!1),[v,j]=(0,n.useState)(!e.transparent),y=()=>{u(!i)};return(0,n.useEffect)(()=>{let e=()=>{window.scrollY>=90?j(!0):j(!1)};window.addEventListener("scroll",e)},[]),(0,n.useEffect)(()=>{let e=(0,x.e)(),l=()=>{null==t||t.track((0,g.b1)(r),"Add to chrome button",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},n=()=>{null==t||t.track((0,g.b1)(r),"Blog link clicked",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},a=()=>{null==t||t.track((0,g.b1)(r),"Pricing link clicked",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},i=()=>{null==t||t.track((0,g.b1)(r),"Contribute link clicked",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},s=()=>{null==t||t.track((0,g.b1)(r),"Login-Logout link clicked",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},c=()=>{null==t||t.track((0,g.b1)(r),"Docs link clicked",{type:"link",eventStatusFlag:1,source:"navbar",name:(0,g.xr)(r)},e)},o=document.getElementById("download-link"),d=document.getElementById("blog-link"),u=document.getElementById("pricing-link"),m=document.getElementById("contribute-link"),h=document.getElementById("login-logout-link"),f=document.getElementById("docs-link");return null==o||o.addEventListener("click",l),null==d||d.addEventListener("click",n),null==u||u.addEventListener("click",a),null==m||m.addEventListener("click",i),null==h||h.addEventListener("click",s),null==f||f.addEventListener("click",c),()=>{null==o||o.removeEventListener("click",l),null==d||d.removeEventListener("click",l),null==u||u.removeEventListener("click",a),null==m||m.removeEventListener("click",i),null==h||h.removeEventListener("click",s),null==f||f.removeEventListener("click",c)}},[t,r]),(0,l.jsxs)(f.Z,{position:"fixed",className:"mx-auto p-4 justify-between items-center max-w-7xl",backdropClassName:"ease-in duration-300"+(v||!e.transparent?" bg-background text-foreground":" bg-primary text-foreground border-b-0"),children:[(0,l.jsxs)(s(),{href:"/",className:"flex items-center",children:[(0,l.jsx)(m(),{src:p.Z,alt:"Vibinex logo",className:"inline w-10 mr-2",priority:!0}),(0,l.jsx)("h1",{className:"font-bold text-3xl sm:text-4xl",children:"Vibinex"})]}),(0,l.jsxs)("ul",{className:"hidden sm:flex sm:items-center sm:justify-evenly",children:[(0,l.jsx)("li",{id:"docs-link",className:"p-3 lg:p-4",children:(0,l.jsx)(s(),{href:"/docs",children:"Docs"})}),(0,l.jsx)("li",{id:"blog-link",className:"p-3 lg:p-4",children:(0,l.jsx)(s(),{href:"/blog",children:"Blog"})}),(0,l.jsx)("li",{id:"contribute-link",className:"p-3 lg:p-4",children:(0,l.jsx)(s(),{href:"https://github.com/vibinex",target:"blank",children:"Contribute"})}),(0,l.jsx)("li",{className:"p-3 lg:p-4",id:"pricing-link",children:(0,l.jsx)(s(),{href:"/pricing",children:"Pricing"})}),(0,l.jsx)("li",{className:"hidden md:inline p-3 lg:p-4",id:"download-link",children:(0,l.jsxs)(s(),{href:"https://chrome.google.com/webstore/detail/vibinex/jafgelpkkkopeaefadkdjcmnicgpcncc",target:"_blank",children:["Download",(0,l.jsx)(m(),{src:d.Z,alt:"chrome extension logo",className:"inline ml-1 w-6"})]})}),(0,l.jsx)("li",{id:"login-logout-link",className:"p-3 lg:p-4",children:(0,l.jsx)(o.Z,{})})]}),(0,l.jsx)(b.Z,{onClick:y,variant:"text",className:"block sm:hidden z-10"+(i||v||!e.transparent?" text-primary-foreground":" text-primary-light"),children:i?(0,l.jsx)(c.oHP,{size:20}):(0,l.jsx)(c.qTj,{size:20})}),(0,l.jsx)("div",{className:"sm:hidden absolute flex justify-center items-center w-full h-screen bg-primary text-center ease-in duration-300"+(i?" left-0 top-0 right-0 bottom-0":" left-[-100%] top-0 right-0 bottom-0"),children:(0,l.jsxs)("ul",{children:[(0,l.jsx)("li",{id:"docs-link",className:"p-4 text-4xl text-primary-foreground hover:text-secondary-light",children:(0,l.jsx)(s(),{href:"/docs",children:"Docs"})}),(0,l.jsx)("li",{id:"contribute-link",className:"p-4 text-4xl text-primary-foreground hover:text-secondary-light",children:(0,l.jsx)(s(),{href:"https://github.com/vibinex",target:"blank",children:"Contribute"})}),(0,l.jsx)("li",{id:"pricing-link",className:"p-4 text-4xl text-primary-foreground hover:text-secondary-light",children:(0,l.jsx)(s(),{href:"/pricing",children:"Pricing"})}),(0,l.jsx)("li",{id:"login-logout-link",className:"p-4 text-primary-foreground hover:text-secondary-light",children:(0,l.jsx)(o.Z,{})})]})})]})};t.Z=v},24654:function(){}},function(e){e.O(0,[2013,4617,3061,3567,2729,3728,129,5135,9357,9774,2888,179],function(){return e(e.s=92510)}),_N_E=e.O()}]);
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.