@webority/ui-elements 0.174.1 → 0.175.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 (118) hide show
  1. package/dist/{WuiCodeBlock-BJ14DaLH.js → WuiCodeBlock-BWYZ1S70.js} +1 -1
  2. package/dist/{WuiCommentThread-ChTsQWet.js → WuiCommentThread-C5n933uz.js} +1 -1
  3. package/dist/WuiContextMenu-DEWYYFRG.js +1 -0
  4. package/dist/{WuiDataTable-3Vd8EAMV.js → WuiDataTable-Ble3hl5L.js} +1 -1
  5. package/dist/{WuiDatePicker-CPr0Yni3.js → WuiDatePicker-3D33rzH4.js} +1 -1
  6. package/dist/{WuiDateRange-DvuE4wfG.js → WuiDateRange-qTncGobM.js} +1 -1
  7. package/dist/{WuiDropdown-5-6E5Q9d.js → WuiDropdown-6g074v1T.js} +1 -1
  8. package/dist/{WuiGantt-DJat5idS.js → WuiGantt-BqNhYIr6.js} +1 -1
  9. package/dist/{WuiInlineEdit-Bfe_m5px.js → WuiInlineEdit-BwB-w61N.js} +1 -1
  10. package/dist/{WuiLightbox-CuzbFBck.js → WuiLightbox-DpHJAMO3.js} +1 -1
  11. package/dist/{WuiMentionInput-Dmtm3N62.js → WuiMentionInput-DJv-WwW6.js} +1 -1
  12. package/dist/{WuiOrgTree-DYMNCGTh.js → WuiOrgTree-DWSk_LHd.js} +1 -1
  13. package/dist/{WuiPhone-BEyz-J2q.js → WuiPhone-CBge7oVA.js} +1 -1
  14. package/dist/WuiSelect-D89S-POU.js +1 -0
  15. package/dist/{WuiTimePicker-Bcc1PfCT.js → WuiTimePicker-DYLFaWDc.js} +1 -1
  16. package/dist/{WuiTour-C71Wmed-.js → WuiTour-BU00-6Lf.js} +1 -1
  17. package/dist/{WuiTree-BQk23SSF.js → WuiTree-CIOM1G59.js} +1 -1
  18. package/dist/WuiTreePicker-DLddmEgG.js +1 -0
  19. package/dist/{WuiWizardStep-Uag__kTu.js → WuiWizardStep-gFtuUzsL.js} +1 -1
  20. package/dist/{chips-BaB5xZXq.js → chips-_rw5Aev4.js} +1 -1
  21. package/dist/copyText-sHWcpcPm.js +1 -0
  22. package/dist/{drawerDiscard-DGmosZR2.js → drawerDiscard-D_n8guAp.js} +1 -1
  23. package/dist/elements/code-block.js +1 -1
  24. package/dist/elements/comment-thread.js +1 -1
  25. package/dist/elements/context-menu.js +1 -1
  26. package/dist/elements/data-table.js +1 -1
  27. package/dist/elements/date-range.js +1 -1
  28. package/dist/elements/datepicker.js +1 -1
  29. package/dist/elements/dropdown.js +1 -1
  30. package/dist/elements/gantt.js +1 -1
  31. package/dist/elements/inline-edit.js +1 -1
  32. package/dist/elements/lightbox.js +1 -1
  33. package/dist/elements/mention-input.js +1 -1
  34. package/dist/elements/org-tree.js +1 -1
  35. package/dist/elements/phone.js +1 -1
  36. package/dist/elements/select.js +1 -1
  37. package/dist/elements/timepicker.js +1 -1
  38. package/dist/elements/tour.js +1 -1
  39. package/dist/elements/tree-picker.js +1 -1
  40. package/dist/elements/tree.js +1 -1
  41. package/dist/elements/wizard.js +1 -1
  42. package/dist/{fileViewer.g-DupSpQYS.js → fileViewer.g-D_zLw_p-.js} +1 -1
  43. package/dist/{fileViewerImage-CCtdOYm3.js → fileViewerImage-DnzDd-rQ.js} +1 -1
  44. package/dist/{fileViewerMedia-Dbwn694I.js → fileViewerMedia-Dm99qAjY.js} +1 -1
  45. package/dist/{fileViewerPdf-Lu6vcnYW.js → fileViewerPdf-Tb26qdtM.js} +3 -3
  46. package/dist/helpers.js +1 -1
  47. package/dist/{iconGlyphs.g-Dj8sa1HF.js → iconGlyphs.g-a9FtjPXh.js} +1 -1
  48. package/dist/imeSafeEnter-DeO_3lXy.js +1 -0
  49. package/dist/{listboxKeyNav-DtlIOryj.js → listboxKeyNav-DNtuh6Ob.js} +1 -1
  50. package/dist/{menuKeyNav-CstMzU08.js → menuKeyNav-BCHtqitp.js} +1 -1
  51. package/dist/{optionLabel-CghX6DYo.js → optionLabel-wbpl8OTJ.js} +1 -1
  52. package/dist/{search-Cj1eEPIN.js → search-D-lfoHy9.js} +1 -1
  53. package/dist/server.js +1 -1
  54. package/dist/{themeTransition-CRnGw929.js → themeTransition-DBv2olsl.js} +1 -1
  55. package/dist/ui-calendar.global.js +1 -1
  56. package/dist/ui-calendar.js +1 -1
  57. package/dist/ui-chart.global.js +1 -1
  58. package/dist/ui-chart.js +1 -1
  59. package/dist/ui-consent-banner.global.js +1 -1
  60. package/dist/ui-elements/carousel.global.js +1 -1
  61. package/dist/ui-elements/code-block.global.js +1 -1
  62. package/dist/ui-elements/command-palette.global.js +2 -2
  63. package/dist/ui-elements/comment-thread.global.js +1 -1
  64. package/dist/ui-elements/consent-banner.global.js +1 -1
  65. package/dist/ui-elements/context-menu.global.js +1 -1
  66. package/dist/ui-elements/date-range.global.js +1 -1
  67. package/dist/ui-elements/date-time.global.js +1 -1
  68. package/dist/ui-elements/datepicker.global.js +1 -1
  69. package/dist/ui-elements/drawer.global.js +1 -1
  70. package/dist/ui-elements/dropdown.global.js +1 -1
  71. package/dist/ui-elements/entry-grid.global.js +2 -2
  72. package/dist/ui-elements/gantt.global.js +1 -1
  73. package/dist/ui-elements/glyphs.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/lead-popup.global.js +2 -2
  78. package/dist/ui-elements/lightbox.global.js +1 -1
  79. package/dist/ui-elements/markdown.global.js +3 -3
  80. package/dist/ui-elements/org-tree.global.js +1 -1
  81. package/dist/ui-elements/phone.global.js +1 -1
  82. package/dist/ui-elements/popover.global.js +1 -1
  83. package/dist/ui-elements/saved-views.global.js +1 -1
  84. package/dist/ui-elements/select-chips.global.js +1 -1
  85. package/dist/ui-elements/select-recents.global.js +1 -1
  86. package/dist/ui-elements/select-search.global.js +1 -1
  87. package/dist/ui-elements/select-window.global.js +1 -1
  88. package/dist/ui-elements/slider.global.js +1 -1
  89. package/dist/ui-elements/sortable.global.js +1 -1
  90. package/dist/ui-elements/status-icon.global.js +1 -1
  91. package/dist/ui-elements/table-export.global.js +1 -1
  92. package/dist/ui-elements/timepicker.global.js +1 -1
  93. package/dist/ui-elements/tour.global.js +1 -1
  94. package/dist/ui-elements/tree-picker.global.js +1 -1
  95. package/dist/ui-elements/tree.global.js +1 -1
  96. package/dist/ui-elements/wizard.global.js +1 -1
  97. package/dist/ui-elements.global.js +1 -1
  98. package/dist/ui-elements.js +1 -1
  99. package/dist/ui-file-viewer.global.js +4 -4
  100. package/dist/ui-file-viewer.js +1 -1
  101. package/dist/ui-lead-popup.global.js +1 -1
  102. package/dist/ui-rich-text.global.js +53 -53
  103. package/dist/ui-rich-text.js +51 -51
  104. package/dist/ui-tour.global.js +1 -1
  105. package/package.json +5 -5
  106. package/types/codeHighlight.d.ts +2 -1
  107. package/types/copyText.d.ts +2 -3
  108. package/types/global/shared.d.ts +47 -46
  109. package/types/imeSafeEnter.d.ts +7 -0
  110. package/types/razor-js/modules/api.d.ts +8 -5
  111. package/types/razor-js/modules/look.d.ts +4 -5
  112. package/types/razor-js/modules/pageListeners.d.ts +1 -1
  113. package/types/razor-js/webority-ui.d.ts +14 -38
  114. package/dist/WuiContextMenu-T-pkqJdV.js +0 -1
  115. package/dist/WuiSelect-C_nfrNr5.js +0 -1
  116. package/dist/WuiTreePicker-DP1lCno3.js +0 -1
  117. package/dist/copyText-Q-QZKBmx.js +0 -1
  118. package/dist/imeSafeEnter-DPs9qL3S.js +0 -1
