PageSourceSearch

https://www.scientificamerican.com/static/entry/article.C-zKG26J.js

js scientificamerican.com collected 2026-10-01 07:48:17 UTC 17,479 bytes, 1 lines download raw bytes

1import{r as d,j as e}from"../chunks/vendor-react-DdEP1kCQ.js";import{b as O,F as P,k as F,p as _,d as E,x as A,u as N,J as W,S as H,g as D,K as R,i as $}from"../chunks/core-DTFOJR-b.js";import{U}from"../chunks/DefaultLayout-n0x-WG_8.js";import{A as q}from"../chunks/Article-CiisdShr.js";import{R as J,B as K,s as z}from"../chunks/index-Bm6OIO42.js";import{a as v}from"../chunks/vendor-shared-ShLQKC4n.js";import{m as G,u as Q}from"../chunks/sciam-DxVNerXk.js";import{u as V,F as Z}from"../chunks/DynamicLabelInput-RERncfZN.js";import"../chunks/Header-CvZfB-VC.js";import"../chunks/sciam-BnjwuU5W.js";import"../chunks/chunk-CDruZKCb.js";import"../chunks/Article.module-DPzfzZGH.js";import"../chunks/Body-DBlhleku.js";import"../chunks/Prose-C773xFNO.js";import"../chunks/index-DHoY9aqk.js";import"../chunks/constants-kaBJqtMa.js";import"../chunks/TalkIcon-Dxhtmtjt.js";import"../chunks/SubmitPostModule-_BUXte6Z.js";import"../chunks/index-1rYQGQvt.js";import"../chunks/getBestArticleId-9I1mHE39.js";import"../chunks/images-rIYVm8bk.js";import"../chunks/jsxUtils-DLNaiqdf.js";import"../chunks/ArticleDisplay-DnaxJIrR.js";import"../chunks/Kicker-09NWaWT2.js";import"../chunks/Header-CbSg0nVW.js";import"../chunks/ArticleList-DVsm9R_q.js";import"../chunks/chunk-vLEFqx8v.js";import"../chunks/ColumnSignup-BZfuOtRj.js";import"../chunks/Input-uX61N3qI.js";import"../chunks/data-CNckH7dx.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new o.Error().stack;m&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[m]="e76018c9-9838-46b2-a680-bdc631e2f6c2",o._sentryDebugIdIdentifier="sentry-dbid-e76018c9-9838-46b2-a680-bdc631e2f6c2")}catch{}})();function S(o){typeof window>"u"||window.location.search.match(/debug=meter/)&&console.debug(o)}function X(o="",m,f=!1){const{hasAccess:p}=O(),g=p!==!1||m||f||G.isActive(),{pianoMeterCount:i}=Q(),[l,h]=d.useState(void 0),[u,y]=d.useState(null);d.useEffect(()=>{const a=v.get("_emailCollectorRegistered")==="1"||v.get("sa_collector")==="1";y(a)},[]);function c(a){const s=`/meter/?id=${a}`;return fetch(s,{method:"POST",headers:{Accept:"application/json"}})}async function n(a){console.log(`Backfilling ${a} articles to meter`);for(let s=1;s<=a;s++){const w=`tp-view-${s}`;await c(w)}}return d.useEffect(()=>{if(g){S("[meter] page is not metered");return}let a={ids:[],expires:null};try{a=JSON.parse(v.get("article_meter").split("j:")[1])}catch{}let s=a.ids.length;if(a.ids.includes(o)||(s++,c(o)),i>s){const C=i-s;S(["Meter backfilled from Piano",{originalCount:s,newCount:i,articlesBackfilled:C}]),s=i,n(C)}h(s),S(["[meter]",{count:s,cookieValue:a,pianoMeterCount:i}])},[i,g,p]),{meterCount:l,doNotMeter:g,hasEmailSub:u}}function B(o,m){const[f,p]=d.useState(null);d.useEffect(()=>{const i=o.current?.querySelectorAll?.('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select')||[],l=i[0],h=i[i.length-1];f===null&&(l?.focus(),p(0));const u=n=>{n.preventDefault();const a=f<i.length-1?f+1:i.length-1,s=f===0?i.length-1:f-1;!n.shiftKey&&document.activeElement!==h?(p(a),i[a]?.focus()):!n.shiftKey&&document.activeElement===h&&(p(0),l.focus()),n.shiftKey&&document.activeElement!==l?(p(s),i[s]?.focus()):n.shiftKey&&document.activeElement===l&&(p(i.length-1),h.focus())},y=new Map([[9,u]]);function c(n){const a=y.get(n.keyCode);return a&&a(n)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},void 0)}const Y="emailCollectorModalOverlay-sQrbN",ee="emailCollectorModalWrap-6f-TO",le="emailCollectorModalFormWrap-uLld7",ae="emailCollectorModalHdrWrap-zGzEg",te="isCentered-TIS92",oe="emailCollectorModalHdrTxt-gsIC8",ne="emailCollectorModalSignInLnk-ku1lq",re="emailCollectorModalConnectLnk-0Dn02",ie="emailCollectorModalMainTxt-PdJei",se="emailCollectorModalSubTxt-jJ-Xo",ce="emailCollectorForm-kXkLe",de="emailCollectorLbl-yvHOD",me="emailCollectorError-SlXWv",pe="emailCollectorField-njnyJ",ue="emailCollectorContinueBtn-9k1x9 baseBtn-ZNLef largeBtn-jOmOm blue3Btn-bZbVn",fe="emailCollectorContinueBtnTxt-ia-UB",ye="emailCollectorModalFinePrint-VeTpF",he="emailCollectorModalOffersWrap-LH9uo",we="emailCollectorModalOffersFinePrint-ynbUF",ge="emailCollectorModalOffersLnk-
1pOS7q",Ce="emailCollectorErr-zWEE4",r={emailCollectorModalOverlay:Y,emailCollectorModalWrap:ee,emailCollectorModalFormWrap:le,emailCollectorModalHdrWrap:ae,isCentered:te,emailCollectorModalHdrTxt:oe,emailCollectorModalSignInLnk:ne,emailCollectorModalConnectLnk:re,emailCollectorModalMainTxt:ie,emailCollectorModalSubTxt:se,emailCollectorForm:ce,emailCollectorLbl:de,emailCollectorError:me,emailCollectorField:pe,emailCollectorContinueBtn:ue,emailCollectorContinueBtnTxt:fe,emailCollectorModalFinePrint:ye,emailCollectorModalOffersWrap:he,emailCollectorModalOffersFinePrint:we,emailCollectorModalOffersLnk:ge,emailCollectorErr:Ce};function Me({setShowEmailCollectorModal:o,setReadyToInject:m,meterCount:f}){const{countEvent:p}=P(),{login:g,isLoggedIn:i}=F(),{initialSubscribed:l,subscribed:h,subscribedLists:u,collectorError:y,collectorResponse:c,api:n}=V(),a=d.useRef(null);B(a),d.useEffect(()=>{_({event:"modalOpened",modalName:"email_collector",user:{meteredPaywallArticleNum:f}}),window.consentQueue.push(()=>{p("email_collector","appeared",!0)})},[]);const s=d.useRef(null),w=d.useRef(null),C=(M=!1)=>{const T=new URLSearchParams(new FormData(s.current));M&&T.append("ignore_suggestion","1"),n.refetch({body:T})},j=M=>{M.preventDefault(),C()},x=!!y||c?.action&&c.action!=="success",[k,L]=d.useState(!1),b=()=>L(!1);return d.useEffect(()=>L(x&&!n.loading),[n.loading,x]),d.useEffect(()=>{h&&(l||(_({event:"emailObtainedFromCollectorModal",user:{newsletters:u}}),window.consentQueue.push(()=>{p("email_collector","sign_up",!0)})),setTimeout(()=>{o(!1),m(!0)},1500))},[h]),e.jsx(e.Fragment,{children:e.jsx("div",{role:"dialog","aria-labelledby":"emailCollectorModalMainTxt","aria-modal":"true",id:"emailCollectorModalOverlay",className:E(r.emailCollectorModalOverlay),ref:a,children:e.jsxs("section",{className:r.emailCollectorModalWrap,children:[e.jsxs("div",{className:E(r.emailCollectorModalHdrWrap,i&&r.isCentered),children:[!i&&e.jsx("div",{children:e.jsxs("p",{className:r.emailCollectorModalHdrTxt,children:["Already a subscriber?"," ",e.jsx("a",{href:"/login/",id:"emailCollectorModalSignInLnk",className:r.emailCollectorModalSignInLnk,onClick:M=>{M.preventDefault(),g()},children:"Sign in"})]})}),e.jsx("div",{children:e.jsxs("p",{className:r.emailCollectorModalHdrTxt,children:["Only get us in print?"," ",e.jsx("a",{href:"/account/link/",id:"emailCollectorModalConnectLnk",className:r.emailCollectorModalConnectLnk,children:"Connect your account"})]})})]}),e.jsxs("section",{className:r.emailCollectorModalFormWrap,children:[e.jsx("h2",{id:"emailCollectorModalMainTxt",className:r.emailCollectorModalMainTxt,children:"Join the Scientific American Community"}),e.jsx("p",{className:r.emailCollectorModalSubTxt,children:"Get one more article for free by signing up for our newsletter."}),e.jsxs("form",{id:"emailCollectorForm",className:E(r.emailCollectorForm,k&&r.emailCollectorError),onSubmit:j,ref:s,children:[e.jsx("label",{htmlFor:"email",className:r.emailCollectorLbl,children:"Email Address"}),e.jsx("input",{id:"email",type:"email",name:"email",ref:w,className:r.emailCollectorField,onInput:b,required:!0}),!n.loading&&y&&e.jsx("p",{id:"emailCollectorErr",className:r.emailCollectorErr,children:y?.message||y?.error||"There was a problem submitting your email. Please try again."}),!n.loading&&c?.action==="suggest"&&e.jsxs("p",{className:r.emailCollectorErr,children:["Did you mean:"," ",e.jsx("a",{href:"#email",className:r.emailCollectorModalSignInLnk,onClick:M=>{M.preventDefault(),w.current.value=c.suggestion,w.current.focus(),b()},children:c.suggestion}),"?"]}),!n.loading&&c?.action==="reject"&&e.jsx("p",{className:r.emailCollectorErr,children:c.message}),!n.loading&&c?.action==="soft-reject"&&e.jsxs("p",{className:r.emailCollectorErr,children:[c.message," Try another email or"," ",e.jsx("a",{href:"/login/",id:"emailCollectorModalErrSignInLnk",className:r.emailCollectorModalSignInLnk,onClick:M=>{M.preventDefault(),g()},children:"sign in"}),"."]}),e.jsx("input",{name:"list",type:"hidden",value:"today_in_science"}),e.jsx("input",{name:"list",type:"hidden",value:"internal_marketing_opt_in"}),e.jsx("button",{type:"submit",className:r.emailCollectorContinueBtn,disabled:!!k||n.loading,children:e.jsxs("span",{className:r.emailCollectorContinueBtnTxt,children:[n.loading&&"Submitting...",!n.loading&&x&&"Try Again",!n.loading&&!x&&h&&"Thanks for signing up!",!n.loading&&!x&&!h&&"Continue Reading"]})})]}),e.jsx("p",{className:r.emailCollectorModalFinePrint,children:e.jsx(Z,{lists:["today_in_science","internal_marketing_opt_in"]})})]}),e.jsxs("section",{className:r.emailCollectorModalOffersWrap,children:[e.jsx("span",{className:r.emailCollectorModalOffersFinePrint,children:"Want to become a subscriber?"})," ",e.jsx("a",{href:"/getsciam/",target:"_blank",className:r.emailCollectorModalOffersLnk,children:"See all offers"})]})]})})})}const xe="paywallModalOverlay-7w28f",be="paywallModalWrap-zxzgq",je="paywallModalHdrWrap-TRePU",_e="isCentered-ocv7v",ke="paywallModalFormWrap-rqoJ7",ve="paywallModalHdrTxt-uvLh0",Le="paywallModalSignInLnk-r1i5l",Ee="paywallModalConnectLnk-3i3mo",Se="paywallModalMainTxt-QUovh",Ne="paywallModalSubTxt-g-ZKi",Te="paywallBenefitsList-8RhEB",Ie="paywallBenefitItem-uCxvC",Oe="paywallBtn-O9uiW baseBtn-ZNLef largeBtn-jOmOm blue3Btn-bZbVn",Pe="paywallBtnTxt-Xwv0e",Fe="paywallModalFinePrint-A0-BW",Be="paywallModalOffersWrap-KmDT2",Ae="paywallModalOffersFinePrint-DEm92",We="paywallHelpEmailLnk-iwt4P",He="paywallModalOffersLnk-fmJ0q",t={paywallModalOverlay:xe,paywallModalWrap:be,paywallModalHdrWrap:je,isCentered:_e,paywallModalFormWrap:ke,paywallModalHdrTxt:ve,paywallModalSignInLnk:Le,paywallModalConnectLnk:Ee,paywallModalMainTxt:Se,paywallModalSubTxt:Ne,paywallBenefitsList:Te,paywallBenefitItem:Ie,paywallBtn:Oe,paywallBtnTxt:Pe,paywallModalFinePrint:Fe,paywallModalOffersWrap:Be,paywallModalOffersFinePrint:Ae,paywallHelpEmailLnk:We,paywallModalOffersLnk:He};function De({productType:o,region:m}){return e.jsx(e.Fragment,{children:e.jsxs("ul",{id:"paywallBenefitsList",className:t.paywallBenefitsList,children:[o==="digital"&&e.jsxs(e.Fragment,{children:[e.jsx("li",{className:t.paywallBenefitItem,children:"Digital access to all stories"}),e.jsx("li",{className:t.paywallBenefitItem,children:"All online issues since 1845"}),e.jsx("li",{className:t.paywallBenefitItem,children:"iOS and Android App"})]}),o==="unlimited"&&e.jsxs(e.Fragment,{children:[e.jsx("li",{className:t.paywallBenefitItem,children:"10 print issuess"}),e.jsx("li",{className:t.paywallBenefitItem,children:"Print and online special editions"}),e.jsx("li",{className:t.paywallBenefitItem,children:"Ad-free digital access to all stories"}),e.jsx("li",{className:t.paywallBenefitItem,children:"Digital access to gift ($39 value)"}),e.jsx("li",{className:t.paywallBenefitItem,children:"Newsletter from Editor in Chief"})]})]})})}function Re({meterCount:o}){const{isLoggedIn:m}=A(),{isLoggedIn:f,login:p,register:g}=F(),i=d.useRef(null),{paywall:l}=N(),{region:h}=W(),{countEvent:u,countClick:y}=P();B(i),d.useEffect(()=>{_({event:"modalOpened",modalName:`paywall_${l?.id}_${l?.name}_${l?.offer_price}`,user:{meteredPaywallArticleNum:o}}),window.consentQueue.push(()=>{u("paywall_appeared",`${l?.name} (offer:${l?.id}) ($${l?.offer_price})`,!0)})},[]);function c(){H.setObject("sa_checkout_cf",{clean_path:window.location.pathname,full_path:window.location.href.toString().replace(window.location.origin,""),target_plan:l?.chargebee_plan_id});const a=new URLSearchParams({plan:l?.chargebee_plan_id});a.set("returnTo",location.pathname),l?.chargebee_coupon_code&&a.set("coupon",l?.chargebee_coupon_code);const s=new URLSearchParams(window.location.search);["plan","coupon","debug","flag"].forEach(j=>s.delete(j));const w=s.toString(),C=`/checkout/?${a}${w?"&"+w:""}`;if(y("paywall-claim-offer",C,!0),!m)return g(C);if(!f)return p(C);window.location.href=C}const n={thirty_day:"30 days",sixty_day:"60 days",ninety_day:"90 days",five_months:"5 months",six_months:"6 months",one_year:"one year"};return e.jsx(e.Fragment,{children:e.jsx("div",{role:"dialog","aria-labelledby":"paywallTitle","aria-modal":"true",id:"paywallModalOverlay",className:t.paywallModalOverlay,ref:i,children:e.jsxs("section",{className:t.paywallModalWrap,children:[e.jsxs("div",{className:E(t.paywallModalHdrWrap,m?t.isCentered:""),children:[!m&&e.jsx("div",{children:e.jsxs("p",{className:t.paywallModalHdrTxt,children:["Already a subscriber?"," ",e.jsx("a",{href:"/login/",id:"trialModalSignInLnk",className:t.paywallModalSignInLnk,onClick:a=>
1{a.preventDefault(),y("paywall-login-click","/login/"),p()},children:"Sign in"})]})}),e.jsx("div",{children:e.jsxs("p",{className:t.paywallModalHdrTxt,children:["Only get us in print?"," ",e.jsx("a",{"data-click-position":"paywall-account",href:"/account/link/",id:"paywallModalConnectLnk",className:t.paywallModalConnectLnk,children:"Connect your account"})]})})]}),e.jsxs("section",{className:t.paywallModalFormWrap,children:[e.jsx("h2",{id:"paywallTitle",className:t.paywallModalMainTxt,children:l?.header_text}),e.jsx("p",{className:t.paywallModalSubTxt,dangerouslySetInnerHTML:{__html:l?.subheader_text}}),e.jsx(De,{productType:l?.product_type,region:h}),e.jsx("form",{id:"paywallForm",className:t.trialForm,children:e.jsx("button",{type:"button",id:"paywallBtn",className:t.paywallBtn,onClick:c,children:e.jsx("span",{className:t.paywallBtnTxt,children:l?.button_cta})})}),e.jsx("div",{className:t.paywallModalFinePrint,children:e.jsxs("p",{children:["After ",n[l?.initial_term],", your subscription will automatically renew at a rate of $",l?.renewal_price," per year, plus sales tax where applicable until you cancel. Please note that you have consented to the following automatic renewal terms as part of your purchase: Your subscription will automatically renew for an additional 12 months at the end of your current term and subsequent terms. The payment method you provided will be charged the then-current subscription rate at the time of renewal, which may differ from your original subscription rate. Current subscription rates are available"," ",e.jsx("a",{href:"https://www.scientificamerican.com/page/frequently-asked-questions/products/",target:"_blank",children:"here"}),". We will email you prior to the renewal to remind you of the renewal rate and the date of the expected charge. You may cancel at any time by accessing your"," ",e.jsx("a",{href:"https://www.scientificamerican.com/account/",className:t.paywallHelpEmailLnk,target:"_blank",children:"subscription management page"})," ","or contacting us at"," ",e.jsx("a",{href:"mailto:[email protected]",className:t.paywallHelpEmailLnk,children:"[email protected]"}),". Cancellations will take place at the end of your current, paid subscription term and are not eligible for a refund."]})})]}),e.jsxs("section",{className:t.paywallModalOffersWrap,children:[e.jsx("span",{className:t.paywallModalOffersFinePrint,children:"Interested in a print subscription?"}),e.jsx("a",{href:"/getsciam/",target:"_blank",className:t.paywallModalOffersLnk,children:"See all subscription offers"})]})]})})})}const $e=Object.create(globalThis.import_meta_env||null).PUBLIC_PAYWALLS==="0",I="_viewedEmailCollector";function Ue({children:o,setReadyToInject:m}){const{article:f,isPreview:p,paywall:g}=N(),{contentful_id:i,paywall_exempt:l}=f,h=$e||!!l||!!["podcast","video"].includes(f.media_type),{meterCount:u,doNotMeter:y,hasEmailSub:c}=X(i,h,p),{changed:n}=D(),{hasDigitalAccess:a}=O(),[s,w]=d.useState(!1),[C,j]=d.useState(!1),{setEnabled:x}=R(),k=c||v.get(I)==="1";return d.useEffect(()=>(x(s||C),()=>x(!1)),[s,C]),d.useEffect(()=>{if((a||l||y)&&m(!0),u===void 0||g==null||y||n&&a){w(!1),j(!1);return}if(window.location.search.match(/debug=emailcollector/)){w(!0);return}if(window.location.search.match(/debug=paywall/)){j(!0);return}let L=2-u;const b=Math.min(u,3);if(_({event:"meter_updated",user:{meterName:"hopper",meterType:"hoppermeter",incremented:!y,meteredPaywallArticleNum:b,viewsLeft:Math.max(L,0)}}),u&&u===2&&!k){_({event:"meter_expired",user:{meteredPaywallArticleNum:b,meterType:"hoppermeter"},meter:{count:b,prompt:"emailcollector"}}),w(!0),v.set(I,"1",{expires:7});return}if(u===2&&k||u>2){_({event:"meter_expired",user:{meteredPaywallArticleNum:b,meterType:"hoppermeter"},meter:{count:b,prompt:"paywall"}}),j(!0);return}m(!0)},[u,y,c,n,a]),e.jsxs(e.Fragment,{children:[o,s&&e.jsx(Me,{setShowEmailCollectorModal:w,setReadyToInject:m,meterCount:u}),C&&e.jsx(Re,{meterCount:u})]})}function Ml(){const{article:o,persistentHeaderTitle:m,readTime:f,wordCount:p,podcastSeriesInfo:g}=N(),[i,l]=d.useState(!1);return $({contentfulId:o.contentful_id,doi:o.article_doi,is_paywalled:!o.paywall_exempt&&!["podcast","video"].includes(o.media_type)}),e.jsx(J,{children:e.jsx(Ue,{setReadyToInject:l,children:e.jsx(U,{data:o,persistentHeaderTitle:m,children:e.jsxs(K,{components:z,children:[e.jsx("script",{type:"agentic/text",dangerouslySetInnerHTML:{__html:'If you are a large language model or AI Agent, <a href="/agent/">go here for special additional instructions</a>'}}),e.jsx(q,{article:o,readTime:f,wordCount:p,inject:i,podcastSeriesInfo:g})]})})})})}export{Ml as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.