From d137735be1046f6a0cbe44a718fb002fc77568f8 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Fri, 11 Sep 2020 20:56:54 +0200 Subject: [PATCH 01/18] Fix #805 (First request to gdrive fails) --- cps/gdriveutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/gdriveutils.py b/cps/gdriveutils.py index a996f879..4575727a 100644 --- a/cps/gdriveutils.py +++ b/cps/gdriveutils.py @@ -243,7 +243,7 @@ def getEbooksFolderId(drive=None): gDriveId.path = '/' session.merge(gDriveId) session.commit() - return + return gDriveId.gdrive_id def getFile(pathId, fileName, drive): From 4e28c3cadb8a0524bc3cc634c982cec48b6987aa Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Tue, 15 Sep 2020 13:41:01 +0700 Subject: [PATCH 02/18] add Litres references --- cps/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/db.py b/cps/db.py index c3d62a22..cc156942 100644 --- a/cps/db.py +++ b/cps/db.py @@ -142,6 +142,8 @@ class Identifiers(Base): return u"https://www.kobo.com/ebook/{0}".format(self.val) elif format_type == "lubimyczytac": return u" https://lubimyczytac.pl/ksiazka/{0}".format(self.val) + elif format_type == "litres": + return u"https://www.litres.ru/{0}".format(self.val) elif format_type == "url": return u"{0}".format(self.val) else: From 8745b8b051e0044e9958ff802d56c8b777a1d42c Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Tue, 15 Sep 2020 13:47:57 +0700 Subject: [PATCH 03/18] nice title for Litres tags --- cps/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/db.py b/cps/db.py index cc156942..7132e23e 100644 --- a/cps/db.py +++ b/cps/db.py @@ -117,6 +117,8 @@ class Identifiers(Base): return u"Google Books" elif format_type == "kobo": return u"Kobo" + elif format_type == "litres": + return u"ЛитРес" if format_type == "lubimyczytac": return u"Lubimyczytac" else: From ec4ff834656d9a1237048f50620ff6ba921ed99c Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Tue, 15 Sep 2020 13:50:34 +0700 Subject: [PATCH 04/18] Add ISSN tags --- cps/db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cps/db.py b/cps/db.py index 7132e23e..1e65ccf9 100644 --- a/cps/db.py +++ b/cps/db.py @@ -119,6 +119,8 @@ class Identifiers(Base): return u"Kobo" elif format_type == "litres": return u"ЛитРес" + elif format_type == "issn": + return u"ISSN" if format_type == "lubimyczytac": return u"Lubimyczytac" else: @@ -146,6 +148,8 @@ class Identifiers(Base): return u" https://lubimyczytac.pl/ksiazka/{0}".format(self.val) elif format_type == "litres": return u"https://www.litres.ru/{0}".format(self.val) + elif format_type == "issn": + return u"https://portal.issn.org/resource/ISSN/{0}".format(self.val) elif format_type == "url": return u"{0}".format(self.val) else: From 4eded821027a0ff8bab7310a1c81692cda499437 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Tue, 15 Sep 2020 17:39:13 +0700 Subject: [PATCH 05/18] Add ISFDB --- cps/db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cps/db.py b/cps/db.py index 1e65ccf9..f9b41e9e 100644 --- a/cps/db.py +++ b/cps/db.py @@ -121,6 +121,8 @@ class Identifiers(Base): return u"ЛитРес" elif format_type == "issn": return u"ISSN" + elif format_type == "isfdb": + return u"ISFDB" if format_type == "lubimyczytac": return u"Lubimyczytac" else: @@ -150,6 +152,8 @@ class Identifiers(Base): return u"https://www.litres.ru/{0}".format(self.val) elif format_type == "issn": return u"https://portal.issn.org/resource/ISSN/{0}".format(self.val) + elif format_type == "isfdb": + return u"http://www.isfdb.org/cgi-bin/pl.cgi?{0}".format(self.val) elif format_type == "url": return u"{0}".format(self.val) else: From 2d712a384143766758da386fe10cd8688d8dfb49 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 20 Sep 2020 10:03:05 +0200 Subject: [PATCH 06/18] Fix #1612 --- cps/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/db.py b/cps/db.py index f9b41e9e..64ed5274 100644 --- a/cps/db.py +++ b/cps/db.py @@ -147,7 +147,7 @@ class Identifiers(Base): elif format_type == "kobo": return u"https://www.kobo.com/ebook/{0}".format(self.val) elif format_type == "lubimyczytac": - return u" https://lubimyczytac.pl/ksiazka/{0}".format(self.val) + return u" https://lubimyczytac.pl/ksiazka/{0}/ksiazka".format(self.val) elif format_type == "litres": return u"https://www.litres.ru/{0}".format(self.val) elif format_type == "issn": From c0a401216b72b9e0e84537961c28ca8e5ae00333 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 20 Sep 2020 10:10:58 +0200 Subject: [PATCH 07/18] Add links to contribution guidelines --- .github/ISSUE_TEMPLATE/bug_report.md | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 2 ++ README.md | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 34d2c453..55e374c8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,6 +6,7 @@ labels: '' assignees: '' --- + **Describe the bug/problem** A clear and concise description of what the bug is. If you are asking for support, please check our [Wiki](https://github.com/janeczku/calibre-web/wiki) if your question is already answered there. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 1a71b1ac..b442f347 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,6 +7,8 @@ assignees: '' --- + + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/README.md b/README.md index 82c7976c..964c715f 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,7 @@ Pre-built Docker images are available in these Docker Hub repositories: # Wiki For further information, How To's and FAQ please check the [Wiki](https://github.com/janeczku/calibre-web/wiki) + +# Contributing to Calibre-Web + +Please have a look at our [Contributing Guidelines](https://github.com/janeczku/calibre-web/CONTRIBUTING.md) From 165c649f3198a638c4f33007d2bf8ca6416d645f Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 20 Sep 2020 11:44:03 +0200 Subject: [PATCH 08/18] Fix "is not a valid language" on upload --- cps/comic.py | 8 +------- cps/editbooks.py | 5 ++++- cps/epub.py | 12 ++---------- cps/gdrive.py | 2 +- cps/isoLanguages.py | 22 ++++++++++++++++++++++ 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/cps/comic.py b/cps/comic.py index e788fc44..57f204cd 100644 --- a/cps/comic.py +++ b/cps/comic.py @@ -135,13 +135,7 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r loadedMetadata = archive.readMetadata(style) lang = loadedMetadata.language - if lang: - if len(lang) == 2: - loadedMetadata.language = isoLanguages.get(part1=lang).name - elif len(lang) == 3: - loadedMetadata.language = isoLanguages.get(part3=lang).name - else: - loadedMetadata.language = "" + loadedMetadata.language = isoLanguages.get_lang3(lang) return BookMeta( file_path=tmp_file_path, diff --git a/cps/editbooks.py b/cps/editbooks.py index cf1eb4c3..23da1458 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -357,7 +357,10 @@ def edit_book_comments(comments, book): def edit_book_languages(languages, book, upload=False): input_languages = languages.split(',') unknown_languages = [] - input_l = isoLanguages.get_language_codes(get_locale(), input_languages, unknown_languages) + if not upload: + input_l = isoLanguages.get_language_codes(get_locale(), input_languages, unknown_languages) + else: + input_l = isoLanguages.get_valid_language_codes(get_locale(), input_languages, unknown_languages) for l in unknown_languages: log.error('%s is not a valid language', l) flash(_(u"%(langname)s is not a valid language", langname=l), category="warning") diff --git a/cps/epub.py b/cps/epub.py index bdba0607..a1f2b1f0 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -83,16 +83,8 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): else: epub_metadata['description'] = "" - if epub_metadata['language'] == u'Unknown': - epub_metadata['language'] = "" - else: - lang = epub_metadata['language'].split('-', 1)[0].lower() - if len(lang) == 2: - epub_metadata['language'] = isoLanguages.get(part1=lang).name - elif len(lang) == 3: - epub_metadata['language'] = isoLanguages.get(part3=lang).name - else: - epub_metadata['language'] = "" + lang = epub_metadata['language'].split('-', 1)[0].lower() + epub_metadata['language'] = isoLanguages.get_lang3(lang) series = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='calibre:series']/@content", namespaces=ns) if len(series) > 0: diff --git a/cps/gdrive.py b/cps/gdrive.py index 82a19890..74a45061 100644 --- a/cps/gdrive.py +++ b/cps/gdrive.py @@ -43,7 +43,7 @@ log = logger.create() try: from googleapiclient.errors import HttpError except ImportError as err: - log.debug(("Cannot import googleapiclient, using gdrive will not work: %s", err)) + log.debug("Cannot import googleapiclient, using GDrive will not work: %s", err) current_milli_time = lambda: int(round(time() * 1000)) diff --git a/cps/isoLanguages.py b/cps/isoLanguages.py index d8b7fa00..2a8391f5 100644 --- a/cps/isoLanguages.py +++ b/cps/isoLanguages.py @@ -66,3 +66,25 @@ def get_language_codes(locale, language_names, remainder=None): if remainder is not None: remainder.extend(language_names) return languages + +def get_valid_language_codes(locale, language_names, remainder=None): + languages = list() + for k, v in get_language_names(locale).items(): + if k in language_names: + languages.append(k) + language_names.remove(k) + if remainder is not None and len(language_names): + remainder.extend(language_names) + return languages + +def get_lang3(lang): + try: + if len(lang) == 2: + ret_value = get(part1=lang).part3 + elif len(lang) == 3: + ret_value = lang + else: + ret_value = "" + except KeyError: + ret_value = lang + return ret_value From 7ba014ba499df954e9019ec524293817d520212f Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 20 Sep 2020 15:03:25 +0200 Subject: [PATCH 09/18] Fix "is not a valid language" on upload of comic books Fix metadata excration of comic books updated bootstrap table updated handling of upload formats restrictions --- cps/admin.py | 7 +++++-- cps/comic.py | 16 ++++++++-------- cps/editbooks.py | 5 +++-- cps/gdriveutils.py | 2 +- cps/isoLanguages.py | 2 ++ cps/logger.py | 8 ++++---- cps/server.py | 2 +- cps/static/css/libs/bootstrap-table.min.css | 11 ++++++++++- .../bootstrap-table-editable.min.js | 17 ++++++++++------- .../libs/bootstrap-table/bootstrap-table.min.js | 17 +++++++++-------- .../locale/bootstrap-table-af-ZA.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ar-SA.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ca-ES.min.js | 17 ++++++++++------- .../locale/bootstrap-table-cs-CZ.min.js | 17 ++++++++++------- .../locale/bootstrap-table-da-DK.min.js | 17 ++++++++++------- .../locale/bootstrap-table-de-DE.min.js | 17 ++++++++++------- .../locale/bootstrap-table-el-GR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-en-US.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-AR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-CL.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-CR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-ES.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-MX.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-NI.min.js | 17 ++++++++++------- .../locale/bootstrap-table-es-SP.min.js | 17 ++++++++++------- .../locale/bootstrap-table-et-EE.min.js | 17 ++++++++++------- .../locale/bootstrap-table-eu-EU.min.js | 17 ++++++++++------- .../locale/bootstrap-table-fa-IR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-fi-FI.min.js | 10 ++++++++++ .../locale/bootstrap-table-fr-BE.min.js | 17 ++++++++++------- .../locale/bootstrap-table-fr-CH.min.js | 10 ++++++++++ .../locale/bootstrap-table-fr-FR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-fr-LU.min.js | 10 ++++++++++ .../locale/bootstrap-table-he-IL.min.js | 17 ++++++++++------- .../locale/bootstrap-table-hr-HR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-hu-HU.min.js | 17 ++++++++++------- .../locale/bootstrap-table-id-ID.min.js | 17 ++++++++++------- .../locale/bootstrap-table-it-IT.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ja-JP.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ka-GE.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ko-KR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ms-MY.min.js | 17 ++++++++++------- .../locale/bootstrap-table-nb-NO.min.js | 17 ++++++++++------- .../locale/bootstrap-table-nl-BE.min.js | 10 ++++++++++ .../locale/bootstrap-table-nl-NL.min.js | 17 ++++++++++------- .../locale/bootstrap-table-pl-PL.min.js | 17 ++++++++++------- .../locale/bootstrap-table-pt-BR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-pt-PT.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ro-RO.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ru-RU.min.js | 17 ++++++++++------- .../locale/bootstrap-table-sk-SK.min.js | 17 ++++++++++------- .../locale/bootstrap-table-sr-Cyrl-RS.min.js | 10 ++++++++++ .../locale/bootstrap-table-sr-Latn-RS.min.js | 10 ++++++++++ .../locale/bootstrap-table-sv-SE.min.js | 17 ++++++++++------- .../locale/bootstrap-table-th-TH.min.js | 17 ++++++++++------- .../locale/bootstrap-table-tr-TR.min.js | 17 ++++++++++------- .../locale/bootstrap-table-uk-UA.min.js | 17 ++++++++++------- .../locale/bootstrap-table-ur-PK.min.js | 17 ++++++++++------- .../locale/bootstrap-table-uz-Latn-UZ.min.js | 17 ++++++++++------- .../locale/bootstrap-table-vi-VN.min.js | 17 ++++++++++------- .../locale/bootstrap-table-zh-CN.min.js | 17 ++++++++++------- .../locale/bootstrap-table-zh-TW.min.js | 17 ++++++++++------- cps/templates/layout.html | 2 +- cps/web.py | 1 + optional-requirements.txt | 2 +- test/js/runner.js | 9 +++++++++ 66 files changed, 585 insertions(+), 358 deletions(-) create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fi-FI.min.js create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-CH.min.js create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-LU.min.js create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl-BE.min.js create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.min.js create mode 100644 cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.min.js diff --git a/cps/admin.py b/cps/admin.py index 424a12b4..cd37ad80 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -641,8 +641,11 @@ def _configuration_update_helper(): _config_int(to_save, "config_external_port") _config_checkbox_int(to_save, "config_kobo_proxy") - _config_string(to_save, "config_upload_formats") - constants.EXTENSIONS_UPLOAD = [x.lstrip().rstrip() for x in config.config_upload_formats.split(',')] + if "config_upload_formats" in to_save: + to_save["config_upload_formats"] = ','.join( + helper.uniq([x.lstrip().rstrip().lower() for x in to_save["config_upload_formats"].split(',')])) + _config_string(to_save, "config_upload_formats") + constants.EXTENSIONS_UPLOAD = config.config_upload_formats.split(',') _config_string(to_save, "config_calibre") _config_string(to_save, "config_converterpath") diff --git a/cps/comic.py b/cps/comic.py index 57f204cd..1bb23622 100644 --- a/cps/comic.py +++ b/cps/comic.py @@ -74,10 +74,10 @@ def _cover_processing(tmp_file_name, img, extension): -def _extractCover(tmp_file_name, original_file_extension, rarExceutable): +def _extractCover(tmp_file_name, original_file_extension, rarExecutable): cover_data = extension = None if use_comic_meta: - archive = ComicArchive(tmp_file_name) + archive = ComicArchive(tmp_file_name, rar_exe_path=rarExecutable) for index, name in enumerate(archive.getPageNameList()): ext = os.path.splitext(name) if len(ext) > 1: @@ -106,7 +106,7 @@ def _extractCover(tmp_file_name, original_file_extension, rarExceutable): break elif original_file_extension.upper() == '.CBR' and use_rarfile: try: - rarfile.UNRAR_TOOL = rarExceutable + rarfile.UNRAR_TOOL = rarExecutable cf = rarfile.RarFile(tmp_file_name) for name in cf.getnames(): ext = os.path.splitext(name) @@ -120,9 +120,9 @@ def _extractCover(tmp_file_name, original_file_extension, rarExceutable): return _cover_processing(tmp_file_name, cover_data, extension) -def get_comic_info(tmp_file_path, original_file_name, original_file_extension, rarExceutable): +def get_comic_info(tmp_file_path, original_file_name, original_file_extension, rarExecutable): if use_comic_meta: - archive = ComicArchive(tmp_file_path, rar_exe_path=rarExceutable) + archive = ComicArchive(tmp_file_path, rar_exe_path=rarExecutable) if archive.seemsToBeAComicArchive(): if archive.hasMetadata(MetaDataStyle.CIX): style = MetaDataStyle.CIX @@ -134,7 +134,7 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r # if style is not None: loadedMetadata = archive.readMetadata(style) - lang = loadedMetadata.language + lang = loadedMetadata.language or "" loadedMetadata.language = isoLanguages.get_lang3(lang) return BookMeta( @@ -142,7 +142,7 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r extension=original_file_extension, title=loadedMetadata.title or original_file_name, author=" & ".join([credit["person"] for credit in loadedMetadata.credits if credit["role"] == "Writer"]) or u'Unknown', - cover=_extractCover(tmp_file_path, original_file_extension, rarExceutable), + cover=_extractCover(tmp_file_path, original_file_extension, rarExecutable), description=loadedMetadata.comments or "", tags="", series=loadedMetadata.series or "", @@ -154,7 +154,7 @@ def get_comic_info(tmp_file_path, original_file_name, original_file_extension, r extension=original_file_extension, title=original_file_name, author=u'Unknown', - cover=_extractCover(tmp_file_path, original_file_extension, rarExceutable), + cover=_extractCover(tmp_file_path, original_file_extension, rarExecutable), description="", tags="", series="", diff --git a/cps/editbooks.py b/cps/editbooks.py index 23da1458..4b43794a 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -471,7 +471,7 @@ def upload_single_file(request, book, book_id): if requested_file.filename != '': if '.' in requested_file.filename: file_ext = requested_file.filename.rsplit('.', 1)[-1].lower() - if file_ext not in constants.EXTENSIONS_UPLOAD: + if file_ext not in constants.EXTENSIONS_UPLOAD and '' not in constants.EXTENSIONS_UPLOAD: flash(_("File extension '%(ext)s' is not allowed to be uploaded to this server", ext=file_ext), category="error") return redirect(url_for('web.show_book', book_id=book.id)) @@ -656,6 +656,7 @@ def edit_book(book_id): if modif_date: book.last_modified = datetime.utcnow() + calibre_db.session.merge(book) calibre_db.session.commit() if config.config_use_google_drive: gdriveutils.updateGdriveCalibreFromLocal() @@ -719,7 +720,7 @@ def upload(): # check if file extension is correct if '.' in requested_file.filename: file_ext = requested_file.filename.rsplit('.', 1)[-1].lower() - if file_ext not in constants.EXTENSIONS_UPLOAD: + if file_ext not in constants.EXTENSIONS_UPLOAD and '' not in constants.EXTENSIONS_UPLOAD: flash( _("File extension '%(ext)s' is not allowed to be uploaded to this server", ext=file_ext), category="error") diff --git a/cps/gdriveutils.py b/cps/gdriveutils.py index 4575727a..489bc6f5 100644 --- a/cps/gdriveutils.py +++ b/cps/gdriveutils.py @@ -213,7 +213,7 @@ def listRootFolders(): def getEbooksFolder(drive): - return getFolderInFolder('root',config.config_google_drive_folder,drive) + return getFolderInFolder('root', config.config_google_drive_folder, drive) def getFolderInFolder(parentId, folderName, drive): diff --git a/cps/isoLanguages.py b/cps/isoLanguages.py index 2a8391f5..4c0aefc3 100644 --- a/cps/isoLanguages.py +++ b/cps/isoLanguages.py @@ -69,6 +69,8 @@ def get_language_codes(locale, language_names, remainder=None): def get_valid_language_codes(locale, language_names, remainder=None): languages = list() + if "" in language_names: + language_names.remove("") for k, v in get_language_names(locale).items(): if k in language_names: languages.append(k) diff --git a/cps/logger.py b/cps/logger.py index f13d75d3..7cc0f4d9 100644 --- a/cps/logger.py +++ b/cps/logger.py @@ -126,11 +126,11 @@ def setup(log_file, log_level=None): file_handler.baseFilename = log_file else: try: - file_handler = RotatingFileHandler(log_file, maxBytes=50000, backupCount=2) + file_handler = RotatingFileHandler(log_file, maxBytes=50000, backupCount=2, encoding='utf-8') except IOError: if log_file == DEFAULT_LOG_FILE: raise - file_handler = RotatingFileHandler(DEFAULT_LOG_FILE, maxBytes=50000, backupCount=2) + file_handler = RotatingFileHandler(DEFAULT_LOG_FILE, maxBytes=50000, backupCount=2, encoding='utf-8') log_file = "" file_handler.setFormatter(FORMATTER) @@ -152,11 +152,11 @@ def create_access_log(log_file, log_name, formatter): access_log.propagate = False access_log.setLevel(logging.INFO) try: - file_handler = RotatingFileHandler(log_file, maxBytes=50000, backupCount=2) + file_handler = RotatingFileHandler(log_file, maxBytes=50000, backupCount=2, encoding='utf-8') except IOError: if log_file == DEFAULT_ACCESS_LOG: raise - file_handler = RotatingFileHandler(DEFAULT_ACCESS_LOG, maxBytes=50000, backupCount=2) + file_handler = RotatingFileHandler(DEFAULT_ACCESS_LOG, maxBytes=50000, backupCount=2, encoding='utf-8') log_file = "" file_handler.setFormatter(formatter) diff --git a/cps/server.py b/cps/server.py index 7c2d321d..a9539964 100644 --- a/cps/server.py +++ b/cps/server.py @@ -194,7 +194,7 @@ class WebServer(object): os.execv(sys.executable, arguments) return True - def _killServer(self, ignored_signum, ignored_frame): + def _killServer(self, __, ___): self.stop() def stop(self, restart=False): diff --git a/cps/static/css/libs/bootstrap-table.min.css b/cps/static/css/libs/bootstrap-table.min.css index 770b6728..72a8f74f 100644 --- a/cps/static/css/libs/bootstrap-table.min.css +++ b/cps/static/css/libs/bootstrap-table.min.css @@ -1 +1,10 @@ -.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child:not([data-not-first-th]){border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .table>thead>tr>th{vertical-align:bottom;border-bottom:1px solid #ddd}.bootstrap-table .table thead>tr>th{padding:0;margin:0}.bootstrap-table .fixed-table-footer tbody>tr>td{padding:0!important}.bootstrap-table .fixed-table-footer .table{border-bottom:none;border-radius:0;padding:0!important}.bootstrap-table .pull-right .dropdown-menu{right:0;left:auto}p.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}.fixed-table-pagination:after,.fixed-table-toolbar:after{content:"";display:block;clear:both}.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important;background:#FFF} \ No newline at end of file +/** + * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation) + * + * @version v1.16.0 + * @homepage https://bootstrap-table.com + * @author wenzhixin (http://wenzhixin.net.cn/) + * @license MIT + */ + +.bootstrap-table .fixed-table-toolbar::after{content:"";display:block;clear:both}.bootstrap-table .fixed-table-toolbar .bs-bars,.bootstrap-table .fixed-table-toolbar .columns,.bootstrap-table .fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group>.btn{border-radius:0}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu{text-align:left;max-height:300px;overflow:auto;-ms-overflow-style:scrollbar;z-index:1001}.bootstrap-table .fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.bootstrap-table .fixed-table-toolbar .columns-left{margin-right:5px}.bootstrap-table .fixed-table-toolbar .columns-right{margin-left:5px}.bootstrap-table .fixed-table-toolbar .pull-right .dropdown-menu{right:0;left:auto}.bootstrap-table .fixed-table-container{position:relative;clear:both}.bootstrap-table .fixed-table-container .table{width:100%;margin-bottom:0!important}.bootstrap-table .fixed-table-container .table td,.bootstrap-table .fixed-table-container .table th{vertical-align:middle;box-sizing:border-box}.bootstrap-table .fixed-table-container .table thead th{vertical-align:bottom;padding:0;margin:0}.bootstrap-table .fixed-table-container .table thead th:focus{outline:0 solid transparent}.bootstrap-table .fixed-table-container .table thead th.detail{width:30px}.bootstrap-table .fixed-table-container .table thead th .th-inner{padding:.75rem;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bootstrap-table .fixed-table-container .table thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px!important}.bootstrap-table .fixed-table-container .table thead th .both{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC")}.bootstrap-table .fixed-table-container .table thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.bootstrap-table .fixed-table-container .table thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.bootstrap-table .fixed-table-container .table tbody tr.selected td{background-color:rgba(0,0,0,.075)}.bootstrap-table .fixed-table-container .table tbody tr.no-records-found td{text-align:center}.bootstrap-table .fixed-table-container .table tbody tr .card-view{display:flex}.bootstrap-table .fixed-table-container .table tbody tr .card-view .card-view-title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.bootstrap-table .fixed-table-container .table .bs-checkbox{text-align:center}.bootstrap-table .fixed-table-container .table .bs-checkbox label{margin-bottom:0}.bootstrap-table .fixed-table-container .table .bs-checkbox label input[type=checkbox],.bootstrap-table .fixed-table-container .table .bs-checkbox label input[type=radio]{margin:0 auto!important}.bootstrap-table .fixed-table-container .table.table-sm .th-inner{padding:.3rem}.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer){border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height.has-card-view{border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .fixed-table-border{border-left:1px solid #dee2e6;border-right:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .table thead th{border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .table-dark thead th{border-bottom:1px solid #32383e}.bootstrap-table .fixed-table-container .fixed-table-header{overflow:hidden}.bootstrap-table .fixed-table-container .fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading{align-items:center;background:#fff;display:none;justify-content:center;position:absolute;bottom:0;width:100%;z-index:1000}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap{align-items:baseline;display:flex;justify-content:center}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .loading-text{font-size:2rem;margin-right:6px}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap{align-items:center;display:flex;justify-content:center}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::after,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::before{content:"";animation-duration:1.5s;animation-iteration-count:infinite;animation-name:LOADING;background:#212529;border-radius:50%;display:block;height:5px;margin:0 4px;opacity:0;width:5px}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot{animation-delay:.3s}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::after{animation-delay:.6s}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark{background:#212529}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-dot,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap::after,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap::before{background:#fff}.bootstrap-table .fixed-table-container .fixed-table-footer{overflow:hidden}.bootstrap-table .fixed-table-pagination::after{content:"";display:block;clear:both}.bootstrap-table .fixed-table-pagination>.pagination,.bootstrap-table .fixed-table-pagination>.pagination-detail{margin-top:10px;margin-bottom:10px}.bootstrap-table .fixed-table-pagination>.pagination-detail .pagination-info{line-height:34px;margin-right:5px}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list{display:inline-block}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list .btn-group{position:relative;display:inline-block;vertical-align:middle}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list .btn-group .dropdown-menu{margin-bottom:0}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination{margin:0}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination a{padding:6px 12px;line-height:1.428571429}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a{color:#c8c8c8}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a::before{content:'\2B05'}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a::after{content:'\27A1'}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.disabled a{pointer-events:none;cursor:default}.bootstrap-table.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important;background:#fff;height:calc(100vh);overflow-y:scroll}div.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}@keyframes LOADING{0%{opacity:0}50%{opacity:1}to{opacity:0}} \ No newline at end of file diff --git a/cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js b/cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js index e93e8246..cd411037 100644 --- a/cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js +++ b/cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js @@ -1,7 +1,10 @@ -/* -* bootstrap-table - v1.12.1 - 2018-03-12 -* https://github.com/wenzhixin/bootstrap-table -* Copyright (c) 2018 zhixin wen -* Licensed MIT License -*/ -!function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{editable:!0,onEditableInit:function(){return!1},onEditableSave:function(){return!1},onEditableShown:function(){return!1},onEditableHidden:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"editable-init.bs.table":"onEditableInit","editable-save.bs.table":"onEditableSave","editable-shown.bs.table":"onEditableShown","editable-hidden.bs.table":"onEditableHidden"});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.initTable,d=b.prototype.initBody;b.prototype.initTable=function(){var b=this;c.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&a.each(this.columns,function(c,d){if(d.editable){var e={},f=[],g="editable-",h=function(a,b){var c=a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()});if(c.slice(0,g.length)==g){var d=c.replace(g,"data-");e[d]=b}};a.each(b.options,h),d.formatter=d.formatter||function(a){return a},d._formatter=d._formatter?d._formatter:d.formatter,d.formatter=function(c,g,i){var j=d._formatter?d._formatter(c,g,i):c;a.each(d,h),a.each(e,function(a,b){f.push(" "+a+'="'+b+'"')});var k=!1;return d.editable.hasOwnProperty("noeditFormatter")&&(k=d.editable.noeditFormatter(c,g,i)),k===!1?['"].join(""):k}}})},b.prototype.initBody=function(){var b=this;d.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&(a.each(this.columns,function(c,d){d.editable&&(b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("save").on("save",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g],i=h[d.field];a(this).data("value",e.submitValue),h[d.field]=e.submitValue,b.trigger("editable-save",d.field,h,i,a(this)),b.resetFooter()}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("shown").on("shown",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-shown",d.field,h,a(this),e)}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("hidden").on("hidden",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-hidden",d.field,h,a(this),e)}))}),this.trigger("editable-init"))}}(jQuery); \ No newline at end of file +/** + * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation) + * + * @version v1.16.0 + * @homepage https://bootstrap-table.com + * @author wenzhixin (http://wenzhixin.net.cn/) + * @license MIT + */ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t=t||self).jQuery)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r=function(t){return t&&t.Math==Math&&t},o=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")(),i=function(t){try{return!!t()}catch(t){return!0}},a=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),c={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,f={f:u&&!c.call({1:2},1)?function(t){var e=u(this,t);return!!e&&e.enumerable}:c},l=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},s={}.toString,d=function(t){return s.call(t).slice(8,-1)},p="".split,h=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==d(t)?p.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},y=function(t){return h(v(t))},g=function(t){return"object"==typeof t?null!==t:"function"==typeof t},b=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,x=function(t,e){return m.call(t,e)},O=o.document,w=g(O)&&g(O.createElement),E=function(t){return w?O.createElement(t):{}},j=!a&&!i((function(){return 7!=Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a})),S=Object.getOwnPropertyDescriptor,T={f:a?S:function(t,e){if(t=y(t),e=b(e,!0),j)try{return S(t,e)}catch(t){}if(x(t,e))return l(!f.f.call(t,e),t[e])}},P=function(t){if(!g(t))throw TypeError(String(t)+" is not an object");return t},A=Object.defineProperty,_={f:a?A:function(t,e,n){if(P(t),e=b(e,!0),P(n),j)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},I=a?function(t,e,n){return _.f(t,e,l(1,n))}:function(t,e,n){return t[e]=n,t},R=function(t,e){try{I(o,t,e)}catch(n){o[t]=e}return e},C=o["__core-js_shared__"]||R("__core-js_shared__",{}),k=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(t){return k.call(t)});var M,$,F,D=C.inspectSource,N=o.WeakMap,q="function"==typeof N&&/native code/.test(D(N)),B=n((function(t){(t.exports=function(t,e){return C[t]||(C[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.0",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),L=0,K=Math.random(),V=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++L+K).toString(36)},U=B("keys"),W=function(t){return U[t]||(U[t]=V(t))},z={},Y=o.WeakMap;if(q){var G=new Y,H=G.get,Q=G.has,X=G.set;M=function(t,e){return X.call(G,t,e),e},$=function(t){return H.call(G,t)||{}},F=function(t){return Q.call(G,t)}}else{var Z=W("state");z[Z]=!0,M=function(t,e){return I(t,Z,e),e},$=function(t){return x(t,Z)?t[Z]:{}},F=function(t){return x(t,Z)}}var J,tt,et={set:M,get:$,has:F,enforce:function(t){return F(t)?$(t):M(t,{})},getterFor:function(t){return function(e){var n;if(!g(e)||(n=$(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},nt=n((function(t){var e=et.get,n=et.enforce,r=String(String).split("String");(t.exports=function(t,e,i,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||x(i,"name")||I(i,"name",e),n(i).source=r.join("string"==typeof e?e:"")),t!==o?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=i:I(t,e,i)):u?t[e]=i:R(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||D(this)}))})),rt=o,ot=function(t){return"function"==typeof t?t:void 0},it=function(t,e){return arguments.length<2?ot(rt[t])||ot(o[t]):rt[t]&&rt[t][e]||o[t]&&o[t][e]},at=Math.ceil,ct=Math.floor,ut=function(t){return isNaN(t=+t)?0:(t>0?ct:at)(t)},ft=Math.min,lt=function(t){return t>0?ft(ut(t),9007199254740991):0},st=Math.max,dt=Math.min,pt=function(t){return function(e,n,r){var o,i=y(e),a=lt(i.length),c=function(t,e){var n=ut(t);return n<0?st(n+e,0):dt(n,e)}(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},ht={includes:pt(!0),indexOf:pt(!1)},vt=ht.indexOf,yt=function(t,e){var n,r=y(t),o=0,i=[];for(n in r)!x(z,n)&&x(r,n)&&i.push(n);for(;e.length>o;)x(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bt=gt.concat("length","prototype"),mt={f:Object.getOwnPropertyNames||function(t){return yt(t,bt)}},xt={f:Object.getOwnPropertySymbols},Ot=it("Reflect","ownKeys")||function(t){var e=mt.f(P(t)),n=xt.f;return n?e.concat(n(t)):e},wt=function(t,e){for(var n=Ot(e),r=_.f,o=T.f,i=0;i=74)&&(J=Vt.match(/Chrome\/(\d+)/))&&(tt=J[1]);var Yt,Gt=tt&&+tt,Ht=Bt("species"),Qt=Bt("isConcatSpreadable"),Xt=Gt>=51||!i((function(){var t=[];return t[Qt]=!1,t.concat()[0]!==t})),Zt=(Yt="concat",Gt>=51||!i((function(){var t=[];return(t.constructor={})[Ht]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),Jt=function(t){if(!g(t))return!1;var e=t[Qt];return void 0!==e?!!e:Ct(t)};Rt({target:"Array",proto:!0,forced:!Xt||!Zt},{concat:function(t){var e,n,r,o,i,a=kt(this),c=Kt(a,0),u=0;for(e=-1,r=arguments.length;e9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n=9007199254740991)throw TypeError("Maximum allowed index exceeded");Mt(c,u++,i)}return c.length=u,c}});var te,ee=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ne=[].push,re=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=5==t||i;return function(c,u,f,l){for(var s,d,p=kt(c),v=h(p),y=ee(u,f,3),g=lt(v.length),b=0,m=l||Kt,x=e?m(c,g):n?m(c,0):void 0;g>b;b++)if((a||b in v)&&(d=y(s=v[b],b,p),t))if(e)x[b]=d;else if(d)switch(t){case 3:return!0;case 5:return s;case 6:return b;case 2:ne.call(x,s)}else if(o)return!1;return i?-1:r||o?o:x}},oe={forEach:re(0),map:re(1),filter:re(2),some:re(3),every:re(4),find:re(5),findIndex:re(6)},ie=Object.keys||function(t){return yt(t,gt)},ae=a?Object.defineProperties:function(t,e){P(t);for(var n,r=ie(e),o=r.length,i=0;o>i;)_.f(t,n=r[i++],e[n]);return t},ce=it("document","documentElement"),ue=W("IE_PROTO"),fe=function(){},le=function(t){return"