PageSourceSearch

https://www.wgoaa.org/assets/YoutubeVideos-CT3YrBcg.js

js wgoaa.org collected 2026-09-29 19:51:37 UTC 6,032 bytes, 2 lines download raw bytes

1import{Q as R,F as y,G as T,I as O,J as E,r as c,j as e,P as I,h as M,g as b,s as S}from"./index-DuBrVlzG.js";import{C as w,c as P}from"./card-cGqlRUPk.js";import{I as k}from"./input-BLjwDyPb.js";import{T as C,a as F,b as g}from"./tabs-sqgTESo8.js";import{S as Q}from"./search-jcwZ4c0f.js";import{L as V}from"./loader-circle-BnmemqfP.js";import{f as G}from"./format-BEMO4FpZ.js";import"./index-B0xIE0yr.js";import"./index-C0qRjAuG.js";import"./index-Dkc44KGJ.js";var W=class extends R{constructor(t,r){super(t,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:y()})}getOptimisticResult(t){return t.behavior=y(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,r){var u,s;const{state:a}=t,l=super.createResult(t,r),{isFetching:i,isRefetching:v,isError:h,isRefetchError:m}=l,n=(s=(u=a.fetchMeta)==null?void 0:u.fetchMore)==null?void 0:s.direction,x=h&&n==="forward",f=i&&n==="forward",p=h&&n==="backward",d=i&&n==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:T(r,a.data),hasPreviousPage:O(r,a.data),isFetchNextPageError:x,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:d,isRefetchError:m&&!x&&!p,isRefetching:v&&!f&&!d}}};function L(t,r){return E(t,W,r)}var Y="AspectRatio",A=c.forwardRef((t,r)=>{const{ratio:a=1/1,style:l,...i}=t;return e.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/a}%`},"data-radix-aspect-ratio-wrapper":"",children:e.jsx(I.div,{...i,ref:r,style:{...l,position:"absolute",top:0,right:0,bottom:0,left:0}})})});A.displayName=Y;var B=A;const D=B,ee=()=>{const[t,r]=c.useState(""),[a,l]=c.useState(""),[i,v]=c.useState("all"),h=c.useRef(null);c.useEffect(()=>{const s=setTimeout(()=>l(t),300);return()=>clearTimeout(s)},[t]);const{data:m,isLoading:n,error:x,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:d}=L({queryKey:["youtube-videos",a,i],queryFn:async({pageParam:s})=>{const{data:o,error:j}=await S.functions.invoke("youtube-videos",{body:{pageToken:s||"",query:a,type:i}});if(j)throw j;return o},initialPageParam:"",getNextPageParam:s=>s.nextPageToken??void 0,staleTime:1e3*60*60}),N=c.useCallback(s=>{const[o]=s;o.isIntersecting&&p&&!d&&f()},[f,p,d]);c.useEffect(()=>{const s=h.current;if(!s)return;const o=new IntersectionObserver(N,{threshold:.1});return o.observe(s),()=>o.disconnect()},[N]);const u=(m==null?void 0:m.pages.flatMap(s=>s.videos))??[];return e.jsxs("div",{children:[e.jsx(M,{title:"WGOAA Videos",description:"Watch the latest videos from Women Gun Owners Association of America on YouTube.",keywords:"women gun owners videos, firearms training videos, WGOAA YouTube"}),e.jsxs("section",{className:"relative bg-brand-black py-20 md:py-28 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 patriotic-stars"}),e.jsxs("div",{className:"relative container mx-auto px-4 text-center",children:[e.jsxs("h1",{className:"text-4xl md:text-6xl text-foreground",children:["WGOAA ",e.jsx("span",{className:"text-rose-gradient",children:"Videos"})]}),e.jsx("p",{className:"mt-4 text-lg text-foreground/70 max-w-2xl mx-auto",children:"The latest from the Women Gun Owners Association of America on YouTube"})]})]}),e.jsx("div",{className:"patriotic-stripe"}),e.jsx("section",{className:"bg-cream py-8",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-6xl space-y-4",children:[e.jsxs("div",{className:"relative max-w-md mx-auto",children:[e.jsx(Q,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(k,{placeholder:"Search videos...",value:t,onChange:s=>r(s.target.value),className:"pl-10"})]}),e.jsx(C,{value:i,onValueChange:v,className:"flex justify-center",children:e.jsxs(F,{children:[e.jsx(g,{value:"all",children:"All"}),e.jsx(g,{value:"videos",children:"Videos"}),e.jsx(g,{value:"livestreams",children:"Livestreams"}),e.jsx(g,{value:"shorts",children:"Shorts"})]})})]})}),e.jsx("section",{className:"bg-cream py-8 md:py-16",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-6xl",children:[e.jsx("h2",{className:"text-3xl md:text-4xl text-foreground mb-8",children:"All Videos"}),n&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array.from({length:6}).map((s,o)=>e.jsxs(w,{className:"overflow-hidden",children:[e.jsx(b,{className:"aspect-video w-full"}),e.jsxs(P,{className:"p-4",children:[e.jsx(b,{className:"h-5 w-full mb-2"}),e.jsx(b,{className:"h-4 w-24"})]})]},o))}),x&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"Unable to load videos right now. Please try again later."})}),u.length>0&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:u.map(s=>e.jsxs(w,{className:"overflow-hidden transition-shadow hover:shadow-lg",children:[e.jsx(D,{ratio:16/9,children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${s.videoId}`,title:s.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full border-0"})}),e.jsxs(P,{className:"p-4",children:[e.jsx("h3",{className:"font-semibold text-sm leading-snug line-clamp-2 text-card-foreground",children:s.title}),s.publishedAt&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:G(new Date(s.publishedAt),"MMM d, yyyy")})]})]},s.videoId))}),!n&&u.length===0&&!x&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"No videos found."})}),e.jsx("div",{ref:h,className:"flex justify-center py-8",children:d&&e.jsx(V,{className:"h-8 w-8 animate-spin text-muted-foreground"})})]})})]})};export{ee as default};
2//# sourceMappingURL=YoutubeVideos-CT3YrBcg.js.map

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.