@webority/ui-elements 0.132.0 → 0.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/WuiLightbox-DSRuxbBA.js +1 -0
  2. package/dist/elements/lightbox.js +1 -1
  3. package/dist/ui-elements/autocomplete.global.js +1 -1
  4. package/dist/ui-elements/carousel.global.js +1 -1
  5. package/dist/ui-elements/code-block.global.js +1 -1
  6. package/dist/ui-elements/command-palette.global.js +1 -1
  7. package/dist/ui-elements/comment-thread.global.js +1 -1
  8. package/dist/ui-elements/consent-banner.global.js +1 -1
  9. package/dist/ui-elements/context-menu.global.js +1 -1
  10. package/dist/ui-elements/date-range.global.js +1 -1
  11. package/dist/ui-elements/drawer.global.js +1 -1
  12. package/dist/ui-elements/image-crop.global.js +1 -1
  13. package/dist/ui-elements/inline-edit.global.js +1 -1
  14. package/dist/ui-elements/kanban.global.js +1 -1
  15. package/dist/ui-elements/lead-popup.global.js +1 -1
  16. package/dist/ui-elements/lightbox.global.js +1 -1
  17. package/dist/ui-elements/markdown.global.js +1 -1
  18. package/dist/ui-elements/multiselect.global.js +1 -1
  19. package/dist/ui-elements/phone.global.js +1 -1
  20. package/dist/ui-elements/resizable.global.js +1 -1
  21. package/dist/ui-elements/saved-views.global.js +1 -1
  22. package/dist/ui-elements/slider.global.js +1 -1
  23. package/dist/ui-elements/sortable.global.js +1 -1
  24. package/dist/ui-elements/status-icon.global.js +1 -1
  25. package/dist/ui-elements/taginput.global.js +1 -1
  26. package/dist/ui-elements/timepicker.global.js +1 -1
  27. package/dist/ui-elements/tour.global.js +1 -1
  28. package/dist/ui-elements/tree.global.js +1 -1
  29. package/dist/ui-elements/wizard.global.js +1 -1
  30. package/dist/ui-elements.global.js +1 -1
  31. package/dist/ui-elements.js +1 -1
  32. package/package.json +2 -2
  33. package/dist/WuiLightbox-hyLXw8cO.js +0 -1
