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AA,CAAK,QAAE,CACP8D,KAAA,CAAA5B,CAAU,CACV8G,QAAA,CAAAF,CAAA,GACE,GACF,GAEM,GAAEX,CAAU,CAAAzD,GAAA,EAAA8D,CAAA,CAAAxL,CAAA,EACtB4K,UAAA,CAAAA,CAAe,CACfI,aAAY,CAAAA,CAAU,CACtBF,UAAS,CAAAA,CAAO,CAChB3D,OAAA,CAAAA,CAAY,CACZ4D,UAAS,CAAAA,CAAO,CAChBE,OAAA,CAAAA,CAAA,GAEJ,CACH,EAED,CAA8B","sources":["webpack://_N_E/./src/redux/reselect/aggregated-units.js","webpack://_N_E/./src/components/list-view-table/index.js","webpack://_N_E/./src/theme/table/analytics/index.js","webpack://_N_E/"],"sourcesContent":["/* eslint-disable camelcase */\nimport { createSelector } from 'reselect';\nimport formatCurrency from 'lib/format-currency';\nimport translations from 'translations';\nimport configSelector from './config';\n\nconst selectPayloadByKey = createSelector(\n (state) => state.aggr.payload,\n (_, key) => key,\n (payload, key) => payload[key],\n);\n\nconst selectAggregatedUnits = createSelector(\n selectPayloadByKey,\n configSelector,\n (payload, config) => {\n if (!payload || !payload.data) return [];\n\n const { languageCode } = config;\n\n const {\n currency,\n query,\n data: {\n aggregations: {\n results: { buckets },\n },\n },\n } = payload;\n\n const isUsage = query.includes('usage_data');\n\n let currentTotal = 0;\n let durationTotal = 0;\n\n buckets.forEach((data) => {\n const {\n current_period: {\n total_revenues: { value },\n total_duration: { value: valueDuration },\n },\n } = data;\n\n currentTotal += value;\n durationTotal += valueDuration;\n });\n\n return buckets\n .map((data) => {\n const { key: isbn, current_period, previous_period, include } = data;\n\n const totalCurrentRevenues = formatCurrency(currency, current_period.total_revenues.value);\n const totalPreviousRevenues = formatCurrency(\n currency,\n previous_period.total_revenues.value,\n );\n const totalCurrentDuration = `${parseFloat(current_period.total_duration.value / 60).toFixed(\n 1,\n )} ${translations[languageCode].hours}`;\n const totalPreviousDuration = `${parseFloat(\n previous_period.total_duration.value / 60,\n ).toFixed(1)} ${translations[languageCode].hours}`;\n\n let percentEarning = 0;\n if (previous_period.total_revenues.value !== 0) {\n percentEarning = Math.round(\n ((current_period.total_revenues.value - previous_period.total_revenues.value) /\n previous_period.total_revenues.value) *\n 100,\n );\n }\n\n let percentTrend = 0;\n if (previous_period.total_duration.value !== 0) {\n percentTrend = Math.round(\n ((current_period.total_duration.value - previous_period.total_duration.value) /\n previous_period.total_duration.value) *\n 100,\n );\n }\n\n let percent = 0;\n percent = (current_period?.total_revenues?.value !== 0 && currentTotal !== 0) ? Math.round(current_period.total_revenues.value / (currentTotal / 100)) : 0;\n\n let percentDuration = 0;\n percentDuration = (current_period?.total_duration?.value !== 0 && durationTotal !== 0) ? Math.round((current_period.total_duration.value * 100) / durationTotal) : 0;\n\n const unitData = include.hits && include.hits.hits[0] ? include.hits.hits[0] : null;\n\n const {\n _source: {\n title,\n language,\n authors,\n main_category,\n cover_link,\n publisher,\n item_type,\n supplier,\n data_type,\n public_domain,\n reading_minutes,\n },\n } = unitData;\n\n let capitalAuthors = [];\n\n if (authors && authors.length) {\n capitalAuthors = authors.map((author) => {\n const authorSplit = author.split(' ');\n\n const capitalName = authorSplit.map(\n (name) => `${name.charAt(0).toUpperCase()}${name.slice(1)}`,\n );\n\n return capitalName.join(' ');\n });\n }\n\n return {\n key: isbn,\n totalCurrentRevenuesValue: current_period.total_revenues.value,\n totalCurrentRevenues,\n totalPreviousRevenuesValue: previous_period.total_revenues.value,\n totalPreviousRevenues,\n totalCurrentDoc: current_period.doc_count,\n totalCurrentQuantity: current_period.total_quantity.value,\n totalPreviousQuantity: previous_period.total_quantity.value,\n totalCurrentDuration,\n totalCurrentDurationValue: current_period.total_duration.value,\n totalPreviousDuration,\n percentEarning,\n percent,\n percentTrend,\n percentDuration,\n cover: cover_link,\n title,\n type: item_type,\n publisher,\n isbn,\n supplier,\n dataType: data_type,\n publicDomain: public_domain,\n itemType: item_type,\n authors: capitalAuthors.join(', '),\n genre: main_category && main_category[languageCode] ? main_category[languageCode] : null,\n language: language && language[languageCode] ? language[languageCode] : null,\n };\n })\n .sort((a, b) => (isUsage) ? a.totalCurrentDurationValue - b.totalCurrentDurationValue : a.totalCurrentRevenuesValue - b.totalCurrentRevenuesValue)\n .reverse();\n },\n);\n\nexport default selectAggregatedUnits;\n","/* eslint-disable no-nested-ternary */\nimport React, { useMemo, useEffect, useState, useCallback } from 'react';\nimport styled from 'styled-components';\nimport { typography, color, space, flexbox } from 'styled-system';\nimport { themeGet } from '@styled-system/theme-get';\nimport base64 from 'base-64';\nimport moment from 'moment';\nimport papa from 'papaparse';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { changeOthersFilter } from 'redux-api/action/filters';\nimport { getAggrRequest } from 'redux-api/action/aggr';\nimport selectAggregatedUnits from 'redux-api/reselect/aggregated-units';\nimport Table from 'theme/table/analytics';\nimport BtnLink from 'theme/buttons/btn-link';\nimport Filter from 'theme/icons/filter';\nimport translations from 'translations';\nimport changeCoverUrl from 'lib/change-cover-url';\nimport createDownloadLink from 'lib/create-download-link';\n\nconst Label = styled.div`\n ${color}\n ${space}\n ${flexbox}\n\n display: flex;\n flex-direction: row;\n width: fit-content;\n border-radius: 4px;\n\n & > img {\n padding-left: ${themeGet('space.xs')}px;\n }\n`;\n\nconst Value = styled.div`\n ${color}\n ${space}\n\n display: flex;\n`;\n\nconst Text = styled.p`\n ${typography}\n ${color}\n ${space}\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-transform: ${({ textTransform }) => textTransform || 'none'};\n`;\n\nconst StyledLink = styled.a`\n text-decoration: none;\n color: ${themeGet('colors.primary_400')};\n\n &:hover {\n background: ${themeGet('colors.primary_500')};\n }\n\n &:focus {\n background: ${themeGet('colors.primary_600')};\n }\n`;\n\nfunction ListViewTable({\n onButtonClick,\n buttonLabel,\n dataType,\n dateFrom,\n dateTo,\n dateRange,\n filters,\n terms,\n compare,\n size,\n reloadChecked,\n}) {\n const dispatch = useDispatch();\n\n // eslint-disable-next-line no-unused-vars\n const [pageSize, setPageSize] = useState(100);\n const [queriedKey, setQueriedKey] = useState(null);\n\n const { isWaiting } = useSelector((state) => state.aggr);\n const units = useSelector((state) => selectAggregatedUnits(state, queriedKey));\n const { currency, languageCode } = useSelector((state) => state.config);\n const { analytics_type } = useSelector((state) => state.profile.payload);\n\n const term = 'isbn';\n\n const handleAddIsbnFilter = useCallback(\n (isbn) => {\n if (isbn) {\n dispatch(\n changeOthersFilter({\n [JSON.stringify(`isbn-${isbn}`)]: {\n type: 'isbn',\n label: isbn,\n value: `isbn=${isbn}`,\n color: 'lime_300',\n },\n }),\n );\n }\n },\n [dispatch],\n );\n\n useEffect(() => {\n if (!dataType || !dateTo || !dateFrom) return;\n\n const include =\n 'cover_link,title,isbn,item_type,price_eur,price_usd,country,publisher,item_type,language,date_publisher,authors,main_category,store_name,platform_name,supplier,order_type,data_type,public_domain';\n\n let query = `currency=${currency}&dataType=${dataType}&term=${term}&size=${\n size || pageSize\n }&dateTo=${dateTo}&dateFrom=${dateFrom}&dateRange=${dateRange}&compare=${compare}&include=${include}&version=7&enterprise=${\n analytics_type || 'standard'\n }`;\n\n if (filters) {\n query = `${query}&filters=${filters}`;\n }\n\n if (terms) {\n query = `${query}&terms=${terms}`;\n }\n\n const key = base64.encode(query);\n setQueriedKey(key);\n\n dispatch(\n getAggrRequest({\n term,\n size: 0,\n key,\n query,\n currency,\n }),\n );\n }, [\n dispatch,\n currency,\n term,\n dateTo,\n dateFrom,\n dateRange,\n size,\n pageSize,\n dataType,\n filters,\n terms,\n compare,\n reloadChecked,\n analytics_type,\n ]);\n\n const columns = useMemo(\n () => [\n {\n title: translations[languageCode].Cover,\n width: 110,\n dataIndex: 'cover',\n key: 'cover',\n fixed: 'left',\n render: (cover) => (\n \n ),\n },\n {\n title: translations[languageCode].Title,\n width: 290,\n dataIndex: 'title',\n sorter: false,\n key: 'title',\n fixed: 'left',\n ellipsis: {\n showTitle: true,\n },\n render: (text, record) => (\n
\n \n {text}\n \n \n
\n ),\n },\n {\n title: translations[languageCode].Type,\n dataIndex: 'type',\n key: 'item_type',\n sorter: false,\n width: 120,\n render: (text) => (\n \n {text}\n \n ),\n },\n {\n title:\n dataType === 'usage_data'\n ? translations[languageCode].hours\n : translations[languageCode].Revenues,\n dataIndex: dataType === 'usage_data' ? 'totalCurrentDuration' : 'totalCurrentRevenues',\n key: dataType === 'usage_data' ? 'totalCurrentDuration' : 'totalCurrentRevenues',\n sorter: false,\n sortOrder: 'descend',\n width: 150,\n render: (text, record) => (\n
\n \n {text}\n \n {dataType === 'usage_data' ? (\n \n 0\n ? 'lime_400'\n : record.percentTrend < 0\n ? 'red_400'\n : 'grey_600'\n }\n textAlign=\"left\"\n >\n {`${\n record.percentTrend > 0 ? '+' : record.percentTrend < 0 ? '-' : ''\n } ${Math.abs(record.percentTrend)}%`}\n \n \n ) : (\n \n 0\n ? 'lime_400'\n : record.percentEarning < 0\n ? 'red_400'\n : 'grey_600'\n }\n textAlign=\"left\"\n >\n {`${\n record.percentEarning > 0 ? '+' : record.percentEarning < 0 ? '-' : ''\n } ${Math.abs(record.percentEarning)}%`}\n \n \n )}\n
\n ),\n },\n {\n title: dataType === 'usage_data'\n ? translations[languageCode].users\n : translations[languageCode].Quantity,\n dataIndex: 'totalCurrentQuantity',\n key: `quantity`,\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true,\n },\n },\n {\n title: translations[languageCode].Language,\n dataIndex: 'language',\n key: `language.${languageCode}`,\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true,\n },\n },\n {\n title: translations[languageCode].Authors,\n dataIndex: 'authors',\n key: 'authors',\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true,\n },\n },\n {\n title: translations[languageCode].Genre,\n dataIndex: 'genre',\n key: `main_category.${languageCode}`,\n sorter: false,\n width: 200,\n ellipsis: {\n showTitle: true,\n },\n },\n {\n title: translations[languageCode].Publisher,\n dataIndex: 'publisher',\n key: 'publisher',\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true,\n },\n },\n ],\n [languageCode, dataType, handleAddIsbnFilter],\n );\n\n const handleClickTableBtn = useCallback(() => {\n if (onButtonClick) return onButtonClick();\n\n const csvData = units.map((unit) => ({\n Cover: unit.cover,\n Isbn: unit.isbn,\n Title: unit.title,\n Type: unit.type,\n Revenue: parseFloat(unit.totalCurrentRevenuesValue.toFixed(2), 2),\n Quantity: unit.totalCurrentQuantity,\n 'Previous Period Revenue': parseFloat(unit.totalPreviousRevenuesValue.toFixed(2), 2),\n 'Previous Period Quantity': unit.totalPreviousQuantity,\n Language: unit.language,\n Authors: unit.authors,\n Genre: unit.genre,\n Publisher: unit.publisher,\n 'Public Domain': unit.publicDomain,\n 'Data Type': unit.dataType,\n }));\n\n const csv = papa.unparse(csvData);\n\n moment.locale(languageCode);\n\n return createDownloadLink(\n csv,\n `${moment(dateFrom).format('DD MMM YYYY')}-${moment(dateTo).format('DD MMM YYYY')}.csv`,\n );\n }, [units, onButtonClick, dateFrom, dateTo, languageCode]);\n\n return (\n null}\n loading={isWaiting}\n />\n );\n}\n\nexport default ListViewTable;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { themeGet } from '@styled-system/theme-get';\nimport Text from 'theme/text';\nimport ButtonBorder from 'theme/buttons/btn-border';\nimport Table from '../default';\n\nconst Wrapper = styled.div`\n background-color: ${themeGet('colors.white')};\n border: 2px solid ${themeGet('colors.primary_100')};\n border-radius: 12px;\n\n & > .table-head {\n height: 88px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n border-bottom: 2px solid ${themeGet('colors.primary_100')};\n padding: 0 ${themeGet('space.s')}px;\n }\n`;\n\nfunction AnalyticsTable({\n emptyLabel,\n buttonLabel,\n totalLabel,\n title,\n onChangeTable,\n total,\n dataSource,\n columns,\n pagination,\n onButtonClick,\n onSecondaryButtonClick,\n secondaryButton,\n secondaryButtonLabel,\n loading,\n buttonDisabled,\n}) {\n return (\n \n
\n
\n \n {title}\n \n \n {`${totalLabel} ${total || ''}`}\n \n
\n
\n {secondaryButton && (\n onSecondaryButtonClick(secondaryButton)}\n style={{\n minWidth: '48px',\n height: '48px',\n p: 0,\n mr: 's',\n }}\n type=\"button\"\n label={secondaryButtonLabel}\n />\n )}\n \n
\n
\n \n
\n );\n}\n\nexport default AnalyticsTable;\n","\"use strict\";\n(self[\"webpackChunk_N_E\"] = self[\"webpackChunk_N_E\"] || []).push([[1219],{\n\n/***/ 51219:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"Z\": function() { return /* binding */ list_view_table; }\n});\n\n// EXTERNAL MODULE: ./node_modules/@swc/helpers/src/_define_property.mjs\nvar _define_property = __webpack_require__(14924);\n// EXTERNAL MODULE: ./node_modules/@swc/helpers/src/_tagged_template_literal.mjs\nvar _tagged_template_literal = __webpack_require__(7297);\n// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js\nvar jsx_runtime = __webpack_require__(85893);\n// EXTERNAL MODULE: ./node_modules/react/index.js\nvar react = __webpack_require__(67294);\n// EXTERNAL MODULE: ./node_modules/styled-components/dist/styled-components.browser.esm.js + 4 modules\nvar styled_components_browser_esm = __webpack_require__(14141);\n// EXTERNAL MODULE: ./node_modules/styled-system/dist/index.esm.js + 12 modules\nvar index_esm = __webpack_require__(32016);\n// EXTERNAL MODULE: ./node_modules/@styled-system/theme-get/dist/index.esm.js\nvar dist_index_esm = __webpack_require__(50056);\n// EXTERNAL MODULE: ./node_modules/base-64/base64.js\nvar base64 = __webpack_require__(97501);\nvar base64_default = /*#__PURE__*/__webpack_require__.n(base64);\n// EXTERNAL MODULE: ./node_modules/moment/moment.js\nvar moment = __webpack_require__(30381);\nvar moment_default = /*#__PURE__*/__webpack_require__.n(moment);\n// EXTERNAL MODULE: ./node_modules/papaparse/papaparse.min.js\nvar papaparse_min = __webpack_require__(57460);\nvar papaparse_min_default = /*#__PURE__*/__webpack_require__.n(papaparse_min);\n// EXTERNAL MODULE: ./node_modules/react-redux/es/index.js + 19 modules\nvar es = __webpack_require__(15313);\n// EXTERNAL MODULE: ./src/redux/action/filters.js\nvar action_filters = __webpack_require__(93103);\n// EXTERNAL MODULE: ./src/redux/action/aggr.js\nvar aggr = __webpack_require__(49888);\n// EXTERNAL MODULE: ./node_modules/reselect/es/index.js + 1 modules\nvar reselect_es = __webpack_require__(68697);\n// EXTERNAL MODULE: ./src/lib/format-currency.js\nvar format_currency = __webpack_require__(70351);\n// EXTERNAL MODULE: ./src/translations/index.js + 4 modules\nvar translations = __webpack_require__(99408);\n// EXTERNAL MODULE: ./src/redux/reselect/config.js\nvar config = __webpack_require__(57708);\n;// CONCATENATED MODULE: ./src/redux/reselect/aggregated-units.js\n/* eslint-disable camelcase */ \n\n\n\nvar selectPayloadByKey = (0,reselect_es/* createSelector */.P1)(function(state) {\n return state.aggr.payload;\n}, function(_, key) {\n return key;\n}, function(payload, key) {\n return payload[key];\n});\nvar selectAggregatedUnits = (0,reselect_es/* createSelector */.P1)(selectPayloadByKey, config/* default */.ZP, function(payload, config) {\n if (!payload || !payload.data) return [];\n var languageCode = config.languageCode;\n var currency = payload.currency, query = payload.query, _data = payload.data, _aggregations = _data.aggregations, buckets = _aggregations.results.buckets;\n var isUsage = query.includes(\"usage_data\");\n var currentTotal = 0;\n var durationTotal = 0;\n buckets.forEach(function(data) {\n var _current_period = data.current_period, value = _current_period.total_revenues.value, _total_duration = _current_period.total_duration, valueDuration = _total_duration.value;\n currentTotal += value;\n durationTotal += valueDuration;\n });\n return buckets.map(function(data) {\n var ref, ref1;\n var isbn = data.key, current_period = data.current_period, previous_period = data.previous_period, include = data.include;\n var totalCurrentRevenues = (0,format_currency/* default */.Z)(currency, current_period.total_revenues.value);\n var totalPreviousRevenues = (0,format_currency/* default */.Z)(currency, previous_period.total_revenues.value);\n var totalCurrentDuration = \"\".concat(parseFloat(current_period.total_duration.value / 60).toFixed(1), \" \").concat(translations/* default */.Z[languageCode].hours);\n var totalPreviousDuration = \"\".concat(parseFloat(previous_period.total_duration.value / 60).toFixed(1), \" \").concat(translations/* default */.Z[languageCode].hours);\n var percentEarning = 0;\n if (previous_period.total_revenues.value !== 0) {\n percentEarning = Math.round((current_period.total_revenues.value - previous_period.total_revenues.value) / previous_period.total_revenues.value * 100);\n }\n var percentTrend = 0;\n if (previous_period.total_duration.value !== 0) {\n percentTrend = Math.round((current_period.total_duration.value - previous_period.total_duration.value) / previous_period.total_duration.value * 100);\n }\n var percent = 0;\n percent = (current_period === null || current_period === void 0 ? void 0 : (ref = current_period.total_revenues) === null || ref === void 0 ? void 0 : ref.value) !== 0 && currentTotal !== 0 ? Math.round(current_period.total_revenues.value / (currentTotal / 100)) : 0;\n var percentDuration = 0;\n percentDuration = (current_period === null || current_period === void 0 ? void 0 : (ref1 = current_period.total_duration) === null || ref1 === void 0 ? void 0 : ref1.value) !== 0 && durationTotal !== 0 ? Math.round(current_period.total_duration.value * 100 / durationTotal) : 0;\n var unitData = include.hits && include.hits.hits[0] ? include.hits.hits[0] : null;\n var __source = unitData._source, title = __source.title, language = __source.language, authors = __source.authors, main_category = __source.main_category, cover_link = __source.cover_link, publisher = __source.publisher, item_type = __source.item_type, supplier = __source.supplier, data_type = __source.data_type, public_domain = __source.public_domain, reading_minutes = __source.reading_minutes;\n var capitalAuthors = [];\n if (authors && authors.length) {\n capitalAuthors = authors.map(function(author) {\n var authorSplit = author.split(\" \");\n var capitalName = authorSplit.map(function(name) {\n return \"\".concat(name.charAt(0).toUpperCase()).concat(name.slice(1));\n });\n return capitalName.join(\" \");\n });\n }\n return {\n key: isbn,\n totalCurrentRevenuesValue: current_period.total_revenues.value,\n totalCurrentRevenues: totalCurrentRevenues,\n totalPreviousRevenuesValue: previous_period.total_revenues.value,\n totalPreviousRevenues: totalPreviousRevenues,\n totalCurrentDoc: current_period.doc_count,\n totalCurrentQuantity: current_period.total_quantity.value,\n totalPreviousQuantity: previous_period.total_quantity.value,\n totalCurrentDuration: totalCurrentDuration,\n totalCurrentDurationValue: current_period.total_duration.value,\n totalPreviousDuration: totalPreviousDuration,\n percentEarning: percentEarning,\n percent: percent,\n percentTrend: percentTrend,\n percentDuration: percentDuration,\n cover: cover_link,\n title: title,\n type: item_type,\n publisher: publisher,\n isbn: isbn,\n supplier: supplier,\n dataType: data_type,\n publicDomain: public_domain,\n itemType: item_type,\n authors: capitalAuthors.join(\", \"),\n genre: main_category && main_category[languageCode] ? main_category[languageCode] : null,\n language: language && language[languageCode] ? language[languageCode] : null\n };\n }).sort(function(a, b) {\n return isUsage ? a.totalCurrentDurationValue - b.totalCurrentDurationValue : a.totalCurrentRevenuesValue - b.totalCurrentRevenuesValue;\n }).reverse();\n});\n/* harmony default export */ var aggregated_units = (selectAggregatedUnits);\n\n// EXTERNAL MODULE: ./src/theme/table/analytics/index.js\nvar analytics = __webpack_require__(3906);\n// EXTERNAL MODULE: ./src/theme/buttons/btn-link.js\nvar btn_link = __webpack_require__(25733);\n// EXTERNAL MODULE: ./src/theme/icons/filter.js\nvar filter = __webpack_require__(8599);\n// EXTERNAL MODULE: ./src/lib/change-cover-url.js\nvar change_cover_url = __webpack_require__(73559);\n// EXTERNAL MODULE: ./src/lib/create-download-link.js\nvar create_download_link = __webpack_require__(60857);\n;// CONCATENATED MODULE: ./src/components/list-view-table/index.js\n/* eslint-disable no-nested-ternary */ \n\nfunction _templateObject() {\n var data = (0,_tagged_template_literal/* default */.Z)([\n \"\\n \",\n \"\\n \",\n \"\\n \",\n \"\\n\\n display: flex;\\n flex-direction: row;\\n width: fit-content;\\n border-radius: 4px;\\n\\n & > img {\\n padding-left: \",\n \"px;\\n }\\n\"\n ]);\n _templateObject = function _templateObject() {\n return data;\n };\n return data;\n}\nfunction _templateObject1() {\n var data = (0,_tagged_template_literal/* default */.Z)([\n \"\\n \",\n \"\\n \",\n \"\\n\\n display: flex;\\n\"\n ]);\n _templateObject1 = function _templateObject1() {\n return data;\n };\n return data;\n}\nfunction _templateObject2() {\n var data = (0,_tagged_template_literal/* default */.Z)([\n \"\\n \",\n \"\\n \",\n \"\\n \",\n \"\\n\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n text-transform: \",\n \";\\n\"\n ]);\n _templateObject2 = function _templateObject2() {\n return data;\n };\n return data;\n}\nfunction _templateObject3() {\n var data = (0,_tagged_template_literal/* default */.Z)([\n \"\\n text-decoration: none;\\n color: \",\n \";\\n\\n &:hover {\\n background: \",\n \";\\n }\\n\\n &:focus {\\n background: \",\n \";\\n }\\n\"\n ]);\n _templateObject3 = function _templateObject3() {\n return data;\n };\n return data;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Label = styled_components_browser_esm/* default.div.withConfig */.ZP.div.withConfig({\n componentId: \"sc-b2fe2b37-0\"\n})(_templateObject(), index_esm/* color */.$_, index_esm/* space */.Dh, index_esm/* flexbox */.GQ, (0,dist_index_esm/* themeGet */.R)(\"space.xs\"));\nvar Value = styled_components_browser_esm/* default.div.withConfig */.ZP.div.withConfig({\n componentId: \"sc-b2fe2b37-1\"\n})(_templateObject1(), index_esm/* color */.$_, index_esm/* space */.Dh);\nvar Text = styled_components_browser_esm/* default.p.withConfig */.ZP.p.withConfig({\n componentId: \"sc-b2fe2b37-2\"\n})(_templateObject2(), index_esm/* typography */.cp, index_esm/* color */.$_, index_esm/* space */.Dh, function(param) {\n var textTransform = param.textTransform;\n return textTransform || \"none\";\n});\nvar StyledLink = styled_components_browser_esm/* default.a.withConfig */.ZP.a.withConfig({\n componentId: \"sc-b2fe2b37-3\"\n})(_templateObject3(), (0,dist_index_esm/* themeGet */.R)(\"colors.primary_400\"), (0,dist_index_esm/* themeGet */.R)(\"colors.primary_500\"), (0,dist_index_esm/* themeGet */.R)(\"colors.primary_600\"));\nfunction ListViewTable(param) {\n var onButtonClick = param.onButtonClick, buttonLabel = param.buttonLabel, dataType = param.dataType, dateFrom = param.dateFrom, dateTo = param.dateTo, dateRange = param.dateRange, filters = param.filters, terms = param.terms, compare = param.compare, size = param.size, reloadChecked = param.reloadChecked;\n var dispatch = (0,es/* useDispatch */.I0)();\n // eslint-disable-next-line no-unused-vars\n var ref = (0,react.useState)(100), pageSize = ref[0], setPageSize = ref[1];\n var ref1 = (0,react.useState)(null), queriedKey = ref1[0], setQueriedKey = ref1[1];\n var isWaiting = (0,es/* useSelector */.v9)(function(state) {\n return state.aggr;\n }).isWaiting;\n var units = (0,es/* useSelector */.v9)(function(state) {\n return aggregated_units(state, queriedKey);\n });\n var ref2 = (0,es/* useSelector */.v9)(function(state) {\n return state.config;\n }), currency = ref2.currency, languageCode = ref2.languageCode;\n var analytics_type = (0,es/* useSelector */.v9)(function(state) {\n return state.profile.payload;\n }).analytics_type;\n var term = \"isbn\";\n var handleAddIsbnFilter = (0,react.useCallback)(function(isbn) {\n if (isbn) {\n dispatch((0,action_filters/* changeOthersFilter */.Ao)((0,_define_property/* default */.Z)({}, JSON.stringify(\"isbn-\".concat(isbn)), {\n type: \"isbn\",\n label: isbn,\n value: \"isbn=\".concat(isbn),\n color: \"lime_300\"\n })));\n }\n }, [\n dispatch\n ]);\n (0,react.useEffect)(function() {\n if (!dataType || !dateTo || !dateFrom) return;\n var include = \"cover_link,title,isbn,item_type,price_eur,price_usd,country,publisher,item_type,language,date_publisher,authors,main_category,store_name,platform_name,supplier,order_type,data_type,public_domain\";\n var query = \"currency=\".concat(currency, \"&dataType=\").concat(dataType, \"&term=\").concat(term, \"&size=\").concat(size || pageSize, \"&dateTo=\").concat(dateTo, \"&dateFrom=\").concat(dateFrom, \"&dateRange=\").concat(dateRange, \"&compare=\").concat(compare, \"&include=\").concat(include, \"&version=7&enterprise=\").concat(analytics_type || \"standard\");\n if (filters) {\n query = \"\".concat(query, \"&filters=\").concat(filters);\n }\n if (terms) {\n query = \"\".concat(query, \"&terms=\").concat(terms);\n }\n var key = base64_default().encode(query);\n setQueriedKey(key);\n dispatch((0,aggr/* getAggrRequest */.js)({\n term: term,\n size: 0,\n key: key,\n query: query,\n currency: currency\n }));\n }, [\n dispatch,\n currency,\n term,\n dateTo,\n dateFrom,\n dateRange,\n size,\n pageSize,\n dataType,\n filters,\n terms,\n compare,\n reloadChecked,\n analytics_type, \n ]);\n var columns = (0,react.useMemo)(function() {\n return [\n {\n title: translations/* default */.Z[languageCode].Cover,\n width: 110,\n dataIndex: \"cover\",\n key: \"cover\",\n fixed: \"left\",\n render: function(cover) {\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(\"img\", {\n src: cover ? (0,change_cover_url/* default */.Z)(cover) : \"/images/book.jpg\",\n alt: \"\",\n className: \"table-image\"\n });\n }\n },\n {\n title: translations/* default */.Z[languageCode].Title,\n width: 290,\n dataIndex: \"title\",\n sorter: false,\n key: \"title\",\n fixed: \"left\",\n ellipsis: {\n showTitle: true\n },\n render: function(text, record) {\n /*#__PURE__*/ return (0,jsx_runtime.jsxs)(\"div\", {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"display\",\n lineHeight: \"display\",\n fontWeight: \"700\",\n color: \"grey_600\",\n textAlign: \"left\",\n children: text\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsxs)(Label, {\n alignItems: \"center\",\n children: [\n record.item_id ? /*#__PURE__*/ (0,jsx_runtime.jsx)(StyledLink, {\n href: \"\".concat((company === null || company === void 0 ? void 0 : company.code) === \"SL_DE\" ? \"https://hub.bookrix.de\" : \"https://hub.streetlib.com\", \"/publish_items/\").concat(record.item_id),\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"display\",\n lineHeight: \"display\",\n fontWeight: \"normal\",\n textAlign: \"left\",\n children: record.isbn\n })\n }) : /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"display\",\n lineHeight: \"display\",\n fontWeight: \"normal\",\n textAlign: \"left\",\n children: record.isbn\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(btn_link/* default */.Z, {\n icon: /*#__PURE__*/ (0,jsx_runtime.jsx)(filter/* default */.Z, {}),\n onClick: function() {\n return handleAddIsbnFilter(record.isbn);\n },\n style: {\n height: \"30px\",\n width: \"36px\",\n minWidth: \"36px\"\n },\n title: \"Filter by this ISBN\"\n })\n ]\n })\n ]\n });\n }\n },\n {\n title: translations/* default */.Z[languageCode].Type,\n dataIndex: \"type\",\n key: \"item_type\",\n sorter: false,\n width: 120,\n render: function(text) {\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(Label, {\n px: \"xs\",\n py: \"xxs\",\n color: \"white\",\n bg: text === \"ebook\" ? \"blue_400\" : text === \"audiobook\" ? \"blue_500\" : \"blue_300\",\n children: text\n });\n }\n },\n {\n title: dataType === \"usage_data\" ? translations/* default */.Z[languageCode].hours : translations/* default */.Z[languageCode].Revenues,\n dataIndex: dataType === \"usage_data\" ? \"totalCurrentDuration\" : \"totalCurrentRevenues\",\n key: dataType === \"usage_data\" ? \"totalCurrentDuration\" : \"totalCurrentRevenues\",\n sorter: false,\n sortOrder: \"descend\",\n width: 150,\n render: function(text, record) {\n return /*#__PURE__*/ (0,jsx_runtime.jsxs)(\"div\", {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"display\",\n lineHeight: \"display\",\n fontWeight: \"500\",\n color: \"grey_400\",\n textAlign: \"left\",\n marginLeft: \"4px\",\n children: text\n }),\n dataType === \"usage_data\" ? /*#__PURE__*/ (0,jsx_runtime.jsx)(Value, {\n ml: \"xxs\",\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"label\",\n lineHeight: \"label\",\n fontWeight: \"bold\",\n color: record.percentTrend > 0 ? \"lime_400\" : record.percentTrend < 0 ? \"red_400\" : \"grey_600\",\n textAlign: \"left\",\n children: \"\".concat(record.percentTrend > 0 ? \"+\" : record.percentTrend < 0 ? \"-\" : \"\", \" \").concat(Math.abs(record.percentTrend), \"%\")\n })\n }) : /*#__PURE__*/ (0,jsx_runtime.jsx)(Value, {\n ml: \"xxs\",\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Text, {\n fontSize: \"label\",\n lineHeight: \"label\",\n fontWeight: \"bold\",\n color: record.percentEarning > 0 ? \"lime_400\" : record.percentEarning < 0 ? \"red_400\" : \"grey_600\",\n textAlign: \"left\",\n children: \"\".concat(record.percentEarning > 0 ? \"+\" : record.percentEarning < 0 ? \"-\" : \"\", \" \").concat(Math.abs(record.percentEarning), \"%\")\n })\n })\n ]\n });\n }\n },\n {\n title: dataType === \"usage_data\" ? translations/* default */.Z[languageCode].users : translations/* default */.Z[languageCode].Quantity,\n dataIndex: \"totalCurrentQuantity\",\n key: \"quantity\",\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true\n }\n },\n {\n title: translations/* default */.Z[languageCode].Language,\n dataIndex: \"language\",\n key: \"language.\".concat(languageCode),\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true\n }\n },\n {\n title: translations/* default */.Z[languageCode].Authors,\n dataIndex: \"authors\",\n key: \"authors\",\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true\n }\n },\n {\n title: translations/* default */.Z[languageCode].Genre,\n dataIndex: \"genre\",\n key: \"main_category.\".concat(languageCode),\n sorter: false,\n width: 200,\n ellipsis: {\n showTitle: true\n }\n },\n {\n title: translations/* default */.Z[languageCode].Publisher,\n dataIndex: \"publisher\",\n key: \"publisher\",\n sorter: false,\n width: 150,\n ellipsis: {\n showTitle: true\n }\n }, \n ];\n }, [\n languageCode,\n dataType,\n handleAddIsbnFilter\n ]);\n var handleClickTableBtn = (0,react.useCallback)(function() {\n if (onButtonClick) return onButtonClick();\n var csvData = units.map(function(unit) {\n return {\n Cover: unit.cover,\n Isbn: unit.isbn,\n Title: unit.title,\n Type: unit.type,\n Revenue: parseFloat(unit.totalCurrentRevenuesValue.toFixed(2), 2),\n Quantity: unit.totalCurrentQuantity,\n \"Previous Period Revenue\": parseFloat(unit.totalPreviousRevenuesValue.toFixed(2), 2),\n \"Previous Period Quantity\": unit.totalPreviousQuantity,\n Language: unit.language,\n Authors: unit.authors,\n Genre: unit.genre,\n Publisher: unit.publisher,\n \"Public Domain\": unit.publicDomain,\n \"Data Type\": unit.dataType\n };\n });\n var csv = papaparse_min_default().unparse(csvData);\n moment_default().locale(languageCode);\n return (0,create_download_link/* default */.Z)(csv, \"\".concat(moment_default()(dateFrom).format(\"DD MMM YYYY\"), \"-\").concat(moment_default()(dateTo).format(\"DD MMM YYYY\"), \".csv\"));\n }, [\n units,\n onButtonClick,\n dateFrom,\n dateTo,\n languageCode\n ]);\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(analytics/* default */.Z, {\n title: translations/* default */.Z[languageCode][\"list view\"],\n emptyLabel: translations/* default */.Z[languageCode][\"no available\"],\n buttonLabel: buttonLabel,\n onButtonClick: handleClickTableBtn,\n totalLabel: translations/* default */.Z[languageCode][\"showing aggs\"],\n columns: columns,\n dataSource: units,\n pagination: false,\n onChangeTable: function() {\n return null;\n },\n loading: isWaiting\n });\n}\n/* harmony default export */ var list_view_table = (ListViewTable);\n\n\n/***/ }),\n\n/***/ 3906:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n/* harmony import */ var _swc_helpers_src_tagged_template_literal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7297);\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85893);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67294);\n/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14141);\n/* harmony import */ var _styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50056);\n/* harmony import */ var theme_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5799);\n/* harmony import */ var theme_buttons_btn_border__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9246);\n/* harmony import */ var _default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72544);\n\nfunction _templateObject() {\n var data = (0,_swc_helpers_src_tagged_template_literal_mjs__WEBPACK_IMPORTED_MODULE_0__/* [\"default\"] */ .Z)([\n \"\\n background-color: \",\n \";\\n border: 2px solid \",\n \";\\n border-radius: 12px;\\n\\n & > .table-head {\\n height: 88px;\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n justify-content: space-between;\\n border-bottom: 2px solid \",\n \";\\n padding: 0 \",\n \"px;\\n }\\n\"\n ]);\n _templateObject = function _templateObject() {\n return data;\n };\n return data;\n}\n\n\n\n\n\n\n\nvar Wrapper = styled_components__WEBPACK_IMPORTED_MODULE_7__/* [\"default\"].div.withConfig */ .ZP.div.withConfig({\n componentId: \"sc-a2fd75c1-0\"\n})(_templateObject(), (0,_styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__/* .themeGet */ .R)(\"colors.white\"), (0,_styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__/* .themeGet */ .R)(\"colors.primary_100\"), (0,_styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__/* .themeGet */ .R)(\"colors.primary_100\"), (0,_styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__/* .themeGet */ .R)(\"space.s\"));\nfunction AnalyticsTable(param) {\n var emptyLabel = param.emptyLabel, buttonLabel = param.buttonLabel, totalLabel = param.totalLabel, title = param.title, onChangeTable = param.onChangeTable, total = param.total, dataSource = param.dataSource, columns = param.columns, pagination = param.pagination, onButtonClick = param.onButtonClick, onSecondaryButtonClick = param.onSecondaryButtonClick, secondaryButton = param.secondaryButton, secondaryButtonLabel = param.secondaryButtonLabel, loading = param.loading, buttonDisabled = param.buttonDisabled;\n return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(Wrapper, {\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"div\", {\n className: \"table-head\",\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"div\", {\n className: \"left\",\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(theme_text__WEBPACK_IMPORTED_MODULE_4__/* [\"default\"] */ .Z, {\n fontSize: \"h2\",\n lineHeight: \"h2\",\n fontWeight: \"bold\",\n color: \"grey_600\",\n children: title\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(theme_text__WEBPACK_IMPORTED_MODULE_4__/* [\"default\"] */ .Z, {\n fontSize: \"pLarge\",\n lineHeight: \"pLarge\",\n fontWeight: \"normal\",\n color: \"grey_400\",\n children: \"\".concat(totalLabel, \" \").concat(total || \"\")\n })\n ]\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"div\", {\n className: \"right\",\n children: [\n secondaryButton && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(theme_buttons_btn_border__WEBPACK_IMPORTED_MODULE_5__/* [\"default\"] */ .Z, {\n onClick: function() {\n return onSecondaryButtonClick(secondaryButton);\n },\n style: {\n minWidth: \"48px\",\n height: \"48px\",\n p: 0,\n mr: \"s\"\n },\n type: \"button\",\n label: secondaryButtonLabel\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(theme_buttons_btn_border__WEBPACK_IMPORTED_MODULE_5__/* [\"default\"] */ .Z, {\n onClick: onButtonClick,\n style: {\n minWidth: \"48px\",\n height: \"48px\",\n p: 0\n },\n type: \"button\",\n label: buttonLabel,\n disabled: buttonDisabled\n })\n ]\n })\n ]\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_default__WEBPACK_IMPORTED_MODULE_6__/* [\"default\"] */ .Z, {\n emptyLabel: emptyLabel,\n onChangeTable: onChangeTable,\n dataSource: dataSource,\n columns: columns,\n pagination: pagination,\n loading: loading\n })\n ]\n });\n}\n/* harmony default export */ __webpack_exports__[\"Z\"] = (AnalyticsTable);\n\n\n/***/ })\n\n}]);"],"names":["self","push","__unused_webpack_module","__webpack_exports__","__webpack_require__","d","list_view_table","_define_property","_tagged_template_literal","jsx_runtime","react","styled_components_browser_esm","index_esm","dist_index_esm","base64","base64_default","n","moment","moment_default","papaparse_min","papaparse_min_default","es","action_filters","aggr","reselect_es","format_currency","translations","config","selectPayloadByKey","P1","state","payload","_","key","selectAggregatedUnits","ZP","data","languageCode","currency","query","buckets","_aggregations","aggregations","results","isUsage","includes","currentTotal","durationTotal","forEach","_current_period","current_period","value","total_revenues","valueDuration","_total_duration","total_duration","map","ref","ref1","isbn","previous_period","include","totalCurrentRevenues","Z","totalPreviousRevenues","totalCurrentDuration","concat","parseFloat","toFixed","hours","totalPreviousDuration","percentEarning","Math","round","percentTrend","percent","percentDuration","__source","unitData","hits","_source","title","language","authors","main_category","cover_link","publisher","item_type","supplier","data_type","public_domain","reading_minutes","capitalAuthors","length","author","capitalName","split","name","charAt","toUpperCase","slice","join","totalCurrentRevenuesValue","totalPreviousRevenuesValue","totalCurrentDoc","doc_count","totalCurrentQuantity","total_quantity","totalPreviousQuantity","totalCurrentDurationValue","cover","type","dataType","publicDomain","itemType","genre","sort","a","b","reverse","analytics","btn_link","filter","change_cover_url","create_download_link","_templateObject","_templateObject1","_templateObject2","_templateObject3","Label","div","withConfig","componentId","$_","Dh","GQ","R","Value","Text","p","cp","param","textTransform","StyledLink","onButtonClick","buttonLabel","dateFrom","dateTo","dateRange","filters","terms","compare","size","reloadChecked","dispatch","I0","useState","pageSize","queriedKey","setQueriedKey","isWaiting","v9","units","aggregated_units","ref2","analytics_type","profile","term","handleAddIsbnFilter","useCallback","Ao","JSON","stringify","label","color","useEffect","encode","js","columns","useMemo","Cover","width","dataIndex","fixed","render","jsx","src","alt","className","Title","sorter","ellipsis","showTitle","text","record","jsxs","children","fontSize","lineHeight","fontWeight","textAlign","alignItems","item_id","href","company","code","icon","onClick","style","height","minWidth","Type","px","py","bg","Revenues","sortOrder","marginLeft","ml","abs","users","Quantity","Language","Authors","Genre","Publisher","handleClickTableBtn","csvData","unit","Isbn","Revenue","csv","unparse","locale","format","emptyLabel","totalLabel","dataSource","pagination","onChangeTable","loading","_swc_helpers_src_tagged_template_literal_mjs__WEBPACK_IMPORTED_MODULE_0__","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__","styled_components__WEBPACK_IMPORTED_MODULE_7__","_styled_system_theme_get__WEBPACK_IMPORTED_MODULE_3__","theme_text__WEBPACK_IMPORTED_MODULE_4__","theme_buttons_btn_border__WEBPACK_IMPORTED_MODULE_5__","_default__WEBPACK_IMPORTED_MODULE_6__","Wrapper","total","onSecondaryButtonClick","secondaryButton","secondaryButtonLabel","buttonDisabled","mr","disabled"],"sourceRoot":""}