PageSourceSearch

https://cmagazine.com/_next/static/chunks/pages/read/archive-117c22a2d9bae2cf.js

js cmagazine.com collected 2026-09-24 18:22:31 UTC 8,126 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3533],{7230:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/read/archive",function(){return s(3266)}])},4379:function(e,t,s){"use strict";s.d(t,{Z:function(){return o}});var l=s(4817),i=(s(1248),s(6100));var o=()=>(0,l.jsx)(i.Z,{className:"width-transition",sx:{width:"15px",transition:"width 350ms ease-in-out"}})},6885:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});var l=s(4817),i=(s(1248),s(2883)),o=s(1965),n=s(2275);var r=e=>{let{explore:t,archive:s,issue:r}=e;const a=(0,o.o)();return(0,l.jsxs)(i.Z,{sx:{display:"flex",mr:-1,"& > a":{mr:1},"& > :nth-of-type(1)":t&&{backgroundColor:"common.blackAlt",color:"common.white",cursor:"default"},"& > :nth-of-type(2)":s&&{backgroundColor:"common.blackAlt",color:"common.white",cursor:"default"},"& > :nth-of-type(3)":r&&{backgroundColor:"common.blackAlt",color:"common.white",cursor:"default"}},children:[(0,l.jsx)(n.Z,{text:"Explore",variant:"outlined",size:["xs","sm","md"].includes(a)?"small":"large",href:"/read/explore"}),(0,l.jsx)(n.Z,{text:"Archive",variant:"outlined",size:["xs","sm","md"].includes(a)?"small":"large",href:"/read/archive"}),(0,l.jsx)(n.Z,{text:"Issues",variant:"outlined",size:["xs","sm","md"].includes(a)?"small":"large",href:"/read/issues"})]})}},3266:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSG:function(){return g},default:function(){return j}});var l=s(4817),i=s(1248),o=s(6497),n=s(2883),r=s(578),a=s(1965),d=s(8304),u=s(120),c=s(1919),v=s(5044),p=s(2275),m=s(5866),x=s(6885),h=s(5322);var b=e=>{let{generalSettings:t,page:s,types:b,subjects:f,currentAds:g,currentIssue:j,localizations:y}=e;var _,w,S,Z,C;const k=(0,o.useRouter)(),A=null===t||void 0===t||null===(_=t.attributes)||void 0===_?void 0:_.app_bar,N=null===t||void 0===t||null===(w=t.attributes)||void 0===w?void 0:w.drawer,E=null===t||void 0===t||null===(S=t.attributes)||void 0===S?void 0:S.footer,z=null===s||void 0===s||null===(Z=s.attributes)||void 0===Z?void 0:Z.page_header,I=null===s||void 0===s||null===(C=s.attributes)||void 0===C?void 0:C.seo,T=(0,a.o)(),[O,$]=(0,i.useState)(" "),[q,F]=(0,i.useState)(0),[L,R]=(0,i.useState)(0),[H,P]=(0,i.useState)(1),[X,M]=(0,i.useState)(null),[B,D]=(0,i.useState)(null),[G,U]=(0,i.useState)("New to old"),[J,K]=(0,i.useState)([]),[Q,V]=(0,i.useState)(null),[W,Y]=(0,i.useState)(!1);(0,i.useEffect)((()=>{var e,t,s,l,i,o;(null===k||void 0===k||null===(e=k.query)||void 0===e?void 0:e.subject)?D(null===k||void 0===k||null===(s=k.query)||void 0===s||null===(t=s.subject)||void 0===t?void 0:t.replace(/(^\w|\s\w)/g,(e=>null===e||void 0===e?void 0:e.toUpperCase()))):D("All"),(null===k||void 0===k||null===(l=k.query)||void 0===l?void 0:l.type)?M(null===k||void 0===k||null===(o=k.query)||void 0===o||null===(i=o.type)||void 0===i?void 0:i.replace(/(^\w|\s\w)/g,(e=>null===e||void 0===e?void 0:e.toUpperCase()))):M("All")}),[]);const ee=async(e,t,s,l,i,o)=>{const n={q:""===e?" ":e,filter:(Y(!0),X&&"All"!==X&&B&&"All"!==B?["collection=article",`article_type='${X}'`,`subjects='${B}'`]:X&&"All"!==X&&"All"===B?["collection=article",`article_type='${X}'`]:"All"===X&&B&&"All"!==B?["collection=article",`subjects='${B}'`]:["collection=article"]),sort:"New to old"===o?["sort_date_1:desc","sort_date_2:desc","sort_date_3:desc"]:["sort_date_1:asc","sort_date_2:asc","sort_date_3:asc"],limit:s,offset:t,articleType:l,articleSubject:i};if(e){const e=await fetch("/api/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(e.ok){const s=await e.json(),l=s.nbHits||0===s.nbHits?"nbHits":"estimatedTotalHits";K(0!==t?e=>[...e,...s.hits]:s.hits);const i=s[l]?s[l]:0,o=Math.ceil(i/50);V(s[l]),F(o),Y(!1)}else V(0),Y(!0)}};(0,i.useEffect)((()=>{P(1),R(0),ee(""===O?" ":O,0,50,X,B,G)}),[O,X,B,G]);const te=(0,i.useRef)(),[se,le]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{const e=null===te||void 0===te?void 0:te.current,t=new IntersectionObserver((e=>{let[t]=e;le(t.intersectionRatio<1)}),{threshold:[1]});return e&&(null===t||void 0===t||t.observe(e)),()=>e&&t.unobserve(e)}),[null===te||void 0===te?void 0:te.current]),(0,l.jsx)(d.Z,{navigation:A,drawer:N,footer:E,header:z,seo:I,currentAds:g,currentIssue:j,localizations:y,children:(0,l.jsxs)(u.Z,{children:[(0,l.jsx)(n.Z,{sx:{gridColumn:{xs:"1 / span 6",sm:"1 / span 12"},mt:{xs:8,sm:7,lg:7},mb:{xs:8,sm:8,lg:9}},children:(0,l.jsx)(c.Z,{title:"Archive"})}),(0,l.jsx)(n.Z,{sx:{gridColumn:{xs:"1 / span 6",sm:"1 / span 12"},mb:{xs:7}},children:(0,l.jsx)(x.Z,{archive:!0})}),(0,l.jsxs)(n.Z,{ref:te,sx:{background:"white",gridColumn:{xs:"1 / span 6",sm:"1 / span 12"},width:"100%",position:{sm:"sticky"},top:{xs:0,sm:-1}
1,left:0,zIndex:5,pt:{sm:"38px",lg:"32px"},mt:{sm:"-38px",lg:"-32px"},borderBottom:se&&"1px solid",borderBottomColor:se&&"rgba(204, 204, 204)"},children:[(0,l.jsxs)(n.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},"& > div:not(:last-of-type)":{mr:{sm:4},mb:{xs:4,sm:0}},"& > div":{width:{sm:"25%"}}},children:[(0,l.jsx)(n.Z,{children:(0,l.jsx)(h.Z,{dropLabels:["All",...b],label:"Filter by type",setSelected:M,selected:X})}),(0,l.jsx)(n.Z,{children:(0,l.jsx)(h.Z,{dropLabels:["All",...f],label:"Filter by subject",setSelected:D,selected:B})}),(0,l.jsx)(n.Z,{children:(0,l.jsx)(h.Z,{dropLabels:["New to old","Old to new"],label:"Sort by",setSelected:U,selected:G})}),(0,l.jsx)(n.Z,{sx:{"& .MuiFilledInput-input":{typography:"TextSans18","&::placeholder":{typography:"TextSans18"}}},children:(0,l.jsx)(m.Z,{placeholder:"Search Field",label:"Search within articles",id:"Search within articles",icon:"search",archive:!0,handleChange:$})})]}),(0,l.jsx)(r.Z,{ref:te,sx:{background:"white",color:"common.black55",gridColumn:"1 / span 6",typography:"TextSans12",position:"sticky",top:-1,mb:2,mt:4},children:Number.isInteger(Q)?`${Q} results`:"Searching..."})]}),(0,l.jsx)(n.Z,{sx:{gridColumn:{xs:"1 / span 6",sm:"1 / span 12"},"& > div":{mb:{xs:7,sm:7,lg:8}}},children:J&&(null===J||void 0===J?void 0:J.length)>0&&(0,l.jsx)(u.Z,{rowGap:["xs"].includes(T)?"30px":["sm","md"].includes(T)?"40px":"60px",disablePadding:!0,disableXXL:!0,sx:{height:"fit-content","& > :first-of-type":{mb:{xs:"30px",sm:"50px",lg:0}},"& > :nth-of-type(2n+1)":{gridColumn:{xs:"1 / span 6",sm:"1 / span 6"}},"& > :nth-of-type(2n+2)":{gridColumn:{xs:"1 / span 6",sm:"7 / span 6"}}},children:null===J||void 0===J?void 0:J.map((e=>{var t,s;return(0,l.jsx)(n.Z,{children:(0,l.jsx)(v.Z,{id:null===e||void 0===e?void 0:e.id.replace("article-",""),type:null===e||void 0===e?void 0:e.article_type,title:null===e||void 0===e?void 0:e.title,date:null===e||void 0===e?void 0:e.publication_date,releaseDate:null===e||void 0===e?void 0:e.release_date,issue:null===e||void 0===e||null===(t=e.issue)||void 0===t?void 0:t.issue_number,skus:null===e||void 0===e||null===(s=e.issue)||void 0===s?void 0:s.pelcro_skus,authors:null===e||void 0===e?void 0:e.authors,summary:null===e||void 0===e?void 0:e.summary,image:{data:{attributes:null===e||void 0===e?void 0:e.thumbnail_image}},slug:`/articles/${null===e||void 0===e?void 0:e.slug}`,pdf:null===e||void 0===e?void 0:e.pdf_file,subjects:f&&(null===e||void 0===e?void 0:e.subjects),imageMobile:!0,archive:!0})},null===e||void 0===e?void 0:e.id)}))})}),(0,l.jsx)(n.Z,{sx:{gridColumn:{xs:"1 / span 6",sm:"1 / span 12"},justifySelf:"center",mb:{xs:8,sm:9,lg:11}},children:q!==H&&0!==q&&(0,l.jsx)(p.Z,{buttonOnClick:()=>{R(L+50),P(H+1),ee(""===O?" ":O,L+50,50,X,B,G)},variant:"outlined",text:"Load more",size:"small",disabled:W})})]})})},f=s(7394);var g=!0,j=e=>{let{statusCode:t,generalSettings:s,page:n,articles:r,types:a,subjects:d,currentAds:u,currentIssue:c,localizations:v}=e;const p=(0,o.useRouter)();if(t>=400)return(0,l.jsx)(f.Z,{generalSettings:s,statusCode:t});const[m,x]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{p.isReady&&x(!0)}),[p]),(0,l.jsx)(l.Fragment,{children:m&&(0,l.jsx)(b,{generalSettings:s,page:n,articles:r,types:a,subjects:d,currentAds:u,currentIssue:c,localizations:v})})}}},function(e){e.O(0,[1406,4172,8582,5923,7394,8304,5299,2888,9774,179],(function(){return t=7230,e(e.s=t);var t}));var t=e.O();_N_E=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.