1import{d as B,e as I,q as k}from"./chunk-MA3UJZI3.js";import{e as T}from"./chunk-4ZBSEH5M.js";import{k as N}from"./chunk-BLUPBYQY.js";import{d as L}from"./chunk-N5KHQ3PY.js";import{j as R}from"./chunk-KMKRC7H4.js";import{$b as d,$c as f,Fa as P,Mc as c,Oc as l,ac as u,bc as M,dc as y,ec as S,fc as g,gc as o,ha as C,hb as r,hc as a,hd as w,id as E,ta as x,tb as O,xc as s,zb as v}from"./chunk-WLVJBNFV.js";var z=i=>({"arabic-font":i}),V=i=>({"d-md-block d-none":i});function $(i,m){if(i&1&&(o(0,"span",6),c(1),a()),i&2){let t=s(3);r(),l(" ",t.lang()==="en"?"chevron_right":"chevron_left"," ")}}function F(i,m){if(i&1&&(o(0,"a",7),c(1),a()),i&2){let t=s(2),e=t.$implicit,n=t.$index,_=s();g("routerLink",_.generateRouterLink(e,n)),r(),l(" ",_.lang()==="en"?(e==null?null:e.name_en)||"general":(e==null?null:e.name_ar)||"\u0639\u0627\u0645\u0629"," ")}}function D(i,m){if(i&1&&(o(0,"span",8),c(1),a()),i&2){let t=s(2).$implicit,e=s();g("ngClass",f(2,V,e.environmentVariables==null?null:e.environmentVariables.NEW_PRODUCTS_DETAILS_UI)),r(),l(" ",e.lang()==="en"?t==null?null:t.name_en:t==null?null:t.name_ar," ")}}function U(i,m){if(i&1&&(o(0,"div",2),d(1,$,2,1,"span",6),d(2,F,2,2,"a",7),d(3,D,2,4,"span",8),a()),i&2){let t=s(),e=t.$index,n=t.$count;r(),u(e>0?1:-1),r(),u(e!==n-1?2:-1),r(),u(e===n-1?3:-1)}}function j(i,m){if(i&1&&d(0,U,4,3,"div",2),i&2){let t=m.$implicit,e=s();u(t!=null&&t.name_en||!(e.environmentVariables!=null&&e.environmentVariables.ENABLE_REMOVE_GENERAL_GROUP)&&!(t!=null&&t.name_en)?0:-1)}}var tt=(()=>{class i{confgServ;document=C(x);routes=[];lang=C(k).currentLanguage;productName="";emitSchema=!0;codec=new L;environmentVariables;subscription;displayRoutes=[];breadcrumbScriptElement;constructor(t){this.confgServ=t,this.getInitilizingData()}ngOnChanges(t){t.routes&&(this.normalizeRoutes(),this.appendBreadcrumbSchema())}ngOnDestroy(){this.subscription?.unsubscribe(),this.breadcrumbScriptElement?.parentNode&&this.breadcrumbScriptElement.parentNode.removeChild(this.breadcrumbScriptElement)}getInitilizingData(){this.subscription=this.confgServ.getenvConfig().subscribe(t=>{this.environmentVariables=t})}getParentSlug1(t){return t[0].slug}getLastParentSlug1(t){return t[t?.length-1].parent_slug}generateRouterLink(t,e){if(e===0&&!t?.list_id)return["/",this.lang(),"product",t?.slug];if(e===1){if(!t.slug){let n=this.getParentSlugs(e);return["/",this.lang(),"category",...n,"general"]}return["/",this.lang(),"product",this.displayRoutes[0]?.slug,t?.slug]}else if(t?.slug){let n=this.getParentSlugs(e);return["/",this.lang(),"product",...n,t?.slug]}return["/",this.lang(),"products"]}getParentSlugs(t){let e=[];for(let n=0;n<t;n++)this.displayRoutes[n]&&this.displayRoutes[n].slug&&e.push(this.displayRoutes[n].slug);return e}normalizeRoutes(){if(!Array.isArray(this.routes)||!this.routes.length){this.displayRoutes=[];return}let t=new Set;this.displayRoutes=this.routes.filter(e=>{if(!e)return!1;let n=e.name;return n?t.has(n)?!1:(t.add(n),!0):!0})}appendBreadcrumbSchema(){if(!this.emitSchema||!this.environmentVariables?.WEBSITE_URL||!this.document?.body)return;this.breadcrumbScriptElement?.parentNode&&this.breadcrumbScriptElement.parentNode.removeChild(this.breadcrumbScriptElement);let t=this.displayRoutes.map(p=>p.slug||"general"),e=this.lang()==="ar",_=[{name_en:"Home",name_ar:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629"},...this.displayRoutes].map((p,h)=>({"@type":"ListItem",position:h+1,item:{"@id":h===0?this.environmentVariables.WEBSITE_URL:this.environmentVariables.WEBSITE_URL+"/product/"+t.slice(0,h).join("/"),name:e&&p.name_ar||p.name_en||"general"}})),b=this.document.createElement("script");b.type="application/ld+json",b.text=`{ 2 "@context": "https://schema.org", 3 "@type": "BreadcrumbList", 4 "itemListElement": ${JSON.stringify(_)} 5 }`,this.document.body.appendChild(b),this.breadcrumbScriptElement=b}static \u0275fac=function(e){return new(e||i)(O(T))};static \u0275cmp=v({type:i,selectors:[["app-bread-crumbs"]],inputs:{routes:"routes",productName:"productName",emitSchema:"emitSchema"},features:[P],decls:13,vars:8,consts:[[1,"bread-crumbs","border-bottom-1"],[1,"d-flex","justify-content-start","align-items-center","col-md-12","flex-wrap","container","pm-0"],[1,"d-flex","align-items-center"],[1,"d-flex","main-breadcrump-menu","align-content-center","align-items-center",3,"routerLink"],[1,"material-icons","mr-1"],[2,"line-height","1.2",3,"ngClass"],[1,"material-icons"],[1,"m-1","pointer","text-capitalize","title","font-weight-bold","name",3,"routerLink"],["data-testid","breadcrumb-current",1,"mx-1","product-name",3,"ngClass"]],template:function(e,n){e&1&&(o(0,"section",0)(1,"div",1)(2,"div",2)(3,"a",3)(4,"span",4),c(5,"home"),a(),o(6,"span",5),c(7),w(8,"translate"),a()(),o(9,"span",6),c(10),a()(),y(11,j,1,1,null,null,M),a()()),e&2&&(r(3),g("routerLink","/"+n.lang()),r(3),g("ngClass",f(6,z,n.lang()==="ar")),r(),l(" ",E(8,4,"header.home")," "),r(3),l(" ",n.lang()==="en"?"chevron_right":"chevron_left"," "),r(),S(n.routes))},dependencies:[N,R,I,B],styles:[".bread-crumbs[_ngcontent-%COMP%]{width:100%;overflow-x:auto;padding:16px;background-color:#fff}.bread-crumbs[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:20px!important;font-weight:500!important}.bread-crumbs[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{width:max-content}.bread-crumbs[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-family:var(--font-family-en);margin-bottom:0;font-size:12px}@media screen and (max-width:500px){.bread-crumbs[_ngcontent-%COMP%]{padding:6px 15px!important}}@media(max-width:600px){.bread-crumbs[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;margin:10px 0;line-height:1}.bread-crumbs[_ngcontent-%COMP%] >
5 div[_ngcontent-%COMP%] .product-name[_ngcontent-%COMP%]{padding-inline-end:1rem;display:inline-block!important}}a.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:1!important;cursor:default}.list[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]:last-child{font-size:20px!important;font-weight:500!important}.filter-icon[_ngcontent-%COMP%]{display:none}@media(max-width:798px){.filter-icon[_ngcontent-%COMP%]{display:block!important}.bread-crumbs[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .bread-crumbs[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .bread-crumbs[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-size:10px!important}}@media(min-width:768px)and (max-width:991px){.filter-icon[_ngcontent-%COMP%]{display:block!important}.bread-crumbs[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .bread-crumbs[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .bread-crumbs[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{font-size:12px!important}}.productName[_ngcontent-%COMP%]{white-space:nowrap}a[_ngcontent-%COMP%], .productName[_ngcontent-%COMP%], .bread-crumbs[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{white-space:nowrap;font-weight:400;font-size:.875rem;font-family:var(--font-family-en)}.productName-ellipsis[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:60%}.main-breadcrump-menu[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--brand-color)}.flex-wrap[_ngcontent-%COMP%]{flex-wrap:wrap!important}.product-name[_ngcontent-%COMP%]{width:auto;text-overflow:ellipsis;text-wrap:nowrap}@media(max-width:700px){.product-name[_ngcontent-%COMP%] .flex-wrap[_ngcontent-%COMP%]{flex-wrap:nowrap!important;width:100%!important}.product-name[_ngcontent-%COMP%] .product-name[_ngcontent-%COMP%]{display:inline-block!important}}@media(max-width:800px){.pm-0[_ngcontent-%COMP%]{padding:0}}"]})}return i})();export{tt as a};
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.