@@ -1 +1 @@
1
- (function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.132.0`)throw Error(`[webority-ui] inline-edit expects ui-elements 0.132.0 but the page loaded `+o+`.`);var s=Object.freeze([`text`,`number`,`select`,`date`,`textarea`]),c=2e3,l=Object.freeze({edit:e=>`Edit ${e}: `,readOnly:e=>`${e}: `,saved:e=>`${e} saved.`,notSaved:(e,t)=>`${e} was not saved. ${t}`,failed:Object.freeze({forbidden:`You do not have permission to change this.`,client:`This could not be saved. Refresh the page and try again.`,validation:`This value was not accepted. Check it and try again.`,server:`Something went wrong on our side, so this was not saved. Try again in a moment.`,network:`Could not reach the server, so this was not saved. Check your connection and try again.`})});function u(e,{type:t=`text`,options:r,placeholder:a}={}){let o=e==null?``:String(e);if(o===``)return{text:a||i.EMPTY_VALUE,empty:!0};if(t===`date`)return{text:(0,n.fmt)(o)||o,empty:!1};if(t===`select`){let e=r?.find(e=>String(e.value)===o);return{text:typeof e?.label==`string`?e.label:o,empty:!1}}return{text:o,empty:!1}}var d=`[data-wui-display]`,f=`[data-wui-value]`,p=`[data-wui-editor]`,m=`[data-wui-control]`,h=`[data-wui-error]`,g=`[data-wui-live]`,_=`[aria-expanded="true"]`,v=new Set([`select`,`date`]),y=e=>typeof e?.message==`string`&&e.message?e.message:l.failed.server,b=class extends r.ElementBase{static get observedAttributes(){return[`disabled`]}constructor(){super(),this._wired=!1,this._editing=!1,this._busy=!1,this._draft=null,this._pressed=!1,this._popupOpen=!1,this._savedTimer=null,this._onClick=this._onClick.bind(this),this._onKeyCapture=this._onKeyCapture.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onChange=this._onChange.bind(this)}connectedCallback(){this._wired||(this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`auxclick`,this._onClick),this.addEventListener(`keydown`,this._onKeyCapture,!0),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`change`,this._onChange))}disconnectedCallback(){clearTimeout(this._savedTimer),this._savedTimer=null,this._releasePress()}attributeChangedCallback(e){e===`disabled`&&this.hasAttribute(`disabled`)&&this.cancel()}edit(){if(this._editing||this._busy||this.hasAttribute(`disabled`))return;let e=this.querySelector(d),t=this.querySelector(p),n=this._control();e&&t&&n&&(this._editing=!0,this._setState(null),n.value=this._draft??this._value(),t.hidden=!1,this.setAttribute(`data-wui-editing`,``),this._focusControl(n),e.hidden=!0)}cancel(){this._editing&&(this._draft=null,this._setError(null),this.getAttribute(`data-wui-state`)===`error`&&this._setState(null),this._close())}_onClick(e){e.stopPropagation(),e.type===`click`&&!this._editing&&this.querySelector(d)?.contains(e.target)&&this.edit()}_onKeyCapture(){this._popupOpen=!!(this._editing&&this.querySelector(p)?.querySelector(_))}_onKeyDown(e){if(!this._editing){(e.key===`Enter`||e.key===` `)&&e.stopPropagation();return}if(e.stopPropagation(),this._popupOpen)return;if(e.key===`Escape`){e.preventDefault(),this.cancel();return}let t=this._type();e.key!==`Enter`||v.has(t)||(t!==`textarea`||e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._commit(this._control()?.value??``))}_onFocusOut(e){if(!this._editing||this._pressed)return;let t=e.relatedTarget;t&&this.contains(t)||document.hasFocus()&&this._commit(this._control()?.value??``)}_onPointerDown(){this._editing&&(this._pressed=!0,document.addEventListener(`pointerup`,this._onPointerUp,!0),document.addEventListener(`pointercancel`,this._onPointerUp,!0))}_onPointerUp(){this._releasePress(),setTimeout(()=>{this._pressed=!1,this._editing&&!this.contains(document.activeElement)&&document.hasFocus()&&this._commit(this._control()?.value??``)},0)}_releasePress(){document.removeEventListener(`pointerup`,this._onPointerUp,!0),document.removeEventListener(`pointercancel`,this._onPointerUp,!0)}_onChange(e){if(!this._editing||!v.has(this._type()))return;let t=this._control();t&&e.target===t&&queueMicrotask(()=>this._commit(t.value))}async _commit(e){if(!this._editing||this._busy)return;let t=this._value();if(e===t){this.cancel();return}let n=typeof this.validate==`function`?this.validate(e):null;if(n){this._setError(n),this._announce(n);return}let r=this.hasAttribute(`controlled`);this._draft=null,this._setError(null),this._busy=!0,this._setState(`saving`),this.setAttribute(`aria-busy`,`true`);let i=r?null:this._readShown();r||this._showValue(e),this._close();let a=await this._persist(e,r);this._busy=!1,this.removeAttribute(`aria-busy`);let o=this.getAttribute(`label`)||``;a.ok?(this.setAttribute(`value`,e),!r&&a.text&&this._showText(a.text,!1),this._setState(`saved`),this._savedTimer=setTimeout(()=>this._setState(null),c),this._announce(l.saved(o)),this._fire(`wui:inline-edit:saved`,{value:e,previous:t})):(i&&this._restoreShown(i),a.kind===`session`||a.kind===`aborted`?this._setState(null):(this._draft=e,this._setState(`error`),this._setError(a.message),this._announce(l.notSaved(o,a.message)),this._fire(`wui:inline-edit:failed`,{value:e,previous:t,kind:a.kind,message:a.message})))}async _persist(e,t){if(t){if(typeof this.save!=`function`)return{ok:!0};try{return await this.save(e),{ok:!0}}catch(e){return{ok:!1,kind:`server`,message:y(e)}}}let n=this.getAttribute(`action`);if(!n)return{ok:!0};let r=new URLSearchParams({[this.getAttribute(`name`)||`value`]:e}),i=await(0,a.wuiFetch)(n,{method:`POST`,body:r});return i.ok?{ok:!0,text:i.html.trim()}:{ok:!1,kind:i.kind,message:i.message||l.failed[i.kind]||l.failed.server}}_close(){let e=this.querySelector(d),t=this.querySelector(p),n=this.contains(document.activeElement);this._editing=!1,this.removeAttribute(`data-wui-editing`),t&&(t.hidden=!0),e&&(e.hidden=!1),t?.querySelector(_)?.click(),n&&e?.focus()}_focusControl(e){if(!v.has(this._type())){e.focus(),e.select?.();return}let t=e.querySelector(`button`);t&&(t.focus(),t.getAttribute(`aria-expanded`)!==`true`&&t.click())}_showValue(e){if(e===``){this._showText(this.getAttribute(`placeholder`)||i.EMPTY_VALUE,!0);return}let t=this._type(),r=e;if(t===`date`)r=(0,n.fmt)(e)||e;else if(t===`select`){let t=[...this._control()?.querySelectorAll(`[data-value]`)??[]].find(t=>t.getAttribute(`data-value`)===e);t&&(r=t.textContent.trim())}this._showText(r,!1)}_readShown(){let e=this.querySelector(f);return e?{html:e.innerHTML,empty:e.hasAttribute(`data-wui-empty`)}:null}_restoreShown(e){let t=this.querySelector(f);t&&(t.innerHTML=e.html,t.toggleAttribute(`data-wui-empty`,e.empty))}_showText(e,t){let n=this.querySelector(f);n&&(n.textContent=e,n.toggleAttribute(`data-wui-empty`,t))}_setError(e){let t=this.querySelector(h),n=this._control();t&&(t.textContent=e||``,t.hidden=!e),e?n?.setAttribute(`aria-invalid`,`true`):n?.removeAttribute(`aria-invalid`)}_setState(e){clearTimeout(this._savedTimer),this._savedTimer=null,e?this.setAttribute(`data-wui-state`,e):this.removeAttribute(`data-wui-state`)}_announce(e){let t=this.querySelector(g);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))}_control(){return this.querySelector(m)}_value(){return this.getAttribute(`value`)??``}_type(){let e=this.getAttribute(`type`);return s.includes(e)?e:`text`}};(0,t.defineElement)(`wui-inline-edit`,b),e.INLINE_EDIT_SAVED_MS=c,e.INLINE_EDIT_TEXT=l,e.INLINE_EDIT_TYPES=s,e.WuiInlineEdit=b,e.inlineEditText=u})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.calendarMath,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
1
+ (function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.133.0`)throw Error(`[webority-ui] inline-edit expects ui-elements 0.133.0 but the page loaded `+o+`.`);var s=Object.freeze([`text`,`number`,`select`,`date`,`textarea`]),c=2e3,l=Object.freeze({edit:e=>`Edit ${e}: `,readOnly:e=>`${e}: `,saved:e=>`${e} saved.`,notSaved:(e,t)=>`${e} was not saved. ${t}`,failed:Object.freeze({forbidden:`You do not have permission to change this.`,client:`This could not be saved. Refresh the page and try again.`,validation:`This value was not accepted. Check it and try again.`,server:`Something went wrong on our side, so this was not saved. Try again in a moment.`,network:`Could not reach the server, so this was not saved. Check your connection and try again.`})});function u(e,{type:t=`text`,options:r,placeholder:a}={}){let o=e==null?``:String(e);if(o===``)return{text:a||i.EMPTY_VALUE,empty:!0};if(t===`date`)return{text:(0,n.fmt)(o)||o,empty:!1};if(t===`select`){let e=r?.find(e=>String(e.value)===o);return{text:typeof e?.label==`string`?e.label:o,empty:!1}}return{text:o,empty:!1}}var d=`[data-wui-display]`,f=`[data-wui-value]`,p=`[data-wui-editor]`,m=`[data-wui-control]`,h=`[data-wui-error]`,g=`[data-wui-live]`,_=`[aria-expanded="true"]`,v=new Set([`select`,`date`]),y=e=>typeof e?.message==`string`&&e.message?e.message:l.failed.server,b=class extends r.ElementBase{static get observedAttributes(){return[`disabled`]}constructor(){super(),this._wired=!1,this._editing=!1,this._busy=!1,this._draft=null,this._pressed=!1,this._popupOpen=!1,this._savedTimer=null,this._onClick=this._onClick.bind(this),this._onKeyCapture=this._onKeyCapture.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onChange=this._onChange.bind(this)}connectedCallback(){this._wired||(this._wired=!0,this.addEventListener(`click`,this._onClick),this.addEventListener(`auxclick`,this._onClick),this.addEventListener(`keydown`,this._onKeyCapture,!0),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`change`,this._onChange))}disconnectedCallback(){clearTimeout(this._savedTimer),this._savedTimer=null,this._releasePress()}attributeChangedCallback(e){e===`disabled`&&this.hasAttribute(`disabled`)&&this.cancel()}edit(){if(this._editing||this._busy||this.hasAttribute(`disabled`))return;let e=this.querySelector(d),t=this.querySelector(p),n=this._control();e&&t&&n&&(this._editing=!0,this._setState(null),n.value=this._draft??this._value(),t.hidden=!1,this.setAttribute(`data-wui-editing`,``),this._focusControl(n),e.hidden=!0)}cancel(){this._editing&&(this._draft=null,this._setError(null),this.getAttribute(`data-wui-state`)===`error`&&this._setState(null),this._close())}_onClick(e){e.stopPropagation(),e.type===`click`&&!this._editing&&this.querySelector(d)?.contains(e.target)&&this.edit()}_onKeyCapture(){this._popupOpen=!!(this._editing&&this.querySelector(p)?.querySelector(_))}_onKeyDown(e){if(!this._editing){(e.key===`Enter`||e.key===` `)&&e.stopPropagation();return}if(e.stopPropagation(),this._popupOpen)return;if(e.key===`Escape`){e.preventDefault(),this.cancel();return}let t=this._type();e.key!==`Enter`||v.has(t)||(t!==`textarea`||e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._commit(this._control()?.value??``))}_onFocusOut(e){if(!this._editing||this._pressed)return;let t=e.relatedTarget;t&&this.contains(t)||document.hasFocus()&&this._commit(this._control()?.value??``)}_onPointerDown(){this._editing&&(this._pressed=!0,document.addEventListener(`pointerup`,this._onPointerUp,!0),document.addEventListener(`pointercancel`,this._onPointerUp,!0))}_onPointerUp(){this._releasePress(),setTimeout(()=>{this._pressed=!1,this._editing&&!this.contains(document.activeElement)&&document.hasFocus()&&this._commit(this._control()?.value??``)},0)}_releasePress(){document.removeEventListener(`pointerup`,this._onPointerUp,!0),document.removeEventListener(`pointercancel`,this._onPointerUp,!0)}_onChange(e){if(!this._editing||!v.has(this._type()))return;let t=this._control();t&&e.target===t&&queueMicrotask(()=>this._commit(t.value))}async _commit(e){if(!this._editing||this._busy)return;let t=this._value();if(e===t){this.cancel();return}let n=typeof this.validate==`function`?this.validate(e):null;if(n){this._setError(n),this._announce(n);return}let r=this.hasAttribute(`controlled`);this._draft=null,this._setError(null),this._busy=!0,this._setState(`saving`),this.setAttribute(`aria-busy`,`true`);let i=r?null:this._readShown();r||this._showValue(e),this._close();let a=await this._persist(e,r);this._busy=!1,this.removeAttribute(`aria-busy`);let o=this.getAttribute(`label`)||``;a.ok?(this.setAttribute(`value`,e),!r&&a.text&&this._showText(a.text,!1),this._setState(`saved`),this._savedTimer=setTimeout(()=>this._setState(null),c),this._announce(l.saved(o)),this._fire(`wui:inline-edit:saved`,{value:e,previous:t})):(i&&this._restoreShown(i),a.kind===`session`||a.kind===`aborted`?this._setState(null):(this._draft=e,this._setState(`error`),this._setError(a.message),this._announce(l.notSaved(o,a.message)),this._fire(`wui:inline-edit:failed`,{value:e,previous:t,kind:a.kind,message:a.message})))}async _persist(e,t){if(t){if(typeof this.save!=`function`)return{ok:!0};try{return await this.save(e),{ok:!0}}catch(e){return{ok:!1,kind:`server`,message:y(e)}}}let n=this.getAttribute(`action`);if(!n)return{ok:!0};let r=new URLSearchParams({[this.getAttribute(`name`)||`value`]:e}),i=await(0,a.wuiFetch)(n,{method:`POST`,body:r});return i.ok?{ok:!0,text:i.html.trim()}:{ok:!1,kind:i.kind,message:i.message||l.failed[i.kind]||l.failed.server}}_close(){let e=this.querySelector(d),t=this.querySelector(p),n=this.contains(document.activeElement);this._editing=!1,this.removeAttribute(`data-wui-editing`),t&&(t.hidden=!0),e&&(e.hidden=!1),t?.querySelector(_)?.click(),n&&e?.focus()}_focusControl(e){if(!v.has(this._type())){e.focus(),e.select?.();return}let t=e.querySelector(`button`);t&&(t.focus(),t.getAttribute(`aria-expanded`)!==`true`&&t.click())}_showValue(e){if(e===``){this._showText(this.getAttribute(`placeholder`)||i.EMPTY_VALUE,!0);return}let t=this._type(),r=e;if(t===`date`)r=(0,n.fmt)(e)||e;else if(t===`select`){let t=[...this._control()?.querySelectorAll(`[data-value]`)??[]].find(t=>t.getAttribute(`data-value`)===e);t&&(r=t.textContent.trim())}this._showText(r,!1)}_readShown(){let e=this.querySelector(f);return e?{html:e.innerHTML,empty:e.hasAttribute(`data-wui-empty`)}:null}_restoreShown(e){let t=this.querySelector(f);t&&(t.innerHTML=e.html,t.toggleAttribute(`data-wui-empty`,e.empty))}_showText(e,t){let n=this.querySelector(f);n&&(n.textContent=e,n.toggleAttribute(`data-wui-empty`,t))}_setError(e){let t=this.querySelector(h),n=this._control();t&&(t.textContent=e||``,t.hidden=!e),e?n?.setAttribute(`aria-invalid`,`true`):n?.removeAttribute(`aria-invalid`)}_setState(e){clearTimeout(this._savedTimer),this._savedTimer=null,e?this.setAttribute(`data-wui-state`,e):this.removeAttribute(`data-wui-state`)}_announce(e){let t=this.querySelector(g);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))}_control(){return this.querySelector(m)}_value(){return this.getAttribute(`value`)??``}_type(){let e=this.getAttribute(`type`);return s.includes(e)?e:`text`}};(0,t.defineElement)(`wui-inline-edit`,b),e.INLINE_EDIT_SAVED_MS=c,e.INLINE_EDIT_TEXT=l,e.INLINE_EDIT_TYPES=s,e.WuiInlineEdit=b,e.inlineEditText=u})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.calendarMath,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
@@ -1 +1 @@
1
- (function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.132.0`)throw Error(`[webority-ui] kanban expects ui-elements 0.132.0 but the page loaded `+o+`.`);var s=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),c=Object.freeze([`number`,`currency`,`compact`]),l=`wui-kanban:`,u=`(max-width: 767.98px)`,d=400,f=6,p=Object.freeze({help:`Press Space to pick up the card. Use the Left and Right arrow keys to choose a column, then Space to drop it, or Escape to cancel.`,empty:`Nothing here`,collapse:e=>`Collapse ${e}`,expand:e=>`Expand ${e}`,lifted:(e,t)=>`Picked up ${e} in ${t}. Use the Left and Right arrow keys to choose a column.`,over:(e,t)=>`${e}, ${t===1?`1 card`:`${t} cards`}. Drop allowed.`,overSource:e=>`${e}, where the card started.`,overRefused:(e,t)=>`${e}. ${t}`,dropHere:(e,t)=>`Drop here to move ${e} to ${t}.`,refused:(e,t)=>`Cards in ${e} cannot move to ${t}.`,moved:(e,t)=>`Moved ${e} to ${t}.`,saving:(e,t)=>`Moving ${e} to ${t}.`,cancelled:e=>`${e} was not moved.`,rolledBack:(e,t)=>`${e} went back to ${t}.`,locked:e=>`${e} cannot be moved.`,more:e=>`Show ${e} more`,fewer:`Show fewer`,loadMore:e=>`Show more (${e})`,loading:`Loading…`,loadFailed:`More cards could not be loaded. Try again.`,swipeHint:`Swipe sideways or tap a column`,busy:`This card is still saving. Try again in a moment.`,failed:Object.freeze({forbidden:`You do not have permission to move this card.`,client:`This card could not be moved. Refresh the board and try again.`,validation:`This card could not be moved. Refresh the board and try again.`,server:`Something went wrong on our side, so the card went back. Try again in a moment.`,network:`Could not reach the server, so the card went back. Check your connection and try again.`})}),m=`[data-wui-column]`,h=`[data-wui-body]`,g=`[data-wui-card]`,_=`[data-wui-count]`,v=`[data-wui-summary]`,y=`[data-wui-empty]`,b=`[data-wui-drop-note]`,x=`[data-wui-live]`,S=`[data-wui-help]`,C=`[data-wui-switch]`,w=`[data-wui-scroller]`,T=`[data-wui-collapse]`,E=`[data-wui-more]`,D=`data-wui-visible-limit`,O=`data-wui-overflow`,k=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,A=`[data-wui-load-more]`,j=`data-wui-more-url`,M=`data-wui-total`,N=`data-wui-unloaded`,P=48,F=16,I=160,L=e=>e.getAttribute(`data-wui-column`),R=e=>e.getAttribute(`data-wui-card`),z=e=>e.hidden||e.hasAttribute(`hidden`),B=e=>z(e)||e.hasAttribute(O);function V(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);if(!Number.isInteger(t)||t<1)throw TypeError(`Unsupported kanban visible limit "${String(e)}". Use a whole number of 1 or more.`);return t}function H(e,t,n,r){let i=new Set;if(t==null||n)return i;let a=0;for(let n of e)r.has(n)||(a<t?a++:i.add(n));return i}function U(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||R(e)||`Card`}function W(e){return e?`${l}${e}`:null}function G(e,t=globalThis.localStorage){let n=W(e);if(!n||!t)return{};try{let e=JSON.parse(t.getItem(n)||`null`);return e&&typeof e.collapsed==`object`&&e.collapsed?e.collapsed:{}}catch{return{}}}function K(e,t,n,r=globalThis.localStorage){let i=W(e);if(!i||!r)return;let a={...G(e,r),[t]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function q(e,t){if(!c.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${c.join(`, `)}.`);if(t!=null&&t!==``&&!i.MONEY_UNITS.includes(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.MONEY_UNITS.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:`INR`,unit:t||`rupees`}:{style:`number`,decimals:0}}function J(e){let t=0;for(let n of e){if(n==null||n===``)continue;let e=typeof n==`number`?n:Number(n);Number.isFinite(e)&&(t+=e)}return t}var Y=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},X=class extends r.ElementBase{constructor(){super(),this._wired=!1,this._filter=null,this._expanded=new Set,this._revealed=new Set,this._press=null,this._drag=null,this._kbd=null,this._suppressClick=!1,this._observer=null,this._refreshQueued=!1,this._scrollTimer=0,this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e),this._onPointerCancel=()=>this._endPointer(!1),this._onDocKeyDown=e=>{e.key===`Escape`&&this._drag&&(e.preventDefault(),this._endPointer(!1))},this._onScroll=()=>{clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>this._syncSwitcherFromScroll(),80)},this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`scroll`,e=>this._loadOnScroll(e.target),!0),this.addEventListener(`dragstart`,e=>{e.target.closest?.(g)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1})}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this._scroller()?.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._restoreCollapsed();for(let e of this._allCards())this._prepareCard(e);if(typeof MutationObserver==`function`){this._observer=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e.nodeType===1&&e.matches(g)&&this._prepareCard(e);this._queueRefresh()});for(let e of this.querySelectorAll(h))this._observer.observe(e,{childList:!0})}this.refresh()}}disconnectedCallback(){this._endPointer(!1),this._observer?.disconnect(),this._observer=null,this._scroller()?.removeEventListener(`scroll`,this._onScroll),clearTimeout(this._scrollTimer),this._wired=!1}setFilter(e){if(e!=null&&typeof e!=`function`)throw TypeError(`wui-kanban setFilter: pass a function or null.`);if(this._filter=e,!e)for(let e of this._allCards())e.hidden=!1;this.refresh()}refresh(){if(this._controlled())return;this._refreshQueued=!1;let e=this._summaryFormat();for(let t of this._columns()){let n=L(t),r=V(t.getAttribute(D)),a=[],o=[];for(let e of this._cardsIn(t))this._filter&&(e.hidden=this._filter(e)===!1),z(e)?e.removeAttribute(O):(a.push(e),o.push(e.getAttribute(`data-wui-value`)));let s=this._expanded.has(n),c=H(a.map(R),r,s,this._revealed);for(let e of a)e.toggleAttribute(O,c.has(R(e)));let l=this._unloadedIn(t),u=String(a.length+l);for(let e of this._countsOf(t))e.textContent!==u&&(e.textContent=u);let d=t.querySelector(y);if(d&&(d.hidden=a.length>0),e){let n=t.querySelector(v);n&&(n.textContent=(0,i.formatValue)(J(o),e))}let f=t.querySelector(E);if(f){f.hidden=r==null||(s?a.length<=r:c.size===0),f.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?p.fewer:p.more(c.size);f.textContent!==e&&(f.textContent=e)}let m=t.querySelector(A);if(m&&(m.hidden=l<=0,!t.hasAttribute(`data-wui-loading`))){m.disabled=!1;let e=p.loadMore(l);m.textContent!==e&&(m.textContent=e)}}}moveCard(e,t,n){let r=this._cardByKey(e);if(!r)throw Error(`wui-kanban moveCard: no card "${String(e)}" on this board.`);if(!this._columnByKey(t))throw Error(`wui-kanban moveCard: no column "${String(t)}" on this board.`);return this._commit(r,t,n)}_columns(){return[...this.querySelectorAll(m)]}_columnByKey(e){return this._columns().find(t=>L(t)===e)||null}_columnOf(e){return e.closest(m)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||L(e)||``).replace(/\s+/g,` `).trim()}_bodyOf(e){return e.querySelector(h)}_cardsIn(e){let t=this._bodyOf(e);return t?[...t.children].filter(e=>e.matches(g)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!B(e))}_allCards(){return[...this.querySelectorAll(`${h} > ${g}`)]}_cardByKey(e){return this._allCards().find(t=>R(t)===e)||null}_countsOf(e){let t=L(e),n=[...this.querySelectorAll(C)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(_),...n.flatMap(e=>[...e.querySelectorAll(_)])]}_scroller(){return this.querySelector(w)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?q(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(S);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=this.querySelector(x);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t,n=!1){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:n,detail:t}))}_canLift(e){let t=U(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(p.locked(t)),this._fire(`wui:kanban:locked`,{key:R(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)!==`true`||(this._announce(p.busy),Y(p.busy,`info`),!1)}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=p.refused(r?this._titleOf(r):t,i?this._titleOf(i):n),o=i?.getAttribute(`data-accept-from`);if(o!=null&&!o.split(/\s+/).filter(Boolean).includes(t))return{ok:!1,reason:a};if(typeof this.accept==`function`){let r=this.accept(e,t,n);if(r===!1)return{ok:!1,reason:a};if(typeof r==`string`&&r)return{ok:!1,reason:r}}return{ok:!0,reason:null}}_markTargets(e,t){let n=U(e),r=new Map;for(let i of this._columns()){let a=L(i),o=this._check(e,t,a);r.set(a,o),i.setAttribute(`data-wui-drop`,o.source?`source`:o.ok?`ok`:`refused`);let s=i.querySelector(b);s&&!o.source&&(s.textContent=o.ok?p.dropHere(n,this._titleOf(i)):o.reason,s.hidden=!1)}return r}_clearTargets(){for(let e of this._columns()){e.removeAttribute(`data-wui-drop`),e.removeAttribute(`data-wui-over`),e.removeAttribute(`data-wui-target`);let t=e.querySelector(b);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e),i=L(r),o=this._columnByKey(t),s=U(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),Y(c.reason,`info`),!1;let l=this._cardsIn(o),u=Number.isInteger(n)?Math.max(0,Math.min(n,l.length)):l.length,d={key:R(e),card:e,from:i,to:t,index:u},f=e.contains(document.activeElement);if(this._controlled())return this._fire(`wui:kanban:move`,d),this._announce(p.moved(s,this._titleOf(o))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let m=o.hasAttribute(D)&&!this._revealed.has(d.key);m&&this._revealed.add(d.key);let h={parent:e.parentNode,next:e.nextSibling,column:r,revealed:m};this._bodyOf(o).insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let g=o.getAttribute(`data-wui-step`);if(g)return this._runStep(e,d,h,g,o.getAttribute(`data-wui-step-size`));let _=this.getAttribute(`move-url`);if(!_)return this._announce(p.moved(s,this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(p.saving(s,this._titleOf(o)));let v=new URLSearchParams({card:d.key,from:i,to:t,index:String(u)}),y=await(0,a.wuiFetch)(_,{method:`POST`,body:v});if(this._lock(e,!1),y.kind===`session`)return!1;if(y.ok){let t=this._applyFragment(y.html)||e;return Y(y.message,`success`),this._announce(p.moved(U(t),this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,card:t,result:y}),!0}return this._rollback(e,h),y.kind!==`aborted`&&Y(y.message||p.failed[y.kind]||p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:y.kind,status:y.status,message:y.message}),!1}async _runStep(e,t,n,r,i){let o=U(e),s=this._columnByKey(t.to),c=new URLSearchParams({card:t.key,from:t.from,to:t.to}).toString(),l=r+(r.includes(`?`)?`&`:`?`)+c;this._lock(e,!0);let u;try{let t=window.WUI?.modal?.load;if(typeof t!=`function`)throw Error(`<wui-kanban> data-wui-step needs the Razor script webority-ui.js (WUI.modal.load).`);u=await(await t(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),r?.name!==`AbortError`&&Y(p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...t,kind:`step`,status:0,message:r?.message??null}),!1}if(u?.status!==`success`)return this._lock(e,!1),this._rollback(e,n),this._announce(p.cancelled(o)),this._fire(`wui:kanban:failed`,{...t,kind:`dismissed`,status:0,message:null}),!1;let d=e,f=this.getAttribute(`card-url`);if(f){let n=await(0,a.wuiFetch)(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:t.key})}`);n.ok&&(d=this._applyFragment(n.html)||e)}return this._lock(d,!1),this._announce(p.moved(U(d),this._titleOf(s))),this._fire(`wui:kanban:moved`,{...t,card:d,result:u}),!0}_lock(e,t){t?(e.setAttribute(`aria-busy`,`true`),e.setAttribute(`data-wui-saving`,``)):(e.removeAttribute(`aria-busy`),e.removeAttribute(`data-wui-saving`))}_rollback(e,t){let n=e.contains(document.activeElement),r=t.next&&t.next.parentNode===t.parent?t.next:null;t.revealed&&this._revealed.delete(R(e)),t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(p.rolledBack(U(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let t=document.createElement(`template`);t.innerHTML=e;for(let e of t.content.querySelectorAll(`script`))(0,n.devWarn)(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of[...t.content.querySelectorAll(g)]){if(e.closest(`template`))continue;let t=this._cardByKey(R(e));if(!t)continue;let n=t.contains(document.activeElement);t.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),t.hidden&&(e.hidden=!0),t.replaceWith(e),this._prepareCard(e),n&&e.focus(),r??=e}for(let e of t.content.querySelectorAll(`template[data-wui-kanban-summary]`))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(v)?.replaceChildren(e.content.cloneNode(!0));return this.refresh(),window.WUI?.refresh?.(),r}_refocusSoon(e){let t=()=>{let t=this._cardByKey(e);t&&this._focusMoved(t)};typeof requestAnimationFrame==`function`?requestAnimationFrame(t):setTimeout(t,0)}_focusMoved(e){e.focus({preventScroll:!0}),e.scrollIntoView?.({block:`nearest`})}_pointerDown(e){if(e.button!==0||e.isPrimary===!1||this._drag||this._kbd)return;let t=e.target.closest?.(g);if(!t||!this.contains(t)||e.target.closest(k))return;let n={card:t,id:e.pointerId,x:e.clientX,y:e.clientY,type:e.pointerType,timer:0};this._press=n,e.pointerType===`touch`&&(n.timer=setTimeout(()=>{this._press===n&&this._startDrag(n,n.x,n.y)},400)),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)}_pointerMove(e){let t=this._press;if(t&&e.pointerId===t.id){if(!this._drag){if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>6))return;if(t.type===`touch`){this._endPointer(!1);return}if(this._startDrag(t,e.clientX,e.clientY),!this._drag)return}this._dragTo(e.clientX,e.clientY)}}_pointerUp(e){this._press&&e.pointerId===this._press.id&&this._endPointer(!!this._drag)}_startDrag(e,t,n){let r=e.card;if(!this._canLift(r)){this._endPointer(!1);return}let i=L(this._columnOf(r)),a=r.getBoundingClientRect(),o=r.cloneNode(!0);for(let e of[o,...o.querySelectorAll(`[id]`)])e.removeAttribute(`id`);o.removeAttribute(`data-wui-card`),o.removeAttribute(`tabindex`),o.setAttribute(`aria-hidden`,`true`),o.classList.add(`wui-kanban-ghost`),o.style.width=`${a.width}px`,this.appendChild(o),r.setAttribute(`data-wui-dragging`,``),this.setAttribute(`data-wui-dragging`,``),this._drag={card:r,from:i,ghost:o,dx:t-a.left,dy:n-a.top,over:null,verdicts:this._markTargets(r,i)},this._announce(p.lifted(U(r),this._titleOf(this._columnOf(r)))),document.addEventListener(`keydown`,this._onDocKeyDown),this._dragTo(t,n)}_dragTo(e,t){let n=this._drag;n.x=e,n.y=t,n.ghost.style.transform=`translate(${e-n.dx}px, ${t-n.dy}px)`;let r=this._columnAt(e,t);r!==n.over&&(n.over?.removeAttribute(`data-wui-over`),r?.setAttribute(`data-wui-over`,``),n.over=r),this._autoScroll(e,t,r)}_columnAt(e,t){for(let n of this._columns()){let r=n.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return n}return null}_indexAt(e,t){let n=this._visibleCardsIn(e).filter(e=>e!==this._drag?.card).find(e=>{let n=e.getBoundingClientRect();return t<n.top+n.height/2}),r=this._cardsIn(e).filter(e=>e!==this._drag?.card);return n?r.indexOf(n):r.length}_autoScroll(e,t,n){let r=this._scroller();if(r){let t=r.getBoundingClientRect();t.width>0&&(e<t.left+P?r.scrollBy?.({left:-16}):e>t.right-P&&r.scrollBy?.({left:F}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<P?window.scrollBy?.({top:-16}):t>i-P&&window.scrollBy?.({top:F}))}_scrollColumn(e,t){let n=this._bodyOf(e);if(!n||e.hasAttribute(`data-collapsed`)||n.scrollHeight<=n.clientHeight)return!1;let r=n.getBoundingClientRect();return t<r.top+P&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-P&&n.scrollTop+n.clientHeight<n.scrollHeight-1&&(n.scrollBy?.({top:F}),!0)}_endPointer(e){let t=this._press,n=this._drag;if(t&&clearTimeout(t.timer),this._press=null,this._drag=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel),document.removeEventListener(`keydown`,this._onDocKeyDown),!n)return;n.ghost.remove(),n.card.removeAttribute(`data-wui-dragging`),this.removeAttribute(`data-wui-dragging`),this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);let r=n.over;if(this._clearTargets(),!e||!r){this._announce(p.cancelled(U(n.card)));return}let i=L(r),a=n.verdicts.get(i);a?.source?this._announce(p.cancelled(U(n.card))):a?.ok?this._commit(n.card,i,this._indexAt(r,n.y)):(this._announce(a?.reason),Y(a?.reason,`info`))}_click(e){if(this._suppressClick&&e.target.closest?.(g)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let t=e.target.closest?.(T);if(t&&this.contains(t)){let e=t.closest(m);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let n=e.target.closest?.(A);if(n&&this.contains(n)){this._controlled()||this._loadMore(n.closest(m));return}let r=e.target.closest?.(E);if(r&&this.contains(r)){this._controlled()||this._toggleMore(r.closest(m));return}let i=e.target.closest?.(C);i&&this.contains(i)&&this._showColumn(i.getAttribute(`data-wui-switch`))}_keyDown(e){if(this._kbd){this._liftedKey(e);return}let t=e.target;if(!t.matches?.(g)||!this.contains(t))return;let n=this._columnOf(t);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(t))return;let r=L(n),i=this._columns();this._kbd={card:t,from:r,target:i.indexOf(n),verdicts:this._markTargets(t,r)},t.setAttribute(`data-wui-lifted`,``),this.setAttribute(`data-wui-dragging`,``),n.setAttribute(`data-wui-target`,``),this._announce(p.lifted(U(t),this._titleOf(n)));return}case`ArrowDown`:case`ArrowUp`:{let r=this._visibleCardsIn(n),i=r[r.indexOf(t)+(e.key===`ArrowDown`?1:-1)];i&&(e.preventDefault(),i.focus());return}case`ArrowLeft`:case`ArrowRight`:{let t=this._columns(),r=e.key===`ArrowRight`?1:-1;for(let i=t.indexOf(n)+r;i>=0&&i<t.length;i+=r){let n=this._visibleCardsIn(t[i])[0];if(n&&!t[i].hasAttribute(`data-collapsed`)){e.preventDefault(),n.focus();return}}return}}}_liftedKey(e){let t=this._kbd,n=this._columns();switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=t.target+(e.key===`ArrowRight`?1:-1);if(r<0||r>=n.length)return;n[t.target]?.removeAttribute(`data-wui-target`),t.target=r;let i=n[r];i.setAttribute(`data-wui-target`,``),this._showColumn(L(i),!1);let a=t.verdicts.get(L(i)),o=this._titleOf(i);this._announce(a.source?p.overSource(o):a.ok?p.over(o,this._cardsIn(i).filter(e=>!z(e)).length):p.overRefused(o,a.reason));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target],i=L(r),a=t.verdicts.get(i);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(p.cancelled(U(t.card))):this._commit(t.card,i);return}case`Escape`:case`Tab`:e.key===`Escape`&&e.preventDefault(),this._endKeyboard(),this._showColumn(t.from,!1),this._announce(p.cancelled(U(t.card)));return}}_endKeyboard(){let e=this._kbd;this._kbd=null,e&&(e.card.removeAttribute(`data-wui-lifted`),this.removeAttribute(`data-wui-dragging`),this._clearTargets())}_restoreCollapsed(){let e=G(this.getAttribute(`board-id`));for(let t of this._columns()){let n=L(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,n)&&this._setCollapsed(t,e[n],!1)}}_setCollapsed(e,t,n){let r=L(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(T))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?p.expand(i):p.collapse(i));n&&(K(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=L(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(R(t));else this._expanded.add(t);this.refresh()}_unloadedIn(e){return e.hasAttribute(j)?(e.hasAttribute(N)||e.setAttribute(N,String(Math.max(0,Number(e.getAttribute(M))-this._cardsIn(e).length))),Number(e.getAttribute(N))):0}async _loadMore(e){let t=Number(e.getAttribute(N));if(e.hasAttribute(`data-wui-loading`)||!(t>0))return;e.setAttribute(`data-wui-loading`,``);let r=e.querySelector(A);r&&(r.disabled=!0,r.textContent=p.loading);let i=new URL(e.getAttribute(j),document.baseURI);i.searchParams.set(`skip`,String(this._cardsIn(e).length));let o=0,s=!1;try{let n=await(0,a.wuiFetch)(i.toString());if(n.ok){let r=document.createElement(`template`);r.innerHTML=n.html;let i=this._bodyOf(e);for(let e of[...r.content.children])e.matches(g)&&!this._cardByKey(R(e))&&(i.append(e),o++);let a=n.response?.headers.get(`Wui-Kanban-Remaining`)??``;e.setAttribute(N,String(/^\d+$/.test(a)?Number(a):Math.max(0,t-o))),s=!0}}catch(e){(0,n.devError)(`[@webority/ui-elements] A kanban column could not load its next cards.`,e)}e.removeAttribute(`data-wui-loading`),this.refresh(),s?this._fire(`wui:kanban:loaded`,{key:L(e),added:o}):Y(p.loadFailed,`danger`)}_loadOnScroll(e){if(this._controlled()||!e.matches(h))return;let t=e.closest(m);t?.hasAttribute(j)&&e.scrollTop+e.clientHeight>=e.scrollHeight-I&&this._loadMore(t)}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(C))t.getAttribute(`data-wui-switch`)===e?t.setAttribute(`aria-current`,`true`):t.removeAttribute(`aria-current`);let n=this._columnByKey(e),r=this._scroller();if(!n||!r||!t&&!this._isPhone())return;let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo?.({left:n.offsetLeft-r.offsetLeft,behavior:i?`auto`:`smooth`})}_syncSwitcherFromScroll(){let e=this._scroller();if(!e||!this._isPhone())return;let t=e.clientWidth||1,n=this._columns()[Math.round(e.scrollLeft/t)];if(n)for(let e of this.querySelectorAll(C))e.getAttribute(`data-wui-switch`)===L(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};(0,t.defineElement)(`wui-kanban`,X),e.KANBAN_DRAG_THRESHOLD_PX=f,e.KANBAN_LONG_PRESS_MS=d,e.KANBAN_PHONE_QUERY=u,e.KANBAN_STORAGE_PREFIX=l,e.KANBAN_SUMMARY_FORMATS=c,e.KANBAN_TEXT=p,e.KANBAN_TONES=s,e.WuiKanban=X,e.kanbanCardLabel=U,e.kanbanOverflow=H,e.kanbanStorageKey=W,e.kanbanSummaryFormat=q,e.kanbanVisibleLimit=V,e.readKanbanCollapsed=G,e.sumKanbanValues=J,e.writeKanbanCollapsed=K})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
1
+ (function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.133.0`)throw Error(`[webority-ui] kanban expects ui-elements 0.133.0 but the page loaded `+o+`.`);var s=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),c=Object.freeze([`number`,`currency`,`compact`]),l=`wui-kanban:`,u=`(max-width: 767.98px)`,d=400,f=6,p=Object.freeze({help:`Press Space to pick up the card. Use the Left and Right arrow keys to choose a column, then Space to drop it, or Escape to cancel.`,empty:`Nothing here`,collapse:e=>`Collapse ${e}`,expand:e=>`Expand ${e}`,lifted:(e,t)=>`Picked up ${e} in ${t}. Use the Left and Right arrow keys to choose a column.`,over:(e,t)=>`${e}, ${t===1?`1 card`:`${t} cards`}. Drop allowed.`,overSource:e=>`${e}, where the card started.`,overRefused:(e,t)=>`${e}. ${t}`,dropHere:(e,t)=>`Drop here to move ${e} to ${t}.`,refused:(e,t)=>`Cards in ${e} cannot move to ${t}.`,moved:(e,t)=>`Moved ${e} to ${t}.`,saving:(e,t)=>`Moving ${e} to ${t}.`,cancelled:e=>`${e} was not moved.`,rolledBack:(e,t)=>`${e} went back to ${t}.`,locked:e=>`${e} cannot be moved.`,more:e=>`Show ${e} more`,fewer:`Show fewer`,loadMore:e=>`Show more (${e})`,loading:`Loading…`,loadFailed:`More cards could not be loaded. Try again.`,swipeHint:`Swipe sideways or tap a column`,busy:`This card is still saving. Try again in a moment.`,failed:Object.freeze({forbidden:`You do not have permission to move this card.`,client:`This card could not be moved. Refresh the board and try again.`,validation:`This card could not be moved. Refresh the board and try again.`,server:`Something went wrong on our side, so the card went back. Try again in a moment.`,network:`Could not reach the server, so the card went back. Check your connection and try again.`})}),m=`[data-wui-column]`,h=`[data-wui-body]`,g=`[data-wui-card]`,_=`[data-wui-count]`,v=`[data-wui-summary]`,y=`[data-wui-empty]`,b=`[data-wui-drop-note]`,x=`[data-wui-live]`,S=`[data-wui-help]`,C=`[data-wui-switch]`,w=`[data-wui-scroller]`,T=`[data-wui-collapse]`,E=`[data-wui-more]`,D=`data-wui-visible-limit`,O=`data-wui-overflow`,k=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,A=`[data-wui-load-more]`,j=`data-wui-more-url`,M=`data-wui-total`,N=`data-wui-unloaded`,P=48,F=16,I=160,L=e=>e.getAttribute(`data-wui-column`),R=e=>e.getAttribute(`data-wui-card`),z=e=>e.hidden||e.hasAttribute(`hidden`),B=e=>z(e)||e.hasAttribute(O);function V(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);if(!Number.isInteger(t)||t<1)throw TypeError(`Unsupported kanban visible limit "${String(e)}". Use a whole number of 1 or more.`);return t}function H(e,t,n,r){let i=new Set;if(t==null||n)return i;let a=0;for(let n of e)r.has(n)||(a<t?a++:i.add(n));return i}function U(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||R(e)||`Card`}function W(e){return e?`${l}${e}`:null}function G(e,t=globalThis.localStorage){let n=W(e);if(!n||!t)return{};try{let e=JSON.parse(t.getItem(n)||`null`);return e&&typeof e.collapsed==`object`&&e.collapsed?e.collapsed:{}}catch{return{}}}function K(e,t,n,r=globalThis.localStorage){let i=W(e);if(!i||!r)return;let a={...G(e,r),[t]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function q(e,t){if(!c.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${c.join(`, `)}.`);if(t!=null&&t!==``&&!i.MONEY_UNITS.includes(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.MONEY_UNITS.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:`INR`,unit:t||`rupees`}:{style:`number`,decimals:0}}function J(e){let t=0;for(let n of e){if(n==null||n===``)continue;let e=typeof n==`number`?n:Number(n);Number.isFinite(e)&&(t+=e)}return t}var Y=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},X=class extends r.ElementBase{constructor(){super(),this._wired=!1,this._filter=null,this._expanded=new Set,this._revealed=new Set,this._press=null,this._drag=null,this._kbd=null,this._suppressClick=!1,this._observer=null,this._refreshQueued=!1,this._scrollTimer=0,this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e),this._onPointerCancel=()=>this._endPointer(!1),this._onDocKeyDown=e=>{e.key===`Escape`&&this._drag&&(e.preventDefault(),this._endPointer(!1))},this._onScroll=()=>{clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>this._syncSwitcherFromScroll(),80)},this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`scroll`,e=>this._loadOnScroll(e.target),!0),this.addEventListener(`dragstart`,e=>{e.target.closest?.(g)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1})}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this._scroller()?.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._restoreCollapsed();for(let e of this._allCards())this._prepareCard(e);if(typeof MutationObserver==`function`){this._observer=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e.nodeType===1&&e.matches(g)&&this._prepareCard(e);this._queueRefresh()});for(let e of this.querySelectorAll(h))this._observer.observe(e,{childList:!0})}this.refresh()}}disconnectedCallback(){this._endPointer(!1),this._observer?.disconnect(),this._observer=null,this._scroller()?.removeEventListener(`scroll`,this._onScroll),clearTimeout(this._scrollTimer),this._wired=!1}setFilter(e){if(e!=null&&typeof e!=`function`)throw TypeError(`wui-kanban setFilter: pass a function or null.`);if(this._filter=e,!e)for(let e of this._allCards())e.hidden=!1;this.refresh()}refresh(){if(this._controlled())return;this._refreshQueued=!1;let e=this._summaryFormat();for(let t of this._columns()){let n=L(t),r=V(t.getAttribute(D)),a=[],o=[];for(let e of this._cardsIn(t))this._filter&&(e.hidden=this._filter(e)===!1),z(e)?e.removeAttribute(O):(a.push(e),o.push(e.getAttribute(`data-wui-value`)));let s=this._expanded.has(n),c=H(a.map(R),r,s,this._revealed);for(let e of a)e.toggleAttribute(O,c.has(R(e)));let l=this._unloadedIn(t),u=String(a.length+l);for(let e of this._countsOf(t))e.textContent!==u&&(e.textContent=u);let d=t.querySelector(y);if(d&&(d.hidden=a.length>0),e){let n=t.querySelector(v);n&&(n.textContent=(0,i.formatValue)(J(o),e))}let f=t.querySelector(E);if(f){f.hidden=r==null||(s?a.length<=r:c.size===0),f.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?p.fewer:p.more(c.size);f.textContent!==e&&(f.textContent=e)}let m=t.querySelector(A);if(m&&(m.hidden=l<=0,!t.hasAttribute(`data-wui-loading`))){m.disabled=!1;let e=p.loadMore(l);m.textContent!==e&&(m.textContent=e)}}}moveCard(e,t,n){let r=this._cardByKey(e);if(!r)throw Error(`wui-kanban moveCard: no card "${String(e)}" on this board.`);if(!this._columnByKey(t))throw Error(`wui-kanban moveCard: no column "${String(t)}" on this board.`);return this._commit(r,t,n)}_columns(){return[...this.querySelectorAll(m)]}_columnByKey(e){return this._columns().find(t=>L(t)===e)||null}_columnOf(e){return e.closest(m)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||L(e)||``).replace(/\s+/g,` `).trim()}_bodyOf(e){return e.querySelector(h)}_cardsIn(e){let t=this._bodyOf(e);return t?[...t.children].filter(e=>e.matches(g)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!B(e))}_allCards(){return[...this.querySelectorAll(`${h} > ${g}`)]}_cardByKey(e){return this._allCards().find(t=>R(t)===e)||null}_countsOf(e){let t=L(e),n=[...this.querySelectorAll(C)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(_),...n.flatMap(e=>[...e.querySelectorAll(_)])]}_scroller(){return this.querySelector(w)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?q(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(S);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=this.querySelector(x);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t,n=!1){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:n,detail:t}))}_canLift(e){let t=U(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(p.locked(t)),this._fire(`wui:kanban:locked`,{key:R(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)!==`true`||(this._announce(p.busy),Y(p.busy,`info`),!1)}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=p.refused(r?this._titleOf(r):t,i?this._titleOf(i):n),o=i?.getAttribute(`data-accept-from`);if(o!=null&&!o.split(/\s+/).filter(Boolean).includes(t))return{ok:!1,reason:a};if(typeof this.accept==`function`){let r=this.accept(e,t,n);if(r===!1)return{ok:!1,reason:a};if(typeof r==`string`&&r)return{ok:!1,reason:r}}return{ok:!0,reason:null}}_markTargets(e,t){let n=U(e),r=new Map;for(let i of this._columns()){let a=L(i),o=this._check(e,t,a);r.set(a,o),i.setAttribute(`data-wui-drop`,o.source?`source`:o.ok?`ok`:`refused`);let s=i.querySelector(b);s&&!o.source&&(s.textContent=o.ok?p.dropHere(n,this._titleOf(i)):o.reason,s.hidden=!1)}return r}_clearTargets(){for(let e of this._columns()){e.removeAttribute(`data-wui-drop`),e.removeAttribute(`data-wui-over`),e.removeAttribute(`data-wui-target`);let t=e.querySelector(b);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e),i=L(r),o=this._columnByKey(t),s=U(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),Y(c.reason,`info`),!1;let l=this._cardsIn(o),u=Number.isInteger(n)?Math.max(0,Math.min(n,l.length)):l.length,d={key:R(e),card:e,from:i,to:t,index:u},f=e.contains(document.activeElement);if(this._controlled())return this._fire(`wui:kanban:move`,d),this._announce(p.moved(s,this._titleOf(o))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let m=o.hasAttribute(D)&&!this._revealed.has(d.key);m&&this._revealed.add(d.key);let h={parent:e.parentNode,next:e.nextSibling,column:r,revealed:m};this._bodyOf(o).insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let g=o.getAttribute(`data-wui-step`);if(g)return this._runStep(e,d,h,g,o.getAttribute(`data-wui-step-size`));let _=this.getAttribute(`move-url`);if(!_)return this._announce(p.moved(s,this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(p.saving(s,this._titleOf(o)));let v=new URLSearchParams({card:d.key,from:i,to:t,index:String(u)}),y=await(0,a.wuiFetch)(_,{method:`POST`,body:v});if(this._lock(e,!1),y.kind===`session`)return!1;if(y.ok){let t=this._applyFragment(y.html)||e;return Y(y.message,`success`),this._announce(p.moved(U(t),this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,card:t,result:y}),!0}return this._rollback(e,h),y.kind!==`aborted`&&Y(y.message||p.failed[y.kind]||p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:y.kind,status:y.status,message:y.message}),!1}async _runStep(e,t,n,r,i){let o=U(e),s=this._columnByKey(t.to),c=new URLSearchParams({card:t.key,from:t.from,to:t.to}).toString(),l=r+(r.includes(`?`)?`&`:`?`)+c;this._lock(e,!0);let u;try{let t=window.WUI?.modal?.load;if(typeof t!=`function`)throw Error(`<wui-kanban> data-wui-step needs the Razor script webority-ui.js (WUI.modal.load).`);u=await(await t(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),r?.name!==`AbortError`&&Y(p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...t,kind:`step`,status:0,message:r?.message??null}),!1}if(u?.status!==`success`)return this._lock(e,!1),this._rollback(e,n),this._announce(p.cancelled(o)),this._fire(`wui:kanban:failed`,{...t,kind:`dismissed`,status:0,message:null}),!1;let d=e,f=this.getAttribute(`card-url`);if(f){let n=await(0,a.wuiFetch)(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:t.key})}`);n.ok&&(d=this._applyFragment(n.html)||e)}return this._lock(d,!1),this._announce(p.moved(U(d),this._titleOf(s))),this._fire(`wui:kanban:moved`,{...t,card:d,result:u}),!0}_lock(e,t){t?(e.setAttribute(`aria-busy`,`true`),e.setAttribute(`data-wui-saving`,``)):(e.removeAttribute(`aria-busy`),e.removeAttribute(`data-wui-saving`))}_rollback(e,t){let n=e.contains(document.activeElement),r=t.next&&t.next.parentNode===t.parent?t.next:null;t.revealed&&this._revealed.delete(R(e)),t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(p.rolledBack(U(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let t=document.createElement(`template`);t.innerHTML=e;for(let e of t.content.querySelectorAll(`script`))(0,n.devWarn)(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of[...t.content.querySelectorAll(g)]){if(e.closest(`template`))continue;let t=this._cardByKey(R(e));if(!t)continue;let n=t.contains(document.activeElement);t.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),t.hidden&&(e.hidden=!0),t.replaceWith(e),this._prepareCard(e),n&&e.focus(),r??=e}for(let e of t.content.querySelectorAll(`template[data-wui-kanban-summary]`))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(v)?.replaceChildren(e.content.cloneNode(!0));return this.refresh(),window.WUI?.refresh?.(),r}_refocusSoon(e){let t=()=>{let t=this._cardByKey(e);t&&this._focusMoved(t)};typeof requestAnimationFrame==`function`?requestAnimationFrame(t):setTimeout(t,0)}_focusMoved(e){e.focus({preventScroll:!0}),e.scrollIntoView?.({block:`nearest`})}_pointerDown(e){if(e.button!==0||e.isPrimary===!1||this._drag||this._kbd)return;let t=e.target.closest?.(g);if(!t||!this.contains(t)||e.target.closest(k))return;let n={card:t,id:e.pointerId,x:e.clientX,y:e.clientY,type:e.pointerType,timer:0};this._press=n,e.pointerType===`touch`&&(n.timer=setTimeout(()=>{this._press===n&&this._startDrag(n,n.x,n.y)},400)),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)}_pointerMove(e){let t=this._press;if(t&&e.pointerId===t.id){if(!this._drag){if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>6))return;if(t.type===`touch`){this._endPointer(!1);return}if(this._startDrag(t,e.clientX,e.clientY),!this._drag)return}this._dragTo(e.clientX,e.clientY)}}_pointerUp(e){this._press&&e.pointerId===this._press.id&&this._endPointer(!!this._drag)}_startDrag(e,t,n){let r=e.card;if(!this._canLift(r)){this._endPointer(!1);return}let i=L(this._columnOf(r)),a=r.getBoundingClientRect(),o=r.cloneNode(!0);for(let e of[o,...o.querySelectorAll(`[id]`)])e.removeAttribute(`id`);o.removeAttribute(`data-wui-card`),o.removeAttribute(`tabindex`),o.setAttribute(`aria-hidden`,`true`),o.classList.add(`wui-kanban-ghost`),o.style.width=`${a.width}px`,this.appendChild(o),r.setAttribute(`data-wui-dragging`,``),this.setAttribute(`data-wui-dragging`,``),this._drag={card:r,from:i,ghost:o,dx:t-a.left,dy:n-a.top,over:null,verdicts:this._markTargets(r,i)},this._announce(p.lifted(U(r),this._titleOf(this._columnOf(r)))),document.addEventListener(`keydown`,this._onDocKeyDown),this._dragTo(t,n)}_dragTo(e,t){let n=this._drag;n.x=e,n.y=t,n.ghost.style.transform=`translate(${e-n.dx}px, ${t-n.dy}px)`;let r=this._columnAt(e,t);r!==n.over&&(n.over?.removeAttribute(`data-wui-over`),r?.setAttribute(`data-wui-over`,``),n.over=r),this._autoScroll(e,t,r)}_columnAt(e,t){for(let n of this._columns()){let r=n.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return n}return null}_indexAt(e,t){let n=this._visibleCardsIn(e).filter(e=>e!==this._drag?.card).find(e=>{let n=e.getBoundingClientRect();return t<n.top+n.height/2}),r=this._cardsIn(e).filter(e=>e!==this._drag?.card);return n?r.indexOf(n):r.length}_autoScroll(e,t,n){let r=this._scroller();if(r){let t=r.getBoundingClientRect();t.width>0&&(e<t.left+P?r.scrollBy?.({left:-16}):e>t.right-P&&r.scrollBy?.({left:F}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<P?window.scrollBy?.({top:-16}):t>i-P&&window.scrollBy?.({top:F}))}_scrollColumn(e,t){let n=this._bodyOf(e);if(!n||e.hasAttribute(`data-collapsed`)||n.scrollHeight<=n.clientHeight)return!1;let r=n.getBoundingClientRect();return t<r.top+P&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-P&&n.scrollTop+n.clientHeight<n.scrollHeight-1&&(n.scrollBy?.({top:F}),!0)}_endPointer(e){let t=this._press,n=this._drag;if(t&&clearTimeout(t.timer),this._press=null,this._drag=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel),document.removeEventListener(`keydown`,this._onDocKeyDown),!n)return;n.ghost.remove(),n.card.removeAttribute(`data-wui-dragging`),this.removeAttribute(`data-wui-dragging`),this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);let r=n.over;if(this._clearTargets(),!e||!r){this._announce(p.cancelled(U(n.card)));return}let i=L(r),a=n.verdicts.get(i);a?.source?this._announce(p.cancelled(U(n.card))):a?.ok?this._commit(n.card,i,this._indexAt(r,n.y)):(this._announce(a?.reason),Y(a?.reason,`info`))}_click(e){if(this._suppressClick&&e.target.closest?.(g)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let t=e.target.closest?.(T);if(t&&this.contains(t)){let e=t.closest(m);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let n=e.target.closest?.(A);if(n&&this.contains(n)){this._controlled()||this._loadMore(n.closest(m));return}let r=e.target.closest?.(E);if(r&&this.contains(r)){this._controlled()||this._toggleMore(r.closest(m));return}let i=e.target.closest?.(C);i&&this.contains(i)&&this._showColumn(i.getAttribute(`data-wui-switch`))}_keyDown(e){if(this._kbd){this._liftedKey(e);return}let t=e.target;if(!t.matches?.(g)||!this.contains(t))return;let n=this._columnOf(t);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(t))return;let r=L(n),i=this._columns();this._kbd={card:t,from:r,target:i.indexOf(n),verdicts:this._markTargets(t,r)},t.setAttribute(`data-wui-lifted`,``),this.setAttribute(`data-wui-dragging`,``),n.setAttribute(`data-wui-target`,``),this._announce(p.lifted(U(t),this._titleOf(n)));return}case`ArrowDown`:case`ArrowUp`:{let r=this._visibleCardsIn(n),i=r[r.indexOf(t)+(e.key===`ArrowDown`?1:-1)];i&&(e.preventDefault(),i.focus());return}case`ArrowLeft`:case`ArrowRight`:{let t=this._columns(),r=e.key===`ArrowRight`?1:-1;for(let i=t.indexOf(n)+r;i>=0&&i<t.length;i+=r){let n=this._visibleCardsIn(t[i])[0];if(n&&!t[i].hasAttribute(`data-collapsed`)){e.preventDefault(),n.focus();return}}return}}}_liftedKey(e){let t=this._kbd,n=this._columns();switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=t.target+(e.key===`ArrowRight`?1:-1);if(r<0||r>=n.length)return;n[t.target]?.removeAttribute(`data-wui-target`),t.target=r;let i=n[r];i.setAttribute(`data-wui-target`,``),this._showColumn(L(i),!1);let a=t.verdicts.get(L(i)),o=this._titleOf(i);this._announce(a.source?p.overSource(o):a.ok?p.over(o,this._cardsIn(i).filter(e=>!z(e)).length):p.overRefused(o,a.reason));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target],i=L(r),a=t.verdicts.get(i);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(p.cancelled(U(t.card))):this._commit(t.card,i);return}case`Escape`:case`Tab`:e.key===`Escape`&&e.preventDefault(),this._endKeyboard(),this._showColumn(t.from,!1),this._announce(p.cancelled(U(t.card)));return}}_endKeyboard(){let e=this._kbd;this._kbd=null,e&&(e.card.removeAttribute(`data-wui-lifted`),this.removeAttribute(`data-wui-dragging`),this._clearTargets())}_restoreCollapsed(){let e=G(this.getAttribute(`board-id`));for(let t of this._columns()){let n=L(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,n)&&this._setCollapsed(t,e[n],!1)}}_setCollapsed(e,t,n){let r=L(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(T))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?p.expand(i):p.collapse(i));n&&(K(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=L(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(R(t));else this._expanded.add(t);this.refresh()}_unloadedIn(e){return e.hasAttribute(j)?(e.hasAttribute(N)||e.setAttribute(N,String(Math.max(0,Number(e.getAttribute(M))-this._cardsIn(e).length))),Number(e.getAttribute(N))):0}async _loadMore(e){let t=Number(e.getAttribute(N));if(e.hasAttribute(`data-wui-loading`)||!(t>0))return;e.setAttribute(`data-wui-loading`,``);let r=e.querySelector(A);r&&(r.disabled=!0,r.textContent=p.loading);let i=new URL(e.getAttribute(j),document.baseURI);i.searchParams.set(`skip`,String(this._cardsIn(e).length));let o=0,s=!1;try{let n=await(0,a.wuiFetch)(i.toString());if(n.ok){let r=document.createElement(`template`);r.innerHTML=n.html;let i=this._bodyOf(e);for(let e of[...r.content.children])e.matches(g)&&!this._cardByKey(R(e))&&(i.append(e),o++);let a=n.response?.headers.get(`Wui-Kanban-Remaining`)??``;e.setAttribute(N,String(/^\d+$/.test(a)?Number(a):Math.max(0,t-o))),s=!0}}catch(e){(0,n.devError)(`[@webority/ui-elements] A kanban column could not load its next cards.`,e)}e.removeAttribute(`data-wui-loading`),this.refresh(),s?this._fire(`wui:kanban:loaded`,{key:L(e),added:o}):Y(p.loadFailed,`danger`)}_loadOnScroll(e){if(this._controlled()||!e.matches(h))return;let t=e.closest(m);t?.hasAttribute(j)&&e.scrollTop+e.clientHeight>=e.scrollHeight-I&&this._loadMore(t)}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(C))t.getAttribute(`data-wui-switch`)===e?t.setAttribute(`aria-current`,`true`):t.removeAttribute(`aria-current`);let n=this._columnByKey(e),r=this._scroller();if(!n||!r||!t&&!this._isPhone())return;let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo?.({left:n.offsetLeft-r.offsetLeft,behavior:i?`auto`:`smooth`})}_syncSwitcherFromScroll(){let e=this._scroller();if(!e||!this._isPhone())return;let t=e.clientWidth||1,n=this._columns()[Math.round(e.scrollLeft/t)];if(n)for(let e of this.querySelectorAll(C))e.getAttribute(`data-wui-switch`)===L(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};(0,t.defineElement)(`wui-kanban`,X),e.KANBAN_DRAG_THRESHOLD_PX=f,e.KANBAN_LONG_PRESS_MS=d,e.KANBAN_PHONE_QUERY=u,e.KANBAN_STORAGE_PREFIX=l,e.KANBAN_SUMMARY_FORMATS=c,e.KANBAN_TEXT=p,e.KANBAN_TONES=s,e.WuiKanban=X,e.kanbanCardLabel=U,e.kanbanOverflow=H,e.kanbanStorageKey=W,e.kanbanSummaryFormat=q,e.kanbanVisibleLimit=V,e.readKanbanCollapsed=G,e.sumKanbanValues=J,e.writeKanbanCollapsed=K})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
@@ -1,4 +1,4 @@
1
- (function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.132.0`)throw Error(`[webority-ui] lead-popup expects ui-elements 0.132.0 but the page loaded `+i+`.`);var a={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-on-primary":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-modal":`0px 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-modal":`1505`},o=e=>`var(${e}, ${a[e]})`,s=`
1
+ (function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.133.0`)throw Error(`[webority-ui] lead-popup expects ui-elements 0.133.0 but the page loaded `+i+`.`);var a={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-on-primary":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-modal":`0px 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-modal":`1505`},o=e=>`var(${e}, ${a[e]})`,s=`
2
2
  :host {
3
3
  all: initial;
4
4
  display: contents;
@@ -1 +1 @@
1
- (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.132.0`)throw Error(`[webority-ui] lightbox expects ui-elements 0.132.0 but the page loaded `+a+`.`);var o=`a.wui-lightbox-item`,s=1,c=4,l=.5,u=2,d=50,f=6,p=300,m=300;function h(e){return Number.isFinite(e)?Math.min(c,Math.max(s,e)):s}function g(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function _(e,t){return Math.abs(e)<d||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function v(e){let t=String(e??``).split(/[?#]/)[0].split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function y(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}function b(e,t,n){let r=y(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=(0,i.glyphSvg)(e,{size:20}),r}var x=class extends n.ElementBase{static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=s,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._lockedOverflow=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.(o);if(!t||!this.contains(t))return;let n=this._links().indexOf(t);n<0||(e.preventDefault(),this.open(n))}}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||`Image viewer`}set label(e){this.setAttribute(`label`,String(e??``))}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(o)]}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||v(t)}})}open(e=0){let t=this._items();return t.length?(this._ui||(this._returnTo=document.activeElement,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))),this._show(e,t),this._ui.close.focus(),!0):!1}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null,this._lockedOverflow!==null&&(document.documentElement.style.overflow=this._lockedOverflow,this._lockedOverflow=null))}_build(){let e=y(`div`,`wui-lightbox-overlay`,{role:`dialog`,"aria-modal":`true`,"aria-label":this.label,tabindex:`-1`}),t=y(`div`,`wui-lightbox-bar`),n=y(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=y(`div`,`wui-lightbox-tools`),a=b(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),o=b(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),s=y(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});s.style.setProperty(`--wui-action-size`,`40px`),s.innerHTML=(0,i.glyphSvg)(`download`,{size:20}),s.hidden=!this.download;let c=b(`x`,`Close`,`wui-lightbox-close`);r.append(a,o,s,c),t.append(n,r);let u=y(`div`,`wui-lightbox-stage`),d=b(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),f=b(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),p=y(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),m=y(`p`,`wui-lightbox-status`,{role:`status`});u.append(p,m,d,f);let h=y(`p`,`wui-lightbox-caption`);e.append(t,u,h);let g={root:e,count:n,zoomOut:a,zoomIn:o,download:s,close:c,stage:u,prev:d,next:f,image:p,status:m,caption:h};this._ui=g,c.addEventListener(`click`,()=>this.close()),d.addEventListener(`click`,()=>this.step(-1)),f.addEventListener(`click`,()=>this.step(1)),a.addEventListener(`click`,()=>this._setZoom(this._zoom-l)),o.addEventListener(`click`,()=>this._setZoom(this._zoom+l)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),u.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),u.addEventListener(`pointermove`,e=>this._onPointerMove(e)),u.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),u.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),u.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),p.addEventListener(`load`,()=>{this._ui===g&&(m.textContent=``,u.removeAttribute(`aria-busy`),p.hidden=!1,this._applyTransform())}),p.addEventListener(`error`,()=>{this._ui===g&&(u.removeAttribute(`aria-busy`),p.hidden=!0,m.textContent=`This image can't be shown.`)}),this.append(e),this._lockedOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._ui,i=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),a=t[i],o=i!==this._index||!n.image.getAttribute(`src`);if(this._index=i,this._zoom=s,this._pan={x:0,y:0},n.count.textContent=`${(0,r.formatNumber)(i+1,{decimals:0})} of ${(0,r.formatNumber)(t.length,{decimals:0})}`,n.caption.textContent=a.caption,n.caption.hidden=!a.caption,n.download.href=a.src,n.download.setAttribute(`download`,a.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=a.alt||a.caption,n.image.src=a.src,this._applyTransform(),this._syncZoomButtons(),t.length>1)for(let e of[t[(i+1)%t.length],t[(i-1+t.length)%t.length]])new Image().src=e.src;o&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:i}}))}_syncZoomButtons(){this._ui.zoomOut.disabled=this._zoom<=s,this._ui.zoomIn.disabled=this._zoom>=c;let e=document.activeElement;(e===this._ui.zoomOut||e===this._ui.zoomIn)&&e.disabled&&this._ui.close.focus()}_setZoom(e){this._ui&&(this._zoom=h(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._ui;return g(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._ui;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>s)}_onKeyDown(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this.close();else if(e.key===`Tab`)this._trapTab(e);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+l)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-l)):e.key===`0`&&(e.preventDefault(),this._setZoom(s))}_trapTab(e){let t=[...this._ui.root.querySelectorAll(`button, a[href]`)].filter(e=>!e.hidden&&!e.disabled);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!this._ui.root.contains(i))?(e.preventDefault(),r.focus()):e.shiftKey||i!==r&&this._ui.root.contains(i)||(e.preventDefault(),n.focus())}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){if(!e.target.closest(`.wui-lightbox-nav`)){if(this._ui.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let[e,t]=[...this._pointers.values()];this._gesture={kind:`pinch`,distance:Math.hypot(e.x-t.x,e.y-t.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===this._ui.image,moved:!1})}}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let[e,n]=[...this._pointers.values()];this._setZoom(t.zoom*Math.hypot(e.x-n.x,e.y-n.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>f&&(t.moved=!0),this._zoom>s&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._ui.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===s&&this.step(_(r,i)):e.timeStamp-n.startTime>p||(n.onImage?e.timeStamp-this._lastTap<m?(this._lastTap=-1/0,this._setZoom(this._zoom>s?s:u)):this._lastTap=e.timeStamp:this.close())}};(0,t.defineElement)(`wui-lightbox`,x),e.WuiLightbox=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.iconGlyphs);
1
+ (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.133.0`)throw Error(`[webority-ui] lightbox expects ui-elements 0.133.0 but the page loaded `+a+`.`);var o=`a.wui-lightbox-item`,s=1,c=4,l=.5,u=2,d=50,f=6,p=300,m=300;function h(e){return Number.isFinite(e)?Math.min(c,Math.max(s,e)):s}function g(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function _(e,t){return Math.abs(e)<d||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function v(e){let t=String(e??``).split(/[?#]/)[0].split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function y(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}function b(e,t,n){let r=y(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=(0,i.glyphSvg)(e,{size:20}),r}var x=class extends n.ElementBase{static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=s,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._lockedOverflow=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.(o);if(!t||!this.contains(t))return;let n=this._links().indexOf(t);n<0||(e.preventDefault(),this.open(n))}}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||`Image viewer`}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(o)]}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||v(t)}})}open(e=0){let t=this._items();return t.length?(this._ui||(this._returnTo=document.activeElement,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))),this._show(e,t),this._ui.close.focus(),!0):!1}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null,this._lockedOverflow!==null&&(document.documentElement.style.overflow=this._lockedOverflow,this._lockedOverflow=null))}_build(){let e=y(`div`,`wui-lightbox-overlay`,{role:`dialog`,"aria-modal":`true`,"aria-label":this.label,tabindex:`-1`}),t=y(`div`,`wui-lightbox-bar`),n=y(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=y(`div`,`wui-lightbox-tools`),a=b(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),o=b(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),s=y(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});s.style.setProperty(`--wui-action-size`,`40px`),s.innerHTML=(0,i.glyphSvg)(`download`,{size:20}),s.hidden=!this.download;let c=b(`x`,`Close`,`wui-lightbox-close`);r.append(a,o,s,c),t.append(n,r);let u=y(`div`,`wui-lightbox-stage`),d=b(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),f=b(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),p=y(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),m=y(`p`,`wui-lightbox-status`,{role:`status`});u.append(p,m,d,f);let h=y(`p`,`wui-lightbox-caption`);e.append(t,u,h);let g={root:e,count:n,zoomOut:a,zoomIn:o,download:s,close:c,stage:u,prev:d,next:f,image:p,status:m,caption:h};this._ui=g,c.addEventListener(`click`,()=>this.close()),d.addEventListener(`click`,()=>this.step(-1)),f.addEventListener(`click`,()=>this.step(1)),a.addEventListener(`click`,()=>this._setZoom(this._zoom-l)),o.addEventListener(`click`,()=>this._setZoom(this._zoom+l)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),u.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),u.addEventListener(`pointermove`,e=>this._onPointerMove(e)),u.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),u.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),u.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),p.addEventListener(`load`,()=>{this._ui===g&&(m.textContent=``,u.removeAttribute(`aria-busy`),p.hidden=!1,this._applyTransform())}),p.addEventListener(`error`,()=>{this._ui===g&&(u.removeAttribute(`aria-busy`),p.hidden=!0,m.textContent=`This image can't be shown.`)}),this.append(e),this._lockedOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._ui,i=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),a=t[i],o=i!==this._index||!n.image.getAttribute(`src`);if(this._index=i,this._zoom=s,this._pan={x:0,y:0},n.count.textContent=`${(0,r.formatNumber)(i+1,{decimals:0})} of ${(0,r.formatNumber)(t.length,{decimals:0})}`,n.caption.textContent=a.caption,n.caption.hidden=!a.caption,n.download.href=a.src,n.download.setAttribute(`download`,a.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=a.alt||a.caption,n.image.src=a.src,this._applyTransform(),this._syncZoomButtons(),t.length>1)for(let e of[t[(i+1)%t.length],t[(i-1+t.length)%t.length]])new Image().src=e.src;o&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:i}}))}_syncZoomButtons(){this._ui.zoomOut.disabled=this._zoom<=s,this._ui.zoomIn.disabled=this._zoom>=c;let e=document.activeElement;(e===this._ui.zoomOut||e===this._ui.zoomIn)&&e.disabled&&this._ui.close.focus()}_setZoom(e){this._ui&&(this._zoom=h(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._ui;return g(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._ui;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>s)}_onKeyDown(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this.close();else if(e.key===`Tab`)this._trapTab(e);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+l)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-l)):e.key===`0`&&(e.preventDefault(),this._setZoom(s))}_trapTab(e){let t=[...this._ui.root.querySelectorAll(`button, a[href]`)].filter(e=>!e.hidden&&!e.disabled);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!this._ui.root.contains(i))?(e.preventDefault(),r.focus()):e.shiftKey||i!==r&&this._ui.root.contains(i)||(e.preventDefault(),n.focus())}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){if(!e.target.closest(`.wui-lightbox-nav`)){if(this._ui.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let[e,t]=[...this._pointers.values()];this._gesture={kind:`pinch`,distance:Math.hypot(e.x-t.x,e.y-t.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===this._ui.image,moved:!1})}}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let[e,n]=[...this._pointers.values()];this._setZoom(t.zoom*Math.hypot(e.x-n.x,e.y-n.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>f&&(t.moved=!0),this._zoom>s&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._ui.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===s&&this.step(_(r,i)):e.timeStamp-n.startTime>p||(n.onImage?e.timeStamp-this._lastTap<m?(this._lastTap=-1/0,this._setZoom(this._zoom>s?s:u)):this._lastTap=e.timeStamp:this.close())}};(0,t.defineElement)(`wui-lightbox`,x),e.WuiLightbox=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.iconGlyphs);
@@ -1,4 +1,4 @@
1
- (function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.132.0`)throw Error(`[webority-ui] markdown expects ui-elements 0.132.0 but the page loaded `+r+`.`);var i=/\[([^[\]\n]+)\](?!\()/g,a=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),o=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,s=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,c=new RegExp(i.source,`y`),l=e=>/[\p{L}\p{N}]/u.test(e);function u(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function d(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),o=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),s=n===`_`&&l(e.charAt(i+n.length));if(a&&!o&&!s&&!u(e,i))return i}return-1}function f(e,t){let n=t?.isCitation,r=[],i=``,u=()=>{i&&=(r.push({type:`text`,text:i}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&a.has(h)){i+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){u(),r.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let n=d(e,p+2,g);if(n!==-1&&!(g===`__`&&l(e.charAt(p-1)))){u();let i=f(e.slice(p+2,n),t);g===`~~`?r.push({type:`strike`,children:i}):r.push({type:`strong`,children:i}),p=n+2;continue}i+=g,p+=2}else{if(m===`*`||m===`_`){let n=d(e,p+1,m);if(n!==-1&&!(m===`_`&&l(e.charAt(p-1)))){u(),r.push({type:`em`,children:f(e.slice(p+1,n),t)}),p=n+1;continue}}if(m===`[`){o.lastIndex=p;let t=o.exec(e);if(t){u(),r.push({type:`link`,href:t[2],children:f(t[1])}),p+=t[0].length;continue}if(n){c.lastIndex=p;let t=c.exec(e);if(t&&n(t[1])){u(),r.push({type:`citation`,text:t[1]}),p+=t[0].length;continue}}}if(m===`!`){s.lastIndex=p;let t=s.exec(e);if(t){u(),r.push({type:`image`,children:f(t[1])}),p+=t[0].length;continue}}i+=m,p+=1}}return u(),r.map((e,t)=>({...e,key:t}))}var p=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,m=/^https?:/i,h=/^(mailto|tel):/i,g=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/;function _(e,t,n,r){if(n&&(t===`page`||p.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}return t===`app`?null:g.test(e)?{kind:`page`,href:e}:t===`page`&&!(m.test(e)&&r&&v(e,r))?null:m.test(e)?{kind:r&&v(e,r)?`page`:`web`,href:e}:h.test(e)?{kind:`contact`,href:e}:null}function v(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function y(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var b=/^\s*```/,x=/^\s*```\s*(\S*)/,S=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,C=/^\s*([-*_])(\s*\1){2,}\s*$/,w=/^(\s*)[-*+]\s+(.*)$/,T=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,E=/^\s*>\s?(.*)$/,D=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,O=e=>e.includes(`|`);function k(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function A(e,t){return O(e[t])&&t+1<e.length&&e[t+1].includes(`|`)&&D.test(e[t+1])}function j(e,t){let n=e[t];return b.test(n)||E.test(n)||w.test(n)||T.test(n)||S.test(n)||C.test(n)||A(e,t)}function M(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function N(e){let t=T.exec(e);if(t)return{text:t[3],depth:M(t[1]),ordered:!0,number:Number(t[2])};let n=w.exec(e);return n?{text:n[2],depth:M(n[1]),ordered:!1,number:0}:null}function P(e){let t=(e??``).replace(/\r\n?/g,`
1
+ (function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.133.0`)throw Error(`[webority-ui] markdown expects ui-elements 0.133.0 but the page loaded `+r+`.`);var i=/\[([^[\]\n]+)\](?!\()/g,a=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),o=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,s=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,c=new RegExp(i.source,`y`),l=e=>/[\p{L}\p{N}]/u.test(e);function u(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function d(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),o=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),s=n===`_`&&l(e.charAt(i+n.length));if(a&&!o&&!s&&!u(e,i))return i}return-1}function f(e,t){let n=t?.isCitation,r=[],i=``,u=()=>{i&&=(r.push({type:`text`,text:i}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&a.has(h)){i+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){u(),r.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let n=d(e,p+2,g);if(n!==-1&&!(g===`__`&&l(e.charAt(p-1)))){u();let i=f(e.slice(p+2,n),t);g===`~~`?r.push({type:`strike`,children:i}):r.push({type:`strong`,children:i}),p=n+2;continue}i+=g,p+=2}else{if(m===`*`||m===`_`){let n=d(e,p+1,m);if(n!==-1&&!(m===`_`&&l(e.charAt(p-1)))){u(),r.push({type:`em`,children:f(e.slice(p+1,n),t)}),p=n+1;continue}}if(m===`[`){o.lastIndex=p;let t=o.exec(e);if(t){u(),r.push({type:`link`,href:t[2],children:f(t[1])}),p+=t[0].length;continue}if(n){c.lastIndex=p;let t=c.exec(e);if(t&&n(t[1])){u(),r.push({type:`citation`,text:t[1]}),p+=t[0].length;continue}}}if(m===`!`){s.lastIndex=p;let t=s.exec(e);if(t){u(),r.push({type:`image`,children:f(t[1])}),p+=t[0].length;continue}}i+=m,p+=1}}return u(),r.map((e,t)=>({...e,key:t}))}var p=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,m=/^https?:/i,h=/^(mailto|tel):/i,g=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/;function _(e,t,n,r){if(n&&(t===`page`||p.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}return t===`app`?null:g.test(e)?{kind:`page`,href:e}:t===`page`&&!(m.test(e)&&r&&v(e,r))?null:m.test(e)?{kind:r&&v(e,r)?`page`:`web`,href:e}:h.test(e)?{kind:`contact`,href:e}:null}function v(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function y(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var b=/^\s*```/,x=/^\s*```\s*(\S*)/,S=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,C=/^\s*([-*_])(\s*\1){2,}\s*$/,w=/^(\s*)[-*+]\s+(.*)$/,T=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,E=/^\s*>\s?(.*)$/,D=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,O=e=>e.includes(`|`);function k(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function A(e,t){return O(e[t])&&t+1<e.length&&e[t+1].includes(`|`)&&D.test(e[t+1])}function j(e,t){let n=e[t];return b.test(n)||E.test(n)||w.test(n)||T.test(n)||S.test(n)||C.test(n)||A(e,t)}function M(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function N(e){let t=T.exec(e);if(t)return{text:t[3],depth:M(t[1]),ordered:!0,number:Number(t[2])};let n=w.exec(e);return n?{text:n[2],depth:M(n[1]),ordered:!1,number:0}:null}function P(e){let t=(e??``).replace(/\r\n?/g,`
2
2
  `).split(`
3
3
  `),n=[],r=0;for(;r<t.length;){let e=t[r];if(!e.trim()){r+=1;continue}if(b.test(e)){let i=x.exec(e)?.[1]||null,a=[];for(r+=1;r<t.length&&!b.test(t[r]);)a.push(t[r]),r+=1;r+=1,n.push({type:`code`,text:a.join(`
4
4
  `),language:i});continue}if(A(t,r)){let i=k(e),a=[];for(r+=2;r<t.length&&t[r].trim()&&O(t[r]);)a.push(k(t[r])),r+=1;n.push({type:`table`,header:i,rows:a});continue}if(C.test(e)){n.push({type:`rule`}),r+=1;continue}let i=S.exec(e);if(i){n.push({type:`heading`,level:i[1].length,text:i[2]}),r+=1;continue}if(E.test(e)){let e=[];for(;r<t.length;){let n=E.exec(t[r]);if(!n)break;e.push(n[1]),r+=1}n.push({type:`quote`,lines:e});continue}let a=N(e);if(a){let e=[];for(;r<t.length&&t[r].trim();){let n=N(t[r]);if(n){if(n.depth===0&&n.ordered!==a.ordered)break;e.push(n)}else if(j(t,r))break;else e[e.length-1].text+=` ${t[r].trim()}`;r+=1}n.push({type:`list`,ordered:a.ordered,start:a.ordered?a.number:1,items:e});continue}let o=[e];for(r+=1;r<t.length&&t[r].trim()&&!j(t,r);)o.push(t[r]),r+=1;n.push({type:`paragraph`,lines:o})}return n.map((e,t)=>({...e,key:t}))}var F=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`],I=[`app`,`web`,`page`];function L(e,t,n,r,i=null){let a=R(e.ownerDocument,n,r).map((e,n)=>{let r=t[n]?.sig===e.sig?t[n].nodes:null;return{sig:e.sig,nodes:r??e.build()}}),o=new Set(a.flatMap(e=>e.nodes));for(let e of t)for(let t of e.nodes)o.has(t)||t.remove();let s=i;for(let t of a.flatMap(e=>e.nodes))(t.parentNode!==e||t.previousSibling!==s)&&e.insertBefore(t,s?s.nextSibling:e.firstChild),s=t;return a}function R(e,t,n){let r={doc:e,links:I.includes(n.links)?n.links:`web`,headings:n.headings===`text`?`text`:`outline`,resolveLink:n.resolveLink,isCitation:n.isCitation},i=n.resolverGeneration??0;return P(t).map(e=>({sig:`${JSON.stringify(e)}|${r.links}|${r.headings}|${i}`,build:()=>V(r,e)}))}var z=class extends n.ElementBase{static get observedAttributes(){return[`links`,`headings`]}constructor(){super(),this._drawn=[],this._blocks=[],this._observer=null,this._connected=!1,this._resolveLink=void 0,this._isCitation=void 0,this._resolverGeneration=0}connectedCallback(){this._connected=!0,this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._drawn.some(t=>t.contains(e.target)))&&this._render()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._connected=!1,this._observer?.disconnect(),this._observer=null}get resolveLink(){return this._resolveLink}set resolveLink(e){this._resolveLink=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get isCitation(){return this._isCitation}set isCitation(e){this._isCitation=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}attributeChangedCallback(e,t,n){t!==n&&this._connected&&this._render()}_source(){return Array.from(this.children).find(e=>e.tagName===`PRE`&&e.classList.contains(`wui-markdown-source`))}_render(){let e=this._source();e&&(this._blocks=L(this,this._blocks,e.textContent??``,{links:this.getAttribute(`links`)??void 0,headings:this.getAttribute(`headings`)??void 0,resolveLink:this._resolveLink,isCitation:this._isCitation,resolverGeneration:this._resolverGeneration},e),this._drawn=this._blocks.flatMap(e=>e.nodes),e.hidden=!0,this._observer?.takeRecords())}};function B(e,t,n=[]){let r=e.createElement(t);return r.append(...n),r}function V(e,t){switch(t.type){case`paragraph`:return[B(e.doc,`p`,H(e,t.lines))];case`heading`:return[U(e,t)];case`list`:return W(e,t.items);case`table`:return[K(e,t)];case`code`:return[q(e.doc,t)];case`quote`:return[B(e.doc,`blockquote`,H(e,t.lines))];case`rule`:return[e.doc.createElement(`hr`)];default:return[]}}function H(e,t){let n=[];return t.forEach((t,r)=>{r>0&&n.push(e.doc.createElement(`br`)),n.push(...J(e,t))}),n}function U(e,t){let n=J(e,t.text);if(e.headings===`text`){let t=B(e.doc,`p`,n);return t.className=`fw-semibold`,t}return B(e.doc,`h2`,n)}function W(e,t){let n=[];for(let r=0;r<t.length;){let i=G(e,t,r);n.push(i.list),r=i.next}return n}function G(e,t,n){let{depth:r,ordered:i,number:a}=t[n],o=e.doc.createElement(i?`ol`:`ul`);i&&a!==1&&o.setAttribute(`start`,String(a));let s=null,c=n;for(;c<t.length&&t[c].depth>=r;)if(t[c].depth===r)s=B(e.doc,`li`,J(e,t[c].text)),o.append(s),c+=1;else{let n=G(e,t,c);s.append(n.list),c=n.next}return{list:o,next:c}}function K(e,t){let n=t.header.map(t=>{let n=B(e.doc,`th`,J(e,t));return n.setAttribute(`scope`,`col`),n}),r=t.rows.map(n=>B(e.doc,`tr`,t.header.map((t,r)=>B(e.doc,`td`,J(e,n[r]??``))))),i=B(e.doc,`table`,[B(e.doc,`thead`,[B(e.doc,`tr`,n)]),B(e.doc,`tbody`,r)]);i.className=`table`;let a=B(e.doc,`div`,[i]);return a.className=`table-responsive`,a}function q(e,t){let n=B(e,`pre`,[B(e,`code`,[e.createTextNode(t.text)])]);n.className=`wui-code-source`;let r=B(e,`wui-code-block`,[n]);return r.className=`wui-code-block`,r.setAttribute(`language`,F.includes(t.language)?t.language:`text`),r}function J(e,t){return Y(e,f(t,{isCitation:e.isCitation}))}function Y(e,t){return t.flatMap(t=>X(e,t))}function X(e,t){let{doc:n}=e;switch(t.type){case`code`:return[B(n,`code`,[n.createTextNode(t.text)])];case`strong`:return[B(n,`strong`,Y(e,t.children))];case`em`:return[B(n,`em`,Y(e,t.children))];case`strike`:return[B(n,`del`,Y(e,t.children))];case`image`:return[n.createTextNode(`[`),...Y(e,t.children),n.createTextNode(`]`)];case`link`:return Z(e,t);case`citation`:return[Q(n,t.text)];default:return[n.createTextNode(t.text)]}}function Z(e,t){let n=Y(e,t.children),r=_(t.href,e.links,e.resolveLink,globalThis.location?.origin);if(!r)return n;if(r.kind===`app`){let t=y(r.target);return t?[$(e.doc,t,n,!1)]:n}return[$(e.doc,r.href,n,r.kind===`web`)]}function Q(e,t){let n=e.createElement(`span`);n.className=`chip primary chip-outline chip-sm chip-clickable wui-markdown-citation`,n.setAttribute(`data-wui`,`AppChip`);let r=e.createElement(`button`);r.type=`button`,r.className=`chip-body`,r.setAttribute(`aria-label`,t),r.addEventListener(`click`,()=>{r.dispatchEvent(new CustomEvent(`wui-markdown-citation`,{bubbles:!0,detail:{citation:t}}))});let i=e.createElement(`span`);return i.className=`chip-label`,i.textContent=t,r.append(i),n.append(r),n}function $(e,t,n,r){let i=B(e,`span`,n);i.className=`wui-link__label`;let a=B(e,`a`,[i]);return a.className=`wui-link wui-link--static`,a.setAttribute(`data-wui`,`AppLink`),a.setAttribute(`href`,t),r&&(a.setAttribute(`target`,`_blank`),a.setAttribute(`rel`,`noopener noreferrer`)),a}(0,t.defineElement)(`wui-markdown`,z),e.WuiMarkdown=z})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase);
@@ -1,4 +1,4 @@
1
- (function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=globalThis.WeborityUiElementsInternal?.version;if(u!==`0.132.0`)throw Error(`[webority-ui] multiselect expects ui-elements 0.132.0 but the page loaded `+u+`.`);var d=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},f=(e,t=`wui-opt-avatar`)=>{let n=d(e.avatar);return!n&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${(0,r.escapeHtml)(e.initials??``)}</span>${n?`<img class="avatar-img" src="${p(n)}" alt="" />`:``}</span>`},p=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),m=!1,h=!1;function g(){h||typeof document>`u`||(h=!0,document.addEventListener(`keydown`,e=>{m=e.key===`Tab`},!0),document.addEventListener(`keyup`,()=>{m=!1},!0))}function _(){return m}function v(e,t){let n=[String(e??``)];for(let e of t)n=n.flatMap(t=>t.split(e));return n.map(e=>e.trim()).filter(Boolean)}var y=(e,t)=>t.some(t=>String(e??``).includes(t)),b=class extends a.ElementBase{static formAssociated=!0;_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}static get observedAttributes(){return[`placeholder`,`search-placeholder`,`searchable`,`disabled`,`readonly`,`loading`,`icon`,`size`,`collapse-chips`,`aria-label`,`aria-invalid`,`allow-custom`,`custom-pattern`,`custom-invalid-message`]}constructor(){super(),this._values=[],this._optionsProp=null,this._active=-1,this._typeahead=``,this._typeaheadTimer=null,this._customError=``;try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){if(this._rendered)this._bindGlobal?.();else{if(!this._valuesInit&&!this._optionsProp&&!this._values.length){let e=this.getAttribute(`value`);if(e!=null&&e!==``)this._values=e.split(`,`).map(e=>e.trim()).filter(Boolean);else{let e=[...this.querySelectorAll(`:scope > wui-option[selected]`)].map(e=>e.getAttribute(`value`)??e.textContent.trim());e.length&&(this._values=e.map(String))}}this._valuesInit=!0,this._defaultCaptured||=(this._defaultValues=this._values.slice(),!0),this.render()}}formResetCallback(){this.values=(this._defaultValues||[]).slice();let e=this.querySelector(`[data-input]`);e&&(e.value=``),this._setCustomError(``)}attributeChangedCallback(e){e===`aria-invalid`?this._syncInvalid():e!==`custom-pattern`&&e!==`custom-invalid-message`&&this._rendered&&this.render()}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._customError?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}get values(){return this._values.slice()}set values(e){this._values=Array.isArray(e)?e.map(String):[],(0,s.syncFormMirrors)(this,this._values),this._rendered&&(this._renderControl(),this._renderOptions(this._query()))}set options(e){this._optionsProp=Array.isArray(e)?e:null,this._rendered&&this._allowCustom?(this._renderControl(),this._renderOptions(this._query())):this.isConnected&&this.render()}get options(){return this._readOptions()}get validateCustom(){return this._validateCustom??null}set validateCustom(e){this._validateCustom=typeof e==`function`?e:null}get _allowCustom(){return this.hasAttribute(`allow-custom`)}_query(){let e=this.querySelector(this._allowCustom?`[data-input]`:`.search-select-input`);return e?e.value:``}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[r.TRUSTED_HTML]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of S){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_labelFor(e){let t=this._readOptions().find(t=>String(t.value)===String(e));return t?(0,r.optionText)(t):(0,r.stripTags)(e)}_labelHtmlFor(e){let t=this._readOptions().find(t=>String(t.value)===String(e));return t?(0,r.optionLabelHtml)(t):(0,r.escapeHtml)(e)}render(){this._snapshotDeclared();let e=this._allowCustom,t=this.hasAttribute(`searchable`)&&!e,n=this.getAttribute(`search-placeholder`)||`Search…`,r=this.getAttribute(`icon`),i=this.getAttribute(`size`),a=i===`sm`?` search-select-sm`:i===`lg`?` search-select-lg`:``;(0,s.syncFormMirrors)(this,this._values),this.id||=`wui-multiselect-${Math.random().toString(36).slice(2,9)}`;let l=`${this.id}-listbox`;this._listboxId=l;let u=this.hasAttribute(`disabled`),d=(0,o.isInert)(this);if(e){let e=`${this.id}-custom-error`;this.innerHTML=`
1
+ (function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=globalThis.WeborityUiElementsInternal?.version;if(u!==`0.133.0`)throw Error(`[webority-ui] multiselect expects ui-elements 0.133.0 but the page loaded `+u+`.`);var d=e=>{let t=String(e??``).trim();return/^(https?:)?\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t)?t:``},f=(e,t=`wui-opt-avatar`)=>{let n=d(e.avatar);return!n&&!e.initials?``:`<span class="avatar ${t}" aria-hidden="true"><span class="avatar-face">${(0,r.escapeHtml)(e.initials??``)}</span>${n?`<img class="avatar-img" src="${p(n)}" alt="" />`:``}</span>`},p=e=>String(e??``).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),m=!1,h=!1;function g(){h||typeof document>`u`||(h=!0,document.addEventListener(`keydown`,e=>{m=e.key===`Tab`},!0),document.addEventListener(`keyup`,()=>{m=!1},!0))}function _(){return m}function v(e,t){let n=[String(e??``)];for(let e of t)n=n.flatMap(t=>t.split(e));return n.map(e=>e.trim()).filter(Boolean)}var y=(e,t)=>t.some(t=>String(e??``).includes(t)),b=class extends a.ElementBase{static formAssociated=!0;_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}static get observedAttributes(){return[`placeholder`,`search-placeholder`,`searchable`,`disabled`,`readonly`,`loading`,`icon`,`size`,`collapse-chips`,`aria-label`,`aria-invalid`,`allow-custom`,`custom-pattern`,`custom-invalid-message`]}constructor(){super(),this._values=[],this._optionsProp=null,this._active=-1,this._typeahead=``,this._typeaheadTimer=null,this._customError=``;try{this._internals=this.attachInternals()}catch{this._internals=null}}connectedCallback(){if(this._rendered)this._bindGlobal?.();else{if(!this._valuesInit&&!this._optionsProp&&!this._values.length){let e=this.getAttribute(`value`);if(e!=null&&e!==``)this._values=e.split(`,`).map(e=>e.trim()).filter(Boolean);else{let e=[...this.querySelectorAll(`:scope > wui-option[selected]`)].map(e=>e.getAttribute(`value`)??e.textContent.trim());e.length&&(this._values=e.map(String))}}this._valuesInit=!0,this._defaultCaptured||=(this._defaultValues=this._values.slice(),!0),this.render()}}formResetCallback(){this.values=(this._defaultValues||[]).slice();let e=this.querySelector(`[data-input]`);e&&(e.value=``),this._setCustomError(``)}attributeChangedCallback(e){e===`aria-invalid`?this._syncInvalid():e!==`custom-pattern`&&e!==`custom-invalid-message`&&this._rendered&&this.render()}_syncInvalid(){let e=this.querySelector(`.search-select-control`);e&&(this.hasAttribute(`aria-invalid`)||this._customError?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}get values(){return this._values.slice()}set values(e){this._values=Array.isArray(e)?e.map(String):[],(0,s.syncFormMirrors)(this,this._values),this._rendered&&(this._renderControl(),this._renderOptions(this._query()))}set options(e){this._optionsProp=Array.isArray(e)?e:null,this._rendered&&this._allowCustom?(this._renderControl(),this._renderOptions(this._query())):this.isConnected&&this.render()}get options(){return this._readOptions()}get validateCustom(){return this._validateCustom??null}set validateCustom(e){this._validateCustom=typeof e==`function`?e:null}get _allowCustom(){return this.hasAttribute(`allow-custom`)}_query(){let e=this.querySelector(this._allowCustom?`[data-input]`:`.search-select-input`);return e?e.value:``}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>{let t={value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[r.TRUSTED_HTML]:!0,selected:e.hasAttribute(`selected`)};for(let[n,r]of S){let i=e.getAttribute(n);i&&(t[r]=i)}return e.hasAttribute(`disabled`)&&(t.disabled=!0),t}))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}_labelFor(e){let t=this._readOptions().find(t=>String(t.value)===String(e));return t?(0,r.optionText)(t):(0,r.stripTags)(e)}_labelHtmlFor(e){let t=this._readOptions().find(t=>String(t.value)===String(e));return t?(0,r.optionLabelHtml)(t):(0,r.escapeHtml)(e)}render(){this._snapshotDeclared();let e=this._allowCustom,t=this.hasAttribute(`searchable`)&&!e,n=this.getAttribute(`search-placeholder`)||`Search…`,r=this.getAttribute(`icon`),i=this.getAttribute(`size`),a=i===`sm`?` search-select-sm`:i===`lg`?` search-select-lg`:``;(0,s.syncFormMirrors)(this,this._values),this.id||=`wui-multiselect-${Math.random().toString(36).slice(2,9)}`;let l=`${this.id}-listbox`;this._listboxId=l;let u=this.hasAttribute(`disabled`),d=(0,o.isInert)(this);if(e){let e=`${this.id}-custom-error`;this.innerHTML=`
2
2
  <div class="search-select${a}">
3
3
  <div class="input search-select-control search-select-multi"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${u?` aria-disabled="true"`:``}>
4
4
  ${r?(0,c.glyphSvg)(r,{className:`search-select-icon`}):``}
@@ -1,4 +1,4 @@
1
- (function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=globalThis.WeborityUiElementsInternal?.version;if(u!==`0.132.0`)throw Error(`[webority-ui] phone expects ui-elements 0.132.0 but the page loaded `+u+`.`);var d=[[`AF`,`Afghanistan`,`93`],[`AX`,`Åland Islands`,`358`],[`AL`,`Albania`,`355`],[`DZ`,`Algeria`,`213`],[`AS`,`American Samoa`,`1`],[`AD`,`Andorra`,`376`],[`AO`,`Angola`,`244`],[`AI`,`Anguilla`,`1`],[`AG`,`Antigua & Barbuda`,`1`],[`AR`,`Argentina`,`54`],[`AM`,`Armenia`,`374`],[`AW`,`Aruba`,`297`],[`AC`,`Ascension Island`,`247`],[`AU`,`Australia`,`61`],[`AT`,`Austria`,`43`],[`AZ`,`Azerbaijan`,`994`],[`BS`,`Bahamas`,`1`],[`BH`,`Bahrain`,`973`],[`BD`,`Bangladesh`,`880`],[`BB`,`Barbados`,`1`],[`BY`,`Belarus`,`375`],[`BE`,`Belgium`,`32`],[`BZ`,`Belize`,`501`],[`BJ`,`Benin`,`229`],[`BM`,`Bermuda`,`1`],[`BT`,`Bhutan`,`975`],[`BO`,`Bolivia`,`591`],[`BA`,`Bosnia & Herzegovina`,`387`],[`BW`,`Botswana`,`267`],[`BR`,`Brazil`,`55`],[`IO`,`British Indian Ocean Territory`,`246`],[`VG`,`British Virgin Islands`,`1`],[`BN`,`Brunei`,`673`],[`BG`,`Bulgaria`,`359`],[`BF`,`Burkina Faso`,`226`],[`BI`,`Burundi`,`257`],[`KH`,`Cambodia`,`855`],[`CM`,`Cameroon`,`237`],[`CA`,`Canada`,`1`],[`CV`,`Cape Verde`,`238`],[`BQ`,`Caribbean Netherlands`,`599`],[`KY`,`Cayman Islands`,`1`],[`CF`,`Central African Republic`,`236`],[`TD`,`Chad`,`235`],[`CL`,`Chile`,`56`],[`CN`,`China`,`86`],[`CX`,`Christmas Island`,`61`],[`CC`,`Cocos (Keeling) Islands`,`61`],[`CO`,`Colombia`,`57`],[`KM`,`Comoros`,`269`],[`CG`,`Congo - Brazzaville`,`242`],[`CD`,`Congo - Kinshasa`,`243`],[`CK`,`Cook Islands`,`682`],[`CR`,`Costa Rica`,`506`],[`CI`,`Côte d’Ivoire`,`225`],[`HR`,`Croatia`,`385`],[`CU`,`Cuba`,`53`],[`CW`,`Curaçao`,`599`],[`CY`,`Cyprus`,`357`],[`CZ`,`Czechia`,`420`],[`DK`,`Denmark`,`45`],[`DJ`,`Djibouti`,`253`],[`DM`,`Dominica`,`1`],[`DO`,`Dominican Republic`,`1`],[`EC`,`Ecuador`,`593`],[`EG`,`Egypt`,`20`],[`SV`,`El Salvador`,`503`],[`GQ`,`Equatorial Guinea`,`240`],[`ER`,`Eritrea`,`291`],[`EE`,`Estonia`,`372`],[`SZ`,`Eswatini`,`268`],[`ET`,`Ethiopia`,`251`],[`FK`,`Falkland Islands`,`500`],[`FO`,`Faroe Islands`,`298`],[`FJ`,`Fiji`,`679`],[`FI`,`Finland`,`358`],[`FR`,`France`,`33`],[`GF`,`French Guiana`,`594`],[`PF`,`French Polynesia`,`689`],[`GA`,`Gabon`,`241`],[`GM`,`Gambia`,`220`],[`GE`,`Georgia`,`995`],[`DE`,`Germany`,`49`],[`GH`,`Ghana`,`233`],[`GI`,`Gibraltar`,`350`],[`GR`,`Greece`,`30`],[`GL`,`Greenland`,`299`],[`GD`,`Grenada`,`1`],[`GP`,`Guadeloupe`,`590`],[`GU`,`Guam`,`1`],[`GT`,`Guatemala`,`502`],[`GG`,`Guernsey`,`44`],[`GN`,`Guinea`,`224`],[`GW`,`Guinea-Bissau`,`245`],[`GY`,`Guyana`,`592`],[`HT`,`Haiti`,`509`],[`HN`,`Honduras`,`504`],[`HK`,`Hong Kong SAR China`,`852`],[`HU`,`Hungary`,`36`],[`IS`,`Iceland`,`354`],[`IN`,`India`,`91`],[`ID`,`Indonesia`,`62`],[`IR`,`Iran`,`98`],[`IQ`,`Iraq`,`964`],[`IE`,`Ireland`,`353`],[`IM`,`Isle of Man`,`44`],[`IL`,`Israel`,`972`],[`IT`,`Italy`,`39`],[`JM`,`Jamaica`,`1`],[`JP`,`Japan`,`81`],[`JE`,`Jersey`,`44`],[`JO`,`Jordan`,`962`],[`KZ`,`Kazakhstan`,`7`],[`KE`,`Kenya`,`254`],[`KI`,`Kiribati`,`686`],[`XK`,`Kosovo`,`383`],[`KW`,`Kuwait`,`965`],[`KG`,`Kyrgyzstan`,`996`],[`LA`,`Laos`,`856`],[`LV`,`Latvia`,`371`],[`LB`,`Lebanon`,`961`],[`LS`,`Lesotho`,`266`],[`LR`,`Liberia`,`231`],[`LY`,`Libya`,`218`],[`LI`,`Liechtenstein`,`423`],[`LT`,`Lithuania`,`370`],[`LU`,`Luxembourg`,`352`],[`MO`,`Macao SAR China`,`853`],[`MG`,`Madagascar`,`261`],[`MW`,`Malawi`,`265`],[`MY`,`Malaysia`,`60`],[`MV`,`Maldives`,`960`],[`ML`,`Mali`,`223`],[`MT`,`Malta`,`356`],[`MH`,`Marshall Islands`,`692`],[`MQ`,`Martinique`,`596`],[`MR`,`Mauritania`,`222`],[`MU`,`Mauritius`,`230`],[`YT`,`Mayotte`,`262`],[`MX`,`Mexico`,`52`],[`FM`,`Micronesia`,`691`],[`MD`,`Moldova`,`373`],[`MC`,`Monaco`,`377`],[`MN`,`Mongolia`,`976`],[`ME`,`Montenegro`,`382`],[`MS`,`Montserrat`,`1`],[`MA`,`Morocco`,`212`],[`MZ`,`Mozambique`,`258`],[`MM`,`Myanmar (Burma)`,`95`],[`NA`,`Namibia`,`264`],[`NR`,`Nauru`,`674`],[`NP`,`Nepal`,`977`],[`NL`,`Netherlands`,`31`],[`NC`,`New Caledonia`,`687`],[`NZ`,`New Zealand`,`64`],[`NI`,`Nicaragua`,`505`],[`NE`,`Niger`,`227`],[`NG`,`Nigeria`,`234`],[`NU`,`Niue`,`683`],[`NF`,`Norfolk Island`,`672`],[`KP`,`North Korea`,`850`],[`MK`,`North Macedonia`,`389`],[`MP`,`Northern Mariana Islands`,`1`],[`NO`,`Norway`,`47`],[`OM`,`Oman`,`968`],[`PK`,`Pakistan`,`92`],[`PW`,`Palau`,`680`],[`PS`,`Palestinian Territories`,`970`],[`PA`,`Panama`,`507`],[`PG`,`Papua New Guinea`,`675`],[`PY`,`Paraguay`,`595`],[`PE`,`Peru`,`51`],[`PH`,`Philippines`,`63`],[`PL`,`Poland`,`48`],[`PT`,`Portugal`,`351`],[`PR`,`Puerto Rico`,`1`],[`QA`,`Qatar`,`974`],[`RE`,`Réunion`,`262`],[`RO`,`Romania`,`40`],[`RU`,`Russia`,`7`],[`RW`,`Rwanda`,`250`],[`WS`,`Samoa`,`685`],[`SM`,`San Marino`,`378`],[`ST`,`São Tomé & Príncipe`,`239`],[`SA`,`Saudi Arabia`,`966`],[`SN`,`Senegal`,`221`],[`RS`,`Serbia`,`381`],[`SC`,`Seychelles`,`248`],[`SL`,`Sierra Leone`,`232`],[`SG`,`Singapore`,`65`],[`SX`,`Sint Maarten`,`1`],[`SK`,`Slovakia`,`421`],[`SI`,`Slovenia`,`386`],[`SB`,`Solomon Islands`,`677`],[`SO`,`Somalia`,`252`],[`ZA`,`South Africa`,`27`],[`KR`,`South Korea`,`82`],[`SS`,`South Sudan`,`211`],[`ES`,`Spain`,`34`],[`LK`,`Sri Lanka`,`94`],[`BL`,`St. Barthélemy`,`590`],[`SH`,`St. Helena`,`290`],[`KN`,`St. Kitts & Nevis`,`1`],[`LC`,`St. Lucia`,`1`],[`MF`,`St. Martin`,`590`],[`PM`,`St. Pierre & Miquelon`,`508`],[`VC`,`St. Vincent & Grenadines`,`1`],[`SD`,`Sudan`,`249`],[`SR`,`Suriname`,`597`],[`SJ`,`Svalbard & Jan Mayen`,`47`],[`SE`,`Sweden`,`46`],[`CH`,`Switzerland`,`41`],[`SY`,`Syria`,`963`],[`TW`,`Taiwan`,`886`],[`TJ`,`Tajikistan`,`992`],[`TZ`,`Tanzania`,`255`],[`TH`,`Thailand`,`66`],[`TL`,`Timor-Leste`,`670`],[`TG`,`Togo`,`228`],[`TK`,`Tokelau`,`690`],[`TO`,`Tonga`,`676`],[`TT`,`Trinidad & Tobago`,`1`],[`TA`,`Tristan da Cunha`,`290`],[`TN`,`Tunisia`,`216`],[`TR`,`Türkiye`,`90`],[`TM`,`Turkmenistan`,`993`],[`TC`,`Turks & Caicos Islands`,`1`],[`TV`,`Tuvalu`,`688`],[`VI`,`U.S. Virgin Islands`,`1`],[`UG`,`Uganda`,`256`],[`UA`,`Ukraine`,`380`],[`AE`,`United Arab Emirates`,`971`],[`GB`,`United Kingdom`,`44`],[`US`,`United States`,`1`],[`UY`,`Uruguay`,`598`],[`UZ`,`Uzbekistan`,`998`],[`VU`,`Vanuatu`,`678`],[`VA`,`Vatican City`,`39`],[`VE`,`Venezuela`,`58`],[`VN`,`Vietnam`,`84`],[`WF`,`Wallis & Futuna`,`681`],[`EH`,`Western Sahara`,`212`],[`YE`,`Yemen`,`967`],[`ZM`,`Zambia`,`260`],[`ZW`,`Zimbabwe`,`263`]],f=e=>(d.find(t=>t[0]===e)||[``,``,``])[2],p={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},m=new Set(d.map(([e])=>e)),h=new Map;for(let[e,t]of Object.entries(p))for(let n of t)h.set(n,e);function g(e){let t=h.get(e);return t&&m.has(t)?t:null}function _(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&m.has(t)?t:null}function v(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return g(e)||_(t)||null}var y=`ui-phone.global.js`;function b(){return window.WeborityPhone?Promise.resolve(window.WeborityPhone):new Promise((e,t)=>{let n=document.querySelector(`script[src*="${y}"]`);if(!n){n=document.createElement(`script`);try{n.src=(0,c.assetUrl)(y)}catch(e){t(e);return}document.head.append(n)}n.addEventListener(`load`,()=>window.WeborityPhone?e(window.WeborityPhone):t(Error(`The phone metadata script did not load.`))),n.addEventListener(`error`,()=>t(Error(`The phone metadata script failed to load.`)))})}var x=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,S=e=>e?`+${f(e)}`:``,C=null,w=null;function T(){return C?Promise.resolve(C):(w||=b().then(e=>(C=e,C)).catch(()=>null),w)}function E(e,t){let n=`+${f(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function D(e,t){if(!C||!t||!e)return t;try{return E(e,new C.AsYouType(e).input(`+${f(e)}${t}`))||t}catch{return t}}function O(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function k(e){if(!C||!e)return null;try{return E(e,C.getExampleNumber(e,C.examples)?.formatInternational())||null}catch{return null}}function A(e){let t=k(e);return t?`For example ${t}`:null}function j(e){if(!C||!e)return null;try{if(!C.isValidPhoneNumber(e))return!1;let t=C.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function M(e){if(!C||!e)return null;try{let t=C.getExampleNumber(e,C.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function N(e,t,n){try{let r=C.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function P(e){if(!C||!e?.trim().startsWith(`+`))return null;try{let t=new C.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}function F(e,t){let n=String(t??``).trim();if(!n.startsWith(`+`))return null;let r=n.replace(/[^0-9]/g,``),i=String(f(e));return{country:e,national:r.startsWith(i)?r.slice(i.length):r}}var I=class extends r.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`locked-country`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=v()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){this._rendered?this._bindGlobal?.():this.render()}attributeChangedCallback(e,t,n){if(e===`value`)this.value=n;else if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n))}else if(e===`aria-describedby`)this._syncDescribedBy();else if(e===`country`){if(this._locked)return;let e=this.value;if(this._country=n||this._defaultCountry,this._suppressCountryRender)return;this.render(),this.value!==e&&(this._emitInput(),this._emitChange())}else this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get _locked(){return(this.getAttribute(`locked-country`)||``).toUpperCase()||null}get value(){return this._national&&this._country?`+${f(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim();this._locked&&(this._country=this._locked);let n=this._locked?null:P(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(f(this._locked||this.getAttribute(`country`)||this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){(0,a.syncFormMirror)(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this._locked||this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||A(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t;let n=this._locked?`<div class="phone-country-adornment"><span class="wui-phone-prefix"><span class="${x(this._country)}" data-flag aria-hidden="true"></span><span class="phone-dial" data-dial>${S(this._country)}</span></span></div>`:`<div class="phone-country-adornment">
1
+ (function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=globalThis.WeborityUiElementsInternal?.version;if(u!==`0.133.0`)throw Error(`[webority-ui] phone expects ui-elements 0.133.0 but the page loaded `+u+`.`);var d=[[`AF`,`Afghanistan`,`93`],[`AX`,`Åland Islands`,`358`],[`AL`,`Albania`,`355`],[`DZ`,`Algeria`,`213`],[`AS`,`American Samoa`,`1`],[`AD`,`Andorra`,`376`],[`AO`,`Angola`,`244`],[`AI`,`Anguilla`,`1`],[`AG`,`Antigua & Barbuda`,`1`],[`AR`,`Argentina`,`54`],[`AM`,`Armenia`,`374`],[`AW`,`Aruba`,`297`],[`AC`,`Ascension Island`,`247`],[`AU`,`Australia`,`61`],[`AT`,`Austria`,`43`],[`AZ`,`Azerbaijan`,`994`],[`BS`,`Bahamas`,`1`],[`BH`,`Bahrain`,`973`],[`BD`,`Bangladesh`,`880`],[`BB`,`Barbados`,`1`],[`BY`,`Belarus`,`375`],[`BE`,`Belgium`,`32`],[`BZ`,`Belize`,`501`],[`BJ`,`Benin`,`229`],[`BM`,`Bermuda`,`1`],[`BT`,`Bhutan`,`975`],[`BO`,`Bolivia`,`591`],[`BA`,`Bosnia & Herzegovina`,`387`],[`BW`,`Botswana`,`267`],[`BR`,`Brazil`,`55`],[`IO`,`British Indian Ocean Territory`,`246`],[`VG`,`British Virgin Islands`,`1`],[`BN`,`Brunei`,`673`],[`BG`,`Bulgaria`,`359`],[`BF`,`Burkina Faso`,`226`],[`BI`,`Burundi`,`257`],[`KH`,`Cambodia`,`855`],[`CM`,`Cameroon`,`237`],[`CA`,`Canada`,`1`],[`CV`,`Cape Verde`,`238`],[`BQ`,`Caribbean Netherlands`,`599`],[`KY`,`Cayman Islands`,`1`],[`CF`,`Central African Republic`,`236`],[`TD`,`Chad`,`235`],[`CL`,`Chile`,`56`],[`CN`,`China`,`86`],[`CX`,`Christmas Island`,`61`],[`CC`,`Cocos (Keeling) Islands`,`61`],[`CO`,`Colombia`,`57`],[`KM`,`Comoros`,`269`],[`CG`,`Congo - Brazzaville`,`242`],[`CD`,`Congo - Kinshasa`,`243`],[`CK`,`Cook Islands`,`682`],[`CR`,`Costa Rica`,`506`],[`CI`,`Côte d’Ivoire`,`225`],[`HR`,`Croatia`,`385`],[`CU`,`Cuba`,`53`],[`CW`,`Curaçao`,`599`],[`CY`,`Cyprus`,`357`],[`CZ`,`Czechia`,`420`],[`DK`,`Denmark`,`45`],[`DJ`,`Djibouti`,`253`],[`DM`,`Dominica`,`1`],[`DO`,`Dominican Republic`,`1`],[`EC`,`Ecuador`,`593`],[`EG`,`Egypt`,`20`],[`SV`,`El Salvador`,`503`],[`GQ`,`Equatorial Guinea`,`240`],[`ER`,`Eritrea`,`291`],[`EE`,`Estonia`,`372`],[`SZ`,`Eswatini`,`268`],[`ET`,`Ethiopia`,`251`],[`FK`,`Falkland Islands`,`500`],[`FO`,`Faroe Islands`,`298`],[`FJ`,`Fiji`,`679`],[`FI`,`Finland`,`358`],[`FR`,`France`,`33`],[`GF`,`French Guiana`,`594`],[`PF`,`French Polynesia`,`689`],[`GA`,`Gabon`,`241`],[`GM`,`Gambia`,`220`],[`GE`,`Georgia`,`995`],[`DE`,`Germany`,`49`],[`GH`,`Ghana`,`233`],[`GI`,`Gibraltar`,`350`],[`GR`,`Greece`,`30`],[`GL`,`Greenland`,`299`],[`GD`,`Grenada`,`1`],[`GP`,`Guadeloupe`,`590`],[`GU`,`Guam`,`1`],[`GT`,`Guatemala`,`502`],[`GG`,`Guernsey`,`44`],[`GN`,`Guinea`,`224`],[`GW`,`Guinea-Bissau`,`245`],[`GY`,`Guyana`,`592`],[`HT`,`Haiti`,`509`],[`HN`,`Honduras`,`504`],[`HK`,`Hong Kong SAR China`,`852`],[`HU`,`Hungary`,`36`],[`IS`,`Iceland`,`354`],[`IN`,`India`,`91`],[`ID`,`Indonesia`,`62`],[`IR`,`Iran`,`98`],[`IQ`,`Iraq`,`964`],[`IE`,`Ireland`,`353`],[`IM`,`Isle of Man`,`44`],[`IL`,`Israel`,`972`],[`IT`,`Italy`,`39`],[`JM`,`Jamaica`,`1`],[`JP`,`Japan`,`81`],[`JE`,`Jersey`,`44`],[`JO`,`Jordan`,`962`],[`KZ`,`Kazakhstan`,`7`],[`KE`,`Kenya`,`254`],[`KI`,`Kiribati`,`686`],[`XK`,`Kosovo`,`383`],[`KW`,`Kuwait`,`965`],[`KG`,`Kyrgyzstan`,`996`],[`LA`,`Laos`,`856`],[`LV`,`Latvia`,`371`],[`LB`,`Lebanon`,`961`],[`LS`,`Lesotho`,`266`],[`LR`,`Liberia`,`231`],[`LY`,`Libya`,`218`],[`LI`,`Liechtenstein`,`423`],[`LT`,`Lithuania`,`370`],[`LU`,`Luxembourg`,`352`],[`MO`,`Macao SAR China`,`853`],[`MG`,`Madagascar`,`261`],[`MW`,`Malawi`,`265`],[`MY`,`Malaysia`,`60`],[`MV`,`Maldives`,`960`],[`ML`,`Mali`,`223`],[`MT`,`Malta`,`356`],[`MH`,`Marshall Islands`,`692`],[`MQ`,`Martinique`,`596`],[`MR`,`Mauritania`,`222`],[`MU`,`Mauritius`,`230`],[`YT`,`Mayotte`,`262`],[`MX`,`Mexico`,`52`],[`FM`,`Micronesia`,`691`],[`MD`,`Moldova`,`373`],[`MC`,`Monaco`,`377`],[`MN`,`Mongolia`,`976`],[`ME`,`Montenegro`,`382`],[`MS`,`Montserrat`,`1`],[`MA`,`Morocco`,`212`],[`MZ`,`Mozambique`,`258`],[`MM`,`Myanmar (Burma)`,`95`],[`NA`,`Namibia`,`264`],[`NR`,`Nauru`,`674`],[`NP`,`Nepal`,`977`],[`NL`,`Netherlands`,`31`],[`NC`,`New Caledonia`,`687`],[`NZ`,`New Zealand`,`64`],[`NI`,`Nicaragua`,`505`],[`NE`,`Niger`,`227`],[`NG`,`Nigeria`,`234`],[`NU`,`Niue`,`683`],[`NF`,`Norfolk Island`,`672`],[`KP`,`North Korea`,`850`],[`MK`,`North Macedonia`,`389`],[`MP`,`Northern Mariana Islands`,`1`],[`NO`,`Norway`,`47`],[`OM`,`Oman`,`968`],[`PK`,`Pakistan`,`92`],[`PW`,`Palau`,`680`],[`PS`,`Palestinian Territories`,`970`],[`PA`,`Panama`,`507`],[`PG`,`Papua New Guinea`,`675`],[`PY`,`Paraguay`,`595`],[`PE`,`Peru`,`51`],[`PH`,`Philippines`,`63`],[`PL`,`Poland`,`48`],[`PT`,`Portugal`,`351`],[`PR`,`Puerto Rico`,`1`],[`QA`,`Qatar`,`974`],[`RE`,`Réunion`,`262`],[`RO`,`Romania`,`40`],[`RU`,`Russia`,`7`],[`RW`,`Rwanda`,`250`],[`WS`,`Samoa`,`685`],[`SM`,`San Marino`,`378`],[`ST`,`São Tomé & Príncipe`,`239`],[`SA`,`Saudi Arabia`,`966`],[`SN`,`Senegal`,`221`],[`RS`,`Serbia`,`381`],[`SC`,`Seychelles`,`248`],[`SL`,`Sierra Leone`,`232`],[`SG`,`Singapore`,`65`],[`SX`,`Sint Maarten`,`1`],[`SK`,`Slovakia`,`421`],[`SI`,`Slovenia`,`386`],[`SB`,`Solomon Islands`,`677`],[`SO`,`Somalia`,`252`],[`ZA`,`South Africa`,`27`],[`KR`,`South Korea`,`82`],[`SS`,`South Sudan`,`211`],[`ES`,`Spain`,`34`],[`LK`,`Sri Lanka`,`94`],[`BL`,`St. Barthélemy`,`590`],[`SH`,`St. Helena`,`290`],[`KN`,`St. Kitts & Nevis`,`1`],[`LC`,`St. Lucia`,`1`],[`MF`,`St. Martin`,`590`],[`PM`,`St. Pierre & Miquelon`,`508`],[`VC`,`St. Vincent & Grenadines`,`1`],[`SD`,`Sudan`,`249`],[`SR`,`Suriname`,`597`],[`SJ`,`Svalbard & Jan Mayen`,`47`],[`SE`,`Sweden`,`46`],[`CH`,`Switzerland`,`41`],[`SY`,`Syria`,`963`],[`TW`,`Taiwan`,`886`],[`TJ`,`Tajikistan`,`992`],[`TZ`,`Tanzania`,`255`],[`TH`,`Thailand`,`66`],[`TL`,`Timor-Leste`,`670`],[`TG`,`Togo`,`228`],[`TK`,`Tokelau`,`690`],[`TO`,`Tonga`,`676`],[`TT`,`Trinidad & Tobago`,`1`],[`TA`,`Tristan da Cunha`,`290`],[`TN`,`Tunisia`,`216`],[`TR`,`Türkiye`,`90`],[`TM`,`Turkmenistan`,`993`],[`TC`,`Turks & Caicos Islands`,`1`],[`TV`,`Tuvalu`,`688`],[`VI`,`U.S. Virgin Islands`,`1`],[`UG`,`Uganda`,`256`],[`UA`,`Ukraine`,`380`],[`AE`,`United Arab Emirates`,`971`],[`GB`,`United Kingdom`,`44`],[`US`,`United States`,`1`],[`UY`,`Uruguay`,`598`],[`UZ`,`Uzbekistan`,`998`],[`VU`,`Vanuatu`,`678`],[`VA`,`Vatican City`,`39`],[`VE`,`Venezuela`,`58`],[`VN`,`Vietnam`,`84`],[`WF`,`Wallis & Futuna`,`681`],[`EH`,`Western Sahara`,`212`],[`YE`,`Yemen`,`967`],[`ZM`,`Zambia`,`260`],[`ZW`,`Zimbabwe`,`263`]],f=e=>(d.find(t=>t[0]===e)||[``,``,``])[2],p={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},m=new Set(d.map(([e])=>e)),h=new Map;for(let[e,t]of Object.entries(p))for(let n of t)h.set(n,e);function g(e){let t=h.get(e);return t&&m.has(t)?t:null}function _(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&m.has(t)?t:null}function v(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return g(e)||_(t)||null}var y=`ui-phone.global.js`;function b(){return window.WeborityPhone?Promise.resolve(window.WeborityPhone):new Promise((e,t)=>{let n=document.querySelector(`script[src*="${y}"]`);if(!n){n=document.createElement(`script`);try{n.src=(0,c.assetUrl)(y)}catch(e){t(e);return}document.head.append(n)}n.addEventListener(`load`,()=>window.WeborityPhone?e(window.WeborityPhone):t(Error(`The phone metadata script did not load.`))),n.addEventListener(`error`,()=>t(Error(`The phone metadata script failed to load.`)))})}var x=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,S=e=>e?`+${f(e)}`:``,C=null,w=null;function T(){return C?Promise.resolve(C):(w||=b().then(e=>(C=e,C)).catch(()=>null),w)}function E(e,t){let n=`+${f(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function D(e,t){if(!C||!t||!e)return t;try{return E(e,new C.AsYouType(e).input(`+${f(e)}${t}`))||t}catch{return t}}function O(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function k(e){if(!C||!e)return null;try{return E(e,C.getExampleNumber(e,C.examples)?.formatInternational())||null}catch{return null}}function A(e){let t=k(e);return t?`For example ${t}`:null}function j(e){if(!C||!e)return null;try{if(!C.isValidPhoneNumber(e))return!1;let t=C.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function M(e){if(!C||!e)return null;try{let t=C.getExampleNumber(e,C.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function N(e,t,n){try{let r=C.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function P(e){if(!C||!e?.trim().startsWith(`+`))return null;try{let t=new C.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}function F(e,t){let n=String(t??``).trim();if(!n.startsWith(`+`))return null;let r=n.replace(/[^0-9]/g,``),i=String(f(e));return{country:e,national:r.startsWith(i)?r.slice(i.length):r}}var I=class extends r.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`locked-country`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=v()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){this._rendered?this._bindGlobal?.():this.render()}attributeChangedCallback(e,t,n){if(e===`value`)this.value=n;else if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n))}else if(e===`aria-describedby`)this._syncDescribedBy();else if(e===`country`){if(this._locked)return;let e=this.value;if(this._country=n||this._defaultCountry,this._suppressCountryRender)return;this.render(),this.value!==e&&(this._emitInput(),this._emitChange())}else this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get _locked(){return(this.getAttribute(`locked-country`)||``).toUpperCase()||null}get value(){return this._national&&this._country?`+${f(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim();this._locked&&(this._country=this._locked);let n=this._locked?null:P(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(f(this._locked||this.getAttribute(`country`)||this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){(0,a.syncFormMirror)(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this._locked||this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||A(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t;let n=this._locked?`<div class="phone-country-adornment"><span class="wui-phone-prefix"><span class="${x(this._country)}" data-flag aria-hidden="true"></span><span class="phone-dial" data-dial>${S(this._country)}</span></span></div>`:`<div class="phone-country-adornment">
2
2
  <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${L(t)}"${this.hasAttribute(`disabled`)?` disabled`:``}>
3
3
  <span class="${x(this._country)}" data-flag aria-hidden="true"></span>
4
4
  ${(0,o.glyphSvg)(`chevron-down`,{className:`phone-chevron`})}
@@ -1 +1 @@
1
- (function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.132.0`)throw Error(`[webority-ui] resizable expects ui-elements 0.132.0 but the page loaded `+r+`.`);var i=`wui-resizable-panel`,a=`wui-resizable-handle`,o=5,s=20,c=10,l=`wui-resizable:`,u=.001,d=0,f=e=>e.reduce((e,t)=>e+t,0),p=(e,t,n)=>Math.min(Math.max(e,t),n),m=e=>Math.round(e*10)/10,h=(e,t)=>e.length===t.length&&e.every((e,n)=>Math.abs(e-t[n])<u);function g(e,t,n){let r=e.map((e,r)=>p(e,t[r],n[r]));for(let e=0;e<r.length;e++){let e=100-f(r);if(Math.abs(e)<u)break;let i=r.map((r,i)=>e>0?n[i]-r:r-t[i]),a=f(i);if(a<=0)break;let o=Math.min(Math.abs(e),a);r=r.map((t,n)=>t+Math.sign(e)*o*i[n]/a)}return r}function _(e,t,n,r){let i=e[t]+e[t+1];return[Math.max(n[t],i-r[t+1]),Math.min(r[t],i-n[t+1])]}function v(e,t,n,r,i){let[a,o]=_(e,t,r,i);if(a>o)return e;let s=e[t]+e[t+1],c=p(e[t]+n,a,o),l=[...e];return l[t]=c,l[t+1]=s-c,l}function y(e){let t=e.filter(e=>e===null).length,n=f(e.filter(e=>e!==null));if(t>0&&n<100)return e.map(e=>e??(100-n)/t);let r=e.map(e=>e??1),i=f(r);return r.map(e=>e*100/i)}var b=(e,t)=>{let n=Number.parseFloat(e.getAttribute(t));return Number.isFinite(n)&&n>0?n:null},x=class extends n.ElementBase{constructor(){super(),this._panels=[],this._handles=[],this._mins=[],this._maxs=[],this._defaults=[],this._sizes=null,this._drag=null,this._observer=null,this._onPointerDown=e=>this._pointerDown(e),this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e,!1),this._onPointerCancel=e=>this._pointerUp(e,!0),this._onKeyDown=e=>this._keyDown(e),this._onDoubleClick=e=>this._reset(e)}connectedCallback(){this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`pointermove`,this._onPointerMove),this.addEventListener(`pointerup`,this._onPointerUp),this.addEventListener(`pointercancel`,this._onPointerCancel),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`dblclick`,this._onDoubleClick),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._sync()),this._observer.observe(this,{childList:!0})),this._sync()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`pointermove`,this._onPointerMove),this.removeEventListener(`pointerup`,this._onPointerUp),this.removeEventListener(`pointercancel`,this._onPointerCancel),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`dblclick`,this._onDoubleClick),this._observer?.disconnect(),this._observer=null,this._drag=null}get sizes(){return this._sizes?[...this._sizes]:[]}get _vertical(){return this.getAttribute(`direction`)===`vertical`}_sync(){let e=[...this.children];this._panels=e.filter(e=>e.classList.contains(i)),this._handles=e.filter(e=>e.classList.contains(a));let t=this._panels.length;if(t===0)return;this._mins=this._panels.map(e=>b(e,`data-min-size`)??c),this._maxs=this._panels.map(e=>b(e,`data-max-size`)??100),this._defaults=g(y(this._panels.map(e=>b(e,`data-default-size`))),this._mins,this._maxs);let n=this._sizes&&this._sizes.length===t?this._sizes:null;this._sizes=g(n??this._load(t)??this._defaults,this._mins,this._maxs);for(let e of this._panels)e.id||=`wui-resizable-panel-${++d}`;this._render()}_render(){this._panels.forEach((e,t)=>{e.style.flex=`${m(this._sizes[t])} 1 0px`});for(let e of this._handles){let t=this._indexOf(e);if(t<0)continue;let[n,r]=_(this._sizes,t,this._mins,this._maxs);e.setAttribute(`aria-controls`,this._panels[t].id),e.setAttribute(`aria-valuenow`,String(Math.round(this._sizes[t]))),e.setAttribute(`aria-valuemin`,String(Math.ceil(n-u))),e.setAttribute(`aria-valuemax`,String(Math.floor(r+u)))}}_indexOf(e){let t=this._panels.indexOf(e.previousElementSibling);return t>=0&&e.nextElementSibling===this._panels[t+1]?t:-1}_handleFor(e){let t=e.target instanceof Element?e.target.closest(`.${a}`):null;if(!t||t.parentElement!==this)return null;let n=this._indexOf(t);return n<0?null:{handle:t,index:n}}_storageKey(){let e=this.getAttribute(`storage-key`);return e?l+e:null}_load(e){let t=this._storageKey();if(!t)return null;try{let n=JSON.parse(globalThis.localStorage?.getItem(t)??`null`);return Array.isArray(n)&&n.length===e&&n.every((e,t)=>Number.isFinite(e)&&e>=this._mins[t]-u&&e<=this._maxs[t]+u)&&Math.abs(f(n)-100)<.5?n:null}catch{return null}}_save(){let e=this._storageKey();if(e)try{globalThis.localStorage?.setItem(e,JSON.stringify(this._sizes.map(m)))}catch{}}_commit(e){h(e,this._sizes)||(this._save(),this.dispatchEvent(new CustomEvent(`wui-resizable:change`,{bubbles:!0,detail:{sizes:this.sizes}})))}_pointerDown(e){let t=this._handleFor(e);if(!t||e.pointerType===`mouse`&&e.button!==0)return;let n=this._panels.reduce((e,t)=>{let n=t.getBoundingClientRect();return e+(this._vertical?n.height:n.width)},0);n<=0||(e.preventDefault(),t.handle.setPointerCapture?.(e.pointerId),t.handle.focus?.({preventScroll:!0}),this._drag={...t,pointerId:e.pointerId,start:this._vertical?e.clientY:e.clientX,before:[...this._sizes],room:n,flip:!this._vertical&&getComputedStyle(this).direction===`rtl`},this.classList.add(`is-dragging`),t.handle.classList.add(`is-active`))}_pointerMove(e){let t=this._drag;if(!t||e.pointerId!==t.pointerId)return;let n=(this._vertical?e.clientY:e.clientX)-t.start,r=(t.flip?-n:n)*100/t.room;this._sizes=v(t.before,t.index,r,this._mins,this._maxs),this._render()}_pointerUp(e,t){let n=this._drag;n&&e.pointerId===n.pointerId&&(this._drag=null,this.classList.remove(`is-dragging`),n.handle.classList.remove(`is-active`),n.handle.releasePointerCapture?.(e.pointerId),t?(this._sizes=n.before,this._render()):this._commit(n.before))}_keyDown(e){let t=this._handleFor(e);if(!t||e.altKey||e.ctrlKey||e.metaKey)return;let[n,r]=this._vertical?[`ArrowUp`,`ArrowDown`]:[`ArrowLeft`,`ArrowRight`],i=!this._vertical&&getComputedStyle(this).direction===`rtl`,a=e.shiftKey?s:o,c;if(e.key===n)c=i?a:-a;else if(e.key===r)c=i?-a:a;else if(e.key===`Home`)c=-1/0;else if(e.key===`End`)c=1/0;else return;e.preventDefault();let l=[...this._sizes];this._sizes=v(l,t.index,c,this._mins,this._maxs),this._render(),this._commit(l)}_reset(e){if(!this._handleFor(e))return;let t=[...this._sizes];this._sizes=[...this._defaults],this._render(),this._commit(t)}};(0,t.defineElement)(`wui-resizable`,x),e.WuiResizable=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase);
1
+ (function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.133.0`)throw Error(`[webority-ui] resizable expects ui-elements 0.133.0 but the page loaded `+r+`.`);var i=`wui-resizable-panel`,a=`wui-resizable-handle`,o=5,s=20,c=10,l=`wui-resizable:`,u=.001,d=0,f=e=>e.reduce((e,t)=>e+t,0),p=(e,t,n)=>Math.min(Math.max(e,t),n),m=e=>Math.round(e*10)/10,h=(e,t)=>e.length===t.length&&e.every((e,n)=>Math.abs(e-t[n])<u);function g(e,t,n){let r=e.map((e,r)=>p(e,t[r],n[r]));for(let e=0;e<r.length;e++){let e=100-f(r);if(Math.abs(e)<u)break;let i=r.map((r,i)=>e>0?n[i]-r:r-t[i]),a=f(i);if(a<=0)break;let o=Math.min(Math.abs(e),a);r=r.map((t,n)=>t+Math.sign(e)*o*i[n]/a)}return r}function _(e,t,n,r){let i=e[t]+e[t+1];return[Math.max(n[t],i-r[t+1]),Math.min(r[t],i-n[t+1])]}function v(e,t,n,r,i){let[a,o]=_(e,t,r,i);if(a>o)return e;let s=e[t]+e[t+1],c=p(e[t]+n,a,o),l=[...e];return l[t]=c,l[t+1]=s-c,l}function y(e){let t=e.filter(e=>e===null).length,n=f(e.filter(e=>e!==null));if(t>0&&n<100)return e.map(e=>e??(100-n)/t);let r=e.map(e=>e??1),i=f(r);return r.map(e=>e*100/i)}var b=(e,t)=>{let n=Number.parseFloat(e.getAttribute(t));return Number.isFinite(n)&&n>0?n:null},x=class extends n.ElementBase{constructor(){super(),this._panels=[],this._handles=[],this._mins=[],this._maxs=[],this._defaults=[],this._sizes=null,this._drag=null,this._observer=null,this._onPointerDown=e=>this._pointerDown(e),this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e,!1),this._onPointerCancel=e=>this._pointerUp(e,!0),this._onKeyDown=e=>this._keyDown(e),this._onDoubleClick=e=>this._reset(e)}connectedCallback(){this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`pointermove`,this._onPointerMove),this.addEventListener(`pointerup`,this._onPointerUp),this.addEventListener(`pointercancel`,this._onPointerCancel),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`dblclick`,this._onDoubleClick),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(()=>this._sync()),this._observer.observe(this,{childList:!0})),this._sync()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`pointermove`,this._onPointerMove),this.removeEventListener(`pointerup`,this._onPointerUp),this.removeEventListener(`pointercancel`,this._onPointerCancel),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`dblclick`,this._onDoubleClick),this._observer?.disconnect(),this._observer=null,this._drag=null}get sizes(){return this._sizes?[...this._sizes]:[]}get _vertical(){return this.getAttribute(`direction`)===`vertical`}_sync(){let e=[...this.children];this._panels=e.filter(e=>e.classList.contains(i)),this._handles=e.filter(e=>e.classList.contains(a));let t=this._panels.length;if(t===0)return;this._mins=this._panels.map(e=>b(e,`data-min-size`)??c),this._maxs=this._panels.map(e=>b(e,`data-max-size`)??100),this._defaults=g(y(this._panels.map(e=>b(e,`data-default-size`))),this._mins,this._maxs);let n=this._sizes&&this._sizes.length===t?this._sizes:null;this._sizes=g(n??this._load(t)??this._defaults,this._mins,this._maxs);for(let e of this._panels)e.id||=`wui-resizable-panel-${++d}`;this._render()}_render(){this._panels.forEach((e,t)=>{e.style.flex=`${m(this._sizes[t])} 1 0px`});for(let e of this._handles){let t=this._indexOf(e);if(t<0)continue;let[n,r]=_(this._sizes,t,this._mins,this._maxs);e.setAttribute(`aria-controls`,this._panels[t].id),e.setAttribute(`aria-valuenow`,String(Math.round(this._sizes[t]))),e.setAttribute(`aria-valuemin`,String(Math.ceil(n-u))),e.setAttribute(`aria-valuemax`,String(Math.floor(r+u)))}}_indexOf(e){let t=this._panels.indexOf(e.previousElementSibling);return t>=0&&e.nextElementSibling===this._panels[t+1]?t:-1}_handleFor(e){let t=e.target instanceof Element?e.target.closest(`.${a}`):null;if(!t||t.parentElement!==this)return null;let n=this._indexOf(t);return n<0?null:{handle:t,index:n}}_storageKey(){let e=this.getAttribute(`storage-key`);return e?l+e:null}_load(e){let t=this._storageKey();if(!t)return null;try{let n=JSON.parse(globalThis.localStorage?.getItem(t)??`null`);return Array.isArray(n)&&n.length===e&&n.every((e,t)=>Number.isFinite(e)&&e>=this._mins[t]-u&&e<=this._maxs[t]+u)&&Math.abs(f(n)-100)<.5?n:null}catch{return null}}_save(){let e=this._storageKey();if(e)try{globalThis.localStorage?.setItem(e,JSON.stringify(this._sizes.map(m)))}catch{}}_commit(e){h(e,this._sizes)||(this._save(),this.dispatchEvent(new CustomEvent(`wui-resizable:change`,{bubbles:!0,detail:{sizes:this.sizes}})))}_pointerDown(e){let t=this._handleFor(e);if(!t||e.pointerType===`mouse`&&e.button!==0)return;let n=this._panels.reduce((e,t)=>{let n=t.getBoundingClientRect();return e+(this._vertical?n.height:n.width)},0);n<=0||(e.preventDefault(),t.handle.setPointerCapture?.(e.pointerId),t.handle.focus?.({preventScroll:!0}),this._drag={...t,pointerId:e.pointerId,start:this._vertical?e.clientY:e.clientX,before:[...this._sizes],room:n,flip:!this._vertical&&getComputedStyle(this).direction===`rtl`},this.classList.add(`is-dragging`),t.handle.classList.add(`is-active`))}_pointerMove(e){let t=this._drag;if(!t||e.pointerId!==t.pointerId)return;let n=(this._vertical?e.clientY:e.clientX)-t.start,r=(t.flip?-n:n)*100/t.room;this._sizes=v(t.before,t.index,r,this._mins,this._maxs),this._render()}_pointerUp(e,t){let n=this._drag;n&&e.pointerId===n.pointerId&&(this._drag=null,this.classList.remove(`is-dragging`),n.handle.classList.remove(`is-active`),n.handle.releasePointerCapture?.(e.pointerId),t?(this._sizes=n.before,this._render()):this._commit(n.before))}_keyDown(e){let t=this._handleFor(e);if(!t||e.altKey||e.ctrlKey||e.metaKey)return;let[n,r]=this._vertical?[`ArrowUp`,`ArrowDown`]:[`ArrowLeft`,`ArrowRight`],i=!this._vertical&&getComputedStyle(this).direction===`rtl`,a=e.shiftKey?s:o,c;if(e.key===n)c=i?a:-a;else if(e.key===r)c=i?-a:a;else if(e.key===`Home`)c=-1/0;else if(e.key===`End`)c=1/0;else return;e.preventDefault();let l=[...this._sizes];this._sizes=v(l,t.index,c,this._mins,this._maxs),this._render(),this._commit(l)}_reset(e){if(!this._handleFor(e))return;let t=[...this._sizes];this._sizes=[...this._defaults],this._render(),this._commit(t)}};(0,t.defineElement)(`wui-resizable`,x),e.WuiResizable=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase);
@@ -1 +1 @@
1
- (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.132.0`)throw Error(`[webority-ui] saved-views expects ui-elements 0.132.0 but the page loaded `+a+`.`);var o=`wui-saved-views:`,s=20,c=e=>typeof e?.name==`string`&&typeof e?.query==`string`,l=class extends r.ElementBase{static get observedAttributes(){return[`key`,`mode`,`action`]}constructor(){super(),this._doc=null,this._views=[],this._open=!1,this._busy=!1,this._error=null,this._trigger=null,this._menu=null,this._divider=null,this._form=null,this._input=null,this._save=null,this._onTriggerClick=()=>this._setOpen(!this._open),this._onKeyDown=e=>{this._open&&this.contains(e.target)&&(e.key===`Escape`?(e.stopPropagation(),this._setOpen(!1),this._trigger.focus()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&this._menu.contains(e.target)&&!/input|textarea/i.test(e.target.tagName)&&(e.preventDefault(),e.stopPropagation()))},this._onPointerDown=e=>{this._open&&!this.contains(e.target)&&this._setOpen(!1)},this._onSubmit=async e=>{e.preventDefault();let t=this._input.value.trim();if(!t)return;if(this._server()){if(this._busy)return;await this._request(`save`,{name:t,query:this._doc.location.search})&&(this._input.value=``);return}let n=this._doc.location.search;this._commit([{name:t,query:n},...this._views.filter(e=>e.name!==t)].slice(0,s)),this._input.value=``}}connectedCallback(){this._doc=this.ownerDocument,this._trigger||this._build(),window.addEventListener(`keydown`,this._onKeyDown,!0),this._reload()}disconnectedCallback(){this._setOpen(!1),window.removeEventListener(`keydown`,this._onKeyDown,!0),this._doc=null}attributeChangedCallback(){this._doc&&this._trigger&&this._reload()}_reload(){this._server()?(this._views=[],this._render(),this._request(`list`)):(this._views=this._load(),this._render())}_server(){return this.getAttribute(`mode`)===`server`&&!!this.getAttribute(`action`)&&!!this.getAttribute(`key`)}async _request(e,t={}){let n=this.getAttribute(`action`),r=this.getAttribute(`key`),a=n,o;e===`list`?a+=(n.includes(`?`)?`&`:`?`)+new URLSearchParams({intent:`list`,key:r}):o={method:`POST`,body:new URLSearchParams({intent:e,key:r,...t})},this._busy=!0,this._render();let l=await(0,i.wuiFetch)(a,o);if(this._busy=!1,this._doc===null)return!1;if(l.ok){let e=new DOMParser().parseFromString(l.html,`text/html`);return this._views=[...e.querySelectorAll(`[data-wui-saved-views-items] > li`)].map(e=>({name:e.dataset.name,query:e.dataset.query})).filter(c).slice(0,s),this._error=null,this._render(),!0}return this._error=l.message||`The views could not be updated. Try again.`,this._render(),!1}_build(){let e=this._doc;this.classList.add(`dropdown`),this._trigger=e.createElement(`button`),this._trigger.type=`button`,this._trigger.className=(0,n.buttonClass)(`outline-secondary`,`sm`),this._trigger.dataset.wui=n.APP_BUTTON_MARKER,this._trigger.textContent=`Views`,this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,`false`),this._trigger.addEventListener(`click`,this._onTriggerClick),this._menu=e.createElement(`div`),this._menu.className=`dropdown-menu`,this._divider=e.createElement(`div`),this._divider.className=`dropdown-divider`,this._input=e.createElement(`input`),this._input.type=`text`,this._input.className=`form-control form-control-sm`,this._input.setAttribute(`aria-label`,`View name`),this._input.placeholder=`Name this view`;let t=e.createElement(`button`);t.type=`submit`,t.className=(0,n.buttonClass)(`primary`,`sm`),t.dataset.wui=n.APP_BUTTON_MARKER,t.textContent=`Save this view`,this._save=t,this._form=e.createElement(`form`),this._form.className=`d-flex gap-2 px-3 py-2`,this._form.append(this._input,t),this._form.addEventListener(`submit`,this._onSubmit),this.append(this._trigger,this._menu)}_render(){let e=this._doc,t=[];for(let n of this._views){let r=e.createElement(`a`);r.className=`dropdown-item`,r.setAttribute(`href`,e.location.pathname+n.query),r.textContent=n.name;let i=e.createElement(`button`);i.type=`button`,i.className=`btn btn-link btn-sm`,i.textContent=`Delete`,i.setAttribute(`aria-label`,`Delete ${n.name}`),i.disabled=this._busy,i.addEventListener(`click`,()=>this._server()?this._request(`delete`,{name:n.name}):this._commit(this._views.filter(e=>e.name!==n.name))),t.push(r,i)}if(this._error){let n=e.createElement(`div`);n.className=`dropdown-item-text text-danger small`,n.setAttribute(`role`,`alert`),n.textContent=this._error,t.push(n)}this._save.disabled=this._busy,this._menu.replaceChildren(...t,this._divider,this._form)}_commit(e){this._views=e,this._write(e),this._render()}_setOpen(e){e!==this._open&&(this._open=e,this._menu.classList.toggle(`show`,e),this._trigger.setAttribute(`aria-expanded`,String(e)),e?this._doc.addEventListener(`pointerdown`,this._onPointerDown,!0):this._doc.removeEventListener(`pointerdown`,this._onPointerDown,!0))}_storage(){let e=this.getAttribute(`key`);if(!e)return null;try{return{store:this._doc.defaultView.localStorage,key:o+e}}catch{return null}}_load(){let e=this._storage();if(!e)return[];try{let t=JSON.parse(e.store.getItem(e.key)??`[]`);return Array.isArray(t)?t.filter(c).slice(0,s):[]}catch{return[]}}_write(e){let t=this._storage();if(t)try{t.store.setItem(t.key,JSON.stringify(e))}catch{}}};(0,t.defineElement)(`wui-saved-views`,l),e.WuiSavedViews=l})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.wuiHttp);
1
+ (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.133.0`)throw Error(`[webority-ui] saved-views expects ui-elements 0.133.0 but the page loaded `+a+`.`);var o=`wui-saved-views:`,s=20,c=e=>typeof e?.name==`string`&&typeof e?.query==`string`,l=class extends r.ElementBase{static get observedAttributes(){return[`key`,`mode`,`action`]}constructor(){super(),this._doc=null,this._views=[],this._open=!1,this._busy=!1,this._error=null,this._trigger=null,this._menu=null,this._divider=null,this._form=null,this._input=null,this._save=null,this._onTriggerClick=()=>this._setOpen(!this._open),this._onKeyDown=e=>{this._open&&this.contains(e.target)&&(e.key===`Escape`?(e.stopPropagation(),this._setOpen(!1),this._trigger.focus()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&this._menu.contains(e.target)&&!/input|textarea/i.test(e.target.tagName)&&(e.preventDefault(),e.stopPropagation()))},this._onPointerDown=e=>{this._open&&!this.contains(e.target)&&this._setOpen(!1)},this._onSubmit=async e=>{e.preventDefault();let t=this._input.value.trim();if(!t)return;if(this._server()){if(this._busy)return;await this._request(`save`,{name:t,query:this._doc.location.search})&&(this._input.value=``);return}let n=this._doc.location.search;this._commit([{name:t,query:n},...this._views.filter(e=>e.name!==t)].slice(0,s)),this._input.value=``}}connectedCallback(){this._doc=this.ownerDocument,this._trigger||this._build(),window.addEventListener(`keydown`,this._onKeyDown,!0),this._reload()}disconnectedCallback(){this._setOpen(!1),window.removeEventListener(`keydown`,this._onKeyDown,!0),this._doc=null}attributeChangedCallback(){this._doc&&this._trigger&&this._reload()}_reload(){this._server()?(this._views=[],this._render(),this._request(`list`)):(this._views=this._load(),this._render())}_server(){return this.getAttribute(`mode`)===`server`&&!!this.getAttribute(`action`)&&!!this.getAttribute(`key`)}async _request(e,t={}){let n=this.getAttribute(`action`),r=this.getAttribute(`key`),a=n,o;e===`list`?a+=(n.includes(`?`)?`&`:`?`)+new URLSearchParams({intent:`list`,key:r}):o={method:`POST`,body:new URLSearchParams({intent:e,key:r,...t})},this._busy=!0,this._render();let l=await(0,i.wuiFetch)(a,o);if(this._busy=!1,this._doc===null)return!1;if(l.ok){let e=new DOMParser().parseFromString(l.html,`text/html`);return this._views=[...e.querySelectorAll(`[data-wui-saved-views-items] > li`)].map(e=>({name:e.dataset.name,query:e.dataset.query})).filter(c).slice(0,s),this._error=null,this._render(),!0}return this._error=l.message||`The views could not be updated. Try again.`,this._render(),!1}_build(){let e=this._doc;this.classList.add(`dropdown`),this._trigger=e.createElement(`button`),this._trigger.type=`button`,this._trigger.className=(0,n.buttonClass)(`outline-secondary`,`sm`),this._trigger.dataset.wui=n.APP_BUTTON_MARKER,this._trigger.textContent=`Views`,this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,`false`),this._trigger.addEventListener(`click`,this._onTriggerClick),this._menu=e.createElement(`div`),this._menu.className=`dropdown-menu`,this._divider=e.createElement(`div`),this._divider.className=`dropdown-divider`,this._input=e.createElement(`input`),this._input.type=`text`,this._input.className=`form-control form-control-sm`,this._input.setAttribute(`aria-label`,`View name`),this._input.placeholder=`Name this view`;let t=e.createElement(`button`);t.type=`submit`,t.className=(0,n.buttonClass)(`primary`,`sm`),t.dataset.wui=n.APP_BUTTON_MARKER,t.textContent=`Save this view`,this._save=t,this._form=e.createElement(`form`),this._form.className=`d-flex gap-2 px-3 py-2`,this._form.append(this._input,t),this._form.addEventListener(`submit`,this._onSubmit),this.append(this._trigger,this._menu)}_render(){let e=this._doc,t=[];for(let n of this._views){let r=e.createElement(`a`);r.className=`dropdown-item`,r.setAttribute(`href`,e.location.pathname+n.query),r.textContent=n.name;let i=e.createElement(`button`);i.type=`button`,i.className=`btn btn-link btn-sm`,i.textContent=`Delete`,i.setAttribute(`aria-label`,`Delete ${n.name}`),i.disabled=this._busy,i.addEventListener(`click`,()=>this._server()?this._request(`delete`,{name:n.name}):this._commit(this._views.filter(e=>e.name!==n.name))),t.push(r,i)}if(this._error){let n=e.createElement(`div`);n.className=`dropdown-item-text text-danger small`,n.setAttribute(`role`,`alert`),n.textContent=this._error,t.push(n)}this._save.disabled=this._busy,this._menu.replaceChildren(...t,this._divider,this._form)}_commit(e){this._views=e,this._write(e),this._render()}_setOpen(e){e!==this._open&&(this._open=e,this._menu.classList.toggle(`show`,e),this._trigger.setAttribute(`aria-expanded`,String(e)),e?this._doc.addEventListener(`pointerdown`,this._onPointerDown,!0):this._doc.removeEventListener(`pointerdown`,this._onPointerDown,!0))}_storage(){let e=this.getAttribute(`key`);if(!e)return null;try{return{store:this._doc.defaultView.localStorage,key:o+e}}catch{return null}}_load(){let e=this._storage();if(!e)return[];try{let t=JSON.parse(e.store.getItem(e.key)??`[]`);return Array.isArray(t)?t.filter(c).slice(0,s):[]}catch{return[]}}_write(e){let t=this._storage();if(t)try{t.store.setItem(t.key,JSON.stringify(e))}catch{}}};(0,t.defineElement)(`wui-saved-views`,l),e.WuiSavedViews=l})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.buttonClass,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.wuiHttp);
@@ -1,4 +1,4 @@
1
- (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.132.0`)throw Error(`[webority-ui] slider expects ui-elements 0.132.0 but the page loaded `+a+`.`);var o=class extends n.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`min`,`max`,`step`,`value`,`start`,`end`,`name`,`start-name`,`end-name`,`disabled`,`readonly`,`loading`,`size`,`show-value`,`unit`,`aria-label`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=50,this._start=25,this._end=75,this._isDragging=!1,this._dragThumb=null,this._pointerDownListener=null,this._pointerMoveListener=null,this._pointerUpListener=null,this._thumbKeyListener=null,this._trackClickListener=null}connectedCallback(){this._rendered?this._wire():this.render()}get value(){return this._value}set value(e){this._value=this._snapToStep(this._clamp(s(e,this._value))),this._syncValue(),this._syncMirrors()}get start(){return this._start}set start(e){this._start=Math.min(this._snapToStep(this._clamp(s(e,this._start))),this._end),this._syncValue(),this._syncMirrors()}get end(){return this._end}set end(e){this._end=Math.max(this._snapToStep(this._clamp(s(e,this._end))),this._start),this._syncValue(),this._syncMirrors()}attributeChangedCallback(e,t,n){e===`value`||e===`start`||e===`end`||e===`min`||e===`max`||e===`step`?(this._updateFromAttribute(e),this._rendered&&(this._syncValue(),this._syncMirrors())):this._rendered&&this.render()}formResetCallback(){this._isRange()?this._resetRange():this._resetSingle()}_updateFromAttribute(e){e===`value`?this._value=this._snapToStep(this._clamp(s(this.getAttribute(`value`),this._value))):e===`start`?this._start=this._snapToStep(this._clamp(s(this.getAttribute(`start`),this._start))):e===`end`&&(this._end=this._snapToStep(this._clamp(s(this.getAttribute(`end`),this._end))))}_isRange(){return this.hasAttribute(`range`)}_min(){return s(this.getAttribute(`min`),0)}_max(){return s(this.getAttribute(`max`),100)}_step(){return s(this.getAttribute(`step`),1)}_clamp(e){return Math.max(this._min(),Math.min(e,this._max()))}_snapToStep(e){let t=this._step();if(t<=0)return e;let n=this._min();return this._clamp(n+Math.round((e-n)/t)*t)}_captureDefaults(){this._defaultsCaptured||=(this._isRange()?(this._defaultStart=this._start,this._defaultEnd=this._end):this._defaultValue=this._value,!0)}_resetSingle(){this._value=this._defaultValue??50,this._syncValue(),this._syncMirrors()}_resetRange(){this._start=this._defaultStart??25,this._end=this._defaultEnd??75,this._syncValue(),this._syncMirrors()}render(){this._captureDefaults();let e=this._min(),t=this._max(),n=this._isRange(),i=this.getAttribute(`size`),a=i===`sm`?` slider-sm`:i===`lg`?` slider-lg`:``,o=this.hasAttribute(`disabled`),s=this.hasAttribute(`readonly`)?` aria-readonly="true"`:``;n?(this._start=this._clamp(this._start),this._end=this._clamp(this._end),this._start>this._end&&([this._start,this._end]=[this._end,this._start])):this._value=this._clamp(this._value),this.innerHTML=`
1
+ (function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.133.0`)throw Error(`[webority-ui] slider expects ui-elements 0.133.0 but the page loaded `+a+`.`);var o=class extends n.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`min`,`max`,`step`,`value`,`start`,`end`,`name`,`start-name`,`end-name`,`disabled`,`readonly`,`loading`,`size`,`show-value`,`unit`,`aria-label`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=50,this._start=25,this._end=75,this._isDragging=!1,this._dragThumb=null,this._pointerDownListener=null,this._pointerMoveListener=null,this._pointerUpListener=null,this._thumbKeyListener=null,this._trackClickListener=null}connectedCallback(){this._rendered?this._wire():this.render()}get value(){return this._value}set value(e){this._value=this._snapToStep(this._clamp(s(e,this._value))),this._syncValue(),this._syncMirrors()}get start(){return this._start}set start(e){this._start=Math.min(this._snapToStep(this._clamp(s(e,this._start))),this._end),this._syncValue(),this._syncMirrors()}get end(){return this._end}set end(e){this._end=Math.max(this._snapToStep(this._clamp(s(e,this._end))),this._start),this._syncValue(),this._syncMirrors()}attributeChangedCallback(e,t,n){e===`value`||e===`start`||e===`end`||e===`min`||e===`max`||e===`step`?(this._updateFromAttribute(e),this._rendered&&(this._syncValue(),this._syncMirrors())):this._rendered&&this.render()}formResetCallback(){this._isRange()?this._resetRange():this._resetSingle()}_updateFromAttribute(e){e===`value`?this._value=this._snapToStep(this._clamp(s(this.getAttribute(`value`),this._value))):e===`start`?this._start=this._snapToStep(this._clamp(s(this.getAttribute(`start`),this._start))):e===`end`&&(this._end=this._snapToStep(this._clamp(s(this.getAttribute(`end`),this._end))))}_isRange(){return this.hasAttribute(`range`)}_min(){return s(this.getAttribute(`min`),0)}_max(){return s(this.getAttribute(`max`),100)}_step(){return s(this.getAttribute(`step`),1)}_clamp(e){return Math.max(this._min(),Math.min(e,this._max()))}_snapToStep(e){let t=this._step();if(t<=0)return e;let n=this._min();return this._clamp(n+Math.round((e-n)/t)*t)}_captureDefaults(){this._defaultsCaptured||=(this._isRange()?(this._defaultStart=this._start,this._defaultEnd=this._end):this._defaultValue=this._value,!0)}_resetSingle(){this._value=this._defaultValue??50,this._syncValue(),this._syncMirrors()}_resetRange(){this._start=this._defaultStart??25,this._end=this._defaultEnd??75,this._syncValue(),this._syncMirrors()}render(){this._captureDefaults();let e=this._min(),t=this._max(),n=this._isRange(),i=this.getAttribute(`size`),a=i===`sm`?` slider-sm`:i===`lg`?` slider-lg`:``,o=this.hasAttribute(`disabled`),s=this.hasAttribute(`readonly`)?` aria-readonly="true"`:``;n?(this._start=this._clamp(this._start),this._end=this._clamp(this._end),this._start>this._end&&([this._start,this._end]=[this._end,this._start])):this._value=this._clamp(this._value),this.innerHTML=`
2
2
  <div class="slider${a}">
3
3
  <div class="wui-slider-rail">
4
4
  <div class="slider-track" role="presentation"></div>
@@ -1 +1 @@
1
- (function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.132.0`)throw Error(`[webority-ui] sortable expects ui-elements 0.132.0 but the page loaded `+i+`.`);var a=new Set,o=`.wui-sortable-handle`,s=`a[href],button,input,select,textarea,label,summary,[contenteditable='true'],[role='button'],[role='link']`,c=4,l=8,u=250,d=48,f=18,p=class extends n.ElementBase{static get observedAttributes(){return[`name`,`disabled`]}constructor(){super(),this._drag=null,this._kb=null,this._moving=!1,this.controlled=!1,this._observer=null,this._onPointerDown=this._onPointerDown.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onDragStart=e=>e.preventDefault(),this._onDocMove=this._onDocMove.bind(this),this._onDocUp=this._onDocUp.bind(this),this._onDocCancel=this._onDocCancel.bind(this),this._onDocKey=this._onDocKey.bind(this),this._onDocTouchMove=e=>{this._drag?.started&&e.preventDefault()},this._onSelectStart=e=>e.preventDefault(),this._scrollTick=this._scrollTick.bind(this)}connectedCallback(){a.add(this),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`dragstart`,this._onDragStart),this._observer=new MutationObserver(()=>this._syncMirrors()),this._observer.observe(this,{childList:!0}),this._syncMirrors()}disconnectedCallback(){a.delete(this),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`dragstart`,this._onDragStart),this._observer?.disconnect(),this._observer=null,this._abort()}attributeChangedCallback(e){e===`disabled`&&this._abort(),this.isConnected&&this._syncMirrors()}get order(){return this._items().map(e=>e.getAttribute(`data-id`))}set order(e){if(this._drag?.started||this._kb)return;let t=this._items(),n=new Map(t.map(e=>[e.getAttribute(`data-id`),e])),r=[];for(let t of e??[]){let e=n.get(String(t));e&&!r.includes(e)&&r.push(e)}[...r,...t.filter(e=>!r.includes(e))].forEach((e,t)=>{let n=this._items()[t];n!==e&&this.insertBefore(e,n)}),this._syncMirrors()}_items(){return[...this.querySelectorAll(`:scope > [data-id]`)]}_itemFrom(e){let t=e;for(;t&&t.parentElement!==this;)t=t.parentElement;return t?.hasAttribute(`data-id`)?t:null}_itemDisabled(e){return e.hasAttribute(`data-disabled`)}_horizontal(){return this.getAttribute(`orientation`)===`horizontal`}_syncMirrors(){(0,r.syncFormMirrors)(this,this.order)}_insertAt(e,t){let n=this._items();if(n.indexOf(e)===t)return;let r=n.filter(t=>t!==e),i=r[t]??null;i?this.insertBefore(e,i):r.length>0?r[r.length-1].after(e):this.appendChild(e)}_indexFor(e,t,n){let r=this._items().filter(t=>t!==e),i=this._horizontal();for(let e=0;e<r.length;e++){let a=r[e].getBoundingClientRect();if(i?n<a.top||n<=a.bottom&&t<a.left+a.width/2:n<a.top+a.height/2)return e}return r.length}_peers(){let e=this.getAttribute(`group`);return[...a].filter(t=>t===this||e&&t.getAttribute(`group`)===e&&!t.hasAttribute(`disabled`))}_labelOf(e){return e.getAttribute(`data-label`)||e.textContent.replace(/\s+/g,` `).trim()||e.getAttribute(`data-id`)}_announce(e){let t=this.querySelector(`:scope > .wui-sortable-live`);t||(t=document.createElement(`div`),t.className=`wui-sortable-live`,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-atomic`,`true`),this.appendChild(t)),t.textContent=e}_position(e){let t=this._items();return`position ${t.indexOf(e)+1} of ${t.length}`}_onPointerDown(e){if(this._drag||this._kb||this.hasAttribute(`disabled`)||e.pointerType===`mouse`&&e.button!==0)return;let t=this._itemFrom(e.target);if(!t||this._itemDisabled(t))return;let n=t.querySelector(`:scope > ${o}`),r=!!n&&n.contains(e.target);if(this.hasAttribute(`handle`)&&!r)return;if(!r){let n=e.target.closest?.(s);if(n&&n!==t&&t.contains(n))return}let i=e.pointerType===`touch`&&!r,a={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,x:e.clientX,y:e.clientY,slop:e.pointerType===`touch`?l:c,ready:!i,started:!1,timer:null,raf:0,list:this,ghost:null};this._drag=a,i&&(a.timer=setTimeout(()=>{a.timer=null,a.ready=!0,this._begin()},u)),document.addEventListener(`pointermove`,this._onDocMove),document.addEventListener(`pointerup`,this._onDocUp),document.addEventListener(`pointercancel`,this._onDocCancel),document.addEventListener(`keydown`,this._onDocKey,!0),document.addEventListener(`touchmove`,this._onDocTouchMove,{passive:!1})}_onDocMove(e){let t=this._drag;if(t&&e.pointerId===t.pointerId){if(t.x=e.clientX,t.y=e.clientY,!t.started){let e=Math.hypot(t.x-t.startX,t.y-t.startY);if(!t.ready){e>t.slop&&this._finish(!0);return}if(e<t.slop||(this._begin(),!this._drag?.started))return}e.preventDefault?.(),this._moveGhost(),this._update()}}_onDocUp(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!1)}_onDocCancel(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!0)}_onDocKey(e){e.key===`Escape`&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._finish(!0))}_begin(){let e=this._drag;if(!e||e.started)return;e.started=!0;let t=e.item.getBoundingClientRect();e.offsetX=e.startX-t.left,e.offsetY=e.startY-t.top,e.fromIndex=this._items().indexOf(e.item);let n=e.item.cloneNode(!0);for(let e of[n,...n.querySelectorAll(`[id],[data-id]`)])e.removeAttribute(`id`),e.removeAttribute(`data-id`);n.classList.add(`wui-sortable-ghost`),n.setAttribute(`aria-hidden`,`true`),n.inert=!0,n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,e.ghost=n,e.item.classList.add(`wui-sortable-dragging`),document.body.appendChild(n),document.documentElement.classList.add(`wui-sortable-active`),document.addEventListener(`selectstart`,this._onSelectStart),this._moveGhost(),e.raf=requestAnimationFrame(this._scrollTick),this._emit(this,`wui-sortable:start`,{id:e.item.getAttribute(`data-id`)})}_moveGhost(){let e=this._drag;e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.offsetX}px, ${e.y-e.offsetY}px)`)}_update(){let e=this._drag;if(!e?.started)return;let t=e.list;for(let n of this._peers()){let r=n.getBoundingClientRect();if(e.x>=r.left&&e.x<=r.right&&e.y>=r.top&&e.y<=r.bottom){t=n;break}}let n=t._indexFor(e.item,e.x,e.y);(t!==e.list||n!==t._items().indexOf(e.item))&&t._insertAt(e.item,n),e.list=t}_scrollTick(){let e=this._drag;if(!e?.started)return;let t=h(e.list),n=t?t.getBoundingClientRect():null,r=Math.max(n?.top??0,0),i=Math.min(n?.bottom??window.innerHeight,window.innerHeight),a=Math.max(n?.left??0,0),o=Math.min(n?.right??window.innerWidth,window.innerWidth),s=m(e.y,r,i),c=m(e.x,a,o);(c||s)&&(t?(t.scrollTop+=s,t.scrollLeft+=c):window.scrollBy(c,s),this._update()),e.raf=requestAnimationFrame(this._scrollTick)}_finish(e){let t=this._drag;if(!t||(this._drag=null,clearTimeout(t.timer),cancelAnimationFrame(t.raf),document.removeEventListener(`pointermove`,this._onDocMove),document.removeEventListener(`pointerup`,this._onDocUp),document.removeEventListener(`pointercancel`,this._onDocCancel),document.removeEventListener(`keydown`,this._onDocKey,!0),document.removeEventListener(`touchmove`,this._onDocTouchMove),document.removeEventListener(`selectstart`,this._onSelectStart),!t.started))return;t.ghost?.remove(),document.documentElement.classList.remove(`wui-sortable-active`),t.item.classList.remove(`wui-sortable-dragging`);let n=t.item.getAttribute(`data-id`);e?(this._insertAt(t.item,t.fromIndex),this._syncMirrors(),t.list!==this&&t.list._syncMirrors()):this._settle(t.item,this,t.fromIndex,t.list),this._emit(this,`wui-sortable:end`,{id:n,cancelled:e})}_settle(e,t,n,r){let i=r._items().indexOf(e);if(r===t&&i===n)return;let a=e.getAttribute(`data-id`),o=r.order,s=r!==t,c=t.order;s&&(t.controlled||r.controlled)&&t._insertAt(e,n),t._syncMirrors(),r._syncMirrors();let l=r._labelOf(e),u=s&&r.getAttribute(`aria-label`)?` to ${r.getAttribute(`aria-label`)}`:``,d={id:a,fromIndex:n,toIndex:i,from:t,to:r};s&&this._emit(t,`wui-sortable:change`,{...d,ids:c}),this._emit(r,`wui-sortable:change`,{...d,ids:o}),r._announce(`${l} moved${u}, position ${i+1} of ${o.length}.`)}_emit(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}_abort(){this._drag&&this._finish(!0),this._kb&&this._dropKeyboard(!0)}_onKeyDown(e){if(this.hasAttribute(`disabled`))return;let t=e.target.closest?.(o),n=t&&t.parentElement?.parentElement===this?t.parentElement:null;if(!n||this._itemDisabled(n)||this._drag)return;let r=e.key;if(!this._kb){if(r!==` `&&r!==`Enter`)return;e.preventDefault(),this._liftKeyboard(n,t)}else if(this._kb.item===n){if(r===` `||r===`Enter`)e.preventDefault(),this._dropKeyboard(!1);else if(r===`Escape`)e.preventDefault(),e.stopPropagation(),this._dropKeyboard(!0);else if([`ArrowUp`,`ArrowLeft`,`ArrowDown`,`ArrowRight`,`Home`,`End`].includes(r)){e.preventDefault();let i=this._items(),a=i.indexOf(n),o=i.length-1,s=r===`Home`?0:r===`End`?o:Math.max(0,Math.min(o,a+(r===`ArrowUp`||r===`ArrowLeft`?-1:1)));if(s===a){this._announce(`${this._labelOf(n)} is already ${a===0?`first`:`last`}, ${this._position(n)}.`);return}this._moveFocused(()=>this._insertAt(n,s),t),this._announce(`${this._labelOf(n)} moved to ${this._position(n)}.`)}}}_onFocusOut(e){this._kb&&!this._moving&&(e.relatedTarget&&this._kb.handle.contains(e.relatedTarget)||this._dropKeyboard(!1))}_liftKeyboard(e,t){this._kb={item:e,handle:t,fromIndex:this._items().indexOf(e)},t.setAttribute(`aria-pressed`,`true`),this._announce(`${this._labelOf(e)} lifted, ${this._position(e)}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`)}_dropKeyboard(e){let t=this._kb;t&&(this._kb=null,t.handle.removeAttribute(`aria-pressed`),e?(this._moveFocused(()=>this._insertAt(t.item,t.fromIndex),t.handle),this._announce(`Reorder cancelled. ${this._labelOf(t.item)} is back at ${this._position(t.item)}.`)):this._items().indexOf(t.item)===t.fromIndex?this._announce(`${this._labelOf(t.item)} dropped, ${this._position(t.item)}.`):this._settle(t.item,this,t.fromIndex,this))}_moveFocused(e,t){this._moving=!0;let n=this.contains(document.activeElement);e(),n&&document.activeElement!==t&&t.focus(),this._moving=!1}};function m(e,t,n){return e<t+d?-Math.ceil(f*Math.min(1,(t+d-e)/d)):e>n-d?Math.ceil(f*Math.min(1,(e-(n-d))/d)):0}function h(e){for(let t=e.parentElement;t&&t!==document.body&&t!==document.documentElement;t=t.parentElement){let e=getComputedStyle(t),n=/(auto|scroll)/.test(e.overflowY)&&t.scrollHeight>t.clientHeight,r=/(auto|scroll)/.test(e.overflowX)&&t.scrollWidth>t.clientWidth;if(n||r)return t}return null}(0,t.defineElement)(`wui-sortable`,p),e.WuiSortable=p})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formMirror);
1
+ (function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.133.0`)throw Error(`[webority-ui] sortable expects ui-elements 0.133.0 but the page loaded `+i+`.`);var a=new Set,o=`.wui-sortable-handle`,s=`a[href],button,input,select,textarea,label,summary,[contenteditable='true'],[role='button'],[role='link']`,c=4,l=8,u=250,d=48,f=18,p=class extends n.ElementBase{static get observedAttributes(){return[`name`,`disabled`]}constructor(){super(),this._drag=null,this._kb=null,this._moving=!1,this.controlled=!1,this._observer=null,this._onPointerDown=this._onPointerDown.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onDragStart=e=>e.preventDefault(),this._onDocMove=this._onDocMove.bind(this),this._onDocUp=this._onDocUp.bind(this),this._onDocCancel=this._onDocCancel.bind(this),this._onDocKey=this._onDocKey.bind(this),this._onDocTouchMove=e=>{this._drag?.started&&e.preventDefault()},this._onSelectStart=e=>e.preventDefault(),this._scrollTick=this._scrollTick.bind(this)}connectedCallback(){a.add(this),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.addEventListener(`dragstart`,this._onDragStart),this._observer=new MutationObserver(()=>this._syncMirrors()),this._observer.observe(this,{childList:!0}),this._syncMirrors()}disconnectedCallback(){a.delete(this),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),this.removeEventListener(`dragstart`,this._onDragStart),this._observer?.disconnect(),this._observer=null,this._abort()}attributeChangedCallback(e){e===`disabled`&&this._abort(),this.isConnected&&this._syncMirrors()}get order(){return this._items().map(e=>e.getAttribute(`data-id`))}set order(e){if(this._drag?.started||this._kb)return;let t=this._items(),n=new Map(t.map(e=>[e.getAttribute(`data-id`),e])),r=[];for(let t of e??[]){let e=n.get(String(t));e&&!r.includes(e)&&r.push(e)}[...r,...t.filter(e=>!r.includes(e))].forEach((e,t)=>{let n=this._items()[t];n!==e&&this.insertBefore(e,n)}),this._syncMirrors()}_items(){return[...this.querySelectorAll(`:scope > [data-id]`)]}_itemFrom(e){let t=e;for(;t&&t.parentElement!==this;)t=t.parentElement;return t?.hasAttribute(`data-id`)?t:null}_itemDisabled(e){return e.hasAttribute(`data-disabled`)}_horizontal(){return this.getAttribute(`orientation`)===`horizontal`}_syncMirrors(){(0,r.syncFormMirrors)(this,this.order)}_insertAt(e,t){let n=this._items();if(n.indexOf(e)===t)return;let r=n.filter(t=>t!==e),i=r[t]??null;i?this.insertBefore(e,i):r.length>0?r[r.length-1].after(e):this.appendChild(e)}_indexFor(e,t,n){let r=this._items().filter(t=>t!==e),i=this._horizontal();for(let e=0;e<r.length;e++){let a=r[e].getBoundingClientRect();if(i?n<a.top||n<=a.bottom&&t<a.left+a.width/2:n<a.top+a.height/2)return e}return r.length}_peers(){let e=this.getAttribute(`group`);return[...a].filter(t=>t===this||e&&t.getAttribute(`group`)===e&&!t.hasAttribute(`disabled`))}_labelOf(e){return e.getAttribute(`data-label`)||e.textContent.replace(/\s+/g,` `).trim()||e.getAttribute(`data-id`)}_announce(e){let t=this.querySelector(`:scope > .wui-sortable-live`);t||(t=document.createElement(`div`),t.className=`wui-sortable-live`,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-atomic`,`true`),this.appendChild(t)),t.textContent=e}_position(e){let t=this._items();return`position ${t.indexOf(e)+1} of ${t.length}`}_onPointerDown(e){if(this._drag||this._kb||this.hasAttribute(`disabled`)||e.pointerType===`mouse`&&e.button!==0)return;let t=this._itemFrom(e.target);if(!t||this._itemDisabled(t))return;let n=t.querySelector(`:scope > ${o}`),r=!!n&&n.contains(e.target);if(this.hasAttribute(`handle`)&&!r)return;if(!r){let n=e.target.closest?.(s);if(n&&n!==t&&t.contains(n))return}let i=e.pointerType===`touch`&&!r,a={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,x:e.clientX,y:e.clientY,slop:e.pointerType===`touch`?l:c,ready:!i,started:!1,timer:null,raf:0,list:this,ghost:null};this._drag=a,i&&(a.timer=setTimeout(()=>{a.timer=null,a.ready=!0,this._begin()},u)),document.addEventListener(`pointermove`,this._onDocMove),document.addEventListener(`pointerup`,this._onDocUp),document.addEventListener(`pointercancel`,this._onDocCancel),document.addEventListener(`keydown`,this._onDocKey,!0),document.addEventListener(`touchmove`,this._onDocTouchMove,{passive:!1})}_onDocMove(e){let t=this._drag;if(t&&e.pointerId===t.pointerId){if(t.x=e.clientX,t.y=e.clientY,!t.started){let e=Math.hypot(t.x-t.startX,t.y-t.startY);if(!t.ready){e>t.slop&&this._finish(!0);return}if(e<t.slop||(this._begin(),!this._drag?.started))return}e.preventDefault?.(),this._moveGhost(),this._update()}}_onDocUp(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!1)}_onDocCancel(e){this._drag&&e.pointerId===this._drag.pointerId&&this._finish(!0)}_onDocKey(e){e.key===`Escape`&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._finish(!0))}_begin(){let e=this._drag;if(!e||e.started)return;e.started=!0;let t=e.item.getBoundingClientRect();e.offsetX=e.startX-t.left,e.offsetY=e.startY-t.top,e.fromIndex=this._items().indexOf(e.item);let n=e.item.cloneNode(!0);for(let e of[n,...n.querySelectorAll(`[id],[data-id]`)])e.removeAttribute(`id`),e.removeAttribute(`data-id`);n.classList.add(`wui-sortable-ghost`),n.setAttribute(`aria-hidden`,`true`),n.inert=!0,n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,e.ghost=n,e.item.classList.add(`wui-sortable-dragging`),document.body.appendChild(n),document.documentElement.classList.add(`wui-sortable-active`),document.addEventListener(`selectstart`,this._onSelectStart),this._moveGhost(),e.raf=requestAnimationFrame(this._scrollTick),this._emit(this,`wui-sortable:start`,{id:e.item.getAttribute(`data-id`)})}_moveGhost(){let e=this._drag;e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.offsetX}px, ${e.y-e.offsetY}px)`)}_update(){let e=this._drag;if(!e?.started)return;let t=e.list;for(let n of this._peers()){let r=n.getBoundingClientRect();if(e.x>=r.left&&e.x<=r.right&&e.y>=r.top&&e.y<=r.bottom){t=n;break}}let n=t._indexFor(e.item,e.x,e.y);(t!==e.list||n!==t._items().indexOf(e.item))&&t._insertAt(e.item,n),e.list=t}_scrollTick(){let e=this._drag;if(!e?.started)return;let t=h(e.list),n=t?t.getBoundingClientRect():null,r=Math.max(n?.top??0,0),i=Math.min(n?.bottom??window.innerHeight,window.innerHeight),a=Math.max(n?.left??0,0),o=Math.min(n?.right??window.innerWidth,window.innerWidth),s=m(e.y,r,i),c=m(e.x,a,o);(c||s)&&(t?(t.scrollTop+=s,t.scrollLeft+=c):window.scrollBy(c,s),this._update()),e.raf=requestAnimationFrame(this._scrollTick)}_finish(e){let t=this._drag;if(!t||(this._drag=null,clearTimeout(t.timer),cancelAnimationFrame(t.raf),document.removeEventListener(`pointermove`,this._onDocMove),document.removeEventListener(`pointerup`,this._onDocUp),document.removeEventListener(`pointercancel`,this._onDocCancel),document.removeEventListener(`keydown`,this._onDocKey,!0),document.removeEventListener(`touchmove`,this._onDocTouchMove),document.removeEventListener(`selectstart`,this._onSelectStart),!t.started))return;t.ghost?.remove(),document.documentElement.classList.remove(`wui-sortable-active`),t.item.classList.remove(`wui-sortable-dragging`);let n=t.item.getAttribute(`data-id`);e?(this._insertAt(t.item,t.fromIndex),this._syncMirrors(),t.list!==this&&t.list._syncMirrors()):this._settle(t.item,this,t.fromIndex,t.list),this._emit(this,`wui-sortable:end`,{id:n,cancelled:e})}_settle(e,t,n,r){let i=r._items().indexOf(e);if(r===t&&i===n)return;let a=e.getAttribute(`data-id`),o=r.order,s=r!==t,c=t.order;s&&(t.controlled||r.controlled)&&t._insertAt(e,n),t._syncMirrors(),r._syncMirrors();let l=r._labelOf(e),u=s&&r.getAttribute(`aria-label`)?` to ${r.getAttribute(`aria-label`)}`:``,d={id:a,fromIndex:n,toIndex:i,from:t,to:r};s&&this._emit(t,`wui-sortable:change`,{...d,ids:c}),this._emit(r,`wui-sortable:change`,{...d,ids:o}),r._announce(`${l} moved${u}, position ${i+1} of ${o.length}.`)}_emit(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}_abort(){this._drag&&this._finish(!0),this._kb&&this._dropKeyboard(!0)}_onKeyDown(e){if(this.hasAttribute(`disabled`))return;let t=e.target.closest?.(o),n=t&&t.parentElement?.parentElement===this?t.parentElement:null;if(!n||this._itemDisabled(n)||this._drag)return;let r=e.key;if(!this._kb){if(r!==` `&&r!==`Enter`)return;e.preventDefault(),this._liftKeyboard(n,t)}else if(this._kb.item===n){if(r===` `||r===`Enter`)e.preventDefault(),this._dropKeyboard(!1);else if(r===`Escape`)e.preventDefault(),e.stopPropagation(),this._dropKeyboard(!0);else if([`ArrowUp`,`ArrowLeft`,`ArrowDown`,`ArrowRight`,`Home`,`End`].includes(r)){e.preventDefault();let i=this._items(),a=i.indexOf(n),o=i.length-1,s=r===`Home`?0:r===`End`?o:Math.max(0,Math.min(o,a+(r===`ArrowUp`||r===`ArrowLeft`?-1:1)));if(s===a){this._announce(`${this._labelOf(n)} is already ${a===0?`first`:`last`}, ${this._position(n)}.`);return}this._moveFocused(()=>this._insertAt(n,s),t),this._announce(`${this._labelOf(n)} moved to ${this._position(n)}.`)}}}_onFocusOut(e){this._kb&&!this._moving&&(e.relatedTarget&&this._kb.handle.contains(e.relatedTarget)||this._dropKeyboard(!1))}_liftKeyboard(e,t){this._kb={item:e,handle:t,fromIndex:this._items().indexOf(e)},t.setAttribute(`aria-pressed`,`true`),this._announce(`${this._labelOf(e)} lifted, ${this._position(e)}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`)}_dropKeyboard(e){let t=this._kb;t&&(this._kb=null,t.handle.removeAttribute(`aria-pressed`),e?(this._moveFocused(()=>this._insertAt(t.item,t.fromIndex),t.handle),this._announce(`Reorder cancelled. ${this._labelOf(t.item)} is back at ${this._position(t.item)}.`)):this._items().indexOf(t.item)===t.fromIndex?this._announce(`${this._labelOf(t.item)} dropped, ${this._position(t.item)}.`):this._settle(t.item,this,t.fromIndex,this))}_moveFocused(e,t){this._moving=!0;let n=this.contains(document.activeElement);e(),n&&document.activeElement!==t&&t.focus(),this._moving=!1}};function m(e,t,n){return e<t+d?-Math.ceil(f*Math.min(1,(t+d-e)/d)):e>n-d?Math.ceil(f*Math.min(1,(e-(n-d))/d)):0}function h(e){for(let t=e.parentElement;t&&t!==document.body&&t!==document.documentElement;t=t.parentElement){let e=getComputedStyle(t),n=/(auto|scroll)/.test(e.overflowY)&&t.scrollHeight>t.clientHeight,r=/(auto|scroll)/.test(e.overflowX)&&t.scrollWidth>t.clientWidth;if(n||r)return t}return null}(0,t.defineElement)(`wui-sortable`,p),e.WuiSortable=p})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formMirror);