"use strict";(()=>{vare={};e.id=2927,e.ids=[2927],e.modules={27825:e=>{e.exports=require("lodash")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},72583:e=>{e.exports=require("sanitize-html")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},24296:(e,t,a)=>{a.r(t),a.d(t,{config:()=>R,default:()=>w,routeModule:()=>x});varr={};a.r(r),a.d(r,{default:()=>v});vars=a(89947),n=a(2706),l=a(96762),o=a(77509),i=a.n(o),d=a(73921),c=a.n(d),u=a(29131),p=a.n(u),_=a(30573),g=a.n(_),E=a(6983),f=a.n(E),S=a(46238),y=a.n(S),m=a(19131),h=a.n(m);asyncfunctionv(e,t){if("POST"!==e.method)returnt.json({success:!1,msg:"Wrong Method"});leta=awaith()(e);if(!a?.logged_in_status)returnt.json({success:!1,log:"Unauthorized"});let{action:r}=e.query,s=e.body;try{lete;switch(r){case"add-page":e=awaiti()({body:s});break;case"update-page":e=awaiti()({body:s,update:!0});break;case"delete-page":e=awaitc()({body:s});break;case"get-snippets":e=awaitp()();break;case"grab-parent-pages":e=awaitf()({body:s});break;case"get-child-pages":e=awaitg()({body:s});break;case"persist":e=awaity()({body:s})}if(!e)throwError("Operation failed!");t.json({success:!0,result:e})}catch(e){t.json({success:!1})}}letw=(0,l.M)(r,"default"),R=(0,l.M)(r,"config"),x=news.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/admin/docs/[action]",pathname:"/api/admin/docs/[action]",bundlePath:"",filename:""},userland:r})},77509:(e,t,a)=>{letr=a(72583),s=a(51348),n=a(47670),l=a(16570);e.exports=asyncfunction({body:e,update:t}){leta=e.title.toLowerCase().replace(/ /g,"-").replace(/[^a-z0-9\-]/g,""),o=awaitasyncfunction(){if(t)returnnull;try{return(awaits("SELECT page_order FROM docs_pages ORDER BY page_order DESC LIMIT 1"))[0].page_order}catch(e){returnnull}}(),i=awaitn({data:{title:e.title,slug:a,description:r(e.description,l),content:r(e.content,l),text_content:e.text_content,level:e.level,page_order:t?e.page_order:parseInt(o)+1,parent_id:e?.parent_id},tableName:"docs_pages",update:t,duplicateColumnName:"id",duplicateColumnValue:e.id});returni?.insertId?i:t&&i.affectedRows?i:null}},73921:(e,t,a)=>{letr=a(51348);e.exports=asyncfunction({body:e}){returnawaitr("DELETE FROM docs_pages WHERE id=?",[e.id])||null}},29131:(e,t,a)=>{letr=a(29021);e.exports=asyncfunction(){lete="./components/su/components/RichText/html-presets",t=[];returnr.existsSync(e)&&r.readdirSync(e).forEach(a=>{if(a?.endsWith(".html")){lets={};s[a.replace(/\.html$/,"")]=r.readFileSync(`${e}/${a}`,"utf-8"),t.push({...s})}}),t}},30573:(e,t,a)=>{a(29021);letr=a(51348);e.exports=asyncfunction({body:e}){lett=awaitr("SELECT id, title, slug FROM docs_pages WHERE parent_id = ?",[e.pageId]);returnt[0]?t:null}},6983:(e,t,a)=>{letr=a(51348);e.exports=asyncfunction({body:e}){returne?.currentPageId?awaitr("SELECT * FROM docs_pages WHERE level = ? AND id != ?",[e.pagesLevel,e.currentPageId]):awaitr("SELECT * FROM docs_pages WHERE level = ?",[e.pagesLevel])}},46238:(e,t,a)=>{letr=a(29021),s=a(51348);e.exports=asyncfunction({body:e}){let{pull:t}=e,a="./jsonData/docs.json";if(t)try{lete=JSON.parse(r.readFileSync(a,"utf-8"));for(lett=0;t<e.length;t++){leta=e[t],r=awaits("SELECT id FROM docs_pages WHERE slug = ? AND level = ?",[a.slug,a.level]);if(r&&r[0]){lete={...a};deletee.date_created,deletee.date_created_code,deletee.date_created_timestamp,deletee.date_updated,deletee.date_updated_code,deletee.date_updated_timestamp,deletee.id,awaits(`UPDATE docs_pages SET ? WHERE slug = '${a.slug}' AND level = '${a.level}'`,e)}else{lete={...a};deletee.date_created_timestamp,deletee.date_updated_timestamp,awaits("INSERT INTO docs_pages SET ?",e)}}}catch(e){returnnull}else{lete=awaits("SELECT * FROM docs_pages");r.writeFileSync(a,JSON.stringify(e,null,4),"utf-8")}return!0}},19131:(e,t,a)=>{let{IncomingMessage:r}=a(81630),s=a(72835),n=a(31341);e.exports=as