1import{a as ye}from"./chunk-RGWTER5P.js";import{a as Me}from"./chunk-PCQZQ3U4.js";import{a as Ee}from"./chunk-HSMEVITP.js";import{a as me,d as ge,e as Se,f as he}from"./chunk-JDYWGDNH.js";import"./chunk-IRONFM6M.js";import{a as ue,b as _e}from"./chunk-VHX354RR.js";import{a as Ce,b as ve}from"./chunk-22WJKAIZ.js";import{b as Pe}from"./chunk-SLWPYULI.js";import"./chunk-RPDGXIQT.js";import"./chunk-RFHORXFH.js";import"./chunk-44BDWJO3.js";import"./chunk-YPSMJDVJ.js";import"./chunk-F6HJUGGY.js";import{a as pe,b as de}from"./chunk-W6FQLWKF.js";import"./chunk-6MXSXX3N.js";import"./chunk-MT62CIDI.js";import{a as le,b as ce}from"./chunk-BXNQRMY5.js";import"./chunk-RFCDL6VX.js";import"./chunk-XWDSR7V3.js";import"./chunk-3THAQ3J3.js";import{b as se}from"./chunk-OAED5FIG.js";import{a as ie,b as ne}from"./chunk-P37GQ53N.js";import"./chunk-YK3HMHC4.js";import"./chunk-2DRXLVRR.js";import{d as re,e as ae}from"./chunk-OFHUO5H7.js";import"./chunk-M3XSAKW4.js";import"./chunk-H76LZNGX.js";import"./chunk-PGR2NPNS.js";import"./chunk-OZD37XM5.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-AVEXXPAT.js";import{ja as te}from"./chunk-FHU4TM37.js";import{a as fe}from"./chunk-UUEFXD6N.js";import{D as ee,c as J,g as X,l as Z}from"./chunk-Q2KKZV5J.js";import{a as $}from"./chunk-JICM7NVH.js";import{a as oe}from"./chunk-BD6EMWWF.js";import"./chunk-AB6CKZTE.js";import{c as q,d as Q,e as Y}from"./chunk-DIGPPQJE.js";import{o as W,r as K,s as j,x as z}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import{D as B,j as U}from"./chunk-ZAQTNZYS.js";import{c as H}from"./chunk-SRTXE2HR.js";import{Dc as y,Ec as T,Fa as V,Fc as b,Jb as c,Kc as A,Lb as R,Mb as O,Nb as I,Rb as v,Ub as F,Uc as d,Vb as D,Vc as u,Wb as l,Xb as s,Yb as _,_a as w,ac as E,da as P,db as a,gc as m,hc as p,la as g,ma as S,sa as N,sb as G,uc as h,vc as f,wc as x,xc as k,yb as C}from"./chunk-NTTV6FWH.js";import{g as M}from"./chunk-W7GRJBO5.js";var Oe=()=>({minWidth:"150px"}),Te=()=>({minWidth:"180px"}),L=()=>({minWidth:"170px"}),xe=()=>({"min-width":"50rem"}),we=(r,t)=>t.id;function Re(r,t){if(r&1){let e=E();l(0,"button",8),m("click",function(){g(e);let n=p();return S(n.onResetFilters())}),_(1,"i",9),h(2),d(3,"translate"),s()}r&2&&(a(2),x(" ",u(3,1,"MANAGER.SHOP.FILTER_RESET")," "))}function ke(r,t){r&1&&_(0,"app-widget-loading")}function Le(r,t){if(r&1){let e=E();l(0,"app-widget-api-error",10),m("retry",function(){g(e);let n=p();return S(n.loadProducts())}),s()}}function Ne(r,t){if(r&1){let e=E();l(0,"app-widget-manager-empty-state",11),m("ctaClick",function(){g(e);let n=p();return S(n.onAddProduct())}),s()}}function Ve(r,t){if(r&1){let e=E();l(0,"p-select",27),d(1,"translate"),b("ngModelChange",function(n){g(e);let o=p(3);return T(o.bulkCollectionValue,n)||(o.bulkCollectionValue=n),S(n)}),m("onChange",function(){g(e);let n=p(3);return S(n.onBulkMoveCollection())}),s()}if(r&2){let e=p(3);O(A(8,L)),y("ngModel",e.bulkCollectionValue),c("options",e.collectionOptions)("placeholder",u(1,6,"MANAGER.SHOP.BULK_MOVE_COLLECTION"))("showClear",!0)}}function Ge(r,t){if(r&1){let e=E();l(0,"div",12)(1,"div",20)(2,"span",21),h(3),d(4,"translate"),s(),l(5,"div",22)(6,"p-select",23),d(7,"translate"),b("ngModelChange",function(n){g(e);let o=p(2);return T(o.bulkStatusValue,n)||(o.bulkStatusValue=n),S(n)}),m("onChange",function(){g(e);let n=p(2);return S(n.onBulkStatus())}),s(),C(8,Ve,2,9,"p-select",24),l(9,"p-button",25),d(10,"translate"),m("onClick",function(){g(e);let n=p(2);return S(n.onBulkDelete())}),s()(),l(11,"p-button",26),d(12,"translate"),m("onClick",function(){g(e);let n=p(2);return S(n.clearSelection())}),s()()()}if(r&2){let e=p(2);a(3),k(" ",e.selectedProducts.length," ",u(4,12,"MANAGER.SHOP.BULK_SELECTED")," "),a(3),O(A(20,L)),y("ngModel",e.bulkStatusValue),c("options",e.bulkStatusOptions)("placeholder",u(7,14,"MANAGER.SHOP.BULK_CHANGE_STATUS")),a(2),v(e.collectionOptions.length>0?8:-1),a(),c("label",u(10,16,"MANAGER.SHOP.BULK_DELETE"))("outlined",!0),a(2),c("label",u(12,18,"MANAGER.SHOP.BULK_DESELECT"))("text",!0)}}function Ie(r,t){r&1&&(l(0,"tr")(1,"th",28),_(2,"p-tableHeaderCheckbox"),s(),_(3,"th",29),l(4,"th"),h(5),d(6,"translate"),s(),l(7,"th"),h(8),d(9,"translate"),s(),l(10,"th"),h(11),d(12,"translate"),s(),l(13,"th"),h(14),d(15,"translate"),s(),l(16,"th",30),d(17,"translate"),_(18,"i",31),s(),l(19,"th"),h(20),d(21,"translate"),s(),l(22,"th"),h(23),d(24,"translate"),s(),_(25,"th",32),s()),r&2&&(a(5),f(u(6,7,"MANAGER.SHOP.COL_TIT
1LE")),a(3),f(u(9,9,"MANAGER.SHOP.COL_SOURCE")),a(3),f(u(12,11,"MANAGER.SHOP.COL_PRICE")),a(3),f(u(15,13,"MANAGER.SHOP.COL_STOCK")),a(2),c("pTooltip",u(17,15,"MANAGER.SHOP.COL_FEATURED")),a(4),f(u(21,17,"MANAGER.SHOP.COL_STATUS")),a(3),f(u(24,19,"MANAGER.SHOP.COL_MODERATION")))}function Fe(r,t){if(r&1&&_(0,"img",34),r&2){let e=p().$implicit;c("src",e.imageUrl,w)("alt",e.title)}}function De(r,t){r&1&&(l(0,"div",35),_(1,"i",51),s())}function He(r,t){if(r&1&&(l(0,"div",37),_(1,"i",52),h(2),d(3,"translate"),s()),r&2){let e=p().$implicit;a(2),k(" ",e.variants.length," ",u(3,2,"MANAGER.SHOP.VARIANTS_TOTAL")," ")}}function Ue(r,t){if(r&1&&_(0,"p-tag",38),r&2){let e=p().$implicit;c("value",e.sourceLabel||e.source)("rounded",!0)}}function Be(r,t){r&1&&(l(0,"span",39),h(1,"-"),s())}function We(r,t){if(r&1){let e=E();l(0,"tr")(1,"td"),_(2,"p-tableCheckbox",33),s(),l(3,"td"),C(4,Fe,1,2,"img",34)(5,De,2,0,"div",35),s(),l(6,"td")(7,"a",36),h(8),s(),C(9,He,4,4,"div",37),s(),l(10,"td"),C(11,Ue,1,2,"p-tag",38)(12,Be,2,0,"span",39),s(),l(13,"td"),h(14),s(),l(15,"td")(16,"span"),h(17),s()(),l(18,"td",40)(19,"button",41),d(20,"translate"),m("click",function(){let n=g(e).$implicit,o=p(2);return S(o.onToggleFeatured(n))}),_(21,"i",42),s()(),l(22,"td"),_(23,"p-tag",43),s(),l(24,"td")(25,"div",44),_(26,"p-tag",45)(27,"p-tag",46),s()(),l(28,"td")(29,"div",47),_(30,"p-button",48),d(31,"translate"),l(32,"p-button",49),d(33,"translate"),m("onClick",function(){let n=g(e).$implicit,o=p(2);return S(o.onDuplicate(n))}),s(),l(34,"p-button",50),d(35,"translate"),m("onClick",function(){let n=g(e).$implicit,o=p(2);return S(o.onDelete(n))}),s()()()()}if(r&2){let e=t.$implicit,i=p(2);a(2),c("value",e),a(2),v(e.imageUrl?4:5),a(3),c("routerLink","/studio/shop/products/"+e.id),a(),x(" ",e.title," "),a(),v(i.isVariantProduct(e)?9:-1),a(2),v(e.source!=="manual"?11:12),a(3),f(i.getDisplayPrice(e)),a(2),I(i.getDisplayStock(e).cssClass),a(),f(i.getDisplayStock(e).text),a(2),R("active",e.isFeatured),c("pTooltip",u(20,32,e.isFeatured?"MANAGER.SHOP.UNMARK_FEATURED":"MANAGER.SHOP.MARK_FEATURED")),a(2),c("ngClass",e.isFeatured?"pi-star-fill":"pi-star"),a(2),c("value",i.getStatusLabel(e.status))("severity",i.getStatusSeverity(e.status))("rounded",!0),a(3),c("value",i.getModerationLabel(e.moderationStatus))("severity",i.getModerationSeverity(e.moderationStatus))("rounded",!0)("pTooltip",i.getModerationTooltip(e)),a(),c("value",i.getGoogleLabel(e))("severity",i.getGoogleSeverity(e))("rounded",!0)("pTooltip",i.getGoogleTooltip(e)),a(3),c("text",!0)("routerLink","/studio/shop/products/"+e.id)("pTooltip",u(31,34,"MANAGER.SHOP.BTN_EDIT")),a(2),c("text",!0)("pTooltip",u(33,36,"MANAGER.SHOP.BTN_DUPLICATE")),a(2),c("text",!0)("pTooltip",u(35,38,"MANAGER.SHOP.BTN_DELETE"))}}function Ke(r,t){if(r&1&&_(0,"img",56),r&2){let e=p().$implicit;c("src",e.imageUrl,w)("alt",e.title)}}function je(r,t){r&1&&(l(0,"div",57),_(1,"i",51),s())}function ze(r,t){if(r&1&&_(0,"p-tag",38),r&2){let e=p().$implicit;c("value",e.sourceLabel||e.source)("rounded",!0)}}function qe(r,t){if(r&1){let e=E();l(0,"div",53)(1,"div",54)(2,"p-checkbox",55),m("ngModelChange",function(){let n=g(e).$implicit,o=p(2);return S(o.toggleSelection(n))}),s(),C(3,Ke,1,2,"img",56)(4,je,2,0,"div",57),l(5,"div",58)(6,"a",59),h(7),s(),l(8,"div",60)(9,"span",61),h(10),s(),C(11,ze,1,2,"p-tag",38),_(12,"p-tag",62)(13,"p-tag",63),s()(),l(14,"div",64),_(15,"p-button",65),l(16,"p-button",66),m("onClick",function(){let n=g(e).$implicit,o=p(2);return S(o.onDelete(n))}),s()()()()}if(r&2){let e=t.$implicit,i=p(2);R("product-card-mobile--selected",i.isSelected(e)),a(2),c("binary",!0)("ngModel",i.isSelected(e)),a(),v(e.imageUrl?3:4),a(3),c("routerLink","/studio/shop/products/"+e.id),a(),x(" ",e.title," "),a(3),f(i.formatPrice(e.priceCents,e.currency)),a(),v(e.source!=="manual"?11:-1),a(),c("value",i.getStatusLabel(e.status))("severity",i.getStatusSeverity(e.status))("rounded",!0),a(),c("value",i.getModerationLabel(e.moderationStatus))("severity",i.getModerationSeverity(e.moderationStatus))("rounded",!0)("pTooltip",i.getModerationTooltip(e)),a(2),c("text",!0)("routerLink","/studio/shop/products/"+e.id),a(),c("text",!0)}}function Qe(r,t){if(r&1){let e=E();l(0,"p-paginator",67),m("onPageChange",function(n){g(e);let o=p(2);return S(o.onPageChange(n))}),s()}if(r&2){let e=p(2);c("rows",e.limit)("totalRecords",e.total)("first",(e.page-1)*e.limit)}}function Ye(r,t){if(r&1){let e=E();C(0,Ge,13,21,"div",12),l(1,"div",13)(2,"p-table",14),b("selectionChange",function(n){g(e);let o=p();return T(o.selectedProducts,n)||(o.selectedProducts=n),S(n)}),C(3,Ie,26,21,"ng-template",15)(4,We,36,40,"ng-template",16),s()(),l(5,"div",17),F(6,qe,17,19,"div",18,we),s(),C(8,Qe,1,3,"p-paginator",19)}if(r&2){let e=p();v(e.selectedProducts.length>0?0:-1),a(2),c("value",e.products)("tableStyle",A(5,xe)),y("selection",e.selectedProducts),a(4),D(e.products),a(2),v(e.total>e.limit?8:-1)}}var be=class r{shopService=P(Me);toastService=P($);confirmService=P(fe);translateService=P(q);platformId=P(V);route=P(W);router=P(K);qf=P(Ee);destroyRef=P(N);eventSource=null;filters;loading=!0;error="";products=[];total=0;search="";statusFilter="";moderationFilter="";stockFilter="";googleFilter="";page=1;limit=20;selectedProducts=[];bulkStatusValue="";bulkStatusOptions=[{label:"Publi\xE9",value:"active"},{label:"Brouillon",value:"draft"},{label:"Archiv\xE9",value:"archived"}];bulkCollectionValue="";collectionOptions=[];statusOptions=[];moderationOptions=[];stockOptions=[];googleOptions=[];buildFilterOptions(){this.statusOptions=[{label:this.translateService.instant("MANAGER.SHOP.FILTER_ALL_STATUS"),value:""},{label:this.translateService.instant("MANAGER.SHOP.PRODUCT_STATUS_ACTIVE"),value:"active"},{label:this.translateService.instant("MANAGER.SHOP.PRODUCT_STATUS_DRAFT"),value:"draft"},{label:this.translateService.instant("MANAGER.SHOP.PRODUCT_STATUS_ARCHIVED"),value:"archived"}],this.moderationOptions=[{label:this.translateService.instant("MANAGER.SHOP.FILTER_ALL_MODERATION"),value:""},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_PENDING"),value:"pending"},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_IN_REVIEW"),value:"in_review"},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_APPROVED"),value:"approved"},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_REJECTED"),value:"rejected"},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_RE_REVIEW"),value:"re_review"},{label:this.translateService.instant("MANAGER.SHOP.MODERATION_STATUS_MANUAL"),value:"manual"}],this.stockOptions=[{label:this.translateService.instant("MANAGER.SHOP.FILTER_ALL_STOCK"),value:""},{label:this.translateService.instant("MANAGER.SHOP.STOCK_IN_STOCK"),value:"in_stock"},{label:this.translateService.instant("MANAGER.SHOP.STOCK_LOW"),value:"low_stock"},{label:this.translateService.instant("MANAGER.SHOP.STOCK_OUT"),value:"out_of_stock"}],this.googleOptions=[{label:this.translateService.instant("MANAGER.SHOP.FILTER_ALL_GOOGLE"),value:""},{label:this.translateService.instant("MANAGER.SHOP.GOOGLE_PUBLISHED"),value:"published"},{label:this.translateService.instant("MANAGER.SHOP.GOOGLE_DISAPPROVED"),value:"disapproved"},{label:this.translateService.instant("MANAGER.SHOP.GOOGLE_PENDING"),value:"pending"},{label:this.translateService.instant("MANAGER.SHOP.GOOGLE_NOT_PUBLISHED"),value:"not_published"}]}ngOnInit(){this.filters=this.qf.init(this.route,[{key:"search",default:""},{key:"status",default:""},{key:"moderation",default:""},{key:"stock",default:""},{key:"google",default:""},{key:"page",default:1,type:"number"},{key:"limit",default:20,type:"number"}],()=>this.onFiltersChanged(),this.destroyRef),this.syncFromFilters(),this.buildFilterOptions(),this.loadProducts(),this.loadCollections(),this.startModerationStream()}syncFromFilters(){let t=this.filters.values();this.search=t.search,this.statusFilter=t.status,this.moderationFilter=t.moderation,this.stockFilter=t.stock,this.googleFilter=t.google,this.page=t.page,this.limit=t.limit}onFiltersChanged(){this.syncFromFilters(),this.loadProducts()}ngOnDestroy(){this.eventSource&&(this.eventSource.close(),this.eventSource=null)}startModerationStream(){H(this.platformId)&&(this.eventSource=this.shopService.getModerationStatusStream(t=>{for(let e of t){let i=this.products.find(n=>n.id===e.id);i&&i.moderationStatus!==e.moderationStatus&&(i.moderationStatus=e.moderationStatus)}}))}loadCollections(){return M(this,null,function*(){try{let t=yield this.shopService.listCollections();this.collectionOptions=[{label:this.translateService.instant("MANAGER.SHOP.BULK_NO_COLLECTION"),value:"__none__"},...t.map(e=>({label:e.title,value:e.id}))]}catch{this.collectionOptions=[]}})}loadProducts(){return M(this,null,function*(){this.loading=!0,this.error="";try{let t=yield this.shopService.listProducts({page:this.page,limit:this.limit,status:this.statusFilter||void 0,moderationStatus:this.moderationFilter||void 0,stockFilter:this.stockFilter||void 0,googleStatus:this.googleFilter||void 0,search:this.search||void 0});this.products=t.data,this.total=t.total}catch(t){this.error=t?.error?.message||t?.message||"Error"}finally{this.loading=!1}})}onAddProduct(){this.router.navigate(["/studio/shop/products/new"],{queryParamsHandling:"preserve"})}onSearch(){this.filters.set({search:this.search,page:1})}onStatusFilter(){this.filters.set({status:this.statusFilter,page:1})}onGoogleFilter(){this.filters.set({google:this.googleFilter,page:1})}onModerationFilter(){this.filters.set({moderation:this.moderationFilter,page:1})}onStockFilter(){this.filters.set({stock:this.stockFilter,page:1})}onPageChange(t){let e=Math.floor(t.first/t.rows)+1;this.filters.set({page:e,limit:t.rows})}onResetFilters(){this.filters.reset()}formatPrice(t,e="EUR"){return(t/100).toFixed(2)+" "+e}getDisplayPrice(t){if(t.variants?.length>0){let e=t.variants.filter(o=>o.isActive).map(o=>o.salePriceCents??o.priceCents);if(e.length===0)return this.formatPrice(t.salePriceCents??t.priceCents,t.currency);let i=Math.min(...e),n=Math.max(...e);return i===n?this.formatPrice(i,t.currency):(i/100).toFixed(2)+" - "+(n/100).toFixed(2)+" "+t.currency}return this.formatPrice(t.salePriceCents??t.priceCents,t.currency)}getDisplayStock(t){if(t.variants?.length>0){if(t.variants.some(i=>i.stockQuantity!=null&&i.stockQuantity>=0)||t.trackStock){let i=t.variants.reduce((n,o)=>n+(o.stockQuantity||0),0);return{text:String(i),cssClass:i===0?"text-danger":""}}return{text:"\u221E",cssClass:"text-muted"}}if(t.trackStock){let e=t.stockQuantity??0;
1return{text:e===0?"0":String(e),cssClass:e===0?"text-danger":""}}return{text:"\u221E",cssClass:"text-muted"}}isVariantProduct(t){return t.variants?.length>0}getStatusSeverity(t){switch(t){case"active":return"success";case"draft":return"warn";case"archived":return"secondary";case"out_of_stock":return"danger";default:return"info"}}getStatusLabel(t){return this.translateService.instant(`MANAGER.SHOP.PRODUCT_STATUS_${t.toUpperCase()}`)}getModerationSeverity(t){switch(t){case"approved":return"success";case"rejected":return"danger";case"pending":return"warn";case"in_review":return"info";case"re_review":return"warn";case"manual":return"info";default:return"secondary"}}getModerationLabel(t){return this.translateService.instant(`MANAGER.SHOP.MODERATION_STATUS_${t.toUpperCase()}`)}getGoogleSeverity(t){switch(t.googleListing?.status){case"published":return"success";case"disapproved":return"danger";case"pending":case"syncing":return"warn";case"error":return"danger";default:return"secondary"}}getGoogleLabel(t){let e=t.googleListing?.status;return!e||e==="excluded"||e==="deleted"?this.translateService.instant("MANAGER.SHOP.GOOGLE_NOT_PUBLISHED"):this.translateService.instant(`MANAGER.SHOP.GOOGLE_STATUS_${e.toUpperCase()}`)}getGoogleTooltip(t){let e=t.googleListing;if(!e)return"";if(e.status==="disapproved"){let i=this.translateService.instant("MANAGER.SHOP.GOOGLE_DISAPPROVED_TOOLTIP",{count:e.rejectionCount});return e.autoFixable?`${i} ${this.translateService.instant("MANAGER.SHOP.GOOGLE_AUTOFIX_HINT")}`:i}return e.status==="published"&&e.lastPublishedAt?this.translateService.instant("MANAGER.SHOP.GOOGLE_PUBLISHED_TOOLTIP",{date:new Date(e.lastPublishedAt).toLocaleDateString()}):""}getModerationTooltip(t){if(t.moderationStatus==="rejected"){let e=[];
1if(t.moderationRejectionCodes?.length)for(let o of t.moderationRejectionCodes){let Ae=this.translateService.instant(`MANAGER.SHOP.REJECTION_CODE_${o}_DESC`);e.push(Ae)}if(t.moderationRejectionCodes?.includes("MISSING_REQUIRED_INFO")&&t.moderationCategoryRequirementGroup){let o=this.translateService.instant(`MANAGER.SHOP.CATEGORY_REQ_${t.moderationCategoryRequirementGroup}`);e.push(o)}if(e.length)return e.join(` 2 3`);let i=t.moderationResult;if(i?.aiAnalysis?.rejectionReason)return i.aiAnalysis.rejectionReason;let n=i?.checks?.filter(o=>!o.passed);return n?.length?n.map(o=>o.reason||o.name).join(". "):this.translateService.instant("MANAGER.SHOP.MODERATION_REJECTED_GENERIC")}return t.moderationStatus==="pending"||t.moderationStatus==="in_review"?this.translateService.instant("MANAGER.SHOP.MODERATION_PENDING_TOOLTIP"):""}onToggleFeatured(t){return M(this,null,function*(){try{let e=yield this.shopService.updateProduct(t.id,{isFeatured:!t.isFeatured});t.isFeatured=e.isFeatured}catch(e){this.toastService.error(e?.error?.message||"Error")}})}onDuplicate(t){return M(this,null,function*(){try{yield this.shopService.duplicateProduct(t.id),this.toastService.success(this.translateService.instant("MANAGER.SHOP.PRODUCT_DUPL
3ICATED")),this.loadProducts()}catch(e){this.toastService.error(e?.error?.message||"Error")}})}onDelete(t){return M(this,null,function*(){if(yield this.confirmService.confirm({message:this.translateService.instant("MANAGER.SHOP.PRODUCT_DELETE_CONFIRM"),header:this.translateService.instant("MANAGER.SHOP.PRODUCT_DELETE_TITLE"),severity:"danger",acceptLabel:this.translateService.instant("MANAGER.SHOP.BTN_DELETE"),rejectLabel:this.translateService.instant("MANAGER.SHOP.BTN_CANCEL")}))try{yield this.shopService.deleteProduct(t.id),this.toastService.success(this.translateService.instant("MANAGER.SHOP.PRODUCT_DELETED")),this.loadProducts()}catch(i){this.toastService.error(i?.error?.message||"Error")}})}isSelected(t){return this.selectedProducts.some(e=>e.id===t.id)}toggleSelection(t){this.isSelected(t)?this.selectedProducts=this.selectedProducts.filter(e=>e.id!==t.id):this.selectedProducts=[...this.selectedProducts,t]}clearSelection(){this.selectedProducts=[]}onBulkStatus(){return M(this,null,function*(){if(!this.bulkStatusValue||!this.selectedProducts.length)return;let t=this.selectedProducts.map(i=>i.id),e=this.bulkStatusValue;try{let i=yield this.shopService.bulkUpdateStatus(t,e);this.toastService.success(this.translateService.instant("MANAGER.SHOP.BULK_STATUS_SUCCESS",{count:i.updated})),this.selectedProducts=[],this.bulkStatusValue="",this.loadProducts()}catch(i){this.toastService.error(i?.error?.message||"Error")}})}onBulkDelete(){return M(this,null,function*(){let t=this.selectedProducts.length;if(!(yield this.confirmService.confirm({message:this.translateService.instant("MANAGER.SHOP.BULK_DELETE_CONFIRM",{count:t}),header:this.translateService.instant("MANAGER.SHOP.BULK_DELETE_TITLE"),severity:"danger",acceptLabel:this.translateService.instant("MANAGER.SHOP.BTN_DELETE"),rejectLabel:this.translateService.instant("MANAGER.SHOP.BTN_CANCEL")})))return;let i=this.selectedProducts.map(n=>n.id);try{let n=yield this.shopService.bulkDelete(i);this.toastService.success(this.translateService.instant("MANAGER.SHOP.BULK_DELETE_SUCCESS",{count:n.deleted})),this.selectedProducts=[],this.loadProducts()}catch(n){this.toastService.error(n?.error?.message||"Error")}})}onBulkMoveCollection(){return M(this,null,function*(){if(!this.bulkCollectionValue||!this.selectedProducts.length)return;let t=this.selectedProducts.map(i=>i.id),e=this.bulkCollectionValue==="__none__"?[]:[this.bulkCollectionValue];try{let i=yield this.shopService.bulkMoveToCollection(t,e);this.toastService.success(this.translateService.instant("MANAGER.SHOP.BULK_COLLECTION_SUCCESS",{count:i.updated})),this.selectedProducts=[],this.bulkCollectionValue="",this.loadProducts()}catch(i){this.toastService.error(i?.error?.message||"Error")}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=G({type:r,selectors:[["app-view-manager-shop-products"]],decls:19,vars:38,consts:[[1,"d-flex","gap-2","mb-3","flex-wrap","align-items-center"],[1,"input-group",2,"max-width","320px"],["type","button",1,"btn","bg-white","pe-0","border-start","border-top","border-bottom"],[1,"pi","pi-search"],["type","text",1,"form-control","border-start-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["optionLabel","label","optionValue","value",3,"ngModelChange","onChange","ngModel","options","placeholder"],[1,"btn","btn-sm","btn-outline-secondary","d-flex","align-items-center","gap-1"],["icon","pi pi-box","titleKey","MANAGER.SHOP.PRODUCTS_EMPTY_TITLE","descriptionKey","MANAGER.SHOP.PRODUCTS_EMPTY_DESC","ctaLabelKey","MANAGER.SHOP.BTN_ADD_PRODUCT","ctaIcon","pi pi-plus"],[1,"btn","btn-sm","btn-outline-secondary","d-flex","align-items-center","gap-1",3,"click"],[1,"pi","pi-filter-slash"],[3,"retry"],["icon","pi pi-box","titleKey","MANAGER.SHOP.PRODUCTS_EMPTY_TITLE","descriptionKey","MANAGER.SHOP.PRODUCTS_EMPTY_DESC","ctaLabelKey","MANAGER.SHOP.BTN_ADD_PRODUCT","ctaIcon","pi pi-plus",3,"ctaClick"],[1,"bulk-toolbar","mb-3"],[1,"d-none","d-md-block"],["styleClass","p-datatable-sm","dataKey","id",3,"selectionChange","value","tableStyle","selection"],["pTemplate","header"],["pTemplate","body"],[1,"d-md-none"],[1,"product-card-mobile","mb-3",3,"product-card-mobile--selected"],[3,"rows","totalRecords","first"],[1,"d-flex","align-items-center","gap-3","flex-wrap"],[1,"bulk-toolbar__count"],[1,"d-flex","gap-2","flex-wrap"],["optionLabel","label","optionValue","value","size","small",3,"ngModelChange","onChange","ngModel","options","placeholder"],["optionLabel","label","optionValue","value","size","small",3,"ngModel","options","placeholder","style","showClear"],["icon","pi pi-trash","severity","danger","size","small",3,"onClick","label","outlined"],["
3icon","pi pi-times","severity","secondary","size","small",3,"onClick","label","text"],["optionLabel","label","optionValue","value","size","small",3,"ngModelChange","onChange","ngModel","options","placeholder","showClear"],[2,"width","40px"],[2,"width","50px"],["tooltipPosition","top",1,"text-center",2,"width","50px",3,"pTooltip"],[1,"pi","pi-star-fill"],[2,"width","140px"],[3,"value"],[1,"product-thumb",3,"src","alt"],[1,"product-thumb","product-thumb--placeholder"],["queryParamsHandling","preserve",1,"fw-semibold","text-decoration-none",3,"routerLink"],[1,"text-muted",2,"font-size","0.75rem"],["severity","info","styleClass","text-xs",3,"value","rounded"],[1,"text-muted"],[1,"text-center"],["tooltipPosition","top",1,"btn-featured",3,"click","pTooltip"],[1,"pi",3,"ngClass"],[3,"value","severity","rounded"],[1,"d-flex","flex-column","gap-1","align-items-start"],["tooltipPosition","top",3,"value","severity","rounded","pTooltip"],["icon","pi pi-google","tooltipPosition","top",3,"value","severity","rounded","pTooltip"],[1,"d-flex","gap-1","justify-content-end"],["icon","pi pi-pencil","severity","secondary","size","small","queryParamsHandling","preserve","tooltipPosition","top",3,"text","routerLink","pTooltip"],["icon","pi pi-copy","
3severity","secondary","size","small","tooltipPosition","top",3,"onClick","text","pTooltip"],["icon","pi pi-trash","severity","danger","size","small","tooltipPosition","top",3,"onClick","text","pTooltip"],[1,"pi","pi-image"],[1,"pi","pi-th-large",2,"font-size","0.65rem"],[1,"product-card-mobile","mb-3"],[1,"d-flex","gap-3","align-items-start"],[3,"ngModelChange","binary","ngModel"],[1,"product-thumb-mobile",3,"src","alt"],[1,"product-thumb-mobile","product-thumb--placeholder"],[1,"flex-grow-1"],["queryParamsHandling","preserve",1,"fw-semibold","text-decoration-none","d-block","mb-1",3,"routerLink"],[1,"d-flex","gap-2","align-items-center","flex-wrap"],[1,"fw-bold"],["styleClass","text-xs",3,"value","severity","rounded"],["styleClass","text-xs","tooltipPosition","top",3,"value","severity","rounded","pTooltip"],[1,"d-flex","flex-column","gap-1"],["icon","pi pi-pencil","severity","secondary","size","small","queryParamsHandling","preserve",3,"text","routerLink"],["icon","pi pi-trash","severity","danger","size","small",3,"onClick","text"],[3,"onPageChange","rows","totalRecords","first"]],template:function(e,i){e&1&&(l(0,"div",0)(1,"div",1)(2,"button",2),_(3,"i",3),s(),l(4,"input",4),d(5,"translate"),b("ngModelChange",function(o){return T(i.search,o)||(i.search=o),o}),m("keyup.enter",function(){return i.onSearch()}),s()(),l(6,"p-select",5),d(7,"translate"),b("ngModelChange",function(o){return T(i.statusFilter,o)||(i.statusFilter=o),o}),m("onChange",function(){return i.onStatusFilter()}),s(),l(8,"p-select",5),d(9,"translate"),b("ngModelChange",function(o){return T(i.moderationFilter,o)||(i.moderationFilter=o),o}),m("onChange",function(){return i.onModerationFilter()}),s(),l(10,"p-select",5),d(11,"translate"),b("ngModelChange",function(o){return T(i.stockFilter,o)||(i.stockFilter=o),o}),m("onChange",function(){return i.onStockFilter()}),s(),l(12,"p-select",5),d(13,"translate"),b("ngModelChange",function(o){return T(i.googleFilter,o)||(i.googleFilter=o),o}),m("onChange",function(){return i.onGoogleFilter()}),s(),C(14,Re,4,3,"button",6),s(),C(15,ke,1,0,"app-widget-loading")(16,Le,1,0,"app-widget-api-error")(17,Ne,1,0,"app-widget-manager-empty-state",7)(18,Ye,9,6)),e&2&&(a(4),y("ngModel",i.search),c("placeholder",u(5,24,"MANAGER.SHOP.SEARCH_PLACEHOLDER")),a(2),O(A(34,Oe)),y("ngModel",i.statusFilter),c("options",i.statusOptions)("placeholder",u(7,26,"MANAGER.SHOP.FILTER_STATUS")),a(2),O(A(35,Te)),y("ngModel",i.moderationFilter),c("options",i.moderationOptions)("placeholder",u(9,28,"MANAGER.SHOP.FILTER_MODERATION")),a(2),O(A(36,L)),y("ngModel",i.stockFilter),c("options",i.stockOptions)("placeholder",u(11,30,"MANAGER.SHOP.FILTER_STOCK")),a(2),O(A(37,Te)),y("ngModel",i.googleFilter),c("options",i.googleOptions)("placeholder",u(13,32,"MANAGER.SHOP.FILTER_GOOGLE")),a(2),v(i.filters&&i.filters.activeCount()>0?14:-1),a(),v(i.loading?15:i.error?16:i.products.length===0?17:18))},dependencies:[B,U,z,j,ee,J,X,Z,Y,Q,ae,re,te,he,me,ge,Se,ve,Ce,se,de,pe,ne,ie,_e,ue,ce,le,oe,Pe,ye],styles:[".shop-tab-content[_ngcontent-%COMP%]{background:var(--p-surface-card);border:1px solid var(--p-surface-border);border-top:none;border-radius:0 0 10px 10px;padding:1.25rem}.product-thumb[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:8px;object-fit:cover}.product-thumb--placeholder[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-surface-100);color:var(--p-text-muted-color);font-size:1rem}.product-thumb-mobile[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:10px;object-fit:cover;flex-shrink:0}.product-thumb-mobile.product-thumb--placeholder[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-surface-100);color:var(--p-text-muted-color);font-size:1.25rem}.product-card-mobile[_ngcontent-%COMP%]{background:var(--p-surface-card);border:1px solid var(--p-surface-border);border-radius:12px;padding:1rem}.btn-featured[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;color:var(--p-text-muted-color);font-size:1.1rem;transition:color .15s,transform .15s}.btn-featured[_ngcontent-%COMP%]:hover{color:#f59e0b;transform:scale(1.2)}.btn-featured.active[_ngcontent-%COMP%]{color:#f59e0b}.bulk-toolbar[_ngcontent-%COMP%]{background:linear-gradient(135deg,#667eea14,#764ba214);border:1px solid rgba(102,126,234,.2);border-radius:10px;padding:.65rem 1rem}.bulk-toolbar__count[_ngcontent-%COMP%]{font-size:.85rem;font-weight:600;color:var(--p-primary-color);white-space:nowrap}.product-card-mobile--selected[_ngcontent-%COMP%]{border-color:var(--p-primary-color);background:#667eea0a}"]})};export{be as ViewManagerShopProductsComponent};
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.