@webority/ui-elements 0.168.0 → 0.169.1
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.
- package/dist/{WuiCommentThread-AYovTYSA.js → WuiCommentThread-RB100aB1.js} +1 -1
- package/dist/{WuiContextMenu-CyejQsef.js → WuiContextMenu-ClMVFeos.js} +1 -1
- package/dist/{WuiDataTable-BniN81KC.js → WuiDataTable-D0tGIVtG.js} +1 -1
- package/dist/{WuiDatePicker-q0s8tL_E.js → WuiDatePicker-BiZciUAZ.js} +1 -1
- package/dist/{WuiDateRange-p2r5A9CY.js → WuiDateRange-DSq6Mj4v.js} +1 -1
- package/dist/{WuiDrawer-CQ7nRHUD.js → WuiDrawer-n8WlVPq_.js} +1 -1
- package/dist/{WuiDropdown-BQC04Q48.js → WuiDropdown-D2jEbCfv.js} +1 -1
- package/dist/{WuiEntryGrid-DPAYNu1v.js → WuiEntryGrid-Bm5_MizA.js} +1 -1
- package/dist/WuiGantt-BsQUCR2U.js +1 -0
- package/dist/{WuiHoverCard-DRZh88zM.js → WuiHoverCard-DmApQa9R.js} +1 -1
- package/dist/{WuiInlineEdit-CEjs5Ruk.js → WuiInlineEdit-C64O31MF.js} +1 -1
- package/dist/{WuiLightbox-DDQAOabU.js → WuiLightbox-cm5eHcMK.js} +1 -1
- package/dist/{WuiMentionInput-CkhrCz_2.js → WuiMentionInput-D7HC7U2Q.js} +1 -1
- package/dist/{WuiModal-BRILsSMq.js → WuiModal-DuBerYTv.js} +1 -1
- package/dist/{WuiNavigationMenu-BCnqv7e-.js → WuiNavigationMenu-VG-ZJstT.js} +1 -1
- package/dist/{WuiNotificationCenter-BCXT3Y7m.js → WuiNotificationCenter-hluDIzO8.js} +1 -1
- package/dist/{WuiOverflow-DtetLQHW.js → WuiOverflow-MzrZwzud.js} +1 -1
- package/dist/{WuiPhone-B6jgFRSi.js → WuiPhone-C03OuI7-.js} +1 -1
- package/dist/{WuiPopover-BzVxNSs1.js → WuiPopover-BxQj74kE.js} +1 -1
- package/dist/{WuiRelativeTime-DTGKGHbK.js → WuiRelativeTime-CujAFS_w.js} +1 -1
- package/dist/WuiSelect-DpZbgU4v.js +9 -0
- package/dist/{WuiShortcuts-DSjwaZx7.js → WuiShortcuts-CSFOyAKI.js} +1 -1
- package/dist/{WuiTimePicker-C5XouoR7.js → WuiTimePicker-BxcImgm1.js} +1 -1
- package/dist/{WuiTour-BDOGWyNA.js → WuiTour-Beop0n-H.js} +1 -1
- package/dist/WuiTree-DGclk55_.js +1 -0
- package/dist/WuiTreePicker-CBhasmC5.js +1 -0
- package/dist/{WuiWhatsNew-DOo54GiH.js → WuiWhatsNew-BtWJkzTv.js} +1 -1
- package/dist/anchorOverlay-DSzkGQPi.js +1 -0
- package/dist/avatarHtml-BtbN7cA5.js +1 -0
- package/dist/{calendarMath-CFjBxJYM.js → calendarMath-ChZ_s7HH.js} +1 -1
- package/dist/{chips-CemguTKJ.js → chips-IbfKMhVk.js} +1 -1
- package/dist/{dataTable-CKz4Oncc.js → dataTable-sRTzep19.js} +1 -1
- package/dist/{drawerDiscard-BjykHS_G.js → drawerDiscard-CIZZuKmY.js} +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/context-menu.js +1 -1
- package/dist/elements/data-table.js +1 -1
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/elements/drawer.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/entry-grid.js +1 -1
- package/dist/elements/filter-popover.js +1 -1
- package/dist/elements/gantt.js +1 -0
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/inline-edit.js +1 -1
- package/dist/elements/kanban.js +1 -1
- package/dist/elements/lightbox.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/modal.js +1 -1
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/shortcuts.js +1 -1
- package/dist/elements/timepicker.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/tree-picker.js +1 -0
- package/dist/elements/tree.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/{fileViewer.g-B5XQ5WKr.js → fileViewer.g-DQ-YkF8l.js} +1 -1
- package/dist/{fileViewerImage-B0Q9zdgW.js → fileViewerImage-DT0a9KaL.js} +1 -1
- package/dist/{fileViewerMedia-D3fdG-Ti.js → fileViewerMedia-BFNxdaYX.js} +1 -1
- package/dist/{fileViewerPdf-DeRWa1JE.js → fileViewerPdf-Boo6uXQO.js} +1 -1
- package/dist/{filterPopover-DmeVG4_N.js → filterPopover-BVBxgtc5.js} +1 -1
- package/dist/{formatters-Dy4kQQ_h.js → formatters-CMTSYlW9.js} +1 -1
- package/dist/gantt.g-TdTxeruW.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/initials-Qb6ITcri.js +1 -0
- package/dist/{inlineEditText-BUO5sZxN.js → inlineEditText-5FT8SGqR.js} +1 -1
- package/dist/{kanban-CEZmyYFY.js → kanban-CRRLqNn_.js} +1 -1
- package/dist/{kanbanModel-Dp5c1rTs.js → kanbanModel-sAwpMCpn.js} +1 -1
- package/dist/listboxKeyNav-DtlIOryj.js +1 -0
- package/dist/loader-Cf_ozcXz.js +1 -0
- package/dist/{nativeOverlay-C1Rw2gIW.js → nativeOverlay-D3VmY8qn.js} +1 -1
- package/dist/{notificationDays-B7cbYu4q.js → notificationDays-DQlrEZ3z.js} +1 -1
- package/dist/{relativeTime-CdFw-ekO.js → relativeTime-CQuwuwZ-.js} +1 -1
- package/dist/search-BVox4aaA.js +1 -0
- package/dist/server.js +1 -1
- package/dist/text/en.json +145 -0
- package/dist/text.js +1 -1
- package/dist/treePicker.g-BR35ru5f.js +1 -0
- package/dist/ui-chart.global.js +2 -2
- package/dist/ui-chart.js +2 -2
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +1 -1
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +1 -1
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/dropdown.global.js +1 -1
- package/dist/ui-elements/entry-grid.global.js +2 -2
- package/dist/ui-elements/gantt.global.js +1 -0
- package/dist/ui-elements/glyphs.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +1 -1
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +1 -1
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +1 -1
- package/dist/ui-elements/popover.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +1 -1
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/select-window.global.js +1 -0
- package/dist/ui-elements/slider.global.js +1 -1
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +1 -1
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree-picker.global.js +1 -0
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +21 -21
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +1 -1
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-tour.global.js +1 -1
- package/dist/window-BZWK3rQk.js +1 -0
- package/package.json +13 -5
- package/types/WuiGantt.d.ts +70 -0
- package/types/WuiSelect.d.ts +9 -0
- package/types/WuiTree.d.ts +37 -2
- package/types/WuiTreePicker.d.ts +64 -0
- package/types/chartSpec.d.ts +1 -1
- package/types/elements/gantt.d.ts +2 -0
- package/types/elements/tree-picker.d.ts +2 -0
- package/types/formatters.d.ts +6 -4
- package/types/ganttLayout.d.ts +116 -0
- package/types/ganttTable.d.ts +24 -0
- package/types/ganttTypes.d.ts +43 -0
- package/types/global/parts/select-window.d.ts +1 -0
- package/types/global/shared.d.ts +4 -0
- package/types/globals.d.ts +5 -1
- package/types/helpers.d.ts +3 -0
- package/types/index.d.ts +5 -1
- package/types/initials.d.ts +5 -0
- package/types/listboxKeyNav.d.ts +13 -0
- package/types/select/list.d.ts +58 -2
- package/types/select/window.d.ts +39 -0
- package/types/select/windowLoad.d.ts +1 -0
- package/types/select/windowLoadGlobal.d.ts +1 -0
- package/types/select/windowThreshold.d.ts +1 -0
- package/types/select/windowed.d.ts +2 -0
- package/types/text/web/catalogue.g.d.ts +12 -0
- package/types/text/web/gantt.g.d.ts +47 -0
- package/types/text/web/idleTimeoutDialog.g.d.ts +7 -0
- package/types/text/web/index.g.d.ts +6 -0
- package/types/text/web/loadMore.g.d.ts +8 -0
- package/types/text/web/queryBuilder.g.d.ts +59 -0
- package/types/text/web/transferList.g.d.ts +18 -0
- package/types/text/web/treePicker.g.d.ts +12 -0
- package/types/treePicker/treeKeys.d.ts +46 -0
- package/types/treePicker/treePickerView.d.ts +31 -0
- package/types/treePicker/treeState.d.ts +42 -0
- package/dist/WuiSelect-CMHoPHlx.js +0 -9
- package/dist/WuiTree-CeYbyaCx.js +0 -1
- package/dist/anchorOverlay-B8fu8hjz.js +0 -1
- package/dist/listboxKeyNav-CF7tMDGG.js +0 -1
- package/dist/loader-CQJFj96n.js +0 -1
- package/dist/search-Cj1YQUwK.js +0 -1
package/dist/ui-file-viewer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,s as r,t as i,u as a}from"./fileViewer.g-
|
|
1
|
+
import{i as e,o as t,r as n,s as r,t as i,u as a}from"./fileViewer.g-DQ-YkF8l.js";function o(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 s=`AppButton`,c=/* @__PURE__ */ new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),l={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 u(e){return Object.hasOwn(l,e)}function d(e=`primary`,t=`solid`,n=`md`){if(!c.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!u(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=l[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var f=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(f);var p=HTMLElement,m=()=>n(`fileViewer`,i),h={pdf:`pdf`,jpg:`image`,jpeg:`image`,png:`image`,webp:`image`,gif:`image`,avif:`image`,bmp:`image`,svg:`image`,mp4:`video`,m4v:`video`,webm:`video`,ogv:`video`,mp3:`audio`,m4a:`audio`,aac:`audio`,wav:`audio`,ogg:`audio`,oga:`audio`,opus:`audio`,flac:`audio`},g={"application/pdf":`pdf`,"image/jpeg":`image`,"image/png":`image`,"image/webp":`image`,"image/gif":`image`,"image/avif":`image`,"image/bmp":`image`,"image/svg+xml":`image`,"video/mp4":`video`,"video/webm":`video`,"video/ogg":`video`,"audio/mpeg":`audio`,"audio/mp4":`audio`,"audio/aac":`audio`,"audio/wav":`audio`,"audio/x-wav":`audio`,"audio/ogg":`audio`,"audio/opus":`audio`,"audio/webm":`audio`,"audio/flac":`audio`},_=`wui-file-viewer:load`,v=`wui-file-viewer:error`,y=`wui-file-viewer:prefs-change`;function b(e,t){let n=(String(e??``).split(`;`)[0]??``).trim().toLowerCase();if(n)return g[n]??null;let r=String(t??``).split(/[?#]/)[0]??``;return h[r.includes(`.`)?(r.split(`.`).pop()??``).toLowerCase():``]??null}function x(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}var S={pdf:()=>import(`./fileViewerPdf-Boo6uXQO.js`).then(e=>e.PdfView),image:()=>import(`./fileViewerImage-DT0a9KaL.js`).then(e=>e.ImageView),video:()=>import(`./fileViewerMedia-BFNxdaYX.js`).then(e=>e.MediaView),audio:()=>import(`./fileViewerMedia-BFNxdaYX.js`).then(e=>e.MediaView)},C=0,w=class n extends p{static defaultAssetBase=``;static get observedAttributes(){return[`src`,`name`,`type`,`download`,`print`,`worker-src`,`asset-base`,`captions`]}uid;_prefs;_hostPrefs;_onFullscreen;_view;_loadId;_actionsBox;constructor(){super(),C+=1,this.uid=`wui-file-viewer-${C}`,this._prefs={},this._onFullscreen=()=>this._syncFullscreen()}get src(){return this.getAttribute(`src`)??``}set src(e){this.setAttribute(`src`,String(e??``))}get name(){return this.getAttribute(`name`)??``}set name(e){this.setAttribute(`name`,String(e??``))}get type(){return this.getAttribute(`type`)??``}set type(e){this.setAttribute(`type`,String(e??``))}get viewKey(){return this.getAttribute(`view-key`)??``}set viewKey(e){this.setAttribute(`view-key`,String(e??``))}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get print(){return this.getAttribute(`print`)!==`false`}set print(e){this.setAttribute(`print`,e===!1||e===`false`?`false`:`true`)}get workerSrc(){return this.getAttribute(`worker-src`)??``}set workerSrc(e){this.setAttribute(`worker-src`,String(e??``))}get captions(){return this.getAttribute(`captions`)??``}set captions(e){this.setAttribute(`captions`,String(e??``))}get assetBase(){return this.getAttribute(`asset-base`)??``}set assetBase(e){this.setAttribute(`asset-base`,String(e??``))}get prefs(){return{...this._prefs}}set prefs(e){this._hostPrefs=!0,this._prefs=e&&typeof e==`object`?{...e}:{}}get actionsContainer(){return this._actionsBox??null}seekTo(e){if(typeof e!=`number`||!Number.isFinite(e))throw TypeError(`[wui-file-viewer] seekTo takes a number of seconds; got ${String(e)}.`);return this._view?.seekTo?(this._view.seekTo(e),!0):!1}displayName(){return this.name||x(this.src)||m().documentLabel}connectedCallback(){if(Object.hasOwn(this,`prefs`)){let e=this.prefs;Reflect.deleteProperty(this,`prefs`),this.prefs=e}document.addEventListener(`fullscreenchange`,this._onFullscreen),this._open()}disconnectedCallback(){document.removeEventListener(`fullscreenchange`,this._onFullscreen),this._close()}attributeChangedCallback(e,t,n){this.isConnected&&this._parts&&t!==n&&(e===`name`?this._parts.name.textContent=this.displayName():e===`download`?this._syncDownload():e===`print`?this._syncPrint():this._open())}_close(){this._view?.destroy(),this._view=null,this._loadId=(this._loadId??0)+1}async _open(){this._close();let e=this._loadId;this._render(),this._prefs=this._readPrefs();let t=b(this.type,this.name||this.src);if(!this.src){this._settle(m().noFileText);return}if(!t){this._settle(m().unsupportedFileText,{offerDownload:!0});return}this._status(m().loadingText);let r;try{r=await S[t]()}catch(t){e===this._loadId&&this._fail(t);return}e===this._loadId&&(this._view=new r(this._shell(e),{src:this.src,kind:t,captions:this.captions,workerSrc:this.workerSrc,assetBase:E(this.assetBase||n.defaultAssetBase)}),this._view.load())}_shell(e){let t=()=>e===this._loadId,n=this._parts;return{host:this,start:n.start,center:n.center,end:n.viewEnd,search:n.search,body:n.body,prefs:{...this._prefs},name:()=>this.displayName(),print:()=>this.print,savePrefs:e=>{t()&&this._savePrefs(e)},loaded:e=>{t()&&(n.body.removeAttribute(`aria-busy`),this.dispatchEvent(new CustomEvent(_,{bubbles:!0,detail:e})))},fail:e=>{t()&&this._fail(e)}}}_render(){let n=(e,t)=>{let n=document.createElement(e);return n.className=t,n},i=n(`div`,`wui-file-viewer-toolbar`),a=n(`div`,`wui-file-viewer-group wui-file-viewer-start`),o=n(`span`,`wui-file-viewer-name`);o.textContent=this.displayName(),o.title=this.displayName(),a.append(o);let s=n(`div`,`wui-file-viewer-group wui-file-viewer-center`),c=n(`div`,`wui-file-viewer-group wui-file-viewer-end`),l=n(`div`,`wui-file-viewer-group wui-file-viewer-view-end`),u=document.createElement(`a`);u.className=`u-action wui-file-viewer-download`,u.style.setProperty(`--wui-action-size`,`32px`),t(u,`download`),r(u,m().downloadLabel);let d=e(`maximize-4`,m().fullScreenLabel,{className:`wui-file-viewer-fullscreen`});d.addEventListener(`click`,()=>this.toggleFullscreen()),d.hidden=!document.fullscreenEnabled,this._actionsBox??=n(`div`,`wui-file-viewer-actions`);let f=this._actionsBox;f.append(...this.querySelectorAll(`:scope > [slot="actions"]`)),c.append(l,u,d,f);let p=n(`search`,`wui-file-viewer-search`);p.hidden=!0,i.append(a,s,c,p);let h=n(`div`,`wui-file-viewer-body`);h.setAttribute(`aria-busy`,`true`),this.replaceChildren(i,h),this._parts={toolbar:i,start:a,name:o,center:s,end:c,viewEnd:l,downloadLink:u,fullscreen:d,actionsBox:f,search:p,body:h},this._syncDownload(),this._syncFullscreen()}_syncDownload(){let e=this._parts.downloadLink;e.hidden=!this.download||!this.src,e.href=this.src,e.setAttribute(`download`,this.displayName())}_syncPrint(){for(let e of this._parts.toolbar.querySelectorAll(`.wui-file-viewer-print`))e instanceof HTMLElement&&(e.hidden=!this.print)}_status(e,{offerDownload:t=!1}={}){let n=document.createElement(`div`);n.className=`wui-file-viewer-status`;let r=document.createElement(`p`);if(r.textContent=e,n.append(r),t&&this.src){let e=document.createElement(`a`);e.className=d(`neutral`,`outline`,`sm`),e.dataset.wui=s,e.href=this.src,e.setAttribute(`download`,this.displayName()),e.textContent=m().downloadLabel,n.append(e)}this._parts.body.replaceChildren(n)}_settle(e,t){this._parts.body.removeAttribute(`aria-busy`),this._status(e,t)}_fail(e){this._view?.destroy(),this._view=null,this._settle(m().openFailedText,{offerDownload:!0});let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;this.dispatchEvent(new CustomEvent(v,{bubbles:!0,detail:{message:t??String(e)}}))}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(e=>{a(`[wui-file-viewer] full screen refused:`,e?.message)})}_syncFullscreen(){if(!this._parts)return;let e=document.fullscreenElement===this,n=this._parts.fullscreen;t(n,e?`x`:`maximize-4`),r(n,e?m().exitFullScreenLabel:m().fullScreenLabel),this._parts.actionsBox.hidden=e}_readPrefs(){if(this._hostPrefs||!this.viewKey)return{...this._prefs};try{let e=JSON.parse(window.localStorage.getItem(`wui-view:${this.viewKey}`)??`{}`);return T(e)?e:{}}catch{return{}}}_savePrefs(e){if(this._prefs={...this._prefs,...e},this.dispatchEvent(new CustomEvent(y,{bubbles:!0,detail:{...this._prefs}})),!this._hostPrefs&&this.viewKey)try{window.localStorage.setItem(`wui-view:${this.viewKey}`,JSON.stringify(this._prefs))}catch(e){if(!(e instanceof DOMException))throw e}}};function T(e){return typeof e==`object`&&!!e}function E(e){return e&&new URL(e,document.baseURI).href}var D=typeof document>`u`?null:document.currentScript;D instanceof HTMLScriptElement&&D.src&&(w.defaultAssetBase=new URL(`pdfjs/`,D.src).href),o(`wui-file-viewer`,w);var O=(e,t)=>import(`./fileViewerPdf-Boo6uXQO.js`).then(n=>n.renderFirstPage(e,{assetBase:w.defaultAssetBase||void 0,...t}));export{w as WuiFileViewer,b as fileKind,x as fileNameFromUrl,O as renderPdfFirstPage};
|
package/dist/ui-tour.global.js
CHANGED
|
@@ -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,t){a(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function a(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 o=`AppButton`,s=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),c={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 l(e){return Object.hasOwn(c,e)}function u(e=`primary`,t=`solid`,n=`md`){if(!s.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!l(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=c[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var d=`data-wui-dismiss`,f=`data-wui-closing`,p=`[${d}]`,m=`(prefers-reduced-motion: reduce)`,h=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,g=new WeakSet,_=Symbol.for(`webority.ui.modal-stack`),v=Symbol.for(`webority.ui.root-watches`);function ee(e){let t=e;return t[v]??=new Set,t[v]}function te(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(h))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${p},.wui-modal-back`))return t;n??=t}return n}function ne(e){let t=[],n=new Map;for(let r of e.querySelectorAll(h))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 y(e){let t=e;return t[_]??=[],t[_]}function re(e){b(e),y(e.ownerDocument).push(e)}function b(e){let t=y(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function x(e){for(let t of ee(e)){let n=S(e);t.last!==n&&(t.last=n,t.listener(n))}}function ie(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 ae(e,t){let n=t.focus===`first-control`?te(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`),g.add(e);let o=()=>{if(re(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw b(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),x(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;S(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&g.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(S(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=ne(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(p);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,b(e),g.has(e)?(o(),n&&t.onRequestClose(`escape`)):x(e.ownerDocument)},m=e.ownerDocument;return m.addEventListener(`keydown`,c),m.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{m.removeEventListener(`keydown`,c),m.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),g.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),b(e),x(e.ownerDocument)}}async function oe(e){g.delete(e),e.setAttribute(f,``),!window.matchMedia(m).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ie(e),e.close(),b(e),x(e.ownerDocument),e.removeAttribute(f)}function se(e){if(ce(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 ce(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function S(e=document){let t=y(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 le=/\{([A-Za-z0-9_]+)\}/g,ue=new Map,de=0,fe=new Map;function C(e,t){let n=ue.get(e);if(n===void 0)return t;let r=fe.get(e);if(r!==void 0&&r.version===de&&r.english===t&&me(r.merged,t))return r.merged;let i=pe(e,n,t);return fe.set(e,{version:de,english:t,merged:i}),i}function pe(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(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=he(t);for(let t of he(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 me(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function he(e){return Array.from(e.matchAll(le),e=>e[1]??``)}var w={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`},ge={advanceLabel:`Click {actionName} to continue.`},T=`data-advance`,E=`wui-tour-hint`,D=`wui-tour-pointer`,_e=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ve=()=>C(`tourAdvance`,ge),O=(e,t)=>e?.advanceOn===`click`&&!!t,k=e=>(e??``).replace(/\s+/g,` `).trim(),ye=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,be=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 xe(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(ye(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=k(e);if(t)return t}return``}function Se(e){for(let t of[e,...e.querySelectorAll(_e)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!be(t))return t;return null}function A(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 Ce(e,t){let n=e.querySelector(`.${E}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&A(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=E,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&&A(e,i,!0)}}function we(e,t){let n=e.querySelector(`.${D}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=D,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Te=e=>getComputedStyle(e).animationName;function j(e,{layer:t,spot:n,card:r},i,a){let o=O(i,a);t.toggleAttribute(T,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(T)&&(n.removeAttribute(T),o&&Te(n)),o&&n.setAttribute(T,``),we(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?k(i?.actionLabel)||xe(a):``,l=e.getAttribute(`advance-label`)||ve().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return Ce(r,u),u}function Ee(e,t,n){if(!O(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function De(e,t,n,r){return e.contains(r)||O(t,n)&&n.contains(r)}function Oe(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=O(r,i)?Se(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 ke(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var Ae=2/3,je=1e3,Me=new Set([`top`,`left`,`width`,`height`]),M=new WeakMap,N=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],P=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Ne=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Me.has(e.transitionProperty),Pe=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function F(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,je);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Fe(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?N(t,Ne):[]){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*Ae-r)}return n}function I(e){let t=Fe(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={};M.set(e,n);let r=()=>{M.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=N(e,Pe);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function L(e){return e.dataset.state=`leaving`,F(N(e,P))}function Ie(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?F(N(n,P)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Le=2,R=12,z=8,B=4,V=20,Re=`(max-width: 575.98px)`,ze=[`bottom`,`top`,`right`,`left`],H=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],U,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 Be(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=q(e),r=e.offsetHeight+R;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+Le}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function K(e,t,n){let r=e.style,i=t.style,a=Ge(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 H)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,Ve(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=q(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-R,top:o.top-R-l.top,right:l.right-o.right-R,left:o.left-R-l.left},f=window.matchMedia(Re).matches,p=ze.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+z)-Math.max(o.top,l.top-z);p?He(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?Ue(t,a,o,l,c):We(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function Ve(e,t){U??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of H)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),U&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function He(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+R:r.top-R-a.height,l=W(e-s,V,a.width-V)}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+R:r.left-R-a.width,l=W(e-c,V,a.height-V)}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 Ue(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)-B;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+B,r.left,r.right-i.width)}px`}function We(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+R:r.top-R-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 q(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+z,bottom:window.innerHeight-r(`paddingBottom`)-z,left:r(`paddingLeft`)+z,right:window.innerWidth-r(`paddingRight`)-z}}function Ge(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 Ke=0,qe=`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 Je(e,t,n){let r=`wui-tour-end-${++Ke}`,i=!!(t.nextLabel&&t.nextHref),a=n?e.createElement(`dialog`):e.createElement(`div`);a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,i&&(a.dataset.next=``),a.setAttribute(`role`,`dialog`),a.tabIndex=-1,a.setAttribute(`aria-labelledby`,`${r}-title`),a.setAttribute(`aria-describedby`,`${r}-message`),a.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions">${i?`<a class="${u(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${o}"></a>`:``}<button type="button" class="${i?qe:u(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${o}"></button></div>`,J(a,`.wui-tour-end-title`,HTMLElement).textContent=t.title,J(a,`.wui-tour-end-message`,HTMLElement).textContent=t.message,J(a,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:s,nextHref:c}=t;if(i&&s&&c){let e=J(a,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=s,e.setAttribute(`href`,c)}return a}var Ye=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function Xe(e,t,n){let r=e.ownerDocument,i=Je(r,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,oe(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=>{Ye(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 ke(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,K(m,p,null),e.append(i),I(i),u&&(d=ae(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=L(p);v?v.then(_):_()})}var Ze=` :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-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::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; } } `,Qe=()=>C(`tour`,w),$e=`wui-tour-media`,et=`wui-tour-media-toggle`,tt=`http://www.w3.org/2000/svg`,nt=`M6 5h4v14H6zM14 5h4v14h-4z`,rt=`M8 5v14l11-7z`,it=()=>({pause:Qe().mediaPauseLabel,play:Qe().mediaPlayLabel}),at=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function ot(e){let t=document.createElementNS(tt,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(tt,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function st(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 ct(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 lt(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=et;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(ot(r?nt:rt))};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 ut(e){let t=e.querySelector(`:scope > .${$e}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function dt(e,t,n=it()){if(ut(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=$e,t.mediaType===`video`){let e=ct(t,!at());r.append(e,lt(e,n))}else r.appendChild(st(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var ft=`data-wui-tour-open`,pt=()=>C(`tour`,w);function mt(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 ht(e,t,n){return(e.getAttribute(`progress-label`)||pt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function gt(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 _t=`wui-tour-seen:`;function vt(e=_t,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var yt=`wui-tour-step`,bt=`wui-tour-host`,Y=`data-tracking`,X=()=>C(`tour`,w),xt=()=>({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}),St={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`},Ct=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],wt={index:null,position:null,total:null},Tt=0,Et=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Dt=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ot=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},Q=null;function kt(e){Q||(Q=new CSSStyleSheet,Q.replaceSync(Ze)),e.adoptedStyleSheets=[Q]}var At=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=mt(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 > ${yt}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of Ct)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`?vt():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(St[e])||xt()[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=mt(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&&!Et(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(Et(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-${++Tt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${u(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${o}"></button> <button type="button" class="${u(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${o}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let n=t;this._shadow=null,this.isolated&&(n=document.createElement(bt),this._shadow=n.attachShadow({mode:`open`}),kt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),S(document).appendChild(n),document.documentElement.setAttribute(ft,``),this._outer=n,this._layer=t;let r=Z(t,`.wui-tour-spot`,HTMLDivElement),a=Z(t,`.wui-tour-card`,HTMLDivElement),s=Z(t,`[role=status]`,HTMLElement);this._spot=r,this._card=a,this._live=s,Z(a,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(a,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(a,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let c=e=>this._key(e);this._onKey=c;let l=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`);De(t,r,n?.target??null,e.target)||a.focus()};this._onFocusIn=l,document.addEventListener(`keydown`,c,!0),this._shadow||document.addEventListener(`focusin`,l),i(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=S(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),se(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=ht(this,c,l);gt(o,{text:d,position:c,total:l}),dt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=j(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(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,Be(o,n),a.removeAttribute(Y),this._place(),I(o),this._unbindAdvance?.(),this._unbindAdvance=Ee(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Dt(Ot()))||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`);K(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=L(e);if(t&&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 j(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),Xe(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(Dt(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`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`);Oe(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(a(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);Ie(t),document.documentElement.removeAttribute(ft),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()}:wt,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=wt,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}}))}},$=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,At),t(`wui-tour-step`,$),e.WuiTourStep=$,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,t){a(e),e._reanchor=t,e._reanchorScroll=n=>{n.composedPath().includes(e)||t()},window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchorScroll,!0)}function a(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 o=`AppButton`,s=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),c={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 l(e){return Object.hasOwn(c,e)}function u(e=`primary`,t=`solid`,n=`md`){if(!s.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!l(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=c[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var d=`data-wui-dismiss`,f=`data-wui-closing`,p=`[${d}]`,m=`(prefers-reduced-motion: reduce)`,h=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,g=new WeakSet,_=Symbol.for(`webority.ui.modal-stack`),v=Symbol.for(`webority.ui.root-watches`);function ee(e){let t=e;return t[v]??=new Set,t[v]}function te(e){let t=e.querySelector(`[data-autofocus]`);if(t)return t;let n=null;for(let t of e.querySelectorAll(h))if(!t.closest(`[hidden],[inert]`)){if(!t.closest(`${p},.wui-modal-back`))return t;n??=t}return n}function ne(e){let t=[],n=new Map;for(let r of e.querySelectorAll(h))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 y(e){let t=e;return t[_]??=[],t[_]}function re(e){b(e),y(e.ownerDocument).push(e)}function b(e){let t=y(e.ownerDocument),n=t.indexOf(e);n>=0&&t.splice(n,1)}function x(e){for(let t of ee(e)){let n=S(e);t.last!==n&&(t.last=n,t.listener(n))}}function ie(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 ae(e,t){let n=t.focus===`first-control`?te(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`),g.add(e);let o=()=>{if(re(e),!e.hasAttribute(`open`)){let t=n!==null&&!e.querySelector(`[autofocus]`);t&&n.setAttribute(`autofocus`,``);try{e.showModal()}catch(t){throw b(e),t}finally{t&&n.removeAttribute(`autofocus`)}}r.focus(),x(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;S(r)===e&&(e.querySelector(`:popover-open`)||r.querySelector(`[popover=""]:popover-open, [popover="auto"]:popover-open`)||(s=!0,window.setTimeout(()=>{s&&g.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(S(n)!==e||e.querySelector(`:popover-open`))return;t.preventDefault();let r=ne(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(p);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,b(e),g.has(e)?(o(),n&&t.onRequestClose(`escape`)):x(e.ownerDocument)},m=e.ownerDocument;return m.addEventListener(`keydown`,c),m.addEventListener(`keydown`,l),e.addEventListener(`cancel`,u),e.addEventListener(`click`,d),e.addEventListener(`close`,f),o(),()=>{m.removeEventListener(`keydown`,c),m.removeEventListener(`keydown`,l),e.removeEventListener(`cancel`,u),e.removeEventListener(`click`,d),e.removeEventListener(`close`,f),g.delete(e),i&&e.removeAttribute(`tabindex`),a&&e.removeAttribute(`closedby`),b(e),x(e.ownerDocument)}}async function oe(e){g.delete(e),e.setAttribute(f,``),!window.matchMedia(m).matches&&typeof e.getAnimations==`function`&&e.getAnimations().length>0&&await ie(e),e.close(),b(e),x(e.ownerDocument),e.removeAttribute(f)}function se(e){if(ce(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 ce(e){if(!e.hasAttribute(`popover`))throw Error(`nativeOverlay: the panel has no popover attribute`)}function S(e=document){let t=y(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 le=/\{([A-Za-z0-9_]+)\}/g,ue=new Map,de=0,fe=new Map;function C(e,t){let n=ue.get(e);if(n===void 0)return t;let r=fe.get(e);if(r!==void 0&&r.version===de&&r.english===t&&me(r.merged,t))return r.merged;let i=pe(e,n,t);return fe.set(e,{version:de,english:t,merged:i}),i}function pe(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(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=he(t);for(let t of he(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 me(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function he(e){return Array.from(e.matchAll(le),e=>e[1]??``)}var w={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`},ge={advanceLabel:`Click {actionName} to continue.`},T=`data-advance`,E=`wui-tour-hint`,D=`wui-tour-pointer`,_e=`a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]`,ve=()=>C(`tourAdvance`,ge),O=(e,t)=>e?.advanceOn===`click`&&!!t,k=e=>(e??``).replace(/\s+/g,` `).trim(),ye=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,be=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 xe(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(ye(e)??[],e=>e.textContent).join(` `),e.getAttribute(`alt`),r,e.textContent,e.getAttribute(`title`)];for(let e of i){let t=k(e);if(t)return t}return``}function Se(e){for(let t of[e,...e.querySelectorAll(_e)])if((t instanceof HTMLElement||t instanceof SVGElement)&&t.tabIndex>=0&&!be(t))return t;return null}function A(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 Ce(e,t){let n=e.querySelector(`.${E}`),r=e.querySelector(`.wui-tour-text`)?.id,i=r?`${r.replace(/-text$/,``)}-hint`:``;if(!t)n?.remove(),i&&A(e,i,!1);else{if(!n){n=e.ownerDocument.createElement(`p`),n.className=E,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&&A(e,i,!0)}}function we(e,t){let n=e.querySelector(`.${D}`);if(!t){n?.remove();return}if(n)return;let r=e.ownerDocument.createElement(`span`);r.className=D,r.setAttribute(`aria-hidden`,`true`),e.append(r)}var Te=e=>getComputedStyle(e).animationName;function j(e,{layer:t,spot:n,card:r},i,a){let o=O(i,a);t.toggleAttribute(T,o&&!(t.getRootNode()instanceof ShadowRoot)),n.hasAttribute(T)&&(n.removeAttribute(T),o&&Te(n)),o&&n.setAttribute(T,``),we(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?k(i?.actionLabel)||xe(a):``,l=e.getAttribute(`advance-label`)||ve().advanceLabel,u=c?l.replace(/\{actionName\}/g,()=>c):``;return Ce(r,u),u}function Ee(e,t,n){if(!O(e,t))return()=>{};let r,i=()=>{r??=setTimeout(n,0)};return t.addEventListener(`click`,i),()=>{t.removeEventListener(`click`,i),clearTimeout(r)}}function De(e,t,n,r){return e.contains(r)||O(t,n)&&n.contains(r)}function Oe(e,{card:t,active:n,step:r,target:i}){let a=Array.from(t.querySelectorAll(`button`)).filter(e=>!e.hidden),o=O(r,i)?Se(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 ke(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}var Ae=2/3,je=1e3,Me=new Set([`top`,`left`,`width`,`height`]),M=new WeakMap,N=(e,t)=>typeof e.getAnimations==`function`?e.getAnimations().filter(t):[],P=e=>`transitionProperty`in e&&e.transitionProperty===`opacity`,Ne=e=>`transitionProperty`in e&&typeof e.transitionProperty==`string`&&Me.has(e.transitionProperty),Pe=e=>`animationName`in e&&typeof e.animationName==`string`&&e.animationName.startsWith(`wui-tour-`);function F(e){return e.length===0?null:new Promise(t=>{let n=setTimeout(t,je);Promise.allSettled(e.map(e=>e.finished)).then(()=>{clearTimeout(n),t()})})}function Fe(e){let t=e.parentElement?.querySelector(`:scope > .wui-tour-spot`),n=0;for(let e of t?N(t,Ne):[]){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*Ae-r)}return n}function I(e){let t=Fe(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={};M.set(e,n);let r=()=>{M.get(e)===n&&e.dataset.state===`entering`&&(e.dataset.state=`shown`)},i=N(e,Pe);i.length===0?r():Promise.allSettled(i.map(e=>e.finished)).then(r)}function L(e){return e.dataset.state=`leaving`,F(N(e,P))}function Ie(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?F(N(n,P)):null;r?(e.setAttribute(`inert`,``),r.then(()=>e.remove())):e.remove()}var Le=2,R=12,z=8,B=4,V=20,Re=`(max-width: 575.98px)`,ze=[`bottom`,`top`,`right`,`left`],H=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],U,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 Be(e,t){if(!t?.scrollIntoView)return;e.style.maxHeight=``;let n=q(e),r=e.offsetHeight+R;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+Le}px`,t.scrollIntoView({block:`start`,inline:`nearest`}),t.style.scrollMarginTop=i}function K(e,t,n){let r=e.style,i=t.style,a=Ge(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 H)r.removeProperty(`border-${e}-radius`),r.removeProperty(`corner-${e}-shape`);t.dataset.placement=`center`,a.hidden=!0,i.position=`fixed`,i.top=`50%`,i.left=`50%`,i.transform=`translate(-50%, -50%)`,i.maxHeight=`calc(100vh - 16px)`;return}r.boxShadow=``,i.transform=``,i.position=`fixed`;let o=n.getBoundingClientRect();r.top=`${o.top}px`,r.left=`${o.left}px`,r.width=`${o.width}px`,r.height=`${o.height}px`,Ve(r,n);let s=t.scrollTop;i.maxHeight=``;let c={width:t.offsetWidth,height:t.offsetHeight},l=q(t),u=l.bottom-l.top,d={bottom:l.bottom-o.bottom-R,top:o.top-R-l.top,right:l.right-o.right-R,left:o.left-R-l.left},f=window.matchMedia(Re).matches,p=ze.find(e=>e===`top`||e===`bottom`?c.height<=d[e]+1:!f&&c.width<=d[e]+1&&c.height<=u+1),m=Math.min(o.bottom,l.bottom+z)-Math.max(o.top,l.top-z);p?He(t,a,p,o,l,c):m>=Math.min(c.height,u)+8?Ue(t,a,o,l,c):We(t,a,d.bottom>=d.top?`bottom`:`top`,o,l,c,d),t.scrollTop=s}function Ve(e,t){U??=CSS.supports(`corner-top-left-shape`,`squircle`);let n=getComputedStyle(t);for(let t of H)e.setProperty(`border-${t}-radius`,n.getPropertyValue(`border-${t}-radius`)),U&&e.setProperty(`corner-${t}-shape`,n.getPropertyValue(`corner-${t}-shape`))}function He(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+R:r.top-R-a.height,l=W(e-s,V,a.width-V)}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+R:r.left-R-a.width,l=W(e-c,V,a.height-V)}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 Ue(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)-B;e.style.top=`${Math.max(r.top,o-Math.min(i.height,a))}px`,e.style.left=`${W(n.left+B,r.left,r.right-i.width)}px`}function We(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+R:r.top-R-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 q(e){let t=e.parentElement,n=t?getComputedStyle(t):null,r=e=>Number.parseFloat(n?.[e]??``)||0;return{top:r(`paddingTop`)+z,bottom:window.innerHeight-r(`paddingBottom`)-z,left:r(`paddingLeft`)+z,right:window.innerWidth-r(`paddingRight`)-z}}function Ge(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 Ke=0,qe=`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 Je(e,t,n){let r=`wui-tour-end-${++Ke}`,i=!!(t.nextLabel&&t.nextHref),a=n?e.createElement(`dialog`):e.createElement(`div`);a.className=`wui-tour-card wui-tour-end`,a.dataset.layout=`center`,i&&(a.dataset.next=``),a.setAttribute(`role`,`dialog`),a.tabIndex=-1,a.setAttribute(`aria-labelledby`,`${r}-title`),a.setAttribute(`aria-describedby`,`${r}-message`),a.innerHTML=` <div class="wui-tour-end-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div> <h2 class="wui-tour-title wui-tour-end-title" id="${r}-title"></h2> <p class="wui-tour-text wui-tour-end-message" id="${r}-message"></p> <div class="wui-tour-actions">${i?`<a class="${u(`primary`,`solid`,`sm`)} wui-tour-end-next" data-wui="${o}"></a>`:``}<button type="button" class="${i?qe:u(`primary`,`solid`,`sm`)} wui-tour-end-button" data-wui="${o}"></button></div>`,J(a,`.wui-tour-end-title`,HTMLElement).textContent=t.title,J(a,`.wui-tour-end-message`,HTMLElement).textContent=t.message,J(a,`.wui-tour-end-button`,HTMLButtonElement).textContent=t.button;let{nextLabel:s,nextHref:c}=t;if(i&&s&&c){let e=J(a,`.wui-tour-end-next`,HTMLAnchorElement);e.textContent=s,e.setAttribute(`href`,c)}return a}var Ye=e=>e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;function Xe(e,t,n){let r=e.ownerDocument,i=Je(r,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,oe(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=>{Ye(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 ke(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,K(m,p,null),e.append(i),I(i),u&&(d=ae(u,{escape:!0,backdrop:!1,focus:`first-control`,onRequestClose:()=>f(`done`)})),h.textContent=[t.title,t.message].filter(Boolean).join(`. `),c.focus())},v=L(p);v?v.then(_):_()})}var Ze=` :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; } } `,Qe=()=>C(`tour`,w),$e=`wui-tour-media`,et=`wui-tour-media-toggle`,tt=`http://www.w3.org/2000/svg`,nt=`M6 5h4v14H6zM14 5h4v14h-4z`,rt=`M8 5v14l11-7z`,it=()=>({pause:Qe().mediaPauseLabel,play:Qe().mediaPlayLabel}),at=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;function ot(e){let t=document.createElementNS(tt,`svg`);t.setAttribute(`viewBox`,`0 0 24 24`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`focusable`,`false`);let n=document.createElementNS(tt,`path`);return n.setAttribute(`d`,e),t.appendChild(n),t}function st(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 ct(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 lt(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=et;let r=(r=!e.paused)=>{n.setAttribute(`aria-label`,r?t.pause:t.play),n.replaceChildren(ot(r?nt:rt))};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 ut(e){let t=e.querySelector(`:scope > .${$e}`);if(!t)return;let n=t.querySelector(`video`);n&&(n.pause(),n.removeAttribute(`src`),n.load()),t.remove()}function dt(e,t,n=it()){if(ut(e),!t.media){e.removeAttribute(`data-media`);return}let r=document.createElement(`div`);if(r.className=$e,t.mediaType===`video`){let e=ct(t,!at());r.append(e,lt(e,n))}else r.appendChild(st(t));e.prepend(r),e.setAttribute(`data-media`,t.target?`step`:`welcome`)}var ft=`data-wui-tour-open`,pt=()=>C(`tour`,w);function mt(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 ht(e,t,n){return(e.getAttribute(`progress-label`)||pt().progressLabel).replace(/\{(current|total)\}/g,(e,r)=>String(r===`current`?t:n))}function gt(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 _t=`wui-tour-seen:`;function vt(e=_t,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var yt=`wui-tour-step`,bt=`wui-tour-host`,Y=`data-tracking`,X=()=>C(`tour`,w),xt=()=>({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}),St={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`},Ct=[[`media`,`media`],[`mediaAlt`,`media-alt`],[`mediaPoster`,`media-poster`],[`mediaType`,`media-type`],[`advanceOn`,`advance-on`],[`actionLabel`,`action-label`]],wt={index:null,position:null,total:null},Tt=0,Et=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,Dt=e=>e instanceof HTMLElement&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Z(e,t,n){let r=e.querySelector(t);if(!(r instanceof n))throw Error(`<wui-tour> layer has no ${t}`);return r}var Ot=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},Q=null;function kt(e){Q||(Q=new CSSStyleSheet,Q.replaceSync(Ze)),e.adoptedStyleSheets=[Q]}var At=class extends r{seenStore;onBeforeStep;_run;_running;_layer;_outer;_shadow;_unbindAdvance;_ending;_seenMark;_steps=[];_progress=mt(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 > ${yt}`),e=>{let t={target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:(e.textContent??``).trim()};for(let[n,r]of Ct)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`?vt():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(St[e])||xt()[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=mt(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&&!Et(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(Et(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-${++Tt}`,t=document.createElement(`div`);t.className=`wui-tour-layer`,t.innerHTML=` <div class="wui-tour-spot" aria-hidden="true"></div> <div class="wui-tour-card" role="dialog" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text"> <p class="wui-tour-position"></p> <h2 class="wui-tour-title" id="${e}-title"></h2> <p class="wui-tour-text" id="${e}-text"></p> <div class="wui-tour-actions"> <button type="button" class="btn btn-sm btn-link wui-tour-skip"></button> <div class="wui-tour-nav"> <button type="button" class="${u(`neutral`,`outline`,`sm`)} wui-tour-back" data-wui="${o}"></button> <button type="button" class="${u(`primary`,`solid`,`sm`)} wui-tour-next" data-wui="${o}"></button> </div> </div> </div> <div class="visually-hidden" role="status" aria-live="polite"></div>`;let n=t;this._shadow=null,this.isolated&&(n=document.createElement(bt),this._shadow=n.attachShadow({mode:`open`}),kt(this._shadow),this._shadow.appendChild(t)),n.setAttribute(`popover`,`manual`),S(document).appendChild(n),document.documentElement.setAttribute(ft,``),this._outer=n,this._layer=t;let r=Z(t,`.wui-tour-spot`,HTMLDivElement),a=Z(t,`.wui-tour-card`,HTMLDivElement),s=Z(t,`[role=status]`,HTMLElement);this._spot=r,this._card=a,this._live=s,Z(a,`.wui-tour-skip`,HTMLElement).addEventListener(`click`,()=>this._close(`skipped`,`button`)),Z(a,`.wui-tour-back`,HTMLElement).addEventListener(`click`,()=>this._move(-1)),Z(a,`.wui-tour-next`,HTMLElement).addEventListener(`click`,()=>this._move(1));let c=e=>this._key(e);this._onKey=c;let l=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`);De(t,r,n?.target??null,e.target)||a.focus()};this._onFocusIn=l,document.addEventListener(`keydown`,c,!0),this._shadow||document.addEventListener(`focusin`,l),i(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=S(this.ownerDocument);e.parentElement!==t&&t.appendChild(e),se(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=ht(this,c,l);gt(o,{text:d,position:c,total:l}),dt(o,r,{pause:this._label(`mediaPause`),play:this._label(`mediaPlay`)}),o.toggleAttribute(`data-welcome`,!n);let f=j(this,{layer:i,spot:a,card:o},r,n),p=Z(o,`.wui-tour-title`,HTMLElement);p.textContent=r.title||``,p.hidden=!r.title,Z(o,`.wui-tour-text`,HTMLElement).textContent=r.description||``,Z(o,`.wui-tour-skip`,HTMLElement).textContent=this._label(`skip`);let m=Z(o,`.wui-tour-back`,HTMLElement);m.textContent=this._label(`back`),m.hidden=t<=this._firstIndex,Z(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,Be(o,n),a.removeAttribute(Y),this._place(),I(o),this._unbindAdvance?.(),this._unbindAdvance=Ee(r,n,()=>this._move(1));let g=this._active();(g!==null&&o.contains(g)?!(g instanceof HTMLElement&&g.hidden):this._shadow!==null&&Dt(Ot()))||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`);K(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=L(e);if(t&&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 j(this,{layer:t,spot:n,card:r},null,null),n.removeAttribute(Y),this._ending=new AbortController,this._seenMark=this._markSeen(`finished`),Xe(t,e,this._ending.signal)}_key(e){if(!(!this._layer||this._ending||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`,`escape`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(Dt(e.composedPath?.()[0]??e.target))return;if(e.preventDefault(),e.key===`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`);Oe(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(a(t),!t)throw Error(`<wui-tour> has a layer with no host to remove`);Ie(t),document.documentElement.removeAttribute(ft),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()}:wt,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=wt,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}}))}},$=class extends r{constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`})}};return t(`wui-tour`,At),t(`wui-tour-step`,$),e.WuiTourStep=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=.5;function t(t,n=36){let r=Math.max(0,Math.floor(t)),i=new Float64Array(r),a=null,o=e=>{let t=e>=0&&e<r?i[e]??0:0;return t>0?t:c.estimate},s=()=>{if(a)return a;let e=new Float64Array(r+1);for(let t=0;t<r;t++)e[t+1]=(e[t]??0)+o(t);return a=e,e},c={count:r,estimate:n,setEstimate(t){!(t>0)||Math.abs(t-c.estimate)<=e||(c.estimate=t,a=null)},set(t,n){if(t<0||t>=r||!(n>0))return!1;let s=o(t);return i[t]=n,Math.abs(s-n)<=e?!1:(a=null,!0)},heightOf:o,offsetOf(e){return s()[Math.min(Math.max(0,Math.floor(e)),r)]??0},total(){return s()[r]??0},indexAt(e){if(r===0)return 0;let t=s(),n=0,i=r-1;for(;n<i;){let r=n+i+1>>1;(t[r]??0)<=e?n=r:i=r-1}return n}};return c}function n(e,t){if(e.count===0)return{start:0,end:0,before:0,after:0};let{overscan:n=8}=t,r=Math.max(0,t.scrollTop),i=e.indexAt(r),a=e.indexAt(r+Math.max(0,t.viewport)),o=Math.max(0,i-n),s=Math.min(e.count,a+1+n);return{start:o,end:s,before:e.offsetOf(o),after:e.total()-e.offsetOf(s)}}function r(e,t,n){let r=e.offsetOf(t),i=r+e.heightOf(t);return r<n.scrollTop?r:i>n.scrollTop+n.viewport?i-n.viewport:n.scrollTop}export{r as n,n as r,t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.1",
|
|
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",
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"types": "./types/elements/filter-popover.d.ts",
|
|
101
101
|
"default": "./dist/elements/filter-popover.js"
|
|
102
102
|
},
|
|
103
|
+
"./elements/gantt": {
|
|
104
|
+
"types": "./types/elements/gantt.d.ts",
|
|
105
|
+
"default": "./dist/elements/gantt.js"
|
|
106
|
+
},
|
|
103
107
|
"./elements/hover-card": {
|
|
104
108
|
"types": "./types/elements/hover-card.d.ts",
|
|
105
109
|
"default": "./dist/elements/hover-card.js"
|
|
@@ -212,6 +216,10 @@
|
|
|
212
216
|
"types": "./types/elements/tree.d.ts",
|
|
213
217
|
"default": "./dist/elements/tree.js"
|
|
214
218
|
},
|
|
219
|
+
"./elements/tree-picker": {
|
|
220
|
+
"types": "./types/elements/tree-picker.d.ts",
|
|
221
|
+
"default": "./dist/elements/tree-picker.js"
|
|
222
|
+
},
|
|
215
223
|
"./elements/truncate": {
|
|
216
224
|
"types": "./types/elements/truncate.d.ts",
|
|
217
225
|
"default": "./dist/elements/truncate.js"
|
|
@@ -263,10 +271,10 @@
|
|
|
263
271
|
"@tiptap/starter-kit": "3.31.4",
|
|
264
272
|
"@types/node": "25.6.0",
|
|
265
273
|
"@vitest/coverage-v8": "5.1.0",
|
|
266
|
-
"@webority/biome-config": "0.
|
|
267
|
-
"@webority/markdown-core": "0.
|
|
268
|
-
"@webority/theme": "0.
|
|
269
|
-
"@webority/web-core": "0.
|
|
274
|
+
"@webority/biome-config": "0.169.1",
|
|
275
|
+
"@webority/markdown-core": "0.169.1",
|
|
276
|
+
"@webority/theme": "0.169.1",
|
|
277
|
+
"@webority/web-core": "0.169.1",
|
|
270
278
|
"echarts": "6.1.0",
|
|
271
279
|
"jsdom": "30.1.1",
|
|
272
280
|
"libphonenumber-js": "^1.13.9",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ElementBase } from "./elementBase.ts";
|
|
2
|
+
import { type Axis, type Layout, type LayoutGeometry, type PlacedRow } from "./ganttLayout.ts";
|
|
3
|
+
import type { GanttLayout, GanttRow, GanttSpec, GanttZoom } from "./ganttTypes.ts";
|
|
4
|
+
export declare class WuiGantt extends ElementBase {
|
|
5
|
+
uid: string;
|
|
6
|
+
_spec: unknown;
|
|
7
|
+
_prev: GanttSpec | null;
|
|
8
|
+
_zoom: GanttZoom;
|
|
9
|
+
_fromMs: number | null;
|
|
10
|
+
_folded: Set<string>;
|
|
11
|
+
_selected: string | null;
|
|
12
|
+
_controlled: boolean;
|
|
13
|
+
_awaitingSpec: boolean;
|
|
14
|
+
_connected: boolean;
|
|
15
|
+
_focusAfter: string | null;
|
|
16
|
+
_resolved: {
|
|
17
|
+
layout: GanttLayout;
|
|
18
|
+
zoom: GanttZoom;
|
|
19
|
+
fromMs: number;
|
|
20
|
+
todayMs: number;
|
|
21
|
+
} | null;
|
|
22
|
+
_specRows: GanttRow[];
|
|
23
|
+
_card: HTMLElement | null;
|
|
24
|
+
_onClick: (e: MouseEvent) => void;
|
|
25
|
+
_onKeyDown: (e: KeyboardEvent) => void;
|
|
26
|
+
_onChange: (e: Event) => void;
|
|
27
|
+
constructor();
|
|
28
|
+
get spec(): unknown;
|
|
29
|
+
set spec(v: unknown);
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
_readScript(): unknown;
|
|
33
|
+
_seed(spec: GanttSpec): void;
|
|
34
|
+
_emit<D>(name: string, detail?: D): void;
|
|
35
|
+
_setZoom(zoom: GanttZoom): void;
|
|
36
|
+
_setFrom(fromMs: number): void;
|
|
37
|
+
_setFolded(group: string): void;
|
|
38
|
+
_setSelected(key: string | null): void;
|
|
39
|
+
_syncRadios(): void;
|
|
40
|
+
_handleChange(e: Event): void;
|
|
41
|
+
_handleClick(e: MouseEvent): void;
|
|
42
|
+
_activate(token: string, control: HTMLElement): void;
|
|
43
|
+
_bars(): HTMLElement[];
|
|
44
|
+
_focusBar(bar: HTMLElement | undefined): void;
|
|
45
|
+
_barByKey(key: string | undefined): HTMLElement | undefined;
|
|
46
|
+
_handleKeyDown(e: KeyboardEvent): void;
|
|
47
|
+
_focusToken(): string | null;
|
|
48
|
+
_draw(): void;
|
|
49
|
+
_compose(): HTMLElement[];
|
|
50
|
+
_toolbar(spec: GanttSpec, counted: boolean): HTMLElement;
|
|
51
|
+
_countText(rows: GanttRow[]): string;
|
|
52
|
+
_scale(): HTMLElement;
|
|
53
|
+
_placeThumb(): void;
|
|
54
|
+
_nav(): HTMLElement;
|
|
55
|
+
_head(axis: Axis): HTMLElement;
|
|
56
|
+
_legend(mode: GanttLayout): HTMLElement;
|
|
57
|
+
_stateBlock(kind: "error" | "empty", text: string): HTMLElement;
|
|
58
|
+
_emptyBlock(spec: GanttSpec): HTMLElement;
|
|
59
|
+
_fillSkeleton(lane: HTMLElement, spec: GanttSpec, geo: LayoutGeometry): HTMLElement;
|
|
60
|
+
_fillLane(lane: HTMLElement, spec: GanttSpec, lay: Layout): void;
|
|
61
|
+
_names(row: GanttRow, byKey: Map<string, GanttRow>): string;
|
|
62
|
+
_barSentence(row: GanttRow, byKey: Map<string, GanttRow>): string;
|
|
63
|
+
_focusable(row: GanttRow, className: string, byKey: Map<string, GanttRow>, table: boolean): HTMLButtonElement;
|
|
64
|
+
_afterLabel(text: string, left: number, top: number, height: number): HTMLElement;
|
|
65
|
+
_drawBar(item: HTMLElement, placed: PlacedRow, byKey: Map<string, GanttRow>, lay: Layout): void;
|
|
66
|
+
_drawMilestone(item: HTMLElement, placed: PlacedRow, byKey: Map<string, GanttRow>, lay: Layout): void;
|
|
67
|
+
_drawGroup(item: HTMLElement, placed: PlacedRow, lay: Layout): void;
|
|
68
|
+
_deps(lay: Layout): SVGSVGElement;
|
|
69
|
+
_details(lay: Layout, byKey: Map<string, GanttRow>): HTMLElement | null;
|
|
70
|
+
}
|
package/types/WuiSelect.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export declare class WuiSelect extends ElementBase {
|
|
|
16
16
|
_query: string;
|
|
17
17
|
_ownsFilter: boolean;
|
|
18
18
|
_active: number;
|
|
19
|
+
_rows: number;
|
|
20
|
+
_windowed: boolean;
|
|
21
|
+
_windowLoad: Promise<void> | null;
|
|
22
|
+
_windowFailed: boolean;
|
|
23
|
+
_scrollFrame: number | null;
|
|
19
24
|
_status: "idle" | "loading" | "empty" | "hint";
|
|
20
25
|
_error: string;
|
|
21
26
|
_nav: ListboxKeyNav | null;
|
|
@@ -89,9 +94,12 @@ export declare class WuiSelect extends ElementBase {
|
|
|
89
94
|
_clearHover(): void;
|
|
90
95
|
_autoSearch(): boolean;
|
|
91
96
|
_visible(): HTMLElement[];
|
|
97
|
+
_rowCount(): number;
|
|
98
|
+
_rowEl(index: number): HTMLElement | undefined;
|
|
92
99
|
_setActive(index: number, { reveal }?: {
|
|
93
100
|
reveal?: boolean;
|
|
94
101
|
}): void;
|
|
102
|
+
_onListScroll(): void;
|
|
95
103
|
_actionRows(): ActionRow[];
|
|
96
104
|
_recents(): Recents;
|
|
97
105
|
_menuPlacement(control: HTMLElement, menu: HTMLElement): AnchorOptions;
|
|
@@ -113,6 +121,7 @@ export declare class WuiSelect extends ElementBase {
|
|
|
113
121
|
_dropMenu(): void;
|
|
114
122
|
_activePartsList(): SelectPart[];
|
|
115
123
|
_ensureParts(): void;
|
|
124
|
+
_loadWindow(): void;
|
|
116
125
|
_mountParts(carry?: Carry): void;
|
|
117
126
|
_teardownParts(): void;
|
|
118
127
|
_remountParts(): void;
|
package/types/WuiTree.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementBase } from "./elementBase.ts";
|
|
2
2
|
import { createListboxKeyNav } from "./listboxKeyNav.ts";
|
|
3
|
+
import { type HeightIndex } from "./select/window.ts";
|
|
3
4
|
export interface WuiTreeNode {
|
|
4
5
|
id?: string | number | null;
|
|
5
6
|
label?: string | number | null;
|
|
@@ -21,6 +22,7 @@ interface TreeModelNode {
|
|
|
21
22
|
parent: TreeModelNode | null;
|
|
22
23
|
level: number;
|
|
23
24
|
seq: number;
|
|
25
|
+
pos: number;
|
|
24
26
|
label: string;
|
|
25
27
|
icon: string | null;
|
|
26
28
|
badge: string | null;
|
|
@@ -32,6 +34,11 @@ interface TreeModelNode {
|
|
|
32
34
|
loading: boolean;
|
|
33
35
|
failed: boolean;
|
|
34
36
|
}
|
|
37
|
+
type Win = {
|
|
38
|
+
heights: HeightIndex;
|
|
39
|
+
start: number;
|
|
40
|
+
end: number;
|
|
41
|
+
};
|
|
35
42
|
export declare class WuiTree extends ElementBase {
|
|
36
43
|
_uid: string;
|
|
37
44
|
_seq: number;
|
|
@@ -53,6 +60,13 @@ export declare class WuiTree extends ElementBase {
|
|
|
53
60
|
_list: HTMLUListElement | null;
|
|
54
61
|
_live: HTMLDivElement | null;
|
|
55
62
|
_ready: boolean;
|
|
63
|
+
_flat: TreeModelNode[] | null;
|
|
64
|
+
_win: Win | null;
|
|
65
|
+
_rowH: number;
|
|
66
|
+
_rowMeasured: boolean;
|
|
67
|
+
_box: HTMLElement | null;
|
|
68
|
+
_unbind: (() => void) | null;
|
|
69
|
+
_frame: number;
|
|
56
70
|
_nav: ReturnType<typeof createListboxKeyNav>;
|
|
57
71
|
_onKeyDown: (e: KeyboardEvent) => void;
|
|
58
72
|
_onClick: (e: MouseEvent) => void;
|
|
@@ -94,6 +108,7 @@ export declare class WuiTree extends ElementBase {
|
|
|
94
108
|
_emit(name: string, detail: unknown): void;
|
|
95
109
|
_announce(text: string): void;
|
|
96
110
|
_setRoving(n: TreeModelNode): void;
|
|
111
|
+
_syncTab(): void;
|
|
97
112
|
_focusNode(n: TreeModelNode | undefined): void;
|
|
98
113
|
_activate(n: TreeModelNode): void;
|
|
99
114
|
_enabledLeaves(n: TreeModelNode): TreeModelNode[];
|
|
@@ -106,7 +121,27 @@ export declare class WuiTree extends ElementBase {
|
|
|
106
121
|
_handleKeyDown(e: KeyboardEvent): void;
|
|
107
122
|
_syncForm(): void;
|
|
108
123
|
_render(): void;
|
|
109
|
-
|
|
110
|
-
|
|
124
|
+
_drawRows(rows: TreeModelNode[]): void;
|
|
125
|
+
_metrics(): {
|
|
126
|
+
scrollTop: number;
|
|
127
|
+
viewport: number;
|
|
128
|
+
};
|
|
129
|
+
_rangeOf(win: Win): {
|
|
130
|
+
start: number;
|
|
131
|
+
end: number;
|
|
132
|
+
};
|
|
133
|
+
_draw(visible: TreeModelNode[], win: Win): void;
|
|
134
|
+
_measure(visible: TreeModelNode[], win: Win): {
|
|
135
|
+
changed: boolean;
|
|
136
|
+
delta: number;
|
|
137
|
+
};
|
|
138
|
+
_scrollBy(delta: number): void;
|
|
139
|
+
_paint(visible: TreeModelNode[], win: Win): void;
|
|
140
|
+
_repaintWindow(): void;
|
|
141
|
+
_schedule(): void;
|
|
142
|
+
_reveal(n: TreeModelNode): void;
|
|
143
|
+
_bindWindow(): void;
|
|
144
|
+
_unbindWindow(): void;
|
|
145
|
+
_buildItem(n: TreeModelNode): HTMLLIElement;
|
|
111
146
|
}
|
|
112
147
|
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ElementBase } from "./elementBase.ts";
|
|
2
|
+
import { treeKeyAction } from "./treePicker/treeKeys.ts";
|
|
3
|
+
import { type TreePickerViewText } from "./treePicker/treePickerView.ts";
|
|
4
|
+
import { type FlatTreeRow, type TreePickerMode, type TreePickerNode } from "./treePicker/treeState.ts";
|
|
5
|
+
export declare class WuiTreePicker extends ElementBase {
|
|
6
|
+
_uid: string;
|
|
7
|
+
_nodes: TreePickerNode[];
|
|
8
|
+
_hasNodes: boolean;
|
|
9
|
+
_valuesSet: boolean;
|
|
10
|
+
_pending: string[] | null;
|
|
11
|
+
_values: string[];
|
|
12
|
+
_expanded: Set<string>;
|
|
13
|
+
_query: string;
|
|
14
|
+
_focusId: string | null;
|
|
15
|
+
_rows: readonly FlatTreeRow[];
|
|
16
|
+
_ready: boolean;
|
|
17
|
+
_typed: {
|
|
18
|
+
text: string;
|
|
19
|
+
at: number;
|
|
20
|
+
};
|
|
21
|
+
_unsubscribe: (() => void) | null;
|
|
22
|
+
_onClick: (e: MouseEvent) => void;
|
|
23
|
+
_onInput: (e: Event) => void;
|
|
24
|
+
_onKeyDown: (e: KeyboardEvent) => void;
|
|
25
|
+
_onFocusIn: (e: FocusEvent) => void;
|
|
26
|
+
static get observedAttributes(): string[];
|
|
27
|
+
constructor();
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
disconnectedCallback(): void;
|
|
30
|
+
attributeChangedCallback(name: string): void;
|
|
31
|
+
get nodes(): TreePickerNode[];
|
|
32
|
+
set nodes(list: TreePickerNode[] | null | undefined);
|
|
33
|
+
get values(): string[];
|
|
34
|
+
set values(ids: readonly (string | number)[] | null | undefined);
|
|
35
|
+
get selection(): TreePickerMode;
|
|
36
|
+
set selection(v: string);
|
|
37
|
+
get name(): string | null;
|
|
38
|
+
set name(v: string | null | undefined);
|
|
39
|
+
_readScript(): TreePickerNode[] | null;
|
|
40
|
+
_adopt(list: TreePickerNode[]): void;
|
|
41
|
+
_readValuesAttribute(): string[];
|
|
42
|
+
_checkInitial(byId: ReadonlyMap<string, FlatTreeRow>, ids: readonly string[]): string[];
|
|
43
|
+
_normalise(): void;
|
|
44
|
+
_text(): TreePickerViewText;
|
|
45
|
+
_visible(): readonly FlatTreeRow[];
|
|
46
|
+
_isOpen(id: string): boolean;
|
|
47
|
+
_render(): void;
|
|
48
|
+
_syncForm(): void;
|
|
49
|
+
_emit(): void;
|
|
50
|
+
_commit(next: string[]): void;
|
|
51
|
+
_rowItems(): HTMLElement[];
|
|
52
|
+
_rowEl(id: string | null): HTMLElement | undefined;
|
|
53
|
+
_rowIdFrom(target: EventTarget | null): string | null;
|
|
54
|
+
_setRoving(id: string): void;
|
|
55
|
+
_focusRow(id: string | null): void;
|
|
56
|
+
_pick(id: string): void;
|
|
57
|
+
_toggleOpen(id: string): void;
|
|
58
|
+
_handleClick(e: MouseEvent): void;
|
|
59
|
+
_handleInput(e: Event): void;
|
|
60
|
+
_handleKeyDown(e: KeyboardEvent): void;
|
|
61
|
+
_searchKey(e: KeyboardEvent, input: Parameters<typeof treeKeyAction>[0]): void;
|
|
62
|
+
_move(row: FlatTreeRow, to: "next" | "prev" | "first" | "last"): void;
|
|
63
|
+
_typeahead(from: FlatTreeRow, char: string): void;
|
|
64
|
+
}
|
package/types/chartSpec.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type ChartRow = Record<string, string | number | null>;
|
|
|
15
15
|
export type FormatSpec = {
|
|
16
16
|
/** `percent` takes a ratio, as Intl does: 0.125 shows as 12.5%. */
|
|
17
17
|
style: FormatStyle;
|
|
18
|
-
/** For currency and compact: an ISO 4217 code (three capital letters)
|
|
18
|
+
/** For currency and compact: an ISO 4217 code (three capital letters). Required when style is currency. */
|
|
19
19
|
currency?: string | undefined;
|
|
20
20
|
/** What the value counts: `rupees` (default) or `paise` for money, `ms`, `s` (default), `min` or `h` for a duration. */
|
|
21
21
|
unit?: FormatUnit | undefined;
|
package/types/formatters.d.ts
CHANGED
|
@@ -38,14 +38,15 @@ export declare function formatNumber(value: unknown, { decimals }?: {
|
|
|
38
38
|
}): string;
|
|
39
39
|
/**
|
|
40
40
|
* Money: rupees get Indian grouping (₹12,34,567), any other currency three-digit grouping ($1,234,567).
|
|
41
|
-
* The symbol is the currency's (₹, $, €, £); any other ISO code prints as "AED 1,234". `
|
|
41
|
+
* The symbol is the currency's (₹, $, €, £); any other ISO code prints as "AED 1,234". `currency` is
|
|
42
|
+
* required, an ISO 4217 code such as "INR"; a call without it throws a TypeError. `unit: "paise"`
|
|
42
43
|
* takes the value in whole paise (a fraction throws) and shifts the decimal point once, here, for any currency. `decimals` (default 0) is fixed,
|
|
43
44
|
* so a column of amounts lines up: pass 2 where paise matter, as on an invoice.
|
|
44
45
|
*/
|
|
45
|
-
export declare function formatCurrency(value: unknown,
|
|
46
|
+
export declare function formatCurrency(value: unknown, options: {
|
|
46
47
|
unit?: string | undefined;
|
|
47
48
|
decimals?: unknown;
|
|
48
|
-
currency
|
|
49
|
+
currency: string;
|
|
49
50
|
}): string;
|
|
50
51
|
/**
|
|
51
52
|
* The short form. For rupees, in lakh and crore: 81.2 K, 19.8 L, ₹3.8 Cr. For any other currency, in K,
|
|
@@ -114,7 +115,8 @@ interface FormatOptions {
|
|
|
114
115
|
export declare function formatValue(value: unknown, format?: FormatOptions): string;
|
|
115
116
|
/**
|
|
116
117
|
* The short form of a format, for axis ticks: money and plain numbers go compact (₹3.8 Cr,
|
|
117
|
-
* 81.2 K), anything else keeps its own format.
|
|
118
|
+
* 81.2 K), anything else keeps its own format. A currency format needs its currency, which throws a
|
|
119
|
+
* TypeError when missing.
|
|
118
120
|
*/
|
|
119
121
|
export declare function compactFormatOf(format?: FormatOptions): FormatOptions;
|
|
120
122
|
/**
|