UNPKG

@digital-blueprint/formalize-app

Version:

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

616 lines • 60.5 kB
/*!
* License: LGPL-2.1-or-later
* Dependencies:
* 
* @webcomponents/scoped-custom-element-registry: BSD-3-Clause
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* lit-html: BSD-3-Clause
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/auth: 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
* cssfilter: MIT
* xss: MIT
* @dbp-toolkit/form-elements: LGPL-2.1-or-later
* html2pdf.js: MIT
* exceljs: MIT
* jspdf-autotable: MIT
* keycloak-js: Apache-2.0
* pdfjs-dist: Apache-2.0
* jszip: (MIT OR GPL-3.0-or-later)
* @babel/runtime: MIT
* fflate: MIT
* iobuffer: MIT
* pako: (MIT AND Zlib)
* fast-png: MIT
* jspdf: MIT
* core-js: MIT
* performance-now: MIT
* raf: MIT
* rgbcolor: MIT OR SEE LICENSE IN FEEL-FREE.md
* svg-pathdata: MIT
* stackblur-canvas: MIT
* canvg: MIT
* dompurify: (MPL-2.0 OR Apache-2.0)
* i18next: MIT
* @dbp-toolkit/common: LGPL-2.1-or-later
* @lit/reactive-element: BSD-3-Clause
* lit-element: BSD-3-Clause
* @open-wc/dedupe-mixin: MIT
* @open-wc/scoped-elements: MIT
* dialog-polyfill: BSD
* jquery: MIT
* select2: MIT
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/tabulator-table: LGPL-2.1-or-later
*/
import{A as e,S as t,w as n,x as r,y as i}from"./ref.DqB7ABXf.js";import{A as a,J as o,L as s,O as c,Q as l,X as u,Z as d,c as f,et as p,g as m,j as h,k as g,l as _,p as v,s as y,v as b,w as x}from"./directive-helpers.C6Xz79AM.js";import{t as S}from"./class-map.B2bFA_il.js";import{t as C}from"./modal.DfjeZb2d.js";import{n as w,t as T}from"./tabulator-table-styles.Csmskvac.js";var E={"add-data":`Daten Hinzufügen`,"collapse-all":`Alles zuklappen`,columns:{age:`Alter`,all:`Alle spalten`,col:`Lieblingsfarbe`,contains:`enthält`,delete:`Löschen`,details:`Details`,dob:`Geburtsdatum`,ends:`endet mit`,keywords:`Stichwörter`,license:`Führerschein: `,name:`Name`,starts:`startet mit`},"delete-rows":`Asugewählte Zeilen löschen`,"demo-column-configuration-description":`Mit der Schaltfläche für Einstellungen können Spalten neu angeordnet oder ein- und ausgeblendet werden. Die Konfiguration wird für diese Demotabelle gespeichert.`,"demo-column-configuration-in-header":`Tabellenkonfiguration im Tabellenkopf anzeigen`,"demo-column-configuration-title":`Tabulator-Tabelle - Spaltenkonfiguration`,"demo-title":`Tabulator Table Demo`,"deselect-all":`Alles abwählen`,download:`Herunterladen`,"expand-all":`Alles aufklappen`,"file-format":`Dateityp: `,filter:`Tabelle filtern`,"new-age":`neue Alter`,"remove-filters":`Filtern entfernen`,"search-bar":`Suchen`,"select-all":`Alles auswählen`,"select-column":`Spalte auswählen:`,"select-operator":`Zeichen auswählen:`,"tabulator-table":{"column-configuration":{cancel:`Abbrechen`,"hide-all":`Alle ausblenden`,"hide-column":`{{column}} ausblenden`,"move-down":`{{column}} nach unten verschieben`,"move-up":`{{column}} nach oben verschieben`,open:`Tabellenkonfiguration`,"open-description":`Konfigurieren Sie, welche Spalten angezeigt werden sollen`,reset:`Zurücksetzen`,save:`Speichern`,"show-all":`Alle einblenden`,"show-column":`{{column}} einblenden`,title:`Spalteneinstellungen`},"download-error-message":`Beim Export ist ein Fehler aufgetreten.`,"download-success-message":`Erfolgreich exportiert. Überprüfen Sie Ihren Download-Ordner auf die exportierten Dateien.`,"error-title":`Fehler`,"loading-table-data":`Tabellendaten werden geladen`,sort:{action:`sortieren`,ascending:`Nach {{column}} aufsteigend sortiert`,descending:`Nach {{column}} absteigend sortiert`,none:`Sortierung aufgehoben`},"success-title":`Erfolg`,"unsupported-type-error-message":`Nicht unterstützter Exporttyp`},"update-rows":`Zeilen aktualisieren`},D={"add-data":`Add data`,"collapse-all":`Collapse all`,columns:{age:`Age`,all:`All columns`,col:`Favourite Color`,contains:`contains`,delete:`Delete`,details:`Details`,dob:`Date Of Birth`,ends:`ends with`,keywords:`keywords`,license:`Driving License: `,name:`Name`,starts:`starts with`},"delete-rows":`Delete selected rows`,"demo-column-configuration-description":`Use the settings button to reorder columns or change their visibility. The configuration is persisted for this demo table.`,"demo-column-configuration-in-header":`Show table configuration in the table header`,"demo-column-configuration-title":`Tabulator table - Column Configuration`,"demo-title":`Tabulator Table Demo`,"deselect-all":`Deselect all`,download:`Download`,"expand-all":`Expand all`,"file-format":`File format: `,filter:`Filter table`,"new-age":`new age`,"remove-filters":`Remove filters`,"search-bar":`Search`,"select-all":`Select all`,"select-column":`Select column:`,"select-operator":`Select operator:`,"tabulator-table":{"column-configuration":{cancel:`Cancel`,"hide-all":`Hide all`,"hide-column":`Hide {{column}}`,"move-down":`Move {{column}} down`,"move-up":`Move {{column}} up`,open:`Table configuration`,"open-description":`Configure which columns to display`,reset:`Reset`,save:`Save`,"show-all":`Show all`,"show-column":`Show {{column}}`,title:`Column settings`},"download-error-message":`Something went wrong during the export.`,"download-success-message":`Successful export. Check your download folder for the exported files.`,"error-title":`Error`,"loading-table-data":`Loading table data`,sort:{action:`sort`,ascending:`Sorted by {{column}} ascending`,descending:`Sorted by {{column}} descending`,none:`Sorting removed`},"success-title":`Success`,"unsupported-type-error-message":`Unsupported export type`},"update-rows":`Update rows`};function O(){return l({en:D,de:E},`de`,`en`)}var k=`@dbp-toolkit/tabulator-table`;async function A(e,t,n){let r=e.getLang(),i=e.getColumns(),a=[],o=[];for(let e of i){let t=e.getDefinition();if(t.formatter===`rowSelection`||!e.isVisible())continue;let n=e.getField();if(n!==`empty`&&n!==`undefined`&&t.formatter!==`html`){a.push(n);let e=r?.columns?.[n]||t.title||n;o.push(e)}}let s=[];for(let e of t){let t=[];a.forEach(n=>{let r=e[n]==null?`-`:e[n];Array.isArray(r)&&(r=r.join(`, `)),t.push(r)}),s.push(t)}let c=(await import(`./jspdf.es.min.CB-v_k3k.js`)).default,l=(await import(`./jspdf.plugin.autotable.RfpJFRLq.js`)).default,u=new c(`l`,`pt`);l(u,{head:[o],body:s,horizontalPageBreak:!1,tableWidth:`auto`,styles:{overflow:`linebreak`,valign:`middle`,cellWidth:`auto`},headStyles:{},bodyStyles:{overflow:`linebreak`}}),u.save(n+`.pdf`)}async function j(t,n){let r=t[0]?.getTable?.()?.getLang?.(),i=[];for(let e of t){let t=e.getCells(),n={};for(let e of t){let t=e.getColumn().getDefinition();if(t.field===`rowIndex`||t.visible===!1)continue;let i=e.getField();if(i!==`empty`&&i!==`undefined`&&t.formatter!==`html`){let a=e.getValue();`formatter`in t&&typeof t.formatter==`function`&&(a=t.formatter(e,t.formatterParams||{},null));let o=r?.columns?.[i]||t.title||i;if(!o&&!a)continue;n[o]=a}}i.push(n)}let a=new(await(import(`./exceljs.min.B83rqaiQ.js`).then(t=>/* @__PURE__ */ e(t.default,1)))).default.Workbook,o=a.addWorksheet(n);if(i.length>0){let e=Object.keys(i[0]);o.addRow(e),i.forEach(t=>{let n=e.map(e=>t[e]||``);o.addRow(n)})}let s=await a.xlsx.writeBuffer(),c=new Blob([s],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`}),l=URL.createObjectURL(c),u=document.createElement(`a`);u.href=l,u.download=n+`.xlsx`,u.click(),URL.revokeObjectURL(l)}var M=class extends g(v){constructor(){super(),this._i18n=O(),this.lang=this._i18n.language,this.columns=[],this.defaultColumns=[],this.workingColumns=[]}static get scopedElements(){return{...super.scopedElements,"dbp-icon":a,"dbp-icon-button":t,"dbp-modal":C}}static get properties(){return{...super.properties,lang:{type:String},columns:{type:Array,attribute:!1},defaultColumns:{type:Array,attribute:!1},workingColumns:{type:Array,attribute:!1}}}get#e(){let e=this.renderRoot.querySelector(`dbp-modal`);if(!(e instanceof C))throw Error(`Column configuration modal is unavailable`);return e}update(e){e.has(`lang`)&&this._i18n.changeLanguage(this.lang),super.update(e)}async open(){this.workingColumns=this.columns.map(e=>({...e})),await this.updateComplete,this.#e.open()}close(){this.#e.close()}toggleColumn(e){this.workingColumns=this.workingColumns.map(t=>t.field===e?{...t,visible:!t.visible}:t)}toggleAll(e){this.workingColumns=this.workingColumns.map(t=>({...t,visible:e}))}reset(){this.workingColumns=this.defaultColumns.map(e=>({...e}))}moveColumn(e,t){let n=this.workingColumns[e];if(!n)return;let r=this.workingColumns.map((e,t)=>e.parentPath===n.parentPath?t:-1).filter(e=>e!==-1),i=r[r.indexOf(e)+t];if(i===void 0)return;let a=[...this.workingColumns];[a[e],a[i]]=[a[i],a[e]],this.workingColumns=a}save(){this.dispatchEvent(new CustomEvent(`column-configuration-save`,{detail:{columns:this.workingColumns.map(e=>({...e}))},bubbles:!0,composed:!0})),this.close()}canMove(e,t){let n=this.workingColumns[e];if(!n)return!1;let r=this.workingColumns.map((e,t)=>e.parentPath===n.parentPath?t:-1).filter(e=>e!==-1);return r[r.indexOf(e)+t]!==void 0}getColumnLabel(e){return e.parentTitle?`${e.parentTitle}: ${e.title}`:e.title}static get styles(){return[c(),b(),m(),u`
                dbp-modal {
                    --dbp-modal-width: 70%;
                    --dbp-modal-max-width: 700px;
                    --dbp-modal-min-width: 300px;
                    --dbp-modal-min-height: auto;
                }

                .columns {
                    box-sizing: border-box;
                    display: grid;
                    list-style: none;
                    margin: 0;
                    max-width: 100%;
                    min-width: 0;
                    padding: 0;
                    width: 100%;
                }

                .column {
                    align-items: center;
                    border: 1px solid var(--dbp-muted);
                    box-sizing: border-box;
                    color: var(--dbp-content);
                    display: flex;
                    height: 50px;
                    margin-bottom: 5px;
                    max-width: 100%;
                    min-width: 0;
                }

                .position {
                    align-items: center;
                    align-self: stretch;
                    background-color: var(--dbp-muted-surface);
                    color: var(--dbp-on-muted-surface);
                    display: flex;
                    flex: 0 0 50px;
                    font-weight: bold;
                    justify-content: center;
                }

                .title {
                    flex: 1 1 auto;
                    font-weight: 400;
                    min-width: 0;
                    overflow: hidden;
                    padding-left: 5px;
                    text-align: left;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                .group-title {
                    display: block;
                    font-size: 0.75rem;
                    opacity: 0.75;
                }

                .move-buttons {
                    align-items: center;
                    display: flex;
                    flex: 0 0 auto;
                    height: 100%;
                    padding-right: 2px;
                }

                dbp-icon-button {
                    font-size: 1.25rem;
                }

                .column > dbp-icon-button {
                    flex: 0 0 40px;
                }

                .footer {
                    box-sizing: border-box;
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                    max-width: 100%;
                    min-width: 0;
                    width: 100%;
                }

                .footer-group {
                    gap: 10px;
                    min-width: 0;
                }

                .footer-group:first-child {
                    display: grid;
                    grid-template-columns: repeat(3, minmax(0, 1fr));
                    padding-top: 10px;
                }

                .footer-group:last-child {
                    display: flex;
                    justify-content: space-between;
                }

                .footer button {
                    align-items: center;
                    box-sizing: border-box;
                    display: inline-flex;
                    max-width: 100%;
                    min-width: 0;
                }

                button dbp-icon {
                    position: static;
                    top: 0;
                    margin-right: 0.25rem;
                }

                @media only screen and (max-width: 768px) {
                    dbp-modal {
                        /* Account for the modal's 40px horizontal padding. */
                        --dbp-modal-width: calc(100vw - 80px);
                        --dbp-modal-max-width: calc(100vw - 80px);
                        --dbp-modal-min-width: 0;
                    }

                    .footer-group:first-child {
                        grid-template-columns: 1fr;
                    }

                    .footer-group:last-child {
                        align-items: stretch;
                        flex-direction: column;
                    }

                    .footer button {
                        width: 100%;
                    }
                }

                @media only screen and (max-width: 490px) {
                    dbp-modal {
                        --dbp-modal-width: calc(100vw - 60px);
                        --dbp-modal-max-width: calc(100vw - 60px);
                    }

                    .position {
                        flex-basis: 40px;
                    }

                    .column > dbp-icon-button {
                        flex-basis: 36px;
                    }

                    .move-buttons {
                        padding-right: 0;
                    }
                }
            `]}render(){let e=this._i18n;return o`
            <dbp-modal
                modal-id="tabulator-column-configuration"
                title=${e.t(`tabulator-table.column-configuration.title`)}
                sticky-footer
                subscribe="lang">
                <ul slot="content" class="columns">
                    ${this.workingColumns.map((t,n)=>o`
                            <li class="column">
                                <span class="position">${n+1}</span>
                                <span class="title" title=${this.getColumnLabel(t)}>
                                    ${t.parentTitle?o`
                                                  <span class="group-title">
                                                      ${t.parentTitle}
                                                  </span>
                                              `:``}
                                    ${t.title}
                                </span>
                                <dbp-icon-button
                                    no-spinner-on-click
                                    icon-name=${t.visible?`source_icons_eye-empty`:`source_icons_eye-off`}
                                    title=${e.t(t.visible?`tabulator-table.column-configuration.hide-column`:`tabulator-table.column-configuration.show-column`,{column:this.getColumnLabel(t)})}
                                    aria-label=${e.t(t.visible?`tabulator-table.column-configuration.hide-column`:`tabulator-table.column-configuration.show-column`,{column:this.getColumnLabel(t)})}
                                    @click=${()=>this.toggleColumn(t.field)}></dbp-icon-button>
                                <span class="move-buttons">
                                    <dbp-icon-button
                                        no-spinner-on-click
                                        icon-name="arrow-up"
                                        ?disabled=${!this.canMove(n,-1)}
                                        title=${e.t(`tabulator-table.column-configuration.move-up`,{column:this.getColumnLabel(t)})}
                                        aria-label=${e.t(`tabulator-table.column-configuration.move-up`,{column:this.getColumnLabel(t)})}
                                        @click=${()=>this.moveColumn(n,-1)}></dbp-icon-button>
                                    <dbp-icon-button
                                        no-spinner-on-click
                                        icon-name="arrow-down"
                                        ?disabled=${!this.canMove(n,1)}
                                        title=${e.t(`tabulator-table.column-configuration.move-down`,{column:this.getColumnLabel(t)})}
                                        aria-label=${e.t(`tabulator-table.column-configuration.move-down`,{column:this.getColumnLabel(t)})}
                                        @click=${()=>this.moveColumn(n,1)}></dbp-icon-button>
                                </span>
                            </li>
                        `)}
                </ul>
                <div slot="footer" class="footer">
                    <div class="footer-group">
                        <button class="button is-secondary" @click=${()=>this.reset()}>
                            <dbp-icon name="spinner-arrow-mirrored" aria-hidden="true"></dbp-icon>
                            ${e.t(`tabulator-table.column-configuration.reset`)}
                        </button>
                        <button class="button is-secondary" @click=${()=>this.toggleAll(!1)}>
                            <dbp-icon name="source_icons_eye-off" aria-hidden="true"></dbp-icon>
                            ${e.t(`tabulator-table.column-configuration.hide-all`)}
                        </button>
                        <button class="button is-secondary" @click=${()=>this.toggleAll(!0)}>
                            <dbp-icon name="source_icons_eye-empty" aria-hidden="true"></dbp-icon>
                            ${e.t(`tabulator-table.column-configuration.show-all`)}
                        </button>
                    </div>
                    <div class="footer-group">
                        <button class="button is-secondary" @click=${()=>this.close()}>
                            <dbp-icon name="close" aria-hidden="true"></dbp-icon>
                            ${e.t(`tabulator-table.column-configuration.cancel`)}
                        </button>
                        <button class="button is-primary" @click=${()=>this.save()}>
                            <dbp-icon name="save" aria-hidden="true"></dbp-icon>
                            ${e.t(`tabulator-table.column-configuration.save`)}
                        </button>
                    </div>
                </div>
            </dbp-modal>
        `}};function N(e){return Array.isArray(e)?e.map(e=>{let t={...e};return Array.isArray(e.columns)&&(t.columns=N(e.columns)),t}):[]}function P(e,t=[],n={}){let r=I(e),i=new Set(t),a=[];return R(e,a,r,i,n,`root`,``),a}function F(e,t){if(!Array.isArray(t))return e;let n=new Map(e.map(e=>[e.field,e])),r=[];for(let e of t){let t=n.get(e?.field);t&&(r.push({...t,visible:typeof e.visible==`boolean`?e.visible:t.visible}),n.delete(e.field))}return r.push(...e.filter(e=>n.has(e.field))),r}function I(e,t=/* @__PURE__ */ new Map){for(let n of e||[])Array.isArray(n.columns)?I(n.columns,t):typeof n.field==`string`&&n.field!==``&&t.set(n.field,(t.get(n.field)||0)+1);return t}function L(e,t,n){return typeof e.field==`string`&&e.field!==``&&t.get(e.field)===1&&e.frozen!==!0&&e.formatter!==`responsiveCollapse`&&!n.has(e.field)}function R(e,t,n,r,i,a,o){e.forEach((e,s)=>{if(Array.isArray(e.columns))R(e.columns,t,n,r,i,`${a}.${s}`,typeof e.title==`string`?e.title:o);else if(L(e,n,r)){let n=i?.[e.field];t.push({field:e.field,title:typeof n==`string`?n:typeof e.title==`string`?e.title:e.field,visible:e.visible!==!1,parentPath:a,parentTitle:o})}})}var z=class extends _(g(v),O){constructor(){super(),this.identifier=`table`,this.id=``,this.options={layout:`fitColumns`,autoColumns:!0},this.data=[],this.paginationNoLangsEnabled=!1,this.paginationEnabled=!1,this.paginationSize=10,this.paginationSizeStorageKey=null,this.defaultPaginationSize=10,this.stickyHeaderEnabled=!1,this.selectRowsEnabled=!1,this.rowSelected=!1,this.selectedRows=null,this.tableReady=!1,this.tableBuilding=!1,this.initialization=!0,this.collapseEnabled=!1,this.isCollapsible=!1,this.overflowYScrollEnabled=!1,this.selectedRowCount=0,this.columnConfigurationEnabled=!1,this.columnConfigurationInHeader=!1,this.columnConfigurationStorageKey=``,this.columnConfigurationExcludedFields=[],this.defaultColumnDefinitions=[],this.defaultColumnConfiguration=[],this.currentColumnConfiguration=[],this.columnConfigurationApplying=!1,this.columnConfigurationHeaderButton=null,this.columnConfigurationHeaderElement=null,this.sortAnnouncement=``,this.sortAnnouncementEnabled=!1,this.sortedColumnAnnounced=!1}static get scopedElements(){return{...super.scopedElements,"dbp-mini-spinner":n,"dbp-button":r,"dbp-icon":a,"dbp-icon-button":t,"dbp-tabulator-column-configuration-modal":M}}static get properties(){return{...super.properties,id:{type:String,reflect:!0},identifier:{type:String,attribute:`identifier`},options:{type:Object,attribute:`options`},data:{type:Array,attribute:`data`},paginationNoLangsEnabled:{type:Boolean,attribute:`pagination-no-langs-enabled`},paginationEnabled:{type:Boolean,attribute:`pagination-enabled`},paginationSize:{type:Number,attribute:`pagination-size`},paginationSizeStorageKey:{type:String,attribute:`pagination-size-storage-key`},stickyHeaderEnabled:{type:Boolean,attribute:`sticky-header`},rowSelected:{type:Boolean},selectedRows:{type:Array},selectRowsEnabled:{type:Boolean,attribute:`select-rows-enabled`},collapseEnabled:{type:Boolean,attribute:`collapse-enabled`},expanded:{type:Boolean},isCollapsible:{type:Boolean,attribute:!1},overflowYScrollEnabled:{type:Boolean,attribute:`overflow-y-scroll-enabled`},tableReady:{type:Boolean,attribute:!1},tableBuilding:{type:Boolean,attribute:!1},selectedRowCount:{type:Number},columnConfigurationEnabled:{type:Boolean,attribute:`column-configuration-enabled`},columnConfigurationInHeader:{type:Boolean,attribute:`column-configuration-in-header`},columnConfigurationStorageKey:{type:String,attribute:`column-configuration-storage-key`},columnConfigurationExcludedFields:{type:Array,attribute:!1},currentColumnConfiguration:{type:Array,attribute:!1},sortAnnouncement:{type:String,attribute:!1}}}update(e){super.update(e),e.forEach((e,t)=>{if(t===`lang`){if(this.updateColumnConfigurationHeaderButtonLabel(),this.tabulatorTable&&(this.setTableLocale(),this.columnConfigurationEnabled)){let e=this.currentColumnConfiguration;this.defaultColumnConfiguration=P(this.defaultColumnDefinitions,this.columnConfigurationExcludedFields,this.getLang()?.columns),this.currentColumnConfiguration=F(this.defaultColumnConfiguration,e)}}else if(t===`options`&&this.options!==null&&!this.tableReady&&!this.tableBuilding&&!this.initialization)this.buildTable();else if(t===`columnConfigurationEnabled`&&this.tableReady)this.columnConfigurationEnabled?this.initializeColumnConfiguration():this.clearColumnConfigurationHeaderButton();else if(t===`columnConfigurationInHeader`&&this.tableReady)this.updateColumnConfigurationTriggerPlacement();else if(t===`columnConfigurationExcludedFields`&&this.columnConfigurationEnabled&&this.tableReady)this.defaultColumnConfiguration=P(this.defaultColumnDefinitions,this.columnConfigurationExcludedFields,this.getLang()?.columns),this.syncCurrentColumnConfiguration();else if(t===`columnConfigurationStorageKey`&&this.columnConfigurationEnabled&&this.tableReady)this.applyColumnConfiguration(F(this.defaultColumnConfiguration,this.loadColumnConfiguration()),{persist:!1,dispatchEvent:!1});else if(t===`paginationSizeStorageKey`&&this.tableReady){let e=this.loadPaginationSize()??this.defaultPaginationSize;this.paginationSize=e,this.tabulatorTable.setPageSize(e)}})}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.initialization=!1})}disconnectedCallback(){this.tabulatorTable&&(this.tabulatorTable.off(`tableBuilt`),this.tabulatorTable.off(`rowClick`),this.tabulatorTable.off(`columnVisibilityChanged`),this.tabulatorTable.off(`columnMoved`),this.tabulatorTable.off(`pageLoaded`),this.tabulatorTable.off(`dataSorted`)),super.disconnectedCallback()}setTableLocale(){if(this.tabulatorTable){if(typeof this.tabulatorTable.setLocale==`function`){this.tabulatorTable.setLocale(this.lang);return}typeof this.tabulatorTable.modules?.localize?.setLocale==`function`&&this.tabulatorTable.modules.localize.setLocale(this.lang)}}buildAccessibleColumnTitle(e){let t=e.getColumn(),n=t.getDefinition(),r=e.getValue(),i=!!r&&r!==`&nbsp;`,a=(t.getSubColumns?.()??[]).length>0;if(!i||a||n.headerSort===!1)return r;let o=document.createElement(`button`);o.type=`button`,o.classList.add(`tabulator-col-title-button`),o.textContent=r;let s=document.createElement(`span`);return s.classList.add(`visually-hidden`),s.textContent=` `+this._i18n.t(`tabulator-table.sort.action`),o.append(s),e.getElement().innerHTML=``,o}announceSortChange(e){let t=e?.[0];if(!t){let e=this.sortedColumnAnnounced;this.sortedColumnAnnounced=!1,this.setSortAnnouncement(e?this._i18n.t(`tabulator-table.sort.none`):``);return}this.sortedColumnAnnounced=!0;let n=t.column?.getDefinition?.()??{},r=this.getLang()?.columns?.[t.field]||n.title||t.field,i=t.dir===`desc`?`descending`:`ascending`;this.setSortAnnouncement(this._i18n.t(`tabulator-table.sort.${i}`,{column:r}))}setSortAnnouncement(e){this.sortAnnouncement=``,e&&requestAnimationFrame(()=>{this.sortAnnouncement=e})}buildTable(){if(this.defaultPaginationSize=this.paginationSize,this.sortAnnouncementEnabled=!1,this.sortedColumnAnnounced=!1,this.collapseEnabled&&(this.options.responsiveLayout=`collapse`),this.paginationNoLangsEnabled){let e=this._(`.tabulator-paginator`);if(e)for(;e.firstChild;)e.removeChild(e.firstChild);this.options.pagination=!0,this.options.paginationSize=this.paginationSize,this.options.paginationSizeSelector=[5,10,20,50,100],this.options.footerElement=``,this.options.paginationElement=e}if(this.paginationEnabled){let e=this._(`.tabulator-paginator`);if(e)for(;e.firstChild;)e.removeChild(e.firstChild);this.options.pagination=!0,this.options.paginationSize=this.paginationSize,this.options.paginationSizeSelector=[5,10,20,50,100],this.options.paginationElement=e,this.options.langs??={},this.options.langs.en??={},this.options.langs.de??={},this.options.langs.en.pagination={page_size:`Page size`,page_size_title:`Page size`,first:`<span class="mobile-hidden"> << </span>`,first_title:`First Page`,last:`<span class="mobile-hidden"> >> </span>`,last_title:`Last Page`,prev:`<span class="mobile-hidden"> < </span>`,prev_title:`Prev Page`,next:`<span class="mobile-hidden"> > </span>`,next_title:`Next Page`},this.options.langs.de.pagination={page_size:`Einträge pro Seite`,page_size_title:`Einträge pro Seite`,first:`<span class="mobile-hidden"> << </span>`,first_title:`Erste Seite`,last:`<span class="mobile-hidden"> >> </span>`,last_title:`Letzte Seite`,prev:`<span class="mobile-hidden"> < </span>`,prev_title:`Vorherige Seite`,next:`<span class="mobile-hidden"> > </span>`,next_title:`Nächste Seite`}}if(this.selectRowsEnabled&&(this.options.selectableRows=!0),this.options.data&&(this.data=this.options.data),this.options.columnDefaults={...this.options.columnDefaults},this.options.columnDefaults.titleFormatter??=e=>this.buildAccessibleColumnTitle(e),!this._(`#${this.identifier}`)){console.warn(`buildTable: container element not found for`,this.identifier);return}this.tabulatorTable=new w(this._(`#`+this.identifier),this.options),console.log(`TABULATOR TABLE INITIALIZED`,this.tabulatorTable),this.tableBuilding=!0,this.tabulatorTable.on(`tableBuilt`,this.tableBuildFunctions.bind(this)),this.tabulatorTable.on(`rowClick`,this.rowClickFunction.bind(this)),this.tabulatorTable.on(`rowSelectionChanged`,(e,t,n,r)=>{let i=this.tabulatorTable.getSelectedRows(),a=i.length;this.selectedRows=i,this.selectedCount=a,this.rowSelected=this.selectedRowCount>0;let o=new CustomEvent(`dbp-tabulator-table-selection-count-changed`,{detail:{count:a,rows:i},bubbles:!0,composed:!0});this.dispatchEvent(o);let s=new CustomEvent(`dbp-tabulator-table-row-selection-changed-event`,{detail:{selected:n,deselected:r,allselected:i,selectedCount:this.selectedCount,rows:t,data:e},bubbles:!0,composed:!0});this.dispatchEvent(s)}),this.tabulatorTable.on(`columnVisibilityChanged`,e=>{let t=e.getDefinition(),n=e.isVisible();if(t.formatter===`responsiveCollapse`){this.isCollapsible=n===!0;let e=new CustomEvent(`dbp-tabulator-table-collapsible-event`,{detail:{tableId:this.identifier,isCollapsible:this.isCollapsible},bubbles:!0,composed:!0});this.dispatchEvent(e),this.updateSelectionState()}this.columnConfigurationEnabled&&!this.columnConfigurationApplying&&this.syncCurrentColumnConfiguration(),this.placeColumnConfigurationButtonInHeader()}),this.tabulatorTable.on(`dataSorted`,e=>{this.sortAnnouncementEnabled&&this.announceSortChange(e)}),this.tabulatorTable.on(`columnMoved`,()=>{this.columnConfigurationEnabled&&!this.columnConfigurationApplying&&this.syncCurrentColumnConfiguration(),this.placeColumnConfigurationButtonInHeader()}),this.tabulatorTable.on(`pageLoaded`,e=>{let t=new CustomEvent(`dbp-tabulator-table-page-loaded-event`,{detail:{tableId:this.identifier,page:e,pageSize:e,paginationSize:this.tabulatorTable.getPageSize()},bubbles:!0,composed:!0});this.dispatchEvent(t)}),this.tabulatorTable.on(`renderComplete`,()=>{this.placeColumnConfigurationButtonInHeader();let e=new CustomEvent(`dbp-tabulator-table-render-complete-event`,{detail:{tableId:this.identifier},bubbles:!0,composed:!0});this.dispatchEvent(e)})}async tableBuildFunctions(){if(!this.tabulatorTable)return;if(this.setTableLocale(),Array.isArray(this.data)&&this.data.length>0&&await this.tabulatorTable.setData(this.data),this.selectRowsEnabled&&this.tabulatorTable.on(`rowMouseOver`,(e,t)=>{t.getElement().classList.add(`pointer-mouse`)}),this.paginationEnabled){let e=this._(`#custom-pagination .tabulator-page-size`),t=this.loadPaginationSize();if(t&&(this.paginationSize=t,this.tabulatorTable.setPageSize(this.paginationSize)),e.addEventListener(`change`,e=>{e.target.value&&(this.paginationSize=Number(e.target.value),this.storePaginationSize(this.paginationSize),this.dispatchEvent(new CustomEvent(`dbp-tabulator-table-page-size-changed-event`,{detail:{tableId:this.identifier,page:this.tabulatorTable.getPage(),pageSize:this.paginationSize,paginationSize:this.paginationSize},bubbles:!0,composed:!0})))}),e&&!e.parentElement.classList.contains(`page-size-wrapper`)){let t=document.createElement(`div`);t.classList.add(`page-size-wrapper`),e.parentNode.insertBefore(t,e),t.appendChild(e)}}this.columnConfigurationEnabled&&this.initializeColumnConfiguration();let e=new CustomEvent(`dbp-tabulator-table-built`,{detail:{id:this.identifier,tabulator:this.tabulatorTable},bubbles:!0,composed:!0});this.dispatchEvent(e),this.tableReady=!0,this.tableBuilding=!1,this.sortAnnouncementEnabled=!0}rowClickFunction(e,t){if(!this._(`#select_all`)||!this.tabulatorTable)return;let n=this.tabulatorTable.getSelectedRows().length===this.tabulatorTable.getRows(`visible`).length;this._(`#select_all`).checked=n,this.rowSelected=this.tabulatorTable.getSelectedRows().length!==0}deleteRow(e){this.tabulatorTable&&this.tabulatorTable.deleteRow(e)}selectAllRows(){this.tabulatorTable&&(this.checkAllSelected()||this.tabulatorTable.getRows().forEach(e=>e.select()))}getPaginationSizeStorageKey(){if(this.paginationSizeStorageKey===``)return null;let e=this.paginationSizeStorageKey??this.identifier;return e?`tabulator-${e}-pagination-size`:null}loadPaginationSize(){let e=this.getPaginationSizeStorageKey();if(!e)return null;try{let t=Number(localStorage.getItem(e));return t>0?t:null}catch(e){return console.warn(`Unable to restore the Tabulator pagination size.`,e),null}}storePaginationSize(e){let t=this.getPaginationSizeStorageKey();if(t)try{localStorage.setItem(t,String(e))}catch(e){console.warn(`Unable to store the Tabulator pagination size.`,e)}}selectAllVisibleRows(){this.tabulatorTable&&this.tabulatorTable.getRows(`visible`).forEach(e=>e.select())}deselectAllRows(){this.tabulatorTable&&(this.checkNoneSelected()||this.tabulatorTable.getSelectedRows().forEach(e=>e.deselect()))}updateSelectionState(e=null,t=null,n=[],r=[]){if(!this.tabulatorTable)return;let i=t??this.tabulatorTable.getSelectedRows(),a=e??this.tabulatorTable.getSelectedData();this.selectedRows=i,this.selectedRowCount=i.length,this.rowSelected=this.selectedRowCount>0;let o=new CustomEvent(`dbp-tabulator-table-selection-count-changed`,{detail:{tableId:this.identifier,count:this.selectedRowCount,selected:n,deselected:r,rows:i,data:a},bubbles:!0,composed:!0});this.dispatchEvent(o)}checkAllSelected(){if(this.tabulatorTable){let e=this.tabulatorTable.getRows(`visible`).length;if(this.tabulatorTable.getSelectedRows().length===e)return!0}return!1}checkNoneSelected(){return!!(this.tabulatorTable&&this.tabulatorTable.getSelectedRows().length===0)}setData(e){if(!this.tabulatorTable)return;this.data=e;let t=this.tabulatorTable.setData(this.data);return this.columnConfigurationEnabled&&this.options.autoColumns&&(!Array.isArray(e)||e.length>0)?Promise.resolve(t).then(()=>(this.refreshAutoColumnConfiguration(),t)):t}clearData(){this.tabulatorTable&&this.tabulatorTable.clearData()}addData(e){this.tabulatorTable&&this.tabulatorTable.addData(e,!1)}setFilter(e){this.tabulatorTable&&(e.length===0?this.tabulatorTable.clearFilter(!1):this.tabulatorTable.setFilter(e))}clearFilter(){this.tabulatorTable&&this.tabulatorTable.clearFilter(!1)}getSelectedRows(){if(this.tabulatorTable)return this.selectedRows=this.tabulatorTable.getSelectedRows(),this.selectedRows}deleteSelectedRows(){this.tabulatorTable&&(this.getSelectedRows(),this.tabulatorTable.deleteRow(this.selectedRows))}getColumns(){if(this.tabulatorTable)return this.tabulatorTable.getColumns()}setColumns(e){this.tabulatorTable&&(this.tabulatorTable.setColumns(e),this.columnConfigurationEnabled&&this.initializeColumnConfiguration())}getColumnDefinitions(){if(this.tabulatorTable)return this.tabulatorTable.getColumnDefinitions()}initializeColumnConfiguration(){if(!this.tabulatorTable)return;let e=this.getColumnDefinitions();if(!Array.isArray(e))return;this.defaultColumnDefinitions=N(e),this.defaultColumnConfiguration=P(this.defaultColumnDefinitions,this.columnConfigurationExcludedFields,this.getLang()?.columns);let t=this.loadColumnConfiguration();this.currentColumnConfiguration=F(this.defaultColumnConfiguration,t),t?this.applyColumnConfigurationToTable(this.currentColumnConfiguration):this.syncCurrentColumnConfiguration(),this.updateColumnConfigurationTriggerPlacement()}updateColumnConfigurationTriggerPlacement(){this.columnConfigurationEnabled&&this.columnConfigurationInHeader?this.placeColumnConfigurationButtonInHeader():this.clearColumnConfigurationHeaderButton()}placeColumnConfigurationButtonInHeader(){if(!this.tabulatorTable||!this.columnConfigurationEnabled||!this.columnConfigurationInHeader)return;let e=this.getRightmostVisibleLeafColumn(this.tabulatorTable.getColumns(!0))?.getElement?.(),t=e?.querySelector(`.tabulator-col-content`);if(!t){this.clearColumnConfigurationHeaderButton();return}if(!this.columnConfigurationHeaderButton){let e=this.createScopedElement(`dbp-icon-button`);e.setAttribute(`icon-name`,`cog`),e.setAttribute(`no-spinner-on-click`,``),e.addEventListener(`click`,e=>{e.stopPropagation(),this.openColumnConfiguration()}),this.columnConfigurationHeaderButton=e}(this.columnConfigurationHeaderElement!==e||this.columnConfigurationHeaderButton.parentElement!==t)&&(this.columnConfigurationHeaderElement?.classList.remove(`column-configuration-header`),e.classList.add(`column-configuration-header`),t.append(this.columnConfigurationHeaderButton),this.columnConfigurationHeaderElement=e),this.updateColumnConfigurationHeaderButtonLabel()}getRightmostVisibleLeafColumn(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n.getSubColumns?.()||[],i=this.getRightmostVisibleLeafColumn(r);if(i)return i;if(r.length===0&&n.isVisible())return n}return null}clearColumnConfigurationHeaderButton(){this.columnConfigurationHeaderButton?.remove(),this.columnConfigurationHeaderElement?.classList.remove(`column-configuration-header`),this.columnConfigurationHeaderElement=null}updateColumnConfigurationHeaderButtonLabel(){if(!this.columnConfigurationHeaderButton)return;let e=this._i18n.t(`tabulator-table.column-configuration.open-description`),t=this._i18n.t(`tabulator-table.column-configuration.open`);this.columnConfigurationHeaderButton.setAttribute(`aria-label`,e),this.columnConfigurationHeaderButton.setAttribute(`title`,t)}refreshAutoColumnConfiguration(){let e=this.currentColumnConfiguration;this.defaultColumnDefinitions=N(this.getColumnDefinitions()),this.defaultColumnConfiguration=P(this.defaultColumnDefinitions,this.columnConfigurationExcludedFields,this.getLang()?.columns),this.currentColumnConfiguration=F(this.defaultColumnConfiguration,e),this.applyColumnConfigurationToTable(this.currentColumnConfiguration)}async openColumnConfiguration(){if(!this.columnConfigurationEnabled||!this.tabulatorTable)return;let e=this.renderRoot.querySelector(`dbp-tabulator-column-configuration-modal`);e&&(e.columns=this.currentColumnConfiguration,e.defaultColumns=this.defaultColumnConfiguration,await e.open())}getColumnConfiguration(){return this.currentColumnConfiguration.map(({field:e,visible:t})=>({field:e,visible:t}))}applyColumnConfiguration(e,t={}){if(!this.tabulatorTable||!Array.isArray(e))return;let n=F(this.defaultColumnConfiguration,e);this.currentColumnConfiguration=n,this.applyColumnConfigurationToTable(n),t.persist!==!1&&this.storeColumnConfiguration(),t.dispatchEvent!==!1&&this.dispatchEvent(new CustomEvent(`dbp-tabulator-table-column-configuration-changed`,{detail:{tableId:this.identifier,columns:this.getColumnConfiguration()},bubbles:!0,composed:!0}))}resetColumnConfiguration(){this.removeStoredColumnConfiguration(),this.applyColumnConfiguration(this.defaultColumnConfiguration,{persist:!1})}handleColumnConfigurationSave(e){this.applyColumnConfiguration(e.detail.columns)}applyColumnConfigurationToTable(e){let t=new Map(e.map((e,t)=>[e.field,{...e,index:t}])),n=this.tabulatorTable.getColumns(!0);this.columnConfigurationApplying=!0;try{this.updateColumnVisibility(n,t);let e=this.tabulatorTable.modules?.responsiveLayout;e?.initializeResponsivity?.(),e?.update?.(),this.reorderColumnComponents(n,t)}finally{this.columnConfigurationApplying=!1,this.syncCurrentColumnConfiguration(),this.placeColumnConfigurationButtonInHeader()}}updateColumnVisibility(e,t){for(let n of e){let e=n.getSubColumns?.()||[];if(e.length>0){this.updateColumnVisibility(e,t);continue}let r=t.get(n.getField?.());if(!r)continue;let i=n._column?.modules?.responsive,a=i?.visible;i&&typeof i.visible==`boolean`&&(i.visible=r.visible),r.visible&&!n.isVisible()&&(!i||a===!1)?n.show():!r.visible&&n.isVisible()&&n.hide()}}reorderColumnComponents(e,t){for(let n of e){let e=n.getSubColumns?.()||[];e.length>0&&this.reorderColumnComponents(e,t)}let n=[...e],r=[],i=[];n.forEach((e,n)=>{let a=e.getField?.();(e.getSubColumns?.()||[]).length===0&&t.has(a)&&(r.push(n),i.push(e))}),i.sort((e,n)=>t.get(e.getField()).index-t.get(n.getField()).index),r.forEach((e,t)=>{let r=i[t],a=n.indexOf(r);if(a===e)return;let o=n[e],s=a<e;this.tabulatorTable.moveColumn(r,o,s),n.splice(a,1);let c=n.indexOf(o);n.splice(c+ +!!s,0,r)})}syncCurrentColumnConfiguration(){let e=P(this.getColumnDefinitions(),this.columnConfigurationExcludedFields,this.getLang()?.columns),t=/* @__PURE__ */ new Map;this.collectLeafColumnComponents(this.tabulatorTable.getColumns(!0),t),this.currentColumnConfiguration=e.map(e=>({...e,visible:this.getConfiguredColumnVisibility(t.get(e.field),e)}))}getConfiguredColumnVisibility(e,t){let n=e?._column?.modules?.responsive?.visible;return typeof n==`boolean`?n:e?.isVisible()??t.visible}collectLeafColumnComponents(e,t){for(let n of e){let e=n.getSubColumns?.()||[];e.length>0?this.collectLeafColumnComponents(e,t):n.getField?.()&&t.set(n.getField(),n)}}getColumnConfigurationStorageKey(){return this.columnConfigurationStorageKey?`dbp-tabulator-table-column-configuration-${this.columnConfigurationStorageKey}`:null}loadColumnConfiguration(){let e=this.getColumnConfigurationStorageKey();if(!e)return null;try{let t=localStorage.getItem(e);if(!t)return null;let n=JSON.parse(t);return n?.version===1&&Array.isArray(n.columns)?n.columns:null}catch(e){return console.warn(`Unable to restore the Tabulator column configuration.`,e),null}}storeColumnConfiguration(){let e=this.getColumnConfigurationStorageKey();if(e)try{localStorage.setItem(e,JSON.stringify({version:1,columns:this.getColumnConfiguration()}))}catch(e){console.warn(`Unable to store the Tabulator column configuration.`,e)}}removeStoredColumnConfiguration(){let e=this.getColumnConfigurationStorageKey();if(e)try{localStorage.removeItem(e)}catch(e){console.warn(`Unable to remove the Tabulator column configuration.`,e)}}getColumnsFields(){if(!this.tabulatorTable)return;let e=this.tabulatorTable.getColumns(),t=[];for(let n of e)t.push(n.getField());return t}getRows(){if(this.tabulatorTable)return this.tabulatorTable.getRows()}getData(){if(this.tabulatorTable)return this.tabulatorTable.getData()}updateRow(e,t){this.tabulatorTable&&e.update(t)}getPage(){if(this.tabulatorTable)return this.tabulatorTable.getPage()}getLang(){if(this.tabulatorTable)return(this.tabulatorTable.getLang?this.tabulatorTable.getLang():this.tabulatorTable.modules?.localize?.getLang())??this.options.langs?.[this.lang]}setPage(e){this.tabulatorTable&&this.tabulatorTable.setPage(e)}expandAll(){this.tabulatorTable&&(this.tabulatorTable.getRows(`visible`).forEach(e=>{let t=e._row.modules.responsiveLayout;t.open=!0;let n=e.getElement().lastChild;n.classList.contains(`tabulator-responsive-collapse`)&&(n.style.display=`block`),e.getElement().getElementsByClassName(`tabulator-responsive-collapse-toggle`)[0].classList.add(`open`)}),setTimeout(()=>{this.tabulatorTable.redraw()},0))}collapseAll(){this.tabulatorTable.getRows(`visible`).forEach(e=>{let t=e._row.modules.responsiveLayout;t.open=!1;let n=e.getElement().lastChild;n.classList.contains(`tabulator-responsive-collapse`)&&(n.style.display=`none`),e.getElement().getElementsByClassName(`tabulator-responsive-collapse-toggle`)[0].classList.remove(`open`)}),setTimeout(()=>{this.tabulatorTable.redraw()},0)}async download(e,t){if(!this.tabulatorTable)return;let n=this.tabulatorTable.getRows(`active`);if(n.length===0)return;let r=this.tabulatorTable.getSelectedRows(),i=r.length>0,a=i?r:n,o=i?r.map(e=>({...e.getData(),rowIndex:e.getPosition(!0)})):this.tabulatorTable.getData().map((e,t)=>({...e,rowIndex:t})),s=i?`selected`:`all`,c=t.replace(/[^a-z0-9_-]/gi,`_`).replace(/_+/g,`_`).toLowerCase(),l=!1;try{switch(e){case`csv`:case`json`:case`html`:this.tabulatorTable.download(e,c+`.`+e,{},s);break;case`xlsx`:await j(a,c);break;case`pdf`:await A(this.tabulatorTable,o,c);break;default:console.error(`Unsupported export type:`,e),y({summary:this._i18n.t(`tabulator-table.error-title`),body:this._i18n.t(`tabulator-table.unsupported-type-error-message`),type:`danger`,timeout:0}),l=!0}}catch(e){l=!0,console.error(`Download failed:`,e),y({summary:this._i18n.t(`tabulator-table.error-title`),body:this._i18n.t(`tabulator-table.download-error-message`),type:`danger`,timeout:0})}l||y({summary:this._i18n.t(`tabulator-table.success-title`),body:this._i18n.t(`tabulator-table.download-success-message`),type:`success`,timeout:5})}static get styles(){return u`
            ${c()}
            ${b()}
            ${x()}
            ${m()}
            ${T()}

            .column-configuration-toolbar {
                display: flex;
                justify-content: flex-end;
                min-height: 2.5rem;
            }

            .column-configuration-toolbar dbp-button {
                --dbp-button-icon-margin-right: 0.5rem;
            }

            .tabulator .tabulator-header .column-configuration-header .tabulator-arrow {
                display: none;
            }

            .tabulator .tabulator-header .column-configuration-header .tabulator-col-content {
                padding-right: 2.75rem;
                position: relative;
            }

            .column-configuration-header dbp-icon-button {
                position: absolute;
                top: 50%;
                right: 0.25rem;
                z-index: 1;
                transform: translateY(-50%);
            }

            .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
                padding-top: 4px;
                padding-bottom: 4px;
                font-weight: normal;
                font-size: 1rem;
            }

            .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
                padding-top: 4px;
                padding-bottom: 4px;
                font-weight: normal;
                font-size: 1rem;
            }

            .tabulator .tabulator-header .tabulator-header-contents .tabulator-headers {
                min-height: 37px;
            }

            /* Allow scrolling of rows inside "content" area of table */
            :host([overflow-y-scroll-enabled]) .tabulator .tabulator-tableholder {
                overflow-y: scroll;
            }

            .tabulator .tabulator-tableholder :hover {
                cursor: default;
            }

            .tabulator .tabulator-row.pointer-mouse:hover,
            .tabulator .tabulator-row.pointer-mouse :hover {
                cursor: pointer;
            }

            .tabulator .tabulator-footer .tabulator-paginator .tabulator-page[disabled] {
                opacity: var(--dbp-hover-background-color);
            }

            .tabulator .tabulator-footer {
                background-color: var(--dbp-background);
                color: var(--dbp-content);
                border-top: none;
            }

            .tabulator .tabulator-footer .tabulator-footer-contents {
                flex-direction: column;
            }

            .tabulator .tabulator-footer .tabulator-paginator {
                flex-direction: row;
                display: flex;
                align-items: center;
                margin-top: 10px;
            }

            .tabulator .tabulator-footer .tabulator-paginator > label {
                padding-right: 10px;
            }

            .tabulator .tabulator-footer .tabulator-paginator label {
                color: var(--dbp-content);
                font-weight: 400;
            }

            .tabulator .tabulator-footer .tabulator-paginator .tabulator-page-size {
                box-sizing: border-box;
                color: var(--dbp-content);
                background-color: var(--dbp-background);
                border: var(--dbp-border);
                border-radius: var(--dbp-border-radius);
                padding: calc(0.5em - 1px) 1.7em calc(0.5em - 1px) 0.75em;
                cursor: pointer;
                min-height: 40px;
                appearance: none;
                -webkit-appearance: none;
                -moz-appearance: none;
                background: none;
            }

            .tabulator-page-size option {
                color: var(--dbp-content);
                background-color: var(--dbp-background);
            }

            .page-size-wrapper {
                position: relative;
                display: inline-flex;
                align-items: center;
            }

            .page-size-wrapper::after {
                content: '';
                position: absolute;
                right: 0.6rem;
                width: 1rem;
                height: 1rem;
                pointer-events: none;
                background-color: var(--dbp-content);
                mask-image: url('${d(h(`chevron-down`))}');
                mask-repeat: no-repeat;
                mask-position: center;
                mask-size: contain;
            }
            .tabulator .tabulator-footer .tabulator-paginator {
                color: var(--dbp-content);
            }

            .tabulator .tabulator-footer .tabulator-paginator .tabulator-page {
                opacity: unset;
                border-radius: var(--dbp-border-radius);
                cursor: pointer;
                padding: calc(0.375em - 1px) 0.75em;
                text-align: center;
                white-space: nowrap;
                font-size: inherit;
                font-weight: 300;
                font-family: inherit;
                transition:
                    all 0.15s ease 0s,
                    color 0.15s ease 0s;
                background: var(--dbp-secondary-surface);
                color: var(--dbp-on-secondary-surface);
                border-color: var(--dbp-secondary-surface-border-color);
                box-sizing: border-box;
                min-height: 40px;
            }

            .tabulator .tabulator-footer .tabulator-paginator .tabulator-page.active {
                background: var(--dbp-selected);
                color: var(--dbp-on-selected-surface);
                font-weight: bold;
            }

            .tabulator .tabulator-footer .tabulator-page:not(disabled):hover {
                color: var(--dbp-hover-color);
                background: var(--dbp-hover-background-color);
            }

            .filename {
                overflow: hidden;
                text-overflow: ellipsis;
                width: 100%;
                white-space: nowrap;
            }

            @media only screen and (orientation: portrait) and (max-width: 768px) {
                .mobile-hidden {
                    display: none;
                }

                #custom-pagination,
                .tabulator-footer {
                    position: sticky;
                    bottom: 0;
                    z-index: 10;
                }

                .tabulator {
                    overflow: visible;
                }

                .tabulator .tabulator-footer .tabulator-paginator .tabulator-page {
                    border: none;
                }

                .tabulator
                    .tabulator-footer
                    .tabulator-footer-contents
                    .tabulator-paginator
                    .tabulator-pages {
                    display: none;
                }

                .tabulator .tabulator-footer .tabulator-paginator {
                    text-align: center;
                }

                .tabulator .tabulator-footer .tabulator-paginator label {
                    display: none;
                }

                .tabulator .tabulator-footer .tabulator-paginator .tabulator-page {
                    border: none;
                }

                .tabulator .tabulator-footer .tabulator-paginator .tabulator-page-size {
                    padding-right: 1.5em;
                    background-size: auto 40%;
                }

                button[data-page='prev']::after,
                button[data-page='next']::after,
                button[data-page='first']::after,
                button[data-page='last']::after {
                    content: '\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0';
                    background-color: var(--dbp-content);
                    mask-repeat: no-repeat;
                    mask-position: center center;
                    padding: 0 0 0.25%;
                    mask-size: 1.4rem !important;
                }

                button[data-page='first']::after {
                    content: '\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0';
                    mask-image: url('${d(h(`angle-double-left`))}');
                }

                button[data-page='prev']::after {
                    mask-image: url('${d(h(`chevron-left`))}');
                }

                button[data-page='next']::after {
                    mask-image: url('${d(h(`chevron-right`))}');
                }

                button[data-page='last']::after {
                    content: '\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0\\00a0';
                    mask-image: url('${d(h(`angle-double-right`))}');
                }
            }
        `}render(){let e=s(k,`tabulator-tables/css/tabulator.min.css`);return o`
            <div class="wrapper">
                <link rel="stylesheet" href="${e}" />

                <div class="visually-hidden" role="status" aria-live="polite">
                    ${this.sortAnnouncement}
                </div>

                ${this.columnConfigurationEnabled?o`
                              ${this.columnConfigurationInHeader?``:o`
                                            <div class="column-configuration-toolbar">
                                                <dbp-button
                                                    no-spinner-on-click
                                                    type="is-secondary"
                                                    ?disabled=${!this.tableReady}
                                                    title=${this._i18n.t(`tabulator-table.column-configuration.open`)}
                                                    @click=${()=>this.openColumnConfiguration()}>
                                                    <dbp-icon
                                                        name="cog"
                                                        aria-hidden="true"></dbp-icon>
                                                    <span>
                                                        ${this._i18n.t(`tabulator-table.column-configuration.open`)}
                                                    </span>
                                                </dbp-button>
                                            </div>
                                        `}
                              <dbp-tabulator-column-configuration-modal
                                  .lang=${this.lang}
                                  @column-configuration-save=${e=>this.handleColumnConfigurationSave(e)}></dbp-tabulator-column-configuration-modal>
                          `:``}

                <div class="table-wrapper">
                    <div class="${S({hidden:this.tableReady,"spinner-container":!0})}">
                        <dbp-mini-spinner
                            text="${this._i18n.t(`tabulator-table.loading-table-data`)}"></dbp-mini-spinner>
                    </div>
                    <div
                        id=${this.identifier}
                        class="${S({"sticky-header":this.stickyHeaderEnabled})}"></div>
                    <div
                        class="tabulator ${S({hidden:!this.paginationEnabled})}"
                        id="custom-pagination">
                        <div class="tabulator-footer">
                            <div class="tabulator-footer-contents">
                                <span class="tabulator-paginator"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        `}},B=class extends z{static get scopedElements(){return{...super.scopedElements,"dbp-formalize-get-details-button":V,"dbp-formalize-get-submission-link":H}}static get styles(){return[z.styles,u`
                :host {
                    display: block;
                }
            `]}},V=class extends g(v){constructor(){super(),this._i18n=i(),this.lang=this._i18n.language,this.title=``,this.ariaLabel=``,this.iconName=`keyword-research`}static get properties(){return{...super.properties,lang:{type:String},title:{type:String},iconName:{type:String,attribute:`icon-name`},ariaLabel:{type:String,attribute:`aria-label`}}}static get scopedElements(){return{"dbp-icon-button":t}}update(e){e.forEach((e,t)=>{t===`lang`&&this._i18n.changeLanguage(this.lang)}),super.update(e)}static get styles(){return u`
            dbp-icon-button {
                font-size: 20px;
            }
        `}render(){return o`
            <dbp-icon-button
                icon-name="${this.iconName}"
                title="${this.title}"
                aria-label="${this.ariaLabel}"></dbp-icon-button>
        `}},H=class extends g(v){constructor(){super(),this._i18n=i(),this.lang=this._i18n.language,this.title=``,this.ariaLabel=``,this.iconName=`keyword-research`,this.submissionUrl=``}static get properties(){return{...super.properties,lang:{type:String},title:{type:String},iconName:{type:String,attribute:`icon-name`},submissionUrl:{type:String,attribute:`submission-url`},ariaLabel:{type:String,attribute:`aria-label`}}}static get scopedElements(){return{"dbp-icon":a}}update(e){e.forEach((e,t)=>{t===`lang`&&this._i18n.changeLanguage(this.lang)}),super.update(e)}static get styles(){return u`
            :host {
                display: inline-block;
            }
            a {
                display: flex;
                text-decoration: none;
                height: 40px;
                width: 40px;
                line-height: 40px;
                color: var(--dbp-content);
                justify-content: center;
                color: currentColor;
            }
            dbp-icon {
                font-size: 24px;
                flex-shrink: 0;
                flex-grow: 0;
            }
        `}render(){return o`
            <a href="${this.submissionUrl}" target="_blank" rel="noopener noreferrer">
                <dbp-icon
                    name="${this.iconName}"
                    title="${this.title}"
                    aria-label="${this.ariaLabel}"></dbp-icon>
            </a>
        `}};const U=()=>{let e=(/* @__PURE__ */ Error()).stack||``;return e.split(`
`).map(function(e){return e.trim()}).splice(e[0]===`Error`?2:1)};var W=class extends _(f(v),i){constructor(){super(),this._initialized=!1,this.entryPointUrl=``,this.basePath=``,this.langDir=``}static get properties(){return{...super.properties,entryPointUrl:{type:String,attribute:`entry-point-url`},basePath:{type:String,attribute:`base-path`},langDir:{type:String,attribute:`lang-dir`}}}connectedCallback(){super.connectedCallback(),this.langDir&&p(this._i18n,this)}loginCallback(){this._initialized||=(this.initialize(),!0)}initialize(){}update(e){e.forEach((e,t)=>{(t===`langDir`||t===`lang`)&&this.langDir&&p(this._i18n,this)}),super.update(e)}isLoading(){return this.isAuthPending()}getToken(){if(!this.auth?.token)throw Error(`Authentication token is not available`);return this.auth.token}getUserId(){if(!this.auth?.[`user-id`])throw Error(`User ID is not available`);return this.auth[`user-id`]}handleErrorResponse(e,t=void 0){switch(e.status){case 401:y({summary:this._i18n.t(`errors.unauthorized-title`),body:this._i18n.t(`errors.unauthorized-body`),type:`danger`,timeout:0,targetNotificationId:t});break;case 403:y({summary:this._i18n.t(`errors.forbidden-title`),body:this._i18n.t(`errors.forbidden-body`),type:`danger`,timeout:0,targetNotificationId:t});break;case 404:y({summary:this._i18n.t(`errors.notfound-title`),body:this._i18n.t(`errors.notfound-body`),type:`danger`,timeout:0,targetNotificationId:t});break;case 422:y({summary:this._i18n.t(`errors.unprocessable_entity-title`),body:this._i18n.t(`errors.unprocessable_entity-body`),type:`danger`,timeout:0,targetNotificationId:t});break;default:y({summary:this._i18n.t(`errors.other-title`),body:this._i18n.t(`errors.other-body`),type:`danger`,timeout:0,targetNotificationId:t})}}async sendErrorAnalyticsEvent(e,t,n,r={}){let i;try{i=await r.clone().json()}catch{i=r}let a={status:r.status||``,url:r.url||``,description:i[`hydra:description`]||``,errorDetails:i[`relay:errorDetails`]||``,information:n,stack:U().slice(1,6)};this.sendSetPropertyEvent(`analytics-event`,{category:e,action:t,name:JSON.stringify(a)})}async apiGetUserDetails(e){let t={method:`GET`,headers:{"Content-Type":`application/ld+json`,Authorization:`Bearer `+this.getToken()}};return await fetch(this.entryPointUrl+`/base/people/${e}`,t)}};export{H as i,B as n,V as r,W as t};
//# sourceMappingURL=dbp-formalize-lit-element.a7wlQ90-.js.map