PageSourceSearch

https://postbold.com/_next/static/chunks/3742-ec6225a27ec7140b.js

js postbold.com collected 2026-09-24 14:02:24 UTC 9,909 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3742],{73742:function(e,s,l){l.r(s),l.d(s,{default:function(){return o}});var r=l(85893),t=l(67294),a=l(78773);function o(e){let{templates:s=[],onSelect:l,inline:o=!1,selectedTemplateId:i=null}=e,[d,c]=(0,t.useState)(""),[n,x]=(0,t.useState)("All"),[u,m]=(0,t.useState)([]);(0,t.useEffect)(()=>{{let e=localStorage.getItem("bookmarkedPostTemplates");if(e)try{m(JSON.parse(e))}catch(e){console.error("Error loading bookmarked templates:",e)}}},[]);let h=(0,t.useMemo)(()=>{let e=new Set;return Array.isArray(s)&&s.forEach(s=>{var l;null===(l=s.professions)||void 0===l||l.forEach(s=>e.add(s))}),["All",...Array.from(e).sort()]},[s]),g=(0,t.useMemo)(()=>Array.isArray(s)?s.filter(e=>{var s,l,r,t,a;let o=(null===(s=e.title)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))||(null===(l=e.category)||void 0===l?void 0:l.toLowerCase().includes(d.toLowerCase()))||(null===(r=e.purpose)||void 0===r?void 0:r.toLowerCase().includes(d.toLowerCase()))||(null===(t=e.professions)||void 0===t?void 0:t.some(e=>e.toLowerCase().includes(d.toLowerCase()))),i="All"===n||(null===(a=e.professions)||void 0===a?void 0:a.includes(n));return o&&i}):[],[s,d,n]),p=(0,t.useMemo)(()=>Array.isArray(s)?s.filter(e=>u.includes(e.id)):[],[s,u]),b=(e,s)=>{s.stopPropagation();let l=u.includes(e)?u.filter(s=>s!==e):[...u,e];m(l),localStorage.setItem("bookmarkedPostTemplates",JSON.stringify(l))},v=e=>{l(e)};return o?(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)(a.U41,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),(0,r.jsx)("input",{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Search templates by title, category, or profession...",className:"w-full pl-12 pr-4 py-3 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all"})]}),(0,r.jsx)("div",{className:"md:w-64",children:(0,r.jsx)("select",{value:n,onChange:e=>x(e.target.value),className:"w-full px-4 py-3 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all bg-white",children:h.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})})]})}),p.length>0&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 mb-3 flex items-center gap-2",children:[(0,r.jsx)(a.VF9,{className:"text-yellow-500"}),"Bookmarked Templates"]}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(e=>(0,r.jsx)("div",{onClick:()=>v(e),className:"p-4 rounded-xl border-2 cursor-pointer transition-all ".concat(i===e.id?"border-blue-500 bg-blue-50 shadow-lg":"border-gray-200 hover:border-gray-300 hover:shadow-md bg-white"),children:(0,r.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h4",{className:"text-base font-bold text-gray-900 mb-1",children:e.title}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-xs px-2 py-1 bg-gray-100 text-gray-700 rounded-full",children:e.category})})]}),(0,r.jsx)("button",{onClick:s=>b(e.id,s),className:"ml-2 text-yellow-500 hover:text-yellow-600",children:(0,r.jsx)(a.VF9,{className:"w-5 h-5"})})]})},e.id))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-3",children:"Templates"}),(0,r.jsx)("div",{children:"Select a template to match the writing style and structure of your post."}),0===g.length?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-gray-500",children:"No templates found matching your criteria."})}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4 max-h-[600px] overflow-y-auto",children:g.map(e=>{var s,l,t,o,d;return(0,r.jsxs)("div",{onClick:()=>v(e),className:"p-4 rounded-xl border-2 cursor-pointer transition-all ".concat(i===e.id?"border-blue-500 bg-blue-50 shadow-lg":"border-gray-200 hover:border-gray-300 hover:shadow-md bg-white"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("h4",{className:"text-lg font-bold text-gray-900 mb-1",children:e.title}),(0,r.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,r.jsx)("span",{className:"text-md px-2 py-1 bg-gray-100 text-gray-700 rounded-full",children:e.category})})]}),(0,r.jsx)("button",{onClick:s=>b(e.id,s),className:"ml-2 transition-colors ".concat(u.includes(e.id)?"text-yellow-500":"text-gray-300 hover:text-yellow-500"),children:(u.includes(e.id),(0,r.jsx)(a.VF9,{className:"w-5 h-5"}))})]}),(0,r.jsx)("div",{className:"text-lg text-gray-600 space-y-1 mb-2",children:(0,r.jsxs)("div",{className:"bg-gray-50 p-2 rounded text-lg",children:[(null===(s=e.structure)||void 0===s?void 0:s.hook)&&(0,r.jsx)("div",{className:"mb-2 ",children:e.structure.hook}),(null===(l=e.structure)||void 0===l?void 0:l.body)&&(0,r.jsx)("div",{className:"mb-2 text-gray-600",style:{whiteSpace:"pre-line"},children:e.structure.body}),(null===(t=e.structure)||void 0===t?void 0:t.cta)&&(0,r.jsx)("div",{children:e.structure.cta})]})}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[null===(o=e.professions)||void 0===o?void 0:o.slice(0,3).map((e,s)=>(0,r.jsx)("span",{className:"text-md px-2 py-1 bg-blue-100 text-blue-700 rounded-full",children:e},s)),(null===(d=e.professions)||void 0===d?void 0:d.length)>3&&(0,r.jsxs)("span",{className:"text-xs px-2 py-1 text-gray-500",children:["+",e.professions.length-3]})]})]},e.id)})})]})]}):(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"p-6 border-b border-gray-200 flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Select a Template"}),(0,r.jsx)("p",{className:"text-gray-600 mt-1",children:"Choose a template structure to guide your post creation"})]}),(0,r.jsx)("button",{onClick:()=>l(null),className:"text-gray-400 hover:text-gray-600 transition-colors",children:(0,r.jsx)(a.U41,{className:"w-6 h-6"})})]}),(0,r.jsx)("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)(a.U41,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),(0,r.jsx)("input",{type:"text",value:d,onChange:e=>c(e.target.value),placeholder:"Search templates by title, category, or profession...",className:"w-full pl-12 pr-4 py-3 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all"})]}),(0,r.jsx)("div",{className:"md:w-64",children:(0,r.jsx)("select",{value:n,onChange:e=>x(e.target.value),className:"w-full px-4 py-3 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all bg-white",children:h.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:0===g.length?(0,r.jsx)("div",{className:"text-center py-12",children:(0,r.jsx)("p",{className:"text-gray-500 text-lg",children:"No templates found matching your criteria."})}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map(e=>{var s,l,t,o,d;return(0,r.jsxs)("div",{onClick:()=>v(e),className:"p-5 rounded-xl border-2 cursor-pointer transition-all ".concat(i===e.id?"border-blue-500 bg-blue-50 shadow-lg":"border-gray-200 hover:border-gray-300 hover:shadow-md bg-white"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-1",children:e.title}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)("span",{className:"text-xs px-2 py-1 bg-gray-100 text-gray-700 rounded-full",children:e.category}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:e.purpose})]})]}),(0,r.jsx)("button",{onClick:s=>b(e.id,s),className:"ml-2 transition-colors ".concat(u.includes(e.id)?"text-yellow-500":"text-gray-300 hover:text-yellow-500"),children:(u.includes(e.id),(0,r.jsx)(a.VF9,{className:"w-5 h-5"}))})]}),(0,r.jsxs)("div",{className:"text-sm text-gray-600 space-y-1 mb-3",children:[(0,r.jsx)("div",{className:"font-semibold text-gray-700",children:"Structure:"}),(0,r.jsxs)("div",{className:"bg-gray-50 p-2 rounded text-xs",children:[(null===(s=e.structure)||void 0===s?void 0:s.hook)&&(0,r.jsxs)("div",{className:"mb-1 truncate",children:["• ",e.structure.hook]}),(null===(l=e.structure)||void 0===l?void 0:l.body)&&(0,r.jsxs)("div",{className:"mb-1 text-gray-600",style:{whiteSpace:"pre-line"},children:["• ",e.structure.body]}),(null===(t=e.structure)||void 0===t?void 0:t.cta)&&(0,r.jsxs)("div",{className:"truncate",children:["• ",e.structure.cta]})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[null===(o=e.professions)||void 0===o?void 0:o.slice(0,3).map((e,s)=>(0,r.jsx)("span",{className:"text-xs px-2 py-1 bg-blue-100 text-blue-700 rounded-full",children:e},s)),(null===(d=e.professions)||void 0===d?void 0:d.length)>3&&(0,r.jsxs)("span",{className:"text-xs px-2 py-1 text-gray-500",children:["+",e.professions.length-3]})]})]},e.id)})})})]})})}}}]);

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.