@webority/ui-react 0.139.4 → 0.140.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.
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.139.4"
5
+ "version": "0.140.1"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Web",
@@ -21,6 +21,12 @@
21
21
  "description": "Extra classes on the list.",
22
22
  "default": ""
23
23
  },
24
+ {
25
+ "name": "closeLabel",
26
+ "type": "string",
27
+ "required": false,
28
+ "description": "The label every trigger carries as data-close-label, for a stylesheet to show while the pane is open. Omitted when unset."
29
+ },
24
30
  {
25
31
  "name": "id",
26
32
  "type": "string",
@@ -2104,6 +2110,70 @@
2104
2110
  "A shortcut sets aria-keyshortcuts; the page binds the key itself.",
2105
2111
  "A static button renders as a plain span, never a button, so assistive technology reads it as text.",
2106
2112
  "The roll animation's copy of the label is aria-hidden, so the label is read once."
2113
+ ],
2114
+ "keyboard": [
2115
+ {
2116
+ "key": "Tab",
2117
+ "does": "Moves focus onto the button.",
2118
+ "notes": "In page order. A disabled or loading button is skipped."
2119
+ },
2120
+ {
2121
+ "key": "Shift + Tab",
2122
+ "does": "Moves focus to the previous control.",
2123
+ "notes": "Reverse of Tab; the order never changes."
2124
+ },
2125
+ {
2126
+ "key": "Enter",
2127
+ "does": "Activates the button.",
2128
+ "notes": "On a link button (href) it follows the link."
2129
+ },
2130
+ {
2131
+ "key": "Space",
2132
+ "does": "Activates the button.",
2133
+ "notes": "Runs on key up, like a native button. A link button ignores it."
2134
+ },
2135
+ {
2136
+ "key": "The shortcut key, for example N",
2137
+ "does": "Runs the action.",
2138
+ "notes": "Only when the page binds the key. The button exposes it as aria-keyshortcuts."
2139
+ }
2140
+ ],
2141
+ "contrast": [
2142
+ {
2143
+ "pair": "primary-text on primary",
2144
+ "light": "6.29:1 AA",
2145
+ "dark": "6.29:1 AA"
2146
+ },
2147
+ {
2148
+ "pair": "primary as text on bg-light",
2149
+ "light": "6.29:1 AA",
2150
+ "dark": "6.23:1 AA"
2151
+ },
2152
+ {
2153
+ "pair": "primary-hover as text on bg-light",
2154
+ "light": "4.47:1 Large only",
2155
+ "dark": "7.36:1 AAA"
2156
+ },
2157
+ {
2158
+ "pair": "danger-text on danger-10",
2159
+ "light": "4.77:1 AA",
2160
+ "dark": "4.77:1 AA"
2161
+ },
2162
+ {
2163
+ "pair": "success-text on the soft success tint (the success variant)",
2164
+ "light": "5.02:1 AA",
2165
+ "dark": "Set by the dark theme"
2166
+ },
2167
+ {
2168
+ "pair": "white on success-strong (solid green surfaces)",
2169
+ "light": "5.82:1 AA",
2170
+ "dark": "5.82:1 AA"
2171
+ },
2172
+ {
2173
+ "pair": "white on danger-strong (the danger variant)",
2174
+ "light": "5.80:1 AA",
2175
+ "dark": "5.80:1 AA"
2176
+ }
2107
2177
  ]
2108
2178
  }
2109
2179
  },
@@ -5103,6 +5173,13 @@
5103
5173
  "required": false,
5104
5174
  "description": "Content under the list, such as key hints."
5105
5175
  },
5176
+ {
5177
+ "name": "groupFilter",
5178
+ "type": "boolean",
5179
+ "required": false,
5180
+ "description": "Shows a pill per group under the query, All first with the total. Only the picked group's results are drawn. Tab and Shift+Tab in the search move to the next and previous pill; a changed query picks All again.",
5181
+ "default": false
5182
+ },
5106
5183
  {
5107
5184
  "name": "groups",
5108
5185
  "type": "array",
@@ -5141,6 +5218,12 @@
5141
5218
  "required": true,
5142
5219
  "description": "The item's key, unique within its group; keep it stable."
5143
5220
  },
5221
+ {
5222
+ "name": "keywords",
5223
+ "type": "array",
5224
+ "required": false,
5225
+ "description": "Other words the item answers to, such as synonyms. The search matches them the way it matches the label; the palette does not filter, so the caller's search reads them."
5226
+ },
5144
5227
  {
5145
5228
  "name": "label",
5146
5229
  "type": "node",
@@ -7372,6 +7455,33 @@
7372
7455
  "Sortable headers carry aria-sort and sort on Enter or Space.",
7373
7456
  "Row checkboxes are labelled Select row, the header one Select all rows, and the expand toggle Expand row or Collapse row with aria-expanded.",
7374
7457
  "The open row carries aria-current, and a saved or failed row change is announced through a polite status region."
7458
+ ],
7459
+ "keyboard": [
7460
+ {
7461
+ "key": "Tab",
7462
+ "does": "Moves focus through the table's stops: the scroll region, each sortable heading, each row that opens, each checkbox and each column resize handle, in page order.",
7463
+ "notes": "Arrow keys do nothing in the table."
7464
+ },
7465
+ {
7466
+ "key": "Enter",
7467
+ "does": "Sorts by a focused sortable column heading.",
7468
+ "notes": "Space does the same. Only sortable headings respond."
7469
+ },
7470
+ {
7471
+ "key": "Space",
7472
+ "does": "Sorts by a focused sortable column heading, or ticks a focused row checkbox.",
7473
+ "notes": "The checkbox is a native input; its state follows the browser."
7474
+ },
7475
+ {
7476
+ "key": "Enter",
7477
+ "does": "Opens a focused row.",
7478
+ "notes": "Only on a table with rowHref or onRowClick, and only when the row itself has focus."
7479
+ },
7480
+ {
7481
+ "key": "Shift + click",
7482
+ "does": "Selects or clears every row from the last ticked row to the clicked one.",
7483
+ "notes": "Mouse; set on a row checkbox, only when selection is on."
7484
+ }
7375
7485
  ]
7376
7486
  }
7377
7487
  },
@@ -8864,7 +8974,7 @@
8864
8974
  ],
