"use strict";(()=>{var e={};e.id=630,e.ids=[630],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},4770:e=>{e.exports=require("crypto")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},7462:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>w,requestAsyncStorage:()=>l,routeModule:()=>h,serverHooks:()=>g,staticGenerationAsyncStorage:()=>y});var s={};t.r(s),t.d(s,{GET:()=>c,POST:()=>u});var o=t(9303),a=t(8716),n=t(670),i=t(7070),d=t(9911),p=t(5735);async function c(){let e=await (0,p.W9)();return i.NextResponse.json({trendResearch:e.trendResearch})}async function u(e){let r=await e.json().catch(()=>({})),t=String(r.seedKeyword||r.keyword||"").trim();if(!t)return i.NextResponse.json({error:"seedKeyword required"},{status:400});let s=new Date().toISOString(),o=String(r.market||"US"),a=[{keyword:`${t} ideas`,category:"content",intent:"idea",score:82,reason:"Pinterest 用户常以 ideas 寻找可执行灵感。"},{keyword:`${t} aesthetic`,category:"style",intent:"seasonal",score:74,reason:"适合扩展视觉风格、图板命名和素材方向。"},{keyword:`${t} diy`,category:"how-to",intent:"idea",score:68,reason:"教程型 Pin 通常更容易保存。"},{keyword:`${t} shopping`,category:"commerce",intent:"shopping",score:66,reason:"适合承接商品 Pin、目录和落地页。"},{keyword:`${t} gift`,category:"seasonal",intent:"seasonal",score:61,reason:"可用于节日和送礼场景内容日历。"}],n={id:(0,p.Mc)("trend"),seedKeyword:t,market:o,terms:a,summary:`已围绕「${t}」生成 ${a.length} 个趋势/内容方向。接入 Pinterest Trends API 后可替换为真实热度数据。`,createdAt:s},c=await (0,p.W9)(),u=await (0,d.Qt)(c,"trend_research");return u.ok?(c.trendResearch.unshift(n),(0,p.Vt)(c,{type:"trend",actor:"user",title:"创建趋势研究",detail:`${t} / ${o}`,status:"completed"}),await (0,p.lX)(c),i.NextResponse.json({research:n})):(await (0,p.lX)(c),i.NextResponse.json({ok:!1,error:u.error,snapshot:u.snapshot},{status:u.status}))}let h=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/trends/research/route",pathname:"/api/trends/research",filename:"route",bundlePath:"app/api/trends/research/route"},resolvedPagePath:"/Users/momo/Project/pinterest-auto/app/api/trends/research/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:y,serverHooks:g}=h,m="/api/trends/research/route";function w(){return(0,n.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:y})}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[276,972,145],()=>t(7462));module.exports=s})();