(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-054d37da"],{"2e08":function(e,t,n){var a=n("9def"),s=n("9744"),o=n("be13");e.exports=function(e,t,n,r){var i=String(o(e)),c=i.length,l=void 0===n?" ":String(n),u=a(t);if(u<=c||""==l)return i;var g=u-c,m=s.call(l,Math.ceil(g/l.length));return m.length>g&&(m=m.slice(0,g)),r?m+i:i+m}},"3c87":function(e,t,n){"use strict";n("891b")},6340:function(e,t,n){"use strict";n.r(t);n("b54a"),n("7f7f");var a=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"gtm-link-generator"}},[t("div",[t("h1",[e._v("Upcoming Events GTM Link Generator")]),t("div",{staticClass:"c-form-group"},[t("label",{attrs:{for:""}},[e._v("Leagues")]),t("multiselect",{attrs:{loading:0===e.leagues.length,options:e.leagues.map((function(e){var t=e.league,n=t.name,a=t.id,s=t.logo;return{label:n,id:a,logo:s}})),label:"label",multiple:!0,"track-by":"id"},on:{select:e.onLeagueSelected},scopedSlots:e._u([{key:"option",fn:function(n){return[t("img",{staticClass:"mr-3",attrs:{width:"30",src:n.option.logo,alt:"a-cho-yetz"}}),e._v("\n "+e._s(n.option.label)+"\n ")]}}]),model:{value:e.selectedLeagues,callback:function(t){e.selectedLeagues=t},expression:"selectedLeagues"}})],1),t("div",{staticClass:"c-form-group"},[t("label",[e._v("Teams")]),e.teams.length?t("multiselect",{attrs:{options:e.teams.map((function(e){var t=e.team;return{label:t.name,id:t.id,logo:t.logo}})),label:"label",multiple:!0,"track-by":"id"},scopedSlots:e._u([{key:"option",fn:function(n){return[t("img",{staticClass:"mr-3",attrs:{width:"30",src:n.option.logo,alt:"a-cho-yetz"}}),e._v("\n "+e._s(n.option.label)+"\n ")]}}],null,!1,2911191978),model:{value:e.selectedTeams,callback:function(t){e.selectedTeams=t},expression:"selectedTeams"}}):t("div",{staticClass:"text-white"},[e._v("Please select a league.")])],1),t("div",{staticClass:"c-form-group"},[t("label",[e._v("From")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.from,expression:"from"}],attrs:{type:"date"},domProps:{value:e.from},on:{input:function(t){t.target.composing||(e.from=t.target.value)}}})]),t("div",{staticClass:"c-form-group"},[t("label",[e._v("To")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.to,expression:"to"}],attrs:{type:"date"},domProps:{value:e.to},on:{input:function(t){t.target.composing||(e.to=t.target.value)}}})]),t("div",{staticClass:"c-form-group"},[t("label",[e._v("Season")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.season,expression:"season"}],attrs:{type:"text"},domProps:{value:e.season},on:{input:function(t){t.target.composing||(e.season=t.target.value)}}})]),t("button",{staticClass:"my-4 btn",on:{click:function(t){e.showLink=!0}}},[e._v("Generate Link")]),e.showLink?t("div",{staticClass:"generated-link text-white"},[e._v("\n "+e._s(e.link)+"\n ")]):e._e()])])},s=[],o=(n("6b54"),n("ac6a"),n("96cf"),n("3b8d")),r=(n("f576"),n("8e5f")),i=n.n(r),c=(n("e607"),{name:"UpcomingEventsGTMLinkGenerator",data:function(){return{isLoading:!0,leagues:[],teams:[],from:this.getToday(),to:this.getToday(),season:(new Date).getFullYear(),selectedLeagues:[],selectedTeams:[],showLink:!1,SPORT_API_BASE:"https://sport.convertologic.com"}},methods:{getToday:function(){var e=new Date,t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=e.getFullYear();return e=a+"-"+n+"-"+t,e},onLeagueSelected:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var n,a,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,n=t.id,e.next=4,fetch(this.SPORT_API_BASE+"/soccer/teams?league=".concat(n,"&season=").concat(this.season));case 4:return a=e.sent,e.next=7,a.json();case 7:a=e.sent,a.data.teams.forEach((function(e){return s.teams.push(e)})),e.next=15;break;case 11:e.prev=11,e.t0=e["catch"](0),console.log(e.t0),alert("Something went wrong. Please try again.");case 15:case"end":return e.stop()}}),e,this,[[0,11]])})));function t(t){return e.apply(this,arguments)}return t}()},computed:{link:function(){var e;return e=this.SPORT_API_BASE,e+="/soccer/fixtures/gtm/",e+="?"+new URLSearchParams({season:this.season,leagues:this.selectedLeagues.map((function(e){var t=e.id;return t})),teams:this.selectedTeams.map((function(e){var t=e.id;return t})),from:this.from,to:this.to}).toString().replaceAll("%2C",","),e="