From 4625752c17412ef00cc4a9e28ff2cd3a1140827b Mon Sep 17 00:00:00 2001 From: kodinkat Date: Fri, 30 Jan 2026 17:30:55 +0000 Subject: [PATCH 01/20] Enhance file upload functionality: Added support for 'upload_file' field type with customizable options including accepted file types, max file size, and display settings. Updated related components and admin settings to accommodate new field type, ensuring improved user experience for file uploads. --- dt-assets/build/components/index.es.js | 23 +- dt-assets/build/components/index.js | 1030 ++++++++++++----- dt-assets/build/components/index.umd.cjs | 1024 +++++++++++----- dt-core/admin/admin-settings-endpoints.php | 59 + dt-core/admin/js/dt-settings.js | 150 ++- dt-core/admin/menu/tabs/tab-custom-fields.php | 212 ++++ dt-core/admin/menu/tabs/tab-fields.php | 2 +- dt-core/dt-storage.php | 13 +- dt-core/global-functions.php | 5 +- dt-core/utilities/dt-components.php | 122 +- dt-posts/dt-posts-endpoints.php | 462 ++++++-- dt-posts/dt-posts.php | 5 + 12 files changed, 2459 insertions(+), 648 deletions(-) diff --git a/dt-assets/build/components/index.es.js b/dt-assets/build/components/index.es.js index 76b0a3cc5a..1f0ffea981 100644 --- a/dt-assets/build/components/index.es.js +++ b/dt-assets/build/components/index.es.js @@ -1,4 +1,4 @@ -import { E as s, C as e, w as D, B as o, D as i, a as l, b as n, d as r, e as c, f as u, u as p, A as C, g as M, x as T, h as m, i as x, j as S, y as g, k as B, t as d, r as h, l as v, m as A, n as L, o as b, p as f, z as y, q as F, c as j, v as k } from "./index-B5P35fmQ.js"; +import { F as s, E as e, x as D, C as o, D as i, a as l, b as n, d as r, e as c, f as p, w as u, B as C, g as M, y as T, h as m, i as x, j as S, z as d, k as g, t as B, r as h, l as v, m as A, n as F, o as L, p as b, A as f, q as y, u as U, c as j, v as k } from "./index-B-kkHhnO.js"; export { s as ApiService, e as ComponentService, @@ -9,25 +9,26 @@ export { n as DtConnection, r as DtCopyText, c as DtDate, - u as DtDatetime, - p as DtFormBase, + p as DtDatetime, + u as DtFormBase, C as DtIcon, M as DtLabel, T as DtList, m as DtLocation, x as DtLocationMap, S as DtMapModal, - g as DtModal, - B as DtMultiSelect, - d as DtMultiSelectButtonGroup, + d as DtModal, + g as DtMultiSelect, + B as DtMultiSelectButtonGroup, h as DtMultiText, v as DtNumberField, A as DtSingleSelect, - L as DtTags, - b as DtText, - f as DtTextArea, - y as DtTile, - F as DtToggle, + F as DtTags, + L as DtText, + b as DtTextArea, + f as DtTile, + y as DtToggle, + U as DtUploadFile, j as DtUsersConnection, k as version }; diff --git a/dt-assets/build/components/index.js b/dt-assets/build/components/index.js index a264216fe1..0ccc1729bf 100644 --- a/dt-assets/build/components/index.js +++ b/dt-assets/build/components/index.js @@ -1,74 +1,74 @@ -var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr=($,q,W)=>q in $?Pr($,q,{enumerable:!0,configurable:!0,writable:!0,value:W}):$[q]=W;var Xe=($,q,W)=>Mr($,typeof q!="symbol"?q+"":q,W);/** +var DtWebComponents=function($){"use strict";var Mn=Object.defineProperty;var jn=($,N,W)=>N in $?Mn($,N,{enumerable:!0,configurable:!0,writable:!0,value:W}):$[N]=W;var Me=($,N,W)=>jn($,typeof N!="symbol"?N+"":N,W);/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */var As;const q=globalThis,W=q.ShadowRoot&&(q.ShadyCSS===void 0||q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vt=Symbol(),Bt=new WeakMap;let qs=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Vt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(W&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Bt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Bt.set(t,e))}return e}toString(){return this.cssText}};const Fs=o=>new qs(typeof o=="string"?o:o+"",void 0,Vt),Us=(o,e)=>{if(W)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=q.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,o.appendChild(i)}},Ht=W?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Fs(t)})(o):o;/** + */var Os;const N=globalThis,W=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bt=Symbol(),Ht=new WeakMap;let Us=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Bt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(W&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ht.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ht.set(t,e))}return e}toString(){return this.cssText}};const Vs=o=>new Us(typeof o=="string"?o:o+"",void 0,Bt),Bs=(o,e)=>{if(W)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=N.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,o.appendChild(i)}},Kt=W?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Vs(t)})(o):o;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:Vs,defineProperty:Bs,getOwnPropertyDescriptor:Hs,getOwnPropertyNames:Gs,getOwnPropertySymbols:Ws,getPrototypeOf:Ks}=Object,K=globalThis,Gt=K.trustedTypes,Zs=Gt?Gt.emptyScript:"",et=K.reactiveElementPolyfillSupport,he=(o,e)=>o,tt={toAttribute(o,e){switch(e){case Boolean:o=o?Zs:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},Wt=(o,e)=>!Vs(o,e),Kt={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:Wt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),K.litPropertyMetadata??(K.litPropertyMetadata=new WeakMap);let pe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Kt){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Bs(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:a}=Hs(this.prototype,e)??{get(){return this[t]},set(n){this[t]=n}};return{get(){return s==null?void 0:s.call(this)},set(n){const r=s==null?void 0:s.call(this);a.call(this,n),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Kt}static _$Ei(){if(this.hasOwnProperty(he("elementProperties")))return;const e=Ks(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(he("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(he("properties"))){const t=this.properties,i=[...Gs(t),...Ws(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Ht(s))}else e!==void 0&&t.push(Ht(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Us(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var a;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const n=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:tt).toAttribute(t,i.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){var a;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const n=i.getPropertyOptions(s),r=typeof n.converter=="function"?{fromAttribute:n.converter}:((a=n.converter)==null?void 0:a.fromAttribute)!==void 0?n.converter:tt;this._$Em=s,this[s]=r.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Wt)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,n]of this._$Ep)this[a]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,n]of s)n.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[he("elementProperties")]=new Map,pe[he("finalized")]=new Map,et==null||et({ReactiveElement:pe}),(K.reactiveElementVersions??(K.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:Hs,defineProperty:Ks,getOwnPropertyDescriptor:Ws,getOwnPropertyNames:Gs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,G=globalThis,Wt=G.trustedTypes,Qs=Wt?Wt.emptyScript:"",tt=G.reactiveElementPolyfillSupport,be=(o,e)=>o,it={toAttribute(o,e){switch(e){case Boolean:o=o?Qs:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},Gt=(o,e)=>!Hs(o,e),Zt={attribute:!0,type:String,converter:it,reflect:!1,hasChanged:Gt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);let ge=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Zt){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Ks(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:a}=Ws(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const n=s==null?void 0:s.call(this);a.call(this,r),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Zt}static _$Ei(){if(this.hasOwnProperty(be("elementProperties")))return;const e=Js(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(be("properties"))){const t=this.properties,i=[...Gs(t),...Zs(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Kt(s))}else e!==void 0&&t.push(Kt(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bs(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var a;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:it).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var a;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),n=typeof r.converter=="function"?{fromAttribute:r.converter}:((a=r.converter)==null?void 0:a.fromAttribute)!==void 0?r.converter:it;this._$Em=s,this[s]=n.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Gt)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,r]of this._$Ep)this[a]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,r]of s)r.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge[be("elementProperties")]=new Map,ge[be("finalized")]=new Map,tt==null||tt({ReactiveElement:ge}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const fe=globalThis,Pe=fe.trustedTypes,Zt=Pe?Pe.createPolicy("lit-html",{createHTML:o=>o}):void 0,Jt="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,Qt="?"+Z,Js=`<${Qt}>`,te=document,be=()=>te.createComment(""),ge=o=>o===null||typeof o!="object"&&typeof o!="function",it=Array.isArray,Qs=o=>it(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",st=`[ -\f\r]`,me=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yt=/-->/g,Xt=/>/g,ie=RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ti=/"/g,ii=/^(?:script|style|textarea|title)$/i,Ys=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),f=Ys(1),U=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),si=new WeakMap,se=te.createTreeWalker(te,129);function oi(o,e){if(!it(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Zt!==void 0?Zt.createHTML(e):e}const Xs=(o,e)=>{const t=o.length-1,i=[];let s,a=e===2?"":e===3?"":"",n=me;for(let r=0;r"?(n=s??me,g=-1):b[1]===void 0?g=-2:(g=n.lastIndex-b[2].length,c=b[1],n=b[3]===void 0?ie:b[3]==='"'?ti:ei):n===ti||n===ei?n=ie:n===Yt||n===Xt?n=me:(n=ie,s=void 0);const y=n===ie&&o[r+1].startsWith("/>")?" ":"";a+=n===me?l+Js:g>=0?(i.push(c),l.slice(0,g)+Jt+l.slice(g)+Z+y):l+Z+(g===-2?r:y)}return[oi(o,a+(o[t]||"")+(e===2?"":e===3?"":"")),i]};class ve{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let a=0,n=0;const r=e.length-1,l=this.parts,[c,b]=Xs(e,t);if(this.el=ve.createElement(c,i),se.currentNode=this.el.content,t===2||t===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(s=se.nextNode())!==null&&l.length0){s.textContent=Pe?Pe.emptyScript:"";for(let y=0;y2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(e,t=this,i,s){const a=this.strings;let n=!1;if(a===void 0)e=de(this,e,t,0),n=!ge(e)||e!==this._$AH&&e!==U,n&&(this._$AH=e);else{const r=e;let l,c;for(e=a[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const a=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new ce(e.insertBefore(be(),a),a,void 0,t??{})}return s._$AI(o),s};/** + */const me=globalThis,je=me.trustedTypes,Jt=je?je.createPolicy("lit-html",{createHTML:o=>o}):void 0,Qt="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,Xt="?"+Z,Xs=`<${Xt}>`,se=document,ve=()=>se.createComment(""),ye=o=>o===null||typeof o!="object"&&typeof o!="function",st=Array.isArray,Ys=o=>st(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",ot=`[ +\f\r]`,we=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yt=/-->/g,ei=/>/g,oe=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ti=/'/g,ii=/"/g,si=/^(?:script|style|textarea|title)$/i,eo=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),u=eo(1),U=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),oi=new WeakMap,ae=se.createTreeWalker(se,129);function ai(o,e){if(!st(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Jt!==void 0?Jt.createHTML(e):e}const to=(o,e)=>{const t=o.length-1,i=[];let s,a=e===2?"":e===3?"":"",r=we;for(let n=0;n"?(r=s??we,g=-1):h[1]===void 0?g=-2:(g=r.lastIndex-h[2].length,d=h[1],r=h[3]===void 0?oe:h[3]==='"'?ii:ti):r===ii||r===ti?r=oe:r===Yt||r===ei?r=we:(r=oe,s=void 0);const y=r===oe&&o[n+1].startsWith("/>")?" ":"";a+=r===we?l+Xs:g>=0?(i.push(d),l.slice(0,g)+Qt+l.slice(g)+Z+y):l+Z+(g===-2?n:y)}return[ai(o,a+(o[t]||"")+(e===2?"":e===3?"":"")),i]};class _e{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let a=0,r=0;const n=e.length-1,l=this.parts,[d,h]=to(e,t);if(this.el=_e.createElement(d,i),ae.currentNode=this.el.content,t===2||t===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(s=ae.nextNode())!==null&&l.length0){s.textContent=je?je.emptyScript:"";for(let y=0;y2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,t=this,i,s){const a=this.strings;let r=!1;if(a===void 0)e=he(this,e,t,0),r=!ye(e)||e!==this._$AH&&e!==U,r&&(this._$AH=e);else{const n=e;let l,d;for(e=a[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const a=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new pe(e.insertBefore(ve(),a),a,void 0,t??{})}return s._$AI(o),s};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const je=globalThis,at=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nt=Symbol(),ai=new WeakMap;let ni=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==nt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(at&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=ai.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ai.set(t,e))}return e}toString(){return this.cssText}};const ro=o=>new ni(typeof o=="string"?o:o+"",void 0,nt),x=(o,...e)=>{const t=o.length===1?o[0]:e.reduce((i,s,a)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+o[a+1],o[0]);return new ni(t,o,nt)},lo=(o,e)=>{if(at)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=je.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,o.appendChild(i)}},ri=at?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return ro(t)})(o):o;/** + */const De=globalThis,rt=De.ShadowRoot&&(De.ShadyCSS===void 0||De.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nt=Symbol(),ri=new WeakMap;let ni=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==nt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(rt&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=ri.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ri.set(t,e))}return e}toString(){return this.cssText}};const co=o=>new ni(typeof o=="string"?o:o+"",void 0,nt),x=(o,...e)=>{const t=o.length===1?o[0]:e.reduce((i,s,a)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+o[a+1],o[0]);return new ni(t,o,nt)},uo=(o,e)=>{if(rt)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=De.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,o.appendChild(i)}},li=rt?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return co(t)})(o):o;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:co,defineProperty:uo,getOwnPropertyDescriptor:ho,getOwnPropertyNames:po,getOwnPropertySymbols:fo,getPrototypeOf:bo}=Object,J=globalThis,li=J.trustedTypes,go=li?li.emptyScript:"",rt=J.reactiveElementPolyfillSupport,ye=(o,e)=>o,lt={toAttribute(o,e){switch(e){case Boolean:o=o?go:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},di=(o,e)=>!co(o,e),ci={attribute:!0,type:String,converter:lt,reflect:!1,hasChanged:di};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),J.litPropertyMetadata??(J.litPropertyMetadata=new WeakMap);class ue extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ci){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&uo(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:a}=ho(this.prototype,e)??{get(){return this[t]},set(n){this[t]=n}};return{get(){return s==null?void 0:s.call(this)},set(n){const r=s==null?void 0:s.call(this);a.call(this,n),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ci}static _$Ei(){if(this.hasOwnProperty(ye("elementProperties")))return;const e=bo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ye("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ye("properties"))){const t=this.properties,i=[...po(t),...fo(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(ri(s))}else e!==void 0&&t.push(ri(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return lo(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var a;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const n=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:lt).toAttribute(t,i.type);this._$Em=e,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){var a;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const n=i.getPropertyOptions(s),r=typeof n.converter=="function"?{fromAttribute:n.converter}:((a=n.converter)==null?void 0:a.fromAttribute)!==void 0?n.converter:lt;this._$Em=s,this[s]=r.fromAttribute(t,n.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??di)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,n]of this._$Ep)this[a]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,n]of s)n.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}ue.elementStyles=[],ue.shadowRootOptions={mode:"open"},ue[ye("elementProperties")]=new Map,ue[ye("finalized")]=new Map,rt==null||rt({ReactiveElement:ue}),(J.reactiveElementVersions??(J.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:ho,defineProperty:po,getOwnPropertyDescriptor:fo,getOwnPropertyNames:bo,getOwnPropertySymbols:go,getPrototypeOf:mo}=Object,J=globalThis,di=J.trustedTypes,vo=di?di.emptyScript:"",lt=J.reactiveElementPolyfillSupport,$e=(o,e)=>o,dt={toAttribute(o,e){switch(e){case Boolean:o=o?vo:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch{t=null}}return t}},ci=(o,e)=>!ho(o,e),ui={attribute:!0,type:String,converter:dt,reflect:!1,hasChanged:ci};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),J.litPropertyMetadata??(J.litPropertyMetadata=new WeakMap);class fe extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ui){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&po(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:a}=fo(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const n=s==null?void 0:s.call(this);a.call(this,r),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ui}static _$Ei(){if(this.hasOwnProperty($e("elementProperties")))return;const e=mo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($e("properties"))){const t=this.properties,i=[...bo(t),...go(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(li(s))}else e!==void 0&&t.push(li(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return uo(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var a;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:dt).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var a;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),n=typeof r.converter=="function"?{fromAttribute:r.converter}:((a=r.converter)==null?void 0:a.fromAttribute)!==void 0?r.converter:dt;this._$Em=s,this[s]=n.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??ci)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,r]of this._$Ep)this[a]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,r]of s)r.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}fe.elementStyles=[],fe.shadowRootOptions={mode:"open"},fe[$e("elementProperties")]=new Map,fe[$e("finalized")]=new Map,lt==null||lt({ReactiveElement:fe}),(J.reactiveElementVersions??(J.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let oe=class extends ue{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=no(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return U}};oe._$litElement$=!0,oe.finalized=!0,(As=globalThis.litElementHydrateSupport)==null||As.call(globalThis,{LitElement:oe});const dt=globalThis.litElementPolyfillSupport;dt==null||dt({LitElement:oe}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/** + */let re=class extends fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=lo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return U}};re._$litElement$=!0,re.finalized=!0,(Os=globalThis.litElementHydrateSupport)==null||Os.call(globalThis,{LitElement:re});const ct=globalThis.litElementPolyfillSupport;ct==null||ct({LitElement:re}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ct={ATTRIBUTE:1,CHILD:2},ut=o=>(...e)=>({_$litDirective$:o,values:e});let ht=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + */const ut={ATTRIBUTE:1,CHILD:2},ht=o=>(...e)=>({_$litDirective$:o,values:e});let pt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const A=ut(class extends ht{constructor(o){var e;if(super(o),o.type!==ct.ATTRIBUTE||o.name!=="class"||((e=o.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(e=>o[e]).join(" ")+" "}update(o,[e]){var i,s;if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!((i=this.nt)!=null&&i.has(a))&&this.st.add(a);return this.render(e)}const t=o.element.classList;for(const a of this.st)a in e||(t.remove(a),this.st.delete(a));for(const a in e){const n=!!e[a];n===this.st.has(a)||(s=this.nt)!=null&&s.has(a)||(n?(t.add(a),this.st.add(a)):(t.remove(a),this.st.delete(a)))}return U}});/** + */const T=ht(class extends pt{constructor(o){var e;if(super(o),o.type!==ut.ATTRIBUTE||o.name!=="class"||((e=o.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(e=>o[e]).join(" ")+" "}update(o,[e]){var i,s;if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!((i=this.nt)!=null&&i.has(a))&&this.st.add(a);return this.render(e)}const t=o.element.classList;for(const a of this.st)a in e||(t.remove(a),this.st.delete(a));for(const a in e){const r=!!e[a];r===this.st.has(a)||(s=this.nt)!=null&&s.has(a)||(r?(t.add(a),this.st.add(a)):(t.remove(a),this.st.delete(a)))}return U}});/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const pt="lit-localize-status";/** + */const ft="lit-localize-status";/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const u=(o,...e)=>({strTag:!0,strings:o,values:e}),mo=o=>typeof o!="string"&&"strTag"in o,ui=(o,e,t)=>{let i=o[0];for(let s=1;s({strTag:!0,strings:o,values:e}),yo=o=>typeof o!="string"&&"strTag"in o,hi=(o,e,t)=>{let i=o[0];for(let s=1;smo(o)?ui(o.strings,o.values):o;let O=hi,pi=!1;function vo(o){if(pi)throw new Error("lit-localize can only be configured once");O=o,pi=!0}/** + */const pi=o=>yo(o)?hi(o.strings,o.values):o;let I=pi,fi=!1;function wo(o){if(fi)throw new Error("lit-localize can only be configured once");I=o,fi=!0}/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class yo{constructor(e){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(pt,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(pt,this.__litLocalizeEventHandler)}}const wo=o=>o.addController(new yo(o));/** + */class _o{constructor(e){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(ft,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(ft,this.__litLocalizeEventHandler)}}const $o=o=>o.addController(new _o(o));/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */class fi{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}/** + */class bi{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}/** * @license * Copyright 2014 Travis Webb * SPDX-License-Identifier: MIT - */const V=[];for(let o=0;o<256;o++)V[o]=(o>>4&15).toString(16)+(o&15).toString(16);function _o(o){let e=0,t=8997,i=0,s=33826,a=0,n=40164,r=0,l=52210;for(let c=0;c>>16,t=e&65535,a+=i>>>16,s=i&65535,l=r+(a>>>16)&65535,n=a&65535;return V[l>>8]+V[l&255]+V[n>>8]+V[n&255]+V[s>>8]+V[s&255]+V[t>>8]+V[t&255]}/** + */const V=[];for(let o=0;o<256;o++)V[o]=(o>>4&15).toString(16)+(o&15).toString(16);function xo(o){let e=0,t=8997,i=0,s=33826,a=0,r=40164,n=0,l=52210;for(let d=0;d>>16,t=e&65535,a+=i>>>16,s=i&65535,l=n+(a>>>16)&65535,r=a&65535;return V[l>>8]+V[l&255]+V[r>>8]+V[r&255]+V[s>>8]+V[s&255]+V[t>>8]+V[t&255]}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const $o="",xo="h",ko="s";function So(o,e){return(e?xo:ko)+_o(typeof o=="string"?o:o.join($o))}/** + */const ko="",So="h",Eo="s";function To(o,e){return(e?So:Eo)+xo(typeof o=="string"?o:o.join(ko))}/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const bi=new WeakMap,gi=new Map;function To(o,e,t){if(o){const i=(t==null?void 0:t.id)??Ao(e),s=o[i];if(s){if(typeof s=="string")return s;if("strTag"in s)return ui(s.strings,e.values,s.values);{let a=bi.get(s);return a===void 0&&(a=s.values,bi.set(s,a)),{...s,values:a.map(n=>e.values[n])}}}}return hi(e)}function Ao(o){const e=typeof o=="string"?o:o.strings;let t=gi.get(e);return t===void 0&&(t=So(e,typeof o!="string"&&!("strTag"in o)),gi.set(e,t)),t}/** + */const gi=new WeakMap,mi=new Map;function Ao(o,e,t){if(o){const i=(t==null?void 0:t.id)??Oo(e),s=o[i];if(s){if(typeof s=="string")return s;if("strTag"in s)return hi(s.strings,e.values,s.values);{let a=gi.get(s);return a===void 0&&(a=s.values,gi.set(s,a)),{...s,values:a.map(r=>e.values[r])}}}}return pi(e)}function Oo(o){const e=typeof o=="string"?o:o.strings;let t=mi.get(e);return t===void 0&&(t=To(e,typeof o!="string"&&!("strTag"in o)),mi.set(e,t)),t}/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function ft(o){window.dispatchEvent(new CustomEvent(pt,{detail:o}))}let De="",bt,mi,ze,gt,vi,ae=new fi;ae.resolve();let Re=0;const Eo=o=>(vo((e,t)=>To(vi,e,t)),De=mi=o.sourceLocale,ze=new Set(o.targetLocales),ze.add(o.sourceLocale),gt=o.loadLocale,{getLocale:Oo,setLocale:Co}),Oo=()=>De,Co=o=>{if(o===(bt??De))return ae.promise;if(!ze||!gt)throw new Error("Internal error");if(!ze.has(o))throw new Error("Invalid locale code");Re++;const e=Re;return bt=o,ae.settled&&(ae=new fi),ft({status:"loading",loadingLocale:o}),(o===mi?Promise.resolve({templates:void 0}):gt(o)).then(i=>{Re===e&&(De=o,bt=void 0,vi=i.templates,ft({status:"ready",readyLocale:o}),ae.resolve())},i=>{Re===e&&(ft({status:"error",errorLocale:o,errorMessage:i.toString()}),ae.reject(i))}),ae.promise},Lo=(o,e,t)=>{const i=o[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((s,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})},Io="en",Po=["am_ET","ar","ar_MA","bg_BG","bn_BD","bs_BA","cs","de_DE","el","en_US","es_419","es_ES","fa_IR","fr_FR","hi_IN","hr","hu_HU","id_ID","it_IT","ja","ko_KR","mk_MK","mr","my_MM","ne_NP","nl_NL","pa_IN","pl","pt_BR","ro_RO","ru_RU","sl_SI","sr_BA","sw","th","tl","tr_TR","uk","vi","zh_CN","zh_TW"],{setLocale:Mo}=Eo({sourceLocale:Io,targetLocales:Po,loadLocale:o=>Lo(Object.assign({"./generated/am_ET.js":()=>Promise.resolve().then(()=>Ba),"./generated/ar.js":()=>Promise.resolve().then(()=>Ga),"./generated/ar_MA.js":()=>Promise.resolve().then(()=>Ka),"./generated/bg_BG.js":()=>Promise.resolve().then(()=>Ja),"./generated/bn_BD.js":()=>Promise.resolve().then(()=>Ya),"./generated/bs_BA.js":()=>Promise.resolve().then(()=>en),"./generated/cs.js":()=>Promise.resolve().then(()=>sn),"./generated/de_DE.js":()=>Promise.resolve().then(()=>an),"./generated/el.js":()=>Promise.resolve().then(()=>rn),"./generated/en_US.js":()=>Promise.resolve().then(()=>dn),"./generated/es-419.js":()=>Promise.resolve().then(()=>un),"./generated/es_419.js":()=>Promise.resolve().then(()=>pn),"./generated/es_ES.js":()=>Promise.resolve().then(()=>bn),"./generated/fa_IR.js":()=>Promise.resolve().then(()=>mn),"./generated/fr_FR.js":()=>Promise.resolve().then(()=>yn),"./generated/hi_IN.js":()=>Promise.resolve().then(()=>_n),"./generated/hr.js":()=>Promise.resolve().then(()=>xn),"./generated/hu_HU.js":()=>Promise.resolve().then(()=>Sn),"./generated/id_ID.js":()=>Promise.resolve().then(()=>An),"./generated/it_IT.js":()=>Promise.resolve().then(()=>On),"./generated/ja.js":()=>Promise.resolve().then(()=>Ln),"./generated/ko_KR.js":()=>Promise.resolve().then(()=>Pn),"./generated/mk_MK.js":()=>Promise.resolve().then(()=>jn),"./generated/mr.js":()=>Promise.resolve().then(()=>zn),"./generated/my_MM.js":()=>Promise.resolve().then(()=>Nn),"./generated/ne_NP.js":()=>Promise.resolve().then(()=>Fn),"./generated/nl_NL.js":()=>Promise.resolve().then(()=>Vn),"./generated/pa_IN.js":()=>Promise.resolve().then(()=>Hn),"./generated/pl.js":()=>Promise.resolve().then(()=>Wn),"./generated/pt_BR.js":()=>Promise.resolve().then(()=>Zn),"./generated/ro_RO.js":()=>Promise.resolve().then(()=>Qn),"./generated/ru_RU.js":()=>Promise.resolve().then(()=>Xn),"./generated/sl_SI.js":()=>Promise.resolve().then(()=>tr),"./generated/sr_BA.js":()=>Promise.resolve().then(()=>sr),"./generated/sw.js":()=>Promise.resolve().then(()=>ar),"./generated/th.js":()=>Promise.resolve().then(()=>rr),"./generated/tl.js":()=>Promise.resolve().then(()=>dr),"./generated/tr_TR.js":()=>Promise.resolve().then(()=>ur),"./generated/uk.js":()=>Promise.resolve().then(()=>pr),"./generated/vi.js":()=>Promise.resolve().then(()=>br),"./generated/zh_CN.js":()=>Promise.resolve().then(()=>mr),"./generated/zh_TW.js":()=>Promise.resolve().then(()=>yr)}),`./generated/${o}.js`,3)});class mt{constructor(e,t="/wp-json"){this.nonce=e;let i=t;i.match("^http")&&(i=i.replace(/^http[s]?:\/\/.*?\//,"")),i=`/${i}/`.replace(/\/\//g,"/"),this.apiRoot=i}async makeRequest(e,t,i,s="dt/v1/"){let a=s;!a.endsWith("/")&&!t.startsWith("/")&&(a+="/");const n=t.startsWith("http")?t:`${this.apiRoot}${a}${t}`,r={method:e,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":this.nonce}};e!=="GET"&&(r.body=JSON.stringify(i));const l=await fetch(n,r),c=await l.json();if(!l.ok){const b=new Error((c==null?void 0:c.message)||c.toString());throw b.args={status:l.status,statusText:l.statusText,body:c},b}return c}async makeRequestOnPosts(e,t,i={}){return this.makeRequest(e,t,i,"dt-posts/v2/")}async getPost(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}`)}async createPost(e,t){return this.makeRequestOnPosts("POST",e,t)}async fetchPostsList(e,t){return this.makeRequestOnPosts("POST",`${e}/list`,t)}async updatePost(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}`,i)}async deletePost(e,t){return this.makeRequestOnPosts("DELETE",`${e}/${t}`)}async listPostsCompact(e,t=""){const i=new URLSearchParams({s:t});return this.makeRequestOnPosts("GET",`${e}/compact?${i}`)}async getPostDuplicates(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/all_duplicates`,i)}async checkFieldValueExists(e,t){return this.makeRequestOnPosts("POST",`${e}/check_field_value_exists`,t)}async getMultiSelectValues(e,t,i=""){const s=new URLSearchParams({s:i,field:t});return this.makeRequestOnPosts("GET",`${e}/multi-select-values?${s}`)}async getLocations(e,t,i,s=""){const a=new URLSearchParams({s,field:t,filter:i});return this.makeRequest("GET",`mapping_module/search_location_grid_by_name?${a}`)}async transferContact(e,t){return this.makeRequestOnPosts("POST","contacts/transfer",{contact_id:e,site_post_id:t})}async transferContactSummaryUpdate(e,t){return this.makeRequestOnPosts("POST","contacts/transfer/summary/send-update",{contact_id:e,update:t})}async requestRecordAccess(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}/request_record_access`,{user_id:i})}async createComment(e,t,i,s="comment"){return this.makeRequestOnPosts("POST",`${e}/${t}/comments`,{comment:i,comment_type:s})}async updateComment(e,t,i,s,a="comment"){return this.makeRequestOnPosts("POST",`${e}/${t}/comments/${i}`,{comment:s,comment_type:a})}async deleteComment(e,t,i){return this.makeRequestOnPosts("DELETE",`${e}/${t}/comments/${i}`)}async getComments(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/comments`)}async toggle_comment_reaction(e,t,i,s,a){return this.makeRequestOnPosts("POST",`${e}/${t}/comments/${i}/react`,{user_id:s,reaction:a})}async getPostActivity(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/activity`)}async getSingleActivity(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/activity/${i}`)}async revertActivity(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/revert/${i}`)}async getPostShares(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/shares`)}async addPostShare(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}/shares`,{user_id:i})}async removePostShare(e,t,i){return this.makeRequestOnPosts("DELETE",`${e}/${t}/shares`,{user_id:i})}async getFilters(){return this.makeRequest("GET","users/get_filters")}async saveFilters(e,t){return this.makeRequest("POST","users/save_filters",{filter:t,postType:e})}async deleteFilter(e,t){return this.makeRequest("DELETE","users/save_filters",{id:t,postType:e})}async searchUsers(e,t=""){const i=new URLSearchParams({s:t});return this.makeRequest("GET",`users/get_users?${i}&post_type=${e}`)}async checkDuplicateUsers(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/duplicates`)}async getContactInfo(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/`)}async createUser(e){return this.makeRequest("POST","users/create",e)}async advanced_search(e,t,i,s){return this.makeRequest("GET","advanced_search",{query:e,postType:t,offset:i,post:s.post,comment:s.comment,meta:s.meta,status:s.status},"dt-posts/v2/posts/search/")}}(function(){(function(o){const e=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,c=new WeakMap,b=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,w=new WeakMap,L=new WeakMap,N={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(h,d)=>{for(let p in N){d[p]=null;let m=null;const _=N[p];Object.defineProperty(d,p,{get(){return m},set(k){m=k,h.isConnected?P(h,_,k):b.set(h,d)}})}};function I(h){const d=s.get(h),{form:p}=d;Ls(h,p,d),Cs(h,d.labels)}const Le=(h,d=!1)=>{const p=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode(k){return s.has(k)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let m=p.nextNode();const _=!d||h.disabled;for(;m;)m.formDisabledCallback&&_&&Rt(m,h.disabled),m=p.nextNode()},Ze={attributes:!0,attributeFilter:["disabled","name"]},X=Ye()?new MutationObserver(h=>{for(const d of h){const p=d.target;if(d.attributeName==="disabled"&&(p.constructor.formAssociated?Rt(p,p.hasAttribute("disabled")):p.localName==="fieldset"&&Le(p)),d.attributeName==="name"&&p.constructor.formAssociated){const m=s.get(p),_=c.get(p);m.setFormValue(_)}}}):{};function T(h){h.forEach(d=>{const{addedNodes:p,removedNodes:m}=d,_=Array.from(p),k=Array.from(m);_.forEach(S=>{var j;if(s.has(S)&&S.constructor.formAssociated&&I(S),b.has(S)){const C=b.get(S);Object.keys(N).filter(F=>C[F]!==null).forEach(F=>{P(S,N[F],C[F])}),b.delete(S)}if(L.has(S)){const C=L.get(S);P(S,"internals-valid",C.validity.valid.toString()),P(S,"internals-invalid",(!C.validity.valid).toString()),P(S,"aria-invalid",(!C.validity.valid).toString()),L.delete(S)}if(S.localName==="form"){const C=l.get(S),G=document.createTreeWalker(S,NodeFilter.SHOW_ELEMENT,{acceptNode(Ut){return s.has(Ut)&&Ut.constructor.formAssociated&&!(C&&C.has(Ut))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let F=G.nextNode();for(;F;)I(F),F=G.nextNode()}S.localName==="fieldset"&&((j=X.observe)===null||j===void 0||j.call(X,S,Ze),Le(S,!0))}),k.forEach(S=>{const j=s.get(S);j&&i.get(j)&&Es(j),r.has(S)&&r.get(S).disconnect()})})}function z(h){h.forEach(d=>{const{removedNodes:p}=d;p.forEach(m=>{const _=y.get(d.target);s.has(m)&&Ps(m),_.disconnect()})})}const le=h=>{var d,p;const m=new MutationObserver(z);!((d=window==null?void 0:window.ShadyDOM)===null||d===void 0)&&d.inUse&&h.mode&&h.host&&(h=h.host),(p=m.observe)===null||p===void 0||p.call(m,h,{childList:!0}),y.set(h,m)};Ye()&&new MutationObserver(T);const ee={childList:!0,subtree:!0},P=(h,d,p)=>{h.getAttribute(d)!==p&&h.setAttribute(d,p)},Rt=(h,d)=>{h.toggleAttribute("internals-disabled",d),d?P(h,"aria-disabled","true"):h.removeAttribute("aria-disabled"),h.formDisabledCallback&&h.formDisabledCallback.apply(h,[d])},Es=h=>{i.get(h).forEach(p=>{p.remove()}),i.set(h,[])},Os=(h,d)=>{const p=document.createElement("input");return p.type="hidden",p.name=h.getAttribute("name"),h.after(p),i.get(d).push(p),p},wr=(h,d)=>{var p;i.set(d,[]),(p=X.observe)===null||p===void 0||p.call(X,h,Ze)},Cs=(h,d)=>{if(d.length){Array.from(d).forEach(m=>m.addEventListener("click",h.click.bind(h)));let p=d[0].id;d[0].id||(p=`${d[0].htmlFor}_Label`,d[0].id=p),P(h,"aria-labelledby",p)}},Je=h=>{const d=Array.from(h.elements).filter(k=>!k.tagName.includes("-")&&k.validity).map(k=>k.validity.valid),p=l.get(h)||[],m=Array.from(p).filter(k=>k.isConnected).map(k=>s.get(k).validity.valid),_=[...d,...m].includes(!1);h.toggleAttribute("internals-invalid",_),h.toggleAttribute("internals-valid",!_)},_r=h=>{Je(Qe(h.target))},$r=h=>{Je(Qe(h.target))},xr=h=>{const d=["button[type=submit]","input[type=submit]","button:not([type])"].map(p=>`${p}:not([disabled])`).map(p=>`${p}:not([form])${h.id?`,${p}[form='${h.id}']`:""}`).join(",");h.addEventListener("click",p=>{if(p.target.closest(d)){const _=l.get(h);if(h.noValidate)return;_.size&&Array.from(_).reverse().map(j=>s.get(j).reportValidity()).includes(!1)&&p.preventDefault()}})},kr=h=>{const d=l.get(h.target);d&&d.size&&d.forEach(p=>{p.constructor.formAssociated&&p.formResetCallback&&p.formResetCallback.apply(p)})},Ls=(h,d,p)=>{if(d){const m=l.get(d);if(m)m.add(h);else{const _=new Set;_.add(h),l.set(d,_),xr(d),d.addEventListener("reset",kr),d.addEventListener("input",_r),d.addEventListener("change",$r)}n.set(d,{ref:h,internals:p}),h.constructor.formAssociated&&h.formAssociatedCallback&&setTimeout(()=>{h.formAssociatedCallback.apply(h,[d])},0),Je(d)}},Qe=h=>{let d=h.parentNode;return d&&d.tagName!=="FORM"&&(d=Qe(d)),d},H=(h,d,p=DOMException)=>{if(!h.constructor.formAssociated)throw new p(d)},Is=(h,d,p)=>{const m=l.get(h);return m&&m.size&&m.forEach(_=>{s.get(_)[p]()||(d=!1)}),d},Ps=h=>{if(h.constructor.formAssociated){const d=s.get(h),{labels:p,form:m}=d;Cs(h,p),Ls(h,m,d)}};function Ye(){return typeof MutationObserver<"u"}class Sr{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const Tr=h=>(h.badInput=!1,h.customError=!1,h.patternMismatch=!1,h.rangeOverflow=!1,h.rangeUnderflow=!1,h.stepMismatch=!1,h.tooLong=!1,h.tooShort=!1,h.typeMismatch=!1,h.valid=!0,h.valueMissing=!1,h),Ar=(h,d,p)=>(h.valid=Er(d),Object.keys(d).forEach(m=>h[m]=d[m]),p&&Je(p),h),Er=h=>{let d=!0;for(let p in h)p!=="valid"&&h[p]!==!1&&(d=!1);return d},Nt=new WeakMap;function Ms(h,d){h.toggleAttribute(d,!0),h.part&&h.part.add(d)}class qt extends Set{static get isPolyfilled(){return!0}constructor(d){if(super(),!d||!d.tagName||d.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Nt.set(this,d)}add(d){if(!/^--/.test(d)||typeof d!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${d} must start with '--'.`);const p=super.add(d),m=Nt.get(this),_=`state${d}`;return m.isConnected?Ms(m,_):setTimeout(()=>{Ms(m,_)}),p}clear(){for(let[d]of this.entries())this.delete(d);super.clear()}delete(d){const p=super.delete(d),m=Nt.get(this);return m.isConnected?(m.toggleAttribute(`state${d}`,!1),m.part&&m.part.remove(`state${d}`)):setTimeout(()=>{m.toggleAttribute(`state${d}`,!1),m.part&&m.part.remove(`state${d}`)}),p}}function js(h,d,p,m){if(typeof d=="function"?h!==d||!0:!d.has(h))throw new TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?m:p==="a"?m.call(h):m?m.value:d.get(h)}function Or(h,d,p,m,_){if(typeof d=="function"?h!==d||!0:!d.has(h))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d.set(h,p),p}var Ie;class Cr{constructor(d){Ie.set(this,void 0),Or(this,Ie,d);for(let p=0;pG.compareDocumentPosition?G.compareDocumentPosition(F)&2?1:-1:0);return new Cr(C)}})}class Ds{static get isPolyfilled(){return!0}constructor(d){if(!d||!d.tagName||d.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const p=d.getRootNode(),m=new Sr;this.states=new qt(d),e.set(this,d),t.set(this,m),s.set(d,this),M(d,this),wr(d,this),Object.seal(this),p instanceof DocumentFragment&&le(p)}checkValidity(){const d=e.get(this);if(H(d,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const p=t.get(this);if(!p.valid){const m=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});d.dispatchEvent(m)}return p.valid}get form(){const d=e.get(this);H(d,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let p;return d.constructor.formAssociated===!0&&(p=Qe(d)),p}get labels(){const d=e.get(this);H(d,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const p=d.getAttribute("id"),m=d.getRootNode();return m&&p?m.querySelectorAll(`[for="${p}"]`):[]}reportValidity(){const d=e.get(this);if(H(d,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const p=this.checkValidity(),m=v.get(this);if(m&&!d.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!p&&m&&(d.focus(),m.focus()),p}setFormValue(d){const p=e.get(this);if(H(p,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Es(this),d!=null&&!(d instanceof FormData)){if(p.getAttribute("name")){const m=Os(p,this);m.value=d}}else d!=null&&d instanceof FormData&&Array.from(d).reverse().forEach(([m,_])=>{if(typeof _=="string"){const k=Os(p,this);k.name=m,k.value=_}});c.set(p,d)}setValidity(d,p,m){const _=e.get(this);if(H(_,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!d)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");v.set(this,m);const k=t.get(this),S={};for(const G in d)S[G]=d[G];Object.keys(S).length===0&&Tr(k);const j=Object.assign(Object.assign({},k),S);delete j.valid;const{valid:C}=Ar(k,j,this.form);if(!C&&!p)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,C?"":p),_.isConnected?(_.toggleAttribute("internals-invalid",!C),_.toggleAttribute("internals-valid",C),P(_,"aria-invalid",`${!C}`)):L.set(_,this)}get shadowRoot(){const d=e.get(this),p=g.get(d);return p||null}get validationMessage(){const d=e.get(this);return H(d,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const d=e.get(this);return H(d,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const d=e.get(this);return H(d,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(d.disabled||d.hasAttribute("disabled")||d.hasAttribute("readonly"))}}function Ir(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class h extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const d=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(d,h);const p=new h;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(m=>m in p.internals)}let zs=!1,Rs=!1;function Ft(h){Rs||(Rs=!0,window.CustomStateSet=qt,h&&(HTMLElement.prototype.attachInternals=function(...d){const p=h.call(this,d);return p.states=new qt(this),p}))}function Ns(h=!0){if(!zs){if(zs=!0,typeof window<"u"&&(window.ElementInternals=Ds),typeof CustomElementRegistry<"u"){const d=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(p,m,_){if(m.formAssociated){const k=m.prototype.connectedCallback;m.prototype.connectedCallback=function(){w.has(this)||(w.set(this,!0),this.hasAttribute("disabled")&&Rt(this,!0)),k!=null&&k.apply(this),Ps(this)}}d.call(this,p,m,_)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(s.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Ds(this)}),typeof Element<"u"){let d=function(...m){const _=p.apply(this,m);if(g.set(this,_),Ye()){const k=new MutationObserver(T);window.ShadyDOM?k.observe(this,ee):k.observe(_,ee),r.set(this,k)}return _};const p=Element.prototype.attachShadow;Element.prototype.attachShadow=d}Ye()&&typeof document<"u"&&new MutationObserver(T).observe(document.documentElement,ee),typeof HTMLFormElement<"u"&&Lr(),(h||typeof window<"u"&&!window.CustomStateSet)&&Ft()}}return!!customElements.polyfillWrapFlushCallback||(Ir()?typeof window<"u"&&!window.CustomStateSet&&Ft(HTMLElement.prototype.attachInternals):Ns(!1)),o.forceCustomStateSetPolyfill=Ft,o.forceElementInternalsPolyfill=Ns,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})();class R extends oe{static get properties(){return{RTL:{type:Boolean},locale:{type:String},apiRoot:{type:String,reflect:!1},postType:{type:String,reflect:!1},postID:{type:String,reflect:!1}}}get _focusTarget(){return this.shadowRoot.children[0]instanceof Element?this.shadowRoot.children[0]:null}constructor(){super(),wo(this),this.addEventListener("click",this._proxyClick.bind(this)),this.addEventListener("focus",this._proxyFocus.bind(this))}connectedCallback(){super.connectedCallback(),this.apiRoot=this.apiRoot?`${this.apiRoot}/`.replace("//","/"):"/",this.api=new mt(this.nonce,this.apiRoot)}willUpdate(e){if(this.RTL===void 0){const t=this.closest("[dir]");if(t){const i=t.getAttribute("dir");i&&(this.RTL=i.toLowerCase()==="rtl")}}if(!this.locale){const t=this.closest("[lang]");if(t){const i=t.getAttribute("lang");i&&(this.locale=i)}}if(!this.locale){const t=this.getRootNode();if(t instanceof ShadowRoot&&t.host){const i=t.host;i.locale&&(this.locale=i.locale)}}if(e&&e.has("locale")&&this.locale)try{Mo(this.locale)}catch(t){console.error(t)}}_proxyClick(){this.clicked=!0}_proxyFocus(){if(this._focusTarget){if(this.clicked){this.clicked=!1;return}this._focusTarget.focus()}}focus(){this._proxyFocus()}}class yi extends R{static get formAssociated(){return!0}static get styles(){return x` + */function bt(o){window.dispatchEvent(new CustomEvent(ft,{detail:o}))}let Fe="",gt,vi,Re,mt,yi,ne=new bi;ne.resolve();let Ne=0;const Co=o=>(wo((e,t)=>Ao(yi,e,t)),Fe=vi=o.sourceLocale,Re=new Set(o.targetLocales),Re.add(o.sourceLocale),mt=o.loadLocale,{getLocale:Lo,setLocale:Io}),Lo=()=>Fe,Io=o=>{if(o===(gt??Fe))return ne.promise;if(!Re||!mt)throw new Error("Internal error");if(!Re.has(o))throw new Error("Invalid locale code");Ne++;const e=Ne;return gt=o,ne.settled&&(ne=new bi),bt({status:"loading",loadingLocale:o}),(o===vi?Promise.resolve({templates:void 0}):mt(o)).then(i=>{Ne===e&&(Fe=o,gt=void 0,yi=i.templates,bt({status:"ready",readyLocale:o}),ne.resolve())},i=>{Ne===e&&(bt({status:"error",errorLocale:o,errorMessage:i.toString()}),ne.reject(i))}),ne.promise},Po=(o,e,t)=>{const i=o[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((s,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})},Mo="en",jo=["am_ET","ar","ar_MA","bg_BG","bn_BD","bs_BA","cs","de_DE","el","en_US","es_419","es_ES","fa_IR","fr_FR","hi_IN","hr","hu_HU","id_ID","it_IT","ja","ko_KR","mk_MK","mr","my_MM","ne_NP","nl_NL","pa_IN","pl","pt_BR","ro_RO","ru_RU","sl_SI","sr_BA","sw","th","tl","tr_TR","uk","vi","zh_CN","zh_TW"],{setLocale:zo}=Co({sourceLocale:Mo,targetLocales:jo,loadLocale:o=>Po(Object.assign({"./generated/am_ET.js":()=>Promise.resolve().then(()=>Ha),"./generated/ar.js":()=>Promise.resolve().then(()=>Wa),"./generated/ar_MA.js":()=>Promise.resolve().then(()=>Za),"./generated/bg_BG.js":()=>Promise.resolve().then(()=>Qa),"./generated/bn_BD.js":()=>Promise.resolve().then(()=>Ya),"./generated/bs_BA.js":()=>Promise.resolve().then(()=>tr),"./generated/cs.js":()=>Promise.resolve().then(()=>sr),"./generated/de_DE.js":()=>Promise.resolve().then(()=>ar),"./generated/el.js":()=>Promise.resolve().then(()=>nr),"./generated/en_US.js":()=>Promise.resolve().then(()=>dr),"./generated/es-419.js":()=>Promise.resolve().then(()=>ur),"./generated/es_419.js":()=>Promise.resolve().then(()=>pr),"./generated/es_ES.js":()=>Promise.resolve().then(()=>br),"./generated/fa_IR.js":()=>Promise.resolve().then(()=>mr),"./generated/fr_FR.js":()=>Promise.resolve().then(()=>yr),"./generated/hi_IN.js":()=>Promise.resolve().then(()=>_r),"./generated/hr.js":()=>Promise.resolve().then(()=>xr),"./generated/hu_HU.js":()=>Promise.resolve().then(()=>Sr),"./generated/id_ID.js":()=>Promise.resolve().then(()=>Tr),"./generated/it_IT.js":()=>Promise.resolve().then(()=>Or),"./generated/ja.js":()=>Promise.resolve().then(()=>Lr),"./generated/ko_KR.js":()=>Promise.resolve().then(()=>Pr),"./generated/mk_MK.js":()=>Promise.resolve().then(()=>jr),"./generated/mr.js":()=>Promise.resolve().then(()=>Dr),"./generated/my_MM.js":()=>Promise.resolve().then(()=>Rr),"./generated/ne_NP.js":()=>Promise.resolve().then(()=>qr),"./generated/nl_NL.js":()=>Promise.resolve().then(()=>Vr),"./generated/pa_IN.js":()=>Promise.resolve().then(()=>Hr),"./generated/pl.js":()=>Promise.resolve().then(()=>Wr),"./generated/pt_BR.js":()=>Promise.resolve().then(()=>Zr),"./generated/ro_RO.js":()=>Promise.resolve().then(()=>Qr),"./generated/ru_RU.js":()=>Promise.resolve().then(()=>Yr),"./generated/sl_SI.js":()=>Promise.resolve().then(()=>tn),"./generated/sr_BA.js":()=>Promise.resolve().then(()=>on),"./generated/sw.js":()=>Promise.resolve().then(()=>rn),"./generated/th.js":()=>Promise.resolve().then(()=>ln),"./generated/tl.js":()=>Promise.resolve().then(()=>cn),"./generated/tr_TR.js":()=>Promise.resolve().then(()=>hn),"./generated/uk.js":()=>Promise.resolve().then(()=>fn),"./generated/vi.js":()=>Promise.resolve().then(()=>gn),"./generated/zh_CN.js":()=>Promise.resolve().then(()=>vn),"./generated/zh_TW.js":()=>Promise.resolve().then(()=>wn)}),`./generated/${o}.js`,3)});class vt{constructor(e,t="/wp-json"){this.nonce=e;let i=t;i.match("^http")&&(i=i.replace(/^http[s]?:\/\/.*?\//,"")),i=`/${i}/`.replace(/\/\//g,"/"),this.apiRoot=i}async makeRequest(e,t,i,s="dt/v1/"){let a=s;!a.endsWith("/")&&!t.startsWith("/")&&(a+="/");const r=t.startsWith("http")?t:`${this.apiRoot}${a}${t}`,n={method:e,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":this.nonce}};e!=="GET"&&(n.body=JSON.stringify(i));const l=await fetch(r,n),d=await l.json();if(!l.ok){const h=new Error((d==null?void 0:d.message)||d.toString());throw h.args={status:l.status,statusText:l.statusText,body:d},h}return d}async makeRequestOnPosts(e,t,i={}){return this.makeRequest(e,t,i,"dt-posts/v2/")}async getPost(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}`)}async createPost(e,t){return this.makeRequestOnPosts("POST",e,t)}async fetchPostsList(e,t){return this.makeRequestOnPosts("POST",`${e}/list`,t)}async updatePost(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}`,i)}async deletePost(e,t){return this.makeRequestOnPosts("DELETE",`${e}/${t}`)}async listPostsCompact(e,t=""){const i=new URLSearchParams({s:t});return this.makeRequestOnPosts("GET",`${e}/compact?${i}`)}async getPostDuplicates(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/all_duplicates`,i)}async checkFieldValueExists(e,t){return this.makeRequestOnPosts("POST",`${e}/check_field_value_exists`,t)}async getMultiSelectValues(e,t,i=""){const s=new URLSearchParams({s:i,field:t});return this.makeRequestOnPosts("GET",`${e}/multi-select-values?${s}`)}async getLocations(e,t,i,s=""){const a=new URLSearchParams({s,field:t,filter:i});return this.makeRequest("GET",`mapping_module/search_location_grid_by_name?${a}`)}async transferContact(e,t){return this.makeRequestOnPosts("POST","contacts/transfer",{contact_id:e,site_post_id:t})}async transferContactSummaryUpdate(e,t){return this.makeRequestOnPosts("POST","contacts/transfer/summary/send-update",{contact_id:e,update:t})}async requestRecordAccess(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}/request_record_access`,{user_id:i})}async createComment(e,t,i,s="comment"){return this.makeRequestOnPosts("POST",`${e}/${t}/comments`,{comment:i,comment_type:s})}async updateComment(e,t,i,s,a="comment"){return this.makeRequestOnPosts("POST",`${e}/${t}/comments/${i}`,{comment:s,comment_type:a})}async deleteComment(e,t,i){return this.makeRequestOnPosts("DELETE",`${e}/${t}/comments/${i}`)}async getComments(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/comments`)}async toggle_comment_reaction(e,t,i,s,a){return this.makeRequestOnPosts("POST",`${e}/${t}/comments/${i}/react`,{user_id:s,reaction:a})}async getPostActivity(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/activity`)}async getSingleActivity(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/activity/${i}`)}async revertActivity(e,t,i){return this.makeRequestOnPosts("GET",`${e}/${t}/revert/${i}`)}async getPostShares(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/shares`)}async addPostShare(e,t,i){return this.makeRequestOnPosts("POST",`${e}/${t}/shares`,{user_id:i})}async removePostShare(e,t,i){return this.makeRequestOnPosts("DELETE",`${e}/${t}/shares`,{user_id:i})}async getFilters(){return this.makeRequest("GET","users/get_filters")}async saveFilters(e,t){return this.makeRequest("POST","users/save_filters",{filter:t,postType:e})}async deleteFilter(e,t){return this.makeRequest("DELETE","users/save_filters",{id:t,postType:e})}async searchUsers(e,t=""){const i=new URLSearchParams({s:t});return this.makeRequest("GET",`users/get_users?${i}&post_type=${e}`)}async checkDuplicateUsers(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/duplicates`)}async getContactInfo(e,t){return this.makeRequestOnPosts("GET",`${e}/${t}/`)}async createUser(e){return this.makeRequest("POST","users/create",e)}async advanced_search(e,t,i,s){return this.makeRequest("GET","advanced_search",{query:e,postType:t,offset:i,post:s.post,comment:s.comment,meta:s.meta,status:s.status},"dt-posts/v2/posts/search/")}}(function(){(function(o){const e=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,d=new WeakMap,h=new WeakMap,g=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakMap,O=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,c)=>{for(let b in C){c[b]=null;let v=null;const _=C[b];Object.defineProperty(c,b,{get(){return v},set(k){v=k,f.isConnected?j(f,_,k):h.set(f,c)}})}};function A(f){const c=s.get(f),{form:b}=c;Ps(f,b,c),Is(f,c.labels)}const ee=(f,c=!1)=>{const b=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(k){return s.has(k)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=b.nextNode();const _=!c||f.disabled;for(;v;)v.formDisabledCallback&&_&&Rt(v,f.disabled),v=b.nextNode()},Qe={attributes:!0,attributeFilter:["disabled","name"]},te=et()?new MutationObserver(f=>{for(const c of f){const b=c.target;if(c.attributeName==="disabled"&&(b.constructor.formAssociated?Rt(b,b.hasAttribute("disabled")):b.localName==="fieldset"&&ee(b)),c.attributeName==="name"&&b.constructor.formAssociated){const v=s.get(b),_=d.get(b);v.setFormValue(_)}}}):{};function E(f){f.forEach(c=>{const{addedNodes:b,removedNodes:v}=c,_=Array.from(b),k=Array.from(v);_.forEach(S=>{var D;if(s.has(S)&&S.constructor.formAssociated&&A(S),h.has(S)){const P=h.get(S);Object.keys(C).filter(q=>P[q]!==null).forEach(q=>{j(S,C[q],P[q])}),h.delete(S)}if(O.has(S)){const P=O.get(S);j(S,"internals-valid",P.validity.valid.toString()),j(S,"internals-invalid",(!P.validity.valid).toString()),j(S,"aria-invalid",(!P.validity.valid).toString()),O.delete(S)}if(S.localName==="form"){const P=l.get(S),K=document.createTreeWalker(S,NodeFilter.SHOW_ELEMENT,{acceptNode(Vt){return s.has(Vt)&&Vt.constructor.formAssociated&&!(P&&P.has(Vt))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let q=K.nextNode();for(;q;)A(q),q=K.nextNode()}S.localName==="fieldset"&&((D=te.observe)===null||D===void 0||D.call(te,S,Qe),ee(S,!0))}),k.forEach(S=>{const D=s.get(S);D&&i.get(D)&&Cs(D),n.has(S)&&n.get(S).disconnect()})})}function F(f){f.forEach(c=>{const{removedNodes:b}=c;b.forEach(v=>{const _=y.get(c.target);s.has(v)&&js(v),_.disconnect()})})}const ue=f=>{var c,b;const v=new MutationObserver(F);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&f.mode&&f.host&&(f=f.host),(b=v.observe)===null||b===void 0||b.call(v,f,{childList:!0}),y.set(f,v)};et()&&new MutationObserver(E);const ie={childList:!0,subtree:!0},j=(f,c,b)=>{f.getAttribute(c)!==b&&f.setAttribute(c,b)},Rt=(f,c)=>{f.toggleAttribute("internals-disabled",c),c?j(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[c])},Cs=f=>{i.get(f).forEach(b=>{b.remove()}),i.set(f,[])},Ls=(f,c)=>{const b=document.createElement("input");return b.type="hidden",b.name=f.getAttribute("name"),f.after(b),i.get(c).push(b),b},_n=(f,c)=>{var b;i.set(c,[]),(b=te.observe)===null||b===void 0||b.call(te,f,Qe)},Is=(f,c)=>{if(c.length){Array.from(c).forEach(v=>v.addEventListener("click",f.click.bind(f)));let b=c[0].id;c[0].id||(b=`${c[0].htmlFor}_Label`,c[0].id=b),j(f,"aria-labelledby",b)}},Xe=f=>{const c=Array.from(f.elements).filter(k=>!k.tagName.includes("-")&&k.validity).map(k=>k.validity.valid),b=l.get(f)||[],v=Array.from(b).filter(k=>k.isConnected).map(k=>s.get(k).validity.valid),_=[...c,...v].includes(!1);f.toggleAttribute("internals-invalid",_),f.toggleAttribute("internals-valid",!_)},$n=f=>{Xe(Ye(f.target))},xn=f=>{Xe(Ye(f.target))},kn=f=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(b=>`${b}:not([disabled])`).map(b=>`${b}:not([form])${f.id?`,${b}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",b=>{if(b.target.closest(c)){const _=l.get(f);if(f.noValidate)return;_.size&&Array.from(_).reverse().map(D=>s.get(D).reportValidity()).includes(!1)&&b.preventDefault()}})},Sn=f=>{const c=l.get(f.target);c&&c.size&&c.forEach(b=>{b.constructor.formAssociated&&b.formResetCallback&&b.formResetCallback.apply(b)})},Ps=(f,c,b)=>{if(c){const v=l.get(c);if(v)v.add(f);else{const _=new Set;_.add(f),l.set(c,_),kn(c),c.addEventListener("reset",Sn),c.addEventListener("input",$n),c.addEventListener("change",xn)}r.set(c,{ref:f,internals:b}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[c])},0),Xe(c)}},Ye=f=>{let c=f.parentNode;return c&&c.tagName!=="FORM"&&(c=Ye(c)),c},H=(f,c,b=DOMException)=>{if(!f.constructor.formAssociated)throw new b(c)},Ms=(f,c,b)=>{const v=l.get(f);return v&&v.size&&v.forEach(_=>{s.get(_)[b]()||(c=!1)}),c},js=f=>{if(f.constructor.formAssociated){const c=s.get(f),{labels:b,form:v}=c;Is(f,b),Ps(f,v,c)}};function et(){return typeof MutationObserver<"u"}class En{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const Tn=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),An=(f,c,b)=>(f.valid=On(c),Object.keys(c).forEach(v=>f[v]=c[v]),b&&Xe(b),f),On=f=>{let c=!0;for(let b in f)b!=="valid"&&f[b]!==!1&&(c=!1);return c},Nt=new WeakMap;function zs(f,c){f.toggleAttribute(c,!0),f.part&&f.part.add(c)}class qt extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Nt.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const b=super.add(c),v=Nt.get(this),_=`state${c}`;return v.isConnected?zs(v,_):setTimeout(()=>{zs(v,_)}),b}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const b=super.delete(c),v=Nt.get(this);return v.isConnected?(v.toggleAttribute(`state${c}`,!1),v.part&&v.part.remove(`state${c}`)):setTimeout(()=>{v.toggleAttribute(`state${c}`,!1),v.part&&v.part.remove(`state${c}`)}),b}}function Ds(f,c,b,v){if(typeof c=="function"?f!==c||!0:!c.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return b==="m"?v:b==="a"?v.call(f):v?v.value:c.get(f)}function Cn(f,c,b,v,_){if(typeof c=="function"?f!==c||!0:!c.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(f,b),b}var Pe;class Ln{constructor(c){Pe.set(this,void 0),Cn(this,Pe,c);for(let b=0;bK.compareDocumentPosition?K.compareDocumentPosition(q)&2?1:-1:0);return new Ln(P)}})}class Fs{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const b=c.getRootNode(),v=new En;this.states=new qt(c),e.set(this,c),t.set(this,v),s.set(c,this),M(c,this),_n(c,this),Object.seal(this),b instanceof DocumentFragment&&ue(b)}checkValidity(){const c=e.get(this);if(H(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const b=t.get(this);if(!b.valid){const v=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(v)}return b.valid}get form(){const c=e.get(this);H(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let b;return c.constructor.formAssociated===!0&&(b=Ye(c)),b}get labels(){const c=e.get(this);H(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const b=c.getAttribute("id"),v=c.getRootNode();return v&&b?v.querySelectorAll(`[for="${b}"]`):[]}reportValidity(){const c=e.get(this);if(H(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const b=this.checkValidity(),v=m.get(this);if(v&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!b&&v&&(c.focus(),v.focus()),b}setFormValue(c){const b=e.get(this);if(H(b,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Cs(this),c!=null&&!(c instanceof FormData)){if(b.getAttribute("name")){const v=Ls(b,this);v.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([v,_])=>{if(typeof _=="string"){const k=Ls(b,this);k.name=v,k.value=_}});d.set(b,c)}setValidity(c,b,v){const _=e.get(this);if(H(_,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");m.set(this,v);const k=t.get(this),S={};for(const K in c)S[K]=c[K];Object.keys(S).length===0&&Tn(k);const D=Object.assign(Object.assign({},k),S);delete D.valid;const{valid:P}=An(k,D,this.form);if(!P&&!b)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,P?"":b),_.isConnected?(_.toggleAttribute("internals-invalid",!P),_.toggleAttribute("internals-valid",P),j(_,"aria-invalid",`${!P}`)):O.set(_,this)}get shadowRoot(){const c=e.get(this),b=g.get(c);return b||null}get validationMessage(){const c=e.get(this);return H(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const c=e.get(this);return H(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const c=e.get(this);return H(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function Pn(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,f);const b=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(v=>v in b.internals)}let Rs=!1,Ns=!1;function Ut(f){Ns||(Ns=!0,window.CustomStateSet=qt,f&&(HTMLElement.prototype.attachInternals=function(...c){const b=f.call(this,c);return b.states=new qt(this),b}))}function qs(f=!0){if(!Rs){if(Rs=!0,typeof window<"u"&&(window.ElementInternals=Fs),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(b,v,_){if(v.formAssociated){const k=v.prototype.connectedCallback;v.prototype.connectedCallback=function(){w.has(this)||(w.set(this,!0),this.hasAttribute("disabled")&&Rt(this,!0)),k!=null&&k.apply(this),js(this)}}c.call(this,b,v,_)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(s.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Fs(this)}),typeof Element<"u"){let c=function(...v){const _=b.apply(this,v);if(g.set(this,_),et()){const k=new MutationObserver(E);window.ShadyDOM?k.observe(this,ie):k.observe(_,ie),n.set(this,k)}return _};const b=Element.prototype.attachShadow;Element.prototype.attachShadow=c}et()&&typeof document<"u"&&new MutationObserver(E).observe(document.documentElement,ie),typeof HTMLFormElement<"u"&&In(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ut()}}return!!customElements.polyfillWrapFlushCallback||(Pn()?typeof window<"u"&&!window.CustomStateSet&&Ut(HTMLElement.prototype.attachInternals):qs(!1)),o.forceCustomStateSetPolyfill=Ut,o.forceElementInternalsPolyfill=qs,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})();class R extends re{static get properties(){return{RTL:{type:Boolean},locale:{type:String},apiRoot:{type:String,reflect:!1},postType:{type:String,reflect:!1},postID:{type:String,reflect:!1}}}get _focusTarget(){return this.shadowRoot.children[0]instanceof Element?this.shadowRoot.children[0]:null}constructor(){super(),$o(this),this.addEventListener("click",this._proxyClick.bind(this)),this.addEventListener("focus",this._proxyFocus.bind(this))}connectedCallback(){super.connectedCallback(),this.apiRoot=this.apiRoot?`${this.apiRoot}/`.replace("//","/"):"/",this.api=new vt(this.nonce,this.apiRoot)}willUpdate(e){if(this.RTL===void 0){const t=this.closest("[dir]");if(t){const i=t.getAttribute("dir");i&&(this.RTL=i.toLowerCase()==="rtl")}}if(!this.locale){const t=this.closest("[lang]");if(t){const i=t.getAttribute("lang");i&&(this.locale=i)}}if(!this.locale){const t=this.getRootNode();if(t instanceof ShadowRoot&&t.host){const i=t.host;i.locale&&(this.locale=i.locale)}}if(e&&e.has("locale")&&this.locale)try{zo(this.locale)}catch(t){console.error(t)}}_proxyClick(){this.clicked=!0}_proxyFocus(){if(this._focusTarget){if(this.clicked){this.clicked=!1;return}this._focusTarget.focus()}}focus(){this._proxyFocus()}}class wi extends R{static get formAssociated(){return!0}static get styles(){return x` :host { display: inline-flex; width: fit-content; @@ -205,10 +205,10 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr cursor: not-allowed; } } - `}static get properties(){return{label:{type:String},context:{type:String},type:{type:String},title:{type:String},outline:{type:Boolean},round:{type:Boolean},disabled:{type:Boolean}}}get classes(){const e={"dt-button":!0,"dt-button--outline":this.outline,"dt-button--round":this.round},t=`dt-button--${this.context}`;return e[t]=!0,e}get _field(){return this.shadowRoot.querySelector("button")}get _focusTarget(){return this._field}constructor(){super(),this.context="default",this.internals=this.attachInternals()}handleClick(e){e.preventDefault(),this.type==="submit"&&this.internals.form&&this.internals.form.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))}render(){const e={...this.classes};return f` + `}static get properties(){return{label:{type:String},context:{type:String},type:{type:String},title:{type:String},outline:{type:Boolean},round:{type:Boolean},disabled:{type:Boolean}}}get classes(){const e={"dt-button":!0,"dt-button--outline":this.outline,"dt-button--round":this.round},t=`dt-button--${this.context}`;return e[t]=!0,e}get _field(){return this.shadowRoot.querySelector("button")}get _focusTarget(){return this._field}constructor(){super(),this.context="default",this.internals=this.attachInternals()}handleClick(e){e.preventDefault(),this.type==="submit"&&this.internals.form&&this.internals.form.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))}render(){const e={...this.classes};return u` - `}}window.customElements.define("dt-button",yi);/** + `}}window.customElements.define("dt-button",wi);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const wi="important",jo=" !"+wi,Q=ut(class extends ht{constructor(o){var e;if(super(o),o.type!==ct.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{const i=o[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[e]){const{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const a=typeof s=="string"&&s.endsWith(jo);i.includes("-")||a?t.setProperty(i,a?s.slice(0,-11):s,a?wi:""):t[i]=s}}return U}});class _i extends R{static get styles(){return x` + */const _i="important",Do=" !"+_i,Q=ht(class extends pt{constructor(o){var e;if(super(o),o.type!==ut.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{const i=o[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[e]){const{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const a=typeof s=="string"&&s.endsWith(Do);i.includes("-")||a?t.setProperty(i,a?s.slice(0,-11):s,a?_i:""):t[i]=s}}return U}});/** +* (c) Iconify +* +* For the full copyright and license information, please view the license.txt +* files at https://github.com/iconify/iconify +* +* Licensed under MIT. +* +* @license MIT +* @version 1.0.2 +*/const $i=Object.freeze({left:0,top:0,width:16,height:16}),qe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),xe=Object.freeze({...$i,...qe}),yt=Object.freeze({...xe,body:"",hidden:!1}),Fo=Object.freeze({width:null,height:null}),xi=Object.freeze({...Fo,...qe});function Ro(o,e=0){const t=o.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(t===""){const s=parseInt(o);return isNaN(s)?0:i(s)}else if(t!==o){let s=0;switch(t){case"%":s=25;break;case"deg":s=90}if(s){let a=parseFloat(o.slice(0,o.length-t.length));return isNaN(a)?0:(a=a/s,a%1===0?i(a):0)}}return e}const No=/[\s,]+/;function qo(o,e){e.split(No).forEach(t=>{switch(t.trim()){case"horizontal":o.hFlip=!0;break;case"vertical":o.vFlip=!0;break}})}const ki={...xi,preserveAspectRatio:""};function Si(o){const e={...ki},t=(i,s)=>o.getAttribute(i)||s;return e.width=t("width",null),e.height=t("height",null),e.rotate=Ro(t("rotate","")),qo(e,t("flip","")),e.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),e}function Uo(o,e){for(const t in ki)if(o[t]!==e[t])return!0;return!1}const ke=/^[a-z0-9]+(-[a-z0-9]+)*$/,Se=(o,e,t,i="")=>{const s=o.split(":");if(o.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const n=s.pop(),l=s.pop(),d={provider:s.length>0?s[0]:i,prefix:l,name:n};return e&&!Ue(d)?null:d}const a=s[0],r=a.split("-");if(r.length>1){const n={provider:i,prefix:r.shift(),name:r.join("-")};return e&&!Ue(n)?null:n}if(t&&i===""){const n={provider:i,prefix:"",name:a};return e&&!Ue(n,t)?null:n}return null},Ue=(o,e)=>o?!!((o.provider===""||o.provider.match(ke))&&(e&&o.prefix===""||o.prefix.match(ke))&&o.name.match(ke)):!1;function Vo(o,e){const t={};!o.hFlip!=!e.hFlip&&(t.hFlip=!0),!o.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((o.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Ei(o,e){const t=Vo(o,e);for(const i in yt)i in qe?i in o&&!(i in t)&&(t[i]=qe[i]):i in e?t[i]=e[i]:i in o&&(t[i]=o[i]);return t}function Bo(o,e){const t=o.icons,i=o.aliases||Object.create(null),s=Object.create(null);function a(r){if(t[r])return s[r]=[];if(!(r in s)){s[r]=null;const n=i[r]&&i[r].parent,l=n&&a(n);l&&(s[r]=[n].concat(l))}return s[r]}return Object.keys(t).concat(Object.keys(i)).forEach(a),s}function Ho(o,e,t){const i=o.icons,s=o.aliases||Object.create(null);let a={};function r(n){a=Ei(i[n]||s[n],a)}return r(e),t.forEach(r),Ei(o,a)}function Ti(o,e){const t=[];if(typeof o!="object"||typeof o.icons!="object")return t;o.not_found instanceof Array&&o.not_found.forEach(s=>{e(s,null),t.push(s)});const i=Bo(o);for(const s in i){const a=i[s];a&&(e(s,Ho(o,s,a)),t.push(s))}return t}const Ko={provider:"",aliases:{},not_found:{},...$i};function wt(o,e){for(const t in e)if(t in o&&typeof o[t]!=typeof e[t])return!1;return!0}function Ai(o){if(typeof o!="object"||o===null)return null;const e=o;if(typeof e.prefix!="string"||!o.icons||typeof o.icons!="object"||!wt(o,Ko))return null;const t=e.icons;for(const s in t){const a=t[s];if(!s.match(ke)||typeof a.body!="string"||!wt(a,yt))return null}const i=e.aliases||Object.create(null);for(const s in i){const a=i[s],r=a.parent;if(!s.match(ke)||typeof r!="string"||!t[r]&&!i[r]||!wt(a,yt))return null}return e}const Ve=Object.create(null);function Wo(o,e){return{provider:o,prefix:e,icons:Object.create(null),missing:new Set}}function X(o,e){const t=Ve[o]||(Ve[o]=Object.create(null));return t[e]||(t[e]=Wo(o,e))}function _t(o,e){return Ai(e)?Ti(e,(t,i)=>{i?o.icons[t]=i:o.missing.add(t)}):[]}function Go(o,e,t){try{if(typeof t.body=="string")return o.icons[e]={...t},!0}catch{}return!1}function Zo(o,e){let t=[];return(typeof o=="string"?[o]:Object.keys(Ve)).forEach(s=>{(typeof s=="string"&&typeof e=="string"?[e]:Object.keys(Ve[s]||{})).forEach(r=>{const n=X(s,r);t=t.concat(Object.keys(n.icons).map(l=>(s!==""?"@"+s+":":"")+r+":"+l))})}),t}let Ee=!1;function Oi(o){return typeof o=="boolean"&&(Ee=o),Ee}function Te(o){const e=typeof o=="string"?Se(o,!0,Ee):o;if(e){const t=X(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function Ci(o,e){const t=Se(o,!0,Ee);if(!t)return!1;const i=X(t.provider,t.prefix);return Go(i,t.name,e)}function Li(o,e){if(typeof o!="object")return!1;if(typeof e!="string"&&(e=o.provider||""),Ee&&!e&&!o.prefix){let s=!1;return Ai(o)&&(o.prefix="",Ti(o,(a,r)=>{r&&Ci(a,r)&&(s=!0)})),s}const t=o.prefix;if(!Ue({provider:e,prefix:t,name:"a"}))return!1;const i=X(e,t);return!!_t(i,o)}function Jo(o){return!!Te(o)}function Qo(o){const e=Te(o);return e?{...xe,...e}:null}function Xo(o){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);o.sort((s,a)=>s.provider!==a.provider?s.provider.localeCompare(a.provider):s.prefix!==a.prefix?s.prefix.localeCompare(a.prefix):s.name.localeCompare(a.name));let i={provider:"",prefix:"",name:""};return o.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const a=s.provider,r=s.prefix,n=s.name,l=t[a]||(t[a]=Object.create(null)),d=l[r]||(l[r]=X(a,r));let h;n in d.icons?h=e.loaded:r===""||d.missing.has(n)?h=e.missing:h=e.pending;const g={provider:a,prefix:r,name:n};h.push(g)}),e}function Ii(o,e){o.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(s=>s.id!==e))})}function Yo(o){o.pendingCallbacksFlag||(o.pendingCallbacksFlag=!0,setTimeout(()=>{o.pendingCallbacksFlag=!1;const e=o.loaderCallbacks?o.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=o.provider,s=o.prefix;e.forEach(a=>{const r=a.icons,n=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==s)return!0;const d=l.name;if(o.icons[d])r.loaded.push({provider:i,prefix:s,name:d});else if(o.missing.has(d))r.missing.push({provider:i,prefix:s,name:d});else return t=!0,!0;return!1}),r.pending.length!==n&&(t||Ii([o],a.id),a.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),a.abort))})}))}let ea=0;function ta(o,e,t){const i=ea++,s=Ii.bind(null,t,i);if(!e.pending.length)return s;const a={id:i,icons:e,callback:o,abort:s};return t.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(a)}),s}const $t=Object.create(null);function Pi(o,e){$t[o]=e}function xt(o){return $t[o]||$t[""]}function ia(o,e=!0,t=!1){const i=[];return o.forEach(s=>{const a=typeof s=="string"?Se(s,e,t):s;a&&i.push(a)}),i}var sa={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function oa(o,e,t,i){const s=o.resources.length,a=o.random?Math.floor(Math.random()*s):o.index;let r;if(o.random){let E=o.resources.slice(0);for(r=[];E.length>1;){const F=Math.floor(Math.random()*E.length);r.push(E[F]),E=E.slice(0,F).concat(E.slice(F+1))}r=r.concat(E)}else r=o.resources.slice(a).concat(o.resources.slice(0,a));const n=Date.now();let l="pending",d=0,h,g=null,m=[],y=[];typeof i=="function"&&y.push(i);function w(){g&&(clearTimeout(g),g=null)}function O(){l==="pending"&&(l="aborted"),w(),m.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),m=[]}function C(E,F){F&&(y=[]),typeof E=="function"&&y.push(E)}function M(){return{startTime:n,payload:e,status:l,queriesSent:d,queriesPending:m.length,subscribe:C,abort:O}}function A(){l="failed",y.forEach(E=>{E(void 0,h)})}function ee(){m.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),m=[]}function Qe(E,F,ue){const ie=F!=="success";switch(m=m.filter(j=>j!==E),l){case"pending":break;case"failed":if(ie||!o.dataAfterTimeout)return;break;default:return}if(F==="abort"){h=ue,A();return}if(ie){h=ue,m.length||(r.length?te():A());return}if(w(),ee(),!o.random){const j=o.resources.indexOf(E.resource);j!==-1&&j!==o.index&&(o.index=j)}l="completed",y.forEach(j=>{j(ue)})}function te(){if(l!=="pending")return;w();const E=r.shift();if(E===void 0){if(m.length){g=setTimeout(()=>{w(),l==="pending"&&(ee(),A())},o.timeout);return}A();return}const F={status:"pending",resource:E,callback:(ue,ie)=>{Qe(F,ue,ie)}};m.push(F),d++,g=setTimeout(te,o.rotate),t(E,e,F.callback)}return setTimeout(te),M}function Mi(o){const e={...sa,...o};let t=[];function i(){t=t.filter(n=>n().status==="pending")}function s(n,l,d){const h=oa(e,n,l,(g,m)=>{i(),d&&d(g,m)});return t.push(h),h}function a(n){return t.find(l=>n(l))||null}return{query:s,find:a,setIndex:n=>{e.index=n},getIndex:()=>e.index,cleanup:i}}function kt(o){let e;if(typeof o.resources=="string")e=[o.resources];else if(e=o.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:o.path||"/",maxURL:o.maxURL||500,rotate:o.rotate||750,timeout:o.timeout||5e3,random:o.random===!0,index:o.index||0,dataAfterTimeout:o.dataAfterTimeout!==!1}}const Be=Object.create(null),Ae=["https://api.simplesvg.com","https://api.unisvg.com"],He=[];for(;Ae.length>0;)Ae.length===1||Math.random()>.5?He.push(Ae.shift()):He.push(Ae.pop());Be[""]=kt({resources:["https://api.iconify.design"].concat(He)});function ji(o,e){const t=kt(e);return t===null?!1:(Be[o]=t,!0)}function Ke(o){return Be[o]}function aa(){return Object.keys(Be)}function zi(){}const St=Object.create(null);function ra(o){if(!St[o]){const e=Ke(o);if(!e)return;const t=Mi(e),i={config:e,redundancy:t};St[o]=i}return St[o]}function Di(o,e,t){let i,s;if(typeof o=="string"){const a=xt(o);if(!a)return t(void 0,424),zi;s=a.send;const r=ra(o);r&&(i=r.redundancy)}else{const a=kt(o);if(a){i=Mi(a);const r=o.resources?o.resources[0]:"",n=xt(r);n&&(s=n.send)}}return!i||!s?(t(void 0,424),zi):i.query(e,s,t)().abort}const Fi="iconify2",Oe="iconify",Ri=Oe+"-count",Ni=Oe+"-version",qi=36e5,na=168;function Et(o,e){try{return o.getItem(e)}catch{}}function Tt(o,e,t){try{return o.setItem(e,t),!0}catch{}}function Ui(o,e){try{o.removeItem(e)}catch{}}function At(o,e){return Tt(o,Ri,e.toString())}function Ot(o){return parseInt(Et(o,Ri))||0}const le={local:!0,session:!0},Vi={local:new Set,session:new Set};let Ct=!1;function la(o){Ct=o}let We=typeof window>"u"?{}:window;function Bi(o){const e=o+"Storage";try{if(We&&We[e]&&typeof We[e].length=="number")return We[e]}catch{}le[o]=!1}function Hi(o,e){const t=Bi(o);if(!t)return;const i=Et(t,Ni);if(i!==Fi){if(i){const n=Ot(t);for(let l=0;l{const l=Oe+n.toString(),d=Et(t,l);if(typeof d=="string"){try{const h=JSON.parse(d);if(typeof h=="object"&&typeof h.cached=="number"&&h.cached>s&&typeof h.provider=="string"&&typeof h.data=="object"&&typeof h.data.prefix=="string"&&e(h,n))return!0}catch{}Ui(t,l)}};let r=Ot(t);for(let n=r-1;n>=0;n--)a(n)||(n===r-1?(r--,At(t,r)):Vi[o].add(n))}function Ki(){if(!Ct){la(!0);for(const o in le)Hi(o,e=>{const t=e.data,i=e.provider,s=t.prefix,a=X(i,s);if(!_t(a,t).length)return!1;const r=t.lastModified||-1;return a.lastModifiedCached=a.lastModifiedCached?Math.min(a.lastModifiedCached,r):r,!0})}}function da(o,e){const t=o.lastModifiedCached;if(t&&t>=e)return t===e;if(o.lastModifiedCached=e,t)for(const i in le)Hi(i,s=>{const a=s.data;return s.provider!==o.provider||a.prefix!==o.prefix||a.lastModified===e});return!0}function ca(o,e){Ct||Ki();function t(i){let s;if(!le[i]||!(s=Bi(i)))return;const a=Vi[i];let r;if(a.size)a.delete(r=Array.from(a).shift());else if(r=Ot(s),!At(s,r+1))return;const n={cached:Math.floor(Date.now()/qi),provider:o.provider,data:e};return Tt(s,Oe+r.toString(),JSON.stringify(n))}e.lastModified&&!da(o,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),t("local")||t("session"))}function Wi(){}function ua(o){o.iconsLoaderFlag||(o.iconsLoaderFlag=!0,setTimeout(()=>{o.iconsLoaderFlag=!1,Yo(o)}))}function ha(o,e){o.iconsToLoad?o.iconsToLoad=o.iconsToLoad.concat(e).sort():o.iconsToLoad=e,o.iconsQueueFlag||(o.iconsQueueFlag=!0,setTimeout(()=>{o.iconsQueueFlag=!1;const{provider:t,prefix:i}=o,s=o.iconsToLoad;delete o.iconsToLoad;let a;if(!s||!(a=xt(t)))return;a.prepare(t,i,s).forEach(n=>{Di(t,n,l=>{if(typeof l!="object")n.icons.forEach(d=>{o.missing.add(d)});else try{const d=_t(o,l);if(!d.length)return;const h=o.pendingIcons;h&&d.forEach(g=>{h.delete(g)}),ca(o,l)}catch(d){console.error(d)}ua(o)})})}))}const Lt=(o,e)=>{const t=ia(o,!0,Oi()),i=Xo(t);if(!i.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(i.loaded,i.missing,i.pending,Wi)}),()=>{l=!1}}const s=Object.create(null),a=[];let r,n;return i.pending.forEach(l=>{const{provider:d,prefix:h}=l;if(h===n&&d===r)return;r=d,n=h,a.push(X(d,h));const g=s[d]||(s[d]=Object.create(null));g[h]||(g[h]=[])}),i.pending.forEach(l=>{const{provider:d,prefix:h,name:g}=l,m=X(d,h),y=m.pendingIcons||(m.pendingIcons=new Set);y.has(g)||(y.add(g),s[d][h].push(g))}),a.forEach(l=>{const{provider:d,prefix:h}=l;s[d][h].length&&ha(l,s[d][h])}),e?ta(e,i,a):Wi},pa=o=>new Promise((e,t)=>{const i=typeof o=="string"?Se(o,!0):o;if(!i){t(o);return}Lt([i||o],s=>{if(s.length&&i){const a=Te(i);if(a){e({...xe,...a});return}}t(o)})});function fa(o){try{const e=typeof o=="string"?JSON.parse(o):o;if(typeof e.body=="string")return{...e}}catch{}}function ba(o,e){const t=typeof o=="string"?Se(o,!0,!0):null;if(!t){const a=fa(o);return{value:o,data:a}}const i=Te(t);if(i!==void 0||!t.prefix)return{value:o,name:t,data:i};const s=Lt([t],()=>e(o,t,Te(t)));return{value:o,name:t,loading:s}}function It(o){return o.hasAttribute("inline")}let Gi=!1;try{Gi=navigator.vendor.indexOf("Apple")===0}catch{}function ga(o,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Gi||o.indexOf("{const w=[],O=y.hFlip,C=y.vFlip;let M=y.rotate;O?C?M+=2:(w.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),w.push("scale(-1 1)"),s.top=s.left=0):C&&(w.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),w.push("scale(1 -1)"),s.top=s.left=0);let A;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:A=s.height/2+s.top,w.unshift("rotate(90 "+A.toString()+" "+A.toString()+")");break;case 2:w.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:A=s.width/2+s.left,w.unshift("rotate(-90 "+A.toString()+" "+A.toString()+")");break}M%2===1&&(s.left!==s.top&&(A=s.left,s.left=s.top,s.top=A),s.width!==s.height&&(A=s.width,s.width=s.height,s.height=A)),w.length&&(a=''+a+"")});const r=i.width,n=i.height,l=s.width,d=s.height;let h,g;return r===null?(g=n===null?"1em":n==="auto"?d:n,h=Pt(g,l/d)):(h=r==="auto"?l:r,g=n===null?Pt(h,d/l):n==="auto"?d:n),{attributes:{width:h.toString(),height:g.toString(),viewBox:s.left.toString()+" "+s.top.toString()+" "+l.toString()+" "+d.toString()},body:a}}let Ge=(()=>{let o;try{if(o=fetch,typeof o=="function")return o}catch{}})();function ya(o){Ge=o}function wa(){return Ge}function _a(o,e){const t=Ke(o);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let s=0;t.resources.forEach(r=>{s=Math.max(s,r.length)});const a=e+".json?icons=";i=t.maxURL-s-t.path.length-a.length}return i}function $a(o){return o===404}const xa=(o,e,t)=>{const i=[],s=_a(o,e),a="icons";let r={type:a,provider:o,prefix:e,icons:[]},n=0;return t.forEach((l,d)=>{n+=l.length+1,n>=s&&d>0&&(i.push(r),r={type:a,provider:o,prefix:e,icons:[]},n=l.length),r.icons.push(l)}),i.push(r),i};function ka(o){if(typeof o=="string"){const e=Ke(o);if(e)return e.path}return"/"}const Sa={prepare:xa,send:(o,e,t)=>{if(!Ge){t("abort",424);return}let i=ka(e.provider);switch(e.type){case"icons":{const a=e.prefix,n=e.icons.join(","),l=new URLSearchParams({icons:n});i+=a+".json?"+l.toString();break}case"custom":{const a=e.uri;i+=a.slice(0,1)==="/"?a.slice(1):a;break}default:t("abort",400);return}let s=503;Ge(o+i).then(a=>{const r=a.status;if(r!==200){setTimeout(()=>{t($a(r)?"abort":"next",r)});return}return s=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?t("abort",a):t("next",s)});return}setTimeout(()=>{t("success",a)})}).catch(()=>{t("next",s)})}};function Ji(o,e){switch(o){case"local":case"session":le[o]=e;break;case"all":for(const t in le)le[t]=e;break}}function Qi(){Pi("",Sa),Oi(!0);let o;try{o=window}catch{}if(o){if(Ki(),o.IconifyPreload!==void 0){const t=o.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(s=>{try{(typeof s!="object"||s===null||s instanceof Array||typeof s.icons!="object"||typeof s.prefix!="string"||!Li(s))&&console.error(i)}catch{console.error(i)}})}if(o.IconifyProviders!==void 0){const t=o.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const s="IconifyProviders["+i+"] is invalid.";try{const a=t[i];if(typeof a!="object"||!a||a.resources===void 0)continue;ji(i,a)||console.error(s)}catch{console.error(s)}}}}return{enableCache:t=>Ji(t,!0),disableCache:t=>Ji(t,!1),iconExists:Jo,getIcon:Qo,listIcons:Zo,addIcon:Ci,addCollection:Li,calculateSize:Pt,buildIcon:Zi,loadIcons:Lt,loadIcon:pa,addAPIProvider:ji,_api:{getAPIConfig:Ke,setAPIModule:Pi,sendAPIQuery:Di,setFetch:ya,getFetch:wa,listAPIProviders:aa}}}function Xi(o,e){let t=o.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'"+o+""}function Ea(o){return o.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Ta(o){return'url("data:image/svg+xml,'+Ea(o)+'")'}const Mt={"background-color":"currentColor"},Yi={"background-color":"transparent"},es={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ts={"-webkit-mask":Mt,mask:Mt,background:Yi};for(const o in ts){const e=ts[o];for(const t in es)e[o+"-"+t]=es[t]}function is(o){return o+(o.match(/^[-0-9.]+$/)?"px":"")}function Aa(o,e,t){const i=document.createElement("span");let s=o.body;s.indexOf("");const a=o.attributes,r=Xi(s,{...a,width:e.width+"",height:e.height+""}),n=Ta(r),l=i.style,d={"--svg":n,width:is(a.width),height:is(a.height),...t?Mt:Yi};for(const h in d)l.setProperty(h,d[h]);return i}function Oa(o){const e=document.createElement("span");return e.innerHTML=Xi(o.body,o.attributes),e.firstChild}function ss(o,e){const t=e.icon.data,i=e.customisations,s=Zi(t,i);i.preserveAspectRatio&&(s.attributes.preserveAspectRatio=i.preserveAspectRatio);const a=e.renderedMode;let r;switch(a){case"svg":r=Oa(s);break;default:r=Aa(s,{...xe,...t},a==="mask")}const n=Array.from(o.childNodes).find(l=>{const d=l.tagName&&l.tagName.toUpperCase();return d==="SPAN"||d==="SVG"});n?r.tagName==="SPAN"&&n.tagName===r.tagName?n.setAttribute("style",r.getAttribute("style")):o.replaceChild(r,n):o.appendChild(r)}const jt="data-style";function os(o,e){let t=Array.from(o.childNodes).find(i=>i.hasAttribute&&i.hasAttribute(jt));t||(t=document.createElement("style"),t.setAttribute(jt,jt),o.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"}function as(o,e,t){const i=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:e,icon:o,lastRender:i}}function Ca(o="iconify-icon"){let e,t;try{e=window.customElements,t=window.HTMLElement}catch{return}if(!e||!t)return;const i=e.get(o);if(i)return i;const s=["icon","mode","inline","width","height","rotate","flip"],a=class extends t{constructor(){super();Me(this,"_shadowRoot");Me(this,"_state");Me(this,"_checkQueued",!1);const l=this._shadowRoot=this.attachShadow({mode:"open"}),d=It(this);os(l,d),this._state=as({value:""},d),this._queueCheck()}static get observedAttributes(){return s.slice(0)}attributeChangedCallback(l){if(l==="inline"){const d=It(this),h=this._state;d!==h.inline&&(h.inline=d,os(this._shadowRoot,d))}else this._queueCheck()}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return It(this)}set inline(l){this.setAttribute("inline",l?"true":null)}restartAnimation(){const l=this._state;if(l.rendered){const d=this._shadowRoot;if(l.renderedMode==="svg")try{d.lastChild.setCurrentTime(0);return}catch{}ss(d,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,d=this.getAttribute("icon");if(d!==l.icon.value){this._iconChanged(d);return}if(!l.rendered)return;const h=this.getAttribute("mode"),g=Si(this);(l.attrMode!==h||Uo(l.customisations,g))&&this._renderIcon(l.icon,g,h)}_iconChanged(l){const d=ba(l,(h,g,m)=>{const y=this._state;if(y.rendered||this.getAttribute("icon")!==h)return;const w={value:h,name:g,data:m};w.data?this._gotIconData(w):y.icon=w});d.data?this._gotIconData(d):this._state=as(d,this._state.inline,this._state)}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,Si(this),this.getAttribute("mode"))}_renderIcon(l,d,h){const g=ga(l.data.body,h),m=this._state.inline;ss(this._shadowRoot,this._state={rendered:!0,icon:l,inline:m,customisations:d,attrMode:h,renderedMode:g})}};s.forEach(n=>{n in a.prototype||Object.defineProperty(a.prototype,n,{get:function(){return this.getAttribute(n)},set:function(l){this.setAttribute(n,l)}})});const r=Qi();for(const n in r)a[n]=a.prototype[n]=r[n];return e.define(o,a),a}const La=Ca()||Qi(),{enableCache:Nn,disableCache:qn,iconExists:Un,getIcon:Vn,listIcons:Bn,addIcon:Hn,addCollection:Kn,calculateSize:Wn,buildIcon:Gn,loadIcons:Zn,loadIcon:Jn,addAPIProvider:Qn,_api:Xn}=La;class rs extends R{static get styles(){return x` + :root { + pointer-events: none; + } + :root, + .icon-container { + font-size: inherit; + color: inherit; + display: inline-flex; + width: fit-content; + height: fit-content; + position: relative; + font-family: var(--font-family); + pointer-events: auto; + } + .tooltip { + --tt-padding: 0.25rem; + position: absolute; + right: 0px; + top: calc(-1lh - var(--tt-padding) - var(--tt-padding) - 4px); + min-width: max-content; + border: solid 1px currentcolor; + background-color: color( + from var(--dt-form-background-color, var(--surface-1)) srgb 1 1 1 / + 0.7 + ); + padding: var(--tt-padding); + border-radius: 0.25rem; + text-align: end; + z-index: 1; + display: block; + } + .tooltip:before { + position: absolute; + right: 0.7rem; + top: calc(1lh + var(--tt-padding) + var(--tt-padding) + 1px); + content: ' '; + border-width: 0.25rem; + border-style: solid; + border-color: currentcolor transparent transparent transparent; + } + .tooltip[hidden] { + display: none; + } + + .tooltip.slotted .attr-msg { + display: none; + } + + .tooltip:hover { + opacity: 0.25; + } + `}static get properties(){return{...super.properties,icon:{type:String},tooltip:{type:String},tooltip_open:{type:Boolean},size:{type:String},slotted:{type:Boolean,attribute:!1}}}firstUpdated(){const e=this.shadowRoot.querySelector("slot[name=tooltip]");e&&e.addEventListener("slotchange",t=>{const s=t.target.assignedNodes();let a=!1;s.length>0&&(s[0].tagName==="SLOT"?a=s[0].assignedNodes().length>0:a=!0),this.slotted=a})}_toggleTooltip(){this.tooltip_open?this.tooltip_open=!1:this.tooltip_open=!0}tooltipClasses(){return{tooltip:!0,slotted:this.slotted}}render(){const e=this.tooltip?u`
+ + ${this.tooltip} +
`:null;return u` +
+ + ${e} +
+ `}}window.customElements.define("dt-icon",rs);class ns extends R{static get styles(){return x` :host { font-family: var(--font-family); font-size: var(--dt-label-font-size, 14px); @@ -253,7 +331,8 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .icon { height: var(--dt-label-font-size, 14px); width: auto; - display: inline-block; + display: inline-flex; + align-items: center; &:empty, &:has(slot:not(.slotted):empty) { @@ -261,6 +340,12 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr } } + .icon dt-icon, + .icon img { + height: 100%; + width: auto; + } + .icon.private { position: relative; flex-grow: 1; @@ -290,19 +375,19 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr border-inline-start: 0.5rem solid transparent; border-inline-end: 0.5rem solid transparent; } - `}static get properties(){return{icon:{type:String},iconAltText:{type:String},private:{type:Boolean},privateLabel:{type:String}}}firstUpdated(){const e=this.shadowRoot.querySelectorAll("slot");if(e&&e.length)for(const n of e)n.addEventListener("slotchange",r=>{const l=r.target.assignedNodes();let c=!1;l.length&&(l[0].tagName==="SLOT"?c=l[0].assignedNodes().length||l[0].children.length:c=!0),c&&r.target.classList.add("slotted")});const i=this.shadowRoot.querySelector("slot[name=icon-start]").assignedElements({flatten:!0});for(const n of i)n.style.height="100%",n.style.width="auto";const s=this.shadowRoot.querySelector("slot:not([name])"),a=this.shadowRoot.querySelector(".label");if(s&&a){const n=s.assignedNodes().map(r=>{var l;return(l=r.textContent)==null?void 0:l.trim()}).filter(r=>r).join(" ");n&&a.setAttribute("title",n)}}get _slottedChildren(){return this.shadowRoot.querySelector("slot").assignedElements({flatten:!0})}render(){const e=f``;return f` + `}static get properties(){return{icon:{type:String},iconAltText:{type:String},private:{type:Boolean},privateLabel:{type:String}}}firstUpdated(){const e=this.shadowRoot.querySelectorAll("slot");if(e&&e.length)for(const r of e)r.addEventListener("slotchange",n=>{const l=n.target.assignedNodes();let d=!1;l.length&&(l[0].tagName==="SLOT"?d=l[0].assignedNodes().length||l[0].children.length:d=!0),d&&n.target.classList.add("slotted")});const i=this.shadowRoot.querySelector("slot[name=icon-start]").assignedElements({flatten:!0});for(const r of i)r.style.height="100%",r.style.width="auto";const s=this.shadowRoot.querySelector("slot:not([name])"),a=this.shadowRoot.querySelector(".label");if(s&&a){const r=s.assignedNodes().map(n=>{var l;return(l=n.textContent)==null?void 0:l.trim()}).filter(n=>n).join(" ");r&&a.setAttribute("title",r)}}get _slottedChildren(){return this.shadowRoot.querySelector("slot").assignedElements({flatten:!0})}_mdiToIconify(e){return/^mdi\s+mdi-/.test(e)?e.replace(/^mdi\s+mdi-/,"mdi:"):/^mdi-/.test(e)?e.replace(/^mdi-/,"mdi:"):e}_renderIconContent(){if(!this.icon||!this.icon.trim())return null;const e=this.icon.trim();return!(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("data:"))&&e.toLowerCase().includes("mdi")?u``:u`${this.iconAltText||`}render(){const e=u``;return u`
${this.icon?f`${this.iconAltText}`:null}${this._renderIconContent()} - ${this.private?f` + ${this.private?u` ${e} ${this.privateLabel||O("Private Field: Only I can see its content")}${this.privateLabel||I("Private Field: Only I can see its content")} `:null} @@ -310,7 +395,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr
- `}}window.customElements.define("dt-label",_i);class Do extends oe{static get styles(){return x` + `}}window.customElements.define("dt-label",ns);class Ia extends re{static get styles(){return x` @keyframes spin { 0% { transform: rotate(0deg); @@ -331,85 +416,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr height: var(--dt-spinner-size, 1rem); width: var(--dt-spinner-size, 1rem); } - `}}window.customElements.define("dt-spinner",Do);/** -* (c) Iconify -* -* For the full copyright and license information, please view the license.txt -* files at https://github.com/iconify/iconify -* -* Licensed under MIT. -* -* @license MIT -* @version 1.0.2 -*/const $i=Object.freeze({left:0,top:0,width:16,height:16}),Ne=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),we=Object.freeze({...$i,...Ne}),vt=Object.freeze({...we,body:"",hidden:!1}),zo=Object.freeze({width:null,height:null}),xi=Object.freeze({...zo,...Ne});function Ro(o,e=0){const t=o.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(t===""){const s=parseInt(o);return isNaN(s)?0:i(s)}else if(t!==o){let s=0;switch(t){case"%":s=25;break;case"deg":s=90}if(s){let a=parseFloat(o.slice(0,o.length-t.length));return isNaN(a)?0:(a=a/s,a%1===0?i(a):0)}}return e}const No=/[\s,]+/;function qo(o,e){e.split(No).forEach(t=>{switch(t.trim()){case"horizontal":o.hFlip=!0;break;case"vertical":o.vFlip=!0;break}})}const ki={...xi,preserveAspectRatio:""};function Si(o){const e={...ki},t=(i,s)=>o.getAttribute(i)||s;return e.width=t("width",null),e.height=t("height",null),e.rotate=Ro(t("rotate","")),qo(e,t("flip","")),e.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),e}function Fo(o,e){for(const t in ki)if(o[t]!==e[t])return!0;return!1}const _e=/^[a-z0-9]+(-[a-z0-9]+)*$/,$e=(o,e,t,i="")=>{const s=o.split(":");if(o.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const r=s.pop(),l=s.pop(),c={provider:s.length>0?s[0]:i,prefix:l,name:r};return e&&!qe(c)?null:c}const a=s[0],n=a.split("-");if(n.length>1){const r={provider:i,prefix:n.shift(),name:n.join("-")};return e&&!qe(r)?null:r}if(t&&i===""){const r={provider:i,prefix:"",name:a};return e&&!qe(r,t)?null:r}return null},qe=(o,e)=>o?!!((o.provider===""||o.provider.match(_e))&&(e&&o.prefix===""||o.prefix.match(_e))&&o.name.match(_e)):!1;function Uo(o,e){const t={};!o.hFlip!=!e.hFlip&&(t.hFlip=!0),!o.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((o.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Ti(o,e){const t=Uo(o,e);for(const i in vt)i in Ne?i in o&&!(i in t)&&(t[i]=Ne[i]):i in e?t[i]=e[i]:i in o&&(t[i]=o[i]);return t}function Vo(o,e){const t=o.icons,i=o.aliases||Object.create(null),s=Object.create(null);function a(n){if(t[n])return s[n]=[];if(!(n in s)){s[n]=null;const r=i[n]&&i[n].parent,l=r&&a(r);l&&(s[n]=[r].concat(l))}return s[n]}return Object.keys(t).concat(Object.keys(i)).forEach(a),s}function Bo(o,e,t){const i=o.icons,s=o.aliases||Object.create(null);let a={};function n(r){a=Ti(i[r]||s[r],a)}return n(e),t.forEach(n),Ti(o,a)}function Ai(o,e){const t=[];if(typeof o!="object"||typeof o.icons!="object")return t;o.not_found instanceof Array&&o.not_found.forEach(s=>{e(s,null),t.push(s)});const i=Vo(o);for(const s in i){const a=i[s];a&&(e(s,Bo(o,s,a)),t.push(s))}return t}const Ho={provider:"",aliases:{},not_found:{},...$i};function yt(o,e){for(const t in e)if(t in o&&typeof o[t]!=typeof e[t])return!1;return!0}function Ei(o){if(typeof o!="object"||o===null)return null;const e=o;if(typeof e.prefix!="string"||!o.icons||typeof o.icons!="object"||!yt(o,Ho))return null;const t=e.icons;for(const s in t){const a=t[s];if(!s.match(_e)||typeof a.body!="string"||!yt(a,vt))return null}const i=e.aliases||Object.create(null);for(const s in i){const a=i[s],n=a.parent;if(!s.match(_e)||typeof n!="string"||!t[n]&&!i[n]||!yt(a,vt))return null}return e}const Fe=Object.create(null);function Go(o,e){return{provider:o,prefix:e,icons:Object.create(null),missing:new Set}}function Y(o,e){const t=Fe[o]||(Fe[o]=Object.create(null));return t[e]||(t[e]=Go(o,e))}function wt(o,e){return Ei(e)?Ai(e,(t,i)=>{i?o.icons[t]=i:o.missing.add(t)}):[]}function Wo(o,e,t){try{if(typeof t.body=="string")return o.icons[e]={...t},!0}catch{}return!1}function Ko(o,e){let t=[];return(typeof o=="string"?[o]:Object.keys(Fe)).forEach(s=>{(typeof s=="string"&&typeof e=="string"?[e]:Object.keys(Fe[s]||{})).forEach(n=>{const r=Y(s,n);t=t.concat(Object.keys(r.icons).map(l=>(s!==""?"@"+s+":":"")+n+":"+l))})}),t}let xe=!1;function Oi(o){return typeof o=="boolean"&&(xe=o),xe}function ke(o){const e=typeof o=="string"?$e(o,!0,xe):o;if(e){const t=Y(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function Ci(o,e){const t=$e(o,!0,xe);if(!t)return!1;const i=Y(t.provider,t.prefix);return Wo(i,t.name,e)}function Li(o,e){if(typeof o!="object")return!1;if(typeof e!="string"&&(e=o.provider||""),xe&&!e&&!o.prefix){let s=!1;return Ei(o)&&(o.prefix="",Ai(o,(a,n)=>{n&&Ci(a,n)&&(s=!0)})),s}const t=o.prefix;if(!qe({provider:e,prefix:t,name:"a"}))return!1;const i=Y(e,t);return!!wt(i,o)}function Zo(o){return!!ke(o)}function Jo(o){const e=ke(o);return e?{...we,...e}:null}function Qo(o){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);o.sort((s,a)=>s.provider!==a.provider?s.provider.localeCompare(a.provider):s.prefix!==a.prefix?s.prefix.localeCompare(a.prefix):s.name.localeCompare(a.name));let i={provider:"",prefix:"",name:""};return o.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const a=s.provider,n=s.prefix,r=s.name,l=t[a]||(t[a]=Object.create(null)),c=l[n]||(l[n]=Y(a,n));let b;r in c.icons?b=e.loaded:n===""||c.missing.has(r)?b=e.missing:b=e.pending;const g={provider:a,prefix:n,name:r};b.push(g)}),e}function Ii(o,e){o.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(s=>s.id!==e))})}function Yo(o){o.pendingCallbacksFlag||(o.pendingCallbacksFlag=!0,setTimeout(()=>{o.pendingCallbacksFlag=!1;const e=o.loaderCallbacks?o.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=o.provider,s=o.prefix;e.forEach(a=>{const n=a.icons,r=n.pending.length;n.pending=n.pending.filter(l=>{if(l.prefix!==s)return!0;const c=l.name;if(o.icons[c])n.loaded.push({provider:i,prefix:s,name:c});else if(o.missing.has(c))n.missing.push({provider:i,prefix:s,name:c});else return t=!0,!0;return!1}),n.pending.length!==r&&(t||Ii([o],a.id),a.callback(n.loaded.slice(0),n.missing.slice(0),n.pending.slice(0),a.abort))})}))}let Xo=0;function ea(o,e,t){const i=Xo++,s=Ii.bind(null,t,i);if(!e.pending.length)return s;const a={id:i,icons:e,callback:o,abort:s};return t.forEach(n=>{(n.loaderCallbacks||(n.loaderCallbacks=[])).push(a)}),s}const _t=Object.create(null);function Pi(o,e){_t[o]=e}function $t(o){return _t[o]||_t[""]}function ta(o,e=!0,t=!1){const i=[];return o.forEach(s=>{const a=typeof s=="string"?$e(s,e,t):s;a&&i.push(a)}),i}var ia={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sa(o,e,t,i){const s=o.resources.length,a=o.random?Math.floor(Math.random()*s):o.index;let n;if(o.random){let T=o.resources.slice(0);for(n=[];T.length>1;){const z=Math.floor(Math.random()*T.length);n.push(T[z]),T=T.slice(0,z).concat(T.slice(z+1))}n=n.concat(T)}else n=o.resources.slice(a).concat(o.resources.slice(0,a));const r=Date.now();let l="pending",c=0,b,g=null,v=[],y=[];typeof i=="function"&&y.push(i);function w(){g&&(clearTimeout(g),g=null)}function L(){l==="pending"&&(l="aborted"),w(),v.forEach(T=>{T.status==="pending"&&(T.status="aborted")}),v=[]}function N(T,z){z&&(y=[]),typeof T=="function"&&y.push(T)}function M(){return{startTime:r,payload:e,status:l,queriesSent:c,queriesPending:v.length,subscribe:N,abort:L}}function I(){l="failed",y.forEach(T=>{T(void 0,b)})}function Le(){v.forEach(T=>{T.status==="pending"&&(T.status="aborted")}),v=[]}function Ze(T,z,le){const ee=z!=="success";switch(v=v.filter(P=>P!==T),l){case"pending":break;case"failed":if(ee||!o.dataAfterTimeout)return;break;default:return}if(z==="abort"){b=le,I();return}if(ee){b=le,v.length||(n.length?X():I());return}if(w(),Le(),!o.random){const P=o.resources.indexOf(T.resource);P!==-1&&P!==o.index&&(o.index=P)}l="completed",y.forEach(P=>{P(le)})}function X(){if(l!=="pending")return;w();const T=n.shift();if(T===void 0){if(v.length){g=setTimeout(()=>{w(),l==="pending"&&(Le(),I())},o.timeout);return}I();return}const z={status:"pending",resource:T,callback:(le,ee)=>{Ze(z,le,ee)}};v.push(z),c++,g=setTimeout(X,o.rotate),t(T,e,z.callback)}return setTimeout(X),M}function Mi(o){const e={...ia,...o};let t=[];function i(){t=t.filter(r=>r().status==="pending")}function s(r,l,c){const b=sa(e,r,l,(g,v)=>{i(),c&&c(g,v)});return t.push(b),b}function a(r){return t.find(l=>r(l))||null}return{query:s,find:a,setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:i}}function xt(o){let e;if(typeof o.resources=="string")e=[o.resources];else if(e=o.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:o.path||"/",maxURL:o.maxURL||500,rotate:o.rotate||750,timeout:o.timeout||5e3,random:o.random===!0,index:o.index||0,dataAfterTimeout:o.dataAfterTimeout!==!1}}const Ue=Object.create(null),Se=["https://api.simplesvg.com","https://api.unisvg.com"],Ve=[];for(;Se.length>0;)Se.length===1||Math.random()>.5?Ve.push(Se.shift()):Ve.push(Se.pop());Ue[""]=xt({resources:["https://api.iconify.design"].concat(Ve)});function ji(o,e){const t=xt(e);return t===null?!1:(Ue[o]=t,!0)}function Be(o){return Ue[o]}function oa(){return Object.keys(Ue)}function Di(){}const kt=Object.create(null);function aa(o){if(!kt[o]){const e=Be(o);if(!e)return;const t=Mi(e),i={config:e,redundancy:t};kt[o]=i}return kt[o]}function zi(o,e,t){let i,s;if(typeof o=="string"){const a=$t(o);if(!a)return t(void 0,424),Di;s=a.send;const n=aa(o);n&&(i=n.redundancy)}else{const a=xt(o);if(a){i=Mi(a);const n=o.resources?o.resources[0]:"",r=$t(n);r&&(s=r.send)}}return!i||!s?(t(void 0,424),Di):i.query(e,s,t)().abort}const Ri="iconify2",Te="iconify",Ni=Te+"-count",qi=Te+"-version",Fi=36e5,na=168;function St(o,e){try{return o.getItem(e)}catch{}}function Tt(o,e,t){try{return o.setItem(e,t),!0}catch{}}function Ui(o,e){try{o.removeItem(e)}catch{}}function At(o,e){return Tt(o,Ni,e.toString())}function Et(o){return parseInt(St(o,Ni))||0}const ne={local:!0,session:!0},Vi={local:new Set,session:new Set};let Ot=!1;function ra(o){Ot=o}let He=typeof window>"u"?{}:window;function Bi(o){const e=o+"Storage";try{if(He&&He[e]&&typeof He[e].length=="number")return He[e]}catch{}ne[o]=!1}function Hi(o,e){const t=Bi(o);if(!t)return;const i=St(t,qi);if(i!==Ri){if(i){const r=Et(t);for(let l=0;l{const l=Te+r.toString(),c=St(t,l);if(typeof c=="string"){try{const b=JSON.parse(c);if(typeof b=="object"&&typeof b.cached=="number"&&b.cached>s&&typeof b.provider=="string"&&typeof b.data=="object"&&typeof b.data.prefix=="string"&&e(b,r))return!0}catch{}Ui(t,l)}};let n=Et(t);for(let r=n-1;r>=0;r--)a(r)||(r===n-1?(n--,At(t,n)):Vi[o].add(r))}function Gi(){if(!Ot){ra(!0);for(const o in ne)Hi(o,e=>{const t=e.data,i=e.provider,s=t.prefix,a=Y(i,s);if(!wt(a,t).length)return!1;const n=t.lastModified||-1;return a.lastModifiedCached=a.lastModifiedCached?Math.min(a.lastModifiedCached,n):n,!0})}}function la(o,e){const t=o.lastModifiedCached;if(t&&t>=e)return t===e;if(o.lastModifiedCached=e,t)for(const i in ne)Hi(i,s=>{const a=s.data;return s.provider!==o.provider||a.prefix!==o.prefix||a.lastModified===e});return!0}function da(o,e){Ot||Gi();function t(i){let s;if(!ne[i]||!(s=Bi(i)))return;const a=Vi[i];let n;if(a.size)a.delete(n=Array.from(a).shift());else if(n=Et(s),!At(s,n+1))return;const r={cached:Math.floor(Date.now()/Fi),provider:o.provider,data:e};return Tt(s,Te+n.toString(),JSON.stringify(r))}e.lastModified&&!la(o,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),t("local")||t("session"))}function Wi(){}function ca(o){o.iconsLoaderFlag||(o.iconsLoaderFlag=!0,setTimeout(()=>{o.iconsLoaderFlag=!1,Yo(o)}))}function ua(o,e){o.iconsToLoad?o.iconsToLoad=o.iconsToLoad.concat(e).sort():o.iconsToLoad=e,o.iconsQueueFlag||(o.iconsQueueFlag=!0,setTimeout(()=>{o.iconsQueueFlag=!1;const{provider:t,prefix:i}=o,s=o.iconsToLoad;delete o.iconsToLoad;let a;if(!s||!(a=$t(t)))return;a.prepare(t,i,s).forEach(r=>{zi(t,r,l=>{if(typeof l!="object")r.icons.forEach(c=>{o.missing.add(c)});else try{const c=wt(o,l);if(!c.length)return;const b=o.pendingIcons;b&&c.forEach(g=>{b.delete(g)}),da(o,l)}catch(c){console.error(c)}ca(o)})})}))}const Ct=(o,e)=>{const t=ta(o,!0,Oi()),i=Qo(t);if(!i.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(i.loaded,i.missing,i.pending,Wi)}),()=>{l=!1}}const s=Object.create(null),a=[];let n,r;return i.pending.forEach(l=>{const{provider:c,prefix:b}=l;if(b===r&&c===n)return;n=c,r=b,a.push(Y(c,b));const g=s[c]||(s[c]=Object.create(null));g[b]||(g[b]=[])}),i.pending.forEach(l=>{const{provider:c,prefix:b,name:g}=l,v=Y(c,b),y=v.pendingIcons||(v.pendingIcons=new Set);y.has(g)||(y.add(g),s[c][b].push(g))}),a.forEach(l=>{const{provider:c,prefix:b}=l;s[c][b].length&&ua(l,s[c][b])}),e?ea(e,i,a):Wi},ha=o=>new Promise((e,t)=>{const i=typeof o=="string"?$e(o,!0):o;if(!i){t(o);return}Ct([i||o],s=>{if(s.length&&i){const a=ke(i);if(a){e({...we,...a});return}}t(o)})});function pa(o){try{const e=typeof o=="string"?JSON.parse(o):o;if(typeof e.body=="string")return{...e}}catch{}}function fa(o,e){const t=typeof o=="string"?$e(o,!0,!0):null;if(!t){const a=pa(o);return{value:o,data:a}}const i=ke(t);if(i!==void 0||!t.prefix)return{value:o,name:t,data:i};const s=Ct([t],()=>e(o,t,ke(t)));return{value:o,name:t,loading:s}}function Lt(o){return o.hasAttribute("inline")}let Ki=!1;try{Ki=navigator.vendor.indexOf("Apple")===0}catch{}function ba(o,e){switch(e){case"svg":case"bg":case"mask":return e}return e!=="style"&&(Ki||o.indexOf("{const w=[],L=y.hFlip,N=y.vFlip;let M=y.rotate;L?N?M+=2:(w.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),w.push("scale(-1 1)"),s.top=s.left=0):N&&(w.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),w.push("scale(1 -1)"),s.top=s.left=0);let I;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:I=s.height/2+s.top,w.unshift("rotate(90 "+I.toString()+" "+I.toString()+")");break;case 2:w.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:I=s.width/2+s.left,w.unshift("rotate(-90 "+I.toString()+" "+I.toString()+")");break}M%2===1&&(s.left!==s.top&&(I=s.left,s.left=s.top,s.top=I),s.width!==s.height&&(I=s.width,s.width=s.height,s.height=I)),w.length&&(a=''+a+"")});const n=i.width,r=i.height,l=s.width,c=s.height;let b,g;return n===null?(g=r===null?"1em":r==="auto"?c:r,b=It(g,l/c)):(b=n==="auto"?l:n,g=r===null?It(b,c/l):r==="auto"?c:r),{attributes:{width:b.toString(),height:g.toString(),viewBox:s.left.toString()+" "+s.top.toString()+" "+l.toString()+" "+c.toString()},body:a}}let Ge=(()=>{let o;try{if(o=fetch,typeof o=="function")return o}catch{}})();function va(o){Ge=o}function ya(){return Ge}function wa(o,e){const t=Be(o);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let s=0;t.resources.forEach(n=>{s=Math.max(s,n.length)});const a=e+".json?icons=";i=t.maxURL-s-t.path.length-a.length}return i}function _a(o){return o===404}const $a=(o,e,t)=>{const i=[],s=wa(o,e),a="icons";let n={type:a,provider:o,prefix:e,icons:[]},r=0;return t.forEach((l,c)=>{r+=l.length+1,r>=s&&c>0&&(i.push(n),n={type:a,provider:o,prefix:e,icons:[]},r=l.length),n.icons.push(l)}),i.push(n),i};function xa(o){if(typeof o=="string"){const e=Be(o);if(e)return e.path}return"/"}const ka={prepare:$a,send:(o,e,t)=>{if(!Ge){t("abort",424);return}let i=xa(e.provider);switch(e.type){case"icons":{const a=e.prefix,r=e.icons.join(","),l=new URLSearchParams({icons:r});i+=a+".json?"+l.toString();break}case"custom":{const a=e.uri;i+=a.slice(0,1)==="/"?a.slice(1):a;break}default:t("abort",400);return}let s=503;Ge(o+i).then(a=>{const n=a.status;if(n!==200){setTimeout(()=>{t(_a(n)?"abort":"next",n)});return}return s=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?t("abort",a):t("next",s)});return}setTimeout(()=>{t("success",a)})}).catch(()=>{t("next",s)})}};function Ji(o,e){switch(o){case"local":case"session":ne[o]=e;break;case"all":for(const t in ne)ne[t]=e;break}}function Qi(){Pi("",ka),Oi(!0);let o;try{o=window}catch{}if(o){if(Gi(),o.IconifyPreload!==void 0){const t=o.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(s=>{try{(typeof s!="object"||s===null||s instanceof Array||typeof s.icons!="object"||typeof s.prefix!="string"||!Li(s))&&console.error(i)}catch{console.error(i)}})}if(o.IconifyProviders!==void 0){const t=o.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const s="IconifyProviders["+i+"] is invalid.";try{const a=t[i];if(typeof a!="object"||!a||a.resources===void 0)continue;ji(i,a)||console.error(s)}catch{console.error(s)}}}}return{enableCache:t=>Ji(t,!0),disableCache:t=>Ji(t,!1),iconExists:Zo,getIcon:Jo,listIcons:Ko,addIcon:Ci,addCollection:Li,calculateSize:It,buildIcon:Zi,loadIcons:Ct,loadIcon:ha,addAPIProvider:ji,_api:{getAPIConfig:Be,setAPIModule:Pi,sendAPIQuery:zi,setFetch:va,getFetch:ya,listAPIProviders:oa}}}function Yi(o,e){let t=o.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'"+o+""}function Sa(o){return o.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Ta(o){return'url("data:image/svg+xml,'+Sa(o)+'")'}const Pt={"background-color":"currentColor"},Xi={"background-color":"transparent"},es={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ts={"-webkit-mask":Pt,mask:Pt,background:Xi};for(const o in ts){const e=ts[o];for(const t in es)e[o+"-"+t]=es[t]}function is(o){return o+(o.match(/^[-0-9.]+$/)?"px":"")}function Aa(o,e,t){const i=document.createElement("span");let s=o.body;s.indexOf("");const a=o.attributes,n=Yi(s,{...a,width:e.width+"",height:e.height+""}),r=Ta(n),l=i.style,c={"--svg":r,width:is(a.width),height:is(a.height),...t?Pt:Xi};for(const b in c)l.setProperty(b,c[b]);return i}function Ea(o){const e=document.createElement("span");return e.innerHTML=Yi(o.body,o.attributes),e.firstChild}function ss(o,e){const t=e.icon.data,i=e.customisations,s=Zi(t,i);i.preserveAspectRatio&&(s.attributes.preserveAspectRatio=i.preserveAspectRatio);const a=e.renderedMode;let n;switch(a){case"svg":n=Ea(s);break;default:n=Aa(s,{...we,...t},a==="mask")}const r=Array.from(o.childNodes).find(l=>{const c=l.tagName&&l.tagName.toUpperCase();return c==="SPAN"||c==="SVG"});r?n.tagName==="SPAN"&&r.tagName===n.tagName?r.setAttribute("style",n.getAttribute("style")):o.replaceChild(n,r):o.appendChild(n)}const Mt="data-style";function os(o,e){let t=Array.from(o.childNodes).find(i=>i.hasAttribute&&i.hasAttribute(Mt));t||(t=document.createElement("style"),t.setAttribute(Mt,Mt),o.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block}"}function as(o,e,t){const i=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:e,icon:o,lastRender:i}}function Oa(o="iconify-icon"){let e,t;try{e=window.customElements,t=window.HTMLElement}catch{return}if(!e||!t)return;const i=e.get(o);if(i)return i;const s=["icon","mode","inline","width","height","rotate","flip"],a=class extends t{constructor(){super();Xe(this,"_shadowRoot");Xe(this,"_state");Xe(this,"_checkQueued",!1);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=Lt(this);os(l,c),this._state=as({value:""},c),this._queueCheck()}static get observedAttributes(){return s.slice(0)}attributeChangedCallback(l){if(l==="inline"){const c=Lt(this),b=this._state;c!==b.inline&&(b.inline=c,os(this._shadowRoot,c))}else this._queueCheck()}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return Lt(this)}set inline(l){this.setAttribute("inline",l?"true":null)}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch{}ss(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value){this._iconChanged(c);return}if(!l.rendered)return;const b=this.getAttribute("mode"),g=Si(this);(l.attrMode!==b||Fo(l.customisations,g))&&this._renderIcon(l.icon,g,b)}_iconChanged(l){const c=fa(l,(b,g,v)=>{const y=this._state;if(y.rendered||this.getAttribute("icon")!==b)return;const w={value:b,name:g,data:v};w.data?this._gotIconData(w):y.icon=w});c.data?this._gotIconData(c):this._state=as(c,this._state.inline,this._state)}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,Si(this),this.getAttribute("mode"))}_renderIcon(l,c,b){const g=ba(l.data.body,b),v=this._state.inline;ss(this._shadowRoot,this._state={rendered:!0,icon:l,inline:v,customisations:c,attrMode:b,renderedMode:g})}};s.forEach(r=>{r in a.prototype||Object.defineProperty(a.prototype,r,{get:function(){return this.getAttribute(r)},set:function(l){this.setAttribute(r,l)}})});const n=Qi();for(const r in n)a[r]=a.prototype[r]=n[r];return e.define(o,a),a}const Ca=Oa()||Qi(),{enableCache:Nr,disableCache:qr,iconExists:Fr,getIcon:Ur,listIcons:Vr,addIcon:Br,addCollection:Hr,calculateSize:Gr,buildIcon:Wr,loadIcons:Kr,loadIcon:Zr,addAPIProvider:Jr,_api:Qr}=Ca;class ns extends R{static get styles(){return x` - :root { - pointer-events: none; - } - :root, - .icon-container { - font-size: inherit; - color: inherit; - display: inline-flex; - width: fit-content; - height: fit-content; - position: relative; - font-family: var(--font-family); - pointer-events: auto; - } - .tooltip { - --tt-padding: 0.25rem; - position: absolute; - right: 0px; - top: calc(-1lh - var(--tt-padding) - var(--tt-padding) - 4px); - min-width: max-content; - border: solid 1px currentcolor; - background-color: color( - from var(--dt-form-background-color, var(--surface-1)) srgb 1 1 1 / - 0.7 - ); - padding: var(--tt-padding); - border-radius: 0.25rem; - text-align: end; - z-index: 1; - display: block; - } - .tooltip:before { - position: absolute; - right: 0.7rem; - top: calc(1lh + var(--tt-padding) + var(--tt-padding) + 1px); - content: ' '; - border-width: 0.25rem; - border-style: solid; - border-color: currentcolor transparent transparent transparent; - } - .tooltip[hidden] { - display: none; - } - - .tooltip.slotted .attr-msg { - display: none; - } - - .tooltip:hover { - opacity: 0.25; - } - `}static get properties(){return{...super.properties,icon:{type:String},tooltip:{type:String},tooltip_open:{type:Boolean},size:{type:String},slotted:{type:Boolean,attribute:!1}}}firstUpdated(){const e=this.shadowRoot.querySelector("slot[name=tooltip]");e&&e.addEventListener("slotchange",t=>{const s=t.target.assignedNodes();let a=!1;s.length>0&&(s[0].tagName==="SLOT"?a=s[0].assignedNodes().length>0:a=!0),this.slotted=a})}_toggleTooltip(){this.tooltip_open?this.tooltip_open=!1:this.tooltip_open=!0}tooltipClasses(){return{tooltip:!0,slotted:this.slotted}}render(){const e=this.tooltip?f`
- - ${this.tooltip} -
`:null;return f` -
- - ${e} -
- `}}window.customElements.define("dt-icon",ns);class La extends oe{static get styles(){return x` + `}}window.customElements.define("dt-spinner",Ia);class Pa extends re{static get styles(){return x` :host { margin-top: -0.25rem; width: 2rem; @@ -423,11 +430,11 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr border-bottom: var(--dt-checkmark-width) solid currentcolor; border-right: var(--dt-checkmark-width) solid currentcolor; } - `}}window.customElements.define("dt-checkmark",La);/** + `}}window.customElements.define("dt-checkmark",Pa);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const B=o=>o??E;class D extends R{static get formAssociated(){return!0}static get styles(){return[x` + */const B=o=>o??L;class z extends R{static get formAssociated(){return!0}static get styles(){return[x` .input-group { position: relative; } @@ -480,6 +487,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr font-family: var(--font-family); font-size: 0.875rem; font-weight: 300; + margin-top: 1rem; padding: 3px 0.5rem; gap: 0.5rem; @@ -494,7 +502,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .invalid ~ .error-container { border-top-width: 0; } - `]}static get properties(){return{...super.properties,name:{type:String},label:{type:String},icon:{type:String},iconAltText:{type:String},private:{type:Boolean},privateLabel:{type:String},disabled:{type:Boolean},required:{type:Boolean},requiredMessage:{type:String},touched:{type:Boolean,state:!0},invalid:{type:Boolean,state:!0},error:{type:String},loading:{type:Boolean},saved:{type:Boolean},errorSlotted:{type:Boolean,attribute:!1}}}get _field(){return this.shadowRoot.querySelector("input, textarea, select")}get _focusTarget(){return this._field}constructor(){super(),this.savedTimeout=null,this.touched=!1,this.invalid=!1,this.internals=this.attachInternals(),this.addEventListener("invalid",e=>{e&&e.preventDefault(),this.touched=!0,this._validateRequired()})}firstUpdated(...e){super.firstUpdated(...e);const t=this.shadowRoot.querySelector("slot[name=error]");t&&t.addEventListener("slotchange",s=>{const n=s.target.assignedNodes();let r=!1;n.length>0&&(n[0].tagName==="SLOT"?r=n[0].assignedNodes().length>0:r=!0),this.errorSlotted=r});const i=D._jsonToFormData(this.value,this.name);this.internals.setFormValue(i),this._validateRequired()}static _buildFormData(e,t,i){if(t&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof File))Object.keys(t).forEach(s=>{this._buildFormData(e,t[s],i?`${i}[${s}]`:s)});else{const s=t??"";e.append(i,s)}}static _jsonToFormData(e,t){const i=new FormData;return D._buildFormData(i,e,t),i}_setFormValue(e){const t=D._jsonToFormData(e,this.name);this.internals.setFormValue(t,e),this._validateRequired(),this.touched=!0}_validateRequired(){}labelTemplate(){return this.label?f` + `]}static get properties(){return{...super.properties,name:{type:String},label:{type:String},icon:{type:String},iconAltText:{type:String},private:{type:Boolean},privateLabel:{type:String},disabled:{type:Boolean},required:{type:Boolean},requiredMessage:{type:String},touched:{type:Boolean,state:!0},invalid:{type:Boolean,state:!0},error:{type:String},loading:{type:Boolean},saved:{type:Boolean},errorSlotted:{type:Boolean,attribute:!1}}}get _field(){return this.shadowRoot.querySelector("input, textarea, select")}get _focusTarget(){return this._field}constructor(){super(),this.savedTimeout=null,this.touched=!1,this.invalid=!1,this.internals=this.attachInternals(),this.addEventListener("invalid",e=>{e&&e.preventDefault(),this.touched=!0,this._validateRequired()})}firstUpdated(...e){super.firstUpdated(...e);const t=this.shadowRoot.querySelector("slot[name=error]");t&&t.addEventListener("slotchange",s=>{const r=s.target.assignedNodes();let n=!1;r.length>0&&(r[0].tagName==="SLOT"?n=r[0].assignedNodes().length>0:n=!0),this.errorSlotted=n});const i=z._jsonToFormData(this.value,this.name);this.internals.setFormValue(i),this._validateRequired()}static _buildFormData(e,t,i){if(t&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof File))Object.keys(t).forEach(s=>{this._buildFormData(e,t[s],i?`${i}[${s}]`:s)});else{const s=t??"";e.append(i,s)}}static _jsonToFormData(e,t){const i=new FormData;return z._buildFormData(i,e,t),i}_setFormValue(e){const t=z._jsonToFormData(e,this.name);this.internals.setFormValue(t,e),this._validateRequired(),this.touched=!0}_validateRequired(){}labelTemplate(){return this.label?u` - ${this.icon?null:f``} + ${this.icon?null:u``} ${this.label} - `:""}_errorClasses(){return{"error-container":!0,slotted:this.errorSlotted}}renderIcons(){return f` + `:""}_errorClasses(){return{"error-container":!0,slotted:this.errorSlotted}}renderIcons(){return u` ${this.renderIconInvalid()} ${this.renderError()} ${this.renderIconLoading()} ${this.renderIconSaved()} - `}renderIconInvalid(){return this.touched&&this.invalid?f`
+ `}renderIconInvalid(){return this.touched&&this.invalid?u`
${this.internals.validationMessage} -
`:null}renderIconLoading(){return this.loading?f``:null}renderIconSaved(){return this.saved&&(this.savedTimeout&&clearTimeout(this.savedTimeout),this.savedTimeout=setTimeout(()=>{this.savedTimeout=null,this.saved=!1},5e3)),this.saved?f` `:null}renderIconLoading(){return this.loading?u``:null}renderIconSaved(){return this.saved&&(this.savedTimeout&&clearTimeout(this.savedTimeout),this.savedTimeout=setTimeout(()=>{this.savedTimeout=null,this.saved=!1},5e3)),this.saved?u``:null}renderError(){return this.error?f`
+ >`:null}renderError(){return this.error?u`
${this.error} -
`:null}render(){return f` +
`:null}render(){return u` ${this.labelTemplate()} `}reset(){var e;(e=this._field)!=null&&e.reset&&this._field.reset(),this.value="",this._setFormValue("")}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{I:Ia}=ao,rs=()=>document.createComment(""),Ae=(o,e,t)=>{var a;const i=o._$AA.parentNode,s=e===void 0?o._$AB:e._$AA;if(t===void 0){const n=i.insertBefore(rs(),s),r=i.insertBefore(rs(),s);t=new Ia(n,r,o,o.options)}else{const n=t._$AB.nextSibling,r=t._$AM,l=r!==o;if(l){let c;(a=t._$AQ)==null||a.call(t,o),t._$AM=o,t._$AP!==void 0&&(c=o._$AU)!==r._$AU&&t._$AP(c)}if(n!==s||l){let c=t._$AA;for(;c!==n;){const b=c.nextSibling;i.insertBefore(c,s),c=b}}}return t},re=(o,e,t=o)=>(o._$AI(e,t),o),Pa={},Ma=(o,e=Pa)=>o._$AH=e,ja=o=>o._$AH,jt=o=>{var i;(i=o._$AP)==null||i.call(o,!1,!0);let e=o._$AA;const t=o._$AB.nextSibling;for(;e!==t;){const s=e.nextSibling;e.remove(),e=s}};/** + */const{I:Ma}=no,ls=()=>document.createComment(""),Ce=(o,e,t)=>{var a;const i=o._$AA.parentNode,s=e===void 0?o._$AB:e._$AA;if(t===void 0){const r=i.insertBefore(ls(),s),n=i.insertBefore(ls(),s);t=new Ma(r,n,o,o.options)}else{const r=t._$AB.nextSibling,n=t._$AM,l=n!==o;if(l){let d;(a=t._$AQ)==null||a.call(t,o),t._$AM=o,t._$AP!==void 0&&(d=o._$AU)!==n._$AU&&t._$AP(d)}if(r!==s||l){let d=t._$AA;for(;d!==r;){const h=d.nextSibling;i.insertBefore(d,s),d=h}}}return t},de=(o,e,t=o)=>(o._$AI(e,t),o),ja={},za=(o,e=ja)=>o._$AH=e,Da=o=>o._$AH,zt=o=>{var i;(i=o._$AP)==null||i.call(o,!1,!0);let e=o._$AA;const t=o._$AB.nextSibling;for(;e!==t;){const s=e.nextSibling;e.remove(),e=s}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ls=(o,e,t)=>{const i=new Map;for(let s=e;s<=t;s++)i.set(o[s],s);return i},Ee=ut(class extends ht{constructor(o){if(super(o),o.type!==ct.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const s=[],a=[];let n=0;for(const r of o)s[n]=i?i(r,n):n,a[n]=t(r,n),n++;return{values:a,keys:s}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,i]){const s=ja(o),{values:a,keys:n}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=n,a;const r=this.ut??(this.ut=[]),l=[];let c,b,g=0,v=s.length-1,y=0,w=a.length-1;for(;g<=v&&y<=w;)if(s[g]===null)g++;else if(s[v]===null)v--;else if(r[g]===n[y])l[y]=re(s[g],a[y]),g++,y++;else if(r[v]===n[w])l[w]=re(s[v],a[w]),v--,w--;else if(r[g]===n[w])l[w]=re(s[g],a[w]),Ae(o,l[w+1],s[g]),g++,w--;else if(r[v]===n[y])l[y]=re(s[v],a[y]),Ae(o,s[g],s[v]),v--,y++;else if(c===void 0&&(c=ls(n,y,w),b=ls(r,g,v)),c.has(r[g]))if(c.has(r[v])){const L=b.get(n[y]),N=L!==void 0?s[L]:null;if(N===null){const M=Ae(o,s[g]);re(M,a[y]),l[y]=M}else l[y]=re(N,a[y]),Ae(o,s[g],N),s[L]=null;y++}else jt(s[v]),v--;else jt(s[g]),g++;for(;y<=w;){const L=Ae(o,l[w+1]);re(L,a[y]),l[y++]=L}for(;g<=v;){const L=s[g++];L!==null&&jt(L)}return this.ut=n,Ma(o,l),U}}),Da=o=>class extends o{constructor(){super(),this.activeIndex=-1,this.filteredOptions=[],this.detectTap=!1}static get properties(){return{...super.properties,value:{type:Array,reflect:!0},query:{type:String,state:!0},options:{type:Array},filteredOptions:{type:Array,state:!0},open:{type:Boolean,state:!0},canUpdate:{type:Boolean,state:!0},activeIndex:{type:Number,state:!0},containerHeight:{type:Number,state:!0},loading:{type:Boolean}}}willUpdate(e){if(super.willUpdate(e),e&&!this.containerHeight&&this.shadowRoot.children&&this.shadowRoot.children.length){const t=this.shadowRoot.querySelector(".input-group");t&&(this.containerHeight=t.offsetHeight)}}updated(){this._scrollOptionListToActive();const e=this.shadowRoot.querySelector(".input-group");!e.style.getPropertyValue("--container-width")&&e.clientWidth>0&&e.style.setProperty("--container-width",`${e.clientWidth}px`)}_select(){console.error("Must implement `_select(value)` function"),this._clearSearch()}static _focusInput(e){e.target===e.currentTarget&&e.target.getElementsByTagName("input")[0].focus()}_inputFocusIn(e){(!e.relatedTarget||!["BUTTON","LI"].includes(e.relatedTarget.nodeName))&&(this.open=!0,this.activeIndex=-1)}_inputFocusOut(e){(!e.relatedTarget||!["BUTTON","LI"].includes(e.relatedTarget.nodeName))&&(this.open=!1,this.canUpdate=!0)}_inputKeyDown(e){}_inputKeyUp(e){switch(e.keyCode||e.which){case 38:this.open=!0,this._listHighlightPrevious();break;case 40:this.open=!0,this._listHighlightNext();break;case 9:this.activeIndex<0?this.open=!1:e.preventDefault(),this._keyboardSelectOption();break;case 13:this._keyboardSelectOption();break;case 27:this.open=!1,this.activeIndex=-1;break;default:this.open=!0,this.query=e.target.value;break}}_scrollOptionListToActive(){const e=this.shadowRoot.querySelector(".option-list"),t=this.shadowRoot.querySelector("button.active");if(e&&t){const i=t.offsetTop,s=t.offsetTop+t.clientHeight,a=e.scrollTop,n=e.scrollTop+e.clientHeight;s>n?e.scrollTo({top:s-e.clientHeight,behavior:"smooth"}):i-1&&(this.activeIndex+1>this.filteredOptions.length?this._select(this.query):this._select(this.filteredOptions[this.activeIndex].id))}_clickOption(e){e.target&&e.target.value&&this._select(e.target.value)}_clickAddNew(e){var t;e.target&&this._select((t=e.target.dataset)==null?void 0:t.label)}_clearSearch(){const e=this.shadowRoot.querySelector("input");e&&(e.value="")}_listHighlightNext(){this.allowAdd?this.activeIndex=Math.min(this.filteredOptions.length,this.activeIndex+1):this.activeIndex=Math.min(this.filteredOptions.length-1,this.activeIndex+1)}_listHighlightPrevious(){this.activeIndex=Math.max(0,this.activeIndex-1)}_renderOption(e,t){return f` + */const ds=(o,e,t)=>{const i=new Map;for(let s=e;s<=t;s++)i.set(o[s],s);return i},ce=ht(class extends pt{constructor(o){if(super(o),o.type!==ut.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const s=[],a=[];let r=0;for(const n of o)s[r]=i?i(n,r):r,a[r]=t(n,r),r++;return{values:a,keys:s}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,i]){const s=Da(o),{values:a,keys:r}=this.dt(e,t,i);if(!Array.isArray(s))return this.ut=r,a;const n=this.ut??(this.ut=[]),l=[];let d,h,g=0,m=s.length-1,y=0,w=a.length-1;for(;g<=m&&y<=w;)if(s[g]===null)g++;else if(s[m]===null)m--;else if(n[g]===r[y])l[y]=de(s[g],a[y]),g++,y++;else if(n[m]===r[w])l[w]=de(s[m],a[w]),m--,w--;else if(n[g]===r[w])l[w]=de(s[g],a[w]),Ce(o,l[w+1],s[g]),g++,w--;else if(n[m]===r[y])l[y]=de(s[m],a[y]),Ce(o,s[g],s[m]),m--,y++;else if(d===void 0&&(d=ds(r,y,w),h=ds(n,g,m)),d.has(n[g]))if(d.has(n[m])){const O=h.get(r[y]),C=O!==void 0?s[O]:null;if(C===null){const M=Ce(o,s[g]);de(M,a[y]),l[y]=M}else l[y]=de(C,a[y]),Ce(o,s[g],C),s[O]=null;y++}else zt(s[m]),m--;else zt(s[g]),g++;for(;y<=w;){const O=Ce(o,l[w+1]);de(O,a[y]),l[y++]=O}for(;g<=m;){const O=s[g++];O!==null&&zt(O)}return this.ut=r,za(o,l),U}}),Fa=o=>class extends o{constructor(){super(),this.activeIndex=-1,this.filteredOptions=[],this.detectTap=!1}static get properties(){return{...super.properties,value:{type:Array,reflect:!0},query:{type:String,state:!0},options:{type:Array},filteredOptions:{type:Array,state:!0},open:{type:Boolean,state:!0},canUpdate:{type:Boolean,state:!0},activeIndex:{type:Number,state:!0},containerHeight:{type:Number,state:!0},loading:{type:Boolean}}}willUpdate(e){if(super.willUpdate(e),e&&!this.containerHeight&&this.shadowRoot.children&&this.shadowRoot.children.length){const t=this.shadowRoot.querySelector(".input-group");t&&(this.containerHeight=t.offsetHeight)}}updated(){this._scrollOptionListToActive();const e=this.shadowRoot.querySelector(".input-group");!e.style.getPropertyValue("--container-width")&&e.clientWidth>0&&e.style.setProperty("--container-width",`${e.clientWidth}px`)}_select(){console.error("Must implement `_select(value)` function"),this._clearSearch()}static _focusInput(e){e.target===e.currentTarget&&e.target.getElementsByTagName("input")[0].focus()}_inputFocusIn(e){(!e.relatedTarget||!["BUTTON","LI"].includes(e.relatedTarget.nodeName))&&(this.open=!0,this.activeIndex=-1)}_inputFocusOut(e){(!e.relatedTarget||!["BUTTON","LI"].includes(e.relatedTarget.nodeName))&&(this.open=!1,this.canUpdate=!0)}_inputKeyDown(e){}_inputKeyUp(e){switch(e.keyCode||e.which){case 38:this.open=!0,this._listHighlightPrevious();break;case 40:this.open=!0,this._listHighlightNext();break;case 9:this.activeIndex<0?this.open=!1:e.preventDefault(),this._keyboardSelectOption();break;case 13:this._keyboardSelectOption();break;case 27:this.open=!1,this.activeIndex=-1;break;default:this.open=!0,this.query=e.target.value;break}}_scrollOptionListToActive(){const e=this.shadowRoot.querySelector(".option-list"),t=this.shadowRoot.querySelector("button.active");if(e&&t){const i=t.offsetTop,s=t.offsetTop+t.clientHeight,a=e.scrollTop,r=e.scrollTop+e.clientHeight;s>r?e.scrollTo({top:s-e.clientHeight,behavior:"smooth"}):i-1&&(this.activeIndex+1>this.filteredOptions.length?this._select(this.query):this._select(this.filteredOptions[this.activeIndex].id))}_clickOption(e){e.target&&e.target.value&&this._select(e.target.value)}_clickAddNew(e){var t;e.target&&this._select((t=e.target.dataset)==null?void 0:t.label)}_clearSearch(){const e=this.shadowRoot.querySelector("input");e&&(e.value="")}_listHighlightNext(){this.allowAdd?this.activeIndex=Math.min(this.filteredOptions.length,this.activeIndex+1):this.activeIndex=Math.min(this.filteredOptions.length-1,this.activeIndex+1)}_listHighlightPrevious(){this.activeIndex=Math.max(0,this.activeIndex-1)}_renderOption(e,t){return u`
  • - `}_baseRenderOptions(){return this.filteredOptions.length?Ee(this.filteredOptions,e=>e.id,(e,t)=>this._renderOption(e,t)):this.loading?f`
  • ${O("Loading options...")}
  • `:f`
  • ${O("No Data Available")}
  • `}_renderOptions(){let e=this._baseRenderOptions();return this.allowAdd&&this.query&&(Array.isArray(e)||(e=[e]),e.push(f`
  • + `}_baseRenderOptions(){return this.filteredOptions.length?ce(this.filteredOptions,e=>e.id,(e,t)=>this._renderOption(e,t)):this.loading?u`
  • ${I("Loading options...")}
  • `:u`
  • ${I("No Data Available")}
  • `}_renderOptions(){let e=this._baseRenderOptions();return this.allowAdd&&this.query&&(Array.isArray(e)||(e=[e]),e.push(u`
  • -
  • `)),e}};class We extends Da(D){static get styles(){return[...super.styles,x` + `)),e}};class Ze extends Fa(z){static get styles(){return[...super.styles,x` :host { position: relative; font-family: Helvetica, Arial, sans-serif; @@ -723,7 +731,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .field-container.invalid { border: 1px solid var(--dt-text-border-color-alert, var(--alert-color)); } - `]}static get properties(){return{...super.properties,placeholder:{type:String},containerHeight:{type:Number,state:!0}}}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length)if(typeof this.value[0]=="string")this.value=[...this.value.filter(i=>i!==`-${e}`),e];else{let i=!1;const s=this.value.map(a=>{const n={...a};return a.id===e.id&&a.delete&&(delete n.delete,i=!0),n});i||s.push(e),this.value=s}else this.value=[e];t.detail.newValue=this.value,this.open=!1,this.activeIndex=-1,this.canUpdate=!0,this.dispatchEvent(t),this._setFormValue(this.value),this.query&&(this.query=""),this._clearSearch()}_remove(e){if(e.stopPropagation(),e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(i=>i===e.target.dataset.value?`-${i}`:i),t.detail.newValue=this.value,this.dispatchEvent(t),this._setFormValue(this.value),this.open&&this.shadowRoot.querySelector("input").focus()}document.activeElement.blur()}updated(){super.updated(),this._updateContainerHeight()}_updateContainerHeight(){const e=this.shadowRoot.querySelector(".field-container");if(e){const t=e.offsetHeight;this.containerHeight!==t&&(this.containerHeight=t,this.requestUpdate())}}_filterOptions(){return this.filteredOptions=(this.options||[]).filter(e=>!(this.value||[]).includes(e.id)&&(!this.query||e.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase()))),this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e){const t=e.has("value"),i=e.has("query"),s=e.has("options");(t||i||s)&&this._filterOptions()}}_handleDivClick(){const e=this.renderRoot.querySelector("input");e&&e.focus()}_handleItemClick(e){e.stopPropagation(),document.activeElement.blur()}_renderSelectedOptions(){return this.options&&this.value&&this.value.filter(e=>e.charAt(0)!=="-").map(e=>f` + `]}static get properties(){return{...super.properties,placeholder:{type:String},containerHeight:{type:Number,state:!0}}}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length)if(typeof this.value[0]=="string")this.value=[...this.value.filter(i=>i!==`-${e}`),e];else{let i=!1;const s=this.value.map(a=>{const r={...a};return a.id===e.id&&a.delete&&(delete r.delete,i=!0),r});i||s.push(e),this.value=s}else this.value=[e];t.detail.newValue=this.value,this.open=!1,this.activeIndex=-1,this.canUpdate=!0,this.dispatchEvent(t),this._setFormValue(this.value),this.query&&(this.query=""),this._clearSearch()}_remove(e){if(e.stopPropagation(),e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(i=>i===e.target.dataset.value?`-${i}`:i),t.detail.newValue=this.value,this.dispatchEvent(t),this._setFormValue(this.value),this.open&&this.shadowRoot.querySelector("input").focus()}document.activeElement.blur()}updated(){super.updated(),this._updateContainerHeight()}_updateContainerHeight(){const e=this.shadowRoot.querySelector(".field-container");if(e){const t=e.offsetHeight;this.containerHeight!==t&&(this.containerHeight=t,this.requestUpdate())}}_filterOptions(){return this.filteredOptions=(this.options||[]).filter(e=>!(this.value||[]).includes(e.id)&&(!this.query||e.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase()))),this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e){const t=e.has("value"),i=e.has("query"),s=e.has("options");(t||i||s)&&this._filterOptions()}}_handleDivClick(){const e=this.renderRoot.querySelector("input");e&&e.focus()}_handleItemClick(e){e.stopPropagation(),document.activeElement.blur()}_renderSelectedOptions(){return this.options&&this.value&&this.value.filter(e=>e.charAt(0)!=="-").map(e=>u`
    @@ -736,14 +744,14 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr x
    - `)}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"field-container":!0,invalid:this.touched&&this.invalid}}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return f` + `)}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"field-container":!0,invalid:this.touched&&this.invalid}}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return u` ${this.labelTemplate()}
    @@ -766,7 +774,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr ${this.renderIcons()}
    - `}}window.customElements.define("dt-multi-select",We);class za extends R{static get styles(){return x` + `}}window.customElements.define("dt-multi-select",Ze);class Ra extends R{static get styles(){return x` root { display: block; } @@ -795,16 +803,16 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr } } } - `}static get properties(){return{key:{type:String},metric:{type:Object},active:{type:Boolean,reflect:!0},disabled:{type:Boolean},missingIcon:{type:String}}}renderIcon(){var s;const e=(s=window==null?void 0:window.wpApiShare)==null?void 0:s.template_dir,{metric:t,missingIcon:i=`${e}/dt-assets/images/groups/missing.svg`}=this;if(t["font-icon"]){const a=t["font-icon"].replace("mdi mdi-","mdi:");return f``}return f``}return u`${t}`}render(){const{metric:e,active:t,disabled:i}=this;return f`
    `}render(){const{metric:e,active:t,disabled:i}=this;return u`
    ${this.renderIcon()} -
    `}async _handleClick(e){if(this.disabled)return;const t=!this.active;this.active=t;const i=new CustomEvent("change",{detail:{key:this.key,active:t}});this.dispatchEvent(i)}}window.customElements.define("dt-church-health-icon",za);class ds extends D{static get styles(){return[...super.styles,x` +
    `}async _handleClick(e){if(this.disabled)return;const t=!this.active;this.active=t;const i=new CustomEvent("change",{detail:{key:this.key,active:t}});this.dispatchEvent(i)}}window.customElements.define("dt-church-health-icon",Ra);class cs extends z{static get styles(){return[...super.styles,x` .root { display: block; } @@ -937,7 +945,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr font-size: 0.65em; color: var(--success-color); } - `]}static get properties(){return{...super.properties,id:{type:String},checked:{type:Boolean,reflect:!0},icons:{type:Boolean,default:!1}}}constructor(){super(),this.icons=!1}firstUpdated(){this.checked===void 0&&(this.checked=!1);const e=this.checked?"1":"0";this._setFormValue(e),this.value=this.checked}onChange(e){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.checked,newValue:e.target.checked}});this.checked=e.target.checked,this.value=e.target.checked,this._setFormValue(this.checked?"1":"0"),this.dispatchEvent(t)}onClickToggle(e){e.preventDefault(),e.target.closest("label").querySelector("input").click()}render(){const e=f``,t=f``;return f` + `]}static get properties(){return{...super.properties,id:{type:String},checked:{type:Boolean,reflect:!0},icons:{type:Boolean,default:!1}}}constructor(){super(),this.icons=!1}firstUpdated(){this.checked===void 0&&(this.checked=!1);const e=this.checked?"1":"0";this._setFormValue(e),this.value=this.checked}onChange(e){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.checked,newValue:e.target.checked}});this.checked=e.target.checked,this.value=e.target.checked,this._setFormValue(this.checked?"1":"0"),this.dispatchEvent(t)}onClickToggle(e){e.preventDefault(),e.target.closest("label").querySelector("input").click()}render(){const e=u``,t=u``;return u`
    ${this.labelTemplate()} @@ -958,13 +966,13 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr ?disabled=${this.disabled} /> - ${this.icons?f` ${e} ${t} `:f``} + ${this.icons?u` ${e} ${t} `:u``} ${this.renderIcons()}
    - `}}window.customElements.define("dt-toggle",ds);class cs extends We{static get styles(){return[...super.styles,x` + `}}window.customElements.define("dt-toggle",cs);class us extends Ze{static get styles(){return[...super.styles,x` .health-circle__container { --icon-count: 9; /* Updated circle size based on dynamic width */ @@ -1054,17 +1062,17 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .error-container { margin-block-start: 0.5rem; } - `]}static get properties(){const e={...super.properties,settings:{type:Object,reflect:!1},missingIcon:{type:String}};return delete e.placeholder,delete e.containerHeight,e}_filterOptions(){const e=this.options||[];if(!Object.values(e).length)return[];const t=Object.entries(e);return this.filteredOptions=t.filter(([i,s])=>i!=="church_commitment"),this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e){const t=e.has("value"),i=e.has("options");(t||i)&&this._filterOptions()}}get isCommited(){return this.value?this.value.includes("church_commitment"):!1}render(){return f` + `]}static get properties(){const e={...super.properties,settings:{type:Object,reflect:!1},missingIcon:{type:String}};return delete e.placeholder,delete e.containerHeight,e}_filterOptions(){const e=this.options||[];if(!Object.values(e).length)return[];const t=Object.entries(e);return this.filteredOptions=t.filter(([i,s])=>i!=="church_commitment"),this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e){const t=e.has("value"),i=e.has("options");(t||i)&&this._filterOptions()}}get isCommited(){return this.value?this.value.includes("church_commitment"):!1}render(){return u`
    - ${this.filteredOptions.map(([e,t],i)=>f`u` ${this.renderError()}
    - `}handleIconClick(e){const{key:t,active:i}=e.detail;i?this._select(t):this._remove(e)}async handleToggleChange(e){const{field:t,newValue:i}=e.detail;i?this._select(t):this._remove(e)}}window.customElements.define("dt-church-health-circle",cs);class Oe extends We{static get properties(){return{...super.properties,allowAdd:{type:Boolean}}}static get styles(){return[...super.styles,x` + `}handleIconClick(e){const{key:t,active:i}=e.detail;i?this._select(t):this._remove(e)}async handleToggleChange(e){const{field:t,newValue:i}=e.detail;i?this._select(t):this._remove(e)}}window.customElements.define("dt-church-health-circle",us);class Le extends Ze{static get properties(){return{...super.properties,allowAdd:{type:Boolean}}}static get styles(){return[...super.styles,x` .selected-option a, .selected-option a:active, .selected-option a:visited { @@ -1135,7 +1143,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .input-group.allowAdd .icon-overlay { inset-inline-end: 3rem; } - `]}_addRecord(){const e=new CustomEvent("dt:add-new",{detail:{field:this.name,value:this.query}});this.dispatchEvent(e)}willUpdate(e){super.willUpdate(e),e&&e.has("open")&&this.open&&(!this.filteredOptions||!this.filteredOptions.length)&&this._filterOptions()}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.startsWith("-"));if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.id.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1;let n=a;n.length&&typeof n[0]=="string"&&(n=n.map(r=>({id:r}))),i.allOptions=n,i.filteredOptions=n.filter(r=>!e.includes(r.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_renderOption(e,t){return f` + `]}_addRecord(){const e=new CustomEvent("dt:add-new",{detail:{field:this.name,value:this.query}});this.dispatchEvent(e)}willUpdate(e){super.willUpdate(e),e&&e.has("open")&&this.open&&(!this.filteredOptions||!this.filteredOptions.length)&&this._filterOptions()}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.startsWith("-"));if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.id.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1;let r=a;r.length&&typeof r[0]=="string"&&(r=r.map(n=>({id:n}))),i.allOptions=r,i.filteredOptions=r.filter(n=>!e.includes(n.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_renderOption(e,t){return u`
  • - `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||typeof t=="string"&&t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}_renderSelectedOptions(){const e=this.options||this.allOptions;return(this.value||[]).filter(t=>!t.startsWith("-")).map(t=>{var a;let i=t;if(e){const n=e.filter(r=>r===t||r.id===t);n.length&&(i=n[0].label||n[0].id||t)}let s;if(!s&&((a=window==null?void 0:window.SHAREDFUNCTIONS)!=null&&a.createCustomFilter)){const n=window.SHAREDFUNCTIONS.createCustomFilter(this.name,[t]),r=this.label||this.name,l=[{id:`${this.name}_${t}`,name:`${r}: ${t}`}];s=window.SHAREDFUNCTIONS.create_url_for_list_query(this.postType,n,l)}return f` + `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||typeof t=="string"&&t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}_renderSelectedOptions(){const e=this.options||this.allOptions;return(this.value||[]).filter(t=>!t.startsWith("-")).map(t=>{var a;let i=t;if(e){const r=e.filter(n=>n===t||n.id===t);r.length&&(i=r[0].label||r[0].id||t)}let s;if(!s&&((a=window==null?void 0:window.SHAREDFUNCTIONS)!=null&&a.createCustomFilter)){const r=window.SHAREDFUNCTIONS.createCustomFilter(this.name,[t]),n=this.label||this.name,l=[{id:`${this.name}_${t}`,name:`${n}: ${t}`}];s=window.SHAREDFUNCTIONS.create_url_for_list_query(this.postType,r,l)}return u`
    - `})}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return f` + `})}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return u` ${this.labelTemplate()}
    @@ -1195,7 +1203,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr ?required=${this.required} />
    - ${this.allowAdd?f``:null}
      @@ -1203,7 +1211,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr
    ${this.renderIcons()}
    - `}}window.customElements.define("dt-tags",Oe);class us extends Oe{static get styles(){return[...super.styles,x` + `}}window.customElements.define("dt-tags",Le);class hs extends Le{static get styles(){return[...super.styles,x` .selected-option a { border-inline-start: solid 3px transparent; } @@ -1240,7 +1248,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .invalid { border-color: var(--dt-text-border-color-alert, var(--alert-color)); } - `]}_clickOption(e){if(e.target&&e.target.value){const t=parseInt(e.target.value,10),i=this.filteredOptions.reduce((s,a)=>!s&&a.id==t?a:s,null);i&&this._select(i)}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]))}_remove(e){if(e.stopPropagation(),e.target&&e.target.dataset&&e.target.dataset.value){let t=e.target.dataset.value;const i=Number.parseInt(t);Number.isNaN(i)||(t=i);const s=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(a=>{const n={...a};return a.id===t&&(n.delete=!0),n}),s.detail.newValue=this.value,this.dispatchEvent(s),this.open&&this.shadowRoot.querySelector("input").focus(),this._validateRequired()}document.activeElement.blur()}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>i==null?void 0:i.id);if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1,i.filteredOptions=a.filter(n=>!e.includes(n.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.delete))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>f` + `]}_clickOption(e){if(e.target&&e.target.value){const t=parseInt(e.target.value,10),i=this.filteredOptions.reduce((s,a)=>!s&&a.id==t?a:s,null);i&&this._select(i)}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]))}_remove(e){if(e.stopPropagation(),e.target&&e.target.dataset&&e.target.dataset.value){let t=e.target.dataset.value;const i=Number.parseInt(t);Number.isNaN(i)||(t=i);const s=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(a=>{const r={...a};return a.id===t&&(r.delete=!0),r}),s.detail.newValue=this.value,this.dispatchEvent(s),this.open&&this.shadowRoot.querySelector("input").focus(),this._validateRequired()}document.activeElement.blur()}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>i==null?void 0:i.id);if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1,i.filteredOptions=a.filter(r=>!e.includes(r.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.delete))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>u`
    - `)}_renderOption(e,t){const i=f`circle-08 2Created using Figma`,s=e.status||{label:"",color:""};return f` + `)}_renderOption(e,t){const i=u`circle-08 2Created using Figma`,s=e.status||{label:"",color:""};return u`
  • - `}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return f` + `}render(){const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"};return u` ${this.labelTemplate()}
    @@ -1308,7 +1316,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr ?required=${this.required} />
    - ${this.allowAdd?f``:null}
      @@ -1316,7 +1324,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr
    ${this.renderIcons()}
    - `}}window.customElements.define("dt-connection",us);class hs extends Oe{static get styles(){return[...super.styles,x` + `}}window.customElements.define("dt-connection",hs);class ps extends Le{static get styles(){return[...super.styles,x` .selected-option a { border-inline-start: solid 3px transparent; } @@ -1350,7 +1358,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr li button svg use { fill: var(--dt-connection-icon-fill, var(--primary-color)); } - `]}static get properties(){return{...super.properties,single:{type:Boolean}}}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length&&!this.single){let i=!1;const s=this.value.map(a=>{const n={...a};return a.id===e.id&&a.delete?(delete n.delete,i=!0):this.single&&!a.delete&&(n.delete=!0),n});i||s.push(e),this.value=s}else this.value=[e];t.detail.newValue=this.value,this.open=!1,this.activeIndex=-1,this.canUpdate=!0,this.dispatchEvent(t),this._clearSearch()}_clickOption(e){if(e.target&&e.target.value){const t=parseInt(e.target.value,10),i=this.filteredOptions.reduce((s,a)=>!s&&a.id==t?a:s,null);i&&this._select(i),this.query=""}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="",this.query="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]),this.query="")}_remove(e){if(e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value,remove:!0}});this.value=(this.value||[]).map(i=>{const s={...i};return i.id.toString()===e.target.dataset.value&&(s.delete=!0),s}),t.detail.newValue=this.value,this.dispatchEvent(t),this.open&&this.shadowRoot.querySelector("input").focus()}}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>Number(i==null?void 0:i.id));if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1,i.filteredOptions=a.filter(n=>!e.includes(n.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>f` + `]}static get properties(){return{...super.properties,single:{type:Boolean}}}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length&&!this.single){let i=!1;const s=this.value.map(a=>{const r={...a};return a.id===e.id&&a.delete?(delete r.delete,i=!0):this.single&&!a.delete&&(r.delete=!0),r});i||s.push(e),this.value=s}else this.value=[e];t.detail.newValue=this.value,this.open=!1,this.activeIndex=-1,this.canUpdate=!0,this.dispatchEvent(t),this._clearSearch()}_clickOption(e){if(e.target&&e.target.value){const t=parseInt(e.target.value,10),i=this.filteredOptions.reduce((s,a)=>!s&&a.id==t?a:s,null);i&&this._select(i),this.query=""}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="",this.query="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]),this.query="")}_remove(e){if(e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value,remove:!0}});this.value=(this.value||[]).map(i=>{const s={...i};return i.id.toString()===e.target.dataset.value&&(s.delete=!0),s}),t.detail.newValue=this.value,this.dispatchEvent(t),this.open&&this.shadowRoot.querySelector("input").focus()}}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>Number(i==null?void 0:i.id));if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,postType:this.postType,query:this.query,onSuccess:a=>{i.loading=!1,i.filteredOptions=a.filter(r=>!e.includes(r.id))},onError:a=>{console.warn(a),i.loading=!1,this.canUpdate=!1}}});this.dispatchEvent(s)}return this.filteredOptions}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>u` - `)}_renderOption(e,t){return f` + `)}_renderOption(e,t){return u`
  • - `}}window.customElements.define("dt-users-connection",hs);class ps extends R{static get styles(){return x` + `}}window.customElements.define("dt-users-connection",ps);class fs extends R{static get styles(){return x` :root { font-size: inherit; --dt-copy-text-color: #575757; @@ -1414,7 +1422,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr :host([dir='rtl']) .copy_icon { transform: translate(1.5em, -0.3125em); } - `}static get properties(){return{value:{type:String},success:{type:Boolean},error:{type:Boolean}}}get inputStyles(){return this.success?{"--dt-text-border-color":"var(--copy-text-success-color, var(--success-color))","--dt-form-text-color":"var( --copy-text-success-color, var(--success-color))",color:"var( --copy-text-success-color, var(--success-color))"}:this.error?{"---dt-text-border-color":"var(--copy-text-alert-color, var(--alert-color))","--dt-form-text-color":"var(--copy-text-alert-color, var(--alert-color))"}:{}}get icon(){return this.success?"ic:round-check":"ic:round-content-copy"}async copy(){try{this.success=!1,this.error=!1,await navigator.clipboard.writeText(this.value),this.success=!0,this.error=!1}catch(e){console.log(e),this.success=!1,this.error=!0}}render(){return f` + `}static get properties(){return{value:{type:String},success:{type:Boolean},error:{type:Boolean}}}get inputStyles(){return this.success?{"--dt-text-border-color":"var(--copy-text-success-color, var(--success-color))","--dt-form-text-color":"var( --copy-text-success-color, var(--success-color))",color:"var( --copy-text-success-color, var(--success-color))"}:this.error?{"---dt-text-border-color":"var(--copy-text-alert-color, var(--alert-color))","--dt-form-text-color":"var(--copy-text-alert-color, var(--alert-color))"}:{}}get icon(){return this.success?"ic:round-check":"ic:round-content-copy"}async copy(){try{this.success=!1,this.error=!1,await navigator.clipboard.writeText(this.value),this.success=!0,this.error=!1}catch(e){console.log(e),this.success=!1,this.error=!0}}render(){return u`
    - `}}window.customElements.define("dt-copy-text",ps);class Dt extends D{static get styles(){return[...super.styles,x` + `}}window.customElements.define("dt-copy-text",fs);class Dt extends z{static get styles(){return[...super.styles,x` input { color: var(--dt-form-text-color, #000); appearance: none; @@ -1542,14 +1550,14 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .icon-overlay { inset-inline-end: 5rem; } - `]}static get properties(){return{...super.properties,value:{type:String,reflect:!0},timestamp:{converter:e=>{let t=Number(e);if(t<1e12&&(t*=1e3),t)return t},reflect:!0}}}updateTimestamp(e){const t=new Date(e).getTime(),i=t/1e3,s=new CustomEvent("change",{detail:{field:this.name,oldValue:this.timestamp,newValue:i}});this.timestamp=t,this.value=e,this._setFormValue(e),this.dispatchEvent(s)}_change(e){this.updateTimestamp(e.target.value)}clearInput(){this.updateTimestamp("")}showDatePicker(){this.shadowRoot.querySelector("input").showPicker()}_validateRequired(){const{value:e}=this;this.required&&!e?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"text-input":!0,invalid:this.touched&&this.invalid,disabled:this.disabled}}get fieldContainerClasses(){return{"field-container":!0,invalid:this.touched&&this.invalid}}render(){return this.timestamp?this.value=new Date(this.timestamp).toISOString().substring(0,10):this.value&&(this.timestamp=new Date(this.value).getTime()),f` + `]}static get properties(){return{...super.properties,value:{type:String,reflect:!0},timestamp:{converter:e=>{let t=Number(e);if(t<1e12&&(t*=1e3),t)return t},reflect:!0}}}updateTimestamp(e){const t=new Date(e).getTime(),i=t/1e3,s=new CustomEvent("change",{detail:{field:this.name,oldValue:this.timestamp,newValue:i}});this.timestamp=t,this.value=e,this._setFormValue(e),this.dispatchEvent(s)}_change(e){this.updateTimestamp(e.target.value)}clearInput(){this.updateTimestamp("")}showDatePicker(){this.shadowRoot.querySelector("input").showPicker()}_validateRequired(){const{value:e}=this;this.required&&!e?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"text-input":!0,invalid:this.touched&&this.invalid,disabled:this.disabled}}get fieldContainerClasses(){return{"field-container":!0,invalid:this.touched&&this.invalid}}render(){return this.timestamp?this.value=new Date(this.timestamp).toISOString().substring(0,10):this.value&&(this.timestamp=new Date(this.value).getTime()),u` ${this.labelTemplate()}
    -
    +
    - `}reset(){this.updateTimestamp(""),super.reset()}}window.customElements.define("dt-date",Dt);class fs extends Dt{static get styles(){return[...super.styles,x` + `}reset(){this.updateTimestamp(""),super.reset()}}window.customElements.define("dt-date",Dt);class bs extends Dt{static get styles(){return[...super.styles,x` input[type='datetime-local'] { max-width: calc(100% - 22px - 1rem); } - `]}static get properties(){return{...super.properties,tzoffset:{type:Number}}}constructor(){super(),this.tzoffset=new Date().getTimezoneOffset()*6e4}render(){return this.timestamp?this.value=new Date(this.timestamp-this.tzoffset).toISOString().substring(0,16):this.value&&(this.timestamp=new Date(this.value).getTime()),f` + `]}static get properties(){return{...super.properties,tzoffset:{type:Number}}}constructor(){super(),this.tzoffset=new Date().getTimezoneOffset()*6e4}render(){return this.timestamp?this.value=new Date(this.timestamp-this.tzoffset).toISOString().substring(0,16):this.value&&(this.timestamp=new Date(this.value).getTime()),u` ${this.labelTemplate()}
    -
    +
    - `}}window.customElements.define("dt-datetime",fs);/** + `}}window.customElements.define("dt-datetime",bs);/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function*Ke(o,e){if(o!==void 0){let t=0;for(const i of o)yield e(i,t++)}}class bs extends Oe{static get properties(){return{...super.properties,filters:{type:Array}}}static get styles(){return[...super.styles,x` + */function*Je(o,e){if(o!==void 0){let t=0;for(const i of o)yield e(i,t++)}}class gs extends Le{static get properties(){return{...super.properties,filters:{type:Array}}}static get styles(){return[...super.styles,x` .input-group { display: flex; } @@ -1638,7 +1646,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr 8px ); } - `]}_clickOption(e){if(e.target&&e.target.value){const t=e.target.value,i=this.filteredOptions.reduce((s,a)=>!s&&a.id===t?a:s,null);this._select(i)}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]))}_remove(e){if(e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(i=>{const s={...i};return i.id.toString()===e.target.dataset.value&&(s.delete=!0),s}),t.detail.newValue=this.value,this.dispatchEvent(t),this.open&&this.shadowRoot.querySelector("input").focus()}}updated(){super.updated();const e=this.shadowRoot.querySelector(".input-group"),t=e.style.getPropertyValue("--select-width"),i=this.shadowRoot.querySelector("select");!t&&(i==null?void 0:i.clientWidth)>0&&e.style.setProperty("--select-width",`${i.clientWidth}px`)}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>i==null?void 0:i.id.toString());if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=this.shadowRoot.querySelector("select"),a=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,query:this.query,filter:s==null?void 0:s.value,onSuccess:n=>{i.loading=!1,i.filteredOptions=n.filter(r=>!e.includes(r.id))},onError:n=>{console.warn(n),i.loading=!1}}});this.dispatchEvent(a)}return this.filteredOptions}_renderOption(e,t){return f` + `]}_clickOption(e){if(e.target&&e.target.value){const t=e.target.value,i=this.filteredOptions.reduce((s,a)=>!s&&a.id===t?a:s,null);this._select(i)}}_clickAddNew(e){var t,i;if(e.target){this._select({id:(t=e.target.dataset)==null?void 0:t.label,label:(i=e.target.dataset)==null?void 0:i.label,isNew:!0});const s=this.shadowRoot.querySelector("input");s&&(s.value="")}}_keyboardSelectOption(){this.activeIndex>-1&&(this.activeIndex+1>this.filteredOptions.length?this._select({id:this.query,label:this.query,isNew:!0}):this._select(this.filteredOptions[this.activeIndex]))}_remove(e){if(e.target&&e.target.dataset&&e.target.dataset.value){const t=new CustomEvent("change",{detail:{field:this.name,oldValue:this.value}});this.value=(this.value||[]).map(i=>{const s={...i};return i.id.toString()===e.target.dataset.value&&(s.delete=!0),s}),t.detail.newValue=this.value,this.dispatchEvent(t),this.open&&this.shadowRoot.querySelector("input").focus()}}updated(){super.updated();const e=this.shadowRoot.querySelector(".input-group"),t=e.style.getPropertyValue("--select-width"),i=this.shadowRoot.querySelector("select");!t&&(i==null?void 0:i.clientWidth)>0&&e.style.setProperty("--select-width",`${i.clientWidth}px`)}_filterOptions(){var t;const e=(this.value||[]).filter(i=>!i.delete).map(i=>i==null?void 0:i.id.toString());if((t=this.options)!=null&&t.length)this.filteredOptions=(this.options||[]).filter(i=>!e.includes(i.id)&&(!this.query||i.label.toLocaleLowerCase().includes(this.query.toLocaleLowerCase())));else if(this.open||this.canUpdate){this.loading=!0,this.filteredOptions=[];const i=this,s=this.shadowRoot.querySelector("select"),a=new CustomEvent("dt:get-data",{bubbles:!0,detail:{field:this.name,query:this.query,filter:s==null?void 0:s.value,onSuccess:r=>{i.loading=!1,i.filteredOptions=r.filter(n=>!e.includes(n.id))},onError:r=>{console.warn(r),i.loading=!1}}});this.dispatchEvent(a)}return this.filteredOptions}_renderOption(e,t){return u`
  • - `}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>f` + `}_renderSelectedOptions(){return(this.value||[]).filter(e=>!e.delete).map(e=>u`
    - `)}render(){const e={display:this.open?"block":"none",top:`${this.containerHeight}px`};return f` + `)}render(){const e={display:this.open?"block":"none",top:`${this.containerHeight}px`};return u` ${this.labelTemplate()}
    @@ -1697,14 +1705,14 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr ?disabled="${this.disabled}" @change="${this._filterOptions}" > - ${Ke(this.filters,t=>f``)} + ${Je(this.filters,t=>u``)}
      ${this._renderOptions()}
    ${this.renderIconInvalid()} ${this.renderError()}
    - `}}window.customElements.define("dt-location",bs);class Ra{constructor(e){this.token=e}async searchPlaces(e,t="en"){const i=new URLSearchParams({types:["country","region","postcode","district","place","locality","neighborhood","address"],limit:6,access_token:this.token,language:t}),s={method:"GET",headers:{"Content-Type":"application/json"}},a=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURI(e)}.json?${i}`,r=await(await fetch(a,s)).json();return r==null?void 0:r.features}async reverseGeocode(e,t,i="en"){const s=new URLSearchParams({types:["country","region","postcode","district","place","locality","neighborhood","address"],access_token:this.token,language:i}),a={method:"GET",headers:{"Content-Type":"application/json"}},n=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURI(e)},${encodeURI(t)}.json?${s}`,l=await(await fetch(n,a)).json();return l==null?void 0:l.features}}class Na{constructor(e,t,i){var s,a,n;if(this.token=e,this.window=t,!((n=(a=(s=t.google)==null?void 0:s.maps)==null?void 0:a.places)!=null&&n.AutocompleteService)){const r=i.createElement("script");r.src=`https://maps.googleapis.com/maps/api/js?libraries=places&key=${e}`,i.body.appendChild(r)}}async getPlacePredictions(e,t="en"){try{return await this._getPlacePredictionsLegacy(e,t)}catch(i){const s=await this._getPlaceSuggestionsRest(e,t);if(s)return s;throw{message:i}}}async _getPlacePredictionsLegacy(e,t="en"){return this.window.google?new Promise((i,s)=>{const a=new this.window.google.maps.places.AutocompleteService;window.gm_authFailure=function(){s("Google Maps API Key authentication failed")},a.getPlacePredictions({input:e,language:t},(n,r)=>{r!=="OK"?s(r):i(n)})}):null}async _getPlaceSuggestionsRest(e,t="en"){const i="https://places.googleapis.com/v1/places:autocomplete?key="+encodeURIComponent(this.token),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),n=await a.json();if(!a.ok&&n.error)throw n.error;return(Array.isArray(n&&n.suggestions)?n.suggestions:[]).map(b=>b&&b.placePrediction?b.placePrediction:null).filter(Boolean).map(b=>{const g=b.placeId||(b.place?String(b.place).replace("places/",""):null),v=b.text&&b.text.text||[b.structuredFormat&&b.structuredFormat.mainText&&b.structuredFormat.mainText.text,b.structuredFormat&&b.structuredFormat.secondaryText&&b.structuredFormat.secondaryText.text].filter(Boolean).join(", ");return g&&v?{description:v,place_id:g}:null}).filter(Boolean)}async getPlaceDetails(e,t="en"){let i=null;if(this.window.google){const s=new window.google.maps.Geocoder;try{const{results:a}=await s.geocode({placeId:e.place_id,language:t}),n=a[0];i={lng:n.geometry.location.lng(),lat:n.geometry.location.lat(),level:this.convert_level(n.types[0]),label:e.description||n.formatted_address}}catch(a){i={error:a}}}return i}async reverseGeocode(e,t,i="en"){const a=`https://maps.googleapis.com/maps/api/geocode/json?${new URLSearchParams({key:this.token,latlng:`${t},${e}`,language:i,result_type:["point_of_interest","establishment","premise","street_address","neighborhood","sublocality","locality","colloquial_area","political","country"].join("|")})}`,r=await(await fetch(a,{method:"GET"})).json();return r==null?void 0:r.results}convert_level(e){switch(e){case"administrative_area_level_0":e="admin0";break;case"administrative_area_level_1":e="admin1";break;case"administrative_area_level_2":e="admin2";break;case"administrative_area_level_3":e="admin3";break;case"administrative_area_level_4":e="admin4";break;case"administrative_area_level_5":e="admin5";break}return e}}class gs extends R{static get styles(){return x` + `}}window.customElements.define("dt-location",gs);class Na{constructor(e){this.token=e}async searchPlaces(e,t="en"){const i=new URLSearchParams({types:["country","region","postcode","district","place","locality","neighborhood","address"],limit:6,access_token:this.token,language:t}),s={method:"GET",headers:{"Content-Type":"application/json"}},a=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURI(e)}.json?${i}`,n=await(await fetch(a,s)).json();return n==null?void 0:n.features}async reverseGeocode(e,t,i="en"){const s=new URLSearchParams({types:["country","region","postcode","district","place","locality","neighborhood","address"],access_token:this.token,language:i}),a={method:"GET",headers:{"Content-Type":"application/json"}},r=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURI(e)},${encodeURI(t)}.json?${s}`,l=await(await fetch(r,a)).json();return l==null?void 0:l.features}}class qa{constructor(e,t,i){var s,a,r;if(this.token=e,this.window=t,!((r=(a=(s=t.google)==null?void 0:s.maps)==null?void 0:a.places)!=null&&r.AutocompleteService)){const n=i.createElement("script");n.src=`https://maps.googleapis.com/maps/api/js?libraries=places&key=${e}`,i.body.appendChild(n)}}async getPlacePredictions(e,t="en"){try{return await this._getPlacePredictionsLegacy(e,t)}catch(i){const s=await this._getPlaceSuggestionsRest(e,t);if(s)return s;throw{message:i}}}async _getPlacePredictionsLegacy(e,t="en"){return this.window.google?new Promise((i,s)=>{const a=new this.window.google.maps.places.AutocompleteService;window.gm_authFailure=function(){s("Google Maps API Key authentication failed")},a.getPlacePredictions({input:e,language:t},(r,n)=>{n!=="OK"?s(n):i(r)})}):null}async _getPlaceSuggestionsRest(e,t="en"){const i="https://places.googleapis.com/v1/places:autocomplete?key="+encodeURIComponent(this.token),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),r=await a.json();if(!a.ok&&r.error)throw r.error;return(Array.isArray(r&&r.suggestions)?r.suggestions:[]).map(h=>h&&h.placePrediction?h.placePrediction:null).filter(Boolean).map(h=>{const g=h.placeId||(h.place?String(h.place).replace("places/",""):null),m=h.text&&h.text.text||[h.structuredFormat&&h.structuredFormat.mainText&&h.structuredFormat.mainText.text,h.structuredFormat&&h.structuredFormat.secondaryText&&h.structuredFormat.secondaryText.text].filter(Boolean).join(", ");return g&&m?{description:m,place_id:g}:null}).filter(Boolean)}async getPlaceDetails(e,t="en"){let i=null;if(this.window.google){const s=new window.google.maps.Geocoder;try{const{results:a}=await s.geocode({placeId:e.place_id,language:t}),r=a[0];i={lng:r.geometry.location.lng(),lat:r.geometry.location.lat(),level:this.convert_level(r.types[0]),label:e.description||r.formatted_address}}catch(a){i={error:a}}}return i}async reverseGeocode(e,t,i="en"){const a=`https://maps.googleapis.com/maps/api/geocode/json?${new URLSearchParams({key:this.token,latlng:`${t},${e}`,language:i,result_type:["point_of_interest","establishment","premise","street_address","neighborhood","sublocality","locality","colloquial_area","political","country"].join("|")})}`,n=await(await fetch(a,{method:"GET"})).json();return n==null?void 0:n.results}convert_level(e){switch(e){case"administrative_area_level_0":e="admin0";break;case"administrative_area_level_1":e="admin1";break;case"administrative_area_level_2":e="admin2";break;case"administrative_area_level_3":e="admin3";break;case"administrative_area_level_4":e="admin4";break;case"administrative_area_level_5":e="admin5";break}return e}}class ms extends R{static get styles(){return x` :host { display: block; font-family: var(--font-family); @@ -1922,23 +1930,23 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr /* Styles for the content inside the named slot */ font-size: 15px;; } - `}static get properties(){return{title:{type:String},context:{type:String},isHelp:{type:Boolean},isOpen:{type:Boolean},hideHeader:{type:Boolean},hideButton:{type:Boolean},buttonClass:{type:Object},buttonStyle:{type:Object},headerClass:{type:Object},imageSrc:{type:String},imageStyle:{type:Object},tileLabel:{type:String},buttonLabel:{type:String},dropdownListImg:{type:String},submitButton:{type:Boolean},closeButton:{type:Boolean},bottom:{type:Boolean}}}constructor(){super(),this.context="default",this.addEventListener("open",()=>this._openModal()),this.addEventListener("close",()=>this._closeModal())}_openModal(){this.isOpen=!0,this.shadowRoot.querySelector("dialog").showModal(),document.querySelector("body").style.overflow="hidden"}get formattedTitle(){if(!this.title)return"";const e=this.title.replace(/_/g," ");return e.charAt(0).toUpperCase()+e.slice(1)}_dialogHeader(e){return this.hideHeader?f``:f` + `}static get properties(){return{title:{type:String},context:{type:String},isHelp:{type:Boolean},isOpen:{type:Boolean},hideHeader:{type:Boolean},hideButton:{type:Boolean},buttonClass:{type:Object},buttonStyle:{type:Object},headerClass:{type:Object},imageSrc:{type:String},imageStyle:{type:Object},tileLabel:{type:String},buttonLabel:{type:String},dropdownListImg:{type:String},submitButton:{type:Boolean},closeButton:{type:Boolean},bottom:{type:Boolean}}}constructor(){super(),this.context="default",this.addEventListener("open",()=>this._openModal()),this.addEventListener("close",()=>this._closeModal())}_openModal(){this.isOpen=!0,this.shadowRoot.querySelector("dialog").showModal(),document.querySelector("body").style.overflow="hidden"}get formattedTitle(){if(!this.title)return"";const e=this.title.replace(/_/g," ");return e.charAt(0).toUpperCase()+e.slice(1)}_dialogHeader(e){return this.hideHeader?u``:u`

    ${this.formattedTitle}

    - `}_closeModal(){this.isOpen=!1,this.shadowRoot.querySelector("dialog").close(),document.querySelector("body").style.overflow="initial"}_cancelModal(){this._triggerClose("cancel")}_triggerClose(e){this.dispatchEvent(new CustomEvent("close",{detail:{action:e}}))}_dialogClick(e){if(e.target.tagName!=="DIALOG")return;const t=e.target.getBoundingClientRect();(t.top<=e.clientY&&e.clientY<=t.top+t.height&&t.left<=e.clientX&&e.clientX<=t.left+t.width)===!1&&this._cancelModal()}_dialogKeypress(e){e.key==="Escape"&&this._cancelModal()}_helpMore(){return this.isHelp?f` + `}_closeModal(){this.isOpen=!1,this.shadowRoot.querySelector("dialog").close(),document.querySelector("body").style.overflow="initial"}_cancelModal(){this._triggerClose("cancel")}_triggerClose(e){this.dispatchEvent(new CustomEvent("close",{detail:{action:e}}))}_dialogClick(e){if(e.target.tagName!=="DIALOG")return;const t=e.target.getBoundingClientRect();(t.top<=e.clientY&&e.clientY<=t.top+t.height&&t.left<=e.clientX&&e.clientX<=t.left+t.width)===!1&&this._cancelModal()}_dialogKeypress(e){e.key==="Escape"&&this._cancelModal()}_helpMore(){return this.isHelp?u`
    - `:null}firstUpdated(){this.isOpen&&this._openModal()}_onButtonClick(){this._triggerClose("button")}get classes(){return{...this.headerClass,"no-header":this.hideHeader,bottom:this.bottom}}render(){const e=f` + `:null}firstUpdated(){this.isOpen&&this._openModal()}_onButtonClick(){this._triggerClose("button")}get classes(){return{...this.headerClass,"no-header":this.hideHeader,bottom:this.bottom}}render(){const e=u` xmlns="http://www.w3.org/2000/svg"> - `;return f` + `;return u` @@ -1964,7 +1972,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr
    - ${this.hideButton?null:f` + ${this.hideButton?null:u` `} - `}}window.customElements.define("dt-modal",gs);class ms extends R{static get properties(){return{...super.properties,title:{type:String},isOpen:{type:Boolean},canEdit:{type:Boolean,state:!0},metadata:{type:Object},center:{type:Array},mapboxToken:{type:String,attribute:"mapbox-token"}}}static get styles(){return[x` + `}}window.customElements.define("dt-modal",ms);class vs extends R{static get properties(){return{...super.properties,title:{type:String},isOpen:{type:Boolean},canEdit:{type:Boolean,state:!0},metadata:{type:Object},center:{type:Array},mapboxToken:{type:String,attribute:"mapbox-token"}}}static get styles(){return[x` .map { width: 100%; min-width: 50vw; min-height: 50dvb; } - `]}constructor(){super(),this.addEventListener("open",e=>{this.shadowRoot.querySelector("dt-modal").dispatchEvent(new Event("open")),this.isOpen=!0}),this.addEventListener("close",e=>{this.shadowRoot.querySelector("dt-modal").dispatchEvent(new Event("close")),this.isOpen=!1})}connectedCallback(){if(super.connectedCallback(),this.canEdit=!this.metadata,window.mapboxgl)this.initMap();else{const e=document.createElement("script");e.src="https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.js",e.onload=this.initMap.bind(this),document.body.appendChild(e)}}initMap(){if(!this.isOpen||!window.mapboxgl||!this.mapboxToken)return;const e=this.shadowRoot.querySelector("#map");if(e&&!this.map){this.map=new window.mapboxgl.Map({accessToken:this.mapboxToken,container:e,style:"mapbox://styles/mapbox/streets-v12",minZoom:1}),this.map.on("load",()=>this.map.resize()),this.center&&this.center.length&&(this.map.setCenter(this.center),this.map.setZoom(15));const t=new mapboxgl.NavigationControl;this.map.addControl(t,"bottom-right"),this.addPinFromMetadata(),this.map.on("click",i=>{this.canEdit&&(this.marker?this.marker.setLngLat(i.lngLat):this.marker=new mapboxgl.Marker().setLngLat(i.lngLat).addTo(this.map))})}}addPinFromMetadata(){if(this.metadata){const{lng:e,lat:t,level:i}=this.metadata;let s=15;i==="admin0"?s=3:i==="admin1"?s=6:i==="admin2"&&(s=10),this.map&&(this.map.setCenter([e,t]),this.map.setZoom(s),this.marker=new mapboxgl.Marker().setLngLat([e,t]).addTo(this.map))}}updated(e){window.mapboxgl&&(e.has("metadata")&&this.metadata&&this.metadata.lat&&this.addPinFromMetadata(),e.has("isOpen")&&this.isOpen&&this.initMap())}onClose(e){var t;((t=e==null?void 0:e.detail)==null?void 0:t.action)==="button"&&this.marker&&this.dispatchEvent(new CustomEvent("submit",{detail:{location:this.marker.getLngLat()}}))}render(){var e;return f` + `]}constructor(){super(),this.addEventListener("open",e=>{this.shadowRoot.querySelector("dt-modal").dispatchEvent(new Event("open")),this.isOpen=!0}),this.addEventListener("close",e=>{this.shadowRoot.querySelector("dt-modal").dispatchEvent(new Event("close")),this.isOpen=!1})}connectedCallback(){if(super.connectedCallback(),this.canEdit=!this.metadata,window.mapboxgl)this.initMap();else{const e=document.createElement("script");e.src="https://api.mapbox.com/mapbox-gl-js/v2.11.0/mapbox-gl.js",e.onload=this.initMap.bind(this),document.body.appendChild(e)}}initMap(){if(!this.isOpen||!window.mapboxgl||!this.mapboxToken)return;const e=this.shadowRoot.querySelector("#map");if(e&&!this.map){this.map=new window.mapboxgl.Map({accessToken:this.mapboxToken,container:e,style:"mapbox://styles/mapbox/streets-v12",minZoom:1}),this.map.on("load",()=>this.map.resize()),this.center&&this.center.length&&(this.map.setCenter(this.center),this.map.setZoom(15));const t=new mapboxgl.NavigationControl;this.map.addControl(t,"bottom-right"),this.addPinFromMetadata(),this.map.on("click",i=>{this.canEdit&&(this.marker?this.marker.setLngLat(i.lngLat):this.marker=new mapboxgl.Marker().setLngLat(i.lngLat).addTo(this.map))})}}addPinFromMetadata(){if(this.metadata){const{lng:e,lat:t,level:i}=this.metadata;let s=15;i==="admin0"?s=3:i==="admin1"?s=6:i==="admin2"&&(s=10),this.map&&(this.map.setCenter([e,t]),this.map.setZoom(s),this.marker=new mapboxgl.Marker().setLngLat([e,t]).addTo(this.map))}}updated(e){window.mapboxgl&&(e.has("metadata")&&this.metadata&&this.metadata.lat&&this.addPinFromMetadata(),e.has("isOpen")&&this.isOpen&&this.initMap())}onClose(e){var t;((t=e==null?void 0:e.detail)==null?void 0:t.action)==="button"&&this.marker&&this.dispatchEvent(new CustomEvent("submit",{detail:{location:this.marker.getLngLat()}}))}render(){var e;return u`
    - ${this.canEdit?f`
    ${O("Save")}
    `:null} + ${this.canEdit?u`
    ${I("Save")}
    `:null} - `}}window.customElements.define("dt-map-modal",ms);class qa extends R{static get properties(){return{id:{type:String,reflect:!0},placeholder:{type:String},mapboxToken:{type:String,attribute:"mapbox-token"},googleToken:{type:String,attribute:"google-token"},metadata:{type:Object},disabled:{type:Boolean},open:{type:Boolean,state:!0},query:{type:String,state:!0},activeIndex:{type:Number,state:!0},containerHeight:{type:Number,state:!0},loading:{type:Boolean},saved:{type:Boolean},invalid:{type:Boolean},filteredOptions:{type:Array,state:!0}}}static get styles(){return[x` + `}}window.customElements.define("dt-map-modal",vs);class Ua extends R{static get properties(){return{id:{type:String,reflect:!0},placeholder:{type:String},mapboxToken:{type:String,attribute:"mapbox-token"},googleToken:{type:String,attribute:"google-token"},metadata:{type:Object},disabled:{type:Boolean},open:{type:Boolean,state:!0},query:{type:String,state:!0},activeIndex:{type:Number,state:!0},containerHeight:{type:Number,state:!0},loading:{type:Boolean},saved:{type:Boolean},invalid:{type:Boolean},filteredOptions:{type:Array,state:!0}}}static get styles(){return[x` :host { --dt-location-map-border-color: var(--dt-form-border-color, #fefefe); position: relative; @@ -2247,7 +2255,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr opacity: 0; animation: fadeOut 4s; } - `]}constructor(){super(),this.activeIndex=-1,this.filteredOptions=[],this.detectTap=!1,this.debounceTimer=null}connectedCallback(){super.connectedCallback(),this.addEventListener("autofocus",async()=>{await this.updateComplete;const e=this.shadowRoot.querySelector("input");e&&e.focus()}),this.mapboxToken&&(this.mapboxService=new Ra(this.mapboxToken))}firstUpdated(){var e;this.googleToken&&!((e=this.metadata)!=null&&e.lat)&&(this.googleGeocodeService=new Na(this.googleToken,window,document))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("autofocus",this.handleAutofocus)}updated(){this._scrollOptionListToActive();const e=this.shadowRoot.querySelector(".input-group");e.style.getPropertyValue("--container-width")||e.style.setProperty("--container-width",`${e.clientWidth}px`)}_scrollOptionListToActive(){const e=this.shadowRoot.querySelector(".option-list"),t=this.shadowRoot.querySelector("button.active");if(e&&t){const i=t.offsetTop,s=t.offsetTop+t.clientHeight,a=e.scrollTop,n=e.scrollTop+e.clientHeight;s>n?e.scrollTo({top:s-e.clientHeight,behavior:"smooth"}):i-1&&(this.activeIndex({label:t.description,place_id:t.place_id,source:"user",raw:t})),this.loading=!1}catch(e){console.error(e),this.error=e.message||"An error occurred while searching for locations.",this.loading=!1;return}}else if(this.mapboxToken&&this.mapboxService){this.saved=!1,this.loading=!0;const e=await this.mapboxService.searchPlaces(this.query,this.locale);this.filteredOptions=e.map(t=>({lng:t.center[0],lat:t.center[1],level:t.place_type[0],label:t.place_name,source:"user"})),this.loading=!1}}return this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e&&(e.has("query")&&(this.error=!1,clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this._filterOptions(),300)),!this.containerHeight&&this.shadowRoot.children&&this.shadowRoot.children.length)){const i=this.shadowRoot.querySelector(".input-group");i&&(this.containerHeight=i.offsetHeight)}}_change(){}_delete(){const e={detail:{metadata:this.metadata},bubbles:!1};this.dispatchEvent(new CustomEvent("delete",e))}_openMapModal(){this.shadowRoot.querySelector("dt-map-modal").dispatchEvent(new Event("open"))}async _onMapModalSubmit(e){var t,i;if((i=(t=e==null?void 0:e.detail)==null?void 0:t.location)!=null&&i.lat){const{location:s}=e==null?void 0:e.detail,{lat:a,lng:n}=s;if(this.googleGeocodeService){const r=await this.googleGeocodeService.reverseGeocode(n,a,this.locale);if(r&&r.length){const l=r[0];this._select({lng:l.geometry.location.lng,lat:l.geometry.location.lat,level:l.types&&l.types.length?l.types[0]:null,label:l.formatted_address,source:"user"})}}else if(this.mapboxService){const r=await this.mapboxService.reverseGeocode(n,a,this.locale);if(r&&r.length){const l=r[0];this._select({lng:l.center[0],lat:l.center[1],level:l.place_type[0],label:l.place_name,source:"user"})}}}}_renderOption(e,t,i){return f` + `]}constructor(){super(),this.activeIndex=-1,this.filteredOptions=[],this.detectTap=!1,this.debounceTimer=null}connectedCallback(){super.connectedCallback(),this.addEventListener("autofocus",async()=>{await this.updateComplete;const e=this.shadowRoot.querySelector("input");e&&e.focus()}),this.mapboxToken&&(this.mapboxService=new Na(this.mapboxToken))}firstUpdated(){var e;this.googleToken&&!((e=this.metadata)!=null&&e.lat)&&(this.googleGeocodeService=new qa(this.googleToken,window,document))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("autofocus",this.handleAutofocus)}updated(){this._scrollOptionListToActive();const e=this.shadowRoot.querySelector(".input-group");e.style.getPropertyValue("--container-width")||e.style.setProperty("--container-width",`${e.clientWidth}px`)}_scrollOptionListToActive(){const e=this.shadowRoot.querySelector(".option-list"),t=this.shadowRoot.querySelector("button.active");if(e&&t){const i=t.offsetTop,s=t.offsetTop+t.clientHeight,a=e.scrollTop,r=e.scrollTop+e.clientHeight;s>r?e.scrollTo({top:s-e.clientHeight,behavior:"smooth"}):i-1&&(this.activeIndex({label:t.description,place_id:t.place_id,source:"user",raw:t})),this.loading=!1}catch(e){console.error(e),this.error=e.message||"An error occurred while searching for locations.",this.loading=!1;return}}else if(this.mapboxToken&&this.mapboxService){this.saved=!1,this.loading=!0;const e=await this.mapboxService.searchPlaces(this.query,this.locale);this.filteredOptions=e.map(t=>({lng:t.center[0],lat:t.center[1],level:t.place_type[0],label:t.place_name,source:"user"})),this.loading=!1}}return this.filteredOptions}willUpdate(e){if(super.willUpdate(e),e&&(e.has("query")&&(this.error=!1,clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this._filterOptions(),300)),!this.containerHeight&&this.shadowRoot.children&&this.shadowRoot.children.length)){const i=this.shadowRoot.querySelector(".input-group");i&&(this.containerHeight=i.offsetHeight)}}_change(){}_delete(){const e={detail:{metadata:this.metadata},bubbles:!1};this.dispatchEvent(new CustomEvent("delete",e))}_openMapModal(){this.shadowRoot.querySelector("dt-map-modal").dispatchEvent(new Event("open"))}async _onMapModalSubmit(e){var t,i;if((i=(t=e==null?void 0:e.detail)==null?void 0:t.location)!=null&&i.lat){const{location:s}=e==null?void 0:e.detail,{lat:a,lng:r}=s;if(this.googleGeocodeService){const n=await this.googleGeocodeService.reverseGeocode(r,a,this.locale);if(n&&n.length){const l=n[0];this._select({lng:l.geometry.location.lng,lat:l.geometry.location.lat,level:l.types&&l.types.length?l.types[0]:null,label:l.formatted_address,source:"user"})}}else if(this.mapboxService){const n=await this.mapboxService.reverseGeocode(r,a,this.locale);if(n&&n.length){const l=n[0];this._select({lng:l.center[0],lat:l.center[1],level:l.place_type[0],label:l.place_name,source:"user"})}}}}_renderOption(e,t,i){return u`
  • - `}_renderOptions(){const e=[];return this.filteredOptions.length?e.push(...this.filteredOptions.map((t,i)=>this._renderOption(t,i))):this.loading?e.push(f`
  • ${O("Loading...")}
  • `):e.push(f`
  • ${O("No Data Available")}
  • `),e.push(this._renderOption({value:this.query,label:this.query},(this.filteredOptions||[]).length,f`${O("Use")}: "${this.query}"`)),e}get classes(){return{"field-container":!0,invalid:this.invalid}}render(){var s,a,n,r;const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"},t=!!((s=this.metadata)!=null&&s.label),i=((a=this.metadata)==null?void 0:a.lat)&&((n=this.metadata)==null?void 0:n.lng);return f` + `}_renderOptions(){const e=[];return this.filteredOptions.length?e.push(...this.filteredOptions.map((t,i)=>this._renderOption(t,i))):this.loading?e.push(u`
  • ${I("Loading...")}
  • `):e.push(u`
  • ${I("No Data Available")}
  • `),e.push(this._renderOption({value:this.query,label:this.query},(this.filteredOptions||[]).length,u`${I("Use")}: "${this.query}"`)),e}get classes(){return{"field-container":!0,invalid:this.invalid}}render(){var s,a,r,n;const e={display:this.open?"block":"none",top:this.containerHeight?`${this.containerHeight}px`:"2.5rem"},t=!!((s=this.metadata)!=null&&s.label),i=((a=this.metadata)==null?void 0:a.lat)&&((r=this.metadata)==null?void 0:r.lng);return u`
    -
    +
    - ${t&&i?f` + ${t&&i?u` `:null} - ${t?f` + ${t?u` - `:f` + `:u` - `,()=>f``)} + `,()=>u``)}
    - `}renderIcons(){let e=0,t=!1;for(const[a,n]of(this.value||[]).entries())!n.value&&a!==0?e+=1:n.delete&&!t&&(t=!0);let i=.5;t===!1&&(i+=3*e);const s=`padding-block-end: ${i.toString()}rem`;return f` + `}renderIcons(){let e=0,t=!1;for(const[a,r]of(this.value||[]).entries())!r.value&&a!==0?e+=1:r.delete&&!t&&(t=!0);let i=.5;t===!1&&(i+=3*e);const s=`padding-block-end: ${i.toString()}rem`;return u` ${this.renderIconInvalid()} ${this.renderError()} ${this.renderIconLoading(s)} ${this.renderIconSaved(s)} - `}renderIconLoading(e){return this.loading?f``:null}renderIconSaved(e){return this.saved&&(this.savedTimeout&&clearTimeout(this.savedTimeout),this.savedTimeout=setTimeout(()=>{this.savedTimeout=null,this.saved=!1},5e3)),this.saved?f``:null}renderIconSaved(e){return this.saved&&(this.savedTimeout&&clearTimeout(this.savedTimeout),this.savedTimeout=setTimeout(()=>{this.savedTimeout=null,this.saved=!1},5e3)),this.saved?u``:null}_renderInputFields(){return(!this.value||!this.value.length)&&(this.value=[{verified:!1,value:"",tempKey:Date.now().toString()}]),f` - ${Ee((this.value??[]).filter(e=>!e.delete),e=>e.id,e=>this._inputFieldTemplate(e,this.value.length))} - `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t.value))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"text-input":!0,invalid:this.touched&&this.invalid}}render(){return f` + >`:null}_renderInputFields(){return(!this.value||!this.value.length)&&(this.value=[{verified:!1,value:"",tempKey:Date.now().toString()}]),u` + ${ce((this.value??[]).filter(e=>!e.delete),e=>e.id,e=>this._inputFieldTemplate(e,this.value.length))} + `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t.value))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"text-input":!0,invalid:this.touched&&this.invalid}}render(){return u` ${this.labelTemplate()}
    ${this._renderInputFields()} ${this.renderIcons()}
    - `}}window.customElements.define("dt-multi-text",$s);class xs extends D{static get styles(){return[...super.styles,x` + `}}window.customElements.define("dt-multi-text",xs);class ks extends z{static get styles(){return[...super.styles,x` :host { margin-bottom: 5px; --dt-button-font-size: 0.75rem; @@ -2932,7 +2940,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr .invalid ~ .error-container { border-top-width: 1px; } - `]}constructor(){super(),this.options=[]}static get properties(){return{value:{type:Array,reflect:!0},context:{type:String},options:{type:Array},outline:{type:Boolean}}}get _field(){return this.shadowRoot.querySelector(".input-group")}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length){const i=this.value.includes(e);this.value=[...this.value.filter(s=>s!==e&&s!==`-${e}`),i?`-${e}`:e]}else this.value=[e];t.detail.newValue=this.value,this.dispatchEvent(t),this._setFormValue(this.value)}_clickOption(e){var t;(t=e==null?void 0:e.currentTarget)!=null&&t.value&&this._select(e.currentTarget.value)}_inputKeyUp(e){switch(e.keyCode||e.which){case 13:this._clickOption(e);break}}_renderButton(e){const i=(this.value??[]).includes(e.id)?"success":this.touched&&this.invalid?"alert":"inactive",s=this.outline??(this.touched&&this.invalid);return f` + `]}constructor(){super(),this.options=[]}static get properties(){return{value:{type:Array,reflect:!0},context:{type:String},options:{type:Array},outline:{type:Boolean}}}get _field(){return this.shadowRoot.querySelector(".input-group")}_select(e){const t=new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value}});if(this.value&&this.value.length){const i=this.value.includes(e);this.value=[...this.value.filter(s=>s!==e&&s!==`-${e}`),i?`-${e}`:e]}else this.value=[e];t.detail.newValue=this.value,this.dispatchEvent(t),this._setFormValue(this.value)}_clickOption(e){var t;(t=e==null?void 0:e.currentTarget)!=null&&t.value&&this._select(e.currentTarget.value)}_inputKeyUp(e){switch(e.keyCode||e.which){case 13:this._clickOption(e);break}}_renderButton(e){const i=(this.value??[]).includes(e.id)?"success":this.touched&&this.invalid?"alert":"inactive",s=this.outline??(this.touched&&this.invalid);return u` - ${e.icon?f`${this.iconAltText}`:null} ${e.label} - `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"button-group":!0,invalid:this.touched&&this.invalid}}render(){return f` + `}_validateRequired(){const{value:e}=this;this.required&&(!e||e.every(t=>!t||t.charAt(0)==="-"))?(this.invalid=!0,this.internals.setValidity({valueMissing:!0},this.requiredMessage||"This field is required",this._field)):(this.invalid=!1,this.internals.setValidity({}))}get classes(){return{"button-group":!0,invalid:this.touched&&this.invalid}}render(){return u` ${this.labelTemplate()}
    -
    - ${Ee(this.options??[],e=>e.id,e=>this._renderButton(e))} +
    + ${ce(this.options??[],e=>e.id,e=>this._renderButton(e))} +
    + ${this.renderIcons()} +
    + `}}window.customElements.define("dt-multi-select-button-group",ks);class Ss extends z{constructor(){super();Me(this,"_handleUploadStagedEvent",()=>{this.uploadStagedFiles()});this.value=[],this.acceptedFileTypes=["image/*","application/pdf"],this.maxFileSize=null,this.maxFiles=null,this.deleteEnabled=!0,this.downloadEnabled=!0,this.renameEnabled=!0,this.displayLayout="grid",this.fileTypeIcon="",this.autoUpload=!0,this.postType="",this.postId="",this.metaKey="",this.keyPrefix="",this.uploading=!1,this.stagedFiles=[],this._uploadZoneExpanded=!1,this._dragOver=!1,this._editingFileKey="",this._editingFileName="",this._dragLeaveTimeout=null,this._resizeObserver=null,this._keydownAttached=!1}static get styles(){return[...super.styles,x` + :host { + display: block; + } + + .upload-zone { + border: 2px dashed var(--dt-upload-border-color, #ccc); + border-radius: 4px; + text-align: center; + background-color: var(--dt-upload-background-color, #fafafa); + transition: padding 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; + cursor: pointer; + position: relative; + width: 100%; + box-sizing: border-box; + } + + .upload-zone.compact { + padding: 0.75rem; + } + + .upload-zone.expanded { + padding: 2rem; + } + + .upload-zone:hover:not(.disabled):not(.uploading) { + border-color: var(--dt-upload-border-color-hover, #999); + background-color: var(--dt-upload-background-color-hover, #f0f0f0); + } + + .upload-zone.drag-over { + border-color: var(--primary-color, #0073aa); + background-color: var(--dt-upload-background-color-drag, #e8f4f8); + } + + .upload-zone.disabled { + opacity: 0.6; + cursor: not-allowed; + } + + .upload-zone.uploading { + pointer-events: none; + } + + .upload-zone-content { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; + } + + .upload-zone-content .expandable { + transition: opacity 0.2s ease; + } + + .upload-zone.compact .upload-zone-content .expandable { + display: none; + } + + .upload-zone.expanded .upload-zone-content .expandable { + display: block; + } + + .upload-icon { + color: var(--dt-upload-icon-color, #999); + flex-shrink: 0; + } + + .upload-zone.compact .upload-icon { + font-size: 1.75rem; + } + + .upload-zone.expanded .upload-icon { + font-size: 3rem; + } + + .upload-text { + font-size: 1rem; + color: var(--dt-upload-text-color, #666); + } + + .upload-hint { + font-size: 0.875rem; + color: var(--dt-upload-hint-color, #999); + } + + input[type='file'] { + position: absolute; + width: 0; + height: 0; + opacity: 0; + overflow: hidden; + } + + .files-container { + margin-top: 1rem; + } + + .files-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); + gap: 1rem; + } + + .files-list { + display: flex; + flex-direction: column; + gap: 0.5rem; + } + + .file-item { + position: relative; + border: 1px solid var(--dt-upload-file-border-color, #ddd); + border-radius: 4px; + overflow: hidden; + background-color: var(--dt-upload-file-background-color, #fff); + } + + .file-item-grid { + aspect-ratio: 1; + display: flex; + flex-direction: column; + } + + .file-item-list { + display: grid; + grid-template-columns: 40px 1fr auto; + grid-template-rows: auto auto; + align-items: center; + padding: 0.5rem; + gap: 0 0.75rem; + row-gap: 0.125rem; + } + + .file-item-list .file-preview-link, + .file-item-list .file-icon-area { + grid-column: 1; + grid-row: 1 / -1; + width: 40px; + height: 40px; + min-width: 40px; + min-height: 40px; + border-radius: 6px; + overflow: hidden; + } + + .file-item-list .file-name, + .file-item-list .file-name-edit, + .file-item-list input.file-name-edit { + grid-column: 2; + grid-row: 1; + min-width: 0; + } + + .file-item-list .file-size { + grid-column: 2; + grid-row: 2; + } + + .file-item-list .file-actions { + grid-column: 3; + grid-row: 1 / -1; + position: relative; + } + + .file-item-list .file-icon-area dt-icon { + font-size: 1.25rem; + } + + .file-preview-link { + display: block; + cursor: pointer; + flex: 1; + min-height: 0; + height: calc(100% - 1.5rem); + } + + .file-preview-link img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; + } + + .file-icon-area { + display: flex; + align-items: center; + justify-content: center; + background-color: var(--dt-upload-file-icon-background, #f5f5f5); + color: var(--dt-upload-file-icon-color, #999); + flex: 1; + min-height: 0; + height: calc(100% - 1.5rem); + } + + .file-icon-area dt-icon { + font-size: 2rem; + } + + .file-icon-area img { + max-width: 100%; + max-height: 100%; + object-fit: contain; + } + + .file-name { + font-size: 0.75rem; + color: var(--dt-upload-file-name-color, #333); + padding: 0.25rem 0.5rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .file-name-editable { + cursor: pointer; + position: relative; + z-index: 2; + } + + .file-name-editable:hover { + text-decoration: underline; + } + + .file-name-edit { + font-size: 0.75rem; + color: var(--dt-upload-file-name-color, #333); + padding: 0.25rem 0.5rem; + width: 100%; + box-sizing: border-box; + border: 1px solid var(--primary-color, #0073aa); + border-radius: 2px; + background: var(--dt-upload-file-background-color, #fff); + } + + .file-name-edit:focus { + outline: none; + border-color: var(--primary-color, #0073aa); + } + + .file-size { + font-size: 0.7rem; + color: var(--dt-upload-file-size-color, #999); + padding: 0 0.5rem 0.25rem; + } + + .file-actions { + position: absolute; + top: 0.25rem; + inset-inline-end: 0.25rem; + display: flex; + gap: 0.25rem; + z-index: 1; + pointer-events: none; + } + + .file-actions button { + pointer-events: auto; + background: rgba(255, 255, 255, 0.9); + border: none; + border-radius: 4px; + padding: 0.25rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + } + + .file-actions button:hover { + background: #fff; + } + + .file-actions button dt-icon { + font-size: 1rem; + } + + .file-actions button.download { + color: var(--primary-color, #0073aa); + } + + .file-actions button.delete { + color: var(--alert-color, #dc3545); + } + + .staged-files { + margin-top: 1rem; + padding: 1rem; + border: 1px dashed var(--dt-upload-border-color, #ccc); + border-radius: 4px; + background: var(--dt-upload-background-color, #fafafa); + } + + .staged-files-title { + font-size: 0.875rem; + font-weight: 600; + margin-bottom: 0.5rem; + } + + .staged-file-item { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.25rem 0; + font-size: 0.875rem; + } + + .staged-file-item span { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + } + + .staged-file-item button.remove { + flex-shrink: 0; + margin-inline-start: auto; + padding: 0.25rem; + background: transparent; + border: none; + color: var(--alert-color, #dc3545); + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + } + + .staged-file-item button.remove:hover { + opacity: 0.8; + } + + .upload-staged-btn { + margin-top: 0.5rem; + padding: 0.5rem 1rem; + background: var(--primary-color, #0073aa); + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 0.875rem; + } + + .upload-staged-btn:hover:not(:disabled) { + opacity: 0.9; + } + + .upload-staged-btn:disabled { + opacity: 0.6; + cursor: not-allowed; + } + `]}static get properties(){return{...super.properties,value:{type:Array,reflect:!0},acceptedFileTypes:{type:Array,attribute:"accepted-file-types"},maxFileSize:{type:Number,attribute:"max-file-size"},maxFiles:{type:Number,attribute:"max-files"},deleteEnabled:{type:Boolean,attribute:"delete-enabled",converter:{fromAttribute:t=>t==null||t===""?!0:t!=="false"&&t!==!1}},downloadEnabled:{type:Boolean,attribute:"download-enabled",converter:{fromAttribute:t=>t==null||t===""?!0:t!=="false"&&t!==!1}},renameEnabled:{type:Boolean,attribute:"rename-enabled",converter:{fromAttribute:t=>t==null||t===""?!0:t!=="false"&&t!==!1}},displayLayout:{type:String,attribute:"display-layout"},fileTypeIcon:{type:String,attribute:"file-type-icon"},autoUpload:{type:Boolean,attribute:"auto-upload",converter:{fromAttribute:t=>{if(t==null)return!0;const i=String(t).toLowerCase().trim();return i!=="false"&&i!=="0"&&t!==!1}}},postType:{type:String,attribute:"post-type"},postId:{type:String,attribute:"post-id"},metaKey:{type:String,attribute:"meta-key"},keyPrefix:{type:String,attribute:"key-prefix"},uploading:{type:Boolean,state:!0},stagedFiles:{type:Array,state:!0},_uploadZoneExpanded:{type:Boolean,state:!0},_dragOver:{type:Boolean,state:!0},_editingFileKey:{type:String,state:!0},_editingFileName:{type:String,state:!0}}}connectedCallback(){super.connectedCallback(),this.addEventListener("dt:upload-files",this._handleUploadStagedEvent),this._boundKeydown=this._handleHostKeydown.bind(this)}disconnectedCallback(){var t;super.disconnectedCallback(),this.removeEventListener("dt:upload-files",this._handleUploadStagedEvent),this._removeKeydownListener(),this._cancelScheduledCollapse(),(t=this._resizeObserver)==null||t.disconnect()}_addKeydownListener(){this._keydownAttached||(this._keydownAttached=!0,this.addEventListener("keydown",this._boundKeydown,{capture:!0}))}_removeKeydownListener(){this._keydownAttached&&(this._keydownAttached=!1,this.removeEventListener("keydown",this._boundKeydown,{capture:!0}))}_handleHostKeydown(t){var s;if(!this._editingFileKey)return;const i=(s=this.shadowRoot)==null?void 0:s.querySelector(".file-name-edit");i&&(t.key==="Enter"||t.keyCode===13?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this._commitRename(this._editingFileKey,i.value)):(t.key==="Escape"||t.keyCode===27)&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this._cancelRename()))}firstUpdated(t){super.firstUpdated(t),this._setupResizeObserver()}updated(t){super.updated(t),(t.has("value")||t.has("stagedFiles")||t.has("error"))&&this.updateComplete.then(()=>this._refreshMasonry()),t.has("_editingFileKey")&&(this._editingFileKey?(this._addKeydownListener(),this.updateComplete.then(()=>{var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector(".file-name-edit");i&&(i.focus(),i.select())})):this._removeKeydownListener())}_setupResizeObserver(){typeof ResizeObserver>"u"||(this._resizeObserver=new ResizeObserver(()=>{this._refreshMasonry()}),this._resizeObserver.observe(this))}_refreshMasonry(){if(typeof window<"u"&&window.jQuery){const t=this;requestAnimationFrame(()=>{let i=null;window.masonGrid&&window.masonGrid.length&&window.masonGrid.masonry?i=window.masonGrid:i=window.jQuery(t).closest(".grid, .masonry-container, .masonry, [data-masonry]"),i&&i.length&&i.masonry&&i.masonry("layout")})}}_expandUploadZone(){this._uploadZoneExpanded=!0}_scheduleCollapse(){this._cancelScheduledCollapse(),this._dragLeaveTimeout=setTimeout(()=>{this._uploadZoneExpanded=!1,this._dragLeaveTimeout=null},300)}_cancelScheduledCollapse(){this._dragLeaveTimeout&&(clearTimeout(this._dragLeaveTimeout),this._dragLeaveTimeout=null)}uploadStagedFiles(){this.stagedFiles.length>0&&this._uploadFiles(this.stagedFiles)}_removeStagedFile(t){t>=0&&ts!==t),this.requestUpdate())}_parseValue(t){if(Array.isArray(t))return t;if(typeof t=="string")try{const i=JSON.parse(t);return Array.isArray(i)?i:[]}catch{return[]}return[]}_formatFileSize(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}_isImage(t){return(t.type||"").toLowerCase().startsWith("image/")}_mdiToIconify(t){if(!t||typeof t!="string")return"";const i=t.trim();return i.startsWith("mdi:")?i:i.includes("mdi-")?`mdi:${i.replace(/.*mdi-/,"").replace(/\s/g,"-")}`:i.startsWith("mdi ")?`mdi:${i.replace(/^mdi\s+/,"").replace(/\s/g,"-")}`:i}_renderFileTypeIcon(t){const i=this.fileTypeIcon||"";if(!i)return null;if(/^(https?:|\/|data:)/.test(i))return u``;const a=this._mdiToIconify(i);return a?u``:null}_getFilePreviewUrl(t){const i=t.thumbnail_key||t.large_thumbnail_key;if(this._isImage(t)){if(t.large_thumbnail_url)return t.large_thumbnail_url;if(t.thumbnail_url)return t.thumbnail_url;if(t.url)return t.url;if(i)return null}return null}_handleFileSelect(t){const i=Array.from(t.target.files||[]);i.length!==0&&(t.target.value="",this._processFiles(i))}_handleDrop(t){if(t.preventDefault(),t.stopPropagation(),this._dragOver=!1,t.currentTarget.classList.remove("drag-over"),this.disabled||this.uploading)return;const i=Array.from(t.dataTransfer.files||[]);i.length!==0&&this._processFiles(i)}_handleDragOver(t){t.preventDefault(),t.stopPropagation(),!this.disabled&&!this.uploading&&(this._dragOver=!0,this._expandUploadZone(),this._cancelScheduledCollapse(),t.currentTarget.classList.add("drag-over"))}_handleDragLeave(t){t.preventDefault(),t.stopPropagation(),this._dragOver=!1,t.currentTarget.classList.remove("drag-over"),this._scheduleCollapse()}_handleZoneClick(t){var i;if(!t.target.closest('input[type="file"]')&&(this._expandUploadZone(),this._cancelScheduledCollapse(),!this.disabled&&!this.uploading)){const s=(i=this.shadowRoot)==null?void 0:i.querySelector('input[type="file"]');s&&s.click()}}_handleZoneMouseEnter(){!this.disabled&&!this.uploading&&(this._expandUploadZone(),this._cancelScheduledCollapse())}_handleZoneMouseLeave(){this._scheduleCollapse()}_processFiles(t){const i=this._validateFiles(t);if(i.length===0)return;this.error="";const s=(this.value||[]).length+this.stagedFiles.length;if(this.maxFiles&&s+i.length>this.maxFiles){this.error=`${this.maxFiles} files allowed`;return}this.autoUpload?this._uploadFiles(i):(this.stagedFiles=[...this.stagedFiles,...i],this._uploadZoneExpanded=!1,this.requestUpdate(),this.updateComplete.then(()=>this._refreshMasonry()))}_validateFiles(t){const i=[],s=this.maxFileSize?this.maxFileSize*1024*1024:null,a=Array.isArray(this.acceptedFileTypes)?this.acceptedFileTypes:["image/*","application/pdf"],r=a.join(",");for(const n of t){if(s&&n.size>s){this.error=`File "${n.name}" exceeds ${this.maxFileSize} MB`;continue}if(r&&r!=="*"&&!a.some(d=>{if(d.startsWith("."))return n.name.toLowerCase().endsWith(d.toLowerCase());if(d.endsWith("/*")){const h=d.slice(0,-2);return(n.type||"").startsWith(h)}return n.type===d||n.name&&n.name.toLowerCase().endsWith(`.${d.split("/")[1]}`)})){this.error=`File type not allowed: ${n.name}`;continue}i.push(n)}return i}async _uploadFiles(t){var i,s;if(!this.postType||!this.postId||!this.metaKey){this.error="Missing required parameters for upload";return}if(!((i=window.wpApiShare)!=null&&i.nonce)){this.error="Authentication nonce not available";return}this.uploading=!0,this.loading=!0,this.error="";try{const a=new FormData;t.forEach(m=>a.append("storage_upload_files[]",m)),a.append("meta_key",this.metaKey),a.append("key_prefix",this.keyPrefix||""),a.append("upload_type","post"),a.append("is_multi_file","true"),a.append("storage_s3_url_duration","+7 days");const r=((s=window.wpApiShare)==null?void 0:s.root)||"/wp-json",n=`${r}dt-posts/v2/${this.postType}/${this.postId}/storage_upload`,l=await fetch(n,{method:"POST",headers:{"X-WP-Nonce":window.wpApiShare.nonce},body:a}),d=await l.json();if(!l.ok||!d.uploaded)throw new Error(d.uploaded_msg||"Upload failed");const h=`${r}dt-posts/v2/${this.postType}/${this.postId}`,g=await fetch(h,{headers:{"X-WP-Nonce":window.wpApiShare.nonce}});if(g.ok){const y=(await g.json())[this.metaKey],w=Array.isArray(this.value)?[...this.value]:[],O=(d.uploaded_files||[]).filter(C=>C.uploaded&&C.file).map(C=>C.file);if(O.length>0){const C=new Set(w.map(A=>String(A.key||A))),M=[...w];for(const A of O){const ee=String(A.key||A);C.has(ee)||(M.push(A),C.add(ee))}this.value=M}else Array.isArray(y)&&y.length>0&&(this.value=y)}else{const m=Array.isArray(this.value)?[...this.value]:[];d.uploaded_files&&d.uploaded_files.forEach(y=>{y.uploaded&&y.file&&m.push(y.file)}),this.value=m}this.stagedFiles=[],this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value,newValue:this.value}})),this._refreshMasonry(),this._uploadZoneExpanded=!1,this.saved=!0}catch(a){console.error("Upload error:",a),this.error=a.message||"Upload failed"}finally{this.uploading=!1,this.loading=!1}}async _deleteFile(t){var i,s;if(!(!this.deleteEnabled||!this.postType||!this.postId||!this.metaKey)){if(!((i=window.wpApiShare)!=null&&i.nonce)){this.error="Authentication nonce not available";return}if(confirm("Are you sure you want to delete this file?")){this.loading=!0,this.error="";try{const r=`${((s=window.wpApiShare)==null?void 0:s.root)||"/wp-json"}dt-posts/v2/${this.postType}/${this.postId}/storage_delete_single`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.wpApiShare.nonce},body:JSON.stringify({meta_key:this.metaKey,file_key:t})}),l=await n.json();if(!n.ok||!l.deleted)throw new Error(l.message||"Delete failed");this.value=(this.value||[]).filter(d=>(d.key||d)!==t),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value,newValue:this.value}})),this.updateComplete.then(()=>this._refreshMasonry())}catch(a){console.error("Delete error:",a),this.error=a.message||"Delete failed"}finally{this.loading=!1}}}}async _renameFile(t,i){var s,a;if(!(!this.renameEnabled||!this.postType||!this.postId||!this.metaKey)){if(!((s=window.wpApiShare)!=null&&s.nonce)){this.error="Authentication nonce not available";return}this.loading=!0,this.error="";try{const n=`${((a=window.wpApiShare)==null?void 0:a.root)||"/wp-json"}dt-posts/v2/${this.postType}/${this.postId}/storage_rename_single`,l=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.wpApiShare.nonce},body:JSON.stringify({meta_key:this.metaKey,file_key:t,new_name:i})}),d=await l.json();if(!l.ok||!d.renamed)throw new Error(d.error||d.message||"Rename failed");const h=this._parseValue(this.value);this.value=h.map(g=>(g.key||g)===t?{...g,name:i}:g),this._editingFileKey="",this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{field:this.name,oldValue:this.value,newValue:this.value}})),this.updateComplete.then(()=>this._refreshMasonry())}catch(r){console.error("Rename error:",r),this.error=(r==null?void 0:r.message)||"Rename failed"}finally{this.loading=!1}}}_startRename(t,i){!this.renameEnabled||this.disabled||(this._editingFileKey=typeof t=="string"?t:String(t),this._editingFileName=i||"")}_commitRename(t,i){const s=(i??this._editingFileName??"").trim();if(this._editingFileKey="",this._editingFileName="",!s)return;const r=this._parseValue(this.value).find(l=>(l.key||l)===t),n=(r==null?void 0:r.name)||(typeof t=="string"?t.split("/").pop():"");s!==n&&this._renameFile(t,s)}_cancelRename(){this._editingFileKey="",this._editingFileName=""}_downloadFile(t){if(!this.downloadEnabled)return;const i=t.url;if(!i)return;const s=document.createElement("a");s.href=i,s.download=t.name||"download",s.target="_blank",s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s)}_validateRequired(){var i,s,a,r;const t=Array.isArray(this.value)?this.value:[];this.required&&t.length===0?(this.invalid=!0,(s=(i=this.internals)==null?void 0:i.setValidity)==null||s.call(i,{valueMissing:!0},this.requiredMessage||"This field is required")):(this.invalid=!1,(r=(a=this.internals)==null?void 0:a.setValidity)==null||r.call(a,{}))}render(){const t=this._parseValue(this.value),s=(this.displayLayout||"grid")==="grid";return u` +
    + ${this.labelTemplate()} +
    + +
    + + + +
    + + ${Y(this.stagedFiles.length>0&&!this.autoUpload,()=>u` +
    +
    Staged files (${this.stagedFiles.length})
    + ${ce(this.stagedFiles,(a,r)=>`${a.name}-${a.size}-${r}`,(a,r)=>u` +
    + ${a.name} (${this._formatFileSize(a.size)}) + +
    + `)} + +
    + `)} + + ${Y(t.length>0,()=>u` +
    +
    + ${ce(t,a=>a.key||a,a=>{const r=typeof a.key=="string"?a.key:typeof a=="string"?a:String(a.key??a.name??""),n=a.name||(typeof r=="string"?r.split("/").pop():""),l=a.size,d=this._getFilePreviewUrl(a),h=this._isImage(a),g=this._editingFileKey===r;return u` +
    + ${Y(d,()=>u` + {a.url||m.preventDefault()}} + > + ${n} + + `,()=>u` + ${a.url?u` + + ${this._renderFileTypeIcon(a)||(h?u``:u``)} + + `:u` +
    + ${this._renderFileTypeIcon(a)||(h?u``:u``)} +
    + `} + `)} + ${Y(g,()=>u` + {this._editingFileName=m.target.value}} + @keydown=${m=>{m.key==="Enter"||m.keyCode===13?(m.preventDefault(),m.stopPropagation(),this._commitRename(r,m.target.value)):(m.key==="Escape"||m.keyCode===27)&&(m.preventDefault(),this._cancelRename())}} + @blur=${m=>this._commitRename(r,m.target.value)} + @click=${m=>m.stopPropagation()} + /> + `,()=>u` +
    {m.stopPropagation(),this.renameEnabled&&!this.disabled&&this._startRename(r,n)}} + @keydown=${m=>{this.renameEnabled&&!this.disabled&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),this._startRename(r,n))}} + > + ${n} +
    + `)} + ${Y(l!=null,()=>u`
    ${this._formatFileSize(l)}
    `)} +
    + ${Y(this.downloadEnabled&&a.url,()=>u` + + `)} + ${Y(this.deleteEnabled,()=>u` + + `)} +
    +
    + `})} +
    +
    + `)} + ${this.renderIcons()}
    - `}}window.customElements.define("dt-multi-select-button-group",xs);class ks extends R{static get styles(){return x` + `}}customElements.define("dt-upload-file",Ss);class Es extends R{static get styles(){return x` :host { display: block; } @@ -3064,7 +3532,7 @@ var DtWebComponents=function($){"use strict";var Pr=Object.defineProperty;var Mr display: flex; align-items: center; } - `}static get properties(){return{context:{type:String},dismissable:{type:Boolean},timeout:{type:Number},hide:{type:Boolean},outline:{type:Boolean}}}get classes(){const e={"dt-alert":!0,"dt-alert--outline":this.outline},t=`dt-alert--${this.context}`;return e[t]=!0,e}constructor(){super(),this.context="default"}connectedCallback(){super.connectedCallback(),this.timeout&&setTimeout(()=>{this._dismiss()},this.timeout)}_dismiss(){this.hide=!0}render(){if(this.hide)return f``;const e=f` + `}static get properties(){return{context:{type:String},dismissable:{type:Boolean},timeout:{type:Number},hide:{type:Boolean},outline:{type:Boolean}}}get classes(){const e={"dt-alert":!0,"dt-alert--outline":this.outline},t=`dt-alert--${this.context}`;return e[t]=!0,e}constructor(){super(),this.context="default"}connectedCallback(){super.connectedCallback(),this.timeout&&setTimeout(()=>{this._dismiss()},this.timeout)}_dismiss(){this.hide=!0}render(){if(this.hide)return u``;const e=u` xmlns="http://www.w3.org/2000/svg"> - `;return f` -