1import{o as e}from"./jJw1AbnH.js";import{A as t,Et as n,dt as r,f as i,kt as a}from"./DyLOZYLg.js";import{p as o}from"./BnwoXePe.js";import{t as s}from"./HclGiUj8.js";import{c}from"./DaO1HPBT.js";import{r as l}from"./h1MNmxMc.js";var u=()=>{let t=e().public.apiEndpoint;if(!t.startsWith(`http`))try{t=location.origin+t}catch{}return t},d=class{baseURL;defaultHeaders;constructor(e,t={}){this.baseURL=e||``,this.defaultHeaders={"Content-Type":`application/json`,...t}}async pureRequest(t,n={}){e();let r=t.startsWith(`http`)?t:`${this.baseURL}${t}`,i=new URL(r);n.params&&Object.entries(n.params).forEach(([e,t])=>{t!=null&&i.searchParams.append(e,String(t))});let a={...this.defaultHeaders,...n.headers};return n.token&&(a.Authorization=`Bearer ${n.token}`),fetch(i.toString(),{method:n.method||`get`,headers:a,body:n.body?JSON.stringify(n.body):void 0})}async request(t,n={}){e();let r=t.startsWith(`http`)?t:`${this.baseURL}${t}`,i=new URL(r);n.params&&Object.entries(n.params).forEach(([e,t])=>{t!=null&&i.searchParams.append(e,String(t))});let a={...this.defaultHeaders,...n.headers};n.token&&(a.Authorization=`Bearer ${n.token}`);try{let e=await fetch(i.toString(),{method:n.method||`get`,headers:a,body:n.body?JSON.stringify(n.body):void 0});if(!e.ok)throw Error(`Request failed: ${e.status}`);return{data:await e.json(),status:e.status,ok:!0}}catch(e){return{data:null,status:500,ok:!1,error:e}}}get(e,t={}){return this.request(e,{...t,method:`get`})}post(e,t,n={}){return this.request(e,{...n,body:t,method:`post`})}put(e,t,n={}){return this.request(e,{...n,body:t,method:`put`})}delete(e,t={}){return this.request(e,{...t,method:`delete`})}patch(e,t,n={}){return this.request(e,{...n,body:t,method:`patch`})}},f=()=>new d(u()),p={get:(e,t={})=>f().get(e,t),post:(e,t,n={})=>f().post(e,t,n),put:(e,t,n={})=>f().put(e,t,n),delete:(e,t={})=>f().delete(e,t),patch:(e,t,n={})=>
1f().patch(e,t,n)},m=async e=>await(await fetch(`/api/portal-login`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})).json(),h=async e=>await(await fetch(o(`/api/portal-veracross/authorize`,{...e.redirect_url?{redirect_url:e.redirect_url}:{},...e.callback_path?{callback_path:e.callback_path}:{}}))).json(),g=async e=>await(await fetch(`/api/portal-veracross/token-login`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})).json(),_=async()=>(await p.get(`/node_type/node_type`)).data,v=async e=>(await p.get(`/field_config/field_config`,{params:e})).data,y=async(e,t={})=>(await p.get(e,{params:t}))?.data,b=async(e={})=>(await p.get(`/taxonomy_vocabulary/taxonomy_vocabulary`,{params:e})).data,x=async e=>{let{pageId:t,menuId:n,lang:r=`en`}=e,i=t?{"filter[group_0_condition_0][condition][path]":`field_pages_ref.id`,"filter[group_0_condition_0][condition][value]":t,"filter[group_0_condition_0][condition][operator]":`=`,"filter[group_0_condition_0][condition][memberOf]":`group_0`,"filter[group_0_condition_1][condition][value]":t,"filter[group_0_condition_1][condition][path]":`field_page_ids`,"filter[group_0_condition_1][condition][operator]":`CONTAINS`,"filter[group_0_condition_1][condition][memberOf]":`group_0`}:{},a=n?{"filter[group_0_condition_2][condition][value]":n,"filter[group_0_condition_2][condition][path]":`field_menu_ids`,"filter[group_0_condition_2][condition][operator]":`CONTAINS`,"filter[group_0_condition_2][condition][memberOf]":`group_0`}:{},o={"filter[main_group][group][conjunction]":`AND`,"filter[group_0][group][conjunction]":`OR`,"filter[group_0][condition][memberOf]":`main_group`,...i,...a,"filter[group_0_condition_3][condition][path]":`field_apply_to_all_pages`,"filter[group_0_condition_3][condition][value]":`1`,"filter[group_0_condition_3][condition][operator]":`=`,"filter[group_0_condition_3][condition][memberOf]":`group_0`,"filter[group_1][group][conjunction]":`AND`,"filter[group_1][condition][memberOf]":`main_group`,"filter[group_1_condition_0][condition][path]":`field_visible`,"filter[group_1_condition_0][condition][value]":`1`,"filter[group_1_condition_0][condition][operator]":`=`,"filter[group_1_condition_0][condition][memberOf]":`group_1`,"filter[group_2][group][
1conjunction]":`OR`,"filter[group_2][condition][memberOf]":`main_group`,"filter[group_2_condition_0][condition][path]":`field_effective_language`,"filter[group_2_condition_0][condition][value]":r,"filter[group_2_condition_0][condition][operator]":`=`,"filter[group_2_condition_0][condition][memberOf]":`group_2`,"filter[group_2_condition_1][condition][path]":`field_effective_language`,"filter[group_2_condition_1][condition][operator]":`IS NULL`,"filter[group_2_condition_1][condition][memberOf]":`group_2`,sort:`-changed`},s=new URLSearchParams;return Object.entries(o).forEach(([e,t])=>{s.append(e,String(t))}),(await fetch(`/api/public-page-popup?${s.toString()}`,{method:`GET`})).json()},S=async e=>{let t={"page[limit]":50,"page[offset]":0,...e},n=new URLSearchParams;return Object.entries(t).forEach(([e,t])=>{n.append(e,String(t))}),(await fetch(`/api/search?${n.toString()}`,{method:`GET`})).json()},C=async e=>(await J({url:`/v1/public/user-infos/list`,method:`POST`,body:JSON.stringify(e)})).json(),w=async()=>(await J({url:`/v1/public/upms/roles/list`,method:`POST`,body:JSON.stringify({})})).json(),T=async()=>(await J({url:`/v1/user-filter-tree/list`,method:`GET`})).json(),E={async list(e){return(await J({url:`/v1/public/athletic-teams/list`,method:`POST`,body:JSON.stringify(e)})).json()},async getEventList(e){return(await J({url:`/v1/public/athletic-events/list`,method:`POST`,body:JSON.stringify(e)})).json()},async getEventDetail(e){return(await J({url:`/v1/public/athletic-events`,method:`GET`,body:JSON.stringify(e)})).json()},async listAllSchools(){return(await J({url:`/v1/public/athletic-team-class-schools/list`,method:`POST`,body:JSON.stringify({})})).json()},async listAllSeasons(){return(await J({url:`/v1/public/athletic-team-class-seasons/list`,method:`POST`,body:JSON.stringify({})})).json()}},D=function(e){return e[e.Unspecified=0]=`Unspecified`,e[e.AllDay=1]=`AllDay`,e[e.SpecifiedTime=2]=`SpecifiedTime`,e}({}),O={async list(){return(await J({url:`/v1/public/calendars/list`,method:`POST`,body:JSON.stringify({})})).json()},async detail(e){return(await J({url:`/v1/public/athletic-events/${e}`,method:`GET`})).json()},async listGroup(){return(await J({url:`/v1/public/calendar-groups/list`,method:`POST`,body:JSON.stringify({})})).json()},async listLeague(){return(await J({url:`/v1/public/athletic-team-class-leagues/list`,method:`POST`,body:JSON.stringify({})})).json()},async listTeam(){return(await J({url:`/v1/public/athletic-teams/list`,method:`POST`,body:JSON.stringify({})})).json()},async listCalendarEvent(e){return(await J({url:`/v1/public/calendar-events/list`,method:`POST`,body:JSON.stringify(e)})).json()}},k=function(e){return e[e.AthleticEvent=1]=`AthleticEvent`,e[e.AthleticTeam=2]=`AthleticTeam`,e[e.Post=3]=`Post`,e[e.CalendarType=4]=`CalendarType`,e[e.CalendarEventType=5]=`CalendarEventType`,e}({}),A=function(e){return e[e.Email=1]=`Email`,e[e.Sms=2]=`Sms`,e}({}),j=function(e){return e.EventDetail=`EventDetail`,e.CancellationsPostponementsChanges=`Cancellations/Postponements/Changes`,e}({}),M={async subscribe(e){return(await J({url:`/v1/calendar-subscribes`,method:`POST`,body:JSON.stringify(e)})).json()},async unsubscribe(e){return(await J({url:`/v1/calendar-subscribes/${e.id}`,method:`DELETE`})).json()},async getAllSubscription(){return(await J({url:`/v1/calendar-subscribes/getMySubscribe`,method:`POST`,body:JSON.stringify({})})).json()},getCalendarICalUrl(e){return`${F.value}/v1/calendar-events/event/${e}`},getTeamICalUrl(e){return`${F.value}/v1/ical/team/${e}`},getEventICalUrl(e){return`${F.value}/v1/ical/event/${e}`}},N={async getUserInfo(e){if(e)return(await J({url:`/v1/user-infos/${e}`,method:`GET`})).json()}},P={async login(){return(await fetch(`/tduck-api/no-valid-login`,{method:`POST`,body:JSON.stringify({username:`admin`,password:`dn7kqz00p7BEd/hAiD2lZtzvr2zWExOeKJ4AfqO1mMjb2U6+9S5YAzvG5VqS5TNLyPo+xMYf8GgYUPf1pCEUkQ==`}),headers:{"Content-Type":`application/json`}})).json()},async getPendingFormList(e){let{current:t,size:n,token:r,userId:i}=e;return(await fetch(`/tduck-api/user/form/todo/page?current=${t||1}&size=${n||1e3}&userId=${i}`,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:r,Accept:`application/json`}})).json()},async getCompletedFormList(e){let{current:t,size:n,token:r,userId:i}=e;return(await fetch(`/tduck-api/user/form/data/my?current=${t||1}&size=${n||1e3}&userId=${i}`,{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:r,Accept:`application/json`}})).json()}},F=n(``),I=async()=>
1{if(typeof window>`u`)return{};let{parse:e}=await s(async()=>{let{parse:e}=await import(`./C_EU2N5V2.js`);return{parse:e}},[],import.meta.url);return e(document.cookie||``)},L=async()=>(e=>{if(typeof e==`number`)return e;let t=Number(e);if(!Number.isNaN(t))return t})((await I()).max_age)||3600,R={async set(e){let t=await I(),{name:n,value:r,maxAge:i}=e,a=r?typeof r==`number`?r.toString():window.btoa(r):t[n],o=i||await L(),{serialize:c}=await s(async()=>{let{serialize:e}=await import(`./C_EU2N5V2.js`);return{serialize:e}},[],import.meta.url),l=c(n,a,{path:`/`,httpOnly:!1,secure:!1,maxAge:o});document.cookie=l},async get(e){let t=(await I())[e];if(t)return window.atob(t)}},z=async(e=!0)=>{await fetch(`/api/portal-logout`,{method:`DELETE`}),e&&window.location.reload()},B=c(`__aisg-current-user__`,void 0),V=c(`__aisg-is-fetching-current-user__`,!1),H=()=>{let e=t(`isMultilingualPage`,n(!1)),o=t(`allPortalRoles`,n([])),s=n(),c=t(`loginUrl`,n(`/login`)),l=t(`navType`,n(`public`)),u=i(()=>l.value===`portal`),d=i(()=>l.value===`public`),f=t(`publicMenus`,n([])),p=i(()=>o.value.find(e=>e.portalRoleName===s.value)?.home_url||o.value[0]?.home_url||`/`),m=a(),h=(e,t={})=>{try{return JSON.parse(e)}catch{return t}};return(async()=>{s.value=await R.get(`cur_portal_role`);let e=await R.get(`portal_user`);e&&(m.value=h(e,{firstName:``,lastName:``,email:``,id:``}))})(),r(m,async()=>{let e=m.value?.id;if(!(V.value||B.value?.id===e))try{V.value=!0;let t=await N.getUserInfo(e);if(t?.code!==0){B.value=void 0,await z(!1);return}B.value=t?.data}catch{}finally{V.value=!1}}),{currentUserDetailRef:B,currentPortalUserRef:m,allPortalRolesRef:o,currentPortalRoleNameRef:s,portalLoginPageUrlRef:c,navTypeRef:l,isPortalNavRef:u,isPublicNavRef:d,publicMenusRef:f,homePageUrlRef:p,isMultilingualPageRef:e}},U=n(`/login`),W=()=>{let e=U.value||`/`;return new URL(window.location.href).pathname===e},G=()=>{let e=new URL(window.location.href);if(W())return;let t=e.toString();e.pathname=U.value||`/`,e.searchParams.set(`redirectUrl`,encodeURIComponent(t)),window.location.href=e.toString()},K=async()=>{let e=await R.get(`portal_token`);if(!e)throw G(),Error(`token is null, redirect to login page`);return e},q=()=>K();async function J(e){let{baseURL:t=F.value,url:n,headers:r={"Content-Type":`application/json`},...i}=e,a=t?`${t.replace(/\/$/,``)}/${n.replace(/^\//,``)}`:n,o=new Headers;if(e.headers&&Object.entries(e.headers).forEach(([e,t])=>{o.set(e,t)}),Object.entries(r).forEach(([e,t])=>{o.set(e,t)}),!(a.includes(`/v1/public/`)||a.includes(`/v1/user-filter-tree/list`))){let e=await K();e&&o.set(`Authorization`,l(e,`Bearer `))}let s=await fetch(a,{...i,headers:o});try{let e=await s.clone().json();e.message.includes(`æ æç drupal token`)&&e.code===1&&G()}catch{}return s}var Y=function(e){return e[e.Event=1]=`Event`,e[e.Outlook=2]=`Outlook`,e}({});export{m as C,M as D,S as E,E as O,w as S,g as T,v as _,J as a,b,H as c,A as d,k as f,_ as g,y as h,z as i,u as k,D as l,P as m,R as n,F as o,O as p,U as r,q as s,Y as t,j as u,T as v,h as w,C as x,x as y};
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.