File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/3767.3f6aa29728e23c82.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[3767],{39451:(B,x,a)=>{a.d(x,{$:()=>s});var i=a(2978),b=a(7125),g=a(54171),y=a(56610),v=a(77897);function e(c,d){if(1&c&&i.nrm(0,"img",6),2&c){const r=i.XpG().$implicit,o=i.XpG();i.FCK("src","",o.cityProvider._urlGallery,"banners/",r.image,"",i.B4B)}}function E(c,d){if(1&c&&(i.j41(0,"ion-item",7)(1,"ion-label",8),i.EFF(2),i.k0s()()),2&c){const r=i.XpG().$implicit;i.R7$(2),i.JRh(r.name)}}function u(c,d){if(1&c){const r=i.RV6();i.j41(0,"ion-slide")(1,"ion-card",3),i.bIt("click",function(){const h=i.eBV(r).$implicit,P=i.XpG();return i.Njj(P.actionClickBanner(h))}),i.DNE(2,e,1,2,"img",4),i.DNE(3,E,3,1,"ion-item",5),i.k0s()()}if(2&c){const r=d.$implicit;i.R7$(2),i.Y8G("ngIf",r.image),i.R7$(1),i.Y8G("ngIf",r.hide_name&&!r.image)}}let s=(()=>{class c{constructor(r,o){this.cityProvider=r,this.utilsService=o,this.slideOpts={initialSlide:0,speed:400,autoplay:{delay:5e3}}}ngOnInit(){}actionClickBanner(r){this.utilsService.actionClickBanner(r)}static#e=this.\u0275fac=function(o){return new(o||c)(i.rXU(b.h),i.rXU(g.T))};static#t=this.\u0275cmp=i.VBU({type:c,selectors:[["app-banner-slide"]],inputs:{banners:"banners"},decls:3,vars:2,consts:[[2,"max-width","640px",3,"options"],["Slides",""],[4,"ngFor","ngForOf"],[1,"h-214","card_container",3,"click"],["class","image",3,"src",4,"ngIf"],["class","text","lines","none",4,"ngIf"],[1,"image",3,"src"],["lines","none",1,"text"],["color","medium","slot","start",1,"text"]],template:function(o,_){1&o&&(i.j41(0,"ion-slides",0,1),i.DNE(2,u,4,2,"ion-slide",2),i.k0s()),2&o&&(i.Y8G("options",_.slideOpts),i.R7$(2),i.Y8G("ngForOf",_.banners))},dependencies:[y.Sq,y.bT,v.b_,v.uz,v.he,v.q3,v.tR],styles:["ion-slide[_ngcontent-%COMP%]{display:block;width:-moz-fit-content!important;width:fit-content!important;min-width:100%!important;padding:0 10px}.h-214[_ngcontent-%COMP%]{width:100%}.card_container[_ngcontent-%COMP%]{display:flex;flex-flow:column;align-items:center;justify-content:center;margin:0 5px 10px 0}.image[_ngcontent-%COMP%]{height:auto;width:100%}.text[_ngcontent-%COMP%]{overflow:initial;height:32px}"]})}return c})()},93767:(B,x,a)=>{a.r(x),a.d(x,{BusinessDirectoryPageModule:()=>U});var i=a(56610),b=a(37222),g=a(77897),y=a(36075),v=a(73308),e=a(2978),E=a(73012),u=a(29885),s=a(54171),c=a(1519),d=a(7125),r=a(22882),o=a(39451);function _(n,m){if(1&n){const t=e.RV6();e.j41(0,"ion-buttons",13),e.bIt("click",function(){e.eBV(t);const p=e.XpG();return e.Njj(p.openCategory(0,!0))}),e.nrm(1,"ion-icon",14),e.k0s()}}function h(n,m){if(1&n&&e.nrm(0,"app-banner-slide",15),2&n){const t=e.XpG();e.Y8G("banners",t.banners)}}function P(n,m){if(1&n&&e.nrm(0,"ion-img",23),2&n){const t=e.XpG(2).$implicit;e.FS9("src",t.image)}}function I(n,m){if(1&n&&e.nrm(0,"ion-img",23),2&n){const t=e.XpG(2).$implicit,l=e.XpG(2);e.FCK("src","",l.cityProvider._urlGallery,"business/categories/",t.image,"")}}function S(n,m){if(1&n&&(e.j41(0,"h3",7),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2).$implicit;e.R7$(1),e.JRh(t.name)}}function D(n,m){if(1&n){const t=e.RV6();e.j41(0,"div",20),e.bIt("click",function(){e.eBV(t);const p=e.XpG().$implicit,f=e.XpG(2);return e.Njj(f.openAlertCategory(p))}),e.DNE(1,P,1,1,"ion-img",21),e.DNE(2,I,1,2,"ion-img",21),e.DNE(3,S,2,1,"h3",22),e.k0s()}if(2&n){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("ngIf",t.image&&t.image.includes("http")),e.R7$(1),e.Y8G("ngIf",t.image&&!t.image.includes("http")),e.R7$(1),e.Y8G("ngIf",!t.image)}}function O(n,m){if(1&n&&e.nrm(0,"ion-img",23),2&n){const t=e.XpG(2).$implicit;e.FS9("src",t.image)}}function C(n,m){if(1&n&&e.nrm(0,"ion-img",23),2&n){const t=e.XpG(2).$implicit,l=e.XpG(2);e.FCK("src","",l.cityProvider._urlGallery,"business/categories/",t.image,"")}}function R(n,m){if(1&n&&(e.j41(0,"h3",7),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2).$implicit;e.R7$(1),e.JRh(t.name)}}function G(n,m){if(1&n){const t=e.RV6();e.j41(0,"div",24),e.bIt("click",function(){e.eBV(t);const p=e.XpG().$implicit,f=e.XpG(2);return e.Njj(f.openCategory(p,!1))}),e.DNE(1,O,1,1,"ion-img",21),e.DNE(2,C,1,2,"ion-img",21),e.DNE(3,R,2,1,"h3",22),e.k0s()}if(2&n){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("ngIf",t.image&&t.image.includes("http")),e.R7$(1),e.Y8G("ngIf",t.image&&!t.image.includes("http")),e.R7$(1),e.Y8G("ngIf",!t.image)}}function M(n,m){if(1&n&&(e.j41(0,"ion-col",17),e.DNE(1,D,4,3,"div",18),e.DNE(2,G,4,3,"div",19),e.k0s()),2&n){const t=m.$implicit;e.R7$(1),e.Y8G("ngIf",!t.businesses),e.R7$(1),e.Y8G("ngIf",t.businesses)}}function k(n,m){if(1&n&&(e.j41(0,"div")(1,"ion-grid")(2,"ion-row"),e.DNE(3,M,3,2,"ion-col",16),e.k0s()()()),2&n){const t=e.XpG();e.R7$(3),e.Y8G("ngForOf",t.businessService.categories)}}const A=[{path:"",component:(()=>{class n{constructor(t,l,p,f,T,F,X,w){this.router=t,this.businessService=l,this.userService=p,this.utilsService=f,this.commsService=T,this.cityProvider=F,this.alertController=X,this.translateService=w,this.offset=0,this.take=10,this.params={},this.banners=[]}ngOnInit(){var t=this;return(0,v.A)(function*(){t.loadInit(100)})()}loadInit(t=0){setTimeout(()=>new Promise((l,p)=>{this.utilsService.presentLoading(this.translateService.instant("all.loading")).then(()=>{Promise.all([this.commsService.getPopups("business-directory"),this.commsService.getBanners("business-directory").then(f=>{this.banners=f}),this.businessService.getCategories(!1),this.userService.getInfoUser().then(f=>{this.params.user=f.id,this.params.offset=this.offset,this.params.take=this.take,this.businessService.getBusinesses(this.params)})]).then(()=>{this.utilsService.dismissLoading(),l(!1)}).catch(f=>{this.utilsService.dismissLoading(),console.log("Error loadInit BusinessDirectoryPage",f),p(f)})})}),t)}doRefresh(t){setTimeout(()=>{this.loadInit(0),t.target.complete()},500)}openAlertCategory(t){var l=this;return(0,v.A)(function*(){yield(yield l.alertController.create({header:l.translateService.instant("TITLE_VALIDATE_INVITED"),message:l.translateService.instant("CATEGORIES_WITHOUT_REGISTERED_BUSINESSES",{category:t.name}),buttons:[{text:l.translateService.instant("CANCEL"),handler:()=>{}},{text:l.translateService.instant("ACCEPT"),handler:()=>{l.router.navigate(["/business-register/0/"+t.id])}}]})).present()})()}openCategory(t,l){this.router.navigate(["/business-directory-list/"+t.id+"/"+l+"/"+t.name])}register(){this.userService.validateAlertsUseApp("document")&&this.router.navigate(["/business-register/0/null"])}static#e=this.\u0275fac=function(l){return new(l||n)(e.rXU(y.Ix),e.rXU(E.u),e.rXU(u.D),e.rXU(s.T),e.rXU(c.p),e.rXU(d.h),e.rXU(g.hG),e.rXU(r.c$))};static#t=this.\u0275cmp=e.VBU({type:n,selectors:[["app-business-directory"]],decls:25,vars:15,consts:[[1,"ion-no-border"],["slot","start"],[1,"ion-text-center"],["slot","end",3,"click",4,"ngIf"],["slot","fixed",3,"ionRefresh"],["pullingIcon","arrow-down-outline","refreshingSpinner","ios"],[3,"banners",4,"ngIf"],[1,"cardTextOptions"],[4,"ngIf"],[1,"footerContainer"],[1,"footerText"],["slot","end",1,"ion-text-center"],["size","default",3,"click"],["slot","end",3,"click"],["slot","icon-only","name","storefront-outline"],[3,"banners"],["size","6",4,"ngFor","ngForOf"],["size","6"],["class","cardOptionsDisabled",3,"click",4,"ngIf"],["class","cardOptions",3,"click",4,"ngIf"],[1,"cardOptionsDisabled",3,"click"],[3,"src",4,"ngIf"],["class","cardTextOptions",4,"ngIf"],[3,"src"],[1,"cardOptions",3,"click"]],template:function(l,p){1&l&&(e.j41(0,"ion-header",0)(1,"ion-toolbar"),e.nrm(2,"ion-back-button",1),e.j41(3,"ion-title",2),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.DNE(6,_,2,0,"ion-buttons",3),e.k0s()(),e.j41(7,"ion-content")(8,"ion-refresher",4),e.bIt("ionRefresh",function(T){return p.doRefresh(T)}),e.nrm(9,"ion-refresher-content",5),e.k0s(),e.DNE(10,h,1,1,"app-banner-slide",6),e.j41(11,"h3",7),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.DNE(14,k,4,1,"div",8),e.k0s(),e.j41(15,"ion-footer")(16,"ion-item",9)(17,"ion-label")(18,"p",10),e.EFF(19),e.nI1(20,"translate"),e.k0s()(),e.j41(21,"ion-label",11)(22,"ion-button",12),e.bIt("click",function(){return p.register()}),e.EFF(23),e.nI1(24,"translate"),e.k0s()()()()),2&l&&(e.R7$(4),e.JRh(e.bMT(5,7,"TITLE_HOME_SUB_BUTTON1")),e.R7$(2),e.Y8G("ngIf",p.businessService.userHaveBusiness),e.R7$(4),e.Y8G("ngIf",p.banners&&p.banners.length),e.R7$(2),e.JRh(e.bMT(13,9,"TITLE_BUSINESS_CATEGORY")),e.R7$(2),e.Y8G("ngIf",p.businessService.categories&&p.businessService.categories.length),e.R7$(5),e.SpI("",e.bMT(20,11,"REGISTER_BUSINESS_DETAIL"),":"),e.R7$(4),e.JRh(e.bMT(24,13,"REGISTER_BUSINESS_BUTTON")))},dependencies:[i.Sq,i.bT,g.el,g.Jm,g.QW,g.hU,g.W9,g.M0,g.lO,g.eU,g.iq,g.KW,g.uz,g.he,g.To,g.Ki,g.ln,g.BC,g.ai,g.tY,o.$,r.D9],styles:["ion-toolbar[_ngcontent-%COMP%]{padding-right:8px;margin-bottom:10px}.textDetail[_ngcontent-%COMP%]{font-size:1.2em;line-height:18px;font-weight:700;margin:0 10px}.sectionOptions[_ngcontent-%COMP%]{display:flex;flex-flow:column;width:-webkit-fill-available;margin:auto;max-width:650px}.carouselOptions[_ngcontent-%COMP%]{display:flex;flex-flow:wrap;justify-content:flex-start}.cardMainOptions[_ngcontent-%COMP%]{color:#fff;margin:5px;max-width:650px;width:calc(48% - 4px);height:150px}.cardOptionsDisabled[_ngcontent-%COMP%]{background:linear-gradient(135deg,grey 50%,black 150%);color:#fff;display:flex;flex-flow:column;box-shadow:1px 1px 1px 2px #d3d3d3;border-radius:10px;align-items:center;justify-content:center;width:-webkit-fill-available;min-height:120px;opacity:.5}.cardOptions[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--ion-color-primary) 50%,black 150%);color:#fff;display:flex;flex-flow:column;box-shadow:1px 1px 1px 2px #d3d3d3;border-radius:10px;align-items:center;justify-content:center;width:-webkit-fill-available;min-height:120px}.cardTextOptions[_ngcontent-%COMP%]{font-size:1.2em;margin-bottom:0;text-transform:uppercase;line-height:18px;font-weight:700;text-align:center}.carfTextAlert[_ngcontent-%COMP%]{text-transform:uppercase}.cardSubMainOptions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font-size:3em}.footerContainer[_ngcontent-%COMP%]{border-top:1px solid lightgrey}.footerText[_ngcontent-%COMP%]{white-space:normal}ion-img[_ngcontent-%COMP%]::part(image){border-radius:10px}"]})}return n})()}];let $=(()=>{class n{static#e=this.\u0275fac=function(l){return new(l||n)};static#t=this.\u0275mod=e.$C({type:n});static#i=this.\u0275inj=e.G2t({imports:[y.iI.forChild(A),y.iI]})}return n})();var j=a(55553);let U=(()=>{class n{static#e=this.\u0275fac=function(l){return new(l||n)};static#t=this.\u0275mod=e.$C({type:n});static#i=this.\u0275inj=e.G2t({imports:[i.MD,b.YN,g.bv,$,r.h.forChild(),j.h]})}return n})()},73012:(B,x,a)=>{a.d(x,{u:()=>v});var i=a(73308),b=a(2978),g=a(3366),y=a(54171);let v=(()=>{class e{constructor(u,s){this.api=u,this.utilsService=s,this.categories=[],this.businesses=[],this.centerFirstMarker=!1,this.userHaveBusiness=!1,this.loadingBusiness=!0}getCategories(u){var s=this;return(0,i.A)(function*(){return s.categories=[],new Promise(function(){var c=(0,i.A)(function*(d,r){(yield s.api.get("business/getCategories/"+u,yield s.utilsService.getAccessToken())).subscribe(_=>{s.categories=_,d(_)},_=>{console.error("Error getCategories",_),r(_)})});return function(d,r){return c.apply(this,arguments)}}())})()}registerBusiness(u){var s=this;return(0,i.A)(function*(){let c=yield s.utilsService.getAccessToken();return new Promise(function(){var d=(0,i.A)(function*(r,o){(yield s.api.post("business/register",u,c)).subscribe(_=>{r(_)},_=>{console.error("Error registerBusiness",_),o(_)})});return function(r,o){return d.apply(this,arguments)}}())})()}getBusinesses(u){var s=this;return(0,i.A)(function*(){s.params=u;let c=yield s.utilsService.getAccessToken();return u.reset&&(s.businesses=[]),new Promise(function(){var d=(0,i.A)(function*(r,o){(yield s.api.get("business/getBusinesses",c,u)).subscribe(h=>{s.loadingBusiness=!1,u.reset?s.businesses=h:s.businesses.push(...h),u.user&&h.length&&(s.userHaveBusiness=!0),s.centerFirstMarker=!(!u.search&&1!=h.length),r(s.businesses)},h=>{console.error("Error getBusinesses",h),o(h)})});return function(r,o){return d.apply(this,arguments)}}())})()}deleteBusiness(u){var s=this;return(0,i.A)(function*(){let c=yield s.utilsService.getAccessToken();return new Promise(function(){var d=(0,i.A)(function*(r,o){(yield s.api.delete("business/delete/"+u,c)).subscribe(_=>{r(_)},_=>{console.error("Error registerBusiness",_),o(_)})});return function(r,o){return d.apply(this,arguments)}}())})()}getParameters(){var u=this;return(0,i.A)(function*(){return new Promise(function(){var s=(0,i.A)(function*(c,d){(yield u.api.get("business/getParameters",yield u.utilsService.getAccessToken())).subscribe(o=>{c(o)},o=>{console.error("Error getParemeters",o),d(o)})});return function(c,d){return s.apply(this,arguments)}}())})()}getScoringOptions(){var u=this;return(0,i.A)(function*(){return new Promise(function(){var s=(0,i.A)(function*(c,d){(yield u.api.get("business/getScoringOptions",yield u.utilsService.getAccessToken())).subscribe(o=>{c(o)},o=>{console.error("Error getParemeters",o),d(o)})});return function(c,d){return s.apply(this,arguments)}}())})()}registerScoring(u){var s=this;return(0,i.A)(function*(){let c=yield s.utilsService.getAccessToken();return new Promise(function(){var d=(0,i.A)(function*(r,o){(yield s.api.post("business/scoreRegistry",u,c)).subscribe(_=>{r(_)},_=>{console.error("Error registerScoring",_),o(_)})});return function(r,o){return d.apply(this,arguments)}}())})()}static#e=this.\u0275fac=function(s){return new(s||e)(b.KVO(g.G),b.KVO(y.T))};static#t=this.\u0275prov=b.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})()}}]);