@digital-blueprint/dispatch-app
Version:
[GitHub Repository](https://github.com/digital-blueprint/dispatch-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/dispatch-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/dispatch-app/) | [Dispatch Bundle](https://gi
617 lines (549 loc) • 52.9 kB
JavaScript
let e=e=>e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y;function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?b(Object(n),!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){var t=w(e,`string`);return typeof t==`symbol`?t:t+``}function w(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}
/*!
* 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/auth: LGPL-2.1-or-later
* lit-html: BSD-3-Clause
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/theme-switcher: LGPL-2.1-or-later
* universal-router: MIT
* @dbp-toolkit/matomo: LGPL-2.1-or-later
*/
import{$ as T,C as E,D,E as O,F as k,I as A,N as j,O as M,P as N,Q as P,S as F,T as I,V as L,_ as R,p as z,rt as B,x as V}from"./shared/dbp-lit-element.BfjLvJVI.js";import"./shared/directive-helpers.Sc6bWiSp.js";import{a as H,i as U,n as W,r as G,t as K}from"./shared/styles.DsCAj-59.js";import"./shared/dbp-file-handling-lit-element.CduMSkeZ.js";import{t as q}from"./shared/file-source.fWrDCXC2.js";import{t as J}from"./shared/file-sink.CHWfTL87.js";import{n as Y,o as X,t as Z}from"./shared/src.CBTAcdze.js";import{n as Q,t as $}from"./shared/src.WsPj5v14.js";L(`dbp-show-requests`,class extends N(W){constructor(){super(),this._i18n=H(),this.lang=this._i18n.language,this.entryPointUrl=``,this.loading=!1,this._initialFetchDone=!1,this.requestList=[],this.showListView=!0,this.showDetailsView=!1,this.currentItem={},this.currentItem.files=[],this.currentItem.recipients=[],this.currentRecipient={},this.subject=``,this.mayWrite=!1,this.mayRead=!1,this.mayReadAddress=!1,this.mayReadMetadata=!1,this.organizationSet=!1,this.addFileViaButton=!1,this.currentItem.senderOrganizationName=``,this.currentItem.senderFullName=``,this.currentItem.senderAddressCountry=``,this.currentItem.senderPostalCode=``,this.currentItem.senderAddressLocality=``,this.currentItem.senderStreetAddress=``,this.currentItem.senderBuildingNumber=``,this.currentRowIndex=``,this.currentTable={},this.lastModifiedName=``,this.expanded=!1,this.fileHandlingEnabledTargets=`local`,this.nextcloudWebAppPasswordURL=``,this.nextcloudWebDavURL=``,this.nextcloudName=``,this.nextcloudFileURL=``,this.nextcloudAuthInfo=``,this.selectedRow=this.rowClick.bind(this),this.initateOpenAdditionalMenu=!1,this.initateOpenAdditionalSearchMenu=!1,this.boundCloseAdditionalSearchMenuHandler=this.hideAdditionalSearchMenu.bind(this),this.boundCloseAdditionalSearchMenuHandlerInner=this.hideAdditionalSearchMenuInner.bind(this),this.boundPressEnterAndSubmitSearchHandler=this.pressEnterAndSubmitSearch.bind(this),this.langDir=void 0,this.loadingTranslations=!1,this.tableLoading=!1,this.expandedTabulator=!1,this.allSelected=!1}static get scopedElements(){return{"dbp-icon":A,"dbp-mini-spinner":k,"dbp-loading-button":F,"dbp-icon-button":V,"dbp-inline-notification":R,"dbp-file-sink":J,"dbp-file-source":q,"dbp-person-select":G,"dbp-resource-select":Y,"dbp-info-tooltip":Q,"dbp-tooltip":$,"dbp-pdf-viewer":X,"dbp-tabulator-table":Z}}static get properties(){return x(x({},super.properties),{},{lang:{type:String},entryPointUrl:{type:String,attribute:`entry-point-url`},loading:{type:Boolean,attribute:!1},initialRequestsLoading:{type:Boolean,attribute:!1},tableLoading:{type:Boolean,attribute:!1},requestList:{type:Array,attribute:!1},showListView:{type:Boolean,attribute:!1},showDetailsView:{type:Boolean,attribute:!1},currentItem:{type:Object,attribute:!1},currentRow:{type:Object,attribute:!1},currentRowIndex:{type:String,attribute:!1},currentTable:{type:Object,attribute:!1},currentRecipient:{type:Object,attribute:!1},subject:{type:String,attribute:!1},organizationSet:{type:Boolean,attribute:!1},mayWrite:{type:Boolean,attribute:!1},mayRead:{type:Boolean,attribute:!1},mayReadMetadata:{type:Boolean,attribute:!1},lastModifiedName:{type:String,attribute:!1},expanded:{type:Boolean,attribute:!1},allSelected:{type:Boolean,attribute:!1},fileHandlingEnabledTargets:{type:String,attribute:`file-handling-enabled-targets`},nextcloudWebAppPasswordURL:{type:String,attribute:`nextcloud-web-app-password-url`},nextcloudWebDavURL:{type:String,attribute:`nextcloud-webdav-url`},nextcloudName:{type:String,attribute:`nextcloud-name`},nextcloudFileURL:{type:String,attribute:`nextcloud-file-url`},nextcloudAuthInfo:{type:String,attribute:`nextcloud-auth-info`},langDir:{type:String,attribute:`lang-dir`},expandedTabulator:{type:Boolean}})}update(e){e.forEach((e,t)=>{switch(t){case`lang`:this._i18n.changeLanguage(this.lang);break}}),super.update(e)}disconnectedCallback(){document.removeEventListener(`keyup`,this.boundPressEnterAndSubmitSearchHandler),super.disconnectedCallback()}connectedCallback(){if(super.connectedCallback(),this._loginStatus=``,this._loginState=[],this._loginCalled=!1,this.langDir){this.loadingTranslations=!0;let e=this;B(this._i18n,this).then(()=>{e.loadingTranslations=!1,e.requestUpdate()})}else this.loadingTranslations=!1;this.updateComplete.then(()=>{this._a(`.tabulator-table`).forEach(e=>{let t=e;t.buildTable(),document.addEventListener(`keyup`,this.boundPressEnterAndSubmitSearchHandler),t.id==`tabulator-table-orders`&&t.addEventListener(`click`,this.selectedRow)}),document.addEventListener(`keyup`,this.boundPressEnterAndSubmitSearchHandler)})}pressEnterAndSubmitSearch(e){if(e.keyCode===13){let t=this.shadowRoot.activeElement;t&&t.id===`searchbar`&&(e.preventDefault(),this.filterTable(),this.hideAdditionalSearchMenu(e))}}clearFilter(){let e=this._(`#searchbar`),t=this._(`#search-select`),n=this._(`#tabulator-table-orders`);!e||!t||!n||(e.value=``,t.value=`all`,n.clearFilter())}filterTable(){let e=this._(`#searchbar`),t=this._(`#search-select`),n=this._(`#search-operator`),r=this._(`#tabulator-table-orders`);if(!e||!n||!t||!r)return;if(e.value===``){r.clearFilter();return}let i=e.value,a=t.value,o=n.value;if(a!==`all`){let e={field:a,type:o,value:i};r.setFilter([e]);return}else{let e=r.getColumnsFields(),t=[];for(let n of e){let e={field:n,type:o,value:i};t.push(e)}r.setFilter([t])}}toggleMoreMenu(){let e=this.shadowRoot.querySelector(`ul.extended-menu`),t=this.shadowRoot.querySelector(`a.extended-menu-link`);e===null||t===null||(e.classList.toggle(`hidden`),e.classList.contains(`hidden`)?document.removeEventListener(`click`,this.boundCloseAdditionalSearchMenuHandler):(document.addEventListener(`click`,this.boundCloseAdditionalSearchMenuHandler),this.initateOpenAdditionalMenu=!0))}hideAdditionalMenu(){if(this.initateOpenAdditionalMenu){this.initateOpenAdditionalMenu=!1;return}let e=this.shadowRoot.querySelector(`ul.extended-menu`);e&&!e.classList.contains(`hidden`)&&this.toggleMoreMenu()}toggleSearchMenu(){let e=this._(`#extendable-searchbar .extended-menu`),t=this._(`#searchbar-menu`);e!==null&&(e.classList.remove(`hidden`),e.classList.contains(`hidden`)||(document.addEventListener(`click`,this.boundCloseAdditionalSearchMenuHandler),t.addEventListener(`click`,this.boundCloseAdditionalSearchMenuHandlerInner),this.initateOpenAdditionalSearchMenu=!0))}hideAdditionalSearchMenuInner(e){if(this._(`#searchbar-menu`).contains(e.target)){e.stopPropagation(),this.initateOpenAdditionalSearchMenu=!1;return}}hideAdditionalSearchMenu(e){if(this.initateOpenAdditionalSearchMenu){this.initateOpenAdditionalSearchMenu=!1;return}let t=this._(`#extendable-searchbar .extended-menu`),n=this._(`#searchbar-menu`);t&&!t.classList.contains(`hidden`)&&(t.classList.add(`hidden`),document.removeEventListener(`click`,this.boundCloseAdditionalSearchMenuHandler),n.removeEventListener(`click`,this.boundCloseAdditionalSearchMenuHandlerInner))}getTableHeaderOptions(){let r=this._i18n,i=this._(`#tabulator-table-orders`);if(!i)return[];let a=[];a[0]=P(t||=e`
<option value="all">${0}</option>
`,r.t(`show-requests.all-columns`));let o=i.getLang().columns;return Object.entries(o).forEach(([t,r],i)=>{t!==`actions`&&(a[i+1]=P(n||=e`
<option value="${0}">${0}</option>
`,t,r))}),a}rowClick(e){this.selected=!0;let t=this._(`#delete-all-btn`),n=this._(`#submit-all-btn`);this._(`#tabulator-table-orders`).getSelectedRows().length===0?(t.disabled=!0,n.disabled=!0):(t.disabled=!1,n.disabled=!1)}async processSelectedOrganization(e){var t=this;let n=this._i18n;this.storeGroupValue(e.detail.value),this.groupId=e.target.valueObject.identifier,e.target.valueObject.accessRights&&(this.mayReadAddress=e.target.valueObject.accessRights.includes(`wra`),this.mayReadMetadata=e.target.valueObject.accessRights.includes(`rm`),this.mayRead=e.target.valueObject.accessRights.includes(`rc`),this.mayWrite=e.target.valueObject.accessRights.includes(`w`)),this.organizationSet=!0,this.getListOfRequests().then(()=>{let e=this._(`#tabulator-table-orders`);this.currentTable=e;let r=[];this.requestList.forEach((i,a)=>{let o=i.dateSubmitted?this.checkRecipientStatus(i.recipients)[1]:n.t(`show-requests.empty-date-submitted`),s=this.createScopedElement(`div`);if(s.classList.add(`tabulator-icon-buttons`),o===n.t(`show-requests.empty-date-submitted`)){let r=this.createScopedElement(`dbp-icon-button`);r.setAttribute(`icon-name`,`pencil`),r.setAttribute(`aria-label`,n.t(`show-requests.edit-request-button-text`)),r.setAttribute(`title`,n.t(`show-requests.edit-request-button-text`)),r.addEventListener(`click`,async function(e){t.currentRowIndex=a.toString(),t.editRequest(e,i),e.stopPropagation()}),s.appendChild(r);let o=this.createScopedElement(`dbp-icon-button`);o.setAttribute(`icon-name`,`trash`),o.setAttribute(`aria-label`,n.t(`show-requests.delete-request-button-text`)),o.setAttribute(`title`,n.t(`show-requests.delete-request-button-text`)),o.addEventListener(`click`,async function(n){t.deleteRequest(e,n,i,a),n.stopPropagation()}),s.appendChild(o);let c=this.createScopedElement(`dbp-icon-button`);c.setAttribute(`icon-name`,`send-diagonal`),c.setAttribute(`aria-label`,n.t(`show-requests.send-request-button-text`)),c.setAttribute(`title`,n.t(`show-requests.send-request-button-text`)),c.addEventListener(`click`,async function(n){t.currentItem=i,t.submitRequest(e,n,i,a),n.stopPropagation()}),s.appendChild(c)}else{let e=this.createScopedElement(`dbp-icon-button`);e.setAttribute(`icon-name`,`keyword-research`),e.setAttribute(`aria-label`,n.t(`show-requests.show-detailed-dispatch-order`)),e.setAttribute(`title`,n.t(`show-requests.show-detailed-dispatch-order`)),e.addEventListener(`click`,async function(e){t.editRequest(e,i),e.stopPropagation()}),s.appendChild(e)}let c={dateCreated:this.convertToReadableDate(i.dateCreated),gz:i.referenceNumber?i.referenceNumber:n.t(`show-requests.empty-reference-number`),subject:i.name,status:o,files:this.createFormattedFilesList(i.files),recipients:this.createFormattedRecipientsList(i.recipients),dateSubmitted:i.dateSubmitted?this.convertToReadableDate(i.dateSubmitted):n.t(`show-requests.date-submitted-not-submitted`),requestId:i.identifier,actions:s};r.push(c)}),e.setData(r)})}deleteSelectedRows(){this._(`#tabulator-table-orders`).deleteSelectedRows()}setTabulatorData(){}expandAll(){this.expanded=!0,this._(`#tabulator-table-orders`).expandAll()}collapseAll(){this.expanded=!1,this._(`#tabulator-table-orders`).collapseAll()}_onLoginClicked(e){this.sendSetPropertyEvent(`requested-login-status`,`logged-in`),e.preventDefault()}static get styles(){return T(r||=e`
${0}
${0}
${0}
${0}
${0}
${0}
${0}
.control.table {
padding-top: 1.5rem;
font-size: 1.5rem;
text-align: center;
}
.muted {
color: var(--dbp-muted);
}
#search-operator,
#search-select,
.dropdown-menu {
background-color: var(--dbp-secondary-surface);
color: var(--dbp-on-secondary-surface);
border-color: var(--dbp-secondary-surface-border-color);
background-size: auto 45%;
padding-bottom: calc(0.375em - 1px);
padding-left: 0.75em;
padding-right: 1.5rem;
padding-top: calc(0.375em - 1px);
cursor: pointer;
background-position-x: calc(100% - 0.4rem);
box-sizing: content-box;
}
#search-select,
#search-operator {
margin-bottom: 10px;
box-sizing: border-box;
text-align: left;
}
.extended-menu.hidden {
display: none !important;
}
#extendable-searchbar .extended-menu {
list-style: none;
border: var(--dbp-border);
background-color: var(--dbp-background);
z-index: 1000;
border-radius: var(--dbp-border-radius);
width: 100%;
position: absolute;
right: 0px;
background-color: var(--dbp-background);
padding: 10px;
box-sizing: border-box;
top: 33px;
margin: 0px;
border-top: unset;
display: flex;
flex-direction: column;
gap: 10px;
}
.search-wrapper {
display: flex;
justify-content: center;
min-width: 300px;
}
.table-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
}
#extendable-searchbar {
display: flex;
flex-grow: 1;
position: relative;
width: 320px;
}
#searchbar {
width: 100%;
box-sizing: border-box;
border: var(--dbp-border);
padding: calc(0.375em - 1px) 10px;
border-radius: var(--dbp-border-radius);
min-height: 33px;
background-color: var(--dbp-background);
color: var(--dbp-content);
}
#search-button {
margin-left: -40px;
font-size: 1rem;
}
.edit-selection-buttons {
display: flex;
gap: 1em;
margin-left: 1em;
}
.edit-items {
font-size: 1.6rem;
}
a {
color: var(--dbp-override-content);
cursor: pointer;
text-decoration: none;
}
h3 {
font-weight: 300;
margin-top: 1.3em;
margin-bottom: 1.3em;
}
.border {
border-top: var(--dbp-override-border);
}
.requests {
margin-top: 1em;
}
.request-item:first-child {
border-top: none;
padding-top: 0;
margin-top: 0;
}
.sender-data {
margin: 0 0 0.5em 1px;
line-height: 1.5;
}
#search-button dbp-icon {
top: -4px;
}
#open-settings-btn dbp-icon,
.card .button.is-icon dbp-icon,
.header-btn .button.is-icon dbp-icon {
font-size: 1.3em;
}
@media only screen and (max-width: 1150px) {
.table-wrapper {
flex-direction: column;
gap: 1em;
}
.selected-buttons,
.filter-buttons {
width: 100%;
}
#extendable-searchbar {
width: 100%;
}
.edit-selection-buttons {
margin-left: 0;
width: 100%;
}
.edit-selection-buttons dbp-loading-button {
flex-grow: 1;
flex-shrink: 1;
/* flex-basis: 25%; */
}
}
@media only screen and (max-width: 800px) {
.edit-selection-buttons {
gap: 6px;
}
}
@media only screen and (orientation: portrait) and (max-width: 768px) {
.edit-selection-buttons {
display: flex;
gap: 1em;
width: 100%;
}
#searchbar {
width: 100%;
height: 40px;
}
#extendable-searchbar {
width: calc(-30px + 100vw);
}
#search-button {
position: absolute;
right: 0px;
top: 0px;
height: 40px;
box-sizing: border-box;
}
#search-button dbp-icon {
top: 0px;
}
#open-settings-btn {
margin-top: 0;
}
.table-wrapper {
flex-direction: column;
gap: 1em;
}
.filter-buttons {
width: calc(100% - 45px);
}
}
`,j(),I(!1),O(),M(),D(),E(),K())}render(){var t=this;let n=this._i18n;this.isLoggedIn()&&!this.isLoading()&&!this._initialFetchDone&&!this.initialRequestsLoading&&this.organizationSet&&this.getListOfRequests();let r={langs:{en:{columns:{details:n.t(`show-requests.table-header-details`,{lng:`en`}),dateCreated:n.t(`show-requests.table-header-date-created`,{lng:`en`}),gz:n.t(`show-requests.table-header-gz`,{lng:`en`}),subject:n.t(`show-requests.table-header-subject`,{lng:`en`}),status:n.t(`show-requests.table-header-status`,{lng:`en`}),files:n.t(`show-requests.table-header-files`,{lng:`en`}),recipients:n.t(`show-requests.table-header-recipients`,{lng:`en`}),dateSubmitted:n.t(`show-requests.date-submitted`,{lng:`en`}),requestId:n.t(`show-requests.table-header-id`,{lng:`en`}),actions:n.t(`show-requests.actions`,{lng:`en`})}},de:{columns:{details:n.t(`show-requests.table-header-details`,{lng:`de`}),dateCreated:n.t(`show-requests.table-header-date-created`,{lng:`de`}),gz:n.t(`show-requests.table-header-gz`,{lng:`de`}),subject:n.t(`show-requests.table-header-subject`,{lng:`de`}),status:n.t(`show-requests.table-header-status`,{lng:`de`}),files:n.t(`show-requests.table-header-files`,{lng:`de`}),recipients:n.t(`show-requests.table-header-recipients`,{lng:`de`}),dateSubmitted:n.t(`show-requests.date-submitted`,{lng:`de`}),requestId:n.t(`show-requests.table-header-id`,{lng:`de`}),actions:n.t(`show-requests.actions`,{lng:`de`})}}},layout:`fitColumns`,responsiveLayout:`collapse`,responsiveLayoutCollapseStartOpen:!1,columns:[{title:`details`,field:`details`,hozAlign:`center`,width:65,formatter:`responsiveCollapse`,headerHozAlign:`center`,sorter:`string`,headerSort:!1,responsive:0},{title:`dateCreated`,field:`dateCreated`,minWidth:140,hozAlign:`left`,widthGrow:1,responsive:0,sorter:(e,t,n,r,i,a,o)=>this.dateToTimestamp(e)-this.dateToTimestamp(t)},{title:`gz`,field:`gz`,responsive:2,widthGrow:3,minWidth:100,formatter:`html`},{title:`subject`,field:`subject`,minWidth:140,responsive:3,widthGrow:3,formatter:`html`},{title:`status`,field:`status`,minWidth:120,responsive:2,widthGrow:1,hozAlign:`center`,formatter:function(e,t,n){return n(function(){var t=e.getElement();t.scrollWidth>t.clientWidth&&(t.style.whiteSpace=`wrap`)}),e.getValue()}},{title:`files`,field:`files`,minWidth:800,formatter:`html`,responsive:8},{title:`recipients`,field:`recipients`,minWidth:800,formatter:`html`,responsive:8},{title:`dateSubmitted`,field:`dateSubmitted`,minWidth:150,responsive:8},{title:`requestId`,field:`requestId`,minWidth:150,responsive:8},{title:`actions`,field:`actions`,minWidth:140,formatter:`html`,hozAlign:`right`,widthGrow:1,headerSort:!1,responsive:0}],columnDefaults:{vertAlign:`middle`,hozAlign:`left`,resizable:!1},initialSort:[{column:`dateCreated`,dir:`desc`}]};return P(i||=e`
<div class="control ${0}">
<span class="loading">
<dbp-mini-spinner text=${0}></dbp-mini-spinner>
</span>
</div>
<div
class="notification is-warning ${0}">
${0} <a href="#" @click="${0}">${0}</a>
</div>
<div class="${0}">
<slot name="activity-description">
<p class="activity-description">${0}
<a href="#" class="int-link-internal" title="${0}"
@click="${0}"
>
<span>${0}.</span>
</a>
</p>
</slot>
<div class="${0}">
${0}
<div class="choose-and-create-btns">
<dbp-resource-select
id="show-resource-select"
subscribe="lang,entry-point-url,auth"
lang="${0}"
resource-path="dispatch/groups"
value="${0}"
@change=${0}
></dbp-resource-select>
</div>
</div>
<div class="no-access-notification">
<dbp-inline-notification class="${0}"
type="${0}"
body="${0}">
</dbp-inline-notification>
</div>
<h3 class="${0}">
${0}
</h3>
<div class="${0}">
<div class="table-wrapper">
<div class="selected-buttons">
<div class="filter-buttons ${0}"
<div class="search-wrapper ">
<div id="extendable-searchbar">
<input type="text" id="searchbar" placeholder="${0}" @click='${0}'>
<dbp-icon-button id="search-button"
title="${0}"
icon-name="search"
aria-label="${0}"
@click='${0}'></dbp-icon-button>
<ul class='extended-menu hidden' id='searchbar-menu'>
<label for='search-select'>${0}:</label>
<select id='search-select' class='button dropdown-menu'
title='${0}:'>
${0}
</select>
<label for='search-operator'>${0}
:</label>
<select id='search-operator' class='button dropdown-menu'>
<option value='like'>${0}
</option>
<option value='='>${0}</option>
<option value='!='>${0}
</option>
<option value='starts'>${0}
</option>
<option value='ends'>${0}
</option>
<option value='<'>${0}</option>
<option value='<='>
${0}
</option>
<option value='>'>${0}
</option>
<option value='>='>
${0}
</option>
<option value='regex'>${0}
</option>
<option value='keywords'>
${0}
</option>
</select>
</ul>
</div>
</div>
<dbp-icon-button class="hidden ${0}" id="open-settings-btn"
?disabled="${0}"
@click="${0}"
title="TODO"
icon-name="iconoir_settings"></dbp-icon-button>
</div>
<div class="edit-selection-buttons ${0}">
${0}
</div>
</div>
<div class="container">
<dbp-tabulator-table
lang="${0}"
class="tabulator-table"
id="tabulator-table-orders"
identifier="orders-table"
collapse-enabled
pagination-size="10"
pagination-enabled
select-rows-enabled
sticky-header
.options=${0}>
</dbp-tabulator-table>
</div>
<div class="control table ${0}">
<span class="loading">
<dbp-mini-spinner text=${0}></dbp-mini-spinner>
</span>
</div>
</div>
</div>
${0}
</div>
</div>
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
`,z({hidden:this.isLoggedIn()||!this.isLoading()||!this.loadingTranslations}),n.t(`loading-message`),z({hidden:this.isLoggedIn()||this.isLoading()}),n.t(`error-login-message`),this._onLoginClicked,n.t(`error-login-link`),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations}),n.t(`show-requests.description-text`),n.t(`show-requests.create-new-request`),e=>{this.dispatchEvent(new CustomEvent(`dbp-show-activity`,{detail:{name:`create-request`}})),e.preventDefault()},n.t(`show-requests.create-new-request`),z({hidden:this.showDetailsView}),n.t(`show-requests.organization-select-description`),this.lang,this.groupValue,e=>{this.isLoggedIn()&&!this.isLoading()&&this.processSelectedOrganization(e).then(()=>{})},z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.mayWrite||!this.organizationSet}),this.mayRead||this.mayReadMetadata?`warning`:`danger`,this.mayRead||this.mayReadMetadata?n.t(`error-no-writes`):n.t(`error-no-read`),z({hidden:!this.isLoggedIn()||this.isLoading()||this.showDetailsView||!this.organizationSet||this.loadingTranslations}),n.t(`show-requests.dispatch-orders`),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showDetailsView||!this.organizationSet||!this.mayRead&&!this.mayReadMetadata}),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showDetailsView||!this.organizationSet}),n.t(`show-requests.search-box-text`),()=>{this.toggleSearchMenu()},n.t(`show-requests.search-box-text`),n.t(`show-requests.search-box-text`),()=>{this.filterTable()},n.t(`show-requests.search-in`),n.t(`show-requests.search-in-column`),this.getTableHeaderOptions(),n.t(`show-requests.search-operator`),n.t(`show-requests.search-operator-like`),n.t(`show-requests.search-operator-equal`),n.t(`show-requests.search-operator-notequal`),n.t(`show-requests.search-operator-starts`),n.t(`show-requests.search-operator-ends`),n.t(`show-requests.search-operator-less`),n.t(`show-requests.search-operator-lessthanorequal`),n.t(`show-requests.search-operator-greater`),n.t(`show-requests.search-operator-greaterorequal`),n.t(`show-requests.search-operator-regex`),n.t(`show-requests.search-operator-keywords`),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showDetailsView}),this.loading,()=>{},z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showDetailsView}),this.mayWrite?P(a||=e`
<dbp-loading-button
id="select-all-btn"
class="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="deselect-all-btn"
class="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="expand-all-btn"
class="${0}"
?disabled="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="collapse-all-btn"
class="${0}"
?disabled="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="delete-all-btn"
disabled
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="submit-all-btn"
disabled
type="is-primary"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
`,z({hidden:this.allSelected}),n.t(`show-requests.select-all`),()=>{this.allSelected=!0,this._(`#tabulator-table-orders`).selectAllVisibleRows(),this.toggleDeleteAndSubmitButtons(`#tabulator-table-orders`)},n.t(`show-requests.select-all`),n.t(`show-requests.select-all`),z({hidden:!this.allSelected}),n.t(`show-requests.deselect-all`),()=>{this.allSelected=!1,this._(`#tabulator-table-orders`).deselectAllRows(),this.toggleDeleteAndSubmitButtons(`#tabulator-table-orders`)},n.t(`show-requests.deselect-all`),n.t(`show-requests.deselect-all`),z({hidden:this.expanded}),this.loading,n.t(`show-requests.expand-all`),()=>{this.expandAll()},n.t(`show-requests.expand-all`),n.t(`show-requests.expand-all`),z({hidden:!this.expanded}),this.loading,n.t(`show-requests.collapse-all`),()=>{this.collapseAll()},n.t(`show-requests.collapse-all`),n.t(`show-requests.collapse-all`),n.t(`show-requests.delete-button-text`),async function(e){await t.deleteSelected(),t.toggleDeleteAndSubmitButtons(`#tabulator-table-orders`)},n.t(`show-requests.delete-button-text`),n.t(`show-requests.delete-button-text`),n.t(`show-requests.submit-button-text`),async function(e){await t.submitSelected(),t.toggleDeleteAndSubmitButtons(`#tabulator-table-orders`)},n.t(`show-requests.submit-button-text`),n.t(`show-requests.submit-button-text`)):``,this.lang,r,z({hidden:!this.initialRequestsLoading&&!this.tableLoading}),n.t(`show-requests.loading-table-message`),this.mayRead||this.mayReadMetadata?P(o||=e`
<div class="back-container">
<span
class="back-navigation ${0}">
<a
href="#"
title="${0}"
@click="${0}">
<dbp-icon name="chevron-left"></dbp-icon>
${0}
</a>
</span>
</div>
<h3
class="${0}">
${0}:
</h3>
<div
class="${0}">
${0}
${0}
</div>
`,z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showListView||!this.organizationSet}),n.t(`show-requests.back-to-list`),()=>{let e=this._(`#tabulator-table-orders`),t=e?e.getPage():1;this.getListOfRequests().then(()=>{e&&e.setPage(t)}),this.showListView=!0,this.showDetailsView=!1,this.currentItem={},this.currentItem.files=[],this.currentItem.recipients=[],this.currentRecipient={},this.currentItem.senderOrganizationName=``,this.currentItem.senderFullName=``,this.currentItem.senderAddressCountry=``,this.currentItem.senderPostalCode=``,this.currentItem.senderAddressLocality=``,this.currentItem.senderStreetAddress=``,this.currentItem.senderBuildingNumber=``},n.t(`show-requests.back-to-list`),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showListView||!this.organizationSet}),this.currentItem&&this.currentItem.dateSubmitted||!this.mayWrite?n.t(`show-requests.show-detailed-dispatch-order`,{id:this.currentItem.identifier}):n.t(`show-requests.detailed-dispatch-order`,{id:this.currentItem.identifier}),z({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations||this.showListView||!this.organizationSet}),this.currentItem&&!this.currentItem.dateSubmitted?P(s||=e`
<div class="request-buttons">
<div class="edit-buttons">
<dbp-loading-button
id="delete-btn"
?disabled="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
</div>
<div class="submit-button">
<dbp-loading-button
type="is-primary"
id="submit-btn"
?disabled="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
</div>
</div>
`,this.loading||this.currentItem.dateSubmitted||!this.mayWrite,n.t(`show-requests.delete-button-text`),e=>{this.deleteRequest(this.currentTable,e,this.currentItem)},n.t(`show-requests.delete-button-text`),n.t(`show-requests.delete-button-text`),this.loading||this.currentItem.dateSubmitted||!this.mayWrite,n.t(`show-requests.submit-button-text`),e=>{this.submitRequest(this.currentTable,e,this.currentItem)},n.t(`show-requests.submit-button-text`),n.t(`show-requests.submit-button-text`)):``,this.currentItem?P(c||=e`
<div class="request-item details">
<div class="details header">
<div>
<div class="section-titles">
${0}
${0}
</div>
<div>
${0}
</div>
</div>
<div class="line"></div>
<div>
<div class="section-titles">
${0}
</div>
<div>
${0}
</div>
</div>
<div class="line"></div>
<div>
<div class="section-titles">
${0}
${0}
</div>
<div>
${0}
</div>
</div>
</div>
${0} ${0}
<div class="details recipients">
<div class="header-btn">
<div class="section-titles">
${0}
<span class="section-title-counts">
${0}
</span>
</div>
${0}
</div>
<div class="recipients-data">
${0}
<div
class="no-recipients ${0}">
${0}
</div>
</div>
</div>
${0}
</div>
`,n.t(`show-requests.id`),this.currentItem.dateSubmitted?``:P(l||=e`
<dbp-icon-button
id="edit-subject-btn"
?disabled="${0}"
@click="${0}"
aria-label="${0}"
title="${0}"
icon-name="pencil"></dbp-icon-button>
`,this.loading||this.currentItem.dateSubmitted||!this.mayWrite,e=>{this.subject=this.currentItem.name?this.currentItem.name:``,this._(`#tf-edit-subject-fn-dialog`).value=this.currentItem.name?this.currentItem.name:``,U.show(this._(`#edit-subject-modal`),{disableScroll:!0,onClose:e=>{}})},n.t(`show-requests.edit-subject-button-text`),n.t(`show-requests.edit-subject-button-text`)),this.currentItem.name?P(u||=e`
${0}
`,this.currentItem.name):P(d||=e`
${0}
`,this.mayReadMetadata&&!this.mayRead&&!this.mayWrite?n.t(`show-requests.metadata-subject-text`):n.t(`show-requests.no-subject-found`)),n.t(`show-requests.submit-status`),this.currentItem.dateSubmitted?P(f||=e`
${0}
`,this.checkRecipientStatus(this.currentItem.recipients)[0]):P(p||=e`
<span class="status-orange">
●
</span>
${0}
`,n.t(`show-requests.empty-date-submitted`)),n.t(`show-requests.reference-number`),this.currentItem.dateSubmitted?``:P(m||=e`
<dbp-icon-button
id="edit-reference-number-btn"
?disabled="${0}"
@click="${0}"
aria-label="${0}"
title="${0}"
icon-name="pencil"></dbp-icon-button>
`,this.loading||this.currentItem.dateSubmitted||!this.mayWrite,e=>{this._(`#tf-edit-reference-number-fn-dialog`).value=this.currentItem.referenceNumber??``,U.show(this._(`#edit-reference-number-modal`),{disableScroll:!0,onClose:e=>{}})},n.t(`show-requests.edit-reference-number-button-text`),n.t(`show-requests.edit-reference-number-button-text`)),this.currentItem.referenceNumber?P(h||=e`
${0}
`,this.currentItem.referenceNumber):P(g||=e`
${0}
`,n.t(`show-requests.empty-reference-number`)),this.addSubHeader(),this.addSenderDetails(),n.t(`show-requests.recipients`),this.currentItem.recipients.length===0?``:`(`+this.currentItem.recipients.length+`)`,this.currentItem.dateSubmitted?``:P(_||=e`
<dbp-loading-button
id="add-recipient-btn"
?disabled="${0}"
value="${0}"
@click="${0}"
title="${0}">
${0}
</dbp-loading-button>
`,this.loading||this.currentItem.dateSubmitted||!this.mayWrite,n.t(`show-requests.add-recipient-button-text`),e=>{this.currentRecipient={},U.show(this._(`#add-recipient-modal`),{disableScroll:!0,onClose:e=>{}})},n.t(`show-requests.add-recipient-button-text`),n.t(`show-requests.add-recipient-button-text`)),this.sortRecipients(this.currentItem.recipients).map(t=>P(v||=e`
<div class="recipient card">
${0}
<div class="right-side">
<dbp-icon-button id="show-recipient-btn"
@click="${0}"
aria-label="${0}"
title="${0}"
icon-name="keyword-research"></dbp-icon></dbp-icon-button>
${0}
</div>
</div>`,this.addRecipientCardLeftSideContent(t),e=>{let n=e.target;n.start(),this.currentRecipient=t;try{this.fetchDetailedRecipientInformation(t.identifier).then(()=>{U.show(this._(`#show-recipient-modal`),{disableScroll:!0,onShow:e=>{this.button=n},onClose:e=>{this.currentRecipient={},n.stop()}})})}catch{n.stop()}finally{n.stop()}},n.t(`show-requests.show-recipient-button-text`),n.t(`show-requests.show-recipient-button-text`),this.currentItem.dateSubmitted?``:P(y||=e`
<dbp-icon-button
id="edit-recipient-btn"
?disabled="${0}"
@