1"use strict";(self.webpackChunkcava=self.webpackChunkcava||[]).push([[8733],{8733:(k,d,r)=>{r.r(d),r.d(d,{ProductListComponent:()=>L});var t=r(4557),_=r(8527),l=r(9223),m=r(5287),v=r(8215),g=r(344),h=r(4572),a=r(853),P=r(7280),u=r(665),f=r(1786),O=r(7023),M=r(7654),C=r(3828),x=r(3580),b=r(6769);const E=()=>({width:"50vw"}),D=i=>({jours:i});function I(i,p){1&i&&(t.j41(0,"div",26),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i&&(t.R7$(),t.JRh(t.bMT(2,1,"product.sold")))}function R(i,p){if(1&i&&(t.j41(0,"span",27),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i){const n=t.XpG().$implicit;t.R7$(),t.JRh(t.bMT(2,1,"promotion.type."+n.product.promoType))}}function T(i,p){if(1&i){const n=t.RV6();t.j41(0,"div",5)(1,"div",10)(2,"div",11),t.DNE(3,I,3,3,"div",12),t.j41(4,"div",13),t.DNE(5,R,3,3,"span",14),t.nrm(6,"img",15),t.k0s(),t.j41(7,"div",16)(8,"div",17),t.EFF(9),t.k0s(),t.j41(10,"div",18),t.nrm(11,"img",19),t.j41(12,"span",20),t.EFF(13),t.nI1(14,"productLocation"),t.k0s()(),t.j41(15,"div",21),t.nrm(16,"div",22),t.j41(17,"label"),t.EFF(18),t.nI1(19,"number"),t.nI1(20,"cvPrice"),t.nI1(21,"translate"),t.nI1(22,"translate"),t.k0s()()()(),t.j41(23,"div",23)(24,"p-button",24),t.bIt("onClick",function(o){t.eBV(n);const c=t.sdS(26);return t.Njj(c.toggle(o))}),t.k0s()()(),t.nrm(25,"p-menu",25,0),t.k0s()}if(2&i){const n=p.$implicit,e=t.XpG();t.R7$(2),t.Mz_("routerLink","/",n.product.url,""),t.R7$(),t.Y8G("ngIf",n.product.sold),t.R7$(2),t.Y8G("ngIf",n.product.isPromoted&&n.product.promoType),t.R7$(),t.Y8G("src",null==n.product.thumbnail?null:n.product.thumbnail.link,t.B4B),t.R7$(3),t.SpI(" ",n.product.name," "),t.R7$(4),t.JRh(t.brH(14,13,n.product.region,n.product.ville,n.product.abroad)),t.R7$(4),t.ZvI("font-p-m m-0 cv-p-price py-1 px-2 cv-global-gradient ",e.cssClass,""),t.R7$(),t.JRh(n.product.price>0?t.bMT(20,20,t.i5U(19,17,n.product.price,"."))+" "+t.bMT(21,22,"product.tnd"):t.bMT(22,24,"product.negotiable")),t.R7$(7),t.Y8G("model",n.options)("popup",!0)}}function w(i,p){if(1&i){const n=t.RV6();t.j41(0,"div",28)(1,"button",29),t.bIt("click",function(){t.eBV(n);const o=t.XpG();return t.Njj(o.getProducts())}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}2&i&&(t.R7$(2),t.JRh(t.bMT(3,1,"global.show_more")))}function A(i,p){1&i&&(t.j41(0,"div",30),t.nrm(1,"img",31),t.j41(2,"p"),t.EFF(3),t.nI1(4,"translate"),t.nI1(5,"translate"),t.k0s()()),2&i&&(t.R7$(3),t.Lme("",t.bMT(4,2,"global.sorry")," ",t.bMT(5,4,"global.no_item_found"),""))}let L=(()=>{class i{constructor(n,e,o,c,s,y,S){this.alertService=n,this.productService=e,this.router=o,this.confirmationService=c,this.translate=s,this.userService=y,this.spinner=S,this.productsWithOptions=[],this.options=!1,this.searchPageable={page:0,size:20,sort:"DESC",property:"shopCreatedAt"},this.lastPage=!0,this.noProducts=!1,this.cssClass="",this.relaunchAlert=!1,this.relaunchDays=0,(0,t.QZP)(()=>{this.userService.profileSignal()&&this.getProducts()})}ngOnInit(){"ar"===this.translate.currentLang&&(this.cssClass="ar-version")}getProducts(){this.spinner.show(),(0,a.s)(this.productService.getConnectedUserProducts(this.searchPageable)).then(n=>{0===this.searchPageable.page?this.productsWithOptions=this.setProductsOptions(n.items):this.productsWithOptions.push(...this.setProductsOptions(n.items)),this.noProducts=0===this.productsWithOptions.length,this.lastPage=n.lastPage,this.searchPageable.page++,this.spinner.hide()}).catch(n=>{this.spinner.hide(),this.noProducts=!0,this.alertService.error("global.failed_operation")})}getProdOptions(n,e){const o=[];return n.owner?.shop?.isPro&&!n.sold&&o.push({label:`${this.translate.instant("product.relaunch")} <i class="pi pi-info-circle mx-2"></i>`,escape:!1,tooltipOptions:{tooltipLabel:this.translate.instant("product.relaunch_description"),tooltipPosition:"right"},command:()=>this.relaunchProduct(n.id)}),o.push({label:this.translate.instant("global.edit"),command:()=>this.editAnnouncement(n.id)},{label:this.translate.instant(n.sold?"product.back_to_sale":"product.mark_sold"),command:()=>n.sold?this.markAsUnSold(n.id,e):this.markAsSold(n.id,e)},{label:this.translate.instant("product.promote"),routerLink:["/profile/overview",{outlets:{profile:"create-promotion"}}]},{label:this.translate.instant("global.delete"),command:()=>this.deleteProduct(n.id,e)}),o}setProductsOptions(n){const e=[];
1return n.forEach((o,c)=>{const s={product:o,options:this.getProdOptions(o,c)};e.push(s)}),e}editAnnouncement(n){return this.router.navigate(["/creatAnnonce"],{queryParams:{id:n}}),!1}deleteProduct(n,e){this.confirmationService.confirm({message:this.translate.instant("product.confirm_delete"),accept:()=>{(0,a.s)(this.productService.deleteById([n])).then(o=>{this.alertService.success("global.success_delete"),this.productsWithOptions.splice(e,1)}).catch(o=>{this.alertService.error("global.failed_operation")})}})}markAsSold(n,e){this.spinner.show(),(0,a.s)(this.productService.markAsSold(n)).then(o=>{this.productsWithOptions[e].product.sold=!0,this.productsWithOptions[e].options=this.getProdOptions(this.productsWithOptions[e].product,e),this.spinner.hide()}).catch(o=>{console.log(" markAsSold error ",o),this.spinner.hide(),this.alertService.error("global.failed_operation")})}markAsUnSold(n,e){this.spinner.show(),(0,a.s)(this.productService.markAsUnSold(n)).then(o=>{this.productsWithOptions[e].product.sold=!1,this.productsWithOptions[e].options=this.getProdOptions(this.productsWithOptions[e].product,e),this.spinner.hide()}).catch(o=>{console.log(" markAsSold error ",o),this.spinner.hide(),this.alertService.error("global.failed_operation")})}relaunchProduct(n){(0,a.s)(this.productService.relaunch(n)).then(e=>{"true"===e.toString()?(this.alertService.success("global.success_operation"),this.searchPageable.page=0,this.getProducts()):(this.relaunchDays=parseInt(e,10),this.relaunchAlert=!0)}).catch(e=>{this.alertService.error("global.failed_operation")})}static{this.\u0275fac=function(e){return new(e||i)(t.rXU(f.u),t.rXU(O.bk),t.rXU(M.Ix),t.rXU(C.td),t.rXU(l.c$),t.rXU(x.D),t.rXU(b.ex))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-product-list"]],decls:15,vars:21,consts:[["menu",""],[1,"profile-list-items"],[1,"Apropos-vender","w-100","mb-2"],[1,"pb-2"],[1,"profile-items-grid","mx-auto","mb-4"],[1,"profile-item-container"],["class","d-flex justify-content-center align-items-center",4,"ngIf"],["class","w-100 annonce-vide text-center cv-no-elements my-5",4,"ngIf"],[3,"visibleChange","header","visible","modal","draggable","resizable"],[1,"m-0","py-4"],[1,"position-relative"],[1,"cv-product","pointer","position-relative",3,"routerLink"],["class","sold-tag",4,"ngIf"],[1,"overflow-hidden","cv-p-image"],["class","position-absolute cv-p-sponsored font-p-l",4,"ngIf"],[3,"src"],[1,"cv-p-details"],[1,"cv-p-title","my-1","font-p-m","px-2","cv-ellipsis"],[1,"cv-p-location","d-flex","align-products-center","pt-1","px-2"],["src","assets/img/location-orange-at-2x.webp","alt","localisation"],[1,"font-p-e-l","text-truncate","px-1","cv-ellipsis"],[1,"cv-p-price-shop","font-p-m","d-flex","justify-content-between","align-items-center"],[1,"cv-p-shop-owner","px-2"],[1,"cv-p-menu","position-absolute"],["icon","pi pi-ellipsis-v",3,"onClick"],[3,"model","popup"],[1,"sold-tag"],[1,"position-absolute","cv-p-sponsored","font-p-l"],[1,"d-flex","justify-content-center","align-items-center"],[1,"btn","btn-more",3,"click"],[1,"w-100","annonce-vide","text-center","cv-no-elements","my-5"],["src","assets/img/empty-annonce.webp"]],template:function(e,o){1&e&&(t.j41(0,"div",1)(1,"div",2)(2,"label",3),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"div",4),t.Z7z(6,T,27,26,"div",5,t.fX1),t.k0s(),t.DNE(8,w,4,3,"div",6)(9,A,6,6,"div",7),t.k0s(),t.j41(10,"p-dialog",8),t.nI1(11,"translate"),t.mxI("visibleChange",function(s){return t.DH7(o.relaunchAlert,s)||(o.relaunchAlert=s),s}),t.j41(12,"p",9),t.EFF(13),t.nI1(14,"translate"),t.k0s()()),2&e&&(t.R7$(3),t.JRh(t.bMT(4,11,"user.product_list")),t.R7$(3),t.Dyx(o.productsWithOptions),t.R7$(2),t.Y8G("ngIf",!o.lastPage),t.R7$(),t.Y8G("ngIf",o.noProducts),t.R7$(),t.Aen(t.lJ4(18,E)),t.FS9("header",t.bMT(11,13,"global.alert")),t.R50("visible",o.relaunchAlert),t.Y8G("modal",!0)("draggable",!1)("resizable",!1),t.R7$(3),t.SpI(" ",t.i5U(14,15,"product.relaunch_error_text",t.eq3(19,D,o.relaunchDays))," "))},dependencies:[h.bT,_.Wk,g.DialogModule,g.Dialog,h.QX,l.h,l.D9,v.ProductLocationPipe,m.CvPricePipe,P.$n,u.Mk,u.W1],styles:["[_nghost-%COMP%]{--profile-grid-items: repeat( 2,1fr )}@media (max-width: 500px){.profile-list-items[_ngcontent-%COMP%]{padding-left:5px!important;padding-right:5px!important}.profile-items-grid[_ngcontent-%COMP%]{gap:4px}[_nghost-%COMP%]{--profile-grid-items: repeat( 2,1fr )}}@media (min-width: 501px) and (max-width: 1380px){[_nghost-%COMP%]{--profile-grid-items: repeat( 3,1fr )}}@media (min-width: 1381px) and (max-width: 1500px){[_nghost-%COMP%]{--profile-grid-items: repeat( 4,1fr )}}@media (min-width: 1501px){[_nghost-%COMP%]{--profile-grid-items: repeat( 4,1fr )}}.profile-items-grid[_ngcontent-%COMP%]{--grid-layout-gap: 6px;--grid-column-count: 4;--grid-item--min-width: 155px;--gap-count: calc(var(--grid-column-count) - 1);--total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap));--grid-item--max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count));display:grid;grid-template-columns:repeat(auto-fill,minmax(max(var(--grid-item--min-width),var(--grid-item--max-width)),1fr));grid-gap:var(--grid-layout-gap)}@media (max-width: 650px){.profile-items-grid[_ngcontent-%COMP%] .cv-product[_ngcontent-%COMP%]{height:230px!important}.profile-items-grid[_ngcontent-%COMP%] .cv-product[_ngcontent-%COMP%] .cv-p-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:155px!important}.profile-items-grid[_ngcontent-%COMP%] .cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%]{padding:0}.profile-items-grid[_ngcontent-%COMP%] .cv-product[_ngcontent-%COMP%] .cv-p-title[_ngcontent-%COMP%], .profile-items-grid[_ngcontent-%COMP%] .cv-product[_ngcontent-%COMP%] .cv-p-price[_ngcontent-%COMP%]{font-size:12px!important}}.card-container[_ngcontent-%COMP%]{border-radius:3px;box-shadow:1px 1px 6px 1px #dedede}.option-container[_ngcontent-%COMP%]{background:#fff;box-shadow:1px 1px 6px #939393;height:215px;width:207px;border-radius:4px;position:fixed;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding-top:14px}.option-container[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:500;font-size:15px}.option-container[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:hover{cursor:pointer}.sold-tag[_ngcontent-%COMP%]{background:#f56b2a;height:30px;width:67px;position:absolute;top:-2px;z-index:99;font-family:Poppins-Regular;
1left:-4px;border-radius:7px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;font-size:13px}.profile-item-container[_ngcontent-%COMP%]{min-width:0}.cv-product[_ngcontent-%COMP%]{flex:20%;position:relative;overflow:hidden;width:100%;height:272px;background:#fff 0% 0% no-repeat padding-box;box-shadow:2px 3px 3px #2120201a;border-radius:9px}.cv-product[_ngcontent-%COMP%] .cv-p-sponsored[_ngcontent-%COMP%]{background-color:#37961d;color:#fff;padding:2px 6px;border-radius:6px;font-size:12px;top:3px;left:3px;z-index:1}.cv-product[_ngcontent-%COMP%] .cv-p-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{transition:transform .5s ease;height:180px;width:100%;object-fit:cover}.cv-product[_ngcontent-%COMP%] .cv-p-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{transform:scale(1.2)!important}.cv-product[_ngcontent-%COMP%] .cv-p-title[_ngcontent-%COMP%]{font-size:15px;color:#383838;letter-spacing:0px;text-align:start;max-width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-weight:700}.cv-product[_ngcontent-%COMP%] .cv-p-location[_ngcontent-%COMP%]{align-items:center}.cv-product[_ngcontent-%COMP%] .cv-p-location[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:20px;height:20px}.cv-product[_ngcontent-%COMP%] .cv-p-location[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{max-width:100%;letter-spacing:0px;color:#383838;font-size:14px;font-weight:200}.cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%]{padding-top:5px}.cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%] .cv-p-shop-owner[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:24px;height:24px}.cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%] .cv-p-shop-owner[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f56b2a}.cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%] .cv-p-price[_ngcontent-%COMP%]{font-size:16px;color:#fff;border-radius:9px 0 0;background:#f56b2a;letter-spacing:0px;background:linear-gradient(90deg,#f56b2a,#f79a3c);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#F56B2A,endColorstr=#F79A3C,GradientType=1)}.cv-product[_ngcontent-%COMP%] .cv-p-price-shop[_ngcontent-%COMP%] .cv-p-price.ar-version[_ngcontent-%COMP%]{border-radius:0 9px 0 0}.cv-p-menu[_ngcontent-%COMP%]{top:3px;right:3px}.cv-p-menu[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-radius:50%;width:27px;height:27px}.cv-p-menu[_ngcontent-%COMP%] .cv-profile-list[_ngcontent-%COMP%]{transform:translate3d(-128px,28px,0)}"]})}}return i})()}}]);
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.