1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1305],{45214:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-post-create/paste-content",function(){return s(13784)}])},13784:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return u}});var r=s(85893),a=s(67294),l=s(11163),n=s(56137),i=s(9008),o=s.n(i),c=s(22655),d=s(37489);s(73742),s(20144);var x=s(40196);function u(e){var t,s;let{embedded:i=!1,onBack:u,onGenerate:m}=e,h=c.Z.posts,g=(0,l.useRouter)(),{data:b,status:f}=(0,d.k)(),[p,y]=(0,a.useState)(""),[j,N]=(0,a.useState)(!1),[v,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(null),[P,S]=(0,a.useState)("medium"),[L,I]=(0,a.useState)(x.MY_STYLE_OPTION),[_,E]=(0,a.useState)(!1),[z,M]=(0,a.useState)(""),[A,T]=(0,a.useState)(!1),[q,O]=(0,a.useState)(""),[W,Y]=(0,a.useState)("");(0,a.useEffect)(()=>{"loading"===f||b||g.push("/signin")},[b,f,g]);let G=async()=>{if(!p.trim()){w("Please paste some content before generating");return}w(""),N(!0);try{m?await m({source:"paste-content",content:p,template:k,influencerId:(0,x.resolveInfluencerId)(L),influencer:(0,x.resolveInfluencerMeta)(L),postLength:P}):w("Generation handler not available.")}catch(e){console.error("Error generating post:",e),w("Failed to generate post. Please try again.")}finally{N(!1)}},B=async e=>{if(e.preventDefault(),O(""),Y(""),!z.trim()){O("Please enter a LinkedIn URL");return}T(!0);try{let e=await fetch("/api/linkedin-influencers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({linkedinUrl:z.trim()})}),t=await e.json();t.success?(Y(t.message||"Influencer request submitted successfully! We will add them to our system soon."),M(""),setTimeout(()=>{E(!1),Y("")},2e3)):O(401===e.status?"Please sign in to request an influencer.":t.error||"Failed to submit request. Please try again.")}catch(e){console.error("Error submitting influencer request:",e),O("Failed to submit request. Please try again.")}finally{T(!1)}};return"loading"===f?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):(0,r.jsxs)(r.Fragment,{children:[!i&&(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:"Paste Content - Create AI Post"}),(0,r.jsx)("meta",{name:"description",content:"Paste your existing content to create an engaging LinkedIn post"}),(0,r.jsx)("link",{rel:"icon",href:h.icon})]}),i?(0,r.jsx)("div",{className:"bg-gradient-to-br from-gray-50 to-gray-100 py-8 px-4 sm:px-6 lg:px-8",children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,r.jsxs)("div",{className:"text-center mb-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Paste Your Content"}),(0,r.jsx)("p",{className:"text-gray-600",children:"Share your note, idea, or article and we'll transform it into an engaging LinkedIn post"})]}),(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Paste Your Content"}),(0,r.jsx)("textarea",{value:p,onChange:e=>{y(e.target.value),w("")},placeholder:"Paste your content, note, or idea here. It can be a paragraph, an article, or any text you want to turn into a LinkedIn post...",className:"text-lg w-full h-64 p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all resize-none",disabled:j}),(0,r.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,r.jsxs)("span",{className:"text-md text-gray-500",children:[p.length," characters"]}),p.length>0&&(0,r.jsx)("button",{onClick:()=>y(""),className:"text-md text-gray-500 hover:text-gray-700",children:"Clear"})]})]}),v&&(0,r.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-700",children:v})}),(0,r.jsx)(x.default,{selected:L,onSelect:e=>{I(e),w("")},onAddClick:()=>E(!0),accent:"blue",layout:"row",userImage:null==b?void 0:null===(t=b.user)||void 0===t?void 0:t.image}),(0,r.jsx)("button",{onClick:G,disabled:j||!p.trim(),className:"w-full text-lg py-4 rounded-xl font-semibold text-white transition-all duration-200 ".concat(j||!p.trim()?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 shadow-lg hover:shadow-xl"),children:j?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating your post..."]}):"Generate Post"})]})]})}):(0,r.jsx)(n.Z,{children:(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 py-12 px-4 sm:px-6 lg:px-8",children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,r.jsxs)("div",{className:"text-center mb-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Paste Your Content"}),(0,r.jsx)("p",{className:"text-gray-600",children:"Share your note, idea, or article and we'll transform it into an engaging LinkedIn post"})]}),(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Post Length"}),(0,r.jsxs)("div",{className:"flex justify-between w-full",children:[(0,r.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"radio",name:"postLength",value:"short",checked:"short"===P,onChange:e=>S(e.target.value),className:"w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500"}),(0,r.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Short"})]}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"50â300 characters"})]}),(0,r.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"radio",name:"postLength",value:"medium",checked:"medium"===P,onChange:e=>S(e.target.value),className:"w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500"}),(0,r.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Medium"})]}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"300â1,200 characters"})]}),(0,r.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"radio",name:"postLength",value:"long",checked:"long"===P,onChange:e=>S(e.target.value),className:"w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500"}),(0,r.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Long"})]}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"1,200â3,000 characters"})]})]})]}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Paste Your Content"}),(0,r.jsx)("textarea",{value:p,onChange:e=>{y(e.target.value),w("")},placeholder:"Paste your content, note, or idea here. It can be a paragraph, an article, or any text you want to turn into a LinkedIn post...",className:"text-lg w-full h-64 p-4 border-2 border-gray-200 rounded-xl focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all resize-none",disabled:j}),(0,r.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,r.jsxs)("span",{className:"text-md text-gray-500",children:[p.length," characters"]}),p.length>0&&(0,r.jsx)("button",{onClick:()=>y(""),className:"text-md text-gray-500 hover:text-gray-700",children:"Clear"})]})]}),v&&(0,r.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-700",children:v})}),(0,r.jsx)(x.default,{selected:L,onSelect:e=>{I(e),w("")},onAddClick:()=>E(!0),accent:"blue",layout:"grid",userImage:null==b?void 0:null===(s=b.user)||void 0===s?void 0:s.image}),(0,r.jsx)("button",{onClick:G,disabled:j||!p.trim(),className:"w-full text-lg py-4 rounded-xl font-semibold text-white transition-all duration-200 ".concat(j||!p.trim()?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 shadow-lg hover:shadow-xl"),children:j?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating your post..."]}):"Generate Post"})]})]})})}),_&&(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-xl w-full p-6 relative",children:[(0,r.jsx)("button",{onClick:()=>{E(!1),M(""),O(""),Y("")},className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)("img",{src:"/icon128.png",alt:"Postbold Logo",className:"w-10 h-10 mb-2 mr-2"}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Add Linkedin Influencers"})]}),(0,r.jsx)("p",{className:"text-gray-600 mb-6",children:"Enter the LinkedIn URL of an influencer whose writing style you'd like to replicate. We'll add them to our system soon and notify you."}),(0,r.jsxs)("form",{onSubmit:B,children:[(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)("input",{type:"url",id:"linkedinUrl",value:z,onChange:e=>{M(e.target.value),O("")},placeholder:"https://www.linkedin.com/in/username",className:"w-full px-4 py-2 border-2 border-gray-200 rounded-lg focus:border-blue-500 focus:ring-2 focus:ring-blue-200 outline-none transition-all",disabled:A,required:!0})}),q&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-700",children:q})}),W&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-green-700",children:W})}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{E(!1),M(""),O(""),Y("")},className:"flex-1 px-4 py-2 border-2 border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-all font-medium",disabled:A,children:"Cancel"}),(0,r.jsx)("button",{type:"submit",disabled:A||!z.trim(),className:"flex-1 px-4 py-2 rounded-lg font-medium text-white transition-all ".concat(A||!z.trim()?"bg-gray-400 cursor-not-allowed":"bg-blue-500 hover:bg-blue-600"),children:A?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Submitting..."]}):"Submit"})]})]})]})})]})}},9008:function(e,t,s){e.exports=s(7828)}},function(e){e.O(0,[4838,4321,6660,4396,509,1664,5675,8005,3542,2655,5069,7517,196,3742,3061,2888,9774,179],function(){return e(e.s=45214)}),_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.