1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24963],{24963:(e,t,a)=>{a.d(t,{R7:()=>h,VV:()=>m,default:()=>S});var r=a(95155),o=a(6531),n=a(94262),s=a(48884),i=a(90651),c=a(49412),u=a(59700),l=a(32202),d=a(28464),g=a(73321),p=a(12115),f=a(87358);let y=(0,p.createContext)(void 0),m=()=>(0,p.useContext)(y),h=["detail","content","images","documents","specifications","properties","attributes","variantTraits","warehouses","facets"],S=({children:e,initialCatalogPageResult:t,siteSettings:a,espotSettings:m})=>{let[h,S]=(0,p.useState)(""),[C,v]=(0,p.useState)(),[w,b]=(0,p.useState)(),[P,I]=(0,p.useState)(),[x,L]=(0,p.useState)(),[$,B]=(0,p.useState)({}),[E,J]=(0,p.useState)(),[k,_]=(0,p.useState)(!1),[T,z]=(0,p.useState)(!1),[U,W]=(0,p.useState)(),[O,D]=(0,p.useState)([]),[N,j]=(0,p.useState)(),[R,V]=(0,p.useState)(!1),[F,A]=(0,p.useState)(),K=(0,g.useParams)(),[q,H]=(0,p.useState)(),[Q,X]=(0,p.useState)(t),[Y,Z]=(0,p.useState)(m),[G,M]=(0,p.useState)(a),[ee,et]=(0,p.useState)(!0),[ea,er]=(0,p.useState)(""),[eo,en]=(0,p.useState)(""),es=(0,n.u)(),ei=(0,g.useSearchParams)(),[ec,eu]=(0,p.useState)([]),[el,ed]=(0,p.useState)(void 0);(0,p.useEffect)(()=>{er("");let e=ei.get("brand");e?et(!0):et(!1),en(e??"")},[ei]),(0,p.useEffect)(()=>{eo&&(async()=>{let e=await (0,c.o7)(es.BaseCommerceUrl??"",eo);eu(e?[e]:[]),er(e?.name)})()},[eo]);let eg=(0,g.useRouter)();(0,p.useEffect)(()=>{ee?F&&F.selectedBrands?.length&&ef(h):ef(h)},[F,h]),(0,p.useEffect)(()=>{(async()=>{ed(await (0,d.Nr)(es?.BaseCommerceUrl??""))})()},[]),K.categoryone,K.categorytwo&&K.categorytwo,K.categorythree&&K.categorythree,K.categoryfour&&K.categoryfour,K.categoryfive&&K.categoryfive,K.categorysix&&K.categorysix;(0,p.useEffect)(()=>{var e;let t,a;Q?.catalogPage&&(e=Q?.catalogPage,t=[],a=es.Site==s._z.Sensi?el?.defaultSensiCategory?.toLowerCase():"products",t.push({link:"/"+es.Language,text:$.Home}),t.push({link:"/"+es.Language+"/shop/"+a,text:$.Shop}),e?.breadCrumbs&&e?.breadCrumbs.forEach(e=>{if(!t.find(t=>t.text==e.text)){let a="/"+es.Language+"/shop"+e?.url?.replace("series/","/").replace("products/products","products");t.push({link:a,text:"all products"==e.text.toLowerCase()?$.allProducts:e.text})}}),ee&&t.push({link:"/"+es.Language+"/shop/"+a+"/"+ea,text:ea}),j({breadCrumb:t}))},[Q,$,ea]);let ep=e=>{_(!0),e&&(0,i.$s)(es.BaseCommerceUrl??"",{id:e}).then(t=>{t&&(J({productTitle:t.shortDescription,productNumber:t.name,properties:t.properties}),S(e),V(!0),ee?F&&F.selectedBrands?.length&&ef(e):ef(e))}).finally(()=>{_(!1)})},ef=e=>{if(e){_(!0);let t={categoryId:e||"",expand:["facets"],attributeValueIds:F?.selectedAttributes?.map(e=>e.attributeValueId)||[],brandIds:F?.selectedBrands?.map(e=>e.id)||[],pageSize:x,page:F?.page,search:F?.searchTerm,sort:F?.sort,additionalExpands:["plpPage"]};(0,l.Ot)(es.BaseCommerceUrl??"",t).then(e=>{e&&(W(e),e?.pagination&&(H(e?.pagination),L(e?.pagination?.pageSize)),D(e?.products),z(e?.products?.length<=0))}).finally(()=>{_(!1)})}};return(0,p.useEffect)(()=>{let e;if(f.env.STORYBOOK)return;let t=window.location.pathname.split("/").filter(Boolean);"shop"==t[t.length-1]&&(es.Site==s._z.Sensi?eg.push("/"+es.Language+"/"+o.E.Shop+"/thermostats"):eg.push("/"+es.Language+"/"+o.E.Shop+"/products")),e="",es.Site===s._z.Sensi?e="SensiProductListingPage,CommonTranslations":es.Site===s._z.Copeland&&(e="CopelandProductListingPage,CommonTranslations"),(0,u.R1)(e,es,"500").then(e=>{if(e){var t;let a,r=(t=e,a=[],t?.translationDictionaries&&t.translationDictionaries.forEach(e=>{e.keyword&&(a[e.keyword]=e.translation)}),a);B(e=>({...e,...r}))}}),(()=>{if(_(!0),Q?.catalogPage?.categoryId==="0")(0,i.bW)(es?.BaseCommerceUrl).then(e=>{let t=es.Site==s._z.Sensi?e?.categories?.find(e=>e.urlSegment.toLowerCase()===el?.defaultSensiCategory?.toLowerCase())?.id:e?.categories?.find(e=>"products"===e.urlSegment.toLowerCase())?.id;t&&((0,i.bW)(es?.BaseCommerceUrl,{startCategoryId:t}).then(e=>{e.categories&&I(e.categories)}),ep(Q?.catalogPage?.categoryId))});else if(!Q?.catalogPage?.categoryId)return(0,g.notFound)();else if(Q?.catalogPage?.categoryId){let e={startCategoryId:Q?.catalogPage?.categoryId};(0,i.bW)(es?.BaseCommerceUrl,e).then(e=>{e.categories&&I(e.categories)}),ep(Q?.catalogPage?.categoryId)}})()},[]),(0,r.jsx)(y.Provider,{value:{catalogPageResult:Q,pageMarkup:$,category:C,productDetails:E,isLoading:k,varientProductCollection:U,varientProducts:O,isSeries:R,breadCrumbs:N,setIsLoading:_,setProductsFilter:A,productsFilter:F,pagination:q,categories:P,siteSetting:G,espotSetting:Y,isBrand:ee,brandValue:ea,brandsModel:ec,isProduct:T},children:e})}},32202:(e,t,a)=>{a.d(t,{F2:()=>i,IX:()=>g,Ot:()=>d,Q5:()=>f,Sz:()=>p,Ze:()=>y,bq:()=>u,gL:()=>l,y9:()=>c});var r=a(83109),o=a(99763),n=a(48884);let s="/api/v2/products";async function i(e,t){return await (0,o.Jt)("/api/v1/autocomplete",e,t)}async function c(e,t){let{id:a,expand:r,...n}=t;if(void 0!==a){let t={...n,expand:r?.join(",")};return await (0,o.Jt)(`${s}/${a}`,e,t)}}async function u(e,t){let{id:a,expand:r,...n}=t;if(void 0!==a){let t={...n,expand:r?.join(",")};return await (0,o.Jt)("/api/v2/catalog/getProductByProductName",e,{productNumber:a,...t})}}async function l(e,t){let{productId:a,expand:r,...n}=t,i={...n,expand:r?.join(",")};if(void 0!==a)return await (0,o.Jt)(`${s}/${a}/variantchildren`,e,i)}async function d(e,t={}){let{expand:a,...r}=t,n={...r,expand:a?.join(",")};return await (0,o.Jt)(s,e,n)}async function g(e,t,a=""){if(void 0!==t)return await (0,o.Jt)(`/api/v2/catalog/${t}/getdocuments`,e,{languageCode:a})}async function p(e,t){let{productId:a,...r}=t;if(void 0!==a)return await (0,o.Jt)(`${s}/${a}/relatedproducts`,e,r)}function f(e,t){let a=(0,r.getCookie)(n.Wc.CurrentShipToId),s=(0,r.getCookie)(n.Wc.CurrentCurrencyCode),i=(0,r.getCookie)(n.Wc.CurrentLanguage),c=t.productPriceParameters.map(e=>({...e,properties:{...e?.properties,shipToId:a,currentCurrencyCode:s,currentLanguage:i}}));return(0,o.bE)("/api/v1/realtimepricing",e,{productPriceParameters:c})}async function y(e,t){return await (0,o.Jt)(`/api/v1/pricematrix/${t.productId}`,e,{priceBasis:"L"})}},49412:(e,t,a)=>{a.d(t,{Fs:()=>s,o7:()=>n,v_:()=>i});var r=a(99763);let o="/api/v1/brands";async function n(e,t){return await (0,r.Jt)(`${o}/${t}`,e)}async function s(e){let t=e?.BaseCommerceUrl??"";return await (0,r.Jt)(o,t)}async function i(e,t){return await (0,r.Jt)("/api/v1/dealers",e,t)}},90651:(e,t,a)=>{a.d(t,{$s:()=>i,Al:()=>c,TK:()=>n,bW:()=>s});var r=a(99763);let o="/api/v1/categories";async function n(e,t,a){let o=await (0,r.Jt)("/api/v1/catalogPages",e,t,!1,a||null),n=o.category??void 0;o.category=null,o.categoryId=n?.id,o.brandId&&n&&(function e(t,a){t.id=`${t.id}:${a}`,t.subCategories?.forEach(t=>e(t,a))}(n,o.brandId),o.categoryIdWithBrandId=n.id);let s={};return n&&function e(t,a,r){let o=t.subCategories;if(o?.sort((e,t)=>
1e.sortOrder-t.sortOrder||e.shortDescription.localeCompare(t.shortDescription)),t.subCategories=null,r>0&&o){let n=[];for(let t of o)n.push(t.id),e(t,a,r-1),delete t.htmlContent;t.subCategoryIds=n}a[t.id]=t}(n,s,1),{catalogPage:o,categoriesById:s}}async function s(e,t){return await (0,r.Jt)(o,e,t)}async function i(e,t){let{id:a,...n}=t;return await (0,r.Jt)(`${o}/${a}`,e,n)}async function c(e,t){return await (0,r.Jt)(`${o}/feederData`,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.