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

289 lines (254 loc) 117 kB
let t,e,n,i,o,r,a,s,l,c,d,h,u,p,g,m,f,v,b,y,w,k,E,x,_=t=>t;function C(){return C=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},C.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) */import{c as S,a as A,D as L,i as R,y as D,o as T,A as O,g as I,p as P,b as F,s as M,S as N,M as j,d as $,I as U,e as B,f as G,h as z,j as H,k as V,l as W,m as q,n as K}from"./shared/notification.23e517da.es.js";(function(){function t(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function e(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function n(t){if(!(t instanceof Array)){t=e(t);for(var n,i=[];!(n=t.next()).done;)i.push(n.value);t=i}return t}var i="function"==typeof Object.create?Object.create:function(t){function e(){}return e.prototype=t,new e};var o,r=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof S&&S];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this),a=function(){if("undefined"!=typeof Reflect&&Reflect.construct){if(function(){function t(){}return Reflect.construct(t,[],(function(){})),new t instanceof t}())return Reflect.construct;var t=Reflect.construct;return function(e,n,i){return e=t(e,n),i&&Reflect.setPrototypeOf(e,i.prototype),e}}return function(t,e,n){return void 0===n&&(n=t),n=i(n.prototype||Object.prototype),Function.prototype.apply.call(t,n,e)||n}}();if("function"==typeof Object.setPrototypeOf)o=Object.setPrototypeOf;else{var s;t:{var l={};try{l.__proto__={a:!0},s=l.a;break t}catch(t){}s=!1}o=s?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var c=o;if(!ShadowRoot.prototype.createElement){var d,h=window.HTMLElement,u=window.customElements.define,p=window.customElements.get,g=window.customElements,m=new WeakMap,f=new WeakMap,v=new WeakMap,b=new WeakMap;window.CustomElementRegistry=function(){this.l=new Map,this.o=new Map,this.i=new Map,this.h=new Map},window.CustomElementRegistry.prototype.define=function(t,n){if(t=t.toLowerCase(),void 0!==this.j(t))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': the name \""+t+'" has already been used with this registry');if(void 0!==this.o.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var i=n.prototype.attributeChangedCallback,o=new Set(n.observedAttributes||[]);if(w(n,o,i),i={g:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:i,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:o},this.l.set(t,i),this.o.set(n,i),(o=p.call(g,t))||(o=y(t),u.call(g,t,o)),this===window.customElements&&(v.set(n,i),i.s=o),o=this.h.get(t)){this.h.delete(t);for(var r=(o=e(o)).next();!r.done;r=o.next())r=r.value,f.delete(r),E(r,i,!0)}return void 0!==(i=this.i.get(t))&&(i.resolve(n),this.i.delete(t)),n},window.CustomElementRegistry.prototype.upgrade=function(){_.push(this),g.upgrade.apply(g,arguments),_.pop()},window.CustomElementRegistry.prototype.get=function(t){var e;return null==(e=this.l.get(t))?void 0:e.g},window.CustomElementRegistry.prototype.j=function(t){return this.l.get(t)},window.CustomElementRegistry.prototype.whenDefined=function(t){var e=this.j(t);if(void 0!==e)return Promise.resolve(e.g);var n=this.i.get(t);return void 0===n&&((n={}).promise=new Promise((function(t){return n.resolve=t})),this.i.set(t,n)),n.promise},window.CustomElementRegistry.prototype.m=function(t,e,n){var i=this.h.get(e);i||this.h.set(e,i=new Set),n?i.add(t):i.delete(t)},window.HTMLElement=function(){var t=d;if(t)return d=void 0,t;var e=v.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return t=Reflect.construct(h,[],e.s),Object.setPrototypeOf(t,this.constructor.prototype),m.set(t,e),t},window.HTMLElement.prototype=h.prototype;var y=function(t){function e(){var e=Reflect.construct(h,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);t:{var n=e.getRootNode();if(!(n===document||n instanceof ShadowRoot)){if((n=_[_.length-1])instanceof CustomElementRegistry){var i=n;break t}(n=n.getRootNode())===document||n instanceof ShadowRoot||(n=(null==(i=b.get(n))?void 0:i.getRootNode())||document)}i=n.customElements}return(n=(i=i||window.customElements).j(t))?E(e,n):f.set(e,i),e}return r.Object.defineProperty(e,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return!0}}),e.prototype.connectedCallback=function(){var e=m.get(this);e?e.connectedCallback&&e.connectedCallback.apply(this,arguments):f.get(this).m(this,t,!0)},e.prototype.disconnectedCallback=function(){var e=m.get(this);e?e.disconnectedCallback&&e.disconnectedCallback.apply(this,arguments):f.get(this).m(this,t,!1)},e.prototype.adoptedCallback=function(){var t,e;null==(t=m.get(this))||null==(e=t.adoptedCallback)||e.apply(this,arguments)},e.prototype.formAssociatedCallback=function(){var t,e=m.get(this);e&&e.formAssociated&&(null==e||null==(t=e.formAssociatedCallback)||t.apply(this,arguments))},e.prototype.formDisabledCallback=function(){var t,e=m.get(this);null!=e&&e.formAssociated&&(null==e||null==(t=e.formDisabledCallback)||t.apply(this,arguments))},e.prototype.formResetCallback=function(){var t,e=m.get(this);null!=e&&e.formAssociated&&(null==e||null==(t=e.formResetCallback)||t.apply(this,arguments))},e.prototype.formStateRestoreCallback=function(){var t,e=m.get(this);null!=e&&e.formAssociated&&(null==e||null==(t=e.formStateRestoreCallback)||t.apply(this,arguments))},e},w=function(t,e,n){if(0!==e.size&&void 0!==n){var i=t.prototype.setAttribute;i&&(t.prototype.setAttribute=function(t,o){if(t=t.toLowerCase(),e.has(t)){var r=this.getAttribute(t);i.call(this,t,o),n.call(this,t,r,o)}else i.call(this,t,o)});var o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){if(t=t.toLowerCase(),e.has(t)){var i=this.getAttribute(t);o.call(this,t),n.call(this,t,i,null)}else o.call(this,t)});var r=t.prototype.toggleAttribute;r&&(t.prototype.toggleAttribute=function(t){if(t=t.toLowerCase(),e.has(t)){var i=this.getAttribute(t);r.call(this,t);var o=this.getAttribute(t);n.call(this,t,i,o)}else r.call(this,t)})}},k=function t(e){var n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===h?Object.setPrototypeOf(e,window.HTMLElement):t(n)},E=function(t,e,n){n=void 0!==n&&n,Object.setPrototypeOf(t,e.g.prototype),m.set(t,e),d=t;try{new e.g}catch(t){k(e.g),new e.g}e.observedAttributes.forEach((function(n){t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},x=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){var e=x.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};var _=[document],C=function(t,e,n){var i=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){_.push(this);var t=i.apply(n||this,arguments);return void 0!==t&&b.set(t,this),_.pop(),t}};C(ShadowRoot,"createElement",document),C(ShadowRoot,"importNode",document),C(Element,"insertAdjacentHTML");var A=function(t){var e=Object.getOwnPropertyDescriptor(t.prototype,"innerHTML");Object.defineProperty(t.prototype,"innerHTML",Object.assign({},e,{set:function(t){_.push(this),e.set.call(this,t),_.pop()}}))};if(A(Element),A(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var L=new WeakMap,R=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return e=R.call.apply(R,[this].concat(n(e))),L.set(e,this),e},["setFormValue","setValidity","checkValidity","reportValidity"].forEach((function(t){var e=window.ElementInternals.prototype,i=e[t];e[t]=function(t){for(var e=[],o=0;o<arguments.length;++o)e[o]=arguments[o];if(o=L.get(this),!0===m.get(o).formAssociated)return null==i?void 0:i.call.apply(i,[this].concat(n(e)));throw new DOMException("Failed to execute "+i+" on 'ElementInternals': The target element is not a form-associated custom element.")}}));var D=function(t){var e=a(Array,[].concat(n(t)),this.constructor);return e.h=t,e},T=D,O=Array;if(T.prototype=i(O.prototype),T.prototype.constructor=T,c)c(T,O);else for(var I in O)if("prototype"!=I)if(Object.defineProperties){var P=Object.getOwnPropertyDescriptor(O,I);P&&Object.defineProperty(T,I,P)}else T[I]=O[I];T.u=O.prototype,r.Object.defineProperty(D.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var t;return(null==(t=this.h.find((function(t){return!0===t.checked})))?void 0:t.value)||""}});var F=function(t){var e=this,n=new Map;t.forEach((function(t,i){var o=t.getAttribute("name"),r=n.get(o)||[];e[+i]=t,r.push(t),n.set(o,r)})),this.length=t.length,n.forEach((function(t,n){t&&(e[n]=1===t.length?t[0]:new D(t))}))};F.prototype.namedItem=function(t){return this[t]};var M=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){for(var t=M.get.call(this,[]),n=[],i=(t=e(t)).next();!i.done;i=t.next()){i=i.value;var o=m.get(i);o&&!0!==o.formAssociated||n.push(i)}return new F(n)}})}}}).call("object"==typeof globalThis?globalThis:window);var Y={"activity-example":{"hello-world":"Hallo Welt"},"choose-from-menu":"Bitte wählen Sie eine Aktivität aus dem Menu.",contact:"Kontakt",imprint:"Impressum",login:"Anmelden",logo:{word1:"Wissen",word2:"Technik",word3:"Leidenschaft"},logout:"Abmelden","page-not-found":"Die gewünschte Seite wurde nicht gefunden","page-updated-needs-reload":"Die Applikation wurde aktualisiert. Bitte laden Sie die Seite neu.","privacy-policy":"Datenschutz",welcome:{headline:"Willkommen bei der Applikation '{{appname}}'."}},J={"activity-example":{"hello-world":"Hello World"},"choose-from-menu":"Please choose an activity from the menu.",contact:"Contact",imprint:"Legal Notice",login:"Login",logo:{word1:"Science",word2:"Passion",word3:"Technology"},logout:"Logout","page-not-found":"Requested Page Not Found","page-updated-needs-reload":"The application has been updated. Please reload the page.","privacy-policy":"Privacy Policy",welcome:{headline:"Welcome to the '{{appname}}' application."}};function X(){return A({en:J,de:Y},"de","en")}var Z={de:"Deutsch","de-action":"Auf Deutsch anzeigen",demo:"Hallo Welt",en:"Englisch","en-action":"Auf Englisch anzeigen"},Q={de:"German","de-action":"Switch to German",demo:"Hello World",en:"English","en-action":"Switch to English"};var tt={error:{"connection-to-server-refused":"Verbindungs zum Server verweigert!",summary:"Ein Fehler ist aufgetreten"},jsonld:{"api-documentation-server":"Verbindung zum apiDocumentation API Server {{apiDocUrl}} fehlgeschlagen!","error-api-server":"Verbindung zum API Server {{apiUrl}} fehlgeschlagen!","error-hydra-documentation-url-not-set":"Hydra apiDocumentation URL wurden für server {{apiUrl}} nicht gesetzt!"}},et={error:{"connection-to-server-refused":"Connection to server refused!",summary:"An error occurred"},jsonld:{"api-documentation-server":"Connection to apiDocumentation server {{apiDocUrl}} failed!","error-api-server":"Connection to api server {{apiUrl}} failed!","error-hydra-documentation-url-not-set":"Hydra apiDocumentation url was not set for server {{apiUrl}}!"}};class nt extends O{constructor(){super(),this._lang="de",this.languages=["de","en"],this._i18n=A({en:Q,de:Z},"de","en"),this._i18n.t("de"),this._i18n.t("de-action"),this._i18n.t("en"),this._i18n.t("en-action")}_getNextLanguage(t){var e=this.languages.indexOf(t),n=this.languages[e+1];return void 0===n&&(n=this.languages[0]),n}_getPreviousLanguage(t){var e=this.languages.indexOf(t),n=this.languages[e-1];return void 0===n&&(n=this.languages[this.languages.length-1]),n}static get properties(){return{lang:{type:String},next:{type:String},languages:{type:Array}}}set lang(t){const e=this.lang,n=this.next;this._lang=t,this.requestUpdate("lang",e),this.requestUpdate("next",n),e!==t&&(this.sendSetPropertyEvent("lang",t),this._i18n.changeLanguage(this.next))}get lang(){return this._lang}set next(t){this.lang=this._getPreviousLanguage(t)}get next(){return this._getNextLanguage(this.lang)}static get styles(){return R(n||(n=_` ${0} :host { display: inline-block; } a:hover { color: var(--dbp-hover-color, var(--dbp-content)); background-color: var(--dbp-hover-background-color); transition: none; } a { padding: 0.3em; display: inline-block; text-decoration: none; transition: background-color 0.15s, color 0.15s; color: var(--dbp-content); } input::-moz-focus-inner { border: 0; } :focus-visible{ outline:none !important; outline-width: 0 !important; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: 0px 0px 4px 2px var(--dbp-primary); } `),I())}onClick(t){t.preventDefault(),this.lang=this.next}render(){var t=this._i18n.t(this.next+"-action");return D(i||(i=_` <a href="#" title="${0}" @click=${0}>${0}</a> `),t,this.onClick,this.next.toUpperCase())}}var it={login:"Anmelden","login-failed":"Kommunikation mit dem Anmeldeserver fehlgeschlagen",logout:"Abmelden"},ot={login:"Login","login-failed":"Communication with the login server failed",logout:"Logout"};function rt(){return A({en:ot,de:it},"de","en")}class at{constructor(t,e){this.entities=e,this.baseApiUrl=t;let n={};for(const t in e){n[e[t]["@id"]]=t}this.idToEntityNameMatchList=n}static async getInstance(t,e="de"){let n=at.promises[t];return void 0===n&&(n=new Promise(((n,i)=>{at._initialize(t,(t=>n(t)),(t=>i(t)),e)})),at.promises[t]=n),n}static initialize(t,e,n,i="de"){console.warn("DEPRECATED: JSONLD.initialize(), use JSONLD.getInstance() instead"),at._initialize(t,e,n,i)}static doInitializationOnce(t){console.warn("DEPRECATED: JSONLD.doInitializationOnce() calls can be removed")}static _initialize(t,e,n,i="de"){at._i18n.changeLanguage(i),void 0===at.instances[t]?(void 0===at.successFunctions[t]&&(at.successFunctions[t]=[]),void 0===at.failureFunctions[t]&&(at.failureFunctions[t]=[]),"function"==typeof e&&at.successFunctions[t].push(e),"function"==typeof n&&at.failureFunctions[t].push(n),t&&void 0===at.initStarted[t]&&(at.initStarted[t]=!0,at._doInitialization(t))):"function"==typeof e&&e(at.instances[t])}static _doInitialization(t){const e=new XMLHttpRequest,n=at._i18n;e.open("GET",t,!0),e.onreadystatechange=function(){if(4===e.readyState)if(200===e.status){const i=JSON.parse(e.responseText);let o={};for(let t in i)t.startsWith("@")||(o[t.toLowerCase()]=i[t]);const r=P(this.getResponseHeader("link"))["http://www.w3.org/ns/hydra/core#apiDocumentation"];if(void 0!==r){const e=new XMLHttpRequest;e.open("GET",r,!0),e.setRequestHeader("Content-Type","application/json"),e.onreadystatechange=function(){4===e.readyState&&(200===e.status?at._gatherEntities(e,t,o):at._executeFailureFunctions(t,n.t("jsonld.api-documentation-server",{apiUrl:r})))},e.send()}else at._executeFailureFunctions(t,n.t("jsonld.error-hydra-documentation-url-not-set",{apiUrl:t}))}else at._executeFailureFunctions(t,n.t("jsonld.error-api-server",{apiUrl:t}))},e.send()}static _gatherEntities(t,e,n){const i=JSON.parse(t.responseText)["hydra:supportedClass"];let o={};const r=F(e);i.forEach((function(t){const e=t["hydra:title"];let i=n[e.toLowerCase()];void 0===i||i.startsWith("http")||(i=r+i),t["@entryPoint"]=i,o[e]=t}));const a=new at(r,o);if(at.instances[e]=a,void 0!==at.successFunctions[e])for(const t of at.successFunctions[e])"function"==typeof t&&t(a);at.successFunctions[e]=[]}static _executeFailureFunctions(t,e=""){const n=at._i18n;if(void 0!==at.failureFunctions[t])for(const n of at.failureFunctions[t])"function"==typeof n&&n(new Error(e));at.failureFunctions[t]=[],""!==e&&M({summary:n.t("error.summary"),body:e,type:"danger"})}getEntityForIdentifier(t){let e=this.getEntityNameForIdentifier(t);return this.getEntityForEntityName(e)}getEntityForEntityName(t){return this.entities[t]}getApiUrlForEntityName(t){const e=this.getEntityForEntityName(t);if(void 0===e||void 0===e["@entryPoint"])throw new Error(`Entity "${t}" not found!`);return e["@entryPoint"]}getEntityNameForIdentifier(t){return this.idToEntityNameMatchList[t]}getApiIdentifierList(){let t=[];for(const e in this.idToEntityNameMatchList)t.push(e);return t}expandMember(t,e){void 0===e&&(e=t["@context"]);let n={"@id":t["@id"]};for(const i of Object.keys(e)){const o=e[i];void 0!==t[i]&&(n[o]=t[i])}return n}compactMember(t,e){let n={};for(const i in e){const o=t[e[i]];void 0!==o&&(n[i]=o)}return n}transformMembers(t,e){const n=t["hydra:member"];if(void 0===n||0===n.length)return[];const i=t["@context"];let o=[],r=this;return n.forEach((function(t){o.push(r.compactMember(r.expandMember(t,i),e))})),o}}function st(t,e,...n){if(!t)throw new TypeError(lt(e,n))}function lt(t,e){let n=0;return t.replace(/%[os]/g,(()=>ct(e[n++])))}function ct(t){return"object"!=typeof t||null===t?String(t):Object.prototype.toString.call(t)}at._i18n=A({en:et,de:tt},"de","en"),at.instances={},at.successFunctions={},at.failureFunctions={},at.initStarted={},at.promises={};const dt="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:void 0;class ht{constructor(t,e){this.code=t,this.message=e}warn(...t){var e;try{undefined;const n=(null!==(e=(new Error).stack)&&void 0!==e?e:"").replace(/^(?:(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?\n){2}/g,"\n");console.warn(this.message,...t,n)}catch(t){}}}const ut=new ht("W01","Unable to initialize event under dispatching."),pt=new ht("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),gt=new ht("W03","Assigning any truthy value to 'returnValue' property has no effect."),mt=new ht("W04","Unable to preventDefault on non-cancelable events."),ft=new ht("W05","Unable to preventDefault inside passive event listener invocation."),vt=new ht("W06","An event listener wasn't added because it has been added already: %o, %o"),bt=new ht("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),yt=new ht("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o");new ht("W09","Event attribute handler must be a function: %o");class wt{static get NONE(){return kt}static get CAPTURING_PHASE(){return Et}static get AT_TARGET(){return xt}static get BUBBLING_PHASE(){return _t}constructor(t,e){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=null!=e?e:{};Ct.set(this,{type:String(t),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return St(this).type}get target(){return St(this).target}get srcElement(){return St(this).target}get currentTarget(){return St(this).currentTarget}composedPath(){const t=St(this).currentTarget;return t?[t]:[]}get NONE(){return kt}get CAPTURING_PHASE(){return Et}get AT_TARGET(){return xt}get BUBBLING_PHASE(){return _t}get eventPhase(){return St(this).dispatchFlag?2:0}stopPropagation(){St(this).stopPropagationFlag=!0}get cancelBubble(){return St(this).stopPropagationFlag}set cancelBubble(t){t?St(this).stopPropagationFlag=!0:pt.warn()}stopImmediatePropagation(){const t=St(this);t.stopPropagationFlag=t.stopImmediatePropagationFlag=!0}get bubbles(){return St(this).bubbles}get cancelable(){return St(this).cancelable}get returnValue(){return!St(this).canceledFlag}set returnValue(t){t?gt.warn():At(St(this))}preventDefault(){At(St(this))}get defaultPrevented(){return St(this).canceledFlag}get composed(){return St(this).composed}get isTrusted(){return!1}get timeStamp(){return St(this).timeStamp}initEvent(t,e=!1,n=!1){const i=St(this);i.dispatchFlag?ut.warn():Ct.set(this,C({},i,{type:String(t),bubbles:Boolean(e),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1}))}}const kt=0,Et=1,xt=2,_t=3,Ct=new WeakMap;function St(t,e="this"){const n=Ct.get(t);return st(null!=n,"'%s' must be an object that Event constructor created, but got another one: %o",e,t),n}function At(t){t.inPassiveListenerFlag?ft.warn():t.cancelable?t.canceledFlag=!0:mt.warn()}Object.defineProperty(wt,"NONE",{enumerable:!0}),Object.defineProperty(wt,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(wt,"AT_TARGET",{enumerable:!0}),Object.defineProperty(wt,"BUBBLING_PHASE",{enumerable:!0});const Lt=Object.getOwnPropertyNames(wt.prototype);for(let t=0;t<Lt.length;++t)"constructor"!==Lt[t]&&Object.defineProperty(wt.prototype,Lt[t],{enumerable:!0});let Rt;void 0!==dt&&void 0!==dt.Event&&Object.setPrototypeOf(wt.prototype,dt.Event.prototype);const Dt={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function Tt(t){const e=Object.keys(Dt);for(let n=0;n<e.length;++n){const i=e[n],o=Dt[i];Object.defineProperty(t,i,{get:()=>o,configurable:!0,enumerable:!0})}}class Ot extends wt{static wrap(t){return new(Mt(t))(t)}constructor(t){super(t.type,{bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}),t.cancelBubble&&super.stopPropagation(),t.defaultPrevented&&super.preventDefault(),It.set(this,{original:t});const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];i in this||Object.defineProperty(this,i,Nt(t,i))}}stopPropagation(){super.stopPropagation();const{original:t}=Pt(this);"stopPropagation"in t&&t.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(t){super.cancelBubble=t;const{original:e}=Pt(this);"cancelBubble"in e&&(e.cancelBubble=t)}stopImmediatePropagation(){super.stopImmediatePropagation();const{original:t}=Pt(this);"stopImmediatePropagation"in t&&t.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(t){super.returnValue=t;const{original:e}=Pt(this);"returnValue"in e&&(e.returnValue=t)}preventDefault(){super.preventDefault();const{original:t}=Pt(this);"preventDefault"in t&&t.preventDefault()}get timeStamp(){const{original:t}=Pt(this);return"timeStamp"in t?t.timeStamp:super.timeStamp}}const It=new WeakMap;function Pt(t){const e=It.get(t);return st(null!=e,"'this' is expected an Event object, but got",t),e}const Ft=new WeakMap;function Mt(t){const e=Object.getPrototypeOf(t);if(null==e)return Ot;let n=Ft.get(e);return null==n&&(n=function(t,e){class n extends t{}const i=Object.keys(e);for(let t=0;t<i.length;++t)Object.defineProperty(n.prototype,i[t],Nt(e,i[t]));return n}(Mt(e),e),Ft.set(e,n)),n}function Nt(t,e){const n=Object.getOwnPropertyDescriptor(t,e);return{get(){const t=Pt(this).original,n=t[e];return"function"==typeof n?n.bind(t):n},set(t){Pt(this).original[e]=t},configurable:n.configurable,enumerable:n.enumerable}}function jt(t){return 1==(1&t.flags)}function $t(t){return 2==(2&t.flags)}function Ut(t){return 4==(4&t.flags)}function Bt(t){return 8==(8&t.flags)}function Gt({callback:t},e,n){try{"function"==typeof t?t.call(e,n):"function"==typeof t.handleEvent&&t.handleEvent(n)}catch(t){!function(t){try{const e=t instanceof Error?t:new Error(ct(t));if("function"==typeof dispatchEvent&&"function"==typeof ErrorEvent)dispatchEvent(new ErrorEvent("error",{error:e,message:e.message}));else if("undefined"!=typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)}catch(t){}}(t)}}function zt({listeners:t},e,n){for(let i=0;i<t.length;++i)if(t[i].callback===e&&jt(t[i])===n)return i;return-1}function Ht(t,e,n){const i=zt(t,e,n);return-1!==i&&Vt(t,i)}function Vt(t,e,n=!1){const i=t.listeners[e];return function(t){t.flags|=8}(i),i.signal&&i.signal.removeEventListener("abort",i.signalListener),t.cow&&!n?(t.cow=!1,t.listeners=t.listeners.filter(((t,n)=>n!==e)),!1):(t.listeners.splice(e,1),!0)}Ft.set(Object.prototype,Ot),void 0!==dt&&void 0!==dt.Event&&Ft.set(dt.Event.prototype,Ot);class Wt{constructor(){qt.set(this,Object.create(null))}addEventListener(t,e,n){const i=Kt(this),{callback:o,capture:r,once:a,passive:s,signal:l,type:c}=function(t,e,n){var i;if(Yt(e),"object"==typeof n&&null!==n)return{type:String(t),callback:null!=e?e:void 0,capture:Boolean(n.capture),passive:Boolean(n.passive),once:Boolean(n.once),signal:null!==(i=n.signal)&&void 0!==i?i:void 0};return{type:String(t),callback:null!=e?e:void 0,capture:Boolean(n),passive:!1,once:!1,signal:void 0}}(t,e,n);if(null==o||(null==l?void 0:l.aborted))return;const d=function(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t[e]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(i,c),h=zt(d,o,r);-1===h?function(t,e,n,i,o,r){let a;r&&(a=Ht.bind(null,t,e,n),r.addEventListener("abort",a));const s=function(t,e,n,i,o,r){return{callback:t,flags:(e?1:0)|(n?2:0)|(i?4:0),signal:o,signalListener:r}}(e,n,i,o,r,a);t.cow?(t.cow=!1,t.listeners=[...t.listeners,s]):t.listeners.push(s)}(d,o,r,s,a,l):function(t,e,n,i){vt.warn(jt(t)?"capture":"bubble",t.callback),$t(t)!==e&&bt.warn("passive");Ut(t)!==n&&bt.warn("once");t.signal!==i&&bt.warn("signal")}(d.listeners[h],s,a,l)}removeEventListener(t,e,n){const i=Kt(this),{callback:o,capture:r,type:a}=function(t,e,n){if(Yt(e),"object"==typeof n&&null!==n)return{type:String(t),callback:null!=e?e:void 0,capture:Boolean(n.capture)};return{type:String(t),callback:null!=e?e:void 0,capture:Boolean(n)}}(t,e,n),s=i[a];null!=o&&s&&Ht(s,o,r)}dispatchEvent(t){const e=Kt(this)[String(t.type)];if(null==e)return!0;const n=t instanceof wt?t:Ot.wrap(t),i=St(n,"event");if(i.dispatchFlag)throw o="This event has been in dispatching.",dt.DOMException?new dt.DOMException(o,"InvalidStateError"):(null==Rt&&(Rt=class t extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,t)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(Rt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),Tt(Rt),Tt(Rt.prototype)),new Rt(o));var o;if(i.dispatchFlag=!0,i.target=i.currentTarget=this,!i.stopPropagationFlag){const{cow:t,listeners:o}=e;e.cow=!0;for(let r=0;r<o.length;++r){const a=o[r];if(!Bt(a)&&(Ut(a)&&Vt(e,r,!t)&&(r-=1),i.inPassiveListenerFlag=$t(a),Gt(a,this,n),i.inPassiveListenerFlag=!1,i.stopImmediatePropagationFlag))break}t||(e.cow=!1)}return i.target=null,i.currentTarget=null,i.stopImmediatePropagationFlag=!1,i.stopPropagationFlag=!1,i.dispatchFlag=!1,!i.canceledFlag}}const qt=new WeakMap;function Kt(t,e="this"){const n=qt.get(t);return st(null!=n,"'%s' must be an object that EventTarget constructor created, but got another one: %o",e,t),n}function Yt(t){if("function"!=typeof t&&("object"!=typeof t||null===t||"function"!=typeof t.handleEvent)){if(null!=t&&"object"!=typeof t)throw new TypeError(lt(yt.message,[t]));yt.warn(t)}}const Jt=Object.getOwnPropertyNames(Wt.prototype);for(let t=0;t<Jt.length;++t)"constructor"!==Jt[t]&&Object.defineProperty(Wt.prototype,Jt[t],{enumerable:!0});void 0!==dt&&void 0!==dt.EventTarget&&Object.setPrototypeOf(Wt.prototype,dt.EventTarget.prototype);class Xt extends Wt{constructor(t,e,n,i,o){super(),this._baseURL=t,this._realm=e,this._clientId=n,this._keycloak=null,this._initDone=!1,this._silentCheckSsoUri=i,this._idpHint=o,this._checkId=null,this.MIN_VALIDITY=20,this.CHECK_INTERVAL=10,this.DEBUG=!1,this._onVisibilityChanged=this._onVisibilityChanged.bind(this),document.addEventListener("visibilitychange",this._onVisibilityChanged)}close(){document.removeEventListener("visibilitychange",this._onVisibilityChanged)}_onVisibilityChanged(){"visible"===document.visibilityState&&this._keycloak.authenticated&&this._checkTokeHasExpired()}_onChanged(){const t=new CustomEvent("changed",{detail:this._keycloak,bubbles:!0,composed:!0});this.dispatchEvent(t)}_onReady(t){t&&this._onChanged()}async _onTokenExpired(){console.log("Token has expired");let t=!1;try{t=await this._keycloak.updateToken(-1)}catch(t){return void console.log("Failed to refresh the token",t)}console.assert(t,"token should have been refreshed")}async _checkTokeHasExpired(){let t,e=this.MIN_VALIDITY+this.CHECK_INTERVAL;this.DEBUG&&console.log(`Updating token if not valid for at least ${e}s`);try{t=await this._keycloak.updateToken(e)}catch(t){console.log("Failed to refresh the token",t)}this.DEBUG&&t&&console.log("token has been refreshed")}async _onAuthSuccess(){null!==this._checkId&&(clearInterval(this._checkId),this._checkId=null),this._checkId=setInterval(this._checkTokeHasExpired.bind(this),1e3*this.CHECK_INTERVAL),this._onChanged()}async _onAuthLogout(){null!==this._checkId&&(clearInterval(this._checkId),this._checkId=null),this._onChanged()}async _ensureInstance(){if(null!==this._keycloak)return;const t=(await import("./shared/keycloak.b289e375.es.js")).default;this._keycloak=new t({url:this._baseURL,realm:this._realm,clientId:this._clientId}),this._keycloak.onTokenExpired=this._onTokenExpired.bind(this),this._keycloak.onAuthRefreshSuccess=this._onChanged.bind(this),this._keycloak.onAuthRefreshError=this._onChanged.bind(this),this._keycloak.onAuthLogout=this._onAuthLogout.bind(this),this._keycloak.onAuthSuccess=this._onAuthSuccess.bind(this),this._keycloak.onAuthError=this._onChanged.bind(this),this._keycloak.onReady=this._onReady.bind(this)}async _keycloakInit(t){try{return await this._keycloak.init(t)}catch(e){return await this._keycloak.init(t)}}async _ensureInit(){if(await this._ensureInstance(),this._initDone)return;this._initDone=!0;const t={promiseType:"native",pkceMethod:"S256"};this.DEBUG&&(t.enableLogging=!0),this._silentCheckSsoUri?(t.onLoad="check-sso",t.silentCheckSsoRedirectUri=function(t){try{return new URL(t).href}catch(e){return new URL(t,window.location.href).href}}(this._silentCheckSsoUri),await function(t,e){let n=new Promise(((e,n)=>{let i=setTimeout((()=>{clearTimeout(i),n("Timed out in "+t+"ms.")}),t)}));return Promise.race([e,n])}(5e3,this._keycloakInit(t)).catch((()=>{console.log("Login timed out"),this._onChanged()}))):await this._keycloakInit(t)}isLoggingIn(){const t=window.location.href;return t.search("[&#]state=")>=0&&t.search("[&#]session_state=")>=0}async login(t){await this._ensureInit();const e=(t=t||{}).lang||"en",n=t.scope||"";this._keycloak.authenticated||await this._keycloak.login({kcLocale:e,locale:e,scope:n,idpHint:this._idpHint})}async tryLogin(){await this._ensureInit()}async localLogout(){this._keycloak.clearToken()}async logout(){await this._ensureInit(),this._keycloak.logout()}}const Zt=Object.freeze({UNKNOWN:"unknown",LOGGING_IN:"logging-in",LOGGED_IN:"logged-in",LOGGING_OUT:"logging-out",LOGGED_OUT:"logged-out"});class Qt extends O{constructor(){super(),this.forceLogin=!1,this.token="",this.subject="",this.name="",this.tryLogin=!1,this.entryPointUrl="",this._user=null,this._userId="",this._authenticated=!1,this._loginStatus=Zt.UNKNOWN,this.requestedLoginStatus=Zt.UNKNOWN,this._i18n=rt(),this.lang=this._i18n.language,this.keycloakUrl=null,this.realm=null,this.clientId=null,this.silentCheckSsoRedirectUri=null,this.scope=null,this.idpHint="",this._onKCChanged=this._onKCChanged.bind(this)}update(t){t.forEach(((t,e)=>{switch(e){case"lang":this._i18n.changeLanguage(this.lang);break;case"entryPointUrl":at.getInstance(this.entryPointUrl,this.lang);break;case"requestedLoginStatus":switch(console.log("requested-login-status changed",this.requestedLoginStatus),this.requestedLoginStatus){case Zt.LOGGED_IN:this._kcwrapper.login({lang:this.lang,scope:this.scope||""});break;case Zt.LOGGED_OUT:this._loginStatus===Zt.LOGGED_IN&&this._setLoginStatus(Zt.LOGGING_OUT),this._kcwrapper.logout(),this._loginStatus===Zt.LOGGING_OUT&&this._setLoginStatus(Zt.LOGGED_IN)}}})),super.update(t)}async _fetchUser(t){var e;let n;n=await at.getInstance(this.entryPointUrl,this.lang);let i="";try{i=n.getApiUrlForEntityName("FrontendUser")}catch(t){i=n.getApiUrlForEntityName("Person")}const o=i+"/"+encodeURIComponent(t);let r=await fetch(o,{headers:{Authorization:"Bearer "+this.token}});if(!r.ok)throw r;return{roles:null!=(e=(await r.json()).roles)?e:[]}}async _onKCChanged(t){const e=t.detail;if(this._authenticated=e.authenticated,e.authenticated){let t=this.token!==e.token;this.name=e.idTokenParsed.name,this.token=e.token,this.subject=e.subject;const n=e.idTokenParsed.preferred_username;let i=n!==this._userId;if(i){let t;this._userId=n;try{t=await this._fetchUser(n)}catch(e){console.error(e),t={roles:[]}}n===this._userId&&(this._user=t)}null!==this._user&&this._setLoginStatus(Zt.LOGGED_IN,t||i)}else this._loginStatus===Zt.LOGGED_IN&&this._setLoginStatus(Zt.LOGGING_OUT),this.name="",this.token="",this.subject="",this._userId="",this._user=null,this._setLoginStatus(Zt.LOGGED_OUT)}sendSetPropertyEvents(){const t={"login-status":this._loginStatus,subject:this.subject,token:this.token,"user-full-name":this.name,"user-id":this._userId,"person-id":this._userId,person:this._user};window.Cypress&&(window.DBPAuth=t),this.sendSetPropertyEvent("auth",t)}_setLoginStatus(t,e){(this._loginStatus!==t||e)&&(this._loginStatus=t,this.sendSetPropertyEvents())}static get properties(){return C({},super.properties,{lang:{type:String},forceLogin:{type:Boolean,attribute:"force-login"},tryLogin:{type:Boolean,attribute:"try-login"},entryPointUrl:{type:String,attribute:"entry-point-url"},name:{type:String,attribute:!1},token:{type:String,attribute:!1},subject:{type:String,attribute:!1},_userId:{type:String,attribute:!1},_user:{type:Object,attribute:!1},_loginStatus:{type:String,attribute:!1},keycloakUrl:{type:String,attribute:"url"},realm:{type:String},clientId:{type:String,attribute:"client-id"},silentCheckSsoRedirectUri:{type:String,attribute:"silent-check-sso-redirect-uri"},scope:{type:String},idpHint:{type:String,attribute:"idp-hint"},requestedLoginStatus:{type:String,attribute:"requested-login-status"}})}connectedCallback(){var t=this;if(super.connectedCallback(),!this.keycloakUrl)throw Error("url not set");if(!this.realm)throw Error("realm not set");if(!this.clientId)throw Error("client-id not set");this._kcwrapper=new Xt(this.keycloakUrl,this.realm,this.clientId,this.silentCheckSsoRedirectUri,this.idpHint),this._kcwrapper.addEventListener("changed",this._onKCChanged);!async function(){try{t.forceLogin||t._kcwrapper.isLoggingIn()?(t._setLoginStatus(Zt.LOGGING_IN),await t._kcwrapper.login({lang:t.lang,scope:t.scope||""})):t.tryLogin?(t._setLoginStatus(Zt.LOGGING_IN),await t._kcwrapper.tryLogin(),t._authenticated||t._setLoginStatus(Zt.LOGGED_OUT)):t._setLoginStatus(Zt.LOGGED_OUT)}catch(e){throw t._setLoginStatus(Zt.LOGGED_OUT),M({summary:t._i18n.t("login-failed"),type:"danger",timeout:5}),e}}()}disconnectedCallback(){this._kcwrapper.close(),this._kcwrapper.removeEventListener("changed",this._onKCChanged),super.disconnectedCallback()}}class te extends(N(O)){constructor(){super(),this._i18n=rt(),this.lang=this._i18n.language,this.auth={}}static get scopedElements(){return{"dbp-mini-spinner":j}}static get properties(){return{lang:{type:String},auth:{type:Object}}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}_onLoginClicked(t){this.sendSetPropertyEvent("requested-login-status",Zt.LOGGED_IN),t.preventDefault()}_onLogoutClicked(t){this.sendSetPropertyEvent("requested-login-status",Zt.LOGGED_OUT),t.preventDefault()}update(t){t.forEach(((t,e)=>{"lang"===e&&this._i18n.changeLanguage(this.lang)})),super.update(t)}static get styles(){return[I(),R(_t5||_` :host { display: inline-block; } a { color: var(--dbp-content); fill: var(--dbp-content); cursor: pointer; text-decoration: none; } .login-box { display: flex; align-items: center; padding: 0.3em 0.4em; transition: background-color 0.15s, color 0.15s; } .login-box svg, .icon { width: 1.1em; height: 1.1em; } .login-box svg, .spinner { display: flex; } .login-box:hover svg path { fill: var(--dbp-hover-color); } .login-box:hover { color: var(--dbp-hover-color, var(--dbp-content)); background-color: var(--dbp-hover-background-color); cursor: pointer; transition: none; } .login-box .label { padding-left: 0.2em; } `)]}render(){let t=this._i18n;return this.auth["login-status"]===Zt.LOGGING_IN?D(_t6||_` <a href="#"> <div class="login-box login-button"> <div class="icon"> <dbp-mini-spinner class="spinner"></dbp-mini-spinner> </div> <div class="label">&#8203;</div> </div> </a> `):this.auth["login-status"]===Zt.LOGGED_IN?D(_t7||_` <a href="#" @click="${0}"> <div class="login-box login-button"> <div class="icon">${0}</div> <div class="label">${0}</div> </div> </a> `,this._onLogoutClicked,$('\n<svg\n viewBox="0 0 100 100"\n y="0px"\n x="0px"\n id="icon"\n role="img"\n version="1.1">\n<g\n id="g6">\n <path\n d="m 20.749313,38.894934 -5.885859,6.967885 h 43.408213 c 1.839331,0 3.433418,1.741972 3.433418,4.064599 0,2.322628 -1.471465,4.064599 -3.433418,4.064599 H 14.863454 l 5.885859,6.967883 c 1.348843,1.596808 1.348843,4.064599 0,5.661406 -1.348843,1.596808 -3.433418,1.596808 -4.782261,0 L 1.9881356,49.927418 15.967052,33.378693 c 1.348843,-1.596806 3.433418,-1.596806 4.782261,0 1.348843,1.596807 1.348843,4.064599 0,5.516241 z"\n id="path2"\n style="stroke-width:1.33417916"\n inkscape:connector-curvature="0" />\n <path\n style="stroke-width:0.67017764"\n d="M 61.663665,16.308792 C 48.158763,16.560171 35.913199,25.828579 30.896087,38.197464 34.816744,37.806184 40.033349,39.91491 41.470306,35.017776 50.594944,21.215302 72.517616,20.362655 82.800384,33.07637 93.497261,44.618596 90.228387,65.093356 76.499603,72.791214 64.104901,80.786232 45.895432,75.593227 39.470306,62.310745 35.613955,62.60637 27.974792,60.593775 32.925384,66.267776 41.232037,82.878292 64.023613,89.46919 79.876556,79.765823 96.140149,70.989504 102.10102,48.145494 91.970306,32.629104 85.705979,22.257901 73.793809,15.772382 61.663665,16.308792 Z"\n id="path4"\n inkscape:connector-curvature="0" />\n</g>\n</svg>\n'),t.t("logout")):D(_t8||_` <a href="#" @click="${0}"> <div class="login-box login-button"> <div class="icon">${0}</div> <div class="label">${0}</div> </div> </a> `,this._onLoginClicked,$('\n<svg\n viewBox="0 0 100 100"\n y="0px"\n x="0px"\n id="icon"\n role="img"\n version="1.1">\n<g\n id="g6">\n <path\n style="stroke-width:1.33417916"\n id="path2"\n d="m 42.943908,38.894934 5.885859,6.967885 H 5.4215537 c -1.8393311,0 -3.4334181,1.741972 -3.4334181,4.064599 0,2.322628 1.4714649,4.064599 3.4334181,4.064599 H 48.829767 L 42.943908,60.9599 c -1.348843,1.596808 -1.348843,4.064599 0,5.661406 1.348843,1.596808 3.433418,1.596808 4.782261,0 L 61.705085,49.927418 47.726169,33.378693 c -1.348843,-1.596806 -3.433418,-1.596806 -4.782261,0 -1.348843,1.596807 -1.348843,4.064599 0,5.516241 z" />\n <path\n id="path4"\n d="m 50,2.3007812 c -18.777325,0 -35.049449,10.9124408 -42.8261719,26.7246098 H 13.390625 C 20.672112,16.348362 34.336876,7.8007812 50,7.8007812 73.3,7.8007812 92.300781,26.7 92.300781,50 92.300781,73.3 73.3,92.300781 50,92.300781 c -15.673389,0 -29.345175,-8.60579 -36.623047,-21.326172 H 7.1640625 C 14.942553,86.8272 31.242598,97.800781 50.099609,97.800781 76.399609,97.800781 97.900391,76.4 97.900391,50 97.800391,23.7 76.3,2.3007812 50,2.3007812 Z" />\n</g>\n</svg>\n'),t.t("login"))}}class ee extends(N(O)){constructor(){super(),this._i18n=X(),this.lang=this._i18n.language,this.auth={},this.closeDropdown=this.closeDropdown.bind(this),this.onWindowResize=this.onWindowResize.bind(this)}static get scopedElements(){return{"dbp-icon":U}}static get properties(){return C({},super.properties,{lang:{type:String},auth:{type:Object}})}onWindowResize(){this.updateDropdownWidth()}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.onWindowResize),document.addEventListener("click",this.closeDropdown)}disconnectedCallback(){window.removeEventListener("resize",this.onWindowResize),document.removeEventListener("click",this.closeDropdown),super.disconnectedCallback()}updateDropdownWidth(){const t=this.shadowRoot.querySelector("div.dropdown-menu");if(!t)return;let e=this.getBoundingClientRect(),n=window.innerWidth-e.left;t.setAttribute("style",`width: ${n-20}px`)}onLoginClicked(t){this.sendSetPropertyEvent("requested-login-status",Zt.LOGGED_IN),t.preventDefault()}onLogoutClicked(t){this.sendSetPropertyEvent("requested-login-status",Zt.LOGGED_OUT)}update(t){t.forEach(((t,e)=>{"lang"===e&&this._i18n.changeLanguage(this.lang)})),super.update(t)}static get styles(){return R(o||(o=_` ${0} :host { display: inline-block; } a { color: var(--dbp-content); fill: var(--dbp-content); cursor: pointer; text-decoration: none; display: block; } input::-moz-focus-inner { border: 0; } :focus-visible { outline: none !important; outline-width: 0 !important; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: 0px 0px 4px 2px var(--dbp-primary); } .dropdown.is-active .dropdown-menu, .dropdown.is-hoverable:hover .dropdown-menu { display: block; } .dropdown-menu { display: none; min-width: 5em; max-width: 25em; position: absolute; z-index: 20; border: var(--dbp-border); border-radius: 0px; overflow: hidden; background-color: var(--dbp-background); } .dropdown-content { padding-bottom: 0.5rem; padding-top: 0.5rem; } .menu a { /*padding: 0.3em;*/ font-weight: 400; color: var(--dbp-content); display: block; text-decoration: none; } .menu a:hover { color: var(--dbp-hover-color, var(--dbp-content)); background-color: var(--dbp-hover-background-color); } .menu a.selected { color: var(--dbp-on-secondary-surface); background-color: var(--dbp-secondary-surface); } .dropdown-item { color: var(--dbp-muted); display: block; font-size: 0.875rem; line-height: 1.5; padding: 0.375rem 1rem; margin-left: 0.5em; margin-right: 0.5em; padding-left: 0.5em; padding-right: 0.5em; position: relative; } .dropdown { cursor: pointer; } a.dropdown-item { width: initial !important; } .main-button { min-width: 150px; } .menu-icon { height: 1em; width: 1em; vertical-align: -0.1rem; } .login-box svg { width: 1.1em; height: 1.1em; display: flex; } .login-button { padding: 0.3em 0.4em; transition: background-color 0.15s, color 0.15s; } .login-button:hover { color: var(--dbp-hover-color, var(--dbp-content)); background-color: var(--dbp-hover-background-color); cursor: pointer; transition: none; } .login-box { display: flex; align-items: center; } .login-box:hover svg path { fill: var(--dbp-hover-color); } .login-box .label { padding-left: 0.2em; } .dropdown-trigger { display: flex; align-items: center; } .dropdown-trigger .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin-right: 0.5em; } `),I())}setChevron(t){const e=this.shadowRoot.querySelector("#menu-chevron-icon");null!==e&&(e.name=t)}onDropdownClick(t){t.stopPropagation(),t.currentTarget.classList.toggle("is-active"),this.setChevron(t.currentTarget.classList.contains("is-active")?"chevron-up":"chevron-down"),this.updateDropdownWidth()}closeDropdown(){this.shadowRoot.querySelectorAll(".dropdown").forEach((function(t){t.classList.remove("is-active")})),this.setChevron("chevron-down")}renderLoggedIn(){const t=this._i18n;return D(r||(r=_` <div class="dropdown" @click="${0}"> <a href="#"> <div class="dropdown-trigger login-button"> <div class="name">${0}</div> <dbp-icon class="menu-icon" name="chevron-down" id="menu-chevron-icon"></dbp-icon> </div> </a> <div class="dropdown-menu" id="dropdown-menu2" role="menu"> <div class="dropdown-content" @blur="${0}"> <div class="menu"> <a href="#" @click="${0}" class="dropdown-item"> ${0} </a> </div> </div> </div> </div> `),this.onDropdownClick,this.auth["user-full-name"],this.closeDropdown,this.onLogoutClicked,t.t("logout"))}renderLoggedOut(){const t=this._i18n;return D(a||(a=_` <a href="#" @click="${0}"> <div class="login-box login-button"> <div class="icon">${0}</div> <div class="label">${0}</div> </div> </a> `),this.onLoginClicked,$('\n <svg\n viewBox="0 0 100 100"\n y="0px"\n x="0px"\n id="icon"\n role="img"\n version="1.1">\n <g\n id="g6">\n <path\n style="stroke-width:1.33417916"\n id="path2"\n d="m 42.943908,38.894934 5.885859,6.967885 H 5.4215537 c -1.8393311,0 -3.4334181,1.741972 -3.4334181,4.064599 0,2.322628 1.4714649,4.064599 3.4334181,4.064599 H 48.829