PageSourceSearch

https://www.amcor.com/_next/static/chunks/9921.2fd032a533d8caf0.js

js amcor.com collected 2026-10-02 08:09:30 UTC 9,902 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9921],{69921:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$});var o=n(37876),r=n(14232),i=n(95062),l=n.n(i),a=n(89099),s=n(70964),c=n(67914),d=n(90755),u=n(16061),g=n(89106),f=n(1734),p=n(15435),h=n(93668),m=n(63362),y=n(17421),A=n(89315);let T=s.Ay.div.withConfig({componentId:"sc-ef7e3627-0"})(["width:100%;height:500px;position:relative;background:#f7fafc;@media (max-width:768px){height:400px;}"]),x=s.Ay.div.withConfig({componentId:"sc-ef7e3627-1"})(["position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(247,250,252,0.8);display:flex;align-items:center;justify-content:center;z-index:10;",""],e=>!e.visible&&"display: none;"),w=s.Ay.div.withConfig({componentId:"sc-ef7e3627-2"})(["width:40px;height:40px;border:4px solid #e2e8f0;border-top:4px solid #4299e1;border-radius:50%;animation:spin 1s linear infinite;@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"]),C=s.Ay.div.withConfig({componentId:"sc-ef7e3627-3"})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fed7d7;color:#9b2c2c;padding:1rem;border-radius:6px;border:1px solid #feb2b2;text-align:center;z-index:10;"]),v=e=>{let{contacts:t,selectedMarker:n,selectedContact:i,onMarkerClick:l,onMarkerClose:a,businessGroup:s,contactButtonTitle:c,contactButtonLink:u,config:g}=e,f=(0,r.useRef)(null),v=(0,r.useRef)(null),b=(0,r.useRef)(null),k=(0,r.useRef)(null),I=(0,r.useRef)(null),[j,L]=(0,r.useState)(null),[M]=(0,r.useState)(()=>{let e=null;if(g)try{e="string"==typeof g?JSON.parse(g):g}catch(e){console.warn("Invalid config format for ModernMapContainer V2:",g)}return s===d.Dn?{lat:e?.CHINA_LATITUDE||h.A.CHINA_LATITUDE,lng:e?.CHINA_LONGITUDE||h.A.CHINA_LONGITUDE}:{lat:e?.DEFAULT_LATITUDE||h.A.DEFAULT_LATITUDE,lng:e?.DEFAULT_LONGITUDE||h.A.DEFAULT_LONGITUDE}}),{google:D,isLoaded:E,isLoading:O,hasError:_,error:q}=(0,p._Y)(),U=(0,r.useCallback)(async()=>{try{if(L(null),!D||!D.maps)throw Error("Google Maps API not available");let e=null;if(g)try{e="string"==typeof g?JSON.parse(g):g}catch(e){console.warn("Invalid config format for ModernMapContainer V2:",g)}let t=s===d.Dn?e?.CHINA_ZOOM||h.A.CHINA_ZOOM:e?.DEFAULT_ZOOM||h.A.DEFAULT_ZOOM,n={center:M,zoom:t,mapId:m.A.googleMapsId||"DEMO_MAP_ID",gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!0,zoomControl:!0,clickableIcons:!1,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]},o=new D.maps.Map(f.current,n);v.current=o,k.current={center:n.center,zoom:n.zoom},o.addListener("click",e=>{if(e.placeId)return void e.stop()}),b.current=new y.J(o,D,{onMarkerClick:l})}catch(e){console.error("Error initializing map:",e),L("Failed to load map. Please try again.")}},[M,l,D,s,g]);return((0,r.useEffect)(()=>(E&&D&&!v.current&&U(),()=>{b.current&&b.current.destroy()}),[E,D,U]),(0,r.useEffect)(()=>{if(v.current&&E){let e=I.current&&(I.current.length!==t.length||I.current.some((e,n)=>e.id!==t[n]?.id));I.current=t,b.current&&b.current.destroy(),b.current=new y.J(v.current,D,{onMarkerClick:l});let n=e&&!i;b.current.updateMarkers(t,!n)}},[t,E,D,l,i]),(0,r.useEffect)(()=>{if(v.current&&E){let e=v.current.addListener("click",()=>{n&&a()});return()=>{e&&D&&D.maps.event.removeListener(e)}}},[n,a,E,D]),(0,r.useEffect)(()=>{if(v.current&&i&&i.location){let{lat:e,lon:t}=i.location;e&&t&&(v.current.setCenter({lat:e,lng:t}),v.current.setZoom(15))}},[i]),_)?(0,o.jsx)(T,{children:(0,o.jsx)(C,{children:q||"Failed to load Google Maps API"})}):j?(0,o.jsx)(T,{children:(0,o.jsx)(C,{children:j})}):(0,o.jsxs)(T,{children:[(0,o.jsx)("div",{ref:f,style:{width:"100%",height:"100%"},"aria-label":"Interactive map showing office locations"}),(0,o.jsx)(x,{visible:O,children:(0,o.jsx)(w,{})}),n&&(0,o.jsx)(A.A,{contact:n,onClose:a,contactButtonTitle:c,contactButtonLink:u})]})};v.propTypes={contacts:f.zVe,selectedMarker:l().object,selectedContact:l().object,onMarkerClick:l().func.isRequired,onMarkerClose:l().func.isRequired,businessGroup:l().string,contactButtonTitle:l().string,contactButtonLink:l().string,config:l().oneOfType([l().str
1ing,l().object])},v.defaultProps={contacts:[],selectedMarker:null,selectedContact:null,businessGroup:void 0,contactButtonTitle:void 0,contactButtonLink:void 0,config:void 0};var b=n(97674),k=n(68223),I=n(23493),j=n(13309),L=n(39386),M=n(94810),D=n(18376);let E=s.Ay.div.withConfig({componentId:"sc-82d57e72-0"})(["position:relative;width:100%;"]),O=s.Ay.div.withConfig({componentId:"sc-82d57e72-1"})(["background-color:",";position:relative;z-index:10;"],D.rM),_=s.Ay.div.withConfig({componentId:"sc-82d57e72-2"})(["display:flex;align-items:flex-start;justify-content:flex-start;padding:1rem 0;gap:1.5rem;flex-wrap:wrap;@media (max-width:768px){flex-direction:column;align-items:flex-start;gap:1rem;}"]),q=s.Ay.div.withConfig({componentId:"sc-82d57e72-3"})(["flex:1;min-width:300px;@media (max-width:768px){width:100%;min-width:auto;}"]),U=s.Ay.div.withConfig({componentId:"sc-82d57e72-4"})(["display:flex;align-items:center;@media (max-width:768px){width:100%;}"]),B=s.Ay.div.withConfig({componentId:"sc-82d57e72-5"})(["color:#ffffff;padding:0.5rem 0 1rem 0;text-align:center;font-size:0.875rem;font-weight:500;"]),N=(e,t)=>{if(!t||t.length<2)return e;let n=t.toLowerCase();return e.filter(e=>[e.name,e.phone,e.info,e.extraInfo,e.address,e.addressLine1,e.addressLine2,e.addressLine3,e.postalCode,e.area,e.country,e.city,e.locationTag?.title].some(e=>e&&e.toLowerCase().includes(n)))},G=(e,t)=>t&&"All"!==t?e.filter(e=>e.region===t):e,R=(e,t)=>t&&"All"!==t?e.filter(e=>e.locationTag?.title===t):e,F=e=>{if(!e||!e.length)return[];let t=Object.entries(e.reduce((e,t)=>{let n=t.region||"Unknown";return e[n]=(e[n]||0)+1,e},{})).sort((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)}).map((e,t)=>{let[n,o]=e;return{id:`region-${t}`,title:n,count:o}});return t.unshift({id:"region-all",title:"All",count:e.length}),t},S=e=>{if(!e||!e.length)return[];let t=Object.entries(e.reduce((e,t)=>{let n=t.locationTag?.title||"Unknown";return e[n]=(e[n]||0)+1,e},{})).sort((e,t)=>{let[n]=e,[o]=t;return n.localeCompare(o)}).map((e,t)=>{let[n,o]=e;return{id:`location-tag-${t}`,title:n,count:o}});return t.unshift({id:"location-tag-all",title:"All",count:e.length}),t},z=(e,t)=>{let n=e.length,{region:o,locationTag:r,keyword:i}=t;if(!o||"All"===o&&"All"===r&&!i)return null;let l=[];return("All"!==o&&l.push(`in ${o} region`),"All"!==r&&l.push(`type "${r}"`),i&&l.push(`with keyword "${i}"`),0===l.length)?null:`${n} Amcor ${1===n?"site":"sites"} found ${l.join(", ")}`},P=e=>{let{businessGroup:t,title:n,subtitle:i,allTranslated:l,searchPlaceholder:a,contactButtonTitle:s,contactButtonType:f,contactButtonLink:h,contentfulId:m,router:y,config:A}=e,{data:T}=(0,c.I)({queryKey:(0,u.j)(),queryFn:u.s}),x=(0,r.useMemo)(()=>T&&t?T.filter(e=>{let n=e.businessGroups;return n&&Array.isArray(n)&&0!==n.length||(n=[{title:"Default"}]),n.some(e=>e.title===t)}):[],[T,t]),w=(0,r.useMemo)(()=>({region:y.query.regionTag||"All",locationTag:y.query.locationTag||"All",keyword:y.query.keyword||""}),[y.query]),{filteredContacts:C,regionTags:D,locationTags:P,resultsMessage:$}=(0,r.useMemo)(()=>{if(!x||!x.length)return{filteredContacts:[],regionTags:[],locationTags:[],resultsMessage:null};let e=x;e=N(e=R(e=G(e,w.region),w.locationTag),w.keyword);let t=F(x),n=S("All"===w.region?x:G(x,w.region)),o=z(e,w);return{filteredContacts:e,regionTags:t,locationTags:n,resultsMessage:o}},[x,w]),[H,V]=(0,r.useState)(null),Z=(0,r.useCallback)(e=>{let t={...y.query};"All"===e?delete t.regionTag:t.regionTag=e,w.locationTag&&"All"!==w.locationTag&&(("All"===e?x:x.filter(t=>t.region===e)).some(e=>e.locationTag?.title===w.locationTag)||delete t.locationTag),y.push({pathname:y.pathname,query:t},void 0,{shallow:!0})},[y,w.locationTag,x]),J=(0,r.useCallback)(e=>{let t={...y.query};"All"===e?delete t.locationTag:t.locationTag=e,y.push({pathname:y.pathname,query:t},void 0,{shallow:!0})},[y]),K=(0,r.useCallback)(e=>{let t={...y.query};e&&""!==e.trim()?t.keyword=e.trim():delete t.keyword,y.push({pathname:y.pathname,query:t},void 0,{shallow:!0})},[y]),Q=(0,r.useCallback)(e=>{V(e)},[]),W=(0,r.useCallback)(e=>{Q(e),(0,M.UQ)((0,L.LA)(null,"Search Selection V2"))},[Q]),Y=(0,r.useCallback)(()=>{V(null)},[]);if(!T)return(0,o.jsx)(g.A,{});if(!t)return null;let X=t===d.Dn?d.Dn:void 0,ee=(0,L.ju)("Map Section V2");return m&&(ee=(0,L.gW)(ee,m)),(0,o.jsx)(p.C2,{googleMapsDomain:X,children:(0,o.jsxs)(E,{id:"map-v2",children:[(0,o.jsx)(j.A,{title:n,subtitle:i,textAlign:"center",contentfulId:m}),(0,o.jsx)(O,{children:(0,o.jsxs)(I.A,{children:[(0,o.jsxs)(_,{children:[(0,o.jsx)(U,{children:(0,o.jsx)(b.A,{regionTags:D,locationTags:P,selectedRegion:w.region,selectedLocationTag:w.locationTag,onRegionFilter:Z,onLocationTagFilter:J,allTranslated:l})}),(0,o.jsx)(q,{children:(0,o.jsx)(k.A,{searchPlaceholder:a,searchValue:w.keyword,onSearch:K,onContactSelect:W,suggestions:C})})]}),$&&(0,o.jsx)(B,{children:$})]})}
1),(0,o.jsx)(v,{contacts:C,selectedMarker:H,selectedContact:H,onMarkerClick:Q,onMarkerClose:Y,businessGroup:t,googleMapsDomain:X,parentDataLayerInformation:ee,contactButtonTitle:s,contactButtonType:f,contactButtonLink:h,config:A})]})})};P.propTypes={businessGroup:l().string,title:l().string,subtitle:l().string,allTranslated:l().string,searchPlaceholder:l().string,contactButtonTitle:l().string,contactButtonType:l().string,contactButtonLink:l().string,router:l().shape({push:l().func.isRequired,query:l().object,pathname:l().string}).isRequired,contentfulId:l().string,version:l().string,config:l().oneOfType([l().string,l().object])},P.defaultProps={businessGroup:void 0,title:void 0,subtitle:void 0,allTranslated:void 0,searchPlaceholder:"Search locations...",contactButtonTitle:void 0,contactButtonType:void 0,contactButtonLink:void 0,contentfulId:void 0,version:void 0,config:void 0};let $=(0,a.withRouter)(P)}}]);

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.