PageSourceSearch

https://www.gs1nz.org/assets/Webinars-BsACq1_e.js

js gs1nz.org collected 2026-09-24 21:07:11 UTC 8,529 bytes, 1 lines download raw bytes

1import{j as e}from"./react-vendor-DgF5BvPh.js";import{u as _,L as D,w as F,V as N,r as o,U as G,v as g}from"./index-DR1xWILk.js";import{f as w}from"./formatTime-ClETPJl5.js";import{H as P}from"./HeroSection-CiCCupBh.js";import{T as B,a as I,b as h,c as p}from"./tabs-C8JthmL4.js";import{C as K}from"./CollectionSchema-D17bxwlG.js";import{i as V}from"./sessionVisibility-gLgQmdx5.js";import{P as y}from"./play--1LDbNRi.js";import{C as Z}from"./clock-u3LyO05l.js";import{d as $,L as E}from"./router-CYXz2GUs.js";import"./ui-vendor-DLQD4Y5c.js";import"./arrow-left-VklBH8pj.js";import"./index-Cu6FbsF-.js";import"./index-bhMWm8UO.js";const ae=()=>{const[L]=$(),q=L.get("type")==="on-demand"?"on-demand":"all",{data:S,isLoading:W}=_({queryKey:["webinars"],queryFn:async()=>{const{data:s,error:n}=await g.from("webinars").select("id, title, slug, description, content, video_url, webinar_type, recurrence_type, schedule_day, schedule_time, duration_minutes, topics, intended_audience, prerequisites, is_free_for_members, is_free_for_all, member_price, non_member_price, is_active, display_order, created_at, updated_at").eq("is_active",!0).order("display_order");if(n)throw n;return s}}),{data:d}=_({queryKey:["webinar-audiences-public"],queryFn:async()=>{const{data:s}=await g.from("webinar_audiences").select("*").eq("is_active",!0);return s||[]}}),{data:k}=_({queryKey:["webinar-upcoming-sessions-all"],queryFn:async()=>{const s=new Date;s.setDate(s.getDate()-1);const{data:n}=await g.from("webinar_sessions_public").select("id, webinar_id, session_date, start_time, end_time, status, show_on_website, hide_24h_before, max_attendees, created_at, audience_id").gte("session_date",s.toISOString().split("T")[0]).order("session_date");return(n||[]).filter(r=>V(r))}}),i=new Map;(k||[]).forEach(s=>{i.has(s.webinar_id)||i.set(s.webinar_id,s)});const l=(S||[]).filter(s=>s.webinar_type!=="live_one_off"||i.has(s.id)),j=l.filter(s=>s.webinar_type==="on_demand"),v=l.filter(s=>s.webinar_type==="live_scheduled"||s.webinar_type==="live_one_off"),b=l.filter(s=>s.webinar_type==="on_request"),T=s=>{const n=(d==null?void 0:d.filter(a=>a.webinar_id===s.id))||[];let r=s.schedule_day,m=s.schedule_time,t=s.recurrence_type;if(!r&&n.length>0){const a=n.filter(x=>x.schedule_day&&x.schedule_time);if(a.length>0){const x=a.every(f=>f.schedule_day===a[0].schedule_day),C=a.every(f=>f.schedule_time===a[0].schedule_time);x&&C&&(r=a[0].schedule_day,m=a[0].schedule_time),t==="none"&&a.length>0&&(t=a[0].recurrence_type)}}let u="";return t!=null&&t.startsWith("monthly")||t!=null&&t.includes("fullweek")?u=" (monthly)":t==="weekly"?u=" (weekly)":t==="fortnightly"&&(u=" (fortnightly)"),{day:r,time:m,recurrenceLabel:u}},c=({webinar:s})=>{const{day:n,time:r,recurrenceLabel:m}=T(s);return e.jsxs(E,{to:`/webinars/${s.slug}`,className:"bg-card p-6 rounded-xl shadow-card border border-border hover:shadow-hover transition-all group flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3 flex-wrap",children:[s.webinar_type==="on_demand"&&e.jsxs("span",{className:"px-2 py-1 bg-green-500/10 text-green-600 text-xs font-medium rounded-full flex items-center gap-1",children:[e.jsx(y,{className:"h-3 w-3"}),"Watch now"]}),s.webinar_type==="live_scheduled"&&e.jsx("span",{className:"px-2 py-1 bg-accent/10 text-accent text-xs font-medium rounded-full",children:"Live (scheduled)"}),s.webinar_type==="live_one_off"&&e.jsx("span",{className:"px-2 py-1 bg-accent/10 text-accent text-xs font-medium rounded-full",children:"Live (one-off)"}),s.webinar_type==="on_request"&&e.jsx("span",{className:"px-2 py-1 bg-blue-500/10 text-blue-600 text-xs font-medium rounded-full",children:"Live (on request)"}),(s.is_free_for_all||s.is_free_for_members)&&e.jsx("span",{className:"px-2 py-1 bg-green-500/10 text-green-600 text-xs font-medium rounded-full",children:s.is_free_for_all?"Free":"Free for members"}),s.duration_minutes&&e.jsxs("span",{className:"px-2 py-1 bg-muted text-muted-foreground text-xs rounded-full flex items-center gap-1",children:[e.jsx(Z,{className:"h-3 w-3"}),s.duration_minutes," min"]})]}),e.jsx("h2",{className:"font-heading font-semibold text-xl text-foreground mb-2 group-hover:text-accent transition-colors",children:s.title}),e.jsx("p",{className:"text-muted-foreground mb-4 line-clamp-3 flex-grow",children:s.description}),e.jsxs("div",{className:"mt-auto",children:[s.webinar_type==="on_demand"?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{children:"Watch recording"})]}):s.webinar_type==="live_one_off"&&i.get(s.id)?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsxs("span",{children:[new Date(`${i.get(s.id).session_date}T00:00:00`).toLocaleDateString("en-NZ",{weekday:"short",day:"numeric",month:"short",year:"numeric"}),i.get(s.id).start_time?` at ${w(i.get(s.id).start_time)}`:""]})]}):n&&r?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsxs("span",{children:[n,"s at ",w(r),m]})]}):s.webinar_type==="on_request"?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{children:"On request"})]}):((d==null?void 0:d.filter(t=>t.webinar_id===s.id).length)??0)>1?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{children:"Schedule varies"})]}
1):null,s.intended_audience&&e.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground mt-2",children:[e.jsx(G,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"line-clamp-2",children:s.intended_audience})]})]})]})};return e.jsxs(D,{title:"Webinars",description:"Live and on-demand training sessions to help you get the most out of GS1 standards and services.",children:[e.jsx(K,{path:"/webinars",name:"GS1 New Zealand webinars",description:"Live and on-demand online training sessions covering GS1 standards and services.",itemListName:"GS1 New Zealand webinars"}),e.jsx(P,{title:"Webinars",description:"Live and on-demand training sessions to help you get the most out of GS1 standards and services.",ctaText:"Back to support",ctaLink:"/support",ctaIsBack:!0,size:"default"}),e.jsx("section",{className:"py-16 lg:py-24 bg-background",children:e.jsx("div",{className:"container mx-auto",children:W?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(F,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs(B,{defaultValue:q,className:"w-full",children:[e.jsxs(I,{className:"mb-8",children:[e.jsx(h,{value:"all",children:"All webinars"}),e.jsx(h,{value:"on-demand",children:"Watch now"}),e.jsx(h,{value:"live-scheduled",children:"Live (scheduled)"}),e.jsx(h,{value:"on-request",children:"Live (on request)"})]}),e.jsxs(p,{value:"all",children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:l.map(s=>e.jsx(c,{webinar:s},s.id))}),l.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(N,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No webinars available at the moment."})]})]}),e.jsxs(p,{value:"on-demand",children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:j.map(s=>e.jsx(c,{webinar:s},s.id))}),j.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(y,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No on-demand webinars available."})]})]}),e.jsxs(p,{value:"live-scheduled",children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:v.map(s=>e.jsx(c,{webinar:s},s.id))}),v.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(o,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No live scheduled webinars available."})]})]}),e.jsxs(p,{value:"on-request",children:[e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:b.map(s=>e.jsx(c,{webinar:s},s.id))}),b.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(N,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No on-request webinars available."})]})]})]})})})]})};export{ae 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.