1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[170],{22868:function(){},14777:function(){},99830:function(){},70209:function(){},16910:function(e,t,r){"use strict";r.d(t,{$W:function(){return s},Ly:function(){return c},TR:function(){return a},UE:function(){return l},im:function(){return n}});var o=r(35695);let a={newest:"Newest",oldest:"Oldest"},n=Object.fromEntries(Object.entries(a).map(e=>{let[t,r]=e;return[r,t]})),l={[a.newest]:o.AP.desc,[a.oldest]:o.AP.asc},s={search:"q",sort:"sort",page:"page"},c=10},22810:function(e,t,r){"use strict";r.d(t,{z:function(){return i}});var o=r(57437),a=r(2265),n=r(59143),l=r(57742),s=r(42694);let c=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 transition-shadow transition-colors duration-200 ease-in-out",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary hover:bg-secondary hover:text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground",accent:"bg-accent text-white",ghost:"hover:bg-gray-200",link:"text-sky-500 underline-offset-4 hover:underline font-normal",text:""},size:{default:"h-11 px-8 py-2",sm:"h-10 px-4",lg:"h-12 px-8",icon:"h-8 w-8",noPadding:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),i=(0,a.forwardRef)((e,t)=>{let{className:r,variant:a,size:l,asChild:i=!1,...u}=e,h=i?n.g7:"button";return(0,o.jsx)(h,{className:(0,s.cn)(c({variant:a,size:l,className:r})),ref:t,...u})});i.displayName="Button"},37127:function(e,t,r){"use strict";r.r(t),r.d(t,{SearchContainer:function(){return C}});var o=r(57437),a=r(2265),n=r(13037),l=r(47907),s=r(40195),c=r.n(s),i=r(16910),u=r(28670),h=r(52235),d=r(20703),f=r(8792),g=r(22810),p=r(42694);let m={sm:16,lg:18},y=e=>{let{title:t,description:r,image:a,blogUrl:n}=e;return(0,o.jsxs)(f.default,{title:t,href:n,className:"flex cursor-pointer items-center justify-between px-5 py-3 hover:bg-primary/5 focus:bg-primary/5 focus-visible:bg-primary/5 focus-visible:outline-none",children:[a&&(0,o.jsx)("div",{className:"mr-3 w-[30%]",children:(0,o.jsx)(d.default,{alt:a.alt,src:a.url,width:75,height:55})}),(0,o.jsxs)("div",{className:(0,p.cn)("w-full",{"w-[70%]":!!a}),children:[(0,o.jsx)("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold",children:t}),(0,o.jsx)("p",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:r})]})]})},w=e=>{let{onClick:t,searchedValue:r}=e;return(0,o.jsx)(g.z,{variant:"ghost","aria-label":"Search all ".concat(r),type:"button",onClick:t,className:(0,p.cn)("group/search-all flex w-full justify-start bg-transparent px-5 text-xs text-foreground opacity-60 hover:bg-transparent hover:opacity-80 focus:bg-transparent focus:opacity-80"),children:(0,o.jsxs)("span",{className:"flex items-center",children:[(0,o.jsx)(u.Z,{size:14,className:"mr-3 text-foreground opacity-80 group-hover/search-all:opacity-100 group-focus/search-all:opacity-100 group-focus-visible/search-all:opacity-100"}),(0,o.jsx)("span",{children:'Search all "'.concat(r,'"')})]})})},v=(0,a.forwardRef)((e,t)=>{let{value:r,onChange:a,size:n="sm",placeholder:l="Search blogs",searchIconClass:s="",handleClearButton:c}=e;return(0,o.jsxs)("div",{className:(0,p.cn)("group/search-input relative h-full bg-transparent px-3 text-base"),children:[(0,o.jsx)(u.Z,{size:m[n],className:(0,p.cn)("absolute left-3 top-1/2 z-10 -translate-y-1/2 text-foreground opacity-60 group-hover/search-input:opacity-80",s)}),(0,o.jsx)("input",{type:"text",value:r,onChange:e=>a(e.target.value),placeholder:l,className:(0,p.cn)("w-full border-0 bg-transparent px-6 py-2.5 outline-none placeholder:text-primary"),ref:t}),!!r&&(0,o.jsx)(g.z,{variant:"ghost","aria-label":"Clear Search",type:"button",onClick:()=>{a(""),null==c||c()},className:(0,p.cn)("absolute right-3 top-1/2 z-10 h-auto -translate-y-1/2 roun
1ded-full p-[0.1rem] text-foreground opacity-60 hover:opacity-80"),children:(0,o.jsx)(h.Z,{size:16})})]})});v.displayName="Search Input";var b=r(35695),x=r(87770),E=r(32443),j=r(95459);let k={rightAlign:"right-align"},C=e=>{let{variant:t=k.rightAlign,showSuggestion:r=!0,defaultValue:s=""}=e,[u,h]=(0,a.useState)(s),[d,f]=(0,a.useState)([]),g=(0,a.useRef)(null),m=(0,a.useRef)(null),C=(0,a.useRef)(null),P=(0,a.useRef)(null),F=(0,l.useRouter)(),S=(0,l.useSearchParams)();(0,a.useEffect)(()=>{let e=(0,j.U)(P,m,C);return()=>{e&&removeEventListener("keydown",e)}},[]),(0,a.useEffect)(()=>{if(!u||!r){g.current&&clearTimeout(g.current),f([]);return}return g.current=setTimeout(()=>{x.U.fetchSearchResults(u).then(e=>{f(e.map(e=>{let t;return(null==e?void 0:e.featured_image_src)&&!(0,E.my)(e.featured_image_src)&&(t={url:e.featured_image_src,alt:e.title.rendered}),{id:e.id,title:(0,n.decode)(c()(e.title.rendered,{allowedTags:[],allowedAttributes:{}})),description:(0,n.decode)(c()(e.excerpt.rendered,{allowedTags:[],allowedAttributes:{}})),image:t,blogUrl:"".concat(b.yA.blogs,"/").concat(e.slug)}}))}).catch(e=>{f([]),console.error(e)})},b.$x),()=>{g.current&&clearTimeout(g.current)}},[u]);let N=()=>{let e=new URLSearchParams(S);e.set(i.$W.search,u),e.delete(i.$W.page),F.push("".concat(b.yA.search,"?").concat(e.toString()))};return(0,o.jsx)("div",{className:(0,p.cn)("relative flex min-h-[2.87rem] items-center",{"mb-10 justify-center md:justify-end":t===k.rightAlign}),children:(0,o.jsxs)("div",{className:(0,p.cn)("group/search-bar absolute top-0 z-30 min-h-[2.87rem] w-full overflow-hidden rounded-3xl border border-primary bg-white",{"max-w-[19.06rem]":t===k.rightAlign,"h-full overflow-hidden focus-within:h-auto focus-within:overflow-visible":r}),ref:P,children:[(0,o.jsxs)("form",{role:"Search",action:N,children:[(0,o.jsx)(v,{ref:m,value:u,onChange:e=>{h(e)},searchIconClass:"group-focus-within/search-bar:opacity-80"}),(0,o.jsx)("input",{type:"submit",value:"Search Blogs",tabIndex:-1,hidden:!0,"aria-hidden":!0})]}),r&&!!d.length&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("ul",{ref:C,className:"mt-5 max-h-[21.87rem] overflow-auto bg-transparent md:max-h-[31.25rem]",children:d.map(e=>(0,o.jsx)("li",{children:(0,o.jsx)(y,{title:e.title,description:e.description,image:null==e?void 0:e.image,blogUrl:e.blogUrl})},e.id))}),(0,o.jsx)(w,{searchedValue:u,onClick:N})]})]})})}},87770:function(e,t,r){"use strict";r.d(t,{U:function(){return c}});var o=r(35695),a=r(34392),n=r(32443);let l="".concat(a.KJ,"/posts"),s="".concat(a.KJ,"/tags"),c={fetchAllPosts:async(e,t)=>{try{let r=[],{blogsList:o,totalPages:a}=await c.fetchBlogs(e,t);for(let o=2;o<=a;o++)r.push(c.fetchPostsByPage(o,e,t));let n=await Promise.all(r),l=await Promise.all(n.map(e=>e.json()));return o.concat(l.flat())}catch(e){throw console.error("Error fetching all posts:",e),Error("Failed to fetch all posts.")}},fetchPostBySlug:async e=>{let t=(0,n.C3)(l,{slug:e});try{let r=await fetch(t);if(!r.ok)return console.error('Failed to fetch post for slug "'.concat(e,'".')),null;let o=await r.json();return o.length>0?o[0]:null}catch(e){throw console.error("Error fetching post:",e),Error("Failed to fetch post by slug.")}},fetchBlogsByTag:async e=>{let t=(0,n.C3)(l,{tag:e});try{let r=await fetch(t);if(!r.ok)throw Error('Failed to fetch blogs by tag "'.concat(e,'"'));return await r.json()}catch(e){throw console.error("Error fetching blogs using tag:",e),Error("Failed to fetch blogs by tag.")}},fetchBlogs:async(e,t)=>{let{order:r,orderBy:o,search:a,page:s}=null!=e?e:{},c=(0,n.C3)(l,{per_page:10,...s?{page:s}:{},...a?{search:a}:{},...r?{order:r}:{},...o?{orderby:o}:{}});try{var i,u;let e=await fetch(c,{signal:t});if(!e.ok)throw Error("Failed to get total pages.");let r=await e.json(),o=parseInt(null!==(i=e.headers.get("X-WP-TotalPages"))&&void 0!==i?i:"1"),a=parseInt(null!==(u=e.headers.get("X-Wp-Total"))&&void 0!==u?u:"0");return{totalPages:o,totalBlogs:a,blogsList:r}}catch(e){throw console.error("Error getting total pages:",e),Error("Failed to get total pages.")}},fetchPostsByPage:async(e,t,r)=>{let{order:o,orderBy:a,search:s}=null!=t?t:{}
1,c=(0,n.C3)(l,{per_page:10,page:e,...s?{search:s}:{},...o?{order:o}:{},...a?{orderby:a}:{}});try{let t=await fetch(c,{signal:r});if(!t.ok)throw Error("Failed to fetch posts for page ".concat(e,"."));return t}catch(t){throw console.error("Error fetching posts for page ".concat(e,":"),t),Error("Failed to fetch posts for page ".concat(e,"."))}},fetchAllPostSlugs:async()=>{try{let{totalPages:e}=await c.fetchBlogs(),t=[];for(let r=1;r<=e;r++){let e=await c.fetchPostsByPage(r);(await e.json()).forEach(e=>{t.push(e.slug)})}return t}catch(e){throw console.error("Error fetching all post slugs:",e),Error("Failed to fetch all post slugs.")}},fetchRelatedPosts:async(e,t,r,o)=>{let a=(0,n.C3)(l,{per_page:o,exclude:r,...e.length>0?{categories:e}:{},...t.length>0?{tags:t}:{}});try{if(!(e.length>0)&&!(t.length>0))return[];{let r=await fetch(a);if(!r.ok)throw Error("Failed to fetch related posts for categories ".concat(e.join(",")," and tags ").concat(t.join(","),". URL=").concat(a));return await r.json()}}catch(e){throw console.error("Error fetching related posts:",e),Error("Failed to fetch related posts.")}},fetchSearchResults:async(e,t)=>{let{orderBy:r=o.Ud.date,order:a=o.AP.desc}=null!=t?t:{},s=(0,n.C3)(l,{search:e,...a?{order:a}:{},...r?{orderby:r}:{}});try{let t=await fetch(s);if(!t.ok)throw Error('Failed to fetch blogs Search Results for "'.concat(e,'"'));return await t.json()}catch(e){throw console.error("Error fetching search result for blogs",e),Error("Failed to fetch blogs Search Results")}},fetchAllTagSlug:async()=>{try{let e=[],t=await c.getTotalTags();for(let r=1;r<=t;r++)e.push(c.fetchTagsByPage(r));let r=await Promise.all(e);return(await Promise.all(r.map(e=>e.json()))).flat()}catch(e){throw console.error("Error fetching all tag slugs:",e),Error("Failed to fetch all tag slugs.")}},getTotalTags:async()=>{let e=(0,n.C3)(s,{per_page:10});try{var t;let r=await fetch(e);if(!r.ok)throw Error("Failed to get total tags.");return parseInt(null!==(t=r.headers.get("X-WP-TotalPages"))&&void 0!==t?t:"1")}catch(e){throw console.error("Error getting total tag pages:",e),Error("Failed to get total tags pages.")}},fetchTagsByPage:async e=>{let t=(0,n.C3)(s,{per_page:10,page:e});try{let r=await fetch(t);if(!r.ok)throw Error("Failed to fetch tags for page ".concat(e,"."));return r}catch(t){throw console.error("Error fetching tags for page ".concat(e,":"),t),Error("Failed to fetch tags for page ".concat(e,"."))}},fetchRandomBlogs:async(e,t)=>{let r=(0,n.C3)(l,{per_page:e,orderby:"rand",...t.length>1?{"exclude[]":t}:{exclude:t[0]}});try{let e=await fetch(r);if(!e.ok)throw Error("Failed to fetch random posts. URL=".concat(r));return await e.json()}catch(e){throw console.error("Error fetching random posts:",e),Error("Failed to fetch random posts.")}}}},95459:function(e,t,r){"use strict";r.d(t,{U:function(){return a}});let o=e=>{var t;null===(t=(null==e?void 0:e.firstElementChild)||HTMLButtonElement)||void 0===t||t.focus()},a=(e,t,r)=>{var a;let n=e=>{let a="ArrowUp"===e.key||38===e.keyCode,n="ArrowDown"===e.key||40===e.keyCode;if((a||n)&&r.current){if(e.target===t.current&&n)e.preventDefault(),o(r.current.firstElementChild);else{var l,s,c,i,u;let t=null===(l=e.target)||void 0===l?void 0:l.parentElement;if(!r.current.contains(t))return;if(e.preventDefault(),a){o(null!==(c=null==t?void 0:t.previousElementSibling)&&void 0!==c?c:null==t?void 0:null===(s=t.parentElement)||void 0===s?void 0:s.lastElementChild);return}if(n){o(null!==(u=null==t?void 0:t.nextElementSibling)&&void 0!==u?u:null==t?void 0:null===(i=t.parentElement)||void 0===i?void 0:i.firstElementChild);return}}}};return null===(a=e.current)||void 0===a||a.addEventListener("keydown",n),n}},42694:function(e,t,r){"use strict";r.d(t,{C:function(){return n},cn:function(){return s}});var o=r(75504),a=r(51367);let n={extend:{classGroups:{"font-size":[{text:["h1","h2","h3","h4","h5","h6","hero"]}]}}},l=(0,a.q7)(n),s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return l((0,o.W)(t))}}}]);
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.