@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
568 lines (508 loc) • 42.5 kB
JavaScript
let e,t,i,s,a,n,r,d,l,o,c,h,u,p,b=e=>e;function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},m.apply(null,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
* @popperjs/core: MIT
* tippy.js: MIT
* @dbp-toolkit/tooltip: LGPL-2.1-or-later
*/}import{D as g,c as w,A as v,I as f,C as $,P as q,g as y,a as x,M as I,n as R}from"./shared/package.CT4hBw5M.es.js";import{S,I as L,M as k,L as _,q as C,s as j,i as D,g as V,b as F,n as A,h as z,r as N,t as T,j as P,u as B,v as E,p as W,x as M,e as O,m as U}from"./shared/notification.DnuvYrJ4.es.js";import{F as G,R as H,T as Y}from"./shared/live.CFjPxCNs.es.js";import"./shared/i18n.DfSNzjaz.es.js";var J={element:"dbp-create-request",module_src:"dbp-create-request.js",routing_name:"create-request",name:{de:"Versandauftrag erstellen",en:"Create dispatch order"},short_name:{de:"Versandauftrag erstellen",en:"Create dispatch order"},description:{de:"Erlaubt das Erstellen neuer Versandaufträge.",en:"Allows the creation of new dispatch orders."},subscribe:"lang,lang-dir,entry-point-url,auth,html-overrides,nextcloud-web-app-password-url,nextcloud-webdav-url,nextcloud-name,nextcloud-file-url,file-handling-enabled-targets"};class K extends(S(g)){constructor(){super(),this._i18n=w(),this.lang=this._i18n.language,this.activity=new v(J),this.entryPointUrl="",this.requestList=[],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="",this.subject="",this.groupId="",this.mayRead=!1,this.mayWrite=!1,this.mayReadMetadata=!1,this.organizationLoaded=!1,this.showDetailsView=!1,this.showListView=!1,this.hasEmptyFields=!1,this.hasSender=!1,this.hasRecipients=!1,this.requestCreated=!1,this.singleFileProcessing=!1,this.createRequestsLoading=!1,this.fileList=[],this.createdRequestsIds=[],this.createdRequestsList=[],this.totalNumberOfCreatedRequestItems=0,this.filesAdded=!1,this.expanded=!1,this.addFileViaButton=!1,this.errorCreatingRequest=!1,this.fileHandlingEnabledTargets="local",this.nextcloudWebAppPasswordURL="",this.nextcloudWebDavURL="",this.nextcloudName="",this.nextcloudFileURL="",this.nextcloudAuthInfo="",this.dispatchRequestsTable=null,this.totalNumberOfItems=0,this.rowsSelected=!1,this.fileUploadFinished=!0,this.uploadedNumberOfFiles=0,this.boundSelectHandler=this.selectAllFiles.bind(this),this.langDir=void 0,this.loadingTranslations=!1,this.tableLoading=!1}static get scopedElements(){return{"dbp-icon":L,"dbp-mini-spinner":k,"dbp-loading-button":_,"dbp-icon-button":C,"dbp-inline-notification":f,"dbp-file-source":G,"dbp-person-select":$,"dbp-resource-select":H,"dbp-pdf-viewer":q}}static get properties(){return m({},super.properties,{lang:{type:String},entryPointUrl:{type:String,attribute:"entry-point-url"},currentItem:{type:Object,attribute:!1},currentRecipient:{type:Object,attribute:!1},subject:{type:String,attribute:!1},groupId:{type:String,attribute:!1},emptyFieldsGiven:{type:Boolean,attribute:!1},showDetailsView:{type:Boolean,attribute:!1},hasSender:{type:Boolean,attribute:!1},hasRecipients:{type:Boolean,attribute:!1},requestCreated:{type:Boolean,attribute:!1},organization:{type:String,attribute:!1},organizationId:{type:String,attribute:!1},mayWrite:{type:Boolean,attribute:!1},mayRead:{type:Boolean,attribute:!1},mayReadMetadata:{type:Boolean,attribute:!1},organizationLoaded:{type:Boolean,attribute:!1},rowsSelected:{type:Boolean,attribute:!1},totalNumberOfCreatedRequestItems:{type:Number,attribute:!1},filesAdded:{type:Boolean,attribute:!1},createRequestsLoading:{type:Boolean,attribute:!1},expanded:{type:Boolean,attribute:!1},fileUploadFinished:{type:Boolean,attribute:!1},uploadedNumberOfFiles:{type:Number,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"},tableLoading:{type:Boolean,attribute:!1}})}update(e){e.forEach(((e,t)=>{if("lang"===t)this._i18n.changeLanguage(this.lang),this.dispatchRequestsTable&&this.dispatchRequestsTable.setLocale(this.lang)})),super.update(e)}disconnectedCallback(){this.dispatchRequestsTable.off("rowClick"),this.dispatchRequestsTable.off("dataLoaded"),this.dispatchRequestsTable.off("pageLoaded"),super.disconnectedCallback()}connectedCallback(){if(super.connectedCallback(),this._loginStatus="",this._loginState=[],this._loginCalled=!1,this.langDir){this.loadingTranslations=!0;const e=this;j(e._i18n,e).then((()=>{e.loadingTranslations=!1,e.requestUpdate()}))}else this.loadingTranslations=!1;this.updateComplete.then((()=>{let e=this._(".tabulator-paginator");const t=this._i18n,i=this;this.dispatchRequestsTable=new Y(this._("#dispatch-requests-table"),{layout:"fitColumns",placeholder:t.t("show-requests.no-table-data"),selectableRows:!0,selectableRowsPersistence:!1,responsiveLayout:"collapse",responsiveLayoutCollapseStartOpen:!1,pagination:!0,paginationSize:10,paginationSizeSelector:!0,paginationElement:e,columnHeaderVertAlign:"bottom",columnDefaults:{vertAlign:"middle",hozAlign:"left",resizable:!1},columns:[{title:'<label id="select_all_wrapper" class="button-container select-all-icon"><input type="checkbox" id="select_all" name="select_all" value="select_all"><span class="checkmark" id="select_all_checkmark"></span></label>',field:"type",hozAlign:"center",width:40,headerSort:!1,responsive:0,widthGrow:1,headerClick:e=>{i.checkAllSelected()?(this.dispatchRequestsTable.deselectRow(),this._("#select_all").checked=!1,this.rowsSelected=!1):(i.dispatchRequestsTable.selectRow("visible"),this._("#select_all").checked=!0,this.rowsSelected=!0),e.preventDefault()}},{title:t.t("show-requests.table-header-details"),field:"details",hozAlign:"center",width:60,headerSort:!1,responsive:0,widthGrow:1,formatter:"responsiveCollapse"},{title:t.t("show-requests.table-header-date-created"),field:"dateCreated",responsive:1,widthGrow:1,minWidth:160,sorter:(e,t)=>Date.parse(e)-Date.parse(t),formatter:function(e){const t=Date.parse(e.getValue()),i=new Date(t),s=i.getFullYear(),a=("0"+(i.getMonth()+1)).slice(-2);return("0"+i.getDate()).slice(-2)+"."+a+"."+s+" "+("0"+i.getHours()).slice(-2)+":"+("0"+i.getMinutes()).slice(-2)}},{title:t.t("show-requests.table-header-gz"),field:"gz",responsive:2,widthGrow:3,minWidth:100,formatter:"html"},{title:t.t("show-requests.table-header-subject"),field:"subject",responsive:2,widthGrow:3,minWidth:150,formatter:"html"},{title:"Status",field:"status",responsive:2,widthGrow:1,minWidth:120,formatter:"html"},{title:t.t("show-requests.table-header-files"),field:"files",responsive:8,minWidth:800,formatter:function(e){return e.getValue()}},{title:t.t("show-requests.table-header-recipients"),field:"recipients",responsive:8,minWidth:800,formatter:function(e){return e.getValue()}},{title:t.t("show-requests.date-submitted"),field:"dateSubmitted",responsive:8,minWidth:150,formatter:function(e){return e.getValue()}},{title:t.t("show-requests.table-header-id"),field:"requestId",responsive:8,minWidth:150,formatter:function(e){return e.getValue()}},{title:"",field:"controls",minWidth:140,widthGrow:1,headerSort:!1,responsive:1,formatter:e=>e.getValue()}],langs:{en:{columns:{dateCreated:"Date created",subject:"Subject",gz:"Reference number",files:"Files",recipients:"Recipients",requestId:"Request-ID"},pagination:{page_size:"Page size",page_size_title:"Page size",first:'<span class="mobile-hidden">First</span>',first_title:"First Page",last:'<span class="mobile-hidden">Last</span>',last_title:"Last Page",prev:'<span class="mobile-hidden">Prev</span>',prev_title:"Prev Page",next:'<span class="mobile-hidden">Next</span>',next_title:"Next Page"}},de:{columns:{dateCreated:"Erstelldatum",subject:"Betreff",gz:"Geschäftszahl",files:"Angehängte Dateien",recipients:"Empfänger",requestId:"Auftrags-ID"},pagination:{page_size:"Einträge pro Seite",page_size_title:"Einträge pro Seite",first:'<span class="mobile-hidden">Erste</span>',first_title:"Erste Seite",last:'<span class="mobile-hidden">Letzte</span>',last_title:"Letzte Seite",prev:'<span class="mobile-hidden">Vorherige</span>',prev_title:"Vorherige Seite",next:'<span class="mobile-hidden">Nächste</span>',next_title:"Nächste Seite"}}},initialSort:[{column:"dateCreated",dir:"desc"}]}),this.dispatchRequestsTable.on("rowClick",this.rowClickFunction.bind(this)),this.dispatchRequestsTable.on("dataLoaded",this.dataLoadedFunction.bind(this)),this.dispatchRequestsTable.on("pageLoaded",this.pageLoadedFunction.bind(this))}))}async _onCreateRequestButtonClicked(e){this.openFileSource()}getCurrentTime(){let e=new Date;return("0"+(e.getHours()+1)).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)}saveRequest(){this.currentItem={},this.currentItem.senderOrganizationName="",this.currentItem.senderFullName="",this.currentItem.senderAddressCountry="",this.currentItem.senderPostalCode="",this.currentItem.senderAddressLocality="",this.currentItem.senderStreetAddress="",this.currentItem.senderBuildingNumber="",this.currentItem.files=[],this.currentItem.recipients=[],this.currentRecipient={},this.subject="",this.hasEmptyFields=!1,this.hasSender=!1,this.hasRecipients=!1,this.expanded=!1,this.showListView=!0,this.showDetailsView=!1,this.requestCreated=!1;let e=this.dispatchRequestsTable?this.dispatchRequestsTable.getPage():1;this.getCreatedDispatchRequests().then((()=>{this.dispatchRequestsTable&&this.dispatchRequestsTable.setPage(e),this.showDetailsView=!1,this.showListView=!0,this.requestCreated=!1}))}checkMultipleRequestsCheckmark(){this.singleFileProcessing=!(this._("#multiple-requests-button")&&this._("#multiple-requests-button").checked)}static get styles(){return D(e||(e=b`
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
h2:first-child {
margin-top: 0;
}
h2 {
margin-bottom: 10px;
}
#multiple-requests-checkbox {
margin-top: 1rem;
margin-bottom: 1.5rem;
}
.multiple-requests {
height: 18px;
width: 18px;
top: 0;
left: 0;
}
.button-container input[type='checkbox']:checked ~ .multiple-requests::after {
top: 1px;
left: 6px;
}
.choose-and-create-btns {
display: flex;
gap: 5px;
}
.choose-and-create-btns dbp-resource-select {
width: 30em;
margin-top: 1px;
}
.control.table {
padding-top: 1.5rem;
font-size: 1.5rem;
text-align: center;
}
.muted {
color: var(--dbp-override-muted);
}
.table-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
}
.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.5em 0 0.5em 16px;*/
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;
}
.table-wrapper {
display: block;
}
.selected-buttons {
flex-direction: row-reverse;
}
#select_all_checkmark {
top: 7px;
}
only screen and (orientation: portrait) and (max-width: 768px) {
.multiple-requests {
top: 10%;
}
.choose-and-create-btns {
display: flex;
flex-direction: column;
}
.choose-and-create-btns dbp-resource-select {
width: unset;
}
.selected-buttons {
flex-direction: column;
}
.edit-selection-buttons {
gap: 5px;
}
#expand-all-btn,
#collapse-all-btn {
padding: 0;
}
.table-wrapper {
padding-top: 1em;
}
.tabulator-header {
padding-top: 0;
}
}
`),V(),F(!1),A(),z(),N(),T(),P(),B(),E(),y(),x())}render(){const e=this._i18n,m=W(R,"tabulator-tables/css/tabulator.min.css");return M(t||(t=b`
<link rel="stylesheet" href="${0}" />
<div
class="control ${0}">
<span class="loading">
<dbp-mini-spinner text=${0}></dbp-mini-spinner>
</span>
</div>
<dbp-inline-notification
class="${0}"
type="warning"
body="${0}"></dbp-inline-notification>
<div
class="${0}">
<h2>${0}</h2>
<p class="subheadline">
<slot name="description">${0}</slot>
</p>
<slot name="activity-description">
<p>${0}</p>
</slot>
<dbp-inline-notification
class="${0}"
type="warning"
body="${0}"></dbp-inline-notification>
<div class="${0}">
${0}
<div class="choose-and-create-btns">
<dbp-resource-select
id="create-resource-select"
subscribe="lang,entry-point-url,auth"
lang="${0}"
resource-path="dispatch/groups"
value="${0}"
=${0}></dbp-resource-select>
<dbp-loading-button
id="create-btn"
type="is-primary"
value="${0}"
="${0}"
title="${0}"
?disabled="${0}"
class="${0}"></dbp-loading-button>
</div>
<label id="multiple-requests-checkbox" class="button-container">
${0}
<input
type="checkbox"
id="multiple-requests-button"
name="multiple-requests-button"
value="multiple-requests-button"
="${0}"
checked />
<span
class="multiple-requests checkmark"
id="multiple-requests-button-checkmark"></span>
</label>
</div>
<div class="no-access-notification">
<dbp-inline-notification
class="${0}"
type="danger"
body="${0}"></dbp-inline-notification>
</div>
<div class="back-container">
<span
class="back-navigation ${0}">
<a
href="#"
title="${0}"
="${0}">
<dbp-icon name="chevron-left"></dbp-icon>
${0}
</a>
</span>
<span
class="back-navigation ${0}">
<a
href="#"
title="${0}"
="${0}">
<dbp-icon name="chevron-left"></dbp-icon>
${0}
</a>
</span>
</div>
<h3
class="${0}">
${0}:
</h3>
<div
class="${0}">
<div class="table-wrapper">
<div class="selected-buttons">
<div
class="edit-selection-buttons ${0}">
<dbp-loading-button
id="expand-all-btn"
class="${0}"
?disabled="${0}"
value="${0}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="collapse-all-btn"
class="${0}"
?disabled="${0}"
value="${0}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
${0}
</div>
</div>
<div
class="control table ${0}">
<span class="loading">
<dbp-mini-spinner
text=${0}></dbp-mini-spinner>
</span>
</div>
<div
class="dispatch-table ${0}">
<div id="dispatch-requests-table" class=""></div>
<div class="tabulator" id="custom-pagination">
<div class="tabulator-footer">
<div class="tabulator-footer-contents">
<span class="tabulator-paginator"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="${0}">
${0}
${0}
</div>
</div>
${0}
${0}
${0}
${0}
${0}
${0}
${0}
${0}
<div class="modal micromodal-slide" id="add-subject-modal" aria-hidden="true">
<div class="modal-overlay" tabindex="-2" data-micromodal-close>
<div
class="modal-container"
id="add-subject-modal-box"
role="dialog"
aria-modal="true"
aria-labelledby="add-subject-modal-title">
<header class="modal-header">
<h3 id="add-subject-modal-title">
${0}
</h3>
<button
title="${0}"
class="modal-close"
aria-label="Close modal"
="${0}">
<dbp-icon
title="${0}"
name="close"
class="close-icon"></dbp-icon>
</button>
</header>
<main class="modal-content" id="add-subject-modal-content">
<div class="modal-content-item">
<div>
<input
type="text"
class="input"
name="tf-add-subject-fn-dialog"
id="tf-add-subject-fn-dialog"
value="${0}"
="${0}" />
</div>
</div>
<div class="modal-content-item">
<div>${0}</div>
</div>
</main>
<footer class="modal-footer">
<div class="modal-footer-btn">
<button
class="button"
data-micromodal-close
aria-label="Close this dialog window"
="${0}">
${0}
</button>
<button
class="button select-button is-primary"
id="add-subject-confirm-btn"
="${0}">
${0}
</button>
</div>
</footer>
</div>
</div>
</div>
`),m,O({hidden:this.isLoggedIn()||!this.isLoading()||!this.loadingTranslations}),e.t("loading-message"),O({hidden:this.isLoggedIn()||this.isLoading()||this.loadingTranslations}),e.t("error-login-message"),O({hidden:!this.isLoggedIn()||this.isLoading()||this.loadingTranslations}),this.activity.getName(this.lang),this.activity.getDescription(this.lang),e.t("create-request.description-text"),O({hidden:!this.hasEmptyFields}),e.t("create-request.empty-fields-given"),O({hidden:this.showDetailsView||this.requestCreated}),e.t("show-requests.organization-select-description"),this.lang,this.groupValue,(e=>{this.processSelectedSender(e)}),e.t("create-request.create-request-button-text"),(e=>{this._onCreateRequestButtonClicked(e)}),e.t("create-request.create-request-button-text"),!this.mayWrite,O({hidden:this.showDetailsView}),e.t("create-request.multiple-requests-text"),this.checkMultipleRequestsCheckmark,O({hidden:!this.isLoggedIn()||this.isLoading()||this.mayWrite||this.requestCreated||!this.organizationLoaded}),this.mayRead||this.mayReadMetadata?e.t("create-request.error-no-writes"):e.t("error-no-read"),O({hidden:!this.isLoggedIn()||this.isLoading()||!this.requestCreated||!this.singleFileProcessing&&this.showDetailsView}),e.t("create-request.back-to-create"),(e=>{this.currentItem={},this.currentItem.senderOrganizationName="",this.currentItem.senderFullName="",this.currentItem.senderAddressCountry="",this.currentItem.senderPostalCode="",this.currentItem.senderAddressLocality="",this.currentItem.senderStreetAddress="",this.currentItem.senderBuildingNumber="",this.currentItem.files=[],this.currentItem.recipients=[],this.currentRecipient={},this.subject="",this.hasEmptyFields=!1,this.hasSender=!1,this.hasRecipients=!1,this.expanded=!1,this.showListView=!1,this.showDetailsView=!1,this.requestCreated=!1,this.addFileViaButton=!1}),e.t("create-request.back-to-create"),O({hidden:!this.isLoggedIn()||this.isLoading()||!this.requestCreated||this.singleFileProcessing||this.showListView}),e.t("show-requests.back-to-list"),(e=>{this.getCreatedDispatchRequests(),this.showDetailsView=!1,this.showListView=!0,this.subject=""}),e.t("show-requests.back-to-list"),O({hidden:!this.isLoggedIn()||this.isLoading()||!this.showDetailsView}),e.t("create-request.create-dispatch-order"),O({hidden:!this.isLoggedIn()||this.isLoading()||this.showDetailsView||!this.showListView}),O({hidden:!this.isLoggedIn()||this.isLoading()||this.showDetailsView}),O({hidden:this.expanded}),this.loading,e.t("show-requests.expand-all"),(e=>{this.expandAll(e)}),e.t("show-requests.expand-all"),e.t("show-requests.expand-all"),O({hidden:!this.expanded}),this.loading,e.t("show-requests.collapse-all"),(e=>{this.collapseAll(e)}),e.t("show-requests.collapse-all"),e.t("show-requests.collapse-all"),this.mayWrite?M(i||(i=b`
<dbp-loading-button
id="delete-all-btn"
?disabled="${0}"
value="${0}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
<dbp-loading-button
id="submit-all-btn"
type="is-primary"
?disabled="${0}"
value="${0}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
`),this.loading||!this.rowsSelected,e.t("show-requests.delete-button-text"),(e=>{this.deleteSelected(e)}),e.t("show-requests.delete-button-text"),e.t("show-requests.delete-button-text"),this.loading||!this.rowsSelected,e.t("show-requests.submit-button-text"),(e=>{this.submitSelected(e)}),e.t("show-requests.submit-button-text"),e.t("show-requests.submit-button-text")):"",O({hidden:!this.createRequestsLoading&&this.fileUploadFinished&&!this.tableLoading}),e.t("show-requests.loading-table-message"),O({hidden:!this.isLoggedIn()||this.isLoading()||this.showDetailsView||!this.showListView||this.createRequestsLoading||this.tableLoading}),O({hidden:!this.isLoggedIn()||this.isLoading()||!this.showDetailsView}),this.currentItem&&!this.currentItem.dateSubmitted?M(s||(s=b`
<div class="request-buttons">
<div class="edit-buttons">
<dbp-loading-button
id="delete-btn"
?disabled="${0}"
value="${0}"
="${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}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
</div>
</div>
`),this.loading||this.currentItem.dateSubmitted,e.t("show-requests.delete-button-text"),(e=>{this.deleteRequest(e,this.currentItem)}),e.t("show-requests.delete-button-text"),e.t("show-requests.delete-button-text"),this.loading||this.currentItem.dateSubmitted,e.t("show-requests.submit-button-text"),(e=>{this.submitRequest(e,this.currentItem)}),e.t("show-requests.submit-button-text"),e.t("show-requests.submit-button-text")):"",this.currentItem?M(a||(a=b`
<div
class="request-item details ${0}">
<div class="details header">
<div>
<div class="section-titles">
${0}
${0}
</div>
<div>${0}</div>
<div
class="no-subject ${0}">
${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}
<div
class="details recipients ${0}">
<div class="header-btn">
<div class="section-titles">
${0}
<span class="section-title-counts">
${0}
</span>
</div>
${0}
</div>
<div
class="recipients-data ${0}">
${0}
<div
class="no-recipients ${0}">
${0}
</div>
</div>
</div>
${0}
</div>
`),O({hidden:!this.showDetailsView}),e.t("create-request.request-subject"),!this.currentItem.dateSubmitted&&this.hasSender?M(n||(n=b`
<dbp-icon-button
id="edit-subject-btn"
?disabled="${0}"
="${0}"
aria-label="${0}"
title="${0}"
icon-name="pencil"></dbp-icon-button>
`),this.loading||this.currentItem.dateSubmitted,(e=>{this.subject=this.currentItem.name?this.currentItem.name:"",this._("#tf-edit-subject-fn-dialog").value=this.currentItem.name?this.currentItem.name:"",I.show(this._("#edit-subject-modal"),{disableScroll:!0,onClose:e=>{this.loading=!1}})}),e.t("show-requests.edit-subject-button-text"),e.t("show-requests.edit-subject-button-text")):"",this.currentItem.name,O({hidden:!this.isLoggedIn()||this.currentItem.name||""!==this.currentItem.name}),e.t("show-requests.empty-subject-text"),e.t("show-requests.submit-status"),this.currentItem.dateSubmitted?M(r||(r=b`
<span class="status-green">●</span>
${0}
`),e.t("show-requests.status-completed-date",{date:this.convertToReadableDate(this.currentItem.dateSubmitted)})):M(d||(d=b`
<span class="status-orange">●</span>
${0}
`),e.t("show-requests.empty-date-submitted")),e.t("show-requests.reference-number"),this.currentItem.dateSubmitted?"":M(l||(l=b`
<dbp-icon-button
id="edit-reference-number-btn"
?disabled="${0}"
="${0}"
aria-label="${0}"
title="${0}"
icon-name="pencil"></dbp-icon-button>
`),this.loading||this.currentItem.dateSubmitted||!this.mayWrite,(e=>{var t;this._("#tf-edit-reference-number-fn-dialog").value=null!=(t=this.currentItem.referenceNumber)?t:"",I.show(this._("#edit-reference-number-modal"),{disableScroll:!0,onClose:e=>{this.loading=!1}})}),e.t("show-requests.edit-reference-number-button-text"),e.t("show-requests.edit-reference-number-button-text")),this.currentItem.referenceNumber?M(o||(o=b`
${0}
`),this.currentItem.referenceNumber):M(c||(c=b`
${0}
`),e.t("show-requests.empty-reference-number")),this.addSenderDetails(),O({hidden:!this.hasSender||!this.hasSubject}),e.t("show-requests.recipients"),0!==this.currentItem.recipients.length?"("+this.currentItem.recipients.length+")":"",this.currentItem.dateSubmitted?"":M(h||(h=b`
<dbp-loading-button
id="add-recipient-btn"
?disabled="${0}"
value="${0}"
="${0}"
title="${0}">
${0}
</dbp-loading-button>
`),this.loading||this.currentItem.dateSubmitted,e.t("show-requests.add-recipient-button-text"),(e=>{this.preloadSelectedRecipient().then((()=>{I.show(this._("#add-recipient-modal"),{disableScroll:!0,disableFocus:!1,onClose:e=>{this.loading=!1,this._("#add-recipient-btn").stop()}})}))}),e.t("show-requests.add-recipient-button-text"),e.t("show-requests.add-recipient-button-text")),O({hidden:!this.hasSender||!this.hasSubject}),this.sortRecipients(this.currentItem.recipients).map((t=>M(u||(u=b`
<div class="recipient card">
${0}
<div class="right-side">
<dbp-icon-button id="show-recipient-btn"
="${0}"
title="${0}"
aria-label="${0}"
icon-name="keyword-research"></dbp-icon></dbp-icon-button>
${0}
</div>
</div>
`),this.addRecipientCardLeftSideContent(t),(e=>{let i=e.target;i.start(),this.currentRecipient=t;try{this.fetchDetailedRecipientInformation(t.identifier).then((()=>{I.show(this._("#show-recipient-modal"),{disableScroll:!0,onShow:e=>{this.button=i},onClose:e=>{this.loading=!1,this.currentRecipient={},i.stop()}})}))}catch(e){i.stop()}}),e.t("show-requests.show-recipient-button-text"),e.t("show-requests.show-recipient-button-text"),this.currentItem.dateSubmitted?"":M(p||(p=b`
<dbp-icon-button
id="edit-recipient-btn"
?disabled="${0}"
="${0}"
title="${0}"
aria-label="${0}"
icon-name="pencil"></dbp-icon-button>
<dbp-icon-button
id="delete-recipient-btn"
?disabled="${0}"
="${0}"
aria-label="${0}"
title="${0}"
icon-name="trash"></dbp-icon-button>
`),this.loading||this.currentItem.dateSubmitted||t.personIdentifier&&(t.electronicallyDeliverable||t.postalDeliverable),(e=>{let i=e.target;i.start(),this.currentRecipient=t;try{this.fetchDetailedRecipientInformation(t.identifier).then((()=>{this._("#edit-recipient-country-select").value=this.currentRecipient.addressCountry,this._("#tf-edit-recipient-birthdate-day").value=this.currentRecipient.birthDateDay,this._("#tf-edit-recipient-birthdate-month").value=this.currentRecipient.birthDateMonth,this._("#tf-edit-recipient-birthdate-year").value=this.currentRecipient.birthDateYear,this._("#tf-edit-recipient-gn-dialog").value=this.currentRecipient.givenName,this._("#tf-edit-recipient-fn-dialog").value=this.currentRecipient.familyName,this._("#tf-edit-recipient-pc-dialog").value=this.currentRecipient.postalCode?this.currentRecipient.postalCode:"",this._("#tf-edit-recipient-al-dialog").value=this.currentRecipient.addressLocality?this.currentRecipient.addressLocality:"",this._("#tf-edit-recipient-sa-dialog").value=this.currentRecipient.streetAddress?this.currentRecipient.streetAddress:"",I.show(this._("#edit-recipient-modal"),{disableScroll:!0,onShow:e=>{this.button=i},onClose:e=>{this.loading=!1,this.currentRecipient={}}})}))}catch(e){i.stop()}}),e.t("show-requests.edit-recipients-button-text"),e.t("show-requests.show-recipient-button-text"),this.loading||this.currentItem.dateSubmitted,(e=>{this.deleteRecipient(e,t)}),e.t("show-requests.delete-recipient-button-text"),e.t("show-requests.delete-recipient-button-text"))))),O({hidden:!this.isLoggedIn()||!this.hasSender||!this.hasSubject||0!==this.currentItem.recipients.length}),e.t("show-requests.no-recipients-text"),this.addDetailedFilesView()):"",this.addFilePicker(),this.addEditSenderModal(this.currentItem),this.addAddRecipientModal(),this.addEditRecipientModal(),this.addShowRecipientModal(),this.addEditSubjectModal(),this.addEditReferenceNumberModal(),this.addFileViewerModal(),e.t("create-request.empty-subject"),e.t("show-requests.modal-close"),(()=>{I.close(this._("#add-subject-modal"))}),e.t("show-requests.modal-close"),this.subject?this.subject:"",(()=>{}),e.t("show-requests.add-subject-description"),(()=>{I.close(this._("#add-subject-modal"))}),e.t("show-requests.edit-recipient-dialog-button-cancel"),(()=>{I.close(this._("#add-subject-modal")),this.confirmAddSubject()}),e.t("show-requests.add-subject-dialog-button-ok"))}}U("dbp-create-request",K);
//# sourceMappingURL=dbp-create-request.js.map