(()=>{var e={};e.id=7832,e.ids=[7832],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},39300:(e,t,r)=>{"use strict";r.r(t),r.d(t,{categories:()=>d,medias:()=>u,metaRelations:()=>g,options:()=>l,posts:()=>p,tags:()=>c,templates:()=>m});var s=r(81598),o=r(70932),n=r(22077),a=r(89283),i=r(49930);let l=(0,s.D)("options",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),optionName:(0,n.sH)("option_name").default().notNull(),optionValue:(0,n.sH)("option_value").notNull()}),u=(0,s.D)("medias",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}),name:(0,a.Qq)("name").notNull(),description:(0,a.Qq)("description"),extension:(0,a.Qq)("extension").default("NA").notNull(),url:(0,a.Qq)("url").notNull(),timeCreated:(0,n.sH)("time_created").default((0,i.ll)`(CURRENT_TIMESTAMP)`),timeModified:(0,n.sH)("time_modified").default((0,i.ll)`(CURRENT_TIMESTAMP)`)}),d=(0,s.D)("categories",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),category:(0,n.sH)("category").notNull(),description:(0,n.sH)("description").notNull(),slug:(0,n.sH)("slug").notNull(),parent:(0,n.sH)("parent").notNull()}),p=(0,s.D)("posts",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),title:(0,a.Qq)("title").notNull(),content:(0,n.sH)("content"),slug:(0,n.sH)("slug").notNull(),timeCreated:(0,n.sH)("time_created").default((0,i.ll)`(CURRENT_TIMESTAMP)`).notNull(),timeModified:(0,n.sH)("time_modified").default((0,i.ll)`(NULL)`),status:(0,n.sH)("status").default("draft").notNull(),isTop:(0,n.sH)("is_top").notNull(),excerpt:(0,a.Qq)("excerpt"),featureImg:(0,a.Qq)("feature_img")}),c=(0,s.D)("tags",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),tag:(0,n.sH)("tag").notNull(),description:(0,n.sH)("description").notNull(),slug:(0,n.sH)("slug").notNull()}),m=(0,s.D)("templates",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),title:(0,a.Qq)("title").notNull(),content:(0,n.sH)("content").notNull()}),g=(0,s.D)("meta_relations",{id:(0,o.nd)("id").primaryKey({autoIncrement:!0}).notNull(),metaId:(0,n.sH)("meta_id"),type:(0,n.sH)("type"),postId:(0,n.sH)("post_id").references(()=>p.id)})},42617:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>y,routeModule:()=>p,serverHooks:()=>g,workAsyncStorage:()=>c,workUnitAsyncStorage:()=>m});var s={};r.r(s),r.d(s,{POST:()=>d});var o=r(96559),n=r(48088),a=r(37719),i=r(32190),l=r(63095),u=r(49930);async function d(e){let t=await (0,l.A)().all((0,u.ll)`SELECT c.id, c.category,count(c.id) AS count FROM categories AS c JOIN meta_relations AS mr ON c.id = mr.meta_id AND  mr.type = 'category' GROUP BY c.id ORDER BY count DESC`);return Object.keys(t).length>0?i.NextResponse.json({data:t,success:!0}):i.NextResponse.json({data:t,success:!1})}let p=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/[locale]/api/post/get-post-count-by-category/route",pathname:"/[locale]/api/post/get-post-count-by-category",filename:"route",bundlePath:"app/[locale]/api/post/get-post-count-by-category/route"},resolvedPagePath:"E:\\xampp01\\htdocs\\wx-saas\\timynote\\app\\[locale]\\api\\post\\get-post-count-by-category\\route.tsx",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:c,workUnitAsyncStorage:m,serverHooks:g}=p;function y(){return(0,a.patchFetch)({workAsyncStorage:c,workUnitAsyncStorage:m})}},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63095:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(87550),o=r.n(s),n=r(46267),a=r(39300);let i=()=>{let e=new(o())("./contents/data.db");return(0,n.f)(e,{schema:a})}},78335:()=>{},87550:e=>{"use strict";e.exports=require("better-sqlite3")},96487:()=>{}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[4447,580,902],()=>r(42617));module.exports=s})();