8865
8975
  "a11y": [
8866
8976
  "The toggle is a button named by ariaLabel, else by label; an icon-only toggle with neither is an unnamed button, and a development warning says so.",
8867
- "Open state, outside click, Escape and arrow key navigation come from react-bootstrap Dropdown, and a custom trigger keeps them.",
8977
+ "The menu closes on an outside click or Escape and moves between items with the arrow keys, and a custom trigger keeps all of it.",
8868
8978
  "An item with a shortcut names its key to assistive technology through aria-keyshortcuts; picture rows use empty alt text."
8869
8979
  ]
8870
8980
  }
@@ -12953,6 +13063,12 @@
12953
13063
  "description": "The close button's accessible name.",
12954
13064
  "default": "Close"
12955
13065
  },
13066
+ {
13067
+ "name": "consentHref",
13068
+ "type": "url",
13069
+ "required": false,
13070
+ "description": "Adds a Privacy policy link beside the consent checkbox, opened in the same tab. Only with fields including consent."
13071
+ },
12956
13072
  {
12957
13073
  "name": "delaySeconds",
12958
13074
  "type": "number",
@@ -12996,7 +13112,7 @@
12996
13112
  "name": "fields",
12997
13113
  "type": "array",
12998
13114
  "required": false,
12999
- "description": "The fields in order: name, email, phone, company, message.",
13115
+ "description": "The fields in order: name, email, phone, company, message, consent.",
13000
13116
  "default": [
13001
13117
  "name",
13002
13118
  "email"
@@ -18963,11 +19079,12 @@
18963
19079
  "name": "variant",
18964
19080
  "type": "enum",
18965
19081
  "enum": [
19082
+ "band",
18966
19083
  "default",
18967
19084
  "muted"
18968
19085
  ],
18969
19086
  "required": false,
18970
- "description": "The section's background around the panel.",
19087
+ "description": "The section's background around the panel. `band` sets the call to action as a full-width band.",
18971
19088
  "default": "default"
18972
19089
  }
18973
19090
  ],
@@ -19007,7 +19124,7 @@
19007
19124
  "start"
19008
19125
  ],
19009
19126
  "required": false,
19010
- "description": "Where the heading block sits.",
19127
+ "description": "Where the heading block sits. Under `split` the default is `start`.",
19011
19128
  "default": "center"
19012
19129
  },
19013
19130
  {
@@ -19032,6 +19149,12 @@
19032
19149
  "description": "Extra class names for the root element.",
19033
19150
  "default": ""
19034
19151
  },
19152
+ {
19153
+ "name": "closeLabel",
19154
+ "type": "string",
19155
+ "required": false,
19156
+ "description": "The label every question's toggle carries as data-close-label, for a stylesheet to show while the question is open. Omitted when unset."
19157
+ },
19035
19158
  {
19036
19159
  "name": "eyebrow",
19037
19160
  "type": "node",
@@ -19061,10 +19184,11 @@
19061
19184
  "type": "enum",
19062
19185
  "enum": [
19063
19186
  "default",
19064
- "muted"
19187
+ "muted",
19188
+ "split"
19065
19189
  ],
19066
19190
  "required": false,
19067
- "description": "The section's background.",
19191
+ "description": "The section's layout and background. `split` sets the heading block beside the questions.",
19068
19192
  "default": "default"
19069
19193
  }
19070
19194
  ],
@@ -21556,7 +21680,7 @@
21556
21680
  }
21557
21681
  ],
21558
21682
  "required": false,
21559
- "description": "The topbar search."
21683
+ "description": "The topbar search. Its onChange, onSelect, onSubmit and onFocus handlers are passed in code; onFocus runs when the field gets focus, for example to open a command palette."
21560
21684
  },
