1"use strict";(self.webpackChunkenergy_tcm=self.webpackChunkenergy_tcm||[]).push([[438],{62166:(B,b,n)=>{n.d(b,{DG:()=>S,N3:()=>u,au:()=>f,zO:()=>r});const r="[LCD] get all currencies",S="[LCD] get all currencies suckness";class f{constructor(){this.type=r}}class u{constructor(l){this.payload=l,this.type=S}}},62399:(B,b,n)=>{n.d(b,{Bd:()=>S,c8:()=>f,dj:()=>r,nT:()=>u});const r="[LCD] get all languages",S="[LCD] get all languages suckness";class f{constructor(){this.type=r}}class u{constructor(l){this.payload=l,this.type=S}}},4903:(B,b,n)=>{n.d(b,{g:()=>Z});var r=n(60177),S=n(41635),f=n(76965),u=n(62399),d=n(62166);const g="[LCD] GET all domains suckness";class C{constructor(U){this.payload=U,this.type=g}}const R={languages:[],currencies:[],domains:[],languagesContainer:null,currenciesContainer:null,domainsContainer:null};function j(m=R,U){switch(U.type){case u.Bd:return{...m,languages:U.payload.items,languagesContainer:U.payload};case d.DG:return{...m,currencies:U.payload.items,currenciesContainer:U.payload};case g:return{...m,domains:U.payload.items,domainsContainer:U.payload};default:return m}}var y=n(90757),P=n(14421),x=n(15539),G=n(49090),k=n(95006),M=n(83921),h=n(54438),L=n(29262);let o=(()=>{class m{constructor(v,D,w,rt,it){this.actions=v,this.store=D,this.lcdService=w,this.toastService=rt,this.loaderService=it}static#t=this.\u0275fac=function(D){return new(D||m)(h.KVO(S.En),h.KVO(f.il),h.KVO(y.j),h.KVO(L.FS),h.KVO(L.wA))};static#e=this.\u0275prov=h.jDH({token:m,factory:m.\u0275fac})}return m})();var p=n(76613);let _=(()=>{class m extends o{constructor(){super(...arguments),this.getCurrencies=(0,S.EH)(()=>this.actions.pipe((0,S.gp)(d.zO),(0,x.M)(()=>this.loaderService.show()),(0,G.n)(()=>this.lcdService.getAllCurrencies().pipe((0,k.T)(v=>new d.N3(v)),(0,M.W)(v=>(0,P.of)(new p.Rn(v))))))),this.getCurrenciesSuccess=(0,S.EH)(()=>this.actions.pipe((0,S.gp)(d.DG),(0,x.M)(()=>this.loaderService.hide())),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let v;return function(w){return(v||(v=h.xGo(m)))(w||m)}})();static#e=this.\u0275prov=h.jDH({token:m,factory:m.\u0275fac})}return m})(),F=(()=>{class m extends o{constructor(){super(...arguments),this.getLanguages=(0,S.EH)(()=>this.actions.pipe((0,S.gp)(u.dj),(0,x.M)(()=>this.loaderService.show()),(0,G.n)(()=>this.lcdService.getAllLanguages().pipe((0,k.T)(v=>new u.nT(v)),(0,M.W)(v=>(0,P.of)(new p.Rn(v))))))),this.getLanguagesSuccess=(0,S.EH)(()=>this.actions.pipe((0,S.gp)(u.Bd),(0,x.M)(()=>this.loaderService.hide())),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let v;return function(w){return(v||(v=h.xGo(m)))(w||m)}})();static#e=this.\u0275prov=h.jDH({token:m,factory:m.\u0275fac})}return m})(),st=(()=>{class m extends o{constructor(){super(...arguments),this.getDomains=(0,S.EH)(()=>this.actions.pipe((0,S.gp)("[LCD] GET all domains"),(0,x.M)(()=>this.loaderService.show()),(0,G.n)(()=>this.lcdService.getAllDomains().pipe((0,k.T)(v=>new C(v)),(0,M.W)(v=>(0,P.of)(new p.Rn(v))))))),this.getDomainsSuccess=(0,S.EH)(()=>this.actions.pipe((0,S.gp)(g),(0,x.M)(()=>this.loaderService.hide())),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let v;return function(w){return(v||(v=h.xGo(m)))(w||m)}})();static#e=this.\u0275prov=h.jDH({token:m,factory:m.\u0275fac})}return m})(),Z=(()=>{class m{static#t=this.\u0275fac=function(D){return new(D||m)};static#e=this.\u0275mod=h.$C({type:m});static#s=this.\u0275inj=h.G2t({providers:[y.j],imports:[r.MD,f.md.forFeature("sharedLCD",j),S.Vm.forFeature([_,F,st])]})}return m})()},90757:(B,b,n)=>{n.d(b,{j:()=>f});var r=n(12906),S=n(54438);let f=(()=>{class u extends r.d{constructor(){super(...arguments),this.LANGUAGES_URL="languages",this.CURRENCIES_URL="currencies",this.DOMAINS_URL="domains"}getAllLanguages(){const l=this.buildUrl(this.LANGUAGES_URL,{});return this.get(l)}createLanguage(l){const g=this.buildUrl(this.LANGUAGES_URL,{});return this.post(g,l)}deleteLanguages(l){const g=l.reduce((C,R)=>C.concat(R.id),[]),t=this.buildUrl(this.LANGUAGES_URL,{language_ids:g});return this.del(t)}getLanguage(l){const g=this.buildUrl(this.LANGUAGES_URL+"/"+l,{});return this.get(g)}patchLanguage(l,g){const t=this.buildUrl(this.LANGUAGES_URL+"/"+l,{});return this.patch(t,g)}getAllCurrencies(){const l=this.buildUrl(this.CURRENCIES_URL,{});return this.get(l)}createCurrency(l){const g=this.buildUrl(this.CURRENCIES_URL,{});return this.post(g,l)}deleteCurrencies(l){const g=l.reduce((C,R)=>
1C.concat(R.id),[]),t=this.buildUrl(this.CURRENCIES_URL,{currency_ids:g});return this.del(t)}getCurrency(l){const g=this.buildUrl(this.CURRENCIES_URL+"/"+l,{});return this.get(g)}patchCurrency(l,g){const t=this.buildUrl(this.CURRENCIES_URL+"/"+l,{});return this.patch(t,g)}getAllDomains(){const l=this.buildUrl(this.DOMAINS_URL,{});return this.get(l)}createDomain(l){const g=this.buildUrl(this.DOMAINS_URL,{});return this.post(g,l)}deleteDomains(l){const g=l.reduce((C,R)=>C.concat(R.id),[]),t=this.buildUrl(this.DOMAINS_URL,{domain_ids:g});return this.del(t)}getDomain(l){const g=this.buildUrl(this.DOMAINS_URL+"/"+l,{});return this.get(g)}patchDomain(l,g){const t=this.buildUrl(this.DOMAINS_URL+"/"+l,{});return this.patch(t,g)}createDomainInfo(l,g){const t=this.buildUrl([this.DOMAINS_URL,l,"info"]),C=new FormData;return C.append("language",g.language),C.append("cart_description",g.cart_description),C.append("terms_and_conditions_file",g.terms_and_conditions_file),this.post(t,C)}patchDomainInfo(l,g,t){const C=this.buildUrl([this.DOMAINS_URL,l,"info",g]),R=new FormData;return R.append("language",t.language),R.append("cart_description",t.cart_description),R.append("terms_and_conditions_file",t.terms_and_conditions_file),this.post(C,R)}deleteDomainInfo(l,g){const t=this.buildUrl([this.DOMAINS_URL,l,"info",g]);return this.del(t)}static#t=this.\u0275fac=(()=>{let l;return function(t){return(l||(l=S.xGo(u)))(t||u)}})();static#e=this.\u0275prov=S.jDH({token:u,factory:u.\u0275fac})}return u})()},80438:(B,b,n)=>{n.r(b),n.d(b,{SellersModule:()=>Ve});var r=n(60177),S=n(63040),f=n(76965),u=n(41635),d=n(89417),l=n(29262),g=n(12906),t=n(54438);let C=(()=>{class s extends g.d{constructor(){super(...arguments),this.SELLERS_URL="sellers"}getSeller(e){const i=this.buildUrl(`${this.SELLERS_URL}/${e}`);return this.get(i)}getSellers(e,i=null){const a={page:e,...i},E=this.buildUrl(this.SELLERS_URL,a,!0);return this.get(E)}createSeller(e){const i=this.buildUrl(this.SELLERS_URL);return this.post(i,e)}patchSeller(e,i){const a=this.buildUrl(`${this.SELLERS_URL}/${e}`);return this.patch(a,i)}patchSellerAddress(e,i){const a=this.buildUrl(`${this.SELLERS_URL}/${e}/address`);return this.patch(a,i)}deleteSellers(e){const i={seller_ids:e.reduce((E,z)=>(E.push(z.id),E),[])},a=this.buildUrl(this.SELLERS_URL,i);return this.del(a)}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})();var R=n(97309),j=n(45286),y=n(7605);const P="[Sellers] get sellers",x="[Sellers] get sellers success";class G{constructor(c){this.payload=c,this.type=P}}class k{constructor(c){this.payload=c,this.type=x}}const M="[Sellers] SET filter",h="[Sellers] RESET filter";class L{constructor(c){this.payload=c,this.type=M}}class o{constructor(){this.type=h}}const p="[Sellers] TOGGLE seller";class _{constructor(c){this.payload=c,this.type=p}}const F="[Sellers] unselect all";class st{constructor(){this.type=F}}
1const Z="[Sellers] DELETE sellers",m="[Sellers] DELETE sellers success";class U{constructor(c){this.payload=c,this.type=Z}}class v{constructor(c){this.payload=c,this.type=m}}const D="[Sellers] CREATE seller",w="[Sellers] CREATE seller success";class rt{constructor(c){this.payload=c,this.type=D}}class it{constructor(c){this.payload=c,this.type=w}}var q=n(52693),O=n(63649),I=n(23509),N=n(90113),$=n(36001),nt=n(33579),ot=n(33555),tt=n(97519),yt=n(31992),xt=n(46346),Lt=n(94300),Ft=n(54444);let Tt=(()=>{class s{constructor(e,i){this.store=e,this.modalService=i,this.ERRORS={name:{required:"Prodejce mus\xed m\xedt n\xe1zev."},gps:{required:"Prodejce mus\xed m\xedt GPS.",pattern:"GPS sou\u0159adnice mus\xed b\xfdt ve form\xe1tu xx.xxx, xx.xxx (-90, 90). (-180, 180)"}},this.form=new d.J3({name:new d.hs(null,d.k0.required),gps:new d.hs(null,[d.k0.required,d.k0.pattern(q.rt)])})}ngOnInit(){}createSeller(){this.form.valid?(this.store.dispatch(new rt({item:this.form.value})),this.close()):console.error("add seller not valid",this.form)}close(){this.modalService.close()}isAddButtonDisabled(){return!this.form||!this.form.valid}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(l.mO))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-add-modal"]],decls:19,vars:5,consts:[["type","text","placeholder","N\xe1zev *",3,"control","errors"],["type","text","placeholder","GPS sou\u0159adnice *",3,"control","errors"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(i,a){1&i&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Nov\xfd prodejce"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"mcrai-row")(6,"mcrai-col")(7,"mcrai-panel")(8,"mcrai-panel-header")(9,"h2"),t.EFF(10,"Z\xe1kladn\xed informace"),t.k0s()(),t.j41(11,"mcrai-panel-content"),t.nrm(12,"mcrai-input",0)(13,"mcrai-input",1),t.k0s()()()()(),t.j41(14,"mcrai-modal-actions")(15,"button",2),t.bIt("click",function(){return a.close()}),t.EFF(16,"Zav\u0159\xedt "),t.k0s(),t.j41(17,"button",3),t.bIt("click",function(){return a.createSeller()}),t.EFF(18,"Vytvo\u0159it "),t.k0s()()()),2&i&&(t.R7$(12),t.Y8G("control",a.form.controls.name)("errors",a.ERRORS.name),t.R7$(),t.Y8G("control",a.form.controls.gps)("errors",a.ERRORS.gps),t.R7$(4),t.Y8G("disabled",a.isAddButtonDisabled()))},dependencies:[O.Q,I.g,N.l,$.B,nt.o,ot.g,tt.N,yt.h,xt.l,Lt.J,Ft.f]})}return s})();var V=n(1173);const pt="[Sellers] GET one seller",at="[Sellers] GET one seller success";class Ut{constructor(c){this.payload=c,this.type=pt}}class Dt{constructor(c){this.payload=c,this.type=at}}const ut="[Sellers] PATCH seller",lt="[Sellers] PATCH seller success";class ht{constructor(c){this.payload=c,this.type=ut}}class Gt{constructor(c){this.payload=c,this.type=lt}}const mt="[Sellers] PATCH seller address",ct="[Sellers] PATCH seller address success";class wt{constructor(c){this.payload=c,this.type=mt}}class jt{constructor(c){this.payload=c,this.type=ct}}const gt={sellers:null,seller:null,filter:null,selectedSellers:[]};function Pt(s,c){const e=s.filter(i=>i.id!==c.id);return e.length<s.length?e:s.concat(c)}const Q="aegisxSellers";function Mt(s=gt,c){switch(c.type){case at:case lt:case ct:return{...s,seller:c.payload.item};case x:return{...s,sellers:c.payload.sellers,seller:null};case F:case m:return{...s,selectedSellers:[]};case p:return{...s,selectedSellers:Pt(s.selectedSellers,c.payload.item)};case M:return{...s,filter:c.payload.filter};case h:return{...s,filter:gt.filter};default:return s}}const At=s=>s[Q].seller,ft=s=>s[Q].sellers,St=s=>s[Q].selectedSellers,kt=s=>s[Q].filter;var dt=n(71829),J=n(65382),_t=n(70014),vt=n(77617),et=n(92721),Et=n(52699),Ot=n(48390),Bt=n(64204),It=n(95466),Nt=n(7306),$t=n(7622),Vt=n(57382),Xt=n(65208),Ht=n(21336),Wt=n(30127),Yt=n(49451);const Kt=s=>["/aegisx/sellers",s];function Qt(s,c){1&s&&(t.j41(0,"mcrai-th"),t.EFF(1,"N\xe1zev"),t.k0s())}function Jt(s,c){if(1&s&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&s){const e=c.$implicit;t.R7$(),t.JRh(e.name)}}function zt(s,c){1&s&&(t.j41(0,"mcrai-th"),t.EFF(1,"GPS"),t.k0s())}function Zt(s,c){if(1&s&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&s){const e=c.$implicit;t.R7$(),t.JRh(e.gps)}}function qt(s,c){1&s&&t.nrm(0,"mcrai-th")}function te(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",12),t.bIt("click",function(){t.eBV(e);const a=t.XpG().$implicit,E=t.XpG(2);return t.Njj(E.toggleSeller(a))}),t.EFF(1,"Vybrat "),t.k0s()}}function ee(s,c){if(1&s&&(t.j41(0,"mcrai-td",9),t.DNE(1,te,2,0,"button",10),t.j41(2,"a",11),t.EFF(3,"Detail"),t.k0s()()),2&s){const e=c.$implicit,i=t.XpG(2);t.R7$(),t.vxM(1,i.canEdit()?1:-1),t.R7$(),t.Y8G("routerLink",t.eq3(2,Kt,e.id))}}function se(s,c){1&s&&t.nrm(0,"mcrai-tr")}function re(s,c){if(1&s&&t.nrm(0,"mcrai-tr"),2&s){const e=c.$implicit,i=t.XpG(2);t.AVh("mcrai-tr--highlight",i.isSelected(e))}}function ie(s,c){if(1&s&&(t.j41(0,"mcrai-table",0),t.qex(1,1),t.DNE(2,Qt,2,0,"mcrai-th",2)(3,Jt,2,1,"mcrai-td",3),t.bVm(),t.qex(4,4),t.DNE(5,zt,2,0,"mcrai-th",2)(6,Zt,2,1,"mcrai-td",3),t.bVm(),t.qex(7,5),t.DNE(8,qt,1,0,"mcrai-th",2)(9,ee,4,4,"mcrai-td",6),t.bVm(),t.DNE(10,se,1,0,"mcrai-tr",7)(11,re,1,2,"mcrai-tr",8),t.k0s()),2&s){const e=t.XpG();t.Y8G("container",e.sellers),t.R7$(10),t.Y8G("mcraiHeaderRowDef",e.columns),t.R7$(),t.Y8G("mcraiRowDefColumns",e.columns)}}let ne=(()=>{class s{get columns(){return["name","gps","actions"]}constructor(e,i,a){this.store=e,this.toolbarService=i,this.permissionService=a,this.destroy=new j.B7}ngOnInit(){this.selectSellers(),this.selectSelectedSellers()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}selectSellers(){this.store.pipe((0,f.Lt)(ft),(0,y.Q)(this.destroy)).subscribe(e=>this.sellers=e)}selectSelectedSellers(){this.store.pipe((0,f.Lt)(St),(0,y.Q)(this.destroy)).subscribe(e=>this.selectedSellers=e)}toggleSeller(e){this.store.dispatch(new _({item:e}))}isSelected(e){return!!this.selectedSellers.find(i=>i.id===e.id)}canEdit(){return this.permissionService.canWritePage("aegisx.sellers")}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(J.h),t.rXU(dt.n))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-list"]],decls:1,vars:1,consts:[[3,"container"],["mcraiColumnDef","name"],[4,"mcraiHeaderCellDef"],[4,"mcraiCellDef"],["mcraiColumnDef","gps"],["mcraiColumnDef","actions"],["align-right","",4,"mcraiCellDef"],[4,"mcraiHeaderRowDef"],[3,"mcrai-tr--highlight",4,"mcraiRowDef","mcraiRowDefColumns"],["align-right",""],["mcrai-button","neutral"],["mcrai-button","neutral",3,"routerLink"],["mcrai-button","neutral",3,"click"]],template:function(i,a){1&i&&t.DNE(0,ie,12,3,"mcrai-table",0),2&i&&t.vxM(0,a.sellers?0:-1)},dependencies:[S.Wk,O.Q,Bt.n,It.q,Nt.B,$t.K,Vt.D,Xt.Q,Ht.V,Wt.e,Yt.O]})}return s})();function oe(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",5),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.resetFilter())}),t.EFF(1,"Reset "),t.k0s()}}let ae=(()=>{class s{get controls(){return this.form.controls}constructor(e){this.store=e}ngOnInit(){this.form=new d.J3({q:new d.hs("")})}filterSellers(){this.store.dispatch(new L({filter:this.form.value})),this.store.dispatch(new G({page:1}))}resetFilter(){this.form.reset(),this.filterSellers()}isFiltered(){return!!this.form.value.q}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-filter"]],decls:15,vars:4,consts:[["color","secondary","collapsable","",3,"collapsed"],["
1id","seller_filter",3,"formGroup"],["type","text","placeholder","Fulltext","error","",3,"control"],["mcrai-button","negative"],["mcrai-button","positive","form","seller_filter",3,"click"],["mcrai-button","negative",3,"click"]],template:function(i,a){1&i&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Filtr"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"form",1)(6,"mcrai-row")(7,"mcrai-col"),t.nrm(8,"mcrai-input",2),t.k0s(),t.nrm(9,"mcrai-col")(10,"mcrai-col"),t.k0s()()(),t.j41(11,"mcrai-panel-actions"),t.DNE(12,oe,2,0,"button",3),t.j41(13,"button",4),t.bIt("click",function(){return a.filterSellers()}),t.EFF(14,"Filtrovat "),t.k0s()()()),2&i&&(t.Y8G("collapsed",!0),t.R7$(5),t.Y8G("formGroup",a.form),t.R7$(3),t.Y8G("control",a.controls.q),t.R7$(4),t.vxM(12,a.isFiltered()?12:-1))},dependencies:[O.Q,d.qT,d.cb,d.j4,I.g,N.l,et.h,$.B,nt.o,ot.g,tt.N]})}return s})();function le(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.deleteSellers())}),t.EFF(1,"Smazat vybran\xe9 "),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteButtonDisabled())}}function ce(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",8),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.showAddSellerModal())}),t.EFF(1,"P\u0159idat prodejce "),t.k0s()}}function de(s,c){if(1&s){const e=t.RV6();t.j41(0,"mcrai-paginator",3),t.bIt("page",function(a){t.eBV(e);const E=t.XpG();return t.Njj(E.onPageChange(a))}),t.k0s(),t.j41(1,"button",4),t.bIt("click",function(){t.eBV(e);const a=t.XpG();return t.Njj(a.unselectAll())}),t.EFF(2,"Zru\u0161it v\xfdb\u011br "),t.k0s(),t.DNE(3,le,2,1,"button",5)(4,ce,2,0,"button",6)}if(2&s){const e=t.XpG();t.Y8G("paginator",null==e.sellers?null:e.sellers.paginator),t.R7$(),t.Y8G("disabled",e.isDeleteButtonDisabled()),t.R7$(2),t.vxM(3,e.toolbarService.isDeleteMode()?3:-1),t.R7$(),t.vxM(4,e.permissionService.canWrite()&&!e.toolbarService.isDeleteMode()?4:-1)}}function pe(s,c){1&s&&t.eu8(0)}function ue(s,c){1&s&&t.eu8(0)}let he=(()=>{class s{constructor(e,i,a,E){this.store=e,this.modalService=i,this.permissionService=a,this.toolbarService=E,this.destroy=new j.B7}ngOnInit(){this.setToolbarModes(),this.getSellers(),this.selectSellers(),this.selectSelectedSellers(),this.selectSellersFilter(),this.resetFilter()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}setToolbarModes(){this.toolbarService.setToolbarModes([V.H.View,V.H.Edit,V.H.Delete])}selectSellers(){this.store.pipe((0,f.Lt)(ft),(0,y.Q)(this.destroy)).subscribe(e=>this.sellers=e)}selectSellersFilter(){this.store.pipe((0,f.Lt)(kt),(0,y.Q)(this.destroy)).subscribe(e=>this.filter=e)}getSellers(e=1){this.store.dispatch(new G({page:e}))}selectSelectedSellers(){this.store.pipe((0,f.Lt)(St),(0,y.Q)(this.destroy)).subscribe(e=>this.selectedSellers=e)}resetFilter(){this.store.dispatch(new o)}showAddSellerModal(){const e=new l.m_("800px","400px");this.modalService.open(Tt,e)}unselectAll(){this.store.dispatch(new st)}isDeleteButtonDisabled(){return!this.selectedSellers||!this.selectedSellers.length}onPageChange(e){this.getSellers(e)}deleteSellers(){console.log(this.selectedSellers),this.selectedSellers.length?this.store.dispatch(new U({items:this.selectedSellers})):console.error("delete sellers fail",this.selectedSellers)}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(l.mO),t.rXU(dt.n),t.rXU(J.h))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-sellers-overview"]],decls:16,vars:2,consts:[["sellersActions",""],["top",""],[4,"ngTemplateOutlet"],[1,"pull-left",3,"page","paginator"],["mcrai-button","neutral",3,"click","disabled"],["mcrai-button","negative",3,"disabled"],["mcrai-button","positive"],["mcrai-button","negative",3,"click","disabled"],["mcrai-button","positive",3,"click"]],template:function(i,a){if(1&i&&(t.nrm(0,"aegisx-header"),t.j41(1,"mcrai-container")(2,"mcrai-panel")(3,"mcrai-panel-header")(4,"h1"),t.EFF(5,"Prodejci"),t.k0s()(),t.j41(6,"mcrai-panel-content"),t.nrm(7,"aegisx-seller-filter")(8,"aegisx-seller-list"),t.k0s(),t.DNE(9,de,5,4,"ng-template",null,0,t.C5r),t.j41(11,"mcrai-panel-actions",1),t.DNE(12,pe,1,0,"ng-container",2),t.k0s(),t.j41(13,"mcrai-panel-actions"),t.DNE(14,ue,1,0,"ng-container",2),t.k0s()()(),t.nrm(15,"aegisx-toolbar")),2&i){const E=t.sdS(10);t.R7$(12),t.Y8G("ngTemplateOutlet",E),t.R7$(2),t.Y8G("ngTemplateOutlet",E)}},dependencies:[r.T3,_t.I,vt.I,O.Q,I.g,N.l,et.h,$.B,Et.H,Ot.h,ne,ae]})}return s})();var me=n(62399),Ct=n(41819),Rt=n(62523),bt=n(39103);function ge(s,c){if(1&s&&(t.j41(0,"mcrai-dl")(1,"mcrai-dt"),t.EFF(2,"N\xe1zev"),t.k0s(),t.j41(3,"mcrai-dd"),t.EFF(4),t.k0s(),t.j41(5,"mcrai-dt"),t.EFF(6,"GPS sou\u0159adnice"),t.k0s(),t.j41(7,"mcrai-dd"),t.EFF(8),t.k0s()()),2&s){const e=t.XpG();t.R7$(4),t.JRh(null==e.seller?null:e.seller.name),t.R7$(4),t.JRh(null==e.seller?null:e.seller.gps)}}function fe(s,c){if(1&s&&t.nrm(0,"mcrai-input",2)(1,"mcrai-input",3),2&s){const e=t.XpG();t.Y8G("control",e.form.controls.name)("errors",e.ERRORS.name),t.R7$(),t.Y8G("control",e.form.controls.gps)("errors",e.ERRORS.gps)}}function Se(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",5),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.patch())}
1),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("disabled",e.form.invalid)}}function _e(s,c){if(1&s&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Se,2,1,"button",4),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1)}}let ve=(()=>{class s{constructor(e,i){this.store=e,this.toolbarService=i,this.ERRORS={name:{required:"Prodejce mus\xed m\xedt n\xe1zev"},gps:{required:"Prodejce mus\xed m\xedt GPS sou\u0159adnice",pattern:"GPS sou\u0159adnice mus\xed b\xfdt ve form\xe1tu xx.xxx, xx.xxx (-90, 90). (-180, 180)"}},this.form=new d.J3({name:new d.hs(null,d.k0.required),gps:new d.hs(null,[d.k0.required,d.k0.pattern(q.rt)])})}ngOnInit(){}ngOnChanges(e){e.hasOwnProperty("seller")&&(this.form.controls.name.patchValue(this.seller.name),this.form.controls.gps.patchValue(this.seller.gps))}showActions(){return this.toolbarService.isViewMode()||!this.toolbarService.isViewMode()}patch(){this.form.valid?this.store.dispatch(new ht({seller_id:this.seller.id,body:this.form.value})):console.error("seller form not valid",this.form)}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(J.h))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-info"]],inputs:{seller:"seller"},features:[t.OA$],decls:9,vars:4,consts:[["color","secondary"],["id","info",3,"formGroup"],["type","text","placeholder","N\xe1zev",3,"control","errors"],["type","text","placeholder","GPS sou\u0159adnice",3,"control","errors"],["form","info","mcrai-button","positive",3,"disabled"],["form","info","mcrai-button","positive",3,"click","disabled"]],template:function(i,a){1&i&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Z\xe1kladn\xed informace"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"form",1),t.DNE(6,ge,9,2,"mcrai-dl")(7,fe,2,4),t.k0s()(),t.DNE(8,_e,2,1,"mcrai-panel-actions"),t.k0s()),2&i&&(t.R7$(5),t.Y8G("formGroup",a.form),t.R7$(),t.vxM(6,a.toolbarService.isEditMode()?-1:6),t.R7$(),t.vxM(7,a.toolbarService.isEditMode()?7:-1),t.R7$(),t.vxM(8,a.showActions()?8:-1))},dependencies:[O.Q,d.qT,d.cb,d.j4,I.g,N.l,et.h,$.B,tt.N,Ct.p,Rt.L,bt.Z]})}return s})();var Ee=n(58728),Ce=n(52570);function Re(s,c){if(1&s&&(t.j41(0,"mcrai-dl")(1,"mcrai-dt"),t.EFF(2,"Email"),t.k0s(),t.j41(3,"mcrai-dd"),t.EFF(4),t.nI1(5,"notSet"),t.k0s(),t.j41(6,"mcrai-dt"),t.EFF(7,"Telefon"),t.k0s(),t.j41(8,"mcrai-dd"),t.EFF(9),t.nI1(10,"notSet"),t.k0s(),t.j41(11,"mcrai-dt"),t.EFF(12,"Webov\xe1 str\xe1nka"),t.k0s(),t.j41(13,"mcrai-dd"),t.EFF(14),t.nI1(15,"notSet"),t.k0s(),t.j41(16,"mcrai-dt"),t.EFF(17,"M\u011bsto"),t.k0s(),t.j41(18,"mcrai-dd"),t.EFF(19),t.nI1(20,"notSet"),t.k0s(),t.j41(21,"mcrai-dt"),t.EFF(22,"Ulice"),t.k0s(),t.j41(23,"mcrai-dd"),t.EFF(24),t.nI1(25,"notSet"),t.k0s(),t.j41(26,"mcrai-dt"),t.EFF(27,"PS\u010c"),t.k0s(),t.j41(28,"mcrai-dd"),t.EFF(29),t.nI1(30,"notSet"),t.k0s(),t.j41(31,"mcrai-dt"),t.EFF(32,"Zem\u011b"),t.k0s(),t.j41(33,"mcrai-dd"),t.EFF(34),t.nI1(35,"notSet"),t.k0s()()),2&s){const e=t.XpG();t.R7$(4),t.JRh(t.bMT(5,7,null==e.address?null:e.address.email)),t.R7$(5),t.JRh(t.bMT(10,9,null==e.address?null:e.address.phone)),t.R7$(5),t.JRh(t.bMT(15,11,null==e.address?null:e.address.website)),t.R7$(5),t.JRh(t.bMT(20,13,null==e.address?null:e.address.city)),t.R7$(5),t.JRh(t.bMT(25,15,null==e.address?null:e.address.street)),t.R7$(5),t.JRh(t.bMT(30,17,null==e.address?null:e.address.postal_code)),t.R7$(5),t.JRh(t.bMT(35,19,null==e.address?null:e.address.country))}}function be(s,c){if(1&s&&t.nrm(0,"mcrai-input",2)(1,"mcrai-input",3)(2,"mcrai-input",4)(3,"mcrai-input",5)(4,"mcrai-input",6)(5,"mcrai-input",7)(6,"mcrai-input",8),2&s){const e=t.XpG();t.Y8G("control",e.controls.email)("errors",e.ERRORS.email),t.R7$(),t.Y8G("control",e.controls.phone)("errors",e.ERRORS.phone),t.R7$(),t.Y8G("control",e.controls.website)("errors",e.ERRORS.website),t.R7$(),t.Y8G("control",e.controls.city),t.R7$(),t.Y8G("control",e.controls.street),t.R7$(),t.Y8G("control",e.controls.postal_code),t.R7$(),t.Y8G("control",e.controls.country)}}function ye(s,c){if(1&s){const e=t.RV6();t.j41(0,"button",10),t.bIt("click",function(){t.eBV(e);const a=t.XpG(2);return t.Njj(a.patch())}
1),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("disabled",e.form.invalid)}}function xe(s,c){if(1&s&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,ye,2,1,"button",9),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1)}}let Le=(()=>{class s{get controls(){return this.form.controls}constructor(e,i,a){this.store=e,this.permissionService=i,this.toolbarService=a,this.ERRORS={email:{pattern:"Zadejte e-mail se spr\xe1vn\xe9m form\xe1tu: [email protected]"},phone:{pattern:"Telefon nen\xed ve form\xe1tu +420123456789"},website:{pattern:"Webov\xe1 str\xe1nka nen\xed ve form\xe1tu (www.) xxx.xx"}},this.destroy=new j.B7,this.form=new d.J3({})}ngOnInit(){this.store.select(At).pipe((0,y.Q)(this.destroy),(0,Ee.p)(e=>!!e.address)).subscribe(e=>this.onSellerChange(e))}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}onSellerChange(e){this.address=e.address,this.seller=e,this.buildForm(e.address)}buildForm(e){this.form=new d.J3({email:new d.hs(e.email,d.k0.pattern(q.Ec)),phone:new d.hs(e.phone,d.k0.pattern(q.Nm)),website:new d.hs(e.website,d.k0.pattern(/^((https?|http):\/\/)?(www.)?[a-z\d]+\.[a-z]+(\/[a-zA-Z\d#]+\/?)*$/)),street:new d.hs(e.street),city:new d.hs(e.city),country:new d.hs(e.country),postal_code:new d.hs(e.postal_code)})}showActions(){return this.toolbarService.isViewMode()||!this.toolbarService.isViewMode()}patch(){this.form.valid?this.store.dispatch(new wt({seller_id:this.seller.id,body:this.form.value})):console.error("seller address form not valid",this.form)}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(dt.n),t.rXU(J.h))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-address"]],decls:9,vars:4,consts:[["color","secondary"],["id","address",3,"formGroup"],["type","text","placeholder","Email",3,"control","errors"],["type","text","placeholder","Telefon",3,"control","errors"],["type","text","placeholder","Webov\xe1 str\xe1nka",3,"control","errors"],["type","text","placeholder","M\u011bsto",3,"control"],["type","text","placeholder","Ulice",3,"control"],["type","text","placeholder","PS\u010c",3,"control"],["type","text","placeholder","Zem\u011b",3,"control"],["form","address","mcrai-button","positive",3,"disabled"],["form","address","mcrai-button","positive",3,"click","disabled"]],template:function(i,a){1&i&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Adresa"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"form",1),t.DNE(6,Re,36,21,"mcrai-dl")(7,be,7,10),t.k0s()(),t.DNE(8,xe,2,1,"mcrai-panel-actions"),t.k0s()),2&i&&(t.R7$(5),t.Y8G("formGroup",a.form),t.R7$(),t.vxM(6,a.toolbarService.isEditMode()?-1:6),t.R7$(),t.vxM(7,a.toolbarService.isEditMode()?7:-1),t.R7$(),t.vxM(8,a.permissionService.canWrite()&&a.showActions()?8:-1))},dependencies:[O.Q,d.qT,d.cb,d.j4,I.g,N.l,et.h,$.B,tt.N,Ct.p,Rt.L,bt.Z,Ce.s],styles:[".mcrai-tabs[_ngcontent-%COMP%]{background-color:#fff!important}"]})}return s})();function Fe(s,c){if(1&s&&(t.j41(0,"mcrai-row")(1,"mcrai-col")(2,"mcrai-panel")(3,"mcrai-panel-header")(4,"h1"),t.EFF(5),t.k0s()(),t.j41(6,"mcrai-panel-content")(7,"mcrai-row")(8,"mcrai-col"),t.nrm(9,"aegisx-seller-info",1),t.k0s(),t.j41(10,"mcrai-col",2),t.nrm(11,"aegisx-seller-address"),t.k0s()()()()()()),2&s){const e=t.XpG();t.R7$(5),t.JRh(null==e.seller?null:e.seller.name),t.R7$(4),t.Y8G("seller",e.seller)}}const Ue=[{path:"",component:he,canActivate:[R.J]},{path:":seller_id",component:(()=>{class s{constructor(e,i,a,E){this.store=e,this.activatedRoute=i,this.toolbarService=a,this.location=E,this.destroy=new j.B7,this.patchedSeller=new d.J3({}),i.params.subscribe(z=>{this.store.dispatch(new Ut({id:z.seller_id}))})}ngOnInit(){this.getLanguages(),this.selectSeller(),this.setToolbarModes()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}setToolbarModes(){this.toolbarService.setToolbarModes([V.H.View,V.H.Edit,V.H.Delete])}selectSeller(){this.store.select(e=>e.aegisxSellers.seller).pipe((0,y.Q)(this.destroy)).subscribe(e=>this.seller=e)}patchSeller(){this.patchedSeller.valid?this.store.dispatch(new ht({seller_id:this.seller.id,body:this.patchedSeller.value})):console.error("patch seller not valid",this.patchedSeller)}getLanguages(){this.store.dispatch(new me.c8)}static#t=this.\u0275fac=function(i){return new(i||s)(t.rXU(f.il),t.rXU(S.nX),t.rXU(J.h),t.rXU(r.aZ))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["aegisx-seller-detail"]],decls:8,vars:1,consts:[["mcrai-button","neutral",3,"click"],[3,"seller"],["flex-2",""]],template:function(i,a){1&i&&(t.nrm(0,"aegisx-header"),t.j41(1,"mcrai-container")(2,"mcrai-row")(3,"mcrai-col")(4,"button",0),t.bIt("click",function(){return a.location.back()}
1),t.EFF(5,"Zp\xe1tky"),t.k0s()()(),t.DNE(6,Fe,12,2,"mcrai-row"),t.k0s(),t.nrm(7,"aegisx-toolbar")),2&i&&(t.R7$(6),t.vxM(6,a.seller?6:-1))},dependencies:[_t.I,vt.I,O.Q,I.g,N.l,$.B,nt.o,ot.g,Et.H,ve,Le]})}return s})(),canActivate:[R.J]}];let De=(()=>{class s{static#t=this.\u0275fac=function(i){return new(i||s)};static#e=this.\u0275mod=t.$C({type:s});static#s=this.\u0275inj=t.G2t({imports:[S.iI.forChild(Ue),S.iI]})}return s})();var Ge=n(291),we=n(93578),je=n(73821),Pe=n(4903),Me=n(50289),X=n(14421),T=n(15539),A=n(49090),H=n(95006),W=n(83921);let Y=(()=>{class s{constructor(e,i,a,E,z,Xe){this.actions=e,this.sellerService=i,this.store=a,this.toastService=E,this.loaderService=z,this.modalService=Xe}static#t=this.\u0275fac=function(i){return new(i||s)(t.KVO(u.En),t.KVO(C),t.KVO(f.il),t.KVO(l.FS),t.KVO(l.wA),t.KVO(l.mO))};static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})();var K=n(76613);let Ae=(()=>{class s extends Y{constructor(){super(...arguments),this.getSeller=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(pt),(0,T.M)(()=>this.loaderService.show()),(0,A.n)(e=>this.sellerService.getSeller(e.payload.id).pipe((0,H.T)(i=>new Dt(i)),(0,W.W)(i=>(0,X.of)(new K.Rn(i))))))),this.getSellerSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(at),(0,T.M)(()=>{this.loaderService.hide()})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})();var ke=n(57421);let Oe=(()=>{class s extends Y{constructor(){super(...arguments),this.getSellers=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(P),(0,T.M)(()=>this.loaderService.show()),(0,ke.E)(this.store),(0,A.n)(([e,i])=>this.sellerService.getSellers(e.payload.page,i.aegisxSellers.filter).pipe((0,H.T)(a=>new k({sellers:a})),(0,W.W)(a=>(0,X.of)(new K.Rn(a))))))),this.getSellersSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(x),(0,T.M)(()=>{this.loaderService.hide()})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})(),Be=(()=>{class s extends Y{constructor(){super(...arguments),this.createSeller=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(D),(0,T.M)(()=>this.loaderService.show()),(0,A.n)(e=>this.sellerService.createSeller(e.payload.item).pipe((0,H.T)(i=>new it(i)),(0,W.W)(i=>(0,X.of)(new K.Rn(i))))))),this.createSellerSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(w),(0,T.M)(e=>{this.toastService.makeToast(e.payload.message,l.Ck.Success)}),(0,A.n)(()=>[new G({page:1})])))}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})(),Ie=(()=>{class s extends Y{constructor(){super(...arguments),this.patchSeller=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(ut),(0,T.M)(()=>this.loaderService.show()),(0,A.n)(e=>this.sellerService.patchSeller(e.payload.seller_id,e.payload.body).pipe((0,H.T)(i=>new Gt(i)),(0,W.W)(i=>(0,X.of)(new K.Rn(i))))))),this.patchSellerSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(lt),(0,T.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,l.Ck.Success)})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})(),Ne=(()=>{class s extends Y{constructor(){super(...arguments),this.patchSellerAddress=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(mt),(0,T.M)(()=>this.loaderService.show()),(0,A.n)(e=>this.sellerService.patchSellerAddress(e.payload.seller_id,e.payload.body).pipe((0,H.T)(i=>new jt(i)),(0,W.W)(i=>(0,X.of)(new K.Rn(i))))))),this.patchSellerAddressSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(ct),(0,T.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,l.Ck.Success)})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})(),$e=(()=>{class s extends Y{constructor(){super(...arguments),this.deleteSellers=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(Z),(0,T.M)(()=>this.loaderService.show()),(0,A.n)(e=>this.sellerService.deleteSellers(e.payload.items).pipe((0,H.T)(i=>new v(i)),(0,W.W)(i=>(0,X.of)(new K.Rn(i))))))),this.deleteSellersSuccess=(0,u.EH)(()=>this.actions.pipe((0,u.gp)(m),(0,T.M)(e=>{this.toastService.makeToast(e.payload.message,l.Ck.Success)}),(0,A.n)(()=>[new G({page:1})])))}static#t=this.\u0275fac=(()=>{let e;return function(a){return(e||(e=t.xGo(s)))(a||s)}})();static#e=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac})}return s})(),Ve=(()=>{class s{static#t=this.\u0275fac=function(i){return new(i||s)};static#e=this.\u0275mod=t.$C({type:s});static#s=this.\u0275inj=t.G2t({providers:[C],imports:[r.MD,De,Ge.G,we.m,Me.G,je.c,d.X1,S.iI,Pe.g,f.md.forFeature
1(Q,Mt),u.Vm.forFeature([Be,Ae,Oe,$e,Ie,Ne]),l.pj,l.LU,l.B4,l.SD,l.Zg,l.xT,l.oP,l.Tm,l.F8,l.hv]})}return s})()},52570:(B,b,n)=>{n.d(b,{s:()=>S});var r=n(54438);let S=(()=>{class f{static#t=this.LET={ZERO:1,EMPTY_STR:2,FALSE:4,NAN:8};transform(d,l=0){return l&f.LET.ZERO&&0===d||l&f.LET.EMPTY_STR&&""===d||l&f.LET.FALSE&&!1===d||l&f.LET.NAN&&isNaN(d)?d:d||"-"}static#e=this.\u0275fac=function(l){return new(l||f)};static#s=this.\u0275pipe=r.EJ8({name:"notSet",type:f,pure:!0})}return f})()},48390:(B,b,n)=>{n.d(b,{h:()=>M});var r=n(54438),S=n(7605),f=n(45286),u=n(63040),d=n(63649),l=n(4379),g=n(26588),t=n(32350);const C=["showMoreBtnWrapper"];function R(h,L){if(1&h){const o=r.RV6();r.j41(0,"button",11),r.bIt("click",function(){r.eBV(o);const _=r.XpG(2);return r.Njj(_.appendPage())}),r.EFF(1,"Na\u010d\xedst dal\u0161\xed "),r.k0s()}if(2&h){const o=r.XpG(2);r.Y8G("disabled",o.isLastPage())}}function j(h,L){1&h&&r.nrm(0,"mcrai-loader",4)}function y(h,L){if(1&h){const o=r.RV6();r.j41(0,"button",12),r.bIt("click",function(){r.eBV(o);const _=r.XpG(2);return r.Njj(_.goToPage(1))}),r.j41(1,"mcrai-icon",8),r.EFF(2,"double_arrow_left"),r.k0s()()}if(2&h){const o=r.XpG(2);r.Y8G("disabled",o.isFirstPage())}}function P(h,L){if(1&h){const o=r.RV6();r.j41(0,"button",13),r.bIt("click",function(){const _=r.eBV(o).$implicit,F=r.XpG(2);return r.Njj(F.goToPage(_))}),r.EFF(1),r.k0s()}if(2&h){const o=L.$implicit,p=r.XpG(2);r.AVh("mcrai-paginator__button--active",p.isActualPage(o)),r.R7$(),r.SpI(" ",o," ")}}function x(h,L){if(1&h){const o=r.RV6();r.j41(0,"button",12),r.bIt("click",function(){r.eBV(o);const _=r.XpG(2);return r.Njj(_.goToPage(_.lastPage))}),r.j41(1,"mcrai-icon",8),r.EFF(2,"double_arrow_right"),r.k0s()()}if(2&h){const o=r.XpG(2);r.Y8G("disabled",o.isLastPage())}}function G(h,L){if(1&h){const o=r.RV6();r.j41(0,"div",1),r.EFF(1),r.k0s(),r.j41(2,"div",2,0),r.DNE(4,R,2,1,"button",3)(5,j,1,0,"mcrai-loader",4),r.k0s(),r.j41(6,"div",5),r.DNE(7,y,3,1,"button",6),r.j41(8,"button",7),r.bIt("click",function(){r.eBV(o);const _=r.XpG();return r.Njj(_.prevPage())}),r.j41(9,"mcrai-icon",8),r.EFF(10,"arrow_left"),r.k0s()(),r.Z7z(11,P,2,3,"button",9,r.fX1),r.j41(13,"button",10),r.bIt("click",function(){r.eBV(o);const _=r.XpG();return r.Njj(_.nextPage())}),r.j41(14,"mcrai-icon",8),r.EFF(15,"arrow_right"),r.k0s()(),r.DNE(16,x,3,1,"button",6),r.k0s()}if(2&h){const o=r.XpG();r.R7$(),r.E5c(" ",o.getRange()," ",o.getPreposition()," ",o.getCount()," "),r.R7$(3),r.vxM(4,!o.showMoreBtn||o.loading||o.isLastPage()?-1:4),r.R7$(),r.vxM(5,o.loading?5:-1),r.R7$(2),r.vxM(7,o.doubleArrow?7:-1),r.R7$(),r.Y8G("disabled",o.isFirstPage()),r.R7$(3),r.Dyx(o.arrayOfPageLinks),r.R7$(2),r.Y8G("disabled",o.isLastPage()),r.R7$(3),r.vxM(16,o.doubleArrow?16:-1)}}function k(h,L){if(1&h&&(r.j41(0,"div",1),r.EFF(1),r.k0s()),2&h){const o=r.XpG();r.R7$(),r.SpI(" ",o.getCount()," ")}}let M=(()=>{class h{constructor(o,p,_,F){this.activatedRoute=o,this.router=p,this.renderer=_,this.elRef=F,this.destroy=new f.B7,this.PAGINATOR_CLASS="mcrai-paginator",this.skipNextUrlLoad=!1,this.appendInitPage=0,this.showCount=!1,this.pageLinksCount=0,this.doubleArrow=!1,this.showMoreBtn=!1,this.readUrl=!1,this.writeUrl=!1,this.scrollUp=!0,this.loading=!1,this.prev=new r.bkB,this.next=new r.bkB,this.append=new r.bkB,this.page=new r.bkB,this.getScreenWidth()}ngOnInit(){this.renderer.addClass(this.elRef.nativeElement,this.PAGINATOR_CLASS),this.lastUrl=this.getCurrentUrl(),this.readUrl&&this.activatedRoute.queryParams.pipe((0,S.Q)(this.destroy)).subscribe(o=>{if(this.skipNextUrlLoad)this.skipNextUrlLoad=!1;else{const p=o.page?+o.page:1;p>0&&p<=this.paginator.page_count&&p!==this.paginator.page&&this.getCurrentUrl()===this.lastUrl&&this.goToPage(p)}}),this.createObserver()}ngOnDestroy(){this.destroy.next(),this.destroy.complete(),this.unobserveTarget()}ngOnChanges(o){if(o.hasOwnProperty("paginator")){if(!o.paginator.firstChange){const p=this.getCurrentUrl();p!==this.lastUrl&&(this.lastUrl=p)}this.showPaginator()&&this.showMoreBtn&&!this.isLastPage()?setTimeout(()=>this.observeTarget(),0):this.unobserveTarget()}}getScreenWidth(){this.screenWidth=window.innerWidth}getCurrentUrl(){return this.router.url.split("?")[0]}showPaginator(){return this.paginator&&this.paginator.page_count>1}showCountOnPage(){return this.showCount&&this.paginator&&1===this.paginator.page_count&&this.paginator.count>0}getRange(){const o=this.paginator.count>0?1:0,p=this.paginator.ipp*(this.getPage()-1)+o;let _=this.paginator.ipp*this.paginator.page;return _>this.paginator.count&&(_=this.paginator.count),p+" - "+_}appendPage(){this.appendInitPage=this.getPage();const o=this.paginator.page+1;this.skipNextUrlLoad=!0,this.append.emit(o),this.upsertQueryParams(o)}nextPage(){const o=this.paginator.page+1;this.scrollUp&&window.scrollTo(0,0),this.skipNextUrlLoad=!0,this.appendInitPage=0,this.next.emit(o),this.page.emit(o),this.upsertQueryParams(o)}prevPage(){const o=this.paginator.page-1;this.scrollUp&&window.scrollTo(0,0),this.skipNextUrlLoad=!0,this.appendInitPage=0,this.prev.emit(o),this.page.emit(o),this.upsertQueryParams(o)}goToPage(o){this.scrollUp&&window.scrollTo(0,0),this.skipNextUrlLoad=!0,this.appendInitPage=0,this.page.emit(o),this.upsertQueryParams(o)}upsertQueryParams(o){if(this.writeUrl){const p=Object.assign({},this.activatedRoute.snapshot.queryParams);o>1?p.page=o:delete p.page,this.router.navigate([],{queryParams:p,relativeTo:this.activatedRoute})}}isFirstPage(){return 1===this.paginator.page}isLastPage(){return this.paginator.page===this.paginator.page_count}isActualPage(o){return this.paginator.page===o}getCount(){return this.paginator.count.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}get lastPage(){return this.paginator.page_count}get pageLinksCountRecalc(){let o;return o=this.screenWidth<768&&this.pageLinksCount>5?5:this.pageLinksCount,o>this.paginator.page_count?this.paginator.page_count:o}get arrayOfPageLinks(){const o=this.paginator.page,p=Math.round(this.pageLinksCountRecalc/2);switch(!0){case o>p&&o<=this.paginator.page_count-p:return this.makeArrayOfPageLinks(o-p);case o>this.paginator.page_count-p:return this.makeArrayOfPageLinks(this.paginator.page_count-this.pageLinksCountRecalc);default:return this.makeArrayOfPageLinks()}}makeArrayOfPageLinks(o=0){return Array.from(Array(this.pageLinksCountRecalc).keys()).map(p=>p+o+1)}getPreposition(){return[2,3,4,17].indexOf(this.paginator.count)>=0||"7"===this.getCount()[0]?"ze":"z"}getPage(){return 0===this.appendInitPage?this.paginator.page:this.appendInitPage}createObserver(){this.showMoreBtnObserver||(this.showMoreBtnObserver=new IntersectionObserver(o=>{o[0].isIntersecting&&!this.loading&&!this.isLastPage()&&this.appendPage()}))}observeTarget(){this.showMoreBtnWrapper&&this.showMoreBtnObserver&&this.showMoreBtnObserver.observe(this.showMoreBtnWrapper.nativeElement)}unobserveTarget(){this.showMoreBtnWrapper&&this.showMoreBtnObserver&&this.showMoreBtnObserver.unobserve(this.showMoreBtnWrapper.nativeElement)}static#t=this.\u0275fac=function(p){return new(p||h)(r.rXU(u.nX),r.rXU(u.Ix),r.rXU(r.sFG),r.rXU(r.aKT))};static#e=this.\u0275cmp=r.VBU({type:h,selectors:[["mcrai-paginator"]],viewQuery:function(p,_){if(1&p&&r.GBs(C,5,r.aKT),2&p){let F;r.mGM(F=r.lsd())&&(_.showMoreBtnWrapper=F.first)}},hostBindings:function(p,_){1&p&&r.bIt("resize",function(){return _.getScreenWidth()},!1,r.tSv)},inputs:{paginator:"paginator",showCount:"showCount",pageLinksCount:"pageLinksCount",doubleArrow:"doubleArrow",showMoreBtn:"showMoreBtn",readUrl:"readUrl",writeUrl:"writeUrl",scrollUp:"scrollUp",loading:"loading"},outputs:{prev:"prev",next:"next",append:"append",page:"page"},features:[r.OA$],decls:2,vars:2,consts:[["showMoreBtnWrapper",""],[1,"mcrai-paginator__range"],[1,"mcrai-paginator__show-more"],["mcrai-button","positive",1,"mcrai-paginator__button","mcrai-paginator__append-button",3,"disabled"],[1,"mcrai-paginator__loader"],[1,"mcrai-paginator__buttons"],["mcrai-icon-button","transparent",1,"mcrai-paginator__button","mcrai-paginator__button--double-arrow",3,"disabled"],["mcrai-icon-button","transparent",1,"mcrai-paginator__button","mcrai-paginator__button--arrow",3,"click","disabled"],["color","secondary"],["color","transparent","mcrai-button","transparent",1,"mcrai-paginator__button","mcrai-paginator__button--number",3,"mcrai-paginator__button--active"],["mcrai-icon-button","transparent",1,"mcrai-paginator__button",3,"click","disabled"],["mcrai-button","positive",1,"mcrai-paginator__button","mcrai-paginator__append-button",3,"click","disabled"],["mcrai-icon-button","transparent",1,"mcrai-paginator__button","mcrai-paginator__button--double-arrow",3,"click","disabled"],["color","transparent","mcrai-button","transparent",1,"mcrai-paginator__button","mcrai-paginator__button--number",3,"click"]],template:function(p,_){1&p&&r.DNE(0,G,17,9)(1,k,2,1,"div",1),2&p&&(r.vxM(0,_.showPaginator()?0:-1),r.R7$(),r.vxM(1,_.showCountOnPage()?1:-1))},dependencies:[d.Q,l.x,g.R,t.V],styles:[".mcrai-paginator{display:flex;align-items:center;margin:8px 0}.mcrai-paginator__range{display:flex;justify-content:flex-end;align-items:center;white-space:nowrap;font-size:14px}.mcrai-paginator__show-more{margin-left:auto}.mcrai-paginator__buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:stretch;margin-left:auto}.mcrai-paginator__loader{min-width:70px}.mcrai-paginator__button--active{background-color:#0000001a!important}.admin .mcrai-paginator__button{padding:0 10px}:host .mcrai-paginator__button{min-width:0}:host .mcrai-icon-button--disabled{display:none}\n"],encapsulation:2,changeDetection:0})}return h})()}}]);
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.