swh.web 0.14.2__py3-none-any.whl → 0.15.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swh/web/alter/forms.py +16 -16
- swh/web/alter/templates/admin_alteration.html +5 -5
- swh/web/alter/templates/alteration_details.html +2 -2
- swh/web/alter/templates/assistant_category.html +21 -19
- swh/web/alter/templates/assistant_email.html +3 -4
- swh/web/alter/templates/assistant_origins.html +1 -2
- swh/web/alter/templates/assistant_reasons.html +1 -2
- swh/web/alter/templates/assistant_summary.html +3 -4
- swh/web/alter/templates/content_policies.html +8 -15
- swh/web/alter/templates/includes/swh_legal.html +1 -1
- swh/web/alter/tests/test_views.py +2 -2
- swh/web/alter/urls.py +1 -1
- swh/web/alter/views.py +2 -2
- swh/web/browse/assets/browse/browse.css +10 -0
- swh/web/browse/assets/browse/sidetabs.js +22 -2
- swh/web/browse/templates/includes/sidetabs.html +20 -16
- swh/web/browse/templates/includes/snapshot-context.html +3 -1
- swh/web/save_code_now/templates/includes/take-new-snapshot.html +1 -1
- swh/web/static/css/browse.0a250d3b07ce628588a5.css +2 -0
- swh/web/static/css/browse.0a250d3b07ce628588a5.css.map +1 -0
- swh/web/static/js/add_forge_now.f8fa8235350a7875b4b2.js.map +1 -1
- swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js +3 -0
- swh/web/static/js/{archive_coverage.b37e2158e800bc69180b.js.LICENSE.txt → archive_coverage.71f6961fbdc0d76c313b.js.LICENSE.txt} +1 -1
- swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js.map +1 -0
- swh/web/static/js/auth.971392ebe3f22c222189.js.map +1 -1
- swh/web/static/js/{browse.b150f8992236375f2e9b.js → browse.d5014e5cae44a2cd3e6e.js} +3 -3
- swh/web/static/js/browse.d5014e5cae44a2cd3e6e.js.map +1 -0
- swh/web/static/js/deposit.060ba94288f399dfe89e.js.map +1 -1
- swh/web/static/js/guided_tour.3a7a41181c43663f866b.js.map +1 -1
- swh/web/static/js/highlightjs.19cb5fa8879fdc8357d7.js.map +1 -1
- swh/web/static/js/mailmap.5dc62b52b8eb18e2e8b0.js.map +1 -1
- swh/web/static/js/origin_visits.679992a2a951f67a08bc.js.map +1 -1
- swh/web/static/js/pdf.worker.min.js +1 -1
- swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js +3 -0
- swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js.map +1 -0
- swh/web/static/js/revision.c5f4750ef7caee355fd9.js.map +1 -1
- swh/web/static/js/save_code_now.3db9c75765eb44fe774a.js.map +1 -1
- swh/web/static/js/showdown.8be01722fe56f5a7c2db.js.map +1 -1
- swh/web/static/js/vault.8c6e8e445d128eb30488.js.map +1 -1
- swh/web/static/js/{vendors.076b42bbe0326fc632ae.js → vendors.532425b092b95d43a1d6.js} +3 -3
- swh/web/static/js/vendors.532425b092b95d43a1d6.js.map +1 -0
- swh/web/static/js/webapp.5427bd8b32cec7de0951.js +3 -0
- swh/web/static/js/{webapp.ec7025df24c9f358f1cc.js.LICENSE.txt → webapp.5427bd8b32cec7de0951.js.LICENSE.txt} +1 -1
- swh/web/static/js/webapp.5427bd8b32cec7de0951.js.map +1 -0
- swh/web/static/jssources/@iframe-resizer/child/index.umd.js +2 -2
- swh/web/static/jssources/@iframe-resizer/parent/index.umd.js +2 -2
- swh/web/static/jssources/core-js/internals/array-to-reversed.js +2 -2
- swh/web/static/jssources/core-js/internals/array-with.js +2 -2
- swh/web/static/jssources/core-js/internals/async-iterator-iteration.js +6 -1
- swh/web/static/jssources/core-js/internals/flatten-into-array.js +1 -1
- swh/web/static/jssources/core-js/internals/get-iterator-direct.js +1 -1
- swh/web/static/jssources/core-js/internals/install-error-cause.js +1 -1
- swh/web/static/jssources/core-js/internals/iterator-create-proxy.js +1 -1
- swh/web/static/jssources/core-js/internals/set-difference.js +1 -1
- swh/web/static/jssources/core-js/internals/set-intersection.js +1 -1
- swh/web/static/jssources/core-js/internals/set-is-disjoint-from.js +1 -1
- swh/web/static/jssources/core-js/internals/set-is-subset-of.js +1 -1
- swh/web/static/jssources/core-js/internals/set-is-superset-of.js +1 -1
- swh/web/static/jssources/core-js/internals/set-method-get-keys-before-cloning-detection.js +1 -1
- swh/web/static/jssources/core-js/internals/set-symmetric-difference.js +1 -1
- swh/web/static/jssources/core-js/internals/set-union.js +1 -1
- swh/web/static/jssources/core-js/internals/shared-store.js +2 -2
- swh/web/static/jssources/core-js/internals/string-pad.js +0 -1
- swh/web/static/jssources/core-js/modules/es.array-buffer.transfer-to-fixed-length.js +1 -1
- swh/web/static/jssources/core-js/modules/es.array-buffer.transfer.js +1 -1
- swh/web/static/jssources/core-js/modules/es.error.is-error.js +1 -1
- swh/web/static/jssources/core-js/modules/es.symbol.constructor.js +1 -1
- swh/web/static/jssources/jslicenses.json +1 -1
- swh/web/static/jssources/pdfjs-dist/build/pdf.worker.mjs +299 -13
- swh/web/static/jssources/pdfjs-dist/legacy/build/pdf.mjs +492 -113
- swh/web/static/jssources/swh/web/browse/assets/browse/sidetabs.js +22 -2
- swh/web/static/jssources/swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
- swh/web/static/webpack-stats.json +73 -73
- swh/web/utils/archive.py +12 -0
- swh/web/utils/tests/test_archive.py +32 -15
- swh/web/vault/templates/includes/vault-common.html +1 -1
- swh/web/vault/templates/includes/vault-create-tasks.html +5 -5
- swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
- swh/web/webapp/templates/includes/footer.html +1 -1
- swh/web/webapp/templates/includes/global-modals.html +3 -3
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/METADATA +1 -1
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/RECORD +89 -89
- swh/web/static/css/browse.5775e0a313f4ccb8aef5.css +0 -2
- swh/web/static/css/browse.5775e0a313f4ccb8aef5.css.map +0 -1
- swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js +0 -3
- swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js.map +0 -1
- swh/web/static/js/browse.b150f8992236375f2e9b.js.map +0 -1
- swh/web/static/js/pdfjs.ca88359f90430972e38c.js +0 -3
- swh/web/static/js/pdfjs.ca88359f90430972e38c.js.map +0 -1
- swh/web/static/js/vendors.076b42bbe0326fc632ae.js.map +0 -1
- swh/web/static/js/webapp.ec7025df24c9f358f1cc.js +0 -3
- swh/web/static/js/webapp.ec7025df24c9f358f1cc.js.map +0 -1
- /swh/web/static/js/{browse.b150f8992236375f2e9b.js.LICENSE.txt → browse.d5014e5cae44a2cd3e6e.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{pdfjs.ca88359f90430972e38c.js.LICENSE.txt → pdfjs.97ecbde9d93314dba75a.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{vendors.076b42bbe0326fc632ae.js.LICENSE.txt → vendors.532425b092b95d43a1d6.js.LICENSE.txt} +0 -0
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/WHEEL +0 -0
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/AUTHORS +0 -0
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/LICENSE +0 -0
- {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/origin_visits.679992a2a951f67a08bc.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAa,IAAID,KAEjBD,EAAU,IAAIA,EAAU,KAAK,CAAC,EAAGA,EAAU,IAAiB,cAAIC,IACjE,CATD,CASGK,MAAM,WACT,sBCVIC,EACAC,yBCDJ,IAAIC,EAAc,EAAQ,OACtBC,EAA2B,EAAQ,OAIvCP,EAAOD,QAHP,SAA8BS,EAAGC,EAAGC,E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,EAAY7b,IAAyB,SAAfA,EAAMyR,KAAkB,UAAYzR,EAAMyR,MAChEqK,EAAU9b,GAASA,EAAM2D,QAAU3D,EAAM2D,OAAOoX,IACpDa,EAAMG,QAAU,iBAAmB7B,EAAU,cAAgB2B,EAAY,KAAOC,EAAU,IAC1FF,EAAMrjB,KAAO,iBACbqjB,EAAMnK,KAAOoK,EACbD,EAAMI,QAAUF,EAChBL,EAAmB,GAAGG,EACvB,CAEF,GACyC,SAAW1B,EAASA,EAE/D,CAEH,EAaA,IAAI+B,EAAuB,SAASC,EAA4Btc,GAC/D,IAKIga,EAAUM,EALViC,EAAWvc,EAAK,GAChBwc,EAAcxc,EAAK,GACnB0X,EAAU1X,EAAK,GAGIzD,EAAI,EAC3B,GAAGggB,EAAShJ,MAAK,SAASkJ,GAAM,OAA+B,IAAxBd,EAAgBc,EAAW,IAAI,CACrE,IAAIzC,KAAYwC,EACZzC,EAAoB1iB,EAAEmlB,EAAaxC,KACrCD,EAAoBzhB,EAAE0hB,GAAYwC,EAAYxC,IAGhD,GAAGtC,EAAsBA,EAAQqC,EAClC,CAEA,IADGuC,GAA4BA,EAA2Btc,GACrDzD,EAAIggB,EAAS3kB,OAAQ2E,IACzB+d,EAAUiC,EAAShgB,GAChBwd,EAAoB1iB,EAAEskB,EAAiBrB,IAAYqB,EAAgBrB,IACrEqB,EAAgBrB,GAAS,KAE1BqB,EAAgBrB,GAAW,CAG7B,EAEIoC,EAAqB7lB,KAAsB,gBAAIA,KAAsB,iBAAK,GAC9E6lB,EAAmBxd,QAAQmd,EAAqB3Z,KAAK,KAAM,IAC3Dga,EAAmBtd,KAAOid,EAAqB3Z,KAAK,KAAMga,EAAmBtd,KAAKsD,KAAKga","sources":["webpack://swh/webpack/universalModuleDefinition","webpack://swh/webpack/runtime/load script","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorKeys.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-histogram.js","webpack://swh/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js","webpack://swh/./node_modules/@babel/runtime/helpers/regenerator.js","webpack://swh/./swh/web/browse/assets/origin_visits/utils.js","webpack://swh/./node_modules/@babel/runtime/helpers/OverloadYield.js","webpack://swh/./node_modules/js-year-calendar/dist/js-year-calendar.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorValues.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-reporting.js","webpack://swh/./node_modules/hex-rgb/index.js","webpack://swh/./node_modules/@babel/runtime/regenerator/index.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsync.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-calendar.js","webpack://swh/./node_modules/@babel/runtime/helpers/typeof.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorDefine.js","webpack://swh/webpack/bootstrap","webpack://swh/webpack/runtime/compat get default export","webpack://swh/webpack/runtime/define property getters","webpack://swh/webpack/runtime/ensure chunk","webpack://swh/webpack/runtime/get javascript chunk filename","webpack://swh/webpack/runtime/get mini-css chunk filename","webpack://swh/webpack/runtime/hasOwnProperty shorthand","webpack://swh/webpack/runtime/make namespace object","webpack://swh/webpack/runtime/publicPath","webpack://swh/webpack/runtime/jsonp chunk loading"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"swh\"] = factory();\n\telse\n\t\troot[\"swh\"] = root[\"swh\"] || {}, root[\"swh\"][\"origin_visits\"] = factory();\n})(self, function() {\nreturn ","var inProgress = {};\nvar dataWebpackPrefix = \"swh:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var regenerator = require(\"./regenerator.js\");\nvar regeneratorAsyncIterator = require(\"./regeneratorAsyncIterator.js\");\nfunction _regeneratorAsyncGen(r, e, t, o, n) {\n return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);\n}\nmodule.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _regeneratorKeys(e) {\n var n = Object(e),\n r = [];\n for (var t in n) r.unshift(t);\n return function e() {\n for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;\n return e.done = !0, e;\n };\n}\nmodule.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var OverloadYield = require(\"./OverloadYield.js\");\nvar regenerator = require(\"./regenerator.js\");\nvar regeneratorAsync = require(\"./regeneratorAsync.js\");\nvar regeneratorAsyncGen = require(\"./regeneratorAsyncGen.js\");\nvar regeneratorAsyncIterator = require(\"./regeneratorAsyncIterator.js\");\nvar regeneratorKeys = require(\"./regeneratorKeys.js\");\nvar regeneratorValues = require(\"./regeneratorValues.js\");\nfunction _regeneratorRuntime() {\n \"use strict\";\n\n var r = regenerator(),\n e = r.m(_regeneratorRuntime),\n t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;\n function n(r) {\n var e = \"function\" == typeof r && r.constructor;\n return !!e && (e === t || \"GeneratorFunction\" === (e.displayName || e.name));\n }\n var o = {\n \"throw\": 1,\n \"return\": 2,\n \"break\": 3,\n \"continue\": 3\n };\n function a(r) {\n var e, t;\n return function (n) {\n e || (e = {\n stop: function stop() {\n return t(n.a, 2);\n },\n \"catch\": function _catch() {\n return n.v;\n },\n abrupt: function abrupt(r, e) {\n return t(n.a, o[r], e);\n },\n delegateYield: function delegateYield(r, o, a) {\n return e.resultName = o, t(n.d, regeneratorValues(r), a);\n },\n finish: function finish(r) {\n return t(n.f, r);\n }\n }, t = function t(r, _t, o) {\n n.p = e.prev, n.n = e.next;\n try {\n return r(_t, o);\n } finally {\n e.next = n.n;\n }\n }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;\n try {\n return r.call(this, e);\n } finally {\n n.p = e.prev, n.n = e.next;\n }\n };\n }\n return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return {\n wrap: function wrap(e, t, n, o) {\n return r.w(a(e), t, n, o && o.reverse());\n },\n isGeneratorFunction: n,\n mark: r.m,\n awrap: function awrap(r, e) {\n return new OverloadYield(r, e);\n },\n AsyncIterator: regeneratorAsyncIterator,\n async: function async(r, e, t, o, u) {\n return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);\n },\n keys: regeneratorKeys,\n values: regeneratorValues\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2022 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\n// Creation of a stacked histogram with D3.js for software origin visits history\n// Parameters description:\n// - container: selector for the div that will contain the histogram\n// - visitsData: raw swh origin visits data\n// - currentYear: the visits year to display by default\n// - yearClickCallback: callback when the user selects a year through the histogram\n\nimport {visitStatusColor} from './utils';\n\nexport async function createVisitsHistogram(container, visitsData, currentYear, yearClickCallback) {\n\n const d3 = await import(/* webpackChunkName: \"d3\" */ 'utils/d3');\n\n // remove previously created histogram and tooltip if any\n d3.select(container).select('svg').remove();\n d3.select('div.d3-tooltip').remove();\n\n // histogram size and margins\n let width = 1000;\n let height = 200;\n const margin = {top: 20, right: 80, bottom: 30, left: 50};\n\n // create responsive svg\n const svg = d3.select(container)\n .attr('style',\n 'padding-bottom: ' + Math.ceil(height * 100 / width) + '%')\n .append('svg')\n .attr('viewBox', '0 0 ' + width + ' ' + height);\n\n // create tooltip div\n const tooltip = d3.select('body')\n .append('div')\n .attr('class', 'd3-tooltip')\n .style('opacity', 0);\n\n // update width and height without margins\n width = width - margin.left - margin.right;\n height = height - margin.top - margin.bottom;\n\n // create main svg group element\n const g = svg.append('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n // create x scale\n const x = d3.scaleTime().rangeRound([0, width]);\n\n // create y scale\n const y = d3.scaleLinear().range([height, 0]);\n\n // create ordinal colorscale mapping visit status\n const colors = d3.scaleOrdinal()\n .domain(Object.keys(visitStatusColor))\n .range(Object.values(visitStatusColor));\n\n // first swh crawls were made in 2015\n const startYear = 2015;\n // set latest display year as the current one\n const now = new Date();\n const endYear = now.getUTCFullYear() + 1;\n const monthExtent = [new Date(Date.UTC(startYear, 0, 1)), new Date(Date.UTC(endYear, 0, 1))];\n\n // create months bins based on setup extent\n const monthBins = d3.timeMonths(d3.timeMonth.offset(monthExtent[0], -1), monthExtent[1]);\n // create years bins based on setup extent\n const yearBins = d3.timeYears(monthExtent[0], monthExtent[1]);\n\n // set x scale domain\n x.domain(d3.extent(monthBins));\n\n // use D3 histogram layout to create a function that will bin the visits by month\n const binByMonth = d3.histogram()\n .value(d => d.date)\n .domain(x.domain())\n .thresholds(monthBins);\n\n // use D3 nest function to group the visits by status\n const visitsByStatus = d3.groups(visitsData, d => d['status'])\n .sort((a, b) => d3.ascending(a[0], b[0]));\n\n // prepare data in order to be able to stack visit statuses by month\n const statuses = [];\n const histData = [];\n for (let i = 0; i < monthBins.length; ++i) {\n histData[i] = {};\n }\n visitsByStatus.forEach(entry => {\n statuses.push(entry[0]);\n const monthsData = binByMonth(entry[1]);\n for (let i = 0; i < monthsData.length; ++i) {\n histData[i]['x0'] = monthsData[i]['x0'];\n histData[i]['x1'] = monthsData[i]['x1'];\n histData[i][entry[0]] = monthsData[i];\n }\n });\n\n // create function to stack visits statuses by month\n const stacked = d3.stack()\n .keys(statuses)\n .value((d, key) => d[key].length);\n\n // compute the maximum amount of visits by month\n const yMax = d3.max(histData, d => {\n let total = 0;\n for (let i = 0; i < statuses.length; ++i) {\n total += d[statuses[i]].length;\n }\n return total;\n });\n\n // set y scale domain\n y.domain([0, yMax]);\n\n // compute ticks values for the y axis (at most 8 ticks)\n const step = Math.floor(yMax / 8) + 1;\n const yTickValues = [];\n for (let i = 0; i <= yMax / step; ++i) {\n yTickValues.push(i * step);\n }\n if (yTickValues.length === 0) {\n for (let i = 0; i <= yMax; ++i) {\n yTickValues.push(i);\n }\n } else if (yMax % step !== 0) {\n yTickValues.push(yMax);\n }\n\n // add histogram background grid\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y)\n .tickValues(yTickValues)\n .tickSize(-width)\n .tickFormat(''));\n\n // create one fill only rectangle by displayed year\n // each rectangle will be made visible when hovering the mouse over a year range\n // user will then be able to select a year by clicking in the rectangle\n\n g.append('g')\n .selectAll('rect')\n .data(yearBins)\n .enter().append('rect')\n .attr('class', d => 'year' + d.getUTCFullYear())\n .attr('fill', 'red')\n .attr('fill-opacity', d => d.getUTCFullYear() === currentYear ? 0.3 : 0)\n .attr('stroke', 'none')\n .attr('x', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return x(date);\n })\n .attr('y', 0)\n .attr('height', height)\n .attr('width', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return yearWidth;\n })\n // mouse event callbacks used to show rectangle years\n // when hovering the mouse over the histograms\n .on('mouseover', (event, d) => {\n svg.selectAll('rect.year' + d.getUTCFullYear())\n .attr('fill-opacity', 0.5);\n })\n .on('mouseout', (event, d) => {\n svg.selectAll('rect.year' + d.getUTCFullYear())\n .attr('fill-opacity', 0);\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.3);\n })\n // callback to select a year after a mouse click\n // in a rectangle year\n .on('click', (event, d) => {\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'none');\n currentYear = d.getUTCFullYear();\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.5);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'black');\n yearClickCallback(currentYear);\n });\n\n // create the stacked histogram of visits\n g.append('g')\n .selectAll('g')\n .data(stacked(histData))\n .enter().append('g')\n .attr('fill', d => colors(d.key))\n .selectAll('rect')\n .data(d => d)\n .enter().append('rect')\n .attr('class', d => 'month' + d.data.x1.getMonth())\n .attr('x', d => x(d.data.x0))\n .attr('y', d => y(d[1]))\n .attr('height', d => y(d[0]) - y(d[1]))\n .attr('width', d => x(d.data.x1) - x(d.data.x0) - 1)\n // mouse event callbacks used to show rectangle years\n // but also to show tooltip when hovering the mouse\n // over the histogram bars\n .on('mouseover', (event, d) => {\n svg.selectAll('rect.year' + d.data.x1.getUTCFullYear())\n .attr('fill-opacity', 0.5);\n tooltip.transition()\n .duration(200)\n .style('opacity', 1);\n const ds = d.data.x1.toISOString().substr(0, 7).split('-');\n let tooltipText = '<b>' + ds[1] + ' / ' + ds[0] + ':</b><br/>';\n for (let i = 0; i < statuses.length; ++i) {\n const visitStatus = statuses[i];\n const nbVisits = d.data[visitStatus].length;\n if (nbVisits === 0) continue;\n tooltipText += nbVisits + ' ' + visitStatus + ' visits';\n if (i !== statuses.length - 1) tooltipText += '<br/>';\n }\n tooltip.html(tooltipText)\n .style('left', event.pageX + 15 + 'px')\n .style('top', event.pageY + 'px');\n })\n .on('mouseout', (event, d) => {\n svg.selectAll('rect.year' + d.data.x1.getUTCFullYear())\n .attr('fill-opacity', 0);\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.3);\n tooltip.transition()\n .duration(500)\n .style('opacity', 0);\n })\n .on('mousemove', (event) => {\n tooltip.style('left', event.pageX + 15 + 'px')\n .style('top', event.pageY + 'px');\n })\n // callback to select a year after a mouse click\n // inside a histogram bar\n .on('click', (event, d) => {\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'none');\n currentYear = d.data.x1.getUTCFullYear();\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.5);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'black');\n yearClickCallback(currentYear);\n });\n\n // create one stroke only rectangle by displayed year\n // that will be displayed on top of the histogram when the user has selected a year\n g.append('g')\n .selectAll('rect')\n .data(yearBins)\n .enter().append('rect')\n .attr('class', d => 'yearoutline' + d.getUTCFullYear())\n .attr('fill', 'none')\n .attr('stroke', d => d.getUTCFullYear() === currentYear ? 'black' : 'none')\n .attr('x', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return x(date);\n })\n .attr('y', 0)\n .attr('height', height)\n .attr('width', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return yearWidth;\n });\n\n // add x axis with a tick for every 1st day of each year\n const xAxis = g.append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(\n d3.axisBottom(x)\n .ticks(d3.timeYear.every(1))\n .tickFormat(d => {\n const year = d.getUTCFullYear();\n if (year >= startYear) {\n return year;\n } else {\n // filter out 2014 tick label\n return '';\n }\n })\n );\n\n // shift tick labels in order to display them at the middle\n // of each year range\n xAxis.selectAll('text')\n .attr('transform', d => {\n const year = d.getUTCFullYear();\n const date = new Date(Date.UTC(year, 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return 'translate(' + -yearWidth / 2 + ', 0)';\n });\n\n // add y axis for the number of visits\n g.append('g')\n .attr('class', 'axis')\n .call(d3.axisLeft(y).tickValues(yTickValues));\n\n // add legend for visit statuses\n const legendGroup = g.append('g')\n .attr('font-family', 'sans-serif')\n .attr('font-size', 10)\n .attr('text-anchor', 'end');\n\n legendGroup.append('text')\n .attr('x', width + margin.right - 5)\n .attr('y', 9.5)\n .attr('dy', '0.32em')\n .text('visit status:');\n\n const legend = legendGroup.selectAll('g')\n .data(statuses.slice().reverse())\n .enter().append('g')\n .attr('transform', (d, i) => 'translate(0,' + (i + 1) * 20 + ')');\n\n legend.append('rect')\n .attr('x', width + 2 * margin.right / 3)\n .attr('width', 19)\n .attr('height', 19)\n .attr('fill', colors);\n\n legend.append('text')\n .attr('x', width + 2 * margin.right / 3 - 5)\n .attr('y', 9.5)\n .attr('dy', '0.32em')\n .text(d => d);\n\n // add text label for the y axis\n g.append('text')\n .attr('transform', 'rotate(-90)')\n .attr('y', -margin.left)\n .attr('x', -(height / 2))\n .attr('dy', '1em')\n .style('text-anchor', 'middle')\n .text('Number of visits');\n}\n","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","var OverloadYield = require(\"./OverloadYield.js\");\nvar regeneratorDefine = require(\"./regeneratorDefine.js\");\nfunction AsyncIterator(t, e) {\n function n(r, o, i, f) {\n try {\n var c = t[r](o),\n u = c.value;\n return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {\n n(\"next\", t, i, f);\n }, function (t) {\n n(\"throw\", t, i, f);\n }) : e.resolve(u).then(function (t) {\n c.value = t, i(c);\n }, function (t) {\n return n(\"throw\", t, i, f);\n });\n } catch (t) {\n f(t);\n }\n }\n var r;\n this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, \"function\" == typeof Symbol && Symbol.asyncIterator || \"@asyncIterator\", function () {\n return this;\n })), regeneratorDefine(this, \"_invoke\", function (t, o, i) {\n function f() {\n return new e(function (e, r) {\n n(t, i, e, r);\n });\n }\n return r = r ? r.then(f, f) : f();\n }, !0);\n}\nmodule.exports = AsyncIterator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var regeneratorDefine = require(\"./regeneratorDefine.js\");\nfunction _regenerator() {\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\n var e,\n t,\n r = \"function\" == typeof Symbol ? Symbol : {},\n n = r.iterator || \"@@iterator\",\n o = r.toStringTag || \"@@toStringTag\";\n function i(r, n, o, i) {\n var c = n && n.prototype instanceof Generator ? n : Generator,\n u = Object.create(c.prototype);\n return regeneratorDefine(u, \"_invoke\", function (r, n, o) {\n var i,\n c,\n u,\n f = 0,\n p = o || [],\n y = !1,\n G = {\n p: 0,\n n: 0,\n v: e,\n a: d,\n f: d.bind(e, 4),\n d: function d(t, r) {\n return i = t, c = 0, u = e, G.n = r, a;\n }\n };\n function d(r, n) {\n for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {\n var o,\n i = p[t],\n d = G.p,\n l = i[2];\n r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));\n }\n if (o || r > 1) return a;\n throw y = !0, n;\n }\n return function (o, p, l) {\n if (f > 1) throw TypeError(\"Generator is already running\");\n for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {\n i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);\n try {\n if (f = 2, i) {\n if (c || (o = \"next\"), t = i[o]) {\n if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\");\n if (!t.done) return t;\n u = t.value, c < 2 && (c = 0);\n } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1);\n i = e;\n } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;\n } catch (t) {\n i = e, c = 1, u = t;\n } finally {\n f = 1;\n }\n }\n return {\n value: t,\n done: y\n };\n };\n }(r, o, i), !0), u;\n }\n var a = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n t = Object.getPrototypeOf;\n var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {\n return this;\n }), t),\n u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);\n function f(e) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e;\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, \"constructor\", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", regeneratorDefine(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), regeneratorDefine(u), regeneratorDefine(u, o, \"Generator\"), regeneratorDefine(u, n, function () {\n return this;\n }), regeneratorDefine(u, \"toString\", function () {\n return \"[object Generator]\";\n }), (module.exports = _regenerator = function _regenerator() {\n return {\n w: i,\n m: f\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2021 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nexport const visitStatusColor = {\n full: '#008000',\n partial: '#edc344',\n failed: '#ff0000',\n ongoing: '#0000ff',\n not_found: '#000',\n created: '#7d8080'\n};\n","function _OverloadYield(e, d) {\n this.v = e, this.k = d;\n}\nmodule.exports = _OverloadYield, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([\"exports\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.jsYearCalendar = mod.exports;\n }\n})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function (_exports) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true\n });\n _exports[\"default\"] = void 0;\n\n function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\n function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n /* =========================================================\r\n * JS year calendar v1.0.0\r\n * Repo: https://github.com/year-calendar/js-year-calendar\r\n * =========================================================\r\n * Created by Paul David-Sivelle\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ========================================================= */\n // NodeList forEach() polyfill\n if (typeof NodeList !== \"undefined\" && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = function (callback, thisArg) {\n thisArg = thisArg || window;\n\n for (var i = 0; i < this.length; i++) {\n callback.call(thisArg, this[i], i, this);\n }\n };\n } // Element closest() polyfill\n\n\n if (typeof Element !== \"undefined\" && !Element.prototype.matches) {\n var prototype = Element.prototype;\n Element.prototype.matches = prototype.msMatchesSelector || prototype.webkitMatchesSelector;\n }\n\n if (typeof Element !== \"undefined\" && !Element.prototype.closest) {\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType == 1);\n\n return null;\n };\n }\n /**\r\n * Calendar instance.\r\n */\n\n\n var Calendar = /*#__PURE__*/function () {\n /**\r\n * Fired when a day is clicked.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('clickDay', function(e) {\r\n * console.log(\"Click on day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when a day is right clicked.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('clickDay', function(e) {\r\n * console.log(\"Right click on day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the mouse enter in a day.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('mouseOnDay', function(e) {\r\n * console.log(\"Mouse enter in a day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the mouse leave a day.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('mouseOutDay', function(e) {\r\n * console.log(\"Mouse leave a day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the calendar rendering is ended.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('renderEnd', function(e) {\r\n * console.log(\"Render end for year: \" + e.currentYear);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when a date range is selected.\r\n * \r\n * Don't forget to enable the `enableRangeSelection` option to be able to use the range selection functionality.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('selectRange', function(e) {\r\n * console.log(\"Select the range: \" + e.startDate + \" - \" + e.endDate);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Triggered after the changing the current year.\r\n * Works only if the calendar is used in a full year mode. Otherwise, use `periodChanged` event.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('yearChanged', function(e) {\r\n * console.log(\"New year selected: \" + e.currentYear);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Triggered after the changing the visible period.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('periodChanged', function(e) {\r\n * console.log(`New period selected: ${e.startDate} ${e.endDate}`);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Create a new calendar.\r\n * @param element The element (or the selector to an element) in which the calendar should be created.\r\n * @param options [Optional] The options used to customize the calendar\r\n */\n function Calendar(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, Calendar);\n\n _defineProperty(this, \"element\", void 0);\n\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"_startDate\", void 0);\n\n _defineProperty(this, \"_dataSource\", void 0);\n\n _defineProperty(this, \"_mouseDown\", void 0);\n\n _defineProperty(this, \"_rangeStart\", void 0);\n\n _defineProperty(this, \"_rangeEnd\", void 0);\n\n _defineProperty(this, \"_responsiveInterval\", void 0);\n\n _defineProperty(this, \"_nbCols\", void 0);\n\n _defineProperty(this, \"clickDay\", void 0);\n\n _defineProperty(this, \"dayContextMenu\", void 0);\n\n _defineProperty(this, \"mouseOnDay\", void 0);\n\n _defineProperty(this, \"mouseOutDay\", void 0);\n\n _defineProperty(this, \"renderEnd\", void 0);\n\n _defineProperty(this, \"selectRange\", void 0);\n\n _defineProperty(this, \"yearChanged\", void 0);\n\n _defineProperty(this, \"periodChanged\", void 0);\n\n if (element instanceof HTMLElement) {\n this.element = element;\n } else if (typeof element === \"string\") {\n this.element = document.querySelector(element);\n } else {\n throw new Error(\"The element parameter should be a DOM node or a selector\");\n }\n\n this.element.classList.add('calendar');\n\n this._initializeEvents(options);\n\n this._initializeOptions(options);\n\n var startYear = new Date().getFullYear();\n var startMonth = 0;\n\n if (this.options.startDate) {\n startYear = this.options.startDate.getFullYear();\n startMonth = this.options.startDate.getMonth();\n } else if (this.options.startYear) {\n startYear = this.options.startYear;\n }\n\n this.setStartDate(new Date(startYear, startMonth, 1));\n }\n\n _createClass(Calendar, [{\n key: \"_initializeOptions\",\n value: function _initializeOptions(opt) {\n if (opt == null) {\n opt = {};\n }\n\n this.options = {\n startYear: !isNaN(parseInt(opt.startYear)) ? parseInt(opt.startYear) : null,\n startDate: opt.startDate instanceof Date ? opt.startDate : null,\n numberMonthsDisplayed: !isNaN(parseInt(opt.numberMonthsDisplayed)) && opt.numberMonthsDisplayed > 0 && opt.numberMonthsDisplayed <= 12 ? parseInt(opt.numberMonthsDisplayed) : 12,\n minDate: opt.minDate instanceof Date ? opt.minDate : null,\n maxDate: opt.maxDate instanceof Date ? opt.maxDate : null,\n language: opt.language != null && Calendar.locales[opt.language] != null ? opt.language : 'en',\n allowOverlap: opt.allowOverlap != null ? opt.allowOverlap : true,\n displayWeekNumber: opt.displayWeekNumber != null ? opt.displayWeekNumber : false,\n displayDisabledDataSource: opt.displayDisabledDataSource != null ? opt.displayDisabledDataSource : false,\n displayHeader: opt.displayHeader != null ? opt.displayHeader : true,\n alwaysHalfDay: opt.alwaysHalfDay != null ? opt.alwaysHalfDay : false,\n enableRangeSelection: opt.enableRangeSelection != null ? opt.enableRangeSelection : false,\n disabledDays: opt.disabledDays instanceof Array ? opt.disabledDays : [],\n disabledWeekDays: opt.disabledWeekDays instanceof Array ? opt.disabledWeekDays : [],\n hiddenWeekDays: opt.hiddenWeekDays instanceof Array ? opt.hiddenWeekDays : [],\n roundRangeLimits: opt.roundRangeLimits != null ? opt.roundRangeLimits : false,\n dataSource: opt.dataSource instanceof Array || typeof opt.dataSource === \"function\" ? opt.dataSource : [],\n style: opt.style == 'background' || opt.style == 'border' || opt.style == 'custom' ? opt.style : 'border',\n enableContextMenu: opt.enableContextMenu != null ? opt.enableContextMenu : false,\n contextMenuItems: opt.contextMenuItems instanceof Array ? opt.contextMenuItems : [],\n customDayRenderer: typeof opt.customDayRenderer === \"function\" ? opt.customDayRenderer : null,\n customDataSourceRenderer: typeof opt.customDataSourceRenderer === \"function\" ? opt.customDataSourceRenderer : null,\n weekStart: !isNaN(parseInt(opt.weekStart)) ? parseInt(opt.weekStart) : null,\n loadingTemplate: typeof opt.loadingTemplate === \"string\" || opt.loadingTemplate instanceof HTMLElement ? opt.loadingTemplate : null\n };\n\n if (this.options.dataSource instanceof Array) {\n this._dataSource = this.options.dataSource;\n\n this._initializeDatasourceColors();\n }\n }\n }, {\n key: \"_initializeEvents\",\n value: function _initializeEvents(opt) {\n if (opt == null) {\n opt = [];\n }\n\n if (opt.yearChanged) {\n this.element.addEventListener('yearChanged', opt.yearChanged);\n }\n\n if (opt.periodChanged) {\n this.element.addEventListener('periodChanged', opt.periodChanged);\n }\n\n if (opt.renderEnd) {\n this.element.addEventListener('renderEnd', opt.renderEnd);\n }\n\n if (opt.clickDay) {\n this.element.addEventListener('clickDay', opt.clickDay);\n }\n\n if (opt.dayContextMenu) {\n this.element.addEventListener('dayContextMenu', opt.dayContextMenu);\n }\n\n if (opt.selectRange) {\n this.element.addEventListener('selectRange', opt.selectRange);\n }\n\n if (opt.mouseOnDay) {\n this.element.addEventListener('mouseOnDay', opt.mouseOnDay);\n }\n\n if (opt.mouseOutDay) {\n this.element.addEventListener('mouseOutDay', opt.mouseOutDay);\n }\n }\n }, {\n key: \"_fetchDataSource\",\n value: function _fetchDataSource(callback) {\n if (typeof this.options.dataSource === \"function\") {\n var getDataSource = this.options.dataSource;\n var currentPeriod = this.getCurrentPeriod();\n var fetchParameters = {\n year: currentPeriod.startDate.getFullYear(),\n startDate: currentPeriod.startDate,\n endDate: currentPeriod.endDate\n };\n\n if (getDataSource.length == 2) {\n // 2 parameters, means callback method\n getDataSource(fetchParameters, callback);\n } else {\n // 1 parameter, means synchronous or promise method\n var result = getDataSource(fetchParameters);\n\n if (result instanceof Array) {\n callback(result);\n }\n\n if (result && result.then) {\n result.then(callback);\n }\n }\n } else {\n callback(this.options.dataSource);\n }\n }\n }, {\n key: \"_initializeDatasourceColors\",\n value: function _initializeDatasourceColors() {\n for (var i = 0; i < this._dataSource.length; i++) {\n if (this._dataSource[i].color == null) {\n this._dataSource[i].color = Calendar.colors[i % Calendar.colors.length];\n }\n }\n }\n /**\r\n * Renders the calendar.\r\n */\n\n }, {\n key: \"render\",\n value: function render() {\n var isLoading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n // Clear the calendar (faster method)\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n\n if (this.options.displayHeader) {\n this._renderHeader();\n }\n\n if (isLoading) {\n this._renderLoading();\n } else {\n this._renderBody();\n\n this._renderDataSource();\n\n this._applyEvents(); // Fade animation\n\n\n var months = this.element.querySelector('.months-container');\n months.style.opacity = '0';\n months.style.display = 'flex';\n months.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n months.style.opacity = '1';\n setTimeout(function () {\n return months.style.transition = '';\n }, 500);\n }, 0);\n var currentPeriod = this.getCurrentPeriod();\n\n this._triggerEvent('renderEnd', {\n currentYear: currentPeriod.startDate.getFullYear(),\n startDate: currentPeriod.startDate,\n endDate: currentPeriod.endDate\n });\n }\n }\n }, {\n key: \"_renderHeader\",\n value: function _renderHeader() {\n var header = document.createElement('div');\n header.classList.add('calendar-header');\n var headerTable = document.createElement('table');\n var period = this.getCurrentPeriod(); // Left arrow\n\n var prevDiv = document.createElement('th');\n prevDiv.classList.add('prev');\n\n if (this.options.minDate != null && this.options.minDate >= period.startDate) {\n prevDiv.classList.add('disabled');\n }\n\n var prevIcon = document.createElement('span');\n prevIcon.innerHTML = \"‹\";\n prevDiv.appendChild(prevIcon);\n headerTable.appendChild(prevDiv);\n\n if (this._isFullYearMode()) {\n // Year N-2\n var prev2YearDiv = document.createElement('th');\n prev2YearDiv.classList.add('year-title');\n prev2YearDiv.classList.add('year-neighbor2');\n prev2YearDiv.textContent = (this._startDate.getFullYear() - 2).toString();\n\n if (this.options.minDate != null && this.options.minDate > new Date(this._startDate.getFullYear() - 2, 11, 31)) {\n prev2YearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(prev2YearDiv); // Year N-1\n\n var prevYearDiv = document.createElement('th');\n prevYearDiv.classList.add('year-title');\n prevYearDiv.classList.add('year-neighbor');\n prevYearDiv.textContent = (this._startDate.getFullYear() - 1).toString();\n\n if (this.options.minDate != null && this.options.minDate > new Date(this._startDate.getFullYear() - 1, 11, 31)) {\n prevYearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(prevYearDiv);\n } // Current year\n\n\n var yearDiv = document.createElement('th');\n yearDiv.classList.add('year-title');\n\n if (this._isFullYearMode()) {\n yearDiv.textContent = this._startDate.getFullYear().toString();\n } else if (this.options.numberMonthsDisplayed == 12) {\n yearDiv.textContent = \"\".concat(period.startDate.getFullYear(), \" - \").concat(period.endDate.getFullYear());\n } else if (this.options.numberMonthsDisplayed > 1) {\n yearDiv.textContent = \"\".concat(Calendar.locales[this.options.language].months[period.startDate.getMonth()], \" \").concat(period.startDate.getFullYear(), \" - \").concat(Calendar.locales[this.options.language].months[period.endDate.getMonth()], \" \").concat(period.endDate.getFullYear());\n } else {\n yearDiv.textContent = \"\".concat(Calendar.locales[this.options.language].months[period.startDate.getMonth()], \" \").concat(period.startDate.getFullYear());\n }\n\n headerTable.appendChild(yearDiv);\n\n if (this._isFullYearMode()) {\n // Year N+1\n var nextYearDiv = document.createElement('th');\n nextYearDiv.classList.add('year-title');\n nextYearDiv.classList.add('year-neighbor');\n nextYearDiv.textContent = (this._startDate.getFullYear() + 1).toString();\n\n if (this.options.maxDate != null && this.options.maxDate < new Date(this._startDate.getFullYear() + 1, 0, 1)) {\n nextYearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(nextYearDiv); // Year N+2\n\n var next2YearDiv = document.createElement('th');\n next2YearDiv.classList.add('year-title');\n next2YearDiv.classList.add('year-neighbor2');\n next2YearDiv.textContent = (this._startDate.getFullYear() + 2).toString();\n\n if (this.options.maxDate != null && this.options.maxDate < new Date(this._startDate.getFullYear() + 2, 0, 1)) {\n next2YearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(next2YearDiv);\n } // Right arrow\n\n\n var nextDiv = document.createElement('th');\n nextDiv.classList.add('next');\n\n if (this.options.maxDate != null && this.options.maxDate <= period.endDate) {\n nextDiv.classList.add('disabled');\n }\n\n var nextIcon = document.createElement('span');\n nextIcon.innerHTML = \"›\";\n nextDiv.appendChild(nextIcon);\n headerTable.appendChild(nextDiv);\n header.appendChild(headerTable);\n this.element.appendChild(header);\n }\n }, {\n key: \"_renderBody\",\n value: function _renderBody() {\n var monthsDiv = document.createElement('div');\n monthsDiv.classList.add('months-container');\n var monthStartDate = new Date(this._startDate.getTime());\n\n for (var m = 0; m < this.options.numberMonthsDisplayed; m++) {\n /* Container */\n var monthDiv = document.createElement('div');\n monthDiv.classList.add('month-container');\n monthDiv.dataset.monthId = m.toString();\n\n if (this._nbCols) {\n monthDiv.classList.add(\"month-\".concat(this._nbCols));\n }\n\n var table = document.createElement('table');\n table.classList.add('month');\n /* Month header */\n\n var thead = document.createElement('thead');\n var titleRow = document.createElement('tr');\n var titleCell = document.createElement('th');\n titleCell.classList.add('month-title');\n titleCell.setAttribute('colspan', this.options.displayWeekNumber ? '8' : '7');\n titleCell.textContent = Calendar.locales[this.options.language].months[monthStartDate.getMonth()];\n titleRow.appendChild(titleCell);\n thead.appendChild(titleRow);\n var headerRow = document.createElement('tr');\n\n if (this.options.displayWeekNumber) {\n var weekNumberCell = document.createElement('th');\n weekNumberCell.classList.add('week-number');\n weekNumberCell.textContent = Calendar.locales[this.options.language].weekShort;\n headerRow.appendChild(weekNumberCell);\n }\n\n var weekStart = this.getWeekStart();\n var d = weekStart;\n\n do {\n var headerCell = document.createElement('th');\n headerCell.classList.add('day-header');\n headerCell.textContent = Calendar.locales[this.options.language].daysMin[d];\n\n if (this._isHidden(d)) {\n headerCell.classList.add('hidden');\n }\n\n headerRow.appendChild(headerCell);\n d++;\n if (d >= 7) d = 0;\n } while (d != weekStart);\n\n thead.appendChild(headerRow);\n table.appendChild(thead);\n /* Days */\n\n var currentDate = new Date(monthStartDate.getTime());\n var lastDate = new Date(monthStartDate.getFullYear(), monthStartDate.getMonth() + 1, 0);\n\n while (currentDate.getDay() != weekStart) {\n currentDate.setDate(currentDate.getDate() - 1);\n }\n\n while (currentDate <= lastDate) {\n var row = document.createElement('tr');\n\n if (this.options.displayWeekNumber) {\n var weekNumberCell = document.createElement('td');\n var currentThursday = new Date(currentDate.getTime()); // Week number is computed based on the thursday\n\n currentThursday.setDate(currentThursday.getDate() - weekStart + 4);\n weekNumberCell.classList.add('week-number');\n weekNumberCell.textContent = this.getWeekNumber(currentThursday).toString();\n row.appendChild(weekNumberCell);\n }\n\n do {\n var cell = document.createElement('td');\n cell.classList.add('day');\n\n if (this._isHidden(currentDate.getDay())) {\n cell.classList.add('hidden');\n }\n\n if (currentDate < monthStartDate) {\n cell.classList.add('old');\n } else if (currentDate > lastDate) {\n cell.classList.add('new');\n } else {\n if (this._isDisabled(currentDate)) {\n cell.classList.add('disabled');\n }\n\n var cellContent = document.createElement('div');\n cellContent.classList.add('day-content');\n cellContent.textContent = currentDate.getDate().toString();\n cell.appendChild(cellContent);\n\n if (this.options.customDayRenderer) {\n this.options.customDayRenderer(cellContent, currentDate);\n }\n }\n\n row.appendChild(cell);\n currentDate.setDate(currentDate.getDate() + 1);\n } while (currentDate.getDay() != weekStart);\n\n table.appendChild(row);\n }\n\n monthDiv.appendChild(table);\n monthsDiv.appendChild(monthDiv);\n monthStartDate.setMonth(monthStartDate.getMonth() + 1);\n }\n\n this.element.appendChild(monthsDiv);\n }\n }, {\n key: \"_renderLoading\",\n value: function _renderLoading() {\n var container = document.createElement('div');\n container.classList.add('calendar-loading-container');\n container.style.minHeight = this._nbCols * 200 + 'px';\n var loading = document.createElement('div');\n loading.classList.add('calendar-loading');\n\n if (this.options.loadingTemplate) {\n if (typeof this.options.loadingTemplate === \"string\") {\n loading.innerHTML = this.options.loadingTemplate;\n } else if (this.options.loadingTemplate instanceof HTMLElement) {\n loading.appendChild(this.options.loadingTemplate);\n }\n } else {\n var spinner = document.createElement('div');\n spinner.classList.add('calendar-spinner');\n\n for (var i = 1; i <= 3; i++) {\n var bounce = document.createElement('div');\n bounce.classList.add(\"bounce\".concat(i));\n spinner.appendChild(bounce);\n }\n\n loading.appendChild(spinner);\n }\n\n container.appendChild(loading);\n this.element.appendChild(container);\n }\n }, {\n key: \"_renderDataSource\",\n value: function _renderDataSource() {\n var _this = this;\n\n if (this._dataSource != null && this._dataSource.length > 0) {\n this.element.querySelectorAll('.month-container').forEach(function (month) {\n var monthId = parseInt(month.dataset.monthId);\n\n var currentYear = _this._startDate.getFullYear();\n\n var currentMonth = _this._startDate.getMonth() + monthId;\n var firstDate = new Date(currentYear, currentMonth, 1);\n var lastDate = new Date(currentYear, currentMonth + 1, 1);\n\n if ((_this.options.minDate == null || lastDate > _this.options.minDate) && (_this.options.maxDate == null || firstDate <= _this.options.maxDate)) {\n var monthData = [];\n\n for (var i = 0; i < _this._dataSource.length; i++) {\n if (!(_this._dataSource[i].startDate >= lastDate) || _this._dataSource[i].endDate < firstDate) {\n monthData.push(_this._dataSource[i]);\n }\n }\n\n if (monthData.length > 0) {\n month.querySelectorAll('.day-content').forEach(function (day) {\n var currentDate = new Date(currentYear, currentMonth, parseInt(day.textContent));\n var nextDate = new Date(currentYear, currentMonth, currentDate.getDate() + 1);\n var dayData = [];\n\n if ((_this.options.minDate == null || currentDate >= _this.options.minDate) && (_this.options.maxDate == null || currentDate <= _this.options.maxDate)) {\n for (var i = 0; i < monthData.length; i++) {\n if (monthData[i].startDate < nextDate && monthData[i].endDate >= currentDate) {\n dayData.push(monthData[i]);\n }\n }\n\n if (dayData.length > 0 && (_this.options.displayDisabledDataSource || !_this._isDisabled(currentDate))) {\n _this._renderDataSourceDay(day, currentDate, dayData);\n }\n }\n });\n }\n }\n });\n }\n }\n }, {\n key: \"_renderDataSourceDay\",\n value: function _renderDataSourceDay(elt, currentDate, events) {\n var parent = elt.parentElement;\n\n switch (this.options.style) {\n case 'border':\n var weight = 0;\n\n if (events.length == 1) {\n weight = 4;\n } else if (events.length <= 3) {\n weight = 2;\n } else {\n parent.style.boxShadow = 'inset 0 -4px 0 0 black';\n }\n\n if (weight > 0) {\n var boxShadow = '';\n\n for (var i = 0; i < events.length; i++) {\n if (boxShadow != '') {\n boxShadow += \",\";\n }\n\n boxShadow += \"inset 0 -\".concat((i + 1) * weight, \"px 0 0 \").concat(events[i].color);\n }\n\n parent.style.boxShadow = boxShadow;\n }\n\n break;\n\n case 'background':\n parent.style.backgroundColor = events[events.length - 1].color;\n var currentTime = currentDate.getTime();\n\n if (events[events.length - 1].startDate.getTime() == currentTime) {\n parent.classList.add('day-start');\n\n if (events[events.length - 1].startHalfDay || this.options.alwaysHalfDay) {\n parent.classList.add('day-half'); // Find color for other half\n\n var otherColor = 'transparent';\n\n for (var i = events.length - 2; i >= 0; i--) {\n if (events[i].startDate.getTime() != currentTime || !events[i].startHalfDay && !this.options.alwaysHalfDay) {\n otherColor = events[i].color;\n break;\n }\n }\n\n parent.style.background = \"linear-gradient(-45deg, \".concat(events[events.length - 1].color, \", \").concat(events[events.length - 1].color, \" 49%, \").concat(otherColor, \" 51%, \").concat(otherColor, \")\");\n } else if (this.options.roundRangeLimits) {\n parent.classList.add('round-left');\n }\n } else if (events[events.length - 1].endDate.getTime() == currentTime) {\n parent.classList.add('day-end');\n\n if (events[events.length - 1].endHalfDay || this.options.alwaysHalfDay) {\n parent.classList.add('day-half'); // Find color for other half\n\n var otherColor = 'transparent';\n\n for (var i = events.length - 2; i >= 0; i--) {\n if (events[i].endDate.getTime() != currentTime || !events[i].endHalfDay && !this.options.alwaysHalfDay) {\n otherColor = events[i].color;\n break;\n }\n }\n\n parent.style.background = \"linear-gradient(135deg, \".concat(events[events.length - 1].color, \", \").concat(events[events.length - 1].color, \" 49%, \").concat(otherColor, \" 51%, \").concat(otherColor, \")\");\n } else if (this.options.roundRangeLimits) {\n parent.classList.add('round-right');\n }\n }\n\n break;\n\n case 'custom':\n if (this.options.customDataSourceRenderer) {\n this.options.customDataSourceRenderer.call(this, elt, currentDate, events);\n }\n\n break;\n }\n }\n }, {\n key: \"_applyEvents\",\n value: function _applyEvents() {\n var _this2 = this;\n\n if (this.options.displayHeader) {\n /* Header buttons */\n this.element.querySelectorAll('.year-neighbor, .year-neighbor2').forEach(function (element) {\n element.addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n _this2.setYear(parseInt(e.currentTarget.textContent));\n }\n });\n });\n this.element.querySelector('.calendar-header .prev').addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n var months = _this2.element.querySelector('.months-container');\n\n months.style.transition = 'margin-left 0.1s';\n months.style.marginLeft = '100%';\n setTimeout(function () {\n months.style.visibility = 'hidden';\n months.style.transition = '';\n months.style.marginLeft = '0';\n setTimeout(function () {\n _this2.setStartDate(new Date(_this2._startDate.getFullYear(), _this2._startDate.getMonth() - _this2.options.numberMonthsDisplayed, 1));\n }, 50);\n }, 100);\n }\n });\n this.element.querySelector('.calendar-header .next').addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n var months = _this2.element.querySelector('.months-container');\n\n months.style.transition = 'margin-left 0.1s';\n months.style.marginLeft = '-100%';\n setTimeout(function () {\n months.style.visibility = 'hidden';\n months.style.transition = '';\n months.style.marginLeft = '0';\n setTimeout(function () {\n _this2.setStartDate(new Date(_this2._startDate.getFullYear(), _this2._startDate.getMonth() + _this2.options.numberMonthsDisplayed, 1));\n }, 50);\n }, 100);\n }\n });\n }\n\n var cells = this.element.querySelectorAll('.day:not(.old):not(.new):not(.disabled)');\n cells.forEach(function (cell) {\n /* Click on date */\n cell.addEventListener('click', function (e) {\n e.stopPropagation();\n\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('clickDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n /* Click right on date */\n\n cell.addEventListener('contextmenu', function (e) {\n if (_this2.options.enableContextMenu) {\n e.preventDefault();\n\n if (_this2.options.contextMenuItems.length > 0) {\n _this2._openContextMenu(e.currentTarget);\n }\n }\n\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('dayContextMenu', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n /* Range selection */\n\n if (_this2.options.enableRangeSelection) {\n cell.addEventListener('mousedown', function (e) {\n if (e.which == 1) {\n var currentDate = _this2._getDate(e.currentTarget);\n\n if (_this2.options.allowOverlap || _this2.isThereFreeSlot(currentDate)) {\n _this2._mouseDown = true;\n _this2._rangeStart = _this2._rangeEnd = currentDate;\n\n _this2._refreshRange();\n }\n }\n });\n cell.addEventListener('mouseenter', function (e) {\n if (_this2._mouseDown) {\n var currentDate = _this2._getDate(e.currentTarget);\n\n if (!_this2.options.allowOverlap) {\n var newDate = new Date(_this2._rangeStart.getTime());\n\n if (newDate < currentDate) {\n var nextDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate() + 1);\n\n while (newDate < currentDate) {\n if (!_this2.isThereFreeSlot(nextDate, false)) {\n break;\n }\n\n newDate.setDate(newDate.getDate() + 1);\n nextDate.setDate(nextDate.getDate() + 1);\n }\n } else {\n var nextDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate() - 1);\n\n while (newDate > currentDate) {\n if (!_this2.isThereFreeSlot(nextDate, true)) {\n break;\n }\n\n newDate.setDate(newDate.getDate() - 1);\n nextDate.setDate(nextDate.getDate() - 1);\n }\n }\n\n currentDate = newDate;\n }\n\n var oldValue = _this2._rangeEnd;\n _this2._rangeEnd = currentDate;\n\n if (oldValue.getTime() != _this2._rangeEnd.getTime()) {\n _this2._refreshRange();\n }\n }\n });\n }\n /* Hover date */\n\n\n cell.addEventListener('mouseenter', function (e) {\n if (!_this2._mouseDown) {\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('mouseOnDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n }\n });\n cell.addEventListener('mouseleave', function (e) {\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('mouseOutDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n });\n\n if (this.options.enableRangeSelection) {\n // Release range selection\n window.addEventListener('mouseup', function (e) {\n if (_this2._mouseDown) {\n _this2._mouseDown = false;\n\n _this2._refreshRange();\n\n var minDate = _this2._rangeStart < _this2._rangeEnd ? _this2._rangeStart : _this2._rangeEnd;\n var maxDate = _this2._rangeEnd > _this2._rangeStart ? _this2._rangeEnd : _this2._rangeStart;\n\n _this2._triggerEvent('selectRange', {\n startDate: minDate,\n endDate: maxDate,\n events: _this2.getEventsOnRange(minDate, new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate() + 1))\n });\n }\n });\n }\n /* Responsive management */\n\n\n if (this._responsiveInterval) {\n clearInterval(this._responsiveInterval);\n this._responsiveInterval = null;\n }\n\n this._responsiveInterval = setInterval(function () {\n if (_this2.element.querySelector('.month') == null) {\n return;\n }\n\n var calendarSize = _this2.element.offsetWidth;\n var monthSize = _this2.element.querySelector('.month').offsetWidth + 10;\n _this2._nbCols = null;\n\n if (monthSize * 6 < calendarSize && _this2.options.numberMonthsDisplayed >= 6) {\n _this2._nbCols = 2;\n } else if (monthSize * 4 < calendarSize && _this2.options.numberMonthsDisplayed >= 4) {\n _this2._nbCols = 3;\n } else if (monthSize * 3 < calendarSize && _this2.options.numberMonthsDisplayed >= 3) {\n _this2._nbCols = 4;\n } else if (monthSize * 2 < calendarSize && _this2.options.numberMonthsDisplayed >= 2) {\n _this2._nbCols = 6;\n } else {\n _this2._nbCols = 12;\n }\n\n _this2.element.querySelectorAll('.month-container').forEach(function (month) {\n if (!month.classList.contains(\"month-\".concat(_this2._nbCols))) {\n ['month-2', 'month-3', 'month-4', 'month-6', 'month-12'].forEach(function (className) {\n month.classList.remove(className);\n });\n month.classList.add(\"month-\".concat(_this2._nbCols));\n }\n });\n }, 300);\n }\n }, {\n key: \"_refreshRange\",\n value: function _refreshRange() {\n var _this3 = this;\n\n this.element.querySelectorAll('td.day.range').forEach(function (day) {\n return day.classList.remove('range');\n });\n this.element.querySelectorAll('td.day.range-start').forEach(function (day) {\n return day.classList.remove('range-start');\n });\n this.element.querySelectorAll('td.day.range-end').forEach(function (day) {\n return day.classList.remove('range-end');\n });\n\n if (this._mouseDown) {\n var minDate = this._rangeStart < this._rangeEnd ? this._rangeStart : this._rangeEnd;\n var maxDate = this._rangeEnd > this._rangeStart ? this._rangeEnd : this._rangeStart;\n this.element.querySelectorAll('.month-container').forEach(function (month) {\n var monthId = parseInt(month.dataset.monthId);\n var monthStartDate = new Date(_this3._startDate.getFullYear(), _this3._startDate.getMonth() + monthId, 1);\n var monthEndDate = new Date(_this3._startDate.getFullYear(), _this3._startDate.getMonth() + monthId + 1, 1);\n\n if (minDate.getTime() < monthEndDate.getTime() && maxDate.getTime() >= monthStartDate.getTime()) {\n month.querySelectorAll('td.day:not(.old):not(.new)').forEach(function (day) {\n var date = _this3._getDate(day);\n\n if (date >= minDate && date <= maxDate) {\n day.classList.add('range');\n\n if (date.getTime() == minDate.getTime()) {\n day.classList.add('range-start');\n }\n\n if (date.getTime() == maxDate.getTime()) {\n day.classList.add('range-end');\n }\n }\n });\n }\n });\n }\n }\n }, {\n key: \"_getElementPosition\",\n value: function _getElementPosition(element) {\n var top = 0,\n left = 0;\n\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n }\n }, {\n key: \"_openContextMenu\",\n value: function _openContextMenu(elt) {\n var _this4 = this;\n\n var contextMenu = document.querySelector('.calendar-context-menu');\n\n if (contextMenu !== null) {\n contextMenu.style.display = 'none'; // Clear the context menu (faster method)\n\n while (contextMenu.firstChild) {\n contextMenu.removeChild(contextMenu.firstChild);\n }\n } else {\n contextMenu = document.createElement('div');\n contextMenu.classList.add('calendar-context-menu');\n document.body.appendChild(contextMenu);\n }\n\n var date = this._getDate(elt);\n\n var events = this.getEvents(date);\n\n for (var i = 0; i < events.length; i++) {\n var eventItem = document.createElement('div');\n eventItem.classList.add('item');\n eventItem.style.paddingLeft = '4px';\n eventItem.style.boxShadow = \"inset 4px 0 0 0 \".concat(events[i].color);\n var eventItemContent = document.createElement('div');\n eventItemContent.classList.add('content');\n var text = document.createElement('span');\n text.classList.add('text');\n text.textContent = events[i].name;\n eventItemContent.appendChild(text);\n var icon = document.createElement('span');\n icon.classList.add('arrow');\n icon.innerHTML = \"›\";\n eventItemContent.appendChild(icon);\n eventItem.appendChild(eventItemContent);\n\n this._renderContextMenuItems(eventItem, this.options.contextMenuItems, events[i]);\n\n contextMenu.appendChild(eventItem);\n }\n\n if (contextMenu.children.length > 0) {\n var position = this._getElementPosition(elt);\n\n contextMenu.style.left = position.left + 25 + 'px';\n contextMenu.style.right = '';\n contextMenu.style.top = position.top + 25 + 'px';\n contextMenu.style.display = 'block';\n\n if (contextMenu.getBoundingClientRect().right > document.body.offsetWidth) {\n contextMenu.style.left = '';\n contextMenu.style.right = '0';\n } // Launch the position check once the whole context menu tree will be rendered\n\n\n setTimeout(function () {\n return _this4._checkContextMenuItemsPosition();\n }, 0);\n\n var closeContextMenu = function closeContextMenu(event) {\n if (event.type !== 'click' || !contextMenu.contains(event.target)) {\n contextMenu.style.display = 'none';\n window.removeEventListener('click', closeContextMenu);\n window.removeEventListener('resize', closeContextMenu);\n window.removeEventListener('scroll', closeContextMenu);\n }\n };\n\n window.addEventListener('click', closeContextMenu);\n window.addEventListener('resize', closeContextMenu);\n window.addEventListener('scroll', closeContextMenu);\n }\n }\n }, {\n key: \"_renderContextMenuItems\",\n value: function _renderContextMenuItems(parent, items, evt) {\n var subMenu = document.createElement('div');\n subMenu.classList.add('submenu');\n\n for (var i = 0; i < items.length; i++) {\n if (items[i].visible === false || typeof items[i].visible === \"function\" && !items[i].visible(evt)) {\n continue;\n }\n\n var menuItem = document.createElement('div');\n menuItem.classList.add('item');\n var menuItemContent = document.createElement('div');\n menuItemContent.classList.add('content');\n var text = document.createElement('span');\n text.classList.add('text');\n text.textContent = items[i].text;\n menuItemContent.appendChild(text);\n\n if (items[i].click) {\n (function (index) {\n menuItemContent.addEventListener('click', function () {\n document.querySelector('.calendar-context-menu').style.display = 'none';\n items[index].click(evt);\n });\n })(i);\n }\n\n menuItem.appendChild(menuItemContent);\n\n if (items[i].items && items[i].items.length > 0) {\n var icon = document.createElement('span');\n icon.classList.add('arrow');\n icon.innerHTML = \"›\";\n menuItemContent.appendChild(icon);\n\n this._renderContextMenuItems(menuItem, items[i].items, evt);\n }\n\n subMenu.appendChild(menuItem);\n }\n\n if (subMenu.children.length > 0) {\n parent.appendChild(subMenu);\n }\n }\n }, {\n key: \"_checkContextMenuItemsPosition\",\n value: function _checkContextMenuItemsPosition() {\n var menus = document.querySelectorAll('.calendar-context-menu .submenu');\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n htmlMenu.style.display = 'block';\n htmlMenu.style.visibility = 'hidden';\n });\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n\n if (htmlMenu.getBoundingClientRect().right > document.body.offsetWidth) {\n htmlMenu.classList.add('open-left');\n } else {\n htmlMenu.classList.remove('open-left');\n }\n });\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n htmlMenu.style.display = '';\n htmlMenu.style.visibility = '';\n });\n }\n }, {\n key: \"_getDate\",\n value: function _getDate(elt) {\n var day = elt.querySelector('.day-content').textContent;\n var monthId = parseInt(elt.closest('.month-container').dataset.monthId);\n return new Date(this._startDate.getFullYear(), this._startDate.getMonth() + monthId, day);\n }\n }, {\n key: \"_triggerEvent\",\n value: function _triggerEvent(eventName, parameters) {\n var event = null;\n\n if (typeof Event === \"function\") {\n event = new Event(eventName);\n } else {\n event = document.createEvent('Event');\n event.initEvent(eventName, false, false);\n }\n\n event.calendar = this;\n\n for (var i in parameters) {\n event[i] = parameters[i];\n }\n\n this.element.dispatchEvent(event);\n return event;\n }\n }, {\n key: \"_isDisabled\",\n value: function _isDisabled(date) {\n if (this.options.minDate != null && date < this.options.minDate || this.options.maxDate != null && date > this.options.maxDate) {\n return true;\n }\n\n if (this.options.disabledWeekDays.length > 0) {\n for (var d = 0; d < this.options.disabledWeekDays.length; d++) {\n if (date.getDay() == this.options.disabledWeekDays[d]) {\n return true;\n }\n }\n }\n\n if (this.options.disabledDays.length > 0) {\n for (var d = 0; d < this.options.disabledDays.length; d++) {\n if (date.getTime() == this.options.disabledDays[d].getTime()) {\n return true;\n }\n }\n }\n\n return false;\n }\n }, {\n key: \"_isHidden\",\n value: function _isHidden(day) {\n if (this.options.hiddenWeekDays.length > 0) {\n for (var d = 0; d < this.options.hiddenWeekDays.length; d++) {\n if (day == this.options.hiddenWeekDays[d]) {\n return true;\n }\n }\n }\n\n return false;\n }\n }, {\n key: \"_isFullYearMode\",\n value: function _isFullYearMode() {\n return this._startDate.getMonth() == 0 && this.options.numberMonthsDisplayed == 12;\n }\n /**\r\n * Gets the week number for a specified date.\r\n *\r\n * @param date The specified date.\r\n */\n\n }, {\n key: \"getWeekNumber\",\n value: function getWeekNumber(date) {\n // Algorithm from https://weeknumber.net/how-to/javascript\n var workingDate = new Date(date.getTime());\n workingDate.setHours(0, 0, 0, 0); // Thursday in current week decides the year.\n\n workingDate.setDate(workingDate.getDate() + 3 - (workingDate.getDay() + 6) % 7); // January 4 is always in week 1.\n\n var week1 = new Date(workingDate.getFullYear(), 0, 4); // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n\n return 1 + Math.round(((workingDate.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n }\n /**\r\n * Gets the data source elements for a specified day.\r\n *\r\n * @param date The specified day.\r\n */\n\n }, {\n key: \"getEvents\",\n value: function getEvents(date) {\n return this.getEventsOnRange(date, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1));\n }\n /**\r\n * Gets the data source elements for a specified range of days.\r\n *\r\n * @param startDate The beginning of the day range (inclusive).\r\n * @param endDate The end of the day range (non inclusive).\r\n */\n\n }, {\n key: \"getEventsOnRange\",\n value: function getEventsOnRange(startDate, endDate) {\n var events = [];\n\n if (this._dataSource && startDate && endDate) {\n for (var i = 0; i < this._dataSource.length; i++) {\n if (this._dataSource[i].startDate < endDate && this._dataSource[i].endDate >= startDate) {\n events.push(this._dataSource[i]);\n }\n }\n }\n\n return events;\n }\n /**\r\n * Check if there is no event on the first part, last part or on the whole specified day.\r\n *\r\n * @param date The specified day.\r\n * @param after Whether to check for a free slot on the first part (if `false`) or the last part (if `true`) of the day. If `null`, this will check on the whole day.\r\n * \r\n * Usefull only if using the `alwaysHalfDay` option of the calendar, or the `startHalfDay` or `endHalfDay` option of the datasource.\r\n */\n\n }, {\n key: \"isThereFreeSlot\",\n value: function isThereFreeSlot(date) {\n var _this5 = this;\n\n var after = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var events = this.getEvents(date);\n\n if (after === true) {\n return !events.some(function (evt) {\n return !_this5.options.alwaysHalfDay && !evt.endHalfDay || evt.endDate > date;\n });\n } else if (after === false) {\n return !events.some(function (evt) {\n return !_this5.options.alwaysHalfDay && !evt.startHalfDay || evt.startDate < date;\n });\n } else {\n return this.isThereFreeSlot(date, false) || this.isThereFreeSlot(date, true);\n }\n }\n /**\r\n * Gets the period displayed on the calendar.\r\n */\n\n }, {\n key: \"getCurrentPeriod\",\n value: function getCurrentPeriod() {\n var startDate = new Date(this._startDate.getTime());\n var endDate = new Date(this._startDate.getTime());\n endDate.setMonth(endDate.getMonth() + this.options.numberMonthsDisplayed);\n endDate.setTime(endDate.getTime() - 1);\n return {\n startDate: startDate,\n endDate: endDate\n };\n }\n /**\r\n * Gets the year displayed on the calendar.\r\n * If the calendar is not used in a full year configuration, this will return the year of the first date displayed in the calendar.\r\n */\n\n }, {\n key: \"getYear\",\n value: function getYear() {\n return this._isFullYearMode() ? this._startDate.getFullYear() : null;\n }\n /**\r\n * Sets the year displayed on the calendar.\r\n * If the calendar is not used in a full year configuration, this will set the start date to January 1st of the given year.\r\n *\r\n * @param year The year to displayed on the calendar.\r\n */\n\n }, {\n key: \"setYear\",\n value: function setYear(year) {\n var parsedYear = parseInt(year);\n\n if (!isNaN(parsedYear)) {\n this.setStartDate(new Date(parsedYear, 0, 1));\n }\n }\n /**\r\n * Gets the first date displayed on the calendar.\r\n */\n\n }, {\n key: \"getStartDate\",\n value: function getStartDate() {\n return this._startDate;\n }\n /**\r\n * Sets the first date that should be displayed on the calendar.\r\n *\r\n * @param startDate The first date that should be displayed on the calendar.\r\n */\n\n }, {\n key: \"setStartDate\",\n value: function setStartDate(startDate) {\n var _this6 = this;\n\n if (startDate instanceof Date) {\n this.options.startDate = startDate;\n this._startDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1); // Clear the calendar (faster method)\n\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n\n if (this.options.displayHeader) {\n this._renderHeader();\n }\n\n var newPeriod = this.getCurrentPeriod();\n\n var periodEventResult = this._triggerEvent('periodChanged', {\n startDate: newPeriod.startDate,\n endDate: newPeriod.endDate,\n preventRendering: false\n });\n\n var yearEventResult = null;\n\n if (this._isFullYearMode()) {\n yearEventResult = this._triggerEvent('yearChanged', {\n currentYear: this._startDate.getFullYear(),\n preventRendering: false\n });\n }\n\n if (typeof this.options.dataSource === \"function\") {\n this.render(true);\n\n this._fetchDataSource(function (dataSource) {\n _this6._dataSource = dataSource;\n\n _this6._initializeDatasourceColors();\n\n _this6.render(false);\n });\n } else {\n if (!periodEventResult.preventRendering && (!yearEventResult || !yearEventResult.preventRedering)) {\n this.render();\n }\n }\n }\n }\n /**\r\n * Gets the number of months displayed by the calendar.\r\n */\n\n }, {\n key: \"getNumberMonthsDisplayed\",\n value: function getNumberMonthsDisplayed() {\n return this.options.numberMonthsDisplayed;\n }\n /**\r\n * Sets the number of months displayed that should be displayed by the calendar.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param numberMonthsDisplayed Number of months that should be displayed by the calendar.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setNumberMonthsDisplayed\",\n value: function setNumberMonthsDisplayed(numberMonthsDisplayed) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var parsedNumber = parseInt(numberMonthsDisplayed);\n\n if (!isNaN(parsedNumber) && parsedNumber > 0 && parsedNumber <= 12) {\n this.options.numberMonthsDisplayed = parsedNumber;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the minimum date of the calendar.\r\n */\n\n }, {\n key: \"getMinDate\",\n value: function getMinDate() {\n return this.options.minDate;\n }\n /**\r\n * Sets the minimum date of the calendar.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param minDate The minimum date to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setMinDate\",\n value: function setMinDate(date) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (date instanceof Date || date === null) {\n this.options.minDate = date;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the maximum date of the calendar.\r\n */\n\n }, {\n key: \"getMaxDate\",\n value: function getMaxDate() {\n return this.options.maxDate;\n }\n /**\r\n * Sets the maximum date of the calendar. \r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param maxDate The maximum date to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setMaxDate\",\n value: function setMaxDate(date) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (date instanceof Date || date === null) {\n this.options.maxDate = date;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the current style used for displaying data source.\r\n */\n\n }, {\n key: \"getStyle\",\n value: function getStyle() {\n return this.options.style;\n }\n /**\r\n * Sets the style to use for displaying data source. \r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param style The style to use for displaying data source (\"background\", \"border\" or \"custom\").\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setStyle\",\n value: function setStyle(style) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.style = style == 'background' || style == 'border' || style == 'custom' ? style : 'border';\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the user can select a range which overlapping an other element present in the datasource.\r\n */\n\n }, {\n key: \"getAllowOverlap\",\n value: function getAllowOverlap() {\n return this.options.allowOverlap;\n }\n /**\r\n * Sets a value indicating whether the user can select a range which overlapping an other element present in the datasource.\r\n *\r\n * @param allowOverlap Indicates whether the user can select a range which overlapping an other element present in the datasource.\r\n */\n\n }, {\n key: \"setAllowOverlap\",\n value: function setAllowOverlap(allowOverlap) {\n this.options.allowOverlap = allowOverlap;\n }\n /**\r\n * Gets a value indicating whether the weeks number are displayed.\r\n */\n\n }, {\n key: \"getDisplayWeekNumber\",\n value: function getDisplayWeekNumber() {\n return this.options.displayWeekNumber;\n }\n /**\r\n * Sets a value indicating whether the weeks number are displayed.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayWeekNumber Indicates whether the weeks number are displayed.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayWeekNumber\",\n value: function setDisplayWeekNumber(displayWeekNumber) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayWeekNumber = displayWeekNumber;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the calendar header is displayed.\r\n */\n\n }, {\n key: \"getDisplayHeader\",\n value: function getDisplayHeader() {\n return this.options.displayHeader;\n }\n /**\r\n * Sets a value indicating whether the calendar header is displayed.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayHeader Indicates whether the calendar header is displayed.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayHeader\",\n value: function setDisplayHeader(displayHeader) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayHeader = displayHeader;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the data source must be rendered on disabled days.\r\n */\n\n }, {\n key: \"getDisplayDisabledDataSource\",\n value: function getDisplayDisabledDataSource() {\n return this.options.displayDisabledDataSource;\n }\n /**\r\n * Sets a value indicating whether the data source must be rendered on disabled days.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayDisabledDataSource Indicates whether the data source must be rendered on disabled days.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayDisabledDataSource\",\n value: function setDisplayDisabledDataSource(displayDisabledDataSource) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayDisabledDataSource = displayDisabledDataSource;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the beginning and the end of each range should be displayed as half selected day.\r\n */\n\n }, {\n key: \"getAlwaysHalfDay\",\n value: function getAlwaysHalfDay() {\n return this.options.alwaysHalfDay;\n }\n /**\r\n * Sets a value indicating whether the beginning and the end of each range should be displayed as half selected day.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param alwaysHalfDay Indicates whether the beginning and the end of each range should be displayed as half selected day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setAlwaysHalfDay\",\n value: function setAlwaysHalfDay(alwaysHalfDay) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.alwaysHalfDay = alwaysHalfDay;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the user can make range selection.\r\n */\n\n }, {\n key: \"getEnableRangeSelection\",\n value: function getEnableRangeSelection() {\n return this.options.enableRangeSelection;\n }\n /**\r\n * Sets a value indicating whether the user can make range selection.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param enableRangeSelection Indicates whether the user can make range selection.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setEnableRangeSelection\",\n value: function setEnableRangeSelection(enableRangeSelection) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.enableRangeSelection = enableRangeSelection;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the disabled days.\r\n */\n\n }, {\n key: \"getDisabledDays\",\n value: function getDisabledDays() {\n return this.options.disabledDays;\n }\n /**\r\n * Sets the disabled days.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param disableDays The disabled days to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisabledDays\",\n value: function setDisabledDays(disabledDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.disabledDays = disabledDays instanceof Array ? disabledDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the disabled days of the week.\r\n */\n\n }, {\n key: \"getDisabledWeekDays\",\n value: function getDisabledWeekDays() {\n return this.options.disabledWeekDays;\n }\n /**\r\n * Sets the disabled days of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param disabledWeekDays The disabled days of the week to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisabledWeekDays\",\n value: function setDisabledWeekDays(disabledWeekDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.disabledWeekDays = disabledWeekDays instanceof Array ? disabledWeekDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the hidden days of the week.\r\n */\n\n }, {\n key: \"getHiddenWeekDays\",\n value: function getHiddenWeekDays() {\n return this.options.hiddenWeekDays;\n }\n /**\r\n * Sets the hidden days of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param hiddenWeekDays The hidden days of the week to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setHiddenWeekDays\",\n value: function setHiddenWeekDays(hiddenWeekDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.hiddenWeekDays = hiddenWeekDays instanceof Array ? hiddenWeekDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the beginning and the end of each range should be displayed as rounded cells.\r\n */\n\n }, {\n key: \"getRoundRangeLimits\",\n value: function getRoundRangeLimits() {\n return this.options.roundRangeLimits;\n }\n /**\r\n * Sets a value indicating whether the beginning and the end of each range should be displayed as rounded cells.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param roundRangeLimits Indicates whether the beginning and the end of each range should be displayed as rounded cells. \r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setRoundRangeLimits\",\n value: function setRoundRangeLimits(roundRangeLimits) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.roundRangeLimits = roundRangeLimits;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the default context menu must be displayed when right clicking on a day.\r\n */\n\n }, {\n key: \"getEnableContextMenu\",\n value: function getEnableContextMenu() {\n return this.options.enableContextMenu;\n }\n /**\r\n * Sets a value indicating whether the default context menu must be displayed when right clicking on a day. \r\n * \r\n * This method causes a refresh of the calendar.\r\n * \r\n * @param enableContextMenu Indicates whether the default context menu must be displayed when right clicking on a day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setEnableContextMenu\",\n value: function setEnableContextMenu(enableContextMenu) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.enableContextMenu = enableContextMenu;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the context menu items.\r\n */\n\n }, {\n key: \"getContextMenuItems\",\n value: function getContextMenuItems() {\n return this.options.contextMenuItems;\n }\n /**\r\n * Sets new context menu items.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param contextMenuItems The new context menu items.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setContextMenuItems\",\n value: function setContextMenuItems(contextMenuItems) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.contextMenuItems = contextMenuItems instanceof Array ? contextMenuItems : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the custom day renderer.\r\n */\n\n }, {\n key: \"getCustomDayRenderer\",\n value: function getCustomDayRenderer() {\n return this.options.customDayRenderer;\n }\n /**\r\n * Sets the custom day renderer.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param handler The function used to render the days. This function is called during render for each day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setCustomDayRenderer\",\n value: function setCustomDayRenderer(customDayRenderer) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.customDayRenderer = typeof customDayRenderer === \"function\" ? customDayRenderer : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the custom data source renderer.\r\n */\n\n }, {\n key: \"getCustomDataSourceRenderer\",\n value: function getCustomDataSourceRenderer() {\n return this.options.customDataSourceRenderer;\n }\n /**\r\n * Sets the custom data source renderer. Works only with the style set to \"custom\".\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param handler The function used to render the data source. This function is called during render for each day containing at least one event.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setCustomDataSourceRenderer\",\n value: function setCustomDataSourceRenderer(customDataSourceRenderer) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.customDataSourceRenderer = typeof customDataSourceRenderer === \"function\" ? customDataSourceRenderer : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the language used for calendar rendering.\r\n */\n\n }, {\n key: \"getLanguage\",\n value: function getLanguage() {\n return this.options.language;\n }\n /**\r\n * Sets the language used for calendar rendering.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param language The language to use for calendar redering.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setLanguage\",\n value: function setLanguage(language) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (language != null && Calendar.locales[language] != null) {\n this.options.language = language;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the current data source.\r\n */\n\n }, {\n key: \"getDataSource\",\n value: function getDataSource() {\n return this.options.dataSource;\n }\n /**\r\n * Sets a new data source.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param dataSource The new data source.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDataSource\",\n value: function setDataSource(dataSource) {\n var _this7 = this;\n\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.dataSource = dataSource instanceof Array || typeof dataSource === \"function\" ? dataSource : [];\n\n if (typeof this.options.dataSource === \"function\") {\n this.render(true);\n\n this._fetchDataSource(function (dataSource) {\n _this7._dataSource = dataSource;\n\n _this7._initializeDatasourceColors();\n\n _this7.render(false);\n });\n } else {\n this._dataSource = this.options.dataSource;\n\n this._initializeDatasourceColors();\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the starting day of the week.\r\n */\n\n }, {\n key: \"getWeekStart\",\n value: function getWeekStart() {\n return this.options.weekStart !== null ? this.options.weekStart : Calendar.locales[this.options.language].weekStart;\n }\n /**\r\n * Sets the starting day of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param weekStart The starting day of the week. This option overrides the parameter define in the language file.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setWeekStart\",\n value: function setWeekStart(weekStart) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.weekStart = !isNaN(parseInt(weekStart)) ? parseInt(weekStart) : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the loading template.\r\n */\n\n }, {\n key: \"getLoadingTemplate\",\n value: function getLoadingTemplate() {\n return this.options.loadingTemplate;\n }\n /**\r\n * Sets the loading template.\r\n *\r\n * @param loadingTemplate The loading template.\r\n */\n\n }, {\n key: \"setLoadingTemplate\",\n value: function setLoadingTemplate(loadingTemplate) {\n this.options.loadingTemplate = typeof loadingTemplate === \"string\" || loadingTemplate instanceof HTMLElement ? loadingTemplate : null;\n }\n /**\r\n * \r\n * Add a new element to the data source.\r\n * \r\n * This method causes a refresh of the calendar.\r\n * \r\n * @param element The element to add.\r\n * @param preventRendering Indicates whether the calendar shouldn't be refreshed once the event added.\r\n */\n\n }, {\n key: \"addEvent\",\n value: function addEvent(evt) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n this._dataSource.push(evt);\n\n if (!preventRendering) {\n this.render();\n }\n }\n }]);\n\n return Calendar;\n }();\n\n _exports[\"default\"] = Calendar;\n\n _defineProperty(Calendar, \"locales\", {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n weekShort: 'W',\n weekStart: 0\n }\n });\n\n _defineProperty(Calendar, \"colors\", ['#2C8FC9', '#9CB703', '#F5BB00', '#FF4A32', '#B56CE2', '#45A597']);\n\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") {\n window.Calendar = Calendar;\n document.addEventListener(\"DOMContentLoaded\", function () {\n document.querySelectorAll('[data-provide=\"calendar\"]').forEach(function (element) {\n return new Calendar(element);\n });\n });\n }\n});","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorValues(e) {\n if (null != e) {\n var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"],\n r = 0;\n if (t) return t.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) return {\n next: function next() {\n return e && r >= e.length && (e = void 0), {\n value: e && e[r++],\n done: !e\n };\n }\n };\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n}\nmodule.exports = _regeneratorValues, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2024 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nimport {createVisitsHistogram} from './visits-histogram';\nimport {updateCalendar} from './visits-calendar';\nimport './visits-reporting.css';\n\n// will hold all visits\nlet allVisits;\n// will hold filtered visits to display\nlet filteredVisits;\n// will hold currently displayed year\nlet currentYear;\n\n// function to gather full visits\nfunction filterFullVisits(differentSnapshots) {\n const filteredVisits = [];\n for (let i = 0; i < allVisits.length; ++i) {\n if (allVisits[i].status !== 'full') continue;\n if (!differentSnapshots) {\n filteredVisits.push(allVisits[i]);\n } else if (filteredVisits.length === 0) {\n filteredVisits.push(allVisits[i]);\n } else {\n const lastVisit = filteredVisits[filteredVisits.length - 1];\n if (allVisits[i].snapshot !== lastVisit.snapshot) {\n filteredVisits.push(allVisits[i]);\n }\n }\n }\n return filteredVisits;\n}\n\n// function to update the visits list view based on the selected year\nfunction updateVisitsList(year) {\n $('#swh-visits-list').children().remove();\n const visitsByYear = [];\n for (let i = 0; i < filteredVisits.length; ++i) {\n if (filteredVisits[i].date.getUTCFullYear() === year) {\n visitsByYear.push(filteredVisits[i]);\n }\n }\n let visitsCpt = 0;\n const nbVisitsByRow = 4;\n let visitsListHtml = '<div class=\"swh-visits-list-row\">';\n for (let i = 0; i < visitsByYear.length; ++i) {\n if (visitsCpt > 0 && visitsCpt % nbVisitsByRow === 0) {\n visitsListHtml += '</div><div class=\"swh-visits-list-row\">';\n }\n visitsListHtml += '<div class=\"swh-visits-list-column\" style=\"width: ' + 100 / nbVisitsByRow + '%;\">';\n visitsListHtml += '<a class=\"swh-visit-icon swh-visit-' + visitsByYear[i].status + '\" title=\"' + visitsByYear[i].status +\n ' visit\" href=\"' + visitsByYear[i].url + '\">' + visitsByYear[i].formatted_date + '</a>';\n visitsListHtml += '</div>';\n ++visitsCpt;\n }\n visitsListHtml += '</div>';\n $('#swh-visits-list').append($(visitsListHtml));\n}\n\nfunction yearChangedCalendar(year) {\n currentYear = year;\n updateVisitsList(year);\n createVisitsHistogram('.d3-wrapper', filteredVisits, currentYear, yearClickedTimeline);\n}\n\n// callback when the user selects a year through the visits histogram\nfunction yearClickedTimeline(year) {\n currentYear = year;\n updateCalendar(year, filteredVisits, yearChangedCalendar);\n updateVisitsList(year);\n}\n\n// function to update the visits views (histogram, calendar, list)\nfunction updateDisplayedVisits() {\n if (filteredVisits.length === 0) {\n return;\n }\n if (!currentYear) {\n currentYear = filteredVisits[filteredVisits.length - 1].date.getUTCFullYear();\n }\n createVisitsHistogram('.d3-wrapper', filteredVisits, currentYear, yearClickedTimeline);\n updateCalendar(currentYear, filteredVisits, yearChangedCalendar);\n updateVisitsList(currentYear);\n}\n\n// callback when the user only wants to see full visits pointing\n// to different snapshots (default)\nexport function showFullVisitsDifferentSnapshots(event) {\n filteredVisits = filterFullVisits(true);\n updateDisplayedVisits();\n}\n\n// callback when the user only wants to see full visits\nexport function showFullVisits(event) {\n filteredVisits = filterFullVisits(false);\n updateDisplayedVisits();\n}\n\n// callback when the user wants to see all visits (including partial, ongoing and failed ones)\nexport function showAllVisits(event) {\n filteredVisits = allVisits;\n updateDisplayedVisits();\n}\n\n// bootstrap 5 popovers on calendar days have display issues after dynamically updating calendar\n// so we refresh the page instead when changing visits filter\nexport function reloadPage() {\n location.reload();\n}\n\nexport function initVisitsReporting(visits) {\n $(document).ready(() => {\n allVisits = visits;\n // process input visits\n let firstFullVisit;\n allVisits.forEach((v, i) => {\n // Turn Unix epoch into Javascript Date object\n v.date = new Date(Math.floor(v.date * 1000));\n const visitLink = '<a class=\"swh-visit-icon swh-visit-' + v.status + '\" href=\"' + v.url + '\">' + v.formatted_date + '</a>';\n if (v.status === 'full') {\n if (!firstFullVisit) {\n firstFullVisit = v;\n $('#swh-first-full-visit').append($(visitLink));\n if (allVisits.length === 1) {\n $('#swh-last-full-visit')[0].innerHTML = visitLink;\n }\n } else {\n $('#swh-last-full-visit')[0].innerHTML = visitLink;\n }\n }\n if (i === allVisits.length - 1) {\n $('#swh-last-visit').append($(visitLink));\n }\n });\n\n if (!firstFullVisit) {\n $('#swh-full-visits-different-snapshots').prop('disabled', true);\n $('#swh-full-visits').prop('disabled', true);\n }\n\n if ($('#swh-full-visits').prop('checked')) {\n showFullVisits();\n } else if ($('#swh-all-visits').prop('checked')) {\n showAllVisits();\n } else {\n // display full visits pointing to different snapshots by default\n showFullVisitsDifferentSnapshots();\n }\n });\n\n}\n","const hexCharacters = 'a-f\\\\d';\nconst match3or4Hex = `#?[${hexCharacters}]{3}[${hexCharacters}]?`;\nconst match6or8Hex = `#?[${hexCharacters}]{6}([${hexCharacters}]{2})?`;\nconst nonHexChars = new RegExp(`[^#${hexCharacters}]`, 'gi');\nconst validHexSize = new RegExp(`^${match3or4Hex}$|^${match6or8Hex}$`, 'i');\n\nexport default function hexRgb(hex, options = {}) {\n\tif (typeof hex !== 'string' || nonHexChars.test(hex) || !validHexSize.test(hex)) {\n\t\tthrow new TypeError('Expected a valid hex string');\n\t}\n\n\thex = hex.replace(/^#/, '');\n\tlet alphaFromHex = 1;\n\n\tif (hex.length === 8) {\n\t\talphaFromHex = Number.parseInt(hex.slice(6, 8), 16) / 255;\n\t\thex = hex.slice(0, 6);\n\t}\n\n\tif (hex.length === 4) {\n\t\talphaFromHex = Number.parseInt(hex.slice(3, 4).repeat(2), 16) / 255;\n\t\thex = hex.slice(0, 3);\n\t}\n\n\tif (hex.length === 3) {\n\t\thex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n\t}\n\n\tconst number = Number.parseInt(hex, 16);\n\tconst red = number >> 16;\n\tconst green = (number >> 8) & 255;\n\tconst blue = number & 255;\n\tconst alpha = typeof options.alpha === 'number' ? options.alpha : alphaFromHex;\n\n\tif (options.format === 'array') {\n\t\treturn [red, green, blue, alpha];\n\t}\n\n\tif (options.format === 'css') {\n\t\tconst alphaString = alpha === 1 ? '' : ` / ${Number((alpha * 100).toFixed(2))}%`;\n\t\treturn `rgb(${red} ${green} ${blue}${alphaString})`;\n\t}\n\n\treturn {red, green, blue, alpha};\n}\n","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","var regeneratorAsyncGen = require(\"./regeneratorAsyncGen.js\");\nfunction _regeneratorAsync(n, e, r, t, o) {\n var a = regeneratorAsyncGen(n, e, r, t, o);\n return a.next().then(function (n) {\n return n.done ? n.value : a.next();\n });\n}\nmodule.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2025 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nimport Calendar from 'js-year-calendar';\nimport 'js-year-calendar/dist/js-year-calendar.css';\nimport hexRgb from 'hex-rgb';\n\nimport {visitStatusColor} from './utils';\n\nconst minSize = 15;\nconst maxSize = 28;\nlet currentPopover = null;\nlet visitsByDate = {};\nlet calendar = null;\n\nfunction closePopover() {\n if (currentPopover) {\n $(currentPopover).popover('dispose');\n currentPopover = null;\n }\n}\n\n// function to update the visits calendar view based on the selected year\nexport function updateCalendar(year, filteredVisits, yearClickedCallback) {\n visitsByDate = {};\n let maxNbVisitsByDate = 0;\n let minDate, maxDate;\n for (let i = 0; i < filteredVisits.length; ++i) {\n filteredVisits[i]['startDate'] = filteredVisits[i]['date'];\n filteredVisits[i]['endDate'] = filteredVisits[i]['startDate'];\n const date = new Date(filteredVisits[i]['date']);\n date.setHours(0, 0, 0, 0);\n const dateStr = date.toDateString();\n if (!visitsByDate.hasOwnProperty(dateStr)) {\n visitsByDate[dateStr] = [filteredVisits[i]];\n } else {\n visitsByDate[dateStr].push(filteredVisits[i]);\n }\n maxNbVisitsByDate = Math.max(maxNbVisitsByDate, visitsByDate[dateStr].length);\n if (i === 0) {\n minDate = maxDate = date;\n } else {\n if (date.getTime() < minDate.getTime()) {\n minDate = date;\n }\n if (date.getTime() > maxDate.getTime()) {\n maxDate = date;\n }\n }\n }\n\n closePopover();\n if (calendar === null) {\n calendar = new Calendar('#swh-visits-calendar', {\n dataSource: filteredVisits,\n style: 'custom',\n minDate: minDate,\n maxDate: maxDate,\n startYear: year,\n renderEnd: e => yearClickedCallback(e.currentYear),\n customDataSourceRenderer: (element, date, events) => {\n const dateStr = date.toDateString();\n const nbVisits = visitsByDate[dateStr].length;\n let t = nbVisits / maxNbVisitsByDate;\n if (maxNbVisitsByDate === 1) {\n t = 0;\n }\n const size = minSize + t * (maxSize - minSize);\n const offsetX = (maxSize - size) / 2 - parseInt($(element).css('padding-left'));\n const offsetY = (maxSize - size) / 2 - parseInt($(element).css('padding-top')) + 1;\n const cellWrapper = $('<div></div>');\n cellWrapper.css('position', 'relative');\n const dayNumber = $('<div></div>');\n dayNumber.text($(element).text());\n const circle = $('<div></div>');\n const color = {red: 0, green: 0, blue: 0, alpha: 0.4};\n for (let i = 0; i < nbVisits; ++i) {\n const visit = visitsByDate[dateStr][i];\n const visitColor = hexRgb(visitStatusColor[visit.status]);\n color.red += visitColor.red;\n color.green += visitColor.green;\n color.blue += visitColor.blue;\n }\n color.red /= nbVisits;\n color.green /= nbVisits;\n color.blue /= nbVisits;\n circle.css('background-color', `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha})`);\n circle.css('width', size + 'px');\n circle.css('height', size + 'px');\n circle.css('border-radius', size + 'px');\n circle.css('position', 'absolute');\n circle.css('top', offsetY + 'px');\n circle.css('left', offsetX + 'px');\n cellWrapper.append(dayNumber);\n cellWrapper.append(circle);\n $(element)[0].innerHTML = $(cellWrapper)[0].outerHTML;\n },\n mouseOnDay: e => {\n if (currentPopover !== e.element) {\n closePopover();\n }\n const dateStr = e.date.toDateString();\n if (visitsByDate.hasOwnProperty(dateStr)) {\n\n const visits = visitsByDate[dateStr];\n let content = '<div><h6>' + e.date.toDateString() + '</h6></div>';\n content += '<ul class=\"swh-list-unstyled\">';\n for (let i = 0; i < visits.length; ++i) {\n const visitTime = visits[i].formatted_date.substr(visits[i].formatted_date.indexOf(',') + 2);\n content += '<li><a class=\"swh-visit-icon swh-visit-' + visits[i].status + '\" title=\"' + visits[i].status +\n ' visit\" href=\"' + visits[i].url + '\">' + visitTime + '</a></li>';\n }\n content += '</ul>';\n\n $(e.element).popover({\n trigger: 'manual',\n container: 'body',\n html: true,\n content: content,\n animation: false\n }).on('mouseleave', () => {\n if (!$('.popover:hover').length) {\n // close popover when leaving day in calendar\n // except if the pointer is hovering it\n closePopover();\n }\n });\n\n $(e.element).on('shown.bs.popover', () => {\n $('.popover').mouseleave(() => {\n // close popover when pointer leaves it\n closePopover();\n });\n });\n\n $(e.element).popover('show');\n currentPopover = e.element;\n }\n }\n });\n } else {\n calendar.setMinDate(minDate);\n calendar.setMaxDate(maxDate);\n calendar.setYear(year);\n calendar.renderEnd = e => yearClickedCallback(e.currentYear);\n calendar.setDataSource(filteredVisits);\n calendar.render();\n }\n $('#swh-visits-calendar.calendar table td').css('width', maxSize + 'px');\n $('#swh-visits-calendar.calendar table td').css('height', maxSize + 'px');\n $('#swh-visits-calendar.calendar table td').css('padding', '0px');\n}\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _regeneratorDefine(e, r, n, t) {\n var i = Object.defineProperty;\n try {\n i({}, \"\", {});\n } catch (e) {\n i = 0;\n }\n module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {\n if (r) i ? i(e, r, {\n value: n,\n enumerable: !t,\n configurable: !t,\n writable: !t\n }) : e[r] = n;else {\n var o = function o(r, n) {\n _regeneratorDefine(e, r, function (e) {\n return this._invoke(r, n, e);\n });\n };\n o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2);\n }\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _regeneratorDefine(e, r, n, t);\n}\nmodule.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + \"d3\" + \".\" + \"2fe5b1ddad0dbb25a61b\" + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/static/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t384: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkswh\"] = self[\"webpackChunkswh\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["root","factory","exports","module","define","amd","self","inProgress","dataWebpackPrefix","regenerator","regeneratorAsyncIterator","r","e","t","o","n","w","Promise","__esModule","Object","unshift","length","pop","value","done","OverloadYield","regeneratorAsync","regeneratorAsyncGen","regeneratorKeys","regeneratorValues","_regeneratorRuntime","m","getPrototypeOf","__proto__","constructor","displayName","name","a","stop","v","abrupt","delegateYield","resultName","d","finish","f","_t","p","prev","next","sent","call","this","wrap","reverse","isGeneratorFunction","mark","awrap","AsyncIterator","async","u","keys","values","createVisitsHistogram","_x","_x2","_x3","_x4","_createVisitsHistogram","apply","arguments","_asyncToGenerator","_callee","container","visitsData","currentYear","yearClickCallback","d3","width","height","margin","svg","tooltip","g","x","y","colors","now","endYear","monthExtent","monthBins","yearBins","binByMonth","visitsByStatus","statuses","histData","i","stacked","yMax","step","yTickValues","_i3","_i4","legendGroup","legend","_context","select","remove","top","right","bottom","left","attr","Math","ceil","append","style","scaleTime","rangeRound","scaleLinear","range","scaleOrdinal","domain","visitStatusColor","Date","getUTCFullYear","UTC","timeMonths","timeMonth","offset","timeYears","extent","histogram","date","thresholds","groups","sort","b","ascending","forEach","entry","push","monthsData","stack","key","max","total","floor","axisLeft","tickValues","tickSize","tickFormat","selectAll","data","enter","timeYear","on","event","x1","getMonth","x0","transition","duration","ds","toISOString","substr","split","tooltipText","visitStatus","nbVisits","html","pageX","pageY","axisBottom","ticks","every","year","text","slice","asyncGeneratorStep","c","resolve","then","_next","_throw","regeneratorDefine","prototype","Symbol","asyncIterator","_regenerator","iterator","toStringTag","Generator","create","G","bind","l","TypeError","GeneratorFunction","GeneratorFunctionPrototype","setPrototypeOf","full","partial","failed","ongoing","not_found","created","k","globalThis","_exports","_typeof","obj","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","enumerable","configurable","writable","defineProperty","_createClass","protoProps","staticProps","_defineProperty","NodeList","callback","thisArg","window","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","document","documentElement","contains","parentElement","parentNode","nodeType","Calendar","element","options","undefined","HTMLElement","Error","querySelector","classList","add","_initializeEvents","_initializeOptions","startYear","getFullYear","startMonth","startDate","setStartDate","opt","isNaN","parseInt","numberMonthsDisplayed","minDate","maxDate","language","locales","allowOverlap","displayWeekNumber","displayDisabledDataSource","displayHeader","alwaysHalfDay","enableRangeSelection","disabledDays","Array","disabledWeekDays","hiddenWeekDays","roundRangeLimits","dataSource","enableContextMenu","contextMenuItems","customDayRenderer","customDataSourceRenderer","weekStart","loadingTemplate","_dataSource","_initializeDatasourceColors","yearChanged","addEventListener","periodChanged","renderEnd","clickDay","dayContextMenu","selectRange","mouseOnDay","mouseOutDay","getDataSource","currentPeriod","getCurrentPeriod","fetchParameters","endDate","result","color","isLoading","firstChild","removeChild","_renderHeader","_renderLoading","_renderBody","_renderDataSource","_applyEvents","months","opacity","display","setTimeout","_triggerEvent","header","createElement","headerTable","period","prevDiv","prevIcon","innerHTML","appendChild","_isFullYearMode","prev2YearDiv","textContent","_startDate","toString","prevYearDiv","yearDiv","concat","nextYearDiv","next2YearDiv","nextDiv","nextIcon","monthsDiv","monthStartDate","getTime","monthDiv","dataset","monthId","_nbCols","table","thead","titleRow","titleCell","setAttribute","headerRow","weekNumberCell","weekShort","getWeekStart","headerCell","daysMin","_isHidden","currentDate","lastDate","getDay","setDate","getDate","row","currentThursday","getWeekNumber","cell","_isDisabled","cellContent","setMonth","minHeight","loading","spinner","bounce","_this","querySelectorAll","month","currentMonth","firstDate","monthData","day","nextDate","dayData","_renderDataSourceDay","elt","events","parent","weight","boxShadow","backgroundColor","currentTime","startHalfDay","otherColor","background","endHalfDay","_this2","currentTarget","setYear","marginLeft","visibility","stopPropagation","_getDate","getEvents","preventDefault","_openContextMenu","which","isThereFreeSlot","_mouseDown","_rangeStart","_rangeEnd","_refreshRange","newDate","oldValue","getEventsOnRange","_responsiveInterval","clearInterval","setInterval","calendarSize","offsetWidth","monthSize","className","_this3","monthEndDate","offsetTop","offsetLeft","offsetParent","_this4","contextMenu","body","eventItem","paddingLeft","eventItemContent","icon","_renderContextMenuItems","children","position","_getElementPosition","getBoundingClientRect","_checkContextMenuItemsPosition","closeContextMenu","type","removeEventListener","items","evt","subMenu","visible","menuItem","menuItemContent","click","index","menus","menu","htmlMenu","eventName","parameters","Event","createEvent","initEvent","calendar","dispatchEvent","workingDate","setHours","week1","round","_this5","after","some","setTime","parsedYear","_this6","newPeriod","periodEventResult","preventRendering","yearEventResult","render","_fetchDataSource","preventRedering","parsedNumber","_this7","en","days","daysShort","monthsShort","allVisits","filteredVisits","filterFullVisits","differentSnapshots","status","lastVisit","snapshot","updateVisitsList","$","visitsByYear","visitsCpt","visitsListHtml","url","formatted_date","yearChangedCalendar","yearClickedTimeline","updateCalendar","updateDisplayedVisits","showFullVisitsDifferentSnapshots","showFullVisits","showAllVisits","reloadPage","location","reload","initVisitsReporting","visits","ready","firstFullVisit","visitLink","prop","hexCharacters","match3or4Hex","match6or8Hex","nonHexChars","RegExp","validHexSize","hexRgb","hex","test","alphaFromHex","replace","Number","repeat","number","red","green","blue","alpha","format","toFixed","runtime","regeneratorRuntime","accidentalStrictMode","Function","minSize","maxSize","currentPopover","visitsByDate","closePopover","popover","yearClickedCallback","maxNbVisitsByDate","dateStr","toDateString","hasOwnProperty","size","offsetX","css","offsetY","cellWrapper","dayNumber","circle","visit","visitColor","outerHTML","content","visitTime","indexOf","trigger","animation","mouseleave","setMinDate","setMaxDate","setDataSource","_regeneratorDefine","_invoke","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","get","chunkId","all","reduce","promises","miniCssF","script","needAttach","scripts","getElementsByTagName","getAttribute","charset","timeout","nc","src","onScriptComplete","onerror","onload","clearTimeout","doneFns","fn","head","installedChunks","j","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","id","chunkLoadingGlobal"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/origin_visits.679992a2a951f67a08bc.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAa,IAAID,KAEjBD,EAAU,IAAIA,EAAU,KAAK,CAAC,EAAGA,EAAU,IAAiB,cAAIC,IACjE,CATD,CASGK,MAAM,WACT,O,eCVIC,EACAC,E,uBCDJ,IAAIC,EAAc,EAAQ,OACtBC,EAA2B,EAAQ,OAIvCP,EAAOD,QAHP,SAA8BS,EAAGC,EAAGC,EAAGC,EAAGC,GACxC,OAAO,IAAIL,EAAyBD,IAAcO,EAAEL,EAAGC,EAAGC,EAAGC,GAAIC,GAAKE,QACxE,EACuCd,EAAOD,QAAQgB,YAAa,EAAMf,EAAOD,QAAiB,QAAIC,EAAOD,O,mBCI5GC,EAAOD,QATP,SAA0BU,GACxB,IAAIG,EAAII,OAAOP,GACbD,EAAI,GACN,IAAK,IAAIE,KAAKE,EAAGJ,EAAES,QAAQP,GAC3B,OAAO,SAASD,IACd,KAAOD,EAAEU,QAAS,IAAKR,EAAIF,EAAEW,SAAUP,EAAG,OAAOH,EAAEW,MAAQV,EAAGD,EAAEY,MAAO,EAAIZ,EAC3E,OAAOA,EAAEY,MAAO,EAAIZ,CACtB,CACF,EACmCT,EAAOD,QAAQgB,YAAa,EAAMf,EAAOD,QAAiB,QAAIC,EAAOD,O,uBCTxG,IAAIuB,EAAgB,EAAQ,OACxBhB,EAAc,E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,EAAW,IAAI,CACrE,IAAIzC,KAAYwC,EACZzC,EAAoB1iB,EAAEmlB,EAAaxC,KACrCD,EAAoBzhB,EAAE0hB,GAAYwC,EAAYxC,IAGhD,GAAGtC,EAAsBA,EAAQqC,EAClC,CAEA,IADGuC,GAA4BA,EAA2Btc,GACrDzD,EAAIggB,EAAS3kB,OAAQ2E,IACzB+d,EAAUiC,EAAShgB,GAChBwd,EAAoB1iB,EAAEskB,EAAiBrB,IAAYqB,EAAgBrB,IACrEqB,EAAgBrB,GAAS,KAE1BqB,EAAgBrB,GAAW,CAG7B,EAEIoC,EAAqB7lB,KAAsB,gBAAIA,KAAsB,iBAAK,GAC9E6lB,EAAmBxd,QAAQmd,EAAqB3Z,KAAK,KAAM,IAC3Dga,EAAmBtd,KAAOid,EAAqB3Z,KAAK,KAAMga,EAAmBtd,KAAKsD,KAAKga,G","sources":["webpack://swh/webpack/universalModuleDefinition","webpack://swh/webpack/runtime/load script","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorKeys.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-histogram.js","webpack://swh/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js","webpack://swh/./node_modules/@babel/runtime/helpers/regenerator.js","webpack://swh/./swh/web/browse/assets/origin_visits/utils.js","webpack://swh/./node_modules/@babel/runtime/helpers/OverloadYield.js","webpack://swh/./node_modules/js-year-calendar/dist/js-year-calendar.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorValues.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-reporting.js","webpack://swh/./node_modules/hex-rgb/index.js","webpack://swh/./node_modules/@babel/runtime/regenerator/index.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorAsync.js","webpack://swh/./swh/web/browse/assets/origin_visits/visits-calendar.js","webpack://swh/./node_modules/@babel/runtime/helpers/typeof.js","webpack://swh/./node_modules/@babel/runtime/helpers/regeneratorDefine.js","webpack://swh/webpack/bootstrap","webpack://swh/webpack/runtime/compat get default export","webpack://swh/webpack/runtime/define property getters","webpack://swh/webpack/runtime/ensure chunk","webpack://swh/webpack/runtime/get javascript chunk filename","webpack://swh/webpack/runtime/get mini-css chunk filename","webpack://swh/webpack/runtime/hasOwnProperty shorthand","webpack://swh/webpack/runtime/make namespace object","webpack://swh/webpack/runtime/publicPath","webpack://swh/webpack/runtime/jsonp chunk loading"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"swh\"] = factory();\n\telse\n\t\troot[\"swh\"] = root[\"swh\"] || {}, root[\"swh\"][\"origin_visits\"] = factory();\n})(self, function() {\nreturn ","var inProgress = {};\nvar dataWebpackPrefix = \"swh:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var regenerator = require(\"./regenerator.js\");\nvar regeneratorAsyncIterator = require(\"./regeneratorAsyncIterator.js\");\nfunction _regeneratorAsyncGen(r, e, t, o, n) {\n return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);\n}\nmodule.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _regeneratorKeys(e) {\n var n = Object(e),\n r = [];\n for (var t in n) r.unshift(t);\n return function e() {\n for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;\n return e.done = !0, e;\n };\n}\nmodule.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var OverloadYield = require(\"./OverloadYield.js\");\nvar regenerator = require(\"./regenerator.js\");\nvar regeneratorAsync = require(\"./regeneratorAsync.js\");\nvar regeneratorAsyncGen = require(\"./regeneratorAsyncGen.js\");\nvar regeneratorAsyncIterator = require(\"./regeneratorAsyncIterator.js\");\nvar regeneratorKeys = require(\"./regeneratorKeys.js\");\nvar regeneratorValues = require(\"./regeneratorValues.js\");\nfunction _regeneratorRuntime() {\n \"use strict\";\n\n var r = regenerator(),\n e = r.m(_regeneratorRuntime),\n t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;\n function n(r) {\n var e = \"function\" == typeof r && r.constructor;\n return !!e && (e === t || \"GeneratorFunction\" === (e.displayName || e.name));\n }\n var o = {\n \"throw\": 1,\n \"return\": 2,\n \"break\": 3,\n \"continue\": 3\n };\n function a(r) {\n var e, t;\n return function (n) {\n e || (e = {\n stop: function stop() {\n return t(n.a, 2);\n },\n \"catch\": function _catch() {\n return n.v;\n },\n abrupt: function abrupt(r, e) {\n return t(n.a, o[r], e);\n },\n delegateYield: function delegateYield(r, o, a) {\n return e.resultName = o, t(n.d, regeneratorValues(r), a);\n },\n finish: function finish(r) {\n return t(n.f, r);\n }\n }, t = function t(r, _t, o) {\n n.p = e.prev, n.n = e.next;\n try {\n return r(_t, o);\n } finally {\n e.next = n.n;\n }\n }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;\n try {\n return r.call(this, e);\n } finally {\n n.p = e.prev, n.n = e.next;\n }\n };\n }\n return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return {\n wrap: function wrap(e, t, n, o) {\n return r.w(a(e), t, n, o && o.reverse());\n },\n isGeneratorFunction: n,\n mark: r.m,\n awrap: function awrap(r, e) {\n return new OverloadYield(r, e);\n },\n AsyncIterator: regeneratorAsyncIterator,\n async: function async(r, e, t, o, u) {\n return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);\n },\n keys: regeneratorKeys,\n values: regeneratorValues\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2022 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\n// Creation of a stacked histogram with D3.js for software origin visits history\n// Parameters description:\n// - container: selector for the div that will contain the histogram\n// - visitsData: raw swh origin visits data\n// - currentYear: the visits year to display by default\n// - yearClickCallback: callback when the user selects a year through the histogram\n\nimport {visitStatusColor} from './utils';\n\nexport async function createVisitsHistogram(container, visitsData, currentYear, yearClickCallback) {\n\n const d3 = await import(/* webpackChunkName: \"d3\" */ 'utils/d3');\n\n // remove previously created histogram and tooltip if any\n d3.select(container).select('svg').remove();\n d3.select('div.d3-tooltip').remove();\n\n // histogram size and margins\n let width = 1000;\n let height = 200;\n const margin = {top: 20, right: 80, bottom: 30, left: 50};\n\n // create responsive svg\n const svg = d3.select(container)\n .attr('style',\n 'padding-bottom: ' + Math.ceil(height * 100 / width) + '%')\n .append('svg')\n .attr('viewBox', '0 0 ' + width + ' ' + height);\n\n // create tooltip div\n const tooltip = d3.select('body')\n .append('div')\n .attr('class', 'd3-tooltip')\n .style('opacity', 0);\n\n // update width and height without margins\n width = width - margin.left - margin.right;\n height = height - margin.top - margin.bottom;\n\n // create main svg group element\n const g = svg.append('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n // create x scale\n const x = d3.scaleTime().rangeRound([0, width]);\n\n // create y scale\n const y = d3.scaleLinear().range([height, 0]);\n\n // create ordinal colorscale mapping visit status\n const colors = d3.scaleOrdinal()\n .domain(Object.keys(visitStatusColor))\n .range(Object.values(visitStatusColor));\n\n // first swh crawls were made in 2015\n const startYear = 2015;\n // set latest display year as the current one\n const now = new Date();\n const endYear = now.getUTCFullYear() + 1;\n const monthExtent = [new Date(Date.UTC(startYear, 0, 1)), new Date(Date.UTC(endYear, 0, 1))];\n\n // create months bins based on setup extent\n const monthBins = d3.timeMonths(d3.timeMonth.offset(monthExtent[0], -1), monthExtent[1]);\n // create years bins based on setup extent\n const yearBins = d3.timeYears(monthExtent[0], monthExtent[1]);\n\n // set x scale domain\n x.domain(d3.extent(monthBins));\n\n // use D3 histogram layout to create a function that will bin the visits by month\n const binByMonth = d3.histogram()\n .value(d => d.date)\n .domain(x.domain())\n .thresholds(monthBins);\n\n // use D3 nest function to group the visits by status\n const visitsByStatus = d3.groups(visitsData, d => d['status'])\n .sort((a, b) => d3.ascending(a[0], b[0]));\n\n // prepare data in order to be able to stack visit statuses by month\n const statuses = [];\n const histData = [];\n for (let i = 0; i < monthBins.length; ++i) {\n histData[i] = {};\n }\n visitsByStatus.forEach(entry => {\n statuses.push(entry[0]);\n const monthsData = binByMonth(entry[1]);\n for (let i = 0; i < monthsData.length; ++i) {\n histData[i]['x0'] = monthsData[i]['x0'];\n histData[i]['x1'] = monthsData[i]['x1'];\n histData[i][entry[0]] = monthsData[i];\n }\n });\n\n // create function to stack visits statuses by month\n const stacked = d3.stack()\n .keys(statuses)\n .value((d, key) => d[key].length);\n\n // compute the maximum amount of visits by month\n const yMax = d3.max(histData, d => {\n let total = 0;\n for (let i = 0; i < statuses.length; ++i) {\n total += d[statuses[i]].length;\n }\n return total;\n });\n\n // set y scale domain\n y.domain([0, yMax]);\n\n // compute ticks values for the y axis (at most 8 ticks)\n const step = Math.floor(yMax / 8) + 1;\n const yTickValues = [];\n for (let i = 0; i <= yMax / step; ++i) {\n yTickValues.push(i * step);\n }\n if (yTickValues.length === 0) {\n for (let i = 0; i <= yMax; ++i) {\n yTickValues.push(i);\n }\n } else if (yMax % step !== 0) {\n yTickValues.push(yMax);\n }\n\n // add histogram background grid\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y)\n .tickValues(yTickValues)\n .tickSize(-width)\n .tickFormat(''));\n\n // create one fill only rectangle by displayed year\n // each rectangle will be made visible when hovering the mouse over a year range\n // user will then be able to select a year by clicking in the rectangle\n\n g.append('g')\n .selectAll('rect')\n .data(yearBins)\n .enter().append('rect')\n .attr('class', d => 'year' + d.getUTCFullYear())\n .attr('fill', 'red')\n .attr('fill-opacity', d => d.getUTCFullYear() === currentYear ? 0.3 : 0)\n .attr('stroke', 'none')\n .attr('x', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return x(date);\n })\n .attr('y', 0)\n .attr('height', height)\n .attr('width', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return yearWidth;\n })\n // mouse event callbacks used to show rectangle years\n // when hovering the mouse over the histograms\n .on('mouseover', (event, d) => {\n svg.selectAll('rect.year' + d.getUTCFullYear())\n .attr('fill-opacity', 0.5);\n })\n .on('mouseout', (event, d) => {\n svg.selectAll('rect.year' + d.getUTCFullYear())\n .attr('fill-opacity', 0);\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.3);\n })\n // callback to select a year after a mouse click\n // in a rectangle year\n .on('click', (event, d) => {\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'none');\n currentYear = d.getUTCFullYear();\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.5);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'black');\n yearClickCallback(currentYear);\n });\n\n // create the stacked histogram of visits\n g.append('g')\n .selectAll('g')\n .data(stacked(histData))\n .enter().append('g')\n .attr('fill', d => colors(d.key))\n .selectAll('rect')\n .data(d => d)\n .enter().append('rect')\n .attr('class', d => 'month' + d.data.x1.getMonth())\n .attr('x', d => x(d.data.x0))\n .attr('y', d => y(d[1]))\n .attr('height', d => y(d[0]) - y(d[1]))\n .attr('width', d => x(d.data.x1) - x(d.data.x0) - 1)\n // mouse event callbacks used to show rectangle years\n // but also to show tooltip when hovering the mouse\n // over the histogram bars\n .on('mouseover', (event, d) => {\n svg.selectAll('rect.year' + d.data.x1.getUTCFullYear())\n .attr('fill-opacity', 0.5);\n tooltip.transition()\n .duration(200)\n .style('opacity', 1);\n const ds = d.data.x1.toISOString().substr(0, 7).split('-');\n let tooltipText = '<b>' + ds[1] + ' / ' + ds[0] + ':</b><br/>';\n for (let i = 0; i < statuses.length; ++i) {\n const visitStatus = statuses[i];\n const nbVisits = d.data[visitStatus].length;\n if (nbVisits === 0) continue;\n tooltipText += nbVisits + ' ' + visitStatus + ' visits';\n if (i !== statuses.length - 1) tooltipText += '<br/>';\n }\n tooltip.html(tooltipText)\n .style('left', event.pageX + 15 + 'px')\n .style('top', event.pageY + 'px');\n })\n .on('mouseout', (event, d) => {\n svg.selectAll('rect.year' + d.data.x1.getUTCFullYear())\n .attr('fill-opacity', 0);\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.3);\n tooltip.transition()\n .duration(500)\n .style('opacity', 0);\n })\n .on('mousemove', (event) => {\n tooltip.style('left', event.pageX + 15 + 'px')\n .style('top', event.pageY + 'px');\n })\n // callback to select a year after a mouse click\n // inside a histogram bar\n .on('click', (event, d) => {\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'none');\n currentYear = d.data.x1.getUTCFullYear();\n svg.selectAll('rect.year' + currentYear)\n .attr('fill-opacity', 0.5);\n svg.selectAll('rect.yearoutline' + currentYear)\n .attr('stroke', 'black');\n yearClickCallback(currentYear);\n });\n\n // create one stroke only rectangle by displayed year\n // that will be displayed on top of the histogram when the user has selected a year\n g.append('g')\n .selectAll('rect')\n .data(yearBins)\n .enter().append('rect')\n .attr('class', d => 'yearoutline' + d.getUTCFullYear())\n .attr('fill', 'none')\n .attr('stroke', d => d.getUTCFullYear() === currentYear ? 'black' : 'none')\n .attr('x', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return x(date);\n })\n .attr('y', 0)\n .attr('height', height)\n .attr('width', d => {\n const date = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return yearWidth;\n });\n\n // add x axis with a tick for every 1st day of each year\n const xAxis = g.append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(\n d3.axisBottom(x)\n .ticks(d3.timeYear.every(1))\n .tickFormat(d => {\n const year = d.getUTCFullYear();\n if (year >= startYear) {\n return year;\n } else {\n // filter out 2014 tick label\n return '';\n }\n })\n );\n\n // shift tick labels in order to display them at the middle\n // of each year range\n xAxis.selectAll('text')\n .attr('transform', d => {\n const year = d.getUTCFullYear();\n const date = new Date(Date.UTC(year, 0, 1));\n const yearWidth = x(d3.timeYear.offset(date, 1)) - x(date);\n return 'translate(' + -yearWidth / 2 + ', 0)';\n });\n\n // add y axis for the number of visits\n g.append('g')\n .attr('class', 'axis')\n .call(d3.axisLeft(y).tickValues(yTickValues));\n\n // add legend for visit statuses\n const legendGroup = g.append('g')\n .attr('font-family', 'sans-serif')\n .attr('font-size', 10)\n .attr('text-anchor', 'end');\n\n legendGroup.append('text')\n .attr('x', width + margin.right - 5)\n .attr('y', 9.5)\n .attr('dy', '0.32em')\n .text('visit status:');\n\n const legend = legendGroup.selectAll('g')\n .data(statuses.slice().reverse())\n .enter().append('g')\n .attr('transform', (d, i) => 'translate(0,' + (i + 1) * 20 + ')');\n\n legend.append('rect')\n .attr('x', width + 2 * margin.right / 3)\n .attr('width', 19)\n .attr('height', 19)\n .attr('fill', colors);\n\n legend.append('text')\n .attr('x', width + 2 * margin.right / 3 - 5)\n .attr('y', 9.5)\n .attr('dy', '0.32em')\n .text(d => d);\n\n // add text label for the y axis\n g.append('text')\n .attr('transform', 'rotate(-90)')\n .attr('y', -margin.left)\n .attr('x', -(height / 2))\n .attr('dy', '1em')\n .style('text-anchor', 'middle')\n .text('Number of visits');\n}\n","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","var OverloadYield = require(\"./OverloadYield.js\");\nvar regeneratorDefine = require(\"./regeneratorDefine.js\");\nfunction AsyncIterator(t, e) {\n function n(r, o, i, f) {\n try {\n var c = t[r](o),\n u = c.value;\n return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {\n n(\"next\", t, i, f);\n }, function (t) {\n n(\"throw\", t, i, f);\n }) : e.resolve(u).then(function (t) {\n c.value = t, i(c);\n }, function (t) {\n return n(\"throw\", t, i, f);\n });\n } catch (t) {\n f(t);\n }\n }\n var r;\n this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, \"function\" == typeof Symbol && Symbol.asyncIterator || \"@asyncIterator\", function () {\n return this;\n })), regeneratorDefine(this, \"_invoke\", function (t, o, i) {\n function f() {\n return new e(function (e, r) {\n n(t, i, e, r);\n });\n }\n return r = r ? r.then(f, f) : f();\n }, !0);\n}\nmodule.exports = AsyncIterator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var regeneratorDefine = require(\"./regeneratorDefine.js\");\nfunction _regenerator() {\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\n var e,\n t,\n r = \"function\" == typeof Symbol ? Symbol : {},\n n = r.iterator || \"@@iterator\",\n o = r.toStringTag || \"@@toStringTag\";\n function i(r, n, o, i) {\n var c = n && n.prototype instanceof Generator ? n : Generator,\n u = Object.create(c.prototype);\n return regeneratorDefine(u, \"_invoke\", function (r, n, o) {\n var i,\n c,\n u,\n f = 0,\n p = o || [],\n y = !1,\n G = {\n p: 0,\n n: 0,\n v: e,\n a: d,\n f: d.bind(e, 4),\n d: function d(t, r) {\n return i = t, c = 0, u = e, G.n = r, a;\n }\n };\n function d(r, n) {\n for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {\n var o,\n i = p[t],\n d = G.p,\n l = i[2];\n r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));\n }\n if (o || r > 1) return a;\n throw y = !0, n;\n }\n return function (o, p, l) {\n if (f > 1) throw TypeError(\"Generator is already running\");\n for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {\n i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);\n try {\n if (f = 2, i) {\n if (c || (o = \"next\"), t = i[o]) {\n if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\");\n if (!t.done) return t;\n u = t.value, c < 2 && (c = 0);\n } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1);\n i = e;\n } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;\n } catch (t) {\n i = e, c = 1, u = t;\n } finally {\n f = 1;\n }\n }\n return {\n value: t,\n done: y\n };\n };\n }(r, o, i), !0), u;\n }\n var a = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n t = Object.getPrototypeOf;\n var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {\n return this;\n }), t),\n u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);\n function f(e) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e;\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, \"constructor\", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", regeneratorDefine(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), regeneratorDefine(u), regeneratorDefine(u, o, \"Generator\"), regeneratorDefine(u, n, function () {\n return this;\n }), regeneratorDefine(u, \"toString\", function () {\n return \"[object Generator]\";\n }), (module.exports = _regenerator = function _regenerator() {\n return {\n w: i,\n m: f\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2021 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nexport const visitStatusColor = {\n full: '#008000',\n partial: '#edc344',\n failed: '#ff0000',\n ongoing: '#0000ff',\n not_found: '#000',\n created: '#7d8080'\n};\n","function _OverloadYield(e, d) {\n this.v = e, this.k = d;\n}\nmodule.exports = _OverloadYield, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([\"exports\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.jsYearCalendar = mod.exports;\n }\n})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function (_exports) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true\n });\n _exports[\"default\"] = void 0;\n\n function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\n function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n /* =========================================================\r\n * JS year calendar v1.0.0\r\n * Repo: https://github.com/year-calendar/js-year-calendar\r\n * =========================================================\r\n * Created by Paul David-Sivelle\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ========================================================= */\n // NodeList forEach() polyfill\n if (typeof NodeList !== \"undefined\" && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = function (callback, thisArg) {\n thisArg = thisArg || window;\n\n for (var i = 0; i < this.length; i++) {\n callback.call(thisArg, this[i], i, this);\n }\n };\n } // Element closest() polyfill\n\n\n if (typeof Element !== \"undefined\" && !Element.prototype.matches) {\n var prototype = Element.prototype;\n Element.prototype.matches = prototype.msMatchesSelector || prototype.webkitMatchesSelector;\n }\n\n if (typeof Element !== \"undefined\" && !Element.prototype.closest) {\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType == 1);\n\n return null;\n };\n }\n /**\r\n * Calendar instance.\r\n */\n\n\n var Calendar = /*#__PURE__*/function () {\n /**\r\n * Fired when a day is clicked.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('clickDay', function(e) {\r\n * console.log(\"Click on day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when a day is right clicked.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('clickDay', function(e) {\r\n * console.log(\"Right click on day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the mouse enter in a day.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('mouseOnDay', function(e) {\r\n * console.log(\"Mouse enter in a day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the mouse leave a day.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('mouseOutDay', function(e) {\r\n * console.log(\"Mouse leave a day: \" + e.date + \" (\" + e.events.length + \" events)\");\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when the calendar rendering is ended.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('renderEnd', function(e) {\r\n * console.log(\"Render end for year: \" + e.currentYear);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Fired when a date range is selected.\r\n * \r\n * Don't forget to enable the `enableRangeSelection` option to be able to use the range selection functionality.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('selectRange', function(e) {\r\n * console.log(\"Select the range: \" + e.startDate + \" - \" + e.endDate);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Triggered after the changing the current year.\r\n * Works only if the calendar is used in a full year mode. Otherwise, use `periodChanged` event.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('yearChanged', function(e) {\r\n * console.log(\"New year selected: \" + e.currentYear);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Triggered after the changing the visible period.\r\n * @event\r\n * @example\r\n * ```\r\n * \r\n * document.querySelector('.calendar').addEventListener('periodChanged', function(e) {\r\n * console.log(`New period selected: ${e.startDate} ${e.endDate}`);\r\n * })\r\n * ```\r\n */\n\n /**\r\n * Create a new calendar.\r\n * @param element The element (or the selector to an element) in which the calendar should be created.\r\n * @param options [Optional] The options used to customize the calendar\r\n */\n function Calendar(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, Calendar);\n\n _defineProperty(this, \"element\", void 0);\n\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"_startDate\", void 0);\n\n _defineProperty(this, \"_dataSource\", void 0);\n\n _defineProperty(this, \"_mouseDown\", void 0);\n\n _defineProperty(this, \"_rangeStart\", void 0);\n\n _defineProperty(this, \"_rangeEnd\", void 0);\n\n _defineProperty(this, \"_responsiveInterval\", void 0);\n\n _defineProperty(this, \"_nbCols\", void 0);\n\n _defineProperty(this, \"clickDay\", void 0);\n\n _defineProperty(this, \"dayContextMenu\", void 0);\n\n _defineProperty(this, \"mouseOnDay\", void 0);\n\n _defineProperty(this, \"mouseOutDay\", void 0);\n\n _defineProperty(this, \"renderEnd\", void 0);\n\n _defineProperty(this, \"selectRange\", void 0);\n\n _defineProperty(this, \"yearChanged\", void 0);\n\n _defineProperty(this, \"periodChanged\", void 0);\n\n if (element instanceof HTMLElement) {\n this.element = element;\n } else if (typeof element === \"string\") {\n this.element = document.querySelector(element);\n } else {\n throw new Error(\"The element parameter should be a DOM node or a selector\");\n }\n\n this.element.classList.add('calendar');\n\n this._initializeEvents(options);\n\n this._initializeOptions(options);\n\n var startYear = new Date().getFullYear();\n var startMonth = 0;\n\n if (this.options.startDate) {\n startYear = this.options.startDate.getFullYear();\n startMonth = this.options.startDate.getMonth();\n } else if (this.options.startYear) {\n startYear = this.options.startYear;\n }\n\n this.setStartDate(new Date(startYear, startMonth, 1));\n }\n\n _createClass(Calendar, [{\n key: \"_initializeOptions\",\n value: function _initializeOptions(opt) {\n if (opt == null) {\n opt = {};\n }\n\n this.options = {\n startYear: !isNaN(parseInt(opt.startYear)) ? parseInt(opt.startYear) : null,\n startDate: opt.startDate instanceof Date ? opt.startDate : null,\n numberMonthsDisplayed: !isNaN(parseInt(opt.numberMonthsDisplayed)) && opt.numberMonthsDisplayed > 0 && opt.numberMonthsDisplayed <= 12 ? parseInt(opt.numberMonthsDisplayed) : 12,\n minDate: opt.minDate instanceof Date ? opt.minDate : null,\n maxDate: opt.maxDate instanceof Date ? opt.maxDate : null,\n language: opt.language != null && Calendar.locales[opt.language] != null ? opt.language : 'en',\n allowOverlap: opt.allowOverlap != null ? opt.allowOverlap : true,\n displayWeekNumber: opt.displayWeekNumber != null ? opt.displayWeekNumber : false,\n displayDisabledDataSource: opt.displayDisabledDataSource != null ? opt.displayDisabledDataSource : false,\n displayHeader: opt.displayHeader != null ? opt.displayHeader : true,\n alwaysHalfDay: opt.alwaysHalfDay != null ? opt.alwaysHalfDay : false,\n enableRangeSelection: opt.enableRangeSelection != null ? opt.enableRangeSelection : false,\n disabledDays: opt.disabledDays instanceof Array ? opt.disabledDays : [],\n disabledWeekDays: opt.disabledWeekDays instanceof Array ? opt.disabledWeekDays : [],\n hiddenWeekDays: opt.hiddenWeekDays instanceof Array ? opt.hiddenWeekDays : [],\n roundRangeLimits: opt.roundRangeLimits != null ? opt.roundRangeLimits : false,\n dataSource: opt.dataSource instanceof Array || typeof opt.dataSource === \"function\" ? opt.dataSource : [],\n style: opt.style == 'background' || opt.style == 'border' || opt.style == 'custom' ? opt.style : 'border',\n enableContextMenu: opt.enableContextMenu != null ? opt.enableContextMenu : false,\n contextMenuItems: opt.contextMenuItems instanceof Array ? opt.contextMenuItems : [],\n customDayRenderer: typeof opt.customDayRenderer === \"function\" ? opt.customDayRenderer : null,\n customDataSourceRenderer: typeof opt.customDataSourceRenderer === \"function\" ? opt.customDataSourceRenderer : null,\n weekStart: !isNaN(parseInt(opt.weekStart)) ? parseInt(opt.weekStart) : null,\n loadingTemplate: typeof opt.loadingTemplate === \"string\" || opt.loadingTemplate instanceof HTMLElement ? opt.loadingTemplate : null\n };\n\n if (this.options.dataSource instanceof Array) {\n this._dataSource = this.options.dataSource;\n\n this._initializeDatasourceColors();\n }\n }\n }, {\n key: \"_initializeEvents\",\n value: function _initializeEvents(opt) {\n if (opt == null) {\n opt = [];\n }\n\n if (opt.yearChanged) {\n this.element.addEventListener('yearChanged', opt.yearChanged);\n }\n\n if (opt.periodChanged) {\n this.element.addEventListener('periodChanged', opt.periodChanged);\n }\n\n if (opt.renderEnd) {\n this.element.addEventListener('renderEnd', opt.renderEnd);\n }\n\n if (opt.clickDay) {\n this.element.addEventListener('clickDay', opt.clickDay);\n }\n\n if (opt.dayContextMenu) {\n this.element.addEventListener('dayContextMenu', opt.dayContextMenu);\n }\n\n if (opt.selectRange) {\n this.element.addEventListener('selectRange', opt.selectRange);\n }\n\n if (opt.mouseOnDay) {\n this.element.addEventListener('mouseOnDay', opt.mouseOnDay);\n }\n\n if (opt.mouseOutDay) {\n this.element.addEventListener('mouseOutDay', opt.mouseOutDay);\n }\n }\n }, {\n key: \"_fetchDataSource\",\n value: function _fetchDataSource(callback) {\n if (typeof this.options.dataSource === \"function\") {\n var getDataSource = this.options.dataSource;\n var currentPeriod = this.getCurrentPeriod();\n var fetchParameters = {\n year: currentPeriod.startDate.getFullYear(),\n startDate: currentPeriod.startDate,\n endDate: currentPeriod.endDate\n };\n\n if (getDataSource.length == 2) {\n // 2 parameters, means callback method\n getDataSource(fetchParameters, callback);\n } else {\n // 1 parameter, means synchronous or promise method\n var result = getDataSource(fetchParameters);\n\n if (result instanceof Array) {\n callback(result);\n }\n\n if (result && result.then) {\n result.then(callback);\n }\n }\n } else {\n callback(this.options.dataSource);\n }\n }\n }, {\n key: \"_initializeDatasourceColors\",\n value: function _initializeDatasourceColors() {\n for (var i = 0; i < this._dataSource.length; i++) {\n if (this._dataSource[i].color == null) {\n this._dataSource[i].color = Calendar.colors[i % Calendar.colors.length];\n }\n }\n }\n /**\r\n * Renders the calendar.\r\n */\n\n }, {\n key: \"render\",\n value: function render() {\n var isLoading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n // Clear the calendar (faster method)\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n\n if (this.options.displayHeader) {\n this._renderHeader();\n }\n\n if (isLoading) {\n this._renderLoading();\n } else {\n this._renderBody();\n\n this._renderDataSource();\n\n this._applyEvents(); // Fade animation\n\n\n var months = this.element.querySelector('.months-container');\n months.style.opacity = '0';\n months.style.display = 'flex';\n months.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n months.style.opacity = '1';\n setTimeout(function () {\n return months.style.transition = '';\n }, 500);\n }, 0);\n var currentPeriod = this.getCurrentPeriod();\n\n this._triggerEvent('renderEnd', {\n currentYear: currentPeriod.startDate.getFullYear(),\n startDate: currentPeriod.startDate,\n endDate: currentPeriod.endDate\n });\n }\n }\n }, {\n key: \"_renderHeader\",\n value: function _renderHeader() {\n var header = document.createElement('div');\n header.classList.add('calendar-header');\n var headerTable = document.createElement('table');\n var period = this.getCurrentPeriod(); // Left arrow\n\n var prevDiv = document.createElement('th');\n prevDiv.classList.add('prev');\n\n if (this.options.minDate != null && this.options.minDate >= period.startDate) {\n prevDiv.classList.add('disabled');\n }\n\n var prevIcon = document.createElement('span');\n prevIcon.innerHTML = \"‹\";\n prevDiv.appendChild(prevIcon);\n headerTable.appendChild(prevDiv);\n\n if (this._isFullYearMode()) {\n // Year N-2\n var prev2YearDiv = document.createElement('th');\n prev2YearDiv.classList.add('year-title');\n prev2YearDiv.classList.add('year-neighbor2');\n prev2YearDiv.textContent = (this._startDate.getFullYear() - 2).toString();\n\n if (this.options.minDate != null && this.options.minDate > new Date(this._startDate.getFullYear() - 2, 11, 31)) {\n prev2YearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(prev2YearDiv); // Year N-1\n\n var prevYearDiv = document.createElement('th');\n prevYearDiv.classList.add('year-title');\n prevYearDiv.classList.add('year-neighbor');\n prevYearDiv.textContent = (this._startDate.getFullYear() - 1).toString();\n\n if (this.options.minDate != null && this.options.minDate > new Date(this._startDate.getFullYear() - 1, 11, 31)) {\n prevYearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(prevYearDiv);\n } // Current year\n\n\n var yearDiv = document.createElement('th');\n yearDiv.classList.add('year-title');\n\n if (this._isFullYearMode()) {\n yearDiv.textContent = this._startDate.getFullYear().toString();\n } else if (this.options.numberMonthsDisplayed == 12) {\n yearDiv.textContent = \"\".concat(period.startDate.getFullYear(), \" - \").concat(period.endDate.getFullYear());\n } else if (this.options.numberMonthsDisplayed > 1) {\n yearDiv.textContent = \"\".concat(Calendar.locales[this.options.language].months[period.startDate.getMonth()], \" \").concat(period.startDate.getFullYear(), \" - \").concat(Calendar.locales[this.options.language].months[period.endDate.getMonth()], \" \").concat(period.endDate.getFullYear());\n } else {\n yearDiv.textContent = \"\".concat(Calendar.locales[this.options.language].months[period.startDate.getMonth()], \" \").concat(period.startDate.getFullYear());\n }\n\n headerTable.appendChild(yearDiv);\n\n if (this._isFullYearMode()) {\n // Year N+1\n var nextYearDiv = document.createElement('th');\n nextYearDiv.classList.add('year-title');\n nextYearDiv.classList.add('year-neighbor');\n nextYearDiv.textContent = (this._startDate.getFullYear() + 1).toString();\n\n if (this.options.maxDate != null && this.options.maxDate < new Date(this._startDate.getFullYear() + 1, 0, 1)) {\n nextYearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(nextYearDiv); // Year N+2\n\n var next2YearDiv = document.createElement('th');\n next2YearDiv.classList.add('year-title');\n next2YearDiv.classList.add('year-neighbor2');\n next2YearDiv.textContent = (this._startDate.getFullYear() + 2).toString();\n\n if (this.options.maxDate != null && this.options.maxDate < new Date(this._startDate.getFullYear() + 2, 0, 1)) {\n next2YearDiv.classList.add('disabled');\n }\n\n headerTable.appendChild(next2YearDiv);\n } // Right arrow\n\n\n var nextDiv = document.createElement('th');\n nextDiv.classList.add('next');\n\n if (this.options.maxDate != null && this.options.maxDate <= period.endDate) {\n nextDiv.classList.add('disabled');\n }\n\n var nextIcon = document.createElement('span');\n nextIcon.innerHTML = \"›\";\n nextDiv.appendChild(nextIcon);\n headerTable.appendChild(nextDiv);\n header.appendChild(headerTable);\n this.element.appendChild(header);\n }\n }, {\n key: \"_renderBody\",\n value: function _renderBody() {\n var monthsDiv = document.createElement('div');\n monthsDiv.classList.add('months-container');\n var monthStartDate = new Date(this._startDate.getTime());\n\n for (var m = 0; m < this.options.numberMonthsDisplayed; m++) {\n /* Container */\n var monthDiv = document.createElement('div');\n monthDiv.classList.add('month-container');\n monthDiv.dataset.monthId = m.toString();\n\n if (this._nbCols) {\n monthDiv.classList.add(\"month-\".concat(this._nbCols));\n }\n\n var table = document.createElement('table');\n table.classList.add('month');\n /* Month header */\n\n var thead = document.createElement('thead');\n var titleRow = document.createElement('tr');\n var titleCell = document.createElement('th');\n titleCell.classList.add('month-title');\n titleCell.setAttribute('colspan', this.options.displayWeekNumber ? '8' : '7');\n titleCell.textContent = Calendar.locales[this.options.language].months[monthStartDate.getMonth()];\n titleRow.appendChild(titleCell);\n thead.appendChild(titleRow);\n var headerRow = document.createElement('tr');\n\n if (this.options.displayWeekNumber) {\n var weekNumberCell = document.createElement('th');\n weekNumberCell.classList.add('week-number');\n weekNumberCell.textContent = Calendar.locales[this.options.language].weekShort;\n headerRow.appendChild(weekNumberCell);\n }\n\n var weekStart = this.getWeekStart();\n var d = weekStart;\n\n do {\n var headerCell = document.createElement('th');\n headerCell.classList.add('day-header');\n headerCell.textContent = Calendar.locales[this.options.language].daysMin[d];\n\n if (this._isHidden(d)) {\n headerCell.classList.add('hidden');\n }\n\n headerRow.appendChild(headerCell);\n d++;\n if (d >= 7) d = 0;\n } while (d != weekStart);\n\n thead.appendChild(headerRow);\n table.appendChild(thead);\n /* Days */\n\n var currentDate = new Date(monthStartDate.getTime());\n var lastDate = new Date(monthStartDate.getFullYear(), monthStartDate.getMonth() + 1, 0);\n\n while (currentDate.getDay() != weekStart) {\n currentDate.setDate(currentDate.getDate() - 1);\n }\n\n while (currentDate <= lastDate) {\n var row = document.createElement('tr');\n\n if (this.options.displayWeekNumber) {\n var weekNumberCell = document.createElement('td');\n var currentThursday = new Date(currentDate.getTime()); // Week number is computed based on the thursday\n\n currentThursday.setDate(currentThursday.getDate() - weekStart + 4);\n weekNumberCell.classList.add('week-number');\n weekNumberCell.textContent = this.getWeekNumber(currentThursday).toString();\n row.appendChild(weekNumberCell);\n }\n\n do {\n var cell = document.createElement('td');\n cell.classList.add('day');\n\n if (this._isHidden(currentDate.getDay())) {\n cell.classList.add('hidden');\n }\n\n if (currentDate < monthStartDate) {\n cell.classList.add('old');\n } else if (currentDate > lastDate) {\n cell.classList.add('new');\n } else {\n if (this._isDisabled(currentDate)) {\n cell.classList.add('disabled');\n }\n\n var cellContent = document.createElement('div');\n cellContent.classList.add('day-content');\n cellContent.textContent = currentDate.getDate().toString();\n cell.appendChild(cellContent);\n\n if (this.options.customDayRenderer) {\n this.options.customDayRenderer(cellContent, currentDate);\n }\n }\n\n row.appendChild(cell);\n currentDate.setDate(currentDate.getDate() + 1);\n } while (currentDate.getDay() != weekStart);\n\n table.appendChild(row);\n }\n\n monthDiv.appendChild(table);\n monthsDiv.appendChild(monthDiv);\n monthStartDate.setMonth(monthStartDate.getMonth() + 1);\n }\n\n this.element.appendChild(monthsDiv);\n }\n }, {\n key: \"_renderLoading\",\n value: function _renderLoading() {\n var container = document.createElement('div');\n container.classList.add('calendar-loading-container');\n container.style.minHeight = this._nbCols * 200 + 'px';\n var loading = document.createElement('div');\n loading.classList.add('calendar-loading');\n\n if (this.options.loadingTemplate) {\n if (typeof this.options.loadingTemplate === \"string\") {\n loading.innerHTML = this.options.loadingTemplate;\n } else if (this.options.loadingTemplate instanceof HTMLElement) {\n loading.appendChild(this.options.loadingTemplate);\n }\n } else {\n var spinner = document.createElement('div');\n spinner.classList.add('calendar-spinner');\n\n for (var i = 1; i <= 3; i++) {\n var bounce = document.createElement('div');\n bounce.classList.add(\"bounce\".concat(i));\n spinner.appendChild(bounce);\n }\n\n loading.appendChild(spinner);\n }\n\n container.appendChild(loading);\n this.element.appendChild(container);\n }\n }, {\n key: \"_renderDataSource\",\n value: function _renderDataSource() {\n var _this = this;\n\n if (this._dataSource != null && this._dataSource.length > 0) {\n this.element.querySelectorAll('.month-container').forEach(function (month) {\n var monthId = parseInt(month.dataset.monthId);\n\n var currentYear = _this._startDate.getFullYear();\n\n var currentMonth = _this._startDate.getMonth() + monthId;\n var firstDate = new Date(currentYear, currentMonth, 1);\n var lastDate = new Date(currentYear, currentMonth + 1, 1);\n\n if ((_this.options.minDate == null || lastDate > _this.options.minDate) && (_this.options.maxDate == null || firstDate <= _this.options.maxDate)) {\n var monthData = [];\n\n for (var i = 0; i < _this._dataSource.length; i++) {\n if (!(_this._dataSource[i].startDate >= lastDate) || _this._dataSource[i].endDate < firstDate) {\n monthData.push(_this._dataSource[i]);\n }\n }\n\n if (monthData.length > 0) {\n month.querySelectorAll('.day-content').forEach(function (day) {\n var currentDate = new Date(currentYear, currentMonth, parseInt(day.textContent));\n var nextDate = new Date(currentYear, currentMonth, currentDate.getDate() + 1);\n var dayData = [];\n\n if ((_this.options.minDate == null || currentDate >= _this.options.minDate) && (_this.options.maxDate == null || currentDate <= _this.options.maxDate)) {\n for (var i = 0; i < monthData.length; i++) {\n if (monthData[i].startDate < nextDate && monthData[i].endDate >= currentDate) {\n dayData.push(monthData[i]);\n }\n }\n\n if (dayData.length > 0 && (_this.options.displayDisabledDataSource || !_this._isDisabled(currentDate))) {\n _this._renderDataSourceDay(day, currentDate, dayData);\n }\n }\n });\n }\n }\n });\n }\n }\n }, {\n key: \"_renderDataSourceDay\",\n value: function _renderDataSourceDay(elt, currentDate, events) {\n var parent = elt.parentElement;\n\n switch (this.options.style) {\n case 'border':\n var weight = 0;\n\n if (events.length == 1) {\n weight = 4;\n } else if (events.length <= 3) {\n weight = 2;\n } else {\n parent.style.boxShadow = 'inset 0 -4px 0 0 black';\n }\n\n if (weight > 0) {\n var boxShadow = '';\n\n for (var i = 0; i < events.length; i++) {\n if (boxShadow != '') {\n boxShadow += \",\";\n }\n\n boxShadow += \"inset 0 -\".concat((i + 1) * weight, \"px 0 0 \").concat(events[i].color);\n }\n\n parent.style.boxShadow = boxShadow;\n }\n\n break;\n\n case 'background':\n parent.style.backgroundColor = events[events.length - 1].color;\n var currentTime = currentDate.getTime();\n\n if (events[events.length - 1].startDate.getTime() == currentTime) {\n parent.classList.add('day-start');\n\n if (events[events.length - 1].startHalfDay || this.options.alwaysHalfDay) {\n parent.classList.add('day-half'); // Find color for other half\n\n var otherColor = 'transparent';\n\n for (var i = events.length - 2; i >= 0; i--) {\n if (events[i].startDate.getTime() != currentTime || !events[i].startHalfDay && !this.options.alwaysHalfDay) {\n otherColor = events[i].color;\n break;\n }\n }\n\n parent.style.background = \"linear-gradient(-45deg, \".concat(events[events.length - 1].color, \", \").concat(events[events.length - 1].color, \" 49%, \").concat(otherColor, \" 51%, \").concat(otherColor, \")\");\n } else if (this.options.roundRangeLimits) {\n parent.classList.add('round-left');\n }\n } else if (events[events.length - 1].endDate.getTime() == currentTime) {\n parent.classList.add('day-end');\n\n if (events[events.length - 1].endHalfDay || this.options.alwaysHalfDay) {\n parent.classList.add('day-half'); // Find color for other half\n\n var otherColor = 'transparent';\n\n for (var i = events.length - 2; i >= 0; i--) {\n if (events[i].endDate.getTime() != currentTime || !events[i].endHalfDay && !this.options.alwaysHalfDay) {\n otherColor = events[i].color;\n break;\n }\n }\n\n parent.style.background = \"linear-gradient(135deg, \".concat(events[events.length - 1].color, \", \").concat(events[events.length - 1].color, \" 49%, \").concat(otherColor, \" 51%, \").concat(otherColor, \")\");\n } else if (this.options.roundRangeLimits) {\n parent.classList.add('round-right');\n }\n }\n\n break;\n\n case 'custom':\n if (this.options.customDataSourceRenderer) {\n this.options.customDataSourceRenderer.call(this, elt, currentDate, events);\n }\n\n break;\n }\n }\n }, {\n key: \"_applyEvents\",\n value: function _applyEvents() {\n var _this2 = this;\n\n if (this.options.displayHeader) {\n /* Header buttons */\n this.element.querySelectorAll('.year-neighbor, .year-neighbor2').forEach(function (element) {\n element.addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n _this2.setYear(parseInt(e.currentTarget.textContent));\n }\n });\n });\n this.element.querySelector('.calendar-header .prev').addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n var months = _this2.element.querySelector('.months-container');\n\n months.style.transition = 'margin-left 0.1s';\n months.style.marginLeft = '100%';\n setTimeout(function () {\n months.style.visibility = 'hidden';\n months.style.transition = '';\n months.style.marginLeft = '0';\n setTimeout(function () {\n _this2.setStartDate(new Date(_this2._startDate.getFullYear(), _this2._startDate.getMonth() - _this2.options.numberMonthsDisplayed, 1));\n }, 50);\n }, 100);\n }\n });\n this.element.querySelector('.calendar-header .next').addEventListener('click', function (e) {\n if (!e.currentTarget.classList.contains('disabled')) {\n var months = _this2.element.querySelector('.months-container');\n\n months.style.transition = 'margin-left 0.1s';\n months.style.marginLeft = '-100%';\n setTimeout(function () {\n months.style.visibility = 'hidden';\n months.style.transition = '';\n months.style.marginLeft = '0';\n setTimeout(function () {\n _this2.setStartDate(new Date(_this2._startDate.getFullYear(), _this2._startDate.getMonth() + _this2.options.numberMonthsDisplayed, 1));\n }, 50);\n }, 100);\n }\n });\n }\n\n var cells = this.element.querySelectorAll('.day:not(.old):not(.new):not(.disabled)');\n cells.forEach(function (cell) {\n /* Click on date */\n cell.addEventListener('click', function (e) {\n e.stopPropagation();\n\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('clickDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n /* Click right on date */\n\n cell.addEventListener('contextmenu', function (e) {\n if (_this2.options.enableContextMenu) {\n e.preventDefault();\n\n if (_this2.options.contextMenuItems.length > 0) {\n _this2._openContextMenu(e.currentTarget);\n }\n }\n\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('dayContextMenu', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n /* Range selection */\n\n if (_this2.options.enableRangeSelection) {\n cell.addEventListener('mousedown', function (e) {\n if (e.which == 1) {\n var currentDate = _this2._getDate(e.currentTarget);\n\n if (_this2.options.allowOverlap || _this2.isThereFreeSlot(currentDate)) {\n _this2._mouseDown = true;\n _this2._rangeStart = _this2._rangeEnd = currentDate;\n\n _this2._refreshRange();\n }\n }\n });\n cell.addEventListener('mouseenter', function (e) {\n if (_this2._mouseDown) {\n var currentDate = _this2._getDate(e.currentTarget);\n\n if (!_this2.options.allowOverlap) {\n var newDate = new Date(_this2._rangeStart.getTime());\n\n if (newDate < currentDate) {\n var nextDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate() + 1);\n\n while (newDate < currentDate) {\n if (!_this2.isThereFreeSlot(nextDate, false)) {\n break;\n }\n\n newDate.setDate(newDate.getDate() + 1);\n nextDate.setDate(nextDate.getDate() + 1);\n }\n } else {\n var nextDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate() - 1);\n\n while (newDate > currentDate) {\n if (!_this2.isThereFreeSlot(nextDate, true)) {\n break;\n }\n\n newDate.setDate(newDate.getDate() - 1);\n nextDate.setDate(nextDate.getDate() - 1);\n }\n }\n\n currentDate = newDate;\n }\n\n var oldValue = _this2._rangeEnd;\n _this2._rangeEnd = currentDate;\n\n if (oldValue.getTime() != _this2._rangeEnd.getTime()) {\n _this2._refreshRange();\n }\n }\n });\n }\n /* Hover date */\n\n\n cell.addEventListener('mouseenter', function (e) {\n if (!_this2._mouseDown) {\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('mouseOnDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n }\n });\n cell.addEventListener('mouseleave', function (e) {\n var date = _this2._getDate(e.currentTarget);\n\n _this2._triggerEvent('mouseOutDay', {\n element: e.currentTarget,\n date: date,\n events: _this2.getEvents(date)\n });\n });\n });\n\n if (this.options.enableRangeSelection) {\n // Release range selection\n window.addEventListener('mouseup', function (e) {\n if (_this2._mouseDown) {\n _this2._mouseDown = false;\n\n _this2._refreshRange();\n\n var minDate = _this2._rangeStart < _this2._rangeEnd ? _this2._rangeStart : _this2._rangeEnd;\n var maxDate = _this2._rangeEnd > _this2._rangeStart ? _this2._rangeEnd : _this2._rangeStart;\n\n _this2._triggerEvent('selectRange', {\n startDate: minDate,\n endDate: maxDate,\n events: _this2.getEventsOnRange(minDate, new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate() + 1))\n });\n }\n });\n }\n /* Responsive management */\n\n\n if (this._responsiveInterval) {\n clearInterval(this._responsiveInterval);\n this._responsiveInterval = null;\n }\n\n this._responsiveInterval = setInterval(function () {\n if (_this2.element.querySelector('.month') == null) {\n return;\n }\n\n var calendarSize = _this2.element.offsetWidth;\n var monthSize = _this2.element.querySelector('.month').offsetWidth + 10;\n _this2._nbCols = null;\n\n if (monthSize * 6 < calendarSize && _this2.options.numberMonthsDisplayed >= 6) {\n _this2._nbCols = 2;\n } else if (monthSize * 4 < calendarSize && _this2.options.numberMonthsDisplayed >= 4) {\n _this2._nbCols = 3;\n } else if (monthSize * 3 < calendarSize && _this2.options.numberMonthsDisplayed >= 3) {\n _this2._nbCols = 4;\n } else if (monthSize * 2 < calendarSize && _this2.options.numberMonthsDisplayed >= 2) {\n _this2._nbCols = 6;\n } else {\n _this2._nbCols = 12;\n }\n\n _this2.element.querySelectorAll('.month-container').forEach(function (month) {\n if (!month.classList.contains(\"month-\".concat(_this2._nbCols))) {\n ['month-2', 'month-3', 'month-4', 'month-6', 'month-12'].forEach(function (className) {\n month.classList.remove(className);\n });\n month.classList.add(\"month-\".concat(_this2._nbCols));\n }\n });\n }, 300);\n }\n }, {\n key: \"_refreshRange\",\n value: function _refreshRange() {\n var _this3 = this;\n\n this.element.querySelectorAll('td.day.range').forEach(function (day) {\n return day.classList.remove('range');\n });\n this.element.querySelectorAll('td.day.range-start').forEach(function (day) {\n return day.classList.remove('range-start');\n });\n this.element.querySelectorAll('td.day.range-end').forEach(function (day) {\n return day.classList.remove('range-end');\n });\n\n if (this._mouseDown) {\n var minDate = this._rangeStart < this._rangeEnd ? this._rangeStart : this._rangeEnd;\n var maxDate = this._rangeEnd > this._rangeStart ? this._rangeEnd : this._rangeStart;\n this.element.querySelectorAll('.month-container').forEach(function (month) {\n var monthId = parseInt(month.dataset.monthId);\n var monthStartDate = new Date(_this3._startDate.getFullYear(), _this3._startDate.getMonth() + monthId, 1);\n var monthEndDate = new Date(_this3._startDate.getFullYear(), _this3._startDate.getMonth() + monthId + 1, 1);\n\n if (minDate.getTime() < monthEndDate.getTime() && maxDate.getTime() >= monthStartDate.getTime()) {\n month.querySelectorAll('td.day:not(.old):not(.new)').forEach(function (day) {\n var date = _this3._getDate(day);\n\n if (date >= minDate && date <= maxDate) {\n day.classList.add('range');\n\n if (date.getTime() == minDate.getTime()) {\n day.classList.add('range-start');\n }\n\n if (date.getTime() == maxDate.getTime()) {\n day.classList.add('range-end');\n }\n }\n });\n }\n });\n }\n }\n }, {\n key: \"_getElementPosition\",\n value: function _getElementPosition(element) {\n var top = 0,\n left = 0;\n\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n }\n }, {\n key: \"_openContextMenu\",\n value: function _openContextMenu(elt) {\n var _this4 = this;\n\n var contextMenu = document.querySelector('.calendar-context-menu');\n\n if (contextMenu !== null) {\n contextMenu.style.display = 'none'; // Clear the context menu (faster method)\n\n while (contextMenu.firstChild) {\n contextMenu.removeChild(contextMenu.firstChild);\n }\n } else {\n contextMenu = document.createElement('div');\n contextMenu.classList.add('calendar-context-menu');\n document.body.appendChild(contextMenu);\n }\n\n var date = this._getDate(elt);\n\n var events = this.getEvents(date);\n\n for (var i = 0; i < events.length; i++) {\n var eventItem = document.createElement('div');\n eventItem.classList.add('item');\n eventItem.style.paddingLeft = '4px';\n eventItem.style.boxShadow = \"inset 4px 0 0 0 \".concat(events[i].color);\n var eventItemContent = document.createElement('div');\n eventItemContent.classList.add('content');\n var text = document.createElement('span');\n text.classList.add('text');\n text.textContent = events[i].name;\n eventItemContent.appendChild(text);\n var icon = document.createElement('span');\n icon.classList.add('arrow');\n icon.innerHTML = \"›\";\n eventItemContent.appendChild(icon);\n eventItem.appendChild(eventItemContent);\n\n this._renderContextMenuItems(eventItem, this.options.contextMenuItems, events[i]);\n\n contextMenu.appendChild(eventItem);\n }\n\n if (contextMenu.children.length > 0) {\n var position = this._getElementPosition(elt);\n\n contextMenu.style.left = position.left + 25 + 'px';\n contextMenu.style.right = '';\n contextMenu.style.top = position.top + 25 + 'px';\n contextMenu.style.display = 'block';\n\n if (contextMenu.getBoundingClientRect().right > document.body.offsetWidth) {\n contextMenu.style.left = '';\n contextMenu.style.right = '0';\n } // Launch the position check once the whole context menu tree will be rendered\n\n\n setTimeout(function () {\n return _this4._checkContextMenuItemsPosition();\n }, 0);\n\n var closeContextMenu = function closeContextMenu(event) {\n if (event.type !== 'click' || !contextMenu.contains(event.target)) {\n contextMenu.style.display = 'none';\n window.removeEventListener('click', closeContextMenu);\n window.removeEventListener('resize', closeContextMenu);\n window.removeEventListener('scroll', closeContextMenu);\n }\n };\n\n window.addEventListener('click', closeContextMenu);\n window.addEventListener('resize', closeContextMenu);\n window.addEventListener('scroll', closeContextMenu);\n }\n }\n }, {\n key: \"_renderContextMenuItems\",\n value: function _renderContextMenuItems(parent, items, evt) {\n var subMenu = document.createElement('div');\n subMenu.classList.add('submenu');\n\n for (var i = 0; i < items.length; i++) {\n if (items[i].visible === false || typeof items[i].visible === \"function\" && !items[i].visible(evt)) {\n continue;\n }\n\n var menuItem = document.createElement('div');\n menuItem.classList.add('item');\n var menuItemContent = document.createElement('div');\n menuItemContent.classList.add('content');\n var text = document.createElement('span');\n text.classList.add('text');\n text.textContent = items[i].text;\n menuItemContent.appendChild(text);\n\n if (items[i].click) {\n (function (index) {\n menuItemContent.addEventListener('click', function () {\n document.querySelector('.calendar-context-menu').style.display = 'none';\n items[index].click(evt);\n });\n })(i);\n }\n\n menuItem.appendChild(menuItemContent);\n\n if (items[i].items && items[i].items.length > 0) {\n var icon = document.createElement('span');\n icon.classList.add('arrow');\n icon.innerHTML = \"›\";\n menuItemContent.appendChild(icon);\n\n this._renderContextMenuItems(menuItem, items[i].items, evt);\n }\n\n subMenu.appendChild(menuItem);\n }\n\n if (subMenu.children.length > 0) {\n parent.appendChild(subMenu);\n }\n }\n }, {\n key: \"_checkContextMenuItemsPosition\",\n value: function _checkContextMenuItemsPosition() {\n var menus = document.querySelectorAll('.calendar-context-menu .submenu');\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n htmlMenu.style.display = 'block';\n htmlMenu.style.visibility = 'hidden';\n });\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n\n if (htmlMenu.getBoundingClientRect().right > document.body.offsetWidth) {\n htmlMenu.classList.add('open-left');\n } else {\n htmlMenu.classList.remove('open-left');\n }\n });\n menus.forEach(function (menu) {\n var htmlMenu = menu;\n htmlMenu.style.display = '';\n htmlMenu.style.visibility = '';\n });\n }\n }, {\n key: \"_getDate\",\n value: function _getDate(elt) {\n var day = elt.querySelector('.day-content').textContent;\n var monthId = parseInt(elt.closest('.month-container').dataset.monthId);\n return new Date(this._startDate.getFullYear(), this._startDate.getMonth() + monthId, day);\n }\n }, {\n key: \"_triggerEvent\",\n value: function _triggerEvent(eventName, parameters) {\n var event = null;\n\n if (typeof Event === \"function\") {\n event = new Event(eventName);\n } else {\n event = document.createEvent('Event');\n event.initEvent(eventName, false, false);\n }\n\n event.calendar = this;\n\n for (var i in parameters) {\n event[i] = parameters[i];\n }\n\n this.element.dispatchEvent(event);\n return event;\n }\n }, {\n key: \"_isDisabled\",\n value: function _isDisabled(date) {\n if (this.options.minDate != null && date < this.options.minDate || this.options.maxDate != null && date > this.options.maxDate) {\n return true;\n }\n\n if (this.options.disabledWeekDays.length > 0) {\n for (var d = 0; d < this.options.disabledWeekDays.length; d++) {\n if (date.getDay() == this.options.disabledWeekDays[d]) {\n return true;\n }\n }\n }\n\n if (this.options.disabledDays.length > 0) {\n for (var d = 0; d < this.options.disabledDays.length; d++) {\n if (date.getTime() == this.options.disabledDays[d].getTime()) {\n return true;\n }\n }\n }\n\n return false;\n }\n }, {\n key: \"_isHidden\",\n value: function _isHidden(day) {\n if (this.options.hiddenWeekDays.length > 0) {\n for (var d = 0; d < this.options.hiddenWeekDays.length; d++) {\n if (day == this.options.hiddenWeekDays[d]) {\n return true;\n }\n }\n }\n\n return false;\n }\n }, {\n key: \"_isFullYearMode\",\n value: function _isFullYearMode() {\n return this._startDate.getMonth() == 0 && this.options.numberMonthsDisplayed == 12;\n }\n /**\r\n * Gets the week number for a specified date.\r\n *\r\n * @param date The specified date.\r\n */\n\n }, {\n key: \"getWeekNumber\",\n value: function getWeekNumber(date) {\n // Algorithm from https://weeknumber.net/how-to/javascript\n var workingDate = new Date(date.getTime());\n workingDate.setHours(0, 0, 0, 0); // Thursday in current week decides the year.\n\n workingDate.setDate(workingDate.getDate() + 3 - (workingDate.getDay() + 6) % 7); // January 4 is always in week 1.\n\n var week1 = new Date(workingDate.getFullYear(), 0, 4); // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n\n return 1 + Math.round(((workingDate.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n }\n /**\r\n * Gets the data source elements for a specified day.\r\n *\r\n * @param date The specified day.\r\n */\n\n }, {\n key: \"getEvents\",\n value: function getEvents(date) {\n return this.getEventsOnRange(date, new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1));\n }\n /**\r\n * Gets the data source elements for a specified range of days.\r\n *\r\n * @param startDate The beginning of the day range (inclusive).\r\n * @param endDate The end of the day range (non inclusive).\r\n */\n\n }, {\n key: \"getEventsOnRange\",\n value: function getEventsOnRange(startDate, endDate) {\n var events = [];\n\n if (this._dataSource && startDate && endDate) {\n for (var i = 0; i < this._dataSource.length; i++) {\n if (this._dataSource[i].startDate < endDate && this._dataSource[i].endDate >= startDate) {\n events.push(this._dataSource[i]);\n }\n }\n }\n\n return events;\n }\n /**\r\n * Check if there is no event on the first part, last part or on the whole specified day.\r\n *\r\n * @param date The specified day.\r\n * @param after Whether to check for a free slot on the first part (if `false`) or the last part (if `true`) of the day. If `null`, this will check on the whole day.\r\n * \r\n * Usefull only if using the `alwaysHalfDay` option of the calendar, or the `startHalfDay` or `endHalfDay` option of the datasource.\r\n */\n\n }, {\n key: \"isThereFreeSlot\",\n value: function isThereFreeSlot(date) {\n var _this5 = this;\n\n var after = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var events = this.getEvents(date);\n\n if (after === true) {\n return !events.some(function (evt) {\n return !_this5.options.alwaysHalfDay && !evt.endHalfDay || evt.endDate > date;\n });\n } else if (after === false) {\n return !events.some(function (evt) {\n return !_this5.options.alwaysHalfDay && !evt.startHalfDay || evt.startDate < date;\n });\n } else {\n return this.isThereFreeSlot(date, false) || this.isThereFreeSlot(date, true);\n }\n }\n /**\r\n * Gets the period displayed on the calendar.\r\n */\n\n }, {\n key: \"getCurrentPeriod\",\n value: function getCurrentPeriod() {\n var startDate = new Date(this._startDate.getTime());\n var endDate = new Date(this._startDate.getTime());\n endDate.setMonth(endDate.getMonth() + this.options.numberMonthsDisplayed);\n endDate.setTime(endDate.getTime() - 1);\n return {\n startDate: startDate,\n endDate: endDate\n };\n }\n /**\r\n * Gets the year displayed on the calendar.\r\n * If the calendar is not used in a full year configuration, this will return the year of the first date displayed in the calendar.\r\n */\n\n }, {\n key: \"getYear\",\n value: function getYear() {\n return this._isFullYearMode() ? this._startDate.getFullYear() : null;\n }\n /**\r\n * Sets the year displayed on the calendar.\r\n * If the calendar is not used in a full year configuration, this will set the start date to January 1st of the given year.\r\n *\r\n * @param year The year to displayed on the calendar.\r\n */\n\n }, {\n key: \"setYear\",\n value: function setYear(year) {\n var parsedYear = parseInt(year);\n\n if (!isNaN(parsedYear)) {\n this.setStartDate(new Date(parsedYear, 0, 1));\n }\n }\n /**\r\n * Gets the first date displayed on the calendar.\r\n */\n\n }, {\n key: \"getStartDate\",\n value: function getStartDate() {\n return this._startDate;\n }\n /**\r\n * Sets the first date that should be displayed on the calendar.\r\n *\r\n * @param startDate The first date that should be displayed on the calendar.\r\n */\n\n }, {\n key: \"setStartDate\",\n value: function setStartDate(startDate) {\n var _this6 = this;\n\n if (startDate instanceof Date) {\n this.options.startDate = startDate;\n this._startDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1); // Clear the calendar (faster method)\n\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n\n if (this.options.displayHeader) {\n this._renderHeader();\n }\n\n var newPeriod = this.getCurrentPeriod();\n\n var periodEventResult = this._triggerEvent('periodChanged', {\n startDate: newPeriod.startDate,\n endDate: newPeriod.endDate,\n preventRendering: false\n });\n\n var yearEventResult = null;\n\n if (this._isFullYearMode()) {\n yearEventResult = this._triggerEvent('yearChanged', {\n currentYear: this._startDate.getFullYear(),\n preventRendering: false\n });\n }\n\n if (typeof this.options.dataSource === \"function\") {\n this.render(true);\n\n this._fetchDataSource(function (dataSource) {\n _this6._dataSource = dataSource;\n\n _this6._initializeDatasourceColors();\n\n _this6.render(false);\n });\n } else {\n if (!periodEventResult.preventRendering && (!yearEventResult || !yearEventResult.preventRedering)) {\n this.render();\n }\n }\n }\n }\n /**\r\n * Gets the number of months displayed by the calendar.\r\n */\n\n }, {\n key: \"getNumberMonthsDisplayed\",\n value: function getNumberMonthsDisplayed() {\n return this.options.numberMonthsDisplayed;\n }\n /**\r\n * Sets the number of months displayed that should be displayed by the calendar.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param numberMonthsDisplayed Number of months that should be displayed by the calendar.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setNumberMonthsDisplayed\",\n value: function setNumberMonthsDisplayed(numberMonthsDisplayed) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var parsedNumber = parseInt(numberMonthsDisplayed);\n\n if (!isNaN(parsedNumber) && parsedNumber > 0 && parsedNumber <= 12) {\n this.options.numberMonthsDisplayed = parsedNumber;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the minimum date of the calendar.\r\n */\n\n }, {\n key: \"getMinDate\",\n value: function getMinDate() {\n return this.options.minDate;\n }\n /**\r\n * Sets the minimum date of the calendar.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param minDate The minimum date to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setMinDate\",\n value: function setMinDate(date) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (date instanceof Date || date === null) {\n this.options.minDate = date;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the maximum date of the calendar.\r\n */\n\n }, {\n key: \"getMaxDate\",\n value: function getMaxDate() {\n return this.options.maxDate;\n }\n /**\r\n * Sets the maximum date of the calendar. \r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param maxDate The maximum date to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setMaxDate\",\n value: function setMaxDate(date) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (date instanceof Date || date === null) {\n this.options.maxDate = date;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the current style used for displaying data source.\r\n */\n\n }, {\n key: \"getStyle\",\n value: function getStyle() {\n return this.options.style;\n }\n /**\r\n * Sets the style to use for displaying data source. \r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param style The style to use for displaying data source (\"background\", \"border\" or \"custom\").\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setStyle\",\n value: function setStyle(style) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.style = style == 'background' || style == 'border' || style == 'custom' ? style : 'border';\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the user can select a range which overlapping an other element present in the datasource.\r\n */\n\n }, {\n key: \"getAllowOverlap\",\n value: function getAllowOverlap() {\n return this.options.allowOverlap;\n }\n /**\r\n * Sets a value indicating whether the user can select a range which overlapping an other element present in the datasource.\r\n *\r\n * @param allowOverlap Indicates whether the user can select a range which overlapping an other element present in the datasource.\r\n */\n\n }, {\n key: \"setAllowOverlap\",\n value: function setAllowOverlap(allowOverlap) {\n this.options.allowOverlap = allowOverlap;\n }\n /**\r\n * Gets a value indicating whether the weeks number are displayed.\r\n */\n\n }, {\n key: \"getDisplayWeekNumber\",\n value: function getDisplayWeekNumber() {\n return this.options.displayWeekNumber;\n }\n /**\r\n * Sets a value indicating whether the weeks number are displayed.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayWeekNumber Indicates whether the weeks number are displayed.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayWeekNumber\",\n value: function setDisplayWeekNumber(displayWeekNumber) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayWeekNumber = displayWeekNumber;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the calendar header is displayed.\r\n */\n\n }, {\n key: \"getDisplayHeader\",\n value: function getDisplayHeader() {\n return this.options.displayHeader;\n }\n /**\r\n * Sets a value indicating whether the calendar header is displayed.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayHeader Indicates whether the calendar header is displayed.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayHeader\",\n value: function setDisplayHeader(displayHeader) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayHeader = displayHeader;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the data source must be rendered on disabled days.\r\n */\n\n }, {\n key: \"getDisplayDisabledDataSource\",\n value: function getDisplayDisabledDataSource() {\n return this.options.displayDisabledDataSource;\n }\n /**\r\n * Sets a value indicating whether the data source must be rendered on disabled days.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param displayDisabledDataSource Indicates whether the data source must be rendered on disabled days.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisplayDisabledDataSource\",\n value: function setDisplayDisabledDataSource(displayDisabledDataSource) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.displayDisabledDataSource = displayDisabledDataSource;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the beginning and the end of each range should be displayed as half selected day.\r\n */\n\n }, {\n key: \"getAlwaysHalfDay\",\n value: function getAlwaysHalfDay() {\n return this.options.alwaysHalfDay;\n }\n /**\r\n * Sets a value indicating whether the beginning and the end of each range should be displayed as half selected day.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param alwaysHalfDay Indicates whether the beginning and the end of each range should be displayed as half selected day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setAlwaysHalfDay\",\n value: function setAlwaysHalfDay(alwaysHalfDay) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.alwaysHalfDay = alwaysHalfDay;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the user can make range selection.\r\n */\n\n }, {\n key: \"getEnableRangeSelection\",\n value: function getEnableRangeSelection() {\n return this.options.enableRangeSelection;\n }\n /**\r\n * Sets a value indicating whether the user can make range selection.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param enableRangeSelection Indicates whether the user can make range selection.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setEnableRangeSelection\",\n value: function setEnableRangeSelection(enableRangeSelection) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.enableRangeSelection = enableRangeSelection;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the disabled days.\r\n */\n\n }, {\n key: \"getDisabledDays\",\n value: function getDisabledDays() {\n return this.options.disabledDays;\n }\n /**\r\n * Sets the disabled days.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param disableDays The disabled days to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisabledDays\",\n value: function setDisabledDays(disabledDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.disabledDays = disabledDays instanceof Array ? disabledDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the disabled days of the week.\r\n */\n\n }, {\n key: \"getDisabledWeekDays\",\n value: function getDisabledWeekDays() {\n return this.options.disabledWeekDays;\n }\n /**\r\n * Sets the disabled days of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param disabledWeekDays The disabled days of the week to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDisabledWeekDays\",\n value: function setDisabledWeekDays(disabledWeekDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.disabledWeekDays = disabledWeekDays instanceof Array ? disabledWeekDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the hidden days of the week.\r\n */\n\n }, {\n key: \"getHiddenWeekDays\",\n value: function getHiddenWeekDays() {\n return this.options.hiddenWeekDays;\n }\n /**\r\n * Sets the hidden days of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param hiddenWeekDays The hidden days of the week to set.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setHiddenWeekDays\",\n value: function setHiddenWeekDays(hiddenWeekDays) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.hiddenWeekDays = hiddenWeekDays instanceof Array ? hiddenWeekDays : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the beginning and the end of each range should be displayed as rounded cells.\r\n */\n\n }, {\n key: \"getRoundRangeLimits\",\n value: function getRoundRangeLimits() {\n return this.options.roundRangeLimits;\n }\n /**\r\n * Sets a value indicating whether the beginning and the end of each range should be displayed as rounded cells.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param roundRangeLimits Indicates whether the beginning and the end of each range should be displayed as rounded cells. \r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setRoundRangeLimits\",\n value: function setRoundRangeLimits(roundRangeLimits) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.roundRangeLimits = roundRangeLimits;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets a value indicating whether the default context menu must be displayed when right clicking on a day.\r\n */\n\n }, {\n key: \"getEnableContextMenu\",\n value: function getEnableContextMenu() {\n return this.options.enableContextMenu;\n }\n /**\r\n * Sets a value indicating whether the default context menu must be displayed when right clicking on a day. \r\n * \r\n * This method causes a refresh of the calendar.\r\n * \r\n * @param enableContextMenu Indicates whether the default context menu must be displayed when right clicking on a day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setEnableContextMenu\",\n value: function setEnableContextMenu(enableContextMenu) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.enableContextMenu = enableContextMenu;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the context menu items.\r\n */\n\n }, {\n key: \"getContextMenuItems\",\n value: function getContextMenuItems() {\n return this.options.contextMenuItems;\n }\n /**\r\n * Sets new context menu items.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param contextMenuItems The new context menu items.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setContextMenuItems\",\n value: function setContextMenuItems(contextMenuItems) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.contextMenuItems = contextMenuItems instanceof Array ? contextMenuItems : [];\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the custom day renderer.\r\n */\n\n }, {\n key: \"getCustomDayRenderer\",\n value: function getCustomDayRenderer() {\n return this.options.customDayRenderer;\n }\n /**\r\n * Sets the custom day renderer.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param handler The function used to render the days. This function is called during render for each day.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setCustomDayRenderer\",\n value: function setCustomDayRenderer(customDayRenderer) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.customDayRenderer = typeof customDayRenderer === \"function\" ? customDayRenderer : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the custom data source renderer.\r\n */\n\n }, {\n key: \"getCustomDataSourceRenderer\",\n value: function getCustomDataSourceRenderer() {\n return this.options.customDataSourceRenderer;\n }\n /**\r\n * Sets the custom data source renderer. Works only with the style set to \"custom\".\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param handler The function used to render the data source. This function is called during render for each day containing at least one event.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setCustomDataSourceRenderer\",\n value: function setCustomDataSourceRenderer(customDataSourceRenderer) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.customDataSourceRenderer = typeof customDataSourceRenderer === \"function\" ? customDataSourceRenderer : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the language used for calendar rendering.\r\n */\n\n }, {\n key: \"getLanguage\",\n value: function getLanguage() {\n return this.options.language;\n }\n /**\r\n * Sets the language used for calendar rendering.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param language The language to use for calendar redering.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setLanguage\",\n value: function setLanguage(language) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (language != null && Calendar.locales[language] != null) {\n this.options.language = language;\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the current data source.\r\n */\n\n }, {\n key: \"getDataSource\",\n value: function getDataSource() {\n return this.options.dataSource;\n }\n /**\r\n * Sets a new data source.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param dataSource The new data source.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setDataSource\",\n value: function setDataSource(dataSource) {\n var _this7 = this;\n\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.dataSource = dataSource instanceof Array || typeof dataSource === \"function\" ? dataSource : [];\n\n if (typeof this.options.dataSource === \"function\") {\n this.render(true);\n\n this._fetchDataSource(function (dataSource) {\n _this7._dataSource = dataSource;\n\n _this7._initializeDatasourceColors();\n\n _this7.render(false);\n });\n } else {\n this._dataSource = this.options.dataSource;\n\n this._initializeDatasourceColors();\n\n if (!preventRendering) {\n this.render();\n }\n }\n }\n /**\r\n * Gets the starting day of the week.\r\n */\n\n }, {\n key: \"getWeekStart\",\n value: function getWeekStart() {\n return this.options.weekStart !== null ? this.options.weekStart : Calendar.locales[this.options.language].weekStart;\n }\n /**\r\n * Sets the starting day of the week.\r\n * \r\n * This method causes a refresh of the calendar.\r\n *\r\n * @param weekStart The starting day of the week. This option overrides the parameter define in the language file.\r\n * @param preventRedering Indicates whether the rendering should be prevented after the property update.\r\n */\n\n }, {\n key: \"setWeekStart\",\n value: function setWeekStart(weekStart) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.options.weekStart = !isNaN(parseInt(weekStart)) ? parseInt(weekStart) : null;\n\n if (!preventRendering) {\n this.render();\n }\n }\n /**\r\n * Gets the loading template.\r\n */\n\n }, {\n key: \"getLoadingTemplate\",\n value: function getLoadingTemplate() {\n return this.options.loadingTemplate;\n }\n /**\r\n * Sets the loading template.\r\n *\r\n * @param loadingTemplate The loading template.\r\n */\n\n }, {\n key: \"setLoadingTemplate\",\n value: function setLoadingTemplate(loadingTemplate) {\n this.options.loadingTemplate = typeof loadingTemplate === \"string\" || loadingTemplate instanceof HTMLElement ? loadingTemplate : null;\n }\n /**\r\n * \r\n * Add a new element to the data source.\r\n * \r\n * This method causes a refresh of the calendar.\r\n * \r\n * @param element The element to add.\r\n * @param preventRendering Indicates whether the calendar shouldn't be refreshed once the event added.\r\n */\n\n }, {\n key: \"addEvent\",\n value: function addEvent(evt) {\n var preventRendering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n this._dataSource.push(evt);\n\n if (!preventRendering) {\n this.render();\n }\n }\n }]);\n\n return Calendar;\n }();\n\n _exports[\"default\"] = Calendar;\n\n _defineProperty(Calendar, \"locales\", {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n weekShort: 'W',\n weekStart: 0\n }\n });\n\n _defineProperty(Calendar, \"colors\", ['#2C8FC9', '#9CB703', '#F5BB00', '#FF4A32', '#B56CE2', '#45A597']);\n\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") {\n window.Calendar = Calendar;\n document.addEventListener(\"DOMContentLoaded\", function () {\n document.querySelectorAll('[data-provide=\"calendar\"]').forEach(function (element) {\n return new Calendar(element);\n });\n });\n }\n});","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorValues(e) {\n if (null != e) {\n var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"],\n r = 0;\n if (t) return t.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) return {\n next: function next() {\n return e && r >= e.length && (e = void 0), {\n value: e && e[r++],\n done: !e\n };\n }\n };\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n}\nmodule.exports = _regeneratorValues, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2024 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nimport {createVisitsHistogram} from './visits-histogram';\nimport {updateCalendar} from './visits-calendar';\nimport './visits-reporting.css';\n\n// will hold all visits\nlet allVisits;\n// will hold filtered visits to display\nlet filteredVisits;\n// will hold currently displayed year\nlet currentYear;\n\n// function to gather full visits\nfunction filterFullVisits(differentSnapshots) {\n const filteredVisits = [];\n for (let i = 0; i < allVisits.length; ++i) {\n if (allVisits[i].status !== 'full') continue;\n if (!differentSnapshots) {\n filteredVisits.push(allVisits[i]);\n } else if (filteredVisits.length === 0) {\n filteredVisits.push(allVisits[i]);\n } else {\n const lastVisit = filteredVisits[filteredVisits.length - 1];\n if (allVisits[i].snapshot !== lastVisit.snapshot) {\n filteredVisits.push(allVisits[i]);\n }\n }\n }\n return filteredVisits;\n}\n\n// function to update the visits list view based on the selected year\nfunction updateVisitsList(year) {\n $('#swh-visits-list').children().remove();\n const visitsByYear = [];\n for (let i = 0; i < filteredVisits.length; ++i) {\n if (filteredVisits[i].date.getUTCFullYear() === year) {\n visitsByYear.push(filteredVisits[i]);\n }\n }\n let visitsCpt = 0;\n const nbVisitsByRow = 4;\n let visitsListHtml = '<div class=\"swh-visits-list-row\">';\n for (let i = 0; i < visitsByYear.length; ++i) {\n if (visitsCpt > 0 && visitsCpt % nbVisitsByRow === 0) {\n visitsListHtml += '</div><div class=\"swh-visits-list-row\">';\n }\n visitsListHtml += '<div class=\"swh-visits-list-column\" style=\"width: ' + 100 / nbVisitsByRow + '%;\">';\n visitsListHtml += '<a class=\"swh-visit-icon swh-visit-' + visitsByYear[i].status + '\" title=\"' + visitsByYear[i].status +\n ' visit\" href=\"' + visitsByYear[i].url + '\">' + visitsByYear[i].formatted_date + '</a>';\n visitsListHtml += '</div>';\n ++visitsCpt;\n }\n visitsListHtml += '</div>';\n $('#swh-visits-list').append($(visitsListHtml));\n}\n\nfunction yearChangedCalendar(year) {\n currentYear = year;\n updateVisitsList(year);\n createVisitsHistogram('.d3-wrapper', filteredVisits, currentYear, yearClickedTimeline);\n}\n\n// callback when the user selects a year through the visits histogram\nfunction yearClickedTimeline(year) {\n currentYear = year;\n updateCalendar(year, filteredVisits, yearChangedCalendar);\n updateVisitsList(year);\n}\n\n// function to update the visits views (histogram, calendar, list)\nfunction updateDisplayedVisits() {\n if (filteredVisits.length === 0) {\n return;\n }\n if (!currentYear) {\n currentYear = filteredVisits[filteredVisits.length - 1].date.getUTCFullYear();\n }\n createVisitsHistogram('.d3-wrapper', filteredVisits, currentYear, yearClickedTimeline);\n updateCalendar(currentYear, filteredVisits, yearChangedCalendar);\n updateVisitsList(currentYear);\n}\n\n// callback when the user only wants to see full visits pointing\n// to different snapshots (default)\nexport function showFullVisitsDifferentSnapshots(event) {\n filteredVisits = filterFullVisits(true);\n updateDisplayedVisits();\n}\n\n// callback when the user only wants to see full visits\nexport function showFullVisits(event) {\n filteredVisits = filterFullVisits(false);\n updateDisplayedVisits();\n}\n\n// callback when the user wants to see all visits (including partial, ongoing and failed ones)\nexport function showAllVisits(event) {\n filteredVisits = allVisits;\n updateDisplayedVisits();\n}\n\n// bootstrap 5 popovers on calendar days have display issues after dynamically updating calendar\n// so we refresh the page instead when changing visits filter\nexport function reloadPage() {\n location.reload();\n}\n\nexport function initVisitsReporting(visits) {\n $(document).ready(() => {\n allVisits = visits;\n // process input visits\n let firstFullVisit;\n allVisits.forEach((v, i) => {\n // Turn Unix epoch into Javascript Date object\n v.date = new Date(Math.floor(v.date * 1000));\n const visitLink = '<a class=\"swh-visit-icon swh-visit-' + v.status + '\" href=\"' + v.url + '\">' + v.formatted_date + '</a>';\n if (v.status === 'full') {\n if (!firstFullVisit) {\n firstFullVisit = v;\n $('#swh-first-full-visit').append($(visitLink));\n if (allVisits.length === 1) {\n $('#swh-last-full-visit')[0].innerHTML = visitLink;\n }\n } else {\n $('#swh-last-full-visit')[0].innerHTML = visitLink;\n }\n }\n if (i === allVisits.length - 1) {\n $('#swh-last-visit').append($(visitLink));\n }\n });\n\n if (!firstFullVisit) {\n $('#swh-full-visits-different-snapshots').prop('disabled', true);\n $('#swh-full-visits').prop('disabled', true);\n }\n\n if ($('#swh-full-visits').prop('checked')) {\n showFullVisits();\n } else if ($('#swh-all-visits').prop('checked')) {\n showAllVisits();\n } else {\n // display full visits pointing to different snapshots by default\n showFullVisitsDifferentSnapshots();\n }\n });\n\n}\n","const hexCharacters = 'a-f\\\\d';\nconst match3or4Hex = `#?[${hexCharacters}]{3}[${hexCharacters}]?`;\nconst match6or8Hex = `#?[${hexCharacters}]{6}([${hexCharacters}]{2})?`;\nconst nonHexChars = new RegExp(`[^#${hexCharacters}]`, 'gi');\nconst validHexSize = new RegExp(`^${match3or4Hex}$|^${match6or8Hex}$`, 'i');\n\nexport default function hexRgb(hex, options = {}) {\n\tif (typeof hex !== 'string' || nonHexChars.test(hex) || !validHexSize.test(hex)) {\n\t\tthrow new TypeError('Expected a valid hex string');\n\t}\n\n\thex = hex.replace(/^#/, '');\n\tlet alphaFromHex = 1;\n\n\tif (hex.length === 8) {\n\t\talphaFromHex = Number.parseInt(hex.slice(6, 8), 16) / 255;\n\t\thex = hex.slice(0, 6);\n\t}\n\n\tif (hex.length === 4) {\n\t\talphaFromHex = Number.parseInt(hex.slice(3, 4).repeat(2), 16) / 255;\n\t\thex = hex.slice(0, 3);\n\t}\n\n\tif (hex.length === 3) {\n\t\thex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n\t}\n\n\tconst number = Number.parseInt(hex, 16);\n\tconst red = number >> 16;\n\tconst green = (number >> 8) & 255;\n\tconst blue = number & 255;\n\tconst alpha = typeof options.alpha === 'number' ? options.alpha : alphaFromHex;\n\n\tif (options.format === 'array') {\n\t\treturn [red, green, blue, alpha];\n\t}\n\n\tif (options.format === 'css') {\n\t\tconst alphaString = alpha === 1 ? '' : ` / ${Number((alpha * 100).toFixed(2))}%`;\n\t\treturn `rgb(${red} ${green} ${blue}${alphaString})`;\n\t}\n\n\treturn {red, green, blue, alpha};\n}\n","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","var regeneratorAsyncGen = require(\"./regeneratorAsyncGen.js\");\nfunction _regeneratorAsync(n, e, r, t, o) {\n var a = regeneratorAsyncGen(n, e, r, t, o);\n return a.next().then(function (n) {\n return n.done ? n.value : a.next();\n });\n}\nmodule.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * Copyright (C) 2018-2025 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nimport Calendar from 'js-year-calendar';\nimport 'js-year-calendar/dist/js-year-calendar.css';\nimport hexRgb from 'hex-rgb';\n\nimport {visitStatusColor} from './utils';\n\nconst minSize = 15;\nconst maxSize = 28;\nlet currentPopover = null;\nlet visitsByDate = {};\nlet calendar = null;\n\nfunction closePopover() {\n if (currentPopover) {\n $(currentPopover).popover('dispose');\n currentPopover = null;\n }\n}\n\n// function to update the visits calendar view based on the selected year\nexport function updateCalendar(year, filteredVisits, yearClickedCallback) {\n visitsByDate = {};\n let maxNbVisitsByDate = 0;\n let minDate, maxDate;\n for (let i = 0; i < filteredVisits.length; ++i) {\n filteredVisits[i]['startDate'] = filteredVisits[i]['date'];\n filteredVisits[i]['endDate'] = filteredVisits[i]['startDate'];\n const date = new Date(filteredVisits[i]['date']);\n date.setHours(0, 0, 0, 0);\n const dateStr = date.toDateString();\n if (!visitsByDate.hasOwnProperty(dateStr)) {\n visitsByDate[dateStr] = [filteredVisits[i]];\n } else {\n visitsByDate[dateStr].push(filteredVisits[i]);\n }\n maxNbVisitsByDate = Math.max(maxNbVisitsByDate, visitsByDate[dateStr].length);\n if (i === 0) {\n minDate = maxDate = date;\n } else {\n if (date.getTime() < minDate.getTime()) {\n minDate = date;\n }\n if (date.getTime() > maxDate.getTime()) {\n maxDate = date;\n }\n }\n }\n\n closePopover();\n if (calendar === null) {\n calendar = new Calendar('#swh-visits-calendar', {\n dataSource: filteredVisits,\n style: 'custom',\n minDate: minDate,\n maxDate: maxDate,\n startYear: year,\n renderEnd: e => yearClickedCallback(e.currentYear),\n customDataSourceRenderer: (element, date, events) => {\n const dateStr = date.toDateString();\n const nbVisits = visitsByDate[dateStr].length;\n let t = nbVisits / maxNbVisitsByDate;\n if (maxNbVisitsByDate === 1) {\n t = 0;\n }\n const size = minSize + t * (maxSize - minSize);\n const offsetX = (maxSize - size) / 2 - parseInt($(element).css('padding-left'));\n const offsetY = (maxSize - size) / 2 - parseInt($(element).css('padding-top')) + 1;\n const cellWrapper = $('<div></div>');\n cellWrapper.css('position', 'relative');\n const dayNumber = $('<div></div>');\n dayNumber.text($(element).text());\n const circle = $('<div></div>');\n const color = {red: 0, green: 0, blue: 0, alpha: 0.4};\n for (let i = 0; i < nbVisits; ++i) {\n const visit = visitsByDate[dateStr][i];\n const visitColor = hexRgb(visitStatusColor[visit.status]);\n color.red += visitColor.red;\n color.green += visitColor.green;\n color.blue += visitColor.blue;\n }\n color.red /= nbVisits;\n color.green /= nbVisits;\n color.blue /= nbVisits;\n circle.css('background-color', `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha})`);\n circle.css('width', size + 'px');\n circle.css('height', size + 'px');\n circle.css('border-radius', size + 'px');\n circle.css('position', 'absolute');\n circle.css('top', offsetY + 'px');\n circle.css('left', offsetX + 'px');\n cellWrapper.append(dayNumber);\n cellWrapper.append(circle);\n $(element)[0].innerHTML = $(cellWrapper)[0].outerHTML;\n },\n mouseOnDay: e => {\n if (currentPopover !== e.element) {\n closePopover();\n }\n const dateStr = e.date.toDateString();\n if (visitsByDate.hasOwnProperty(dateStr)) {\n\n const visits = visitsByDate[dateStr];\n let content = '<div><h6>' + e.date.toDateString() + '</h6></div>';\n content += '<ul class=\"swh-list-unstyled\">';\n for (let i = 0; i < visits.length; ++i) {\n const visitTime = visits[i].formatted_date.substr(visits[i].formatted_date.indexOf(',') + 2);\n content += '<li><a class=\"swh-visit-icon swh-visit-' + visits[i].status + '\" title=\"' + visits[i].status +\n ' visit\" href=\"' + visits[i].url + '\">' + visitTime + '</a></li>';\n }\n content += '</ul>';\n\n $(e.element).popover({\n trigger: 'manual',\n container: 'body',\n html: true,\n content: content,\n animation: false\n }).on('mouseleave', () => {\n if (!$('.popover:hover').length) {\n // close popover when leaving day in calendar\n // except if the pointer is hovering it\n closePopover();\n }\n });\n\n $(e.element).on('shown.bs.popover', () => {\n $('.popover').mouseleave(() => {\n // close popover when pointer leaves it\n closePopover();\n });\n });\n\n $(e.element).popover('show');\n currentPopover = e.element;\n }\n }\n });\n } else {\n calendar.setMinDate(minDate);\n calendar.setMaxDate(maxDate);\n calendar.setYear(year);\n calendar.renderEnd = e => yearClickedCallback(e.currentYear);\n calendar.setDataSource(filteredVisits);\n calendar.render();\n }\n $('#swh-visits-calendar.calendar table td').css('width', maxSize + 'px');\n $('#swh-visits-calendar.calendar table td').css('height', maxSize + 'px');\n $('#swh-visits-calendar.calendar table td').css('padding', '0px');\n}\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _regeneratorDefine(e, r, n, t) {\n var i = Object.defineProperty;\n try {\n i({}, \"\", {});\n } catch (e) {\n i = 0;\n }\n module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {\n if (r) i ? i(e, r, {\n value: n,\n enumerable: !t,\n configurable: !t,\n writable: !t\n }) : e[r] = n;else {\n var o = function o(r, n) {\n _regeneratorDefine(e, r, function (e) {\n return this._invoke(r, n, e);\n });\n };\n o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2);\n }\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _regeneratorDefine(e, r, n, t);\n}\nmodule.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + \"d3\" + \".\" + \"2fe5b1ddad0dbb25a61b\" + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/static/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t384: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkswh\"] = self[\"webpackChunkswh\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["root","factory","exports","module","define","amd","self","inProgress","dataWebpackPrefix","regenerator","regeneratorAsyncIterator","r","e","t","o","n","w","Promise","__esModule","Object","unshift","length","pop","value","done","OverloadYield","regeneratorAsync","regeneratorAsyncGen","regeneratorKeys","regeneratorValues","_regeneratorRuntime","m","getPrototypeOf","__proto__","constructor","displayName","name","a","stop","v","abrupt","delegateYield","resultName","d","finish","f","_t","p","prev","next","sent","call","this","wrap","reverse","isGeneratorFunction","mark","awrap","AsyncIterator","async","u","keys","values","createVisitsHistogram","_x","_x2","_x3","_x4","_createVisitsHistogram","apply","arguments","_asyncToGenerator","_callee","container","visitsData","currentYear","yearClickCallback","d3","width","height","margin","svg","tooltip","g","x","y","colors","now","endYear","monthExtent","monthBins","yearBins","binByMonth","visitsByStatus","statuses","histData","i","stacked","yMax","step","yTickValues","_i3","_i4","legendGroup","legend","_context","select","remove","top","right","bottom","left","attr","Math","ceil","append","style","scaleTime","rangeRound","scaleLinear","range","scaleOrdinal","domain","visitStatusColor","Date","getUTCFullYear","UTC","timeMonths","timeMonth","offset","timeYears","extent","histogram","date","thresholds","groups","sort","b","ascending","forEach","entry","push","monthsData","stack","key","max","total","floor","axisLeft","tickValues","tickSize","tickFormat","selectAll","data","enter","timeYear","on","event","x1","getMonth","x0","transition","duration","ds","toISOString","substr","split","tooltipText","visitStatus","nbVisits","html","pageX","pageY","axisBottom","ticks","every","year","text","slice","asyncGeneratorStep","c","resolve","then","_next","_throw","regeneratorDefine","prototype","Symbol","asyncIterator","_regenerator","iterator","toStringTag","Generator","create","G","bind","l","TypeError","GeneratorFunction","GeneratorFunctionPrototype","setPrototypeOf","full","partial","failed","ongoing","not_found","created","k","globalThis","_exports","_typeof","obj","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","enumerable","configurable","writable","defineProperty","_createClass","protoProps","staticProps","_defineProperty","NodeList","callback","thisArg","window","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","document","documentElement","contains","parentElement","parentNode","nodeType","Calendar","element","options","undefined","HTMLElement","Error","querySelector","classList","add","_initializeEvents","_initializeOptions","startYear","getFullYear","startMonth","startDate","setStartDate","opt","isNaN","parseInt","numberMonthsDisplayed","minDate","maxDate","language","locales","allowOverlap","displayWeekNumber","displayDisabledDataSource","displayHeader","alwaysHalfDay","enableRangeSelection","disabledDays","Array","disabledWeekDays","hiddenWeekDays","roundRangeLimits","dataSource","enableContextMenu","contextMenuItems","customDayRenderer","customDataSourceRenderer","weekStart","loadingTemplate","_dataSource","_initializeDatasourceColors","yearChanged","addEventListener","periodChanged","renderEnd","clickDay","dayContextMenu","selectRange","mouseOnDay","mouseOutDay","getDataSource","currentPeriod","getCurrentPeriod","fetchParameters","endDate","result","color","isLoading","firstChild","removeChild","_renderHeader","_renderLoading","_renderBody","_renderDataSource","_applyEvents","months","opacity","display","setTimeout","_triggerEvent","header","createElement","headerTable","period","prevDiv","prevIcon","innerHTML","appendChild","_isFullYearMode","prev2YearDiv","textContent","_startDate","toString","prevYearDiv","yearDiv","concat","nextYearDiv","next2YearDiv","nextDiv","nextIcon","monthsDiv","monthStartDate","getTime","monthDiv","dataset","monthId","_nbCols","table","thead","titleRow","titleCell","setAttribute","headerRow","weekNumberCell","weekShort","getWeekStart","headerCell","daysMin","_isHidden","currentDate","lastDate","getDay","setDate","getDate","row","currentThursday","getWeekNumber","cell","_isDisabled","cellContent","setMonth","minHeight","loading","spinner","bounce","_this","querySelectorAll","month","currentMonth","firstDate","monthData","day","nextDate","dayData","_renderDataSourceDay","elt","events","parent","weight","boxShadow","backgroundColor","currentTime","startHalfDay","otherColor","background","endHalfDay","_this2","currentTarget","setYear","marginLeft","visibility","stopPropagation","_getDate","getEvents","preventDefault","_openContextMenu","which","isThereFreeSlot","_mouseDown","_rangeStart","_rangeEnd","_refreshRange","newDate","oldValue","getEventsOnRange","_responsiveInterval","clearInterval","setInterval","calendarSize","offsetWidth","monthSize","className","_this3","monthEndDate","offsetTop","offsetLeft","offsetParent","_this4","contextMenu","body","eventItem","paddingLeft","eventItemContent","icon","_renderContextMenuItems","children","position","_getElementPosition","getBoundingClientRect","_checkContextMenuItemsPosition","closeContextMenu","type","removeEventListener","items","evt","subMenu","visible","menuItem","menuItemContent","click","index","menus","menu","htmlMenu","eventName","parameters","Event","createEvent","initEvent","calendar","dispatchEvent","workingDate","setHours","week1","round","_this5","after","some","setTime","parsedYear","_this6","newPeriod","periodEventResult","preventRendering","yearEventResult","render","_fetchDataSource","preventRedering","parsedNumber","_this7","en","days","daysShort","monthsShort","allVisits","filteredVisits","filterFullVisits","differentSnapshots","status","lastVisit","snapshot","updateVisitsList","$","visitsByYear","visitsCpt","visitsListHtml","url","formatted_date","yearChangedCalendar","yearClickedTimeline","updateCalendar","updateDisplayedVisits","showFullVisitsDifferentSnapshots","showFullVisits","showAllVisits","reloadPage","location","reload","initVisitsReporting","visits","ready","firstFullVisit","visitLink","prop","hexCharacters","match3or4Hex","match6or8Hex","nonHexChars","RegExp","validHexSize","hexRgb","hex","test","alphaFromHex","replace","Number","repeat","number","red","green","blue","alpha","format","toFixed","runtime","regeneratorRuntime","accidentalStrictMode","Function","minSize","maxSize","currentPopover","visitsByDate","closePopover","popover","yearClickedCallback","maxNbVisitsByDate","dateStr","toDateString","hasOwnProperty","size","offsetX","css","offsetY","cellWrapper","dayNumber","circle","visit","visitColor","outerHTML","content","visitTime","indexOf","trigger","animation","mouseleave","setMinDate","setMaxDate","setDataSource","_regeneratorDefine","_invoke","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","get","chunkId","all","reduce","promises","miniCssF","script","needAttach","scripts","getElementsByTagName","getAttribute","charset","timeout","nc","src","onScriptComplete","onerror","onload","clearTimeout","doneFns","fn","head","installedChunks","j","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","id","chunkLoadingGlobal"],"sourceRoot":""}
|