1import{a as mt}from"./chunk-2TXMBPSO.js";import{a as gt}from"./chunk-MR6SBMUW.js";import{g as pt}from"./chunk-624RHLPA.js";import"./chunk-I6TFQSWG.js";import"./chunk-JSCSFFY6.js";import"./chunk-A3KR7GWF.js";import"./chunk-5BEEXEIJ.js";import"./chunk-BECIFPPZ.js";import"./chunk-ZH66IXOP.js";import"./chunk-F25Q44KB.js";import"./chunk-UGA564ZN.js";import"./chunk-SNPCKK7E.js";import"./chunk-A7LDNCFW.js";import"./chunk-DNYG7EM7.js";import"./chunk-TEFUAKT2.js";import{a as ct,c as st}from"./chunk-A4GYQBFW.js";import"./chunk-ETNMBXFH.js";import"./chunk-WJZYPAXF.js";import"./chunk-5MKXZXTK.js";import"./chunk-IAHJFMAZ.js";import"./chunk-DF7G2DJU.js";import"./chunk-NXU5XRGR.js";import{o as at}from"./chunk-IJGV6PEH.js";import"./chunk-UXFYXNZB.js";import"./chunk-2PZQVO5M.js";import"./chunk-YSEUWOBF.js";import"./chunk-5UOHIPKD.js";import"./chunk-XTGJWW32.js";import"./chunk-5J364GZE.js";import"./chunk-24RBYWHK.js";import"./chunk-LYGGRJPP.js";import"./chunk-CLFYICNC.js";import"./chunk-U7N5LJKI.js";import"./chunk-65TISXPA.js";import"./chunk-2MNCRMEG.js";import"./chunk-WAKOINC4.js";import{g as it,m as N}from"./chunk-CQVGPCJN.js";import"./chunk-2JZU3INV.js";import"./chunk-VU6FXXNN.js";import"./chunk-R65BPLEU.js";import"./chunk-WTQLJPFM.js";import"./chunk-66W4FRMO.js";import"./chunk-Q2HHPJLL.js";import"./chunk-WCZ7ODOR.js";import{d as H}from"./chunk-MRPA26HF.js";import"./chunk-QPY6YZD2.js";import"./chunk-YNOYMHTV.js";import"./chunk-RYYSJJVE.js";import{$ as L,_ as nt}from"./chunk-DSTH3QV4.js";import{Ab as A,Bb as l,Da as C,Fb as Q,Gb as E,Ka as p,Kc as B,Ob as n,Oc as D,Qa as c,Wb as $,Ya as j,Yb as v,_b as F,a as W,d as Y,fb as R,fd as ot,hd as rt,i as J,id as z,jc as P,jd as G,kc as S,la as K,o as O,p as w,rb as d,sb as Z,tb as u,ua as V,wb as X,xb as tt,xc as et,yb as h,zb as _}from"./chunk-6KO6CXQN.js";import{a as q}from"./chunk-Q5ZUIUCT.js";var lt={laptop:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/laptop-images%2FMacBook%20A2179%2FMacBook-A2179-1.jpg?alt=media&token=d23c1c83-da0c-4e23-8973-862f4f26b6ff",phone:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Smartphone%20Images%2FiPhone%2013%20Pro%20Max%2FGraphite%2FBlack.jpg?alt=media&token=19a9ddd3-4248-490b-ab1e-077f82a64623",tablet:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Smartphone%20Images%2FiPad%20Pro%203rd%20Gen%2FSilver%2FiPad-Pro-3rd-Gen-Silver-1.jpg?alt=media&token=b52530ac-89f2-4eff-966e-84c6e0c98f45",audio:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Accessories%2FAirPods%203rd%20Gen%20(2021)%2F1.jpg?alt=media&token=bd2d1eb9-284d-4732-be45-436972f45672",accessory:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Charger%2FMAGSAFE%20Charger%2F1.jpg?alt=media&token=6f8addcc-752a-4
1cf8-a366-f6cf1afc074d",watch:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/watch%2Fapple%2Fwatch-series-se-2023-gps-cellular-40mm%2Fsilver-aluminum%2F2.jpg?alt=media&token=1e020c92-8441-4c6b-adad-f896c5d710d0",gaming:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/playstation%2FPlayStation-4-Pro%2Fblack%2F1.jpg?alt=media&token=22b5dea9-f4f9-4eed-b8c0-98ae6bc0ac65"};function At(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.phone,C)}}function Mt(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.audio,C)}}function Ot(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.tablet,C)}}function vt(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.accessory,C)}}function Ft(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.laptop,C)}}function It(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.watch,C)}}function Tt(t,s){if(t&1&&l(0,"img",4),t&2){let i=n(),e=n(2);h("alt",e.product?.model??null)("src",i.gaming,C)}}function wt(t,s){if(t&1&&(_(0,"a",2),P(1,"async"),P(2,"async"),_(3,"span",3),d(4,At,1,2,"img",4),d(5,Mt,1,2,"img",4),d(6,Ot,1,2,"img",4),d(7,vt,1,2,"img",4),d(8,Ft,1,2,"img",4),d(9,It,1,2,"img",4),d(10,Tt,1,2,"img",4),A(),l(11,"span",5),_(12,"span",6)(13,"span",7)(14,"h3",8),v(15),A()()()()),t&2){let i=n().$implicit,e=n();$("mobile",S(1,14,e.biggerThan$)?.xs)("widescreen",S(2,16,e.biggerThan$)?.sm),h("routerLink",e.urlFragments)("queryParams",e.queryParameters),p(4),u(e.product?.category==="SMARTPHONE"?4:-1),p(),u(e.product?.category==="HEADPHONES"?5:-1),p(),u(e.product?.category==="TABLET"?6:-1),p(),u(e.product?.category==="ACCESSORIES"?7:-1),p(),u(e.product?.category==="LAPTOP"?8:-1),p(),u(e.product?.category==="WATCH"?9:-1),p(),u(e.product?.category==="GAMING"?10:-1),p(5),F(" ",i("category_"+(e.parsedCategory?.toLowerCase()||"")+"_title")," ")}}function jt(t,s){if(t&1&&(Q(0),d(1,wt,16,18,"a",1),P(2,"async"),E()),t&2){let i,e=n();p(),u((i=S(2,1,e.sharedImages$)||e.mockData)?1:-1,i)}}var dt=(()=>{class t{constructor(i,e,M,U){this.akitaScreenQuery=i,this.changeDetector=e,this.akitaRouterQuery=M,this.akitaRemoteConfigQuery=U,this.sharedImages$=this.akitaRemoteConfigQuery.selectSharedImageCategory(),this.mockData=lt,this.biggerThan$=this.akitaScreenQuery.selectBiggerThan(),this.readMore=!1,this.parsedCategory=this.capitalizeCategory(this.product?.category||""),this.queryParameters=q({},this.akitaRouterQuery.queryParamsToKeep),this.urlFragments="",this.lessThan$=this.akitaScreenQuery.selectLessThan()}ngOnChanges(i){i&&(this.parsedCategory=this.capitalizeCategory(this.product?.category||""),this.sharedImages$=this.akitaRemoteConfigQuery.selectSharedImageCategory(),this.urlFragments=this.getCategoryCollectionFragment(this.product?.category||""),this.queryParameters=q({},this.akitaRouterQuery.queryParamsToKeep),this.changeDetector.markForCheck())}capitalizeCategory(i){return i.charAt(0).toUpperCase().concat(i.slice(1).replace(/ /g,"_").toLowerCase())}getSearchUrlFragment(){return this.akitaRouterQuery.getPhoneSearchFragment()}getCategoryCollectionFragment(i){let e=this.akitaRouterQuery.homeUrlFragment;return e.push("c"),e.push("category"),e.push(i.toLowerCase()),e}static{this.\u0275fac=function(e){return new(e||t)(c(H),c(et),c(L),c(pt))}}static{this.\u0275cmp=j({type:t,selectors:[["app-category-item"]],inputs:{product:"product"},features:[V],decls:1,vars:0,consts:[[4,"transloco"],[1,"category-item",3,"routerLink","queryParams","mobile","widescreen"],[1,"category-item",3,"routerLink","queryParams"],[1,"pic-wrapper","flex"],[1,"picture",3,"alt","src"],["aria-hidden","true",1,"fixed-space-8"],[1,"head-wrapper"],[1,"discount","flex","flex-col","justify-center","align-center"],[1,"model","flex","justify-center"]],template:function(e,M){e&1&&R(0,jt,3,3,"ng-container",0)},dependencies:[D,G,z,N,it,B],styles:["@keyframes _ngcontent-%COMP%_loading{0%{transform:translate(-45%)}to{transform:translate(345%)}}.category-item[_ngcontent-%COMP%]{font-size:16px;line-height:24px;min-height:16px;font-display:swap;color:#172b4d;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;margin:0;border:1px solid transparent}.category-item[_ngcontent-%COMP%] .head-wrapper[_ngcontent-%COMP%]{margin-top:0;z-index:2}.category-item[_ngcontent-%COMP%] .head-wrapper[_ngcontent-%COMP%] .model[_ngcontent-%COMP%]{font-weight:700;text-align:center;font-size:16px}.mobile.category-item[_ngcontent-%COMP%] .head-wrapper[_ngcontent-%COMP%] .model[_ngcontent-%COMP%]{font-size:20px}.category-item[_ngcontent-%COMP%] .pic-wrapper[_ngcontent-%COMP%]{box-sizing:border-box;align-items:center;width:24vw;height:24vw;margin:0 auto;border-radius:200px}.mobile.category-item[_ngcontent-%COMP%] .pic-wrapper[_ngcontent-%COMP%]{width:20vw;height:20vw;max-width:230px;max-height:231px}.category-item[_ngcontent-%COMP%] .pic-wrapper[_ngcontent-%COMP%] .picture[_ngcontent-%COMP%]{width:100%;height:90%;border-radius:4px;overflow:hidden;object-fit:cover}.mobile.category-item[_ngcontent-%COMP%] .pic-wrapper[_ngcontent-%COMP%] .picture[_ngcontent-%COMP%]{height:80%}.mobile.category-item[_ngcontent-%COMP%] .pic-wrapper[_ngcontent-%COMP%] .picture[_ngcontent-%COMP%] img{object-fit:cover}.category-item.mobile[_ngcontent-%COMP%]{flex-direction:column}"]})}}return t})();var ut=[{id:105012,brand:"Apple",model:"iPhone 15 Pro Max",category:"SMARTPHONE",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/smartphone-images%2Fiphone-15-pro-max%2Fnt%2F1.jpg?alt=media&token=b9132d97-66b0-4ca0-9346-5b3cb0727d3e",price:{amount:119,currency:"SAR"}
1,originalPrice:{amount:7149,currency:"SAR"},inStock:!0},{id:100526,brand:"Apple",model:'MacBook Air 13.3" (Mid-2020)',category:"LAPTOP",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/laptop-images%2FMacBook-Air-A2179-(2020)%2FSpace%20Gray%2F1.jpg?alt=media&token=7b0e1098-4088-4d4f-ac19-77460bab34f1&_gl=1*1gkyvp8*_ga*NzEzOTk2Mzc5LjE2ODQ0MTI1OTY.*_ga_CW55HF8NVT*MTY4NjU5NDUzMy44LjEuMTY4NjU5NjY5NC4wLjAuMA..",price:{amount:589,currency:"SAR"},originalPrice:{amount:4799,currency:"SAR"},inStock:!0},{id:101925,brand:"Apple",model:"iPad 9.7 (2018)",category:"TABLET",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/smartphone-images%2Fipad%209-7-2018%2Fsg%2F1.jpg?alt=media&token=472c9710-8acf-46a4-ab08-7fdc388205ca",price:{amount:449,currency:"SAR"},originalPrice:{amount:1129,currency:"SAR"},inStock:!0},{id:102371,brand:"Apple",model:"Watch Series 6 Aluminium (GPS) 40mm",category:"WATCH",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Smartphone%20Images%2FWatch%20series%2FWatch%20Series%206%20Aluminium%20(%20GPS%20%2B%20Cellular%20)%2FSliver%2F1.jpg?alt=media&token=dbbb07ed-9f2e-496d-ac60-ba4a006f3834",price:{amount:839,currency:"SAR"},originalPrice:{amount:1339,currency:"SAR"},inStock:!0},{id:102187,brand:"Apple",model:"Earpods with Lightning Connector",category:"HEADPHONES",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Charger%2FEarpods%20Lightning%20Connector%2F1.jpg?alt=media&token=1e06cbf3-bfdd-429a-b694-28cd6078b456",price:{amount:299,currency:"SAR"},originalPrice:{amount:719,currency:"SAR"},inStock:!0},{id:102186,brand:"Apple",model:"MAGSAFE Charger",category:"ACCESSORIES",image:"https://firebasestorage.googleapis.com/v0/b/popsygae.appspot.com/o/Charger%2FMAGSAFE%20Charger%2F1.jpg?alt=media&token=6f8addcc-752a-4
1cf8-a366-f6cf1afc074d",price:{amount:299,currency:"SAR"},originalPrice:{amount:719,currency:"SAR"},inStock:!0}];function Rt(t,s){return this.trackByModel}function Qt(t,s){t&1&&v(0),t&2&&F(" ","\u0623\u0641\u0636\u0644 \u0627\u0644\u0639\u0631\u0648\u0636 \u0639\u0644\u0649..."," ")}function Et(t,s){t&1&&v(0),t&2&&F(" ","Find the best deals on..."," ")}function $t(t,s){if(t&1&&l(0,"app-category-item",3),t&2){let i=s.$implicit;h("product",i)}}function Bt(t,s){if(t&1&&(Q(0),_(1,"section",1),P(2,"async"),P(3,"async"),_(4,"h3"),d(5,Qt,1,1),P(6,"async"),Z(7,Et,1,1),A(),l(8,"span",2),_(9,"app-popsy-scroller"),X(10,$t,1,1,"app-category-item",3,Rt,!0),A()(),E()),t&2){let i=n();p(),$("widescreen",S(2,5,i.biggerThan$)?.mobileL)("hugescreen",S(3,7,i.biggerThan$)?.sm),p(4),u(S(6,9,i.language$)==="ar"?5:7),p(5),tt(i.categorySignal())}}var se=(()=>{class t{constructor(i,e,M,U,ht,yt,ft,Ct,_t){this.akitaRouterQuery=i,this.akitaLocationQuery=e,this.translationService=M,this.akitaScreenQuery=U,this.zone=ht,this.akitaStartingPricesQuery=yt,this.akitaStartingPricesService=ft,this.akitaProductsQuery=Ct,this.akitaProductsService=_t,this.mockCategoryData=ut,this.startingPricesPerCategory$=J(null),this.destroySubject=new Y,this.subscriptions=new W,this.language$=this.translationService.langChanges$,this.biggerThan$=this.akitaScreenQuery.selectBiggerThan(),this.country$=w([this.akitaRouterQuery.selectQueryParams(),this.akitaRouterQuery.selectRouteData(),this.akitaLocationQuery.selectCountry()]).pipe(O(([y,r,a])=>`${y.country||r.country||a||"US"}`.toUpperCase())),this.startingPricesPerCategory$=J(this.mockCategoryData),this.startingPrices$=this.akitaStartingPricesQuery.selectStartingPrices(),this.fetchingStartingPrices$=this.akitaStartingPricesQuery.selectFetchingStartingPrices(),this.startingPricesError$=this.akitaStartingPricesQuery.selectStartingPricesError(),this.akitaStartingPricesQuery.getStartingPrices().length||(this.akitaRouterQuery.isBrowser?this.zone.runOutsideAngular(this.fetchStartingPricesInBG.bind(this)):this.fetchStartingPricesInBG()),this.productCategories$=this.akitaProductsQuery.selectProductFilters().pipe(O(y=>{let r=[];return y.category.length&&(r=[...y.category].filter(a=>a!=="ACCESSORIES"),r=[...r].filter(a=>a!=="SMARTPHONE"),r=[...r].filter(a=>a!=="HEADPHONES"),r=[...r].filter(a=>a!=="WATCH"),r=[...r].filter(a=>a!=="GAMING"),r.unshift("SMARTPHONE"),r.push("ACCESSORIES"),r.push("WATCH"),r.push("HEADPHONES"),r.push("GAMING")),r})),this.fetchingProductOptions$=this.akitaProductsQuery.selectIsFetchingProductFilters(),this.productOptionsError$=this.akitaProductsQuery.selectErrorFetchingProductFilters(),this.akitaProductsQuery.getProductFilters()?.category?.length||(this.akitaRouterQuery.isBrowser?this.zone.runOutsideAngular(this.fetchProductOptionsInBG.bind(this)):this.fetchProductOptionsInBG()),this.categorySignal=ot(w([this.productCategories$,this.startingPrices$]).pipe(O(([y,r])=>{let a=Array(0),k=JSON.parse(JSON.stringify(r)),g=JSON.parse(JSON.stringify(y));if(g.length&&k.length){for(let m=0;m<g.length;m++){let I=k.slice().sort(function(o,b){return o.price.amount+b.price.amount}),T=k.slice().sort(function(o,b){return o.price.amount-b.price.amount}),f=I.find(o=>o.category===g[m]&&o.inStock&&o.brand==="Apple"),x=T.find(o=>o.category===g[m]&&o.inStock&&o.brand==="Apple");g[m]==="GAMING"&&(f=I.find(o=>o.category===g[m]&&o.inStock),x=T.find(o=>o.category===g[m]&&o.inStock)),f&&x&&(f.price.amount=x.price.amount,a.push(f))}return a}return this.mockCategoryData})),{initialValue:this.mockCategoryData}),this.startingPricesPerCategory$=w([this.productCategories$,this.startingPrices$]).pipe(O(([y,r])=>{let a=Array(0),k=JSON.parse(JSON.stringify(r)),g=JSON.parse(JSON.stringify(y));if(g)for(let m=0;m<g.length;m++){let I=k.slice().sort(function(o,b){return o.price.amount+b.price.amount}),T=k.slice().sort(function(o,b){return o.price.amount-b.price.amount}),f=I.find(o=>o.category===g[m]&&o.inStock&&o.brand==="Apple"),x=T.find(o=>o.category===g[m]&&o.inStock&&o.brand==="Apple");f&&x&&(f.price.amount=x.price.amount,a.push(f))}return a}))}fetchStartingPricesInBG(){this.subscriptions.add(this.akitaStartingPricesService.findStartingPricesAsync(this.akitaRouterQuery.country))}fetchProductOptionsInBG(){this.subscriptions.add(this.akitaProductsService.getAvailableSearchOptionsAsync())}trackByModel(i,e){return e?.id||e||`${i}`}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}static{this.\u0275fac=function(e){return new(e||t)(c(L),c(nt),c(rt),c(H),c(K),c(ct),c(st),c(at),c(gt))}}static{this.\u0275cmp=j({type:t,selectors:[["app-category-picker"]],decls:1,vars:0,consts:[[4,"transloco"],[1,"category-picker-component"],["aria-hidden","true",1,"item","fixed-space-16"],[1,"item",3,"product"]],template:function(e,M){e&1&&R(0,Bt,12,11,"ng-container",0)},dependencies:[D,G,z,N,dt,mt,B],styles:["@keyframes _ngcontent-%COMP%_loading{0%{transform:translate(-45%)}to{transform:translate(345%)}}
1.category-picker-component[_ngcontent-%COMP%]{display:block;position:relative;box-sizing:border-box;backface-visibility:hidden;transform:translateZ(0);transform-origin:50% 51%;padding:0 16px;max-width:1200px;margin:0 auto;scrollbar-width:thin;scrollbar-color:#a5adba #f4f4f4}.category-picker-component[_ngcontent-%COMP%]::-webkit-scrollbar{height:6px}.category-picker-component[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f4f4f4}.category-picker-component[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#a5adba;border-radius:20px;border:1px solid #f4f4f4}.category-picker-component[_ngcontent-%COMP%]{margin:0 auto;padding:16px}.category-picker-component.widescreen[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:16px;font-size:30px;line-height:40px}.category-picker-component[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:4px;gap:8px;text-align:center;overflow-x:auto}.hugescreen.category-picker-component[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.hugescreen.category-picker-component[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{min-width:unset}.category-picker-component[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{min-width:26vw}"]})}}return t})();export{se as CategoryPickerComponent};
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.