1import{a as Qt}from"./chunk-KHVAK3OD.js";import{a as Wt}from"./chunk-KPGFIJ3R.js";import{a as Ht}from"./chunk-3EGACNWO.js";import{a as zt}from"./chunk-BFDKET35.js";import{a as qt}from"./chunk-S55M2TU3.js";import{a as Gt}from"./chunk-2SZSYN4X.js";import{a as jt}from"./chunk-7KGUR7RG.js";import{a as Nt}from"./chunk-6H753PRS.js";import{a as Mt,b as Qe}from"./chunk-LY4HHVOS.js";import{a as Ut}from"./chunk-MZUEIRNK.js";import{a as Ze}from"./chunk-QUOYCW2K.js";import"./chunk-LOJPQV5Z.js";import"./chunk-42XQHSRH.js";import{f as $t}from"./chunk-EQFW4QQZ.js";import"./chunk-U7QXCRJE.js";import{a as At}from"./chunk-EPNG2NCV.js";import{a as Ot}from"./chunk-5AET6QL4.js";import"./chunk-XCMBNBWD.js";import"./chunk-P4IOY7MQ.js";import{a as Bt}from"./chunk-Z6ZMT5TB.js";import{a as kt}from"./chunk-IFYI57RT.js";import"./chunk-YQJDOXQV.js";import{a as Rt}from"./chunk-DW76HRGN.js";import{c as Vt}from"./chunk-U5GMFOUI.js";import"./chunk-KFUJOWFG.js";import{a as Lt}from"./chunk-EMN3LJF3.js";import"./chunk-WTFDJVK3.js";import{a as yt,f as It,g as We}from"./chunk-CQ7QGRPL.js";import"./chunk-T33EOPBV.js";import"./chunk-62B2JVET.js";import{a as bt}from"./chunk-Y6ABLFG6.js";import{a as Dt}from"./chunk-DFRMZ4MB.js";import"./chunk-QX445V22.js";import{a as Ft}from"./chunk-3WSTOD3D.js";import{a as Pt}from"./chunk-EPIV5ND4.js";import{a as St}from"./chunk-FILWG3SR.js";import"./chunk-RYVFIKYI.js";import{a as Et}from"./chunk-KNIZNUVD.js";import"./chunk-44VXWE7X.js";import{f as Tt}from"./chunk-MF5SWVV5.js";import{a as He}from"./chunk-S7RS4WME.js";import"./chunk-RM7NCUBU.js";import"./chunk-H4XVNYYW.js";import"./chunk-GGQ7LRWG.js";import"./chunk-W4BNGQYG.js";import{n as wt}from"./chunk-FACX5VIG.js";import"./chunk-RNIINARP.js";import{A as ze,c as Me,d as ht,e as $e,f as Ue,g as ve,i as we,k as je,l as xt,o as Ne,p as Ct,q as Ge,s as gt,t as vt,y as qe}from"./chunk-4YLKWLTE.js";import{d as Be,e as M,f as j}from"./chunk-MDEUGU6N.js";import"./chunk-WAWXULXV.js";import{b as ft}from"./chunk-AP2OXJSW.js";import"./chunk-QEGWBESR.js";import{a as I}from"./chunk-BVTNNYKT.js";import{H as mt,X as _t,Y as ee}from"./chunk-RVLSVGP4.js";import"./chunk-3IIJ5ZCP.js";import{e as pt}from"./chunk-ZHB2XPGO.js";import{E as Ae,k as ut,p as Le,q as de,s as Oe,y as ge}from"./chunk-6EYILAK6.js";import{$b as se,Ac as pe,Bc as X,D as De,Dc as O,Ec as T,F as K,Gb as ae,Ha as Ie,Hb as at,Ib as st,J as re,Jb as xe,Kc as x,Lb as H,Lc as C,Mb as h,Mc as me,Ob as Y,Pb as dt,Pc as Q,Qb as Ce,Rb as p,Sb as R,T as Ee,Tb as ct,Ub as F,Vb as D,Vc as _e,W as le,Wb as a,X as ot,Xb as s,Y as Je,Yb as _,ac as E,bb as z,f as it,fa as ye,fc as P,g as nt,gc as d,hb as l,k as $,m as A,mc as Ve,na as J,nb as S,nc as ke,oa as w,oc as Re,pa as b,pc as W,q as Ke,qa as B,qc as u,ra as Te,rc as y,s as oe,sc as g,t as Fe,tc as L,ub as U,xb as lt,ya as k,za as rt,zb as m,zc as ue}from"./chunk-7R5QJ3F4.js";import{a as ie,b as ne,o as G}from"./chunk-EMXRSGQS.js";var Zt=(()=>{let o=class o{transform(e){return e?e.length===0?"":e[0].toUpperCase()+e.substring(1).toLowerCase():""}};o.\u0275fac=function(n){return new(n||o)},o.\u0275pipe=lt({name:"capitalize",type:o,pure:!0});let i=o;return i})();var hi=["product-filter-row",""],Ye=()=>[],Xe=i=>({valueTemplate:i}),Kt=i=>[i];function xi(i,o){if(i&1&&(a(0,"dt"),u(1),s()),i&2){let t=d();l(),y(t.filterDefinition.name)}}function Ci(i,o){if(i&1&&(a(0,"a",5),u(1),s()),i&2){let t,e=d(3).$implicit,n=d(2);h("routerLink",T(3,Kt,"/search/"+e.value)),l(),L(" ",e.value," ",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function gi(i,o){if(i&1&&(a(0,"span"),u(1),s()),i&2){let t,e=d(3).$implicit,n=d(2);l(),L("",e.value," ",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:"","")}}function vi(i,o){if(i&1&&m(0,Ci,2,5,"a",5)(1,gi,2,2,"span"),i&2){d(4);let t=X(2);p(t?0:1)}}function wi(i,o){if(i&1&&(a(0,"s",4),u(1),s()),i&2){let t,e=d(2).$implicit,n=d(2);l(),L("",e.value,"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:"","")}}function bi(i,o){if(i&1&&m(0,vi,2,1)(1,wi,2,2,"s",4),i&2){let t=d(3);p(t.filterDefinition.name!=="Prix"?0:1)}}function Si(i,o){if(i&1&&(m(0,bi,2,1,"ng-template",null,1,Q),se(2,3)),i&2){let t=W(1);d(2);let e=W(10);l(2),h("ngTemplateOutlet",e)("ngTemplateOutletContext",T(2,Xe,t))}}function Pi(i,o){if(i&1&&F(0,Si,3,4,null,null,R),i&2){let t,e=d();D((t=e.filterValue==null?null:e.filterValue.rawValues)!==null&&t!==void 0?t:O(0,Ye))}}function Fi(i,o){if(i&1&&_(0,"img",9),i&2){let t=d(2);h("alt",t.filterDefinition.name)("title",t.filterDefinition.name)("ngSrc",t.filterDefinition.icon.url)}}function Di(i,o){if(i&1&&(a(0,"span",11),u(1),s()),i&2){let t=d(2);l(),g("(",t.filterDefinition.unit,")")}}function Ei(i,o){if(i&1){let t=E();a(0,"div",12)(1,"button",16),P("click",function(n){return w(t),d(2).addRawValue(),n.stopPropagation(),b(n.preventDefault())}),u(2),x(3,"translate"),s()()}if(i&2){let t=d(2);l(),h("disabled",t.disableAdd),l(),g(" ",C(3,2,"PRODUCT_FILTERS_TABLE.ADD")," ")}}function yi(i,o){if(i&1){let t=E();a(0,"button",17),P("click",function(n){return w(t),d(2).addPromo(),n.stopPropagation(),b(n.preventDefault())}),_(1,"span",18),s()}if(i&2){let t=d(2);Y("bg-primary",t.isPromo),l(),Y("translate-x-5",t.isPromo)}}function Ti(i,o){if(i&1){let t=E();a(0,"div",15)(1,"input",20),P("input",function(){w(t);let n=d().$index,r=d(2);return b(r.onRawValueInputChange(n,r.filterDefinition.unit))}),s(),a(2,"button",21),x(3,"translate"),P("click",function(){w(t);let n=d().$index,r=d(2);return b(r.deleteRawValue(n,r.filterDefinition.unit))}),u(4," \u274C "),s()()}i&2&&(l(2),H("aria-label",C(3,1,"PRODUCT_FILTERS_TABLE.DELETE")))}function Ii(i,o){i&1&&(a(0,"p",19),u(1),x(2,"translate"),s()),i&2&&(l(),g(" ",C(2,1,"PRODUCT_FILTERS_TABLE.VALIDATION.NUMBER")," "))}function Vi(i,o){if(i&1&&(a(0,"form",14),m(1,Ti,5,3,"div",15)(2,Ii,3,3,"p",19),s()),i&2){let t=o.$implicit,e=o.$index,n=d(2);h("formGroup",t),l(),p(n.filterDefinition.name.toLowerCase()!=="promo"?1:-1),l(),p(n.errorFilter[e]?2:-1)}}function ki(i,o){i&1&&(a(0,"div",23),u(1),x(2,"translate"),s()),i&2&&(l(),y(C(2,1,"PRODUCT_FILTERS_TABLE.VALIDATION.REQUIRED")))}function Ri(i,o){if(i&1){let t=E();a(0,"div",15)(1,"input",22),P("input",function(){w(t);let n=d(2);return b(n.addPromoValue())}),s(),m(2,ki,3,3,"div",23),s()}if(i&2){let t,e=d(2);l(2),p(!((t=e.promoForm.get("prix"))==null||t.errors==null)&&t.errors.required?2:-1)}}function Li(i,o){if(i&1&&(a(0,"div",6)(1,"div",7)(2,"div",8),m(3,Fi,1,3,"img",9),a(4,"div",10),u(5),m(6,Di,2,1,"span",11),s()()(),a(7,"div",7),m(8,Ei,4,4,"div",12),s(),m(9,yi,2,4,"button",13),s(),_(10,"br"),F(11,Vi,3,3,"form",14,R),a(13,"form",14),m(14,Ri,3,1,"div",15),s()),i&2){let t=d();l(3),p(t.filterDefinition.icon?3:-1),l(2),g(" ",t.filterDefinition.name," "),l(),p(t.filterDefinition.unit?6:-1),l(2),p(t.filterDefinition.name.toLowerCase()!=="promo"?8:-1),l(),p(t.filterDefinition.name.toLowerCase()==="promo"?9:-1),l(2),D(t.rawValueControls),l(2),h("formGroup",t.promoForm),l(),p(t.isPromo?14:-1)}}function Oi(i,o){if(i&1&&(a(0,"a",5),u(1),s()),i&2){let t,e=d(3).$implicit,n=d(2);h("routerLink",T(3,Kt,"/search/"+n.filterDefinition.product_filter_presets[e.valueId].value)),l(),L(" ",n.filterDefinition.product_filter_presets[e.valueId].value,"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function Ai(i,o){if(i&1&&(a(0,"span"),u(1),s()),i&2){let t,e=d(3).$implicit,n=d(2);l(),L(" ",n.filterDefinition.product_filter_presets[e.valueId].value,"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function Bi(i,o){if(i&1&&m(0,Oi,2,5,"a",5)(1,Ai,2,2,"span"),i&2){d(4);let t=X(2);p(t?0:1)}}function Mi(i,o){if(i&1&&_(0,"img",24),i&2){let t=d(2).$implicit,e=d(2);h("alt",e.filterDefinition.product_filter_presets[t.valueId].value)("src",e.filterDefinition.product_filter_presets[t.valueId].icon==null?null:e.filterDefinition.product_filter_presets[t.valueId].icon.url,z)}}function $i(i,o){if(i&1&&m(0,Bi,2,1)(1,Mi,1,2,"img",24),i&2){let t=d().$implicit,e=d(2);p(e.filterDefinition.product_filter_presets[t.valueId]&&!(e.filterDefinition.product_filter_presets[t.valueId]!=null&&e.filterDefinition.product_filter_presets[t.valueId].icon)?0:e.filterDefinition.product_filter_presets[t.valueId]!=null&&e.filterDefinition.product_filter_presets[t.valueId].icon?1:-1)}}function Ui(i,o){if(i&1&&(m(0,$i,2,1,"ng-template",null,1,Q),se(2,3)),i&2){let t=W(1);d(2);let e=W(10);l(2),h("ngTemplateOutlet",e)("ngTemplateOutletContext",T(2,Xe,t))}}function ji(i,o){if(i&1&&F(0,Ui,3,4,null,null,R),i&2){let t,e=d();D((t=e.filterValue==null?null:e.filterValue.presetValueIds)!==null&&t!==void 0?t:O(0,Ye))}}function Ni(i,o){if(i&1&&_(0,"img",26),i&2){let t=d(3);h("alt",t.filterDefinition.name)("title",t.filterDefinition.name)("src",t.filterDefinition.icon.url,z)}}function Gi(i,o){if(i&1&&(a(0,"option",31),u(1),x(2,"capitalize"),s()),i&2){let t,e=d().$implicit,n=d(3);h("value",e==null?null:e.valueId),l(),L(" ",C(2,3,n.filterDefinition.product_filter_presets[e.valueId]==null?null:n.filterDefinition.product_filter_presets[e.valueId].value),"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function qi(i,o){i&1&&_(0,"option",32)}function zi(i,o){if(i&1&&(a(0,"option",34),u(1),x(2,"capitalize"),s()),i&2){let t,e=d().$implicit,n=d(4);h("value",e.key),l(),L(" ",C(2,3,e.value.value),"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function Hi(i,o){if(i&1&&m(0,zi,3,5,"option",34),i&2){let t=o.$implicit,e=d(4);p(e.isFilterPresetIdSelected(t.key)?-1:0)}}function Wi(i,o){if(i&1){let t=E();a(0,"p",28),u(1),s(),a(2,"div",29)(3,"select",30),P("change",function(n){let r=w(t).$index,c=d(3);return b(c.onPresetValueSelected(n,r))}),m(4,Gi,3,5,"option",31)(5,qi,1,0,"option",32),F(6,Hi,1,1,null,null,R),x(8,"keyvalue"),s(),a(9,"button",33),x(10,"translate"),P("click",function(){let n=w(t).$index,r=d(3);return b(r.deleteSelect(n))}),u(11," \u274C "),s()()}if(i&2){let t=o.$implicit,e=o.$index,n=d(3);l(),L("",n.filterDefinition.name," ",e+1,""),l(3),p(n.filterDefinition.product_filter_presets[t.valueId]!=null&&n.filterDefinition.product_filter_presets[t.valueId].value?4:5),l(2),D(C(8,4,n.filterDefinition.product_filter_presets)),l(3),H("aria-label",C(10,6,"PRODUCT_FILTERS_TABLE.DELETE"))}}function Qi(i,o){if(i&1){let t=E();a(0,"div",6)(1,"div",7)(2,"div",8),m(3,Ni,1,3,"img",26),a(4,"div",10),u(5),s()()(),a(6,"div",7)(7,"div",12)(8,"button",27),P("click",function(n){return w(t),d(2).addSelect(),n.stopPropagation(),b(n.preventDefault())}),u(9),x(10,"translate"),s()()()(),F(11,Wi,12,8,null,null,R)}if(i&2){let t,e=d(2);l(3),p(e.filterDefinition.icon?3:-1),l(2),y(e.filterDefinition.name),l(4),g(" ",C(10,3,"PRODUCT_FILTERS_TABLE.ADD")," "),l(2),D((t=e.filterValue==null?null:e.filterValue.presetValueIds)!==null&&t!==void 0?t:O(5,Ye))}}function Zi(i,o){if(i&1&&(a(0,"option",34),u(1),x(2,"capitalize"),s()),i&2){let t,e=d().$implicit,n=d(3);h("value",e.key),l(),L(" ",C(2,3,e.value.value),"",(t=n.filterDefinition.unit)!==null&&t!==void 0?t:""," ")}}function Ki(i,o){if(i&1&&m(0,Zi,3,5,"option",34),i&2){let t=o.$implicit,e=d(3);p(e.isFilterPresetIdSelected(t.key)?-1:0)}}function Ji(i,o){if(i&1&&(a(0,"div",25)(1,"p",35),u(2),s(),a(3,"select",36),F(4,Ki,1,1,null,null,R),x(6,"keyvalue"),s()()),i&2){let t=d(2);l(2),L("",t.filterDefinition.name," ",t.rawValueControls.length+1,""),l(2),D(C(6,2,t.filterDefinition.product_filter_presets))}}function Yi(i,o){if(i&1&&(m(0,Qi,13,6,"ng-template",null,1,Q),se(2,3),F(3,Ji,7,4,"div",25,R)),i&2){let t=W(1),e=d(),n=W(10);l(2),h("ngTemplateOutlet",n)("ngTemplateOutletContext",T(2,Xe,t)),l(),D(e.rawValueControls)}}function Xi(i,o){if(i&1&&(a(0,"div")(1,"label",37),se(2,38),s()()),i&2){let t=o.valueTemplate,e=d();l(),h("for",e.filterDefinition.name),l(),h("ngTemplateOutlet",t)}}var Jt=(()=>{let o=class o{constructor(e,n,r){this.formBuilder=e,this.errorFilterService=n,this.websiteFeaturesService=r,this.hasProductsSearchFeature$=this.websiteFeaturesService.hasProductsSearch$(),this.productFilterForm=new ve({rawValue:new we}),this.requiredFilterIds=[],this.filterIdValuePairsChanged=new k,this.prixValue=new k,this.promoBoolean=new k,this.filterValueEmit=new k,this.isPromo=!1,this.rawValueControls=[],this.filterIdValuePairs={id:"",rawValues:[],presetValueIds:[]},this.regex=/^-?\d*[.]?\d*$/,this.errorFilter=[],this.disableAdd=!1,this.promoForm=new ve({prix:new we("",{validators:[ht.required]})})}ngOnChanges(e){if((e.filterDefinition||e.filterValue)&&this.filterDefinition){if(this.filterValue){if(this.requiredFilterIds.includes(this.filterValue.id)){let n=[];this.filterValue?.presetValueIds?.forEach(r=>{let c=this.filterDefinition.product_filter_presets[r.valueId]?.value;c&&n.push(c)}),this.filterValue?.rawValues?.forEach(r=>{let c=String(r.value??"").trim();c&&n.push(c)}),this.filterValueEmit.emit({filterId:this.filterValue.id,values:Array.from(new Set(n))})}this.filterValue?.rawValues?.forEach(n=>{let r=this.formBuilder.group({rawValueControl:[n.value]});this.rawValueControls.push(r),this.filterIdValuePairs?.rawValues.push({value:n.value})}),this.filterValue?.presetValueIds?.forEach(n=>{this.filterIdValuePairs.presetValueIds.push({valueId:n.valueId})}),this.filterIdValuePairs.id=this.filterDefinition.id,this.filterDefinition.name.toLowerCase()==="promo"&&this.filterValue?.
1id===this.filterDefinition.id&&(this.filterValue?.rawValues[0].value==="oui"?(this.isPromo=!0,this.promoForm.patchValue({prix:this.prixPromo})):this.isPromo=!1)}else this.filterIdValuePairs.id=this.filterDefinition.id,this.filterIdValuePairs.presetValueIds=[],this.filterIdValuePairs.rawValues=[];!this.filterValue&&this.requiredFilterIds.includes(this.filterDefinition.id)&&this.filterValueEmit.emit(null),this.filterIdValuePairsChanged.emit(this.filterIdValuePairs)}}addRawValue(){let e=this.formBuilder.group({rawValueControl:[""]});this.rawValueControls.push(e)}addPromo(){this.isPromo?(this.isPromo=!1,this.promoBoolean.emit(!1)):(this.isPromo=!0,this.promoBoolean.emit(!0)),this.filterIdValuePairs.rawValues[0]={value:this.isPromo?"oui":"non"},this.filterIdValuePairsChanged.emit(this.filterIdValuePairs),this.isPromo||(this.promoForm.patchValue({prix:""}),this.prixValue.emit(this.promoForm.value.prix))}addPromoValue(){this.prixValue.emit(this.promoForm.value.prix)}onRawValueInputChange(e,n){if(this.rawValueControls&&this.rawValueControls[e]){let r=this.rawValueControls[e].get("rawValueControl").value;n&&(this.regex.test(r)?(this.errorFilter[e]=!1,this.disableAdd=!1,this.errorFilterService.setErrorFilter(!1)):(this.errorFilter[e]=!0,this.disableAdd=!0,this.errorFilterService.setErrorFilter(!0))),this.filterIdValuePairs.rawValues[e]={value:r},this.filterIdValuePairsChanged.emit(this.filterIdValuePairs)}}deleteRawValue(e,n){this.rawValueControls.splice(e,1),this.filterIdValuePairs.rawValues.splice(e,1),this.filterIdValuePairsChanged.emit(this.filterIdValuePairs),n&&this.filterIdValuePairs.rawValues.length==0&&(this.errorFilter[e]=!1,this.disableAdd=!1,this.errorFilterService.setErrorFilter(!1))}onPresetValueSelected(e,n){let r=e.target.value;this.filterIdValuePairs.presetValueIds[n]&&(this.filterIdValuePairs.presetValueIds[n].valueId=r),this.filterIdValuePairsChanged.emit(this.filterIdValuePairs)}addSelect(){let e=this.formBuilder.group({newValue:[""]});this.filterIdValuePairs.presetValueIds.push({valueId:""})}deleteSelect(e){this.rawValueControls.splice(e,1),this.filterIdValuePairs.presetValueIds.splice(e,1),this.filterIdValuePairsChanged.emit(this.filterIdValuePairs)}get hasMultipleValues(){let e=this.filterValue?.rawValues?.length??0,n=this.filterValue?.presetValueIds?.length??0;return e+n>1}isFilterWithPresets(){return Object.keys(this.filterDefinition?.product_filter_presets).length>0}isFilterPresetIdSelected(e){return this.filterValue?.presetValueIds?.length?this.filterValue.presetValueIds.findIndex(n=>n.valueId.toString()===e)!==-1:!1}};o.\u0275fac=function(n){return new(n||o)(S(qe),S(Qe),S(He))},o.\u0275cmp=U({type:o,selectors:[["","product-filter-row",""]],inputs:{filterDefinition:"filterDefinition",filterValue:"filterValue",isEditMode:"isEditMode",categoryId:"categoryId",requiredFilterIds:"requiredFilterIds",prixPromo:"prixPromo"},outputs:{filterIdValuePairsChanged:"filterIdValuePairsChanged",prixValue:"prixValue",promoBoolean:"promoBoolean",filterValueEmit:"filterValueEmit"},features:[J],attrs:hi,decls:11,vars:10,consts:[["valueContainer",""],["valueTemplate",""],[3,"ngClass"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"whitespace-nowrap"],[1,"hover:text-brand",3,"routerLink"],[1,"flex","justify-between","items-center","space-x-4"],[1,"w-1/2"],[1,"flex","items-center","space-x-2"],["ngSrcset","40w",1,"h-10","w-10","rounded-full",3,"alt","title","ngSrc"],[1,"text-sm","font-semibold","text-gray-900"],[1,"text-red-600"],[1,"flex","justify-end"],["type","button","role","switch",1,"disabled:cursor-not-allowed","bg-gray-900","relative","inline-flex","h-6","w-11","flex-shrink-0","cursor-pointer","rounded-full","border-2","border-transparent","transition-colors","duration-200","ease-in-out",3,"bg-primary"],[3,"formGroup"],[1,"input-container","mr-48","max-md:mr-52"],["type","button",1,"text-white","rounded-md","bg-primary","py-2","px-4",3,"click","disabled"],["type","button","role","switch",1,"disabled:cursor-not-allowed","bg-gray-900","relative","inline-flex","h-6","w-11","flex-shrink-0","cursor-pointer","rounded-full","border-2","border-transparent","transition-colors","duration-200","ease-in-out",3,"click"],[1,"translate-x-0","pointer-events-none","inline-block","h-5","w-5","transform","rounded-full","bg-gray-50","shadow","transition","duration-200","ease-in-out"],[1,"mt-2","text-sm","text-red-600"],["type","text","formControlName","rawValueControl",1,"rounded-md","w-[13.5rem]","border-gray-300",3,"input"],["type","button",1,"delete-icon","cursor-pointer","mt-[17px]",3,"click"],["type","number","formControlName","prix",1,"rounded-lg",3,"input"],[1,"text-primary"],["width","40","height","40",3,"alt","src"],[1,"w-40"],[1,"h-10","w-10","rounded-full",3,"alt","title","src"],["type","button",1,"text-white","rounded-md","bg-primary","py-2","px-4",3,"click"],[1,"w-52","mt-2","max-md:ml-10"],[1,"flex","items-center","space-x-3","w-full"],[1,"w-52","mt-2","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:border-blue-500","block","p-2.5","cursor-pointer",3,"change"],["selected","",3,"value"],["selected",""],["type","button",1,"curs
1or-pointer","p-1","text-red-500","hover:text-red-700",3,"click"],[3,"value"],[1,"w-52"],[1,"w-full","bg-gray-50","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:border-blue-500","block","p-2.5","cursor-pointer"],[3,"for"],[3,"ngTemplateOutlet"]],template:function(n,r){if(n&1&&(m(0,xi,2,1,"dt"),a(1,"div",2),ue(2),x(3,"async"),a(4,"dd",2),m(5,Pi,2,1)(6,Li,15,7)(7,ji,2,1)(8,Yi,5,4),s(),m(9,Xi,3,2,"ng-template",null,0,Q),s()),n&2){let c,f;p(r.isEditMode?-1:0),l(),h("ngClass",r.isEditMode?"w-full":"contents"),l(),pe(C(3,7,r.hasProductsSearchFeature$)),l(2),h("ngClass",r.isEditMode?"":r.hasMultipleValues?"wp-specs-v is-chips":"wp-specs-v"),l(),p((c=r.filterValue==null||r.filterValue.rawValues==null?null:r.filterValue.rawValues.length)!==null&&c!==void 0&&c&&!r.isEditMode?5:-1),l(),p(!r.isFilterWithPresets()&&r.isEditMode?6:-1),l(),p(!((f=r.filterValue==null||r.filterValue.rawValues==null?null:r.filterValue.rawValues.length)!==null&&f!==void 0&&f)&&((f=r.filterValue==null||r.filterValue.presetValueIds==null?null:r.filterValue.presetValueIds.length)!==null&&f!==void 0&&f)&&!r.isEditMode?7:-1),l(),p(r.isFilterWithPresets()&&r.isEditMode?8:-1)}},dependencies:[Le,de,Oe,Zt,ze,je,gt,vt,Me,xt,$e,Ue,Ne,Ge,ut,Ae,ee,j,M],styles:[".input-container[_ngcontent-%COMP%]{position:relative}.delete-icon[_ngcontent-%COMP%]{transform:translateY(-50%);cursor:pointer;color:red}.truncate[_ngcontent-%COMP%]{display:inline-block;max-width:16rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]});let i=o;return i})();var en=["combinated-product-filter-row",""],Yt=()=>[];function tn(i,o){let t;return(t=o==null?null:o.id)!==null&&t!==void 0?t:i}function nn(i,o){i&1&&(u(0),x(1,"translate")),i&2&&g(" ",C(1,1,"PRODUCT_FILTERS_TABLE.SEE_LESS")," ")}function on(i,o){i&1&&(u(0),x(1,"translate")),i&2&&g(" ",C(1,1,"PRODUCT_FILTERS_TABLE.SEE_MORE")," ")}function rn(i,o){if(i&1){let t=E();a(0,"button",3),P("click",function(){w(t);let n=d(2);return b(n.toggleExpanded())}),m(1,nn,2,3)(2,on,2,3),s()}if(i&2){let t=d(2);l(),p(t.expanded?1:2)}}function ln(i,o){if(i&1&&(a(0,"dt"),u(1),s(),a(2,"dd",1)(3,"span"),u(4),s(),m(5,rn,3,1,"button",2),s()),i&2){let t=d();l(),y(t.combinatedFilterDefinition==null?null:t.combinatedFilterDefinition.name),l(3),y(t.visibleValues.join("; ")),l(),p(t.hiddenCount>0?5:-1)}}function an(i,o){if(i&1&&_(0,"img",7),i&2){let t=d(2);h("alt",t.combinatedFilterDefinition==null?null:t.combinatedFilterDefinition.name)("title",t.combinatedFilterDefinition==null?null:t.combinatedFilterDefinition.name)("src",t.combinatedFilterDefinition==null?null:t.combinatedFilterDefinition.icon.url,z)}}function sn(i,o){if(i&1){let t=E();a(0,"div",15)(1,"label",17),u(2),s(),a(3,"span",18),u(4),s(),a(5,"input",19),P("input",function(){let n=w(t).$index,r=d().$index,c=d(2);return b(c.onFilterInputChange(r,n))}),s()()}if(i&2){let t=o.$implicit,e=o.$index,n=d().$index,r=d(2);l(2),g(" ",r.filterDefinitions[t.id]==null?null:r.filterDefinitions[t.id].name," "),l(2),g(" ",r.filterDefinitions[t.id]!=null&&r.filterDefinitions[t.id].unit?"("+(r.filterDefinitions[t.id]==null?null:r.filterDefinitions[t.id].unit)+")":""," "),l(),h("formControlName","filter_"+n+"_"+e)}}function dn(i,o){i&1&&(a(0,"p",16),u(1),x(2,"translate"),s()),i&2&&(l(),g(" ",C(2,1,"PRODUCT_FILTERS_TABLE.VALIDATION.NUMBER")," "))}function cn(i,o){if(i&1){let t=E();a(0,"div",12)(1,"button",13),P("click",function(n){let r=w(t).$index;return d(2).removeFilterRow(r),n.stopPropagation(),b(n.preventDefault())}),u(2),x(3,"translate"),s(),a(4,"div",14),F(5,sn,6,3,"div",15,tn),_(7,"br"),s(),m(8,dn,3,3,"p",16),s()}if(i&2){let t,e=o.$index,n=d(2);h("formGroupName","filterRow_"+e),l(2),g(" ",C(3,3,"PRODUCT_FILTERS_TABLE.DELETE")," "),l(3),D((t=n.combinatedFilterDefinition==null?null:n.combinatedFilterDefinition.product_filters)!==null&&t!==void 0?t:O(5,Yt)),l(3),p(n.errorFilterCombined!=null&&n.errorFilterCombined[e]?8:-1)}}function un(i,o){if(i&1){let t=E();a(0,"div",0)(1,"div",4)(2,"div",5)(3,"div",6),m(4,an,1,3,"img",7),a(5,"div",8),u(6),s()()(),a(7,"div",5)(8,"div",9)(9,"button",10),P("click",function(n){return w(t),d().addFilter(),n.stopPropagation(),b(n.preventDefault())}),u(10),x(11,"translate"),s()()()(),a(12,"form",11),F(13,cn,9,6,"div",12,R),s()()}if(i&2){let t,e=d();
1l(4),p(e.combinatedFilterDefinition!=null&&e.combinatedFilterDefinition.icon?4:-1),l(2),g(" ",e.combinatedFilterDefinition==null?null:e.combinatedFilterDefinition.name," "),l(3),h("disabled",e.disableAdd),l(),g(" ",C(11,5,"PRODUCT_FILTERS_TABLE.ADD")," "),l(2),h("formGroup",e.filterRowsForm),l(),D((t=e.combinedFilterData==null?null:e.combinedFilterData.values)!==null&&t!==void 0?t:O(7,Yt))}}var Xt=(()=>{let o=class o{constructor(e,n){this.formBuilder=e,this.errorFilterService=n,this.combinedFilterDataChanged=new k,this.filterIdsUsedInCombination=[],this.allFilterIdsUsedInCombination=[],this.combinedFilterData={id:"",values:[]},this.regex=/^-?\d*[.]?\d*$/,this.errorFilterCombined=[],this.disableAdd=!1,this.selectedCombinationValue=null,this.resolvedValues=[],this.expanded=!1}ngOnInit(){this.isEditMode||(this.filterIdsUsedInCombination=[...new Set(this.combinatedFilterValue.values.flatMap(n=>n.filters).filter(n=>n?.presetValueId||n?.rawValue).flatMap(n=>n.id))],this.resolvedValues=[...new Set((this.combinatedFilterValue?.values??[]).map(n=>this.lookupCombinationValue(n)).filter(n=>n?.length))]),this.allFilterIdsUsedInCombination=[...new Set(this.combinatedFilterDefinition.product_filters.map(n=>n.id))],this.combinedFilterData.id=this.combinatedFilterDefinition.id,this.combinedFilterData.values=this.combinatedFilterValue?.values?.map(n=>({filters:n.filters.map(c=>({id:c.id,presetValueId:c.presetValueId?{valueId:c.presetValueId.valueId}:null,rawValue:c.rawValue?{value:c.rawValue.value}:null}))}))??[],this.initForm();let e=this.combinatedFilterValue?.values?.[0];e&&(this.selectedCombinationValue=this.lookupCombinationValue(e)),this.combinedFilterDataChanged.emit(this.combinedFilterData)}initForm(){let e={};this.combinedFilterData.values.forEach((n,r)=>{let c={};n.filters.map((f,v)=>{let V=`filter_${r}_${v}`,te=f.rawValue?f.rawValue.value:f.presetValueId?f.presetValueId.valueId.toString():"";c[V]=new we(te)}),e[`filterRow_${r}`]=new ve(c)}),this.filterRowsForm=this.formBuilder.group(e)}addFilter(){let e=this.allFilterIdsUsedInCombination.map(n=>({id:n,presetValueId:null,rawValue:null}));this.combinedFilterData.values.push({filters:e}),this.combinedFilterDataChanged.emit(this.combinedFilterData),this.initForm()}onFilterInputChange(e,n){let r=`filter_${e}_${n}`,c=this.filterRowsForm.get(`filterRow_${e}`)?.value,f=this.filterRowsForm.get(`filterRow_${e}`)?.get(`filter_${e}_${n}`)?.value;this.regex.test(f)?(this.errorFilterCombined[e]=!1,this.disableAdd=!1,this.errorFilterService.setErrorFilterCombined(!1)):(this.errorFilterCombined[e]=!0,this.disableAdd=!0,this.errorFilterService.setErrorFilterCombined(!0));let v=this.combinedFilterData.values[e];v.filters[n].rawValue={value:c[r]},this.combinedFilterDataChanged.emit(this.combinedFilterData)}removeFilterRow(e){this.combinedFilterData.values.splice(e,1),this.combinedFilterDataChanged.emit(this.combinedFilterData),this.combinedFilterData.values.length==0&&(this.errorFilterCombined[e]=!1,this.disableAdd=!1,this.errorFilterService.setErrorFilterCombined(!1)),this.initForm()}lookupCombinationValue(e){return e.filters.map(n=>n?.presetValueId?.valueId?this.filterDefinitions[n.id]?.product_filter_presets[n.presetValueId.valueId]?.value??"":n?.rawValue?.value??"").filter(n=>n?.length).join(this.combinatedFilterDefinition.delimiter)}get visibleValues(){return this.expanded?this.resolvedValues:this.resolvedValues.slice(0,o.COLLAPSED_LIMIT)}get hiddenCount(){return Math.max(0,this.resolvedValues.length-o.COLLAPSED_LIMIT)}toggleExpanded(){this.expanded=!this.expanded}};o.COLLAPSED_LIMIT=5,o.\u0275fac=function(n){return new(n||o)(S(qe),S(Qe))},o.\u0275cmp=U({type:o,selectors:[["","combinated-product-filter-row",""]],inputs:{filterDefinitions:"filterDefinitions",combinatedFilterDefinition:"combinatedFilterDefinition",combinatedFilterValue:"combinatedFilterValue",isEditMode:"isEditMode"},outputs:{combinedFilterDataChanged:"combinedFilterDataChanged"},attrs:en,decls:2,vars:1,consts:[[1,"w-full","flex","flex-col","justify-between","items-center"],[1,"wp-specs-v"],["type","button",1,"ml-1","inline-flex","items-center","rounded-full","bg-c
1hip","px-2","py-0.5","text-[12px]","font-semibold","text-ink-2","transition-colors","hover:bg-line-2"],["type","button",1,"ml-1","inline-flex","items-center","rounded-full","bg-chip","px-2","py-0.5","text-[12px]","font-semibold","text-ink-2","transition-colors","hover:bg-line-2",3,"click"],[1,"w-full","flex","justify-between","items-center","space-x-4"],[1,"w-1/2"],[1,"flex","items-center","space-x-2"],[1,"h-10","w-10","rounded-full",3,"alt","title","src"],[1,"text-sm","font-semibold","text-gray-900"],[1,"flex","justify-end"],["type","button",1,"text-white","rounded-md","bg-primary","py-2","px-4",3,"click","disabled"],[1,"w-full",3,"formGroup"],[3,"formGroupName"],["type","button",1,"text-sm","border","bg-white","border-zinc-600","py-2","px-3","rounded-md","whitespace-nowrap","w-28","my-3",3,"click"],[1,"grid","grid-cols-5","space-x-1"],[1,"flex","flex-col","space-y-1"],[1,"mt-2","text-sm","text-red-600"],[1,"text-[11px]","xs:text-sm"],[1,"font-semibold","text-primary","text-xs"],["type","text",1,"rounded-md","w-11","xs:w-14","border-gray-300",3,"input","formControlName"]],template:function(n,r){n&1&&m(0,ln,6,3)(1,un,15,8,"div",0),n&2&&p(r.isEditMode?1:0)},dependencies:[ze,je,Me,$e,Ue,Ne,Ge,Ct,j,M],encapsulation:2,changeDetection:0});let i=o;return i})();var pn=()=>[];function ei(i,o){let t;return(t=o==null?null:o.id)!==null&&t!==void 0?t:i}function ti(i,o){let t;return(t=o==null?null:o.key)!==null&&t!==void 0?t:i}function mn(i,o){if(i&1&&(a(0,"div")(1,"dt"),u(2),x(3,"translate"),s(),a(4,"dd",4),u(5),x(6,"translate"),s()()),i&2){let t=d(2);l(2),y(C(3,3,"PRODUCT_FILTERS_TABLE.PROMO_PRICE")),l(3),L("",t.product==null?null:t.product.prixPromo," ",C(6,5,"PRODUCT_FILTERS_TABLE.PROMO_UNIT"),"")}}function _n(i,o){if(i&1){let t=E();a(0,"div",6),P("filterIdValuePairsChanged",function(n){w(t);let r=d(3);return b(r.onFilterValueChanged(n))})("filterValueEmit",function(n){w(t);let r=d(3);return b(r.onFilterValueEmit(n))}),s()}if(i&2){let t,e=d().$implicit,n=d(2);h("filterValue",e)("isEditMode",n.enableEditMode)("filterDefinition",n.filterDefinitions[e.id])("categoryId",n.product==null||n.product.productCategory==null?null:n.product.productCategory.id)("requiredFilterIds",(t=n.product==null||n.product.productCategory==null?null:n.product.productCategory.requiredProductFilterIds)!==null&&t!==void 0?t:O(5,pn))}}function fn(i,o){if(i&1&&m(0,_n,1,6,"div",5),i&2){let t,e=o.$implicit,n=d(2);p(n.filterDefinitions&&(!(n.product==null||n.product.productCategory==null||n.product.productCategory.productFilterIds==null)&&n.product.productCategory.productFilterIds.includes(e.id))&&n.filterDefinitions[e.id]&&((t=e==null||e.presetValueIds==null?null:e.presetValueIds.length)!==null&&t!==void 0&&t||(t=e==null||e.rawValues==null?null:e.rawValues.length)!==null&&t!==void 0&&t)?0:-1)}}function hn(i,o){if(i&1){let t=E();a(0,"div",8),P("combinedFilterDataChanged",function(n){w(t);let r=d(3);return b(r.onCombinedFilterValueChanged(n))}),s()}if(i&2){let t=d().$implicit,e=d(2);h("combinatedFilterValue",t)("combinatedFilterDefinition",e.filterCombinationDefinitions[t.id])("filterDefinitions",e.filterDefinitions)("isEditMode",e.enableEditMode)}}function xn(i,o){if(i&1&&m(0,hn,1,4,"div",7),i&2){let t,e=o.$implicit,n=d(2);p(n.filterDefinitions&&n.filterCombinationDefinitions&&(!(n.product==null||n.product.productCategory==null||n.product.productCategory.productFilterCombinationIds==null)&&n.product.productCategory.productFilterCombinationIds.includes(e.id))&&((t=e==null||e.values==null?null:e.values.length)!==null&&t!==void 0?t:0)>0?0:-1)}}function Cn(i,o){if(i&1&&(a(0,"dl",2),m(1,mn,7,7,"div"),F(2,fn,1,1,null,null,ei),F(4,xn,1,1,null,null,ei),s()),i&2){let t=d();l(),p(t.product!=null&&t.product.prixPromo?1:-1),l(),D(t.displayedFilters),l(2),D(t.combinatedFilterValues)}}function gn(i,o){if(i&1&&_(0,"app-product-brand",9),i&2){let t=d(2);h("product",t.product)("enableEditMode",t.enableEditMode)}}function vn(i,o){if(i&1){let t=E();a(0,"div",11),P("filterIdValuePairsChanged",function(n){w(t);let r=d(3);return b(r.onFilterValueChanged(n))})("prixValue",function(n){w(t);let r=d(3);return b(r.prixValue(n))})("promoBoolean",function(n){w(t);let r=d(3);return b(r.promoBoolean(n))}),s()}if(i&2){let t=d().$implicit,e=d(2);h("prixPromo",e.prixPromo)("isEditMode",e.enableEditMode)("filterDefinition",t.value)("filterValue",e.filterValuesMap.get(t.value.id))}}function wn(i,o){if(i&1&&m(0,vn,1,4,"div",10),i&2){let t=o.$implicit,e=d(2);p(!(e.product==null||e.product.productCategory==null||e.product.productCategory.productFilterIds==null)&&e.product.productCategory.productFilterIds.includes(t.value.id)?0:-1)}}function bn(i,o){if(i&1){let t=E();a(0,"div",13),P("combinedFilterDataChanged",function(n){w(t);let r=d(3);return b(r.onCombinedFilterValueChanged(n))}),s()}if(i&2){let t=d().$implicit,e=d(2);h("combinatedFilterDefinition",t.value)("filterDefinitions",e.filterDefinitions)("isEditMode",e.enableEditMode)("combinatedFilterValue",e.combinatedFilterValuesMap.get(t.value.id))}}function Sn(i,o){if(i&1&&m(0,bn,1,4,"div",12),i&2){let t=o.$implicit,e=d(2);p(!(e.product==null||e.product.productCategory==null||e.product.productCategory.productFilterComb
1inationIds==null)&&e.product.productCategory.productFilterCombinationIds.includes(t.value.id)?0:-1)}}function Pn(i,o){if(i&1&&(a(0,"div",3),m(1,gn,1,2,"app-product-brand",9),F(2,wn,1,1,null,null,ti),x(4,"keyvalue"),F(5,Sn,1,1,null,null,ti),x(7,"keyvalue"),s()),i&2){let t=d();l(),p(t.product!=null&&t.product.store?1:-1),l(),D(C(4,1,t.filterDefinitions)),l(3),D(C(7,3,t.filterCombinationDefinitions))}}function Fn(i,o){i&1&&(a(0,"div",14)(1,"div",15),B(),a(2,"svg",16),_(3,"path",17)(4,"path",18),s()()())}var ii=(()=>{let o=class o{get displayedFilters(){return this.sortedFilterValues?this.sortedFilterValues:[]}toggleFilters(){this.expandedFilters=!this.expandedFilters}constructor(){this.filterDefinitions=null,this.filterCombinationDefinitions=null,this.enableEditMode=!1,this.sortedFilterValues=[],this.expandedFilters=!1,this.filterValuesMap=new Map,this.combinatedFilterValuesMap=new Map,this.filtersUpdated=new k,this.prixValueOnchanged=new k,this.promoBooleanOnchanged=new k,this.filterValueOnchanged=new k,this.importantFiltersMap=new Map}ngOnChanges(e){e.filterDefinitions&&!e.filterDefinitions.isFirstChange()&&this.filterValuesMap.clear(),e.filterCombinationDefinitions&&!e.filterCombinationDefinitions.isFirstChange()&&this.combinatedFilterValuesMap.clear(),e.filterValues&&this.filterDefinitions&&this.filterDefinitions&&(this.sortedFilterValues=this.filterValues?.slice().sort((n,r)=>{let c=this.filterDefinitions?.[n.id]?.valuesSelectable||!1,f=this.filterDefinitions?.[r.id]?.valuesSelectable||!1;return c&&!f?-1:!c&&f?1:0})),e.product&&this.product.filters&&(this.importantFiltersMap.clear(),this.product.filters?.data.filters&&this.product.filters.data.filters.map(n=>{this.filterValuesMap.set(n.id,{id:n.id,presetValueIds:n?.presetValueIds?.map(r=>({valueId:r.valueId})),rawValues:n?.rawValues?.map(r=>({value:r.value}))})}),this.product.filters?.data.combinations&&this.product.filters.data.combinations.forEach(n=>{this.combinatedFilterValuesMap.set(n.id,{id:n.id,values:n.values.map(r=>({filters:r.filters.map(c=>({id:c.id,presetValueId:c.presetValueId?{valueId:c.presetValueId.valueId}:null,rawValue:c.rawValue?{value:c.rawValue.value}:null}))}))})}))}onFilterValueChanged(e){this.filterValuesMap.set(e.id,e),this.filtersUpdated.emit({filters:this.filterValuesMap,combinations:this.combinatedFilterValuesMap})}onFilterValueEmit(e){e?.filterId&&this.importantFiltersMap.set(e.filterId,e),this.filterValueOnchanged.emit(Array.from(this.importantFiltersMap.values()))}prixValue(e){this.prixValueOnchanged.emit(e)}promoBoolean(e){this.promoBooleanOnchanged.emit(e)}onCombinedFilterValueChanged(e){this.combinatedFilterValuesMap.set(e.id,e),this.filtersUpdated.emit({filters:this.filterValuesMap,combinations:this.combinatedFilterValuesMap})}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=U({type:o,selectors:[["app-product-filters-table"]],inputs:{product:"product",filterDefinitions:"filterDefinitions",filterCombinationDefinitions:"filterCombinationDefinitions",enableEditMode:"enableEditMode",prixPromo:"prixPromo",filterValues:"filterValues",combinatedFilterValues:"combinatedFilterValues"},outputs:{filtersUpdated:"filtersUpdated",prixValueOnchanged:"prixValueOnchanged",promoBooleanOnchanged:"promoBooleanOnchanged",filterValueOnchanged:"filterValueOnchanged"},features:[J],decls:5,vars:1,consts:[["loading",""],[1,"mt-2"],[1,"wp-specs"],[1,"grid","grid-cols-1","md:grid-cols-2","gap-4"],[1,"!text-brand"],["product-filter-row","",3,"filterValue","isEditMode","filterDefinition","categoryId","requiredFilterIds"],["product-filter-row","",3,"filterIdValuePairsChanged","filterValueEmit","filterValue","isEditMode","filterDefinition","categoryId","requiredFilterIds"],["combinated-product-filter-row","",3,"combinatedFilterValue","combinatedFilterDefinition","filterDefinitions","isEditMode"],["combinated-product-filter-row","",3,"combinedFilterDataChanged","combinatedFilterValue","combinatedFilterDefinition","filterDefinitions","isEditMode"],[3,"product","enableEditMode"],["product-filter-row","",1,"relative","flex","flex-col","items-center","space-x-3","rounded-lg","border","border-gray-300","bg-white","px-6","py-5","shadow-sm","focus-within:ring-2","focus-within:ring-primary","focus-within:ring-offset-2",3,"prixPromo","isEditMode","filterDefinition","filterValue"],["product-filter-row","",1,"relative","flex","flex-col","items-center","space-x-3","rounded-lg","border","border-gray-300","bg-white","px-6","py-5","shadow-sm","focus-within:ring-2","focus-within:ring-primary","focus-within:ring-offset-2",3,"filterIdValuePairsChanged","prixValue","promoBoolean","prixPromo","isEditMode","filterDefinition","filterValue"],["combinated-product-filter-row","",1,"relative","flex","items-center","space-x-3","rounded-lg","border","border-gray-300","bg-white","p-3","shadow-sm","focus-within:ring-2","focus-within:ring-primary","focus-within:ring-offset-2",3,"combinatedFilterDefinition","filterDefinitions","isEditMode","combinatedFilterValue"],["combinated-product-filter-row","",1,"relative","flex","items-center","space-x-3","rounded-lg","border","border-gray-300","bg-white","p-3","shadow-sm","focus-within:ring-2","focus-within:ring-primary","focus-within:ring-offset-2",3,"combinedFilterDataChanged","combinatedFilterDefinition","filterDefinitions","isEditMode","combinatedFilterValue"],[1,"text-center"],["role","status"],["viewBox","0 0 100 101","fill","none","xmlns","http://www.w3.org/2000/svg",1,"inline","w-8","h-8","mr-2","text-gray-200","animate-spin","fill-primary"],["d","M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z","fill","currentColor"],["d","M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.
11071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z","fill","currentFill"]],template:function(n,r){n&1&&(a(0,"div",1),m(1,Cn,6,1,"dl",2)(2,Pn,8,5,"div",3)(3,Fn,5,0,"ng-template",null,0,Q),s()),n&2&&(l(),p(r.enableEditMode?2:1))},dependencies:[Mt,Jt,Xt,Oe,j,M],encapsulation:2});let i=o;return i})();var Dn=i=>["/entreprises",i],En=(i,o)=>o._id,yn=(i,o)=>o.category._id;function Tn(i,o){if(i&1&&(a(0,"p",2)(1,"span",3),u(2),s(),a(3,"span",4),u(4,"\xB7"),s(),u(5),s()),i&2){let t=o.$implicit,e=d(2);l(2),y(t.name),l(3),g(" ",e.valuesOf(t).join(" \xB7 ")," ")}}function In(i,o){if(i&1&&(a(0,"a",9),u(1),s()),i&2){let t=d().$implicit;h("routerLink",o),l(),g(" ",t.category.name," ")}}function Vn(i,o){if(i&1&&(a(0,"span",10),u(1),s()),i&2){let t=d().$implicit;l(),g(" ",t.category.name," ")}}function kn(i,o){if(i&1&&m(0,In,2,2,"a",9)(1,Vn,2,1,"span",10),i&2){let t,e=o.$implicit,n=d(3);p((t=n.linkFor(e))?0:1,t)}}function Rn(i,o){if(i&1&&(a(0,"a",7),u(1),s()),i&2){let t=d(3);h("routerLink",T(2,Dn,t.storeSlug)),l(),g(" +",t.otherOverflow," ")}}function Ln(i,o){if(i&1&&(a(0,"span",8),u(1),s()),i&2){let t=d(3);l(),g("+",t.otherOverflow,"")}}function On(i,o){if(i&1&&(a(0,"div")(1,"p",5),u(2),x(3,"translate"),s(),a(4,"div",6),F(5,kn,2,1,null,null,yn),m(7,Rn,2,4,"a",7)(8,Ln,2,1,"span",8),s()()),i&2){let t=d(2);l(2),g(" ",C(3,2,"PRODUCT_DETAIL_PAGE.STORE_EXPERTISES.ALSO")," "),l(3),D(t.others),l(2),p(t.otherOverflow&&t.storeSlug?7:t.otherOverflow?8:-1)}}function An(i,o){if(i&1&&(a(0,"div",0)(1,"p",1),u(2),x(3,"translate"),s(),F(4,Tn,6,2,"p",2,En),m(6,On,9,4,"div"),s()),i&2){let t=d();l(2),g(" ",C(3,2,"PRODUCT_DETAIL_PAGE.STORE_EXPERTISES.LABEL")," "),l(2),D(t.sameCategoryFilters),l(2),p(t.others.length?6:-1)}}var Bn=3,ni=(()=>{let o=class o{constructor(){this.storeSlug=null,this.sameCategory=null,this.others=[],this.otherOverflow=0,this.destroy$=new it,this.expertisesService=ye(At),this.currentWebsiteFacade=ye(wt),this.cdr=ye(_e)}ngOnChanges(e){e.productId&&(this.reset(),this.load())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get hasContent(){return!!this.sameCategoryFilters.length||!!this.others.length}linkFor(e){let n=e?.categoryGroup?.slug?.trim(),r=e?.category?.slug?.trim();return n&&r?["/produits",n,r]:null}get sameCategoryFilters(){return(this.sameCategory?.category?.filters??[]).filter(e=>(e.values??[]).length>0)}valuesOf(e){return(e.values??[]).map(n=>n?.name).filter(Boolean)}reset(){this.sameCategory=null,this.others=[],this.otherOverflow=0}load(){this.productId&&this.currentWebsiteFacade.website$.pipe(oe(e=>String(e?.slug??"").trim()||I.websiteSlug||""),De(e=>!!e),re(1),le(e=>this.expertisesService.getForProduct(this.productId,e)),K(()=>A(null)),ot(this.destroy$)).subscribe(e=>{let n=e?.data;this.sameCategory=n?.sameCategory??null;let r=(n?.otherCategories??[]).filter(c=>!!c?.category?.name);this.others=r.slice(0,Bn),this.otherOverflow=Math.max(0,r.length-this.others.length),this.cdr.markForCheck()})}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=U({type:o,selectors:[["app-product-store-expertises"]],inputs:{productId:"productId",storeSlug:"storeSlug"},features:[J],decls:1,vars:1,consts:[[1,"wp-pd-co-sf"],[1,"wp-pd-co-lb"],[1,"wp-pd-co-sfl"],[1,"font-medium","text-ink"],[1,"mx-1.5","text-gray-400"],[1,"wp-pd-co-al"],[1,"wp-pd-co-chips"],[1,"rounded-full","border","border-line","px-2.5","py-1","text-[11.5px]","font-semibold","text-ink-2","hover:border-brand","hover:text-brand",3,"routerLink"],[1,"rounded-full","px-1.5","py-1","text-[11.5px]","text-gray-500"],[1,"wp-pd-co-chip","hover:bg-line","hover:text-brand",3,"routerLink"],[1,"wp-pd-co-chip"]],template:function(n,r){n&1&&m(0,An,7,4,"div",0),n&2&&p(r.hasContent?0:-1)},dependencies:[ee,j,M],encapsulation:2,changeDetection:0});let i=o;return i})();var jn=["descriptionTextRef"],Nn=["mobileStrip"],Gn=["similarSwiper"],qn=()=>[import("./chunk-5WVNQGUI.js").then(i=>i.RequestDialogShareComponent)],zn=()=>[import("./chunk-LSYGQ6VH.js").then(i=>i.AuthDialogComponent)],Hn=()=>[de,ee,M,import("./chunk-2HSLULZW.js").then(i=>i.DistributorsListComponent)],Wn=()=>[de,M,import("./chunk-Z7ECOMZI.js").then(i=>i.ProductCardComponent)],Qn=()=>[de,ee,M,import("./chunk-Z7ECOMZI.js").then(i=>i.ProductCardComponent)],Zn=()=>[import("./chunk-XO24BTFZ.js").then(i=>i.ElasticProjectListComponent)],Kn=i=>[i],Jn=()=>[],Z=i=>["/entreprises",i],Yn=i=>({count:i}),Xn=i=>({name:i}),eo=i=>["/produits",i],tt=()=>[1,2,3,4],et=i=>({storeName:i}),to=()=>[1,2,3],io=()=>[1,2,3,4,5,6],oi=(i,o)=>o.url,no=(i,o)=>o.id;function oo(i,o){if(i&1&&_(0,"img",37),i&2){let t=d().$implicit;h("ngSrc",t.url)("alt",t.alt)}}function ro(i,o){if(i&1&&_(0,"img",38),i&2){let t=d().$implicit;h("ngSrc",t.url)("alt",t.alt)}}function lo(i,o){if(i&1){let t=E();a(0,"a",40),x(1,"translate"),P("click",function(){w(t);let n=d(4);return b(n.onProductVideoOpened())}),a(2,"span",41),B(),a(3,"svg",42),_(4,"path",43),s()()()}if(i&2){let t=d().$implicit;h("href",t.videoUrl,z),H("aria-label",C(1,2,"MEDIA_GALLERY.ARIA.OPEN_VIDEO"))}}function ao(i,o){if(i&1&&(a(0,"div",30),m(1,oo,1,2,"img",37)(2,ro,1,2,"img",38)(3,lo,5,4,"a",39),s()),i&2){let t=o.$implicit,e=o.$index;l(),p(e===0?1:2),l(2),p(t.isVideo&&t.videoUrl?3:-1)}}function so(i,o){if(i&1&&_(0,"i",47),i&2){let t=o.$index,e=d(4);
1dt(t===e.mobileGalleryIndex?"h-[6px] w-4 rounded-full bg-white":"h-[6px] w-[6px] rounded-full bg-white/55")}}function co(i,o){if(i&1&&(a(0,"div",44),F(1,so,1,2,"i",45,oi),s(),a(3,"span",46),u(4),s()),i&2){let t=d(3);l(),D(t.mobileGalleryItems),l(3),L(" ",t.mobileGalleryIndex+1," / ",t.mobileGalleryItems.length," ")}}function uo(i,o){if(i&1){let t=E();a(0,"div",4)(1,"div",29,1),F(3,ao,4,2,"div",30,oi),s(),a(5,"div",31)(6,"button",32),x(7,"translate"),P("click",function(){w(t);let n=d(2);return b(n.goBack())}),B(),a(8,"svg",33),_(9,"path",34),s()(),Te(),_(10,"span",35)(11,"app-favorite",36),s(),m(12,co,5,2),s()}if(i&2){let t=d(2);l(3),D(t.mobileGalleryItems),l(3),H("aria-label",C(7,3,"PRODUCT_DETAIL_PAGE.BACK")),l(5),h("productId",t.product.id),l(),p(t.mobileGalleryItems.length>1?12:-1)}}function po(i,o){if(i&1&&(a(0,"a",52),u(1),x(2,"translate"),s()),i&2){let t=d(3);h("routerLink",T(5,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),L(" ",C(2,3,"PRODUCT_DETAIL_PAGE.BY_PREFIX")," ",t.product==null||t.product.store==null?null:t.product.store.name," ")}}function mo(i,o){if(i&1){let t=E();a(0,"button",55),P("click",function(n){w(t);let r=d(3);return b(r.onConnect(n))}),_(1,"app-connect-icon"),u(2),x(3,"translate"),s()}i&2&&(l(2),g(" ",C(3,1,"STORES.LIST.TABLE.CONNECT")," "))}function _o(i,o){if(i&1&&(a(0,"div",48)(1,"div",49)(2,"span",50)(3,"b",51),u(4),s(),m(5,po,3,7,"a",52),s(),a(6,"span",53),m(7,mo,4,3,"button",54),s()()()),i&2){let t=d(2);Y("is-on",t.mobileDockVisible),H("aria-hidden",!t.mobileDockVisible)("inert",t.mobileDockVisible?null:""),l(4),y(t.product==null?null:t.product.name),l(),p(!(t.product==null||t.product.store==null)&&t.product.store.name?5:-1),l(2),p(t.hasLeadsFeature?7:-1)}}function fo(i,o){if(i&1&&(a(0,"span",56),u(1),s()),i&2){let t=o.$implicit;l(),y(t)}}function ho(i,o){if(i&1&&(a(0,"div",12),F(1,fo,2,1,"span",56,ct),s()),i&2){let t=d(2);l(),D(t.categoryChips)}}function xo(i,o){if(i&1){let t=E();a(0,"button",60),P("click",function(){w(t);let n=d(3);return b(n.isDescriptionExpanded=!n.isDescriptionExpanded)}),a(1,"span"),u(2),x(3,"translate"),s(),B(),a(4,"svg",61),_(5,"path",62),s()()}if(i&2){let t=d(3);l(2),g(" ",C(3,3,t.isDescriptionExpanded?"PRODUCT_DETAIL_PAGE.SHOW_LESS":"PRODUCT_DETAIL_PAGE.SHOW_MORE")," "),l(2),Y("rotate-180",t.isDescriptionExpanded)}}function Co(i,o){if(i&1&&(a(0,"section",13)(1,"h2",57),u(2),x(3,"translate"),s(),_(4,"p",58,2),m(6,xo,6,5,"button",59),s()),i&2){let t=d(2);l(2),g(" ",C(3,5,"PRODUCT_DETAIL_PAGE.DESCRIPTION")," "),l(2),Y("multiline-ellipsis",!t.isDescriptionExpanded),h("innerText",t.product==null?null:t.product.descriptionText),l(2),p(t.hasOverflow?6:-1)}}function go(i,o){if(i&1){let t=E();a(0,"section",63)(1,"h2",57),u(2),x(3,"translate"),s(),a(4,"app-product-filters-table",64),P("filterValueOnchanged",function(n){w(t);let r=d(3);return b(r.onFilterValueEmit(n))}),s()()}if(i&2){d();let t=X(0),e=X(2);d();let n=X(10),r=d();l(2),g(" ",C(3,6,"PRODUCT_DETAIL_PAGE.TECHNICAL_CHARACTERISTICS")," "),l(2),h("product",r.product)("filterCombinationDefinitions",e)("filterDefinitions",t)("filterValues",r.visibleFilterValues)("combinatedFilterValues",n.data==null?null:n.data.combinations)}}function vo(i,o){if(i&1&&(ue(0),x(1,"async"),ue(2),x(3,"async"),m(4,go,5,8,"section",63)),i&2){d();let t=X(10),e=d(),n=pe(C(1,1,e.productFilters$));l(2);let r=pe(C(3,4,e.productFilterCombinations$));l(2),p(n&&(!(t.data==null||t.data.combinations==null)&&t.data.combinations.length&&r||!(!(t.data==null||t.data.combinations==null)&&t.data.combinations.length))?4:-1)}}function wo(i,o){if(i&1){let t=E();a(0,"button",68),P("click",function(){let n=w(t).$implicit,r=d(3);return b(r.onDownload(n))}),a(1,"div",69),_(2,"app-pdf-thumbnail",70),s(),a(3,"b",71),u(4),s(),a(5,"span",72),u(6),s()()}if(i&2){let t=o.$implicit,e=d(3);l(2),h("url",t.url)("name",e.pdfName(t)),l(2),y(e.pdfName(t)),l(2),y(e.pdfMeta(t))}}function bo(i,o){if(i&1&&(a(0,"section",14)(1,"h2",57),u(2),x(3,"translate"),a(4,"span",65),u(5),x(6,"translate"),s()(),a(7,"div",66),F(8,wo,7,4,"button",67,Ce().trackByPdfUrl,!0),s()()),i&2){let t=d(2);l(2),g(" ",C(3,2,"PRODUCT_DETAIL_PAGE.SPEC_SHEET")," "),l(3),g(" ",me(6,4,"PRODUCT_DETAIL_PAGE.DOCUMENTS_COUNT",T(7,Yn,t.product.pdfs.length))," "),l(3),D(t.product.pdfs)}}function So(i,o){if(i&1&&(a(0,"p",17),u(1),s()),i&2){let t=d(2);l(),y(t.categoryTrail)}}function Po(i,o){if(i&1&&_(0,"img",73),i&2){let t=d(3);h("src",t.product.store==null||t.product.store.logo==null?null:t.product.store.logo.url,z)}}function Fo(i,o){i&1&&(a(0,"em",74),x(1,"translate"),B(),a(2,"svg",75),_(3,"path",76),s()()),i&2&&h("title",C(1,1,"PRODUCT_DETAIL_PAGE.VERIFIED_MAKER"))}function Do(i,o){if(i&1&&(a(0,"a",22),m(1,Po,1,1,"img",73),a(2,"span"),u(3),x(4,"translate"),a(5,"b"),u(6),s()(),m(7,Fo,4,3,"em",74),s()),i&2){let t=d(2);h("routerLink",T(7,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),p(!(t.product==null||t.product.store==null||t.product.store.logo==null)&&t.product.store.logo.url?1:-1),l(2),g(" ",C(4,5,"PRODUCT_DETAIL_PAGE.BY_PREFIX")," "),l(3),y(t.product==null||t.product.store==null?null:t.product.store.name),l(),p(!(t.product==null||t.product.store==null)&&t.product.store.isPaid?7:-1)}}function Eo(i,o){if(i&1&&_(0,"app-price-block",23),i&2){let t=d(2);h("price",t.price)}}function yo(i,o){if(i&1&&_(0,"img",73),i&2){let t=d(3);h("src",t.product.store==null||t.product.store.logo==null?null:t.product.store.logo.url,z)}}function To(i,o){i&1&&(u(0),x(1,"translate")),i&2&&g(" ",C(1,1,"PRODUCT_DETAIL_PAGE.VERIFIED_MAKER")," ")}function Io(i,o){i&1&&u(0," \xB7 ")}function Vo(i,o){if(i&1){let t=E();a(0,"div",24)(1,"p",77),u(2),x(3,"translate"),s(),a(4,"a",78)(5,"span",79),m(6,yo,1,1,"img",73),s(),a(7,"span",80)(8,"b"),u(9),s(),a(10,"i"),m(11,To,2,3)(12,Io,1,0),u(13),s()(),B(),a(14,"svg",81),_(15,"path",82),s()(),Te(),a(16,"button",83),P("
1click",function(n){w(t);let r=d(2);return b(r.onConnect(n))}),_(17,"app-connect-icon"),u(18),x(19,"translate"),s(),a(20,"p",84),u(21),x(22,"translate"),s()()}if(i&2){let t,e=d(2);l(2),y(C(3,9,"PRODUCTS.CONTACT.INTRO")),l(2),h("routerLink",T(16,Z,e.product==null||e.product.store==null?null:e.product.store.slug)),l(2),p(!(e.product==null||e.product.store==null||e.product.store.logo==null)&&e.product.store.logo.url?6:-1),l(3),y(e.product==null||e.product.store==null?null:e.product.store.name),l(2),p(!(e.product==null||e.product.store==null)&&e.product.store.isPaid?11:-1),l(),p(!(e.product==null||e.product.store==null)&&e.product.store.isPaid&&e.storeLocation?12:-1),l(),g(" ",e.storeLocation," "),l(5),g(" ",C(19,11,"STORES.LIST.TABLE.CONNECT")," "),l(3),g(" ",me(22,13,"PRODUCTS.CONTACT.NOTE",T(18,Xn,(t=e.product==null||e.product.store==null?null:e.product.store.name)!==null&&t!==void 0?t:""))," ")}}function ko(i,o){if(i&1&&(_(0,"img",89),x(1,"translate")),i&2){let t=d(3);h("ngSrc",t.product.store==null||t.product.store.logo==null?null:t.product.store.logo.url)("alt",(t.product==null||t.product.store==null?null:t.product.store.name)||C(1,2,"PRODUCT_DETAIL_PAGE.MAKER"))}}function Ro(i,o){if(i&1&&(a(0,"span",90),u(1),s()),i&2){let t=d(3);l(),y(t.storeInitials)}}function Lo(i,o){if(i&1&&(a(0,"span",93),B(),a(1,"svg",101),_(2,"path",102)(3,"circle",103),s(),u(4),s()),i&2){let t=d(3);l(4),g(" ",t.storeLocation," ")}}function Oo(i,o){if(i&1&&(a(0,"span")(1,"b"),u(2),s(),u(3),x(4,"translate"),s()),i&2){let t=d(4);l(2),y(t.storeCounts.productsCount),l(),g(" ",C(4,2,"PRODUCT_DETAIL_PAGE.STAT_PRODUCTS")," ")}}function Ao(i,o){if(i&1&&(a(0,"span")(1,"b"),u(2),s(),u(3),x(4,"translate"),s()),i&2){let t=d(4);l(2),y(t.storeCounts.projectsCount),l(),g(" ",C(4,2,"PRODUCT_DETAIL_PAGE.STAT_REALIZATIONS")," ")}}function Bo(i,o){if(i&1&&(a(0,"span")(1,"b"),u(2),s(),u(3),x(4,"translate"),s()),i&2){let t=d(4);l(2),y(t.storeCounts.videosCount),l(),g(" ",C(4,2,"PRODUCT_DETAIL_PAGE.STAT_VIDEOS")," ")}}function Mo(i,o){if(i&1&&(a(0,"span")(1,"b"),u(2),s(),u(3),x(4,"translate"),s()),i&2){let t=d(4);l(2),y(t.storeCounts.catalogsCount),l(),g(" ",C(4,2,"PRODUCT_DETAIL_PAGE.STAT_DOCS")," ")}}function $o(i,o){if(i&1&&(a(0,"div",94),m(1,Oo,5,4,"span")(2,Ao,5,4,"span")(3,Bo,5,4,"span")(4,Mo,5,4,"span"),s()),i&2){let t=d(3);l(),p(t.storeCounts.productsCount?1:-1),l(),p(t.storeCounts.projectsCount?2:-1),l(),p(t.storeCounts.videosCount?3:-1),l(),p(t.storeCounts.catalogsCount?4:-1)}}function Uo(i,o){if(i&1&&_(0,"app-product-store-expertises",95),i&2){let t,e=d(3);h("productId",e.product.id)("storeSlug",(t=e.product==null||e.product.store==null?null:e.product.store.slug)!==null&&t!==void 0?t:null)}}function jo(i,o){if(i&1&&_(0,"img",106),i&2){let t=d().$implicit;h("ngSrc",t.images[0].url)("alt",t.name)}}function No(i,o){if(i&1&&(a(0,"a",104),m(1,jo,1,2,"img",106),s()),i&2){let t=o.$implicit;h("routerLink",T(3,eo,t.slug+".html"))("title",t.name),l(),p(!(t.images==null||t.images[0]==null)&&t.images[0].url?1:-1)}}function Go(i,o){if(i&1&&(a(0,"a",105),u(1),s()),i&2){let t=d(4);h("routerLink",T(2,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),g("+",t.storeMoreCount,"")}}function qo(i,o){if(i&1&&(a(0,"div",96),F(1,No,2,5,"a",104,no),m(3,Go,2,4,"a",105),s()),i&2){let t=d(3);l(),D(t.storeMiniProducts.slice(0,5)),l(2),p(t.storeMoreCount>0?3:-1)}}function zo(i,o){if(i&1&&(a(0,"h2",85),u(1),x(2,"translate"),s(),a(3,"div",86)(4,"a",87)(5,"span",88),m(6,ko,2,4,"img",89)(7,Ro,2,1,"span",90),s(),a(8,"span",91)(9,"span",92),u(10),s(),m(11,Lo,5,1,"span",93),s()(),m(12,$o,5,4,"div",94)(13,Uo,1,2,"app-product-store-expertises",95)(14,qo,4,1,"div",96),a(15,"a",97),u(16),x(17,"translate"),B(),a(18,"svg",98),_(19,"path",99)(20,"path",100),s()()()),i&2){let t=d(2);l(),g(" ",C(2,10,"PRODUCT_DETAIL_PAGE.MAKER_SECTION")," "),l(3),h("routerLink",T(14,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(2),p(!(t.product==null||t.product.store==null||t.product.store.logo==null)&&t.product.store.logo.url?6:7),l(4),y(t.product==null||t.product.store==null?null:t.product.store.name),l(),p(t.storeLocation?11:-1),l(),p(t.storeCounts.productsCount||t.storeCounts.projectsCount||t.storeCounts.catalogsCount||t.storeCounts.videosCount?12:-1),l(),p(t.hasStoreExpertisesFeature&&(t.product!=null&&t.product.id)?13:-1),l(),p(t.storeMiniProducts.length?14:-1),l(),h("routerLink",T(16,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),g(" ",C(17,12,"PRODUCT_DETAIL_PAGE.SEE_FULL_PROFILE")," ")}}function Ho(i,o){if(i&1&&(a(0,"div",107)(1,"h3",108),u(2),x(3,"translate"),s(),a(4,"a",109),u(5),x(6,"translate"),s()(),a(7,"div",110),_(8,"app-distributors-list",111),s()),i&2){let t=d(),e=d(3);l(2),y(C(3,4,"PRODUCT_DETAIL_PAGE.DISTRIBUTORS")),l(2),h("routerLink",T(8,Z,e.product==null||e.product.store==null?null:e.product.store.slug)),l(),g(" ",C(6,6,"PRODUCT_DETAIL_PAGE.SEE_MORE")," "),l(3),h("distributors",t)}}function Wo(i,o){i&1&&m(0,Ho,9,10),i&2&&p(o.length>0?0:-1)}function Qo(i,o){if(i&1&&(m(0,Wo,1,1),x(1,"async")),i&2){let t,e=d(2);p((t=C(1,1,e.distributors$))?0:-1,t)}}function Zo(i,o){i&1&&_(0,"div",112)}function Ko(i,o){if(i&1&&_(0,"app-product-card",116),i&2){let t=o.$implicit;h("displayStoreLogo",!0)("product",t)}}function Jo(i,o){if(i&1&&(a(0,"div",113)(1,"h3",114),u(2),x(3,"translate"),s()(),a(4,"div",115),F(5,Ko,1,2,"app-product-card",116,Ce().trackByProduct,!0),s()),i&2){let t=d();l(2),g(" ",C(3,1,"PRODUCT_DETAIL_PAGE.RELATED_COMPLEMENTARY")," "),l(3),D(t)}}function Yo(i,o){i&1&&m(0,Jo,7,3),i&2&&p(o.length>0?0:-1)}function Xo(i,o){if(i&1&&(m(0,Yo,1,1),x(1,"async")),i&2){let t,e=d(2);p((t=C(1,1,e.complementProducts$))?0:-1,t)}}function er(i,o){i&1&&_(0,"app-product-card-skeleton")}function tr(i,o){i&1&&(a(0,"div",117),_(1,"div",118),a(2,"div",119),F(3,er,1,0,"app-product-card-skeleton",null,R),s()()),i&2&&(l(3),D(O(0,tt)))}function ir(i,o){if(i&1){let t=E();a(0,"app-elastic-project-list",130),P("totalCountChanged",function(n){w(t);let r=d(3);return b(r.onStoreProjectsTotal(n))}),s()}if(i&2){let t=d(3);h("storeId",t.product.store.id)("storeProjectScope","owner-or-actor")("isStorePage",!0)("projectsPerPage",4)("disablePagination",!0)("displayStoreLogos",!0)}}function nr(i,o){i&1&&_(0,"app-project-card-skeleton")}function or(i,o){i&1&&(a(0,"div",131),F(1,nr,1,0,"app-project-card-skeleton",null,R),s()),i&2&&(l(),D(O(0,tt)))}function rr(i,o){if(i&1&&(a(0,"section",120)(1,"div",121)(2,"div",122)(3,"div")(4,"h2",123),u(5),x(6,"translate"),s(),a(7,"p",124),u(8),x(9,"translate"),s()(),a(10,"a",125),u(11),x(12,"translate"),B(),a(13,"svg",126),_(14,"path",99)(15,"path",100),s()()(),Te(),a(16,"div",127)(17,"h2",128),u(18),x(19,"translate"),s(),a(20,"a",129),u(21),x(22,"translate"),s()(),a(23,"div",110),m(24,ir,1,6)(25,or,3,1),ae(26,24,Zn,null,25),xe(0,-1),s()()()),i&2){let t=d(2);Y("hidden",t.storeProjectsLoaded&&!t.hasStoreProjects),l(5),g(" ",me(6,9,"PRODUCT_DETAIL_PAGE.REALIZATIONS_OF",T(22,et,t.product==null||t.product.store==null?null:t.product.store.name))," "),l(3),g(" ",me(9,12,"PRODUCT_DETAIL_PAGE.REALIZATIONS_DESC",T(24,et,t.product==null||t.product.store==null?null:t.product.store.name))," "),l(2),h("routerLink",T(26,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),g(" ",C(12,15,"PRODUCT_DETAIL_PAGE.ALL_REALIZATIONS")," "),l(7),g(" ",me(19,17,"PRODUCT_DETAIL_PAGE.REALIZATIONS_OF",T(28,et,t.product==null||t.product.store==null?null:t.product.store.name))," "),l(2),h("routerLink",T(30,Z,t.product==null||t.product.store==null?null:t.product.store.slug)),l(),y(C(22,20,"PRODUCT_DETAIL_PAGE.SEE_ALL_F"))}}function lr(i,o){if(i&1&&(a(0,"a",129),u(1),x(2,"translate"),s()),i&2){let t=d(5);h("routerLink",t.categoryRouterLink),l(),y(C(2,2,"PRODUCT_DETAIL_PAGE.SEE_ALL_M"))}}function ar(i,o){if(i&1&&_(0,"app-product-card",116),i&2){let t=o.$implicit;h("displayStoreLogo",!0)("product",t)}}function sr(i,o){if(i&1){let t=E();a(0,"button",139),x(1,"translate"),P("click",function(){w(t);let n=d(5);return b(n.onSimilarPrev())}),B(),a(2,"svg",140),_(3,"path",141),s()()}i&2&&H("aria-label",C(1,1,"PRODUCT_DETAIL_PAGE.SIMILAR_PREVIOUS"))}function dr(i,o){if(i&1&&(a(0,"swiper-slide")(1,"div",142),_(2,"app-product-card",116),s()()),i&2){let t=o.$implicit;l(2),h("displayStoreLogo",!0)("product",t)}}function cr(i,o){if(i&1){let t=E();a(0,"button",143),x(1,"translate"),P("click",function(){w(t);let n=d(5);return b(n.onSimilarNext())}),B(),a(2,"svg",140),_(3,"path",144),s()()}i&2&&H("aria-label",C(1,1,"PRODUCT_DETAIL_PAGE.SIMILAR_NEXT"))}function ur(i,o){if(i&1&&(a(0,"div",132)(1,"h2",133),u(2),x(3,"translate"),s()(),a(4,"div",127)(5,"h2",128),u(6),x(7,"translate"),s(),m(8,lr,3,4,"a",129),s(),a(9,"div",134),F(10,ar,1,2,"app-product-card",116,Ce().trackByProduct,!0),s(),a(12,"div",135),m(13,sr,4,3,"button",136),a(14,"swiper-container",137,3),F(16,dr,3,2,"swiper-slide",null,Ce().trackByProduct,!0),s(),m(18,cr,4,3,"button",138),s()),i&2){let t=d(),e=d(3);l(2),g(" ",C(3,6,"PRODUCT_DETAIL_PAGE.RELATED_SIMILAR")," "),l(4),y(C(7,8,"PRODUCT_DETAIL_PAGE.RELATED_SIMILAR")),l(2),p(e.categoryRouterLink?8:-1),l(2),D(t),l(3),p(t.length>4?13:-1),l(),h("breakpoints",e.similarBreakpoints),l(2),D(t),l(2),p(t.length>4?18:-1)}}function pr(i,o){i&1&&m(0,ur,19,10),i&2&&p(o.length>0?0:-1)}function mr(i,o){if(i&1&&(m(0,pr,1,1),x(1,"async")),i&2){let t,e=d(2);p((t=C(1,1,e.similarProducts$))?0:-1,t)}}function _r(i,o){i&1&&_(0,"app-product-card-skeleton")}function fr(i,o){i&1&&(a(0,"div",145),_(1,"div",146),a(2,"div",147),F(3,_r,1,0,"app-product-card-skeleton",null,R),s()()),i&2&&(l(3),D(O(0,tt)))}function hr(i,o){if(i&1){let t=E();m(0,uo,13,5,"div",4)(1,_o,8,7,"div",5),a(2,"div",6)(3,"div",7)(4,"div",8),_(5,"div",9),a(6,"div",10)(7,"app-media-gallery",11),P("videoOpened",function(){w(t);let n=d();return b(n.onProductVideoOpened())}),s()(),m(8,ho,3,0,"div",12)(9,Co,7,7,"section",13),ue(10),m(11,vo,5,7)(12,bo,10,9,"section",14),s(),a(13,"aside",15)(14,"div",16),m(15,So,2,1,"p",17),a(16,"div",18)(17,"h1",19),u(18),s(),a(19,"div",20),_(20,"app-favorite",21),s()(),m(21,Do,8,9,"a",22),s(),m(22,Eo,1,1,"app-price-block",23)(23,Vo,23,20,"div",24),a(24,"div",25),se(25,26),s()()(),m(26,zo,21,18,"ng-template",null,0,Q)(28,Qo,2,3)(29,Zo,1,0),ae(30,28,Hn,null,29),xe(0,-1),m(32,Xo,2,3)(33,tr,5,1),ae(34,32,Wn,null,33),xe(0,-1),s(),m(36,rr,28,32,"section",27),a(37,"div",28),m(38,mr,2,3)(39,fr,5,1),ae(40,38,Qn,null,39),xe(0,-1),s()}if(i&2){let t=W(27),e=d();p(e.mobileGalleryItems.length?0:-1),l(),p(e.showMobileCta&&(e.product!=null&&e.product.store)?1:-1),l(6),h("blendOnSoft",!0)("images",e.product.images)("videos",e.product!=null&&e.product.video?T(18,Kn,e.product.video):O(20,Jn)),l(),p(e.categoryChips.length?8:-1),l(),p(e.product!=null&&e.product.descriptionText?9:-1),l();let n=pe(e.product==null?null:e.product.filters);l(),p(n&&e.characteristicCount>0?11:-1),l(),p((e.product.pdfs==null?null:e.product.pdfs.length)>0?12:-1),l(3),p(e.categoryTrail?15:-1),l(3),y(e.product==null?null:e.product.name),l(2),h("productId",e.product.id),l(),p(!(e.product==null||e.product.store==null)&&e.product.store.name?21:-1),l(),p(e.price?22:-1),l(),p(e.hasLeadsFeature&&!e.isOwnStore?23:-1),l(2),h("ngTemplateOutlet",t),l(11),p(!(e.product==null||e.product.store==null)&&e.product.store.id?36:-1)}}function xr(i,o){i&1&&(a(0,"div",184),_(1,"div",216)(2,"div",217)(3,"div",218),s())}function Cr(i,o){i&1&&_(0,"div",213)}function gr(i,o){i&1&&(a(0,"div",148),_(1,"div",149),a(2,"div",31),_(3,"div",150)(4,"span",35)(5,"div",150),s()(),a(6,"div",151)(7,"div",152)(8,"div",153)(9,"div",10),_(10,"app-media-gallery",154),s(),a(11,"div",155),_(12,"div",156)(13,"div",157),s(),a(14,"div",158)(15,"div",159)(16,"div",160),_(17,"div",161),a(18,"div",162),_(19,"div",163)(20,"div",164),s()(),a(21,"div",165),_(22,"div",166)(23,"div",167),s()()(),a(24,"div",168),_(25,"div",169),a(26,"div",170),_(27,"div",171)(28,"div",172)(29,"div",173)(30,"div",174)(31,"div",175),s(),_(32,"div",176),s(),a(33,"div",168),_(34,"div",177),a(35,"div",178),_(36,"div",179)(37,"div",179),s(),_(38,"div",180),s(),a(39,"div",181),_(40,"div",182),a(41,"div",183),F(42,xr,4,0,"div",184,R),s()()(),a(44,"aside",185)(45,"div",186),_(46,"div",187),a(47,"div",188)(48,"div",189),_(49,"div",190)(50,"div",191),s(),_(51,"div",192),s()(),a(52,"div",193),_(53,"div",194)(54,"div",195),a(55,"div",196),_(56,"div",197)(57,"div",197),s(),_(58,"div",198),s(),a(59,"div",199)(60,"div",200),_(61,"div",201),a(62,"div",162),_(63,"div",202)(64,"div",203),s()(),a(65,"div",94),_(66,"div",204)(67,"div",205),s(),a(68,"div",206),_(69,"div",207)(70,"div",208)(71,"div",209),a(72,"div",210),_(73,"div",211)(74,"div",212),s()(),a(75,"div",96),F(76,Cr,1,0,"div",213,R),s(),a(78,"div",214),_(79,"div",215),s()()()()()),i&2&&(l(42),D(O(0,to)),l(34),D(O(1,io)))}function vr(i,o){if(i&1){let t=E();a(0,"div")(1,"app-request-dialog-share",219),P("closeModal",function(n){w(t);let r=d(2);return b(r.closeModalShare(n))}),s()()}if(i&2){let t=d(2);l(),h("product",t.product)}}function wr(i,o){if(i&1&&m(0,vr,2,1,"div"),i&2){let t=d();p(t.showModalShare?0:-1)}}function br(i,o){i&1&&_(0,"app-auth-dialog",220)}function Sr(i,o){if(i&1&&m(0,br,1,0,"app-auth-dialog",220),i&2){let t=d();p(t.user?-1:0)}}var ri=(()=>{let o=class o{get categoryChips(){let e=this.product?.productCategory?.name;return e?[e]:[]}get storeMoreCount(){let e=this.storeCounts.productsCount||this.storeMiniProducts.length;return Math.max(0,e-5)}get storeLocation(){let e=this.product?.store;
1return[e?.city,e?.country].filter(Boolean).join(" \xB7 ")}get showMobileCta(){return(this.hasLeadsFeature||this.canWhatsapp||this.canEmail)&&!this.isOwnStore}get categoryTrail(){let e=`${this.product?.productCategory?.category_group?.name??""}`.trim(),n=`${this.product?.productCategory?.name??""}`.trim();return[e,n].filter(Boolean).join(" \xB7 ")}get canWhatsapp(){return!!this.product?.store?.hasWhatsapp&&!this.isOwnStore}get canEmail(){return!!this.product?.store?.hasEmail&&!this.isOwnStore}get produitPourDemande(){let e=`${this.product?.id??""}`.trim();return e?{id:e,type:"produit",nom:this.product?.name??"",sousTitre:this.categoryTrail,image:this.product?.images?.[0]?.url??null,similaires:this.produitsSimilairesPourDemande}:null}reprendreIntentionDeContact(){if(!this.isBrowser)return;let e=this.storeContact.takeIntent();if(!e||!this.storeContact.isKnownAuthenticated())return;if(e.channel!=="form"){this.storeContact.requestContact(e.storeId,e.channel,null,e.message);return}let n=e.destinataires?.[0];this.storeContact.ouvrirConnect({id:e.storeId,name:n?.nom,logo:n?.logo,isPaid:n?.verifie,city:n?.lieu},e.source??"produit",e.message,e.contexte??null)}onConnect(e){return G(this,null,function*(){e?.preventDefault(),e?.stopPropagation(),yield this.storeContact.ouvrirConnect(this.product?.store,"produit","",this.produitPourDemande)})}onContactChannel(e,n){return G(this,null,function*(){e.preventDefault(),e.stopPropagation();let r=`${this.product?.store?.id??this.product?.store?._id??""}`.trim();if(!r)return;this.storeContact.noterClicContact(r,n,"produit");let c=ge(this.platformId)&&this.storeContact.isKnownAuthenticated()?window.open("","_blank"):null;yield this.storeContact.requestContact(r,n,c,"",`${this.product?.store?.name??""}`)})}get categoryRouterLink(){let e=this.product?.productCategory?.category_group?.slug,n=this.product?.productCategory?.slug;return e&&n?["/produits",e,n]:null}get storeCountsSummary(){let e=this.storeCounts,n=[];return e.productsCount&&n.push({count:e.productsCount,labelKey:"PRODUCT_DETAIL_PAGE.STAT_PRODUCTS"}),e.projectsCount&&n.push({count:e.projectsCount,labelKey:"PRODUCT_DETAIL_PAGE.STAT_REALIZATIONS"}),e.catalogsCount&&n.push({count:e.catalogsCount,labelKey:"PRODUCT_DETAIL_PAGE.STAT_DOCS"}),n}get mobileGalleryItems(){let e=(this.product?.images??[]).filter(c=>typeof c?.url=="string"&&c.url.trim().length).map((c,f)=>({url:c.url,alt:c.alternativeText||c.caption||`${this.product?.name} ${f+1}`,isVideo:!1})),n=this.product?.video,r=n?.thumbnail||$t(n?.url)||null;return n?.url&&r&&e.push({url:r,alt:this.product?.name??"",isVideo:!0,videoUrl:n.url}),e}goBack(){if(this.isBrowser){if(window.history.length>1){window.history.back();return}this.router.navigate(["/"])}}attachMobileGalleryScroll(){let e=this.mobileStrip?.nativeElement;!this.isBrowser||!e||this.mobileStripEl===e||(this.detachMobileGalleryScroll(),this.mobileStripEl=e,this.ngZone.runOutsideAngular(()=>{this.mobileStripListener=()=>{this.mobileStripRaf===null&&(this.mobileStripRaf=requestAnimationFrame(()=>{this.mobileStripRaf=null;let n=e.clientWidth||1,r=Math.round(e.scrollLeft/n);r!==this.mobileGalleryIndex&&this.ngZone.run(()=>{this.mobileGalleryIndex=r,this.cdr.markForCheck()})}))},e.addEventListener("scroll",this.mobileStripListener,{passive:!0})}))}detachMobileGalleryScroll(){this.mobileStripEl&&this.mobileStripListener&&this.mobileStripEl.removeEventListener("scroll",this.mobileStripListener),this.mobileStripRaf!==null&&(cancelAnimationFrame(this.mobileStripRaf),this.mobileStripRaf=null),this.mobileStripEl=void 0,this.mobileStripListener=void 0}get storeInitials(){let e=this.product?.store?.name?.trim()||"";return e?e.slice(0,2):""}loadStoreCounts(e){this.storesService.requestAlreadyHave(e).pipe(re(1)).subscribe({next:n=>{this.storeCounts={productsCount:Number(n?.productsCount??0),projectsCount:Number(n?.projectsCount??0),servicesCount:Number(n?.servicesCount??0),videosCount:Number(n?.videosCount??0),catalogsCount:Number(n?.catalogsCount??0)},this.cdr.markForCheck()},error:()=>{}}),this.storesService.elasticStoresContentCounts([e]).pipe(re(1)).subscribe({next:n=>{let r=n.get(e);r&&(this.storeCounts=ne(ie({},this.storeCounts),{productsCount:r.productsCount,projectsCount:r.projectsCount}),this.cdr.markForCheck())},error:()=>{}})}get characteristicCount(){let e=this.product?.filters?.data;if(!e)return 0;let n=this.product?.productCategory?.productFilterIds??[],r=this.product?.productCategory?.productFilterComb
1inationIds??[],c=0;for(let f of e.filters??[]){let v=n.length?n.includes(f.id):!0,V=(f.presetValueIds?.length??0)>0||(f.rawValues?.length??0)>0;v&&V&&f.id!==this.priceFilterId&&c++}for(let f of e.combinations??[]){let v=r.length?r.includes(f.id):!0,V=(f.values?.length??0)>0;v&&V&&c++}return c}keyFacts(e){let n=this.product?.filters?.data?.filters;if(!e||!n?.length)return[];let r=[];for(let c of n){let f=e?.[c.id];if(!f?.name)continue;let v=[];for(let q of c.rawValues??[]){let N=q?.value?.toString().trim();N&&v.push(N)}if(!v.length)for(let q of c.presetValueIds??[]){let N=f.product_filter_presets?.[q.valueId]?.value?.toString().trim();N&&v.push(N)}if(!v.length)continue;let V=v.join(", ")+(f.unit?` ${f.unit}`:""),te=f.name.trim();if(V&&r.push({label:te,value:V}),r.length>=3)break}return r}pdfName(e){return e?.name||e?.alternativeText||this.translateService.instant("PRODUCT_DETAIL_PAGE.DOCUMENT")}pdfMeta(e){let n=(e?.ext||"pdf").replace(".","").toUpperCase(),r=e?.size?` \xB7 ${Math.round(e.size)} Ko`:"";return`${n}${r}`}onStoreProjectsTotal(e){this.storeProjectsLoaded=!0,this.hasStoreProjects=(e??0)>0,this.cdr.markForCheck()}constructor(e,n,r,c,f,v,V,te,q,N,he,Se,ce,Pe,li,ai,si,di,ci,ui,pi){this.platformId=e,this.productsService=n,this.productFiltersService=r,this.authService=c,this.seoService=f,this.modalService=v,this.cdr=V,this.ngZone=te,this.distributorService=q,this.http=N,this.websiteFeaturesService=he,this.translateService=Se,this.layoutService=ce,this.storesService=Pe,this.tracking=li,this.incentive=ai,this.incentivePrompt=si,this.downloadGate=di,this.router=ci,this.storeContact=ui,this.consent=pi,this.productLoaded=new k,this.similarProductsLoaded=new k,this.productNotFound=new k,this.apiUrl=I.apiUrl,this.showModalShare=!1,this.hasOverflow=!1,this.isDownloadingPdf=!1,this.pdfViewerComponent=null,this.distributors$=$,this.isDescriptionExpanded=!1,this.user=void 0,this.productFilters$=$,this.productFilterCombinations$=$,this.productFilterDefs=null,this.price=null,this.priceFilterId=null,this.similarProducts=[],this.complementProducts=[],this.similarBreakpoints={1024:{slidesPerView:4,spaceBetween:24},0:{slidesPerView:2,spaceBetween:16}},this.storeMiniProducts=[],this.hasStoreProjects=!1,this.storeProjectsLoaded=!1,this.openRequestAfterLogin=null,this.similarProducts$=$,this.storeProducts$=$,this.complementProducts$=$,this.similarStoreProducts$=$,this.filterValue$=new nt([]),this.isTechnicalVisible=!1,this.isComplementVisible=!1,this.isProjectsVisible=!1,this.isSimilarProductsVisible=!1,this.sent=!1,this.productDetailsTabIndex=0,this.hasLeadsFeature=!1,this.hasStoreExpertisesFeature=!1,this.startTime=0,this.storeCounts={productsCount:0,projectsCount:0,servicesCount:0,videosCount:0,catalogsCount:0},this.produitsSimilairesPourDemande=[],this.mobileGalleryIndex=0,this.mobileStripRaf=null,this.mobileDockVisible=!1,this.dockSetupFrames=0,this.viewTracked=!1,this.visibleFilterValues=[],this.isBrowser=ge(this.platformId)}ngOnInit(){if(this.reprendreIntentionDeContact(),this.syncContextualBottomBar(),this.leadsFeatureSubscription=this.websiteFeaturesService.hasLeads$().subscribe(e=>{this.hasLeadsFeature=e,this.syncContextualBottomBar(),this.cdr.markForCheck()}),this.expertisesFeatureSubscription=this.websiteFeaturesService.hasStoresExpertises$().subscribe(e=>{this.hasStoreExpertisesFeature=e,this.cdr.markForCheck()}),this.isBrowser){this.scheduleIdleTask(()=>{this.loadPdfViewer()},100),this.maybeTrackView();let e=localStorage.getItem("open_request_after_login");if(e)try{this.openRequestAfterLogin=JSON.parse(e)}catch{this.openRequestAfterLogin={nameEnjoy:"contact"}}}this.authStateChangeSubscription=this.authService.authStateChange$.subscribe(e=>{this.user=e?this.authService.currentUser:null,e&&this.consumeOpenRequestAfterLogin(),this.syncContextualBottomBar(),this.cdr.markForCheck()})}syncContextualBottomBar(){this.layoutService.setContextualBottomBar(!1)}setupMobileDock(){if(!this.isBrowser||this.dockObserver)return;let e=document.querySelector('[data-testid="product-contact"]');if(!e){if(this.dockSetupFrames++>60)return;requestAnimationFrame(()=>this.setupMobileDock());return}this.dockObserver=new IntersectionObserver(n=>{let r=!n[0].isIntersecting;r!==this.mobileDockVisible&&(this.mobileDockVisible=r,this.ngZone.run(()=>this.cdr.markForCheck()))},{rootMargin:"-60px 0px 0px 0px"}),this.dockObserver.observe(e)}ngAfterViewInit(){this.isBrowser&&(this.setupMobileDock(),this.observeDescriptionOverflow(),this.attachMobileGalleryScroll())}observeDescriptionOverflow(){let e=this.descriptionTextRef?.nativeElement;e&&(this.descriptionRo?.disconnect(),this.ngZone.runOutsideAngular(()=>{this.descriptionRo=new ResizeObserver(()=>{requestAnimationFrame(()=>{this.checkDescriptionOverflow(e)})}),this.descriptionRo.observe(e)}))}checkDescriptionOverflow(e){e.classList.contains("multiline-ellipsis")&&e.classList.remove("multiline-ellipsis");let r=parseFloat(getComputedStyle(e).lineHeight||"26"),c=e.scrollHeight,v=(window.innerWidth<1024?5:8)*r,V=c>v;this.isDescriptionExpanded||e.classList.add("multiline-ellipsis"),this.hasOverflow!==V&&(this.hasOverflow=V,this.ngZone.run(()=>this.cdr.markForCheck()))}ngOnChanges(e){if(e.product&&e.product.currentValue){this.processProduct(e.product.currentValue).subscribe({next:()=>{},error:()=>{}});return}e.productSlug&&(!e.productSlug.previousValue||e.productSlug.previousValue!==e.productSlug.currentValue)&&(this.product||this.loadProduct(e.productSlug.currentValue))}loadProduct(e){this.productSubscription?.unsubscribe(),this.productSubscription=this.productsService.findOne(e).pipe(le(n=>n?this.processProduct(n):(this.productNotFound.emit(),$))).subscribe(),this.user=this.authService.currentUser}maybeTrackView(){if(this.viewTracked||!this.product?.id)return;this.viewTracked=!0;let e=this.product.id,n=this.product.store?.id;this.viewTrackSubscription=this.authService.userLoaded$.pipe(De(r=>r),re(1)).subscribe(()=>{let r=this.authService.currentUser;n&&r?.stores?.some(f=>String(f.id)===String(n))||this.tracking.track("view","product",e,{storeId:n,metadata:{category:this.product?.productCategory?.id,essence:this.extractEssence()}})})}
1extractEssence(){let e=this.productFilterDefs,n=this.product?.filters?.data?.filters;if(!(!e||!n?.length))for(let r of n){let c=e?.[r.id];if(/essence|bois/i.test(c?.name??"")){for(let f of r.rawValues??[]){let v=f?.value?.toString().trim();if(v)return v}for(let f of r.presetValueIds??[]){let v=c.product_filter_presets?.[f.valueId]?.value?.toString().trim();if(v)return v}}}}extractPrice(){this.priceFilterId=null,this.price=null;let e=this.productFilterDefs,n=this.product?.filters?.data?.filters;if(!(!e||!n?.length))for(let r of n){let c=e?.[r.id];if(/^(prix|price)$/i.test((c?.name??"").trim())){this.priceFilterId=r.id;for(let f of r.rawValues??[]){let v=f?.value?.toString().trim();if(v){this.price={value:v,unit:(c.unit??"").toString().trim()};return}}return}}}computeVisibleFilterValues(){let e=this.product?.filters?.data?.filters??[];this.visibleFilterValues=this.priceFilterId?e.filter(n=>n.id!==this.priceFilterId):e}processProduct(e){this.product=e,this.isBrowser&&this.storeContact.synchroniserContextePage(e.store,this.produitPourDemande),this.productFilterDefs=null,this.price=null,this.priceFilterId=null,this.computeVisibleFilterValues(),this.maybeTrackView(),this.isBrowser&&(this.incentive.noteConcreteInterest("product"),this.incentivePrompt.maybeShowSearchPrompt()),this.storeProducts$=$,this.similarStore=void 0,this.similarStoreProducts$=$;let n=e.filters?.data?.filters?.map(f=>f.id)?.filter(f=>e.productCategory?.productFilterIds?.includes(f)??!0)??[],r=[],c=[];if(e.filters?.data?.combinations?.length&&(r=[...new Set(e.filters.data.combinations.filter(f=>e.productCategory?.productFilterCombinationIds?.includes(f.id)??!0).flatMap(f=>f.values).flatMap(f=>f.filters).map(f=>f.id))],c=e.filters.data.combinations.map(f=>f.id)),(n?.length||r?.length)&&(this.productFilters$=this.productFiltersService.get([...new Set([...n,...r])]).pipe(Je(f=>{this.productFilterDefs=f,this.extractPrice(),this.computeVisibleFilterValues(),this.cdr.markForCheck()}))),c?.length&&(this.productFilterCombinations$=this.productFiltersService.getCombined(c,e.productCategory?.id)),e?.images?.[0]?.url){let f=e.images[0].url,v=f.startsWith(I.s3.baseUrl)?f.replace(I.s3.baseUrl,I.s3.baseCdnUrl):f;this.seoService.preloadImage({url:v,type:"image/avif",sizes:"(max-width: 1024px) 100vw, calc(100vw - 726px)",widths:[320,480,640,768,960,1200],fetchPriority:"high"})}return this.productLoaded.emit(e),this.startTime=Date.now(),this.isBrowser&&setTimeout(()=>{this.observeDescriptionOverflow(),this.attachMobileGalleryScroll()},0),this.mobileGalleryIndex=0,this.isBrowser?this.scheduleIdleTask(()=>this.processProductDeferred(e),50):this.processProductDeferred(e),A({})}processProductDeferred(e){e.store?.id&&e.id&&(this.storeProducts$=this.productsService.getOtherProductsOfStore(e.store.id,e.id).pipe(K(n=>(console.warn("Error fetching store products",n),A([]))),Ee({bufferSize:1,refCount:!0})),this.storeMiniSub?.unsubscribe(),this.storeMiniSub=this.storeProducts$.subscribe(n=>{this.storeMiniProducts=(n??[]).slice(0,6),this.cdr.markForCheck()}),this.loadStoreCounts(String(e.store.id))),e.store?.slug&&(this.distributors$=this.distributorService.findDistributorsByStore(e.store.slug).pipe(oe(n=>n?.data??[]),Ee({bufferSize:1,refCount:!0}))),this.requestQuery&&this.isBrowser&&this.hasLeadsFeature&&!this.isOwnStore&&this.openRequestModal({store:e.store,product:e,nameEnjoy:""}),this.openRequestAfterLogin&&this.user&&this.openPendingRequestAfterLogin(),this.user&&this.consumeOpenRequestAfterLogin(),e.productCategory&&(this.similarProducts$=Fe([this.filterValue$,A(e)]).pipe(le(([n,r])=>this.productsService.elasticSimilarSearch(r.id,r.productCategory.id,n)),oe(n=>{let r=n?.products||[];return this.similarProducts=r,this.similarProductsLoaded.emit(r),r}),K(n=>(console.warn("Error fetching similar products",n),A([])))),this.complementProducts$=Fe([this.filterValue$]).pipe(le(([n])=>this.productsService.elasticComplementProducts(n.flatMap(r=>r.values))),oe(n=>{let r=n?.products||[];return this.complementProducts=r,r}),K(n=>(console.warn("Error fetching complement products",n),A([])))),this.similarStoreProducts$=Fe([this.filterValue$,A(e)]).pipe(le(([n,r])=>this.productsService.elasticSimilarStoreByProduct(r.id,r?.store?.id,r.productCategory.id,n)),oe(n=>this.extractUniqueStores(n?.products||[])),Je(n=>{this.similarStore=n}),K(n=>(console.warn("Error fetching similar store products",n),this.similarStore=[],A([]))),Ee({bufferSize:1,refCount:!0})),this.cdr.markForCheck())}onFilterValueEmit(e){this.filterValue$.next(e)}funcvieuw(){return this.filterValue$.value}ngOnDestroy(){this.layoutService.setContextualBottomBar(!1),this.dockObserver?.disconnect(),this.productSubscription?.unsubscribe(),this.authStateChangeSubscription?.unsubscribe(),this.viewCountSubscription?.unsubscribe(),this.viewTrackSubscription?.unsubscribe(),this.leadsFeatureSubscription?.unsubscribe(),this.expertisesFeatureSubscription?.unsubscribe(),this.storeMiniSub?.unsubscribe(),this.descriptionRo?.disconnect(),this.detachMobileGalleryScroll(),this.isBrowser&&(localStorage.setItem("pageView","false"),this.storePageVisit())}openRequestDialog(e,n){e.stopPropagation(),this.hasLeadsFeature&&this.openRequestDialogAsync(n)}openRequestDialogAsync(e){return G(this,null,function*(){if(!this.hasLeadsFeature)return;let n=yield this.resolveSimilarStoreForRequest(),r={store:this.product?.store,product:this.product,nameEnjoy:e,similarStore:n,similarProduct:this.similarProducts};yield this.openRequestModal(r,this.toRequestAction(e))})}toggleProductDetailsTab(e){this.productDetailsTabIndex=e}toYoutubeEmbedUrl(e){if(!e)return null;let n=/(?:youtu.be\/|youtube.com\/(?:watch\?.*v=|embed\/|v\/|u\/\w\/|embed\/))([^#\&\?]*).*/,r=e.match(n);return r&&r[1]?`https://www.youtube.com/embed/${r[1]}`:null}openModalShare(){this.showModalShare=!0}closeModalShare(e){this.showModalShare=e}storePageVisit(){if(!this.product)return A({});if(!this.consent.estAccorde())return A({});let e=(Date.now()-this.startTime)/1e3,n=this.isOwnStore;if(this.user&&!n){let r={storeId:this.product?.store?.id,userEmail:this.user?.email,productId:this.product?.id,nbreVisit:1,duration:e};Object.keys(r).forEach(c=>r[c]==null&&delete r[c]),this.productsService.requestPageVisit(r)?.subscribe()}else if(!n){if(!this.isBrowser)return A({});let r=localStorage.getItem("product-visited"),c=JSON.parse(r??"[]"),f=c.findIndex(v=>v.productId===this.product.id);if(f===-1)c.push({storeId:this.product.store.id,productId:this.product.id,nbreVisit:1,duration:e});else{let v=Math.max(e,c[f].duration);c[f]=ne(ie({},c[f]),{nbreVisit:c[f].nbreVisit+1,duration:v})}localStorage.setItem("product-visited",JSON.stringify(c))}return A({})}trackByProduct(e,n){return n?.id??e}onSimilarPrev(){this.similarSwiper?.nativeElement?.swiper?.slidePrev()}onSimilarNext(){this.similarSwiper?.nativeElement?.swiper?.slideNext()}trackByProject(e,n){return n?.id??e}trackBySimilarProduct(e,n){return n?.id??e}trackByPdfUrl(e,n){return n.id?`media-${n.id}`:n.url}shouldShowConnectBubble(){return!!(this.product?.store&&this.product?.store?.activeStore)}consumeOpenRequestAfterLogin(){return G(this,null,function*(){if(!this.isBrowser)return;if(!this.hasLeadsFeature){localStorage.removeItem("open_request_after_login"),this.openRequestAfterLogin=null;return}let e=localStorage.getItem("open_request_after_login");if(e)try{let n=JSON.parse(e);if(Date.now()-(n.ts||0)<1e3*60*5&&n.productId&&n.productId===this.product?.id&&this.user){let c=yield this.resolveSimilarStoreForRequest();yield this.openRequestModal({store:this.product.store,product:this.product,similarStore:c,similarProduct:this.similarProducts}),localStorage.removeItem("open_request_after_login")}else localStorage.removeItem("open_request_after_login")}catch{localStorage.removeItem("open_request_after_login")}})}get isOwnStore(){let e=this.product?.store?.id;return e?!!this.user?.stores?.some(n=>String(n.id)===String(e)):!1}handleContactSupplier(e,n="none"){e?.stopPropagation(),!(!this.hasLeadsFeature||this.isOwnStore)&&this.openContactSupplierModal(n)}openContactSupplierModal(e){return G(this,null,function*(){if(!this.hasLeadsFeature||this.isOwnStore)return;let n=yield this.resolveSimilarStoreForRequest(),r={store:this.product?.store,product:this.product,similarStore:n,similarProduct:this.similarProducts};yield this.openRequestModal(r,e)})}openPendingRequestAfterLogin(){return G(this,null,function*(){if(!this.openRequestAfterLogin||!this.user||!this.hasLeadsFeature){this.isBrowser&&!this.hasLeadsFeature&&localStorage.removeItem("open_request_after_login"),this.openRequestAfterLogin=null;return}this.isBrowser&&localStorage.removeItem("open_request_after_login");let e=yield this.resolveSimilarStoreForRequest();yield this.openRequestModal({store:this.product?.store,product:this.product,similarStore:e,similarProduct:this.similarProducts}),this.openRequestAfterLogin=null})}extractUniqueStores(e){let n=new Map;return e.forEach(r=>{let c=r.store?.id;!c||n.has(c)||n.set(c,{id:c,name:r.store?.name,isPaid:r.store?.isPaid})}),Array.from(n.values())}resolveSimilarStoreForRequest(){return G(this,null,function*(){if(this.similarStore!==void 0)return this.similarStore;if(!this.product?.id||!this.product?.productCategory?.id)return this.similarStore=[],[];
1try{if(this.similarStoreProducts$!==$){let e=yield Ke(this.similarStoreProducts$.pipe(re(1)));return this.similarStore=e,e}}catch(e){console.warn("Error resolving similarStore from similarStoreProducts$ stream",e)}try{let e=yield Ke(this.productsService.elasticSimilarStoreByProduct(this.product.id,this.product?.store?.id,this.product.productCategory.id,this.filterValue$.value)),n=this.extractUniqueStores(e?.products||[]);return this.similarStore=n,n}catch(e){return console.warn("Error fetching similarStore for request modal",e),this.similarStore=[],[]}})}onProductVideoOpened(){this.tracking.track("view","video",this.product?.id,{storeId:this.product?.store?.id})}onDownload(e){if(!this.isBrowser){console.warn("onDownload called on server \u2014 skipping download.");return}let n=typeof e=="string"?e:e?.url,r=typeof e=="string"?"document.pdf":e?.filename||this.deriveFilenameFromUrl(n)||"document.pdf";if(!n||this.isDownloadingPdf)return;let c={storeId:this.product?.store?.id,targetType:"product",targetId:this.product?.id,assetType:"fiche",assetUrl:n,assetId:typeof e=="string"?void 0:e?.id,assetTitle:typeof e=="string"?void 0:e?.name};this.downloadGate.requestDownload(c,()=>this.performPdfDownload(n,r))}performPdfDownload(e,n){!this.isBrowser||!e||this.isDownloadingPdf||(this.tracking.track("download","product",this.product?.id,{storeId:this.product?.store?.id}),this.isDownloadingPdf=!0,this.http.get(e,{responseType:"blob"}).pipe(K(r=>{console.warn("Download via HttpClient failed, fallback to window.open",r);try{window.open(e,"_blank","noopener")}catch{}return A(null)})).subscribe(r=>{if(this.isDownloadingPdf=!1,!r)return;let c=window.URL.createObjectURL(r),f=document.createElement("a");f.href=c,f.download=n,document.body.appendChild(f),f.click(),f.remove(),window.URL.revokeObjectURL(c)}))}deriveFilenameFromUrl(e){if(!e)return null;try{return new URL(e).pathname.split("/").pop()||""||null}catch{try{return(e||"").split("/").pop()||null}catch{return null}}}loadPdfViewer(){return G(this,null,function*(){if(this.isBrowser&&!this.pdfViewerComponent){let e=yield import("./chunk-KQWJJLOS.js");this.pdfViewerComponent=e.PdfViewerClientComponent,this.cdr.markForCheck()}})}onDownloadMobile(e){if(!this.isBrowser){console.warn("onDownloadMobile called on server \u2014 skipping.");return}if(!e?.url)return;let n={storeId:this.product?.store?.id,targetType:"product",targetId:this.product?.id,assetType:"fiche",assetUrl:e.url,assetId:e?.id,assetTitle:e?.name};this.downloadGate.requestDownload(n,()=>{this.tracking.track("download","product",this.product?.id,{storeId:this.product?.store?.id}),window.open(e.url,"_blank","noopener")})}scheduleIdleTask(e,n=50){if(!this.isBrowser)return;let r=window.requestIdleCallback;if(typeof r=="function"){r(()=>e(),{timeout:n});return}setTimeout(e,16)}openRequestModal(e,n){return G(this,null,function*(){if(!this.hasLeadsFeature)return;e=ne(ie({},e),{price:this.price});let{RequestDialogComponent:r}=yield import("./chunk-JSCQFAU2.js");this.modalService.open(r,e,n,"wp-pd-sheet")})}toRequestAction(e){switch(e){case"catalog":case"priceList":case"dealers":case"contact":return e;default:return"none"}}onFormSubmitted(){}};o.\u0275fac=function(n){return new(n||o)(S(Ie),S(Ze),S(Lt),S(ft),S(We),S(Vt),S(_e),S(rt),S(Wt),S(pt),S(He),S(Be),S(qt),S(Ot),S(Pt),S(bt),S(Ft),S(Dt),S(_t),S(kt),S(St))},o.\u0275cmp=U({type:o,selectors:[["app-product-details"]],viewQuery:function(n,r){if(n&1&&(Ve(jn,5),Ve(Nn,5),Ve(Gn,5)),n&2){let c;ke(c=Re())&&(r.descriptionTextRef=c.first),ke(c=Re())&&(r.mobileStrip=c.first),ke(c=Re())&&(r.similarSwiper=c.first)}},inputs:{product:"product",productSlug:"productSlug",requestQuery:"requestQuery"},outputs:{productLoaded:"productLoaded",similarProductsLoaded:"similarProductsLoaded",productNotFound:"productNotFound"},features:[J],decls:8,vars:2,consts:[["brandCardTpl",""],["mobileStrip",""],["descriptionTextRef",""],["similarSwiper",""],[1,"relative","lg:hidden"],[1,"wp-dock","lg:hidden",3,"is-on"],[1,"wp-pd","wp-public-container","relative","w-full","overflow-hidden","lg:overflow-visible"],[1,"mt-5","grid","grid-cols-1","items-start","gap-8","lg:mt-[14px]","lg:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]","lg:gap-x-12","max-[860px]:mt-0","max-[860px]:flex","max-[860px]:flex-col","max-[860px]:items-stretch","max-[860px]:gap-0"],[1,"wp-pd-col","flex","min-w-0","flex-col","gap-8","lg:gap-10","max-[860px]:order-3","max-[860px]:gap-[30px]"],[1,"wp-pd-head","min-w-0"],[1,"hidden","w-full","lg:-mt-[30px]","lg:block"],["variant","product",1,"block","w-full",3,"videoOpened","blendOnSoft","images","videos"],[1,"wp-pd-chips","-mt-7","flex","flex-wrap","gap-2","lg:-mt-4"],[1,"max-[860px]:order-2"],[1,"max-[860px]:order-3"],[1,"order-first","flex","flex-col","lg:order-none","lg:sticky","lg:top-[100px]","max-[860px]:contents"],[1,"max-[860px]:order-1","wp-pd-ident"],[1,"wp-pd-eb"],[1,"flex","items-start","justify-between","gap-4"],[1,"wp-pd-title"],[1,"mt-1","hidden","shrink-0","lg:block"],["variant","icon",3,"productId"],["data-testid","product-maker-line",1,"wp-pd-by","lg:hidden","max-[860px]:!hidden",3,"routerLink"],["variant","plain","testid","product-price",1,"mt-4","block",3,"price"],["data-testid","product-contact",1,"wp-ctc","mt-[22px]","max-[860px]:order-2","max-[860px]:mt-4"],[1,"mt-5","max-[860px]:order-4","max-[860px]:mt-0"],[3,"ngTemplateOutlet"],[1,"wp-pd","mt-6","lg:mt-[72px]","lg:border-y","lg:border-line","lg:bg-cream",3,"hidden"],[1,"wp-pd","wp-public-container"],[1,"flex","snap-x","snap-mandatory","overflow-x-auto","[-ms-overflow-style:none]","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"],[1,"relative","aspect-[4/3]","max-h-[46vh]","w-full","flex-none","snap-start","bg-soft"],[1,"absolute","
1inset-x-[10px]","top-[10px]","z-[3]","flex","items-center","gap-2"],["type","button",1,"grid","h-[34px]","w-[34px]","place-items-center","rounded-full","bg-white/[0.93]","text-ink","shadow-[0_2px_10px_rgba(0,0,0,0.15)]",3,"click"],["viewBox","0 0 24 24","fill","none","aria-hidden","true",1,"h-4","w-4"],["d","M15 6l-6 6 6 6","stroke","currentColor","stroke-width","2.2","stroke-linecap","round","stroke-linejoin","round"],[1,"flex-1"],["variant","icon",1,"wp-pd-fav-round",3,"productId"],["ngOptimizedImage","","width","800","height","600","ngSrcset","400w, 800w, 1200w","sizes","100vw","priority","",1,"absolute","inset-0","h-full","w-full","object-contain","mix-blend-multiply",3,"ngSrc","alt"],["ngOptimizedImage","","width","800","height","600","ngSrcset","400w, 800w, 1200w","sizes","100vw","loading","lazy","decoding","async",1,"absolute","inset-0","h-full","w-full","object-contain","mix-blend-multiply",3,"ngSrc","alt"],["target","_blank","rel","noopener noreferrer",1,"absolute","inset-0","flex","items-center","justify-center",3,"href"],["target","_blank","rel","noopener noreferrer",1,"absolute","inset-0","flex","items-center","justify-center",3,"click","href"],[1,"inline-flex","h-14","w-14","items-center","justify-center","rounded-full","bg-brand/90","text-white"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","currentColor","aria-hidden","true",1,"ml-1","h-6","w-6"],["d","M8 5v14l11-7z"],["aria-hidden","true",1,"absolute","bottom-3.5","left-1/2","z-[3]","flex","-translate-x-1/2","gap-[5px]","rounded-full","bg-black/[0.35]","px-2","py-[5px]","backdrop-blur-[4px]"],[1,"h-[6px]","rounded-full","transition-all","duration-150",3,"class"],[1,"absolute","bottom-3","right-3","z-[3]","rounded-[7px]","bg-black/65","px-[9px]","py-[3px]","text-[11px]","font-semibold","text-white"],[1,"h-[6px]","rounded-full","transition-all","duration-150"],[1,"wp-dock","lg:hidden"],[1,"mx-auto","flex","min-h-[60px]","items-center","gap-3","px-4","py-2"],[1,"flex","min-w-0","flex-1","flex-col","gap-0.5"],[1,"wp-dock-nom"],[1,"truncate","text-[12px]","font-medium","text-muted2","hover:text-ink",3,"routerLink"],[1,"flex","flex-none","items-center","gap-2"],["type","button","data-testid","product-contact-cta-dock",1,"wp-btn","wp-btn-connect","h-10","flex-none","whitespace-nowrap","px-[18px]","text-[14px]"],["type","button","data-testid","product-contact-cta-dock",1,"wp-btn","wp-btn-connect","h-10","flex-none","whitespace-nowrap","px-[18px]","text-[14px]",3,"click"],[1,"rounded-full","bg-chip","px-[13px]","py-1.5","text-[13px]","font-medium","text-ink-2"],[1,"wp-pd-h2","mb-4","text-[24px]","font-bold","text-ink"],[1,"wp-pd-desc","text-[16px]","leading-[1.7]","text-ink-2",3,"innerText"],[1,"wp-pd-more","mt-3","inline-flex","items-center","gap-2","text-sm","font-semibold","text-brand"],[1,"wp-pd-more","mt-3","inline-flex","items-center","gap-2","text-sm","font-semibold","text-brand",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 20 20","fill","currentColor",1,"h-4","w-4","transition-transform"],["fill-rule","evenodd","d","M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule","evenodd"],[1,"wp-pd-specs","max-[860px]:order-1"],[3,"filterValueOnchanged","product","filterCombinationDefinitions","filterDefinitions","filterValues","combinatedFilterValues"],[1,"text-[15px]","font-medium","text-muted2"],[1,"wp-pd-docs-rail","flex","snap-x","snap-mandatory","gap-3","overflow-x-auto","pb-1","[-ms-overflow-style:none]","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden","lg:grid","lg:grid-cols-3","lg:gap-3.5","lg:snap-none","lg:overflow-visible"],["type","button",1,"wp-pd-doccard","group","block","min-w-0","shrink-0","basis-[148px]","snap-start","text-left","lg:basis-auto"],["type","button",1,"wp-pd-doccard","group","block","min-w-0","shrink-0","basis-[148px]","snap-start","text-left","lg:basis-auto",3,"click"],[1,"transition-transform","duration-150","group-hover:-translate-y-[3px]"],[3,"url","name"],[1,"mt-2.5","block","truncate","text-[13px]","font-semibold","leading-[1.25]","text-ink"],[1,"block","text-[11.5px]","text-muted2"],["alt","",3,"src"],[3,"title"],["viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","m5 13 4 4 10-11","
1stroke","currentColor","stroke-width","3","stroke-linecap","round","stroke-linejoin","round"],[1,"wp-ctc__lb","max-[860px]:hidden"],["data-testid","product-contact-maker",1,"wp-ctc__id","hidden","max-[860px]:flex",3,"routerLink"],[1,"wp-ctc__lg"],[1,"wp-ctc__tx"],["viewBox","0 0 24 24","fill","none","aria-hidden","true",1,"wp-ctc__go"],["d","m9 6 6 6-6 6","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["type","button","data-testid","product-connect",1,"wp-btn","wp-btn-connect","wp-ctc__cta",3,"click"],[1,"wp-ctc__note"],[1,"wp-pd-co-t","hidden","max-[860px]:block"],[1,"wp-pd-co"],[1,"wp-pd-co-hd",3,"routerLink"],[1,"wp-pd-co-logo"],["ngOptimizedImage","","width","48","height","48","ngSrcset","48w, 96w","sizes","48px",3,"ngSrc","alt"],[1,"text-[15px]","font-extrabold","text-ok"],[1,"min-w-0"],[1,"block","truncate","text-[17px]","font-bold","text-ink"],[1,"mt-0.5","flex","items-center","gap-1","text-[13.5px]","text-muted2"],[1,"wp-pd-co-st"],[3,"productId","storeSlug"],[1,"wp-pd-co-gr"],[1,"wp-pd-co-ft",3,"routerLink"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"h-4","w-4","text-brand"],["d","M5 12h14"],["d","m12 5 7 7-7 7"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"h-[14px]","w-[14px]"],["d","M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"],["cx","12","cy","10","r","3"],[1,"group",3,"routerLink","title"],[1,"wp-pd-co-more",3,"routerLink"],["fill","","decoding","async",1,"transition-transform","duration-300","group-hover:scale-105",3,"ngSrc","alt"],[1,"wp-pd-m-h2","mt-12","flex","items-center","justify-between","pb-4"],[1,"text-[20px]","font-bold","text-ink"],[1,"cursor-pointer","text-[14px]","font-semibold","text-brand",3,"routerLink"],[1,"wp-pd-railwrap"],[3,"distributors"],[1,"mt-12","h-8","animate-pulse","rounded","bg-gray-200"],[1,"wp-pd-m-h2"],[1,"mb-4","mt-12","text-[20px]","font-bold","text-ink"],[1,"wp-pd-rail","lg:grid","lg:gap-6","lg:grid-cols-3","xl:grid-cols-4"],[3,"displayStoreLogo","product"],[1,"wp-pd-railwrap","mt-12"],[1,"wp-pd-skel-h2","mb-4","h-6","w-48","animate-pulse","rounded","bg-gray-200"],[1,"grid","grid-cols-2","gap-[18px_14px]","sm:gap-6","xl:gr
1id-cols-4"],[1,"wp-pd","mt-6","lg:mt-[72px]","lg:border-y","lg:border-line","lg:bg-cream"],[1,"wp-public-container","lg:py-16"],[1,"mb-[30px]","hidden","flex-col","items-start","justify-between","gap-4","lg:flex","sm:flex-row","sm:items-end","sm:gap-6"],[1,"text-[26px]","font-bold","tracking-[-0.01em]","text-ink","sm:text-[34px]"],[1,"mt-1.5","text-[16px]","text-muted2"],[1,"inline-flex","items-center","gap-1.5","whitespace-nowrap","text-[15px]","font-semibold","text-brand",3,"routerLink"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"h-4","w-4"],[1,"wp-pd-m-h2","lg:hidden"],[1,"text-ink"],[3,"routerLink"],[3,"totalCountChanged","storeId","storeProjectScope","isStorePage","projectsPerPage","disablePagination","displayStoreLogos"],[1,"grid","grid-cols-2","gap-[18px_14px]","sm:gap-6","lg:grid-cols-3","xl:grid-cols-4"],[1,"mt-16","hidden","lg:block"],[1,"mb-6","text-[26px]","font-bold","tracking-[-0.01em]","text-ink","sm:text-[34px]"],[1,"wp-pd-rail","lg:hidden"],[1,"relative","hidden","w-full","pb-12","lg:block"],[1,"absolute","right-[1rem]","top-[-2rem]","z-20","flex","-translate-y-1/2","items-center","justify-center","p-2"],["free-mode","true","free-mode-sticky","false","free-mode-momentum","true","free-mode-momentum-ratio","1","free-mode-momentum-velocity-ratio","1","free-mode-minimum-velocity","0.02","speed","400","touch-ratio","1.2","threshold","5","resistance","true","resistance-ratio","0.85",1,"w-full",3,"breakpoints"],[1,"absolute","right-0","top-[-2rem]","z-20","flex","-translate-y-1/2","items-center","justify-center","p-2"],[1,"absolute","right-[1rem]","top-[-2rem]","z-20","flex","-translate-y-1/2","items-center","justify-center","p-2",3,"click"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 6 10",1,"h-3","w-3","text-gray-500"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M5 1 1 5l4 4"],[1,"mb-1","w-full"],[1,"absolute","right-0","top-[-2rem]","z-20","flex","-translate-y-1/2","items-center","justify-center","p-2",3,"click"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","m1 9 4-4-4-4"],[1,"wp-pd-railwrap","mt-16","lg:pb-12"],[1,"wp-pd-skel-h2","mb-4","h-6","w-40","animate-pulse","rounded","bg-gray-200"],[1,"grid","grid-cols-2","gap-[18px_14px]","sm:gap-6","lg:grid-cols-4"],["aria-hidden","true",1,"relative","lg:hidden"],[1,"aspect-[4/3]","max-h-[46vh]","animate-pulse","bg-soft"],[1,"h-[34px]","w-[34px]","rounded-full","bg-white/70"],["aria-hidden","true",1,"wp-pd","wp-public-container","relative","w-full","overflow-hidden","lg:overflow-visible"],[1,"mt-5","grid","grid-cols-1","items-start","gap-8","lg:mt-[14px]","lg:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]","lg:gap-x-12"],[1,"wp-pd-col","flex","min-w-0","flex-col","gap-8","lg:gap-10"],["variant","product",1,"block","w-full"],[1,"-mt-6","flex","animate-pulse","gap-2","lg:-mt-4"],[1,"h-[31px]","w-40","rounded-full","bg-gray-200","lg:h-7"],[1,"h-[31px]","w-28","rounded-full","bg-gray-200","lg:hidden"],[1,"-mb-[22px]","-mt-[10px]","animate-pulse","lg:hidden"],[1,"wp-contact-card","wp-contact-card--maker"],[1,"flex","items-center","gap-3"],[1,"h-[46px]","w-[46px]","flex-none","rounded-[12px]","bg-gray-200"],[1,"min-w-0","flex-1","space-y-2"],[1,"h-4","w-1/2","rounded","bg-gray-200"],[1,"h-3","w-3/4","rounded","bg-gray-200"],[1,"flex","items-center","justify-between","gap-3","border-t","border-line","pt-[11px]"],[1,"h-3.5","w-32","rounded","bg-gray-200"],[1,"h-[38px]","w-[97px]","flex-none","rounded-full","bg-gray-200"],[1,"animate-pulse"],[1,"wp-pd-skel-h2","mb-4","h-7","w-40","rounded","bg-gray-200"],[1,"space-y-2"],[1,"h-4","w-full","rounded","bg-gray-200"],[1,"h-4","w-11/12","rounded","bg-gray-200"],[1,"h-4","w-full","rounded","bg-gray-200","lg:hidden"],[1,"h-4","w-10/12","rounded","bg-gray-200","lg:hidden"],[1,"h-4","w-4/5","rounded","bg-gray-200"],[1,"mt-1.5","h-[19px]","w-36","rounded","bg-gray-200","lg:hidden"],[1,"wp-pd-skel-h2","mb-4","h-
17","w-64","rounded","bg-gray-200"],[1,"space-y-2","lg:hidden"],[1,"h-[44px]","rounded-[12px]","bg-gray-200"],[1,"hidden","h-40","rounded-[14px]","bg-gray-200","lg:block"],[1,"hidden","animate-pulse","lg:block"],[1,"wp-pd-skel-h2","mb-4","h-7","w-52","rounded","bg-gray-200"],[1,"wp-pd-docs-rail","flex","gap-3","overflow-hidden","lg:grid","lg:grid-cols-3","lg:gap-3.5"],[1,"min-w-0","shrink-0","basis-[148px]","lg:basis-auto"],[1,"order-first","flex","animate-pulse","flex-col","lg:order-none","lg:sticky","lg:top-[100px]"],[1,"wp-pd-ident"],[1,"h-[11px]","w-40","rounded","bg-gray-200"],[1,"mt-2","flex","items-start","justify-between","gap-4"],[1,"flex-1","space-y-2"],[1,"h-[32px]","w-11/12","rounded","bg-gray-200"],[1,"h-[32px]","w-1/2","rounded","bg-gray-200"],[1,"hidden","h-9","w-9","shrink-0","rounded-full","bg-gray-200","lg:block"],[1,"wp-ctc","mt-[22px]"],[1,"h-[11px]","w-44","rounded","bg-gray-200"],[1,"h-[52px]","w-full","rounded-full","bg-gray-200"],[1,"wp-ctc__alt"],[1,"h-[46px]","rounded-full","bg-gray-200"],[1,"mx-auto","h-3","w-3/4","rounded","bg-gray-200"],[1,"wp-pd-co","mt-5"],[1,"wp-pd-co-hd"],[1,"h-12","w-12","flex-none","rounded-[10px]","bg-gray-200"],[1,"h-5","w-2/3","rounded","bg-gray-200"],[1,"h-3.5","w-1/2","rounded","bg-gray-200"],[1,"h-4","w-20","rounded","bg-gray-200"],[1,"h-4","w-24","rounded","bg-gray-200"],[1,"wp-pd-co-sf"],[1,"h-[11px]","w-24","rounded","bg-gray-200"],[1,"mt-2","h-4","w-full","rounded","bg-gray-200"],[1,"mt-3","h-3","w-28","rounded","bg-gray-200"],[1,"wp-pd-co-chips"],[1,"h-[26px]","w-20","rounded-full","bg-gray-200"],[1,"h-[26px]","w-28","rounded-full","bg-gray-200"],[1,"aspect-[4/3]","rounded-[8px]","bg-gray-200"],[1,"wp-pd-co-ft"],[1,"h-4","w-40","rounded","bg-gray-200"],[1,"aspect-[3/4]","rounded-[10px]","bg-gray-200"],[1,"mt-2.5","h-3.5","w-3/4","rounded","bg-gray-200"],[1,"mt-1.5","h-3","w-1/3","rounded","bg-gray-200"],[3,"closeModal","product"],["identifier","AUTH_MODAL"]],template:function(n,r){n&1&&(m(0,hr,42,21)(1,gr,80,2)(2,wr,1,1),ae(3,2,qn),m(5,Sr,1,1),ae(6,5,zn),st()),n&2&&(p(r.product?0:1),l(3),at(r.showModalShare))},dependencies:[Ht,Rt,de,ee,j,M,ii,Ut,Bt,Ae,Le,Qt,ni,Nt,jt],styles:[".multiline-ellipsis[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;display:-webkit-box!important;-webkit-line-clamp:8;-webkit-box-orient:vertical;white-space:normal}.mobile-cta-safe[_ngcontent-%COMP%]{padding-bottom:calc(9px + env(safe-area-inset-bottom))}@media (max-width: 1023.98px){.multiline-ellipsis[_ngcontent-%COMP%]{-webkit-line-clamp:5}.wp-pd-cta.mobile-cta-safe[_ngcontent-%COMP%]{padding:9px 14px calc(9px + env(safe-area-inset-bottom))}}.wp-pd-fav-round[_ngcontent-%COMP%] .favorite-btn{width:34px;height:34px;border:0;background:#ffffffed;box-shadow:0 2px 10px #00000026;color:var(--ink)}.wp-pd-fav-round[_ngcontent-%COMP%] .favorite-btn svg{width:16px;height:16px}.wp-pd-fav-round[_ngcontent-%COMP%] .favorite-btn.is-liked{background:#ffffffed;color:var(--brand)}"],changeDetection:0});let i=o;return i})();function Pr(i,o){if(i&1&&(a(0,"div",3),_(1,"app-breadcrumb",7),s()),i&2){let t=d(2);l(),h("items",t.breadcrumbItems)}}function Fr(i,o){i&1&&(a(0,"div",4),_(1,"div",8),s())}function Dr(i,o){if(i&1){let t=E();a(0,"section",0),_(1,"div",2),m(2,Pr,2,1,"div",3)(3,Fr,2,0,"div",4),a(4,"div",5)(5,"app-product-details",6),P("productNotFound",function(){w(t);let n=d();return b(n.onProductNotFoundEmitted())})("productLoaded",function(n){w(t);let r=d();return b(r.onProductLoaded(n))})("similarProductsLoaded",function(n){w(t);let r=d();return b(r.onSimilarProductsLoaded(n))}),s()()()}if(i&2){let t=d();l(2),p(t.product?2:3),l(3),h("product",t.product)("productSlug",t.productSlug)("requestQuery",t.requestQuery)}}function Er(i,o){i&1&&(a(0,"section",1),_(1,"app-not-found"),s())}var ma=(()=>{let o=class o{get breadcrumbItems(){return yt(this.product,this.translateService.instant("PRODUCT_DETAIL_PAGE.BREADCRUMB_ROOT"))}constructor(e,n,r,c,f,v,V,te){this.activatedRoute=e,this.seoService=n,this.analyticsService=r,this.productsService=c,this.platformId=f,this.cdr=v,this.translateService=V,this.localizedRouteService=te,this.productNotFound=!1,this.localizedUrlResolver=q=>{let N=this.product?.slugsByLanguage?.[q];if(N)return{url:`/produits/${this.addHtmlExtension(N)}`,exact:!0};let he=this.product?.productCategory,Se=he?.category_group,ce=Se?.
1slugsByLanguage?.[q]??Se?.slug,Pe=he?.slugsByLanguage?.[q]??he?.slug;return ce&&Pe?{url:`/produits/${ce}/${Pe}`,exact:!1}:ce?{url:`/produits/${ce}`,exact:!1}:null}}ngOnInit(){this.localizedRouteService.setLocalizedUrlResolver(this.localizedUrlResolver),this.routeParamsSubscription=this.activatedRoute.params.subscribe(e=>{this.productSlug=e.productSlug,this.productSlug&&this.loadProductForSeo(this.productSlug)}),this.routeQueryParamsSubscription=this.activatedRoute.queryParams.subscribe(e=>{this.requestQuery=e?.demande,this.cdr.markForCheck()})}loadProductForSeo(e){this.productSubscription?.unsubscribe(),this.productSubscription=this.productsService.findOne(e).subscribe({next:n=>{if(!n){this.productNotFound=!0,this.cdr.markForCheck();return}if(n.redirectToWebsiteLink){this.seoService.redirigerVersUnAutreSite(n.redirectToWebsiteLink)||(this.productNotFound=!0),this.cdr.markForCheck();return}this.product=n,this.localizedRouteService.setEntityWebSites(n?.webSiteSlugs),this.localizedRouteService.setEntityWebSites(n?.webSiteSlugs),this.setupSeo(n),this.cdr.markForCheck()},error:()=>{this.productNotFound=!0,this.cdr.markForCheck()}})}setupSeo(e){let n=e.seo?.canonicalURL||`produits/${this.addHtmlExtension(e.slug)}`,r=e.seo?.metaTitle?.trim(),c=e.seo?.metaDescription?.trim(),f=this.seoService.getWebsiteName(),v=e.store?`${e.name} | ${e.store?.name} | ${f}`:`${e.name} | ${f}`;this.seoService.setMetaTags(ne(ie({},e.seo),{metaTitle:r||v,metaImage:e.seo?.metaImage??(e.images?.length?e.images[0]:void 0),metaDescription:c||(e?.descriptionText?.length?e?.descriptionText.replace(/(\r\n|\n|\r)/gm,"").substring(0,130)+"...":""),canonicalUrl:n})),e.seo?.structuredData||this.seoService.setJsonLd(It.PRODUCT,e)}addHtmlExtension(e){return e?`${e}.html`:void 0}getProductUrl(e){return e?`/produits/${this.addHtmlExtension(e)}`:"/"}ngOnDestroy(){this.localizedRouteService.clearLocalizedUrlResolver(this.localizedUrlResolver),this.localizedRouteService.clearEntityWebSites(),this.routeParamsSubscription?.unsubscribe(),this.routeQueryParamsSubscription?.unsubscribe(),this.productSubscription?.unsubscribe()}onProductLoaded(e){this.product||(this.product=e,this.setupSeo(e)),ge(this.platformId)&&this.storeProductHistory()}onProductNotFoundEmitted(){this.productNotFound=!0}onSimilarProductsLoaded(e){if(this.product&&this.product.images?.length&&e?.length&&e.length>2){let n={data:{visited_product:{name:this.product.name,category_href:`https://${I.domain}/${this.product.productCategory?.slug??""}`,image:`${this.product.images[0].url.replace(I.s3.baseUrl,I.s3.baseCdnUrl)}`,href:`https://${I.domain}${this.getProductUrl(this.product.slug)}`},linked_product_1:{href:`https://${I.domain}${this.getProductUrl(e[0].slug)}`,image:`${e[0].images?.[0]?.url?.replace(I.s3.baseUrl,I.s3.baseCdnUrl)}?width=400`},linked_product_2:{href:`https://${I.domain}${this.getProductUrl(e[1].slug)}`,image:`${e[1].images?.[0]?.url?.replace(I.s3.baseUrl,I.s3.baseCdnUrl)}?width=400`},linked_product_3:{href:`https://${I.domain}${this.getProductUrl(e[2].slug)}`,image:`${e[2].images?.[0]?.url?.replace(I.s3.baseUrl,I.s3.baseCdnUrl)}?width=400`}}};this.analyticsService.postProductVisited(n)}}shouldShowConnectBubble(){return!!(this.product?.store&&this.product?.store?.activeStore)}storeProductHistory(){if(!this.product)return;let e=localStorage.getItem("product-history"),n=JSON.parse(e??"[]"),r=n.findIndex(v=>v.productId===this.product.id),c=new Date().toISOString();r===-1?n.push({productId:this.product.id,viewedAt:c}):n[r]=ne(ie({},n[r]),{viewedAt:c});let f=n.sort((v,V)=>new Date(V.viewedAt).getTime()-new Date(v.viewedAt).getTime()).slice(0,9);localStorage.setItem("product-history",JSON.stringify(f))}showProductsPopup(){}};o.\u0275fac=function(n){return new(n||o)(S(mt),S(We),S(Gt),S(Ze),S(Ie),S(_e),S(Be),S(Tt))},o.\u0275cmp=U({type:o,selectors:[["app-products-detail-page"]],decls:2,vars:1,consts:[[1,"min-h-screen","relative","isolate","overflow-hidden","lg:overflow-visible","pb-4","bg-white"],[1,"min-h-screen","w-full","bg-background","md:pt-3"],[1,"pointer-events-none","absolute","inset-x-0","top-0","-z-10","h-[32rem]"],[1,"wp-public-container","hidden","bg-white","text-[13.5px]","lg:block"],[1,"wp-public-container","mt-[1rem]","hidden","lg:block"],[1,"mt-0"],[3,"productNotFound","productLoaded","similarProductsLoaded","product","productSlug","requestQuery"],[3,"items"],[1,"bg-muted","rounded","w-1/2","h-8","animate-pulse"]],template:function(n,r){n&1&&m(0,Dr,6,4,"section",0)(1,Er,2,0,"section",1),n&2&&p(r.productNotFound?1:0)},dependencies:[j,ri,zt,Et],encapsulation:2,changeDetection:0});let i=o;return i})();export{ma as ProductsDetailPageComponent};
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.