@@ -1 +1 @@
1
- var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,l=`AppButton`,u=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),d={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function f(e){return c(d,e)}function p(e=`primary`,t=`solid`,n=`md`){if(!u.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!f(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=d[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function m(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var h=`data-wui-dismiss`,g=`data-wui-closing`,_=`[${h}]`,v=`(prefers-reduced-motion: reduce)`,y=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,b=new WeakSet,x=Symbol.for(`webority.ui.modal-stack`),ee=Symbol.for(`webority.ui.root-watches`);function te(e){let t=e;return t[ee]??=new Set,t[ee]}function ne(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(y))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${_},.wui-modal-back`))return t;n??=t}return n}function re(e){let t=[],n=new Map;for(let r of e.querySelectorAll(y))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[x]??=[],t[x]}function ie(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of te(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ae(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function oe(e,t){let n=t.focus===`first-control`?ne(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),b.add(e);let o=()=>{if(ie(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&b.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=re(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(_);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),b.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),b.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function se(e){b.delete(e),e.setAttribute(g,``),!window.matchMedia(v).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ae(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(g)}function ce(e){if(le(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function le(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var ue=/\{([A-Za-z0-9_]+)\}/g,de=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,fe=new Map,pe=0,me=new Map;function E(e,t){let n=fe.get(e);if(n===void 0)return t;let r=me.get(e);if(r!==void 0&&r.version===pe&&r.english===t&&ge(r.merged,t))return r.merged;let i=he(e,n,t);return me.set(e,{version:pe,english:t,merged:i}),i}function he(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=de(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function ge(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>de(e,t))}function D(e){return Array.from(e.matchAll(ue),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},_e={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ve=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ye=()=>E(`tourAdvance`,_e),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),be=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,xe=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function Se(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(be(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function Ce(e){for(let t of[e,...e.querySelectorAll(ve)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!xe(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function we(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Te(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Ee=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&Ee(n)),o&&n.setAttribute(k,``),Te(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||Se(a):``,l=e.getAttribute(`advance-label`)||ye().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return we(r,u),u}function De(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Oe(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function ke(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?Ce(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Ae(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Me)}function je(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Me(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var Ne=2/3,Pe=1e3,Fe=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],V=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Ie=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Fe.has(e.transitionProperty),Le=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function H(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Pe);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Re(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Ie):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*Ne-r)}return n}function ze(e){let t=Re(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,Le);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function Be(e){return e.dataset.state=`leaving`,H(B(e,V))}function Ve(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?H(B(n,V)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var He=2,U=12,W=8,Ue=4,G=20,We=`(max-width: 575.98px)`,Ge=[`bottom`,`top`,`right`,`left`],Ke=[`bottom`,`top`,`left`,`right`],qe=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Je,K=(e,t,n)=>Math.max(t,Math.min(e,n)),q=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Ye(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=tt(e),r=e.offsetHeight+U;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+He}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function Xe(e,t,n){let r=e.style,a=t.style,o=nt(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of qe)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,Ze(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=tt(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-U,top:s.top-U-u.top,right:u.right-s.right-U,left:s.left-U-u.left},p=window.matchMedia(We).matches,m=(i(n)?Ke:Ge).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+W)-Math.max(s.top,u.top-W);m?Qe(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?$e(t,o,s,u,l):et(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function Ze(e,t){Je??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of qe)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),Je&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function Qe(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=q(r.left,r.right,i.left,i.right);s=K(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+U:r.top-U-a.height,l=K(e-s,G,a.width-G)}else{let e=q(r.top,r.bottom,i.top,i.bottom);c=K(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+U:r.left-U-a.width,l=K(e-c,G,a.height-G)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function $e(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-Ue;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${K(n.left+Ue,r.left,r.right-i.width)}px`}function et(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+U:r.top-U-c}px`;let l=q(r.left,r.right,i.left,i.right);e.style.left=`${K(l-a.width/2,i.left,i.right-a.width)}px`}function tt(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+W,bottom:window.innerHeight-r(`paddingBottom`)-W,left:r(`paddingLeft`)+W,right:window.innerWidth-r(`paddingRight`)-W}}function nt(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var rt=0,it=`btn btn-sm btn-link`;function J(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function at(e,t){let n=`wui-tour-end-${++rt}`,{nextLabel:r,nextHref:i}=e,a=r&&i?m(`a`,{class:`${p(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":l,href:i},r):null,o=a!==null,s=m(`button`,{type:`button`,class:`${o?it:p(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":l},e.button);return m(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},m(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},je({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),m(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),m(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),m(`div`,{class:`wui-tour-actions`},a,s))}var ot=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function st(e,t,n){let r=e.ownerDocument,i=at(t,e.getRootNode()===r),a=J(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,se(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=J(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=J(e,`.wui-tour-spot`,HTMLElement),h=J(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{ot(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else Ae(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,Xe(m,p,null),e.append(i),ze(i),u&&(d=oe(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=Be(p);v===null?_():v.then(_)})}var ct=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,lt=()=>E(`tour`,O),ut=`wui-tour-media`,dt=`wui-tour-media-toggle`,ft=`http://www.w3.org/2000/svg`,pt=`M6 5h4v14H6zM14 5h4v14h-4z`,mt=`M8 5v14l11-7z`,ht=()=>({pause:lt().mediaPauseLabel,play:lt().mediaPlayLabel}),gt=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function _t(e){let t=document.createElementNS(ft,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(ft,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function vt(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function yt(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function bt(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=dt;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(_t(r?pt:mt))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function xt(e){let t=e.querySelector(`:scope > .${ut}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function St(e,t,n=ht()){if(xt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=ut,t.mediaType===`video`){let e=yt(t,!gt());r.append(e,bt(e,n))}else r.appendChild(vt(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Y=`data-wui-tour-open`,Ct=()=>E(`tour`,O);function wt(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function Tt(e,t,n){return(e.getAttribute(`progress-label`)||Ct().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function Et(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var Dt=`wui-tour-seen:`;function Ot(e=Dt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var kt=`wui-tour-step`,At=`wui-tour-host`,X=`data-tracking`,Z=()=>E(`tour`,O),jt=()=>({back:Z().backLabel,next:Z().nextLabel,skip:Z().skipLabel,done:Z().doneLabel,mediaPause:Z().mediaPauseLabel,mediaPlay:Z().mediaPlayLabel,endTitle:Z().endTitle,endMessage:Z().endMessage,endButton:Z().doneLabel}),Mt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},Nt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Pt={index:null,position:null,total:null},Ft=0,It=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Lt=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Rt=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function zt(e){$||($=new CSSStyleSheet,$.replaceSync(ct)),e.adoptedStyleSheets=[$]}var Bt=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=wt(0);_firstIndex=0;_returnFocus=null;_current=null;_moving=!1;_card=null;_spot=null;_live=null;_onKey=null;_onFocusIn=null;static get observedAttributes(){return[`open`]}constructor(){super(),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${kt}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of Nt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Ot():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Mt[e])||jt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=wt(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!It(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(It(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Ft}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(m(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),m(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},m(`p`,{class:`wui-tour-position`}),m(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),m(`p`,{class:`wui-tour-text`,id:`${e}-text`}),m(`div`,{class:`wui-tour-actions`},m(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),m(`div`,{class:`wui-tour-nav`},m(`button`,{type:`button`,class:`${p(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":l}),m(`button`,{type:`button`,class:`${p(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":l})))),m(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(At),this._shadow=n.attachShadow({mode:`open`}),zt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(Y,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),i=Q(t,`.wui-tour-card`,HTMLDivElement),a=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Q(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let c=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Oe(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=c,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,c),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),ce(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=Tt(this,c,l);Et(o,{text:d,position:c,total:l}),St(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Q(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Q(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Q(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Q(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Q(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Ye(o,n),a.removeAttribute(X),this._place(),ze(o),this._unbindAdvance?.(),this._unbindAdvance=De(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Lt(Rt()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);Xe(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(X,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=Be(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(X),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),st(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(Lt(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);ke(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);Ve(t),document.documentElement.removeAttribute(Y),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Pt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Pt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},Vt=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Bt),t(`wui-tour-step`,Vt),e.WuiTourStep=Vt,e})({});
1
+ var WeborityTour=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var n=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(n);var r=HTMLElement;function i(e){return getComputedStyle(e).direction===`rtl`}function a(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}function o(e,t){s(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function s(e){if(!e?._reanchor)return;window.removeEventListener(`resize`,e._reanchor);let t=e._reanchorScroll;t&&window.removeEventListener(`scroll`,t,!0),e._reanchor=null,e._reanchorScroll=null}var c=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,l=`AppButton`,u=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),d={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function f(e){return c(d,e)}function p(e=`primary`,t=`solid`,n=`md`){if(!u.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!f(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=d[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}function m(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var h=`data-wui-dismiss`,g=`data-wui-closing`,_=`[${h}]`,v=`(prefers-reduced-motion: reduce)`,y=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,b=new WeakSet,x=Symbol.for(`webority.ui.modal-stack`),ee=Symbol.for(`webority.ui.root-watches`);function te(e){let t=e;return t[ee]??=new Set,t[ee]}function ne(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(y))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${_},.wui-modal-back`))return t;n??=t}return n}function re(e){let t=[],n=new Map;for(let r of e.querySelectorAll(y))if(!(r.closest(`[hidden],[inert]`)||r.closest(`dialog`)!==e)&&!(r.tabIndex<0||r.getClientRects().length===0)){if(r instanceof HTMLInputElement&&r.type===`radio`&&r.name){let e=n.get(r.name);e?r.checked&&!e.checked&&(e.checked=r,t[t.indexOf(e.first)]=r):(n.set(r.name,{first:r,checked:r.checked?r:null}),t.push(r))}else t.push(r)}return t}function S(e){let t=e;return t[x]??=[],t[x]}function ie(e){C(e),S(e.ownerDocument).push(e)}function C(e){let t=S(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function w(e){for(let t of te(e)){let n=T(e);t.last!==n&&(t.last=n,t.listener(n))}}function ae(e){let t=Promise.allSettled(e.getAnimations().map(e=>e.finished));return new Promise(e=>{let n=window.setTimeout(e,400);t.then(()=>{window.clearTimeout(n),e()})})}function oe(e,t){let n=t.focus===`first-control`?ne(e):null,r=n??e,i=r===e&&!e.hasAttribute(`tabindex`);i&&e.setAttribute(`tabindex`,`-1`);let a=!t.escape&&!e.hasAttribute(`closedby`);a&&e.setAttribute(`closedby`,`none`),b.add(e);let o=()=>{if(ie(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw C(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),w(e.ownerDocument)},s=!1,c=n=>{if(n.key!==`Escape`||n.defaultPrevented||!t.escape||n.altKey||n.ctrlKey||n.metaKey)return;let r=e.ownerDocument;T(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&b.has(e)&&e.open&&(s=!1,t.onRequestClose(`escape`))},0)))},l=t=>{if(t.key!==`Tab`||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)return;let n=e.ownerDocument;if(T(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=re(e),i=r[0],a=r[r.length-1];if(!i||!a){e.focus();return}let o=n.activeElement,s=o?r.findIndex(e=>e===o||e.contains(o)):-1;s<0?(t.shiftKey?a:i).focus():r[((t.shiftKey?s-1:s+1)+r.length)%r.length]?.focus()},u=e=>{s=!1,e.preventDefault(),t.escape&&t.onRequestClose(`escape`)},d=n=>{let r=n.target;if(!(r instanceof Element))return;let i=r.closest(_);if(i&&i.closest(`dialog`)===e){t.onRequestClose(`dismiss`);return}if(r!==e||!t.backdrop)return;let a=e.getBoundingClientRect();(n.clientX<a.left||n.clientX>a.right||n.clientY<a.top||n.clientY>a.bottom)&&t.onRequestClose(`backdrop`)},f=()=>{let n=s;s=!1,C(e),b.has(e)?(o(),n&&t.onRequestClose(`escape`)):w(e.ownerDocument)},p=e.ownerDocument;return p.addEventListener(`keydown`,c),p.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{p.removeEventListener(`keydown`,c),p.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),b.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),C(e),w(e.ownerDocument)}}async function se(e){b.delete(e),e.setAttribute(g,``),!window.matchMedia(v).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ae(e),e.close(),C(e),w(e.ownerDocument),e.removeAttribute(g)}function ce(e){if(le(e),!e.isConnected)throw Error(`nativeOverlay: raisePopover was given a panel that is not on the page; a caller whose overlay root can leave the page skips the raise until the panel moves to the new root`);e.hidePopover(),e.showPopover()}function le(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function T(e=document){let t=S(e);for(let e=t.length-1;e>=0;e--){let n=t[e];if(n?.isConnected&&n.hasAttribute(`open`))return n}return e.body}var ue=/\{([A-Za-z0-9_]+)\}/g,de=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,fe=new Map,pe=0,me=new Map;function E(e,t){let n=fe.get(e);if(n===void 0)return t;let r=me.get(e);if(r!==void 0&&r.version===pe&&r.english===t&&ge(r.merged,t))return r.merged;let i=he(e,n,t);return me.set(e,{version:pe,english:t,merged:i}),i}function he(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=de(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=D(t);for(let t of D(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function ge(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>de(e,t))}function D(e){return Array.from(e.matchAll(ue),e=>e[1]??``)}var O={backLabel:`Back`,doneLabel:`Done`,endMessage:`You know your way around now. Enjoy exploring.`,endTitle:`You're all set`,mediaPauseLabel:`Pause animation`,mediaPlayLabel:`Play animation`,nextLabel:`Next`,progressLabel:`Step {current} of {total}`,skipLabel:`Skip`},_e={advanceLabel:`Click {actionName} to continue.`},k=`data-advance`,A=`wui-tour-hint`,j=`wui-tour-pointer`,ve=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ye=()=>E(`tourAdvance`,_e),M=(e,t)=>e?.advanceOn===`click`&&!!t,N=e=>(e??``).replace(/\s+/g,` `).trim(),be=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLMeterElement||e instanceof HTMLOutputElement||e instanceof HTMLProgressElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.labels:null,xe=e=>e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLFieldSetElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement?e.disabled:!1;function Se(e){let t=e.ownerDocument,n=(e.getAttribute(`aria-labelledby`)||``).split(/\s+/).filter(Boolean),r=e instanceof HTMLInputElement&&/^(button|submit|reset)$/.test(e.type)?e.value:``,i=[n.map(e=>t.getElementById(e)?.textContent??``).join(` `),e.getAttribute(`aria-label`),Array.from(be(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=N(e);if(t)return t}return``}function Ce(e){for(let t of[e,...e.querySelectorAll(ve)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!xe(t))return t;return null}function P(e,t,n){let r=(e.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(e=>e&&e!==t);n&&r.push(t),r.length>0?e.setAttribute(`aria-describedby`,r.join(` `)):e.removeAttribute(`aria-describedby`)}function we(e,t){let n=e.querySelector(`.${A}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&P(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=A,i&&(n.id=i);let t=e.querySelector(`.wui-tour-actions`);if(!t)throw Error(`Tour card has no actions row.`);t.before(n)}n.textContent=t,i&&P(e,i,!0)}}function Te(e,t){let n=e.querySelector(`.${j}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=j,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Ee=e=>getComputedStyle(e).animationName;function F(e,{layer:t,spot:n,card:r},i,a){let o=M(i,a);t.toggleAttribute(k,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(k)&&(n.removeAttribute(k),o&&Ee(n)),o&&n.setAttribute(k,``),Te(n,o);let s=r.querySelector(`.wui-tour-next`);if(!(s instanceof HTMLElement))throw Error(`Tour card has no next button.`);s.classList.toggle(`btn-primary`,!o),s.classList.toggle(`btn-link`,o);let c=o?N(i?.actionLabel)||Se(a):``,l=e.getAttribute(`advance-label`)||ye().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return we(r,u),u}function De(e,t,n){if(!M(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function Oe(e,t,n,r){return e.contains(r)||M(t,n)&&n.contains(r)}function ke(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=M(r,i)?Ce(i):null;o&&a.push(o);let s=a.findIndex(e=>e===n||e===o&&i?.contains(n));e.preventDefault();let c=a[s===-1?e.shiftKey?a.length-1:0:(s+(e.shiftKey?-1:1)+a.length)%a.length];if(!c)throw Error(`Tour card has no focus stop.`);c.focus()}function Ae(e){return e.isComposing||e.keyCode===229}function je(e){return e.key===`Enter`&&!Ae(e)}var I=`http://www.w3.org/2000/svg`;function L(e){return e.map(Ne)}function Me(e,t){let n=document.createElementNS(I,`svg`);return R(n,e),n.append(...L(t)),n}function Ne(e){let[t,n,r]=e,i=document.createElementNS(I,t);return R(i,n),typeof r==`string`?i.append(document.createTextNode(r)):r&&i.append(...L(r)),i}function R(e,t){for(let[n,r]of Object.entries(t))r===!0?e.setAttribute(n,``):(typeof r==`string`||typeof r==`number`)&&e.setAttribute(n,String(r))}var Pe=2/3,Fe=1e3,Ie=new Set([`top`,`left`,`width`,`height`]),z=new WeakMap,B=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],Le=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Re=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Ie.has(e.transitionProperty),ze=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function Be(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,Fe);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Ve(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?B(t,Re):[]){let t=e.effect?.getComputedTiming?.();if(typeof t?.duration!=`number`)continue;let r=typeof e.currentTime==`number`?e.currentTime:0;n=Math.max(n,(t.delay??0)+t.duration*Pe-r)}return n}function He(e){let t=Ve(e);t>0?e.style.setProperty(`--wui-tour-card-delay`,`${Math.round(t)}ms`):e.style.removeProperty(`--wui-tour-card-delay`),e.dataset.state=`entering`;let n={};z.set(e,n);let r=()=>{z.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=B(e,ze);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function Ue(e){return e.dataset.state=`leaving`,Be(B(e,Le))}function We(e){let t=e.shadowRoot?.querySelector(`.wui-tour-layer`),n=e.classList.contains(`wui-tour-layer`)?e:t instanceof HTMLElement?t:null;n&&(n.dataset.state=`leaving`);let r=n?Be(B(n,Le)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Ge=2,V=12,H=8,Ke=4,U=20,qe=`(max-width: 575.98px)`,Je=[`bottom`,`top`,`right`,`left`],Ye=[`bottom`,`top`,`left`,`right`],Xe=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Ze,W=(e,t,n)=>Math.max(t,Math.min(e,n)),G=(e,t,n,r)=>(Math.max(e,n)+Math.min(t,r))/2;function Qe(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=it(e),r=e.offsetHeight+V;if(t.getBoundingClientRect().height+4+r*2<=n.bottom-n.top){t.scrollIntoView({block:`center`,inline:`nearest`});return}let i=t.style.scrollMarginTop;t.style.scrollMarginTop=`${n.top+r+Ge}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function $e(e,t,n){let r=e.style,a=t.style,o=at(t);if(!n){r.top=`50%`,r.left=`50%`,r.width=`0px`,r.height=`0px`,r.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`;for(let e of Xe)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,o.hidden=!0,a.position=`fixed`,a.top=`50%`,a.left=`50%`,a.transform=`translate(-50%, -50%)`,a.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,a.transform=``,a.position=`fixed`;let s=n.getBoundingClientRect();r.top=`${s.top}px`,r.left=`${s.left}px`,r.width=`${s.width}px`,r.height=`${s.height}px`,et(r,n);let c=t.scrollTop;a.maxHeight=``;let l={width:t.offsetWidth,height:t.offsetHeight},u=it(t),d=u.bottom-u.top,f={bottom:u.bottom-s.bottom-V,top:s.top-V-u.top,right:u.right-s.right-V,left:s.left-V-u.left},p=window.matchMedia(qe).matches,m=(i(n)?Ye:Je).find(e=>e===`top`||e===`bottom`?l.height<=f[e]+1:!p&&l.width<=f[e]+1&&l.height<=d+1),h=Math.min(s.bottom,u.bottom+H)-Math.max(s.top,u.top-H);m?tt(t,o,m,s,u,l):h>=Math.min(l.height,d)+8?nt(t,o,s,u,l):rt(t,o,f.bottom>=f.top?`bottom`:`top`,s,u,l,f),t.scrollTop=c}function et(e,t){Ze??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of Xe)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),Ze&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function tt(e,t,n,r,i,a){let o=n===`top`||n===`bottom`,s,c,l;if(o){let e=G(r.left,r.right,i.left,i.right);s=W(e-a.width/2,i.left,i.right-a.width),c=n===`bottom`?r.bottom+V:r.top-V-a.height,l=W(e-s,U,a.width-U)}else{let e=G(r.top,r.bottom,i.top,i.bottom);c=W(e-a.height/2,i.top,i.bottom-a.height),s=n===`right`?r.right+V:r.left-V-a.width,l=W(e-c,U,a.height-U)}e.dataset.placement=n,e.style.top=`${c}px`,e.style.left=`${s}px`,t.hidden=!1,t.style.left=o?`${l-e.clientLeft-t.offsetWidth/2}px`:``,t.style.top=o?``:`${l-e.clientTop-t.offsetHeight/2}px`}function nt(e,t,n,r,i){let a=r.bottom-r.top;e.dataset.placement=`overlap`,t.hidden=!0,e.style.maxHeight=i.height>a?`${Math.max(a,0)}px`:``;let o=Math.min(n.bottom,r.bottom)-Ke;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+Ke,r.left,r.right-i.width)}px`}function rt(e,t,n,r,i,a,o){let s=Math.max(o[n],0),c=Math.min(a.height,s);e.dataset.placement=n,t.hidden=!0,e.style.maxHeight=a.height>s?`${s}px`:``,e.style.top=`${n===`bottom`?r.bottom+V:r.top-V-c}px`;let l=G(r.left,r.right,i.left,i.right);e.style.left=`${W(l-a.width/2,i.left,i.right-a.width)}px`}function it(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+H,bottom:window.innerHeight-r(`paddingBottom`)-H,left:r(`paddingLeft`)+H,right:window.innerWidth-r(`paddingRight`)-H}}function at(e){let t=e.querySelector(`:scope > .wui-tour-arrow`);if(t instanceof HTMLElement)return t;let n=document.createElement(`span`);return n.className=`wui-tour-arrow`,n.setAttribute(`aria-hidden`,`true`),n.hidden=!0,e.append(n),n}var ot=0,st=`btn btn-sm btn-link`;function K(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`Expected "${t}" to match a ${n.name}.`);return r}function ct(e,t){let n=`wui-tour-end-${++ot}`,{nextLabel:r,nextHref:i}=e,a=r&&i?m(`a`,{class:`${p(`primary`,`solid`,`sm`)} wui-tour-end-next`,"data-wui":l,href:i},r):null,o=a!==null,s=m(`button`,{type:`button`,class:`${o?st:p(`primary`,`solid`,`sm`)} wui-tour-end-button`,"data-wui":l},e.button);return m(t?`dialog`:`div`,{class:`wui-tour-card wui-tour-end`,"data-layout":`center`,"data-next":o||void 0,role:`dialog`,tabindex:-1,"aria-labelledby":`${n}-title`,"aria-describedby":`${n}-message`},m(`div`,{class:`wui-tour-end-mark`,"aria-hidden":`true`},Me({viewBox:`0 0 24 24`,focusable:`false`},[[`path`,{d:`M5 12.5l4.5 4.5L19 7.5`}]])),m(`h2`,{class:`wui-tour-title wui-tour-end-title`,id:`${n}-title`},e.title),m(`p`,{class:`wui-tour-text wui-tour-end-message`,id:`${n}-message`},e.message),m(`div`,{class:`wui-tour-actions`},a,s))}var lt=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function ut(e,t,n){let r=e.ownerDocument,i=ct(t,e.getRootNode()===r),a=K(i,`.wui-tour-end-button`,HTMLButtonElement),o=i.querySelector(`.wui-tour-end-next`);if(o!==null&&!(o instanceof HTMLAnchorElement))throw Error(`The end dialog's next link is not a link.`);let s=o,c=s??a,l=new AbortController,u=i instanceof HTMLDialogElement?i:null,d=null;return new Promise(o=>{let f=e=>{if(l.abort(),d&&u){let e=d;d=null,se(u).then(e)}o(e)};if(n?.aborted){f(`done`);return}let p=K(e,`.wui-tour-card:not(.wui-tour-end)`,HTMLElement),m=K(e,`.wui-tour-spot`,HTMLElement),h=K(e,`[role=status]`,HTMLElement),g={signal:l.signal};n?.addEventListener(`abort`,()=>f(`done`),g),a.addEventListener(`click`,()=>f(`done`),g),s&&s.addEventListener(`click`,e=>{lt(e)&&(e.preventDefault(),f(`next`))},g),r.addEventListener(`keydown`,e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){if(d)return;e.preventDefault(),e.stopPropagation(),f(`done`)}else je(e)&&s&&!e.shiftKey&&(e.composedPath?.()[0]??e.target)===s&&(e.preventDefault(),f(`next`))}},{capture:!0,signal:l.signal});let _=()=>{l.signal.aborted||(p.hidden=!0,$e(m,p,null),e.append(i),He(i),u&&(d=oe(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=Ue(p);v===null?_():v.then(_)})}var dt=` :host { all: initial; display: revert-layer; position: fixed; inset: 0; ${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-popover":`0px 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--wui-ease-out":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-ease-linear":`cubic-bezier(0, 0, 1, 1)`,"--wui-duration-fast":`150ms`,"--wui-duration-default":`250ms`,"--wui-duration-slow":`400ms`,"--wui-space-xs":`4px`,"--wui-tour-motion-duration":`200ms`,"--wui-tour-motion-ease":`cubic-bezier(0.22, 1, 0.36, 1)`,"--wui-tour-spot-duration":`240ms`,"--wui-tour-spot-ease":`cubic-bezier(0.32, 0.72, 0, 1)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-text":`#4F46E5`,"--color-focus-ring":`#4F46E5`,"--wui-focus-ring-width":`2px`,"--wui-focus-ring-offset":`2px`,"--color-on-primary":`#FFFFFF`,"--color-success-soft":`#E8FAEE`,"--color-success-text":`#0e7531`,"--color-on-scrim":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-bg-muted":`#F5F6FA`}).map(([e,t])=>` ${e}: ${t};`).join(` `)} } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; } .btn { display: inline-block; margin: 0; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } .btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); } .btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); } .btn-outline-neutral { border-color: var(--color-text-muted); color: var(--color-text-muted); } .btn-outline-neutral:hover { background: var(--color-bg-muted); color: var(--color-text); } .btn-link { font-weight: 400; color: var(--color-primary-text); text-decoration: underline; } .btn-link:hover { color: var(--color-primary-hover); } .wui-tour-layer { pointer-events: none; font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--color-text); text-align: start; } .wui-tour-card { pointer-events: auto; } .wui-tour-layer { position: fixed; inset: 0; z-index: var(--wui-z-tour); width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; background: none; } .wui-tour-spot { position: fixed; box-shadow: 0 0 0 2px var(--color-primary), 0 0 4px 2px color-mix(in srgb, var(--color-primary) 30%, transparent), 0 0 0 100vmax var(--color-scrim-strong); pointer-events: none; } .wui-tour-card { display: flex; flex-direction: column; gap: 8px; width: min(360px, 100vw - 16px); padding: 16px; overflow-y: auto; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--wui-radius-lg); corner-shape: squircle; box-shadow: var(--wui-shadow-popover); } .wui-tour-card:focus { outline: none; } .wui-tour-card:focus-visible { outline: var(--wui-focus-ring-width) solid var(--color-focus-ring); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-title { margin: 0; font-size: 16px; font-weight: 600; } .wui-tour-text { margin: 0; font-size: 14px; color: var(--color-text-muted); } .wui-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; } .wui-tour-nav { display: flex; gap: 8px; } .wui-tour-skip { color: var(--color-text-muted); } .wui-tour-back, .wui-tour-next { min-width: 64px; } @keyframes wui-tour-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes wui-tour-card-enter { from { opacity: 0; scale: 0.96; translate: var(--wui-tour-card-lift, 0 6px); } to { opacity: 1; scale: 1; translate: 0 0; } } .wui-tour-layer[data-state=leaving], .wui-tour-card[data-state=leaving] { opacity: 0; } .wui-tour-layer[data-state=leaving], .wui-tour-layer[data-state=leaving] * { pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-tour-motion-duration) var(--wui-tour-motion-ease); } .wui-tour-spot { transition: top var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), left var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), width var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), height var(--wui-tour-spot-duration) var(--wui-tour-spot-ease), border-radius var(--wui-tour-spot-duration) var(--wui-tour-spot-ease); } .wui-tour-spot[data-tracking] { transition: none; } .wui-tour-card { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=top] { --wui-tour-card-lift: 0 -6px; transform-origin: bottom center; } .wui-tour-card[data-placement=bottom] { --wui-tour-card-lift: 0 6px; transform-origin: top center; } .wui-tour-card[data-placement=left] { --wui-tour-card-lift: -6px 0; transform-origin: right center; } .wui-tour-card[data-placement=right] { --wui-tour-card-lift: 6px 0; transform-origin: left center; } .wui-tour-card[data-placement=overlap], .wui-tour-card[data-placement=center] { --wui-tour-card-lift: 0 0; transform-origin: center; } .wui-tour-card[data-state=entering] { animation: wui-tour-card-enter var(--wui-tour-motion-duration) var(--wui-tour-motion-ease) var(--wui-tour-card-delay, 0ms) both; } .wui-tour-card[data-state=leaving] { transition: opacity calc(var(--wui-tour-motion-duration) / 2) var(--wui-tour-motion-ease); } } @media (prefers-reduced-motion: reduce) { .wui-tour-layer { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-layer[data-state=leaving] { transition: opacity var(--wui-duration-fast) var(--wui-ease-linear); } .wui-tour-card[data-state=entering] { animation: wui-tour-fade-in var(--wui-duration-fast) var(--wui-ease-linear) both; } } .wui-tour-progress-bar { display: flex; gap: 4px; } .wui-tour-progress-segment { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--color-border); } .wui-tour-progress-segment[data-filled] { background: var(--color-primary); } .wui-tour-position { margin: 0; font-size: 12px; color: var(--color-text-muted); } .wui-tour-layer { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); } .wui-tour-card:has(.wui-tour-arrow:not([hidden])) { overflow: visible; } .wui-tour-arrow { position: absolute; width: 8px; height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); rotate: 45deg; pointer-events: none; } .wui-tour-card[data-placement=bottom] .wui-tour-arrow { top: -5px; border-right-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=top] .wui-tour-arrow { bottom: -5px; border-top-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=right] .wui-tour-arrow { left: -5px; border-top-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); } .wui-tour-card[data-placement=left] .wui-tour-arrow { right: -5px; border-bottom-color: rgba(0, 0, 0, 0); border-left-color: rgba(0, 0, 0, 0); } @media (max-width: 575.98px) { .wui-tour-card { width: calc(100vw - 16px); } .wui-tour-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; } } .wui-tour-media { position: relative; order: -1; flex: none; aspect-ratio: 16/9; margin: -16px -16px 4px; overflow: hidden; background: var(--color-border); } .wui-tour-media>img, .wui-tour-media>video { display: block; width: 100%; height: 100%; object-fit: cover; } .wui-tour-card[data-welcome] { width: min(420px, 100vw - 16px); } .wui-tour-media-toggle { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--color-scrim-strong); color: var(--color-on-scrim); cursor: pointer; } .wui-tour-media-toggle>svg { width: 20px; height: 20px; fill: currentColor; } .wui-tour-media-toggle:focus-visible { outline: 2px solid var(--color-on-scrim); outline-offset: var(--wui-focus-ring-offset); } .wui-tour-layer[data-advance] { pointer-events: none; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-card { pointer-events: auto; } .wui-tour-layer[data-advance]:not([data-state=leaving]) .wui-tour-spot::before { content: ""; position: absolute; inset: -100vmax; pointer-events: auto; clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 100vmax 100vmax, calc(100% - 100vmax) 100vmax, calc(100% - 100vmax) calc(100% - 100vmax), 100vmax calc(100% - 100vmax), 100vmax 100vmax); } .wui-tour-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); } .wui-tour-pointer { position: absolute; top: 50%; left: 50%; width: 18px; height: 24px; pointer-events: none; } .wui-tour-pointer::before { content: ""; position: absolute; inset: 0; background: var(--color-primary); clip-path: polygon(0 0, 0 75%, 28% 58%, 46% 100%, 62% 92%, 45% 52%, 85% 52%); filter: drop-shadow(1px 0 0 var(--color-surface)) drop-shadow(-1px 0 0 var(--color-surface)) drop-shadow(0 1px 0 var(--color-surface)) drop-shadow(0 -1px 0 var(--color-surface)); } .wui-tour-pointer::after { content: ""; position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); opacity: 0; display: none; } @media (max-width: 575.98px) { .wui-tour-pointer { width: 24px; height: 24px; translate: -50% -50%; } .wui-tour-pointer::before { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); filter: none; } .wui-tour-pointer::after { top: -4px; left: -4px; } } @keyframes wui-tour-tap { 0% { opacity: 0; transform: translate(56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-tap-rtl { 0% { opacity: 0; transform: translate(-56px, 44px) scale(1); } 10% { opacity: 1; transform: translate(-56px, 44px) scale(1); } 45% { transform: translate(0, 0) scale(1); } 52% { transform: translate(0, 0) scale(0.86); } 60% { transform: translate(0, 0) scale(1); } 85% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(0, 0) scale(1); } } @keyframes wui-tour-ripple { 0%, 50% { opacity: 0; transform: scale(0.2); } 52% { opacity: 0.35; transform: scale(0.2); } 80%, 100% { opacity: 0; transform: scale(1); } } @media (prefers-reduced-motion: no-preference) { .wui-tour-pointer { opacity: 0; animation: wui-tour-tap calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } .wui-tour-pointer:dir(rtl) { animation-name: wui-tour-tap-rtl; } .wui-tour-pointer::after { display: block; animation: wui-tour-ripple calc(var(--wui-duration-slow) * 6) var(--wui-ease-out) var(--wui-tour-spot-duration) infinite; } } @keyframes wui-tour-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } } .wui-tour-end[data-layout=center] { --wui-tour-card-lift: 0 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); transform-origin: center; align-items: center; gap: 8px; width: min(420px, 100vw - 16px); max-height: calc(100vh - 16px); padding: 24px; text-align: center; } .wui-tour-end[data-layout=center] .wui-tour-actions { justify-content: center; margin-top: 8px; } .wui-tour-end[data-layout=center][data-next] .wui-tour-actions { flex-direction: column; align-items: stretch; width: 100%; gap: var(--wui-space-xs); } .wui-tour-end-mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-success-soft); color: var(--color-success-text); } .wui-tour-end-mark>svg { width: 26px; height: 26px; } .wui-tour-end-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; } .wui-tour-end-title { font-size: 18px; } .wui-tour-end-message { text-wrap: balance; } .wui-tour-end-next { text-wrap: balance; } .wui-tour-end-button { min-width: 120px; } @media (prefers-reduced-motion: no-preference) { .wui-tour-end-mark path { animation: wui-tour-check var(--wui-duration-default) var(--wui-ease-out) calc(var(--wui-tour-card-delay, 0ms) + var(--wui-duration-fast)) both; } } `,ft=()=>E(`tour`,O),pt=`wui-tour-media`,mt=`wui-tour-media-toggle`,ht=`http://www.w3.org/2000/svg`,gt=`M6 5h4v14H6zM14 5h4v14h-4z`,_t=`M8 5v14l11-7z`,vt=()=>({pause:ft().mediaPauseLabel,play:ft().mediaPlayLabel}),yt=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function bt(e){let t=document.createElementNS(ht,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(ht,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function xt(e){let t=document.createElement(`img`);return t.setAttribute(`alt`,e.mediaAlt??``),t.setAttribute(`width`,`1280`),t.setAttribute(`height`,`720`),t.setAttribute(`loading`,`lazy`),t.setAttribute(`decoding`,`async`),t.setAttribute(`src`,e.media??``),t}function St(e,t){let n=document.createElement(`video`);return n.muted=!0,n.setAttribute(`muted`,``),n.loop=!0,n.setAttribute(`playsinline`,``),t&&n.setAttribute(`autoplay`,``),n.setAttribute(`preload`,t?`auto`:`metadata`),e.mediaAlt&&n.setAttribute(`aria-label`,e.mediaAlt),e.mediaPoster&&n.setAttribute(`poster`,e.mediaPoster),n.setAttribute(`src`,e.media??``),n}function Ct(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=mt;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(bt(r?gt:_t))};return e.addEventListener(`play`,()=>r()),e.addEventListener(`pause`,()=>r()),n.addEventListener(`click`,()=>{e.paused?e.play()?.catch(()=>r()):e.pause()}),r(e.hasAttribute(`autoplay`)),n}function wt(e){let t=e.querySelector(`:scope > .${pt}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function Tt(e,t,n=vt()){if(wt(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=pt,t.mediaType===`video`){let e=St(t,!yt());r.append(e,Ct(e,n))}else r.appendChild(xt(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var Et=`data-wui-tour-open`,Dt=()=>E(`tour`,O);function Ot(e){let t=new Set;return{drop:e=>{t.add(e)},position:e=>{t.delete(e);let n=0;for(let r of t)r<e&&n++;return e+1-n},total:()=>e-t.size}}function kt(e,t,n){return(e.getAttribute(`progress-label`)||Dt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function At(e,{text:t,position:n,total:r}){let i=e.querySelector(`.wui-tour-position`);if(!(i instanceof HTMLElement))throw Error(`tour position label missing`);i.textContent=t;let a=e.querySelector(`.wui-tour-progress-bar`);if(!a){let t=e.ownerDocument,n=t.createElement(`div`);n.className=`wui-tour-progress`,n.setAttribute(`aria-hidden`,`true`),a=t.createElement(`div`),a.className=`wui-tour-progress-bar`,n.append(a),i.before(n)}let o=a.children;for(;o.length<r;){let t=e.ownerDocument.createElement(`span`);t.className=`wui-tour-progress-segment`,a.append(t)}for(;o.length>r;){let e=a.lastElementChild;if(!e)throw Error(`progress bar segment missing`);e.remove()}for(let e=0;e<o.length;e++){let t=o[e];if(!t)throw Error(`progress bar segment missing`);t.toggleAttribute(`data-filled`,e<n)}}var jt=`wui-tour-seen:`;function Mt(e=jt,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}function q(e){"@babel/helpers - typeof";return q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q(e)}function Nt(e,t){if(q(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(q(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pt(e){var t=Nt(e,`string`);return q(t)==`symbol`?t:t+``}function J(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft=`wui-tour-step`,It=`wui-tour-host`,Y=`data-tracking`,X=()=>E(`tour`,O),Lt=()=>({back:X().backLabel,next:X().nextLabel,skip:X().skipLabel,done:X().doneLabel,mediaPause:X().mediaPauseLabel,mediaPlay:X().mediaPlayLabel,endTitle:X().endTitle,endMessage:X().endMessage,endButton:X().doneLabel}),Rt={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`,mediaPause:`media-pause-label`,mediaPlay:`media-play-label`,endTitle:`end-title`,endMessage:`end-message`,endButton:`end-button`},zt=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],Bt={index:null,position:null,total:null},Vt=0,Z=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Ht=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Q(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ut=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},$=null;function Wt(e){$||($=new CSSStyleSheet,$.replaceSync(dt)),e.adoptedStyleSheets=[$]}var Gt=class extends r{static get observedAttributes(){return[`open`]}constructor(){super(),J(this,`seenStore`,void 0),J(this,`onBeforeStep`,void 0),J(this,`_run`,void 0),J(this,`_running`,void 0),J(this,`_layer`,void 0),J(this,`_outer`,void 0),J(this,`_shadow`,void 0),J(this,`_unbindAdvance`,void 0),J(this,`_ending`,void 0),J(this,`_seenMark`,void 0),J(this,`_steps`,[]),J(this,`_progress`,Ot(0)),J(this,`_firstIndex`,0),J(this,`_returnFocus`,null),J(this,`_current`,null),J(this,`_moving`,!1),J(this,`_card`,null),J(this,`_spot`,null),J(this,`_live`,null),J(this,`_onKey`,null),J(this,`_onFocusIn`,null),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null,this._unbindAdvance=null,this._ending=null,this._seenMark=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e===`open`&&this.isConnected&&(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${Ft}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of zt)e.hasAttribute(r)&&(t[n]=e.getAttribute(r)??``);return t})}_stepAt(e){let t=this._steps[e];if(!t)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);return t}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?Mt():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(Rt[e])||Lt()[e]}_endDialogText(){if(this.getAttribute(`end-dialog`)===`false`)return null;let e=(this.getAttribute(`end-next-label`)??``).trim(),t=(this.getAttribute(`end-next-href`)??``).trim();return{title:this._label(`endTitle`),message:this._label(`endMessage`),button:this._label(`endButton`),nextLabel:e,nextHref:t}}_markSeen(e){let t=this._store();return t?t.markSeen(this.tourId,e):null}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList(),this._progress=Ot(this._steps.length);let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}for(let[e,t]of this._steps.entries())t.target&&!Z(document.querySelector(t.target))&&this._progress.drop(e);this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);e===this._run&&(n?(this._firstIndex=n.index,this.dispatchEvent(new CustomEvent(`wui-tour:start`,{bubbles:!0,detail:{total:this._progress.total()}})),e===this._run&&(this._build(),this._show(n))):this._finish(`noTargets`))}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(!e)break;if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target),a=t instanceof HTMLElement||t instanceof SVGElement?t:null;if(Z(a))return this._progress.position(i),{index:i,target:a};this._progress.drop(i)}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++Vt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.replaceChildren(m(`div`,{class:`wui-tour-spot`,"aria-hidden":`true`}),m(`div`,{class:`wui-tour-card`,role:`dialog`,tabindex:`-1`,"aria-labelledby":`${e}-title`,"aria-describedby":`${e}-text`},m(`p`,{class:`wui-tour-position`}),m(`h2`,{class:`wui-tour-title`,id:`${e}-title`}),m(`p`,{class:`wui-tour-text`,id:`${e}-text`}),m(`div`,{class:`wui-tour-actions`},m(`button`,{type:`button`,class:`btn btn-sm btn-link wui-tour-skip`}),m(`div`,{class:`wui-tour-nav`},m(`button`,{type:`button`,class:`${p(`neutral`,`outline`,`sm`)} wui-tour-back`,"data-wui":l}),m(`button`,{type:`button`,class:`${p(`primary`,`solid`,`sm`)} wui-tour-next`,"data-wui":l})))),m(`div`,{class:`visually-hidden`,role:`status`,"aria-live":`polite`}));let n=t;this._shadow=null,this.isolated&&(n=document.createElement(It),this._shadow=n.attachShadow({mode:`open`}),Wt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),T(document).appendChild(n),document.documentElement.setAttribute(Et,``),this._outer=n,this._layer=t;let r=Q(t,`.wui-tour-spot`,HTMLDivElement),i=Q(t,`.wui-tour-card`,HTMLDivElement),a=Q(t,`[role=status]`,HTMLElement);this._spot=r,this._card=i,this._live=a,Q(i,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Q(i,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Q(i,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let s=e=>this._key(e);this._onKey=s;let c=e=>{let t=this._layer;if(!t||this._ending)return;let n=this._current,r=n?this._stepAt(n.index):null;if(!(e.target instanceof Node))throw Error(`<wui-tour> saw a focus change from a non-node target`);Oe(t,r,n?.target??null,e.target)||i.focus()};this._onFocusIn=c,document.addEventListener(`keydown`,s,!0),this._shadow||document.addEventListener(`focusin`,c),o(n,()=>this._follow())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_raise(){let e=this._outer;if(!e)throw Error(`<wui-tour> raises a step before its host is built`);let t=T(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),ce(e)}_show(e){this._current=e;let{index:t,target:n}=e,r=this._stepAt(t),i=this._layer,a=this._spot,o=this._card,s=this._live;if(!i||!a||!o||!s)throw Error(`<wui-tour> shows a step before its layer is built`);this._raise();let c=this._progress.position(t),l=this._progress.total(),u=c===l&&!this._endDialogText(),d=kt(this,c,l);At(o,{text:d,position:c,total:l}),Tt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=F(this,{layer:i,spot:a,card:o},r,n),p=Q(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Q(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Q(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Q(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Q(o,`.wui-tour-next`,HTMLElement).textContent=this._label(u?`done`:`next`);let h=[d,r.title,r.description].filter(Boolean).join(`. `);s.textContent=f?[h,f].join(/[.!?]$/.test(h)?` `:`. `):h,Qe(o,n),a.removeAttribute(Y),this._place(),He(o),this._unbindAdvance?.(),this._unbindAdvance=De(r,n,()=>void this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Ht(Ut()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t,position:c,total:l}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot,t=this._card;if(!e||!t)throw Error(`<wui-tour> places a step before its layer is built`);$e(e,t,this._current.target)}_follow(){if(!this._current||!this._layer||this._ending)return;let e=this._spot;if(!e)throw Error(`<wui-tour> follows a step before its spot is built`);let t=e.style.cssText;this._place(),e.style.cssText!==t&&e.setAttribute(Y,``)}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;if(r){let e=this._card;if(!e)throw Error(`<wui-tour> moved with no card showing`);let t=Ue(e);if(t!==null&&await t,n!==this._run)return;this._show(r)}else if(t>0){let e=this._endDialogText(),t=e?await this._showEnd(e):`done`;if(n!==this._run)return;let r=await this._close(t===`next`?`next`:`finished`);if(t===`next`&&r&&e){let t=this.ownerDocument.defaultView;if(!t)throw Error(`<wui-tour> has no window to follow its next link in`);t.location.assign(e.nextHref)}}}finally{this._moving=!1}}_showEnd(e){this._unbindAdvance?.(),this._unbindAdvance=null;let t=this._layer,n=this._spot,r=this._card;if(!t||!n||!r)throw Error(`<wui-tour> ends a tour before its layer is built`);return F(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),ut(t,e,this._ending.signal)}_key(e){if(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)return;let t=a(e.key,i(this));if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(t===`ArrowRight`||t===`ArrowLeft`){if(Ht(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),t===`ArrowRight`)this._move(1);else{let e=this._current;if(!e)throw Error(`<wui-tour> moved back with no step showing`);e.index>this._firstIndex&&this._move(-1)}}else if(e.key===`Tab`&&!this._shadow){let t=this._current,n=this._card;if(!t||!n)throw Error(`<wui-tour> cycled focus with no step showing`);ke(e,{card:n,active:this._active(),step:this._stepAt(t.index),target:t.target})}}_teardown(){if(!this._layer)return;this._onKey&&document.removeEventListener(`keydown`,this._onKey,!0),this._onFocusIn&&document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;this._unbindAdvance?.(),this._unbindAdvance=null,this._ending?.abort(),this._ending=null,this._seenMark=null;let t=this._outer;if(s(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);We(t),document.documentElement.removeAttribute(Et),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.focus()}async _close(e,t=null){let n=this._run,r=this._current,i=r?{index:r.index,position:this._progress.position(r.index),total:this._progress.total()}:Bt,a=this._seenMark;this._teardown();let o=e===`next`?`finished`:e,s=!1;try{n===this._run&&await(a??this._markSeen(o)),s=n===this._run}finally{this._finish(e,i,t)}return s}_finish(e,t=Bt,n=null){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e,...t,via:n}}))}},Kt=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,Gt),t(`wui-tour-step`,Kt),e.WuiTourStep=Kt,e})({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.174.1",
3
+ "version": "0.175.0",
4
4
  "description": "Webority framework-agnostic UI custom elements (<wui-*>): the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -275,10 +275,10 @@
275
275
  "@tiptap/starter-kit": "3.31.4",
276
276
  "@types/node": "25.6.0",
277
277
  "@vitest/coverage-v8": "5.1.0",
278
- "@webority/biome-config": "0.174.1",
279
- "@webority/markdown-core": "0.174.1",
280
- "@webority/theme": "0.174.1",
281
- "@webority/web-core": "0.174.1",
278
+ "@webority/biome-config": "0.175.0",
279
+ "@webority/markdown-core": "0.175.0",
280
+ "@webority/theme": "0.175.0",
281
+ "@webority/web-core": "0.175.0",
282
282
  "echarts": "6.1.0",
283
283
  "jsdom": "30.1.1",
284
284
  "libphonenumber-js": "^1.13.9",
@@ -1,5 +1,6 @@
1
1
  /** The languages the block highlights; "text" shows the source as written. */
2
- export declare const CODE_LANGUAGES: readonly ["text", "json", "js", "cs", "sql", "bash", "http", "html", "razor", "css"];
2
+ export type CodeLanguages = readonly ["text", "json", "js", "cs", "sql", "bash", "http", "html", "razor", "css"];
3
+ export declare const CODE_LANGUAGES: CodeLanguages;
3
4
  /** The name the block's header shows when it has no label. */
4
5
  export declare const CODE_LANGUAGE_NAMES: Readonly<Record<(typeof CODE_LANGUAGES)[number], string>>;
5
6
  /** Source longer than this is not tokenized. */
@@ -1,10 +1,9 @@
1
1
  /** Feedback window for copy-button label/icon swap on both surfaces. */
2
2
  export declare const COPY_FEEDBACK_MS = 2000;
3
3
  /**
4
- * Copy plain text to the clipboard. Tries `navigator.clipboard.writeText`, then falls
5
- * back to a hidden textarea + `document.execCommand("copy")`.
4
+ * Copy plain text to the clipboard with `navigator.clipboard.writeText`.
6
5
  *
7
6
  * @param text
8
- * @returns true when the copy succeeded
7
+ * @returns true when the copy succeeded; false when the Clipboard API is missing or refuses the write
9
8
  */
10
9
  export declare function copyTextToClipboard(text: string): Promise<boolean>;
@@ -42,49 +42,50 @@ import * as zone from "../zone.ts";
42
42
  import * as glyphs from "./glyphs.ts";
43
43
  import * as loader from "./loader.ts";
44
44
  import * as tableExport from "./tableExport.ts";
45
- export declare const SHARED_MODULES: Readonly<{
46
- anchorOverlay: typeof anchorOverlay;
47
- avatarNode: typeof avatarNode;
48
- buttonClass: typeof buttonClass;
49
- calendarMath: typeof calendarMath;
50
- copyText: typeof copyText;
51
- dataTable: typeof dataTable;
52
- datePickerText: typeof datePickerText;
53
- defineElement: typeof defineElement;
54
- devWarn: typeof devWarn;
55
- dom: typeof dom;
56
- drawerText: typeof drawerText;
57
- elementBase: typeof elementBase;
58
- fieldState: typeof fieldState;
59
- formatters: typeof formatters;
60
- formMirror: typeof formMirror;
61
- glyphs: typeof glyphs;
62
- hasOwn: typeof hasOwn;
63
- iconGlyphs: typeof iconGlyphs;
64
- imeSafeEnter: typeof imeSafeEnter;
65
- isDrawn: typeof isDrawn;
66
- listboxKeyNav: typeof listboxKeyNav;
67
- loader: typeof loader;
68
- mentionText: typeof mentionText;
69
- menuKeyNav: typeof menuKeyNav;
70
- nativeOverlay: typeof nativeOverlay;
71
- notificationDays: typeof notificationDays;
72
- optionLabel: typeof optionLabel;
73
- partRegistry: typeof partRegistry;
74
- rtl: typeof rtl;
75
- selectList: typeof selectList;
76
- selectRemote: typeof selectRemote;
77
- selectText: typeof selectText;
78
- selectWindow: typeof selectWindow;
79
- serverHtml: typeof serverHtml;
80
- stepperHeader: typeof stepperHeader;
81
- svgNodes: typeof svgNodes;
82
- tableExport: typeof tableExport;
83
- tableSelect: typeof tableSelect;
84
- textMatch: typeof textMatch;
85
- textStore: typeof textStore;
86
- tooltips: typeof tooltips;
87
- wuiHttp: typeof wuiHttp;
88
- WuiSelect: typeof WuiSelect;
89
- zone: typeof zone;
90
- }>;
45
+ export interface SharedModules {
46
+ readonly anchorOverlay: typeof anchorOverlay;
47
+ readonly avatarNode: typeof avatarNode;
48
+ readonly buttonClass: typeof buttonClass;
49
+ readonly calendarMath: typeof calendarMath;
50
+ readonly copyText: typeof copyText;
51
+ readonly dataTable: typeof dataTable;
52
+ readonly datePickerText: typeof datePickerText;
53
+ readonly defineElement: typeof defineElement;
54
+ readonly devWarn: typeof devWarn;
55
+ readonly dom: typeof dom;
56
+ readonly drawerText: typeof drawerText;
57
+ readonly elementBase: typeof elementBase;
58
+ readonly fieldState: typeof fieldState;
59
+ readonly formatters: typeof formatters;
60
+ readonly formMirror: typeof formMirror;
61
+ readonly glyphs: typeof glyphs;
62
+ readonly hasOwn: typeof hasOwn;
63
+ readonly iconGlyphs: typeof iconGlyphs;
64
+ readonly imeSafeEnter: typeof imeSafeEnter;
65
+ readonly isDrawn: typeof isDrawn;
66
+ readonly listboxKeyNav: typeof listboxKeyNav;
67
+ readonly loader: typeof loader;
68
+ readonly mentionText: typeof mentionText;
69
+ readonly menuKeyNav: typeof menuKeyNav;
70
+ readonly nativeOverlay: typeof nativeOverlay;
71
+ readonly notificationDays: typeof notificationDays;
72
+ readonly optionLabel: typeof optionLabel;
73
+ readonly partRegistry: typeof partRegistry;
74
+ readonly rtl: typeof rtl;
75
+ readonly selectList: typeof selectList;
76
+ readonly selectRemote: typeof selectRemote;
77
+ readonly selectText: typeof selectText;
78
+ readonly selectWindow: typeof selectWindow;
79
+ readonly serverHtml: typeof serverHtml;
80
+ readonly stepperHeader: typeof stepperHeader;
81
+ readonly svgNodes: typeof svgNodes;
82
+ readonly tableExport: typeof tableExport;
83
+ readonly tableSelect: typeof tableSelect;
84
+ readonly textMatch: typeof textMatch;
85
+ readonly textStore: typeof textStore;
86
+ readonly tooltips: typeof tooltips;
87
+ readonly wuiHttp: typeof wuiHttp;
88
+ readonly WuiSelect: typeof WuiSelect;
89
+ readonly zone: typeof zone;
90
+ }
91
+ export declare const SHARED_MODULES: Readonly<SharedModules>;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Whether a keydown was typed during an input method composition, Safari's confirming keydown included.
3
+ */
4
+ export declare function isImeComposing(event: KeyboardEvent | {
5
+ isComposing?: boolean;
6
+ keyCode?: number;
7
+ }): boolean;
1
8
  /**
2
9
  * Whether a keydown is an Enter that may submit: not one that confirms an input method composition
3
10
  * (Hindi, Chinese or Japanese typed through an IME). Safari fires the confirming keydown after
@@ -1,14 +1,17 @@
1
+ import type { ModalHandle } from "../../server/remoteModal.ts";
2
+ import type { ServerTableHandle } from "../../server/serverTable.ts";
3
+ import type { ShellHandle } from "../../server/shellParts.ts";
1
4
  export type RemoteOptions = Parameters<typeof window.WeborityUiElements.loadRemoteModal>[1];
2
5
  export declare const modal: {
3
6
  open: (id: string) => void;
4
7
  close: (id: string) => void;
5
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
8
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
6
9
  };
7
10
  export declare const drawer: {
8
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
11
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
9
12
  };
10
13
  export declare const pane: {
11
- load: (url: string, options?: RemoteOptions) => Promise<import("../../server/remoteModal.ts").ModalHandle>;
14
+ load: (url: string, options?: RemoteOptions) => Promise<ModalHandle>;
12
15
  close: (target: string | Element) => void;
13
16
  };
14
17
  export interface TourSeenStore {
@@ -20,10 +23,10 @@ export declare const tour: {
20
23
  start: (id: string) => unknown;
21
24
  };
22
25
  export declare const table: {
23
- get: (target: string | Element) => import("../../server/serverTable.ts").ServerTableHandle;
26
+ get: (target: string | Element) => ServerTableHandle;
24
27
  };
25
28
  export declare const shell: {
26
- get: (target?: string | Element) => import("../../server/shellParts.ts").ShellHandle;
29
+ get: (target?: string | Element) => ShellHandle;
27
30
  };
28
31
  export declare const filePicker: {
29
32
  setLoading: (target: string | Element, on: boolean) => void;
@@ -1,6 +1,5 @@
1
- declare const fromAddress: (url: string) => Promise<string>;
2
- export declare const look: {
1
+ export interface Look {
3
2
  apply: (file: unknown) => string;
4
- fromAddress: typeof fromAddress;
5
- };
6
- export {};
3
+ fromAddress: (url: string) => Promise<string>;
4
+ }
5
+ export declare const look: Look;
@@ -1 +1 @@
1
- declare const chartOf: (node: Element) => import("../../WuiChart").WuiChart | null | undefined;
1
+ declare const chartOf: (node: Element) => HTMLElementTagNameMap["wui-chart"] | null | undefined;
@@ -1,50 +1,26 @@
1
1
  import "../globals.ts";
2
2
  import "./modules/pageListeners.ts";
3
+ import { button, drawer, filePicker, modal, pane, shell, table, tour, unsaved } from "./modules/api.ts";
4
+ import { look } from "./modules/look.ts";
3
5
  import { dismissAllToasts, toast } from "./modules/toast.ts";
4
6
  import { showErrorSummary } from "./modules/validation.ts";
5
7
  declare const refresh: (root?: Document | Element) => void;
6
- declare const wui: {
7
- modal: {
8
- open: (id: string) => void;
9
- close: (id: string) => void;
10
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
11
- };
12
- drawer: {
13
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
14
- };
15
- pane: {
16
- load: (url: string, options?: import("./modules/api.ts").RemoteOptions) => Promise<import("../server/remoteModal.ts").ModalHandle>;
17
- close: (target: string | Element) => void;
18
- };
19
- tour: {
20
- seenStore: import("./modules/api.ts").TourSeenStore | null;
21
- start: (id: string) => unknown;
22
- };
23
- table: {
24
- get: (target: string | Element) => import("../server/serverTable.ts").ServerTableHandle;
25
- };
26
- shell: {
27
- get: (target?: string | Element) => import("../server/shellParts.ts").ShellHandle;
28
- };
29
- filePicker: {
30
- setLoading: (target: string | Element, on: boolean) => void;
31
- };
32
- button: {
33
- setLoading: (target: HTMLElement | string, isLoading: boolean) => void;
34
- };
35
- unsaved: {
36
- reset: (target: string | Element) => void;
37
- };
8
+ export interface WuiApi {
9
+ modal: typeof modal;
10
+ drawer: typeof drawer;
11
+ pane: typeof pane;
12
+ tour: typeof tour;
13
+ table: typeof table;
14
+ shell: typeof shell;
15
+ filePicker: typeof filePicker;
16
+ button: typeof button;
17
+ unsaved: typeof unsaved;
38
18
  toast: typeof toast;
39
19
  dismissAllToasts: typeof dismissAllToasts;
40
20
  showErrorSummary: typeof showErrorSummary;
41
- look: {
42
- apply: (file: unknown) => string;
43
- fromAddress: (url: string) => Promise<string>;
44
- };
21
+ look: typeof look;
45
22
  refresh: typeof refresh;
46
- };
47
- export type WuiApi = typeof wui;
23
+ }
48
24
  declare global {
49
25
  interface WuiHost extends WuiApi {
50
26
  }
@@ -1 +0,0 @@
1
- import{t as e}from"./elementBase-Cxeyx0tU.js";import{t}from"./imeSafeEnter-DPs9qL3S.js";import{t as n}from"./isDrawn-BbF4phmB.js";import{t as r}from"./menuKeyNav-CstMzU08.js";import{a as i,l as a,s as o}from"./nativeOverlay-BHD2QV02.js";import{n as s,t as c}from"./rtl-g7G8Bsib.js";var l=`[role="menuitem"]`,u=`.wui-context-menu-sub`,d=`input.wui-context-menu-search`,f=`input, textarea, select, [contenteditable=""], [contenteditable="true"]`,p=500,m=10,h=400,g=null,_=null,v=0;function y(e,t,n){let r=document.createElement(`span`);return r.setAttribute(`aria-hidden`,`true`),r.style.cssText=n?`position:absolute;left:${e+window.scrollX}px;top:${t+window.scrollY}px;width:0;height:0;`:`position:fixed;left:${e}px;top:${t}px;width:0;height:0;`,document.body.append(r),r}var b=/* @__PURE__ */ new WeakMap;function x(e,t,n){let r=b.get(e);if(r){if(r.region===t||t.contains(r.region))return!1;r.cancel()}return b.set(e,{region:t,cancel:n}),!0}var S=e=>e instanceof Element?e:e instanceof Node?e.parentElement:null,C=e=>`focus`in e,w=e=>[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE||e instanceof Element&&!e.matches(`.wui-context-menu-hint, .wui-context-menu-tick`)).map(e=>e.textContent).join(``),T=(e,t)=>[...e.querySelectorAll(t)].filter(e=>e instanceof HTMLElement),E=e=>[...e.children].filter(e=>e instanceof HTMLElement),D=(e,t)=>{let n=e.children[t];if(!(n instanceof HTMLElement))throw Error(`a submenu holds its opener and then its panel`);return n},O=e=>D(e,0),k=e=>D(e,1),A=(e,t)=>{let n=e?.closest(t);return n instanceof HTMLElement?n:null};function j(e,t){return!(e instanceof Node)||e.contains(t)}var M=class extends e{_region;_origin;_returnFocus;_press;_swallowClick;_unbindKeys;_anchor;_closingByKey;_onContextMenu;_onContextMenuCapture;_onDocKeyDown;_onDocClick;_onPointerDown;_onPressMove;_onPressEnd;_onClickCapture;_onKeyDown;_onClick;_onInput;_onMouseMove;_onDismiss;_onPointerDownCapture;static get observedAttributes(){return[`disabled`,`open`]}constructor(){super(),this._region=null,this._origin=null,this._returnFocus=null,this._press=null,this._swallowClick=!1,this._unbindKeys=null,this._anchor=null,this._closingByKey=!1,this._onContextMenu=e=>this._handleContextMenu(e),this._onContextMenuCapture=e=>{this.isOpen&&!this._inPanel(e.target)&&!this._isKeyEcho()&&this.close()},this._onDocKeyDown=e=>this._handleDocKeyDown(e),this._onDocClick=e=>this._handleDocClick(e),this._onPointerDown=e=>this._handlePointerDown(e),this._onPressMove=e=>{this._press&&Math.hypot(e.clientX-this._press.x,e.clientY-this._press.y)>m&&this._cancelPress()},this._onPressEnd=e=>{(e.type!==`scroll`||!this._press||j(e.target,this._press.region))&&this._cancelPress()},this._onClickCapture=e=>{if(this._swallowClick&&this._region){if(!(e.target instanceof Node))throw Error(`a click target is always a node`);this._region.contains(e.target)&&(this._swallowClick=!1,e.preventDefault(),e.stopImmediatePropagation())}},this._onKeyDown=e=>{if(this.isOpen&&this._inPanel(e.target)){if(e.key===`Escape`){if(e.stopPropagation(),this.hasAttribute(`open`)&&A(S(e.target),`[role="menu"]`)===this._panel()){e.preventDefault(),this.close(!0);return}this._closingByKey=!0}this._handleMenuKey(e)}},this._onClick=e=>this._handleClick(e),this._onInput=e=>this._handleInput(e),this._onMouseMove=e=>{let t=A(S(e.target),l);t&&this._inPanel(t)&&!this._isDisabled(t)&&t!==document.activeElement&&t.focus({preventScroll:!0})},this._onDismiss=e=>{this.hasAttribute(`open`)||(e.type!==`scroll`||!this._inPanel(e.target)&&j(e.target,this._region??this))&&this.close()},this._onPointerDownCapture=()=>{this._swallowClick=!1}}connectedCallback(){this._teardown(),document.addEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.addEventListener(`contextmenu`,this._onContextMenu),document.addEventListener(`keydown`,this._onDocKeyDown),document.addEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.addEventListener(`pointerdown`,this._onPointerDown),document.addEventListener(`click`,this._onClickCapture,!0),document.addEventListener(`click`,this._onDocClick),window.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick),this.addEventListener(`input`,this._onInput),this.addEventListener(`mousemove`,this._onMouseMove),this._syncOpen()}disconnectedCallback(){this._teardown()}attributeChangedCallback(e){e===`open`?this.isConnected&&this._syncOpen():this.disabled&&this.close()}get target(){return this.getAttribute(`target`)}set target(e){e==null||e===``?this.removeAttribute(`target`):this.setAttribute(`target`,String(e))}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get isOpen(){let e=this._panel();return!!e&&o(e)}open(e,t,{region:n=this,origin:i=n,trigger:s=null,keyboard:c=!1}={}){let l=this._panel();if(!l)return!1;let u=new CustomEvent(`wui-context-menu:beforeopen`,{bubbles:!0,cancelable:!0,detail:{region:n,origin:i,trigger:s}});if(this.dispatchEvent(u),u.defaultPrevented)return!1;if(this._decorate(l),g&&g!==this&&g.close(!0),!this.isOpen){let e=document.activeElement;this._returnFocus=e&&e!==document.body&&!this._inPanel(e)&&C(e)?e:null}this._region=n,this._origin=i,_=null,g=this,this._unbindKeys?.(),this._unbindKeys=r(l,{items:()=>this._menuRows()}),this._anchor?.remove();let d=this.hasAttribute(`open`);return this._anchor=y(e,t,d),a(this._anchor,l,{mode:d?`manual`:`auto`,keepOffscreen:d,clampHeight:!0,onClosed:()=>this._onPanelClosed()}),window.addEventListener(`scroll`,this._onDismiss,!0),window.addEventListener(`resize`,this._onDismiss),window.addEventListener(`blur`,this._onDismiss),queueMicrotask(()=>{o(l)&&((c?this._rowsOf(l)[0]:null)??l).focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`wui-context-menu:open`,{bubbles:!0,detail:{region:n,origin:i,x:e,y:t}})),!0}_syncOpen(){if(!this.hasAttribute(`open`)){this.close(this._inPanel(document.activeElement));return}let e=this.target?document.querySelector(this.target):this,t=e&&this._regionRect(e);e&&t&&this.open(t.left,t.top,{region:e,origin:e})}_regionRect(e){if(e!==this)return e.getBoundingClientRect();let t=[...this.children].filter(e=>e!==this._panel()).map(e=>e.getBoundingClientRect());return t.length?{left:Math.min(...t.map(e=>e.left)),top:Math.min(...t.map(e=>e.top))}:null}close(e=!1){let t=this._panel();t&&o(t)&&(e&&(this._closingByKey=!0),i(t))}_finish(e){let t=this._panel();if(t)for(let e of T(t,u))this._setSub(e,!1);g===this&&(g=null),window.removeEventListener(`scroll`,this._onDismiss,!0),window.removeEventListener(`resize`,this._onDismiss),window.removeEventListener(`blur`,this._onDismiss),this._unbindKeys?.(),this._unbindKeys=null,this._anchor?.remove(),this._anchor=null;let n=this._returnFocus;this._returnFocus=null,e&&n?.isConnected&&n.focus({preventScroll:!0})}_onPanelClosed(){let e=this._panel();if(!e||o(e))return;let t=this._closingByKey;this._closingByKey=!1,this._finish(t)}_menuRows(){let e=S(document.activeElement);if(!e||e.matches(d))return[];let t=A(e,`[role="menu"]`);return t?this._rowsOf(t):[]}_panel(){return E(this).find(e=>e.getAttribute(`role`)===`menu`)??null}_inPanel(e){return e instanceof Node&&!!this._panel()?.contains(e)}_rowsOf(e){return e?T(e,l).filter(t=>t.closest(`[role="menu"]`)===e&&!this._isDisabled(t)&&n(t)):[]}_isDisabled(e){return e.getAttribute(`aria-disabled`)===`true`}_regionFor(e){let t=S(e);if(!t||this.disabled||!this._panel()||this._inPanel(t)||t.closest(f))return null;let n=this.target;return n?t.closest(n):this.contains(t)?this:null}_triggerFor(e){let t=S(e),n=this.getAttribute(`trigger`);if(!t||!n||this._inPanel(t))return null;let r=A(t,n),i=r&&this._regionFor(r);return r&&i?{trigger:r,region:i}:null}_isKeyEcho(){return _?.menu===this&&this.isOpen&&performance.now()-_.at<h}_handleContextMenu(e){if(this._inPanel(e.target)){e.preventDefault();return}if(e.defaultPrevented&&!b.has(e))return;let t=this._regionFor(e.target);t&&(this._isKeyEcho()?e.preventDefault():e.shiftKey||x(e,t,()=>this.close(!0))&&this.open(e.clientX,e.clientY,{region:t,origin:S(e.target)})&&e.preventDefault())}_handleDocKeyDown(e){if(e.defaultPrevented&&!b.has(e))return;if(t(e)){let t=this._triggerFor(e.target);if(!t||!x(e,t.region,()=>this.close(!0)))return;e.preventDefault(),t.trigger.click();return}if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey)||this._inPanel(e.target))return;let n=this._regionFor(e.target);if(!n||!x(e,n,()=>this.close(!0)))return;let r=S(e.target);if(!r)return;let i=r.getBoundingClientRect();this.open(i.left+Math.min(16,i.width/2),i.bottom,{region:n,origin:r,keyboard:!0})&&(e.preventDefault(),_={menu:this,at:performance.now()})}_handleDocClick(e){let t=this._triggerFor(e.target);if(!t||!x(e,t.region,()=>this.close(!0)))return;let n=t.trigger.getBoundingClientRect();this.open(n.left,n.bottom,{region:t.region,origin:t.trigger,trigger:t.trigger,keyboard:e.detail===0})}_handlePointerDown(e){if(e.pointerType!==`touch`)return;let t=this._regionFor(e.target);if(!t||!x(e,t,()=>this._cancelPress()))return;this._cancelPress();let{clientX:n,clientY:r}=e,i=S(e.target);this._press={x:n,y:r,region:t,timer:setTimeout(()=>{this._cancelPress(),this.open(n,r,{region:t,origin:i})&&(this._swallowClick=!0)},p)},document.addEventListener(`pointermove`,this._onPressMove,{passive:!0}),document.addEventListener(`pointerup`,this._onPressEnd),document.addEventListener(`pointercancel`,this._onPressEnd),window.addEventListener(`scroll`,this._onPressEnd,!0)}_cancelPress(){this._press&&(clearTimeout(this._press.timer),this._press=null,document.removeEventListener(`pointermove`,this._onPressMove),document.removeEventListener(`pointerup`,this._onPressEnd),document.removeEventListener(`pointercancel`,this._onPressEnd),window.removeEventListener(`scroll`,this._onPressEnd,!0))}_handleMenuKey(e){if(!this.isOpen)return;let n=S(e.target);if(!n)return;if(n.matches(d)){this._handleSearchKey(e,n);return}let r=A(n,`[role="menu"]`);if(!r)return;let i=A(n,l),a=r.matches(`.wui-context-menu-subpanel`)?r.parentElement:null,o=s(e.key,c(this));if(e.key===`Tab`)this.close(!0);else if(o===`ArrowRight`){let t=i&&this._subOf(i);if(!t)return;e.preventDefault(),this._openSub(t,!0)}else if(o===`ArrowLeft`){if(!a)return;e.preventDefault(),this._closeSubByKey(a)}else(t(e)||e.key===` `)&&(e.preventDefault(),i?.click())}_handleSearchKey(e,t){let n=A(t,u);if(!n)return;let r=this._rowsOf(k(n));e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),this._closeSubByKey(n)):e.key===`ArrowDown`?(e.preventDefault(),r[0]?.focus({preventScroll:!0})):e.key===`ArrowUp`?(e.preventDefault(),r[r.length-1]?.focus({preventScroll:!0})):e.key===`Tab`&&this.close(!0)}_subOf(e){return e.hasAttribute(`aria-haspopup`)&&e.parentElement?.matches(u)?e.parentElement:null}_openSub(e,t){let n=e.parentElement;if(!n)throw Error(`a submenu is always inside its menu panel`);for(let t of E(n))t!==e&&t.matches(u)&&this._closeSub(t);this._setSub(e,!0);let r=k(e).querySelector(`:scope > ${d}`),i=e.hasAttribute(`data-searchable`)&&r instanceof HTMLInputElement?r:null;i?(i.value=``,this._filter(e,``),i.focus({preventScroll:!0})):t&&this._rowsOf(k(e))[0]?.focus({preventScroll:!0})}_closeSub(e){for(let t of T(k(e),u))this._setSub(t,!1);this._setSub(e,!1)}_closeSubByKey(e){this._closeSub(e),O(e).focus({preventScroll:!0})}_setSub(e,t){let n=k(e);t?(a(O(e),n,{mode:`auto`,beside:!0,onClosed:()=>this._onSubClosed(e)}),O(e).setAttribute(`aria-expanded`,String(o(n)))):o(n)?i(n):this._onSubClosed(e)}_onSubClosed(e){let t=k(e);if(o(t))return;let n=O(e);n.setAttribute(`aria-expanded`,`false`),t.removeAttribute(`data-side`);let r=this._closingByKey;this._closingByKey=!1,r&&n.focus({preventScroll:!0})}_filter(e,t){let n=t.trim().toLowerCase();for(let t of E(k(e)))t.tagName===`HR`?t.hidden=n!==``:t.matches(l)?t.hidden=n!==``&&!w(t).toLowerCase().includes(n):t.matches(u)&&(t.hidden=n!==``&&!w(O(t)).toLowerCase().includes(n))}_handleInput(e){let t=S(e.target)?.closest(d);if(!(t instanceof HTMLInputElement))return;let n=A(t,u);n?.hasAttribute(`data-searchable`)&&this._inPanel(n)&&this._filter(n,t.value)}_decorate(e){for(let t of T(e,l)){let e=t.getAttribute(`aria-checked`)===`true`,n=t.querySelector(`:scope > .wui-context-menu-tick`);if(e&&!n){let e=document.createElement(`span`);e.className=`wui-context-menu-tick`,e.setAttribute(`aria-hidden`,`true`),t.prepend(e)}else!e&&n&&n.remove();let r=t.querySelector(`:scope > .wui-context-menu-hint`),i=t.dataset.hint;if(i){let e=r??document.createElement(`span`);r||(e.className=`wui-context-menu-hint`,e.id=`wui-context-menu-hint-${++v}`,t.append(e)),e.textContent=i,t.setAttribute(`aria-describedby`,e.id)}else r&&(r.remove(),t.removeAttribute(`aria-describedby`))}}_handleClick(e){let t=A(S(e.target),l);if(!t||!this._inPanel(t))return;if(this._isDisabled(t)){e.preventDefault(),e.stopPropagation();return}let n=this._subOf(t);n?(e.preventDefault(),this._openSub(n,e.detail===0)):(this.close(!0),this.dispatchEvent(new CustomEvent(`wui-context-menu:select`,{bubbles:!0,detail:{key:t.dataset.key??null,item:t,region:this._region,origin:this._origin}})))}_teardown(){let e=this._panel();if(this._closingByKey=!1,e){for(let t of[...T(e,u)].reverse())i(k(t));i(e)}this._anchor&&this._finish(!1),this._cancelPress(),document.removeEventListener(`contextmenu`,this._onContextMenuCapture,!0),document.removeEventListener(`contextmenu`,this._onContextMenu),document.removeEventListener(`keydown`,this._onDocKeyDown),document.removeEventListener(`pointerdown`,this._onPointerDownCapture,!0),document.removeEventListener(`pointerdown`,this._onPointerDown),document.removeEventListener(`click`,this._onClickCapture,!0),document.removeEventListener(`click`,this._onDocClick),window.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`input`,this._onInput),this.removeEventListener(`mousemove`,this._onMouseMove)}};export{M as t};