@webority/ui-elements 0.107.0 → 0.108.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 (105) hide show
  1. package/dist/{WuiAutocomplete-CEUYj1he.js → WuiAutocomplete-Bol_8H76.js} +1 -1
  2. package/dist/{WuiCodeBlock-g0ofpXMd.js → WuiCodeBlock-Je21uGRC.js} +1 -1
  3. package/dist/{WuiCommandPalette-BND6hxMZ.js → WuiCommandPalette-DdL68m66.js} +1 -1
  4. package/dist/{WuiCommentThread-ehVrMKpJ.js → WuiCommentThread-Btzeidjo.js} +1 -1
  5. package/dist/{WuiCountrySelect-B4E5myaS.js → WuiCountrySelect-CuZpXHoS.js} +1 -1
  6. package/dist/{WuiDataTable-Ds44BXhE.js → WuiDataTable-CoxLsrAF.js} +1 -1
  7. package/dist/{WuiDatePicker-CIQ1PizX.js → WuiDatePicker-D5ArlyfO.js} +1 -1
  8. package/dist/{WuiDateRange-DaaXYmfd.js → WuiDateRange-zBX7UxAi.js} +1 -1
  9. package/dist/WuiDrawer-BDPrSmML.js +1 -0
  10. package/dist/{WuiInlineEdit-DEQmdOGf.js → WuiInlineEdit-DP7wLmHd.js} +1 -1
  11. package/dist/{WuiLightbox-BMbaWFYN.js → WuiLightbox-B0HZefpp.js} +1 -1
  12. package/dist/{WuiMentionInput-BNmQ_P1L.js → WuiMentionInput-CtAwChDg.js} +1 -1
  13. package/dist/{WuiMultiSelect-DZPrYsLa.js → WuiMultiSelect-COHA1_cK.js} +1 -1
  14. package/dist/WuiNotificationCenter-Dxm2sSN6.js +1 -0
  15. package/dist/{WuiPhone-BnLRd9BK.js → WuiPhone-BAEXxhPv.js} +1 -1
  16. package/dist/{WuiRelativeTime-D6hPHWXX.js → WuiRelativeTime-B5I84Rkz.js} +1 -1
  17. package/dist/{WuiRollingNumber-gAaTn4jG.js → WuiRollingNumber-BVwFF7Ha.js} +1 -1
  18. package/dist/{WuiSelect-7d7Xw5uh.js → WuiSelect-DhrTajiM.js} +1 -1
  19. package/dist/WuiShortcuts-BpR8npaI.js +1 -0
  20. package/dist/{WuiTagInput-DVmiTCMB.js → WuiTagInput-Dg0Y-pa5.js} +1 -1
  21. package/dist/{WuiTimePicker-C8Cdn7rU.js → WuiTimePicker-PB0UN3eA.js} +1 -1
  22. package/dist/{WuiTree-IfM9-lZ7.js → WuiTree-D-7Do7II.js} +1 -1
  23. package/dist/WuiWhatsNew-DkI69gjR.js +1 -0
  24. package/dist/WuiWizardStep-DhhdUzN_.js +1 -0
  25. package/dist/{dataTable-Cd_IJQcs.js → dataTable-SKMmByaz.js} +1 -1
  26. package/dist/elements/autocomplete.js +1 -1
  27. package/dist/elements/code-block.js +1 -1
  28. package/dist/elements/command-palette.js +1 -1
  29. package/dist/elements/comment-thread.js +1 -1
  30. package/dist/elements/country-select.js +1 -1
  31. package/dist/elements/data-table.js +1 -1
  32. package/dist/elements/date-range.js +1 -1
  33. package/dist/elements/datepicker.js +1 -1
  34. package/dist/elements/drawer.js +1 -1
  35. package/dist/elements/inline-edit.js +1 -1
  36. package/dist/elements/kanban.js +1 -1
  37. package/dist/elements/lightbox.js +1 -1
  38. package/dist/elements/mention-input.js +1 -1
  39. package/dist/elements/multiselect.js +1 -1
  40. package/dist/elements/notification-center.js +1 -1
  41. package/dist/elements/phone.js +1 -1
  42. package/dist/elements/relative-time.js +1 -1
  43. package/dist/elements/rolling-number.js +1 -1
  44. package/dist/elements/select.js +1 -1
  45. package/dist/elements/shortcuts.js +1 -1
  46. package/dist/elements/taginput.js +1 -1
  47. package/dist/elements/timepicker.js +1 -1
  48. package/dist/elements/tree.js +1 -1
  49. package/dist/elements/whats-new.js +1 -1
  50. package/dist/elements/wizard.js +1 -1
  51. package/dist/{fileViewerImage-Caj960up.js → fileViewerImage-Q4ILIc5S.js} +1 -1
  52. package/dist/{fileViewerMedia-B5CpXCS_.js → fileViewerMedia-CvyJKkAx.js} +1 -1
  53. package/dist/{fileViewerPdf-Cb0xjDBA.js → fileViewerPdf-CFQj8r_-.js} +1 -1
  54. package/dist/{fileViewerUi-EVuRv_xJ.js → fileViewerUi-uUZ6lfhT.js} +1 -1
  55. package/dist/{formatters-BAE__8ye.js → formatters-6DhcQIjT.js} +1 -1
  56. package/dist/helpers.js +1 -1
  57. package/dist/{iconGlyphs.g-Bo-gCFpk.js → iconGlyphs.g-CrodCkbV.js} +1 -1
  58. package/dist/{kanban-yPVCTz52.js → kanban-DNsxENr3.js} +1 -1
  59. package/dist/{notificationDays-BUoh4mG6.js → notificationDays-DOIBIwN5.js} +1 -1
  60. package/dist/{optionLabel-DFT2Lcs6.js → optionLabel-aV6M6_a-.js} +1 -1
  61. package/dist/stepperHeader-yinJ_7Dk.js +1 -0
  62. package/dist/themeTransition-BY52mM_w.js +1 -0
  63. package/dist/ui-chat.global.js +1 -1
  64. package/dist/ui-chat.js +1 -1
  65. package/dist/ui-elements/autocomplete.global.js +1 -1
  66. package/dist/ui-elements/carousel.global.js +1 -1
  67. package/dist/ui-elements/code-block.global.js +1 -1
  68. package/dist/ui-elements/command-palette.global.js +1 -1
  69. package/dist/ui-elements/comment-thread.global.js +1 -1
  70. package/dist/ui-elements/consent-banner.global.js +1 -1
  71. package/dist/ui-elements/context-menu.global.js +1 -1
  72. package/dist/ui-elements/date-range.global.js +1 -1
  73. package/dist/ui-elements/drawer.global.js +1 -1
  74. package/dist/ui-elements/image-crop.global.js +1 -1
  75. package/dist/ui-elements/inline-edit.global.js +1 -1
  76. package/dist/ui-elements/kanban.global.js +1 -1
  77. package/dist/ui-elements/lightbox.global.js +1 -1
  78. package/dist/ui-elements/markdown.global.js +1 -1
  79. package/dist/ui-elements/multiselect.global.js +1 -1
  80. package/dist/ui-elements/phone.global.js +1 -1
  81. package/dist/ui-elements/resizable.global.js +1 -1
  82. package/dist/ui-elements/slider.global.js +1 -1
  83. package/dist/ui-elements/sortable.global.js +1 -1
  84. package/dist/ui-elements/status-icon.global.js +1 -1
  85. package/dist/ui-elements/taginput.global.js +1 -1
  86. package/dist/ui-elements/timepicker.global.js +1 -1
  87. package/dist/ui-elements/tour.global.js +1 -1
  88. package/dist/ui-elements/tree.global.js +1 -1
  89. package/dist/ui-elements/wizard.global.js +1 -1
  90. package/dist/ui-elements.global.js +26 -26
  91. package/dist/ui-elements.js +1 -1
  92. package/dist/ui-file-viewer.global.js +1 -1
  93. package/dist/ui-file-viewer.js +1 -1
  94. package/dist/wuiHttp-DieYBkvu.js +1 -0
  95. package/package.json +1 -2
  96. package/dist/WuiDrawer-CUGylXXx.js +0 -1
  97. package/dist/WuiMenubar-BVgYbbzG.js +0 -1
  98. package/dist/WuiNotificationCenter-P_16DGfa.js +0 -1
  99. package/dist/WuiShortcuts-DfAbWRZZ.js +0 -1
  100. package/dist/WuiWhatsNew-D30atDNr.js +0 -1
  101. package/dist/WuiWizardStep-6VAgAV7V.js +0 -1
  102. package/dist/elements/menubar.js +0 -1
  103. package/dist/themeTransition-BlOe94Bx.js +0 -1
  104. package/dist/ui-elements/menubar.global.js +0 -1
  105. package/dist/wuiHttp-BUYlubF-.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./elementBase-DV9IZZCu.js";import{n as t,t as n}from"./devWarn-DXdRWZs3.js";import{m as r,s as i,t as a}from"./formatters-BAE__8ye.js";import{c as o,o as s}from"./wuiHttp-BUYlubF-.js";var c=`wui-remote-modal`,l=`wui-remote-drawer`,u=Object.freeze({sm:360,md:480,lg:640,xl:720}),d=`wui-modal-fullscreen`,f=Object.freeze({sm:380,md:440,lg:640,xl:880}),p=Object.freeze({loading:`Loading`,close:`Close`,retry:`Try again`,errorTitle:`This could not be loaded`,forbidden:`You do not have access to this.`,client:`It may have been moved or deleted.`,server:`Something went wrong on our side. Try again in a moment.`,network:`Could not reach the server. Check your connection and try again.`,submitFailed:`Your changes were not saved.`,invalid:`Some fields need attention.`}),m=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,h=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,g=`[aria-invalid="true"], .is-invalid, .input-validation-error`,_=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,v=`[data-wui-modal-content]`,ee=`[data-wui-pane-close], [data-bs-dismiss="modal"]`,te=`<button type="button" class="wui-modal-close" data-bs-dismiss="modal" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button>`,y=new WeakMap,ne=new WeakSet,b=()=>Object.assign(Error(`The remote modal load was aborted.`),{name:`AbortError`}),re=e=>{let t=window.bootstrap?.Modal;if(!t)throw Error(`WUI.modal.load(${String(e)}): Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return t},x=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML};function ie(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(Object.hasOwn(f,e))return{px:f[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`)}var ae=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:f.md}},S=(e,t)=>{e.classList.toggle(d,!!t.fullscreen),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},oe=[`center`,`top`];function se(e){if(e==null||e===``)return null;if(Object.hasOwn(u,e))return{px:u[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var ce=e=>e.container===`drawer`,C=e=>e.container===`pane`,w=e=>e.container!==`modal`,le=(e,t)=>ce(e)?se(t):ie(t),ue=()=>document.getElementById(`wui-remote-drawer`)?.classList.contains(`show`)??!1,de=e=>{let t=typeof e==`string`?document.querySelector(e):e;return t?.matches?.(`[data-wui-pane-host]`)?t:null},fe=e=>C(e)?e.shell:e.shell.querySelector(`.modal-dialog`);function pe(e=`modal`){let t=e===`drawer`,n=t?l:c,r=document.getElementById(n);return r||(r=document.createElement(`div`),r.id=n,r.className=t?`modal fade wui-modal-shell wui-remote-drawer`:`modal fade wui-modal-shell`,r.tabIndex=-1,r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-modal`,`true`),r.style.setProperty(`--wui-modal-max-width`,`${t?u.md:f.md}px`),r.innerHTML=t?`<div class="modal-dialog wui-remote-drawer-dialog"><div class="modal-content wui-modal"></div></div>`:`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal"></div></div>`,document.body.appendChild(r),r)}var me=e=>`<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${x(e)}</div></div></div>${te}</div>`,he=e=>`<div class="modal-content wui-modal" aria-busy="true">${me(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${x(p.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`,ge=(e,t)=>`<div class="modal-content wui-modal" data-wui-modal-error="${x(t)}">${me(e)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${x(p.errorTitle)}</p><p class="wui-modal-state-text">${x(p[t]||p.server)}</p><div class="wui-modal-state-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${x(p.close)}</button><button type="button" class="btn btn-primary" data-wui-modal-retry>${x(p.retry)}</button></div></div></div></div>`,T=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelector(`.modal-content`)},E=e=>e.shell.querySelector(`.modal-content`);function _e(e){if(!e)return;e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}));let t=window.bootstrap,n=[t?.Tooltip,t?.Popover,t?.Dropdown].filter(e=>e?.getInstance);for(let t of[e,...e.querySelectorAll(`*`)])for(let e of n)e.getInstance(t)?.dispose()}function D(e,t){let n=E(e),r=n?ye(n):new Map;_e(n),n?n.replaceWith(t):fe(e).appendChild(t),be(t,r),window.WUI?.refresh?.()}var ve=`input[type="file"][name]`;function ye(e){let t=new Map;for(let n of e.querySelectorAll(ve))n.files.length>0&&t.set(n.name,[...n.files]);return t}function be(e,t){if(!(t.size===0||typeof DataTransfer>`u`))for(let n of e.querySelectorAll(ve)){let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var O=e=>C(e)?!e.shell.hidden:e.shell.classList.contains(`show`);function k(e,t,n=!1){let r=t&&e.querySelector(g),i=r?r.matches(m)?r:r.querySelector(m)||r:null;if(!i&&n)i=e.querySelector(`[data-autofocus]`)||e.querySelector(h)||e.querySelector(`.wui-modal-close`);else if(!i){let t=[...e.querySelectorAll(m)];i=e.querySelector(`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}i?.focus?.()}function xe(e,t){let n=[...e.querySelectorAll(m)].filter(e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`);if(!n.length){t.preventDefault(),e.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;!e.contains(a)||a===e?(t.preventDefault(),(t.shiftKey?i:r).focus()):t.shiftKey&&a===r?(t.preventDefault(),i.focus()):!t.shiftKey&&a===i&&(t.preventDefault(),r.focus())}function Se(e,t){let n=e.shell.querySelector(`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),fe(e).appendChild(n)),n.textContent=``,n.textContent=t}var Ce=e=>{let t=e.shell.querySelector(`[data-wui-modal-live]`);t&&(t.textContent=``)},A=(e,t,n)=>e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}));function j(e,t,n,r){let i={...r,container:e.container};A(t,`wui:modal:${n}`,i),ce(e)&&A(t,`wui:drawer:${n}`,i),C(e)&&A(t,`wui:pane:${n}`,i)}var we=e=>e.matches(`[data-wui-pane-host]`)?`pane`:e.classList.contains(`wui-remote-drawer`)?`drawer`:`modal`;function M(e){let t=y.get(e);return t||(t={shell:e,container:we(e),queue:s(),defaultSize:ae(e),defaultLabel:e.getAttribute(`aria-label`),placeholder:E({shell:e})?.outerHTML||`<div class="modal-content wui-modal"></div>`,remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null},y.set(e,t),e.addEventListener(`submit`,e=>ze(t,e)),e.addEventListener(`click`,e=>{!e.target.closest?.(`[data-wui-modal-retry]`)||!t.session||(e.preventDefault(),F(t,t.session))}),C(t)&&e.addEventListener(`click`,e=>{let n=e.target.closest?.(ee);!n||!e.currentTarget.contains(n)||!t.session||P(t,t.session,`dismissed`,null)}),e.addEventListener(`hidden.bs.modal`,n=>{n.target===e&&(e.classList.contains(`wui-modal-stacked`)&&Ee(t),De(t))}),e.addEventListener(`shown.bs.modal`,n=>{if(n.target!==e)return;e.classList.contains(`wui-modal-stacked`)&&[...document.querySelectorAll(`.modal-backdrop`)].at(-1)?.classList.add(`wui-modal-backdrop-stacked`);let r=E(t);t.session&&r?.matches(v)&&!r.contains(document.activeElement)&&k(r,!1,w(t))}),t.remoteUrl&&e.addEventListener(`show.bs.modal`,n=>{n.target===e&&Oe(t,n)}),t)}function N(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:null};return a.handle={el:e.shell,closed:i,close:()=>P(e,a,`dismissed`,null),reload:()=>F(e,a)},e.session=a,a}function P(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},C(e)?Te(e,t):window.bootstrap?.Modal?.getOrCreateInstance(e.shell).hide())}function Te(e,t){let n=e.shell,{status:r,detail:i}=t.closing,a=n.contains(document.activeElement);e.queue.abort(),e.session=null,_e(E(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),j(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function Ee(e){e.shell.classList.remove(`wui-modal-stacked`),ue()&&(document.body.classList.add(`modal-open`),document.body.style.overflow=`hidden`)}function De(e){let t=e.session;if(e.queue.abort(),e.session=null,Ce(e),t){let{status:n,detail:r}=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n,detail:r}),j(e,e.shell,`closed`,{status:n,url:t.url});let i=document.activeElement;t.trigger?.isConnected&&(!i||i===document.body||e.shell.contains(i))&&t.trigger.focus?.()}e.cache||(D(e,T(e.placeholder)),e.loadedUrl=null,S(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function Oe(e,t){let n=t.relatedTarget instanceof Element?t.relatedTarget:null,r=n?.getAttribute(`data-wui-url`)||e.remoteUrl,i=N(e,r,{trigger:n});i.explicitSize=ke(e,n?.getAttribute(`data-wui-size`)),i.explicitSize&&S(e.shell,i.explicitSize),!(e.cache&&e.loadedUrl===r)&&(e.loadedUrl&&D(e,T(e.placeholder)),F(e,i,{keepPlaceholder:!0}))}function ke(e,t){try{return le(e,t)}catch(e){return n(e),null}}async function F(e,t,{keepPlaceholder:n=!1}={}){n||D(e,T(he(t.options.title||Ae(e))));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if((r.kind===`ok`||r.kind===`validation`)&&I(e,t,r.html,!1))return e.loadedUrl=t.url,j(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return D(e,T(ge(t.options.title||Ae(e),i))),O(e)&&k(E(e),!1,w(e)),j(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var Ae=e=>E(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,je=`/_content/Webority.Ui.Razor/js/`,Me=e=>new URL(e,window.location.href).pathname.includes(je);function Ne(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function I(e,r,i,a){let o=document.createElement(`template`);o.innerHTML=i;let s=!1;for(let e of o.content.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&Me(t)?Ne(t):s=!0}s&&t(`WUI.modal: ${r.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let c=o.content.querySelector(v);if(!c)return n(`WUI.modal: ${r.url} did not answer with an <app-modal-content> fragment.`),!1;if(D(e,c),a||Ce(e),!C(e)){S(e.shell,r.explicitSize||ke(e,c.getAttribute(`data-wui-size`))||e.defaultSize);let t=c.getAttribute(`data-wui-title`);t&&e.shell.setAttribute(`aria-label`,t)}return O(e)&&k(c,a,w(e)),!0}var Pe=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function Fe(e,t,n){let r=[...e.elements].filter(e=>e.matches(Pe));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.insertAdjacentHTML(`afterbegin`,`<span class="spinner-border spinner-border-sm me-2" aria-hidden="true" data-wui-submit-spinner></span>`));return}e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}function Ie(e){for(let t of e.querySelectorAll(_))t.remove();for(let t of e.querySelectorAll(g))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}function Le(e,t,n){let r=t.closest(`.wui-modal-body`)||t;r.querySelector(`[data-wui-modal-submit-error]`)?.remove(),Ie(r);let i=document.createElement(`div`);i.className=`alert alert-danger wui-modal-submit-error`,i.setAttribute(`role`,`alert`),i.setAttribute(`data-wui-modal-submit-error`,``),i.textContent=`${p.submitFailed} ${p[n]||p.server}`,r.prepend(i),Se(e,i.textContent)}var Re=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function ze(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(v)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=t.submitter||null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;Fe(n,i,!0);let l=await e.queue.run(c?Re(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate});if(e.session===r){if(n.isConnected&&Fe(n,i,!1),l.kind===`ok`&&l.result===`success`){Be(e,r,l);return}if(!(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)){if(l.kind===`validation`&&I(e,r,l.html,!0)){let t=E(e).querySelector(_)?.textContent.replace(/\s+/g,` `).trim();Se(e,t||p.invalid);return}l.kind===`ok`&&l.html&&I(e,r,l.html,!1)||Le(e,n,l.kind===`ok`||l.kind===`validation`?`server`:l.kind)}}}function Be(e,t,n){let r=n.message,i=n.redirect||null,a={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};if(r&&window.WUI?.toast?.(r,{variant:`success`}),j(e,t.trigger?.isConnected?t.trigger:document,`success`,a),t.options.onSuccess?.(a,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i),n.next&&!i){t.url=n.next,t.method=`GET`,t.body=void 0,F(e,t);return}if(n.keepOpen){n.html&&I(e,t,n.html,!1);return}P(e,t,`success`,a)}function Ve(e){let t=e.target.closest?.(`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);if(t&&!(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0))){if(e.preventDefault(),t.hasAttribute(`data-wui-pane`)){qe(t.getAttribute(`data-wui-pane`),{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)});return}if(!t.hasAttribute(`data-wui-modal`)){Ge(t.getAttribute(`data-wui-drawer`),{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)});return}R(t.getAttribute(`data-wui-modal`),{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)})}}function He(e){if(e.key!==`Tab`||e.defaultPrevented)return;let t=e.currentTarget.querySelectorAll(`.modal.show`),n=e.currentTarget.querySelector(`.modal.show.wui-modal-stacked`)??t[t.length-1];n&&xe(n,e)}function Ue(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=e.target.closest?.(Ke),n=t&&y.get(t);!n?.session||e.currentTarget.querySelector(`.modal.show`)||P(n,n.session,`dismissed`,null)}function L(e=document){let t=e.ownerDocument||e;ne.has(t)||(ne.add(t),t.addEventListener(`click`,Ve),t.addEventListener(`keydown`,He),t.addEventListener(`keydown`,Ue));let n=[...e.querySelectorAll?.(`.modal[data-wui-remote-url]`)||[]];e.matches?.(`.modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)M(e)}function R(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=re(e),r=t.container===`drawer`,i=r?se(t.size):ie(t.size),a=t.placement||`center`;if(!oe.includes(a))throw TypeError(`WUI.modal.load: unsupported placement "${a}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(b());let o=pe(r?`drawer`:`modal`);L(document);let s=M(o),c=O(s),l=N(s,e,t);l.explicitSize=i,S(o,i||s.defaultSize),r||o.querySelector(`.modal-dialog`).classList.toggle(`modal-dialog-centered`,a===`center`),t.title&&o.setAttribute(`aria-label`,t.title),c||(!r&&ue()&&(document.body.appendChild(o),o.classList.add(`wui-modal-stacked`)),n.getInstance(o)?.dispose(),n.getOrCreateInstance(o,{backdrop:!t.staticBackdrop||`static`,keyboard:!t.staticBackdrop}));let u=c?Promise.resolve():new Promise(e=>o.addEventListener(`shown.bs.modal`,()=>e(),{once:!0})),d=F(s,l);return c||n.getOrCreateInstance(o).show(),We(s,l,t,u,d,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function We(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),P(e,t,`dismissed`,{aborted:!0})),i(b())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw b();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function Ge(e,t={}){return R(e,{...t,container:`drawer`,placement:void 0})}var Ke=`[data-wui-pane-host]`;function qe(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=de(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(b());L(document);let r=M(n),i=N(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=F(r,i);return We(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function Je(e){let t=de(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=y.get(t);n?.session&&P(n,n.session,`dismissed`,null)}var Ye=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),z=Object.freeze([`number`,`currency`,`compact`]),Xe=`wui-kanban:`,Ze=`(max-width: 767.98px)`,Qe=400,$e=6,B=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`,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.`})}),V=`[data-wui-column]`,H=`[data-wui-body]`,U=`[data-wui-card]`,et=`[data-wui-count]`,tt=`[data-wui-summary]`,nt=`[data-wui-empty]`,rt=`[data-wui-drop-note]`,it=`[data-wui-live]`,at=`[data-wui-help]`,W=`[data-wui-switch]`,ot=`[data-wui-scroller]`,st=`[data-wui-collapse]`,ct=`[data-wui-more]`,lt=`data-wui-visible-limit`,G=`data-wui-overflow`,ut=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,K=48,q=16,J=e=>e.getAttribute(`data-wui-column`),Y=e=>e.getAttribute(`data-wui-card`),X=e=>e.hidden||e.hasAttribute(`hidden`),dt=e=>X(e)||e.hasAttribute(G);function ft(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 pt(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 Z(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||Y(e)||`Card`}function mt(e){return e?`${Xe}${e}`:null}function Q(e,t=globalThis.localStorage){let n=mt(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 ht(e,t,n,r=globalThis.localStorage){let i=mt(e);if(!i||!r)return;let a={...Q(e,r),[t]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function gt(e,t){if(!z.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${z.join(`, `)}.`);if(t!=null&&t!==``&&!i.includes(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:a[0],unit:t||`rupees`}:{style:`number`,decimals:0}}function _t(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 $=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},vt=class extends e{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)}}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`dragstart`,e=>{e.target.closest?.(U)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1}),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(U)&&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=J(t),i=ft(t.getAttribute(lt)),a=[],o=[];for(let e of this._cardsIn(t)){if(this._filter&&(e.hidden=this._filter(e)===!1),X(e)){e.removeAttribute(G);continue}a.push(e),o.push(e.getAttribute(`data-wui-value`))}let s=this._expanded.has(n),c=pt(a.map(Y),i,s,this._revealed);for(let e of a)e.toggleAttribute(G,c.has(Y(e)));let l=String(a.length);for(let e of this._countsOf(t))e.textContent!==l&&(e.textContent=l);let u=t.querySelector(nt);if(u&&(u.hidden=a.length>0),e){let n=t.querySelector(tt);n&&(n.textContent=r(_t(o),e))}let d=t.querySelector(ct);if(d){d.hidden=i==null||(s?a.length<=i:c.size===0),d.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?B.fewer:B.more(c.size);d.textContent!==e&&(d.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(V)]}_columnByKey(e){return this._columns().find(t=>J(t)===e)||null}_columnOf(e){return e.closest(V)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||J(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(U)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!dt(e))}_allCards(){return[...this.querySelectorAll(`${H} > ${U}`)]}_cardByKey(e){return this._allCards().find(t=>Y(t)===e)||null}_countsOf(e){let t=J(e),n=[...this.querySelectorAll(W)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(et),...n.flatMap(e=>[...e.querySelectorAll(et)])]}_scroller(){return this.querySelector(ot)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?gt(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(at);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=this.querySelector(it);!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=Z(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(B.locked(t)),this._fire(`wui:kanban:locked`,{key:Y(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)===`true`?(this._announce(B.busy),$(B.busy,`info`),!1):!0}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=B.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=Z(e),r=new Map;for(let i of this._columns()){let a=J(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(rt);s&&!o.source&&(s.textContent=o.ok?B.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(rt);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e),i=J(r),a=this._columnByKey(t),s=Z(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),$(c.reason,`info`),!1;let l=this._cardsIn(a),u=Number.isInteger(n)?Math.max(0,Math.min(n,l.length)):l.length,d={key:Y(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(B.moved(s,this._titleOf(a))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let p=a.hasAttribute(lt)&&!this._revealed.has(d.key);p&&this._revealed.add(d.key);let m={parent:e.parentNode,next:e.nextSibling,column:r,revealed:p};this._bodyOf(a).insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let h=a.getAttribute(`data-wui-step`);if(h)return this._runStep(e,d,m,h,a.getAttribute(`data-wui-step-size`));let g=this.getAttribute(`move-url`);if(!g)return this._announce(B.moved(s,this._titleOf(a))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(B.saving(s,this._titleOf(a)));let _=await o(g,{method:`POST`,body:new URLSearchParams({card:d.key,from:i,to:t,index:String(u)})});if(this._lock(e,!1),_.kind===`session`)return!1;if(_.ok){let t=this._applyFragment(_.html)||e;return $(_.message,`success`),this._announce(B.moved(Z(t),this._titleOf(a))),this._fire(`wui:kanban:moved`,{...d,card:t,result:_}),!0}return this._rollback(e,m),_.kind!==`aborted`&&$(_.message||B.failed[_.kind]||B.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:_.kind,status:_.status,message:_.message}),!1}async _runStep(e,t,n,r,i){let a=Z(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{u=await(await R(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),r?.name!==`AbortError`&&$(B.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(B.cancelled(a)),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 o(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:t.key})}`);n.ok&&(d=this._applyFragment(n.html)||e)}return this._lock(d,!1),this._announce(B.moved(Z(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(Y(e)),t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(B.rolledBack(Z(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let n=document.createElement(`template`);n.innerHTML=e;for(let e of n.content.querySelectorAll(`script`))t(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of[...n.content.querySelectorAll(U)]){if(e.closest(`template`))continue;let t=this._cardByKey(Y(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 n.content.querySelectorAll(`template[data-wui-kanban-summary]`))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(tt)?.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?.(U);if(!t||!this.contains(t)||e.target.closest(ut))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=J(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(B.lifted(Z(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+K?r.scrollBy?.({left:-16}):e>t.right-K&&r.scrollBy?.({left:q}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<K?window.scrollBy?.({top:-16}):t>i-K&&window.scrollBy?.({top:q}))}_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+K&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-K&&n.scrollTop+n.clientHeight<n.scrollHeight-1?(n.scrollBy?.({top:q}),!0):!1}_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(B.cancelled(Z(n.card)));return}let i=J(r),a=n.verdicts.get(i);if(a?.source){this._announce(B.cancelled(Z(n.card)));return}if(!a?.ok){this._announce(a?.reason),$(a?.reason,`info`);return}this._commit(n.card,i,this._indexAt(r,n.y))}_click(e){if(this._suppressClick&&e.target.closest?.(U)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let t=e.target.closest?.(st);if(t&&this.contains(t)){let e=t.closest(V);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let n=e.target.closest?.(ct);if(n&&this.contains(n)){this._controlled()||this._toggleMore(n.closest(V));return}let r=e.target.closest?.(W);r&&this.contains(r)&&this._showColumn(r.getAttribute(`data-wui-switch`))}_keyDown(e){if(this._kbd){this._liftedKey(e);return}let t=e.target;if(!t.matches?.(U)||!this.contains(t))return;let n=this._columnOf(t);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(t))return;let r=J(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(B.lifted(Z(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}default:}}_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(J(i),!1);let a=t.verdicts.get(J(i)),o=this._titleOf(i);this._announce(a.source?B.overSource(o):a.ok?B.over(o,this._cardsIn(i).filter(e=>!X(e)).length):B.overRefused(o,a.reason));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target],i=J(r),a=t.verdicts.get(i);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(B.cancelled(Z(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(B.cancelled(Z(t.card)));return;default:}}_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=Q(this.getAttribute(`board-id`));for(let t of this._columns()){let n=J(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,n)&&this._setCollapsed(t,e[n],!1)}}_setCollapsed(e,t,n){let r=J(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(st))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?B.expand(i):B.collapse(i));n&&(ht(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=J(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(Y(t));else this._expanded.add(t);this.refresh()}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(W))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(W))e.getAttribute(`data-wui-switch`)===J(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};export{qe as S,f as _,z as a,Ge as b,vt as c,mt as d,gt as f,ht as g,_t as h,Xe as i,Z as l,Q as m,Qe as n,B as o,ft as p,Ze as r,Ye as s,$e as t,pt as u,Je as v,R as x,L as y};
1
+ import{t as e}from"./elementBase-DV9IZZCu.js";import{n as t,t as n}from"./devWarn-DXdRWZs3.js";import{h as r,s as i,t as a}from"./formatters-6DhcQIjT.js";import{c as o,o as s}from"./wuiHttp-DieYBkvu.js";var c=`wui-remote-modal`,l=`wui-remote-drawer`,u=Object.freeze({sm:360,md:480,lg:640,xl:720}),d=`wui-modal-fullscreen`,f=Object.freeze({sm:380,md:440,lg:640,xl:880}),p=Object.freeze({loading:`Loading`,close:`Close`,retry:`Try again`,errorTitle:`This could not be loaded`,forbidden:`You do not have access to this.`,client:`It may have been moved or deleted.`,server:`Something went wrong on our side. Try again in a moment.`,network:`Could not reach the server. Check your connection and try again.`,submitFailed:`Your changes were not saved.`,invalid:`Some fields need attention.`}),m=`a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,h=`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled]),[contenteditable="true"]`,g=`[aria-invalid="true"], .is-invalid, .input-validation-error`,_=`.wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]`,v=`[data-wui-modal-content]`,ee=`[data-wui-pane-close], [data-bs-dismiss="modal"]`,te=`<button type="button" class="wui-modal-close" data-bs-dismiss="modal" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button>`,y=new WeakMap,ne=new WeakSet,b=()=>Object.assign(Error(`The remote modal load was aborted.`),{name:`AbortError`}),re=e=>{let t=window.bootstrap?.Modal;if(!t)throw Error(`WUI.modal.load(${String(e)}): Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return t},x=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML};function ie(e){if(e==null||e===``)return null;if(e===`fullscreen`)return{fullscreen:!0};if(Object.hasOwn(f,e))return{px:f[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`)}var ae=e=>{if(e.classList.contains(`wui-modal-fullscreen`))return{fullscreen:!0};let t=Number.parseInt(e.style.getPropertyValue(`--wui-modal-max-width`),10);return{px:t>0?t:f.md}},S=(e,t)=>{e.classList.toggle(d,!!t.fullscreen),t.fullscreen?e.style.removeProperty(`--wui-modal-max-width`):e.style.setProperty(`--wui-modal-max-width`,`${t.px}px`)},oe=[`center`,`top`];function se(e){if(e==null||e===``)return null;if(Object.hasOwn(u,e))return{px:u[e]};let t=typeof e==`number`?e:/^\d+$/.test(String(e))?Number(e):NaN;if(Number.isInteger(t)&&t>0)return{px:t};throw TypeError(`Unsupported drawer size "${String(e)}". Use sm, md, lg, xl or a px number.`)}var ce=e=>e.container===`drawer`,C=e=>e.container===`pane`,w=e=>e.container!==`modal`,le=(e,t)=>ce(e)?se(t):ie(t),ue=()=>document.getElementById(`wui-remote-drawer`)?.classList.contains(`show`)??!1,de=e=>{let t=typeof e==`string`?document.querySelector(e):e;return t?.matches?.(`[data-wui-pane-host]`)?t:null},fe=e=>C(e)?e.shell:e.shell.querySelector(`.modal-dialog`);function pe(e=`modal`){let t=e===`drawer`,n=t?l:c,r=document.getElementById(n);return r||(r=document.createElement(`div`),r.id=n,r.className=t?`modal fade wui-modal-shell wui-remote-drawer`:`modal fade wui-modal-shell`,r.tabIndex=-1,r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-modal`,`true`),r.style.setProperty(`--wui-modal-max-width`,`${t?u.md:f.md}px`),r.innerHTML=t?`<div class="modal-dialog wui-remote-drawer-dialog"><div class="modal-content wui-modal"></div></div>`:`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal"></div></div>`,document.body.appendChild(r),r)}var me=e=>`<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${x(e)}</div></div></div>${te}</div>`,he=e=>`<div class="modal-content wui-modal" aria-busy="true">${me(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${x(p.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`,ge=(e,t)=>`<div class="modal-content wui-modal" data-wui-modal-error="${x(t)}">${me(e)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${x(p.errorTitle)}</p><p class="wui-modal-state-text">${x(p[t]||p.server)}</p><div class="wui-modal-state-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${x(p.close)}</button><button type="button" class="btn btn-primary" data-wui-modal-retry>${x(p.retry)}</button></div></div></div></div>`,T=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelector(`.modal-content`)},E=e=>e.shell.querySelector(`.modal-content`);function _e(e){if(!e)return;e.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0}));let t=window.bootstrap,n=[t?.Tooltip,t?.Popover,t?.Dropdown].filter(e=>e?.getInstance);for(let t of[e,...e.querySelectorAll(`*`)])for(let e of n)e.getInstance(t)?.dispose()}function D(e,t){let n=E(e),r=n?ye(n):new Map;_e(n),n?n.replaceWith(t):fe(e).appendChild(t),be(t,r),window.WUI?.refresh?.()}var ve=`input[type="file"][name]`;function ye(e){let t=new Map;for(let n of e.querySelectorAll(ve))n.files.length>0&&t.set(n.name,[...n.files]);return t}function be(e,t){if(!(t.size===0||typeof DataTransfer>`u`))for(let n of e.querySelectorAll(ve)){let e=t.get(n.name);if(!e)continue;let r=new DataTransfer;for(let t of e)r.items.add(t);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}}var O=e=>C(e)?!e.shell.hidden:e.shell.classList.contains(`show`);function k(e,t,n=!1){let r=t&&e.querySelector(g),i=r?r.matches(m)?r:r.querySelector(m)||r:null;if(!i&&n)i=e.querySelector(`[data-autofocus]`)||e.querySelector(h)||e.querySelector(`.wui-modal-close`);else if(!i){let t=[...e.querySelectorAll(m)];i=e.querySelector(`[data-autofocus]`)||t.find(e=>!e.classList.contains(`wui-modal-close`))||t[0]||e}i?.focus?.()}function xe(e,t){let n=[...e.querySelectorAll(m)].filter(e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`);if(!n.length){t.preventDefault(),e.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;!e.contains(a)||a===e?(t.preventDefault(),(t.shiftKey?i:r).focus()):t.shiftKey&&a===r?(t.preventDefault(),i.focus()):!t.shiftKey&&a===i&&(t.preventDefault(),r.focus())}function Se(e,t){let n=e.shell.querySelector(`[data-wui-modal-live]`);n||(n=document.createElement(`div`),n.className=`visually-hidden`,n.setAttribute(`aria-live`,`assertive`),n.setAttribute(`data-wui-modal-live`,``),fe(e).appendChild(n)),n.textContent=``,n.textContent=t}var Ce=e=>{let t=e.shell.querySelector(`[data-wui-modal-live]`);t&&(t.textContent=``)},A=(e,t,n)=>e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}));function j(e,t,n,r){let i={...r,container:e.container};A(t,`wui:modal:${n}`,i),ce(e)&&A(t,`wui:drawer:${n}`,i),C(e)&&A(t,`wui:pane:${n}`,i)}var we=e=>e.matches(`[data-wui-pane-host]`)?`pane`:e.classList.contains(`wui-remote-drawer`)?`drawer`:`modal`;function M(e){let t=y.get(e);return t||(t={shell:e,container:we(e),queue:s(),defaultSize:ae(e),defaultLabel:e.getAttribute(`aria-label`),placeholder:E({shell:e})?.outerHTML||`<div class="modal-content wui-modal"></div>`,remoteUrl:e.getAttribute(`data-wui-remote-url`),cache:e.getAttribute(`data-wui-remote-cache`)===`true`,loadedUrl:null,session:null},y.set(e,t),e.addEventListener(`submit`,e=>ze(t,e)),e.addEventListener(`click`,e=>{!e.target.closest?.(`[data-wui-modal-retry]`)||!t.session||(e.preventDefault(),F(t,t.session))}),C(t)&&e.addEventListener(`click`,e=>{let n=e.target.closest?.(ee);!n||!e.currentTarget.contains(n)||!t.session||P(t,t.session,`dismissed`,null)}),e.addEventListener(`hidden.bs.modal`,n=>{n.target===e&&(e.classList.contains(`wui-modal-stacked`)&&Ee(t),De(t))}),e.addEventListener(`shown.bs.modal`,n=>{if(n.target!==e)return;e.classList.contains(`wui-modal-stacked`)&&[...document.querySelectorAll(`.modal-backdrop`)].at(-1)?.classList.add(`wui-modal-backdrop-stacked`);let r=E(t);t.session&&r?.matches(v)&&!r.contains(document.activeElement)&&k(r,!1,w(t))}),t.remoteUrl&&e.addEventListener(`show.bs.modal`,n=>{n.target===e&&Oe(t,n)}),t)}function N(e,t,n){e.session&&(e.queue.abort(),e.session.resolveClosed({status:`dismissed`,detail:{replaced:!0}}));let r,i=new Promise(e=>{r=e}),a={url:t,method:(n.method||`GET`).toUpperCase(),body:n.body,options:n,trigger:n.trigger||null,explicitSize:null,closing:null,resolveClosed:r,handle:null};return a.handle={el:e.shell,closed:i,close:()=>P(e,a,`dismissed`,null),reload:()=>F(e,a)},e.session=a,a}function P(e,t,n,r){e.session===t&&(t.closing={status:n,detail:r},C(e)?Te(e,t):window.bootstrap?.Modal?.getOrCreateInstance(e.shell).hide())}function Te(e,t){let n=e.shell,{status:r,detail:i}=t.closing,a=n.contains(document.activeElement);e.queue.abort(),e.session=null,_e(E(e)),n.replaceChildren(),n.hidden=!0,n.removeAttribute(`data-open`),t.resolveClosed({status:r,detail:i}),j(e,n,`closed`,{status:r,url:t.url}),a&&t.trigger?.isConnected&&t.trigger.focus?.()}function Ee(e){e.shell.classList.remove(`wui-modal-stacked`),ue()&&(document.body.classList.add(`modal-open`),document.body.style.overflow=`hidden`)}function De(e){let t=e.session;if(e.queue.abort(),e.session=null,Ce(e),t){let{status:n,detail:r}=t.closing||{status:`dismissed`,detail:null};t.resolveClosed({status:n,detail:r}),j(e,e.shell,`closed`,{status:n,url:t.url});let i=document.activeElement;t.trigger?.isConnected&&(!i||i===document.body||e.shell.contains(i))&&t.trigger.focus?.()}e.cache||(D(e,T(e.placeholder)),e.loadedUrl=null,S(e.shell,e.defaultSize),e.defaultLabel?e.shell.setAttribute(`aria-label`,e.defaultLabel):e.shell.removeAttribute(`aria-label`))}function Oe(e,t){let n=t.relatedTarget instanceof Element?t.relatedTarget:null,r=n?.getAttribute(`data-wui-url`)||e.remoteUrl,i=N(e,r,{trigger:n});i.explicitSize=ke(e,n?.getAttribute(`data-wui-size`)),i.explicitSize&&S(e.shell,i.explicitSize),!(e.cache&&e.loadedUrl===r)&&(e.loadedUrl&&D(e,T(e.placeholder)),F(e,i,{keepPlaceholder:!0}))}function ke(e,t){try{return le(e,t)}catch(e){return n(e),null}}async function F(e,t,{keepPlaceholder:n=!1}={}){n||D(e,T(he(t.options.title||Ae(e))));let r=await e.queue.run(t.url,{method:t.method,body:t.body,navigate:t.options.navigate});if(e.session!==t||r.kind===`aborted`||r.kind===`stale`)return`aborted`;if(r.kind===`session`)return`session`;if((r.kind===`ok`||r.kind===`validation`)&&I(e,t,r.html,!1))return e.loadedUrl=t.url,j(e,e.shell,`loaded`,{url:t.url,handle:t.handle}),`loaded`;let i=r.kind===`ok`||r.kind===`validation`?`server`:r.kind;return D(e,T(ge(t.options.title||Ae(e),i))),O(e)&&k(E(e),!1,w(e)),j(e,e.shell,`error`,{url:t.url,kind:i,status:r.status}),`error`}var Ae=e=>E(e)?.querySelector(`.wui-modal-title`)?.textContent||e.shell.getAttribute(`aria-label`)||``,je=`/_content/Webority.Ui.Razor/js/`,Me=e=>new URL(e,window.location.href).pathname.includes(je);function Ne(e){if([...document.scripts].some(t=>t.getAttribute(`src`)===e))return;let t=document.createElement(`script`);t.src=e,document.head.appendChild(t)}function I(e,r,i,a){let o=document.createElement(`template`);o.innerHTML=i;let s=!1;for(let e of o.content.querySelectorAll(`script`)){if(e.getAttribute(`type`)===`application/json`)continue;let t=e.getAttribute(`src`);e.remove(),t&&Me(t)?Ne(t):s=!0}s&&t(`WUI.modal: ${r.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);let c=o.content.querySelector(v);if(!c)return n(`WUI.modal: ${r.url} did not answer with an <app-modal-content> fragment.`),!1;if(D(e,c),a||Ce(e),!C(e)){S(e.shell,r.explicitSize||ke(e,c.getAttribute(`data-wui-size`))||e.defaultSize);let t=c.getAttribute(`data-wui-title`);t&&e.shell.setAttribute(`aria-label`,t)}return O(e)&&k(c,a,w(e)),!0}var Pe=`button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]`;function Fe(e,t,n){let r=[...e.elements].filter(e=>e.matches(Pe));if(n){e.setAttribute(`data-wui-submitting`,``);let n=t&&r.includes(t)?t:r[0];for(let e of r)e.toggleAttribute(`data-wui-was-disabled`,e.disabled),e.disabled=!0;n&&(n.classList.add(`is-loading`),n.setAttribute(`aria-busy`,`true`),n.tagName===`BUTTON`&&n.insertAdjacentHTML(`afterbegin`,`<span class="spinner-border spinner-border-sm me-2" aria-hidden="true" data-wui-submit-spinner></span>`));return}e.removeAttribute(`data-wui-submitting`);for(let e of r)e.disabled=e.hasAttribute(`data-wui-was-disabled`),e.removeAttribute(`data-wui-was-disabled`),e.classList.remove(`is-loading`),e.removeAttribute(`aria-busy`),e.querySelector(`[data-wui-submit-spinner]`)?.remove()}function Ie(e){for(let t of e.querySelectorAll(_))t.remove();for(let t of e.querySelectorAll(g))t.removeAttribute(`aria-invalid`),t.classList.remove(`is-invalid`,`input-validation-error`);for(let t of e.querySelectorAll(`.field-error`))t.textContent=``}function Le(e,t,n){let r=t.closest(`.wui-modal-body`)||t;r.querySelector(`[data-wui-modal-submit-error]`)?.remove(),Ie(r);let i=document.createElement(`div`);i.className=`alert alert-danger wui-modal-submit-error`,i.setAttribute(`role`,`alert`),i.setAttribute(`data-wui-modal-submit-error`,``),i.textContent=`${p.submitFailed} ${p[n]||p.server}`,r.prepend(i),Se(e,i.textContent)}var Re=(e,t)=>{let n=new URL(e,window.location.href);for(let[e,r]of t)typeof r==`string`&&n.searchParams.append(e,r);return n.origin===window.location.origin?n.pathname+n.search:n.href};async function ze(e,t){let n=t.target,r=e.session;if(!(n instanceof HTMLFormElement)||!r||n.hasAttribute(`data-wui-native`)||!n.closest(v)||(t.preventDefault(),n.hasAttribute(`data-wui-submitting`)))return;let i=t.submitter||null,a=i?.getAttribute(`formaction`)||n.getAttribute(`action`)||r.url,o=(i?.getAttribute(`formmethod`)||n.getAttribute(`method`)||`GET`).toUpperCase(),s=new FormData(n);i?.name&&!s.has(i.name)&&s.append(i.name,i.value);let c=o===`GET`;Fe(n,i,!0);let l=await e.queue.run(c?Re(a,s):a,{method:o,body:c?void 0:s,navigate:r.options.navigate});if(e.session===r){if(n.isConnected&&Fe(n,i,!1),l.kind===`ok`&&l.result===`success`){Be(e,r,l);return}if(!(l.kind===`aborted`||l.kind===`stale`||l.kind===`session`)){if(l.kind===`validation`&&I(e,r,l.html,!0)){let t=E(e).querySelector(_)?.textContent.replace(/\s+/g,` `).trim();Se(e,t||p.invalid);return}l.kind===`ok`&&l.html&&I(e,r,l.html,!1)||Le(e,n,l.kind===`ok`||l.kind===`validation`?`server`:l.kind)}}}function Be(e,t,n){let r=n.message,i=n.redirect||null,a={url:t.url,trigger:t.trigger,handle:t.handle,message:r,redirect:i,data:n.data??null,container:e.container};if(r&&window.WUI?.toast?.(r,{variant:`success`}),j(e,t.trigger?.isConnected?t.trigger:document,`success`,a),t.options.onSuccess?.(a,t.handle),i&&(t.options.navigate||(e=>window.location.assign(e)))(i),n.next&&!i){t.url=n.next,t.method=`GET`,t.body=void 0,F(e,t);return}if(n.keepOpen){n.html&&I(e,t,n.html,!1);return}P(e,t,`success`,a)}function Ve(e){let t=e.target.closest?.(`[data-wui-modal], [data-wui-drawer], [data-wui-pane]`);if(t&&!(t.matches(`a[href]`)&&(e.ctrlKey||e.metaKey||e.shiftKey||e.button!==0))){if(e.preventDefault(),t.hasAttribute(`data-wui-pane`)){qe(t.getAttribute(`data-wui-pane`),{target:t.getAttribute(`data-wui-pane-target`),trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)});return}if(!t.hasAttribute(`data-wui-modal`)){Ge(t.getAttribute(`data-wui-drawer`),{size:t.getAttribute(`data-wui-drawer-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)});return}R(t.getAttribute(`data-wui-modal`),{size:t.getAttribute(`data-wui-size`)||void 0,title:t.getAttribute(`data-wui-title`)||void 0,trigger:t}).catch(e=>{e?.name!==`AbortError`&&n(e)})}}function He(e){if(e.key!==`Tab`||e.defaultPrevented)return;let t=e.currentTarget.querySelectorAll(`.modal.show`),n=e.currentTarget.querySelector(`.modal.show.wui-modal-stacked`)??t[t.length-1];n&&xe(n,e)}function Ue(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=e.target.closest?.(Ke),n=t&&y.get(t);!n?.session||e.currentTarget.querySelector(`.modal.show`)||P(n,n.session,`dismissed`,null)}function L(e=document){let t=e.ownerDocument||e;ne.has(t)||(ne.add(t),t.addEventListener(`click`,Ve),t.addEventListener(`keydown`,He),t.addEventListener(`keydown`,Ue));let n=[...e.querySelectorAll?.(`.modal[data-wui-remote-url]`)||[]];e.matches?.(`.modal[data-wui-remote-url]`)&&n.unshift(e);for(let e of n)M(e)}function R(e,t={}){try{if(!e)throw TypeError(`WUI.modal.load: a fragment url is required.`);let n=re(e),r=t.container===`drawer`,i=r?se(t.size):ie(t.size),a=t.placement||`center`;if(!oe.includes(a))throw TypeError(`WUI.modal.load: unsupported placement "${a}". Use center or top.`);if(t.signal?.aborted)return Promise.reject(b());let o=pe(r?`drawer`:`modal`);L(document);let s=M(o),c=O(s),l=N(s,e,t);l.explicitSize=i,S(o,i||s.defaultSize),r||o.querySelector(`.modal-dialog`).classList.toggle(`modal-dialog-centered`,a===`center`),t.title&&o.setAttribute(`aria-label`,t.title),c||(!r&&ue()&&(document.body.appendChild(o),o.classList.add(`wui-modal-stacked`)),n.getInstance(o)?.dispose(),n.getOrCreateInstance(o,{backdrop:!t.staticBackdrop||`static`,keyboard:!t.staticBackdrop}));let u=c?Promise.resolve():new Promise(e=>o.addEventListener(`shown.bs.modal`,()=>e(),{once:!0})),d=F(s,l);return c||n.getOrCreateInstance(o).show(),We(s,l,t,u,d,`WUI.modal.load`)}catch(e){return Promise.reject(e)}}function We(e,t,n,r,i,a){let o=new Promise((r,i)=>{n.signal?.addEventListener(`abort`,()=>{e.session===t&&(e.queue.abort(),P(e,t,`dismissed`,{aborted:!0})),i(b())},{once:!0})}),s=Promise.all([r,i]).then(([,e])=>{if(e===`aborted`)throw b();if(e===`session`)throw Error(`${a}(${t.url}): the session expired; the browser is signing in again.`);return t.handle});return Promise.race([s,o])}function Ge(e,t={}){return R(e,{...t,container:`drawer`,placement:void 0})}var Ke=`[data-wui-pane-host]`;function qe(e,t={}){try{if(!e)throw TypeError(`WUI.pane.load: a fragment url is required.`);let n=de(t.target);if(!n)throw TypeError(`WUI.pane.load: the target is not an <app-detail-pane>.`);if(t.signal?.aborted)return Promise.reject(b());L(document);let r=M(n),i=N(r,e,t);n.hidden=!1,n.setAttribute(`data-open`,``);let a=F(r,i);return We(r,i,t,Promise.resolve(),a,`WUI.pane.load`)}catch(e){return Promise.reject(e)}}function Je(e){let t=de(e);if(!t)throw TypeError(`WUI.pane.close: the target is not an <app-detail-pane>.`);let n=y.get(t);n?.session&&P(n,n.session,`dismissed`,null)}var Ye=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),z=Object.freeze([`number`,`currency`,`compact`]),Xe=`wui-kanban:`,Ze=`(max-width: 767.98px)`,Qe=400,$e=6,B=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`,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.`})}),V=`[data-wui-column]`,H=`[data-wui-body]`,U=`[data-wui-card]`,et=`[data-wui-count]`,tt=`[data-wui-summary]`,nt=`[data-wui-empty]`,rt=`[data-wui-drop-note]`,it=`[data-wui-live]`,at=`[data-wui-help]`,W=`[data-wui-switch]`,ot=`[data-wui-scroller]`,st=`[data-wui-collapse]`,ct=`[data-wui-more]`,lt=`data-wui-visible-limit`,G=`data-wui-overflow`,ut=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,K=48,q=16,J=e=>e.getAttribute(`data-wui-column`),Y=e=>e.getAttribute(`data-wui-card`),X=e=>e.hidden||e.hasAttribute(`hidden`),dt=e=>X(e)||e.hasAttribute(G);function ft(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 pt(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 Z(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||Y(e)||`Card`}function mt(e){return e?`${Xe}${e}`:null}function Q(e,t=globalThis.localStorage){let n=mt(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 ht(e,t,n,r=globalThis.localStorage){let i=mt(e);if(!i||!r)return;let a={...Q(e,r),[t]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function gt(e,t){if(!z.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${z.join(`, `)}.`);if(t!=null&&t!==``&&!i.includes(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:a[0],unit:t||`rupees`}:{style:`number`,decimals:0}}function _t(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 $=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},vt=class extends e{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)}}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`dragstart`,e=>{e.target.closest?.(U)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1}),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(U)&&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=J(t),i=ft(t.getAttribute(lt)),a=[],o=[];for(let e of this._cardsIn(t)){if(this._filter&&(e.hidden=this._filter(e)===!1),X(e)){e.removeAttribute(G);continue}a.push(e),o.push(e.getAttribute(`data-wui-value`))}let s=this._expanded.has(n),c=pt(a.map(Y),i,s,this._revealed);for(let e of a)e.toggleAttribute(G,c.has(Y(e)));let l=String(a.length);for(let e of this._countsOf(t))e.textContent!==l&&(e.textContent=l);let u=t.querySelector(nt);if(u&&(u.hidden=a.length>0),e){let n=t.querySelector(tt);n&&(n.textContent=r(_t(o),e))}let d=t.querySelector(ct);if(d){d.hidden=i==null||(s?a.length<=i:c.size===0),d.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?B.fewer:B.more(c.size);d.textContent!==e&&(d.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(V)]}_columnByKey(e){return this._columns().find(t=>J(t)===e)||null}_columnOf(e){return e.closest(V)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||J(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(U)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!dt(e))}_allCards(){return[...this.querySelectorAll(`${H} > ${U}`)]}_cardByKey(e){return this._allCards().find(t=>Y(t)===e)||null}_countsOf(e){let t=J(e),n=[...this.querySelectorAll(W)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(et),...n.flatMap(e=>[...e.querySelectorAll(et)])]}_scroller(){return this.querySelector(ot)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?gt(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(at);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=this.querySelector(it);!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=Z(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(B.locked(t)),this._fire(`wui:kanban:locked`,{key:Y(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)===`true`?(this._announce(B.busy),$(B.busy,`info`),!1):!0}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=B.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=Z(e),r=new Map;for(let i of this._columns()){let a=J(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(rt);s&&!o.source&&(s.textContent=o.ok?B.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(rt);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e),i=J(r),a=this._columnByKey(t),s=Z(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),$(c.reason,`info`),!1;let l=this._cardsIn(a),u=Number.isInteger(n)?Math.max(0,Math.min(n,l.length)):l.length,d={key:Y(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(B.moved(s,this._titleOf(a))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let p=a.hasAttribute(lt)&&!this._revealed.has(d.key);p&&this._revealed.add(d.key);let m={parent:e.parentNode,next:e.nextSibling,column:r,revealed:p};this._bodyOf(a).insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let h=a.getAttribute(`data-wui-step`);if(h)return this._runStep(e,d,m,h,a.getAttribute(`data-wui-step-size`));let g=this.getAttribute(`move-url`);if(!g)return this._announce(B.moved(s,this._titleOf(a))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(B.saving(s,this._titleOf(a)));let _=await o(g,{method:`POST`,body:new URLSearchParams({card:d.key,from:i,to:t,index:String(u)})});if(this._lock(e,!1),_.kind===`session`)return!1;if(_.ok){let t=this._applyFragment(_.html)||e;return $(_.message,`success`),this._announce(B.moved(Z(t),this._titleOf(a))),this._fire(`wui:kanban:moved`,{...d,card:t,result:_}),!0}return this._rollback(e,m),_.kind!==`aborted`&&$(_.message||B.failed[_.kind]||B.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:_.kind,status:_.status,message:_.message}),!1}async _runStep(e,t,n,r,i){let a=Z(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{u=await(await R(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),r?.name!==`AbortError`&&$(B.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(B.cancelled(a)),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 o(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:t.key})}`);n.ok&&(d=this._applyFragment(n.html)||e)}return this._lock(d,!1),this._announce(B.moved(Z(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(Y(e)),t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(B.rolledBack(Z(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let n=document.createElement(`template`);n.innerHTML=e;for(let e of n.content.querySelectorAll(`script`))t(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of[...n.content.querySelectorAll(U)]){if(e.closest(`template`))continue;let t=this._cardByKey(Y(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 n.content.querySelectorAll(`template[data-wui-kanban-summary]`))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(tt)?.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?.(U);if(!t||!this.contains(t)||e.target.closest(ut))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=J(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(B.lifted(Z(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+K?r.scrollBy?.({left:-16}):e>t.right-K&&r.scrollBy?.({left:q}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<K?window.scrollBy?.({top:-16}):t>i-K&&window.scrollBy?.({top:q}))}_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+K&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-K&&n.scrollTop+n.clientHeight<n.scrollHeight-1?(n.scrollBy?.({top:q}),!0):!1}_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(B.cancelled(Z(n.card)));return}let i=J(r),a=n.verdicts.get(i);if(a?.source){this._announce(B.cancelled(Z(n.card)));return}if(!a?.ok){this._announce(a?.reason),$(a?.reason,`info`);return}this._commit(n.card,i,this._indexAt(r,n.y))}_click(e){if(this._suppressClick&&e.target.closest?.(U)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let t=e.target.closest?.(st);if(t&&this.contains(t)){let e=t.closest(V);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let n=e.target.closest?.(ct);if(n&&this.contains(n)){this._controlled()||this._toggleMore(n.closest(V));return}let r=e.target.closest?.(W);r&&this.contains(r)&&this._showColumn(r.getAttribute(`data-wui-switch`))}_keyDown(e){if(this._kbd){this._liftedKey(e);return}let t=e.target;if(!t.matches?.(U)||!this.contains(t))return;let n=this._columnOf(t);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(t))return;let r=J(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(B.lifted(Z(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}default:}}_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(J(i),!1);let a=t.verdicts.get(J(i)),o=this._titleOf(i);this._announce(a.source?B.overSource(o):a.ok?B.over(o,this._cardsIn(i).filter(e=>!X(e)).length):B.overRefused(o,a.reason));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target],i=J(r),a=t.verdicts.get(i);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(B.cancelled(Z(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(B.cancelled(Z(t.card)));return;default:}}_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=Q(this.getAttribute(`board-id`));for(let t of this._columns()){let n=J(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,n)&&this._setCollapsed(t,e[n],!1)}}_setCollapsed(e,t,n){let r=J(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(st))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?B.expand(i):B.collapse(i));n&&(ht(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=J(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(Y(t));else this._expanded.add(t);this.refresh()}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(W))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(W))e.getAttribute(`data-wui-switch`)===J(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};export{qe as S,f as _,z as a,Ge as b,vt as c,mt as d,gt as f,ht as g,_t as h,Xe as i,Z as l,Q as m,Qe as n,B as o,ft as p,Ze as r,Ye as s,$e as t,pt as u,Je as v,R as x,L as y};
@@ -1 +1 @@
1
- import{h as e,u as t}from"./formatters-BAE__8ye.js";var n=99,r=1440*60*1e3,i=Object.freeze({label:`Notifications`,empty:`You are all caught up.`,markAll:`Mark all read`,viewAll:`View all`,unreadPrefix:`Unread: `,today:`Today`,yesterday:`Yesterday`,allRead:`All notifications marked as read.`,noneUnread:`No unread notifications`,failed:Object.freeze({forbidden:`You do not have permission to mark these as read.`,client:`These could not be marked as read. Refresh the page and try again.`,validation:`These could not be marked as read. Refresh the page and try again.`,server:`Something went wrong on our side, so these were not marked as read. Try again in a moment.`,network:`Could not reach the server, so these were not marked as read. Check your connection and try again.`})});function a(e){return e>99?`99+`:String(e)}function o(e,t){return t===0?e:`${e}, ${a(t)} unread`}function s(e){return e===0?i.noneUnread:`${a(e)} unread notifications`}function c(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?``:t(e,{pattern:`time`})}function l(n,a=Date.now()){let o=t(n);return o===t(a)?i.today:o===t(e(a)-r)?i.yesterday:o}function u(n,r=Date.now()){let i=new Map;for(let a of n){if(!Number.isFinite(e(a.at)))throw Error(`<AppNotificationCenter> item "${a.id}": at must be an ISO date-time with its zone (or a YYYY-MM-DD day), got ${String(a.at)}.`);let n=t(a.at);i.has(n)||i.set(n,{key:n,heading:l(a.at,r),items:[]}),i.get(n).items.push(a)}return[...i.values()]}export{l as a,s as c,a as i,i as n,c as o,u as r,o as s,n as t};
1
+ import{_ as e,u as t}from"./formatters-6DhcQIjT.js";var n=99,r=1440*60*1e3,i=Object.freeze({label:`Notifications`,empty:`You are all caught up.`,markAll:`Mark all read`,viewAll:`View all`,unreadPrefix:`Unread: `,today:`Today`,yesterday:`Yesterday`,allRead:`All notifications marked as read.`,noneUnread:`No unread notifications`,failed:Object.freeze({forbidden:`You do not have permission to mark these as read.`,client:`These could not be marked as read. Refresh the page and try again.`,validation:`These could not be marked as read. Refresh the page and try again.`,server:`Something went wrong on our side, so these were not marked as read. Try again in a moment.`,network:`Could not reach the server, so these were not marked as read. Check your connection and try again.`})});function a(e){return e>99?`99+`:String(e)}function o(e,t){return t===0?e:`${e}, ${a(t)} unread`}function s(e){return e===0?i.noneUnread:`${a(e)} unread notifications`}function c(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?``:t(e,{pattern:`time`})}function l(n,a=Date.now()){let o=t(n);return o===t(a)?i.today:o===t(e(a)-r)?i.yesterday:o}function u(n,r=Date.now()){let i=new Map;for(let a of n){if(!Number.isFinite(e(a.at)))throw Error(`<AppNotificationCenter> item "${a.id}": at must be an ISO date-time with its zone (or a YYYY-MM-DD day), got ${String(a.at)}.`);let n=t(a.at);i.has(n)||i.set(n,{key:n,heading:l(a.at,r),items:[]}),i.get(n).items.push(a)}return[...i.values()]}export{l as a,s as c,a as i,i as n,c as o,u as r,o as s,n as t};
@@ -1 +1 @@
1
- import{t as e}from"./iconGlyphs.g-Bo-gCFpk.js";var t=Symbol(`wui.trustedHtml`),n=e=>({...e,[t]:!0}),r=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),i=t=>{if(!t)return``;let n=String(t).toLowerCase().replace(/[^a-z0-9-]/g,``);return n?e(n):``},a=e=>`wui-flag wui-flag-${e}`,o=e=>{let t=String(e??``).toLowerCase();return/^[a-z]{2}$/.test(t)?`<span class="${a(t)}" aria-hidden="true"></span>`:``},s=e=>{if(e==null)return``;let n=e[t]?String(e.label??``):r(e.label),a=o(e.flag)+i(e.icon);return a?`<span class="wui-opt-label">${a}${n}</span>`:n},c=e=>String(e??``).replace(/<[^>]*>/g,``),l=new WeakMap,u=e=>{if(e==null)return``;if(!e[t])return c(e.label);let n=l.get(e);if(n&&n.label===e.label)return n.text;let r=document.createElement(`template`);r.innerHTML=String(e.label??``);let i=r.content.textContent;return l.set(e,{label:e.label,text:i}),i};export{c as a,u as i,r as n,n as o,s as r,t};
1
+ import{t as e}from"./iconGlyphs.g-CrodCkbV.js";var t=Symbol(`wui.trustedHtml`),n=e=>({...e,[t]:!0}),r=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),i=t=>{if(!t)return``;let n=String(t).toLowerCase().replace(/[^a-z0-9-]/g,``);return n?e(n):``},a=e=>`wui-flag wui-flag-${e}`,o=e=>{let t=String(e??``).toLowerCase();return/^[a-z]{2}$/.test(t)?`<span class="${a(t)}" aria-hidden="true"></span>`:``},s=e=>{if(e==null)return``;let n=e[t]?String(e.label??``):r(e.label),a=o(e.flag)+i(e.icon);return a?`<span class="wui-opt-label">${a}${n}</span>`:n},c=e=>String(e??``).replace(/<[^>]*>/g,``),l=new WeakMap,u=e=>{if(e==null)return``;if(!e[t])return c(e.label);let n=l.get(e);if(n&&n.label===e.label)return n.text;let r=document.createElement(`template`);r.innerHTML=String(e.label??``);let i=r.content.textContent;return l.set(e,{label:e.label,text:i}),i};export{c as a,u as i,r as n,n as o,s as r,t};
@@ -0,0 +1 @@
1
+ function e(e,t){return typeof t==`number`?e<t?`done`:e===t?`active`:`pending`:`pending`}function t(e,t){let{statusOf:n,journey:r,connectors:i}=t;return e.map((t,a)=>{let o=n(a),s;return s=o===`done`?{icon:`check`}:o===`error`?{icon:`alert-triangle`}:o===`skipped`?{icon:`minus`}:t.icon?{icon:t.icon}:{number:a+1},{index:a,status:o,className:o===`pending`?`step`:`step ${o}`,glyph:s,current:o===`active`,line:r&&i&&a<e.length-1?{done:o===`done`}:null}})}export{t as n,e as t};
@@ -0,0 +1 @@
1
+ var e=`image/jpeg,image/png,image/webp,image/heic,image/heif,.heic,.heif`,t=10,n=512,r=`image/webp`,i=[96,48],a={dialogTitle:`Edit photo`,dialogSubtitle:`Drag to position the photo, then zoom or rotate it.`,save:`Save photo`,cancel:`Cancel`,choose:`Upload photo`,change:`Change photo`,camera:`Take photo`,remove:`Remove photo`,unreadable:`That photo could not be opened. Choose a JPG, PNG or WebP image.`,heicUnreadable:`This browser cannot open HEIC photos. Choose a JPG, PNG or WebP image instead.`,cropFailed:`That photo could not be saved. Try again, or choose another one.`};function o(e){if(!e)return!1;let t=String(e.type||``).toLowerCase();return t===`image/heic`||t===`image/heif`||/\.hei[cf]$/i.test(String(e.name||``))}function s(e){return o(e)?a.heicUnreadable:a.unreadable}function c(e,t){let n=Number(t);return{name:e?.name||`photo`,type:r,size:Number.isInteger(n)&&n>0?n:512}}var l=`data-wui-command-shortcut`,u=`k`,d=new WeakSet;function f(e,t){return!(e.ctrlKey||e.metaKey)||e.altKey||e.shiftKey||e.repeat?!1:String(e.key).toLowerCase()===String(t).toLowerCase()}function p(e){let t=window.bootstrap?.Modal;if(!t)throw Error(`data-wui-command-shortcut: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);let n=e.closest(`.modal`);n&&t.getOrCreateInstance(n).show()}function m(e){let t=e.ownerDocument??e;d.has(t)||!e.querySelector(`[data-wui-command-shortcut]`)||(d.add(t),t.addEventListener(`keydown`,e=>{for(let n of t.querySelectorAll(`[${l}]`))if(f(e,n.getAttribute(`data-wui-command-shortcut`)||u)){e.preventDefault(),n.localName===`wui-command-palette`||n.classList.contains(`modal`)?p(n):(n.focus(),n.select?.());return}}))}var h=`image/png,image/jpeg,image/webp`,g=5,_={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"image/heic":[`.heic`],"image/heif":[`.heif`],"application/pdf":[`.pdf`],"text/plain":[`.txt`]},v={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"image/heic":`HEIC`,"image/heif":`HEIC`,"application/pdf":`PDF`,"text/plain":`text file`,"image/*":`images`,"video/*":`videos`,"audio/*":`audio`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".heic":`HEIC`,".heif":`HEIC`,".pdf":`PDF`,".txt":`text file`},y=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean),b=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.gif`,`.svg`,`.bmp`,`.avif`,`.heic`,`.heif`];function x(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t.startsWith(`image/`);let n=typeof e==`string`?e:e.name||e.url||``,r=String(n).toLowerCase();return b.some(e=>r.endsWith(e))}var S=[`KB`,`MB`,`GB`];function ee(e){if(e<1024)return`${e} B`;let t=e/1024,n=0;for(;t>=1024&&n<S.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${S[n]}`}function C(e){if(!e)return!1;let t=typeof e==`object`&&e.type?String(e.type).toLowerCase():``;if(t)return t===`application/pdf`;let n=typeof e==`string`?e:e.name||e.url||``;return String(n).toLowerCase().split(/[?#]/)[0].endsWith(`.pdf`)}function w(e){let t=y(e);return t.length?t.every(e=>e.startsWith(`.`)?b.includes(e):e===`image/*`||e.startsWith(`image/`)):!1}function T(e){let t=[];for(let n of y(e)){let e=v[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function E(e,t){let n=y(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(_[e]||[]).some(e=>i.endsWith(e)))}function D(e,t={}){if(!e)return null;let n=t.accept===void 0?h:t.accept,r=t.maxSizeMb===void 0?5:t.maxSizeMb;if(!E(e,n)){let e=T(n),t=y(n).map(e=>[`images`,`videos`,`audio`].includes(v[e]));return t.every(Boolean)?`Choose ${e}.`:t.some(Boolean)?`Choose ${e.endsWith(` file`)?`${e}s`:`${e} files`}.`:`Choose a ${e.endsWith(` file`)?e:`${e} file`}.`}return r>0&&e.size>r*1024*1024?`Keep the file under ${r} MB.`:null}function O(e,t){let n=Array.from(e||[]),r=t.multiple?n:n.slice(0,1),i=[],a=[];for(let e of r){let n=D(e,{accept:t.accept,maxSizeMb:t.maxSizeMb});n?a.push({file:e,message:n}):i.push(e)}return{files:i,rejections:a}}function te(e,t){let{overClass:n,isDisabled:r=()=>!1,onFiles:i,onReject:a,...o}=t,s=0,c=t=>e.classList.toggle(n,t),l=e=>{e.preventDefault(),!r()&&(s+=1,c(!0))},u=e=>{e.preventDefault(),r()||c(!0)},d=e=>{e.preventDefault(),!r()&&(s=Math.max(0,s-1),s===0&&c(!1))},f=e=>{if(e.preventDefault(),s=0,c(!1),r())return;let{files:t,rejections:n}=O(e.dataTransfer?.files,o);t.length&&i(t),n.length&&a(n[0])};return e.addEventListener(`dragenter`,l),e.addEventListener(`dragover`,u),e.addEventListener(`dragleave`,d),e.addEventListener(`drop`,f),()=>{e.removeEventListener(`dragenter`,l),e.removeEventListener(`dragover`,u),e.removeEventListener(`dragleave`,d),e.removeEventListener(`drop`,f)}}var k=/[0-9]/,A={9:k,A:/[A-Za-z]/,"*":/[0-9A-Za-z]/},ne=/[9A*]/,re=new Set([`text`,`tel`,`search`,`url`,`password`]),ie=e=>{let t=e.replace(/\D/g,``);return t.length===12&&t.startsWith(`91`)?t.slice(2):t.length===11&&t.startsWith(`0`)?t.slice(1):e},ae=e=>{let t=Number(e.slice(0,2)),n=Number(e.slice(2,4)),r=Number(e.slice(4,8));if(r<1)return!1;let i=new Date(Date.UTC(r,n-1,t));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===t},oe=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,se=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?`${t[3]}-${t[2]}-${t[1]}`:e};function j(e,{upper:t=!1,normalize:n,valid:r,post:i=e=>e,message:a=`Enter the full value`}={}){let o=[...e].map(e=>A[e]?{re:A[e]}:{lit:e}),s=o.filter(e=>e.re).length;return{inputMode:o.every(e=>!e.re||e.re===k)?`numeric`:`text`,normalize:n,post:i,message:a,extract(e){let n=``,r=0;for(let i of e){for(;r<o.length&&o[r].lit!==void 0&&o[r].lit!==i;)r++;if(r>=o.length)break;let e=o[r];e.lit===void 0?e.re.test(i)&&(n+=t?i.toUpperCase():i,r++):r++}return n},layout(e){let t=``,n=[],r=0;for(let i=0;i<o.length&&r<e.length;i++)o[i].lit===void 0?(t+=e[r++],n.push(!0)):(t+=o[i].lit,n.push(!1));return{text:t,isRaw:n}},isValid:e=>e.length===s&&(!r||r(e))}}function ce(){return{inputMode:`decimal`,post:e=>e,message:`Enter a valid amount`,extract(e){let t=``,n=!1,r=0;for(let i of e)k.test(i)?n?r<2&&(t+=i,r++):t+=i:i===`.`&&!n&&(n=!0,t+=i);return t.startsWith(`.`)&&(t=`0${t}`),t.replace(/^0+(?=\d)/,``)},layout(e){let[t,n]=e.split(`.`),r=oe(t)+(e.includes(`.`)?`.${n}`:``);return{text:r,isRaw:[...r].map(e=>e!==`,`)}},isValid:e=>/^\d+(\.\d{1,2})?$/.test(e)}}var M={"phone-in":()=>j(`99999 99999`,{normalize:ie,valid:e=>/^[6-9]/.test(e),message:`Enter a 10-digit mobile number`}),pan:()=>j(`AAAAA9999A`,{upper:!0,valid:e=>/^[A-Z]{5}\d{4}[A-Z]$/.test(e),message:`Enter a valid PAN`}),gstin:()=>j(`99AAAAA9999A***`,{upper:!0,valid:e=>/^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),message:`Enter a valid GSTIN`}),aadhaar:()=>j(`9999 9999 9999`,{valid:e=>/^[2-9]/.test(e),message:`Enter a valid 12-digit Aadhaar number`}),ifsc:()=>j(`AAAA*******`,{upper:!0,valid:e=>/^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),message:`Enter a valid IFSC`}),"pin-code":()=>j(`999999`,{valid:e=>/^[1-9]/.test(e),message:`Enter a valid 6-digit PIN code`}),date:()=>j(`99-99-9999`,{normalize:se,valid:ae,post:(e,t)=>e.length===8&&ae(e)?`${e.slice(4)}-${e.slice(2,4)}-${e.slice(0,2)}`:t,message:`Enter a valid date as DD-MM-YYYY`}),amount:ce},le=Object.keys(M),ue=e=>{let t=String(e).toLowerCase();return Object.hasOwn(M,t)?t:void 0},de=e=>ne.test(String(e))&&ue(e)===void 0,N=new Map;function P(e){if(e==null||e===``)return null;let t=String(e);return N.has(t)||(de(t)?N.set(t,j(t)):N.set(t,Object.hasOwn(M,t)?M[t]():null)),N.get(t)}var F=(e,t)=>e.normalize?e.normalize(t):t;function fe(e,t){let n=P(e);return n?n.extract(F(n,String(t??``))):String(t??``)}function pe(e,t){let n=P(e);if(!n)return String(t??``);let r=n.extract(F(n,String(t??``)));return n.post(r,n.layout(r).text)}function me(e,t){let n=P(e);return n?n.layout(n.extract(F(n,String(t??``)))).text:String(t??``)}var he=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(e[r]&&++n===t)return r+1;return e.length},I=new WeakMap,ge=e=>I.get(e)?.(),_e=new WeakMap;function ve(e,t,n,r){let i=e.getAll(t),a=_e.get(e);a||(a=new Set,_e.set(e,a));let o=i.findIndex((e,r)=>e===n&&!a.has(`${t}\u0000${r}`));if(!(o<0)){if(a.add(`${t}\u0000${o}`),i[o]=r,i.length===1){e.set(t,r);return}e.delete(t);for(let n of i)e.append(t,n)}}function ye(e){let t=null,n=null,r=!1,i=(t,n)=>n===null?e.removeAttribute(t):e.setAttribute(t,n),a,o,s=()=>{t?.remove(),t=null,n&&(n.hidden=!1),n=null,r&&e.classList.remove(`error`),r=!1,a!==void 0&&i(`aria-invalid`,a),o!==void 0&&i(`aria-describedby`,o),a=void 0,o=void 0};return i=>{if(!i){s();return}let c=e.closest(`.field`),l=c?.querySelector(`.field-error`);l&&l!==t&&l.textContent.trim()||(t||(r=!e.classList.contains(`error`),e.classList.add(`error`),a=e.getAttribute(`aria-invalid`),o=e.getAttribute(`aria-describedby`),c&&(t=document.createElement(`div`),t.className=`field-error`,e.id&&(t.id=`${e.id}-error`),n=c.querySelector(`.field-hint`),n&&(n.hidden=!0),c.insertBefore(t,[...c.children].find(e=>e.classList.contains(`field-count`))??null),t.id&&e.setAttribute(`aria-describedby`,t.id)),e.setAttribute(`aria-invalid`,`true`)),t&&(t.textContent=i))}}function be(e,{mask:t,postFormatted:n=!1,onChange:r,onInvalidChange:i}={}){let a=P(t);if(!a||!re.has(e.type))return()=>{};let o=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(o,`value`).set,c=!e.hasAttribute(`inputmode`);c&&e.setAttribute(`inputmode`,a.inputMode);let l=i??ye(e),u=null,d=!1,f=!1,p=!1,m=``,h=``,g,_=()=>{let e=p?m:``;e!==h&&(h=e,l(h))},v=(t,n,i)=>{let o=a.extract(t.slice(0,n)).length,c=a.extract(t),{text:l,isRaw:d}=a.layout(c);if(e.value!==l&&(s.call(e,l),document.activeElement===e&&re.has(e.type))){let t=he(d,o);e.setSelectionRange(t,t)}e.dataset.maskRaw=c,m=c&&!a.isValid(c)?a.message:``,e.setCustomValidity(m),_(),i&&c!==u&&r?.(c,l),u=c},y=Object.getOwnPropertyDescriptor(e,`value`),b=y??Object.getOwnPropertyDescriptor(o,`value`);Object.defineProperty(e,"value",{configurable:!0,enumerable:b.enumerable,get:()=>b.get.call(e),set:t=>{if(b.set.call(e,t),f)return;let n=F(a,e.value);v(n,n.length,!0)}});let x=()=>{d=!0,e.dispatchEvent(new Event(`input`,{bubbles:!0})),d=!1},S=t=>{if(d||f||t.isComposing)return;let n=t.inputType===`insertText`&&(t.data?.length??0)<=1||t.inputType?.startsWith(`delete`)?e.value:F(a,e.value);v(n,e.selectionStart??n.length,!0)},ee=()=>{f=!0},C=()=>{f=!1;let t=F(a,e.value);v(t,e.selectionStart??t.length,!0),x()},w=t=>{let n=t.inputType===`deleteContentBackward`;if(!n&&t.inputType!==`deleteContentForward`||t.isComposing)return;let r=e.selectionStart;if(r==null||r!==e.selectionEnd)return;let{isRaw:i}=a.layout(a.extract(e.value)),o=n?r-1:r;for(;o>=0&&o<i.length&&!i[o];)o+=n?-1:1;o!==(n?r-1:r)&&(t.preventDefault(),!(o<0||o>=i.length)&&(v(e.value.slice(0,o)+e.value.slice(o+1),n?o:r,!0),x()))},T=t=>{if(e.readOnly||e.disabled)return;let n=t.clipboardData?.getData(`text`);if(n==null)return;t.preventDefault();let r=F(a,n),i=e.selectionStart??e.value.length,o=e.selectionEnd??i;v(e.value.slice(0,i)+r+e.value.slice(o),i+r.length,!0),x()},E=()=>{let t=a.extract(e.value);return a.post(t,a.layout(t).text)},D=()=>{p=!0,_()};e.addEventListener(`input`,S),e.addEventListener(`beforeinput`,w),e.addEventListener(`paste`,T),e.addEventListener(`compositionstart`,ee),e.addEventListener(`compositionend`,C),e.addEventListener(`blur`,D),e.addEventListener(`invalid`,D);let O=e.form,te=t=>{e.name&&!e.disabled&&ve(t.formData,e.name,e.value,E())},k=()=>{clearTimeout(g),g=setTimeout(()=>{p=!1,v(F(a,e.value),e.value.length,!0)},0)};n||(O?.addEventListener(`formdata`,te),I.set(e,E)),O?.addEventListener(`reset`,k),O?.addEventListener(`submit`,D);let A=F(a,e.value);return v(A,A.length,!1),()=>{clearTimeout(g),e.removeEventListener(`input`,S),e.removeEventListener(`beforeinput`,w),e.removeEventListener(`paste`,T),e.removeEventListener(`compositionstart`,ee),e.removeEventListener(`compositionend`,C),e.removeEventListener(`blur`,D),e.removeEventListener(`invalid`,D),O?.removeEventListener(`formdata`,te),O?.removeEventListener(`reset`,k),O?.removeEventListener(`submit`,D),I.delete(e),y?Object.defineProperty(e,"value",y):delete e.value,p=!1,m=``,_(),e.setCustomValidity(``),delete e.dataset.maskRaw,c&&e.removeAttribute(`inputmode`)}}function xe(){let e=typeof window>`u`?void 0:window.jQuery?.validator?.prototype;if(!e||e.wuiMaskHook)return;let t=e.elementValue;e.elementValue=function(e){let n=ge(e);return n===void 0?t.call(this,e):n},e.wuiMaskHook=!0}var L=new WeakMap,R,Se=e=>{L.has(e)||L.set(e,be(e,{mask:e.dataset.appMask,postFormatted:e.hasAttribute(`data-mask-post-formatted`)}))},Ce=e=>e.nodeType===1?[...e.matches(`input[data-app-mask]`)?[e]:[],...e.querySelectorAll(`input[data-app-mask]`)]:[];function we(){R||typeof MutationObserver>`u`||(R=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Ce(e))L.get(t)?.(),L.delete(t);for(let e of t.addedNodes)for(let t of Ce(e))Se(t)}}),R.observe(document.documentElement,{childList:!0,subtree:!0}))}function Te(e=document){xe();for(let t of e.querySelectorAll(`input[data-app-mask]`))Se(t);e===document&&we()}var z={minLength:10,uppercase:!0,lowercase:!0,digit:!0,special:!0,uniqueChars:0,customRules:[]},Ee=`Password requirements`;function De(e){return e===!0||e==null?{...z}:{...z,...e}}function Oe(e){let t=De(e),n=[];if(t.minLength>0&&n.push({key:`length`,label:`At least ${t.minLength} characters long`,test:e=>e.length>=t.minLength}),t.uppercase&&n.push({key:`uppercase`,label:`At least one uppercase letter`,test:e=>/[A-Z]/.test(e)}),t.lowercase&&n.push({key:`lowercase`,label:`At least one lowercase letter`,test:e=>/[a-z]/.test(e)}),t.digit&&n.push({key:`digit`,label:`At least one digit`,test:e=>/[0-9]/.test(e)}),t.special&&n.push({key:`special`,label:`At least one special character`,test:e=>/[^A-Za-z0-9]/.test(e)}),t.uniqueChars>0){let e=t.uniqueChars;n.push({key:`unique`,label:`At least ${e} unique character${e>1?`s`:``}`,test:t=>new Set(t).size>=e})}for(let[e,r]of(t.customRules??[]).entries()){let t=new RegExp(r.pattern);n.push({key:`custom-${e}`,label:r.label,test:e=>t.test(e)})}return n}function ke(e,t){let n=e==null?``:String(e);return Oe(t).map(e=>({key:e.key,label:e.label,met:e.test(n)}))}function Ae(e,t){return ke(e,t).every(e=>e.met)}var je=`wui:row-drop`,B=`is-drop-over`,Me=`application/x-wui-rows`,Ne=`wui-row-dragging`,V=`[data-wui-drop-target]`,Pe=`tbody tr[data-row-key]`,Fe=`input, button, a, select, textarea, label`,Ie=`.wui-select-cell .wui-check`,H=new WeakMap,Le=new WeakSet,U=null,W=null;function Re(e){return e.querySelector(Ie)?.checked===!0}function G(e){return[...e.querySelectorAll(`tbody tr`)].filter(Re).map(e=>e.dataset.rowKey)}function K(){U=null,document.body.classList.remove(Ne);for(let e of document.querySelectorAll(`${V}.${B}`))e.classList.remove(B)}function ze(e,t,n){e.dispatchEvent(new CustomEvent(je,{bubbles:!0,detail:{keys:t,target:n.dataset.wuiDropTarget}}))}function Be(e){let t=e.target.closest?.(V);!t||!U||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,t.classList.add(B))}function Ve(e){let t=e.target.closest?.(V);!t||t.contains(e.relatedTarget)||t.classList.remove(B)}function He(e){let t=e.target.closest?.(V);if(!t||!U)return;e.preventDefault(),t.classList.remove(B);let{root:n,keys:r}=U;ze(n,r,t),K()}function Ue(e){let t=e.target.closest?.(V);!t||!W?.keys.length||(e.preventDefault(),ze(W.root,W.keys,t))}function We(e){(e.key===`Enter`||e.key===` `)&&Ue(e)}function Ge(e){Le.has(e)||(Le.add(e),e.addEventListener(`dragover`,Be),e.addEventListener(`dragenter`,Be),e.addEventListener(`dragleave`,Ve),e.addEventListener(`drop`,He),e.addEventListener(`click`,Ue),e.addEventListener(`keydown`,We))}function Ke(e){let t=H.get(e);if(t)return t;Ge(e.ownerDocument||e);let n=t=>{let n=t.target.closest?.(Pe);if(!n||!e.contains(n))return;let r=t.target.closest(Fe);r&&n.contains(r)||(n.draggable=!0)},r=t=>{let n=t.target.closest?.(Pe);if(!n||!e.contains(n))return;let r=Re(n)?G(e):[n.dataset.rowKey];t.dataTransfer.setData(Me,JSON.stringify(r)),t.dataTransfer.setData(`text/plain`,r.join(`,`)),t.dataTransfer.effectAllowed=`move`,U={root:e,keys:r},document.body.classList.add(Ne)},i=t=>{let n=t.detail?.selected;n>0?W={root:e,keys:t.detail.keys??G(e)}:n===0&&(W=null),q(document)};e.addEventListener(`pointerdown`,n),e.addEventListener(`dragstart`,r),e.addEventListener(`dragend`,K),e.addEventListener(`selectionchange`,i);let a=()=>{e.removeEventListener(`pointerdown`,n),e.removeEventListener(`dragstart`,r),e.removeEventListener(`dragend`,K),e.removeEventListener(`selectionchange`,i),H.delete(e)};return H.set(e,a),a}function q(e=document){let t=e.querySelector(`[data-wui-row-drag] tbody tr ${Ie}:checked`)!==null;for(let n of e.querySelectorAll(V)){n.tagName!==`BUTTON`&&(n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`)),t?n.removeAttribute(`aria-disabled`):n.setAttribute(`aria-disabled`,`true`);let e=n.getAttribute(`data-wui-drop-label`)||n.textContent.trim();n.setAttribute(`aria-label`,`Move to ${e}`)}for(let t of e.querySelectorAll(`.wui-drop-tray`))t.hasAttribute(`role`)||(t.setAttribute(`role`,`toolbar`),t.setAttribute(`aria-label`,`Move to`))}function qe(e=document){for(let t of e.querySelectorAll(`[data-wui-row-drag]`))Ke(t);q(e.ownerDocument||e)}var Je=`.table-wrap, .table-responsive, [class*="table-responsive-"]`,J=1;function Ye(e){let t=()=>{let t=e.scrollWidth-e.clientWidth,n=Math.abs(e.scrollLeft);e.toggleAttribute(`data-wui-overflow-start`,t>J&&n>J),e.toggleAttribute(`data-wui-overflow-end`,t>J&&n<t-J),e.toggleAttribute(`data-wui-overflow-top`,e.scrollTop>J)},n=()=>{if(e.scrollWidth-e.clientWidth>J){let t=getComputedStyle(e);e.style.setProperty(`--wui-scroll-pad-start`,t.paddingInlineStart),e.style.setProperty(`--wui-scroll-pad-end`,t.paddingInlineEnd)}else e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))},r=()=>{n(),t()};e.addEventListener(`scroll`,t,{passive:!0});let i=null;if(typeof ResizeObserver<`u`){i=new ResizeObserver(r),i.observe(e);for(let t of e.children)i.observe(t)}return r(),()=>{e.removeEventListener(`scroll`,t),i?.disconnect(),e.removeAttribute(`data-wui-overflow-start`),e.removeAttribute(`data-wui-overflow-end`),e.removeAttribute(`data-wui-overflow-top`),e.style.getPropertyValue(`--wui-scroll-pad-end`)&&(e.style.removeProperty(`--wui-scroll-pad-start`),e.style.removeProperty(`--wui-scroll-pad-end`))}}var Y=new WeakMap,Xe,Ze=e=>{Y.has(e)||Y.set(e,Ye(e))},Qe=e=>{if(e.nodeType!==1)return[];let t=e.matches(`.table-wrap, .table-responsive, [class*="table-responsive-"]`)?[e]:[];return e.firstElementChild===null?t:[...t,...e.querySelectorAll(Je)]};function $e(){Xe||typeof MutationObserver>`u`||(Xe=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)for(let t of Qe(e))Y.get(t)?.(),Y.delete(t);for(let e of t.addedNodes)for(let t of Qe(e))Ze(t)}}),Xe.observe(document.documentElement,{childList:!0,subtree:!0}))}function et(e=document){for(let t of e.querySelectorAll(Je))Ze(t);e===document&&$e()}var tt=`data-wui-submit-once`,X=`data-wui-submit-pending`,nt=new WeakSet,rt=new WeakMap;function it(e){return e.method===`post`&&e.target!==`_blank`&&e.getAttribute(`data-wui-submit-once`)!==`off`}function at(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!it(t))return;if(t.hasAttribute(X)){e.preventDefault();return}t.setAttribute(X,``);let n=e.submitter;setTimeout(()=>{if(t.hasAttribute(X)){if(e.defaultPrevented){t.removeAttribute(X);return}n&&(n.disabled=!0,rt.set(t,n))}},0)}function ot(e){for(let t of e.querySelectorAll(`form[${X}]`)){t.removeAttribute(X);let e=rt.get(t);e&&(e.disabled=!1,rt.delete(t))}}function st(e){let t=e.ownerDocument??e;nt.has(t)||(nt.add(t),t.addEventListener(`submit`,at,!0),t.defaultView?.addEventListener(`pageshow`,()=>ot(t)))}var ct=[`light`,`dark`,`auto`],lt=[`wave`,`circle`,`slide`,`blinds`,`fade`,`none`],ut=`wave`,Z=`theme`,dt={wave:1100,circle:700,slide:600,blinds:900,fade:350,none:0},ft=`wui-theme-switching`,pt=`wui:theme:change`,mt=`(prefers-color-scheme: dark)`,ht=e=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches,gt=e=>ct.includes(e);function _t(e){return e===`dark`||e===`auto`&&ht(mt)?`dark`:`light`}function vt(e=Z){let t=null;try{t=window.localStorage.getItem(e)}catch{}return gt(t)?t:`auto`}function yt(e,t=Z){try{window.localStorage.setItem(t,e)}catch{}}function bt(e){let t=document.documentElement,n=_t(e);t.setAttribute(`data-theme`,e),t.setAttribute(`data-bs-theme`,n),document.dispatchEvent(new CustomEvent(pt,{detail:{mode:n,preference:e}}))}var xt=`(function(k){var m;try{m=localStorage.getItem(k)}catch{}if(m!=='light'&&m!=='dark')m='auto';var r=document.documentElement,q=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null;function s(){var t=r.getAttribute('data-theme');r.setAttribute('data-bs-theme',t==='auto'?(q&&q.matches?'dark':'light'):t)}r.setAttribute('data-theme',m);s();if(q&&q.addEventListener)q.addEventListener('change',function(){if(r.getAttribute('data-theme')==='auto')s()})})(`;function St(e=Z){return`${xt}${JSON.stringify(String(e)).replace(/</g,`\\u003c`)})`}function Ct(e,{includeAuto:t=!1}={}){return e===`light`?`dark`:e===`dark`&&t?`auto`:`light`}function wt(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(mt),n=()=>e(t.matches?`dark`:`light`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Tt=60,Et=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,Q=e=>e.toFixed(1),$=(e,t)=>`${Q(e)}px ${Q(t)}px`,Dt={amplitude:22,segments:36,cycles:1.5,ripples:2},Ot=6,kt=(e,t,n,r,i)=>{let{amplitude:a,segments:o,cycles:s}=Dt,c=n*(t+2*a),l=i?t+a-c:c-a,u=i?t+2*a:-2*a,d=[$(0,u)];for(let t=0;t<=o;t++){let n=e*t/o,i=l+a*Math.sin(2*Math.PI*s*t/o+r);d.push($(n,i))}return d.push($(e,u)),`polygon(${d.join(`, `)})`},At=(e,t,n,r)=>{let i=t/Ot,a=[];for(let t=0;t<Ot;t++){let o=t*i,s=i*n,c=r?o+i-s:o,l=r?o+i:o+s;a.push($(0,c),$(e,c),$(e,l),$(0,l))}return`polygon(${a.join(`, `)})`};function jt(e,{width:t,height:n,to:r=`dark`,origin:i}={}){let a=r===`dark`,o=[];for(let r=0;r<=Tt;r++){let s=r/Tt,c=Et(s);switch(e){case`circle`:{let e=i?.x??t/2,r=i?.y??n/2,a=Math.hypot(Math.max(e,t-e),Math.max(r,n-r));o.push({clipPath:`circle(${Q(a*c)}px at ${Q(e)}px ${Q(r)}px)`});break}case`slide`:{let e=n*(1-c);o.push({clipPath:a?`inset(${Q(e)}px 0px 0px 0px)`:`inset(0px 0px ${Q(e)}px 0px)`});break}case`blinds`:o.push({clipPath:At(t,n,c,a)});break;case`fade`:o.push({clipPath:`none`,opacity:c});break;case`none`:return[];default:o.push({clipPath:kt(t,n,c,s*Dt.ripples*2*Math.PI,a)})}}return o}function Mt(e,{effect:t=ut,to:n,origin:r,duration:i}={}){let a=document.documentElement,o=n!==void 0&&a.getAttribute(`data-bs-theme`)===n;if(t===`none`||o||ht(`(prefers-reduced-motion: reduce)`)||typeof document.startViewTransition!=`function`||typeof a.animate!=`function`)return e(),Promise.resolve(!1);a.classList.add(ft);let s=document.startViewTransition(e),c=i??dt[t]??dt.wave;return s.ready.then(()=>{let e=jt(t,{width:window.innerWidth,height:window.innerHeight,to:n,origin:r});a.animate(e,{duration:c,easing:`linear`,fill:`both`,pseudoElement:`::view-transition-new(root)`})}).catch(()=>{}),s.finished.catch(()=>{}).then(()=>(a.classList.remove(ft),!0))}export{C as $,z as A,de as B,B as C,qe as D,Ke as E,re as F,O as G,pe as H,le as I,g as J,te as K,be as L,Oe as M,ke as N,q as O,Ae as P,w as Q,me as R,et as S,je as T,fe as U,ge as V,P as W,ee as X,T as Y,x as Z,wt as _,lt as a,e as at,Je as b,ft as c,r as ct,vt as d,c as dt,E as et,_t as f,s as ft,Mt as g,jt as h,pt as i,f as it,Ee as j,G as k,bt as l,i as lt,St as m,Z as n,l as nt,dt as o,t as ot,yt as p,o as pt,h as q,xt as r,m as rt,ct as s,n as st,ut as t,D as tt,Ct as u,a as ut,tt as v,Me as w,Ye as x,st as y,Te as z};