UNPKG

@digital-blueprint/greenlight-app

Version:

[GitHub Repository](https://github.com/digital-blueprint/greenlight-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/greenlight-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/greenlight-app/) | [Greenlight Bundle](ht

52 lines 79.6 kB
let e,t=e=>e;const r=["ext","key_ops","alg","use"],n=["encryptedKey"],i=["encryptedKey"];function a(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)} /*! * License: LGPL-2.1-or-later * Dependencies: * * @webcomponents/scoped-custom-element-registry: 0.0.7 (BSD-3-Clause) * @dbp-toolkit/app-shell: 0.3.3 (LGPL-2.1-or-later) * @dbp-toolkit/language-select: 0.3.1 (LGPL-2.1-or-later) * @dbp-toolkit/common: 0.3.4 (LGPL-2.1-or-later) * @dbp-toolkit/auth: 0.3.1 (LGPL-2.1-or-later) * event-target-shim: 6.0.2 (MIT) * @dbp-toolkit/notification: 0.3.1 (LGPL-2.1-or-later) * @dbp-toolkit/theme-switcher: 0.0.5 (LGPL-2.1-or-later) * path-to-regexp: 6.2.0 (MIT) * universal-router: 9.1.0 (MIT) * generateUrls: 9.1.0 (MIT) * @dbp-toolkit/matomo: 0.2.6 (LGPL-2.1-or-later) * @tugraz/web-components: 0.3.6 (LGPL-2.1-or-later) * @babel/runtime: 7.20.13 (MIT) * i18next: 22.4.9 (MIT) * @lit/reactive-element: 1.6.1 (BSD-3-Clause) * lit-html: 2.6.1 (BSD-3-Clause) * lit-element: 3.2.2 (BSD-3-Clause) * @open-wc/dedupe-mixin: 1.3.1 (MIT) * @open-wc/scoped-elements: 2.1.4 (MIT) * jose: 4.11.2 (MIT) * @dbp-toolkit/file-handling: 0.3.5 (LGPL-2.1-or-later) * webdav: 4.8.0 (MIT) * tabulator-tables: 5.1.8 (MIT) * file-saver: 2.0.5 (MIT) * @dbp-toolkit/qr-code-scanner: 0.3.1 (LGPL-2.1-or-later) * async-mutex: 0.4.0 (MIT) * pdfjs-dist: 2.16.105 (Apache-2.0) * dommatrix: 1.0.3 (MIT) * web-streams-polyfill: 3.2.1 (MIT) * mockdate: 3.0.5 (MIT) * certlogic-js: 1.2.2 (Apache-2.0) * string-similarity: 4.0.4 (ISC) */import{a as o,c,K as l,w as d,D as u,s as h,i as f}from"./notification.23e517da.es.js";const p=(e,t)=>(e.endsWith("/")||(e+="/"),new URL(t.replace(/^\/+/,""),e).href);var g={"acquire-3g-ticket":{"3g-proof":"Nachweis","3g-proof-birthdate":"Geburtsdatum","3g-proof-label-text":"Nachweis importieren","3g-proof-proof-from":"Von","3g-proof-status":"Status","3g-proof-valid-for":"Gültigkeit","3g-proof-valid-till-title":"Gültig bis","additional-information":"Sie können Ihren Nachweis einer geringen epidemiologischen Gefahr importieren, indem Sie den entsprechenden QR-Code scannen. Alternativ kann auch ein PDF-Dokument oder ein Bild mit dem QR-Code ausgewählt werden.","confirm-checkbox-valid-cert-text":"Ich bestätige, dass mein Nachweis für die Dauer meines Aufenthalts gültig ist, sowie die Richtigkeit meiner Angaben, und nehme zur Kenntnis, dass jeglicher Missbrauch der App greenlight oder die Angabe falscher Daten zu rechtlichen Konsequenzen führen kann.","confirm-not-checked-body":"Bitte bestätigen Sie, dass Ihre Angaben richtig sind und dass Sie sich bewusst sind, dass der Missbrauch der App greenlight zu rechtlichen Konsequenzen führen kann.","confirm-not-checked-title":"Zustimmung nicht erteilt!","create-new-ticket":"Neues Ticket anfordern","create-ticket":"Ticket erstellen","create-ticket-success-body":"Das angeforderte Eintrittsticket für den Ort {{place}} wurde erfolgreich erstellt.","create-ticket-success-title":"Ticket erfolgreich erstellt!","filepicker-button-title":"PDF oder Bild auswählen","filepicker-context":"PDF oder Bild zur Überprüfung auswählen","found-valid-3g":"Es wurde ein gültiger Nachweis importiert.","found-valid-3g-preCheck":"Es wurden lokal gespeicherte gültige Nachweis-Informationen gefunden.","found-valid-selftest":"Es wurde ein Selbsttest gefunden.","found-valid-selftest-preCheck":"Es wurde ein lokal gespeicherter Selbsttest gefunden.","invalid-body":"Bitte versuchen Sie es mit einem anderen Dokument noch einmal.","invalid-document":"Der Nachweis ist aktuell nicht für den Eintritt an der {{place}} gültig.","invalid-document-prefix":"Technische Details: ","invalid-qr-body":"Der QR-Code enthält keinen gültigen Nachweis.","invalid-title":"Validierung fehlgeschlagen!","manage-tickets-link":"Tickets anzeigen","manage-tickets-text":"Es wurden aktive Tickets gefunden. Sie können Ihre aktiven Tickets vorzeigen oder löschen unter: ","manual-uploading-message":"Suche nach gültigem QR-Code...","manually-button-text":"Datei hochladen","no-photo-body":"Es existiert kein gültiges Foto von Ihrem Studierenden- oder Bedienstetenausweis in {{serviceName}}. Bitte wenden Sie sich an die Studienabteilung.","no-qr-code":"Kein QR-Code gefunden!","not-same-person":"Der hochgeladene Nachweis konnte der angemeldeten Person nicht zugeordnet werden.","other-error-body":"Es ist ein unbekannter Fehler aufgetreten.","other-error-title":"Fehler!","photo-not-available-body":"Es konnte kein Foto von Ihrem Studierenden- oder Bedienstetenausweis aus {{serviceName}} geladen werden. Bitte versuchen Sie es zu einem späteren Zeitpunkt noch einmal.","photo-not-available-title":"Ticketerstellung fehlgeschlagen!","qr-button-text":"QR-Code scannen","remove-proof":"Nachweis entfernen","request-ticket-button-text":"Ticket anfordern","self-test":"Selbsttest","self-test-information":"Bitte überprüfen Sie ob der Nachweis noch gültig ist.","self-test-link":"Link","trust-and-save-1":"Meinen Nachweis importieren und auf diesem Gerät speichern.","trust-and-save-2":"Ihre Daten werden ausschließlich auf diesem Gerät gespeichert und verarbeitet. Es findet keine automatische Übertragung von importierten Nachweisen zwischen Geräten statt. Nachweise, die auf anderen Geräten importiert wurden, sind nur auf diesen verfügbar.","valid-till":"gültig bis "},"date-time":"{{clock}} Uhr am {{date}}","delete-btn-text":"Löschen","entry-ticket":"Eintrittsticket","error-login-message":"Sie müssen angemeldet sein um diese Funktion nutzen zu können!","error-permission-message":"Diese Funktion ist aktuell nur für Studierende verfügbar!","file-sink":{"modal-close":"Schließen"},"full-validity-default":"Erweiterter Zutritt zur Universität",hcert:{"cert-not-valid-error":"Erfüllt nicht die folgenden Regeln: {{error}}","cert-validation-failed-error":"Validierung fehlgeschlagen: {{error}}"},"image-alt-text":"Ticketfoto","loading-message":"Lädt...","loading-message-ticket":"Ticket wird geladen ...","no-full-validity-default":"Kein erweiterter Zutritt zur Universität","no-tickets-message":"Sie besitzen derzeit keine Tickets!","partial-validity-default":"Zutritt zur Universität",reload:"Aktualisieren","reload-error-body":"Die Aktualisierung schlug fehl. Prüfen Sie Ihre Internetverbindung, loggen Sie sich neu ein oder probieren Sie es später noch einmal.","reload-error-title":"Aktualisierung fehlgeschlagen","reload-failed":"Automatische Aktualisierung fehlgeschlagen","self-test-not-supported-body":"Antigen-Tests mit Selbstabnahme („Wohnzimmertests“) sind nicht mehr als Eintrittsnachweis zulässig.","self-test-not-supported-title":"Antigen-Selbsttests („Wohnzimmertests“) werden nicht unterstützt.","show-active-tickets":{"3-g-evidence":"Nachweis","3-g-evidence-green-pass-valid":"Grüner Pass auf diesem Gerät importiert und gültig","3-g-evidence-greenpass":"Nachweis: Grüner Pass gefunden","3-g-evidence-invalid":"kein gültiger Nachweis auf diesem Gerät gefunden","3-g-evidence-invalid-text":"Eventuell haben Sie Ihren Nachweis auf einem anderen Gerät importiert, der Nachweis ist nicht mehr gültig oder die Applikation wurde für einen längeren Zeitraum nicht genutzt.","3-g-evidence-maximize-saving":"Fügen Sie die App auf dem Startbildschirm Ihres Smartphones hinzu, um die Speicherdauer des Nachweises zu maximieren.","3-g-evidence-selftest":"Selbsttest auf diesem Gerät importiert, manuelle Kontrolle notwendig","acquire-ticket":"Ticket erstellen","delete-dialog-text":"Möchten Sie das Ticket wirklich löschen?","delete-ticket-notfound-body":"Es wurde kein aktives Ticket: {{place}} gefunden. Das Ticket ist wahrscheinlich schon abgelaufen oder gelöscht.","delete-ticket-notfound-title":"Ticket nicht gefunden!","delete-ticket-success-body":"Das Ticket für den Ort {{place}} wurde erfolgreich gelöscht.","delete-ticket-success-title":"Ticket erfolgreich gelöscht!","invalid-evidence":"Falls der Nachweis nicht mehr gültig ist, können Sie ein neues Ticket erstellen und einen neuen Nachweis hochladen.","logged-out-body":"Die Sitzung ist abgelaufen. Bitte melden Sie sich erneut an.","logged-out-title":"Sitzung abgelaufen!","new-ticket":"Neues Ticket anfordern","no-3g-evidence":"Kein Nachweis gefunden","no-evidence":"Es wurde kein gültiger gespeicherter Nachweis gefunden. Zeigen Sie ihren Nachweis manuell vor oder laden Sie einen neuen Nachweis hoch, indem Sie ein neues Ticket erstellen.","other-error-body":"Es ist ein unbekannter Fehler aufgetreten.","other-error-title":"Fehler!","self-test":"Selbsttest","self-test-found":"Nachweis: Selbsttest gefunden","self-test-information":"Bitte überprüfen Sie ob der Nachweis noch gültig ist.","self-test-link":"Link zum Test","show-btn-text":"Vorzeigen",status:"Status: ","status-active":"aktiv","status-inactive":"inaktiv","validation-failed":"Validierung aktuell nicht möglich","validation-failed-text":"Die Validierung des Nachweises ist aus technischen Gründen derzeit nicht möglich. Bitte versuchen Sie es zu einem späteren Zeitpunkt noch einmal."},"show-btn-text":"Zeigen","show-reference-ticket":{description:"Vergleichen Sie als Überprüfende/r immer die Tickets, die von Studierenden vorgezeigt werden, mit dem Referenzticket. Der Hintergrund des Ticketbildes wird aus Sicherheitsgründen in regelmäßigen Abständen geändert. Wenn der Hintergrund mit dem des aktuellen Referenztickets übereinstimmt, ist das Ticket gültig. Das Referenzticket berechtigt nicht für den Zugang zu den Räumlichkeiten der Universität.","information-container-body":"Ist ein gültiger Grüner Pass auf dem Gerät importiert, wird dessen QR-Code angezeigt und das Ticket in Farbe dargestellt. Der QR-Code kann mit GreenCheck validiert werden. Ist ein Selbsttest des Landes Steiermark oder Kärnten auf dem Gerät importiert, wird dessen QR-Code angezeigt und das Ticket in Graustufen dargestellt. Dieser QR-Code kann nicht in greenlight validiert werden, daher muss die Kontrolle mit einem QR-Code Scanner erfolgen. Ist ein gültiger universitätsinterner Test auf dem Gerät importiert, wird das Ticket in Farbe dargestellt. Die manuelle Validierung dieses Tests kann nur mit dem Originaldokument erfolgen.","information-container-headline":"Informationen zum Nachweis","place-name":"Ort","switch-label-in-color":"In Farbe","switch-label-in-grayscale":"In Graustufen"},"show-ticket-title":"Ticket: ","valid-till":"Voraussichtlich gültig bis ","validation-not-possible":"Die Validierung des Nachweises ist aus technischen Gründen derzeit nicht möglich. Bitte versuchen Sie es zu einem späteren Zeitpunkt noch einmal.","validation-not-possible-body":"Der Nachweis kann aktuell nicht validiert werden. Versuchen Sie es später nochmals.","validation-not-possible-title":"Validierung aktuell nicht möglich","validity-tooltip":"Nach den aktuellen Bestimmungen der {{place}}. Die Gültigkeitsdauer wird bei einer Änderung der Bestimmungen automatisch aktualisiert.","validity-tooltip-ticket-text":"Das Ticket ist nur in elektronischer Form gültig."},y={"acquire-3g-ticket":{"3g-proof":"Evidence","3g-proof-birthdate":"Birthdate","3g-proof-label-text":"Import evidence","3g-proof-proof-from":"From","3g-proof-status":"Status","3g-proof-valid-for":"Validity","3g-proof-valid-till-title":"Valid until","additional-information":"You can import your evidence of a low epidemiological risk by scanning the corresponding QR code. Alternatively, you can select a PDF document or an image with the QR code. ","confirm-checkbox-valid-cert-text":"I confirm the accuracy of my evidence and understand that any misuse of the greenlight app or the provision of incorrect data can lead to legal consequences.","confirm-not-checked-body":"Please confirm that the information you have provided is correct and that you are aware that misuse of the greenlight app may lead to legal consequences","confirm-not-checked-title":"Consent not given!","create-new-ticket":"Request new ticket","create-ticket":"Create ticket","create-ticket-success-body":"The acquired entrance ticket for {{place}} was successfully created.","create-ticket-success-title":"Ticket successfully created!","filepicker-button-title":"Choose PDF or image","filepicker-context":"Choose PDF or image for verification","found-valid-3g":"A valid evidence was imported.","found-valid-3g-preCheck":"Stored valid evidence could be found.","found-valid-selftest":"A self-test was found.","found-valid-selftest-preCheck":"A locally saved self-test was found.","invalid-body":"Please try again with another document.","invalid-document":"The evidence is currently not valid for {{place}}.","invalid-document-prefix":"Technical details: ","invalid-qr-body":"The QR code does not contain a valid evidence.","invalid-title":"Validation failed!","manage-tickets-link":"Show tickets","manage-tickets-text":"Active tickets could be found. You can manage your active tickets at: ","manual-uploading-message":"Search for valid QR code...","manually-button-text":"Upload File","no-photo-body":"There is no valid photo of your student or staff ID in {{serviceName}}. Please contact the studies department.","no-qr-code":"No QR code found!","not-same-person":"The person in the uploaded evidence does not match the person logged in.","other-error-body":"An unknown error has occurred.","other-error-title":"Error!","photo-not-available-body":"No photo of your student or staff ID card could be loaded from {{serviceName}}. Please try again at a later time.","photo-not-available-title":"Ticket creation failed!","qr-button-text":"Scan QR code","remove-proof":"Remove evidence","request-ticket-button-text":"Request ticket","self-test":"Selftest","self-test-information":"Please check whether the evidence is still valid.","self-test-link":"Link","trust-and-save-1":"I agree to import my evidence and store this data on my device.","trust-and-save-2":"Your data is stored and processed exclusively on this device. There is no automatic transfer of an imported evidence between devices. The evidence imported on other devices is only available on these devices.","valid-till":"valid until "},"date-time":"{{clock}} on {{date}}","delete-btn-text":"Delete","entry-ticket":"Entry Ticket","error-login-message":"You need to be logged in to use this function!","error-permission-message":"This function is currently only available for students!","file-sink":{"modal-close":"Close"},"full-validity-default":"Extended access to the university",hcert:{"cert-not-valid-error":"Does not comply with the following rules: {{error}}","cert-validation-failed-error":"Validation failed: {{error}}"},"image-alt-text":"Ticket image","loading-message":"Loading...","loading-message-ticket":"Loading the ticket ...","no-full-validity-default":"No extended access to the university","no-tickets-message":"You do not have any tickets!","partial-validity-default":"Access to the university",reload:"Refresh","reload-error-body":"The update failed. Check your internet connection, log in again or try again later.","reload-error-title":"Update failed","reload-failed":"Automatic update failed","self-test-not-supported-body":'Antigen tests with self-acceptance ("self-tests") are no longer permitted as proof of entry.',"self-test-not-supported-title":"Self-tests are not supported","show-active-tickets":{"3-g-evidence":"Evidence","3-g-evidence-green-pass-valid":"Green Pass imported and valid on this device","3-g-evidence-greenpass":"Evidence: Green Pass found","3-g-evidence-invalid":"No valid evidence found on this device","3-g-evidence-invalid-text":"You may have imported your evidence on another device, the evidence is no longer valid or the application has not been used for a longer period of time.","3-g-evidence-maximize-saving":"Add the app to the home screen of your smartphone to maximize the storage time of the evidence.","3-g-evidence-selftest":"Self-test imported on this device, manual control necessary","acquire-ticket":"Create a ticket","delete-dialog-text":"Do you really want to delete the ticket?","delete-ticket-notfound-body":"No active ticket: {{place}} was found. The ticket has probably already expired or deleted.","delete-ticket-notfound-title":"Ticket not found!","delete-ticket-success-body":"The ticket for {{place}} was successfully deleted.","delete-ticket-success-title":"Ticket successfully deleted!","invalid-evidence":"If the evidence is no longer valid, you can create a new ticket and upload a new evidence.","logged-out-body":"The session has expired. Please log in again.","logged-out-title":"Session expired!","new-ticket":"Request a new ticket","no-3g-evidence":"No evidence found","no-evidence":"No valid stored evidence was found. Show your evidence manually or upload a new evidence by creating a new ticket.","other-error-body":"An unknown error occurred.","other-error-title":"Error!","self-test":"self-test","self-test-found":"Evidence: Self-test found","self-test-information":"Please check whether the evidence is still valid.","self-test-link":"Link to the test","show-btn-text":"Show",status:"Status: ","status-active":"active","status-inactive":"inactive","validation-failed":"Validation currently not possible","validation-failed-text":"The validation of the evidence is currently not possible for technical reasons. Please try again later."},"show-btn-text":"Show","show-reference-ticket":{description:"At this point the validity of an entrance ticket is displayed. Whether a ticket is active or inactive depends on the evidence imported on the controlled person's device. The reference ticket does not entitle you to enter rooms at the university.","information-container-body":"If a valid health certificate is available on this device then its QR code is displayed and the ticket is shown in color. This QR code can be checked with GreenCheck. If a self-test that was issued by Land Steiermark or Land Kärnten is available on this device then its QR code is displayed and the ticket is shown in black and white. This QR code cannot be validated by this app, therefore its validation requires a QR code scanner. If a valid university-internal test is available on this device then the ticket is shown in color. Manual validation of this test can only be done with the original document.","information-container-headline":"Information about evidence","place-name":"Place","switch-label-in-color":"In color","switch-label-in-grayscale":"In grayscale"},"show-ticket-title":"Ticket: ","valid-till":"Probably valid until ","validation-not-possible":"The validation of the evidence is currently not possible for technical reasons. Please try again later.","validation-not-possible-body":"The evidence cannot currently be validated. Please try again later.","validation-not-possible-title":"Validierung aktuell nicht möglich","validity-tooltip":"According to the current regulations of {{place}}. The validity period is automatically updated when the regulations change.","validity-tooltip-ticket-text":"The ticket is only valid in electronic form."};function w(){return o({en:y,de:g},"de","en")}const m=()=>{let e=(new Error).stack||"";return e=e.split("\n").map((function(e){return e.trim()})),e.splice("Error"===e[0]?2:1)};function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){return e}function A(e,t,r){return e(t,r)}var E="@digital-blueprint/greenlight-app",k={};!function(e){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=Date,i=null,a=function(e){function t(t,r,a,s,o,c,l){var d;switch(e.call(this),arguments.length){case 0:d=null!==i?new n(i.valueOf()):new n;break;case 1:d=new n(t);break;default:d=new n(t,r,a=void 0===a?1:a,s=s||0,o=o||0,c=c||0,l=l||0)}return d}return r(t,e),t}(n);function s(e){var t=new Date(e.valueOf());if(isNaN(t.getTime()))throw new TypeError("mockdate: The time set is an invalid date: "+e);Date=a,i=t.valueOf()}function o(){Date=n}a.prototype=n.prototype,a.UTC=n.UTC,a.now=function(){return(new a).valueOf()},a.parse=function(e){return n.parse(e)},a.toString=function(){return n.toString()};var c={set:s,reset:o};e.default=c,e.reset=o,e.set=s,Object.defineProperty(e,"__esModule",{value:!0})}(k);var S=l(k);function C(e,t){S.set(e.toISOString());try{return t()}finally{S.reset()}}async function T(){let e=T._promise;return void 0===e&&(e=new Promise(((e,t)=>{let r=document.createElement("script");r.onload=function(){let t=window.hcert;delete window.hcert,document.head.removeChild(r),e(t)},r.onerror=function(e){document.head.removeChild(r),t(e)},r.src=d(E,"hcert-kotlin.js"),document.head.appendChild(r)})),T._promise=e),async function(e){const t=e=>parseInt(e);if(t.prototype={},void 0===window.BigInt){window.BigInt=t;try{return await e()}finally{window.BigInt===t&&delete window.BigInt}}return await e()}((async()=>await e))}var D={},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.timeUnits=void 0,P.timeUnits=["year","month","day","hour"];var U={},_={};Object.defineProperty(_,"__esModule",{value:!0}),_.dataAccessesWithContext=_.dataAccesses=void 0;const x=(e,t)=>{const r=t=>x(t,e);if(Array.isArray(e))return e.flatMap(r);if("object"==typeof e){const[n,i]=Object.entries(e)[0];switch(n){case"var":return[{path:i,context:null!=t?t:e}];case"if":return i.slice(0,3).flatMap(r);case"===":case"and":case">":case"<":case">=":case"<=":case"in":case"+":case"after":case"before":case"not-after":case"not-before":return i.flatMap(r);case"!":case"plusTime":case"extractFromUVCI":case"dccDateOfBirth":return r(i[0]);case"reduce":return[i[0],i[2]].flatMap(r);default:throw new Error(`operator not recognised by fields gatherer ("gatherFrom") in certlogic-js/validation/${__filename}: "${n}"`)}}return[]};_.dataAccesses=e=>[...new Set(x(e).map((e=>e.path)))].sort();_.dataAccessesWithContext=e=>{const t={};return x(e).forEach((({path:e,context:r})=>{e in t||(t[e]=[]),t[e].push(r)})),t};var H={},I={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.access=e.extractFromUVCI=e.dccDateOfBirth=e.plusTime=e.roundUpPartialDate=e.dateFromString=e.isDate=e.isCertLogicLiteral=e.isInt=e.boolsiness=e.isTruthy=e.isFalsy=e.isDictionary=void 0;e.isDictionary=e=>"object"==typeof e&&null!==e&&"[object Object]"===e.toString()&&!Array.isArray(e);e.isFalsy=t=>!1===t||null===t||"string"==typeof t&&""===t||"number"==typeof t&&0===t||Array.isArray(t)&&0===t.length||(0,e.isDictionary)(t)&&0===Object.entries(t).length;e.isTruthy=t=>!0===t||"string"==typeof t&&""!==t||"number"==typeof t&&0!==t||Array.isArray(t)&&t.length>0||(0,e.isDictionary)(t)&&Object.entries(t).length>0;e.boolsiness=t=>!!(0,e.isTruthy)(t)||!(0,e.isFalsy)(t)&&void 0;e.isInt=e=>"number"==typeof e&&Number.isInteger(e);e.isCertLogicLiteral=t=>"string"==typeof t||(0,e.isInt)(t)||"boolean"==typeof t;e.isDate=e=>e instanceof Date;const t="T00:00:00.000Z";e.dateFromString=e=>{if(e.match(/^\d{4}-\d{2}-\d{2}$/))return new Date(`${e}${t}`);const r=e.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+?)?(Z|(([+-])(\d{1,2}):?(\d{2})?))?$/);if(r){let e=`${r[1]}-${r[2]}-${r[3]}T${r[4]}:${r[5]}:${r[6]}`;return r[7]&&(e+=r[7].padEnd(4,"0").substring(0,4)),r[8]&&"Z"!==r[8]?e+=r[10]+((e,t,r)=>r.repeat(t-e.length)+e)(r[11],2,"0")+":"+(r[12]||"00"):e+="Z",new Date(e)}throw new Error(`not an allowed date or date-time format: ${e}`)};e.roundUpPartialDate=e=>{if(e.match(/^\d{4}$/))return new Date(`${e}-12-31${t}`);if(e.match(/^\d{4}-\d{2}$/)){const r=new Date(`${e}-01${t}`);return r.setUTCMonth(r.getUTCMonth()+1),r.setUTCDate(0),r}};e.plusTime=(t,r,n)=>{var i;const a=null!=(i=(0,e.roundUpPartialDate)(t))?i:(0,e.dateFromString)(t);if(0===r)return a;if("day"===n)a.setUTCDate(a.getUTCDate()+r);else if("hour"===n)a.setUTCHours(a.getUTCHours()+r);else if("month"===n)a.setUTCMonth(a.getUTCMonth()+r);else{if("year"!==n)throw new Error(`unknown time unit "${n}"`);a.setUTCFullYear(a.getUTCFullYear()+r)}return a};e.dccDateOfBirth=t=>{const r=(0,e.roundUpPartialDate)(t);if(void 0!==r)return r;if(t.match(/^\d{4}-\d{2}-\d{2}$/))return(0,e.dateFromString)(t);throw new Error(`can't parse "${t}" as an EU DCC date-of-birth`)};const r="URN:UVCI:";e.extractFromUVCI=(e,t)=>{if(null===e||t<0)return null;const n=(e.startsWith(r)?e.substring(r.length):e).split(/[/#:]/);return t<n.length?n[t]:null};e.access=(e,t)=>""===t?e:t.split(".").reduce(((e,t)=>{if(null===e)return null;const r=parseInt(t,10),n=isNaN(r)?e[t]:e[r];return void 0===n?null:n}),e)}(I),Object.defineProperty(H,"__esModule",{value:!0}),H.validateFormat=void 0;const K=I,R=P,M=e=>{const t=t=>[{expr:e,message:t}];if((0,K.isCertLogicLiteral)(e))return[];if("number"==typeof e)return t(`${e} is a non-integer number`);if(null===e)return t("invalid CertLogic expression");if(Array.isArray(e))return e.flatMap(M);if("object"==typeof e){const r=Object.entries(e);if(1!==r.length)return t(`expression object must have exactly one key, but it has ${r.length}`);const[n,i]=r[0];return"var"===n?((e,t)=>{if("string"!=typeof t)return[{expr:e,message:'not of the form { "var": "<path>" }'}];const r=t;return""===r||r.match(/^([^.]+?)(\.[^.]+?)*$/)?[]:[{expr:e,message:`data access path doesn't have a valid format: ${r}`}]})(e,i):Array.isArray(i)?"if"===n?((e,t)=>{const r=[];return 3!==t.length&&r.push({expr:e,message:`an "if"-operation must have exactly 3 values/operands, but it has ${t.length}`}),r.push(...t.slice(0,3).flatMap(M)),r})(e,i):["===","and",">","<",">=","<=","in","+","after","before","not-after","not-before"].indexOf(n)>-1?((e,t,r)=>{const n=[];let i=r.length;switch(t){case"and":r.length<2&&n.push({expr:e,message:`an "and" operation must have at least 2 operands, but it has ${r.length}`});break;case"<":case">":case"<=":case">=":case"after":case"before":case"not-after":case"not-before":i=3,(r.length<2||r.length>3)&&n.push({expr:e,message:`an operation with operator "${t}" must have 2 or 3 operands, but it has ${r.length}`});break;default:i=2,2!==r.length&&n.push({expr:e,message:`an operation with operator "${t}" must have 2 operands, but it has ${r.length}`})}return n.push(...r.slice(0,i).flatMap(M)),n})(e,n,i):"!"===n?((e,t)=>1===t.length?M(t[0]):[{expr:e,message:`a !-operation (logical not/negation) must have exactly 1 operand, but it has ${t.length}`}])(e,i):"plusTime"===n?((e,t)=>{const r=[];return 3!==t.length&&r.push({expr:e,message:`a "plusTime"-operation must have exactly 3 values/operands, but it has ${t.length}`}),void 0!==t[0]&&r.push(...M(t[0])),void 0===t[1]||(0,K.isInt)(t[1])||r.push({expr:e,message:`"amount" argument (#2) of "plusTime" must be an integer, but it is: ${t[1]}`}),void 0!==t[2]&&-1===R.timeUnits.indexOf(t[2])&&r.push({expr:e,message:`"unit" argument (#3) of "plusTime" must be a string equal to one of ${R.timeUnits.join(", ")}, but it is: ${t[2]}`}),r})(e,i):"reduce"===n?((e,t)=>{const r=[];return 3!==t.length&&r.push({expr:e,message:`a "reduce"-operation must have exactly 3 values/operands, but it has ${t.length}`}),r.push(...t.slice(0,3).flatMap(M)),r})(e,i):"extractFromUVCI"===n?((e,t)=>{const r=[];return 2!==t.length&&r.push({expr:e,message:`an "extractFromUVCI"-operation must have exactly 2 values/operands, but it has ${t.length}`}),void 0!==t[0]&&r.push(...M(t[0])),void 0===t[1]||(0,K.isInt)(t[1])||r.push({expr:e,message:`"index" argument (#2) of "extractFromUVCI" must be an integer, but it is: ${t[1]}`}),r})(e,i):"dccDateOfBirth"===n?((e,t)=>{const r=[];return 1!==t.length&&r.push({expr:e,message:`a "dccDateOfBirth"-operation must have exactly 1 value/operand, but it has ${t.length}`}),void 0!==t[0]&&r.push(...M(t[0])),r})(e,i):t(`unrecognised operator: "${n}"`):t('operation not of the form { "<operator>": [ <values...> ] }')}return t("invalid CertLogic expression")};H.validateFormat=M,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCertLogicOperation=e.isCertLogicExpression=e.validate=e.validateFormat=e.dataAccessesWithContext=e.dataAccesses=void 0;var t=_;Object.defineProperty(e,"dataAccesses",{enumerable:!0,get:function(){return t.dataAccesses}}),Object.defineProperty(e,"dataAccessesWithContext",{enumerable:!0,get:function(){return t.dataAccessesWithContext}});var r=H;Object.defineProperty(e,"validateFormat",{enumerable:!0,get:function(){return r.validateFormat}});const n=H;e.validate=e=>(0,n.validateFormat)(e);e.isCertLogicExpression=t=>0===(0,e.validate)(t).length;const i=I;e.isCertLogicOperation=t=>(0,e.isCertLogicExpression)(t)&&(0,i.isDictionary)(t)}(U);var B={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.evaluate=void 0;const t=P,r=I,n=(e,t)=>{const r=(e=>(t,r)=>{switch(e){case"<":return t<r;case">":return t>r;case"<=":return t<=r;case">=":return t>=r}})(e);switch(t.length){case 2:return r(t[0],t[1]);case 3:return r(t[0],t[1])&&r(t[1],t[2]);default:throw new Error(`invalid number of operands to a "${e}" operation`)}};e.evaluate=(i,a)=>{if((0,r.isCertLogicLiteral)(i))return i;if(null===i)throw new Error(`invalid CertLogic expression: ${i}`);if(Array.isArray(i))return i.map((t=>(0,e.evaluate)(t,a)));if("object"==typeof i){const s=Object.entries(i);if(1!==s.length)throw new Error("unrecognised expression object encountered");const[o,c]=s[0];if("var"===o)return((e,t)=>{if("string"!=typeof e)throw new Error('not of the form { "var": "<path>" }');return(0,r.access)(t,e)})(c,a);if(!(Array.isArray(c)&&c.length>0))throw new Error('operation not of the form { "<operator>": [ <values...> ] }');if("if"===o){const[t,n,i]=c;return((t,n,i,a)=>{if(void 0===t)throw new Error("an if-operation must have a guard (argument #1)");if(void 0===n)throw new Error("an if-operation must have a then (argument #2)");if(void 0===i)throw new Error("an if-operation must have an else (argument #3)");const s=(0,e.evaluate)(t,a);switch((0,r.boolsiness)(s)){case!0:return(0,e.evaluate)(n,a);case!1:return(0,e.evaluate)(i,a);case void 0:throw new Error(`if-guard evaluates to something neither truthy, nor falsy: ${s}`)}})(t,n,i,a)}if(["===","and",">","<",">=","<=","in","+","after","before","not-after","not-before"].indexOf(o)>-1)return((t,i,a)=>{switch(t){case"and":if(i.length<2)throw new Error('an "and" operation must have at least 2 operands');break;case"<":case">":case"<=":case">=":case"after":case"before":case"not-after":case"not-before":if(i.length<2||i.length>3)throw new Error(`an operation with operator "${t}" must have 2 or 3 operands`);break;default:if(2!==i.length)throw new Error(`an operation with operator "${t}" must have 2 operands`)}if("and"===t)return i.reduce(((t,n)=>{switch((0,r.boolsiness)(t)){case!1:return t;case!0:{const t=(0,e.evaluate)(n,a);if(void 0===(0,r.boolsiness)(t))throw new Error('all operands of an "and" operation must be either truthy or falsy');return t}}}),!0);const s=i.map((t=>(0,e.evaluate)(t,a)));switch(t){case"===":return s[0]===s[1];case"in":{const e=s[1];if(!Array.isArray(e))throw new Error('right-hand side of an "in" operation must be an array');return e.indexOf(s[0])>-1}case"+":{const e=s[0],t=s[1];if(!(0,r.isInt)(e)||!(0,r.isInt)(t))throw new Error("operands of this operation must both be integers");return e+t}case"<":case">":case"<=":case">=":if(!s.every(r.isInt))throw new Error("all operands of a comparison operation must be of integer type");return n(t,s);case"after":case"before":case"not-after":case"not-before":if(!s.every((e=>e instanceof Date)))throw new Error("all operands of a date-time comparison must be date-times");return n((e=>{switch(e){case"after":return">";case"before":return"<";case"not-after":return"<=";case"not-before":return">="}})(t),s);default:throw new Error(`unhandled infix operator "${t}"`)}})(o,c,a);if("!"===o)return((t,n)=>{const i=(0,e.evaluate)(t,n);switch((0,r.boolsiness)(i)){case!1:return!0;case!0:return!1;case void 0:throw new Error(`operand of ! evaluates to something neither truthy, nor falsy: ${i}`)}})(c[0],a);if("plusTime"===o)return((n,i,a,s)=>{if(!(0,r.isInt)(i))throw new Error('"amount" argument (#2) of "plusTime" must be an integer');if(-1===t.timeUnits.indexOf(a))throw new Error(`"unit" argument (#3) of "plusTime" must be a string with one of the time units: ${t.timeUnits.join(", ")}`);const o=(0,e.evaluate)(n,s);if("string"!=typeof o)throw new Error('date argument (#1) of "plusTime" must be a string');return(0,r.plusTime)(o,i,a)})(c[0],c[1],c[2],a);if("reduce"===o)return((t,r,n,i)=>{const a=(0,e.evaluate)(t,i),s=()=>(0,e.evaluate)(n,i);if(null===a)return s();if(!Array.isArray(a))throw new Error("operand of reduce evaluated to a non-null non-array");return a.reduce(((t,n)=>(0,e.evaluate)(r,{accumulator:t,current:n})),s())})(c[0],c[1],c[2],a);if("extractFromUVCI"===o)return((t,n,i)=>{const a=(0,e.evaluate)(t,i);if(null!==a&&"string"!=typeof a)throw new Error('"UVCI" argument (#1) of "extractFromUVCI" must be either a string or null');if(!(0,r.isInt)(n))throw new Error('"index" argument (#2) of "extractFromUVCI" must be an integer');return(0,r.extractFromUVCI)(a,n)})(c[0],c[1],a);if("dccDateOfBirth"===o)return((t,n)=>{const i=(0,e.evaluate)(t,n);if("string"!=typeof i)throw new Error('operand of "dccDateOfBirth" must be a string');return(0,r.dccDateOfBirth)(i)})(c[0],a);throw new Error(`unrecognised operator: "${o}"`)}throw new Error(`invalid CertLogic expression: ${i}`)}}(B);var O="1.2.2";!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.specificationVersion=e.implementationVersion=e.evaluate=e.isInt=e.isCertLogicOperation=e.isCertLogicExpression=e.timeUnits=void 0;var t=P;Object.defineProperty(e,"timeUnits",{enumerable:!0,get:function(){return t.timeUnits}});var r=U;Object.defineProperty(e,"isCertLogicExpression",{enumerable:!0,get:function(){return r.isCertLogicExpression}}),Object.defineProperty(e,"isCertLogicOperation",{enumerable:!0,get:function(){return r.isCertLogicOperation}});var n=I;Object.defineProperty(e,"isInt",{enumerable:!0,get:function(){return n.isInt}});var i=B;Object.defineProperty(e,"evaluate",{enumerable:!0,get:function(){return i.evaluate}}),e.implementationVersion=O,e.specificationVersion="1.3.2"}(D);var F=l(D);class W{constructor(){this.validFrom=null,this.validUntil=null,this.valueSets=[]}forLogic(){let e={};for(const t of this.valueSets)e[t.valueSetId]=Object.keys(t.valueSetValues);return e}}class N{constructor(){this.rules=[]}removeAll(e){let t=Object.entries(e);0!==t.length&&(this.rules=this.rules.filter((e=>{for(let[r,n]in t)if(e[r]!==n)return!0;return!1})))}add(e){this.rules.push(e)}filter(e,t){let r=[];for(let n of this.rules)n.Country==e&&n.Region==t&&r.push(n);let n=new N;return n.rules=r,n}}function V(e){let t={};for(let r of e.Description)t[r.lang]=`[${e.Identifier}] ${r.desc}`;return t}class Q{constructor(){this.isValid=!1,this.errors=[]}}function j(e,t,r,n,i){let a={payload:e,external:{valueSets:r.forLogic(),validationClock:n.toISOString()}},s=new Q;s.isValid=!0;let o=[];for(let e of t.rules){if(i<new Date(e.ValidFrom)||i>new Date(e.ValidTo))continue;!0!==F.evaluate(e.Logic,a)&&o.push(V(e))}return o.length&&(s.errors=o,s.isValid=!1),s}function G(e,t,r,n){let i=i=>j(e,t,r,i,n).isValid,a=e=>new Date(e);if(!i(n))return null;let s=n.getTime(),o=864e5,c=n;const l=new Date(n.getTime());for(l.setFullYear(l.getFullYear()+1e3);;){if(c=a(s+o),isNaN(c.getTime())||c>l){if(!i(l)){c=l;break}return null}if(!i(c))break;o*=2}let d=n.getTime(),u=c.getTime();for(;d<u;){let e=Math.round(d+(u-d)/2);if(c=a(e),i(c)){if(d===e)break;d=e}else{if(u===e)break;u=e}}return a(d)}class ${constructor(){this.country=null,this.region=null,this.isValid=!1,this.error=null,this.validUntil=null}}class L{constructor(){this.isValid=!1,this.error=null,this.firstname=null,this.firstname_t=null,this.lastname=null,this.lastname_t=null,this.dob=null,this.regions={}}}const z=new class{constructor(e,t=!0){let r=t?"prod":"test";this._trustAnchor=t?"-----BEGIN CERTIFICATE-----\nMIIB1DCCAXmgAwIBAgIKAYDcOWBmNxlPgDAKBggqhkjOPQQDAjBEMQswCQYDVQQG\nEwJBVDEPMA0GA1UECgwGQk1TR1BLMQwwCgYDVQQFEwMwMDIxFjAUBgNVBAMMDUFU\nIERHQyBDU0NBIDIwHhcNMjIwNTE5MTIwOTQ5WhcNMjMwNjE5MTIwOTQ5WjBFMQsw\nCQYDVQQGEwJBVDEPMA0GA1UECgwGQk1TR1BLMQ8wDQYDVQQFEwYwMDIwMDIxFDAS\nBgNVBAMMC0FUIERHQyBUTCAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEl2tm\nd16CBHXwcBN0r1Uy+CmNW/b2V0BNP85y5N3JZeo/8l9ey/jIe5mol9fFcGTk9bCk\n8zphVo0SreHa5aWrQKNSMFAwDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBRTwp6d\ncDGcPUB6IwdDja/a3ncM0TAfBgNVHSMEGDAWgBQvWRbxO3tS9HatiMTvp8sD9Rwy\nwTAKBggqhkjOPQQDAgNJADBGAiEAleZ8CcLG4FK4kty+sN0APZmT6LfEE2kzznyV\nyEepU0gCIQCGaqJpOwPXBmgoOsehnJkA0+TZX8V2p1Bg/nqnuYqXFg==\n-----END CERTIFICATE-----":"-----BEGIN CERTIFICATE-----\nMIIB6zCCAZGgAwIBAgIKAXmEuohlRbR2qzAKBggqhkjOPQQDAjBQMQswCQYDVQQG\nEwJBVDEPMA0GA1UECgwGQk1TR1BLMQowCAYDVQQLDAFRMQwwCgYDVQQFEwMwMDEx\nFjAUBgNVBAMMDUFUIERHQyBDU0NBIDEwHhcNMjEwNTE5MTMwNDQ3WhcNMjIwNjE5\nMTMwNDQ3WjBRMQswCQYDVQQGEwJBVDEPMA0GA1UECgwGQk1TR1BLMQowCAYDVQQL\nDAFRMQ8wDQYDVQQFEwYwMDEwMDExFDASBgNVBAMMC0FUIERHQyBUTCAxMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAE29KpT1eIKsy5Jx3J0xpPLW+fEBF7ma9943/j\n4Z+o1TytLVok9cWjsdasWCS/zcRyAh7HBL+oyMWdFBOWENCQ76NSMFAwDgYDVR0P\nAQH/BAQDAgeAMB0GA1UdDgQWBBQYmsL5sXTdMCyW4UtP5BMxq+UAVzAfBgNVHSME\nGDAWgBR2sKi2xkUpGC1Cr5ehwL0hniIsJzAKBggqhkjOPQQDAgNIADBFAiBse17k\nF5F43q9mRGettRDLprASrxsDO9XxUUp3ObjcWQIhALfUWnserGEPiD7Pa25tg9lj\nwkrqDrMdZHZ39qb+Jf/E\n-----END CERTIFICATE-----",this._baseUrl=d(E,"dgc-trust/"+r),this._verifier=null,this._businessRules=null,this._valueSets=null,this._loaded=!1,this._trustDate=e}async _ensureData(){if(!0===this._loaded)return;let e=await T(),t=await async function(e){let t=["rules.json","trustlist","trustlistsig","valuesets","valuesetssig"],r={};for(let n of t)r[n]=fetch(e+"/"+n);for(let[e,t]of Object.entries(r)){let n=await t;if(!n.ok)throw Error(n.statusText);r[e]=await n.arrayBuffer()}return r}(this._baseUrl);this._verifier=C(this._trustDate,(()=>new e.VerifierTrustList(this._trustAnchor,t.trustlist,t.trustlistsig))),this._businessRules=await async function(e,t,r,n){let i=new DataView(t["rules.json"]),a=new TextDecoder("utf8"),s=JSON.parse(a.decode(i)),o=[];for(const e of s.r)o.push(JSON.parse(e.r));let c=new N;return c.rules=o,c}(0,t,this._trustAnchor,this._trustDate),this._valueSets=await async function(e,t,r,n){let i=C(n,(()=>e.SignedDataDownloader.loadValueSets(r,t.valuesets,t.valuesetssig))),a=[];for(const e of i.second.valueSets)a.push(JSON.parse(e.valueSet));let s=new W;return s.validFrom=new Date(i.first.validFrom),s.validUntil=new Date(i.first.validUntil),s.valueSets=a,s}(e,t,this._trustAnchor,this._trustDate),this._loaded=!0}async validate(e,t,r="en",n="AT",i=["ET"]){await this._ensureData();let a=w();a.changeLanguage(r);let s=e=>{let t=a.languages+["en"],r=[];for(let n of e){let e="unknown",i=-1;for(let[r,a]of Object.entries(n)){let n=t.indexOf(r);(-1===i||-1!==n&&n<i)&&(e=a,i=n)}r.push(e)}return r.sort(),r},o=C(this._trustDate,(()=>this._verifier.verify(e))),c=new L;if(o.isValid){var l,d,u,h,f;let e=o.greenCertificate;c.isValid=!0,c.firstname=null!=(l=e.nam.gn)?l:"",c.lastname=null!=(d=e.nam.fn)?d:"",c.firstname_t=null!=(u=e.nam.gnt)?u:"",c.lastname_t=null!=(h=e.nam.fnt)?h:"",c.dob=null!=(f=e.dob)?f:"";for(let r of i){let i=new $;i.country=n,i.region=r;let l=this._businessRules.filter(n,r),d=j(e,l,this._valueSets,t,this._trustDate);if(d.isValid){i.isValid=!0;let r=G(e,l,this._valueSets,t),n=e=>e&&e.includes("T"),a=o.metaInformation;if(n(a.certificateValidUntil)){let e=new Date(a.certificateValidUntil);(null===r||e<r)&&(r=e)}if(n(a.expirationTime)){let e=new Date(a.expirationTime);(null===r||e<r)&&(r=e)}i.validUntil=r}else i.isValid=!1,i.error=a.t("hcert.cert-not-valid-error",{error:s(d.errors).join("\n")});c.regions[r]=i}}else c.isValid=!1,c.error=a.t("hcert.cert-validation-failed-error",{error:o.error});return c}}(new Date,!0);var q={compareTwoStrings:J,findBestMatch:function(e,t){if(!function(e,t){return"string"==typeof e&&(!!Array.isArray(t)&&(!!t.length&&!t.find((function(e){return"string"!=typeof e}))))}(e,t))throw new Error("Bad arguments: First argument should be a string, second should be an array of strings");const r=[];let n=0;for(let i=0;i<t.length;i++){const a=t[i],s=J(e,a);r.push({target:a,rating:s}),s>r[n].rating&&(n=i)}const i=r[n];return{ratings:r,bestMatch:i,bestMatchIndex:n}}};function J(e,t){if((e=e.replace(/\s+/g,""))===(t=t.replace(/\s+/g,"")))return 1;if(e.length<2||t.length<2)return 0;let r=new Map;for(let t=0;t<e.length-1;t++){const n=e.substring(t,t+2),i=r.has(n)?r.get(n)+1:1;r.set(n,i)}let n=0;for(let e=0;e<t.length-1;e++){const i=t.substring(e,e+2),a=r.has(i)?r.get(i):0;a>0&&(r.set(i,a-1),n++)}return 2*n/(e.length+t.length-2)}function Y(e){let t=e.split("-");if(""===e&&(t=[]),t.length>3)return null;let r={};return r.year=void 0!==t[0]?t[0]:null,r.month=void 0!==t[1]?t[1]:null,r.day=void 0!==t[2]?t[2]:null,r}function Z(e){return function(e){let t="";for(const r of Array.from(e.normalize("NFC")))t+=Array.from(r.normalize("NFD"))[0];return t}(e).normalize("NFC").toUpperCase().toLowerCase()}function X(e,t){return q.compareTwoStrings(Z(e),Z(t))}function ee(e,t,r){let n=0;for(let i=0;i<e.length;i++){for(let a=0;a<t.length&&(n=X(e[i],t[a]),!(n>=r));a++);if(n>=r)break}return n}function te(e,t,r,n,i,a,s,o){let c=function(e,t){let r=Y(e),n=Y(t);if(null===r||null===n)return!1;let i=0;if(null!==r.year&&null!==n.year){if(r.year!==n.year)return!1;if(i++,null!==r.month&&null!==n.month){if(r.month!==n.month)return!1;if(i++,null!==r.day&&null!==n.day){if(r.day!==n.day)return!1;i++}}}return i}(i,o);if(!1===c)return!1;const l=.8-.1*c;if(""!==e){let t=e.split(/[-\s+]/),n=a.split(/[-\s+]/),i=ee(t,n,l);if(i<l&&r){i=ee(r.split("<"),n,l)}if(i<l)return!1}let d=X(t,s);if(d<l&&n){d=X(n.replace(/</g," "),s)}return d>=l}var re=crypto;const ne=e=>e instanceof CryptoKey,ie=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await re.subtle.digest(r,t))},ae=new TextEncoder,se=new TextDecoder;function oe(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function ce(e,t,r){if(t<0||t>=4294967296)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function le(e){const t=Math.floor(e/4294967296),r=e%4294967296,n=new Uint8Array(8);return ce(n,t,0),ce(n,r,4),n}function de(e){const t=new Uint8Array(4);return ce(t,e),t}function ue(e){return oe(de(e.length),e)}const he=e=>(e=>{let t=e;"string"==typeof t&&(t=ae.encode(t));const r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),fe=e=>{let t=e;t instanceof Uint8Array&&(t=se.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class pe extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class ge extends pe{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class ye extends pe{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class we extends pe{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class me extends pe{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}var ve=re.getRandomValues.bind(re);function be(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new ye(`Unsupported JWE Algorithm: ${e}`)}}var Ae=e=>ve(new Uint8Array(be(e)>>3));const Ee=(e,t)=>{if(t.length<<3!==be(e))throw new me("Invalid Initialization Vector length")},ke=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new me(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Se(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Ce(e,t){return e.name===t}function Te(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Ce(e.algorithm,"AES-GCM"))throw Se("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Se(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Ce(e.algorithm,"AES-KW"))throw Se("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Se(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Se("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Ce(e.algorithm,"PBKDF2"))throw Se("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Ce(e.algorithm,"RSA-OAEP"))throw Se("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if((n=e.algorithm.hash,parseInt(n.name.slice(4),10))!==r)throw Se(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}var n;!function(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}function De(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Pe=(e,...t)=>De("Key must be ",e,...t);function Ue(e,t,...r){return De(`Key for the ${e} algorithm must be `,t,...r)}var _e=e=>ne(e);const xe=["CryptoKey"];async function He(e,t,r,n,i,a){if(!(t instanceof Uint8Array))throw new TypeError(Pe(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),o=await re.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),c=await re.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),l=oe(a,n,r,le(a.length<<3)),d=new Uint8Array((await re.subtle.sign("HMAC",c,l)).slice(0,s>>3));let u,h;try{u=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i<r;)n|=e[i]^t[i];return 0===n})(i,d)}catch(e){}if(!u)throw new we;try{h=new Uint8Array(await re.subtle.decrypt({iv:n,name:"AES-CBC"},o,r))}catch(e){}if(!h)throw new we;return h}const Ie=async(e,t,r,n,i,a)=>{if(!(ne(t)||t instanceof Uint8Array))throw new TypeError(Pe(t,...xe,"Uint8Array"));switch(Ee(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&ke(t,parseInt(e.slice(-3),10)),He(e,t,r,n,i,a);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&ke(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,a){let s;t instanceof Uint8Array?s=await re.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Te(t,e,"decrypt"),s=t);try{return new Uint8Array(await re.subtle.decrypt({additionalData:a,iv:n,name:"AES-GCM",tagLength:128},s,oe(r,i)))}catch(e){throw new we}}(e,t,r,n,i,a);default:throw new ye("Unsupported JWE Content Encryption Algorithm")}},Ke=async()=>{throw new ye('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Re=async()=>{throw new ye('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Me=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Be(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPr