{"version":3,"sources":["webpack:///./src/services/CatalogSongsService.ts","webpack:///./src/views/IntellectualProperty/Catalogs/CatalogSongDetail.vue","webpack:///./src/views/IntellectualProperty/Catalogs/CatalogSongDetail.vue?28aa","webpack:///./src/views/IntellectualProperty/Catalogs/CatalogSongDetail.vue?a848","webpack:///./src/views/IntellectualProperty/Catalogs/CatalogSongDetail.vue?5197"],"names":["CatalogSongsServiceClass","Vue","constructor","catalogId","numResults","catalogLabel","searchResults","query","page","sortBy","numPerPage","lyricsCached","reset","this","setQueryParams","data","toString","numperpage","router","push","path","catch","err","getQueryParams","currentRoute","parseInt","includes","setSortBy","onSetTerritory","performSearch","setNumPerPage","setPage","BusyService","showBusy","response","ApiService","post","territoryId","TerritoryService","filters","JSON","stringify","adminIds","catalogIds","contributorIds","search","pageSize","currentFilters","label","hideBusy","songId","lyrics","offset","Date","getTimezoneOffset","encodeURIComponent","__decorate","Component","CatalogSongsService","render","_vm","_c","_self","_setupProxy","staticClass","attrs","_v","_s","$t","store","_e","$route","params","ccliSongId","staticRenderFns","CatalogSongDetail","catalogid","metaInfo","title","DynamicTranslationService","songDetailsTitle","components","SongDetails","component"],"mappings":"sQAWA,IAAMA,EAAN,cAAuCC,OAAvCC,c,oBACE,KAAAC,UAAY,GACZ,KAAAC,WAAa,EACb,KAAAC,aAAe,GACf,KAAAC,cAAqC,KAErC,KAAAC,MAAQ,CACNC,KAAM,EACNC,OAAQ,GACRC,WAAY,IA2Fd,KAAAC,aAA6C,GAxF7CC,QACEC,KAAKP,cAAgB,KAGvBQ,iBACE,MAAMC,EAA2C,GAE7CF,KAAKN,MAAMC,KAAO,IACpBO,EAAKP,KAAOK,KAAKN,MAAMC,KAAKQ,YAGD,IAAzBH,KAAKN,MAAMG,aACbK,EAAKE,WAAaJ,KAAKN,MAAMG,WAAWM,YAGtCH,KAAKN,MAAME,SACbM,EAAKN,OAASI,KAAKN,MAAME,QAG3BS,OAAOC,KAAK,CAAEC,KAAM,kCAAkCP,KAAKV,UA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song-detail.10cf24fe.js","sourcesContent":["import { SearchSongFilter } from '@/models/SearchSongFilter';\r\nimport { SongResult } from '@/models/SongResult';\r\nimport { ApplyFilters } from '@/models/ApplyFilters';\r\nimport { SearchSongData } from '@/models/SearchSongData';\r\nimport router from '@/router';\r\nimport { Component, Vue } from 'vue-property-decorator'\r\nimport { BusyService } from './BusyService';\r\nimport { ApiService } from './ApiService';\r\nimport { TerritoryService } from './TerritoryService';\r\n\r\n@Component\r\nclass CatalogSongsServiceClass extends Vue {\r\n catalogId = '';\r\n numResults = 0;\r\n catalogLabel = '';\r\n searchResults: SongResult[] | null = null;\r\n\r\n query = {\r\n page: 1,\r\n sortBy: '',\r\n numPerPage: 10,\r\n }\r\n\r\n reset() {\r\n this.searchResults = null;\r\n }\r\n\r\n setQueryParams(){\r\n const data: {[key: string]: string[] | string} = {}\r\n\r\n if (this.query.page > 1){\r\n data.page = this.query.page.toString();\r\n }\r\n\r\n if (this.query.numPerPage != 10){\r\n data.numperpage = this.query.numPerPage.toString();\r\n }\r\n\r\n if (this.query.sortBy){\r\n data.sortBy = this.query.sortBy\r\n }\r\n\r\n router.push({ path: `/intellectualproperty/catalogs/${this.catalogId}`, query: data}).catch((err)=>{});\r\n }\r\n\r\n getQueryParams(){\r\n\r\n if (router.currentRoute.query.page) {\r\n this.query.page = parseInt(router.currentRoute.query.page as string)\r\n }else{\r\n this.query.page = 1;\r\n }\r\n\r\n if (router.currentRoute.query.numperpage) {\r\n this.query.numPerPage = parseInt(router.currentRoute.query.numperpage as string)\r\n }else{\r\n this.query.numPerPage = 10;\r\n }\r\n\r\n if (router.currentRoute.query.sortBy && ['TitleAsc', 'TitleDesc', 'LyricsAsc', 'LyricsDesc', 'SongIdAsc', 'SongIdDesc'].includes(router.currentRoute.query.sortBy as string)) {\r\n this.query.sortBy = router.currentRoute.query.sortBy as string;\r\n }else{\r\n this.query.sortBy = '';\r\n }\r\n }\r\n\r\n setSortBy(sortBy: string) {\r\n this.query.sortBy = sortBy;\r\n this.query.page = 1;\r\n this.setQueryParams();\r\n }\r\n\r\n onSetTerritory(){\r\n this.query.page = 1;\r\n this.setQueryParams();\r\n this.performSearch();\r\n }\r\n\r\n setNumPerPage(numPerPage: number){\r\n this.query.numPerPage = numPerPage;\r\n this.query.page = 1;\r\n this.setQueryParams();\r\n }\r\n\r\n setPage(page: number) {\r\n this.query.page = page;\r\n this.setQueryParams();\r\n }\r\n\r\n async performSearch() {\r\n BusyService.showBusy();\r\n // sample api call when endpoint is ready\r\n const response = await ApiService.post('/api/SearchSongs', {\r\n territoryId: parseInt(TerritoryService.territoryId),\r\n filters: JSON.stringify({\r\n adminIds: [],\r\n catalogIds: [this.catalogId],\r\n contributorIds: []\r\n }),\r\n search: '',\r\n page: this.query.page || 1,\r\n pageSize: this.query.numPerPage || 10,\r\n sortBy: this.query.sortBy || '', // options: TitleAsc, TitleDesc, LyricsAsc, LyricsDesc, SongIdAsc, SongIdDesc\r\n }) as SearchSongData;\r\n\r\n this.catalogLabel = response.currentFilters[0].label;\r\n this.searchResults = response.searchResults as SongResult[];\r\n this.numResults = response.numResults as number;\r\n BusyService.hideBusy();\r\n }\r\n\r\n lyricsCached: {[songId: string]: string[]} = {};\r\n async getLyrics(songId: string){\r\n if (!this.lyricsCached[songId]){\r\n const lyrics = await ApiService.post('/api/GetSongLyricsPreview', { songId});\r\n this.lyricsCached[songId] = lyrics;\r\n }\r\n return this.lyricsCached[songId];\r\n }\r\n\r\n get downloadAllUrl() {\r\n const offset = new Date().getTimezoneOffset();\r\n return `/api/DownloadCatalog?CatalogId=${this.catalogId}&CatalogName=${encodeURIComponent(this.catalogLabel)}&Offset=${offset}&TerritoryId=${TerritoryService.territoryId}`\r\n }\r\n}\r\n\r\nexport const CatalogSongsService = new CatalogSongsServiceClass()\r\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"mt-2 border-top border-1 p-4\"},[_c('div',{staticClass:\"mb-2\"},[_c('router-link',{staticClass:\"text-secondary small\",attrs:{\"to\":`/intellectualproperty/catalogs/${_vm.catalogId}`}},[_c('i',{staticClass:\"fa-solid fa-caret-left me-1\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(\" \"+_vm._s(_vm.$t('R.LIT_BackToCatalog'))),(_vm.store.catalogLabel)?_c('span',[_vm._v(\": '\"+_vm._s(_vm.store.catalogLabel)+\"'\")]):_vm._e()])],1),_c('SongDetails',{attrs:{\"ccli-song-id\":_vm.$route.params.ccliSongId}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { i18n } from '@/main';\r\nimport { DynamicTranslationService } from '@/services/DynamicTranslationService';\r\nimport { CatalogSongsService } from '@/services/CatalogSongsService';\r\nimport { Component, Vue } from 'vue-property-decorator'\r\nimport SongDetails from './../Shared/SongDetails.vue';\r\n\r\n\r\n@Component({\r\n metaInfo: () => ({\r\n title: DynamicTranslationService.songDetailsTitle\r\n }), \r\n components:{ \r\n SongDetails\r\n }\r\n})\r\nexport default class CatalogSongDetail extends Vue {\r\n store = CatalogSongsService;\r\n catalogId = this.$route.params.catalogid;\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CatalogSongDetail.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CatalogSongDetail.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./CatalogSongDetail.vue?vue&type=template&id=0b6754c4\"\nimport script from \"./CatalogSongDetail.vue?vue&type=script&lang=ts\"\nexport * from \"./CatalogSongDetail.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"],"sourceRoot":""}