1import{y as q,a3 as H,l as X,A as i,a4 as e,X as k,al as S,F as t,ag as $,a9 as L,a5 as c,$ as J,a0 as B,a1 as K,D as p,j as _,_ as n,ak as W,ai as V,b as N,an as Z,aj as ee}from"./D0rPpKiU.js";import{L as te,E as se,Q as ae}from"#entry";import{_ as D}from"./7d6gfDXL.js";import"./D_gTWDL9.js";import"./wzWXuswT.js";const le=te("/sprites/icons/ui-icons.svg"),x="Total Published Pages",A={[x]:/.*/,"Total Published Pages (Excluding Test Patterns)":/^(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,"Total Test Pages":/(var\d*|ctl\d*|variation|test|backup)/i,VAR:/\bvar\d*\b/i,CTL:/\bctl\d*\b/i,Variation:/\bvariation\b/i,Backup:/backup(?!.*\b(var\d*|ctl\d*|variation|test)\b)/i,Test:/(?:^|[\\/_-])test(?:[\\/_-]|$)/i,Sales:/^(?=.*sales)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Certs:/^(?=.*certs)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Mastery:/^(?=.*mastery)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Masterclass:/^(?=.*masterclass)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Live:/^(?=.*live)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Replay:/^(?=.*replay)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Special:/^(?=.*special)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Membership:/^(?=.*membership)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Upsell:/^(?=.*upsell)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Upgrade:/^(?=.*upgrade)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,"Thank You":/^(?=.*thank-you)(?!.*(var\d*|ctl\d*|variation|test|backup)).*$/i,Others:/^(?!.*\b(var\d*|ctl\d*|variation|test|backup|masterclass|replay|sales|certs|mastery|special|live|membership|upsell|upgrade)\b).*$/i},oe={[x]:"All published pages, excluding playground, include, articles, and settings.","Total Published Pages (Excluding Test Patterns)":"All published pages that do not include test-related patterns such as var, ctl, variation, test, or backup.","Total Test Pages":"Pages related to testing, including var, ctl, variation, test, and backup.",VAR:'Pages with "var" followed by numbers (e.g., var1, var2).',CTL:'Pages with "ctl" followed by numbers (e.g., ctl1, ctl2).',Variation:'Pages containing the exact word "variation."',Backup:"Backup pages excluding other test-related patterns.",Test:'Pages containing the exact word "test" in URL segments.',Masterclass:"Masterclass pages excluding test-related patterns.",Replay:"Replay pages excluding test-related patterns.",Sales:"Sales pages excluding test-related patterns.",Certs:"Certification pages excluding test-related patterns.",Mastery:"Mastery pages excluding test-related patterns.",Special:"Special event pages excluding test-related patterns.",Live:"Live event pages excluding test-related patterns.",Membership:"Membership-related pages excluding test-related patterns.",Upsell:"Upsell pages excluding test-related patterns.",Upgrade:"Upgrade pages excluding test-related patterns.","Thank You":"Thank-you pages excluding test-related patterns.",Others:"Pages that do not match any of the above categories."},w=30;function re(r){return oe[r]??"Select a category to view more details."}function O(r,l){if(l===x)return r;const o=A[l];return o?r.filter(g=>o.test(g.slug)):[]}function ne(r){return Object.keys(A).reduce((l,o)=>(l[o]=O(r,o).length,l),{})}function ie(r,l){const o=l.trim().toLowerCase();return o?r.filter(g=>g.name.toLowerCase().includes(o)||g.slug.toLowerCase().includes(o)):r}function ce(r,l=w){return l<=0?1:Math.max(1,Math.ceil(r/l))}function de(r,l,o=w){const d=(Math.max(1,l)-1)*o;return r.slice(d,d+o)}const ue=le+"#external-link-outlined",pe={class:"min-h-screen bg-cool-grey-50"},ge={class:"w-full mx-auto px-5 lg:px-10 xl:max-w-[1640px] space-y-8 py-10"},be={class:"space-y-3"},ye={class:"flex items-center gap-4 border-b border-cool-grey-200"},ve={class:"flex items-center gap-5",role:"tablist","aria-label":"Storyblok space"},he=["aria-selected","disabled","onClick"],xe={key:0,class:"body-2-xs ml-auto pb-2 text-cool-grey-400",role:"status"},me={class:"body-small text-cool-grey-500"},fe={class:"body-small-bold"},ke={key:0},_e={key:0,class:"body-small text-cool-grey-500"},we={class:"body-small text-red-700"},Ce={class:"title-bold-1 text-cool-grey-700"},Pe={class:"overline-text text-cool-grey-500"},Te=["value"],Se={class:"body-2-xs mt-2 text-cool-grey-500"},$e={key:0,class:"space-y-4"},Le={class:"body-small text-cool-grey-700"},Ae={class:"flex shrink-0 items-center gap-3"},Me=["href"],Ee=["href","title","aria-label"],Re={class:"flex items-center justify-center gap-6"},Ue=["disabled"],Be={class:"body-small text-cool-grey-500"},Ve=["disabled"],Ne={key:1,class:"body-small text-cool-grey-500"},Ye=q({__name:"storyblok-stats",async setup(r){let l,o;se({title:"Storyblok Stats (internal)",meta:[{name:"robots",content:"noindex, nofollow"}]});const g=[{key:"pagebuilder",label:"PageBuilder"},{key:"nextgen",label:"NextGen"}],d=_("pagebuilder"),{data:M,status:j,error:E}=([l,o]=H(()=>ae("storyblok-published-links",()=>$fetch(`/api/storyblok/published-links?space=${d.value}`),{watch:[d]})),l=await l,o(),l),m=p(()=>j.value==="pending"),C=p(()=>M.value?.links??[]),f=p(()=>M.value?.spaceId??null),G=p(()=>g.find(v=>v.key===d.value)?.label??"");function R(v){return f.value?`https://app.storyblok.com/#/me/spaces/${f.value}/stories/0/0/${v}`:null}const b=_(x),y=_(""),u=_(1);function I(v){m.value||v===d.value||(d.value=v,b.value=x,y.value="",u.value=1)}const Y=p(()=>ne(C.value)),F=p(()=>re(b.value)),P=p(()=>ie(O(C.value,b.value),y.value)),T=p(()=>ce(P.value.length,w)),U=p(()=>de(P.value,u.value,w));X([b,y],()=>{u.value=1});function z(){u.value<T.value&&(u.value+=1)}function Q(){u.value>1&&(u.value-=1)}return(v,s)=>
1(n(),i("div",pe,[s[10]||(s[10]=e("header",{class:"w-full border-b border-cool-grey-200 bg-white"},[e("div",{class:"w-full mx-auto px-5 lg:px-10 xl:max-w-[1640px] flex h-[80px] flex-row items-center justify-between"},[e("img",{src:"https://static.mindvalley.com/public/assets/2019/09/mv-logo-horizontal-colour.svg",alt:"Mindvalley",width:"153",height:"24",class:"h-6 w-[153px] object-contain"}),e("span",{class:"button-text-small flex h-[18px] items-center px-2 text-cool-grey-700"}," Internal tooling ")])],-1)),e("main",ge,[e("div",be,[e("div",ye,[e("div",ve,[(n(),i(k,null,S(g,a=>e("button",{key:a.key,type:"button",role:"tab","aria-selected":t(d)===a.key,disabled:t(m),class:W(["title-2 -mb-px border-b-2 pb-2 transition-colors disabled:cursor-not-allowed",t(d)===a.key?"border-purple-600 text-cool-grey-700":"border-transparent text-cool-grey-400 hover:text-cool-grey-600 disabled:hover:text-cool-grey-400"]),onClick:h=>I(a.key)},c(a.label),11,he)),64))]),s[2]||(s[2]=e("span",{class:"title-2 pb-2 text-cool-grey-700"},"Stats",-1)),t(m)?(n(),i("span",xe," Loading⦠")):$("",!0)]),e("p",me,[s[3]||(s[3]=L(" Published page counts by category, from the ",-1)),e("strong",fe,c(t(G)),1),s[4]||(s[4]=L(" space",-1)),t(f)?(n(),i("span",ke," ("+c(t(f))+")",1)):$("",!0),s[5]||(s[5]=L(". ",-1))])]),t(m)&&!t(C).length?(n(),i("p",_e," Loading published links⦠")):t(E)?(n(),J(D,{key:1,padding:"p-4",class:"border border-red-300",background:"bg-red-50"},{default:B(()=>[e("p",we," Failed to load published links: "+c(t(E).message),1)]),_:1})):(n(),i(k,{key:2},[K(D,{padding:"p-6",class:"flex flex-col space-y-6"},{default:B(()=>[e("div",null,[e("p",Ce,c(t(P).length),1),e("p",Pe,c(t(y)?"Matching entries":"Published pages"),1)]),e("div",null,[s[6]||(s[6]=e("label",{for:"category",class:"sr-only"},"Category",-1)),V(e("select",{id:"category","onUpdate:modelValue":s[0]||(s[0]=a=>N(b)?b.value=a:null),class:"body-small w-full rounded-lg border border-cool-grey-300 bg-white p-3 text-cool-grey-700"},[(n(!0),i(k,null,S(t(A),(a,h)=>(n(),i("option",{key:h,value:h},c(h)+" ("+c(t(Y)[h]??0)+") ",9,Te))),128))],512),[[Z,t(b)]]),e("p",Se,c(t(F)),1)]),e("div",null,[s[7]||(s[7]=e("label",{for:"search",class:"sr-only"},"Search",-1)),V(e("input",{id:"search","onUpdate:modelValue":s[1]||(s[1]=a=>N(y)?y.value=a:null),type:"text",placeholder:"Search within selected categoryâ¦",class:"body-small w-full rounded-lg border border-cool-grey-300 p-3 text-cool-grey-700"},null,512),[[ee,t(y)]])])]),_:1}),t(U).length>0?(n(),i("section",$e,[s[9]||(s[9]=e("h2",{class:"title-bold-6 text-center text-cool-grey-700"},"Page Links",-1)),e("ul",null,[(n(!0),i(k,null,S(t(U),a=>(n(),i("li",{key:a.id,class:"flex items-center justify-between gap-6 border-b border-cool-grey-200 py-3"},[e("span",Le,c(a.name),1),e("span",Ae,[e("a",{href:`https://www.mindvalley.com/${a.slug}`,target:"_blank",rel:"noopener noreferrer",class:"body-small text-purple-600 hover:underline"}," /"+c(a.slug),9,Me),R(a.id)?(n(),i("a",{key:0,href:R(a.id)||void 0,target:"_blank",rel:"noopener noreferrer",class:"text-cool-grey-400 transition-colors hover:text-purple-600",title:`Edit â${a.name}â in Storyblok`,"aria-label":`Edit ${a.name} in Storyblok`},[...s[8]||(s[8]=[e("svg",{class:"h-4 w-4","aria-hidden":"true"},[e("use",{href:ue})],-1)])],8,Ee)):$("",!0)])]))),128))]),e("div",Re,[e("button",{type:"button",disabled:t(u)===1,class:"button-text-small text-purple-600 disabled:opacity-40",onClick:Q}," Previous ",8,Ue),e("span",Be,c(t(u))+" of "+c(t(T)),1),e("button",{type:"button",disabled:t(u)>=t(T),class:"button-text-small text-purple-600 disabled:opacity-40",onClick:z}," Next ",8,Ve)])])):(n(),i("p",Ne," No pages match the current filters. "))],64))])]))}});export{Ye as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.