vendor: 4,357 bytes, line 1
1import{a as ct}from"./chunk-PSWZAP7N.js";import{a as pt}from"./chunk-RGWTER5P.js";import{a as st}from"./chunk-PCQZQ3U4.js";import{a as rt,b as lt}from"./chunk-7D3HORSI.js";import{a as ot}from"./chunk-HSMEVITP.js";import{a as Ze,f as et}from"./chunk-JDYWGDNH.js";import"./chunk-IRONFM6M.js";import"./chunk-VHX354RR.js";import{a as tt,b as it}from"./chunk-22WJKAIZ.js";import{b as nt}from"./chunk-SLWPYULI.js";import{b as ze}from"./chunk-6S5SATLI.js";import"./chunk-RPDGXIQT.js";import"./chunk-RFHORXFH.js";import"./chunk-44BDWJO3.js";import"./chunk-YPSMJDVJ.js";import"./chunk-F6HJUGGY.js";import{a as Ye,b as Je}from"./chunk-W6FQLWKF.js";import"./chunk-6MXSXX3N.js";import"./chunk-MT62CIDI.js";import"./chunk-BXNQRMY5.js";import"./chunk-RFCDL6VX.js";import"./chunk-XWDSR7V3.js";import"./chunk-3THAQ3J3.js";import{a as $e,b as Qe}from"./chunk-OAED5FIG.js";import{a as Ge,b as Be}from"./chunk-P37GQ53N.js";import{b as qe,c as Ke}from"./chunk-NZ226J7R.js";import"./chunk-7EBKYMB6.js";import"./chunk-YK3HMHC4.js";import"./chunk-2DRXLVRR.js";import{d as Ue,e as Xe}from"./chunk-OFHUO5H7.js";import"./chunk-M3XSAKW4.js";import{a as je}from"./chunk-H76LZNGX.js";import"./chunk-PGR2NPNS.js";import{a as J}from"./chunk-OZD37XM5.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import{c as Fe}from"./chunk-AVEXXPAT.js";import{X as W,aa as De,ja as Q,ka as Y,r as ke,u as We}from"./chunk-FHU4TM37.js";import{a as at}from"./chunk-UUEFXD6N.js";import{D as Le,a as Ve,c as Ae,g as Oe,l as Pe,z as Ne}from"./chunk-Q2KKZV5J.js";import{a as Te}from"./chunk-JICM7NVH.js";import{a as He}from"./chunk-BD6EMWWF.js";import"./chunk-AB6CKZTE.js";import{c as Ie,d as be,e as Me}from"./chunk-DIGPPQJE.js";import{o as Re,x as ye}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import{D as $,j as ve,l as fe,m as Se,s as xe,t as we,x as Ee}from"./chunk-ZAQTNZYS.js";import"./chunk-SRTXE2HR.js";import{$b as de,Ba as se,Dc as y,Ec as I,Fc as b,Ib as E,Jb as c,Jc as me,Kb as ce,Kc as P,Lb as j,Mb as O,Mc as ue,Nb as k,Rb as v,Ub as Z,Uc as d,Vb as ee,Vc as _,Wb as r,Wc as ge,Xb as l,Y as oe,Yb as C,Z as ae,Zb as U,Zc as Ce,_ as re,_a as K,_b as X,ac as x,da as T,db as o,gc as S,hc as s,id as z,jd as he,kc as te,la as u,ma as g,mc as F,na as H,oc as G,p as N,pa as A,pc as B,sa as le,sb as V,tb as pe,tc as _e,uc as m,va as D,vc as f,wb as L,wc as R,yb as h,yc as ie}from"./chunk-NTTV6FWH.js";import{g as M}from"./chunk-W7GRJBO5.js";var dt=(()=>{class t extends J{pathId;ngOnInit(){this.pathId="url(#"+W()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=A(t)))(i||t)}})();static \u0275cmp=V({type:t,selectors:[["StarIcon"]],features:[L],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M10.9741 13.6721C10.8806 13.6719 10.7886 13.6483 10.7066 13.6033L7.00002 11.6545L3.29345 13.6033C3.19926 13.6539 3.09281 13.6771 2.98612 13.6703C2.87943 13.6636 2.77676 13.6271 2.6897 13.5651C2.60277 13.5014 2.53529 13.4147 2.4948 13.3148C2.45431 13.215 2.44241 13.1058 2.46042 12.9995L3.17881 8.87264L0.167699 5.95324C0.0922333 5.8777 0.039368 5.78258 0.0150625 5.67861C-0.00924303 5.57463 -0.00402231 5.46594 0.030136 5.36477C0.0621323 5.26323 0.122141 5.17278 0.203259 5.10383C0.284377 5.03488 0.383311 4.99023 0.488681 4.97501L4.63087 4.37126L6.48797 0.618832C6.54083 0.530159 6.61581 0.456732 6.70556 0.405741C6.79532 0.35475 6.89678 0.327942 7.00002 0.327942C7.10325 0.327942 7.20471 0.35475 7.29447 0.405741C7.38422 0.456732 7.4592 0.530159 7.51206 0.618832L9.36916 4.37126L13.5114 4.97501C13.6167 4.99023 13.7157 5.03488 13.7968 5.10383C13.8779 5.17278 13.9379 5.26323 13.9699 5.36477C14.0041 5.46594 14.0093 5.57463 13.985 5.67861C13.9607 5.78258 13.9078 5.8777 13.8323 5.95324L10.8212 8.87264L11.532 12.9995C11.55 13.1058 11.5381 13.215 11.4976 13.3148C11.4571 13.4147 11.3896 13.5014 11.3027 13.5651C11.2059 13.632 11.0917 13.6692 10.9741 13.6721ZM7.00002 10.4393C7.09251 10.4404 7.18371 10.4613 7.2675 10.5005L10.2098 12.029L9.65193 8.75036C9.6368 8.6584 9.64343 8.56418 9.6713 8.47526C9.69918 8.38633 9.74751 8.30518 9.81242 8.23832L12.1969 5.94559L8.90298 5.45648C8.81188 5.44198 8.72555 5.406 8.65113 5.35152C8.57671 5.29703 8.51633 5.2256 8.475 5.14314L7.00002 2.1626L5.52503 5.15078C5.4837 5.23324 5.42332 5.30467 5.3489 5.35916C5.27448 5.41365 5.18815 5.44963 5.
109705 5.46412L1.80318 5.94559L4.18761 8.23832C4.25252 8.30518 4.30085 8.38633 4.32873 8.47526C4.3566 8.56418 4.36323 8.6584 4.3481 8.75036L3.7902 12.0519L6.73253 10.5234C6.81451 10.4762 6.9058 10.4475 7.00002 10.4393Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(a,i){a&1&&(H(),r(0,"svg",0)(1,"g"),C(2,"path",1),l(),r(3,"defs")(4,"clipPath",2),C(5,"rect",3),l()()()),a&2&&(k(i.getClassNames()),E("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),o(),E("clip-path",i.pathId),o(3),c("id",i.pathId))},encapsulation:2})}return t})();var _t=(()=>{class t extends J{pathId;ngOnInit(){this.pathId="url(#"+W()+")"}static \u0275fac=(()=>{let e;return function(i){return(e||(e=A(t)))(i||t)}})();static \u0275cmp=V({type:t,selectors:[["StarFillIcon"]],features:[L],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.9718 5.36453C13.9398 5.26298 13.8798 5.17252 13.7986 5.10356C13.7175 5.0346 13.6186 4.98994 13.5132 4.97472L9.37043 4.37088L7.51307 0.617955C7.46021 0.529271 7.38522 0.455834 7.29545 0.404836C7.20568 0.353838 7.1042 0.327026 7.00096 0.327026C6.89771 0.327026 6.79624 0.353838 6.70647 0.404836C6.6167 0.455834 6.54171 0.529271 6.48885 0.617955L4.63149 4.37088L0.488746 4.97472C0.383363 4.98994 0.284416 5.0346 0.203286 5.10356C0.122157 5.17252 0.0621407 5.26298 0.03014 5.36453C-0.00402286 5.46571 -0.00924428 5.57442 0.0150645 5.67841C0.0393733 5.7824 0.0922457 5.87753 0.167722 5.95308L3.17924 8.87287L2.4684 13.0003C2.45038 13.1066 2.46229 13.2158 2.50278 13.3157C2.54328 13.4156 2.61077 13.5022 2.6977 13.5659C2.78477 13.628 2.88746 13.6644 2.99416 13.6712C3.10087 13.678 3.20733 13.6547 3.30153 13.6042L7.00096 11.6551L10.708 13.6042C10.79 13.6491 10.882 13.6728 10.9755 13.673C11.0958 13.6716 11.2129 13.6343 11.3119 13.5659C11.3988 13.5022 11.4663 13.4156 11.5068 13.3157C11.5473 13.2158 11.5592 13.1066 11.5412 13.0003L10.8227 8.87287L13.8266 5.95308C13.9033 5.87835 13.9577 5.7836 13.9833 5.67957C14.009 5.57554 14.005 5.4664 13.9718 5.36453Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(a,i){a&1&&(H(),r(0,"svg",0)(1,"g"),C(2,"path",1),l(),r(3,"defs")(4,"clipPath",2),C(5,"rect",3),l()()()),a&2&&(k(i.getClassNames()),E("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role),o(),E("clip-path",i.pathId),o(3),c("id",i.pathId))},encapsulation:2})}return t})();var ft=["onicon"],St=["officon"],xt=["cancelicon"],wt=(t,n)=>({"p-rating-option-active":t,"p-focus-visible":n});function Et(t,n){if(t&1&&C(0,"span",9),t&2){let e=s(4);c("ngStyle",e.iconOffStyle)("ngClass",e.iconOffClass),E("data-pc-section","offIcon")}}function Rt(t,n){if(t&1&&C(0,"StarIcon",10),t&2){let e=s(4);c("ngStyle",e.iconOffStyle)("styleClass","p-rating-icon"),E("data-pc-section","offIcon")}}function yt(t,n){if(t&1&&(U(0),h(1,Et,1,3,"span",7)(2,Rt,1,3,"StarIcon",8),X()),t&2){let e=s(3);o(),c("ngIf",e.iconOffClass),o(),c("ngIf",!e.iconOffClass)}}function It(t,n){if(t&1&&C(0,"span",12),t&2){let e=s(4);c("ngStyle",e.iconOnStyle)("ngClass",e.iconOnClass),E("data-pc-section","onIcon")}}function bt(t,n){if(t&1&&C(0,"StarFillIcon",10),t&2){let e=s(4);c("ngStyle",e.iconOnStyle)("styleClass","p-rating-icon p-rating-icon-active"),E("data-pc-section","onIcon")}}function Mt(t,n){if(t&1&&(U(0),h(1,It,1,3,"span",11)(2,bt,1,3,"StarFillIcon",8),X()),t&2){let e=s(3);o(),c("ngIf",e.iconOnClass),o(),c("ngIf",!e.iconOnClass)}}function Tt(t,n){if(t&1){let e=x();r(0,"div",3),S("click",function(i){let p=u(e).$implicit,w=s(2);return g(w.onOptionClick(i,p+1))}),r(1,"span",4)(2,"input",5),S("focus",function(i){let p=u(e).$implicit,w=s(2);return g(w.onInputFocus(i,p+1))})("blur",function(i){u(e);let p=s(2);return g(p.onInputBlur(i))})("change",function(i){let p=u(e).$implicit,w=s(2);return g(w.onChange(i,p+1))}),l()(),h(3,yt,3,2,"ng-container",6)(4,Mt,3,2,"ng-container",6),l()}if(t&2){let e=n.$implicit,a=n.index,i=s(2);c("ngClass",ue(10,wt,e+1<=i.value,e+1===i.focusedOptionIndex()&&i.isFocusVisibleItem)),o(),E("data-p-hidden-accessible",!0),o(),c("name",i.nameattr)("checked",i.value===0)("disabled",i.disabled)("readonly",i.readonly)("pAutoFocus",
1i.autofocus),E("aria-label",i.starAriaLabel(e+1)),o(),c("ngIf",!i.value||a>=i.value),o(),c("ngIf",i.value&&a<i.value)}}function Vt(t,n){if(t&1&&(U(0),h(1,Tt,5,13,"ng-template",2),X()),t&2){let e=s();o(),c("ngForOf",e.starsArray)}}function At(t,n){t&1&&de(0)}function Ot(t,n){if(t&1){let e=x();r(0,"span",14),S("click",function(i){let p=u(e).$implicit,w=s(2);return g(w.onOptionClick(i,p+1))}),h(1,At,1,0,"ng-container",15),l()}if(t&2){let e=n.index,a=s(2);E("data-pc-section","onIcon"),o(),c("ngTemplateOutlet",a.getIconTemplate(e))}}function Pt(t,n){if(t&1&&h(0,Ot,2,2,"span",13),t&2){let e=s();c("ngForOf",e.starsArray)}}var Nt=({dt:t})=>` 2.p-rating { 3 position: relative; 4 display: flex; 5 align-items: center; 6 gap: ${t("rating.gap")}; 7} 8 9.p-rating-option { 10 display: inline-flex; 11 align-items: center; 12 cursor: pointer; 13 outline-color: transparent; 14 border-radius: 50%; 15 transition: background ${t("rating.transition.duration")}, color ${t("rating.transition.duration")}, border-color ${t("rating.transition.duration")}, outline-color ${t("rating.transition.duration")}, box-shadow ${t("rating.transition.duration")}; 16} 17 18.p-rating-option.p-focus-visible { 19 box-shadow: ${t("rating.focus.ring.shadow")}; 20 outline: ${t("rating.focus.ring.width")} ${t("rating.focus.ring.style")} ${t("rating.focus.ring.color")}; 21 outline-offset: ${t("rating.focus.ring.offset")}; 22} 23 24.p-rating-icon { 25 color: ${t("rating.icon.color")}; 26 transition: background ${t("rating.transition.duration")}, color ${t("rating.transition.duration")}, border-color ${t("rating.transition.duration")}, outline-color ${t("rating.transition.duration")}, box-shadow ${t("rating.transition.duration")}; 27 font-size: ${t("rating.icon.size")}; 28 width: ${t("rating.icon.size")}; 29 height: ${t("rating.icon.size")}; 30} 31 32.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-option:hover .p-rating-icon { 33 color: ${t("rating.icon.hover.color")}; 34} 35 36.p-rating-option-active .p-rating-icon { 37 color: ${t("rating.icon.active.color")}; 38} 39 40/* For PrimeNG */ 41p-rating.ng-invalid.ng-dirty > .p-rating > .p-rating-icon { 42 stroke: ${t("rating.invalid.icon.color")}; 43}`,Lt={root:({props:t})=>["p-rating",{"p-readonly":t.readonly,"p-disabled":t.disabled}],option:({instance:t,props:n,value:e})=>["p-rating-option",{"p-rating-option-active":e<=n.modelValue,"p-focus-visible":e===t.focusedOptionIndex()&&t.isFocusVisibleItem}],onIcon:"p-rating-icon p-rating-on-icon",offIcon:"p-rating-icon p-rating-off-icon"},mt=(()=>{class t extends De{name="rating";theme=Nt;classes=Lt;static \u0275fac=(()=>{let e;return function(i){return(e||(e=A(t)))(i||t)}})();static \u0275prov=ae({token:t,factory:t.\u0275fac})}return t})();var kt={provide:Ve,useExisting:oe(()=>q),multi:!0},q=(()=>{class t extends Fe{disabled;readonly;stars=5;iconOnClass;iconOnStyle;iconOffClass;iconOffStyle;autofocus;onRate=new D;onCancel=new D;onFocus=new D;onBlur=new D;onIconTemplate;offIconTemplate;cancelIconTemplate;templates;value;onModelChange=()=>{};onModelTouched=()=>{};starsArray;isFocusVisibleItem=!0;focusedOptionIndex=se(-1);nameattr;_componentStyle=T(mt);_onIconTemplate;_offIconTemplate;_cancelIconTemplate;ngOnInit(){super.ngOnInit(),this.nameattr=this.nameattr||W("pn_id_"),this.starsArray=[];for(let e=0;e<this.stars;e++)this.starsArray[e]=e}
43ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"onicon":this._onIconTemplate=e.template;break;case"officon":this._offIconTemplate=e.template;break;case"cancelicon":this._cancelIconTemplate=e.template;break}})}onOptionClick(e,a){if(!this.readonly&&!this.disabled){this.onOptionSelect(e,a),this.isFocusVisibleItem=!1;let i=We(e.currentTarget,"");i&&ke(i)}}onOptionSelect(e,a){!this.readonly&&!this.disabled&&(this.focusedOptionIndex()===a||a===this.value?(this.focusedOptionIndex.set(-1),this.updateModel(e,null)):(this.focusedOptionIndex.set(a),this.updateModel(e,a||null)))}onChange(e,a){this.onOptionSelect(e,a),this.isFocusVisibleItem=!0}onInputBlur(e){this.focusedOptionIndex.set(-1),this.onBlur.emit(e)}onInputFocus(e,a){!this.readonly&&!this.disabled&&(this.focusedOptionIndex.set(a),this.onFocus.emit(e))}updateModel(e,a){this.value=a,this.onModelChange(this.value),this.onModelTouched(),a?this.onRate.emit({originalEvent:e,value:a}):this.onCancel.emit()}starAriaLabel(e){return e===1?this.config.translation.aria.star:this.config.translation.aria.stars.replace(/{star}/g,e)}getIconTemplate(e){return!this.value||e>=this.value?this.offIconTemplate||this._offIconTemplate:this.onIconTemplate||this.offIconTemplate}writeValue(e){this.value=e,this.cd.detectChanges()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}get isCustomIcon(){return!!(this.onIconTemplate||this._onIconTemplate||this.offIconTemplate||this._offIconTemplate||this.cancelIconTemplate||this._cancelIconTemplate)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=A(t)))(i||t)}})();static \u0275cmp=V({type:t,selectors:[["p-rating"]],contentQueries:function(a,i,p){if(a&1&&(F(p,ft,4),F(p,St,4),F(p,xt,4),F(p,Q,4)),a&2){let w;G(w=B())&&(i.onIconTemplate=w.first),G(w=B())&&(i.offIconTemplate=w.first),G(w=B())&&(i.cancelIconTemplate=w.first),G(w=B())&&(i.templates=w)}},hostAttrs:[1,"p-rating"],hostVars:6,hostBindings:function(a,i){a&2&&(E("data-pc-name","rating")("data-pc-section","root"),j("p-readonly",i.readonly)("p-disabled",i.disabled))},inputs:{disabled:[2,"disabled","disabled",z],readonly:[2,"readonly","readonly",z],stars:[2,"stars","stars",he],iconOnClass:"iconOnClass",iconOnStyle:"iconOnStyle",iconOffClass:"iconOffClass",iconOffStyle:"iconOffStyle",autofocus:[2,"autofocus","autofocus",z]},outputs:{onRate:"onRate",onCancel:"onCancel",onFocus:"onFocus",onBlur:"onBlur"},features:[me([kt,mt]),L],decls:3,vars:2,consts:[["customTemplate",""],[4,"ngIf","ngIfElse"],["ngFor","",3,"ngForOf"],[1,"p-rating-option",3,"click","ngClass"],[1,"p-hidden-accessible"],["type","radio","value","0",3,"focus","blur","change","name","checked","disabled","readonly","pAutoFocus"],[4,"ngIf"],["class","p-rating-icon",3,"ngStyle","ngClass",4,"ngIf"],[3,"ngStyle","styleClass",4,"ngIf"],[1,"p-rating-icon",3,"ngStyle","ngClass"],[3,"ngStyle","styleClass"],["class","p-rating-icon p-rating-icon-active",3,"ngStyle","ngClass",4,"ngIf"],[1,"p-rating-icon","p-rating-icon-active",3,"ngStyle","ngClass"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[4,"ngTemplateOutlet"]],template:function(a,i){if(a&1&&h(0,Vt,2,1,"ng-container",1)(1,Pt,1,1,"ng-template",null,0,Ce),a&2){let p=_e(2);c("ngIf",!i.isCustomIcon)("ngIfElse",p)}},dependencies:[$,ve,fe,Se,we,xe,je,_t,dt,Y],encapsulation:2,changeDetection:0})}return t})(),ut=(()=>{class t{static \u0275fac=function(a){return new(a||t)};static \u0275mod=pe({type:t});static \u0275inj=re({imports:[q,Y,Y]})}return t})();var gt=()=>({width:"500px"}),ht=()=>({minWidth:"160px"}),Dt=()=>({width:"650px"}),Ft=()=>({width:"550px"}),Gt=(t,n)=>n.label,Bt=(t,n)=>n.id;function Ht(t,n){t&1&&C(0,"app-widget-loading")}function jt(t,n){if(t&1){let e=x();r(0,"app-widget-api-error",2),S("retry",function(){u(e);let i=s();return g(i.loadAll())}),l()}}function Ut(t,n){if(t&1&&(r(0,"div",13)(1,"div",14),C(2,"i"),l(),r(3,"div",15)(4,"div",16),m(5),l(),r(6,"div",17),m(7),d(8,"translate"),l()()()),t&2){let e=n.$implicit;ce("--kpi-color",e.color)("--kpi-bg",e.bgColor),o(2),k(e.icon),o(3),f(e.value),o(2),f(_(8,8,e.label))}}function Xt(t,n){if(t&1&&(r(0,"div",3),Z(1,Ut,9,10,"div",12,Gt),l()),t&2){let e=s(2);o(),ee(e.kpiCards)}}function zt(t,n){if(t&1){let e=x();r(0,"span",18),m(1),d(2,"translate"),l(),r(3,"p-select",6),b("ngModelChange",function(i){u(e);let p=s(2);return I(p.sourceFilter,i)||(p.sourceFilter=i),g(i)}),S("onChange",function(){u(e);let i=s(2);return g(i.onFilterChange())}),l()}if(t&2){let e=s(2);o(),f(_(2,5,"MANAGER.SHOP.REVIEW_SOURCE_LABEL")),o(2),O(P(7,ht)),y("ngModel",e.sourceFilter),c("options",e.sourceOptions)}}function $t(t,n){if(t&1){let e=x();r(0,"button",19),S("click",function(){u(e);let i=s(2);return g(i.onResetFilters())}),C(1,"i",20),m(2),d(3,"translate"),l()}t&2&&(o(2),R(" ",_(3,1,"COMMON.RESET_FILTERS")," "))}function Qt(t,n){if(t&1){let e=x();r(0,"p-button",21),d(1,"translate"),S("onClick",function(){u(e);let i=s(2);return g(i.openSourcesDialog())}),l()}if(t&2){let e=s(2);c("label",_(1,3,"MANAGER.SHOP.EXT_REVIEW_MANAGE_SOURCES"))("outlined",!0)("badge",e.externalSources.length.toString())}}function Yt(t,n){t&1&&C(0,"app-widget-manager-empty-state",10)}function Jt(t,n){t&1&&(r(0,"tr")(1,"th"),m(2),d(3,"translate"),l(),r(4,"th"),m(5),d(6,"translate"),l(),r(7,"th"),m(8),d(9,"translate"),l(),r(10,"th"),m(11),d(12,"translate"),l(),r(13,"th"),m(14),d(15,"translate"),l(),r(16,"th"),m(17),d(18,"translate"),l(),r(19,"th",25),m(20),d(21,"translate"),l()()),t&2&&(o(2),f(_(3,7,"MANAGER.SHOP.REVIEW_COL_SOURCE")),o(3),f(_(6,9,"MANAGER.SHOP.REVIEW_COL_AUTHOR")),o(3),f(_(9,11,"MANAGER.SHOP.REVIEW_COL_RATING")),o(3),f(_(12,13,"MANAGER.SHOP.REVIEW_COL_COMMENT")),o(3),f(_(15,15,"MANAGER.SHOP.REVIEW_COL_STATUS")),o(3),f(_(18,17,"MANAGER.SHOP.REVIEW_COL_DATE")),o(3),R(" ",_(21,19,"MANAGER.SHOP.REVIEW_COL_ACTIONS")," "))}function qt(t,n){if(t&1&&C(0,"img",28),t&2){let e=s().$implicit;c("src",e.authorAvatarUrl,K)}}function Kt(t,n){if(t&1&&(r(0,"div",5),m(1),l()),t&2){let e=s().$implicit;o(),R(" ",e.authorEmail," ")}}function Zt(t,n){t&1&&(C(0,"p-tag",30),d(1,"translate")),t&2&&c("value",_(1,2,"MANAGER.SHOP.REVIEW_VERIFIED"))("rounded",!0)}function ei(t,n){if(t&1&&(r(0,"div",33),m(1),l()),t&2){let e=s().$implicit;o(),R(" ",e.title," ")}}function ti(t,n){if(t&1&&(r(0,"div",35),C(1,"i",40),r(2,"span",41),m(3),l()()),t&2){let e=s().$implicit;o(3),f(e.sellerReply)}}function ii(t,n){if(t&1&&(r(0,"a",36),C(1,"i",42),m(2),d(3,"translate"),l()),t&2){let e=s().$implicit;c("href",e.platformUrl,K),o(2),R("",_(3,2,"MANAGER.SHOP.EXT_REVIEW_VIEW_ORIGINAL")," ")}}function ni(t,n){if(t&1&&C(0,"p-tag",26),t&2){let e=s().$implicit,a=s(3);c("value",a.getStatusLabel(e.status))("severity",a.getStatusSeverity(e.status))("rounded",!0)}}function oi(t,n){if(t&1&&(C(0,"p-tag",26),d(1,"translate"),d(2,"translate")),t&2){let e=s().$implicit;c("value",e.visible!==!1?_(1,3,"MANAGER.SHOP.EXT_REVIEW_VISIBLE"):_(2,5,"MANAGER.SHOP.EXT_REVIEW_HIDDEN"))("severity",e.visible!==!1?"success":"warn")("roun
43ded",!0)}}function ai(t,n){if(t&1){let e=x();r(0,"p-button",44),d(1,"translate"),S("onClick",function(){u(e);let i=s(2).$implicit,p=s(3);return g(p.approve(i))}),l(),r(2,"p-button",45),d(3,"translate"),S("onClick",function(){u(e);let i=s(2).$implicit,p=s(3);return g(p.openRejectDialog(i))}),l()}t&2&&(c("text",!0)("pTooltip",_(1,4,"MANAGER.SHOP.REVIEW_BTN_APPROVE")),o(2),c("text",!0)("pTooltip",_(3,6,"MANAGER.SHOP.REVIEW_BTN_REJECT")))}function ri(t,n){if(t&1){let e=x();h(0,ai,4,8),r(1,"p-button",43),d(2,"translate"),S("onClick",function(){u(e);let i=s().$implicit,p=s(3);return g(p.openReplyDialog(i))}),l()}if(t&2){let e=s().$implicit;v(e.status==="pending"||e.status==="flagged"?0:-1),o(),c("text",!0)("pTooltip",_(2,3,"MANAGER.SHOP.REVIEW_BTN_REPLY"))}}function li(t,n){if(t&1){let e=x();r(0,"p-button",46),d(1,"translate"),S("onClick",function(){u(e);let i=s().$implicit,p=s(3);return g(p.toggleExternalVisibility(i))}),l()}if(t&2){let e=s().$implicit;c("icon",e.visible!==!1?"pi pi-eye":"pi pi-eye-slash")("severity",e.visible!==!1?"secondary":"warn")("text",!0)("pTooltip",_(1,4,e.visible!==!1?"MANAGER.SHOP.EXT_REVIEW_HIDE":"MANAGER.SHOP.EXT_REVIEW_SHOW"))}}function si(t,n){if(t&1&&(r(0,"tr")(1,"td"),C(2,"p-tag",26),l(),r(3,"td")(4,"div",27),h(5,qt,1,1,"img",28),r(6,"div")(7,"div",29),m(8),l(),h(9,Kt,2,1,"div",5)(10,Zt,2,4,"p-tag",30),l()()(),r(11,"td"),C(12,"p-rating",31),l(),r(13,"td",32),h(14,ei,2,1,"div",33),r(15,"div",34),m(16),l(),h(17,ti,4,1,"div",35)(18,ii,4,4,"a",36),l(),r(19,"td"),h(20,ni,1,3,"p-tag",26)(21,oi,3,7,"p-tag",26),l(),r(22,"td")(23,"span",37),m(24),d(25,"date"),l()(),r(26,"td",25)(27,"div",38),h(28,ri,3,5)(29,li,2,6,"p-button",39),l()()()),t&2){let e=n.$implicit,a=s(3);j("review-hidden",e._type==="external"&&e.visible===!1),o(2),c("value",a.getSourceLabel(e._source))("severity",a.getSourceSeverity(e._source))("rounded",!0),o(3),v(e.authorAvatarUrl?5:-1),o(3),R(" ",e.authorName," "),o(),v(e.authorEmail?9:-1),o(),v(e.isVerified?10:-1),o(2),c("ngModel",e.rating)("readonly",!0)("stars",5),o(2),v(e.title?14:-1),o(2),f(e.comment),o(),v(e.sellerReply?17:-1),o(),v(e.platformUrl?18:-1),o(2),v(e._type==="internal"&&e.status?20:e._type==="external"?21:-1),o(4),f(ge(25,19,e.date,"dd/MM/yyyy HH:mm")),o(4),v(e._type==="internal"?28:29)}}function pi(t,n){if(t&1){let e=x();r(0,"p-table",22),S("onLazyLoad",function(i){u(e);let p=s(2);return g(p.onPageChange(i))}),h(1,Jt,22,21,"ng-template",23)(2,si,30,22,"ng-template",24),l()}if(t&2){let e=s(2);c("value",e.unifiedReviews)("paginator",e.totalAllReviews>e.limit)("rows",e.limit)("totalRecords",e.totalAllReviews)("lazy",!0)("rowHover",!0)}}function ci(t,n){if(t&1){let e=x();h(0,Xt,3,0,"div",3),r(1,"div",4)(2,"span",5),m(3),d(4,"translate"),l(),r(5,"p-select",6),b("ngModelChange",function(i){u(e);let p=s();return I(p.activeFilter,i)||(p.activeFilter=i),g(i)}),S("onChange",function(){u(e);let i=s();return g(i.onFilterChange())}),l(),h(6,zt,4,8),r(7,"div",7),h(8,$t,4,3,"button",8)(9,Qt,2,5,"p-button",9),l()(),h(10,Yt,1,0,"app-widget-manager-empty-state",10)(11,pi,3,6,"p-table",11)}if(t&2){let e=s();v(e.stats?0:-1),o(3),f(_(4,10,"MANAGER.SHOP.REVIEW_FILTER")),o(2),O(P(12,ht)),y("ngModel",e.activeFilter),c("options",e.statusOptions),o(),v(e.externalReviewsImportEnabled?6:-1),o(2),v(e.filters&&e.filters.activeCount()>0?8:-1),o(),v(e.externalReviewsImportEnabled?9:-1),o(),v(e.unifiedReviews.length===0?10:11)}}function di(t,n){if(t&1){let e=x();r(0,"div",47)(1,"div",48),m(2),l(),C(3,"p-rating",49),r(4,"div",5),m(5),l()(),r(6,"div",47)(7,"label",50),m(8),d(9,"translate"),l(),r(10,"textarea",51),b("ngModelChange",function(i){u(e);let p=s();return I(p.replyText,i)||(p.replyText=i),g(i)}),l()(),r(11,"div",52)(12,"p-button",53),d(13,"translate"),S("onClick",function(){u(e);let i=s();return g(i.showReplyDialog=!1)}),l(),r(14,"p-button",54),d(15,"translate"),S("onClick",function(){u(e);let i=s();return g(i.confirmReply())}),l()()}if(t&2){let e=s();o(2),f(e.replyReview.authorName),o(),c("ngModel",e.replyReview.rating)("readonly",!0)("stars",5),o(2),f(e.replyReview.comment),o(3),f(_(9,13,"MANAGER.SHOP.REVIEW_YOUR_REPLY")),o(2),y("ngModel",e.replyText),c("rows",4),o(2),c("label",_(13,15,"COMMON.CANCEL"))("text",!0),o(2),c("label",_(15,17,"MANAGER.SHOP.REVIEW_BTN_SEND_REPLY"))("loading",e.replying)("disabled",!e.replyText.trim())}}function _i(t,n){if(t&1){let e=x();r(0,"div",47)(1,"div",48),m(2),l(),r(3,"div",5),m(4),l()(),r(5,"div",47)(6,"label",50),m(7),d(8,"translate"),l(),r(9,"textarea",55),d(10,"translate"),b("ngModelChange",function(i){u(e);let p=s();return I(p.rejectReason,i)||(p.rejectReason=i),g(i)}),l()(),r(11,"div",52)(12,"p-button",53),d(13,"translate"),S("onClick",function(){u(e);let i=s();return g(i.showRejectDialog=!1)}),l(),r(14,"p-button",56),d(15,"translate"),S("onClick",function(){u(e);let i=s();return g(i.confirmReject())}),l()()}if(t&2){let e=s();o(2),f(e.rejectReview.authorName),o(2),f(e.rejectReview.comment),o(3),f(_(8,10,"MANAGER.SHOP.REVIEW_REJECT_REASON")),o(2),y("ngModel",e.rejectReason),c("rows",3)("placeholder",_(10,12,"MANAGER.SHOP.REVIEW_REJECT_REASON_PH")),o(3),c("label",_(13,14,"COMMON.CANCEL"))("text",!0),o(2),c("label",_(15,16,"MANAGER.SHOP.REVIEW_BTN_CONFIRM_REJECT"))("loading",e.rejecting)}}function mi(t,n){t&1&&(r(0,"div",59),m(1),d(2,"translate"),l()),t&2&&(o(),R(" ",_(2,1,"MANAGER.SHOP.EXT_REVIEW_NO_SOURCES")," "))}function ui(t,n){t&1&&(C(0,"p-tag",64),d(1,"translate")),t&2&&(te("value",_(1,2,"MANAGER.SHOP.EXT_REVIEW_PENDING_APPROVAL")),c("rounded",!0))}function gi(t,n){t&1&&(C(0,"p-tag",65),d(1,"translate")),t&2&&(te("value",_(1,2,"MANAGER.SHOP.EXT_REVIEW_REJECTED_LABEL")),c("rounded",!0))}function Ci(t,n){if(t&1&&C(0,"p-tag",26),t&2){let e=s().$implicit,a=s(3);c("value",a.getSyncLabel(e.syncStatus))("severity",a.getSyncSeverity(e.syncStatus))("rounded",!0)}}function hi(t,n){t&1&&(r(0,"div",66),C(1,"i",71),m(2),d(3,"translate"),l()),t&2&&(o(2),R("",_(3,1,"MANAGER.SHOP.EXT_REVIEW_PENDING_HINT")," "))}function vi(t,n){if(t&1&&(r(0,"div",67),C(1,"i",72),m(2),l()),t&2){let e=s().$implicit;o(2),R("",e.adminRejectionReason," ")}}function fi(t,n){if(t&1&&(r(0,"div",67),C(1,"i",73),m(2),l()),t&2){let e=s().$implicit;o(2),R("",e.syncError," ")}}function Si(t,n){if(t&1){let e=x();r(0,"div",60)(1,"div",61)(2,"div",62)(3,"div",63),m(4),l(),r(5,"div",5),m(6),d(7,"translate"),l()(),h(8,ui,2,4,"p-tag",64)(9,gi,2,4,"p-tag",65)(10,Ci,1,3,"p-tag",26),l(),h(11,hi,4,3,"div",66)(12,vi,3,1,"div",67)(13,fi,3,1,"div",67),r(14,"div",68)(15,"p-button",69),d(16,"translate"),S("onClick",function(){let i=u(e).$implicit,p=s(3);return g(p.syncSource(i))}),l(),r(17,"p-button",70),d(18,"translate"),S("onClick",function(){let i=u(e).$implicit,p=s(3);return g(p.deleteSource(i))}),l()()()}if(t&2){let e=n.$implicit;o(4),R(" ",e.displayName," "),o(2),ie(" ",e.platform," \u2022 ",e.totalImported," ",_(7,13,"MANAGER.SHOP.EXT_REVIEW_REVIEWS_LABEL")," "),o(2),v(!e.adminApproved&&!e.adminRejectionReason?8:e.adminRejectionReason?9:10),o(3),v(!e.adminApproved&&!e.adminRejectionReason?11:-1),o(),v(e.adminRejectionReason?12:-1),o(),v(e.syncError&&e.adminApproved?13:-1),o(2),c("text",!0)("pTooltip",_(16,15,"MANAGER.SHOP.EXT_REVIEW_BTN_SYNC"))("disabled",e.syncStatus==="syncing"||!e.adminApproved),o(2),c("text",!0)("pTooltip",_(18,17,"MANAGER.SHOP.EXT_REVIEW_BTN_DELETE"))}}
43function xi(t,n){if(t&1&&Z(0,Si,19,19,"div",60,Bt),t&2){let e=s(2);ee(e.externalSources)}}function wi(t,n){if(t&1){let e=x();r(0,"p-dialog",0),d(1,"translate"),b("visibleChange",function(i){u(e);let p=s();return I(p.showSourcesDialog,i)||(p.showSourcesDialog=i),g(i)}),r(2,"div",57)(3,"p-button",58),d(4,"translate"),S("onClick",function(){u(e);let i=s();return g(i.openAddSourceDialog())}),l()(),h(5,mi,3,3,"div",59)(6,xi,2,0),l()}if(t&2){let e=s();O(P(11,Dt)),c("header",_(1,7,"MANAGER.SHOP.EXT_REVIEW_SOURCES_TITLE")),y("visible",e.showSourcesDialog),c("modal",!0),o(3),c("label",_(4,9,"MANAGER.SHOP.EXT_REVIEW_ADD_SOURCE")),o(2),v(e.externalSources.length===0?5:6)}}function Ei(t,n){if(t&1&&(r(0,"div",80)(1,"div",29),m(2),l(),r(3,"div",37),m(4),d(5,"translate"),l()()),t&2){let e=s(3);o(2),R(" ",e.addSourceSearchResult.displayName," "),o(2),ie(" ",e.addSourceSearchResult.numberOfReviews==null?null:e.addSourceSearchResult.numberOfReviews.total," ",_(5,4,"MANAGER.SHOP.EXT_REVIEW_REVIEWS_LABEL")," \u2022 ",e.addSourceSearchResult.score==null?null:e.addSourceSearchResult.score.stars,"/5 ")}}function Ri(t,n){if(t&1){let e=x();r(0,"div",47)(1,"label",50),m(2),d(3,"translate"),l(),r(4,"input",77),b("ngModelChange",function(i){u(e);let p=s(2);return I(p.addSourceDomain,i)||(p.addSourceDomain=i),g(i)}),l(),r(5,"small",78),m(6),d(7,"translate"),l()(),r(8,"div",47)(9,"p-button",79),d(10,"translate"),S("onClick",function(){u(e);let i=s(2);return g(i.searchTrustpilot())}),l()(),h(11,Ei,6,6,"div",80)}if(t&2){let e=s(2);o(2),f(_(3,7,"MANAGER.SHOP.EXT_REVIEW_DOMAIN")),o(2),y("ngModel",e.addSourceDomain),o(2),f(_(7,9,"MANAGER.SHOP.EXT_REVIEW_DOMAIN_HINT")),o(3),c("label",_(10,11,"MANAGER.SHOP.EXT_REVIEW_SEARCH_TRUSTPILOT"))("loading",e.addSourceSearching)("disabled",!e.addSourceDomain),o(2),v(e.addSourceSearchResult?11:-1)}}function yi(t,n){if(t&1){let e=x();r(0,"div",47)(1,"label",50),m(2),d(3,"translate"),l(),r(4,"input",81),b("ngModelChange",function(i){u(e);let p=s(2);return I(p.addSourceExternalId,i)||(p.addSourceExternalId=i),g(i)}),l(),r(5,"small",82),m(6),d(7,"translate"),r(8,"a",83),m(9),d(10,"translate"),l()()()}if(t&2){let e=s(2);o(2),f(_(3,4,"MANAGER.SHOP.EXT_REVIEW_GOOGLE_PLACE_ID")),o(2),y("ngModel",e.addSourceExternalId),o(2),R(" ",_(7,6,"MANAGER.SHOP.EXT_REVIEW_GOOGLE_PLACE_ID_HINT")," "),o(3),R(" ",_(10,8,"MANAGER.SHOP.EXT_REVIEW_GOOGLE_PLACE_ID_LINK")," ")}}function Ii(t,n){if(t&1){let e=x();r(0,"div",47)(1,"label",50),m(2),d(3,"translate"),l(),r(4,"input",75),b("ngModelChange",function(i){u(e);let p=s(2);return I(p.addSourceExternalId,i)||(p.addSourceExternalId=i),g(i)}),l()()}if(t&2){let e=s(2);o(2),f(_(3,2,"MANAGER.SHOP.EXT_REVIEW_EXTERNAL_ID")),o(2),y("ngModel",e.addSourceExternalId)}}function bi(t,n){if(t&1){let e=x();r(0,"p-dialog",0),d(1,"translate"),b("visibleChange",function(i){u(e);let p=s();return I(p.showAddSourceDialog,i)||(p.showAddSourceDialog=i),g(i)}),r(2,"div",47)(3,"label",50),m(4),d(5,"translate"),l(),r(6,"p-select",74),b("ngModelChange",function(i){u(e);let p=s();return I(p.addSourcePlatform,i)||(p.addSourcePlatform=i),g(i)}),l()(),h(7,Ri,12,13)(8,yi,11,10,"div",47)(9,Ii,5,4,"div",47),r(10,"div",47)(11,"label",50),m(12),d(13,"translate"),l(),r(14,"input",75),b("ngModelChange",function(i){u(e);let p=s();return I(p.addSourceDisplayName,i)||(p.addSourceDisplayName=i),g(i)}),l()(),r(15,"div",52)(16,"p-button",53),d(17,"translate"),S("onClick",function(){u(e);let i=s();return g(i.showAddSourceDialog=!1)}),l(),r(18,"p-button",76),d(19,"translate"),S("onClick",function(){u(e);let i=s();return g(i.saveSource())}),l()()()}if(t&2){let e=s();O(P(26,Ft)),c("header",_(1,16,"MANAGER.SHOP.EXT_REVIEW_ADD_SOURCE_TITLE")),y("visible",e.showAddSourceDialog),c("modal",!0),o(4),f(_(5,18,"MANAGER.SHOP.EXT_REVIEW_PLATFORM")),o(2),y("ngModel",e.addSourcePlatform),c("options",e.platformAddOptions),o(),v(e.addSourcePlatform==="trustpilot"?7:e.addSourcePlatform==="google_business"?8:9),o(5),f(_(13,20,"MANAGER.SHOP.EXT_REVIEW_DISPLAY_NAME")),o(2),y("ngModel",e.addSourceDisplayName),o(2),c("label",_(17,22,"COMMON.CANCEL"))("text",!0),o(2),c("label",_(19,24,"MANAGER.SHOP.EXT_REVIEW_SAVE_SOURCE"))("loading",e.addSourceSaving)("disabled",!e.addSourceExternalId||!e.addSourceDisplayName)}}var Ct=class t{reviewService=T(ct);shopService=T(st);toastService=T(Te);confirmService=T(at);t=T(Ie);route=T(Re);qf=T(ot);destroyRef=T(le);filters;loading=!0;error=null;internalReviews=[];totalInternalReviews=0;externalReviews=[];totalExternalReviews=0;externalSources=[];externalStats=null;unifiedReviews=[];page=1;limit=20;activeFilter="";sourceFilter="all";stats=null;get kpiCards(){if(!this.stats)return[];let n=[{icon:"pi pi-star",label:"MANAGER.SHOP.REVIEW_STAT_TOTAL",value:(this.stats.combinedTotalReviews??0).toString(),color:"#3b82f6",bgColor:"rgba(59, 130, 246, 0.1)"},{icon:"pi pi-clock",label:"MANAGER.SHOP.REVIEW_STAT_PENDING",value:(this.stats.pendingCount??0).toString(),color:"#f59e0b",bgColor:"rgba(245, 158, 11, 0.1)"},{icon:"pi pi-chart-bar",label:"MANAGER.SHOP.REVIEW_STAT_AVERAGE",value:(this.stats.combinedAverageRating??this.stats.averageRating??0).toFixed(1),color:"#22c55e",bgColor:"rgba(34, 197, 94, 0.1)"},{icon:"pi pi-flag",label:"MANAGER.SHOP.REVIEW_STAT_FLAGGED",value:(this.stats.flaggedCount??0).toString(),color:"#ef4444",bgColor:"rgba(239, 68, 68, 0.1)"}];return this.externalReviewsImportEnabled&&(this.stats.externalReviews??0)>0&&n.push({icon:"pi pi-comments",label:"MANAGER.SHOP.EXT_REVIEW_STAT_TOTAL",value:this.stats.externalReviews.toString(),color:"#8b5cf6",bgColor:"rgba(139, 92, 246, 0.1)"}),n}showReplyDialog=!1;replyReview=null;replyText="";replying=!1;showRejectDialog=!1;rejectReview=null;rejectReason="";rejecting=!1;showAddSourceDialog=!1;addSourcePlatform="trustpilot";addSourceDomain="";addSourceDisplayName="";addSourceExternalId="";addSourceSearching=!1;addSourceSaving=!1;addSourceSearchResult=null;showSourcesDialog=!1;externalReviewsImportEnabled=!1;statusOptions=[{label:this.t.instant("MANAGER.SHOP.REVIEW_FILTER_ALL"),value:""},{label:this.t.instant("MANAGER.SHOP.REVIEW_STATUS_PENDING"),value:"pending"},{label:this.t.instant("MANAGER.SHOP.REVIEW_STATUS_APPROVED"),value:"approved"},{label:this.t.instant("MANAGER.SHOP.REVIEW_STATUS_REJECTED"),value:"rejected"},{label:this.t.instant("MANAGER.SHOP.REVIEW_STATUS_FLAGGED"),value:"flagged"}];sourceOptions=[{label:this.t.instant("MANAGER.SHOP.REVIEW_SOURCE_ALL"),value:"all"},{label:this.t.instant("MANAGER.SHOP.REVIEW_SOURCE_INTERNAL"),value:"internal"},{label:this.t.instant("MANAGER.SHOP.REVIEW_SOURCE_EXTERNAL"),value:"external"}];platformAddOptions=[{label:"Trustpilot",value:"trustpilot"},{label:"Google Business",value:"google_business"}];ngOnInit(){this.filters=this.qf.init(this.route,[{key:"status",default:""},{key:"source",default:"all"},{key:"page",default:1,type:"number"},{key:"limit",default:20,type:"number"}],()=>this.onFiltersChanged(),this.destroyRef),this.syncFromFilters(),this.loadAll()}loadAll(){return M(this,null,function*(){this.loading=!0,this.error=null;try{yield Promise.all([this.loadReviews(),this.loadStats(),this.loadExternalSources()])}catch{this.error="load"}finally{this.loading=!1}})}loadReviews(){return M(this,null,function*(){let n=this.activeFilter||void 0;if(this.sourceFilter!=="external"){let e=yield N(this.reviewService.getAllReviews(n,this.page,this.limit));this.internalReviews=e.reviews,this.totalInternalReviews=e.total}else this.internalReviews=[],this.totalInternalReviews=0;if(this.sourceFilter!=="internal"&&!this.activeFilter){let e=yield this.shopService.getExternalReviews(void 0,void 0,void 0,this.page,this.limit);this.externalReviews=e.reviews,this.totalExternalReviews=e.total}else this.externalReviews=[],this.totalExternalReviews=0;this.mergeReviews()})}mergeReviews(){let n=[];for(let e of this.internalReviews)n.push({_source:"internal",_type:"internal",id:e.id,authorName:e.authorName,authorEmail:e.authorEmail,rating:e.rating,comment:e.comment,status:e.status,isVerified:e.isVerified,sellerReply:e.sellerReply,date:e.createdAt,_internal:e});for(let e of this.externalReviews)n.push({_source:e.platform,_type:"external",id:e.id,authorName:e.authorName,authorAvatarUrl:e.authorAvatarUrl,rating:e.rating,comment:e.comment,title:e.title,isVerified:e.isVerified,sellerReply:e.sellerReply,date:e.reviewDate,visible:e.visible,platformUrl:e.platformUrl,_external:e});n.sort((e,a)=>new Date(a.date).getTime()-new Date(e.date).getTime()),this.unifiedReviews=n}
43loadStats(){return M(this,null,function*(){try{let[n,e]=yield Promise.all([N(this.reviewService.getReviewStats()),this.shopService.getExternalReviewStats().catch(()=>null)]);this.stats=n,this.externalStats=e}catch{}})}loadExternalSources(){return M(this,null,function*(){try{this.externalSources=yield this.shopService.getExternalReviewSources()}catch{}})}onFilterChange(){this.filters.set({status:this.activeFilter,source:this.sourceFilter,page:1}),this.syncFromFilters(),this.loadReviews()}onPageChange(n){let e=Math.floor(n.first/n.rows)+1;this.filters.set({page:e,limit:n.rows}),this.syncFromFilters(),this.loadReviews()}syncFromFilters(){let n=this.filters.values();this.activeFilter=n.status,this.sourceFilter=n.source,this.page=n.page,this.limit=n.limit}onFiltersChanged(){this.syncFromFilters(),this.loadReviews()}onResetFilters(){this.filters.reset()}get totalAllReviews(){return this.sourceFilter==="internal"?this.totalInternalReviews:this.sourceFilter==="external"?this.totalExternalReviews:this.totalInternalReviews+this.totalExternalReviews}getSourceLabel(n){return{internal:this.t.instant("MANAGER.SHOP.REVIEW_SOURCE_INTERNAL"),trustpilot:"Trustpilot",google_business:"Google Business",avis_verifies:"Avis V\xE9rifi\xE9s"}[n]||n}getSourceSeverity(n){switch(n){case"internal":return"success";case"trustpilot":return"info";case"google_business":return"warn";case"avis_verifies":return"secondary";default:return"info"}}approve(n){return M(this,null,function*(){if(n._internal)try{let e=yield N(this.reviewService.approveReview(n._internal.id));Object.assign(n._internal,e),n.status=e.status,this.toastService.success(this.t.instant("MANAGER.SHOP.REVIEW_APPROVED")),this.loadStats()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}openRejectDialog(n){n._internal&&(this.rejectReview=n._internal,this.rejectReason="",this.showRejectDialog=!0)}confirmReject(){return M(this,null,function*(){if(this.rejectReview){this.rejecting=!0;try{let n=yield N(this.reviewService.rejectReview(this.rejectReview.id,this.rejectReason||void 0));Object.assign(this.rejectReview,n);let e=this.unifiedReviews.find(a=>a._internal?.id===this.rejectReview.id);e&&(e.status=n.status),this.showRejectDialog=!1,this.toastService.success(this.t.instant("MANAGER.SHOP.REVIEW_REJECTED")),this.loadStats()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.rejecting=!1}}})}openReplyDialog(n){n._internal&&(this.replyReview=n._internal,this.replyText=n._internal.sellerReply||"",this.showReplyDialog=!0)}confirmReply(){return M(this,null,function*(){if(!(!this.replyReview||!this.replyText.trim())){this.replying=!0;try{let n=yield N(this.reviewService.replyToReview(this.replyReview.id,this.replyText.trim()));Object.assign(this.replyReview,n);let e=this.unifiedReviews.find(a=>a._internal?.id===this.replyReview.id);e&&(e.sellerReply=n.sellerReply),this.showReplyDialog=!1,this.toastService.success(this.t.instant("MANAGER.SHOP.REVIEW_REPLIED"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.replying=!1}}})}toggleExternalVisibility(n){return M(this,null,function*(){if(n._external)try{let e=!n._external.visible;yield this.shopService.toggleExternalReviewVisibility(n._external.id,e),n._external.visible=e,n.visible=e}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}openSourcesDialog(){this.showSourcesDialog=!0}openAddSourceDialog(){this.addSourcePlatform="trustpilot",this.addSourceDomain="",this.addSourceDisplayName="",this.addSourceExternalId="",this.addSourceSearchResult=null,this.showAddSourceDialog=!0}searchTrustpilot(){return M(this,null,function*(){if(this.addSourceDomain){this.addSourceSearching=!0,this.addSourceSearchResult=null;try{let n=yield this.shopService.searchTrustpilot(this.addSourceDomain);"error"in n?this.toastService.error(this.t.instant("MANAGER.SHOP.EXT_REVIEW_SEARCH_ERROR")):(this.addSourceSearchResult=n,this.addSourceExternalId=n.id,this.addSourceDisplayName=n.displayName||`Trustpilot - ${this.addSourceDomain}`)}catch{this.toastService.error(this.t.instant("MANAGER.SHOP.EXT_REVIEW_SEARCH_ERROR"))}finally{this.addSourceSearching=!1}}})}saveSource(){return M(this,null,function*(){if(!(!this.addSourceExternalId||!this.addSourceDisplayName)){this.addSourceSaving=!0;try{let n={platform:this.addSourcePlatform,externalIdentifier:this.addSourceExternalId,displayName:this.addSourceDisplayName,domain:this.addSourceDomain||void 0};yield this.shopService.createExternalReviewSource(n),this.showAddSourceDialog=!1,this.toastService.success(this.t.instant("MANAGER.SHOP.EXT_REVIEW_SOURCE_CREATED")),yield this.loadExternalSources()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.addSourceSaving=!1}}})}syncSource(n){return M(this,null,function*(){try{yield this.shopService.triggerExternalReviewSync(n.id),n.syncStatus="syncing",this.toastService.success(this.t.instant("MANAGER.SHOP.EXT_REVIEW_SYNC_QUEUED"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}deleteSource(n){return M(this,null,function*(){if(yield this.confirmService.confirm({message:this.t.instant("MANAGER.SHOP.EXT_REVIEW_DELETE_CONFIRM"),header:this.t.instant("MANAGER.SHOP.EXT_REVIEW_DELETE_TITLE"),severity:"danger",acceptLabel:this.t.instant("COMMON.DELETE"),rejectLabel:this.t.instant("COMMON.CANCEL")}))try{yield this.shopService.deleteExternalReviewSource(n.id),this.externalSources=this.externalSources.filter(a=>
43a.id!==n.id),this.toastService.success(this.t.instant("MANAGER.SHOP.EXT_REVIEW_SOURCE_DELETED")),this.loadReviews(),this.loadStats()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}getSyncSeverity(n){switch(n){case"idle":return"success";case"syncing":return"info";case"error":return"danger";default:return"info"}}getSyncLabel(n){let e="MANAGER.SHOP.EXT_REVIEW_SYNC_"+n.toUpperCase();return this.t.instant(e)}getStatusSeverity(n){switch(n){case"approved":return"success";case"pending":return"warn";case"rejected":return"danger";case"flagged":return"danger";default:return"secondary"}}getStatusLabel(n){let e=`MANAGER.SHOP.REVIEW_STATUS_${n.toUpperCase()}`;return this.t.instant(e)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=V({type:t,selectors:[["app-view-manager-shop-reviews"]],decls:11,vars:21,consts:[[3,"visibleChange","header","visible","modal"],[3,"header","visible","modal","style"],[3,"retry"],[1,"kpi-grid","mb-4"],[1,"d-flex","align-items-center","mb-3","gap-2","flex-wrap"],[1,"text-light","small"],["optionLabel","label","optionValue","value","appendTo","body",3,"ngModelChange","onChange","ngModel","options"],[1,"ms-auto","d-flex","gap-2"],[1,"btn","btn-sm","btn-outline-secondary","d-flex","align-items-center","gap-1"],["icon","pi pi-plus-circle","severity","info","size","small","badgeSeverity","contrast",3,"label","outlined","badge"],["icon","pi pi-star","titleKey","MANAGER.SHOP.REVIEWS_EMPTY_TITLE","descriptionKey","MANAGER.SHOP.REVIEWS_EMPTY_DESC"],["styleClass","p-datatable-sm",3,"value","paginator","rows","totalRecords","lazy","rowHover"],[1,"kpi-card",3,"--kpi-color","--kpi-bg"],[1,"kpi-card"],[1,"kpi-icon"],[1,"kpi-content"],[1,"kpi-value"],[1,"kpi-label"],[1,"text-light","small","ms-2"],[1,"btn","btn-sm","btn-outline-secondary","d-flex","align-items-center","gap-1",3,"click"],[1,"pi","pi-filter-slash"],["icon","pi pi-plus-circle","severity","info","size","small","badgeSeverity","contrast",3,"onClick","label","outlined","badge"],["styleClass","p-datatable-sm",3,"onLazyLoad","value","paginator","rows","totalRecords","lazy","rowHover"],["pTemplate","header"],["pTemplate","body"],[1,"text-end"],[3,"value","severity","rounded"],[1,"d-flex","align-items-center","gap-2"],["alt","",1,"review-avatar",3,"src"],[1,"fw-semibold"],["severity","success",1,"mt-1",3,"value","rounded"],[3,"ngModel","readonly","stars"],[2,"max-width","300px"],[1,"fw-semibold","small","mb-1"],[1,"text-truncate"],[1,"mt-1","p-2","bg-light","rounded","small"],["target","_blank","rel","noopener noreferrer",1,"small","mt-1","d-block",3,"href"],[1,"small","text-light"],[1,"d-flex","justify-content-end","gap-1"],["size","small",3,"icon","severity","text","pTooltip"],[1,"pi","pi-reply","me-1","text-primary"],[1,"text-truncate","d-inline-block",2,"max-width","200px","vertical-align","middle"],[1,"pi","pi-external-link","me-1"],["icon","pi pi-reply","severity","secondary","size","small",3,"onClick","text","pTooltip"],["icon","pi pi-check","severity","success","size","small",3,"onClick","text","pTooltip"],["icon","pi pi-times","severity","danger","size","small",3,"onClick","text","pTooltip"],["size","small",3,"onClick","icon","severity","text","pTooltip"],[1,"mb-3"],[1,"fw-semibold","mb-1"],[1,"mb-2",3,"ngModel","readonly","stars"],[1,"form-label","fw-semibold"],["pTextarea","","maxlength","2000",1,"w-100",3,"ngModelChange","ngModel","rows"],[1,"d-flex","justify-content-end","gap-2"],["severity","secondary",3,"onClick","label","text"],["severity","primary","icon","pi pi-send",3,"onClick","label","loading","disabled"],["pTextarea","","maxlength","500",1,"w-100",3,"ngModelChange","ngModel","rows","placeholder"],["severity","danger","icon","pi pi-times",3,"onClick","label","loading"],[1,"d-flex","justify-content-end","mb-3","pt-2"],["icon","pi pi-plus","severity","primary","size","small",3,"onClick","label"],[1,"text-center","p-4","text-light"],[1,"source-card","mb-2"],[1,"d-flex","align-items-center","gap-2","mb-2"],[1,"flex-grow-1","min-width-0"],[1,"fw-semibold","text-truncate"],["severity","warn",3,"value","rounded"],["severity","danger",3,"value","rounded"],[1,"small","mb-2",2,"color","var(--p-yellow-600)"],[1,"text-danger","small","mb-2"],[1,"d-flex","align-items-center","justify-content-end","gap-1"],["icon","pi pi-sync","severity","secondary","size","small",3,"onClick","text","pTooltip","disabled"],["icon","pi pi-trash","severity","danger","size","small",3,"onClick","text","pTooltip"],[1,"pi","pi-info-circle","me-1"],[1,"pi","pi-ban","me-1"],[1,"pi","pi-exclamation-triangle","me-1"],["optionLabel","label","optionValue","value",1,"w-100",3,"ngModelChange","ngModel","options"],["pInputText","",1,"w-100",3,"ngModelChange","ngModel"],["severity","primary","icon","pi pi-check",3,"onClick","label","loading","disabled"],["pInputText","","placeholder","monsite.com",1,"w-100",3,"ngModelChange","ngModel"],[1,"text-light"],["icon","pi pi-search","severity","secondary",3,"onClick","label","loading","disabled"],[1,"p-3","mb-3","rounded",2,"background","var(--p-surface-100)"],["pInputText","","placeholder","ChIJxxxxxxxxxxxxxxxxxxxxxxxx",1,"w-100",3,"ngModelChange","ngModel"],[1,"text-light","d-block","mt-1"],["href","https://developers.google.com/maps/documentation/places/web-service/place-id-lookup","target","_blank","rel","noopener noreferrer"]],template:function(e,a){e&1&&(h(0,Ht,1,0,"app-widget-loading")(1,jt,1,0,"app-widget-api-error")(2,ci,12,13),r(3,"p-dialog",0),d(4,"translate"),b("visibleChange",function(p){return I(a.showReplyDialog,p)||(a.showReplyDialog=p),p}),h(5,di,16,19),l(),r(6,"p-dialog",0),d(7,"translate"),b("visibleChange",function(p){return I(a.showRejectDialog,p)||(a.showRejectDialog=p),p}),h(8,_i,16,18),l(),h(9,wi,7,12,"p-dialog",1)(10,bi,20,27,"p-dialog",1)),e&2&&(v(a.loading?0:a.error?1:2),o(3),O(P(19,gt)),c("header",_(4,15,"MANAGER.SHOP.REVIEW_REPLY_TITLE")),y("visible",a.showReplyDialog),c("modal",!0),o(2),v(a.replyReview?5:-1),o(),O(P(20,gt)),c("header",_(7,17,"MANAGER.SHOP.REVIEW_REJECT_TITLE")),y("visible",a.showRejectDialog),c("modal",!0),o(2),v(a.rejectReview?8:-1),o(),v(a.externalReviewsImportEnabled?9:-1),o(),v(a.externalReviewsImportEnabled?10:-1))},dependencies:[$,Ee,ye,Le,Ae,Oe,Ne,Pe,Me,be,Xe,Ue,Q,it,tt,et,Ze,Ke,qe,lt,rt,Je,Ye,ut,q,Be,Ge,Qe,$e,ze,He,nt,pt],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}.kpi-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.kpi-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:16px;border-radius:12px;background:var(--kpi-bg);transition:transform .2s ease,box-shadow .2s ease;cursor:default}.kpi-card[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 4px 12px #00000014}.kpi-icon[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:10px;background:var(--kpi-color);display:flex;align-items:center;justify-content:center;flex-shrink:0}.kpi-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff;font-size:1rem}.kpi-content[_ngcontent-%COMP%]{min-width:0}.kpi-value[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:700;color:#1e293b;line-height:1.2}.kpi-label[_ngcontent-%COMP%]{font-size:.72rem;color:#64748b;text-transform:uppercase;letter-spacing:.3px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state__icon[_ngcontent-%COMP%]{width:64px;
43height:64px;border-radius:16px;background:#3b82f61a;display:inline-flex;align-items:center;justify-content:center}.empty-state__icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1.5rem;color:#3b82f6}.empty-state__title[_ngcontent-%COMP%]{font-size:.9rem;color:#64748b}.source-card[_ngcontent-%COMP%]{padding:12px 16px;border-radius:10px;border:1px solid var(--p-surface-border);background:var(--p-surface-card)}.review-avatar[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;object-fit:cover;flex-shrink:0}.review-hidden[_ngcontent-%COMP%]{opacity:.5}@media (max-width: 576px){.kpi-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr);gap:8px}.kpi-card[_ngcontent-%COMP%]{padding:12px;gap:8px}.kpi-icon[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:8px}.kpi-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.85rem}.kpi-value[_ngcontent-%COMP%]{font-size:1.1rem}.kpi-label[_ngcontent-%COMP%]{font-size:.65rem}}"]})};export{Ct as ViewManagerShopReviewsComponent};
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.