21561
21685
  {
21562
21686
  "name": "searchResultsLabel",
@@ -26479,7 +26603,7 @@
26479
26603
  "dont": [],
26480
26604
  "a11y": [
26481
26605
  "The tooltip opens on hover and on keyboard focus of the trigger, so keyboard users get the same hint.",
26482
- "The tooltip carries a generated id and react-bootstrap links it to the trigger with aria-describedby while it is open.",
26606
+ "The tooltip carries a generated id, and the trigger points at it with aria-describedby while it is open.",
26483
26607
  "Placement flips to stay inside the viewport, but essential information still belongs in visible copy."
26484
26608
  ]
26485
26609
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.139.4",
3
+ "version": "0.140.1",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.139.4"
9
+ "version": "0.140.1"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "d1930396d224fcf9d5be56a4e1f2a19f051a7d5b5566dbe0f472ea4039888f4e",
14
- "bytes": 974700
13
+ "sha256": "137a97627a67b5eb9eec6157eb567043f2a181cc57a0f185bdb4a6a19c34039c",
14
+ "bytes": 979840
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "ffacd4ed68de0fda02317eff10b195f54e3efa5e5701668672d4e4493d8f3c8e",
18
- "bytes": 11153339
17
+ "sha256": "70208ba19ba5ba6bf138a74feb4032e75ce71273d7ef5a29875b168a77f2d52f",
18
+ "bytes": 11171914
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i,useId as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`bordered`,`flat`];function u(e,t,n){if(Array.isArray(n)){let e=n.map(String);return new Set(t?e:e.slice(0,1))}let r=e.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(t?r:r.slice(0,1))}function d(d){let{marker:f,props:p}=e(`AppAccordion`,d),{items:m=[],multiple:h=!1,openItems:g,variant:_=`bordered`,id:v,className:y=``,...b}=p;r(`AppAccordion`,b),n(`AppAccordion`,`variant`,_,l);let x=_===`flat`,S=/* @__PURE__ */ s(`span`,{className:`wui-accordion-icon`,children:/* @__PURE__ */ s(t,{name:`chevron-down`,size:18})}),C=a(),w=v||C,[T,E]=o(()=>u(m,h,g)),D=Array.isArray(g)?g.map(String).join(`\0`):null;i(()=>{D!==null&&E(u(m,h,g))},[D,h]);let O=(e,t)=>e.key??String(t),k=e=>{E(t=>{let n=new Set(h?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return/* @__PURE__ */ s(`div`,{className:`wui-accordion${x?` wui-accordion-flat`:``}${y?` ${y}`:``}`,...f,...b,children:m.map((e,t)=>{let n=O(e,t),r=T.has(n),i=`${w}-${t}`,a=`${i}-q`;return/* @__PURE__ */ c(`div`,{className:`wui-accordion-item${r?` open`:``}`,children:[/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-accordion-trigger`,id:a,"aria-expanded":r,"aria-controls":i,onClick:()=>k(n),children:[x?S:null,e.title,e.count==null?null:/* @__PURE__ */ s(`span`,{className:`wui-accordion-count`,children:e.count}),x?null:S]}),/* @__PURE__ */ s(`section`,{className:`wui-accordion-panel`,id:i,"aria-labelledby":a,inert:!r,"aria-hidden":!r||void 0,children:/* @__PURE__ */ s(`div`,{className:`wui-accordion-body`,children:e.content})})]},n)})})}export{d as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i,useId as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`bordered`,`flat`];function u(e,t,n){if(Array.isArray(n)){let e=n.map(String);return new Set(t?e:e.slice(0,1))}let r=e.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(t?r:r.slice(0,1))}function d(d){let{marker:f,props:p}=e(`AppAccordion`,d),{items:m=[],multiple:h=!1,openItems:g,variant:_=`bordered`,id:v,closeLabel:y,className:b=``,...x}=p;r(`AppAccordion`,x),n(`AppAccordion`,`variant`,_,l);let S=_===`flat`,C=/* @__PURE__ */ s(`span`,{className:`wui-accordion-icon`,children:/* @__PURE__ */ s(t,{name:`chevron-down`,size:18})}),w=a(),T=v||w,[E,D]=o(()=>u(m,h,g)),O=Array.isArray(g)?g.map(String).join(`\0`):null;i(()=>{O!==null&&D(u(m,h,g))},[O,h]);let k=(e,t)=>e.key??String(t),A=e=>{D(t=>{let n=new Set(h?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return/* @__PURE__ */ s(`div`,{className:`wui-accordion${S?` wui-accordion-flat`:``}${b?` ${b}`:``}`,...f,...x,children:m.map((e,t)=>{let n=k(e,t),r=E.has(n),i=`${T}-${t}`,a=`${i}-q`;return/* @__PURE__ */ c(`div`,{className:`wui-accordion-item${r?` open`:``}`,children:[/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-accordion-trigger`,id:a,"aria-expanded":r,"aria-controls":i,"data-close-label":y,onClick:()=>A(n),children:[S?C:null,e.title,e.count==null?null:/* @__PURE__ */ s(`span`,{className:`wui-accordion-count`,children:e.count}),S?null:C]}),/* @__PURE__ */ s(`section`,{className:`wui-accordion-panel`,id:i,"aria-labelledby":a,inert:!r,"aria-hidden":!r||void 0,children:/* @__PURE__ */ s(`div`,{className:`wui-accordion-body`,children:e.content})})]},n)})})}export{d as default};
@@ -1 +1 @@
1
- import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppModal.js";import a from"./AppSpinner.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{matchSegments as c}from"@webority/ui-elements/helpers";import{Fragment as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/command-palette";var g=`lg`;function _(e){let{marker:t,props:r}=n(`AppCommandPalette`,e),{open:a,onClose:o,query:c=``,onQueryChange:l,placeholder:u=`Search…`,groups:f=[],path:p=[],onPathChange:h,rootLabel:_,backLabel:y=`Back`,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C=!1,emptyText:w=`No results`,footer:T,ariaLabel:E=`Search`,resultsLabel:D=`Results`,highlight:O=!0,id:k,className:A=``,...j}=r;s(`AppCommandPalette`,j);let M=d(),N=k||M;return/* @__PURE__ */ m(i,{...t,open:a,onClose:o,hideHeader:!0,placement:`top`,size:g,ariaLabel:E,className:`wui-cmd-card${A?` ${A}`:``}`,children:/* @__PURE__ */ m(v,{baseId:N,query:c,onQueryChange:l,placeholder:u,groups:f,path:p,onPathChange:h,rootLabel:_,backLabel:y,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C,emptyText:w,footer:T,ariaLabel:E,resultsLabel:D,highlight:O,onClose:o,rest:j})})}function v({baseId:n,query:i,onQueryChange:s,placeholder:c,groups:l,path:d,onPathChange:g,rootLabel:_,backLabel:v,recentsKey:x,recentsLimit:S,recentsLabel:C,loading:w,emptyText:T,footer:E,ariaLabel:D,resultsLabel:O,highlight:k,onClose:A,rest:j}){let M=p(null),N=`${n}-list`,P=l.filter(e=>e.items?.length),F=!w&&i.trim()!==``&&P.length===0;return f(()=>{M.current?.refresh?.()}),u(()=>{let e=M.current,t=e=>{let t=l.find(t=>String(t.key)===e.detail.groupKey)?.items?.find(t=>String(t.key)===e.detail.key);t&&(e.preventDefault(),t.page?(s?.(``),g?.([...d,{key:t.page.key,label:t.page.label}])):(t.onSelect?.(),A?.()))},n=e=>{e.preventDefault(),s?.(``),g?.(e.detail.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,d,A,s,g]),/* @__PURE__ */ h(`wui-command-palette`,{ref:M,path:JSON.stringify(d),"root-label":_,"recents-key":x,"recents-limit":S,"recents-label":C,...j,children:[/* @__PURE__ */ h(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`search`,size:18})}),/* @__PURE__ */ m(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":N,"aria-autocomplete":`list`,"aria-label":D,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:i,onChange:e=>s?.(e.target.value)}),w&&/* @__PURE__ */ m(a,{size:`sm`,className:`wui-cmd-spinner`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":v,children:/* @__PURE__ */ m(r,{name:`chevron-left`,size:16})}),/* @__PURE__ */ m(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-list`,role:`listbox`,id:N,"aria-label":O,"aria-busy":w?`true`:void 0,hidden:P.length===0,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-recents`}),P.map(a=>{let s=`${n}-${b(a.key)}`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":s,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:s,children:a.label}),a.items.map(n=>{let c=`${s}-${b(n.key)}`,l=n.description==null?null:`${c}-desc`,u=n.meta==null?null:`${c}-meta`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(a.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:o(n.icon,{size:18})}),/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-label`,children:k?y(n.label,i):n.label}),l&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`chevron-right`,size:16})})]},n.key)})]},a.key)})]}),/* @__PURE__ */ m(`div`,{className:`wui-cmd-empty`,role:`status`,children:F?T:null}),E!=null&&/* @__PURE__ */ m(`div`,{className:`wui-cmd-footer`,children:E})]})}function y(e,t){if(typeof e!=`string`)return e;let n=c(e,t);if(n.length===1&&!n[0].match)return e;let r=0;return n.map(e=>{let t=r;return r+=e.text.length,e.match?/* @__PURE__ */ m(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ m(l,{children:e.text},t)})}function b(e){return String(e).replace(/\s+/g,`_`)}export{_ as default};
1
+ import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppModal.js";import a from"./AppSpinner.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{matchSegments as c}from"@webority/ui-elements/helpers";import{Fragment as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import"@webority/ui-elements/elements/command-palette";var _=`lg`;function v(e){let{marker:t,props:r}=n(`AppCommandPalette`,e),{open:a,onClose:o,query:c=``,onQueryChange:l,placeholder:u=`Search…`,groups:f=[],path:p=[],onPathChange:m,rootLabel:g,backLabel:v=`Back`,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C=!1,emptyText:w=`No results`,footer:T,ariaLabel:E=`Search`,resultsLabel:D=`Results`,highlight:O=!0,groupFilter:k=!1,id:A,className:j=``,...M}=r;s(`AppCommandPalette`,M);let N=d(),P=A||N;return/* @__PURE__ */ h(i,{...t,open:a,onClose:o,hideHeader:!0,placement:`top`,size:_,ariaLabel:E,className:`wui-cmd-card${j?` ${j}`:``}`,children:/* @__PURE__ */ h(y,{baseId:P,query:c,onQueryChange:l,placeholder:u,groups:f,path:p,onPathChange:m,rootLabel:g,backLabel:v,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C,emptyText:w,footer:T,ariaLabel:E,resultsLabel:D,highlight:O,groupFilter:k,onClose:o,rest:M})})}function y({baseId:n,query:i,onQueryChange:s,placeholder:c,groups:l,path:d,onPathChange:_,rootLabel:v,backLabel:y,recentsKey:C,recentsLimit:w,recentsLabel:T,loading:E,emptyText:D,footer:O,ariaLabel:k,resultsLabel:A,highlight:j,groupFilter:M,onClose:N,rest:P}){let F=p(null),I=`${n}-list`,L=l.filter(e=>e.items?.length),R=!E&&i.trim()!==``&&L.length===0,[z,B]=m({query:i,key:null}),V=z.query===i&&L.some(e=>String(e.key)===z.key)?z.key:null,H=M&&V!=null?L.filter(e=>String(e.key)===V):L,U=M&&L.length>0,W=e=>B({query:i,key:e}),G=e=>{if(!U||e.key!==`Tab`)return;e.preventDefault();let t=[x,...L.map(e=>String(e.key))],n=t[(Math.max(0,t.indexOf(V??x))+(e.shiftKey?-1:1)+t.length)%t.length];W(n===x?null:n)};return f(()=>{F.current?.refresh?.()}),u(()=>{let e=F.current,t=e=>{let t=l.find(t=>String(t.key)===e.detail.groupKey)?.items?.find(t=>String(t.key)===e.detail.key);t&&(e.preventDefault(),t.page?(s?.(``),_?.([...d,{key:t.page.key,label:t.page.label}])):(t.onSelect?.(),N?.()))},n=e=>{e.preventDefault(),s?.(``),_?.(e.detail.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,d,N,s,_]),/* @__PURE__ */ g(`wui-command-palette`,{ref:F,path:JSON.stringify(d),"root-label":v,"recents-key":C,"recents-limit":w,"recents-label":T,...P,children:[/* @__PURE__ */ g(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ h(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ h(r,{name:`search`,size:18})}),/* @__PURE__ */ h(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":I,"aria-autocomplete":`list`,"aria-label":k,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:i,onChange:e=>s?.(e.target.value),onKeyDown:G}),E&&/* @__PURE__ */ h(a,{size:`sm`,className:`wui-cmd-spinner`})]}),U&&/* @__PURE__ */ h(`div`,{className:`wui-cmd-tabs app-tabs app-tabs-pills app-tabs-sm`,role:`tablist`,"aria-label":`Result groups`,children:[{key:``,label:`All (${L.reduce((e,t)=>e+t.items.length,0)})`},...L.map(e=>({key:String(e.key),label:`${e.label} (${e.items.length})`}))].map(e=>{let t=(V??``)===e.key;return/* @__PURE__ */ h(`button`,{type:`button`,className:t?`app-tab active`:`app-tab`,role:`tab`,"aria-selected":t?`true`:`false`,tabIndex:-1,"data-group-tab":e.key,onClick:()=>W(e.key===``?null:e.key),children:/* @__PURE__ */ h(`span`,{className:`wui-tab-label`,children:e.label})},e.key||x)})}),/* @__PURE__ */ g(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":y,children:/* @__PURE__ */ h(r,{name:`chevron-left`,size:16})}),/* @__PURE__ */ h(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ g(`div`,{className:`wui-cmd-list`,role:`listbox`,id:I,"aria-label":A,"aria-busy":E?`true`:void 0,hidden:L.length===0,children:[/* @__PURE__ */ h(`div`,{className:`wui-cmd-recents`}),H.map(a=>{let s=`${n}-${S(a.key)}`;return/* @__PURE__ */ g(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":s,children:[/* @__PURE__ */ h(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:s,children:a.label}),a.items.map(n=>{let c=`${s}-${S(n.key)}`,l=n.description==null?null:`${c}-desc`,u=n.meta==null?null:`${c}-meta`;return/* @__PURE__ */ g(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(a.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"data-keywords":n.keywords?.length?n.keywords.join(` `):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:o(n.icon,{size:18})}),/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-label`,children:j?b(n.label,i):n.label}),l&&/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ h(r,{name:`chevron-right`,size:16})})]},n.key)})]},a.key)})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-empty`,role:`status`,children:R?D:null}),O!=null&&/* @__PURE__ */ h(`div`,{className:`wui-cmd-footer`,children:O})]})}function b(e,t){if(typeof e!=`string`)return e;let n=c(e,t);if(n.length===1&&!n[0].match)return e;let r=0;return n.map(e=>{let t=r;return r+=e.text.length,e.match?/* @__PURE__ */ h(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ h(l,{children:e.text},t)})}var x=`__all__`;function S(e){return String(e).replace(/\s+/g,`_`)}export{v as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./useWuiControl.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";import"@webority/ui-elements/elements/lead-popup";var s=[`name`,`email`,`phone`,`company`,`message`],c=[`exit`,`delay`,`scroll`,`pages`],l=e=>e?.length?e.join(` `):void 0,u=e=>{let t=Object.entries(e??{});return t.length?t.map(([e,t])=>`${e}=${t}`).join(`;`):void 0},d=i(function(i,d){let{marker:f,props:p}=e(`AppLeadPopup`,i),{action:m,publicForm:h,title:g,description:_,fields:v=[`name`,`email`],required:y=[],fieldPrefix:b,fieldNames:x,labels:S,maxLengths:C,submitLabel:w,successTitle:T,successText:E,errorText:D,closeLabel:O,secondaryLabel:k,secondaryHref:A,secondaryDivider:j,triggers:M=[],delaySeconds:N,scrollPercent:P,pagesViewed:F,storageKey:I,dismissDays:L,submittedDays:R,successCloseSeconds:z,preview:B=!1,onShown:V,onBeforeSubmit:H,onSubmitted:U,onError:W,onClosed:G,className:K=``,style:q,...J}=p;r(`AppLeadPopup`,J);for(let e of v)n(`AppLeadPopup`,`fields`,e,s);for(let e of y)n(`AppLeadPopup`,`required`,e,s);for(let e of M)n(`AppLeadPopup`,`triggers`,e,c);let{setRef:Y,innerRef:X}=t({ref:d});return a(()=>{let e=X.current;if(!e)return;let t=[[`wui-lead-popup-shown`,e=>V?.(e.detail)],[`wui-lead-popup-before-submit`,e=>H?.(e.detail.formData)],[`wui-lead-popup-submitted`,e=>U?.(e.detail)],[`wui-lead-popup-error`,e=>W?.(e.detail)],[`wui-lead-popup-closed`,e=>G?.(e.detail.reason)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[X,V,H,U,W,G]),/* @__PURE__ */ o(`wui-lead-popup`,{ref:Y,action:m||void 0,"public-form":h||void 0,heading:g||void 0,description:_||void 0,fields:l(v),required:l(y),"field-prefix":b||void 0,"field-names":u(x),labels:u(S),"max-lengths":u(C),"submit-label":w||void 0,"success-title":T||void 0,"success-text":E||void 0,"error-text":D||void 0,"close-label":O||void 0,"secondary-label":k||void 0,"secondary-href":A||void 0,"secondary-divider":j||void 0,triggers:l(M),"delay-seconds":N??void 0,"scroll-percent":P??void 0,"pages-viewed":F??void 0,"storage-key":I||void 0,"dismiss-days":L??void 0,"submitted-days":R??void 0,"success-close-seconds":z??void 0,preview:B||void 0,class:K||void 0,style:q,...f,...J})});export{d as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./useWuiControl.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";import"@webority/ui-elements/elements/lead-popup";var s=[`name`,`email`,`phone`,`company`,`message`,`consent`],c=[`exit`,`delay`,`scroll`,`pages`],l=e=>e?.length?e.join(` `):void 0,u=e=>{let t=Object.entries(e??{});return t.length?t.map(([e,t])=>`${e}=${t}`).join(`;`):void 0},d=i(function(i,d){let{marker:f,props:p}=e(`AppLeadPopup`,i),{action:m,publicForm:h,title:g,description:_,fields:v=[`name`,`email`],required:y=[],fieldPrefix:b,fieldNames:x,labels:S,maxLengths:C,consentHref:w,submitLabel:T,successTitle:E,successText:D,errorText:O,closeLabel:k,secondaryLabel:A,secondaryHref:j,secondaryDivider:M,triggers:N=[],delaySeconds:P,scrollPercent:F,pagesViewed:I,storageKey:L,dismissDays:R,submittedDays:z,successCloseSeconds:B,preview:V=!1,onShown:H,onBeforeSubmit:U,onSubmitted:W,onError:G,onClosed:K,className:q=``,style:J,...Y}=p;r(`AppLeadPopup`,Y);for(let e of v)n(`AppLeadPopup`,`fields`,e,s);for(let e of y)n(`AppLeadPopup`,`required`,e,s);for(let e of N)n(`AppLeadPopup`,`triggers`,e,c);let{setRef:X,innerRef:Z}=t({ref:d});return a(()=>{let e=Z.current;if(!e)return;let t=[[`wui-lead-popup-shown`,e=>H?.(e.detail)],[`wui-lead-popup-before-submit`,e=>U?.(e.detail.formData)],[`wui-lead-popup-submitted`,e=>W?.(e.detail)],[`wui-lead-popup-error`,e=>G?.(e.detail)],[`wui-lead-popup-closed`,e=>K?.(e.detail.reason)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[Z,H,U,W,G,K]),/* @__PURE__ */ o(`wui-lead-popup`,{ref:X,action:m||void 0,"public-form":h||void 0,heading:g||void 0,description:_||void 0,fields:l(v),required:l(y),"field-prefix":b||void 0,"field-names":u(x),labels:u(S),"max-lengths":u(C),"consent-href":w||void 0,"submit-label":T||void 0,"success-title":E||void 0,"success-text":D||void 0,"error-text":O||void 0,"close-label":k||void 0,"secondary-label":A||void 0,"secondary-href":j||void 0,"secondary-divider":M||void 0,triggers:l(N),"delay-seconds":P??void 0,"scroll-percent":F??void 0,"pages-viewed":I??void 0,"storage-key":L||void 0,"dismiss-days":R??void 0,"submitted-days":z??void 0,"success-close-seconds":B??void 0,preview:V||void 0,class:q||void 0,style:J,...f,...Y})});export{d as default};
@@ -1 +1 @@
1
- import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{jsx as c}from"react/jsx-runtime";function l(l){let{marker:u,props:d}=a(`AppSectionCallToAction`,l),{title:f,actions:p,as:m=`h2`,eyebrow:h,subtitle:g,align:_=`center`,variant:v=`default`,className:y=``,...b}=d;return s(`AppSectionCallToAction`,b),o(`AppSectionCallToAction`,`as`,m,n),o(`AppSectionCallToAction`,`align`,_,t),o(`AppSectionCallToAction`,`variant`,v,r),/* @__PURE__ */ c(e,{component:`AppSectionCallToAction`,kind:`call-to-action`,title:f,as:i(m,`h2`),eyebrow:h,subtitle:g,align:_,variant:v,actions:p,className:y,rest:{...u,...b}})}export{l as default};
1
+ import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{jsx as c}from"react/jsx-runtime";var l=[...r,`band`];function u(r){let{marker:u,props:d}=a(`AppSectionCallToAction`,r),{title:f,actions:p,as:m=`h2`,eyebrow:h,subtitle:g,align:_=`center`,variant:v=`default`,className:y=``,...b}=d;s(`AppSectionCallToAction`,b),o(`AppSectionCallToAction`,`as`,m,n),o(`AppSectionCallToAction`,`align`,_,t),o(`AppSectionCallToAction`,`variant`,v,l);let x=[v===`band`?`wui-section-call-to-action--band`:``,y].filter(Boolean).join(` `);return/* @__PURE__ */ c(e,{component:`AppSectionCallToAction`,kind:`call-to-action`,title:f,as:i(m,`h2`),eyebrow:h,subtitle:g,align:_,variant:v,actions:p,className:x,rest:{...u,...b}})}export{u as default};
@@ -1 +1 @@
1
- import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAccordion.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{Children as l,cloneElement as u,isValidElement as d}from"react";import{jsx as f}from"react/jsx-runtime";function p(e,t){return Array.isArray(t)?l.map(e,e=>{if(!d(e)||e.type!==o)return e;let n=t.map(t=>e.props.items?.[t]?.key??String(t));return u(e,{openItems:n})}):e}function m(o){let{marker:l,props:u}=a(`AppSectionFaq`,o),{title:d,as:m=`h2`,eyebrow:h,subtitle:g,align:_=`center`,variant:v=`default`,children:y,openItems:b,className:x=``,...S}=u;return c(`AppSectionFaq`,S),s(`AppSectionFaq`,`as`,m,n),s(`AppSectionFaq`,`align`,_,t),s(`AppSectionFaq`,`variant`,v,r),/* @__PURE__ */ f(e,{component:`AppSectionFaq`,kind:`faq`,title:d,as:i(m,`h2`),eyebrow:h,subtitle:g,align:_,variant:v,className:x,rest:{...l,...S},children:y!=null&&y!==!1&&/* @__PURE__ */ f(`div`,{className:`wui-section-faq-body`,children:p(y,b)})})}export{m as default};
1
+ import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAccordion.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{Children as l,cloneElement as u,isValidElement as d}from"react";import{jsx as f}from"react/jsx-runtime";var p=[...r,`split`];function m(e,t,n){return!Array.isArray(t)&&n==null?e:l.map(e,e=>{if(!d(e)||e.type!==o)return e;let r={};return Array.isArray(t)&&(r.openItems=t.map(t=>e.props.items?.[t]?.key??String(t))),n!=null&&(r.closeLabel=n),u(e,r)})}function h(r){let{marker:o,props:l}=a(`AppSectionFaq`,r),{title:u,as:d=`h2`,eyebrow:h,subtitle:g,align:_,variant:v=`default`,children:y,openItems:b,closeLabel:x,className:S=``,...C}=l;c(`AppSectionFaq`,C),s(`AppSectionFaq`,`as`,d,n),s(`AppSectionFaq`,`align`,_,t),s(`AppSectionFaq`,`variant`,v,p);let w=_??(v===`split`?`start`:`center`),T=[v===`split`?`wui-section-faq--split`:``,S].filter(Boolean).join(` `);return/* @__PURE__ */ f(e,{component:`AppSectionFaq`,kind:`faq`,title:u,as:i(d,`h2`),eyebrow:h,subtitle:g,align:w,variant:v,className:T,rest:{...o,...C},children:y!=null&&y!==!1&&/* @__PURE__ */ f(`div`,{className:`wui-section-faq-body`,children:m(y,b,x)})})}export{h as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./warnInvalidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h}from"@webority/ui-elements/helpers";import{useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";var w=99,T=4,E=5,D=/^[a-z0-9-]+$/,O=[`prefix`,`exact`],k=[`comfortable`,`compact`],A=[`neutral`,`primary`],j=[`side`,`top`],M=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],N=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),P=e=>e>w?`${w}+`:String(e),F=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),I=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:F.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},L=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ S(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ S(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function R(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E,sidebarStart:D,sidebarStartCompact:O,sidebarFooter:N,topbarStart:P,topbarEnd:F,footer:I,launcher:R,children:ne,collapsed:z,onCollapsedChange:re,noSidebar:B=!1,nav:V=`side`,density:U=`comfortable`,itemHeight:W,iconVariant:G,topbarTone:de=`neutral`,navLabel:fe=`Main navigation`,linkComponent:K,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:q=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,U,k),p(`AppShell`,`topbarTone`,de,A),p(`AppShell`,`nav`,V,j),p(`AppShell`,`iconVariant`,G,M);let Ke=W>0?{...We,"--wui-nav-item-height":`${W}px`}:We,[qe,Je]=b(()=>me&&z===void 0&&typeof document<`u`?a(he)??!1:!1),[J,Y]=b(!1),[Ye,Xe]=b(!1),[Ze,Qe]=b(!1),X=y(null),$e=y(null),et=y(null),Z=z??qe,tt=()=>{let e=!Z;z===void 0&&Je(e),me&&s(e,he),re?.(e)},nt=l.some(e=>e.collapsible),[rt,it]=b(()=>nt&&typeof document<`u`?i(q):/* @__PURE__ */ new Set),at=e=>{let t=new Set(rt);t.has(e)?t.delete(e):t.add(e),it(t),o(t,q)},Q=v(()=>te(l,pe),[l,pe]),$=B?null:ie(Q);g(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),g(()=>{h()},[]),g(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),g(()=>{let e=X.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let ot=!!I;g(()=>{let e=et.current,t=$e.current;if(!ot||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[ot]),g(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let st=[`app-shell`,Z?`collapsed`:``,B?`no-sidebar`:``,V===`top`?`wui-shell-top`:``,J?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ C(`div`,{ref:$e,className:st,"data-density":U===`compact`?`compact`:void 0,"data-wui-folded-cookie":nt?q:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ S(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ C(`aside`,{className:`app-sidebar`,children:[(u||_||x||w||T)&&/* @__PURE__ */ C(`div`,{className:ee({logoLight:_,logoDark:x,markLight:w,markDark:T}),children:[L({logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E}),u]}),D&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start`,children:D}),O&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start-compact`,children:O}),/* @__PURE__ */ S(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:X,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ S(se,{item:e,linkComponent:K,onNavigate:()=>Y(!1),iconVariant:G,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ S(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ C(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!rt.has(e.key)||!!H(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ C(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>at(e.key),children:[/* @__PURE__ */ S(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ S(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ C(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),N&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-foot`,children:N}),!B&&/* @__PURE__ */ S(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:tt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ S(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ C(`div`,{className:`app-main`,children:[/* @__PURE__ */ C(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":ye,"aria-expanded":J,children:/* @__PURE__ */ S(d,{name:`menu`,size:18})}),V===`top`&&u&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-brand`,children:u}),V===`top`&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ S(f,{items:ae(Q),ariaLabel:fe,linkComponent:K})}),P,He&&/* @__PURE__ */ S(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ C(`div`,{className:`app-topbar-end`,children:[F,Ve&&/* @__PURE__ */ S(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ S(ce,{config:Be,linkComponent:K,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ S(`main`,{className:`app-content`,id:`main-content`,children:ne}),I&&/* @__PURE__ */ S(`footer`,{className:`app-footer`,ref:et,children:I})]}),R&&/* @__PURE__ */ S(`div`,{className:`wui-shell-launcher`,children:R}),$&&/* @__PURE__ */ C(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ S(oe,{tab:e,linkComponent:K,iconVariant:G},e.key??e.href)),$.hasMore&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ S(d,{name:`more`,size:24})}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ S(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":be,tabIndex:J?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&V(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>z(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!z(e))),a=[],o=e=>{for(let t of e)z(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,O),p(`AppShell`,`iconVariant`,e.iconVariant,M);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!N.has(e)))}var z=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!z(t))return!0;let r=e.findIndex((e,t)=>t>n&&z(e));return e.slice(n+1,r<0?void 0:r).length>0})}var B=/* @__PURE__ */ new Set;function V(t){if(t.key!=null&&D.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!B.has(n)&&(B.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)z(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?T:E;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>z(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(z(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ S(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ S(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function H(e){for(let t of e){if(t.active)return t;let e=t.children?.length?H(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?H(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,_]=b(p);g(()=>{m!=null&&_(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ S(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),w=e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=I(e.newUntil)&&/* @__PURE__ */ S(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ C(x,{children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,e.trailingIcon&&/* @__PURE__ */ S(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ S(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ S(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ S(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ S(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ S(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ S(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>_(e=>!e),children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>_(e=>!e),children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,/* @__PURE__ */ S(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ S(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function U(){let[e,t]=b(!1),n=y(null);return g(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=_(),{open:s,setOpen:c,ref:f}=U(),{name:m,role:h,roles:g=[],photo:v,profileHref:y,profileLabel:b=`My profile`,onLogout:w,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ S(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ S(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ S(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ C(x,{children:[P,E]});return/* @__PURE__ */ C(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ S(l,{name:m,src:v,tone:`auto`}),/* @__PURE__ */ C(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ S(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ S(l,{name:m,src:v,size:`lg`,tone:`auto`}),/* @__PURE__ */ C(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ S(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ S(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||w)&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ S(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),w()},children:E})}):T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):w&&/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),w()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=_(),{open:u,setOpen:f,ref:p}=U(),{unread:m=0,items:h,loading:v=!1,onOpen:w,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=b(``),j=y(m);g(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:P(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ C(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ S(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ S(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ S(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ S(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):v?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ C(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:P(m)}),onClick:()=>{let e=!u;f(e),e&&w?.()},children:[/* @__PURE__ */ S(d,{name:`notification`,size:20}),/* @__PURE__ */ S(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:P(m)})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ S(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ S(`div`,{className:`wui-bell-list`,"aria-busy":v||void 0,children:M}),E&&/* @__PURE__ */ S(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var W=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=_(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,placeholder:h=`Search`}=e,[x,w]=b(!1),[T,E]=b(!1),[D,O]=b({results:null,index:-1}),k=D.results===u?D.index:-1,A=e=>O({results:u,index:e}),j=y(null),M=y(null),N=y([]),P=v(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),F=u!=null&&!T,I=P.length;g(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||W(e.target)||(e.preventDefault(),w(!0),M.current?.focus())},t=e=>{j.current?.contains(e.target)||(E(!0),w(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!F||I===0)return;e.preventDefault(),A((k+(e.key===`ArrowDown`?1:-1)+I)%I)}else e.key===`Enter`?F&&k>=0&&N.current[k]?(e.preventDefault(),N.current[k].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(F?(e.preventDefault(),E(!0)):x&&(e.preventDefault(),w(!1)))},L=-1;return N.current=[],/* @__PURE__ */ C(`div`,{className:`wui-topsearch${x?` is-open`:``}${f?` is-loading`:``}`,ref:j,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":h,"aria-expanded":x,"aria-controls":`${s}-panel`,onClick:()=>{let e=!x;w(e),e&&M.current?.focus()},children:/* @__PURE__ */ S(d,{name:`search`,size:20})}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ C(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ S(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ S(`input`,{ref:M,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:h,"aria-label":h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":F,"aria-controls":`${s}-list`,"aria-activedescendant":F&&k>=0?`${s}-opt-${k}`:void 0,autoComplete:`off`,value:c,onChange:e=>{E(!1),l?.(e.target.value)},onKeyDown:ee})]}),/* @__PURE__ */ S(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!F,children:F&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[I===0&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{L+=1;let t=L;return/* @__PURE__ */ C(`a`,{className:`wui-topsearch-hit${t===k?` is-active`:``}`,role:`option`,"aria-selected":t===k,id:`${s}-opt-${t}`,href:e.href,ref:e=>{N.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:F?I===0?r:t(I===1?o:a,{count:I}):``})]})}export{R as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./warnInvalidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h}from"@webority/ui-elements/helpers";import{useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";var w=99,T=4,E=5,D=/^[a-z0-9-]+$/,O=[`prefix`,`exact`],k=[`comfortable`,`compact`],A=[`neutral`,`primary`],j=[`side`,`top`],M=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],N=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),P=e=>e>w?`${w}+`:String(e),F=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),I=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:F.format(/* @__PURE__ */ new Date)<=e},L=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ S(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ S(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function R(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E,sidebarStart:D,sidebarStartCompact:O,sidebarFooter:N,topbarStart:P,topbarEnd:F,footer:I,launcher:R,children:ne,collapsed:z,onCollapsedChange:re,noSidebar:B=!1,nav:V=`side`,density:U=`comfortable`,itemHeight:W,iconVariant:G,topbarTone:de=`neutral`,navLabel:fe=`Main navigation`,linkComponent:K,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:q=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,U,k),p(`AppShell`,`topbarTone`,de,A),p(`AppShell`,`nav`,V,j),p(`AppShell`,`iconVariant`,G,M);let Ke=W>0?{...We,"--wui-nav-item-height":`${W}px`}:We,[qe,Je]=b(()=>me&&z===void 0&&typeof document<`u`?a(he)??!1:!1),[J,Y]=b(!1),[Ye,Xe]=b(!1),[Ze,Qe]=b(!1),X=y(null),$e=y(null),et=y(null),Z=z??qe,tt=()=>{let e=!Z;z===void 0&&Je(e),me&&s(e,he),re?.(e)},nt=l.some(e=>e.collapsible),[rt,it]=b(()=>nt&&typeof document<`u`?i(q):/* @__PURE__ */ new Set),at=e=>{let t=new Set(rt);t.has(e)?t.delete(e):t.add(e),it(t),o(t,q)},Q=v(()=>te(l,pe),[l,pe]),$=B?null:ie(Q);g(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),g(()=>{h()},[]),g(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),g(()=>{let e=X.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let ot=!!I;g(()=>{let e=et.current,t=$e.current;if(!ot||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[ot]),g(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let st=[`app-shell`,Z?`collapsed`:``,B?`no-sidebar`:``,V===`top`?`wui-shell-top`:``,J?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ C(`div`,{ref:$e,className:st,"data-density":U===`compact`?`compact`:void 0,"data-wui-folded-cookie":nt?q:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ S(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ C(`aside`,{className:`app-sidebar`,children:[(u||_||x||w||T)&&/* @__PURE__ */ C(`div`,{className:L({logoLight:_,logoDark:x,markLight:w,markDark:T}),children:[ee({logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E}),u]}),D&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start`,children:D}),O&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start-compact`,children:O}),/* @__PURE__ */ S(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:X,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ S(se,{item:e,linkComponent:K,onNavigate:()=>Y(!1),iconVariant:G,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ S(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ C(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!rt.has(e.key)||!!H(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ C(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>at(e.key),children:[/* @__PURE__ */ S(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ S(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ C(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),N&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-foot`,children:N}),!B&&/* @__PURE__ */ S(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:tt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ S(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ C(`div`,{className:`app-main`,children:[/* @__PURE__ */ C(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":ye,"aria-expanded":J,children:/* @__PURE__ */ S(d,{name:`menu`,size:18})}),V===`top`&&u&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-brand`,children:u}),V===`top`&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ S(f,{items:ae(Q),ariaLabel:fe,linkComponent:K})}),P,He&&/* @__PURE__ */ S(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ C(`div`,{className:`app-topbar-end`,children:[F,Ve&&/* @__PURE__ */ S(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ S(ce,{config:Be,linkComponent:K,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ S(`main`,{className:`app-content`,id:`main-content`,children:ne}),I&&/* @__PURE__ */ S(`footer`,{className:`app-footer`,ref:et,children:I})]}),R&&/* @__PURE__ */ S(`div`,{className:`wui-shell-launcher`,children:R}),$&&/* @__PURE__ */ C(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ S(oe,{tab:e,linkComponent:K,iconVariant:G},e.key??e.href)),$.hasMore&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ S(d,{name:`more`,size:24})}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ S(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":be,tabIndex:J?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&V(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>z(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!z(e))),a=[],o=e=>{for(let t of e)z(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,O),p(`AppShell`,`iconVariant`,e.iconVariant,M);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!N.has(e)))}var z=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!z(t))return!0;let r=e.findIndex((e,t)=>t>n&&z(e));return e.slice(n+1,r<0?void 0:r).length>0})}var B=/* @__PURE__ */ new Set;function V(t){if(t.key!=null&&D.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!B.has(n)&&(B.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)z(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?T:E;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>z(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(z(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ S(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ S(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function H(e){for(let t of e){if(t.active)return t;let e=t.children?.length?H(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?H(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,_]=b(p);g(()=>{m!=null&&_(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ S(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),w=e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=I(e.newUntil)&&/* @__PURE__ */ S(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ C(x,{children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,e.trailingIcon&&/* @__PURE__ */ S(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ S(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ S(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ S(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ S(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ S(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ S(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>_(e=>!e),children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>_(e=>!e),children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,/* @__PURE__ */ S(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ S(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function U(){let[e,t]=b(!1),n=y(null);return g(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=_(),{open:s,setOpen:c,ref:f}=U(),{name:m,role:h,roles:g=[],photo:v,profileHref:y,profileLabel:b=`My profile`,onLogout:w,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ S(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ S(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ S(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ C(x,{children:[P,E]});return/* @__PURE__ */ C(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ S(l,{name:m,src:v,tone:`auto`}),/* @__PURE__ */ C(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ S(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ S(l,{name:m,src:v,size:`lg`,tone:`auto`}),/* @__PURE__ */ C(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ S(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ S(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||w)&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ S(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),w()},children:E})}):T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):w&&/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),w()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=_(),{open:u,setOpen:f,ref:p}=U(),{unread:m=0,items:h,loading:v=!1,onOpen:w,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=b(``),j=y(m);g(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:P(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ C(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ S(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ S(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ S(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ S(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):v?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ C(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:P(m)}),onClick:()=>{let e=!u;f(e),e&&w?.()},children:[/* @__PURE__ */ S(d,{name:`notification`,size:20}),/* @__PURE__ */ S(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:P(m)})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ S(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ S(`div`,{className:`wui-bell-list`,"aria-busy":v||void 0,children:M}),E&&/* @__PURE__ */ S(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var W=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=_(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,onFocus:h,placeholder:x=`Search`}=e,[w,T]=b(!1),[E,D]=b(!1),[O,k]=b({results:null,index:-1}),A=O.results===u?O.index:-1,j=e=>k({results:u,index:e}),M=y(null),N=y(null),P=y([]),F=v(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),I=u!=null&&!E,L=F.length;g(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||W(e.target)||(e.preventDefault(),T(!0),N.current?.focus())},t=e=>{M.current?.contains(e.target)||(D(!0),T(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!I||L===0)return;e.preventDefault(),j((A+(e.key===`ArrowDown`?1:-1)+L)%L)}else e.key===`Enter`?I&&A>=0&&P.current[A]?(e.preventDefault(),P.current[A].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(I?(e.preventDefault(),D(!0)):w&&(e.preventDefault(),T(!1)))},R=-1;return P.current=[],/* @__PURE__ */ C(`div`,{className:`wui-topsearch${w?` is-open`:``}${f?` is-loading`:``}`,ref:M,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":x,"aria-expanded":w,"aria-controls":`${s}-panel`,onClick:()=>{let e=!w;T(e),e&&N.current?.focus()},children:/* @__PURE__ */ S(d,{name:`search`,size:20})}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ C(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ S(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ S(`input`,{ref:N,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:x,"aria-label":x,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":`${s}-list`,"aria-activedescendant":I&&A>=0?`${s}-opt-${A}`:void 0,autoComplete:`off`,value:c,onChange:e=>{D(!1),l?.(e.target.value)},onKeyDown:ee,onFocus:h})]}),/* @__PURE__ */ S(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!I,children:I&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[L===0&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{R+=1;let t=R;return/* @__PURE__ */ C(`a`,{className:`wui-topsearch-hit${t===A?` is-active`:``}`,role:`option`,"aria-selected":t===A,id:`${s}-opt-${t}`,href:e.href,ref:e=>{P.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:I?L===0?r:t(L===1?o:a,{count:L}):``})]})}export{R as default};