1import{A as e,E as t,I as n,T as r,j as i}from"./chunk-KS7C4IRE-DIkipulk.js";import{t as a}from"./jsx-runtime-CsaOnxTR.js";import{_ as o}from"./components-JSzoenoU.js";import{$r as s,Ba as c,Ft as l,Ga as u,Ha as d,Ki as f,Pt as p,Qr as m,Sn as h,Va as g,aa as _,da as v,ea as y,ia as b,ki as x,na as S,ni as C,ra as w}from"./Elements-BJgAzht_.js";import{t as T}from"./Article-DmH4mBhK.js";import{n as E,t as D}from"./ssr-CJ2n4bG3.js";import{t as O}from"./JSONLD-p5Fx8-kT.js";import{t as k}from"./Footer-C8YzpA8F.js";import{t as A}from"./ST-logo-default-DY1puEYz.js";import{t as j}from"./PageLayout-VSFjvclv.js";import{n as M}from"./MetaTags-DxD1Vn5J.js";import{t as N}from"./BlockHelper-CxA3Q3ex.js";import{r as P}from"./sectionHelper-BzSf4oTN.js";import{t as F}from"./StatusHandler-BAQGTOm7.js";import{t as I}from"./adsHelper-D-PUDSBN.js";var L=n(i(),1),R=a(),z=f({type:S.DISPLAY,size:y.SM,weight:w.THIRTY}),B=({blogUrl:e})=>{let[t,n]=(0,L.useState)(!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:c(`block border-b border-default`,`px-16 py-04 desktop:py-08`,`flex justify-between items-center`,`transition-all duration-100 ease-linear`),"data-testid":`header-wrapper-test-id`,children:(0,R.jsxs)(`div`,{className:c(`w-full flex justify-between mobile:flex-nowrap tablet:flex-wrap h-full items-stretch breakpoint:max-w-breakpoint breakpoint:mx-auto`),children:[(0,R.jsx)(`div`,{className:`flex items-center`,"data-testid":`header-main-left-test-id`,children:(0,R.jsx)(b,{type:_.IMAGE_ONLY,alt:`Straitstimes.com header logo`,src:A,url:u,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`)}),(0,R.jsx)(`div`,{className:`flex items-center`,"data-testid":`header-main-right-test-id`,children:(0,R.jsxs)(`button`,{onClick:()=>{p(e||window.location.href),n(!0)},className:`flex items-center gap-2 px-4 py-2 text-sm font-medium text-primary hover:bg-gray-100 rounded-md transition-colors`,"data-testid":`header-blog-share-test-id`,"aria-label":`Share this blog post`,children:[(0,R.jsx)(C,{iconName:g.ACTION_SHARE_OUTLINED,className:`text-secondary`,iconWidth:d.REGULAR}),(0,R.jsx)(`span`,{className:`text-secondary text-xs hidden tablet:block`,children:`Share blog`})]})})]})}),t&&(0,R.jsx)(`div`,{className:`relative whitespace-nowrap`,"data-testid":`link-copied-toast-container-test-id`,children:(0,R.jsx)(m,{type:s.SUCCESS,message:`Link copied`,duration:3e3,handler:()=>{n(!1)},testId:`link-copied-toast-test-id`,className:`liveblog-toast-copy-link absolute top-66 left-1/2 transform -translate-x-1/2`,textClassName:z})})]})},V=({children:e})=>(0,R.jsxs)(R.Fragment,{children:[!l()&&(0,R.jsx)(B,{}),(0,R.jsx)(`main`,{children:e}),!l()&&(0,R.jsx)(k,{})]});function H(){let e=r();if(e.type===D.CLIENT_ERROR||e.type===D.SERVER_ERROR)return(0,R.jsx)(F,{response:e});let t=e.payload.results;return(0,R.jsxs)(V,{children:[(0,R.jsx)(O,{type:x.LIVEBLOG,schemaProps:e.payload.liveBlogSchemaProps}),(0,R.jsx)(`div`,{children:v(t)&&t.map((e,t)=>(0,R.jsx)(L.Fragment,{children:N({...e})},t))})]})}var U=!1;function W(){let e=r();if(e.type===D.CLIENT_ERROR||e.type===D.SERVER_ERROR)return(0,R.jsx)(F,{response:e});let t=e.payload.results,n=(e.payload.uniqueName||``).replaceAll(`-`,`_`),i=v(e.payload.advertisements)?e.payload.advertisements:[],a=v(i)?i[0]:void 0;U||=(I(i),!0);let{gaData:s}=e.payload;return(0,R.jsx)(j,{lb1Ad:a,gaData:s,children:(0,R.jsxs)(`div`,{children:[Object.prototype.hasOwnProperty.call(Object(o),n)&&(0,R.jsx)(h,{...o[n]}),v(t)&&t.map((e,t)=>(0,R.jsx)(L.Fragment,{children:N({...e})},t))]})})}var G=!1;function K(){let e=r(),{pathname:n}=t();if(e.type===D.CLIENT_ERROR||e.type===D.SERVER_ERROR)return(0,R.jsx)(F,{response:e});let{results:i,uniqueName:a,gaData:o}=e.payload,s=v(e.payload.advertisements)?e.payload.advertisements:[],c=v(s)?s[0]:void 0;G||=(I(s),!0);let{sectionTitle:l,sectionUrl:u,subSections:d}=P(a??``);return(0,R.jsx)(j,{lb1Ad:c,gaData:o,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(h,{title:l,url:u,navigationItems:d,isSectionPage:n===u}),v(i)&&i.map((e,t)=>(0,R.jsx)(L.Fragment,{children:N({...e,gaData:o})},t)),(0,R.jsx)(`div`,{className:`pt-32`})]})})}var q=e(function(){let e=r();if(e.type===D.CLIENT_ERROR||e.type===D.SERVER_ERROR||e.statusCode!==200)return(0,R.jsx)(F,{response:e});let t=Object.prototype.hasOwnProperty.call(Object(e.payload),`pageType`)?e.payload.pageType:`article`;return t===`web-category-page`?(0,R.jsx)(K,{}):t===`microsite-page`?(0,R.jsx)(W,{}):t===`live-blog-landing-page`?(0,R.jsx)(H,{}):t===`article`?(0,R.jsx)(T,{}):(0,R.jsx)(F,{response:{type:D.CLIENT_ERROR,statusCode:404}})}),J=e=>{let t=e.loaderData;if(t.type===D.SUCCESS){let e=t.payload.metaData;return M(e)}};async function Y(e){let t=await E(e);if(!t.context)return console.error(`Error occured during client-side routing for container, returning server Loader Data`),await e.serverLoader();let n=t.context;return(!n||typeof n!=`object`||!(`payload`in n)||typeof n.payload!=`object`)&&console.error(`Client Loader: fetchContext() returned an invali
1d payload for container`),n}export{Y as clientLoader,q as default,J as meta};
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.