1import{E as e,I as t,O as n,j as r}from"./chunk-KS7C4IRE-DIkipulk.js";import{t as i}from"./jsx-runtime-CsaOnxTR.js";import{S as a,f as o,h as s,l as c,m as l,p as u,t as d,v as f,w as p,y as m}from"./components-JSzoenoU.js";import{Aa as h,Ba as g,Bi as _,Ca as v,Fi as y,Ga as b,Ha as x,Hi as S,Ii as C,La as w,Li as T,Ln as ee,Lt as te,Ma as E,Mn as D,Na as O,Pa as k,Pi as A,Pr as ne,Qa as re,Qi as ie,Rn as j,Sa as M,Ua as N,Ui as P,Va as F,Vi as I,Vn as ae,Wa as L,Xr as R,aa as z,ar as oe,ba as se,da as B,ea as ce,ei as V,fr as le,ga as ue,ht as de,ia as H,ja as fe,li as pe,ni as U,oa as me,pr as he,qi as ge,st as _e,yr as ve,zi as W,zn as ye}from"./Elements-BJgAzht_.js";import{t as be}from"./ST-logo-default-DY1puEYz.js";var G=t(r(),1),xe=async(e,t,n,r)=>{try{let i=`st_saved_${t}`,a=M.get(i),o=a===void 0?[]:q(a);B(o)&&(o.length<60?r(!1):r(!0)),(await ne(`saveBookmarks`,`POST`,{},!1,{cueid:e,visitorid:t})).code===200&&(n(!0),K(`save`,e,t));return}catch(e){L(N.ERROR,`BAAS:: Save Bookmarks API request failed`,{err:e})}},Se=async(e,t,n)=>{try{(await ne(`deleteBookmarks`,`POST`,{},!1,{cueid:e,visitorid:t})).code===200&&(n(!1),K(`delete`,e,t));return}catch(e){L(N.ERROR,`BAAS:: Save Bookmarks API request failed`,{err:e})}};function K(e,t,n){let r=`st_saved_${n}`,i=q(M.get(r));if(e===`save`){let e=[...i,t];M.set(r,JSON.stringify(e))}if(e===`delete`){let e=i.filter(e=>e!==t);M.set(r,JSON.stringify(e))}}function q(e){if(!e)return[];try{let t=JSON.parse(e);return B(t)?t:[]}catch{return[]}}var J=i();function Ce({cueId:e,savedStatus:t,visitorId:n,urlPath:r}){let[i,a]=(0,G.useState)(),[o,s]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1),d=`st_saved_${n}`,f=M.get(d),{lightbox:p}=ae();(0,G.useMemo)(()=>{if(B(t)&&e){let e=`st_saved_${n}`,r=M.get(e),i=r===void 0?[]:q(r);if(B(i)){let n=[...t,...i],r=[...new Set(n)];M.remove(e,{path:`/`}),M.set(e,JSON.stringify(r))}else M.remove(e,{path:`/`}),M.set(e,JSON.stringify(t))}},[n]),(0,G.useMemo)(()=>{e&&f!==void 0&&f.includes(e)&&a(!0),e&&f!==void 0&&!f.includes(e)&&a(!1)},[f,e]);let m=(0,G.useCallback)(t=>{n||s(!0),n&&e&&(t?Se(e,n,a):(xe(e,n,a,u),k({eventCategory:w.BOOKMARK,eventAction:`Click`,eventLabel:r})))},[n,e]);return(0,J.jsxs)(J.Fragment,{children:[o&&(0,J.jsx)(`div`,{className:`following-modal`,children:(0,J.jsx)(D,{title:`Log in to use myST+`,successButton:`Log in / Sign up`,showSuccessButton:!0,successFill:W.PRIMARY,onClose:()=>{s(!1)},onSuccessClick:()=>{c&&se(p),s(!1)},children:`Follow topics and authors, save articles and explore content that matters to you.`})}),l&&(0,J.jsx)(`div`,{className:`following-modal`,children:(0,J.jsx)(D,{title:`You have saved 60 articles`,successButton:`Manage Saved`,showSuccessButton:!0,successFill:W.PRIMARY,onSuccessClick:()=>{c&&window.location.assign(`/myst/saved`)},onClose:()=>{u(!1),c&&window.location.assign(`/myst/saved`)},children:`To keep current favourites, go to your space in myST+ to remove the ones you no longer want.`})}),(0,J.jsx)(V,{className:`action-button`,fill:W.NONE,type:I.ICON_ONLY,icon:{iconName:i?F.ACTION_BOOKMARK_FILLED:F.ACTION_BOOKMARK_OUTLINED,iconWidth:x.REGULAR},handler:()=>{m(!!i)}})]})}var Y=(0,G.forwardRef)(({title:e,progress:t,urlPath:n,shortUrl:r,cueId:i,bookmarked:a,visitorId:o,className:s,testId:c=`sticky-headline-test-id`},l)=>{let[u,d]=(0,G.useState)(e),[f,p]=(0,G.useState)(t),[m,h]=(0,G.useState)(n),[_,v]=(0,G.useState)(r),[x,S]=(0,G.useState)(i),[C,w]=(0,G.useState)(a),[T,E]=(0,G.useState)(o),D=_e(m);return(0,G.useImperativeHandle)(l,()=>({update:({title:e,progress:t,urlPath:n,shortUrl:r,cueId:i,bookmarked:a,visitorId:o})=>{d(e),p(t),h(n),v(r),S(i),w(a),E(o)}})),(0,J.jsxs)(`div`,{className:g(`sticky-headline`,s),"data-test-id":c,children:[(0,J.jsx)(`div`,{className:`outer-sticky-headline-container`,children:(0,J.jsxs)(`div`,{className:`inner-container`,children:[(0,J.jsxs)(`div`,{className:`logo-and-text items-center`,children:[(0,J.jsx)(H,{type:z.CUSTOM,url:b,children:(0,J.jsxs)(`div`,{className:`logo-container`,"data-testid":`sticky-headline-logo-test-id`,children:[(0,J.jsx)(`span`,{className:`full-logo-container`,"data-testid":`sticky-headline-st-full-logo-test-id`,children:(0,J.jsx)(U,{className:`full-logo`,symmetric:!1,iconName:F.ST_FULL_LOGO_DEFAULT,iconWidth:`231px`,iconHeight:`18px`})}),(0,J.jsx)(`span`,{className:`initial-logo-container`,"data-testid":`sticky-headline-st-initial-logo-test-id`,children:(0,J.jsx)(U,{className:`initial-logo`,iconName:F.ST_INITIAL_LOGO_DEFAULT})})]})}
1),(0,J.jsx)(y,{className:`logo-divider`,type:A.DEFAULT,vertical:!0}),(0,J.jsx)(`div`,{className:`text-container`,"data-testid":`sticky-headline-title-test-id`,children:(0,J.jsx)(ge,{type:ie.BODY,className:`title`,size:ce.SM,children:u??``})})]}),(0,J.jsxs)(`div`,{className:g(`action-container`,O.ACCOUNT_HUB_ENTRYPOINT&&`!min-w-unset`),children:[(0,J.jsx)(de,{className:`gap-08 py-16 h-full items-start`,type:te.STICKY_HEADLINE,title:u,url:m,shortUrl:_}),!D&&(0,J.jsx)(Ce,{cueId:x,savedStatus:C,visitorId:T,urlPath:m}),(0,J.jsx)(ye,{enabled:O.ACCOUNT_HUB_ENTRYPOINT,children:(0,J.jsx)(ee,{})})]})]})}),(0,J.jsx)(`div`,{className:`progress-bar-container`,children:(0,J.jsx)(`span`,{"data-testid":`sticky-headline-progress-bar-test-id`,className:`progress-bar`,style:{width:`${Math.min(Math.max(f,10),100)}%`}})})]})});Y.displayName=`StickyHeadline`;function we(e){return re()?E(e):E(fe(e))}var X=function(e){return e.GLOBAL=`/global`,e.SINGAPORE=`/`,e}({}),Z=we(e=>({edition:`/`,setEdition:t=>{e({edition:t})}}));function Q({title:e,url:t,className:n,testId:r=`menu-item-test-id`,divider:i=!0}){if(!(!t||!e))return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{url:t,title:e,type:z.TEXT_ONLY,className:g(`px-16 tablet:px-24 py-12`,n),textClassName:`font-button-sm-regular`,testId:r}),i&&(0,J.jsx)(y,{className:`mx-00 ml-16 desktop:ml-24 h-01 !border-subtle`})]})}function Te({openMenu:e,menuToggle:t,testId:r=`menu-container-test-id`,className:i}){let[a,o]=(0,G.useState)(!1),c=Z(e=>e.edition),l=(0,G.useRef)(null),{deviceType:u}=ve(!0),f=(0,G.useCallback)(e=>{e.key===`Escape`&&t(!1)},[t]);(0,G.useEffect)(()=>(document.addEventListener(`keydown`,f,!1),()=>{document.removeEventListener(`keydown`,f,!1)}),[f]),S(l,()=>{t(!1)}),P(()=>{setTimeout(()=>{o(e)},50)},[e]);let p=n(),m=h(e=>e.userInfo);return(0,J.jsxs)(`nav`,{className:g(`menu-container`,!e&&`hidden`,a?`show`:`hide`,i),"data-testid":r,ref:l,children:[(0,J.jsx)(`div`,{className:`pt-16 pb-08 flex w-full justify-end mobile:px-16 tablet:px-24`,children:(0,J.jsx)(V,{handler:()=>{t(!e)},type:I.ICON_ONLY,fill:W.NONE,className:`p-00`,icon:{iconName:F.STATUS_ERROR_FILLED,iconWidth:x.LARGE},testId:`menu-container-close-button-test-id`})}),(0,J.jsxs)(`div`,{className:`w-full`,children:[(0,J.jsx)(le,{id:`menu-edition`,title:`Choose edition`,items:[{label:`Singapore`,value:`/`},{label:`International`,value:`/global`}],size:he.SMALL,orientation:`horizontal`,init:c===X.GLOBAL?`/global`:`/`,className:`mobile:px-16 tablet:px-24`,handler:e=>{p(e??``,{replace:!0,relative:`route`})}}),(0,J.jsx)(y,{type:A.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),(0,J.jsxs)(`div`,{className:`w-full`,children:[(0,J.jsx)(H,{title:`Search`,url:`/search`,className:`mobile:px-16 tablet:px-24 justify-between w-full font-button-md-bold`,type:z.ICON_RIGHT,rightIconProps:{iconName:F.NAV_SEARCH}}),(0,J.jsx)(y,{type:A.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),(0,J.jsx)(d,{children:Oe(u===`desktop`,m?.usertype===v.SUBSCRIBER)}),(0,J.jsxs)(`div`,{className:`w-full `,children:[Object.keys(s).map((e,t)=>(0,J.jsx)(T,{header:e,items:s[e],type:C.COLUMN,className:`capitalize`},t)),(0,J.jsx)(Q,{url:`/visual`,title:`Visual`,className:`w-full`}),(0,J.jsx)(Q,{url:`/st-podcasts`,title:`Podcasts`,className:`w-full`,divider:!1}),(0,J.jsx)(y,{type:A.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),De(),Ee(),(0,J.jsx)(`div`,{className:`w-full min-h-80 block tablet:hidden`,children:`\xA0`})]})}var Ee=()=>{let[e,t]=(0,G.useState)(me());return(0,G.useEffect)(()=>{c&&t(me(window.navigator.userAgent))},[]),(0,J.jsxs)(`div`,{className:`w-full pb-16`,children:[(0,J.jsx)(Q,{url:`https://consumerfaq.sph.com.sg/kb?lang=en`,title:`FAQs`,className:`w-full`}),(0,J.jsx)(Q,{url:e,title:`Contact us`,className:`w-full`,divider:!1})]})},De=()=>(0,J.jsxs)(`div`,{className:`w-full `,children:[(0,J.jsx)(Q,{url:u,title:`STClassifieds`,className:`w-full`}),(0,J.jsx)(Q,{url:f,title:`Paid press releases`,className:`w-full`}),(0,J.jsx)(H,{title:`Advertise with us`,url:o,type:z.ICON_RIGHT,rightIconProps:{iconName:F.NAV_EXTERNAL},className:`mobile:px-16 tablet:px-24 py-12 justify-between w-full`,textClassName:`font-button-sm-regular`}),(0,J.jsx)(y,{type:A.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),Oe=(e,t=!1)=>{let n=(0,G.useCallback)(()=>{c&&(k({eventCategory:w.SUBSCRIBE,eventAction:`click`,eventLabel:window.location.href,click_reference:`subscribe-usermenu`}),O.ESAAS_GA_TAGGING?window.location.assign(window._data.articleid?`${p}&article_id=${window._data.articleid}`:p):window.location.assign(p))},[]);return(0,J.jsxs)(`div`,{className:`w-full`,children:[!t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{text:`Subscribe`,fill:W.NONE,size:_.SMALL,className:`subscribe-link w-full justify-start`,textClassName:`font-button-sm-regular`,handler:n,testId:`sidebar-subscribe-button-test-id`}),(0,J.jsx)(y,{className:`mx-00 ml-16 desktop:ml-24 h-01 !border-subtle`})]}),(0,J.jsx)(Q,{url:l,title:`E-paper`,className:`w-full`,divider:!0}),(0,J.jsx)(Q,{url:`/newsletter-signup`,title:`Newsletters`,className:g(`w-full`),divider:!0}),(0,J.jsx)(Q,{url:`/myst`,title:`myST+`,className:g(`w-full`),divider:!1}),(0,J.jsx)(y,{type:A.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]})};function ke(){let[e,t]=(0,G.useState)(!1),[n,r]=(0,G.useState)(!1),i=()=>{t(!e),k({eventLabel:`menu`,eventAction:w.CLICK,eventCategory:`masterhead`})};return(0,G.useEffect)(()=>{e?document.documentElement.setAttribute(`style`,`overflow-y: hidden !important`):document.documentElement.removeAttribute(`style`)},[e]),P(()=>{setTimeout(()=>{r(e)},150)},[e]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{text:`Menu`,icon:{iconName:F.MENU_HAMBURGER_SEARCH},type:I.ICON_LEFT,fill:W.NONE,handler:i,size:_.SMALL,textClassName:g(`font-secondary-label-sm-regular`),className:`header-menu hidden items-end tablet:flex !px-08 !py-16`,testId:`desktop-menu-trigger-button-test-id`}),(0,J.jsx)(V,{icon:{iconName:F.MENU_HAMBURGER_SEARCH},type:I.ICON_ONLY,fill:W.NONE,handler:i,size:_.SMALL,textClassName:`font-secondary-label-sm-regular`,className:`flex items-end tablet:hidden !px-08 !py-16`,testId:`mobile-menu-trigger-button-test-id`}),n&&(0,J.jsx)(`div`,{className:`h-screen w-screen z-1000 absolute top-00 left-00 opacity-40 bg-neutral-90/80 `}),(0,J.jsx)(Te,{menuToggle:t,openMenu:e})]})}var $=({isErrorPage:e,isVisualStoryPage:t})=>(0,J.jsxs)(`div`,{className:g(`flex justify-between mobile:flex-nowrap tablet:flex-wrap content-center h-full items-stretch `,`pl-16 pr-08`,`tablet:pl-24 tablet:pr-12`,`desktop:pl-32 desktop:pr-24`,`breakpoint:px-00 breakpoint:max-w-breakpoint breakpoint:mx-auto`),"data-testid":`header-main-test-id`,children:[(0,J.jsx)(`div`,{className:`flex items-center`,"data-testid":`header-main-left-test-id`,children:(0,J.jsx)(H,{type:z.IMAGE_ONLY,alt:`Straitstimes.com header logo`,src:be,url:b,textClassName:`flex items-start`,imageClassName:`h-48 py-16 aspect-auto desktop:h-56 flex-shrink-0 w-auto object-contain`},`header-st-logo-default`)}),!e&&(0,J.jsxs)(`div`,{className:`flex items-center flex-shrink`,"data-testid":`header-main-right-test-id`,children:[(0,J.jsx)(j,{}),!t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(y,{vertical:!0,className:`hidden desktop:block`}),(0,J.jsx)(ke,{})]})]})]}),Ae=()=>(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`hidden desktop:block breakpoint:max-w-breakpoint breakpoint:mx-auto`,"data-testid":`header-home-test-id`,children:[(0,J.jsx)(je,{}),(0,J.jsx)(`div`,{className:g(`flex justify-between flex-wrap content-center h-full items-stretch desktop:pb-24`),children:(0,J.jsxs)(`div`,{className:`flex items-center `,children:[(0,J.jsx)(H,{type:z.IMAGE_ONLY,alt:`Straitstimes.com header logo`,src:be,url:b,textClassName:`flex items-start`,imageClassName:`h-48 py-16 aspect-auto desktop:py-00`},`header-st-logo-default`),ue()&&(0,J.jsx)(`div`,{className:`pl-08 hidden desktop:flex homepage-doodle`,children:(0,J.jsx)(`img`,{src:`/assets/ndp2026-Cm09-2x-.gif`,width:`150px`,alt:`ST Doodle`})})]})}),(0,J.jsx)(Me,{})]}),(0,J.jsx)(`div`,{className:`block desktop:hidden`,children:(0,J.jsx)($,{})})]}),je=()=>{let[e,t]=(0,G.useState)(!1),n=(0,G.useRef)(null),r=[{label:`Singapore`,value:X.SINGAPORE},{label:`International`,value:X.GLOBAL}],i=h(e=>e.userInfo),o=Z(e=>e.edition);S(n,()=>{t(!1)});let s=i?.display_name,u=i?.usertype,d=(0,G.useCallback)(()=>{c&&(k({eventCategory:w.SUBSCRIBE,eventAction:`click`,eventLabel:window.location.href,click_reference:`subscribe-header`}),window.location.assign(a))},[]);return(0,J.jsxs)(`div`,{className:g(`hidden desktop:flex justify-between flex-wrap pb-24`),children:[(0,J.jsxs)(`div`,{className:`flex items-center`,children:[(0,J.jsx)(`div`,{className:`p-08 pl-00 flex`,ref:n,children:(0,J.jsxs)(R,{className:`min-h-unset`,children:[(0,J.jsx)(R.Trigger,{children:(0,J.jsx)(V,{handler:()=>{t(!e)},fill:W.NONE,type:I.ICON_RIGHT,icon:{iconName:e?F.NAV_EXPAND_LESS:F.NAV_EXPAND_MORE,iconWidth:x.SMALL},text:o===X.GLOBAL?`International`:`Singapore`,textClassName:`font-secondary-label-sm-bold`,className:`p-00`})}),(0,J.jsx)(R.Items,{className:`left w-200 p-00`,children:(0,J.jsxs)(`div`,{className:`flex flex-col pb-08 font-secondary-label-md-regular`,children:[(0,J.jsx)(`span`,{className:`font-secondary-label-sm-regular text-disabled p-16 pb-08`,children:`Choose edition`}),r.map(({label:e,value:t})=>o===(t===X.GLOBAL?X.GLOBAL:X.SINGAPORE)?(0,J.jsx)(`span`,{className:`py-12 px-16 font-secondary-label-md-bold after:inline-block after:content-[''] after:w-24 after:h-24 after:ml-08 after:bg-[url('/src/app/assets/images/icon-status-nav-edition.png')] after:bg-no-repeat after:bg-ce
1nter after:bg-contain after:align-sub`,children:e},e):(0,J.jsx)(`a`,{href:t,className:`py-12 px-16`,children:e},e))]})})]})}),(0,J.jsx)(y,{type:A.DEFAULT,vertical:!0}),(0,J.jsx)(`div`,{className:`px-08 py-12`,children:(0,J.jsx)(H,{url:l,title:`E-paper`,textClassName:`font-secondary-label-sm-regular`})})]}),(0,J.jsxs)(`div`,{className:`flex items-center`,children:[!(s&&u===v.SUBSCRIBER)&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{children:(0,J.jsx)(V,{text:`Subscribe`,fill:W.NONE,size:_.SMALL,className:`header-subscribe-link`,textClassName:`font-secondary-label-sm-regular`,handler:d,testId:`Subscribe`})}),(0,J.jsx)(y,{type:A.DEFAULT,vertical:!0})]}),(0,J.jsx)(`div`,{children:(0,J.jsx)(`div`,{className:`block`,children:(0,J.jsx)(j,{})})})]})]})},Me=()=>(0,J.jsxs)(`div`,{className:`hidden desktop:flex justify-between flex-wrap`,children:[(0,J.jsx)(`div`,{className:`flex items-center`,children:(0,J.jsx)(oe,{arrayList:m,vertical:!1,linkProps:{className:`py-12 px-16 first:pl-00`}})}),(0,J.jsx)(`div`,{className:`flex items-center`,children:(0,J.jsx)(ke,{})})]});function Ne({isHomepage:t=!1,isArticlePage:n=!1,isVisualStoryPage:r=!1,isErrorPage:i=!1,disableSticky:a=!1,stickyHeadlineRef:o,className:s}){let[l,u]=(0,G.useState)(!1),d=Z(e=>e.setEdition),f=(0,G.useContext)(pe);return(0,G.useEffect)(()=>{let e=()=>{let e=document.body.scrollTop||document.documentElement.scrollTop;e===0?u(!1):e>190&&!l?u(!0):l&&e<100&&u(!1)};return c&&!a&&window.addEventListener(`scroll`,e,{passive:!0}),()=>{c&&window.removeEventListener(`scroll`,e)}},[]),(0,G.useEffect)(()=>{c&&d(window.location.pathname.startsWith(`/global`)?X.GLOBAL:X.SINGAPORE)},[e().pathname,d]),(0,J.jsx)(`div`,{className:g(`block border-b border-default`,!n&&``,n&&!l&&``,!l&&t?`desktop:py-16 desktop:pl-32 desktop:pr-24`:l&&n?`py-00`:`desktop:py-08`,l&&`sticky top-00 z-1050 layer-one layer-no-hover`,`transition-all duration-100 ease-linear`,s),"data-testid":`header-wrapper-test-id`,children:l&&n?(0,J.jsx)(Y,{ref:o,title:f.title||``,progress:f.infiniteScrolling?.progress||0,urlPath:f.urlPath,shortUrl:f.shortUrl}):!l&&t?(0,J.jsx)(Ae,{}):(0,J.jsx)($,{isErrorPage:i,isVisualStoryPage:r})})}export{K as i,$ as n,Y as r,Ne as t};
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.