{"version":3,"sources":["webpack:///./src/components/admin/TeamsListPage.vue?e56e","webpack:///./src/components/admin/TeamsListPage.vue","webpack:///./src/components/admin/TeamsListPage.vue?cca8","webpack:///./src/components/admin/TeamsListPage.vue?d163"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","fetch","model","value","callback","$$v","searchField","expression","teams","staticClass","_v","_s","displayedTeams","length","filter","x","isActive","guildRealm","Math","round","_e","pageCount","page","headers","isLoading","on","$event","scopedSlots","_u","key","fn","ref","item","guildSide","imageLinks","iconFaction","teamUrl","name","guildRegionCategory","toUpperCase","getLocaleStringFromDateString","lastVisit","smartDisplayDays","differenceInDaysBetweenDates","Date","parse","now","createdAt","premiumLevel","manualMinimumPremiumLevel","staticRenderFns","classes","text","align","$t","normalizedSearchField","map","eventsToCome","nbRosters","nbCharacters","g","includes","admin","getTeams","components","DataFetcher","StatCard","component","VDataTable","VImg","VPagination","VTextField"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,eAAe,CAACE,MAAM,CAAC,aAAaN,EAAIO,QAAQ,CAACH,EAAG,MAAM,CAACA,EAAG,eAAe,CAACE,MAAM,CAAC,MAAQ,SAAS,SAAW,GAAG,eAAe,IAAIE,MAAM,CAACC,MAAOT,EAAe,YAAEU,SAAS,SAAUC,GAAMX,EAAIY,YAAYD,GAAKE,WAAW,iBAA+B,MAAbb,EAAIc,MAAeV,EAAG,MAAM,CAACW,YAAY,yCAAyC,CAACX,EAAG,YAAY,CAACE,MAAM,CAAC,MAAQ,UAAU,CAACN,EAAIgB,GAAG,aAAahB,EAAIiB,GAAGjB,EAAIkB,eAAeC,QAAQ,cAAcf,EAAG,YAAY,CAACE,MAAM,CAAC,MAAQ,iBAAiB,CAACN,EAAIgB,GAAG,aAAahB,EAAIiB,GAAGjB,EAAIkB,eAAeE,QAAO,SAAUC,GAAK,OAAOA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,aAAe,OAErB7C,QAAO,SAAA8C,GAAC,OACRA,EAAEvB,MAAQ,eAAgBuB,EAAEvB,MAAMwB,SAASN,QApF/C,8EAyFC,kIAzFD,qIA4FC,8GACoBO,EAAA,KAASC,WAD7B,OACCpE,KAAKa,MADN,uDA5FD,8DAA2C,QAAtB,EAAa,gBANjC,eAAU,CACVwD,WAAY,CACXC,cAAA,KACAC,WAAA,SAGmB,WC/GqY,I,iFCOtZC,EAAY,eACd,EACA1E,EACAyD,GACA,EACA,KACA,KACA,MAIa,aAAAiB,EAAiB,QAQhC,IAAkBA,EAAW,CAACC,aAAA,KAAWC,OAAA,KAAKC,cAAA,KAAYC,aAAA","file":"dist/js/chunk-2d21e765.6d7e174b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('data-fetcher',{attrs:{\"fetch-data\":_vm.fetch}},[_c('div',[_c('v-text-field',{attrs:{\"label\":\"Search\",\"outlined\":\"\",\"hide-details\":\"\"},model:{value:(_vm.searchField),callback:function ($$v) {_vm.searchField=$$v},expression:\"searchField\"}}),(_vm.teams != null)?_c('div',{staticClass:\"d-flex flex-wrap gap-x-6 gap-y-3 mt-3\"},[_c('stat-card',{attrs:{\"title\":\"Teams\"}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.displayedTeams.length)+\"\\n\\t\\t\\t\")]),_c('stat-card',{attrs:{\"title\":\"Active Teams\"}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.displayedTeams.filter(function (x) { return x.isActive; }).length)+\"\\n\\t\\t\\t\")]),_c('stat-card',{attrs:{\"title\":\"Guilds\"}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.displayedTeams.filter(function (x) { return x.guildRealm != null; }).length)+\" (\"+_vm._s(Math.round(100 * _vm.displayedTeams.filter(function (x) { return x.guildRealm != null; }).length / _vm.displayedTeams.length))+\"%)\\n\\t\\t\\t\")]),_c('stat-card',{attrs:{\"title\":\"Standalone Teams\"}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.displayedTeams.filter(function (x) { return x.guildRealm == null; }).length)+\" (\"+_vm._s(Math.round(100 * _vm.displayedTeams.filter(function (x) { return x.guildRealm == null; }).length / _vm.displayedTeams.length))+\"%)\\n\\t\\t\\t\")])],1):_vm._e(),_c('div',{staticClass:\"text-center pb-2 mt-3\"},[_c('v-pagination',{attrs:{\"length\":_vm.pageCount,\"total-visible\":11},model:{value:(_vm.page),callback:function ($$v) {_vm.page=$$v},expression:\"page\"}})],1),_c('v-data-table',{attrs:{\"headers\":_vm.headers,\"items\":_vm.displayedTeams,\"loading\":_vm.isLoading,\"page\":_vm.page,\"items-per-page\":20,\"mobile-breakpoint\":0,\"sort-by\":\"createdAt\",\"sort-desc\":\"\",\"hide-default-footer\":\"\"},on:{\"update:page\":function($event){_vm.page=$event},\"page-count\":function($event){_vm.pageCount = $event}},scopedSlots:_vm._u([{key:\"item.guildSide\",fn:function(ref){\nvar item = ref.item;\nreturn [(item.guildSide != null)?_c('v-img',{attrs:{\"src\":_vm.imageLinks.iconFaction(item.guildSide),\"max-width\":\"24\"}}):_vm._e()]}},{key:\"item.name\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('router-link',{staticClass:\"simple\",attrs:{\"to\":_vm.teamUrl(item, \"/dashboard\")}},[_vm._v(_vm._s(item.name)+\" - (\"+_vm._s(item.guildRegionCategory.toUpperCase())+\")\\n\\t\\t\\t\\t\\t\"),(item.guildRealm)?_c('span',[_vm._v(_vm._s(item.guildRealm))]):_vm._e()])]}},{key:\"item.lastVisit\",fn:function(ref){\nvar item = ref.item;\nreturn [(item.lastVisit)?_c('span',[_vm._v(_vm._s(_vm.getLocaleStringFromDateString(item.lastVisit))+\" - (\"+_vm._s(_vm.smartDisplayDays(_vm.differenceInDaysBetweenDates(new Date(Date.parse(item.lastVisit)), _vm.now)))+\")\")]):_c('span',[_vm._v(\"-\")])]}},{key:\"item.createdAt\",fn:function(ref){\nvar item = ref.item;\nreturn [_vm._v(_vm._s(_vm.getLocaleStringFromDateString(item.createdAt))+\" - (\"+_vm._s(_vm.smartDisplayDays(_vm.differenceInDaysBetweenDates(new Date(Date.parse(item.createdAt)), _vm.now)))+\")\\n\\t\\t\\t\")]}},{key:\"item.premiumLevel\",fn:function(ref){\nvar item = ref.item;\nreturn [_vm._v(_vm._s(item.premiumLevel)+\"\\n\\t\\t\\t\\t\"),(item.manualMinimumPremiumLevel > 0)?_c('span',[_vm._v(\"(manual \"+_vm._s(item.manualMinimumPremiumLevel)+\")\")]):_vm._e()]}}])})],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue } from \"vue-property-decorator\";\n\n/**\n * Utils\n */\nimport classes from \"@/config/wow/classes\";\nimport * as imageLinks from \"@/config/image-links\";\nimport { getLocaleStringFromDateString, differenceInDaysBetweenDates, smartDisplayDays } from \"@/utils/date-helpers\";\nimport { teamUrl } from \"@/utils/url-helpers\";\n\n\n/**\n * Components\n */\nimport StatCard from \"@/components/admin/components/StatCard.vue\";\n\n/**\n * API\n */\nimport adminAPI from \"@/api/admin\";\nimport { normalizeString } from \"@/utils/string-helpers\";\nimport { GetAllTeamsResponse } from \"@/api/admin/get-all-teams.response\";\nimport DataFetcher from \"@/components/_global/DataFetcher.vue\";\n\n\n/**\n * Types\n */\n\n\n/**\n * VueX Modules\n */\n\n\ntype DisplayedTeam = GetAllTeamsResponse.Team & { isActive: boolean };\n\n/**\n * Admin teams list page.\n */\n@Component({\n\tcomponents: {\n\t\tDataFetcher,\n\t\tStatCard\n\t}\n})\nexport default class TeamsListPage extends Vue {\n\t/// Injections\n\tclasses = classes;\n\tgetLocaleStringFromDateString = getLocaleStringFromDateString;\n\tdifferenceInDaysBetweenDates = differenceInDaysBetweenDates;\n\tsmartDisplayDays = smartDisplayDays;\n\n\tteamUrl = teamUrl;\n\n\timageLinks = imageLinks;\n\n\t/// Attributes\n\tnow = new Date();\n\tisLoading = false;\n\t// Filters\n\tsearchField = \"\";\n\t// Pagination\n\tpage = 1;\n\tpageCount = 0;\n\t// Table\n\tteams: GetAllTeamsResponse.Team[] | null = null;\n\n\tget headers() {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttext: \"\",\n\t\t\t\tvalue: \"guildSide\",\n\t\t\t\talign: \"center\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.name\"),\n\t\t\t\tvalue: \"name\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.nb_characters\"),\n\t\t\t\tvalue: \"nbCharacters\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.nb_rosters\"),\n\t\t\t\tvalue: \"nbRosters\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.upcoming_events\"),\n\t\t\t\tvalue: \"eventsToCome\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.last_visit\"),\n\t\t\t\tvalue: \"lastVisit\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.created_at\"),\n\t\t\t\tvalue: \"createdAt\",\n\t\t\t\talign: \"left\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: this.$t(\"team.premium_level\"),\n\t\t\t\tvalue: \"premiumLevel\",\n\t\t\t\talign: \"left\"\n\t\t\t}\n\t\t];\n\t}\n\n\tget displayedTeams(): DisplayedTeam[] {\n\t\tif (this.teams == null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst normalizedSearchField = normalizeString(this.searchField);\n\t\treturn this.teams\n\t\t\t.map(x => ({\n\t\t\t\t...x,\n\t\t\t\tisActive:\n\t\t\t\t\tx.lastVisit != null\n\t\t\t\t\t&& differenceInDaysBetweenDates(new Date(Date.parse(x.lastVisit)), this.now) < 7\n\t\t\t\t\t&& x.eventsToCome > 0\n\t\t\t\t\t&& x.nbRosters > 0\n\t\t\t\t\t&& x.nbCharacters > 0\n\t\t\t}))\n\t\t\t.filter(g =>\n\t\t\t\tg.name && normalizeString(g.name).includes(normalizedSearchField)\n\t\t\t);\n\t}\n\n\t/// Methods\n\tasync created() {\n\t}\n\n\tasync fetch() {\n\t\tthis.teams = await adminAPI.getTeams();\n\t}\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TeamsListPage.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TeamsListPage.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TeamsListPage.vue?vue&type=template&id=8ebc3386&\"\nimport script from \"./TeamsListPage.vue?vue&type=script&lang=ts&\"\nexport * from \"./TeamsListPage.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VDataTable } from 'vuetify/lib/components/VDataTable';\nimport { VImg } from 'vuetify/lib/components/VImg';\nimport { VPagination } from 'vuetify/lib/components/VPagination';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VDataTable,VImg,VPagination,VTextField})\n"],"sourceRoot":""}