UNPKG

@dbp-topics/dispatch

Version:

[GitHub Repository](https://github.com/digital-blueprint/dispatch-frontend) | [npmjs package](https://www.npmjs.com/package/@dbp-topics/dispatch) | [Unpkg CDN](https://unpkg.com/browse/@dbp-topics/dispatch/) | [Dispatch Bundle](https://github.com/digital-

353 lines (312 loc) 113 kB
let t,e,n,i,o,r,a,s,l,c,d,h,u,p,g,m,v,b,f,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: BSD-3-Clause * @dbp-toolkit/app-shell: LGPL-2.1-or-later * @dbp-toolkit/language-select: LGPL-2.1-or-later * @dbp-toolkit/common: LGPL-2.1-or-later * @dbp-toolkit/auth: LGPL-2.1-or-later * event-target-shim: MIT * @dbp-toolkit/notification: LGPL-2.1-or-later * @dbp-toolkit/theme-switcher: LGPL-2.1-or-later * path-to-regexp: MIT * universal-router: MIT * generateUrls: MIT * @dbp-toolkit/matomo: LGPL-2.1-or-later * @tugraz/web-components: LGPL-2.1-or-later */import{c as S}from"./shared/_commonjsHelpers.e3705ba7.es.js";import{c as A,D as L,i as R,y as T,o as D,A as O,g as I,s as P,S as M,M as F,a as $,I as j,b as N,d as B,e as U,f as G,h as H,j as z,k as V,l as W}from"./shared/notification.431b7aff.es.js";import{J as q}from"./shared/jsonld.f5d0f523.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,v=new WeakMap,b=new WeakMap,f=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&&(b.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,v.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=b.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=f.get(n))?void 0:i.getRootNode())||document)}i=n.customElements}return(n=(i=i||window.customElements).j(t))?E(e,n):v.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):v.get(this).m(this,t,!0)},e.prototype.disconnectedCallback=function(){var e=m.get(this);e?e.disconnectedCallback&&e.disconnectedCallback.apply(this,arguments):v.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&&f.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 T=function(t){var e=a(Array,[].concat(n(t)),this.constructor);return e.h=t,e},D=T,O=Array;if(D.prototype=i(O.prototype),D.prototype.constructor=D,c)c(D,O);else for(var I in O)if("prototype"!=I)if(Object.defineProperties){var P=Object.getOwnPropertyDescriptor(O,I);P&&Object.defineProperty(D,I,P)}else D[I]=O[I];D.u=O.prototype,r.Object.defineProperty(T.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 M=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 T(t))}))};M.prototype.namedItem=function(t){return this[t]};var F=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){for(var t=F.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 M(n)}})}}}).call("object"==typeof globalThis?globalThis:window);var K={"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}}'."}},Y={"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 J(){return A({en:Y,de:K},"de","en")}var X={de:"Deutsch","de-action":"Auf Deutsch anzeigen",demo:"Hallo Welt",en:"Englisch","en-action":"Auf Englisch anzeigen"},Z={de:"German","de-action":"Switch to German",demo:"Hello World",en:"English","en-action":"Switch to English"};class Q extends O{constructor(){super(),this._lang="de",this.languages=["de","en"],this._i18n=A({en:Z,de:X},"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 T(i||(i=_` <a href="#" title="${0}" @click=${0}>${0}</a> `),t,this.onClick,this.next.toUpperCase())}}var tt={login:"Anmelden","login-failed":"Kommunikation mit dem Anmeldeserver fehlgeschlagen",logout:"Abmelden"},et={login:"Login","login-failed":"Communication with the login server failed",logout:"Logout"};function nt(){return A({en:et,de:tt},"de","en")}function it(t,e,...n){if(!t)throw new TypeError(ot(e,n))}function ot(t,e){let n=0;return t.replace(/%[os]/g,(()=>rt(e[n++])))}function rt(t){return"object"!=typeof t||null===t?String(t):Object.prototype.toString.call(t)}const at="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:void 0;class st{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 lt=new st("W01","Unable to initialize event under dispatching."),ct=new st("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),dt=new st("W03","Assigning any truthy value to 'returnValue' property has no effect."),ht=new st("W04","Unable to preventDefault on non-cancelable events."),ut=new st("W05","Unable to preventDefault inside passive event listener invocation."),pt=new st("W06","An event listener wasn't added because it has been added already: %o, %o"),gt=new st("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),mt=new st("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o");new st("W09","Event attribute handler must be a function: %o");class vt{static get NONE(){return bt}static get CAPTURING_PHASE(){return ft}static get AT_TARGET(){return yt}static get BUBBLING_PHASE(){return wt}constructor(t,e){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=null!=e?e:{};kt.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 Et(this).type}get target(){return Et(this).target}get srcElement(){return Et(this).target}get currentTarget(){return Et(this).currentTarget}composedPath(){const t=Et(this).currentTarget;return t?[t]:[]}get NONE(){return bt}get CAPTURING_PHASE(){return ft}get AT_TARGET(){return yt}get BUBBLING_PHASE(){return wt}get eventPhase(){return Et(this).dispatchFlag?2:0}stopPropagation(){Et(this).stopPropagationFlag=!0}get cancelBubble(){return Et(this).stopPropagationFlag}set cancelBubble(t){t?Et(this).stopPropagationFlag=!0:ct.warn()}stopImmediatePropagation(){const t=Et(this);t.stopPropagationFlag=t.stopImmediatePropagationFlag=!0}get bubbles(){return Et(this).bubbles}get cancelable(){return Et(this).cancelable}get returnValue(){return!Et(this).canceledFlag}set returnValue(t){t?dt.warn():xt(Et(this))}preventDefault(){xt(Et(this))}get defaultPrevented(){return Et(this).canceledFlag}get composed(){return Et(this).composed}get isTrusted(){return!1}get timeStamp(){return Et(this).timeStamp}initEvent(t,e=!1,n=!1){const i=Et(this);i.dispatchFlag?lt.warn():kt.set(this,C({},i,{type:String(t),bubbles:Boolean(e),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1}))}}const bt=0,ft=1,yt=2,wt=3,kt=new WeakMap;function Et(t,e="this"){const n=kt.get(t);return it(null!=n,"'%s' must be an object that Event constructor created, but got another one: %o",e,t),n}function xt(t){t.inPassiveListenerFlag?ut.warn():t.cancelable?t.canceledFlag=!0:ht.warn()}Object.defineProperty(vt,"NONE",{enumerable:!0}),Object.defineProperty(vt,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(vt,"AT_TARGET",{enumerable:!0}),Object.defineProperty(vt,"BUBBLING_PHASE",{enumerable:!0});const _t=Object.getOwnPropertyNames(vt.prototype);for(let t=0;t<_t.length;++t)"constructor"!==_t[t]&&Object.defineProperty(vt.prototype,_t[t],{enumerable:!0});let Ct;void 0!==at&&void 0!==at.Event&&Object.setPrototypeOf(vt.prototype,at.Event.prototype);const St={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 At(t){const e=Object.keys(St);for(let n=0;n<e.length;++n){const i=e[n],o=St[i];Object.defineProperty(t,i,{get:()=>o,configurable:!0,enumerable:!0})}}class Lt extends vt{static wrap(t){return new(Ot(t))(t)}constructor(t){super(t.type,{bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}),t.cancelBubble&&super.stopPropagation(),t.defaultPrevented&&super.preventDefault(),Rt.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,It(t,i))}}stopPropagation(){super.stopPropagation();const{original:t}=Tt(this);"stopPropagation"in t&&t.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(t){super.cancelBubble=t;const{original:e}=Tt(this);"cancelBubble"in e&&(e.cancelBubble=t)}stopImmediatePropagation(){super.stopImmediatePropagation();const{original:t}=Tt(this);"stopImmediatePropagation"in t&&t.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(t){super.returnValue=t;const{original:e}=Tt(this);"returnValue"in e&&(e.returnValue=t)}preventDefault(){super.preventDefault();const{original:t}=Tt(this);"preventDefault"in t&&t.preventDefault()}get timeStamp(){const{original:t}=Tt(this);return"timeStamp"in t?t.timeStamp:super.timeStamp}}const Rt=new WeakMap;function Tt(t){const e=Rt.get(t);return it(null!=e,"'this' is expected an Event object, but got",t),e}const Dt=new WeakMap;function Ot(t){const e=Object.getPrototypeOf(t);if(null==e)return Lt;let n=Dt.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],It(e,i[t]));return n}(Ot(e),e),Dt.set(e,n)),n}function It(t,e){const n=Object.getOwnPropertyDescriptor(t,e);return{get(){const t=Tt(this).original,n=t[e];return"function"==typeof n?n.bind(t):n},set(t){Tt(this).original[e]=t},configurable:n.configurable,enumerable:n.enumerable}}function Pt(t){return 1==(1&t.flags)}function Mt(t){return 2==(2&t.flags)}function Ft(t){return 4==(4&t.flags)}function $t(t){return 8==(8&t.flags)}function jt({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(rt(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 Nt({listeners:t},e,n){for(let i=0;i<t.length;++i)if(t[i].callback===e&&Pt(t[i])===n)return i;return-1}function Bt(t,e,n){const i=Nt(t,e,n);return-1!==i&&Ut(t,i)}function Ut(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)}Dt.set(Object.prototype,Lt),void 0!==at&&void 0!==at.Event&&Dt.set(at.Event.prototype,Lt);class Gt{constructor(){Ht.set(this,Object.create(null))}addEventListener(t,e,n){const i=zt(this),{callback:o,capture:r,once:a,passive:s,signal:l,type:c}=function(t,e,n){var i;if(Vt(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=Nt(d,o,r);-1===h?function(t,e,n,i,o,r){let a;r&&(a=Bt.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){pt.warn(Pt(t)?"capture":"bubble",t.callback),Mt(t)!==e&&gt.warn("passive");Ft(t)!==n&&gt.warn("once");t.signal!==i&&gt.warn("signal")}(d.listeners[h],s,a,l)}removeEventListener(t,e,n){const i=zt(this),{callback:o,capture:r,type:a}=function(t,e,n){if(Vt(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&&Bt(s,o,r)}dispatchEvent(t){const e=zt(this)[String(t.type)];if(null==e)return!0;const n=t instanceof vt?t:Lt.wrap(t),i=Et(n,"event");if(i.dispatchFlag)throw o="This event has been in dispatching.",at.DOMException?new at.DOMException(o,"InvalidStateError"):(null==Ct&&(Ct=class t extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,t)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(Ct.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),At(Ct),At(Ct.prototype)),new Ct(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(!$t(a)&&(Ft(a)&&Ut(e,r,!t)&&(r-=1),i.inPassiveListenerFlag=Mt(a),jt(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 Ht=new WeakMap;function zt(t,e="this"){const n=Ht.get(t);return it(null!=n,"'%s' must be an object that EventTarget constructor created, but got another one: %o",e,t),n}function Vt(t){if("function"!=typeof t&&("object"!=typeof t||null===t||"function"!=typeof t.handleEvent)){if(null!=t&&"object"!=typeof t)throw new TypeError(ot(mt.message,[t]));mt.warn(t)}}const Wt=Object.getOwnPropertyNames(Gt.prototype);for(let t=0;t<Wt.length;++t)"constructor"!==Wt[t]&&Object.defineProperty(Gt.prototype,Wt[t],{enumerable:!0});void 0!==at&&void 0!==at.EventTarget&&Object.setPrototypeOf(Gt.prototype,at.EventTarget.prototype);class qt extends Gt{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.3b1feb8b.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 Kt=Object.freeze({UNKNOWN:"unknown",LOGGING_IN:"logging-in",LOGGED_IN:"logged-in",LOGGING_OUT:"logging-out",LOGGED_OUT:"logged-out"});class Yt 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=Kt.UNKNOWN,this.requestedLoginStatus=Kt.UNKNOWN,this._i18n=nt(),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":q.getInstance(this.entryPointUrl,this.lang);break;case"requestedLoginStatus":switch(console.log("requested-login-status changed",this.requestedLoginStatus),this.requestedLoginStatus){case Kt.LOGGED_IN:this._kcwrapper.login({lang:this.lang,scope:this.scope||""});break;case Kt.LOGGED_OUT:this._loginStatus===Kt.LOGGED_IN&&this._setLoginStatus(Kt.LOGGING_OUT),this._kcwrapper.logout(),this._loginStatus===Kt.LOGGING_OUT&&this._setLoginStatus(Kt.LOGGED_IN)}}})),super.update(t)}async _fetchUser(t){var e;let n;n=await q.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(Kt.LOGGED_IN,t||i)}else this._loginStatus===Kt.LOGGED_IN&&this._setLoginStatus(Kt.LOGGING_OUT),this.name="",this.token="",this.subject="",this._userId="",this._user=null,this._setLoginStatus(Kt.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 qt(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(Kt.LOGGING_IN),await t._kcwrapper.login({lang:t.lang,scope:t.scope||""})):t.tryLogin?(t._setLoginStatus(Kt.LOGGING_IN),await t._kcwrapper.tryLogin(),t._authenticated||t._setLoginStatus(Kt.LOGGED_OUT)):t._setLoginStatus(Kt.LOGGED_OUT)}catch(e){throw t._setLoginStatus(Kt.LOGGED_OUT),P({summary:t._i18n.t("login-failed"),type:"danger",timeout:5}),e}}()}disconnectedCallback(){this._kcwrapper.close(),this._kcwrapper.removeEventListener("changed",this._onKCChanged),super.disconnectedCallback()}}class Jt extends(M(O)){constructor(){super(),this._i18n=nt(),this.lang=this._i18n.language,this.auth={}}static get scopedElements(){return{"dbp-mini-spinner":F}}static get properties(){return{lang:{type:String},auth:{type:Object}}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}_onLoginClicked(t){this.sendSetPropertyEvent("requested-login-status",Kt.LOGGED_IN),t.preventDefault()}_onLogoutClicked(t){this.sendSetPropertyEvent("requested-login-status",Kt.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"]===Kt.LOGGING_IN?T(_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"]===Kt.LOGGED_IN?T(_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")):T(_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 Xt extends(M(O)){constructor(){super(),this._i18n=J(),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":j}}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",Kt.LOGGED_IN),t.preventDefault()}onLogoutClicked(t){this.sendSetPropertyEvent("requested-login-status",Kt.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 T(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 T(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.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"))}render(){const t="logged-in"===this.auth["login-status"];return T(s||(s=_` <div class="authbox">${0}</div> `),t?this.renderLoggedIn():this.renderLoggedOut())}}var Zt={send:"senden"},Qt={send:"send"};class te extends L{constructor(){super(),this._i18n=A({en:Qt,de:Zt},"de","en"),this.lang=this._i18n.language}static get properties(){return C({},super.properties,{lang:{type:String}})}connectedCallback(){super.connectedCallback();const t=this;window.addEventListener("dbp-notification-send",(e=>{if(void 0===e.detail)return;t.notificationBlock=t._("#notification");const n=`notification-${(()=>{let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))})()}`,i=void 0!==e.detail.type?e.detail.type:"info",o=void 0!==e.detail.body?e.detail.body:"",r=void 0!==e.detail.summary?e.detail.summary:"",a=void 0!==e.detail.timeout?e.detail.timeout:0,s=void 0!==e.detail.icon?e.detail.icon:"",l=""!==s?`<dbp-icon name="${s}"></dbp-icon>`:"",c=""!==r?`<h3>${r}</h3>`:"";t.notificationBlock.innerHTML=`\n <div id="${n}" class="notification is-${i}">\n <button id="${n}-button" onclick="parentNode.parentNode.removeChild(parentNode)" class="delete"></button>\n ${c}\n ${l} ${o}\n </div>\n `+t.notificationBlock.innerHTML;const d=`#${n}`;a>0&&setTimeout((()=>{t.removeMessageId(d)}),1e3*a),e.preventDefault()}))}removeMessageId(t){const e=this._(t);e&&this.notificationBlock.removeChild(e)}static get styles(){return R(l||(l=_` ${0} ${0} ${0} .notification:not(:last-child) { margin-bottom: 1.5rem; } .notification h3 { font-weight: bold; margin-bottom: 3px; } .delete, .modal-close { -moz-appearance: none; -webkit-appearance: none; background-color: rgba(10, 10, 10, 0.2); border: none; border-radius: 290486px; cursor: pointer; pointer-events: auto; display: inline-block; flex-grow: 0; flex-shrink: 0; font-size: 0; height: 20px; max-height: 20px; max-width: 20px; min-height: 20px; min-width: 20px; outline: 0; position: relative; vertical-align: top; width: 20px; } .delete::before, .modal-close::before, .delete::after, .modal-close::after { background-color: var(--dbp-background); color: var(--dbp-content); content: ''; display: block; left: 50%; position: absolute; top: 50%; -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg); -webkit-transform-origin: center center; transform-origin: center center; } .delete::before, .modal-close::before { height: 2px; width: 50%; } .delete::after, .modal-