const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./qj_uDOqG.js","./-dIGDsTg.js","./entry.CTdsRwLo.css"])))=>i.map(i=>d[i]); import{G as f,H as y,I as g,J as $}from"./-dIGDsTg.js";const m={content:"v3.5.0--vC_ZbTkG2af2qJnIQlE4mhwq_MJcFVVttpKmyNo2ES0"},S={content:"_content_content",info:"_content_info"},b={content:{type:"page",fields:{id:"string",title:"string",body:"json",cards:"json",description:"string",extension:"string",hero:"json",leadForm:"json",meta:"json",navigation:"json",path:"string",sections:"json",seo:"json",stem:"string"}},info:{type:"data",fields:{}}},d=(s,o)=>{const e=s._conditions;return e.length>0?`(${e.join(` ${o} `)})`:""},l=s=>{const o=[],e={_conditions:o,where(n,i,t){let r;switch(i.toUpperCase()){case"IN":case"NOT IN":if(Array.isArray(t)){const c=t.map(a=>u(a)).join(", ");r=`"${String(n)}" ${i.toUpperCase()} (${c})`}else throw new TypeError(`Value for ${i} must be an array`);break;case"BETWEEN":case"NOT BETWEEN":if(Array.isArray(t)&&t.length===2)r=`"${String(n)}" ${i.toUpperCase()} ${u(t[0])} AND ${u(t[1])}`;else throw new Error(`Value for ${i} must be an array with two elements`);break;case"IS NULL":case"IS NOT NULL":r=`"${String(n)}" ${i.toUpperCase()}`;break;case"LIKE":case"NOT LIKE":r=`"${String(n)}" ${i.toUpperCase()} ${u(t)}`;break;default:r=`"${String(n)}" ${i} ${u(typeof t=="boolean"?Number(t):t)}`}return o.push(`${r}`),e},andWhere(n){const i=n(l());return o.push(d(i,"AND")),e},orWhere(n){const i=n(l());return o.push(d(i,"OR")),e}};return e},w=(s,o)=>{const e={conditions:[],selectedFields:[],offset:0,limit:0,orderBy:[],count:{field:"",distinct:!1}},n={__params:e,andWhere(t){const r=t(l());return e.conditions.push(d(r,"AND")),n},orWhere(t){const r=t(l());return e.conditions.push(d(r,"OR")),n},path(t){return n.where("path","=",f(t))},skip(t){return e.offset=t,n},where(t,r,c){return n.andWhere(a=>a.where(String(t),r,c)),n},limit(t){return e.limit=t,n},select(...t){return t.length&&e.selectedFields.push(...t),n},order(t,r){return e.orderBy.push(`"${String(t)}" ${r}`),n},async all(){return o(s,i()).then(t=>t||[])},async first(){return o(s,i({limit:1})).then(t=>t[0]||null)},async count(t="*",r=!1){return o(s,i({count:{field:String(t),distinct:r}})).then(c=>c[0].count)}};function i(t={}){let r="SELECT ";if(t?.count)r+=`COUNT(${t.count.distinct?"DISTINCT ":""}${t.count.field}) as count`;else{const a=Array.from(new Set(e.selectedFields));r+=a.length>0?a.map(p=>`"${String(p)}"`).join(", "):"*"}r+=` FROM ${S[String(s)]}`,e.conditions.length>0&&(r+=` WHERE ${e.conditions.join(" AND ")}`),e.orderBy.length>0?r+=` ORDER BY ${e.orderBy.join(", ")}`:r+=" ORDER BY stem ASC";const c=t?.limit||e.limit;return c>0&&(e.offset>0?r+=` LIMIT ${c} OFFSET ${e.offset}`:r+=` LIMIT ${c}`),r}return n};function u(s){return`'${String(s).replace(/'/g,"''")}'`}async function h(s,o,e,n){const i=s?y(s):{};i["accept-encoding"]=void 0;const t=`/__nuxt_content/${o}/${e}`,r={...n,headers:{...i,...n.headers},query:{v:m[String(o)],t:void 0}};return s?await s.$fetch(t,r):await $fetch(t,r)}async function C(s,o){return h(s,o,"sql_dump.txt",{responseType:"text",headers:{"content-type":"text/plain"}})}async function E(s,o,e){return h(s,o,"query",{headers:{"content-type":"application/json"},method:"POST",body:{sql:e}})}const I=s=>{const o=g()?.ssrContext?.event;return w(s,(e,n)=>_(o,e,n))};async function _(s,o,e){return window.WebAssembly?N(o,e):E(s,String(o),e)}async function N(s,o){return await $(()=>import("./qj_uDOqG.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(n=>n.loadDatabaseAdapter(s)).then(n=>n.all(o))}export{m as a,b as c,C as f,I as q,S as t};