TOPVERSE_Official/.output/public/_nuxt/PageView.ee39761d.js

2 lines
1.8 KiB
JavaScript

import{h as C,u as F}from"./index.c0f9b2a4.js";import{u as l,j as $,k as D,a as E,l as L,m as T,o as V,e as B,f as y,t as _,p as O}from"./entry.a42f0781.js";function R(o,a,s){const[t={},n]=typeof a=="string"?[{},a]:[a,s],e=t.key||C([n,l(t.baseURL),typeof o=="string"?o:"",l(t.params||t.query)]);if(!e||typeof e!="string")throw new TypeError("[nuxt] [useFetch] key must be a string: "+e);if(!o)throw new Error("[nuxt] [useFetch] request is missing.");const u=e===n?"$f"+e:e,c=$(()=>{let r=o;return typeof r=="function"&&(r=r()),l(r)});if(!t.baseURL&&typeof c.value=="string"&&c.value.startsWith("//"))throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:m,lazy:g,default:w,transform:v,pick:A,watch:f,immediate:x,...b}=t,p=D({...b,cache:typeof t.cache=="boolean"?void 0:t.cache}),k={server:m,lazy:g,default:w,transform:v,pick:A,immediate:x,watch:f===!1?[]:[p,c,...f||[]]};let i;return F(u,()=>{var h;return(h=i==null?void 0:i.abort)==null||h.call(i),i=typeof AbortController<"u"?new AbortController:{},typeof c.value=="string"&&c.value.startsWith("/"),(t.$fetch||globalThis.$fetch)(c.value,{signal:i.signal,...p})},k)}function d(o){let a,s=o[0],t=1;for(;t<o.length;){const n=o[t],e=o[t+1];if(t+=2,(n==="optionalAccess"||n==="optionalCall")&&s==null)return;n==="access"||n==="optionalAccess"?(a=s,s=e(s)):(n==="call"||n==="optionalCall")&&(s=e((...u)=>s.call(a,...u)),a=void 0)}return s}const U={"text-gray:80":""},M={"font-500":"","text-gray":""},N={"text-gray":""},q=E({__name:"PageView",async setup(o){let a,s;const{data:t}=([a,s]=L(()=>R("/api/pageview","$GYaFMVMIJ4")),a=await a,s(),a),n=T(()=>d([t,"access",e=>e.value,"optionalAccess",e=>e.startAt])||0);return(e,u)=>(V(),B("div",U,[y("span",M,_(d([l,"call",c=>c(t),"optionalAccess",c=>c.pageview])),1),O(" page views since "),y("span",N,_(l(n)),1)]))}});export{q as default};