1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6916,7671],{184:(e,t,r)=>{r.d(t,{q:()=>i});let i=e=>{}},10594:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var i={default:function(){return v},handleClientScriptLoad:function(){return b},initScriptLoader:function(){return w}};for(var n in i)Object.defineProperty(t,n,{enumerable:!0,get:i[n]});let a=r(31991),s=r(56404),l=r(54568),o=a._(r(97509)),d=s._(r(7620)),c=r(2737),u=r(66161),h=r(71341),p=r(93505),f=new Map,m=new Set,g=e=>{let{src:t,id:r,onLoad:i=()=>{},onReady:n=null,dangerouslySetInnerHTML:a,children:s="",strategy:l="afterInteractive",onError:d,stylesheets:c}=e,h=r||t;if(h&&m.has(h))return;if(f.has(t)){m.add(h),f.get(t).then(i,d);return}let p=()=>{n&&n(),m.add(h)},g=document.createElement("script"),b=new Promise((e,t)=>{g.addEventListener("load",function(t){e(),i&&i.call(this,t),p()}),g.addEventListener("error",function(e){t(e)})}).catch(function(e){d&&d(e)});a?(g.innerHTML=a.__html||"",p()):s?(g.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",p()):t&&(g.src=t,f.set(t,b)),(0,u.setAttributesFromProps)(g,e),"worker"===l&&g.setAttribute("type","text/partytown"),g.setAttribute("data-nscript",l),c&&(e=>{if(o.default.preinit)return e.forEach(e=>{o.default.preinit(e,{as:"style"})});{let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(c),document.body.appendChild(g)};function b(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>g(e))}):g(e)}function w(e){e.forEach(b),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");m.add(t)})}function y(e){let{id:t,src:r="",onLoad:i=()=>{},onReady:n=null,strategy:a="afterInteractive",onError:s,stylesheets:u,...f}=e,{updateScripts:b,scripts:w,getIsSsr:y,appDir:v,nonce:x}=(0,d.useContext)(c.HeadManagerContext);x=f.nonce||x;let z=(0,d.useRef)(!1);(0,d.useEffect)(()=>{let e=t||r;z.current||(n&&e&&m.has(e)&&n(),z.current=!0)},[n,t,r]);let S=(0,d.useRef)(!1);if((0,d.useEffect)(()=>{if(!S.current){if("afterInteractive"===a)g(e);else"lazyOnload"===a&&("complete"===document.readyState?(0,h.requestIdleCallback)(()=>g(e)):window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>g(e))}));S.current=!0}},[e,a]),("beforeInteractive"===a||"worker"===a)&&(b?(w[a]=(w[a]||[]).concat([{id:t,src:r,onLoad:i,onReady:n,onError:s,...f,nonce:x}]),b(w)):y&&y()?m.add(t||r):y&&!y()&&g({...e,nonce:x})),v){if(u&&u.forEach(e=>{o.default.preinit(e,{as:"style"})}),"beforeInteractive"===a)if(!r)return f.dangerouslySetInnerHTML&&(f.children=f.dangerouslySetInnerHTML.__html,delete f.dangerouslySetInnerHTML),(0,l.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([0,{...f,id:t}]))})`}});else return o.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:x,crossOrigin:f.crossOrigin}:{as:"script",nonce:x,crossOrigin:f.crossOrigin}),(0,l.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([r,{...f,id:t}]))})`}});"afterInteractive"===a&&r&&o.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:x,crossOrigin:f.crossOrigin}:{as:"script",nonce:x,crossOrigin:f.crossOrigin})}return null}Object.defineProperty(y,"__nextScript",{value:!0});let v=y;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25177:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n.a});var i=r(10594),n=r.n(i),a={};for(let e in i)"default"!==e&&(a[e]=()=>i[e]);r.d(t,a)},26556:(e,t,r)=>{r.d(t,{w:()=>c});var i=r(19279),n=r(17947),a=r(7620),s=r(68402),l=r(61550),o=r(184),d=r(84975);let c=({content:e,successMessages:t={bookmarked:"Bookmarked successfully",unbookmarked:"Bookmark removed"},errorMessages:c={authRequired:"Please sign in to bookmark content",failed:"Failed to update bookmark"}})=>{let{currentUser:u}=(0,s.As)(),h=(0,i.J$)(),[p,f]=(0,a.useState)(!1),m=(0,a.useCallback)(async(e,t)=>{try{let{isBookmarked:i}=await Promise.all([r.e(9410),r.e(3420)]).then(r.bind(r,40774));f(await i(e,t))}catch(e){console.error("Failed to check bookmark status:",e),f(!1)}},[]);(0,a.useEffect)(()=>{u?m(u.uid,e.id):f(!1)},[e.id,u,m]);let g=(0,a.useCallback)(async()=>
1{if(!u)return void h.show(c.authRequired,{status:"error"});try{let{addBookmark:i,removeBookmark:a}=await Promise.all([r.e(9410),r.e(3420)]).then(r.bind(r,40774));p?(await a(u.uid,e.id),f(!1),(0,d.$s)("bookmark_remove",{content_id:e.id})):(await i(u.uid,e),f(!0),(0,d.$s)("bookmark_add",{content_id:e.id})),h.show(p?t.unbookmarked:t.bookmarked,{...!p&&{actionText:n.Fc.x.lL,actionUrl:l.bw.LIBRARY},colour:"$seville_tint_primary",iconColour:"$seville_primary",status:"success"})}catch(e){console.error("Failed to toggle bookmark:",e),h.show(c.failed,{colour:"$seville_tint_primary",status:"error"})}},[u,p,e,t,c,h]),b=(0,a.useCallback)(()=>{u&&m(u.uid,e.id)},[u,e.id,m]);return(0,o.q)(b),{isBookmarked:p,toggleBookmark:g}}},28564:(e,t,r)=>{r.d(t,{w:()=>m});var i=r(54568),n=r(41756),a=r(43540),s=r(61275),l=r(75477),o=r(5595);let d=({width:e=16,height:t=20,color:r="#C85000",...n})=>(0,i.jsx)(o.Ay,{width:e,height:t,viewBox:"0 0 16 20",fill:"none",color:r,...n,children:(0,i.jsx)(o.wA,{d:"M16 9V20H0V9H2V18H14V9H16ZM7 3.91V14.5H9V3.91L13.04 7.95L14.45 6.54L8 0L1.54 6.54L2.95 7.95L7 3.91Z",fill:r})});var c=r(17947),u=r(54076),h=r(2028);let p=(0,u.styled)(h.$,{flexDirection:"row",justifyContent:"center",alignItems:"center",alignSelf:"flex-start",gap:0,paddingHorizontal:24,paddingVertical:12,marginVertical:"$16",borderColor:"$seville_primary",backgroundColor:"$background_primary",borderRadius:30,borderWidth:1,hoverStyle:{backgroundColor:"$background_primary",borderColor:"$seville_primary",borderWidth:1},pressStyle:{backgroundColor:"$background_primary",borderColor:"$seville_primary",borderWidth:1},focusStyle:{backgroundColor:"$background_primary",borderColor:"$seville_primary",borderWidth:1}});var f=r(22062);let m=({path:e,title:t})=>{let r=async()=>{try{let r=`${s.M5}${e}`,i="web"===n.A.OS?"web_share":"native_share";if(f.ex.dispatch({type:"share",channel:i,contentId:e}),"web"===n.A.OS)await navigator.share({title:t,url:r});else{let e=`${t} 2${r}`;await a.A.share("ios"===n.A.OS?{message:e}:{title:t,message:e})}}catch(e){console.warn("Share failed:",e)}};return(0,i.jsxs)(p,{onPress:r,"aria-label":"Share",role:"button",children:[(0,i.jsx)(d,{}),(0,i.jsx)(l.x,{fontSize:"$14",color:"$seville_primary",children:c.jZ.o})]})}},44086:(e,t,r)=>{r.d(t,{X:()=>p});var i=r(54568),n=r(7620),a=r(54076),s=r(30770),l=r(17947),o=r(42288),d=r(5595);let c=({primaryColour:e="#333",secondaryColour:t="#fff",variant:r="unsaved",...n})=>(0,i.jsx)(d.BS,{width:20,height:24,viewBox:"0 0 20 24",...n,children:{unsaved:(0,i.jsx)(d.wA,{d:"M18 2v18.31l-6.91-4.51-1.09-.71-1.09.71L2 20.31V2h16zm2-2H0v24l10-6.53L20 24V0z",fill:e}),"unsaved-hover":(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.wA,{d:"M20 24l-10-6.53L0 24V0h20v24z",fill:t}),(0,i.jsx)(d.wA,{d:"M18 2v18.31l-6.91-4.51-1.09-.71-1.09.71L2 20.31V2h16zm2-2H0v24l10-6.53L20 24V0z",fill:e}),(0,i.jsx)(d.wA,{d:"M11 4H9v3H6v2h3v3h2V9h3V7h-3V4z",fill:e})]}),saved:(0,i.jsx)(d.wA,{d:"M20 24l-10-6.53L0 24V0h20v24z",fill:e}),"saved-hover":(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.wA,{d:"M20 24l-10-6.53L0 24V0h20v24z",fill:e}),(0,i.jsx)(d.wA,{d:"M11 8H6v2h8V8h-3z",fill:t})]})}[r]});var u=r(50457),h=r(85266);let p=({alwaysShowText:e=!1,iconRight:t=!1,onPress:r,saved:d=!1})=>{let[p,f]=(0,n.useState)(!1),m=(0,a.useTheme)(),g=(0,h.X)(m.text_primary,u.r.textPrimary),b=(0,h.X)(m.seville_primary,u.r.sevillePrimary),w=(0,h.X)(m.seville_dark_primary,u.r.sevilleDarkPrimary),y=(0,h.X)(m.orange_blossom_primary,u.r.orangeBlossom),v=(0,h.X)(m.white,u.r.white),x=d?p?w:b:g,z=d?l.Fc.x.zv:l.Fc.x.g9,S=d?b:g;return(0,i.jsxs)(s.lW,{alignItems:"center",cursor:"pointer",flexDirection:t?"row-reverse":"row",gap:"$8",onPress:e=>{e?.stopPropagation?.(),r?.()},onHoverIn:()=>f(!0),onHoverOut:()=>f(!1),children:[(0,i.jsx)(c,{primaryColour:x,secondaryColour:p&&d?v:y,variant:d?p?"saved-hover":"saved":p?"unsaved-hover":"unsaved"}),(0,i.jsx)(o.W,{color:S,display:e?"block":"none",$lg:{display:"block"},children:z})]})}},47671:(e,t,r)=>{r.r(t),r.d(t,{rollbar:()=>u});var i=r(64e3),n=r.n(i);let a={itemsPerMinute:10,maxItems:50},s={missing_index:"error",data_fetch_error:"error",render_error:"error",render_timeout:"error",no_user:"warning",webview_error:"error"},l=null,o=["Script error\\.?","ResizeObserver loop","Non-Error promise rejection captured","The operation was aborted\\.?"],d=["observer.co.uk"],c=["chrome-extension://","moz-extension://","safari-web-extension://"],u={init(e){if(e.accessToken&&!l)try{l=new(n())({accessToken:e.accessToken,environment:e.environment,captureUncaught:!0,captureUnhandledRejections:!0,captureIp:"anonymize",enabled:"development"!==e.environment,ignoredMessages:o,hostSafeList:d,hostBlockList:c,...a,scrubTelemetryInputs:!0,payload:{client:{javascript:{code_version:e.codeVersion,source_map_enabled:!0,guess_uncaught_frames:!0}},custom:{platform:e.platform??"web"}}})}catch(e){console.warn("[Rollbar] web init failed; puzzle failures will not reach Rollbar:",e),l=null}},report(e){if(!l)return;let t=s[e.failureReason],r=`${e.type}: ${e.failureReason}`;"error"===t?l.error(r,e):l.warning(r,e)},info(e,t){l&&l.info(e,t)},error(e,t){l&&l.error(e,t)}}},47783:(e,t,r)=>{r.d(t,{L:()=>i});let i=e=>{let t={id:e.id,linkUrl:e.linkUrl,publishDate:e.publishDate,saveDate:new Date().toISOString(),title:e.title,type:e.type};return void 0!==e.duration&&(t.duration=e.duration),void 0!==e.imageAspectRatio&&(t.imageAspectRatio=e.imageAspectRatio),void 0!==e.imageUrl&&(t.imageUrl=e.imageUrl),void 0!==e.seriesEpisode&&(t.seriesEpisode=e.seriesEpisode),t}},55847:(e,t,r)=>{r.d(t,{v:()=>i.v});var i=r(330)},56938:(e,t,r)=>{r.d(t,{Article:()=>eV});var i=r(54568),n=r(17031),a=r(84975),s=r(45233),l=r(17947),o=r(7620),d=r(54076),c=r(30770),u=r(88359),h=r(8405),p=r(59902),f=r(44086),m=r(91200),g=r(68533),b=r(13690),w=r(32815),y=r(48648),v=r(70931),x=r(22062),z=r(20292);let S=({children:e,componentName:t,componentVariant:r,positionIndex:n,skip:a=!1})=>{let s=(0,o.useRef)(null),l=(0,o.useRef)(!1),{height:c}=(0,z.v)();return(0,o.useEffect)(()=>
2{if(!a&&!l.current&&s.current)if(d.isWeb){let e=new IntersectionObserver(([i])=>{i.isIntersecting&&!l.current&&(l.current=!0,x.ex.dispatch({type:"component_impression",componentName:t,componentVariant:r,positionIndex:n}),e.disconnect())},{threshold:.5});return e.observe(s.current),()=>{e.disconnect()}}else{let e=()=>{!l.current&&s.current&&s.current.measureInWindow?.((e,i,a,s)=>{if(l.current)return;let o=Math.max(0,i),d=Math.max(0,Math.min(c,i+s)-o);s>0&&d/s>=.5&&(l.current=!0,x.ex.dispatch({type:"component_impression",componentName:t,componentVariant:r,positionIndex:n}))})},i=setInterval(e,500),a=setTimeout(e,100);return()=>{clearInterval(i),clearTimeout(a)}}},[t,r,n,c,a]),(0,i.jsx)(d.View,{ref:s,children:e})};var j=r(42288),$=r(46588),k=r(4476),_=r(59429),E=r(27547),C=r(25177),R=r(6818),I=r(55847),T=r(61275);let L=async e=>{if(!e)return null;let t=new AbortController,r=setTimeout(()=>t.abort(),3e4);try{let r=await fetch(`${T.MK}/puzzle-data/${e}/`,{signal:t.signal});if(!r.ok)throw Error(`Puzzle data not found: ${r.status} ${r.statusText}`);return await r.json()}finally{clearTimeout(r)}};var P=r(88770),A=r(66497),O=r(48834);let W=e=>{let t=e.match(/data-id="([^"]+)"\s+data-set="([^"]+)"/);if(!t)return null;let r=t[1],i=t[2];return`${"tortoisemedia-everymanpast"===i?"https://cdn2.amuselabs.com/puzzleme":"https://cdn2.amuselabs.com/pmm"}/crossword?id=${encodeURIComponent(r)}&set=${encodeURIComponent(i)}&embed=js&picker=date-picker&deepLink=1`};function M(e){return(Array.isArray(e)?e:[e]).some(e=>null!==e&&"object"==typeof e&&"event"===e.kind&&"puzzleready"===e.name)}let D=` 3function __isPuzzleReady(parsed) { 4 var items = Array.isArray(parsed) ? parsed : [parsed]; 5 for (var i = 0; i < items.length; i++) { 6 var item = items[i]; 7 if (item && typeof item === 'object' && item.kind === 'event' && item.name === 'puzzleready') { 8 return true; 9 } 10 } 11 return false; 12}`;var H=r(69413),N=r(47671);let U=new Set;function V(e){for(let t of[...U])try{t(e)}catch(e){console.error("window-message-tap subscriber threw",e),N.rollbar.error("window-message-tap subscriber threw",{error:e instanceof Error?e.message:String(e)})}}let F=null,B=null;function q(){if("function"!=typeof window.addEventListener||F===window.addEventListener)return;B?.();let e=window.addEventListener,t=window.removeEventListener;F=e,B="function"==typeof t?()=>t.call(window,"message",V,!0):null,e.call(window,"message",V,!0)}function J(e){return q(),U.add(e),()=>{U.delete(e)}}function K(){let e=T.MK;try{return new URL(e).origin}catch{return null}}function Z(e){return{puzzleUuid:e.uuid,puzzleType:e.puzzleType,puzzleVariant:e.puzzleVariant,...{osVersion:"web",appVersion:"web"},authed:e.authed}}function G(e){var t;let r=Z({uuid:e.uuid,puzzleType:e.puzzleType,puzzleVariant:e.puzzleVariant,authed:e.authed}),i={type:"puzzle_failure",failureReason:e.reason,webviewStatus:e.webviewStatus,webviewUrl:(t=e.webviewUrl)?t.split(/[?#]/)[0]:t,...r};x.ex.dispatch(i),"no_user"!==e.reason&&N.rollbar.report(i)}q();var Q=r(83032);let Y=({rawHtml:e,uuid:t})=>{var r;let a,s,l,u,{height:h}=(0,I.v)(),p=(0,R.r)(),{currentUser:f,loading:m}=(0,P.As)(),g=W(e||""),b=(e=>{let t=e.match(/data-id="([^"]+)"\s+data-set="([^"]+)"/);if(!t)return{baseUrl:"",puzzleId:"",puzzleSet:""};let r=t[1],i=t[2];return{baseUrl:"tortoisemedia-everymanpast"===i?"https://cdn2.amuselabs.com/puzzleme/":"https://cdn2.amuselabs.com/pmm/",puzzleId:r,puzzleSet:i}})(e||""),{data:w,isLoading:y,error:v}=(0,n.I)({queryKey:["puzzleData",t||""],queryFn:()=>L(t||""),enabled:!!t,retry:(e,t)=>t?.name!=="AbortError"&&e<1}),z=(0,o.useMemo)(()=>{if(!t||!w||!w.files?.["index.html"])return;let e=T.MK,r=new URLSearchParams({uuid:f?.uid||""});return d.isWeb||r.set("embed","observer-native"),`${e}${w.files["index.html"]}?${r.toString()}`},[t,w,f?.uid]),S=(s=(0,H.a)(),l=s?.split("/").filter(Boolean).pop(),u=(0,o.useCallback)(e=>{let t;if("string"!=typeof e)return;try{t=JSON.parse(e)}catch{return}if(!t||"object"!=typeof t)return;let{date:r,id:i,type:n}=t;"string"==typeof r&&"string"==typeof i&&"string"==typeof n&&l&&x.ex.dispatch({type:"puzzle_event",puzzleId:i,puzzleType:n,puzzleDate:r,payload:{slug:l}})},[l]),(0,o.useEffect)(()=>
12{if(!d.isWeb)return;let e=K();return J(t=>{e&&t.origin!==e||u(t.data)})},[u]),{onMessage:(0,o.useCallback)(e=>u(e.nativeEvent.data),[u]),injectedJavaScript:` 13 (function() { 14 ${D} 15 var orig = window.postMessage.bind(window); 16 window.postMessage = function(msg) { 17 orig(msg); 18 try { 19 var parsed = typeof msg === 'string' ? JSON.parse(msg) : msg; 20 if (!parsed || typeof parsed !== 'object') return; 21 if (__isPuzzleReady(parsed) || 22 parsed.type === 'dm-puzzle' || 23 (typeof parsed.date === 'string' && typeof parsed.id === 'string' && typeof parsed.type === 'string')) { 24 window.ReactNativeWebView.postMessage(typeof msg === 'string' ? msg : JSON.stringify(msg)); 25 } 26 } catch(e) {} 27 }; 28 })(); 29 true; 30 `}),j=g?`puzzle-html-${g}-${f?.uid||"anon"}`:t?`puzzle-uuid-${t}-${f?.uid||"anon"}`:"puzzle",{dispatchLoadSuccess:$,dispatchWebViewError:k,dispatchRenderError:_,startRenderTimer:E,handleWebViewMessage:N}=function(e){let{uuid:t,uri:r,currentUser:i,loading:n,puzzleData:a,puzzleFetchError:s}=e,l=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useRef)(!1),h=(0,o.useRef)(!1),p=(0,o.useRef)(!1),f=(0,o.useRef)(null),m=(0,o.useRef)(!1),g=function(){let[e,t]=(0,o.useState)(()=>"u"<typeof document||"visible"===document.visibilityState);return(0,o.useEffect)(()=>{if("u"<typeof document)return;let e=()=>t("visible"===document.visibilityState);return document.addEventListener("visibilitychange",e),e(),()=>document.removeEventListener("visibilitychange",e)},[]),e}(),b=(0,o.useRef)(!1),w=(0,o.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]),y=(0,o.useCallback)(e=>{if(null===l.current||m.current)return;w(),b.current=!1;let r=Date.now()-l.current;l.current=null,x.ex.dispatch({type:"puzzle_load_success",loadMs:r,readySignal:e,...Z({uuid:t,puzzleType:a?.puzzle_type,puzzleVariant:a?.variant,authed:!!i})})},[t,a,i,w]),v=(0,o.useCallback)(()=>{null===l.current||m.current||(b.current=!0,null!==f.current||g&&(f.current=setTimeout(()=>{f.current=null,m.current=!0,b.current=!1,G({reason:"render_timeout",uuid:t,puzzleType:a?.puzzle_type,puzzleVariant:a?.variant,authed:!!i})},3e4)))},[t,a,i,g]);(0,o.useEffect)(()=>{if(b.current){if(g)return void v();w()}},[g,v,w]);let z=(0,o.useCallback)((e,r)=>{G({reason:"webview_error",uuid:t,puzzleType:a?.puzzle_type,puzzleVariant:a?.variant,authed:!!i,webviewStatus:e,webviewUrl:r})},[t,a,i]),S=(0,o.useCallback)(()=>{w(),b.current=!1,l.current=null,G({reason:"render_error",uuid:t,puzzleType:a?.puzzle_type,puzzleVariant:a?.variant,authed:!!i})},[t,a,i,w]);(0,o.useEffect)(()=>{!t&&!r||n||c.current||(c.current=!0,l.current=Date.now(),x.ex.dispatch({type:"puzzle_load_start",...Z({uuid:t,authed:!!i})}))},[t,r,n,i]);let j=(0,o.useCallback)(e=>{let t;try{t=JSON.parse(e.nativeEvent.data)}catch{return}if(M(t))return void y("message");if(!t||"object"!=typeof t)return;let r=t;"observer-puzzle"===r.source&&("rendered"===r.status?y(r.via):"loaded"===r.status?v():"error"===r.status&&S())},[y,S,v]);return(0,o.useEffect)(()=>{if(!d.isWeb||!t)return;let e=K();return J(t=>{let r;if(!e||t.origin===e){try{r="string"==typeof t.data?JSON.parse(t.data):t.data}catch{return}M(r)&&y("message")}})},[y,t]),(0,o.useEffect)(()=>w,[w]),(0,o.useEffect)(()=>{!d.isWeb||n||i||!t&&!r||u.current||(u.current=!0,G({reason:"no_user",uuid:t,authed:!1}))},[n,i,t,r]),(0,o.useEffect)(()=>{!t||!a||a.files?.["index.html"]||h.current||(h.current=!0,G({reason:"missing_index",uuid:t,puzzleType:a?.puzzle_type,puzzleVariant:a?.variant,authed:!!i}))},[t,a,i]),(0,o.useEffect)(()=>{t&&s&&(p.current||(p.current=!0,G({reason:"data_fetch_error",uuid:t,authed:!!i})))},[t,s,i]),{dispatchLoadSuccess:y,dispatchWebViewError:z,dispatchRenderError:S,startRenderTimer:v,handleWebViewMessage:j}}({uuid:t,uri:g,currentUser:f,loading:m,puzzleData:w,puzzleFetchError:v}),{onLoadHandler:U}=function({currentUser:e,loading:t,baseUrl:r}){let i=(0,o.useRef)(!1),n=()=>
30{if(!d.isWeb||!(0,Q.b)("embedGame")||i.current||t)return;window.PM_Config=window.PM_Config||{},window.PM_Config.PM_BasePath=r;let n=e?e.uid:void 0;(!e||n)&&(window.embedGame(),i.current=!0)};return(0,o.useEffect)(()=>{n()},[e,t,r]),{onLoadHandler:()=>{n()}}}({currentUser:f,loading:m,baseUrl:b.baseUrl}),V=(0,o.useCallback)(e=>{if(!e)return!1;let t=(0,A.$w)(e);return!!t&&(p.push(t),!0)},[p]),F=(0,o.useCallback)(e=>{let t=e?.url;return!t||e?.isTopFrame===!1||!V(t)},[V]),B=(0,o.useCallback)(e=>{let t=e.currentTarget?.src;if(!t||!V(t))return;let r=e.currentTarget.getAttribute("data-initial-src");r&&r!==t&&(e.currentTarget.src=r)},[V]),q=(0,o.useCallback)(e=>{e.currentTarget?.src&&($(),B(e))},[$,B]),Y=(0,o.useCallback)(e=>{e.currentTarget?.src&&(E(),B(e))},[E,B]);if(!g&&e)return null;if(!f&&(d.isWeb||m))return(0,i.jsx)(c.Se,{style:{background:"#F0EAE6",height:700,width:"100%"}});if(e&&g)if(d.isWeb)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.default,{id:"pm-embed-script",src:`${b.baseUrl}js/puzzleme-embed.js`,strategy:"afterInteractive",onLoad:U}),(0,i.jsx)("div",{className:"pm-embed-div","data-testid":"pm-embed",...{testID:"pm-embed"},"data-id":b.puzzleId,"data-set":b.puzzleSet,"data-uid":f?f.uid:void 0,"data-height":"700px",style:{position:"relative",height:"700px",minHeight:"700px",width:"100%",display:"block",margin:"0 auto",maxWidth:"1280px"}})]});else{let e=f?`${g}&uid=${encodeURIComponent(f.uid)}`:g;return(0,i.jsx)(O.B,{iframeProps:{title:"Puzzle Me Game","aria-label":"Puzzle Me Game",allow:"web-share; fullscreen",src:e,"data-initial-src":e,onLoad:q,style:{position:"relative",height:"700px",minHeight:"700px",width:"100%",display:"block",margin:"0 auto",maxWidth:"1280px"}},webViewProps:{source:{uri:e},onShouldStartLoadWithRequest:F,onLoad:()=>$(),onError:e=>k(void 0,e.nativeEvent.url),onHttpError:e=>k(e.nativeEvent.statusCode,e.nativeEvent.url),style:{height:h-175},...S}},j)}return t&&!y&&z?(0,i.jsxs)(i.Fragment,{children:[d.isWeb&&(0,i.jsx)(C.default,{id:"dm-puzzle-bridge",src:"/scripts/dm-puzzle-bridge.js",strategy:"afterInteractive"}),(0,i.jsx)(O.B,{iframeProps:{title:"Marmelade Puzzle","aria-label":"Marmelade Game",allow:"web-share; fullscreen",src:z,"data-initial-src":z,"data-dm-puzzle":"",onLoad:Y,onError:()=>_(),style:{position:"relative",height:"700px",minHeight:"700px",width:"100%",display:"block",margin:"0 auto",maxWidth:"1280px"}},webViewProps:{source:{html:(r=z,a=/^https?:\/\/[^/?#]+/i.exec(r)?.[0]??null,`<!DOCTYPE html> 31<html> 32<head> 33<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> 34<style>*{margin:0;padding:0;box-sizing:border-box}html,body{width:100%;height:100%;overflow:hidden}iframe{width:100%;height:100%;border:none}</style> 35<script> 36(function () { 37 ${D} 38 // Readiness detection. Full rationale on createNativePuzzleHtml below - deliberately NOT in 39 // this script, which is parsed in the WebView on every puzzle load. 40 var settled = false; 41 function signalRendered(via) { 42 if (settled || !window.ReactNativeWebView) return; 43 settled = true; 44 window.ReactNativeWebView.postMessage( 45 JSON.stringify({ source: 'observer-puzzle', status: 'rendered', via: via }) 46 ); 47 } 48 // Route 2: puzzleready. Never sent today; kept so it works the moment DM emit it. 49 var expectedOrigin = ${JSON.stringify(a)}; 50 window.addEventListener('message', function (e) { 51 try { 52 // The same gate the web listeners apply. Null only where the URL would not parse, in which 53 // case this behaves exactly as it did before the gate existed. 54 if (expectedOrigin && e.origin !== expectedOrigin) return; 55 var data = typeof e.data === 'string' ? JSON.parse(e.data) : e.data; 56 if (__isPuzzleReady(data)) signalRendered('message'); 57 } catch (err) {} 58 }, true); 59 var polls = 0; 60 var timer = null; 61 // Route 1: same-origin DOM observation. Started by the iframe's load handler, not here. 62 window.__startPuzzleReadyPoll = function () { 63 if (timer || settled) return; 64 // Reset the budget too. Nulling the handle alone is not enough: an exhausted counter makes the 65 // restarted poll stop on its very first tick, so a second iframe load is still never detected. 66 polls = 0; 67 function stop() { 68 clearInterval(timer); 69 // Null it, or the guard above permanently blocks a restart - a second iframe load in the 70 // same wrapper (a retry, or a replaced frame) would never be detected. 71 timer = null; 72 } 73 timer = setInterval(function () { 74 if (settled || ++polls > 120) { stop(); return; } 75 var doc = null;
76 try { 77 var frame = document.querySelector('[data-dm-puzzle]'); 78 doc = frame && frame.contentDocument; 79 } catch (err) { 80 // Do NOT stop here. A throw is expected only where this document does not share the 81 // iframe's origin, which is permanent and the budget above ends anyway; treating every 82 // exception as terminal would let one transient failure silently disable detection for 83 // the rest of the puzzle's life with no trace. 84 return; 85 } 86 if (!doc || doc.readyState !== 'complete') return; 87 var app = doc.getElementById('app'); 88 if (app && app.children && app.children.length > 0) signalRendered('dom'); 89 }, 500); 90 }; 91})();</script> 92</head> 93<body> 94<iframe data-dm-puzzle allow="web-share; fullscreen" src="${r.replace(/&/g,"&").replace(/"/g,""")}" onload="window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify({source:'observer-puzzle',status:'loaded'}));window.__startPuzzleReadyPoll&&window.__startPuzzleReadyPoll()" onerror="window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify({source:'observer-puzzle',status:'error'}))"></iframe> 95<!-- 96 The Digital Marmelade storage bridge. MEASURED INERT ON iOS: the player posts nothing to this 97 window, so no STORAGE_REQUEST ever reaches the channel, and progress persistence was verified to 98 work regardless (typed into a puzzle, force-quit the app, reopened - the grid and clock were 99 restored). The player evidently persists to its own same-origin storage inside the iframe. 100 101 It is kept anyway because that measurement is iOS-only. Android resolves this document's origin 102 through loadDataWithBaseURL rather than loadHTMLString:baseURL: and may give it an opaque origin, 103 in which case the player's own storage could be partitioned and this bridge WOULD be load-bearing 104 there. Removing it would save ~14.8KB of parse per WebView; getting it wrong would silently 105 destroy reader progress on Android. Verify on an Android device before considering removal. 106--> 107<script>// Digital Marmelade PuzzleChannel bridge (minified vendor bundle). 108// Source: provided by Digital Marmelade (Simone Cabras). 109// 110// LOCAL PATCH - OBS-1602. Do not drop a new vendor build over this file without 111// re-applying the patch, and re-run \`node scripts/regenerate-dm-br
111idge-script.js\` 112// afterwards so native's inline copy matches. Send the patch to Digital Marmelade 113// so the next build carries it. The tail (\`C\`, \`j\` and the init block) now: 114// - tracks the bound iframe and contentWindow (\`z\`/\`q\`) and disposes + rebinds 115// when they change. \`$ ??=\` bound one contentWindow for the life of the page, 116// so after a client-side navigation to another puzzle the channel stayed on 117// the previous puzzle's dead window, dropped its requests 118// (\`t.source !== this.#i\`) and the player never reached \`puzzleready\`; 119// - releases the binding (\`k()\`) once no \`[data-dm-puzzle]\` iframe is left in 120// the document. Rebinding alone was not enough: the channel is built with 121// \`bubble:!1\`, so an undisposed one goes on calling stopImmediatePropagation 122// on every window \`message\` for the rest of the session, starving every 123// bubble-phase listener on every page visited after a puzzle (embed-block 124// height and scroll sync, Flourish, onboarding, the CMP stub); 125// - returns instead of throwing when no \`[data-dm-puzzle]\` iframe is present, 126// which is a normal transient state while the client renders; 127// - keeps DISPOSE_REQUEST terminal. \`j()\` records the disposed iframe in \`y\` and 128// \`C()\` refuses to rebind while that same element is still mounted, because 129// the observer below would otherwise rebuild the channel on the next DOM 130// mutation with \`w\`/\`B\` cleared, so the next PUZZLE_LOAD_REQUEST would answer 131// null. Dispose used to be terminal by construction: a disposed channel could 132// not deliver the CREATE_REQUEST that rebuilds it; 133// - keeps a MutationObserver connected for the life of the page so an iframe 134// mounting later, or a replacement one, is picked up. Its steady-state cost is 135// an identity check while a puzzle is bound and a document-wide querySelector 136// per mutation batch while none is. Re-running the script per puzzle is NOT an 137// alternative: each instance adds its own capture-phase \`message\` listener 138// that calls stopImmediatePropagation on every event, so the first instance 139// registered silently starves every later one. 140 141(()=>{function J(t){if(t===void 0)return t;if(typeof structuredClone==="function")try{return structuredClone(t)}catch(c){console.warn("structuredClone failed, falling back to JSON clone",c)}else console.warn("structuredClone unavailable, falling back to JSON clone");return JSON.parse(JSON.stringify(t))}function Q(){if(typeof crypto<"u"&&typeof crypto.randomUUID==="function")return crypto.randomUUID();return\`pc_\${Math.random().toString(36).slice(2,10)}\`}var W={events:{forward:!0},batch:{enabled:!0,delay:50}};function x(t){return t.kind==="event"&&typeof t.name==="string"}function I(t){return t.kind==="request"&&typeof t.name==="string"&&typeof t.id==="string"}class A{#i;#n;#f;#t=!1;#c=[];#d=null;handlers=new Map;#h=new Map;#K=new AbortController;#x=new WeakSet;#I=(t)=>{this.receive(t).catch((c)=>{console.error("Error handling incoming message",c)})};#B(t,c){let d=this.handlers.get(t);if(!d)return;if(c&&d!==c)return;if(d.opts?.signal&&d.abortHandler)d.opts.signal.removeEventListener("abort",d.abortHandler);this.handlers.delete(t)}#S(t){if(this.#t)throw Error("PuzzleChannel is disposed");this.#i.postMessage(t,this.#n)}#D(t){if(!t||typeof t!=="object")return null;return t}#N(t){let c=this.#f.events.bubble,d=Array.isArray(t.data)?t.data:[t.data],f=d.length===1?this.#D(d[0]):null;if(d.length===1){if(c===!0)return;if(Array.isArray(c)&&f&&(x(f)||I(f))&&c.includes(f.name))return}if(c!==!0&&!Array.isArray(c)){t.stopImmediatePropagation();return}t.stopImmediatePropagation();for(let i of d){let n=this.#D(i);if(!n)continue;if(!x(n)&&!I(n))continue;if(Array.isArray(c)&&!c.includes(n.name))continue;let h;if(x(n))h={kind:"event",name:n.name,data:n.data};else h={kind:"request",id:n.id,name:n.name,data:n.data};let K=new MessageEvent("message",{data:h,origin:t.origin,lastEventId:t.lastEventId,source:t.source,ports:[...t.ports]});this.#x.add(K),window.dispatchEvent(K)}}constructor(t,c="*",d={}){this.#i=t,this.#n=c,this.#f={events:{forward:d.events?.forward??W.events.forward,bubble:d.events?.bubble??W.events.bubble},batch:{...W.batch,...d.batch}},window.addEventListener("message",(f)=>{if(this.#t)throw Error("PuzzleChannel is disposed");if(this.#x.has(f))return;this.#N(f),this.#I(f)},{capture:!0,signal:this.#K.signal})}on(t,c,d){if(this.#t)throw Error("PuzzleChannel is disposed");if(this.handlers.has(t))console.warn(\`Overwriting existing handler for message: \${t}\`),this.#B(t);let f={handler:c,opts:d};if(d?.signal){if(d.signal.aborted)return console.warn(\`Handler for message \${t} registered with already-aborted signal, handler will never be called\`),this;f.abortHandler=()=>{this.#B(t,f)},d.signal.addEventListener("abort",f.abortHandler,{once:!0})}return this.handlers.set(t,f),this}off(t){if(this.#t)throw Error("PuzzleChannel is disposed");return this.#B(t),this}send(t,c,d={}){if(this.#t)throw Error("PuzzleChannel is disposed");let f={kind:"event",name:t,data:J(c),events:d.events};if(!(d.batch??this.#f.batch.enabled)){this.#S(f);return}this.#c.push(f),this.#w()}request(t,c,d={}){if(this.#t)throw Error("PuzzleChannel is disposed");let f=Q(),i=d.timeout??1e4,n={kind:"request",id:f,name:t,data:J(c)};return new Promise((h,K)=>{let F=()=>{clearTimeout(G),this.#h.delete(f),K(Error(\`Request aborted: \${t}\`))},G=setTimeout(()=>{this.#K.signal.removeEventListener("abort",F),this.#h.delete(f),K(Error(\`Request timed out: \${t}\`))},i);if(this.#K.signal.addEventListener("abort",F,{once:!0}),this.#h.set(f,{resolve:h,reject:K,timeoutId:G,abortHandler:F}),!(d.batch??this.#f.batch.enabled)){this.#S(n);return}this.#c.push(n),this.#w()})}flush(){if(this.#t)throw Error("PuzzleChannel is disposed");if(this.#d)clearTimeout(this.#d),this.#d=null;if(!this.#c.length)return;let t=this.#c.splice(0,this.#c.length);this.#S(t)}#w(){if(this.#t)throw Error("PuzzleChannel is disposed");if(this.#d)return;this.#d=setTimeout(()=>{this.flush()},this.#f.batch.delay)}async receive(t){if(this.#t)throw Error("PuzzleChannel is disposed");if(t.source!==this.#i)return;if(this.#n!=="*"&&t.origin!==this.#n)return;let c=Array.isArray(t.data)?t.data:[t.data];for(let d of c){let f=this.#D(d);if(!f)continue;
141if(f.kind==="response"){if(typeof f.replyTo!=="string")continue;let n=this.#h.get(f.replyTo);if(!n)continue;if(clearTimeout(n.timeoutId),this.#K.signal.removeEventListener("abort",n.abortHandler),this.#h.delete(f.replyTo),f.ok)n.resolve(f.data);else n.reject(f.error??Error("Request failed"));continue}if(!x(f)&&!I(f))continue;let i=this.handlers.get(f.name);if(!i){if(I(f)){let n={kind:"response",replyTo:f.id,ok:!1,error:{message:\`No handler found for request: \${f.name}\`}};if(!this.#f.batch.enabled)this.#S(n);else this.#c.push(n),this.#w()}else{if(console.warn(\`No handler found for event: \${f.name}\`),!x(f))continue;let n=f.events?.forward??this.#f.events.forward;if(n){let h=typeof n==="object"?n.transform:void 0;this.forward(f,h)}}continue}try{let n=await Promise.resolve().then(()=>i.handler(f.data));if(I(f)){let h={kind:"response",replyTo:f.id,ok:!0,data:J(n)};if(!this.#f.batch.enabled)this.#S(h);else this.#c.push(h),this.#w()}}catch(n){if(I(f)){let h={kind:"response",replyTo:f.id,ok:!1,error:{message:n instanceof Error?n.message:"Unknown error"}};if(!this.#f.batch.enabled)this.#S(h);else this.#c.push(h),this.#w()}else console.error(\`Error handling event: \${f.name}\`,n)}finally{if(i.opts?.once)this.handlers.delete(f.name)}if(x(f)){let n=f.events?.forward??i.opts?.events?.forward??this.#f.events?.forward;if(n){let h=typeof n==="object"?n.transform:void 0;this.forward(f,h)}}}}forward(t,c){let d=c?c(t.name):t.name;window.dispatchEvent(new CustomEvent(d,{detail:t.data}))}dispose(){if(this.#t)return;if(this.#t=!0,this.#d)clearTimeout(this.#d),this.#d=null;this.#c=[],this.#K.abort();for(let t of this.#h.values())clearTimeout(t.timeoutId);for(let t of this.handlers.values())if(t.opts?.signal&&t.abortHandler)t.opts.signal.removeEventListener("abort",t.abortHandler);this.#h.clear(),this.handlers.clear()}[Symbol.dispose](){this.dispose()}}var X={debug:0,info:1,warn:2,error:3,fatal:4};class S{name;static#i="info";#n;constructor(t,c){this.name=t;this.#n=c}static set defaultLevel(t){S.#i=t}static get defaultLevel(){return S.#i}static toError(t){return t instanceof Error?t:Error(String(t),{cause:t})}static print(t){if(t instanceof Error)return t.message+(t.stack?\` 142\${t.stack}\`:"");if(typeof t==="object"&&t!==null)try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)}set level(t){this.#n=t}get level(){return this.#n??S.#i}log(t,c,d){if(X[t]<X[this.level])return;let f={ts:Date.now(),level:t,message:c};if(t==="error"||t==="fatal")f.error=d?S.toError(d):Error(c);let i=\`[\${\`\${this.name??""}\`}] [\${f.ts}] [\${t.toUpperCase()}] \${c}\`,n=f.error?\` 143\${S.print(f.error)}\`:"";if(t==="warn"){console.warn(i,n);return}if(t==="error"||t==="fatal"){console.error(i,n);return}console.log(i,n)}debug(...t){this.log("debug",t.join(" "))}info(...t){this.log("info",t.join(" "))}warn(...t){this.log("warn",t.join(" "))}error(t,c){this.log("error",t,c===void 0?void 0:S.toError(c))}fatal(t,c){this.log("fatal",t,c===void 0?void 0:S.toError(c))}}var N=new S("PuzzleChannelStorage:IndexedDB");class O{name;request;db;constructor(t,c){if(this.name=t,this.request=c,this.db=this.request.result,!this.db.objectStoreNames.contains(t))this.db.createObjectStore(t,{keyPath:"id"})}set(t,c){if(t===void 0||c===void 0)return Promise.resolve(!1);let d={id:t,data:JSON.stringify(c)};return new Promise((f,i)=>{try{let n=this.db.transaction(this.name,"readwrite"),h=n.objectStore(this.name);n.addEventListener("complete",()=>{f(!0)},{once:!0}),n.addEventListener("error",()=>{N.error("Failed to put record",n.error),i(n.error)},{once:!0}),n.addEventListener("abort",()=>{N.error("Failed to put record",n.error),i(n.error)},{once:!0}),h.put(d)}catch(n){N.error("Failed to put record",n),i(n)}})}get(t){return new Promise((c,d)=>{if(t===void 0){d("No key defined");return}let n=this.db.transaction(this.name,"readwrite").objectStore(this.name).get(t);n.addEventListener("success",()=>{let h=n.result,K=h&&h.data?JSON.parse(h.data):null;c(K)},{once:!0}),n.addEventListener("error",()=>{d(n.error)},{once:!0})})}delete(t){if(t===void 0)return Promise.resolve(!1);return new Promise((c,d)=>{try{let f=this.db.transaction(this.name,"readwrite"),i=f.objectStore(this.name);f.addEventListener("complete",()=>{c(!0)},{once:!0}),f.addEventListener("error",()=>{N.error("Failed to delete record",f.error),d(f.error)},{once:!0}),f.addEventListener("abort",()=>{N.error("Failed to delete record",f.error),d(f.error)},{once:!0}),i.delete(t)}catch(f){N.error("Failed to delete record",f),d(f)}})}getAll(){return new Promise((t,c)=>{let i=this.db.transaction(this.name,"readwrite").objectStore(this.name).getAll();i.addEventListener("success",()=>{let n={};for(let h of i.result)n[String(h.id)]=JSON.parse(h.data);t(n)},{once:!0}),i.addEventListener("error",(n)=>{c(n)},{once:!0})})}}var _=new S("PuzzleChannelStorage:LocalStorage");class V{name;webStorage;constructor(t){this.name=t,this.webStorage=window.localStorage}getFullKey(t){return t===void 0?!1:this.name+":_"+t}set(t,c){if(t===void 0||c===void 0)return!1;
143try{let d=typeof c==="string"?c:JSON.stringify(c),f=this.getFullKey(t);if(f===!1)return!1;this.webStorage.setItem(f,d)}catch(d){return _.error("Failed to set value",d),!1}return!0}get(t){if(!t)return null;let c=this.getFullKey(t);if(c===!1)return null;let d=this.webStorage.getItem(c);return typeof d==="string"?JSON.parse(d):d}getAll(){let t={},c=\`\${this.name}:_\`;for(let d=0;d<this.webStorage.length;d++){let f=this.webStorage.key(d);if(!f||!f.startsWith(c))continue;let i=f.slice(c.length);t[i]=this.get(i)}return t}delete(t){if(!t)return!1;let c=this.getFullKey(t);if(c===!1)return!1;return this.webStorage.removeItem(c),!0}}var $,w,B,q,z,y,D=new S("PuzzleChannelStorage");function k(){if($)$.dispose();$=void 0,w=void 0,B=void 0,q=void 0,z=void 0}function C(){if($&&z&&z.isConnected&&z.contentWindow===q)return!0;let t=document.querySelector("[data-dm-puzzle]");if(!t?.contentWindow){k(),y=void 0;return!1}if(t===y)return!1;k();let c="*";try{c=new URL(t.src,window.location.href).origin}catch{}z=t,q=t.contentWindow,y=void 0,$=new A(q,c,{events:{bubble:!1,forward:!1}}),$.on("STORAGE_REQUEST",U).on("PUZZLE_LOAD_REQUEST",H).on("PUZZLE_SAVE_REQUEST",E).on("TYPE_LOAD_REQUEST",P).on("TYPE_SAVE_REQUEST",R).on("DISPOSE_REQUEST",j).on("CREATE_REQUEST",T);return!0}function Y(t,c){if(c===void 0)return t.getAll();if(!Array.isArray(c))return t.get(c);return Promise.all(c.map((d)=>Promise.resolve(t.get(d)).then((f)=>[d,f]))).then(Object.fromEntries)}function Z(t,c){let d=Object.entries(c);if(!d.length)return!1;return Promise.all(d.map(([f,i])=>Promise.resolve(t.set(f,i)).catch((n)=>{return D.error(\`Failed to save storage value for key: \${f}\`,n),!1}))).then((f)=>f.every(Boolean))}function U(t){let{puzzle:c,content:d}=t;if(d.kind==="IndexedDB")return new Promise((f)=>{let i=indexedDB.open(d.name,Date.now());i.onupgradeneeded=()=>{let n=i.result;if(!n.objectStoreNames.contains(\`\${c.type}-\${c.id}\`))n.createObjectStore(\`\${c.type}-\${c.id}\`,{keyPath:"id"});if(!n.objectStoreNames.contains(c.type))n.createObjectStore(c.type,{keyPath:"id"})},i.onsuccess=()=>{i.result.onversionchange=()=>{i.result.close()},w=new O(\`\${c.type}-\${c.id}\`,i),B=new O(\`\${c.type}\`,i),f(!!(w&&B))},i.addEventListener("error",()=>{D.error("Failed to create IndexedDB adapter",i.error),f(!1)},{once:!0})});return new Promise((f)=>{try{w=new V(\`\${c.type}-\${c.id}\`),B=new V(c.type),f(!0)}catch(i){D.error("Failed to create localStorage adapter",i),f(!1)}})}function H(t){if(!w)return D.error("No puzzle storage found"),null;return Y(w,t.content.keys)}function E(t){if(!w)return D.error("No puzzle storage found"),!1;return Z(w,t.content)}function P(t){if(!B)return D.error("No puzzle type storage found"),null;return Y(B,t.content.keys)}function R(t){if(!B)return D.error("No puzzle type storage found"),!1;return Z(B,t.content)}function j(){y=z,k()}function T(){C()}function L(){try{return C()}catch(t){return D.error("Failed to create PuzzleChannelStorage",t),!1}}function M(){L();try{new MutationObserver(L).observe(document.documentElement,{childList:!0,subtree:!0})}catch(t){D.error("Failed to watch the DOM for puzzle iframe changes",t)}}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",M,{once:!0});else M()})();</script> 144</body> 145</html>`),baseUrl:new URL(z).origin},onShouldStartLoadWithRequest:F,onError:e=>k(void 0,e.nativeEvent.url),onHttpError:e=>k(e.nativeEvent.statusCode,e.nativeEvent.url),style:{height:h-175},...S,onMessage:e=>{S.onMessage?.(e),N(e)}}},j)]}):null};var X=r(30983),ee=r(75477);let et=({article:e,children:t})=>{let r=(0,R.r)(),n=()=>{(0,a.$s)("related_article_click",{content_id:e.id,content_title:e.title})};return d.isWeb?(0,i.jsx)(p.M,{href:e.linkUrl,unstyled:!0,pressStyle:{opacity:.7},width:"100%",onPress:n,children:t}):(0,i.jsx)(d.Stack,{onPress:()=>{n();let t=e.linkUrl;t&&(t.startsWith("http")||t.startsWith("tel:")||t.startsWith("mailto:")?X.A.openURL(t):r.push(t))},pressStyle:{opacity:.7},accessibilityHint:"Opens the article",accessibilityRole:"button",accessibilityLabel:`Read article: ${e.title}`,width:"100%",children:t})},er=({articles:e,variant:t="desktop",hideOnLargeScreens:r=!0})=>e?.length?"desktop"===t?(0,i.jsxs)(c.Se,{width:220,paddingVertical:"$16",gap:"$24",children:[(0,i.jsx)(ee.x,{weight:"bold",children:"Related articles:"}),(0,i.jsx)(c.Se,{gap:"$24",children:e.map(e=>(0,i.jsxs)(c.Se,{children:[(0,i.jsx)(b.c,{spacing:"$16"}),(0,i.jsx)(et,{article:e,children:(0,i.jsxs)(c.Se,{gap:"$24",children:[e.image&&(0,i.jsx)(v.M,{imageUrl:e.image,aspectRatio:e.imageRatio||1.5,sizes:"220px"}),(0,i.jsx)(ee.x,{children:e.title})]})})]},e.id))})]}):(0,i.jsxs)(c.Se,{$lg:{padding:"$32",gap:"$24"},padding:"$24",gap:"$8",...r&&{$xxl:{display:"none"}},children:[(0,i.jsx)(ee.x,{weight:"bold",children:"Related articles:"}),(0,i.jsx)(c.Se,{gap:"$24",children:e.map(e=>(0,i.jsxs)(c.Se,{children:[(0,i.jsx)(b.c,{spacing:"$16",width:"100%"}),(0,i.jsx)(et,{article:e,children:(0,i.jsxs)(c.lW,{gap:"$24",alignItems:"flex-start",children:[(0,i.jsx)(ee.x,{flex:1,children:e.title}),e.image&&(0,i.jsx)(d.View,{width:105,height:70,overflow:"hidden",children:(0,i.jsx)(v.M,{imageUrl:e.image,aspectRatio:e.imageRatio||1.5,objectFit:"cover",sizes:"105px"})})]})})]},e.id))})]}):null;var ei=r(28564),en=r(50481);let ea=(0,d.styled)(en.f,{accessible:!0,role:"note",fontFamily:"$caslonDoric",fontSize:"$14",lineHeight:"$20",fontWeight:"$400",fontStyle:"italic",color:"$grey_600",marginTop:"$16"});function es(){return(0,i.jsx)(ea,{children:"Editorâs note: our recommendations are chosen independently by our journalists. The Observer may earn a small commission if a reader clicks a link and purchases a recommended product. This revenue helps support Observer journalism."})}var el=r(58066),eo=r(37791),ed=r(18810),ec=r(68912),eu=r(41756),eh=r(35308);let ep=/<a\s[^>]*href=(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi,ef=e=>e.trimStart().toLowerCase().startsWith("http")&&!(0,A.$w)(e)&&!("web"!==eu.A.OS&&(0,A.to)(e));var em=r(68402),eg=r(47783),eb=r(26556),ew=r(18924),ey=r(61550),ev=r(49180),ex=r
145(74888);let ez=["culture","style"],eS=[/^sponsored\b/i,/^in partnership with\b/i,/^paid (advertisement|advert|promotion|content|partnership)\b/i,/^advertorial\b/i,/^promoted\b/i,/^brought to you by\b/i];var ej=r(4825),e$=r(12638),ek=r(57362),e_=r(92309),eE=r(90560),eC=r(43742),eR=r(57353),eI=r(1788),eT=r(66563),eL=r(84965),eP=r(93234);let eA=(0,d.styled)(eL.a,{fontSize:"$16",lineHeight:"$23"}),eO=e=>e?"caslonIonicBoldItalic":"caslonIonicLightItalic",eW=({newsletter:e,isSelected:t,isLoading:r=!1,onToggle:n})=>{let a=(0,o.useMemo)(()=>(0,eT.eC)(e.description),[e.description]),s=!!e.articleCoverImage,u=(0,d.useMedia)().lg?160:142,h=(0,i.jsx)(eI.G,{label:e.ctaText||l._6.Hh,newsletterTitle:e.title,isSelected:t,isLoading:r,onPress:()=>n(e)});return(0,i.jsxs)(c.Se,{testID:"article-newsletter-card",borderTopWidth:1,borderBottomWidth:1,borderColor:"$newsletter_border",gap:"$16",paddingVertical:"$16",paddingHorizontal:"$0",width:"100%",$lg:{paddingHorizontal:"$32"},children:[(0,i.jsxs)(c.lW,{width:"100%",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsxs)(c.Se,{testID:"article-newsletter-card-copy",flex:1,flexBasis:0,minWidth:176,gap:"$8",alignItems:"flex-start",alignSelf:"flex-start",paddingTop:"$0",paddingBottom:"$8",paddingRight:"$16",paddingLeft:"$0",$lg:{justifyContent:"flex-start"},children:[(0,i.jsx)(el.c,{color:"$newsletter_text",lineHeight:20,children:l.Wb.Yf}),(0,i.jsx)(eT.yx,{displayTitle:e.displayTitle,title:e.title,color:"$newsletter_text"}),a.length>0&&(0,i.jsx)(ee.x,{color:"$newsletter_text",children:(0,i.jsx)(eT.Ig,{nodes:a,italicFace:eO})}),(0,i.jsxs)(c.lW,{alignItems:"center",gap:"$16",flexWrap:"wrap",children:[(0,i.jsx)(eC.Z,{alignSelf:"flex-start",lineColor:"$orange_600",href:ey.bw.NEWSLETTERS_PAGE,iconAfter:(0,i.jsx)(eP.Q,{color:"currentColor",width:20,height:11}),children:(0,i.jsx)(eA,{color:"$newsletter_text",children:l.Wb.CM})}),!s&&h]})]}),s&&(0,i.jsxs)(c.Se,{testID:"article-newsletter-card-image-column",alignSelf:"stretch",alignItems:"flex-end",justifyContent:"space-between",gap:"$8",flexShrink:0,children:[(0,i.jsx)(c.Se,{testID:"article-newsletter-card-cover",children:(0,i.jsx)(eR.c,{coverImage:e.articleCoverImage,size:u,showEnvelopeFlap:!1})}),h]})]}),(0,i.jsxs)(j.W,{color:"$newsletter_meta_text",children:[l.Wb.zf,(0,i.jsx)(p.M,{"aria-label":"Privacy Policy Link",href:ey.bw.PRIVACY_DATA_USAGE_AND_COOKIE_POLICY,fontSize:"$14",lineHeight:"$20",fontFamily:"$caslonDoric",fontWeight:"$400",color:"$newsletter_meta_text",unstyled:!1,children:l.Wb.hM})]})]})};var eM=r(86143),eD=r(40022),eH=r(64984),eN=r(52221),eU=r(52561);let eV=({article:{access:e,articleType:t,content:r,heroImageDescription:z,heroImageRatio:C,heroImageSize:R,heroImageUrl:I,heroVideoUrl:T,heroVideoOrientation:L,id:P,journalists:A,kicker:O,noAds:M,publishAt:D,secondaryTopic:H,slug:N,summary:U,tags:V,title:F,topic:B},relatedArticles:q,isPreview:J=!1})=>{let K=(0,o.useRef)(null),{currentUser:Z}=(0,em.As)(),{showAds:G,setShowAds:Q}=(0,eo.g)(),X=A.length>0,ee=V.length>0,et=X||ee,{subscribed:en,isLoading:ea}=(0,e_.Rs)(),eC=r.find(e=>"articleRawHtmlItem"===e.type||"puzzle"===e.type),eR=!!eC,eI=r.some(e=>"articleEmbedBlock"===e.type&&!0===e.fullScreen),[eT,eL]=(0,o.useState)(0),eP=(0,ex.k)({topic:B,secondaryTopic:H,slug:N}),{targeting:eA}=(0,ec.S)(),eO=ez.includes(B)&&!J&&eA&&!(({tags:e,kicker:t})=>{if((e??[]).some(e=>e?.slug==="sponsored"))return!0;let r=(t??"").trim();return""!==r&&eS.some(e=>e.test(r))})({tags:V,kicker:O}),eV=(0,o.useMemo)(()=>eO&&r.some(e=>{let t;return("paragraph"===e.type||"imageWithDesc"===e.type||"quote"===e.type||"verse"===e.type||"articleRawHtmlItem"===e.type&&"web"===eu.A.OS||"title"===e.type&&(0,eh.j)(e.body))&&Array.from(("string"==typeof(t="imageWithDesc"===e.type?e.caption:"articleRawHtmlItem"===e.type?e.rawHtml:e.body)?t:"").matchAll(ep),e=>e[1]??e[2]??e[3]).some(ef)||"articleBlock"===e.type&&"string"==typeof e.articleUrl&&ef(e.articleUrl)}),[eO,r]),eF=(0,o.useRef)(!1),eB=d.isWeb?{top:0}:(0,eH.Or)(),eq=d.isWeb?0:eB.top+76,{stickyVisible:eJ,activeTab:eK,setActiveTab:eZ,setRecipeLayout:eG,handleScroll:eQ,scrollYRef:eY}=(0,eD.x)(eq),eX=!ea&&!en.loading;(0,o.useEffect)(()=>(Q(!M),()=>Q(!0)),[M,Q]),(0,ew.L)({authors:A.map(e=>e.name),sections:[B,H],title:F,path:eP}),(0,o.useEffect)(()=>
145{if(!K.current)return void eL(0);let e="function"==typeof K.current.getBoundingClientRect?K.current.getBoundingClientRect():void 0;eL(function(e){let t=0,r=0;for(;;){let i=ty[t%2==0?"dmpu":"mpu"],n=850*(t>0);if(r+i+n>e)break;r+=i+n,t+=1}return t}(e&&"number"==typeof e.height?e.height:1e3))},[]),(0,o.useEffect)(()=>{if(ea||en.loading)return;let e=setTimeout(()=>{eF.current||((0,a.$s)("author_name",{author_name:A.map(e=>e.name).join(", ")}),eF.current=!0)},500);return()=>clearTimeout(e)},[A,ea,en.loading]),(0,o.useEffect)(()=>{(0,ej.VU)({tags:[B,H,(0,ej.R2)(e)],articleDate:D,author:A[0]?.name||"",section:"Article",rawAccess:e})},[P,B,H,e,D,A]),(({path:e,access:t,accessTag:r,enabled:i,subscribed:n})=>{let a=(0,o.useRef)(n);a.current=n,(0,o.useEffect)(()=>{if(!i||!(0,ek.L)())return;(0,e$.$V)({path:e,accessTag:r,rawAccess:t,report:e=>{let{status:t,loading:r}=a.current;t||x.ex.dispatch({type:"paywall_lifecycle",...e,subscriptionResolved:!r})}});let n=()=>{"hidden"===document.visibilityState&&(0,e$.w3)()},s=e=>{e.persisted?(0,e$.w3)():(0,e$.vg)()};return window.addEventListener("pagehide",s),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("pagehide",s),document.removeEventListener("visibilitychange",n),(0,e$.vg)()}},[e,t,r,i])})({path:eP,access:e,accessTag:(0,ej.R2)(e),enabled:d.isWeb,subscribed:{status:en.status,loading:!eX}});let e0=B?.toLowerCase().includes("puzzles")||H?.toLowerCase().includes("puzzles"),e1="obsstack_article"===t,e2=r.filter(e=>"placeholder"===e.type&&"related_articles"===e.kind),e4=e2.length>0,e5=e2[0],e6=e4&&e5?.hidden===!0,e7=r.filter(e=>"placeholder"===e.type&&"newsletter_signup"===e.kind),e8=e7.length>0,e3=e8&&e7[0]?.hidden===!0,{isAnonymous:e9}=(0,_.q)(),[te,tt]=(0,o.useState)(!1),tr=!eI&&!e3,{data:ti,isError:tn}=(0,n.I)({queryKey:["newsletters-page"],queryFn:()=>(0,s.o)(),enabled:tr,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}),ta=tr&&!tn&&!ti,ts=tn||!!ti&&0===ti.newsletters.length,tl=ti?function(e,{newsletterId:t,newsletterSlug:r,topic:i,secondaryTopic:n,journalists:a}){if(null!=t){let r=e.find(e=>e.id===t);if(r)return r}if(r){let t=e.find(e=>e.slug===r);if(t)return t}for(let t of(0,eM.TT)(i,n,a?.map(e=>e.slug))){let r=e.find(e=>e.key===t);if(r)return r}return e.find(e=>e.key===eM.DW)??null}(ti.newsletters,{newsletterId:e7[0]?.newsletterId,newsletterSlug:e7[0]?.newsletterSlug,topic:B,secondaryTopic:H,journalists:A}):null,to=(0,o.useMemo)(()=>tl?[tl]:[],[tl]),td=(0,E.l)(to,{source:"article",enabled:tr}),tc=e9&&(td.hasPendingChanges||te),tu=async({email:e,marketingOptIn:t})=>{await td.commit(e,t)&&tt(!0)},th=(0,ed.T)("article",r.filter(e=>{if(eI)return"articleEmbedBlock"===e.type&&!0===e.fullScreen;if("tags"===e.type)return!1;if("articleRawHtmlItem"===e.type&&e0){let t=W(e.rawHtml||"");return!t?.toLowerCase().includes("crossword")}return!0}),{activeTab:eK,setActiveTab:eZ,onRecipeLayout:eG,scrollYRef:eY}),tp=(0,eg.L)({id:P,title:F,publishDate:D,imageUrl:I,imageAspectRatio:C,linkUrl:eP,type:"Article"}),{isBookmarked:tf,toggleBookmark:tm}=(0,eb.w)({content:tp,successMessages:{bookmarked:l.Fc.o.jZ.F,unbookmarked:l.Fc.o.kS},errorMessages:{authRequired:l.Fc.o.jZ.i,failed:l.Fc.o.av}}),tg=(e,t,r)=>{let i=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a.key&&a.key.includes(t))if(i)e.splice(n,1),n--;else{let t=Array.isArray(r)?r:[r];e.splice(n,1,...t),n+=t.length-1,i=!0}}},tb=(e,t,r)=>{let i=0,n=-1,a=e.findIndex((e,r)=>!!(e.key&&e.key.includes("paragraph"))&&(i++,n=r,i===t)),s=Array.isArray(r)?r:[r];-1!==a?e.splice(a+1,0,...s):-1!==n&&e.splice(n+1,0,...s)},tw=r.some(e=>"articleBlock"===e.type);if(!eI&&q?.length&&!e6&&!tw&&(e4?tg(th,"placeholder-related_articles",{Component:er,props:{articles:q,variant:"mobile",hideOnLargeScreens:!1},key:"relatedArticles-placeholder",tracking:{component_name:"related_articles",component_variant:"mobile"}}):tb(th,8,{Component:er,props:{articles:q,variant:"mobile"},key:`relatedArticles-mobile-${th.length}`,tracking:{component_name:"related_articles",component_variant:"mobile"}})),!eI&&!e3&&!ta){let e=tl&&!ts?[{Component:eW,props:{newsletter:tl,isSelected:td.selectedKeys.includes(tl.key),isLoading:td.isLoading,onToggle:e=>{tt(!1),td.toggle(e)}},key:"newsletter-signup",tracking:{component_name:"newsletter_signup"}}]:[{Component:k.q,props:{isArticle:!0,topic:B,secondaryTopic:H,journalists:A},key:"newsletter-signup",tracking:{component_name:"newsletter_signup"}}];e8?tg(th,"placeholder-newsletter_signup",e):tb(th,10,e)}let ty={dmpu:600,mpu:250};if(d.isWeb&&G&&!eI){let e=0;for(let t=0;t<th.length;t++){let r=th[t];if(r.key&&r.key.includes("paragraph")&&++e%5==0){let r={Component:h.v,props:{id:(e-1)%4+1,page:"article",type:"mpu",inline:!0},key:`adPlaceholder-${t}-${e}`};th.splice(t+1,0,r),t++}}}let tv=th.map(e=>({key:e.key,sidebar:e.sidebar})).filter(e=>!!e.sidebar),tx="tall"===L,tz=T?eE.pu:eE.D$,tS=eI?(0,i.jsx)(d.View,{width:"100%",backgroundColor:e1?"$obsstack_background":void 0,children:th.map(({Component:e,props:t,key:r})=>(0,i.jsx)(e,{...t},r))}):(0,i.jsxs)(eE.Nh,{width:e1?"100%":void 0,backgroundColor:e1?"$obsstack_background":void 0,children:[(0,i.jsx)(tz,{children:(0,i.jsxs)(c.lW,{flexDirection:"column",$md:{flexDirection:T&&tx?"row":"column"},gap:"$4",$lg:{gap:tx?"$4":"$8"},width:"100%",children:[(0,i.jsxs)(c.Se,{flex:1,gap:"$4",$md:{alignSelf:T&&tx?"center":void 0},children:[(0,i.jsxs)(c.lW,{justifyContent:"space-between",width:"100%",children:[(0,i.jsxs)(c.Se,{gap:"$4",$lg:{gap:"$8"},children:[(0,i.jsx)(p.M,{href:`${ey.bw.TOPICS}/${H}`,children:(0,i.jsx)(el.c,{textTransform:"capitalize",children:O||H?.replace(/-/g," ")?.trim()})}),(0,i.jsx)(j.W,{children:(0,ev.Y)(D,"event")})]}),Z&&(0,i.jsx)(f.X,{iconRight:!0,onPress:tm,saved:tf})]}),(0,i.jsx)(w.H2,{tag:"h1",children:F}),(0,i.jsx)(y.H5,{tag:"h2",children:U})]}),!!T&&(0,i.jsx)(c.Se,{width:"100%",paddingTop:tx?"$24":void 0,$md:{paddingTop:0,width:tx?"40%":"100%",marginTop:tx?0:"$4",paddingLeft:tx?"$24":void 0},overflow:"hidden",testID:"hero-video",children:(0,i.jsx)(eU.x,{videoId:T,aspectRatio:"tall"===L?"tall":"wide"})})]})}
145),I&&!T&&"hidden"!==R&&(0,i.jsxs)(d.View,{maxWidth:"$maxContentWidth",role:"figure",gap:"$16",width:"100%",testID:"hero-image",children:[(0,i.jsx)(v.M,{aspectRatio:Number(C),imageUrl:I,alt:z,sizes:"(min-width: 1280px) 1280px, 100vw",maxHeight:"auto",priority:!0}),z&&(0,i.jsx)(g.H,{width:"100%",paddingHorizontal:"$16",children:z})]}),(0,i.jsxs)(eE.Ww,{ref:K,children:[eR&&"articleRawHtmlItem"===eC.type&&(0,i.jsx)(Y,{rawHtml:eC.rawHtml}),eR&&"puzzle"===eC.type&&(0,i.jsx)(Y,{uuid:eC.uuid}),(0,i.jsxs)(eE.VI,{children:[(0,i.jsxs)(eE.cm,{flex:1,children:[(0,i.jsxs)(c.Se,{width:"100%",gap:"$16",$md:{gap:"$24"},$xxl:{gap:"$32",width:eE.fQ,zIndex:1},children:[et&&(0,i.jsxs)(c.Se,{position:"relative",width:"100%",children:[A?.map(e=>(0,i.jsx)(m.K,{article:!0,journalist:e},e.id)),ee&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.c,{display:"none",$xxl:{display:"flex"},color:"$grey_25",thickness:.5,spacing:16}),(0,i.jsx)(c.lW,{display:"none",$xxl:{display:"flex"},flexWrap:"wrap",gap:"$8",children:V.map(e=>(0,i.jsx)(j.W,{textDecorationLine:"underline",children:(0,i.jsx)(p.M,{href:`${ey.bw.TAGS}/${e.slug}`,children:e.title})},e.id))})]}),eR?null:(0,i.jsx)(ei.w,{path:eP,title:F})]}),tv.length>0&&(0,i.jsx)(c.Se,{display:"none",$xxl:{display:"flex"},width:"100%",gap:"$8",children:tv.map(({key:e,sidebar:t})=>{let r=t.Component;return(0,i.jsxs)(c.Se,{width:"100%",children:[t.label?(0,i.jsx)(el.c,{children:t.label}):null,(0,i.jsx)(r,{...t.props})]},`${e}-sidebar`)})}),!!q?.length&&!e6&&!e4&&(0,i.jsx)(c.Se,{display:"none",$xxl:{display:"flex"},width:"100%",children:(0,i.jsx)(er,{articles:q,variant:"desktop"})})]}),(0,i.jsxs)(eE.mR,{children:[th?.map(({Component:e,props:t,key:r,tracking:n},a)=>n?(0,i.jsx)(S,{componentName:n.component_name,componentVariant:n.component_variant,positionIndex:a,skip:!eX,children:(0,i.jsx)(e,{...t})},r):(0,i.jsx)(e,{...t},r)),ee&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.c,{$xxl:{display:"none"},color:"$grey_25",thickness:.5,spacing:0}),(0,i.jsx)(c.lW,{$xxl:{display:"none"},flexWrap:"wrap",gap:"$8",children:V.map(e=>(0,i.jsx)(j.W,{textDecorationLine:"underline",children:(0,i.jsx)(p.M,{href:`${ey.bw.TAGS}/${e.slug}`,children:e.title})},e.id))})]}),eV&&(0,i.jsx)(es,{}),(0,i.jsx)(b.c,{marginTop:"$32"}),d.isWeb?(0,i.jsx)("div",{id:"piano_inline_article_end"},P):null]})]}),(0,i.jsx)(c.Se,{flexShrink:0,width:eE.WY,children:d.isWeb&&G&&[...Array(eT).keys()].map(e=>{let t=[...Array(e).keys()].reduce((e,t)=>e+ty[t%2==0?"dmpu":"mpu"]+850,0),r=e%2==0,n=Math.floor(e/2)+1,a=Math.floor(e/2)+1;return(0,i.jsx)(c.Se,{position:"absolute",top:t,$lg:{display:"block"},display:"none",width:300,children:(0,i.jsx)(h.v,{page:"article",type:r?"dmpu":"mpu",id:r?n:a})},e)})})]})]})]}),tj=tc&&(0,i.jsx)($.s,{children:(0,i.jsx)($.R,{selectedCount:td.selectedCount,totalCount:+!!tl,isCommitting:td.isCommitting,hasPendingChanges:td.hasPendingChanges,hasSucceeded:te,onConfirm:tu,onDismiss:()=>{tt(!1),td.reset()}})});return d.isWeb?(0,i.jsxs)(i.Fragment,{children:[tS,!eI&&eJ&&(0,i.jsx)(eN.cR,{activeTab:eK,setActiveTab:eZ,headerHeight:eq}),tj]}):(0,i.jsxs)(d.View,{flex:1,children:[(0,i.jsx)(u.B,{flex:1,onScroll:e=>{if(d.isWeb)return;let{contentOffset:t,contentSize:r,layoutMeasurement:i}=e.nativeEvent||{};t&&r&&i&&eQ(t.y)},scrollEventThrottle:16,children:tS}),!eI&&eJ&&(0,i.jsx)(eN.cR,{activeTab:eK,setActiveTab:eZ,headerHeight:eq}),tj]})}},64984:(e,t,r)=>{r.d(t,{Or:()=>s});var i=r(7620),n=r(26452);let a=i.createContext(null);function s(){let e=i.useContext(a);if(null==e)throw Error("No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.");return e}n.A.create({fill:{flex:1}}),a.Consumer},71341:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={cancelIdleCallback:function(){return a},requestIdleCallback:function(){return n}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let n="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},a="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
145dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75237:(e,t,r)=>{r.d(t,{ArticleSkeleton:()=>l});var i=r(54568),n=r(30770),a=r(62243);let s=({lines:e})=>(0,i.jsx)(n.Se,{children:e.map((e,t)=>(0,i.jsx)(a.d,{width:e,lineHeight:26},`para-line-${t}`))}),l=()=>(0,i.jsxs)(n.Se,{flex:1,width:"100%",children:[(0,i.jsxs)(n.Se,{paddingHorizontal:"$16",paddingVertical:"$24",gap:"$16",width:"100%",maxWidth:800,alignSelf:"center",children:[(0,i.jsxs)(n.Se,{gap:"$4",children:[(0,i.jsx)(a.d,{width:"30%",lineHeight:24}),(0,i.jsx)(a.d,{width:"45%",lineHeight:20})]}),(0,i.jsxs)(n.Se,{children:[(0,i.jsx)(a.d,{width:"100%",lineHeight:36}),(0,i.jsx)(a.d,{width:"85%",lineHeight:36})]}),(0,i.jsxs)(n.Se,{children:[(0,i.jsx)(a.d,{width:"100%",lineHeight:26}),(0,i.jsx)(a.d,{width:"60%",lineHeight:26})]})]}),(0,i.jsx)(a.Z,{width:"100%",aspectRatio:1.5,radius:0}),(0,i.jsxs)(n.Se,{paddingHorizontal:"$16",paddingVertical:"$24",gap:"$16",width:"100%",maxWidth:800,alignSelf:"center",children:[(0,i.jsxs)(n.lW,{gap:"$12",alignItems:"center",children:[(0,i.jsx)(a.Z,{width:80,height:80,radius:40}),(0,i.jsxs)(n.Se,{flex:1,gap:"$4",children:[(0,i.jsx)(a.d,{width:"50%",lineHeight:26}),(0,i.jsx)(a.d,{width:"35%",lineHeight:20})]})]}),(0,i.jsxs)(n.Se,{gap:"$16",children:[(0,i.jsx)(s,{lines:["100%","100%","96%","100%","70%"]}),(0,i.jsx)(s,{lines:["100%","95%","100%","90%","55%"]})]})]})]})},91200:(e,t,r)=>{r.d(t,{K:()=>f});var i=r(54568),n=r(7620),a=r(6818),s=r(54076),l=r(70931),o=r(61550),d=r(30770),c=r(35677);let u=(0,s.styled)(d.lW,{name:"BylineContainer",alignItems:"center",alignSelf:"stretch",width:"100%",gap:"$12",paddingBottom:"$16"}),h=(0,s.styled)(d.Se,{name:"TextContainer",flex:1,gap:"$8",variants:{variant:{article:{gap:0}}}}),p=(0,s.styled)(c.E,{name:"BylineText",color:"$text_primary",fontFamily:"$caslonIonic",fontWeight:"$300",variants:{variant:{articleName:{fontSize:"$14",lineHeight:"$21"},articleInfo:{fontSize:"$14",lineHeight:"$21",fontStyle:"italic"},name:{fontSize:"$20",lineHeight:"$24"},info:{fontSize:"$18",fontStyle:"italic",lineHeight:"$24"}}},defaultVariants:{variant:"name"}}),f=({article:e,journalist:t,props:r})=>{let d=n.useRef(null),c=(0,a.r)(),f=t.name?`Default profile image for ${t.name}`:"Default journalist profile image";return(0,i.jsxs)(u,{onPress:()=>{t.slug&&(s.isWeb?c.replace(`/contributor/${t.slug}`):c.push(`/contributor/${t.slug}`))},...r,ref:d,children:[(0,i.jsx)(s.View,{width:"$80",height:"$80",borderRadius:"$40",overflow:"hidden",children:(0,i.jsx)(l.M,{width:"100%",height:"100%",aspectRatio:1,objectFit:"cover",sizes:"80px",objectPosition:"center",imageUrl:t.photo??o.SS,alt:t.photo?`Photo of ${t.name}`:f})}),(0,i.jsxs)(h,{...e&&{variant:"article"},children:[t.name?(0,i.jsx)(p,{variant:e?"articleName":"name",children:t.name}):null,t.position?(0,i.jsx)(p,{variant:e?"articleInfo":"info",children:t.position}):null,t.location?(0,i.jsx)(p,{variant:e?"articleInfo":"info",children:t.location}):null]})]})};f.displayName="Byline"},93505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={ESCAPE_REGEX:function(){return a},htmlEscapeAttributeString:function(){return d},htmlEscapeJsonString:function(){return o}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let n={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},a=/[&><\u2028\u2029]/g,s={"&":"&",'"':""","'":"'","<":"<",">":">"},l=/[&"'<>]/g;function o(e){return e.replace(a,e=>n[e])}function d(e){return e.replace(l,e=>s[e])}}}]); 146//# sourceMappingURL=6916-98ed3d7db2baaf02.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.