@interopio/home-ui-react 1.4.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/LICENSE +21 -0
  2. package/{README.md → dist/README.md} +56 -56
  3. package/dist/common/sequelizer.d.ts +7 -0
  4. package/dist/common/types.d.ts +27 -0
  5. package/dist/common/utils.d.ts +2 -0
  6. package/dist/constants/alerts.d.ts +8 -0
  7. package/{constants → dist/constants}/defaults.d.ts +0 -1
  8. package/dist/constants/dialogs.d.ts +5 -0
  9. package/{constants → dist/constants}/itemTypes.d.ts +1 -0
  10. package/dist/constants/platformPrefs.d.ts +15 -0
  11. package/dist/constants/regex.d.ts +1 -0
  12. package/dist/constants/sections.d.ts +5 -0
  13. package/{constants → dist/constants}/storageKeys.d.ts +1 -2
  14. package/{decoders → dist/decoders}/base.d.ts +2 -1
  15. package/dist/decoders/config.d.ts +3 -0
  16. package/dist/decoders/layouts.d.ts +3 -0
  17. package/{decoders → dist/decoders}/platform.d.ts +3 -3
  18. package/dist/decoders/user.d.ts +3 -0
  19. package/dist/decoders/validation.d.ts +3 -0
  20. package/{executors → dist/executors}/applicationActions.d.ts +1 -1
  21. package/{executors → dist/executors}/layoutActions.d.ts +1 -1
  22. package/dist/executors/setupStepsActions.d.ts +3 -0
  23. package/dist/executors/types.d.ts +33 -0
  24. package/{executors → dist/executors}/workspaceActions.d.ts +1 -1
  25. package/{helpers → dist/helpers}/a11y.d.ts +0 -16
  26. package/dist/helpers/alerts.d.ts +9 -0
  27. package/{helpers → dist/helpers}/sort.d.ts +4 -4
  28. package/dist/hooks/index.d.ts +28 -0
  29. package/dist/hooks/useApplications.d.ts +2 -0
  30. package/{hooks → dist/hooks}/useExecuteApplicationAction.d.ts +1 -1
  31. package/dist/hooks/useExecuteLayoutAction.d.ts +5 -0
  32. package/{hooks → dist/hooks}/useExecuteWorkspaceAction.d.ts +1 -1
  33. package/dist/hooks/useFavorites.d.ts +8 -0
  34. package/dist/hooks/useFrameId.d.ts +1 -0
  35. package/{hooks → dist/hooks}/useInvokeInteropMethod.d.ts +1 -1
  36. package/dist/hooks/useIsLaunchpadPinned.d.ts +8 -0
  37. package/dist/hooks/useLayouts.d.ts +5 -0
  38. package/{hooks → dist/hooks}/useNotifications.d.ts +1 -1
  39. package/dist/hooks/useNotificationsConfiguration.d.ts +3 -0
  40. package/dist/hooks/useOnIframeFocus.d.ts +6 -0
  41. package/dist/hooks/useOnOutsideClick.d.ts +9 -0
  42. package/{hooks → dist/hooks}/usePlatformWindow.d.ts +1 -1
  43. package/{hooks → dist/hooks}/useRestoreLayout.d.ts +1 -1
  44. package/{hooks → dist/hooks}/useRestoreWorkspace.d.ts +1 -2
  45. package/{hooks → dist/hooks}/useSearch.d.ts +1 -1
  46. package/dist/hooks/useStartApplication.d.ts +7 -0
  47. package/{hooks → dist/hooks}/useStorage.d.ts +2 -2
  48. package/dist/hooks/useWorkspaces.d.ts +2 -0
  49. package/dist/index.css +1 -0
  50. package/dist/index.d.ts +21 -0
  51. package/dist/index.js +61 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/index.mjs +14513 -0
  54. package/dist/index.mjs.map +1 -0
  55. package/{lib → dist/lib}/applications-section/applications-section.d.ts +1 -1
  56. package/dist/lib/applications-section/helpers.d.ts +5 -0
  57. package/dist/lib/applications-section/types.d.ts +9 -0
  58. package/{lib → dist/lib}/base-section/base-section-header.d.ts +2 -4
  59. package/dist/lib/base-section/base-section-item.d.ts +14 -0
  60. package/{lib → dist/lib}/base-section/base-section.d.ts +3 -3
  61. package/{lib → dist/lib}/base-section/helpers.d.ts +1 -1
  62. package/dist/lib/base-section/types.d.ts +20 -0
  63. package/dist/lib/base-section/useCollapsedSections.d.ts +4 -0
  64. package/dist/lib/context-menu/constants.d.ts +11 -0
  65. package/dist/lib/context-menu/context-menu.d.ts +11 -0
  66. package/dist/lib/context-menu/dropdown-button/dropdown-button.d.ts +20 -0
  67. package/{lib → dist/lib}/context-menu/types.d.ts +5 -1
  68. package/dist/lib/default-header-system-buttons/constants.d.ts +2 -0
  69. package/dist/lib/default-header-system-buttons/default-header-system-buttons.d.ts +2 -0
  70. package/dist/lib/default-header-system-buttons/default-header-system-menu.d.ts +2 -0
  71. package/{lib → dist/lib}/favorites-section/favorites-section.d.ts +1 -1
  72. package/dist/lib/favorites-section/helpers.d.ts +3 -0
  73. package/dist/lib/home-app-workspace/after-tabs.d.ts +3 -0
  74. package/dist/lib/home-app-workspace/constants.d.ts +2 -0
  75. package/{lib → dist/lib}/home-app-workspace/group-header-buttons.d.ts +1 -1
  76. package/dist/lib/home-app-workspace/home-app-workspace.d.ts +13 -0
  77. package/dist/lib/home-app-workspace/index.d.ts +1 -0
  78. package/dist/lib/home-app-workspace/launchpad-access.d.ts +7 -0
  79. package/{lib → dist/lib}/home-app-workspace/workspace-components-context.d.ts +3 -4
  80. package/dist/lib/icon-components/index.d.ts +4 -0
  81. package/dist/lib/icon-components/platform-setup/index.d.ts +4 -0
  82. package/{lib → dist/lib}/io-connect-home/auth0-login-home.d.ts +1 -1
  83. package/{lib → dist/lib}/io-connect-home/home-app.d.ts +1 -1
  84. package/{lib → dist/lib}/io-connect-home/io-connect-home.d.ts +1 -1
  85. package/{lib → dist/lib}/io-connect-home/no-login-home.d.ts +1 -1
  86. package/{lib → dist/lib}/io-connect-home/simple-login-home.d.ts +1 -1
  87. package/{lib → dist/lib}/io-connect-home/types.d.ts +54 -18
  88. package/{lib → dist/lib}/io-connect-home/useUser.d.ts +1 -1
  89. package/{lib → dist/lib}/io-connect-home-provider/helpers.d.ts +1 -1
  90. package/{lib → dist/lib}/io-connect-home-provider/io-connect-home-provider.d.ts +1 -1
  91. package/{lib → dist/lib}/io-connect-home-provider/types.d.ts +2 -2
  92. package/{lib/io-connect-browser-start-failed/io-connect-browser-start-failed.d.ts → dist/lib/io-init-error-screen/io-init-error-screen.d.ts} +1 -1
  93. package/dist/lib/launchpad/constants.d.ts +2 -0
  94. package/dist/lib/launchpad/helpers.d.ts +4 -0
  95. package/dist/lib/launchpad/launchpad-header.d.ts +7 -0
  96. package/dist/lib/launchpad/launchpad-pin-button.d.ts +5 -0
  97. package/dist/lib/launchpad/launchpad.context.d.ts +19 -0
  98. package/dist/lib/launchpad/launchpad.d.ts +11 -0
  99. package/dist/lib/launchpad/useIsLaunchpadCollapsed.d.ts +9 -0
  100. package/dist/lib/layouts-panel/active-layout.d.ts +2 -0
  101. package/dist/lib/layouts-panel/all-layouts.d.ts +2 -0
  102. package/dist/lib/layouts-panel/constants.d.ts +8 -0
  103. package/dist/lib/layouts-panel/create-layout-button.d.ts +2 -0
  104. package/dist/lib/layouts-panel/helpers.d.ts +3 -0
  105. package/dist/lib/layouts-panel/layouts-dropdown.d.ts +6 -0
  106. package/dist/lib/layouts-panel/layouts-list.d.ts +6 -0
  107. package/dist/lib/layouts-panel/save-layout-button.d.ts +5 -0
  108. package/dist/lib/layouts-panel/types.d.ts +8 -0
  109. package/dist/lib/layouts-panel/useIsLayoutsPanelOpen.d.ts +9 -0
  110. package/{lib → dist/lib}/login/auth0/auth0-login-page.d.ts +1 -2
  111. package/dist/lib/login/index.d.ts +3 -0
  112. package/dist/lib/login/login-heading.d.ts +1 -0
  113. package/{lib → dist/lib}/login/simple/reducers.d.ts +1 -1
  114. package/{lib → dist/lib}/login/simple/simple-login-form.d.ts +2 -2
  115. package/{lib → dist/lib}/login/simple/simple-login-page.d.ts +1 -1
  116. package/{lib → dist/lib}/login/types.d.ts +1 -5
  117. package/dist/lib/notifications-icon/notifications-badge.d.ts +2 -0
  118. package/{lib/notifications-panel → dist/lib/notifications-icon}/notifications-icon.d.ts +1 -1
  119. package/dist/lib/notifications-panels/notification-settings-panel.d.ts +9 -0
  120. package/dist/lib/notifications-panels/notifications-panel.d.ts +10 -0
  121. package/dist/lib/panels/launchpad/launchpad-button.d.ts +6 -0
  122. package/dist/lib/panels/launchpad/launchpad-panel.d.ts +2 -0
  123. package/dist/lib/panels/panel-with-toggle-button.d.ts +12 -0
  124. package/dist/lib/panels/panel-wrapper.d.ts +11 -0
  125. package/dist/lib/panels/types.d.ts +9 -0
  126. package/{lib → dist/lib}/platform-setup/constants.d.ts +1 -1
  127. package/{lib → dist/lib}/platform-setup/reducers.d.ts +2 -2
  128. package/{lib → dist/lib}/platform-setup/setup-steps-list.d.ts +1 -1
  129. package/{lib → dist/lib}/platform-setup/types.d.ts +4 -4
  130. package/dist/lib/profile-panel/profile-panel.d.ts +9 -0
  131. package/{lib → dist/lib}/search/search-bar/search-bar.d.ts +1 -0
  132. package/dist/lib/search/search-results-section/search-results-section.d.ts +5 -0
  133. package/{lib → dist/lib}/search/search-results-section/types.d.ts +3 -3
  134. package/dist/lib/search/search-results-section/useExecuteLayoutSearchResultAction.d.ts +2 -0
  135. package/dist/lib/search/search-results-section/useGenerateLayoutFromId.d.ts +2 -0
  136. package/dist/lib/search/search-results-section/useGetActionExecutor.d.ts +1 -0
  137. package/dist/lib/search/search-results-section/useSearchResultsSectionConfigs.d.ts +3 -0
  138. package/{lib → dist/lib}/section/helpers.d.ts +2 -2
  139. package/{lib → dist/lib}/section/section.d.ts +1 -1
  140. package/{lib → dist/lib}/section/types.d.ts +1 -1
  141. package/dist/lib/spinner/index.d.ts +1 -0
  142. package/dist/lib/system-menu/helpers.d.ts +3 -0
  143. package/dist/lib/system-menu/system-menu.d.ts +6 -0
  144. package/dist/lib/system-menu/types.d.ts +9 -0
  145. package/dist/lib/workspaces-section/constants.d.ts +3 -0
  146. package/{lib → dist/lib}/workspaces-section/helpers.d.ts +3 -3
  147. package/{lib → dist/lib}/workspaces-section/workspaces-section.d.ts +1 -1
  148. package/package.json +59 -41
  149. package/assets/fonts/nunito-regular-webfont.woff +0 -0
  150. package/assets/fonts/nunito-regular-webfont.woff2 +0 -0
  151. package/assets/fonts/nunito-semibold-webfont.woff +0 -0
  152. package/assets/fonts/nunito-semibold-webfont.woff2 +0 -0
  153. package/assets/io-connect-browser-logo.json +0 -5
  154. package/common/types.d.ts +0 -10
  155. package/decoders/config.d.ts +0 -3
  156. package/decoders/context-menu.d.ts +0 -3
  157. package/decoders/favorites.d.ts +0 -3
  158. package/decoders/layouts.d.ts +0 -3
  159. package/decoders/user.d.ts +0 -3
  160. package/decoders/validation.d.ts +0 -3
  161. package/executors/notificationsSort.d.ts +0 -7
  162. package/executors/setupStepsActions.d.ts +0 -3
  163. package/executors/types.d.ts +0 -26
  164. package/helpers/date.d.ts +0 -1
  165. package/helpers/string.d.ts +0 -1
  166. package/hooks/index.d.ts +0 -25
  167. package/hooks/useApplications.d.ts +0 -2
  168. package/hooks/useExecuteLayoutAction.d.ts +0 -2
  169. package/hooks/useFavoriteEntities.d.ts +0 -7
  170. package/hooks/useFrame.d.ts +0 -2
  171. package/hooks/useIsBrowserSupported.d.ts +0 -1
  172. package/hooks/useLayouts.d.ts +0 -2
  173. package/hooks/useNotificationsSort.d.ts +0 -5
  174. package/hooks/useStartApplication.d.ts +0 -4
  175. package/hooks/useWorkspaces.d.ts +0 -2
  176. package/index.css +0 -1
  177. package/index.d.ts +0 -37
  178. package/index.js +0 -54
  179. package/index.js.map +0 -1
  180. package/index.mjs +0 -8651
  181. package/index.mjs.map +0 -1
  182. package/lib/applications-section/helpers.d.ts +0 -6
  183. package/lib/applications-section/types.d.ts +0 -4
  184. package/lib/base-section/base-section-item.d.ts +0 -13
  185. package/lib/base-section/types.d.ts +0 -29
  186. package/lib/browser-not-supported/additional-information.d.ts +0 -5
  187. package/lib/browser-not-supported/browser-not-supported.d.ts +0 -11
  188. package/lib/browser-not-supported/constants.d.ts +0 -6
  189. package/lib/button/button.d.ts +0 -7
  190. package/lib/button-group/button-group.d.ts +0 -8
  191. package/lib/context-menu/constants.d.ts +0 -3
  192. package/lib/context-menu/context-menu.d.ts +0 -10
  193. package/lib/context-menu/dropdown-button/dropdown-button.d.ts +0 -11
  194. package/lib/dialog/dialog.d.ts +0 -8
  195. package/lib/favorites-section/helpers.d.ts +0 -3
  196. package/lib/home-app-workspace/after-tabs.d.ts +0 -3
  197. package/lib/home-app-workspace/home-app-workspace.d.ts +0 -14
  198. package/lib/home-app-workspace/index.d.ts +0 -2
  199. package/lib/home-app-workspace/launchpad-access.d.ts +0 -6
  200. package/lib/home-app-workspace/workspace-logo.d.ts +0 -10
  201. package/lib/icon/icon.d.ts +0 -9
  202. package/lib/icon-components/google-chrome-icon.d.ts +0 -2
  203. package/lib/icon-components/index.d.ts +0 -7
  204. package/lib/icon-components/microsoft-edge-icon.d.ts +0 -2
  205. package/lib/icon-components/opera-icon.d.ts +0 -2
  206. package/lib/icon-components/platform-setup/index.d.ts +0 -4
  207. package/lib/img-icon/img-icon.d.ts +0 -8
  208. package/lib/launchpad/default-sections.d.ts +0 -2
  209. package/lib/launchpad/helpers.d.ts +0 -3
  210. package/lib/launchpad/launchpad.context.d.ts +0 -19
  211. package/lib/launchpad/launchpad.d.ts +0 -12
  212. package/lib/launchpad/types.d.ts +0 -16
  213. package/lib/layouts-panel/available-layouts.d.ts +0 -6
  214. package/lib/layouts-panel/constants.d.ts +0 -6
  215. package/lib/layouts-panel/helpers.d.ts +0 -4
  216. package/lib/layouts-panel/layout-actions.d.ts +0 -9
  217. package/lib/layouts-panel/layouts-notification.d.ts +0 -6
  218. package/lib/layouts-panel/types.d.ts +0 -20
  219. package/lib/login/index.d.ts +0 -4
  220. package/lib/login/login-heading.d.ts +0 -5
  221. package/lib/login/login-loader.d.ts +0 -5
  222. package/lib/logo/logo.d.ts +0 -2
  223. package/lib/notifications-panel/constants.d.ts +0 -9
  224. package/lib/notifications-panel/index.d.ts +0 -4
  225. package/lib/notifications-panel/notification.d.ts +0 -6
  226. package/lib/notifications-panel/notifications-badge.d.ts +0 -5
  227. package/lib/notifications-panel/notifications-panel.d.ts +0 -2
  228. package/lib/notifications-panel/types.d.ts +0 -7
  229. package/lib/panels/launchpad-slide-panel.d.ts +0 -10
  230. package/lib/panels/slide-panel.d.ts +0 -9
  231. package/lib/search/search-results-section/helpers.d.ts +0 -3
  232. package/lib/search/search-results-section/search-results-section.d.ts +0 -5
  233. package/lib/spinner/index.d.ts +0 -1
  234. package/lib/user-panel/settings-card.d.ts +0 -2
  235. package/lib/user-panel/support-card.d.ts +0 -11
  236. package/lib/user-panel/user-details-card.d.ts +0 -6
  237. package/lib/user-panel/user-panel-icon.d.ts +0 -6
  238. package/lib/user-panel/user-panel.d.ts +0 -7
  239. /package/{constants → dist/constants}/auth0LoginTypes.d.ts +0 -0
  240. /package/{constants → dist/constants}/modifierKeys.d.ts +0 -0
  241. /package/{constants → dist/constants}/sortOrder.d.ts +0 -0
  242. /package/{hooks → dist/hooks}/useApplicationsInstances.d.ts +0 -0
  243. /package/{hooks → dist/hooks}/useBeforeunload.d.ts +0 -0
  244. /package/{hooks → dist/hooks}/useExecuteLayoutOperationIfNotBlocked.d.ts +0 -0
  245. /package/{hooks → dist/hooks}/useIsHomeLoaded.d.ts +0 -0
  246. /package/{hooks → dist/hooks}/useIsRunningInDesktopContainer.d.ts +0 -0
  247. /package/{hooks → dist/hooks}/usePressedKeys.d.ts +0 -0
  248. /package/{hooks → dist/hooks}/useUA.d.ts +0 -0
  249. /package/{hooks → dist/hooks}/useWorkspacesInstances.d.ts +0 -0
  250. /package/{lib → dist/lib}/home-app-workspace/no-logo.d.ts +0 -0
  251. /package/{lib → dist/lib}/home-app-workspace/types.d.ts +0 -0
  252. /package/{lib → dist/lib}/home-app-workspace/useAddWindowButtonVisible.d.ts +0 -0
  253. /package/{lib → dist/lib}/icon-components/platform-setup/browser-notifications-icon.d.ts +0 -0
  254. /package/{lib → dist/lib}/icon-components/platform-setup/popups-icon.d.ts +0 -0
  255. /package/{lib → dist/lib}/icon-components/platform-setup/pwa-install-icon.d.ts +0 -0
  256. /package/{lib → dist/lib}/icon-components/platform-setup/window-management-icon.d.ts +0 -0
  257. /package/{lib → dist/lib}/icon-components/reopen-prompt-icon.d.ts +0 -0
  258. /package/{lib → dist/lib}/icon-components/start-failed-icon.d.ts +0 -0
  259. /package/{lib → dist/lib}/icon-components/warning-icon.d.ts +0 -0
  260. /package/{lib → dist/lib}/info-card/info-card.d.ts +0 -0
  261. /package/{lib → dist/lib}/info-page-container/info-page-container.d.ts +0 -0
  262. /package/{lib → dist/lib}/io-connect-home-provider/constants.d.ts +0 -0
  263. /package/{lib → dist/lib}/layouts-panel/layouts-panel.d.ts +0 -0
  264. /package/{lib → dist/lib}/login/constants.d.ts +0 -0
  265. /package/{lib → dist/lib}/login/login-logo.d.ts +0 -0
  266. /package/{lib → dist/lib}/login/login-page-container.d.ts +0 -0
  267. /package/{lib → dist/lib}/platform-setup/platform-setup.d.ts +0 -0
  268. /package/{lib → dist/lib}/platform-setup/setup-steps.d.ts +0 -0
  269. /package/{lib → dist/lib}/platform-setup/use-edge-notifications-permission.d.ts +0 -0
  270. /package/{lib → dist/lib}/section/section.context.d.ts +0 -0
  271. /package/{lib → dist/lib}/spinner/spinner.d.ts +0 -0
  272. /package/{lib → dist/lib}/system-loader/system-loader.d.ts +0 -0
  273. /package/{lib → dist/lib}/workspaces-section/types.d.ts +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,61 @@
1
+ "use strict";var mh=Object.defineProperty;var gh=(t,n,e)=>n in t?mh(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var At=(t,n,e)=>(gh(t,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),Un=require("react-dom"),_e=require("@interopio/react-hooks"),Co=require("@interopio/workspaces-ui-react");function Bl(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const _=Bl(v),Hl=Bl(Un);function zl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wi,Wl={exports:{}};/*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */Wi=Wl,function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)t.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Wi.exports?(n.default=n,Wi.exports=n):window.classNames=n}();var K=zl(Wl.exports);function Xe({className:t,size:n="16",variant:e="workspace",...o}){const r=K("icon",n&&[`icon-size-${n}`],t);return s.jsx("span",{className:r,...o,children:s.jsx("i",{className:`icon-${e}`})})}const Ue=v.forwardRef(({className:t,variant:n="default",icon:e="workspace",size:o="16",iconSize:r="16",onClick:i,disabled:a,children:c,...l},u)=>{const p=K("io-btn-icon",n!=="default"&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),f=v.useCallback(d=>{if(!a)return i?i(d):void 0;d.preventDefault()},[i,a]);return s.jsx("button",{className:p,type:"button",ref:u,"aria-label":"button",onClick:f,disabled:a,...l,children:c??(e&&s.jsx(Xe,{variant:e,size:r}))})});Ue.displayName="ButtonIcon";const vh={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function yh({className:t,variant:n="default",size:e="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...c}){const l=K("io-alert",`io-alert-${n}`,e==="large"&&"io-alert-lg",t),u=vh[n];return s.jsxs("div",{"data-testid":"io-alert",className:l,...c,children:[u&&s.jsx(Xe,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&s.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),e==="large"&&a,r&&s.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function $l({className:t,variant:n="default",children:e,...o}){const r=K("io-badge",n!=="default"&&[`io-badge-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function nn({className:t,tag:n="h2",size:e="normal",text:o="Title",...r}){const i=n,a=K(e==="small"&&"io-title-semibold",e==="normal"&&"io-title",e==="large"&&"io-title-large",t);return s.jsx(i,{className:a,...r,children:o})}function Ye({className:t,title:n,titleSize:e="normal",tag:o,hint:r,children:i,...a}){const c=K("io-block",t);return s.jsxs("div",{className:c,...a,children:[n&&s.jsx(nn,{tag:o,text:n,size:e}),i,r&&s.jsx("p",{className:"io-text-smaller",children:r})]})}const Ge=v.forwardRef(({className:t,variant:n="default",size:e="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:c,disabled:l,children:u,...p},f)=>{const d=K("io-btn",(n==="primary"||n==="critical"||n==="outline"||n==="link")&&[`io-btn-${n}`],e==="large"&&"io-btn-lg",t),h=v.useCallback(m=>{if(!l)return c?c(m):void 0;m.preventDefault()},[c,l]);return s.jsxs("button",{className:d,ref:f,type:"button","aria-label":"button",onClick:h,disabled:l,tabIndex:0,...p,children:[o&&!i&&s.jsx(Xe,{variant:o,size:r}),u??a,o&&i&&s.jsx(Xe,{variant:o,size:r})]})});Ge.displayName="Button";const hi=v.createContext({}),Ul=v.forwardRef(({size:t="32",...n},e)=>{const{handleOpen:o,disabled:r}=v.useContext(hi),i=v.useCallback(()=>{o&&o()},[o]);return s.jsx(Ue,{ref:e,size:t,onClick:i,disabled:r,...n})});function Vl({className:t,...n}){const{handleOpen:e}=v.useContext(hi),o=K("io-dropdown-content",t),r=v.useCallback(i=>{i.stopPropagation(),e&&e()},[e]);return s.jsx("div",{className:o,role:"button",onClick:r,...n})}Ul.displayName="DropdownButtonIcon";const Gl=v.createContext({}),Kr=v.forwardRef((t,n)=>{const{className:e,prepend:o,append:r,isSelected:i,onClick:a,description:c,disabled:l=!1,children:u,tooltip:p,...f}=t,{variant:d="default",selected:h,checkIcon:m,handleItemClick:g}=v.useContext(Gl),y=i??(h==null?void 0:h.some(C=>C.children===u)),w=d!=="default"&&!!m,E=w||o,k=K("io-list-item",E&&"io-list-item-left",r&&"io-list-item-right",d!=="default"&&y&&"selected",c&&"io-list-item-description",l&&"io-list-item-disabled",e);return s.jsxs("li",{className:k,ref:n,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:C=>{l?C.preventDefault():(g==null||g(C,{children:u}),a==null||a(C))},...f,children:[E&&s.jsxs("div",{className:"io-list-left-column",children:[w&&s.jsx(Xe,{variant:m.variant,title:y?m.tooltip:void 0}),o]}),s.jsx("span",{className:"io-list-text",title:p,children:u}),r&&s.jsx("div",{className:"io-list-right-column",children:r}),c&&s.jsx("div",{className:"io-list-text-description",children:c})]})});Kr.displayName="ListItem";const Ca=v.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-title",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});Ca.displayName="ListItemTitle";const ka=v.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-section",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});ka.displayName="ListItemSection";const Yl=v.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item-header",t);return s.jsxs("div",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});Yl.displayName="ListItemHeader";const Zl=v.forwardRef(({className:t,children:n,...e},o)=>{const r=K("io-list-item","io-list-with-sub-items",t);return s.jsx("li",{className:r,ref:o,...e,children:n})});Zl.displayName="ListItemWithSubItems";const Kl=v.forwardRef((t,n)=>{const{className:e,variant:o="default",checkIcon:r,children:i,...a}=t,[c,l]=v.useState([]),u=K("io-list",o!=="default"&&"io-list-selectable",e),p=v.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=v.useCallback((h,m)=>{if(o==="default")return;const g=c.some(y=>{var w,E;return((w=y.children)==null?void 0:w.toString())===((E=m.children)==null?void 0:E.toString())});o==="single"?l([m]):(()=>{const y=g?c.filter(w=>w.children!==m.children):[...c,m];l(y)})()},[c,o]),d=v.useMemo(()=>({variant:o,selected:c,checkIcon:p,handleItemClick:f}),[o,c,p,f]);return s.jsx(Gl.Provider,{value:d,children:s.jsx("ul",{className:u,ref:n,...a,children:i})})});Kl.displayName="List";const ut=Kl;function bh(t,n){v.useEffect(()=>{const e=o=>{t.current&&!t.current.contains(o.target)&&n()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,n])}function ae({className:t,variant:n="outline",align:e="down",disabled:o,children:r,...i}){const[a,c]=v.useState(!1),l=v.useRef(null),u=K("io-dropdown",a&&"io-dropdown-open",n!=="default"&&[`io-dropdown-${n}`],t),p=v.useCallback(()=>{c(!a)},[a]);bh(l,v.useCallback(()=>{c(!1)},[]));const f=v.useMemo(()=>({isOpen:a,handleOpen:p,variant:n,align:e,disabled:o}),[a,p,n,e,o]);return s.jsx(hi.Provider,{value:f,children:s.jsx("div",{className:u,ref:l,...i,children:r})})}function Re({className:t,variant:n="default",align:e="left",children:o,...r}){const i=K("io-btn-group",n==="sticky"&&"io-btn-group-sticky",n==="append"&&"io-btn-group-append",n==="fullwidth"&&"io-btn-group-fullwidth",e==="right"&&"io-btn-group-right",t);return s.jsx("div",{className:i,...r,children:o})}function Ft({className:t,draggable:n=!1,children:e,...o}){const r=K("io-header",n&&["draggable"],t);return s.jsx("header",{className:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--spacing-8)"},...o,children:e})}function Lo({className:t,children:n,...e}){const o=K("io-dialog-header",t);return s.jsx(Ft,{"data-testid":"io-dialog-header",className:o,...e,children:n})}function wh({className:t,children:n,...e}){const o=K("io-dialog-body",t);return s.jsx("div",{"data-testid":"io-dialog-body",className:o,...e,children:n})}function Vn({className:t,children:n,...e}){const o=K("io-footer",t);return s.jsx("footer",{className:o,...e,children:n})}function kr({className:t,...n}){const e=K("io-dialog-footer",t);return s.jsx(Vn,{"data-testid":"io-dialog-footer",className:e,...n})}function mi(){return typeof window<"u"}function Nn(t){return ql(t)?(t.nodeName||"").toLowerCase():"#document"}function Bt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function pn(t){var n;return(n=(ql(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function ql(t){return!!mi()&&(t instanceof Node||t instanceof Bt(t).Node)}function Ze(t){return!!mi()&&(t instanceof Element||t instanceof Bt(t).Element)}function dt(t){return!!mi()&&(t instanceof HTMLElement||t instanceof Bt(t).HTMLElement)}function Ea(t){return!(!mi()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof Bt(t).ShadowRoot)}function rr(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=Vt(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&!["inline","contents"].includes(r)}function xh(t){return["table","td","th"].includes(Nn(t))}function Ch(t){return[":popover-open",":modal"].some(n=>{try{return t.matches(n)}catch{return!1}})}function Sa(t){const n=gi(),e=Ze(t)?Vt(t):t;return e.transform!=="none"||e.perspective!=="none"||!!e.containerType&&e.containerType!=="normal"||!n&&!!e.backdropFilter&&e.backdropFilter!=="none"||!n&&!!e.filter&&e.filter!=="none"||["transform","perspective","filter"].some(o=>(e.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(e.contain||"").includes(o))}function gi(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Sn(t){return["html","body","#document"].includes(Nn(t))}function Vt(t){return Bt(t).getComputedStyle(t)}function vi(t){return Ze(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function fn(t){if(Nn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ea(t)&&t.host||pn(t);return Ea(n)?n.host:n}function Jl(t){const n=fn(t);return Sn(n)?t.ownerDocument?t.ownerDocument.body:t.body:dt(n)&&rr(n)?n:Jl(n)}function jn(t,n,e){var o;n===void 0&&(n=[]),e===void 0&&(e=!0);const r=Jl(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),a=Bt(r);if(i){const c=function(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}(a);return n.concat(a,a.visualViewport||[],rr(r)?r:[],c&&e?jn(c):[])}return n.concat(r,jn(r,[],e))}function dn(t){let n=t.activeElement;for(;((e=n)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)!=null;){var e;n=n.shadowRoot.activeElement}return n}function vt(t,n){if(!t||!n)return!1;const e=n.getRootNode==null?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&Ea(e)){let o=n;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function Xl(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function Ql(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(n=>{let{brand:e,version:o}=n;return e+"/"+o}).join(" "):navigator.userAgent}function eu(t){return!(t.mozInputSource!==0||!t.isTrusted)||(ja()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType)}function tu(t){return!Ql().includes("jsdom/")&&(!ja()&&t.width===0&&t.height===0||ja()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch")}function nu(){return/apple/i.test(navigator.vendor)}function ja(){const t=/android/i;return t.test(Xl())||t.test(Ql())}function Zo(t,n){const e=["mouse","pen"];return n||e.push("",void 0),e.includes(t)}function kt(t){return(t==null?void 0:t.ownerDocument)||document}function $i(t,n){if(n==null)return!1;if("composedPath"in t)return t.composedPath().includes(n);const e=t;return e.target!=null&&n.contains(e.target)}function bn(t){return"composedPath"in t?t.composedPath()[0]:t.target}ut.Item=Kr,ut.ItemTitle=Ca,ut.ItemSection=ka,ut.ItemHeader=Yl,ut.ItemWithSubItems=Zl,ae.Button=function({icon:t="chevron-down",...n}){const{handleOpen:e,disabled:o}=v.useContext(hi),r=v.useCallback(i=>{i.stopPropagation(),e&&e()},[e]);return s.jsx(Ge,{icon:t,iconRight:!0,onClick:r,disabled:o,...n})},ae.ButtonIcon=Ul,ae.Content=Vl,ae.List=ut,ae.Item=Kr,ae.ItemTitle=Ca,ae.ItemSection=ka,Re.Button=Ge,Re.ButtonIcon=Ue,Re.Dropdown=ae,Ft.Title=nn,Ft.ButtonGroup=Re,Ft.Button=Ge,Ft.ButtonIcon=Ue,Ft.Dropdown=ae,Lo.Title=nn,Lo.ButtonGroup=Re,Lo.Button=Ge,Lo.ButtonIcon=Ue,Lo.Dropdown=ae,wh.Content=function({className:t,children:n,...e}){const o=K("io-dialog-content",t);return s.jsx("div",{className:o,...e,children:n})},Vn.ButtonGroup=Re,Vn.Button=Ge,Vn.ButtonIcon=Ue,Vn.Dropdown=ae,kr.ButtonGroup=Re,kr.Button=Ge,kr.ButtonIcon=Ue,kr.Dropdown=ae;const kh="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ou(t){return dt(t)&&t.matches(kh)}function It(t){t.preventDefault(),t.stopPropagation()}function Oa(t){return!!t&&t.getAttribute("role")==="combobox"&&ou(t)}const qr=Math.min,Zn=Math.max,Jr=Math.round,go=Math.floor,In=t=>({x:t,y:t}),Eh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function sc(t,n,e){return Zn(t,qr(n,e))}function yi(t,n){return typeof t=="function"?t(n):t}function Kn(t){return t.split("-")[0]}function Xr(t){return t.split("-")[1]}function ru(t){return t==="x"?"y":"x"}function iu(t){return t==="y"?"height":"width"}function bi(t){return["top","bottom"].includes(Kn(t))?"y":"x"}function au(t){return ru(bi(t))}function Ui(t){return t.replace(/start|end/g,n=>Sh[n])}function Er(t){return t.replace(/left|right|bottom|top/g,n=>Eh[n])}function Qr(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}/*!
6
+ * tabbable 6.2.0
7
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
8
+ */var ei=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),su=typeof Element>"u",ko=su?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hr=!su&&Element.prototype.getRootNode?function(t){var n;return t==null||(n=t.getRootNode)===null||n===void 0?void 0:n.call(t)}:function(t){return t==null?void 0:t.ownerDocument},ti=function t(n,e){var o;e===void 0&&(e=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert");return r===""||r==="true"||e&&n&&t(n.parentNode)},jh=function t(n,e,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!ti(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=t(c.length?c:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{ko.call(a,ei)&&o.filter(a)&&(e||!n.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),p=!ti(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&p){var f=t(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,f):r.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return r},cu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},lu=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(n){var e,o=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return o===""||o==="true"}(t))&&!cu(t)?0:t.tabIndex},Oh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},uu=function(t){return t.tagName==="INPUT"},Nh=function(t){return function(n){return uu(n)&&n.type==="radio"}(t)&&!function(n){if(!n.name)return!0;var e,o=n.form||Hr(n),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")e=r(window.CSS.escape(n.name));else try{e=r(n.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,c){for(var l=0;l<a.length;l++)if(a[l].checked&&a[l].form===c)return a[l]}(e,n.form);return!i||i===n}(t)},cc=function(t){var n=t.getBoundingClientRect(),e=n.width,o=n.height;return e===0&&o===0},Ih=function(t,n){var e=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=ko.call(t,"details>summary:first-of-type")?t.parentElement:t;if(ko.call(r,"details:not([open]) *"))return!0;if(e&&e!=="full"&&e!=="legacy-full"){if(e==="non-zero-area")return cc(t)}else{if(typeof o=="function"){for(var i=t;t;){var a=t.parentElement,c=Hr(t);if(a&&!a.shadowRoot&&o(a)===!0)return cc(t);t=t.assignedSlot?t.assignedSlot:a||c===t.ownerDocument?a:c.host}t=i}if(function(l){var u,p,f,d,h=l&&Hr(l),m=(u=h)===null||u===void 0?void 0:u.host,g=!1;if(h&&h!==l)for(g=!!((p=m)!==null&&p!==void 0&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(m)||l!=null&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(l));!g&&m;){var y,w,E;g=!((w=m=(y=h=Hr(m))===null||y===void 0?void 0:y.host)===null||w===void 0||(E=w.ownerDocument)===null||E===void 0||!E.contains(m))}return g}(t))return!t.getClientRects().length;if(e!=="legacy-full")return!0}return!1},Ah=function(t,n){return!(n.disabled||ti(n)||function(e){return uu(e)&&e.type==="hidden"}(n)||Ih(n,t)||function(e){return e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"})}(n)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var o=e.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!ko.call(o,"fieldset[disabled] *")||!i.contains(e)}return!0}o=o.parentElement}return!1}(n))},Na=function(t,n){return!(Nh(n)||lu(n)<0||!Ah(t,n))},Ph=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Th=function t(n){var e=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,c=a?r.scopeParent:r,l=function(p,f){var d=lu(p);return d<0&&f&&!cu(p)?0:d}(c,a),u=a?t(r.candidates):c;l===0?a?e.push.apply(e,u):e.push(c):o.push({documentOrder:i,tabIndex:l,item:r,isScope:a,content:u})}),o.sort(Oh).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},ds=function(t,n){var e;return e=(n=n||{}).getShadowRoot?jh([t],n.includeContainer,{filter:Na.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ph}):function(o,r,i){if(ti(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(ei));return r&&ko.call(o,ei)&&a.unshift(o),a.filter(i)}(t,n.includeContainer,Na.bind(null,n)),Th(e)},_h=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ko.call(t,ei)!==!1&&Na(n,t)};function lc(t,n,e){let{reference:o,floating:r}=t;const i=bi(n),a=au(n),c=iu(a),l=Kn(n),u=i==="y",p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:p,y:o.y-r.height};break;case"bottom":h={x:p,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(Xr(n)){case"start":h[a]-=d*(e&&u?-1:1);break;case"end":h[a]+=d*(e&&u?-1:1)}return h}async function du(t,n){var e;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=yi(n,t),m=function(j){return typeof j!="number"?function(S){return{top:0,right:0,bottom:0,left:0,...S}}(j):{top:j,right:j,bottom:j,left:j}}(h),g=c[d?f==="floating"?"reference":"floating":f],y=Qr(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(g)))==null||e?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:p,strategy:l})),w=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),k=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},C=Qr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:l}):w);return{top:(y.top-C.top+m.top)/k.y,bottom:(C.bottom-y.bottom+m.bottom)/k.y,left:(y.left-C.left+m.left)/k.x,right:(C.right-y.right+m.right)/k.x}}function fu(t){const n=Vt(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=dt(t),i=r?t.offsetWidth:e,a=r?t.offsetHeight:o,c=Jr(e)!==i||Jr(o)!==a;return c&&(e=i,o=a),{width:e,height:o,$:c}}function fs(t){return Ze(t)?t:t.contextElement}function yo(t){const n=fs(t);if(!dt(n))return In(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:i}=fu(n);let a=(i?Jr(e.width):e.width)/o,c=(i?Jr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const Dh=In(0);function pu(t){const n=Bt(t);return gi()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Dh}function Xn(t,n,e,o){n===void 0&&(n=!1),e===void 0&&(e=!1);const r=t.getBoundingClientRect(),i=fs(t);let a=In(1);n&&(o?Ze(o)&&(a=yo(o)):a=yo(t));const c=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Bt(d))&&h}(i,e,o)?pu(i):In(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(i){const d=Bt(i),h=o&&Ze(o)?Bt(o):o;let m=d,g=m.frameElement;for(;g&&o&&h!==m;){const y=yo(g),w=g.getBoundingClientRect(),E=Vt(g),k=w.left+(g.clientLeft+parseFloat(E.paddingLeft))*y.x,C=w.top+(g.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,p*=y.x,f*=y.y,l+=k,u+=C,m=Bt(g),g=m.frameElement}}return Qr({width:p,height:f,x:l,y:u})}const Mh=[":popover-open",":modal"];function Ia(t){return Mh.some(n=>{try{return t.matches(n)}catch{return!1}})}function hu(t){return Xn(pn(t)).left+vi(t).scrollLeft}function uc(t,n,e){let o;if(n==="viewport")o=function(r,i){const a=Bt(r),c=pn(r),l=a.visualViewport;let u=c.clientWidth,p=c.clientHeight,f=0,d=0;if(l){u=l.width,p=l.height;const h=gi();(!h||h&&i==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:p,x:f,y:d}}(t,e);else if(n==="document")o=function(r){const i=pn(r),a=vi(r),c=r.ownerDocument.body,l=Zn(i.scrollWidth,i.clientWidth,c.scrollWidth,c.clientWidth),u=Zn(i.scrollHeight,i.clientHeight,c.scrollHeight,c.clientHeight);let p=-a.scrollLeft+hu(r);const f=-a.scrollTop;return Vt(c).direction==="rtl"&&(p+=Zn(i.clientWidth,c.clientWidth)-l),{width:l,height:u,x:p,y:f}}(pn(t));else if(Ze(n))o=function(r,i){const a=Xn(r,!0,i==="fixed"),c=a.top+r.clientTop,l=a.left+r.clientLeft,u=dt(r)?yo(r):In(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:l*u.x,y:c*u.y}}(n,e);else{const r=pu(t);o={...n,x:n.x-r.x,y:n.y-r.y}}return Qr(o)}function mu(t,n){const e=fn(t);return!(e===n||!Ze(e)||Sn(e))&&(Vt(e).position==="fixed"||mu(e,n))}function Lh(t,n,e){const o=dt(n),r=pn(n),i=e==="fixed",a=Xn(t,!0,i,n);let c={scrollLeft:0,scrollTop:0};const l=In(0);if(o||!o&&!i)if((Nn(n)!=="body"||rr(r))&&(c=vi(n)),o){const u=Xn(n,!0,i,n);l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}else r&&(l.x=hu(r));return{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function Vi(t){return Vt(t).position==="static"}function dc(t,n){return dt(t)&&Vt(t).position!=="fixed"?n?n(t):t.offsetParent:null}function fc(t,n){const e=Bt(t);if(Ia(t))return e;if(!dt(t)){let r=fn(t);for(;r&&!Sn(r);){if(Ze(r)&&!Vi(r))return r;r=fn(r)}return e}let o=dc(t,n);for(;o&&xh(o)&&Vi(o);)o=dc(o,n);return o&&Sn(o)&&Vi(o)&&!Sa(o)?e:o||function(r){let i=fn(r);for(;dt(i)&&!Sn(i);){if(Sa(i))return i;if(Ch(i))return null;i=fn(i)}return null}(t)||e}const Rh={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i=r==="fixed",a=pn(o),c=!!n&&Ia(n.floating);if(o===a||c&&i)return e;let l={scrollLeft:0,scrollTop:0},u=In(1);const p=In(0),f=dt(o);if((f||!f&&!i)&&((Nn(o)!=="body"||rr(a))&&(l=vi(o)),dt(o))){const d=Xn(o);u=yo(o),p.x=d.x+o.clientLeft,p.y=d.y+o.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+p.x,y:e.y*u.y-l.scrollTop*u.y+p.y}},getDocumentElement:pn,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[...e==="clippingAncestors"?Ia(n)?[]:function(l,u){const p=u.get(l);if(p)return p;let f=jn(l,[],!1).filter(g=>Ze(g)&&Nn(g)!=="body"),d=null;const h=Vt(l).position==="fixed";let m=h?fn(l):l;for(;Ze(m)&&!Sn(m);){const g=Vt(m),y=Sa(m);y||g.position!=="fixed"||(d=null),(h?!y&&!d:!y&&g.position==="static"&&d&&["absolute","fixed"].includes(d.position)||rr(m)&&!y&&mu(l,m))?f=f.filter(w=>w!==m):d=g,m=fn(m)}return u.set(l,f),f}(n,this._c):[].concat(e),o],a=i[0],c=i.reduce((l,u)=>{const p=uc(n,u,r);return l.top=Zn(p.top,l.top),l.right=qr(p.right,l.right),l.bottom=qr(p.bottom,l.bottom),l.left=Zn(p.left,l.left),l},uc(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:fc,getElementRects:async function(t){const n=this.getOffsetParent||fc,e=this.getDimensions,o=await e(t.floating);return{reference:Lh(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=fu(t);return{width:n,height:e}},getScale:yo,isElement:Ze,isRTL:function(t){return Vt(t).direction==="rtl"}};function Fh(t,n,e,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=fs(t),p=r||i?[...u?jn(u):[],...jn(n)]:[];p.forEach(y=>{r&&y.addEventListener("scroll",e,{passive:!0}),i&&y.addEventListener("resize",e)});const f=u&&c?function(y,w){let E,k=null;const C=pn(y);function j(){var S;clearTimeout(E),(S=k)==null||S.disconnect(),k=null}return function S(D,$){D===void 0&&(D=!1),$===void 0&&($=1),j();const{left:W,top:J,width:B,height:A}=y.getBoundingClientRect();if(D||w(),!B||!A)return;const fe={rootMargin:-go(J)+"px "+-go(C.clientWidth-(W+B))+"px "+-go(C.clientHeight-(J+A))+"px "+-go(W)+"px",threshold:Zn(0,qr(1,$))||1};let ve=!0;function Y(de){const he=de[0].intersectionRatio;if(he!==$){if(!ve)return S();he?S(!1,he):E=setTimeout(()=>{S(!1,1e-7)},1e3)}ve=!1}try{k=new IntersectionObserver(Y,{...fe,root:C.ownerDocument})}catch{k=new IntersectionObserver(Y,fe)}k.observe(y)}(!0),j}(u,e):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(n)})),e()}),u&&!l&&m.observe(u),m.observe(n));let g=l?Xn(t):null;return l&&function y(){const w=Xn(t);!g||w.x===g.x&&w.y===g.y&&w.width===g.width&&w.height===g.height||e(),g=w,d=requestAnimationFrame(y)}(),e(),()=>{var y;p.forEach(w=>{r&&w.removeEventListener("scroll",e),i&&w.removeEventListener("resize",e)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const Bh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(u,p){const{placement:f,platform:d,elements:h}=u,m=await(d.isRTL==null?void 0:d.isRTL(h.floating)),g=Kn(f),y=Xr(f),w=bi(f)==="y",E=["left","top"].includes(g)?-1:1,k=m&&w?-1:1,C=yi(p,u);let{mainAxis:j,crossAxis:S,alignmentAxis:D}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return y&&typeof D=="number"&&(S=y==="end"?-1*D:D),w?{x:S*k,y:j*E}:{x:j*E,y:S*k}}(n,t);return a===((e=c.offset)==null?void 0:e.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Hh=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:w,y:E}=y;return{x:w,y:E}}},...l}=yi(t,n),u={x:e,y:o},p=await du(n,l),f=bi(Kn(r)),d=ru(f);let h=u[d],m=u[f];if(i){const y=d==="y"?"bottom":"right";h=sc(h+p[d==="y"?"top":"left"],h,h-p[y])}if(a){const y=f==="y"?"bottom":"right";m=sc(m+p[f==="y"?"top":"left"],m,m-p[y])}const g=c.fn({...n,[d]:h,[f]:m});return{...g,data:{x:g.x-e,y:g.y-o}}}}},zh=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=n,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=yi(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const w=Kn(r),E=Kn(c)===c,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=d||(E||!g?[Er(c)]:function(A){const fe=Er(A);return[Ui(A),fe,Ui(fe)]}(c));d||m==="none"||C.push(...function(A,fe,ve,Y){const de=Xr(A);let he=function(Oe,se,H){const Q=["left","right"],me=["right","left"],pe=["top","bottom"],V=["bottom","top"];switch(Oe){case"top":case"bottom":return H?se?me:Q:se?Q:me;case"left":case"right":return se?pe:V;default:return[]}}(Kn(A),ve==="start",Y);return de&&(he=he.map(Oe=>Oe+"-"+de),fe&&(he=he.concat(he.map(Ui)))),he}(c,g,m,k));const j=[c,...C],S=await du(n,y),D=[];let $=((o=i.flip)==null?void 0:o.overflows)||[];if(p&&D.push(S[w]),f){const A=function(fe,ve,Y){Y===void 0&&(Y=!1);const de=Xr(fe),he=au(fe),Oe=iu(he);let se=he==="x"?de===(Y?"end":"start")?"right":"left":de==="start"?"bottom":"top";return ve.reference[Oe]>ve.floating[Oe]&&(se=Er(se)),[se,Er(se)]}(r,a,k);D.push(S[A[0]],S[A[1]])}if($=[...$,{placement:r,overflows:D}],!D.every(A=>A<=0)){var W,J;const A=(((W=i.flip)==null?void 0:W.index)||0)+1,fe=j[A];if(fe)return{data:{index:A,overflows:$},reset:{placement:fe}};let ve=(J=$.filter(Y=>Y.overflows[0]<=0).sort((Y,de)=>Y.overflows[1]-de.overflows[1])[0])==null?void 0:J.placement;if(!ve)switch(h){case"bestFit":{var B;const Y=(B=$.map(de=>[de.placement,de.overflows.filter(he=>he>0).reduce((he,Oe)=>he+Oe,0)]).sort((de,he)=>de[1]-he[1])[0])==null?void 0:B[0];Y&&(ve=Y);break}case"initialPlacement":ve=c}if(r!==ve)return{reset:{placement:ve}}}return{}}}},Wh=(t,n,e)=>{const o=new Map,r={platform:Rh,...e},i={...r.platform,_c:o};return(async(a,c,l)=>{const{placement:u="bottom",strategy:p="absolute",middleware:f=[],platform:d}=l,h=f.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(c));let g=await d.getElementRects({reference:a,floating:c,strategy:p}),{x:y,y:w}=lc(g,u,m),E=u,k={},C=0;for(let j=0;j<h.length;j++){const{name:S,fn:D}=h[j],{x:$,y:W,data:J,reset:B}=await D({x:y,y:w,initialPlacement:u,placement:E,strategy:p,middlewareData:k,rects:g,platform:d,elements:{reference:a,floating:c}});y=$??y,w=W??w,k={...k,[S]:{...k[S],...J}},B&&C<=50&&(C++,typeof B=="object"&&(B.placement&&(E=B.placement),B.rects&&(g=B.rects===!0?await d.getElementRects({reference:a,floating:c,strategy:p}):B.rects),{x:y,y:w}=lc(g,E,m)),j=-1)}return{x:y,y:w,placement:E,strategy:p,middlewareData:k}})(t,n,{...r,platform:i})};var zr=typeof document<"u"?v.useLayoutEffect:v.useEffect;function ni(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let e,o,r;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(e=t.length,e!==n.length)return!1;for(o=e;o--!=0;)if(!ni(t[o],n[o]))return!1;return!0}if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!=0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=e;o--!=0;){const i=r[o];if((i!=="_owner"||!t.$$typeof)&&!ni(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}function gu(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function pc(t,n){const e=gu(t);return Math.round(n*e)/e}function Gi(t){const n=_.useRef(t);return zr(()=>{n.current=t}),n}const $h=(t,n)=>({...Hh(t),options:[t,n]}),Uh=(t,n)=>({...zh(t),options:[t,n]});function vu(t){return _.useMemo(()=>t.every(n=>n==null)?null:n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&(e.current=n)})},t)}const yu={..._},Vh=yu.useInsertionEffect||(t=>t());function Pt(t){const n=_.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vh(()=>{n.current=t}),_.useCallback(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}const ps="ArrowUp",Qo="ArrowDown",wn="ArrowLeft",xn="ArrowRight";function Sr(t,n,e){return Math.floor(t/n)!==e}function Ro(t,n){return n<0||n>=t.current.length}function Yi(t,n){return xt(t,{disabledIndices:n})}function hc(t,n){return xt(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function xt(t,n){let{startingIndex:e=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n;const a=t.current;let c=e;do c+=o?-i:i;while(c>=0&&c<=a.length-1&&Wr(a,c,r));return c}function Gh(t,n,e,o,r){if(t===-1)return-1;const i=e.indexOf(t),a=n[t];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return e.lastIndexOf(t)}}function Yh(t,n){return n.flatMap((e,o)=>t.includes(e)?[o]:[])}function Wr(t,n,e){if(e)return e.includes(n);const o=t[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var Je=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Zh(t,n){const e=t.compareDocumentPosition(n);return e&Node.DOCUMENT_POSITION_FOLLOWING||e&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:e&Node.DOCUMENT_POSITION_PRECEDING||e&Node.DOCUMENT_POSITION_CONTAINS?1:0}const bu=_.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Kh(t){const{children:n,elementsRef:e,labelsRef:o}=t,[r,i]=_.useState(()=>new Map),a=_.useCallback(l=>{i(u=>new Map(u).set(l,null))},[]),c=_.useCallback(l=>{i(u=>{const p=new Map(u);return p.delete(l),p})},[]);return Je(()=>{const l=new Map(r);Array.from(l.keys()).sort(Zh).forEach((u,p)=>{l.set(u,p)}),function(u,p){if(u.size!==p.size)return!1;for(const[f,d]of u.entries())if(d!==p.get(f))return!1;return!0}(r,l)||i(l)},[r]),_.createElement(bu.Provider,{value:_.useMemo(()=>({register:a,unregister:c,map:r,elementsRef:e,labelsRef:o}),[a,c,r,e,o])},n)}function wu(t){t===void 0&&(t={});const{label:n}=t,{register:e,unregister:o,map:r,elementsRef:i,labelsRef:a}=_.useContext(bu),[c,l]=_.useState(null),u=_.useRef(null),p=_.useCallback(f=>{if(u.current=f,c!==null&&(i.current[c]=f,a)){var d;const h=n!==void 0;a.current[c]=h?n:(d=f==null?void 0:f.textContent)!=null?d:null}},[c,i,a,n]);return Je(()=>{const f=u.current;if(f)return e(f),()=>{o(f)}},[e,o]),Je(()=>{const f=u.current?r.get(u.current):null;f!=null&&l(f)},[r]),_.useMemo(()=>({ref:p,index:c??-1}),[c,p])}function oi(){return oi=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},oi.apply(this,arguments)}let mc=!1,qh=0;const gc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qh++,Aa=yu.useId||function(){const[t,n]=_.useState(()=>mc?gc():void 0);return Je(()=>{t==null&&n(gc())},[]),_.useEffect(()=>{mc=!0},[]),t};let ir;function Zi(){for(var t,n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];const r="Floating UI: "+e.join(" ");var i;(t=ir)!=null&&t.has(r)||((i=ir)==null||i.add(r),console.warn(r))}function xu(){const t=new Map;return{emit(n,e){var o;(o=t.get(n))==null||o.forEach(r=>r(e))},on(n,e){t.set(n,[...t.get(n)||[],e])},off(n,e){var o;t.set(n,((o=t.get(n))==null?void 0:o.filter(r=>r!==e))||[])}}}process.env.NODE_ENV!=="production"&&(ir=new Set);const Cu=_.createContext(null),ku=_.createContext(null),kn=()=>{var t;return((t=_.useContext(Cu))==null?void 0:t.id)||null},En=()=>_.useContext(ku);function Jh(t){const{children:n,id:e}=t,o=kn();return _.createElement(Cu.Provider,{value:_.useMemo(()=>({id:e,parentId:o}),[e,o])},n)}function Xh(t){const{children:n}=t,e=_.useRef([]),o=_.useCallback(a=>{e.current=[...e.current,a]},[]),r=_.useCallback(a=>{e.current=e.current.filter(c=>c!==a)},[]),i=_.useState(()=>xu())[0];return _.createElement(ku.Provider,{value:_.useMemo(()=>({nodesRef:e,addNode:o,removeNode:r,events:i}),[o,r,i])},n)}function ar(t){return"data-floating-ui-"+t}function qt(t){const n=v.useRef(t);return Je(()=>{n.current=t}),n}const vc=ar("safe-polygon");function Ki(t,n,e){return e&&!Zo(e)?0:typeof t=="number"?t:t==null?void 0:t[n]}let yc=0;function yn(t,n){n===void 0&&(n={});const{preventScroll:e=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(yc);const i=()=>t==null?void 0:t.focus({preventScroll:e});r?i():yc=requestAnimationFrame(i)}function qn(t,n){let e=t.filter(r=>{var i;return r.parentId===n&&((i=r.context)==null?void 0:i.open)}),o=e;for(;o.length;)o=t.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var c;return r.parentId===a.id&&((c=r.context)==null?void 0:c.open)})}),e=e.concat(o);return e}let io=new WeakMap,jr=new WeakSet,Or={},qi=0;const Eu=t=>t&&(t.host||Eu(t.parentNode)),Qh=(t,n)=>n.map(e=>{if(t.contains(e))return e;const o=Eu(e);return t.contains(o)?o:null}).filter(e=>e!=null);function bc(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);const o=kt(t[0]).body;return function(r,i,a,c){const l="data-floating-ui-inert",u=c?"inert":a?"aria-hidden":null,p=Qh(i,r),f=new Set,d=new Set(p),h=[];Or[l]||(Or[l]=new WeakMap);const m=Or[l];return p.forEach(function g(y){y&&!f.has(y)&&(f.add(y),y.parentNode&&g(y.parentNode))}),function g(y){y&&!d.has(y)&&[].forEach.call(y.children,w=>{if(Nn(w)!=="script")if(f.has(w))g(w);else{const E=u?w.getAttribute(u):null,k=E!==null&&E!=="false",C=(io.get(w)||0)+1,j=(m.get(w)||0)+1;io.set(w,C),m.set(w,j),h.push(w),C===1&&k&&jr.add(w),j===1&&w.setAttribute(l,""),!k&&u&&w.setAttribute(u,"true")}})}(i),f.clear(),qi++,()=>{h.forEach(g=>{const y=(io.get(g)||0)-1,w=(m.get(g)||0)-1;io.set(g,y),m.set(g,w),y||(!jr.has(g)&&u&&g.removeAttribute(u),jr.delete(g)),w||g.removeAttribute(l)}),qi--,qi||(io=new WeakMap,io=new WeakMap,jr=new WeakSet,Or={})}}(t.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,e)}const ri=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wc(t,n){const e=ds(t,ri());n==="prev"&&e.reverse();const o=e.indexOf(dn(kt(t)));return e.slice(o+1)[0]}function xc(t,n){const e=n||t.currentTarget,o=t.relatedTarget;return!o||!vt(e,o)}const hs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Cc(t){t.key==="Tab"&&(t.target,clearTimeout(void 0))}const kc=_.forwardRef(function(t,n){const[e,o]=_.useState();Je(()=>(nu()&&o("button"),document.addEventListener("keydown",Cc),()=>{document.removeEventListener("keydown",Cc)}),[]);const r={ref:n,tabIndex:0,role:e,"aria-hidden":!e||void 0,[ar("focus-guard")]:"",style:hs};return _.createElement("span",oi({},t,r))}),em=_.createContext(null),Pa="data-floating-ui-focusable";function Su(t){return t?t.hasAttribute(Pa)?t:t.querySelector("["+Pa+"]")||t:null}const tm=20;let Mn=[];function Ji(t){Mn=Mn.filter(e=>e.isConnected);let n=t;if(n&&Nn(n)!=="body"){if(!_h(n,ri())){const e=ds(n,ri())[0];e&&(n=e)}Mn.push(n),Mn.length>tm&&(Mn=Mn.slice(-20))}}function Ec(){return Mn.slice().reverse().find(t=>t.isConnected)}const nm=_.forwardRef(function(t,n){return _.createElement("button",oi({},t,{type:"button",ref:n,tabIndex:-1,style:hs}))});function om(t){const{context:n,children:e,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:f=!0}=t,{open:d,refs:h,nodeId:m,onOpenChange:g,events:y,dataRef:w,floatingId:E,elements:{domReference:k,floating:C}}=n,j=typeof a=="number"&&a<0,S=Oa(k)&&j,D=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,$=qt(r),W=qt(a),J=qt(c),B=En(),A=_.useContext(em),fe=_.useRef(null),ve=_.useRef(null),Y=_.useRef(!1),de=_.useRef(!1),he=_.useRef(-1),Oe=A!=null,se=Su(C),H=Pt(function(V){return V===void 0&&(V=se),V?ds(V,ri()):[]}),Q=Pt(V=>{const T=H(V);return $.current.map(P=>k&&P==="reference"?k:se&&P==="floating"?se:T).filter(Boolean).flat()});function me(V){return!o&&p&&u?_.createElement(nm,{ref:V==="start"?fe:ve,onClick:T=>g(!1,T.nativeEvent)},typeof p=="string"?p:"Dismiss"):null}_.useEffect(()=>{if(o||!u)return;function V(P){if(P.key==="Tab"){vt(se,dn(kt(se)))&&H().length===0&&!S&&It(P);const L=Q(),G=bn(P);$.current[0]==="reference"&&G===k&&(It(P),P.shiftKey?yn(L[L.length-1]):yn(L[1])),$.current[1]==="floating"&&G===se&&P.shiftKey&&(It(P),yn(L[0]))}}const T=kt(se);return T.addEventListener("keydown",V),()=>{T.removeEventListener("keydown",V)}},[o,k,se,u,$,S,H,Q]),_.useEffect(()=>{if(!o&&C)return C.addEventListener("focusin",V),()=>{C.removeEventListener("focusin",V)};function V(T){const P=bn(T),L=H().indexOf(P);L!==-1&&(he.current=L)}},[o,C,H]),_.useEffect(()=>{if(!o&&f)return C&&dt(k)?(k.addEventListener("focusout",T),k.addEventListener("pointerdown",V),C.addEventListener("focusout",T),()=>{k.removeEventListener("focusout",T),k.removeEventListener("pointerdown",V),C.removeEventListener("focusout",T)}):void 0;function V(){de.current=!0,setTimeout(()=>{de.current=!1})}function T(P){const L=P.relatedTarget;queueMicrotask(()=>{const G=!(vt(k,L)||vt(C,L)||vt(L,C)||vt(A==null?void 0:A.portalNode,L)||L!=null&&L.hasAttribute(ar("focus-guard"))||B&&(qn(B.nodesRef.current,m).find(U=>{var re,te;return vt((re=U.context)==null?void 0:re.elements.floating,L)||vt((te=U.context)==null?void 0:te.elements.domReference,L)})||function(U,re){var te;let I=[],ke=(te=U.find(xe=>xe.id===re))==null?void 0:te.parentId;for(;ke;){const xe=U.find(Me=>Me.id===ke);ke=xe==null?void 0:xe.parentId,xe&&(I=I.concat(xe))}return I}(B.nodesRef.current,m).find(U=>{var re,te;return((re=U.context)==null?void 0:re.elements.floating)===L||((te=U.context)==null?void 0:te.elements.domReference)===L})));if(l&&G&&dn(kt(se))===kt(se).body){dt(se)&&se.focus();const U=he.current,re=H(),te=re[U]||re[re.length-1]||se;dt(te)&&te.focus()}!S&&u||!L||!G||de.current||L===Ec()||(Y.current=!0,g(!1,P,"focus-out"))})}},[o,k,C,se,u,m,B,A,g,f,l,H,S]),_.useEffect(()=>{var V;if(o)return;const T=Array.from((A==null||(V=A.portalNode)==null?void 0:V.querySelectorAll("["+ar("portal")+"]"))||[]);if(C){const P=[C,...T,fe.current,ve.current,$.current.includes("reference")||S?k:null].filter(G=>G!=null),L=u||S?bc(P,D,!D):bc(P);return()=>{L()}}},[o,k,C,u,$,A,S,D]),Je(()=>{if(o||!dt(se))return;const V=dn(kt(se));queueMicrotask(()=>{const T=Q(se),P=W.current,L=(typeof P=="number"?T[P]:P.current)||se,G=vt(se,V);j||G||!d||yn(L,{preventScroll:L===se})})},[o,d,se,j,Q,W]),Je(()=>{if(o||!se)return;let V=!1;const T=kt(se),P=dn(T);let L=w.current.openEvent;function G(re){let{open:te,reason:I,event:ke,nested:xe}=re;te&&(L=ke),I==="escape-key"&&h.domReference.current&&Ji(h.domReference.current),I==="hover"&&ke.type==="mouseleave"&&(Y.current=!0),I==="outside-press"&&(xe?(Y.current=!1,V=!0):Y.current=!(eu(ke)||tu(ke)))}Ji(P),y.on("openchange",G);const U=T.createElement("span");return U.setAttribute("tabindex","-1"),U.setAttribute("aria-hidden","true"),Object.assign(U.style,hs),Oe&&k&&k.insertAdjacentElement("afterend",U),()=>{y.off("openchange",G);const re=dn(T),te=vt(C,re)||B&&qn(B.nodesRef.current,m).some(ke=>{var xe;return vt((xe=ke.context)==null?void 0:xe.elements.floating,re)});(te||L&&["click","mousedown"].includes(L.type))&&h.domReference.current&&Ji(h.domReference.current);const I=typeof J.current=="boolean"?Ec()||U:J.current.current||U;queueMicrotask(()=>{J.current&&!Y.current&&dt(I)&&(I===re||re===T.body||te)&&I.focus({preventScroll:V}),U.remove()})}},[o,C,se,J,w,h,y,B,m,Oe,k]),_.useEffect(()=>{queueMicrotask(()=>{Y.current=!1})},[o]),Je(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:f,open:d,onOpenChange:g,refs:h}),()=>{A.setFocusManagerState(null)}},[o,A,u,d,g,h,f]),Je(()=>{if(o||!se||typeof MutationObserver!="function"||j)return;const V=()=>{const P=se.getAttribute("tabindex"),L=H(),G=dn(kt(C)),U=L.indexOf(G);U!==-1&&(he.current=U),$.current.includes("floating")||G!==h.domReference.current&&L.length===0?P!=="0"&&se.setAttribute("tabindex","0"):P!=="-1"&&se.setAttribute("tabindex","-1")};V();const T=new MutationObserver(V);return T.observe(se,{childList:!0,subtree:!0,attributes:!0}),()=>{T.disconnect()}},[o,C,se,h,$,H,j]);const pe=!o&&D&&(!u||!S)&&(Oe||u);return _.createElement(_.Fragment,null,pe&&_.createElement(kc,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:V=>{if(u){const P=Q();yn(r[0]==="reference"?P[0]:P[P.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(Y.current=!1,xc(V,A.portalNode)){const P=wc(document.body,"next")||k;P==null||P.focus()}else{var T;(T=A.beforeOutsideRef.current)==null||T.focus()}}}),!S&&me("start"),e,me("end"),pe&&_.createElement(kc,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:V=>{if(u)yn(Q()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(f&&(Y.current=!0),xc(V,A.portalNode)){const P=wc(document.body,"prev")||k;P==null||P.focus()}else{var T;(T=A.afterOutsideRef.current)==null||T.focus()}}}))}function Sc(t){return dt(t.target)&&t.target.tagName==="BUTTON"}function jc(t){return ou(t)}const rm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},im={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Oc=t=>{var n,e;return{escapeKey:typeof t=="boolean"?t:(n=t==null?void 0:t.escapeKey)!=null&&n,outsidePress:typeof t=="boolean"?t:(e=t==null?void 0:t.outsidePress)==null||e}};function am(t){const{open:n=!1,onOpenChange:e,elements:o}=t,r=Aa(),i=_.useRef({}),[a]=_.useState(()=>xu()),c=kn()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!Ze(h)&&function(){for(var m,g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const E="Floating UI: "+y.join(" ");var k;(m=ir)!=null&&m.has(E)||((k=ir)==null||k.add(E),console.error(E))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=_.useState(o.reference),p=Pt((h,m,g)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:g,nested:c}),e==null||e(h,m,g)}),f=_.useMemo(()=>({setPositionReference:u}),[]),d=_.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return _.useMemo(()=>({dataRef:i,open:n,onOpenChange:p,elements:d,events:a,floatingId:r,refs:f}),[n,p,d,a,r,f])}function sm(t){t===void 0&&(t={});const{nodeId:n}=t,e=am({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||e,r=o.elements,[i,a]=_.useState(null),[c,l]=_.useState(null),u=(r==null?void 0:r.domReference)||i,p=_.useRef(null),f=En();Je(()=>{u&&(p.current=u)},[u]);const d=function(E){E===void 0&&(E={});const{placement:k="bottom",strategy:C="absolute",middleware:j=[],platform:S,elements:{reference:D,floating:$}={},transform:W=!0,whileElementsMounted:J,open:B}=E,[A,fe]=_.useState({x:0,y:0,strategy:C,placement:k,middlewareData:{},isPositioned:!1}),[ve,Y]=_.useState(j);ni(ve,j)||Y(j);const[de,he]=_.useState(null),[Oe,se]=_.useState(null),H=_.useCallback(Ie=>{Ie!==V.current&&(V.current=Ie,he(Ie))},[]),Q=_.useCallback(Ie=>{Ie!==T.current&&(T.current=Ie,se(Ie))},[]),me=D||de,pe=$||Oe,V=_.useRef(null),T=_.useRef(null),P=_.useRef(A),L=J!=null,G=Gi(J),U=Gi(S),re=Gi(B),te=_.useCallback(()=>{if(!V.current||!T.current)return;const Ie={placement:k,strategy:C,middleware:ve};U.current&&(Ie.platform=U.current),Wh(V.current,T.current,Ie).then(Pe=>{const ge={...Pe,isPositioned:re.current!==!1};I.current&&!ni(P.current,ge)&&(P.current=ge,Hl.flushSync(()=>{fe(ge)}))})},[ve,k,C,U,re]);zr(()=>{B===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,fe(Ie=>({...Ie,isPositioned:!1})))},[B]);const I=_.useRef(!1);zr(()=>(I.current=!0,()=>{I.current=!1}),[]),zr(()=>{if(me&&(V.current=me),pe&&(T.current=pe),me&&pe){if(G.current)return G.current(me,pe,te);te()}},[me,pe,te,G,L]);const ke=_.useMemo(()=>({reference:V,floating:T,setReference:H,setFloating:Q}),[H,Q]),xe=_.useMemo(()=>({reference:me,floating:pe}),[me,pe]),Me=_.useMemo(()=>{const Ie={position:C,left:0,top:0};if(!xe.floating)return Ie;const Pe=pc(xe.floating,A.x),ge=pc(xe.floating,A.y);return W?{...Ie,transform:"translate("+Pe+"px, "+ge+"px)",...gu(xe.floating)>=1.5&&{willChange:"transform"}}:{position:C,left:Pe,top:ge}},[C,W,xe.floating,A.x,A.y]);return _.useMemo(()=>({...A,update:te,refs:ke,elements:xe,floatingStyles:Me}),[A,te,ke,xe,Me])}({...t,elements:{...r,...c&&{reference:c}}}),h=_.useCallback(E=>{const k=Ze(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;l(k),d.refs.setReference(k)},[d.refs]),m=_.useCallback(E=>{(Ze(E)||E===null)&&(p.current=E,a(E)),(Ze(d.refs.reference.current)||d.refs.reference.current===null||E!==null&&!Ze(E))&&d.refs.setReference(E)},[d.refs]),g=_.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:p}),[d.refs,m,h]),y=_.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),w=_.useMemo(()=>({...d,...o,refs:g,elements:y,nodeId:n}),[d,g,y,n,o]);return Je(()=>{o.dataRef.current.floatingContext=w;const E=f==null?void 0:f.nodesRef.current.find(k=>k.id===n);E&&(E.context=w)}),_.useMemo(()=>({...d,context:w,refs:g,elements:y}),[d,g,y,w])}const Nc="active",Ic="selected";function Xi(t,n,e){const o=new Map,r=e==="item";let i=t;if(r&&t){const{[Nc]:a,[Ic]:c,...l}=t;i=l}return{...e==="floating"&&{tabIndex:-1,[Pa]:""},...i,...n.map(a=>{const c=a?a[e]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((a,c)=>(c&&Object.entries(c).forEach(l=>{let[u,p]=l;var f;r&&[Nc,Ic].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof p=="function"&&((f=o.get(u))==null||f.push(p),a[u]=function(){for(var d,h=arguments.length,m=new Array(h),g=0;g<h;g++)m[g]=arguments[g];return(d=o.get(u))==null?void 0:d.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=p)}),a),{})}}let Ac=!1;function wi(t,n,e){switch(t){case"vertical":return n;case"horizontal":return e;default:return n||e}}function Pc(t,n){return wi(n,t===ps||t===Qo,t===wn||t===xn)}function Qi(t,n,e){return wi(n,t===Qo,e?t===wn:t===xn)||t==="Enter"||t===" "||t===""}function Tc(t,n,e){return wi(n,e?t===xn:t===wn,t===ps)}function cm(t,n){const{open:e,onOpenChange:o,elements:r}=t,{listRef:i,activeIndex:a,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:p=!1,loop:f=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:E,orientation:k="vertical",cols:C=1,scrollItemIntoView:j=!0,virtualItemRef:S,itemSizes:D,dense:$=!1}=n;process.env.NODE_ENV!=="production"&&(p&&(f||Zi("`useListNavigation` looping must be enabled to allow escaping."),m||Zi("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&C>1&&Zi("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const W=qt(Su(r.floating)),J=kn(),B=En(),A=Pt(c),fe=Oa(r.domReference),ve=_.useRef(g),Y=_.useRef(u??-1),de=_.useRef(null),he=_.useRef(!0),Oe=_.useRef(A),se=_.useRef(!!r.floating),H=_.useRef(e),Q=_.useRef(!1),me=_.useRef(!1),pe=qt(E),V=qt(e),T=qt(j),P=qt(u),[L,G]=_.useState(),[U,re]=_.useState(),te=Pt(function(ge,x,b){function O(R){m?(G(R.id),B==null||B.events.emit("virtualfocus",R),S&&(S.current=R)):yn(R,{preventScroll:!0,sync:!(!Xl().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!nu())&&(Ac||Q.current)})}b===void 0&&(b=!1);const N=ge.current[x.current];N&&O(N),requestAnimationFrame(()=>{const R=ge.current[x.current]||N;if(!R)return;N||O(R);const ne=T.current;ne&&ke&&(b||!he.current)&&(R.scrollIntoView==null||R.scrollIntoView(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne))})});Je(()=>{document.createElement("div").focus({get preventScroll(){return Ac=!0,!1}})},[]),Je(()=>{l&&(e&&r.floating?ve.current&&u!=null&&(me.current=!0,Y.current=u,A(u)):se.current&&(Y.current=-1,Oe.current(null)))},[l,e,r.floating,u,A]),Je(()=>{if(l&&e&&r.floating)if(a==null){if(Q.current=!1,P.current!=null)return;if(se.current&&(Y.current=-1,te(i,Y)),(!H.current||!se.current)&&ve.current&&(de.current!=null||ve.current===!0&&de.current==null)){let ge=0;const x=()=>{i.current[0]==null?(ge<2&&(ge?requestAnimationFrame:queueMicrotask)(x),ge++):(Y.current=de.current==null||Qi(de.current,k,h)||d?Yi(i,pe.current):hc(i,pe.current),de.current=null,A(Y.current))};x()}}else Ro(i,a)||(Y.current=a,te(i,Y,me.current),me.current=!1)},[l,e,r.floating,a,P,d,i,k,h,A,te,pe]),Je(()=>{var ge;if(!l||r.floating||!B||m||!se.current)return;const x=B.nodesRef.current,b=(ge=x.find(R=>R.id===J))==null||(ge=ge.context)==null?void 0:ge.elements.floating,O=dn(kt(r.floating)),N=x.some(R=>R.context&&vt(R.context.elements.floating,O));b&&!N&&he.current&&b.focus({preventScroll:!0})},[l,r.floating,B,J,m]),Je(()=>{if(l&&B&&m&&!J)return B.events.on("virtualfocus",ge),()=>{B.events.off("virtualfocus",ge)};function ge(x){re(x.id),S&&(S.current=x)}},[l,B,m,J,S]),Je(()=>{Oe.current=A,se.current=!!r.floating}),Je(()=>{e||(de.current=null)},[e]),Je(()=>{H.current=e},[e]);const I=a!=null,ke=_.useMemo(()=>{function ge(x){if(!e)return;const b=i.current.indexOf(x);b!==-1&&A(b)}return{onFocus(x){let{currentTarget:b}=x;ge(b)},onClick:x=>{let{currentTarget:b}=x;return b.focus({preventScroll:!0})},...y&&{onMouseMove(x){let{currentTarget:b}=x;ge(b)},onPointerLeave(x){let{pointerType:b}=x;he.current&&b!=="touch"&&(Y.current=-1,te(i,Y),A(null),m||yn(W.current,{preventScroll:!0}))}}}},[e,W,te,y,i,A,m]),xe=Pt(ge=>{if(he.current=!1,Q.current=!0,ge.which===229||!V.current&&ge.currentTarget===W.current)return;if(d&&Tc(ge.key,k,h))return It(ge),o(!1,ge.nativeEvent,"list-navigation"),void(dt(r.domReference)&&(m?B==null||B.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const x=Y.current,b=Yi(i,E),O=hc(i,E);if(fe||(ge.key==="Home"&&(It(ge),Y.current=b,A(Y.current)),ge.key==="End"&&(It(ge),Y.current=O,A(Y.current))),C>1){const N=D||Array.from({length:i.current.length},()=>({width:1,height:1})),R=function(F,Z,le){const ie=[];let oe=0;return F.forEach((ee,ye)=>{let{width:Ae,height:Ve}=ee;if(Ae>Z&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+ye+" is greater than grid columns");let je=!1;for(le&&(oe=0);!je;){const Ee=[];for(let Ce=0;Ce<Ae;Ce++)for(let ue=0;ue<Ve;ue++)Ee.push(oe+Ce+ue*Z);oe%Z+Ae<=Z&&Ee.every(Ce=>ie[Ce]==null)?(Ee.forEach(Ce=>{ie[Ce]=ye}),je=!0):oe++}}),[...ie]}(N,C,$),ne=R.findIndex(F=>F!=null&&!Wr(i.current,F,E)),q=R.reduce((F,Z,le)=>Z==null||Wr(i.current,Z,E)?F:le,-1),z=R[function(F,Z){let{event:le,orientation:ie,loop:oe,rtl:ee,cols:ye,disabledIndices:Ae,minIndex:Ve,maxIndex:je,prevIndex:Ee,stopEvent:Ce=!1}=Z,ue=Ee;if(le.key===ps){if(Ce&&It(le),Ee===-1)ue=je;else if(ue=xt(F,{startingIndex:ue,amount:ye,decrement:!0,disabledIndices:Ae}),oe&&(Ee-ye<Ve||ue<0)){const be=Ee%ye,Te=je%ye,Ne=je-(Te-be);ue=Te===be?je:Te>be?Ne:Ne-ye}Ro(F,ue)&&(ue=Ee)}if(le.key===Qo&&(Ce&&It(le),Ee===-1?ue=Ve:(ue=xt(F,{startingIndex:Ee,amount:ye,disabledIndices:Ae}),oe&&Ee+ye>je&&(ue=xt(F,{startingIndex:Ee%ye-ye,amount:ye,disabledIndices:Ae}))),Ro(F,ue)&&(ue=Ee)),ie==="both"){const be=go(Ee/ye);le.key===(ee?wn:xn)&&(Ce&&It(le),Ee%ye!=ye-1?(ue=xt(F,{startingIndex:Ee,disabledIndices:Ae}),oe&&Sr(ue,ye,be)&&(ue=xt(F,{startingIndex:Ee-Ee%ye-1,disabledIndices:Ae}))):oe&&(ue=xt(F,{startingIndex:Ee-Ee%ye-1,disabledIndices:Ae})),Sr(ue,ye,be)&&(ue=Ee)),le.key===(ee?xn:wn)&&(Ce&&It(le),Ee%ye!=0?(ue=xt(F,{startingIndex:Ee,decrement:!0,disabledIndices:Ae}),oe&&Sr(ue,ye,be)&&(ue=xt(F,{startingIndex:Ee+(ye-Ee%ye),decrement:!0,disabledIndices:Ae}))):oe&&(ue=xt(F,{startingIndex:Ee+(ye-Ee%ye),decrement:!0,disabledIndices:Ae})),Sr(ue,ye,be)&&(ue=Ee));const Te=go(je/ye)===be;Ro(F,ue)&&(ue=oe&&Te?le.key===(ee?xn:wn)?je:xt(F,{startingIndex:Ee-Ee%ye-1,disabledIndices:Ae}):Ee)}return ue}({current:R.map(F=>F!=null?i.current[F]:null)},{event:ge,orientation:k,loop:f,rtl:h,cols:C,disabledIndices:Yh([...E||i.current.map((F,Z)=>Wr(i.current,Z)?Z:void 0),void 0],R),minIndex:ne,maxIndex:q,prevIndex:Gh(Y.current>O?b:Y.current,N,R,C,ge.key===Qo?"bl":ge.key===(h?wn:xn)?"tr":"tl"),stopEvent:!0})];if(z!=null&&(Y.current=z,A(Y.current)),k==="both")return}if(Pc(ge.key,k)){if(It(ge),e&&!m&&dn(ge.currentTarget.ownerDocument)===ge.currentTarget)return Y.current=Qi(ge.key,k,h)?b:O,void A(Y.current);Qi(ge.key,k,h)?Y.current=f?x>=O?p&&x!==i.current.length?-1:b:xt(i,{startingIndex:x,disabledIndices:E}):Math.min(O,xt(i,{startingIndex:x,disabledIndices:E})):Y.current=f?x<=b?p&&x!==-1?i.current.length:O:xt(i,{startingIndex:x,decrement:!0,disabledIndices:E}):Math.max(b,xt(i,{startingIndex:x,decrement:!0,disabledIndices:E})),Ro(i,Y.current)?A(null):A(Y.current)}}),Me=_.useMemo(()=>m&&e&&I&&{"aria-activedescendant":U||L},[m,e,I,U,L]),Ie=_.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...!Oa(r.domReference)&&Me,onKeyDown:xe,onPointerMove(){he.current=!0}}),[Me,xe,r.domReference,k]),Pe=_.useMemo(()=>{function ge(x){g==="auto"&&eu(x.nativeEvent)&&(ve.current=!0)}return{...Me,onKeyDown(x){he.current=!1;const b=x.key.startsWith("Arrow"),O=["Home","End"].includes(x.key),N=b||O,R=function(ie,oe,ee){return wi(oe,ee?ie===wn:ie===xn,ie===Qo)}(x.key,k,h),ne=Tc(x.key,k,h),q=Pc(x.key,k),z=(d?R:q)||x.key==="Enter"||x.key.trim()==="";if(m&&e){const ie=B==null?void 0:B.nodesRef.current.find(ee=>ee.parentId==null),oe=B&&ie?function(ee,ye){let Ae,Ve=-1;return function je(Ee,Ce){Ce>Ve&&(Ae=Ee,Ve=Ce),qn(ee,Ee).forEach(ue=>{je(ue.id,Ce+1)})}(ye,0),ee.find(je=>je.id===Ae)}(B.nodesRef.current,ie.id):null;if(N&&oe&&S){const ee=new KeyboardEvent("keydown",{key:x.key,bubbles:!0});if(R||ne){var F,Z;const ye=((F=oe.context)==null?void 0:F.elements.domReference)===x.currentTarget,Ae=ne&&!ye?(Z=oe.context)==null?void 0:Z.elements.domReference:R?i.current.find(Ve=>(Ve==null?void 0:Ve.id)===L):null;Ae&&(It(x),Ae.dispatchEvent(ee),re(void 0))}var le;if((q||O)&&oe.context&&oe.context.open&&oe.parentId&&x.currentTarget!==oe.context.elements.domReference)return It(x),void((le=oe.context.elements.domReference)==null||le.dispatchEvent(ee))}return xe(x)}(e||w||!b)&&(z&&(de.current=d&&q?null:x.key),d?R&&(It(x),e?(Y.current=Yi(i,pe.current),A(Y.current)):o(!0,x.nativeEvent,"list-navigation")):q&&(u!=null&&(Y.current=u),It(x),!e&&w?o(!0,x.nativeEvent,"list-navigation"):xe(x),e&&A(Y.current)))},onFocus(){e&&!m&&A(null)},onPointerDown:function(x){ve.current=g,g==="auto"&&tu(x.nativeEvent)&&(ve.current=!0)},onMouseDown:ge,onClick:ge}},[L,Me,xe,pe,g,i,d,A,o,e,w,k,h,u,B,m,S]);return _.useMemo(()=>l?{reference:Pe,floating:Ie,item:ke}:{},[l,Pe,Ie,ke])}const lm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _c(t,n){const[e,o]=t;let r=!1;const i=n.length;for(let a=0,c=i-1;a<i;c=a++){const[l,u]=n[a]||[0,0],[p,f]=n[c]||[0,0];u>=o!=f>=o&&e<=(p-l)*(o-u)/(f-u)+l&&(r=!r)}return r}function um(t){t===void 0&&(t={});const{buffer:n=.5,blockPointerEvents:e=!1,requireIntent:o=!0}=t;let r,i=!1,a=null,c=null,l=performance.now();const u=p=>{let{x:f,y:d,placement:h,elements:m,onClose:g,nodeId:y,tree:w}=p;return function(E){function k(){clearTimeout(r),g()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||f==null||d==null)return;const{clientX:C,clientY:j}=E,S=[C,j],D=bn(E),$=E.type==="mouseleave",W=vt(m.floating,D),J=vt(m.domReference,D),B=m.domReference.getBoundingClientRect(),A=m.floating.getBoundingClientRect(),fe=h.split("-")[0],ve=f>A.right-A.width/2,Y=d>A.bottom-A.height/2,de=function(V,T){return V[0]>=T.x&&V[0]<=T.x+T.width&&V[1]>=T.y&&V[1]<=T.y+T.height}(S,B),he=A.width>B.width,Oe=A.height>B.height,se=(he?B:A).left,H=(he?B:A).right,Q=(Oe?B:A).top,me=(Oe?B:A).bottom;if(W&&(i=!0,!$))return;if(J&&(i=!1),J&&!$)return void(i=!0);if($&&Ze(E.relatedTarget)&&vt(m.floating,E.relatedTarget)||w&&qn(w.nodesRef.current,y).some(V=>{let{context:T}=V;return T==null?void 0:T.open}))return;if(fe==="top"&&d>=B.bottom-1||fe==="bottom"&&d<=B.top+1||fe==="left"&&f>=B.right-1||fe==="right"&&f<=B.left+1)return k();let pe=[];switch(fe){case"top":pe=[[se,B.top+1],[se,A.bottom-1],[H,A.bottom-1],[H,B.top+1]];break;case"bottom":pe=[[se,A.top+1],[se,B.bottom-1],[H,B.bottom-1],[H,A.top+1]];break;case"left":pe=[[A.right-1,me],[A.right-1,Q],[B.left+1,Q],[B.left+1,me]];break;case"right":pe=[[B.right-1,me],[B.right-1,Q],[A.left+1,Q],[A.left+1,me]]}if(!_c([C,j],pe)){if(i&&!de)return k();if(!$&&o){const V=function(T,P){const L=performance.now(),G=L-l;if(a===null||c===null||G===0)return a=T,c=P,l=L,null;const U=T-a,re=P-c,te=Math.sqrt(U*U+re*re);return a=T,c=P,l=L,te/G}(E.clientX,E.clientY);if(V!==null&&V<.1)return k()}_c([C,j],function(V){let[T,P]=V;switch(fe){case"top":return[[he?T+n/2:ve?T+4*n:T-4*n,P+n+1],[he?T-n/2:ve?T+4*n:T-4*n,P+n+1],[A.left,ve||he?A.bottom-n:A.top],[A.right,ve?he?A.bottom-n:A.top:A.bottom-n]];case"bottom":return[[he?T+n/2:ve?T+4*n:T-4*n,P-n],[he?T-n/2:ve?T+4*n:T-4*n,P-n],[A.left,ve||he?A.top+n:A.bottom],[A.right,ve?he?A.top+n:A.bottom:A.top+n]];case"left":{const L=[T+n+1,Oe?P+n/2:Y?P+4*n:P-4*n],G=[T+n+1,Oe?P-n/2:Y?P+4*n:P-4*n];return[[Y||Oe?A.right-n:A.left,A.top],[Y?Oe?A.right-n:A.left:A.right-n,A.bottom],L,G]}case"right":return[[T-n,Oe?P+n/2:Y?P+4*n:P-4*n],[T-n,Oe?P-n/2:Y?P+4*n:P-4*n],[Y||Oe?A.left+n:A.right,A.top],[Y?Oe?A.left+n:A.right:A.left+n,A.bottom]]}}([f,d]))?!i&&o&&(r=window.setTimeout(k,40)):k()}}};return u.__options={blockPointerEvents:e},u}const Ta=v.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),ju=v.forwardRef(({className:t,disabled:n,children:e,...o},r)=>{const i=v.useContext(Ta),a=wu(),c=En(),l=a.index===i.activeIndex,u=K("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return s.jsx("div",{ref:vu([a.ref,r]),role:"menuitem",className:u,tabIndex:l?0:-1,...o,...i.getItemProps({onClick(p){var f;(f=o.onClick)==null||f.call(o,p),i.setIsOpen(!1),c==null||c.events.emit("click")},onFocus(p){var f;(f=o.onFocus)==null||f.call(o,p),i.setHasFocusInside(!0)}}),children:e})});ju.displayName="DropdownMenuItem";const _a=v.forwardRef(({className:t,variant:n="default",icon:e,iconRight:o,text:r="",disabled:i,children:a,...c},l)=>{const[u,p]=v.useState(!1),[f,d]=v.useState(!1),[h,m]=v.useState(null),g=v.useRef([]),y=v.useRef([]),w=v.useContext(Ta),E=En(),k=function(T){const P=Aa(),L=En(),G=kn();return Je(()=>{const U={id:P,parentId:G};return L==null||L.addNode(U),()=>{L==null||L.removeNode(U)}},[L,P,G]),P}(),C=kn(),j=wu(),S=C!=null,{floatingStyles:D,refs:$,context:W}=sm({nodeId:k,open:u,onOpenChange:p,placement:S?"right-start":"bottom-start",middleware:[(J={mainAxis:S?0:4,alignmentAxis:S?-4:0},{...Bh(J),options:[J,B]}),Uh(),$h()],whileElementsMounted:Fh});var J,B;const A=function(T,P){P===void 0&&(P={});const{open:L,onOpenChange:G,dataRef:U,events:re,elements:te}=T,{enabled:I=!0,delay:ke=0,handleClose:xe=null,mouseOnly:Me=!1,restMs:Ie=0,move:Pe=!0}=P,ge=En(),x=kn(),b=qt(xe),O=qt(ke),N=qt(L),R=_.useRef(),ne=_.useRef(-1),q=_.useRef(),z=_.useRef(-1),F=_.useRef(!0),Z=_.useRef(!1),le=_.useRef(()=>{}),ie=_.useRef(!1),oe=_.useCallback(()=>{var Ce;const ue=(Ce=U.current.openEvent)==null?void 0:Ce.type;return(ue==null?void 0:ue.includes("mouse"))&&ue!=="mousedown"},[U]);_.useEffect(()=>{if(I)return re.on("openchange",Ce),()=>{re.off("openchange",Ce)};function Ce(ue){let{open:be}=ue;be||(clearTimeout(ne.current),clearTimeout(z.current),F.current=!0,ie.current=!1)}},[I,re]),_.useEffect(()=>{if(!I||!b.current||!L)return;function Ce(be){oe()&&G(!1,be,"hover")}const ue=kt(te.floating).documentElement;return ue.addEventListener("mouseleave",Ce),()=>{ue.removeEventListener("mouseleave",Ce)}},[te.floating,L,G,I,b,oe]);const ee=_.useCallback(function(Ce,ue,be){ue===void 0&&(ue=!0),be===void 0&&(be="hover");const Te=Ki(O.current,"close",R.current);Te&&!q.current?(clearTimeout(ne.current),ne.current=window.setTimeout(()=>G(!1,Ce,be),Te)):ue&&(clearTimeout(ne.current),G(!1,Ce,be))},[O,G]),ye=Pt(()=>{le.current(),q.current=void 0}),Ae=Pt(()=>{if(Z.current){const Ce=kt(te.floating).body;Ce.style.pointerEvents="",Ce.removeAttribute(vc),Z.current=!1}}),Ve=Pt(()=>!!U.current.openEvent&&["click","mousedown"].includes(U.current.openEvent.type));_.useEffect(()=>{if(I&&Ze(te.domReference)){var Ce;const Ne=te.domReference;return L&&Ne.addEventListener("mouseleave",Te),(Ce=te.floating)==null||Ce.addEventListener("mouseleave",Te),Pe&&Ne.addEventListener("mousemove",ue,{once:!0}),Ne.addEventListener("mouseenter",ue),Ne.addEventListener("mouseleave",be),()=>{var qe;L&&Ne.removeEventListener("mouseleave",Te),(qe=te.floating)==null||qe.removeEventListener("mouseleave",Te),Pe&&Ne.removeEventListener("mousemove",ue),Ne.removeEventListener("mouseenter",ue),Ne.removeEventListener("mouseleave",be)}}function ue(Ne){if(clearTimeout(ne.current),F.current=!1,Me&&!Zo(R.current)||Ie>0&&!Ki(O.current,"open"))return;const qe=Ki(O.current,"open",R.current);qe?ne.current=window.setTimeout(()=>{N.current||G(!0,Ne,"hover")},qe):L||G(!0,Ne,"hover")}function be(Ne){if(Ve())return;le.current();const qe=kt(te.floating);if(clearTimeout(z.current),ie.current=!1,b.current&&U.current.floatingContext){L||clearTimeout(ne.current),q.current=b.current({...U.current.floatingContext,tree:ge,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ye(),Ve()||ee(Ne,!0,"safe-polygon")}});const Kt=q.current;return qe.addEventListener("mousemove",Kt),void(le.current=()=>{qe.removeEventListener("mousemove",Kt)})}(R.current!=="touch"||!vt(te.floating,Ne.relatedTarget))&&ee(Ne)}function Te(Ne){Ve()||U.current.floatingContext&&(b.current==null||b.current({...U.current.floatingContext,tree:ge,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ye(),Ve()||ee(Ne)}})(Ne))}},[te,I,T,Me,Ie,Pe,ee,ye,Ae,G,L,N,ge,O,b,U,Ve]),Je(()=>{var Ce;if(I&&L&&(Ce=b.current)!=null&&Ce.__options.blockPointerEvents&&oe()){Z.current=!0;const be=te.floating;if(Ze(te.domReference)&&be){var ue;const Te=kt(te.floating).body;Te.setAttribute(vc,"");const Ne=te.domReference,qe=ge==null||(ue=ge.nodesRef.current.find(Kt=>Kt.id===x))==null||(ue=ue.context)==null?void 0:ue.elements.floating;return qe&&(qe.style.pointerEvents=""),Te.style.pointerEvents="none",Ne.style.pointerEvents="auto",be.style.pointerEvents="auto",()=>{Te.style.pointerEvents="",Ne.style.pointerEvents="",be.style.pointerEvents=""}}}},[I,L,x,te,ge,b,oe]),Je(()=>{L||(R.current=void 0,ie.current=!1,ye(),Ae())},[L,ye,Ae]),_.useEffect(()=>()=>{ye(),clearTimeout(ne.current),clearTimeout(z.current),Ae()},[I,te.domReference,ye,Ae]);const je=_.useMemo(()=>{function Ce(ue){R.current=ue.pointerType}return{onPointerDown:Ce,onPointerEnter:Ce,onMouseMove(ue){const{nativeEvent:be}=ue;function Te(){F.current||N.current||G(!0,be,"hover")}Me&&!Zo(R.current)||L||Ie===0||ie.current&&ue.movementX**2+ue.movementY**2<2||(clearTimeout(z.current),R.current==="touch"?Te():(ie.current=!0,z.current=window.setTimeout(Te,Ie)))}}},[Me,G,L,N,Ie]),Ee=_.useMemo(()=>({onMouseEnter(){clearTimeout(ne.current)},onMouseLeave(Ce){Ve()||ee(Ce.nativeEvent,!1)}}),[ee,Ve]);return _.useMemo(()=>I?{reference:je,floating:Ee}:{},[I,je,Ee])}(W,{enabled:S,delay:{open:75},handleClose:um({blockPointerEvents:!0})}),fe=function(T,P){P===void 0&&(P={});const{open:L,onOpenChange:G,dataRef:U,elements:{domReference:re}}=T,{enabled:te=!0,event:I="click",toggle:ke=!0,ignoreMouse:xe=!1,keyboardHandlers:Me=!0,stickIfOpen:Ie=!0}=P,Pe=_.useRef(),ge=_.useRef(!1),x=_.useMemo(()=>({onPointerDown(b){Pe.current=b.pointerType},onMouseDown(b){const O=Pe.current;b.button===0&&I!=="click"&&(Zo(O,!0)&&xe||(!L||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="mousedown"?(b.preventDefault(),G(!0,b.nativeEvent,"click")):G(!1,b.nativeEvent,"click")))},onClick(b){const O=Pe.current;I==="mousedown"&&Pe.current?Pe.current=void 0:Zo(O,!0)&&xe||(!L||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="click"?G(!0,b.nativeEvent,"click"):G(!1,b.nativeEvent,"click"))},onKeyDown(b){Pe.current=void 0,b.defaultPrevented||!Me||Sc(b)||(b.key!==" "||jc(re)||(b.preventDefault(),ge.current=!0),b.key==="Enter"&&G(!L||!ke,b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!Me||Sc(b)||jc(re)||b.key===" "&&ge.current&&(ge.current=!1,G(!L||!ke,b.nativeEvent,"click"))}}),[U,re,I,xe,Me,G,L,Ie,ke]);return _.useMemo(()=>te?{reference:x}:{},[te,x])}(W,{event:"mousedown",toggle:!S,ignoreMouse:S}),ve=function(T,P){var L;P===void 0&&(P={});const{open:G,floatingId:U}=T,{enabled:re=!0,role:te="dialog"}=P,I=(L=lm.get(te))!=null?L:te,ke=Aa(),xe=kn()!=null,Me=_.useMemo(()=>I==="tooltip"||te==="label"?{["aria-"+(te==="label"?"labelledby":"describedby")]:G?U:void 0}:{"aria-expanded":G?"true":"false","aria-haspopup":I==="alertdialog"?"dialog":I,"aria-controls":G?U:void 0,...I==="listbox"&&{role:"combobox"},...I==="menu"&&{id:ke},...I==="menu"&&xe&&{role:"menuitem"},...te==="select"&&{"aria-autocomplete":"none"},...te==="combobox"&&{"aria-autocomplete":"list"}},[I,U,xe,G,ke,te]),Ie=_.useMemo(()=>{const ge={id:U,...I&&{role:I}};return I==="tooltip"||te==="label"?ge:{...ge,...I==="menu"&&{"aria-labelledby":ke}}},[I,U,ke,te]),Pe=_.useCallback(ge=>{let{active:x,selected:b}=ge;const O={role:"option",...x&&{id:U+"-option"}};switch(te){case"select":return{...O,"aria-selected":x&&b};case"combobox":return{...O,...x&&{"aria-selected":!0}}}return{}},[U,te]);return _.useMemo(()=>re?{reference:Me,floating:Ie,item:Pe}:{},[re,Me,Ie,Pe])}(W,{role:"menu"}),Y=function(T,P){P===void 0&&(P={});const{open:L,onOpenChange:G,elements:U,dataRef:re}=T,{enabled:te=!0,escapeKey:I=!0,outsidePress:ke=!0,outsidePressEvent:xe="pointerdown",referencePress:Me=!1,referencePressEvent:Ie="pointerdown",ancestorScroll:Pe=!1,bubbles:ge,capture:x}=P,b=En(),O=Pt(typeof ke=="function"?ke:()=>!1),N=typeof ke=="function"?O:ke,R=_.useRef(!1),ne=_.useRef(!1),{escapeKey:q,outsidePress:z}=Oc(ge),{escapeKey:F,outsidePress:Z}=Oc(x),le=_.useRef(!1),ie=Pt(je=>{var Ee;if(!L||!te||!I||je.key!=="Escape"||le.current)return;const Ce=(Ee=re.current.floatingContext)==null?void 0:Ee.nodeId,ue=b?qn(b.nodesRef.current,Ce):[];if(!q&&(je.stopPropagation(),ue.length>0)){let be=!0;if(ue.forEach(Te=>{var Ne;(Ne=Te.context)==null||!Ne.open||Te.context.dataRef.current.__escapeKeyBubbles||(be=!1)}),!be)return}G(!1,function(be){return"nativeEvent"in be}(je)?je.nativeEvent:je,"escape-key")}),oe=Pt(je=>{var Ee;const Ce=()=>{var ue;ie(je),(ue=bn(je))==null||ue.removeEventListener("keydown",Ce)};(Ee=bn(je))==null||Ee.addEventListener("keydown",Ce)}),ee=Pt(je=>{var Ee;const Ce=R.current;R.current=!1;const ue=ne.current;if(ne.current=!1,xe==="click"&&ue||Ce||typeof N=="function"&&!N(je))return;const be=bn(je),Te="["+ar("inert")+"]",Ne=kt(U.floating).querySelectorAll(Te);let qe=Ze(be)?be:null;for(;qe&&!Sn(qe);){const $t=fn(qe);if(Sn($t)||!Ze($t))break;qe=$t}if(Ne.length&&Ze(be)&&!be.matches("html,body")&&!vt(be,U.floating)&&Array.from(Ne).every($t=>!vt(qe,$t)))return;if(dt(be)&&Ve){const $t=be.clientWidth>0&&be.scrollWidth>be.clientWidth,vn=be.clientHeight>0&&be.scrollHeight>be.clientHeight;let Mo=vn&&je.offsetX>be.clientWidth;if(vn&&Vt(be).direction==="rtl"&&(Mo=je.offsetX<=be.offsetWidth-be.clientWidth),Mo||$t&&je.offsetY>be.clientHeight)return}const Kt=(Ee=re.current.floatingContext)==null?void 0:Ee.nodeId,ic=b&&qn(b.nodesRef.current,Kt).some($t=>{var vn;return $i(je,(vn=$t.context)==null?void 0:vn.elements.floating)});if($i(je,U.floating)||$i(je,U.domReference)||ic)return;const ac=b?qn(b.nodesRef.current,Kt):[];if(ac.length>0){let $t=!0;if(ac.forEach(vn=>{var Mo;(Mo=vn.context)==null||!Mo.open||vn.context.dataRef.current.__outsidePressBubbles||($t=!1)}),!$t)return}G(!1,je,"outside-press")}),ye=Pt(je=>{var Ee;const Ce=()=>{var ue;ee(je),(ue=bn(je))==null||ue.removeEventListener(xe,Ce)};(Ee=bn(je))==null||Ee.addEventListener(xe,Ce)});_.useEffect(()=>{if(!L||!te)return;re.current.__escapeKeyBubbles=q,re.current.__outsidePressBubbles=z;let je=-1;function Ee(Ne){G(!1,Ne,"ancestor-scroll")}function Ce(){window.clearTimeout(je),le.current=!0}function ue(){je=window.setTimeout(()=>{le.current=!1},gi()?5:0)}const be=kt(U.floating);I&&(be.addEventListener("keydown",F?oe:ie,F),be.addEventListener("compositionstart",Ce),be.addEventListener("compositionend",ue)),N&&be.addEventListener(xe,Z?ye:ee,Z);let Te=[];return Pe&&(Ze(U.domReference)&&(Te=jn(U.domReference)),Ze(U.floating)&&(Te=Te.concat(jn(U.floating))),!Ze(U.reference)&&U.reference&&U.reference.contextElement&&(Te=Te.concat(jn(U.reference.contextElement)))),Te=Te.filter(Ne=>{var qe;return Ne!==((qe=be.defaultView)==null?void 0:qe.visualViewport)}),Te.forEach(Ne=>{Ne.addEventListener("scroll",Ee,{passive:!0})}),()=>{I&&(be.removeEventListener("keydown",F?oe:ie,F),be.removeEventListener("compositionstart",Ce),be.removeEventListener("compositionend",ue)),N&&be.removeEventListener(xe,Z?ye:ee,Z),Te.forEach(Ne=>{Ne.removeEventListener("scroll",Ee)}),window.clearTimeout(je)}},[re,U,I,N,xe,L,G,Pe,te,q,z,ie,F,oe,ee,Z,ye]),_.useEffect(()=>{R.current=!1},[N,xe]);const Ae=_.useMemo(()=>({onKeyDown:ie,[rm[Ie]]:je=>{Me&&G(!1,je.nativeEvent,"reference-press")}}),[ie,G,Me,Ie]),Ve=_.useMemo(()=>({onKeyDown:ie,onMouseDown(){ne.current=!0},onMouseUp(){ne.current=!0},[im[xe]]:()=>{R.current=!0}}),[ie,xe]);return _.useMemo(()=>te?{reference:Ae,floating:Ve}:{},[te,Ae,Ve])}(W,{bubbles:!0}),de=cm(W,{listRef:g,activeIndex:h,nested:S,onNavigate:m}),{getReferenceProps:he,getFloatingProps:Oe,getItemProps:se}=function(T){T===void 0&&(T=[]);const P=T.map(I=>I==null?void 0:I.reference),L=T.map(I=>I==null?void 0:I.floating),G=T.map(I=>I==null?void 0:I.item),U=_.useCallback(I=>Xi(I,T,"reference"),P),re=_.useCallback(I=>Xi(I,T,"floating"),L),te=_.useCallback(I=>Xi(I,T,"item"),G);return _.useMemo(()=>({getReferenceProps:U,getFloatingProps:re,getItemProps:te}),[U,re,te])}([A,fe,ve,Y,de]);v.useEffect(()=>{if(E)return E.events.on("click",T),E.events.on("menuopen",P),()=>{E.events.off("click",T),E.events.off("menuopen",P)};function T(){p(!1)}function P(L){L.nodeId!==k&&L.parentId===C&&p(!1)}},[E,k,C]),v.useEffect(()=>{u&&E&&E.events.emit("menuopen",{parentId:C,nodeId:k})},[E,u,k,C]);const H={activeIndex:h,setActiveIndex:m,getItemProps:se,setHasFocusInside:d,isOpen:u,setIsOpen:p},Q=v.useMemo(()=>H,[h,m,se,d,u]),me=K("io-dropdown-menu-button",S&&"io-dropdown-menu-item",u&&!S&&"active",t),pe=vu([$.setReference,j.ref,l]),V=w.activeIndex===j.index?0:-1;return s.jsxs(Jh,{id:k,children:[s.jsx(Ge,{className:me,ref:pe,variant:S?"link":n,tabIndex:S?V:void 0,role:S?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":S?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:S?"chevron-right":e,iconSize:"10",iconRight:!!S||o,disabled:i,...he(w.getItemProps({onFocus(T){var P;(P=c.onFocus)==null||P.call(c,T),d(!1),w.setHasFocusInside(!0)},...c}))}),s.jsx(Ta.Provider,{value:Q,children:s.jsx(Kh,{elementsRef:g,labelsRef:y,children:u&&s.jsx(om,{context:W,modal:!1,initialFocus:S?-1:0,returnFocus:!S,children:s.jsx("div",{ref:$.setFloating,className:"io-dropdown-menu",style:D,...Oe(),children:a})})})})]})});function xi({className:t,...n}){const e=K("io-separator",t);return s.jsx("hr",{className:e,...n})}_a.displayName="DropdownMenu";const Jt=v.forwardRef(({...t},n)=>kn()===null?s.jsx(Xh,{children:s.jsx(_a,{ref:n,...t})}):s.jsx(_a,{ref:n,...t}));function Ou({className:t,variant:n="default",size:e="16",src:o,alt:r,...i}){const a=K("io-image-icon",n==="grayscale"&&[`io-image-icon-${n}`],e&&[`io-image-icon-${e}`],t);return s.jsx("img",{className:a,style:{width:`${e}px`,filter:n==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function dm({className:t,size:n="large",variant:e="default",align:o="up",text:r,...i}){const a=K("io-loader",{[`io-loader-${e}`]:e!=="default"},n==="normal"&&"io-loader-md",n==="small"&&"io-loader-sm",o&&[`direction-${o}`],t);return s.jsxs("div",{className:a,...i,children:[s.jsx("div",{className:"io-loader-icon"}),r&&s.jsx("div",{className:"io-loader-text",children:r})]})}function Cn({className:t,children:n,...e}){const o=K("io-panel-header",t);return s.jsx(Ft,{className:o,...e,children:n})}Jt.displayName="DropdownMenu",Jt.Item=ju,Jt.Separator=xi,Cn.Title=nn,Cn.ButtonGroup=Re,Cn.Button=Ge,Cn.ButtonIcon=Ue,Cn.Dropdown=ae;const Eo=v.forwardRef(({className:t,children:n,...e},o)=>{const r=K("io-panel-body",t);return s.jsx("div",{className:r,ref:o,...e,children:n})});function po({className:t,...n}){const e=K("io-panel-footer",t);return s.jsx(Vn,{className:e,...n})}function Ke({className:t,children:n,...e}){const o=K("io-panel",t);return s.jsx("div",{className:o,...e,children:n})}function Nu({className:t,variant:n="default",children:e,...o}){const r=K("io-pill",n!=="default"&&[`io-pill-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function fm({className:t,variant:n="active",value:e=0,...o}){const r=K("io-progress",n,t);return s.jsx("div",{className:r,...o,children:s.jsx("div",{className:"io-progress-bar",style:{width:`${e<0?0:e>100?100:e}%`}})})}function Ci({text:t="Label",...n}){return s.jsx("label",{...n,children:t})}Eo.displayName="PanelBody",po.ButtonGroup=Re,po.Button=Ge,po.ButtonIcon=Ue,po.Dropdown=ae,Ke.Header=Cn,Ke.Body=Eo,Ke.Footer=po,Nu.Icon=Xe;const Qn=v.forwardRef(({id:t="input",className:n,type:e="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:c,iconAppend:l,iconAppendOnClick:u,placeholder:p,disabled:f,readOnly:d,errorMessage:h,errorDataTestId:m,...g},y)=>{const w=K("io-control-input",a&&"io-control-leading-icon",l&&"io-control-trailing-icon",f&&"io-control-disabled",d&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],n),E=v.useCallback(C=>{f?C.preventDefault():c&&c(C)},[c,f]),k=v.useCallback(C=>{f?C.preventDefault():u&&u(C)},[u,f]);return s.jsxs("div",{className:w,children:[i&&s.jsx(Ci,{htmlFor:t,text:i}),a&&s.jsx(Xe,{variant:a,onClick:C=>E(C)}),s.jsx("input",{id:t,className:"io-input",ref:y,type:e,name:o,tabIndex:0,placeholder:p??(()=>{switch(e){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),disabled:f,readOnly:d,...g}),l&&s.jsx(Xe,{variant:l,onClick:C=>k(C)}),h&&s.jsxs("div",{"data-testid":m,children:[s.jsx(Xe,{variant:"close"}),h]})]})});Qn.displayName="Input";const ki=v.forwardRef(({id:t="textarea",className:n,name:e="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:c,readOnly:l,...u},p)=>{const f=K("io-control-textarea",c&&"io-control-disabled",l&&"io-control-readonly",o&&[`direction-${o}`],n);return s.jsxs("div",{className:f,children:[r&&s.jsx(Ci,{htmlFor:t,text:r}),s.jsx("textarea",{id:t,className:"io-textarea",ref:p,name:e,tabIndex:0,placeholder:a,disabled:c,readOnly:l,rows:i,...u})]})});ki.displayName="Textarea";const Ei=v.forwardRef(({id:t="checkbox",className:n,name:e="checkbox",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=K("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(Ci,{htmlFor:t,text:r})]})});Ei.displayName="Checkbox";const pm=v.forwardRef(({id:t="radio",className:n,name:e="radio",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=K("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"radio",id:t,className:"io-radio",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(Ci,{htmlFor:t,text:r})]})});pm.displayName="Radio";const ft=v.forwardRef(({id:t="toggle",className:n,name:e="toggle",align:o="left",label:r="Toggle",checked:i,disabled:a,...c},l)=>{const u=K("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsx("div",{className:u,children:s.jsxs("label",{className:"io-toggle",children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,checked:i,disabled:a,...c}),s.jsx("span",{className:"slider"}),r]})})});function hm(){const t=v.useContext(_e.IOConnectContext),[n,e]=v.useState({}),o=v.useCallback(async a=>{var c;t&&await((c=t.prefs)==null?void 0:c.set(a))},[t]),r=v.useCallback(async a=>{var c;t&&await((c=t.prefs)==null?void 0:c.update(a))},[t]),i=v.useCallback(async()=>{var a;t&&await((a=t.prefs)==null?void 0:a.clear())},[t]);return v.useEffect(()=>{var c;if(!t)return;const a=(c=t.prefs)==null?void 0:c.subscribe(l=>{e(u=>u===null?l.data:{...u,...l.data})});return()=>{a==null||a()}},[t]),{appPrefs:n,setPrefs:o,updatePrefs:r,clearPrefs:i}}function Iu(t,n=500){const[e,o]=v.useState(t);return v.useEffect(()=>{const r=setTimeout(()=>{o(t)},n);return()=>clearTimeout(r)},[t,n]),e}function mm(t,n){v.useEffect(()=>{const e=o=>{o.code===t&&n()};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[t,n])}ft.displayName="Toggle";const Si=()=>window.glue42gd!==void 0||window.iodesktop!==void 0;function Be(){return v.useMemo(()=>typeof window=="object"&&Si(),[])}v.createContext({theme:"dark"});const Dc="io-connect-platform",Hn="___platform_prefs___",Da="_launchpad_isPinned",Au="_launchpad_pinnedPosition",Pu="_launchpad_allowDocking",Tu="_launchpad_minimizeToTray",_u="_launchpad_autoCloseStartingAppsAndWorkspaces",Du="_launchpad_showTutorialOnStartup",Mu="_layouts_restoreLastSaved",Lu="_layouts_saveCurrentOnExit",Ru="_layouts_showUnsavedChangesPrompt",Fu="_layouts_showDeletePrompt",Bu="_downloads_askForEachDownload",Hu="_widget_enableForExternalApps",gm={_launchpad_collapsedSections:[],_launchpad_favorites:[],_launchpad_isLayoutsPanelOpen:!1,_launchpad_isCollapsed:!1,[Da]:!1,[Au]:"Left",[Pu]:!0,[Tu]:!1,[_u]:!0,[Du]:!0,[Mu]:!0,[Lu]:!0,[Ru]:!0,[Fu]:!0,[Bu]:!0,_downloads_location:"",_system_scheduleRestart:!1,_system_scheduleRestartTime:"12:00 AM",_system_scheduleRestartFrequency:"daily",_system_scheduleRestartDay:"Monday",_system_scheduleShutdown:!1,_system_scheduleShutdownTime:"12:00 AM",_system_scheduleShutdownFrequency:"daily",_system_scheduleShutdownDay:"Monday",[Hu]:!0},zn=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),ms={SUCCESS:"success",WARNING:"warning"},vm={success:5e3,warning:1e4};var ht=function(t){return{ok:!0,result:t}},it=function(t){return{ok:!1,error:t}},Mc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:ht(t(n.result,e.result))},ea=function(t,n){return n.ok===!0?n:it(t(n.error))},Ma=function(){return Ma=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ma.apply(this,arguments)};function La(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!La(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!La(t[o[e]],n[o[e]]))return!1;return!0}}var Ko=function(t){return Array.isArray(t)},Nr=function(t){return typeof t=="object"&&t!==null&&!Ko(t)},sn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Fo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Bo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ma({at:t+(e||"")},o)},ct=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ea(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(e.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?ht(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?ht(n):it({message:sn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?ht(n):it({message:sn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?ht(n):it({message:sn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return La(e,n)?ht(n):it({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Nr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?it({message:"the key '"+r+"' is required but was not present"}):it(Bo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return ht(o)}return Nr(e)?ht(e):it({message:sn("an object",e)})})},t.array=function(n){return new t(function(e){return Ko(e)&&n?e.reduce(function(o,r,i){return Mc(function(a,c){return a.concat([c])},o,function(a,c){return ea(function(l){return Bo("["+c+"]",l)},n.decode(a))}(r,i))},ht([])):Ko(e)?ht(e):it({message:sn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Ko(e)){if(e.length!==n.length)return it({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return it(Bo("["+r+"]",i.error));o[r]=i.result}return ht(o)}return it({message:sn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Mc(Object.assign,a,c.decode(i))},ht({}))})},t.anyJson=function(){return new t(function(n){return ht(n)})},t.unknownJson=function(){return new t(function(n){return ht(n)})},t.dict=function(n){return new t(function(e){if(Nr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return it(Bo("."+r,i.error));o[r]=i.result}return ht(o)}return it({message:sn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?ht(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return it({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return ht(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return it({at:Fo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Nr(r))return it({at:Fo(n.slice(0,i+1)),message:sn("an object",r)});if(typeof n[i]=="number"&&!Ko(r))return it({at:Fo(n.slice(0,i+1)),message:sn("an array",r)});r=r[n[i]]}return ea(function(a){return r===void 0?{at:Fo(n),message:"path does not exist"}:Bo(Fo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return ht(n)})},t.fail=function(n){return new t(function(e){return it({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),zu=ct.string;ct.number;var Ot=ct.boolean,Wu=ct.anyJson;ct.unknownJson;var M=ct.constant,$u=ct.object,Ra=ct.array;ct.tuple,ct.dict;var $e=ct.optional,ji=ct.oneOf;ct.union,ct.intersection,ct.withDefault,ct.valueAt,ct.succeed,ct.fail,ct.lazy;const Lc=["name","title","version","customProperties","icon","caption","type"],ym=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var mt=function(t){return{ok:!0,result:t}},at=function(t){return{ok:!1,error:t}},Rc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:mt(t(n.result,e.result))},ta=function(t,n){return n.ok===!0?n:at(t(n.error))},Fa=function(){return Fa=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Fa.apply(this,arguments)};function Ba(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Ba(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Ba(t[o[e]],n[o[e]]))return!1;return!0}}var qo=function(t){return Array.isArray(t)},Ir=function(t){return typeof t=="object"&&t!==null&&!qo(t)},cn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Ho=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},zo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Fa({at:t+(e||"")},o)},lt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ta(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(e.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?mt(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?mt(n):at({message:cn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?mt(n):at({message:cn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?mt(n):at({message:cn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Ba(e,n)?mt(n):at({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Ir(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?at({message:"the key '"+r+"' is required but was not present"}):at(zo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return mt(o)}return Ir(e)?mt(e):at({message:cn("an object",e)})})},t.array=function(n){return new t(function(e){return qo(e)&&n?e.reduce(function(o,r,i){return Rc(function(a,c){return a.concat([c])},o,function(a,c){return ta(function(l){return zo("["+c+"]",l)},n.decode(a))}(r,i))},mt([])):qo(e)?mt(e):at({message:cn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(qo(e)){if(e.length!==n.length)return at({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return at(zo("["+r+"]",i.error));o[r]=i.result}return mt(o)}return at({message:cn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Rc(Object.assign,a,c.decode(i))},mt({}))})},t.anyJson=function(){return new t(function(n){return mt(n)})},t.unknownJson=function(){return new t(function(n){return mt(n)})},t.dict=function(n){return new t(function(e){if(Ir(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return at(zo("."+r,i.error));o[r]=i.result}return mt(o)}return at({message:cn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?mt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return at({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return mt(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return at({at:Ho(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Ir(r))return at({at:Ho(n.slice(0,i+1)),message:cn("an object",r)});if(typeof n[i]=="number"&&!qo(r))return at({at:Ho(n.slice(0,i+1)),message:cn("an array",r)});r=r[n[i]]}return ta(function(a){return r===void 0?{at:Ho(n),message:"path does not exist"}:zo(Ho(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return mt(n)})},t.fail=function(n){return new t(function(e){return at({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),sr=lt.string,Ha=lt.number,bm=lt.boolean,eo=lt.anyJson;lt.unknownJson;var Wo=lt.constant,bt=lt.object,rt=lt.array;lt.tuple;var za=lt.dict,ce=lt.optional,Uu=lt.oneOf;lt.union,lt.intersection,lt.withDefault,lt.valueAt,lt.succeed,lt.fail,lt.lazy;const we=sr().where(t=>t.length>0,"Expected a non-empty string"),Wa=Ha().where(t=>t>=0,"Expected a non-negative number"),Vu=bt({name:we,displayName:ce(sr()),contexts:ce(rt(sr())),customConfig:ce(bt())}),wm=Uu(Wo("web"),Wo("native"),Wo("citrix"),Wo("onlineNative"),Wo("other")),Gu=bt({url:we}),Yu=bt({src:we,size:ce(we),type:ce(we)}),Zu=bt({src:we,size:ce(we),type:ce(we),label:ce(we)}),xm=bt({contexts:rt(we),displayName:ce(we),resultType:ce(we),customConfig:ce(eo())}),Cm=bt({listensFor:ce(za(xm)),raises:ce(za(rt(we)))}),km=bt({broadcasts:ce(rt(we)),listensFor:ce(rt(we))}),Em=bt({name:we,description:ce(we),broadcasts:ce(rt(we)),listensFor:ce(rt(we))}),Ku=bt({intents:ce(Cm),userChannels:ce(km),appChannels:ce(rt(Em))}),Sm=bt({url:ce(we),top:ce(Ha()),left:ce(Ha()),width:ce(Wa),height:ce(Wa)}),jm=bt({name:ce(we),type:ce(we.where(t=>t==="window","Expected a value of window")),title:ce(we),version:ce(we),customProperties:ce(eo()),icon:ce(sr()),caption:ce(sr()),details:ce(Sm),intents:ce(rt(Vu)),hidden:ce(bm())}),qu=bt({name:we,appId:we,title:ce(we),version:ce(we),manifest:we,manifestType:we,tooltip:ce(we),description:ce(we),contactEmail:ce(we),supportEmail:ce(we),publisher:ce(we),images:ce(rt(bt({url:ce(we)}))),icons:ce(rt(bt({icon:ce(we)}))),customConfig:eo(),intents:ce(rt(Vu))}),Om=bt({appId:ce(we),name:ce(we),details:ce(Gu),version:ce(we),title:ce(we),tooltip:ce(we),lang:ce(we),description:ce(we),categories:ce(rt(we)),icons:ce(rt(Yu)),screenshots:ce(rt(Zu)),contactEmail:ce(we),supportEmail:ce(we),moreInfo:ce(we),publisher:ce(we),customConfig:ce(rt(eo())),hostManifests:ce(eo()),interop:ce(Ku)}),Ju=bt({appId:we,name:we,type:wm,details:Gu,version:ce(we),title:ce(we),tooltip:ce(we),lang:ce(we),description:ce(we),categories:ce(rt(we)),icons:ce(rt(Yu)),screenshots:ce(rt(Zu)),contactEmail:ce(we),supportEmail:ce(we),moreInfo:ce(we),publisher:ce(we),customConfig:ce(rt(eo())),hostManifests:ce(eo()),interop:ce(Ku),localizedVersions:ce(za(Om))}),$r=Uu(qu,Ju),Ar=t=>`${t.kind} at ${t.at}: ${JSON.stringify(t.input)}. Reason - ${t.message}`;class Nm{constructor(){At(this,"fdc3ToDesktopDefinitionType",{web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"})}toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(n){const e=$r.run(n);return e.ok?n.appId&&n.details?{isFdc3:!0,version:"2.0"}:n.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:Ar(e.error)}}parseToBrowserBaseAppData(n){var p,f;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=$r.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Ar(r.error)}`);const i=this.getUserPropertiesFromDefinition(n,o),a={url:this.getUrl(n,o)},c={name:n.appId,type:"window",createOptions:a,userProperties:{...i,intents:o==="1.2"?i.intents:this.getIntentsFromV2AppDefinition(n),details:a},title:n.title,version:n.version,icon:this.getIconFromDefinition(n,o),caption:n.description,fdc3:o==="2.0"?{...n,definitionVersion:"2.0"}:void 0},l=((p=n.hostManifests)==null?void 0:p.ioConnect)||((f=n.hostManifests)==null?void 0:f.Glue42);if(!l)return c;const u=jm.run(l);if(!u.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Ar(u.error)}`);return Object.keys(u.result).length?this.mergeBaseAppDataWithGlueManifest(c,u.result):c}parseToDesktopAppConfig(n){var l,u,p;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=$r.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Ar(r.error)}`);if(o==="1.2"){const f=n;return{name:f.appId,type:"window",details:{url:this.getUrl(n,o)},version:f.version,title:f.title,tooltip:f.tooltip,caption:f.description,icon:(l=f.icons)==null?void 0:l[0].icon,intents:f.intents,customProperties:{manifestType:f.manifestType,images:f.images,contactEmail:f.contactEmail,supportEmail:f.supportEmail,publisher:f.publisher,icons:f.icons,customConfig:f.customConfig}}}const i=n,a={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},c=((u=n.hostManifests)==null?void 0:u.ioConnect)||((p=n.hostManifests)==null?void 0:p.Glue42);if(!c)return a;if(typeof c!="object"||Array.isArray(c))throw new Error(`Invalid '${n.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(a,c)}getUserPropertiesFromDefinition(n,e){return Object.fromEntries(e==="1.2"?Object.entries(n).filter(([o])=>!Lc.includes(o)):Object.entries(n).filter(([o])=>!Lc.includes(o)&&!ym.includes(o)))}getUrl(n,e){var r,i;let o;if(e==="1.2"){const a=JSON.parse(n.manifest);o=((r=a.details)==null?void 0:r.url)||a.url}else o=(i=n.details)==null?void 0:i.url;if(!o||typeof o!="string")throw new Error(`Invalid FDC3 ${e} definition. Provide valid 'url' under '${e==="1.2"?"manifest":"details"}' key`);return o}getIntentsFromV2AppDefinition(n){var o,r;const e=(r=(o=n.interop)==null?void 0:o.intents)==null?void 0:r.listensFor;if(e)return Object.entries(e).map(i=>{const[a,c]=i;return{name:a,...c}})}getIconFromDefinition(n,e){var o,r,i,a;return e==="1.2"?((r=(o=n.icons)==null?void 0:o.find(c=>c.icon))==null?void 0:r.icon)||void 0:((a=(i=n.icons)==null?void 0:i.find(c=>c.src))==null?void 0:a.src)||void 0}mergeBaseAppDataWithGlueManifest(n,e){let o=n;if(e.customProperties&&(o.userProperties={...n.userProperties,...e.customProperties}),e.details){const r={...n.createOptions,...e.details};o.createOptions=r,o.userProperties.details=r}return Array.isArray(e.intents)&&(o.userProperties.intents=(o.userProperties.intents||[]).concat(e.intents)),o={...o,...e},delete o.details,delete o.intents,o}mergeDesktopConfigWithGlueManifest(n,e){const o=Object.assign({},n,e,{details:{...n.details,...e.details}});return Array.isArray(e.intents)&&(o.intents=(n.intents||[]).concat(e.intents)),o}}const Im={common:{nonEmptyStringDecoder:we,nonNegativeNumberDecoder:Wa},fdc3:{allDefinitionsDecoder:$r,v1DefinitionDecoder:qu,v2DefinitionDecoder:Ju}};var $a;(function(t){t.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",t.CALLER_NOT_DEFINED="Caller Id is not defined",t.TIMEOUT_HIT="Timeout hit",t.INTENT_NOT_FOUND="Cannot find Intent",t.HANDLER_NOT_FOUND="Cannot find Intent Handler",t.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",t.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",t.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",t.RESOLVER_TIMEOUT="User did not choose a handler",t.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",t.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"})($a||($a={}));const gs=new class{constructor(){At(this,"_fdc3");At(this,"_decoders",Im);At(this,"_errors",{intents:$a})}get fdc3(){return this._fdc3||(this._fdc3=new Nm().toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};gs.fdc3;const Am=gs.decoders;gs.errors;const Gn=Am.common.nonEmptyStringDecoder,Pm=ji(M("add"),M("align-bottom"),M("align-bottom-solid"),M("align-left"),M("align-left-bottom"),M("align-left-bottom-solid"),M("align-left-solid"),M("align-left-top"),M("align-left-top-solid"),M("align-right"),M("align-right-bottom"),M("align-right-bottom-solid"),M("align-right-solid"),M("align-right-top"),M("align-right-top-solid"),M("align-top"),M("align-top-solid"),M("always-on-top"),M("always-on-top-on"),M("application"),M("arrow-down-long"),M("arrow-down-to-bracket"),M("arrow-left-long"),M("arrow-right-from-bracket"),M("arrow-right-long"),M("arrow-right"),M("arrow-up"),M("arrow-up-long"),M("ban"),M("bell"),M("bell-solid"),M("bookmark"),M("bullseye-pointer"),M("certificate"),M("check"),M("check-light"),M("check-solid"),M("chevron-down"),M("chevron-left"),M("chevron-right"),M("chevron-up"),M("circle-info"),M("circle-xmark"),M("circle-xmark-full"),M("clock"),M("clock-rotate-left"),M("clone"),M("close"),M("cog"),M("cog-solid"),M("collapse"),M("copy"),M("download"),M("delete-left"),M("dev-tools"),M("ellipsis"),M("ellipsis-vertical"),M("expand"),M("envelope"),M("envelope-open"),M("exclamation-mark"),M("expand"),M("feedback"),M("filter"),M("floppy"),M("floppy-disk-pen"),M("folder"),M("folder-open"),M("globe"),M("group"),M("hidden"),M("home"),M("house"),M("info"),M("keyboard"),M("layout"),M("link"),M("list-ul"),M("lock"),M("logo"),M("minimize"),M("minimize-down"),M("paper-plane-top"),M("paperclip"),M("pause"),M("pen-line"),M("pen-to-square"),M("pin"),M("play"),M("pop-in"),M("pop-in-widget"),M("pop-out"),M("power-off"),M("publish"),M("refresh"),M("resize"),M("restore"),M("rotate-right"),M("search"),M("search-filled"),M("sliders"),M("snooze"),M("spinner"),M("square"),M("square-arrow-down"),M("square-arrow-up"),M("star"),M("star-full"),M("sticky-off"),M("sticky-off-hover"),M("sticky-on"),M("sticky-on-hover"),M("subscribe"),M("system-close"),M("system-maximize"),M("system-minimize"),M("thumbs-down"),M("thumbs-up"),M("trash"),M("trash-can"),M("triangle-exclamation"),M("unlock"),M("unpin"),M("up-to-line"),M("user"),M("user-gear"),M("visible"),M("workspace")),Tm=$u({id:Gn,title:Gn,description:$e(zu()),icon:$e(Pm),iconSrc:$e(Gn),contextMenuActions:$e(Ra(Wu())),type:Gn}),_m=ji(M("Left"),M("Right")),Fc=ji(M("daily"),M("weekly")),Bc=ji(M("Sunday"),M("Monday"),M("Tuesday"),M("Wednesday"),M("Thursday"),M("Friday"),M("Saturday")),Ur=$u({customPrefs:$e(Wu()),_launchpad_collapsedSections:$e(Ra(Gn)),_launchpad_favorites:$e(Ra(Tm)),_launchpad_isLayoutsPanelOpen:$e(Ot()),_launchpad_isCollapsed:$e(Ot()),_launchpad_isPinned:$e(Ot()),_launchpad_pinnedPosition:$e(_m),_launchpad_allowDocking:$e(Ot()),_launchpad_minimizeToTray:$e(Ot()),_launchpad_autoCloseStartingAppsAndWorkspaces:$e(Ot()),_launchpad_showTutorialOnStartup:$e(Ot()),_layouts_restoreLastSaved:$e(Ot()),_layouts_saveCurrentOnExit:$e(Ot()),_layouts_showUnsavedChangesPrompt:$e(Ot()),_layouts_showDeletePrompt:$e(Ot()),_downloads_askForEachDownload:$e(Ot()),_downloads_location:$e(zu()),_system_scheduleRestart:$e(Ot()),_system_scheduleRestartTime:$e(Gn),_system_scheduleRestartFrequency:$e(Fc),_system_scheduleRestartDay:$e(Bc),_system_scheduleShutdown:$e(Ot()),_system_scheduleShutdownTime:$e(Gn),_system_scheduleShutdownFrequency:$e(Fc),_system_scheduleShutdownDay:$e(Bc),_widget_enableForExternalApps:$e(Ot())}),Xu=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=zn(r);try{if(e===ms.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n)||!n.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:vm[e]};await n.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},vs=v.createContext(void 0),Oi=({children:t,launchpadMode:n})=>{const[e,o]=v.useState(),[r,i]=v.useState(!1),[a,c]=v.useState(),l=v.useContext(_e.IOConnectContext),u=v.useMemo(()=>({prefs:e,isInitialSetupCompleted:r,initialSetupError:a}),[e,r,a]);return v.useEffect(()=>{if(!l)return;let p=!1;const f=l.contexts.subscribe(Hn,d=>{if(p)return;const h=Ur.run(d);if(!h.ok)return void l.logger.warn(`The received data for context ${Hn} is with an invalid shape: ${zn(h.error.message)}`);const m=h.result;o(m),l.prefs.updateFor(Dc,m).catch(g=>{l.logger.warn(`Failed to update platform prefs. Error: ${zn(g)}`)})});return()=>{p=!0,f.then(d=>{d()})}},[l]),v.useEffect(()=>{l&&(async()=>{var p;try{const f=await l.contexts.get(Hn),d=Ur.run(f);if(!d.ok)throw new Error(`The data in context ${Hn} is with an invalid shape: ${zn(d.error.message)}`);const h=d.result;if(Object.keys(h).length>0)return;const m=((p=await l.prefs.get(Dc))==null?void 0:p.data)??{},g=Ur.run(m);if(!g.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${zn(g.error.message)}`);const y={[Da]:n==="pinned"||(m[Da]??!1)},w={...gm,...g.result,...y};await l.contexts.set(Hn,w)}catch(f){c({message:zn(f)}),await Xu({io:l,variant:ms.WARNING,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[l,n]),s.jsx(vs.Provider,{value:u,children:t})};function Qu(){const t=v.useContext(vs);if(t===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return t}function Ht({prefKey:t}){var f;const n=v.useContext(_e.IOConnectContext),e=v.useContext(vs),o=(f=e==null?void 0:e.prefs)==null?void 0:f[t],r=(e==null?void 0:e.isInitialSetupCompleted)??!1,[i,a]=v.useState(!r),[c,l]=v.useState(),u=v.useRef(0);v.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const p=v.useCallback(async d=>{if(!n)return;const h=++u.current;a(!0),l(void 0);const m=async y=>{y&&await Xu({io:n,variant:ms.WARNING,text:`Failed to update prefKey "${t}".`,error:y}),h===u.current&&(a(!1),y&&l({message:zn(y)}))};let g;if(d instanceof Function)try{g=d((await n.contexts.get(Hn))[t])}catch(y){return m(y)}else g=d;try{const y=Ur.runWithException({[t]:g});await n.contexts.update(Hn,y)}catch(y){return m(y)}await m()},[n,t]);if(e===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:c,isLoading:i,update:p,value:o}}function Hc(t,n,e){return Math.min(Math.max(t,e),n)}class Dm extends Error{constructor(n){super(`Failed to parse color: "${n}"`)}}var $o=Dm;function Mm(t){if(typeof t!="string")throw new $o(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let n=t.trim();n=zm.test(t)?function(a){const c=a.toLowerCase().trim(),l=Lm[function(u){let p=5381,f=u.length;for(;f;)p=33*p^u.charCodeAt(--f);return(p>>>0)%2341}(c)];if(!l)throw new $o(a);return`#${l}`}(t):t;const e=Rm.exec(n);if(e){const a=Array.from(e).slice(1);return[...a.slice(0,3).map(c=>parseInt(cr(c,2),16)),parseInt(cr(a[3]||"f",2),16)/255]}const o=Fm.exec(n);if(o){const a=Array.from(o).slice(1);return[...a.slice(0,3).map(c=>parseInt(c,16)),parseInt(a[3]||"ff",16)/255]}const r=Bm.exec(n);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(c=>parseInt(c,10)),parseFloat(a[3]||"1")]}const i=Hm.exec(n);if(i){const[a,c,l,u]=Array.from(i).slice(1).map(parseFloat);if(Hc(0,100,c)!==c)throw new $o(t);if(Hc(0,100,l)!==l)throw new $o(t);return[...Wm(a,c,l),Number.isNaN(u)?1:u]}throw new $o(t)}const zc=t=>parseInt(t.replace(/_/g,""),36),Lm="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const e=zc(n.substring(0,3)),o=zc(n.substring(3)).toString(16);let r="";for(let i=0;i<6-o.length;i++)r+="0";return t[e]=`${r}${o}`,t},{}),cr=(t,n)=>Array.from(Array(n)).map(()=>t).join(""),Rm=new RegExp(`^#${cr("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Fm=new RegExp(`^#${cr("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Bm=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${cr(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Hm=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,zm=/^[a-z]+$/i,Wc=t=>Math.round(255*t),Wm=(t,n,e)=>{let o=e/100;if(n===0)return[o,o,o].map(Wc);const r=(t%360+360)%360/60,i=(1-Math.abs(2*o-1))*(n/100),a=i*(1-Math.abs(r%2-1));let c=0,l=0,u=0;r>=0&&r<1?(c=i,l=a):r>=1&&r<2?(c=a,l=i):r>=2&&r<3?(l=i,u=a):r>=3&&r<4?(l=a,u=i):r>=4&&r<5?(c=a,u=i):r>=5&&r<6&&(c=i,u=a);const p=o-i/2;return[c+p,l+p,u+p].map(Wc)};function $m(t){return function(n){if(n==="transparent")return 0;function e(a){const c=a/255;return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)}const[o,r,i]=Mm(n);return .2126*e(o)+.7152*e(r)+.0722*e(i)}(t)>.179}function Um({className:t,channel:n,...e}){const o=K("io-channel-badge",t);return s.jsx("div",{className:o,style:{color:(r=n.color,$m(r)?"#000":"#fff"),backgroundColor:n.color},...e,children:s.jsx("span",{className:"io-channel-badge-label",children:n.label})});var r}function Vm(){return s.jsx(Xe,{variant:"check"})}function Gm({channel:t,handleChannelRestricted:n,restricted:e}){return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:t.isSelected&&s.jsx("span",{children:"Active"})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Publish",checked:t.write,onChange:()=>{n({...t,write:!t.write})},disabled:e==null?void 0:e.write})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Subscribe",checked:t.read,onChange:()=>{n({...t,read:!t.read})},disabled:e==null?void 0:e.read})})]})}const ed=v.createContext({});function Ym({channel:t,isSelected:n,onChannelSelect:e,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,restrictedChannels:c}=v.useContext(ed),l=n||t.isSelected||(a==null?void 0:a.includes(t)),u=c==null?void 0:c.find(d=>d.name===t.name),p=v.useCallback(()=>e==null?void 0:e({...t,isSelected:!l}),[t,e,l]),f=v.useCallback(d=>{o&&o(d)},[o]);return s.jsx(Kr,{prepend:s.jsx(Um,{channel:t}),append:i==="single"||i==="multi"?l&&s.jsx(Vm,{}):s.jsx(Gm,{channel:t,handleChannelRestricted:f,restricted:u}),isSelected:l,onClick:p,...r,children:t.name},t.name)}const Zm=v.forwardRef(({className:t,variant:n="single",variantToggle:e=!1,channels:o=[],restrictedChannels:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:c,...l},u)=>{const p=K("io-list-channels",n==="directionalSingle"&&"io-bi-direction",t),f=o.filter(m=>m.isSelected),d=v.useMemo(()=>({variant:n,selectedChannels:f,restrictedChannels:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:c}),[n,f,r,i,a,c]);let h="Select Channel";return n==="multi"?h="Select Channels":n==="directionalSingle"&&(h="Select Directional Channel"),s.jsx(ed.Provider,{value:d,children:s.jsx("div",{className:p,ref:u,children:s.jsxs(ut,{variant:"single",...l,children:[s.jsx(ut.ItemTitle,{append:e&&s.jsx(ft,{label:"Directional",align:"right",onChange:m=>i&&i(m.target.checked),checked:n==="directionalSingle"}),children:h}),o==null?void 0:o.map(m=>s.jsx(Ym,{channel:m,onChannelSelect:a,onChannelRestrict:c},m.name))]})})})});Zm.displayName="ChannelSelector";v.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function Km({title:t="Downloads"}){const{ItemSearch:n,HeaderButtons:e}=Ni();return s.jsxs("div",{className:"io-dm-header",children:[s.jsxs(Ft,{children:[s.jsx(Ft.Title,{tag:"h1",text:t,size:"large"}),s.jsx(e,{})]}),s.jsx(n,{})]})}const qm=v.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),Pn=()=>v.useContext(qm);function Jm({className:t,icon:n="search",placeholder:e="Search",...o}){const r=K("io-header-search",t),i=v.useRef(null),{searchQuery:a,setSearch:c,itemsCount:l}=Pn();return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:i,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-header-search-count",children:`${l} results`})]})}function Xm({className:t,...n}){const{SettingsButton:e,MoreButton:o}=Ni();return s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(e,{}),s.jsx(o,{})]})}function Qm({icon:t="cog",...n}){const{showSettings:e}=Pn();return s.jsx(Ue,{icon:t,variant:"circle",size:"32",onClick:e,...n})}function eg({icon:t="ellipsis",...n}){const{items:e,clearItems:o}=Pn(),r=e.length===0;return s.jsxs(ae,{variant:"light",...n,children:[s.jsx(ae.ButtonIcon,{icon:t,variant:"circle",size:"32"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:s.jsx(ae.Item,{disabled:r,onClick:i=>(a=>{r?a.stopPropagation():o()})(i),children:"Clear All"})})})]})}function ao(t,n=!1,e=!1,o=!1){const r=t.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],a=t.getFullYear(),c=t.getHours(),l=t.getMinutes();let u="";return u=l<10?`0${l}`:`${l}`,n?n==="Today"?e?"Today":`Today at ${c}:${u}`:n==="Yesterday"?e?"Yesterday":`Yesterday at ${c}:${u}`:`${c}:${u}`:o?e?`${i} ${r}`:`${i} ${r} at ${c}:${u}`:e?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${c}:${u}`}function td(t,n={showTime:!0}){const e=new Date(1e3*t),o=new Date,r=Math.round((o-e)/1e3),i=Math.round(r/60),a=o.toDateString()===e.toDateString(),c=new Date(o.setDate(o.getDate()-1)).toDateString()===e.toDateString(),l=o.getFullYear()===e.getFullYear();return n.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?ao(e,"Today",!1,!0):c?ao(e,"Yesterday",!1,!0):l?ao(e,!1,!1,!0):ao(e):a?"Today":c?"Yesterday":l?ao(e,!1,!0,!0):ao(e,!1,!0)}function tg({className:t,...n}){const e=K("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:i}=Ni(),{items:a,searchQuery:c,setCount:l,sortItems:u}=Pn(),p=u(a),f=Iu(c),d=v.useMemo(()=>p.filter(g=>g.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||g.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[p,f]),h=v.useMemo(()=>d.map(g=>({...g,displayInfo:{...g.displayInfo,startTime:td(g.displayInfo.startTime,{showTime:!1})}})),[d]),m=v.useMemo(()=>Object.values(h.reduce((g={},y)=>{var w;return g[y.displayInfo.startTime]=((w=g[y.displayInfo.startTime])==null?void 0:w.concat([]))??[],g[y.displayInfo.startTime].push(y),g},{})),[h]);return v.useEffect(()=>{l(d.length)},[d,l]),s.jsx("div",{className:e,...n,children:m&&m.length!==0?m.map(g=>s.jsx(r,{title:String(g[0].displayInfo.startTime)??null,children:g.map(y=>s.jsx(i,{item:y},y.id))},g[0].id??"")):s.jsx(o,{})})}function ng({className:t,icon:n="download",text:e="No downloads to display.",...o}){const r=K("io-dm-no-items",t);return s.jsxs("div",{className:r,...o,children:[s.jsx(Xe,{variant:n}),s.jsx("p",{children:e})]})}function og({className:t,title:n,children:e,...o}){const r=K("io-dm-item-group",t);return s.jsxs("div",{className:r,...o,children:[n&&s.jsx("p",{children:n}),e]})}function rg({className:t,item:n,...e}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=Ni(),{state:a,url:c,filename:l,receivedBytes:u,totalBytes:p,speed:f,timeRemaining:d}=n.displayInfo;if(!n)return s.jsx(s.Fragment,{});const h=K("io-dm-item",n.displayInfo.state&&[a],t);return s.jsxs("div",{className:h,...e,children:[s.jsx(o,{itemID:n.id,filename:l,state:a}),s.jsx(r,{state:a,url:c,bytesReceived:u,bytesTotal:p,speed:f,timeRemaining:d}),s.jsx(i,{itemID:n.id,state:a})]})}function nd({bytesReceived:t=0,bytesTotal:n=0,...e}){const o=v.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return s.jsx(fm,{value:o(),...e})}function ig({className:t,itemID:n,filename:e,state:o,cancel:r,remove:i,...a}){const c=K("io-dm-item-header",t),{cancelItem:l,removeItem:u}=Pn(),p=v.useCallback(d=>{r?r(d):l(d)},[r,l]),f=v.useCallback(d=>{i?i(d):u(d)},[i,u]);return s.jsxs("div",{className:c,...a,children:[s.jsx(nn,{text:e,style:{textDecoration:o==="interrupted"||o==="cancelled"?"line-through":"none"}}),s.jsx(Ue,{icon:"close",onClick:()=>{o==="progressing"||o==="paused"?p(n):f(n)}})]})}function ag({className:t,state:n,url:e,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...c}){const l=K("io-dm-item-body",t),u=d=>{const h=["Bytes","KB","MB","GB","TB"];if(d===0)return"0";const m=Math.floor(Math.log(d)/Math.log(1024));return m===0?`${d}${h[m]}`:`${(d/1024**m).toFixed(1)}${h[m]}`};return s.jsxs("div",{className:l,...c,children:[s.jsx("p",{className:"io-text-small",children:e}),(f=n,f==="cancelled"||f==="interrupted"||f==="completed"?null:s.jsx(nd,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),s.jsx("p",{className:"io-text-default-lh16",children:n==="completed"?`${u(o??0)} - Done`:n==="cancelled"||n==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${p=i,(p?`${(p/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(d=>{const h=Math.floor(d/3600),m=Math.floor(d%3600/60);let g="";return h>0&&(g+=`${h} hour${h>1?"s":""}, `),m>0&&(g+=`${m} min${m>1?"s":""}, `),((d=Math.floor(d%60))>0||g==="")&&(g+=`${d} sec${d!==1?"s":""}`),`${g.trim()} left`})(a)??0}`})]});var p,f}const sg={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function na({className:t,variant:n,text:e}){const o=K("io-dm-item-status",`io-dm-item-status-${n}`,t);return s.jsxs("div",{className:o,children:[n&&s.jsx(Xe,{variant:sg[n],className:"icon-severity"}),e&&s.jsx("p",{className:"io-text-smaller",children:e})]})}function cg({className:t,itemID:n,state:e,pauseResume:o,showInFolder:r,cancel:i,...a}){const c=K("io-dm-item-footer",t),{pauseResumeItem:l,showItemInFolder:u,cancelItem:p}=Pn(),f=v.useCallback(m=>{o?o(m):l(m)},[o,l]),d=v.useCallback(m=>{r?r(m):u(m)},[r,u]),h=v.useCallback(m=>{i?i(m):p(m)},[i,p]);return s.jsx("div",{className:c,...a,children:(()=>{switch(e){case"progressing":return s.jsxs(Re,{align:"right",children:[s.jsx(Re.Button,{variant:"primary",text:"Pause",onClick:()=>f(n)}),s.jsx(Re.Button,{variant:"link",text:"Cancel",onClick:()=>h(n)})]});case"paused":return s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Resume",onClick:()=>f(n)})});case"completed":return s.jsxs(s.Fragment,{children:[s.jsx(na,{variant:"success",text:"Complete"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Show in Folder",onClick:()=>d(n)})})]});case"cancelled":return s.jsx(s.Fragment,{children:s.jsx(na,{variant:"warning",text:"Cancelled"})});case"interrupted":return s.jsxs(s.Fragment,{children:[s.jsx(na,{variant:"critical",text:"Failed"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Retry",onClick:()=>f(n)})})]});default:return null}})()})}function lg({className:t,title:n="Settings",...e}){const o=K("io-dm-settings-panel",t),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:l,downloadLocationList:u}=Pn();return s.jsxs(Ke,{className:o,...e,children:[s.jsxs(Ke.Header,{children:[s.jsx(Ke.Header.Title,{size:"large",text:n,tag:"h1"}),s.jsx(Ke.Header.ButtonGroup,{children:s.jsx(Ue,{variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:l})})]}),s.jsx(Ke.Body,{children:s.jsxs(Re,{children:[s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{children:s.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&s.jsx(ae.Content,{children:s.jsx(ae.List,{children:u.map((p,f)=>!p||f===0||f>3?null:s.jsx(ae.Item,{onClick:()=>{a(p)},children:p},p))})})]}),s.jsx(Ge,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c()},disabled:l})]})})]})}const od={Header:Km,ItemSearch:Jm,HeaderButtons:Xm,SettingsButton:Qm,MoreButton:eg,Body:tg,DownloadListEmpty:ng,ItemGroup:og,Item:rg,ItemProgress:nd,ItemHeader:ig,ItemBody:ag,ItemFooter:cg,Settings:lg},rd=v.createContext(od),ug=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...od,...n}),[n]);return s.jsx(rd.Provider,{value:e,children:t})});ug.displayName="ComponentsStore";const Ni=()=>v.useContext(rd);function Ua(t){if(t&&t.errorHandling&&typeof t.errorHandling!="function"&&t.errorHandling!=="log"&&t.errorHandling!=="silent"&&t.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof t.errorHandling+" was passed");var n=t&&typeof t.errorHandling=="function"&&t.errorHandling,e={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(n)n(a);else{var c='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(t)switch(t.errorHandling){case"log":return console.error(c);case"silent":return;case"throw":throw new Error(c)}console.error(c)}}return{add:function(r,i,a){var c=e[r];return c||(c=[],e[r]=c),c.push(i),a&&setTimeout(function(){a.forEach(function(l){var u;if(!((u=e[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(l)?i.apply(void 0,l):i.apply(void 0,[l])}catch(p){o(p,r)}})},0),function(){var l=e[r];l&&(l=l.reduce(function(u,p,f){return p===i&&u.length===f||u.push(p),u},[]),l.length===0?delete e[r]:e[r]=l)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var c=e[r];if(!c||c.length===0)return[];var l=[];return c.forEach(function(u){try{var p=u.apply(void 0,i);l.push(p)}catch(f){l.push(void 0),o(f,r)}}),l},clear:function(){e={}},clearKey:function(r){e[r]&&delete e[r]}}}Ua.default=Ua;var dg=zl(Ua);const fg=v.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:t=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:t=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Xt=()=>v.useContext(fg);function pg({...t}){const{config:n,close:e}=Xt(),{applicationTitle:o}=n;return s.jsxs(Ft,{draggable:!0,...t,children:[s.jsx(Ft.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),s.jsx(Ft.ButtonGroup,{className:"non-draggable",children:s.jsx(Ft.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>e()})})]})}function hg({className:t,handleSubmit:n,...e}){const o=K("io-panel-body",t),{config:r,submitFeedback:i}=Xt(),{IntroField:a,DescriptionField:c,TechInfoField:l,EnvInfoField:u,FileAttachmentsField:p,CategoryAttachmentsField:f,SettingsField:d,MailListField:h}=Ii(),m=n??i,g=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return s.jsxs("form",{className:o,id:"feedback",onSubmit:y=>m(y),...e,children:[s.jsx(a,{children:s.jsx("p",{children:g})}),s.jsx(d,{}),s.jsx(h,{}),s.jsx(c,{}),s.jsx(l,{readOnly:!0}),s.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?s.jsx(p,{}):s.jsx(f,{})]})}function mg({...t}){const{FooterButtons:n}=Ii(),{openUrl:e,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Xt();return s.jsx(Vn,{...t,children:s.jsxs("div",o?{className:"flex ai-center jc-between",children:[s.jsx(Ye,{children:s.jsx("p",{children:r.title})}),s.jsx(dm,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[s.jsxs(Ye,{children:[s.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&s.jsx("a",{href:i,onClick:a=>{a.preventDefault(),e(i)},children:i})]}),s.jsx(n,{})]})})}function gg({className:t,...n}){const{CloseButton:e}=Ii(),{close:o}=Xt();return s.jsx(Re,{className:t,...n,children:s.jsx(e,{onClick:()=>o()})})}function vg({className:t,...n}){const{SubmitButton:e,CancelButton:o,CloseButton:r}=Ii(),{close:i,submitCompleted:a}=Xt();return a?s.jsx(Re,{className:t,...n,children:s.jsx(r,{text:"Close",onClick:()=>i()})}):s.jsxs(Re,{className:t,...n,children:[s.jsx(e,{}),s.jsx(o,{onClick:()=>i()})]})}function yg({text:t="Submit",...n}){return s.jsx(Ge,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function bg({text:t="Cancel",...n}){return s.jsx(Ge,{variant:"link",text:t,...n})}function wg({...t}){return s.jsx(Ge,{variant:"primary",...t})}function xg({showField:t=!0,className:n,title:e,hint:o,children:r,...i}){return t?s.jsx(Ye,{className:n,title:e,hint:o,...i,children:r}):null}function Cg({showField:t=!0,className:n,title:e="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return t?s.jsx(Ye,{className:n,hint:o,title:"",...a,children:s.jsx(ki,{id:"description",name:"description",label:e,readOnly:r,disabled:i})}):null}function kg({showField:t,className:n,title:e="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.errorMessage,p=r??l.errorMessage;return u&&p?s.jsx(Ye,{className:n,hint:o,...c,children:s.jsx(ki,{id:"errorMessage",name:"errorMessage",label:e,value:p,readOnly:i,disabled:a})}):null}function Eg({showField:t,className:n,title:e="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.showEnvironmentInfo,p=r??l.environmentInfo;return u&&p?s.jsx(Ye,{className:n,hint:o,...c,children:s.jsx(ki,{id:"environmentInfo",name:"environmentInfo",label:e,value:p,readOnly:i,disabled:a})}):null}function Sg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:c,...l}){const u=K("io-block-list-gap",n),{config:p}=Xt(),f=a??p.attachments,d=c??p.selectedCategories,h=v.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!f||f.length<=0?s.jsx(Ye,{title:"Attachments",children:s.jsx("p",{children:"No Attachments"})}):s.jsx(Ye,{className:u,title:e,hint:o,...l,children:s.jsx("div",{className:"file-attachments",children:f.map(m=>s.jsx(Ei,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function jg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:c,...l}){const{config:u,attachmentCategories:p}=Xt(),f=a??p,d=c??u.selectedCategories,h=v.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!f||f.length<=0?s.jsx("p",{children:"No Attachments"}):s.jsx(Ye,{className:n,title:e,hint:o,...l,children:s.jsx("div",{className:"category-attachments",children:f.map(m=>s.jsx(ft,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function Og({className:t,title:n,hint:e,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:c="Send Email",readOnly:l=!1,disabled:u,...p}){const f=K("io-block-list-gap",t),{config:d,showMailingList:h,setShowMailingList:m}=Xt();if(!o)return null;const g=r??d.createJiraTicket,y=a??d.sendEmail;return s.jsxs(Ye,{className:f,hint:e,title:n,...p,children:[g&&s.jsx(ft,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:l,disabled:u,defaultChecked:g}),y&&s.jsx(ft,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:l,disabled:u,defaultChecked:y})]})}function Ng({showField:t=!0,className:n,title:e="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...c}){const{config:l,showMailingList:u}=Xt(),p=t??l.sendEmail,f=i??l.allowEditRecipients===!1;return p&&u?s.jsx(Ye,{className:n,hint:o,...c,children:s.jsx(Qn,{id:"mailingList",name:"mailingList",label:e,placeholder:r,readOnly:f,disabled:a,defaultValue:l.mailingList??""})}):null}const id={Header:pg,Body:hg,Footer:mg,HeaderButtons:gg,FooterButtons:vg,SubmitButton:yg,CancelButton:bg,CloseButton:wg,IntroField:xg,DescriptionField:Cg,TechInfoField:kg,EnvInfoField:Eg,FileAttachmentsField:Sg,CategoryAttachmentsField:jg,SettingsField:Og,MailListField:Ng},ad=v.createContext(id),Ig=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...id,...n}),[n]);return s.jsx(ad.Provider,{value:e,children:t})});function Ii(t){return{...v.useContext(ad),...t}}Ig.displayName="ComponentsStore";function sd({className:t,title:n="General",...e}){const o=K("io-notifications-settings-panel-general",t),{AllowNotifications:r,ShowNotificationBadge:i,CloseNotificationOnClick:a,PanelAutoHide:c,HideToastsAfter:l}=oo(),u=Be();return s.jsx("div",{className:o,...e,children:s.jsxs(Ye,{title:n,children:[u&&s.jsx(r,{}),s.jsx(i,{}),u&&s.jsx(a,{}),u&&s.jsx(c,{}),u&&s.jsx(l,{})]})})}var tt=new class{constructor(){At(this,"subscribed",!1);At(this,"io");At(this,"registry",dg());At(this,"logger");At(this,"isPanelVisible");At(this,"notifications",[]);At(this,"bulkActionsSupported",!1)}init(t){var r,i,a,c;if(this.subscribed)return;this.subscribed=!0,this.io=t,this.logger=this.io.logger.subLogger("notifications");const n=this.io.appManager.myApplication,e=((i=(r=n==null?void 0:n.userProperties)==null?void 0:r.logger)==null?void 0:i.publishLevel)??"error",o=((c=(a=n==null?void 0:n.userProperties)==null?void 0:a.logger)==null?void 0:c.consoleLevel)??"info";this.logger.publishLevel(e),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.7.0 ====="),this.getBulkActionsSupport(),this.subscribe()}onPanelVisibilityChanged(t){return this.registry.add("on-panel-visibility-changed",t)}onConfigurationChanged(t){return this.registry.add("on-configuration-changed",t)}onNotificationsChanged(t){return this.registry.add("on-notifications-changed",t)}onCounterChanged(t){return this.registry.add("on-counter-changed",t)}async getNotificationsList(){var n;const t=await((n=this.io)==null?void 0:n.notifications.list());if(!t)throw new Error("io.notifications.list is not supported in this environment.");return t.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.show()}hidePanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.hide()}clearAll(){var t,n;return(t=this.logger)==null||t.trace("clearing all notifications"),(n=this.io)==null?void 0:n.notifications.clearAll()}clearAllOld(){var t,n;return(t=this.logger)==null||t.trace("clearing all old notifications"),(n=this.io)==null?void 0:n.notifications.clearOld()}clearMany(t){var n,e,o,r;return typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"?t.length<1?((e=this.logger)==null||e.trace("no ids provided to clear notifications"),Promise.resolve()):((o=this.logger)==null||o.trace(`clearing notifications with ids ${JSON.stringify(t.join(", "))}`),((r=this.io)==null?void 0:r.notifications).clearMany(t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(t){var n,e;return(n=this.logger)==null||n.trace(`closing notification with id ${t}`),(e=this.io)==null?void 0:e.notifications.clear(t)}snooze(t,n){var e,o;return(e=this.logger)==null||e.trace(`snoozing notification with id ${t} for ${n}ms`),(o=this.io)==null?void 0:o.notifications.snooze(t,n)}snoozeMany(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).snoozeMany=="function"?t.length<1?((o=this.logger)==null||o.trace("no ids provided to snooze notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`snoozing notifications with ids ${JSON.stringify(t.join(", "))} for ${n}ms`),((i=this.io)==null?void 0:i.notifications).snoozeMany(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(t,n){var e,o;return(e=this.logger)==null||e.trace(`setting state of ${t} to ${n}`),(o=this.io)==null?void 0:o.notifications.setState(t,n)}setStates(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"?t.length<1?((o=this.logger)==null||o.trace(`no ids provided to change state to ${n} for notifications`),Promise.resolve()):((r=this.logger)==null||r.trace(`setting state of ${JSON.stringify(t.join(", "))} to ${n}`),((i=this.io)==null?void 0:i.notifications).setStates(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){var n,e,o;const t=typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"&&typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"&&typeof((o=this.io)==null?void 0:o.notifications).snoozeMany=="function";this.bulkActionsSupported=t}setFilter(t){var n,e;return(n=this.logger)==null||n.trace(`setting filter to ${JSON.stringify(t)}`),(e=this.io)==null?void 0:e.notifications.setFilter(t)}configure(t){var n;return(n=this.io)==null?void 0:n.notifications.configure(t)}subscribe(){var t,n,e,o,r,i,a;(t=this.io)==null||t.notifications.onRaised(c=>{var l;(l=this.logger)==null||l.trace(`received event indicating notification raise: ${JSON.stringify(c)}`),this.attachHandlers(c),this.notifications.unshift(c),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:c},l)=>{var u;(u=this.logger)==null||u.trace(`received event for notification state is changed - "${c}" - "${l==null?void 0:l.toString()}"`),this.notifications=this.notifications.map(p=>{var f;return p.id===c?((f=this.logger)==null||f.trace(`${p.id} - the state is changed from "${p.state}" to "${l==null?void 0:l.toString()}"`),Object.assign(p,{state:l})):p}),this.registry.execute("on-notifications-changed",this.notifications)}),(e=this.io)!=null&&e.notifications&&"onDataChanged"in this.io.notifications&&typeof this.io.notifications.onDataChanged=="function"&&((o=this.io)==null||o.notifications.onDataChanged((c,l)=>{var p;const u=c.id;(p=this.logger)==null||p.trace(`received event for notification data is changed - "${u}" - "${JSON.stringify(l)}"`),this.notifications=this.notifications.map(f=>{var d;return f.id===u?((d=this.logger)==null||d.trace(`${f.id} - the data is changed from "${JSON.stringify(f.data)}" to "${JSON.stringify(l)}"`),Object.assign(f,{data:l})):f}),this.registry.execute("on-notifications-changed",this.notifications)})),(r=this.io)==null||r.notifications.onClosed(({id:c})=>{var l;(l=this.logger)==null||l.trace(`received event for notification is closed - "${c}".`),this.notifications=this.notifications.filter(u=>u.id!==c),this.registry.execute("on-notifications-changed",this.notifications)}),(i=this.io)==null||i.notifications.onConfigurationChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for configuration changed - ${JSON.stringify(c)}.`),this.registry.execute("on-configuration-changed",c)}),this.isDesktopEnvironment()&&((a=this.io)==null||a.notifications.panel.onVisibilityChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for panel visibility changed to "${c}".`),this.isPanelVisible=c,this.registry.execute("on-panel-visibility-changed",c)}))}isDesktopEnvironment(){return typeof window=="object"&&(!!window.iodesktop||!!window.glue42gd)}attachHandlers(t){var e;return(e=t.actions)==null||e.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,c;try{(i=this.logger)==null||i.info(`${t.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(t.id,o.action,r))}catch(l){(c=this.logger)==null||c.error("Error while clicking on action:",l)}}})}),Object.assign(t,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(t.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(t.id,o)},updateData:async o=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the data to ${JSON.stringify(o)}`),(i=this.io)!=null&&i.notifications&&"updateData"in this.io.notifications&&typeof this.io.notifications.updateData=="function"?await this.io.notifications.updateData(t.id,o):console.log("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${t.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(t.id,void 0,o))}catch(c){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${t.id}`,c)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${t.id} - was closed.`),this.close(t.id)}})}};function ys(t){const n=v.useContext(_e.IOConnectContext),e=n==null?void 0:n.appManager,o=Be(),[r,i]=v.useState([]),[a,c]=v.useState(0),l="Platform",u=v.useCallback((d="asc")=>{if(o===null)return[];const h=[...r].sort((m,g)=>{const y=(m.title??m.name).toLowerCase(),w=(g.title??g.name).toLowerCase();return d==="asc"?y.localeCompare(w):w.localeCompare(y)});if(!o){const m=h.findIndex(g=>g.name===l);if(m!==-1){const[g]=h.splice(m,1);h.unshift(g)}}return h},[r,o]),p=v.useMemo(()=>u("asc"),[u]),f=v.useMemo(()=>u("desc"),[u]);return v.useEffect(()=>{if(o===null||o)return;const d={title:"System",name:l,hidden:!1,userProperties:{hidden:!1}};i(h=>h.some(m=>m.name===d.name)?h:[...h,d])},[o]),v.useEffect(()=>{if(!e)return;const d=e.onAppAdded(g=>{i(y=>[...y,{title:g.title,name:g.name,hidden:g.hidden,userProperties:g.userProperties}])}),h=e.onAppRemoved(g=>{i(y=>y.filter(w=>w.name!==g.name))}),m=e.onAppChanged(g=>{i(y=>{const w=y.find(E=>E.name===g.name);return[...y.filter(E=>E.name!==g.name),{title:g.title,name:w==null?void 0:w.name,hidden:w==null?void 0:w.hidden,allowed:w==null?void 0:w.allowed,userProperties:w==null?void 0:w.userProperties}]})});return()=>{d(),h(),m()}},[e]),{apps:v.useMemo(()=>{if(!(t!=null&&t.sourceFilter)||!Array.isArray(r))return r;const{allowed:d=[],blocked:h=[]}=t.sourceFilter,m=d.includes("*"),g=h.includes("*");let y=0;const w=r.map(E=>{const k=m||d.includes(E.name),C=!g&&k;return C&&y++,{...E,allowed:C}});return c(y),w},[t,r]),allowedApps:a,sortedAppsAsc:p,sortedAppsDesc:f,sortAppsAlphabetically:u}}function cd(t,n,e){var r;return{notificationStacks:v.useMemo(()=>{var u,p,f,d;if(!n.toastStacking)return[];const i=(a=n.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const c=t.filter(h=>h.state==="Active"),l=new Map;for(const h of c){const m=h[i]??"";if(h.source&&((p=(u=e==null?void 0:e.sourceFilter)==null?void 0:u.muted)!=null&&p.includes(h.source))||(d=(f=e==null?void 0:e.sourceFilter)==null?void 0:f.muted)!=null&&d.includes("*"))continue;l.has(m)||l.set(m,{key:m,items:[]});const g=l.get(m);g&&g.items.unshift(h)}return Array.from(l.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[t,n.toastStacking,n.stackBy,(r=e==null?void 0:e.sourceFilter)==null?void 0:r.muted])}}function ld(t){const[n,e]=v.useState([]);return{selectedNotifications:n,selectNotification:(o,r)=>{const i=n;e(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=t.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=t.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=t.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=t.map(a=>a.id)}e(i)}else e([])}}}const ud="newest",Ag="oldest",Pg="severity",oa=["None","Low","Medium","High","Critical"],$c={key:ud,descending:!0},Tg=new Set(["enabledNotifications","enabledToasts","toastStacking","stackBy","showNotificationBadge","toastExpiry","placement","snooze","closeNotificationOnClick"]),Uc=t=>{var n,e;return{enabledNotifications:t.enable,enabledToasts:t.enableToasts,toastStacking:((n=t.toasts)==null?void 0:n.mode)==="stacked",stackBy:(e=t.toasts)==null?void 0:e.stackBy,toastExpiry:t.toastExpiry,showNotificationBadge:t.showNotificationBadge,placement:t.placement,snooze:t.snooze,closeNotificationOnClick:t.closeNotificationOnClick}},Vc=t=>Array.from(t.reduce((n,e)=>n.set(e.id,e),new Map).values());function _g(){const t=v.useContext(_e.IOConnectContext),n=v.useMemo(()=>({autoHidePanel:!0,alwaysOnTop:!0,highlightNewFor:3e4,markAsReadAfter:6e4}),[]),{appPrefs:e,updatePrefs:o}=hm(),[r,i]=v.useState({}),[a,c]=v.useState({}),[l,u]=v.useState([]),[p,f]=v.useState(0),[d,h]=v.useState(!0),{apps:m,allowedApps:g}=ys(r),{notificationStacks:y}=cd(l,{toastStacking:a.toastStacking??!1,stackBy:a.stackBy??"source"},{sourceFilter:r.sourceFilter}),{selectedNotifications:w,selectNotification:E,selectAllNotifications:k}=ld(l);tt.init(t),v.useEffect(()=>{(async()=>{await(async()=>{try{const S=await tt.getConfiguration();i(S),c(D=>({...D,...Uc(S)}))}catch(S){console.error("Error fetching configuration:",S)}})(),await(async()=>{try{const S=await tt.getNotificationsList();u(Vc(S))}catch(S){console.error("Error fetching notifications:",S)}})()})().catch(S=>{console.error("Error in useNotifications fetch:",S)}),C()},[]),v.useEffect(()=>{c(S=>({...S,autoHidePanel:e.autoHidePanel??n.autoHidePanel,alwaysOnTop:e.alwaysOnTop??n.alwaysOnTop,highlightNewFor:e.highlightNewFor??n.highlightNewFor,markAsReadAfter:e.markAsReadAfter??n.markAsReadAfter}))},[e,n]),v.useEffect(()=>{const S=tt.onNotificationsChanged(W=>{u(Vc(W))}),D=tt.onConfigurationChanged(W=>{const J=Uc(W);i(B=>({...B,...W})),c(B=>({...B,...J}))}),$=tt.onCounterChanged(W=>{f(W)});return()=>{S(),D(),$()}},[]);const C=()=>{h(tt.bulkActionsSupported)},j=async S=>{await tt.setFilter(S)};return{close:S=>tt.close(S),clearAll:()=>tt.clearAll(),settings:a,hidePanel:async()=>{await tt.hidePanel()},showPanel:async()=>{await tt.showPanel()},saveFilter:j,clearAllOld:()=>tt.clearAllOld(),saveSetting:async S=>{const D=Object.keys(S)[0];if(!Tg.has(D))return void o(S);const $=((W,J)=>{const B=(ve=>({enabledNotifications:Y=>({enable:Y}),enabledToasts:Y=>({enableToasts:Y}),toastStacking:Y=>{var de;return{toasts:{mode:Y?"stacked":"single",stackBy:(de=ve.toasts)==null?void 0:de.stackBy}}},stackBy:Y=>{var de;return{toasts:{mode:(de=ve.toasts)==null?void 0:de.mode,stackBy:Y}}},showNotificationBadge:Y=>({showNotificationBadge:Y}),toastExpiry:Y=>({toastExpiry:Y}),placement:Y=>({placement:Y}),snooze:Y=>({snooze:Y}),closeNotificationOnClick:Y=>({closeNotificationOnClick:Y})}))(J),A=Object.keys(W)[0],fe=W[A];return A&&fe!==void 0&&B[A]?B[A](fe):{}})(S,r);$&&await tt.configure($)},allApps:m,saveAllFilter:async S=>{"subscribe"in S?await j({allowed:S.subscribe?["*"]:[],blocked:S.subscribe?[]:["*"]}):"mute"in S&&await j({muted:S.mute?["*"]:[]})},configuration:r,notifications:l,notificationStacks:y,notificationsCount:p,allApplications:r.allApplications??0,allowedApplications:g,isBulkActionsSupported:d,selectedNotifications:w,selectNotification:E,selectAllNotifications:k,clearMany:async S=>{await tt.clearMany(S)},snooze:async(S,D)=>{await tt.snooze(S,D)},snoozeMany:async(S,D)=>{await tt.snoozeMany(S,D)},setState:async(S,D)=>{await tt.setState(S,D)},setStates:async(S,D)=>{await tt.setStates(S,D)},setCount:S=>{f(S)},getNotificationsList:async()=>await tt.getNotificationsList()}}const dd=v.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Se=()=>v.useContext(dd);function fd({label:t="Allow notifications",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=Be(),a=v.useCallback(c=>{r({enabledNotifications:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.enabledNotifications??!1,...e}):null}function pd({label:t="Show notification badge",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=Be()&&!o.enabledNotifications,a=v.useCallback(c=>{r({showNotificationBadge:c.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...e})}function hd({label:t="Close notification on click",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=Be(),a=i&&!o.enabledNotifications,c=v.useCallback(l=>{r({closeNotificationOnClick:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.closeNotificationOnClick??!1,disabled:a,...e}):null}function md({label:t="Auto hide panel",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=Be(),a=v.useCallback(c=>{r({autoHidePanel:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.autoHidePanel??!1,...e}):null}function gd({label:t="Panel always on top",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=v.useCallback(a=>{r({alwaysOnTop:a.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:i,checked:o.alwaysOnTop??!1,...e})}const Gc=(t,n)=>t?`${t} ${n}${t!==1?"s":""}`:"",ii=t=>{const n=Math.floor(t/60),e=t%60,o=Gc(n,"minute"),r=Gc(e,"second");return o+(o&&r?" ":"")+r};function vd({className:t,title:n="Hide toasts after",items:e=[15,30,45,60],...o}){const r=K("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Se(),c=Be(),l=c&&!i.enabledNotifications,u=v.useCallback((p=15e3)=>{i.toastExpiry!==p&&a({toastExpiry:1e3*p})},[i.toastExpiry,a]);return c?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:"io-text-clipper "+(l?"io-text-disabled":""),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{text:ii((i.toastExpiry??0)/1e3)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:e.map(p=>s.jsx(ae.Item,{onClick:()=>{u(p)},children:ii(p)},p))})})]})]}):null}function yd({className:t,title:n="Highlight new for",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r}=Se(),i=Be()&&!r.enabledNotifications,a=["30 seconds","1 minute","5 minutes","Never"];return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":i}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:i,children:[s.jsx(ae.Button,{text:a[0]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:a.map(c=>s.jsx(ae.Item,{children:c},c))})})]})]})}function bd({className:t,title:n="Mark as read after",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r}=Se(),i=Be()&&!r.enabledNotifications,a=["1 minute","5 minutes","Never"];return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":i}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:i,children:[s.jsx(ae.Button,{text:a[0]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:a.map(c=>s.jsx(ae.Item,{children:c},c))})})]})]})}function wd({className:t,title:n="Stacking",...e}){const o=K("io-notifications-settings-panel-stacking",t),{ToastStacking:r,ToastStackBy:i}=oo();return Be()?s.jsx("div",{className:o,...e,children:s.jsxs(Ye,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function xd({label:t="Allow toast stacking",align:n="right",...e}){const{settings:o,saveSetting:r}=Se(),i=Be(),a=i&&!o.enabledNotifications,c=v.useCallback(l=>{r({toastStacking:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.toastStacking??!1,disabled:a,...e}):null}const bs=t=>t.replace(/(^|-)\w/g,n=>n.toUpperCase().replace("-"," "));function Cd({className:t,title:n="Group by",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Se(),a=Be(),c=a&&!r.enabledNotifications,l=v.useCallback(u=>{u||(u="severity"),r.stackBy!==u&&i({stackBy:u.toLowerCase()})},[r.stackBy,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":c}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:c,children:[s.jsx(ae.Button,{text:r.stackBy?bs(r.stackBy):"Severity"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Severity","Application"].map(u=>s.jsx(ae.Item,{onClick:()=>{l(u)},children:u},u))})})]})]}):null}function kd({className:t,title:n="Placement",...e}){const o=K("io-notifications-settings-panel-placement",t),{PlacementPanel:r,PlacementToasts:i}=oo();return Be()?s.jsx("div",{className:o,...e,children:s.jsxs(Ye,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function Ed({className:t,title:n="Panel position",...e}){var l,u;const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Se(),a=Be(),c=v.useCallback(p=>{var f;p||(p="right"),((f=r.placement)==null?void 0:f.panel)!==p&&i({placement:{...r.placement,panel:p.toLowerCase()}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:(l=r.placement)!=null&&l.panel?bs((u=r.placement)==null?void 0:u.panel):"Right"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Right","Left"].map(p=>s.jsx(ae.Item,{onClick:()=>{c(p)},children:p},p))})})]})]}):null}function Sd({className:t,title:n="Toasts position",...e}){var l,u;const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Se(),a=Be(),c=v.useCallback(p=>{var d;if(p||(p="bottom-right"),((d=r.placement)==null?void 0:d.toasts)===p)return;const f=p.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:(l=r.placement)!=null&&l.toasts?bs((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(p=>s.jsx(ae.Item,{onClick:()=>{c(p)},children:p},p))})})]})]}):null}function jd({className:t,title:n="Snooze",...e}){var a;const o=K("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=oo(),{settings:i}=Se();return Be()&&((a=i.snooze)!=null&&a.enabled)?s.jsx("div",{className:o,...e,children:s.jsx(Ye,{title:n,children:s.jsx(r,{})})}):null}function Od({className:t,title:n="Default duration",items:e=[60,120,180,300],...o}){var p,f;const r=K("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Se(),c=Be(),l=c&&!i.enabledNotifications,u=v.useCallback((d=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==d&&a({snooze:{...i.snooze,duration:1e3*d}})},[i.snooze,a]);return c&&((p=i.snooze)!=null&&p.enabled)?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":l}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{text:ii((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:e.map(d=>s.jsx(ae.Item,{onClick:()=>{u(d)},children:ii(d)},d))})})]})]}):null}function Nd({className:t,title:n,...e}){const o=K("io-notifications-settings-panel-subscriptions",t),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:c}=oo(),{sortAppsAlphabetically:l}=ys(),u=Be(),p=l(),f="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return s.jsx("div",{className:o,...e,children:s.jsxs(Ye,{title:n??(u?"Subscribe & Mute":"Subscribe"),children:[s.jsxs("div",{className:f,children:[s.jsx("p",{className:"io-text-section",children:"Sources"}),s.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&s.jsx("p",{className:"io-text-section",children:"Mute"})]}),s.jsxs("div",{className:f,children:[s.jsx("p",{children:"All Sources"}),s.jsx(r,{label:""}),u&&s.jsx(a,{label:""})]}),p.map(d=>{var h;return!d||d.hidden||(h=d==null?void 0:d.userProperties)!=null&&h.hidden?null:s.jsxs("div",{className:f,children:[s.jsx("p",{children:d.title??d.name}),s.jsx(i,{app:d,label:""}),u&&s.jsx(c,{app:d,label:""})]},d.name)})]})})}function Id({label:t="All apps",align:n="right",...e}){var l,u,p,f;const{settings:o,configuration:r,saveAllFilter:i}=Se(),a=Be()&&!o.enabledNotifications,c=v.useCallback(d=>{i({subscribe:d.target.checked})},[i]);return s.jsx(ft,{align:n,label:t,onChange:c,checked:(((u=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:u.includes("*"))&&((f=(p=r.sourceFilter)==null?void 0:p.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...e})}function Ad({label:t="App",align:n="right",app:e,...o}){var p,f,d,h,m,g;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Se(),l=Be()&&!i.enabledNotifications,u=v.useCallback((y,w)=>{var C,j,S,D,$,W;const E={...a.sourceFilter},k=(C=E.allowed)==null?void 0:C.indexOf("*");typeof k=="number"&&k>-1&&((j=E.allowed)==null||j.splice(k,1),r.forEach(J=>{var B;J.name!==w.name&&((B=E.allowed)==null||B.push(J.name))})),y?(E.allowed=[...new Set([...E.allowed??[],w.name])],E.blocked=(S=E.blocked)==null?void 0:S.filter(J=>J!==w.name)):(E.allowed=(D=E.allowed)==null?void 0:D.filter(J=>J!==w.name),E.blocked=[...new Set([...E.blocked??[],w.name])]),($=E.allowed)!=null&&$.length&&((W=E.blocked)!=null&&W.includes("*"))&&E.blocked.splice(E.blocked.indexOf("*"),1),c(E)},[r,a.sourceFilter,c]);return s.jsx(ft,{id:e.name,label:t,align:n,onChange:y=>u(y.target.checked,e),checked:(((f=(p=a.sourceFilter)==null?void 0:p.allowed)==null?void 0:f.includes("*"))&&!((h=(d=a.sourceFilter)==null?void 0:d.blocked)!=null&&h.includes(e.name))||((g=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:g.includes(e.name)))??!1,disabled:l,...o})}function Pd({label:t="Mute all",align:n="right",...e}){var u,p,f,d;const{settings:o,configuration:r,saveAllFilter:i}=Se(),a=Be(),c=a&&(!o.enabledNotifications||((p=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:p.indexOf("*"))===-1),l=v.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?s.jsx(ft,{align:n,label:t,onChange:l,checked:((d=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:d.includes("*"))??!1,disabled:c??!1,...e}):null}function Td({label:t="App",align:n="right",app:e,...o}){var f,d,h,m,g,y,w,E,k,C,j,S,D,$,W,J;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Se(),l=Be(),u=l&&(!i.enabledNotifications||((d=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:d.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(e.name))||((y=(g=a.sourceFilter)==null?void 0:g.allowed)==null?void 0:y.length)===0||((E=(w=a.sourceFilter)==null?void 0:w.allowed)==null?void 0:E.indexOf(e.name))===-1&&((C=(k=a.sourceFilter)==null?void 0:k.allowed)==null?void 0:C.indexOf("*"))===-1&&((S=(j=a.sourceFilter)==null?void 0:j.blocked)==null?void 0:S.length)===0),p=v.useCallback((B,A)=>{var Y,de,he,Oe;const fe={...a.sourceFilter},ve=(Y=fe==null?void 0:fe.muted)==null?void 0:Y.indexOf("*");typeof ve=="number"&&ve>-1&&((de=fe.muted)==null||de.splice(ve,1),r.forEach(se=>{var H;se.name===A.name||se.hidden||((H=fe.muted)==null||H.push(se.name))})),B?(he=fe.muted)==null||he.push(A.name):fe.muted=(Oe=fe.muted)==null?void 0:Oe.filter(se=>se!==A.name),c(fe)},[r,a.sourceFilter,c]);return!l||e.hidden?null:s.jsx(ft,{id:e.name,label:t,align:n,onChange:B=>p(B.target.checked,e),checked:((($=(D=a.sourceFilter)==null?void 0:D.muted)==null?void 0:$.includes("*"))||((J=(W=a.sourceFilter)==null?void 0:W.muted)==null?void 0:J.includes(e.name)))??!1,disabled:u??!1,...o})}const _d={Body:t=>{const{General:n,Placement:e,Stacking:o,Snooze:r,Subscriptions:i}=oo();return s.jsxs(Eo,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{})]})},General:sd,AllowNotifications:fd,ShowNotificationBadge:pd,CloseNotificationOnClick:hd,PanelAutoHide:md,PanelAlwaysOnTop:gd,HideToastsAfter:vd,MarkAsNew:yd,MarkAsRead:bd,Stacking:wd,ToastStacking:xd,ToastStackBy:Cd,Placement:kd,PlacementPanel:Ed,PlacementToasts:Sd,Snooze:jd,SnoozeDuration:Od,Subscriptions:Nd,SubscribeAll:Id,SubscribeApp:Ad,SubscribeMuteAll:Pd,SubscribeMuteApp:Td},Dd=v.createContext(_d),ws=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({..._d,...n}),[n]);return s.jsx(Dd.Provider,{value:e,children:t})});ws.displayName="NotificationsSettingsPanelComponentsStoreProvider";const oo=()=>v.useContext(Dd),Dg=({className:t,onClose:n,title:e="Notification Settings",...o})=>{const{Body:r}=oo();return s.jsxs(Ke,{className:K("io-notifications-settings-panel",t),...o,children:[s.jsxs(Ke.Header,{children:[s.jsx(Ke.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ke.Header.ButtonGroup,{children:s.jsx(Ke.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsx(r,{})]})},Md=({components:t,...n})=>s.jsx(ws,{components:t,children:s.jsx(Dg,{...n})});function Mg({isOpen:t,onClose:n,container:e}){return t?Un.createPortal(s.jsx(Md,{onClose:n}),e??document.querySelector("#root")??document.body):null}const Ld=v.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),St=()=>v.useContext(Ld);function Rd({title:t,onClose:n,onOpenSettings:e,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:c,HeaderActions:l,HeaderBulkActions:u,HeaderSearch:p}=to(),{isBulkActionsSupported:f,notificationsCount:d}=Se(),{isBulkActionsVisible:h}=St(),m=Be();return s.jsxs(Cn,{...o,children:[s.jsxs("div",{className:"io-panel-header-caption",children:[s.jsx(r,{title:t}),s.jsx(i,{}),s.jsxs(Cn.ButtonGroup,{children:[m&&s.jsx(a,{onClick:e}),s.jsx(c,{onClick:n})]})]}),f?s.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&d>0?"io-panel-header-bulk-actions-opened":""} `,children:[s.jsx(l,{}),s.jsx(u,{})]}):s.jsx(l,{}),s.jsx(p,{})]})}function Fd({text:t="Notifications",counter:n,...e}){const{notificationsCount:o}=Se();return s.jsx(nn,{text:t,size:"large",...e,children:(n??!0)&&s.jsxs("span",{children:["(",o,")"]})})}const Bd=t=>[...t].sort((n,e)=>(e.timestamp||0)-(n.timestamp||0)),Hd=t=>[...t].sort((n,e)=>(n.timestamp||0)-(e.timestamp||0)),zd=(t,n)=>{const e=oa[0];return[...t].sort((o,r)=>{const i=oa.indexOf(o.severity||e),a=oa.indexOf(r.severity||e);return(n?-1:1)*(i-a)})},Lg={[ud]:Bd,[Ag]:Hd,[Pg]:zd};function Wd({...t}){const[n,e]=v.useState([]),{NotificationsList:o,Notification:r}=to(),{notifications:i,setCount:a,notificationsCount:c}=Se(),{sortNotificationsBy:l,viewNotificationsBy:u,searchQuery:p}=St(),f=v.useRef(null),d=Iu(p),h=v.useMemo(()=>((g,y)=>{if(!g)return[];switch(y){case"all":default:return g;case"unread":return g.filter(w=>w.state==="Active"||w.state==="Stale");case"read":return g.filter(w=>w.state==="Acknowledged"||w.state==="Seen");case"snoozed":return g.filter(w=>w.state==="Snoozed")}})(i,u).filter(g=>{var y,w;return g.title.toLowerCase().includes(d.toLowerCase())||((y=g.source)==null?void 0:y.toLowerCase().includes(d.toLowerCase()))||((w=g.body)==null?void 0:w.toLowerCase().includes(d.toLowerCase()))}),[d,i,u]);return v.useEffect(()=>{switch(l){case"newest":e(Bd(h));break;case"oldest":e(Hd(h));break;case"severity":e(zd(h,!0));break;default:e(h)}a(h.length)},[h,l,a]),v.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[d,c,l,u]),s.jsx(Eo,{ref:f,...t,children:s.jsx(o,{notifications:n,Notification:r})})}function $d({...t}){const{FooterButtons:n}=to();return s.jsx(po,{...t,children:s.jsx(n,{})})}function Ud({className:t,...n}){const{FooterButtonClearAll:e,FooterButtonClearAllOld:o}=to(),{notifications:r}=Se(),[i,a]=v.useState(!1);return v.useEffect(()=>{r.filter(c=>c.state==="Stale"||c.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(o,{disabled:!i}),s.jsx(e,{disabled:r.length<=0})]})}function Vd({text:t="Clear All",...n}){const{clearAll:e}=Se();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function Gd({text:t="Clear Old",...n}){const{clearAllOld:e}=Se();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function Yd({className:t,notification:n,...e}){const o=K("io-notification-header",t),{HeaderCount:r,HeaderBadge:i,HeaderTitle:a,HeaderTimestamp:c,HeaderButtonSnooze:l,HeaderButtonClose:u}=Ai();return s.jsxs("div",{className:o,...e,children:[s.jsx(i,{notification:n}),s.jsx(r,{notification:n}),s.jsx(a,{notification:n}),s.jsx(c,{notification:n}),s.jsxs(Re,{children:[s.jsx(l,{notification:n}),s.jsx(u,{notification:n})]})]})}function Zd({notification:t,...n}){const{settings:e,notificationStacks:o}=Se(),{isPanelVisible:r}=St(),{toastStacking:i,stackBy:a}=e,c=a==="application"?"source":a??"source";let l;if(i){const u=o.find(p=>p.key===t[c]);l=(u==null?void 0:u.items.length)??0}return i&&!r&&l&&l>1?s.jsx($l,{...n,children:l<10?l:"9+"}):null}function Kd({className:t,notification:n,...e}){if(!(n!=null&&n.severity)||n.severity==="None")return null;const o=K("io-notification-header-badge",t);return s.jsxs("div",{className:o,...e,children:[s.jsx(Xe,{variant:((r="None")=>{switch(r.toLowerCase()){case"low":case"medium":case"none":default:return"circle-info";case"high":return"triangle-exclamation";case"critical":return"ban"}})(n.severity),size:"12"}),n.severity]})}function qd({className:t,state:n,severity:e="None",icon:o,...r}){const i=K("io-notification-header-icon",t),{isPanelVisible:a}=St();return s.jsxs("div",{className:i,...r,children:[o&&s.jsx("span",{className:"io-notification-header-icon-image",children:s.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),s.jsx("span",{className:`io-notification-header-icon-badge color-${e.toLowerCase()}`,children:a&&n!=="Acknowledged"&&"New"})]})}function Jd({className:t,notification:{appTitle:n},...e}){const o=K("io-notification-header-title",t);return s.jsx("div",{className:o,...e,children:n})}function Xd({className:t,notification:{timestamp:n,state:e,snooze:o},...r}){const i=K("io-notification-timestamp",t);return s.jsx("small",o&&e==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:td(n??0)??"Just Now"})}function Qd({notification:{id:t,state:n},...e}){var a,c;const{settings:o,snooze:r}=Se(),i=v.useCallback(l=>{var u;l.stopPropagation(),r&&r(t,((u=o.snooze)==null?void 0:u.duration)??0)},[t,r,(a=o.snooze)==null?void 0:a.duration]);return r&&n!=="Snoozed"&&((c=o.snooze)!=null&&c.enabled)?s.jsx(Ge,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...e}):null}function ef({notification:{id:t,updateState:n},...e}){const o=Be(),{onClose:r}=Se(),{isPanelVisible:i}=St(),a=v.useCallback(c=>{c.stopPropagation(),!o||i?r(t):n("Acknowledged").catch(console.error)},[o,t,r,i,n]);return s.jsx(Ue,{icon:"close",iconSize:"10",size:"24",tabIndex:-1,onClick:a,...e})}function tf({className:t,notification:n,...e}){const o=K("io-notification-body",t),r=Be(),{BodyIcon:i,BodyTitle:a,BodyDescription:c}=Ai(),{id:l,icon:u,title:p,body:f,onClick:d,updateState:h}=n,{settings:m,onClose:g}=Se(),{isPanelVisible:y}=St(),w=v.useCallback(async()=>{if(!d)return;if(!r)return void g(l);const E=!(m!=null&&m.toastStacking)&&null,k=y?(m==null?void 0:m.closeNotificationOnClick)??!0:E;k!==null?await d({close:k}).catch(console.error):(await d({close:!1}).catch(console.error),await h("Acknowledged").catch(console.error))},[r,l,y,d,g,h,m==null?void 0:m.closeNotificationOnClick,m==null?void 0:m.toastStacking]);return s.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async E=>{(k=>k.key==="Enter"||k.key===" ")(E)&&await w()},onClick:w,...e,children:[s.jsx(i,{icon:u}),s.jsxs("div",{className:"io-notification-body-content",children:[s.jsx(a,{text:p}),s.jsx(c,{text:f})]})]})}function nf({className:t,icon:n,altText:e="notification icon",...o}){if(!n)return null;const r=K("io-notification-body-icon",t);return s.jsx("div",{className:r,...o,children:s.jsx("img",{src:n,alt:e})})}function of({text:t,...n}){return s.jsx(nn,{text:t,...n})}function rf({className:t,text:n,...e}){const o=K("io-notification-body-description",t);return s.jsx("p",{className:o,...e,children:n})}function af({className:t,notification:n}){const e=K("io-notification-footer",t),{FooterButton:o}=Ai(),r=v.useMemo(()=>function(a){const c=[],l={};if(!a)return;a.forEach(p=>{var m;const{displayId:f,displayPath:d}=p,h={...p,children:[]};if(d&&d.length>0){let g;d.forEach((y,w)=>{var E;w===0?g=l[y]:g&&(g=(E=g.children)==null?void 0:E.find(k=>k.displayId===y))}),g&&((m=g.children)==null||m.push(h))}else f?(c.push(h),l[f]=h):c.push(h);f&&(l[f]=h)});const u=p=>{p.forEach(f=>{f.children&&f.children.length===0?delete f.children:f.children&&u(f.children)})};return u(c),c}(n.actions),[n.actions]),i=(a,c)=>a.children?s.jsx(Jt,{text:a.title,children:a.children.map(i)},`${a.title}-${c}`):((l,u)=>s.jsx(Jt.Item,{children:s.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:l,notificationId:n.id})},`${l.title}-${u}`))(a,c);return s.jsx("div",{className:e,children:s.jsx(Re,{align:"right",children:r==null?void 0:r.map((a,c)=>a.children?s.jsxs(Re,{variant:"append",children:[s.jsx(o,{notificationAction:a,variant:c===0?"primary":"default",notificationId:n.id}),s.jsx(Jt,{variant:c===0?"primary":"default",icon:"ellipsis",children:a.children.map(i)})]},`${a.title}-${c}`):s.jsx(o,{notificationAction:a,variant:c===0?"primary":"link",notificationId:n.id},`${a.title}-${c}`))})})}function sf({notificationAction:t,...n}){const e=v.useCallback(o=>{o.stopPropagation(),t.onClick({close:!0})},[t]);return s.jsx(Ge,{text:t.title,onClick:e,...n})}const cf={Header:Yd,HeaderCount:Zd,HeaderBadge:Kd,HeaderIcon:qd,HeaderTitle:Jd,HeaderTimestamp:Xd,HeaderButtonSnooze:Qd,HeaderButtonClose:ef,Body:tf,BodyIcon:nf,BodyTitle:of,BodyDescription:rf,Footer:af,FooterButton:sf},lf=v.createContext(cf),uf=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...cf,...n}),[n]);return s.jsx(lf.Provider,{value:e,children:t})});function Ai(t){return{...v.useContext(lf),...t}}function Rg({className:t,notification:n,...e}){const{Header:o,Body:r,Footer:i}=Ai(),{severity:a}=n,c=K("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,n.state!=="Acknowledged"&&"state-new",t);return s.jsxs("div",{className:c,...e,children:[s.jsx(o,{notification:n}),s.jsx(r,{notification:n}),s.jsx(i,{notification:n})]})}function Pi({components:t,notification:n,...e}){return s.jsx(uf,{components:t,children:s.jsx(Rg,{notification:n,...e})})}function df({className:t,notifications:n,...e}){const[o,r]=v.useState(!1),i=n.length>=3?"large":"normal",a=n.length===2?"small":i,c=n[0].severity,l=K("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],c&&c!=="None"&&[`io-notification-stack-${c.toLowerCase()}`],t),u=v.useCallback(()=>{r(!0)},[]),p=v.useCallback(f=>{f.stopPropagation(),n.forEach(d=>{d.close()})},[n]);return s.jsxs("div",{className:l,onClick:u,...e,children:[o&&a!=="normal"&&s.jsx("div",{className:"io-notification-stack-btn",children:s.jsx(Ge,{icon:"close",onClick:f=>p(f),children:s.jsx("span",{className:"io-btn-text",children:"Clear All"})})}),n.map(f=>s.jsx(Pi,{notification:f},f.id))]})}function Fg({...t}){const{notificationStacks:n}=Se();return s.jsx(s.Fragment,{children:n.map(e=>s.jsx(df,{notifications:e.items,...t},e.key))})}uf.displayName="ComponentsStoreProvider";const Bg=({notification:t,Notification:n,...e})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Se(),{isPanelVisible:c,isBulkActionsVisible:l}=St(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],p=t.source&&u.includes(t.source)||u.includes("*");if(!c&&p)return null;const f=c&&r&&l,d=i.includes(t.id);return f?s.jsxs("div",{className:K("io-notification-list-bulk-action-item",{selected:d}),children:[s.jsx(Ei,{checked:d,onChange:m=>a(t.id,m.target.checked)}),s.jsx(n,{notification:t,...e})]}):s.jsx(n,{notification:t,...e})};function xs({className:t,Notification:n,notifications:e=[],noNotificationText:o="No notifications to display",...r}){const i=K("io-notification-list",t),{settings:a}=Se(),{isPanelVisible:c}=St(),{toastStacking:l}=a,u=l&&!c,p=e.length>0;return s.jsxs("div",{className:i,...r,children:[u&&s.jsx(Fg,{}),!u&&(p?e.map(f=>s.jsx(Bg,{notification:f,Notification:n,...r},f.id)):s.jsx("div",{className:"flex jc-center mt-8",children:o}))]})}const ff={Header:Rd,HeaderCaptionTitle:Fd,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:e=0}=Se();return e===0?null:s.jsx($l,{variant:t,...n,children:e>99?"99+":e})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:e="circle",...o}){return Be()?s.jsx(Ue,{icon:t,size:n,variant:e,...o}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const{hidePanel:i}=Se(),a=Be();return s.jsx(Ue,{icon:t,size:n,variant:e,onClick:c=>{o?o(c):a&&i()},...r})},HeaderActions:function({className:t,...n}){const e=K("io-panel-header-actions",t),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=to();return s.jsxs("div",{className:e,...n,children:[s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{})]}),s.jsxs(Re,{children:[s.jsx(i,{}),s.jsx(a,{})]})]})},HeaderActionSort:function({text:t="Sort by",...n}){const{sortNotificationsBy:e,setSortBy:o}=St(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Se(),[a,c]=v.useState($c),{key:l,descending:u}=a,p=v.useMemo(()=>Lg[l](i,u),[i,l,u]);return{onNotificationsSort:v.useCallback(d=>{c(h=>({key:d,descending:h.key!==d?$c.descending:!h.descending}))},[]),sortedNotifications:p}})();return s.jsxs(ae,{variant:"light",...n,children:[s.jsxs(ae.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:e})]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Severity"].map(i=>s.jsx(ae.Item,{isSelected:e===i.toLowerCase(),onClick:()=>{o(i.toLowerCase()),r(i.toLowerCase())},children:i},i))})})]})},HeaderActionView:function({text:t="View",...n}){var a;const{settings:e}=Se(),{viewNotificationsBy:o,setViewBy:r}=St(),i=(a=e.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return s.jsxs(ae,{variant:"light",...n,children:[s.jsxs(ae.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:o})]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",checkIcon:"check",children:i.map(c=>s.jsx(ae.Item,{isSelected:o===c.toLowerCase(),onClick:()=>r(c.toLowerCase()),children:c},c))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:e,notificationsCount:o}=Se();return s.jsx(Ge,{variant:"link",text:t,onClick:e,disabled:o===0,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:e,notificationsCount:o}=Se(),{showBulkActions:r}=St();return e?s.jsx(Ue,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:o===0,...n}):null},HeaderBulkActions:function({className:t,...n}){const e=K("io-panel-header-bulk-actions",t),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:c,HeaderBulkActionClear:l,HeaderBulkActionClose:u}=to(),{isBulkActionsSupported:p}=Se();return p?s.jsx("div",{className:e,...n,children:s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{}),s.jsx(c,{}),s.jsx(l,{}),s.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:e,selectAllNotifications:o,notificationsCount:r}=Se();return n?s.jsx(Ei,{checked:r===e.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...t}):null},HeaderBulkActionSelectDropdown:function({...t}){const{isBulkActionsSupported:n,selectAllNotifications:e,notificationsCount:o}=Se();return n?s.jsxs(ae,{variant:"light",...t,children:[s.jsx(ae.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),s.jsx(Vl,{children:s.jsxs(ae.List,{variant:"single",checkIcon:"check",children:[s.jsx(ae.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>s.jsx(ae.Item,{onClick:()=>e(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:e="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Se(),u=v.useCallback(()=>{c(a,"Seen")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:e="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Se(),u=v.useCallback(()=>{c(a,"Active")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:e="circle",tooltip:o="Snooze",...r}){var f,d;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:c,settings:l,notificationsCount:u}=Se(),p=v.useCallback(()=>{var h;c(a,((h=l.snooze)==null?void 0:h.duration)??0)},[a,c,(f=l.snooze)==null?void 0:f.duration]);return i&&((d=l.snooze)!=null&&d.enabled)?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:p,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:e="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:c,notificationsCount:l}=Se(),u=v.useCallback(()=>{c(a)},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...e}){const{isBulkActionsSupported:o,notificationsCount:r}=Se(),{hideBulkActions:i}=St();return o?s.jsx(Ge,{variant:n,text:t,onClick:i,disabled:r===0,...e}):null},HeaderSearch:function({className:t,icon:n="search",placeholder:e="Search",...o}){const r=K("io-panel-header-search",t),{notificationsCount:i}=Se(),{searchQuery:a,setSearch:c}=St(),l=v.useRef(null);return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:l,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-panel-header-search-count",children:`${i} results`})]})},Body:Wd,Footer:$d,FooterButtons:Ud,FooterButtonClearAll:Vd,FooterButtonClearAllOld:Gd,Notification:Pi,NotificationsList:xs},pf=v.createContext(ff),hf=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...ff,...n}),[n]);return s.jsx(pf.Provider,{value:e,children:t})});function to(t){return{...v.useContext(pf),...t}}function mf(){var r,i;const t=v.useContext(_e.IOConnectContext),{settings:n}=Se(),e=Be(),o=v.useCallback(async()=>{var l;const a=t.windows.my();if(!t||!a||!e)return;const c=a.placementSettings;await a.place({...c,horizontalAlignment:(l=n.placement)==null?void 0:l.panel})},[t,e,(r=n.placement)==null?void 0:r.panel]);v.useEffect(()=>{var a;t&&((a=n.placement)!=null&&a.panel)&&e&&o().catch(console.error)},[t,e,o,(i=n.placement)==null?void 0:i.panel])}function Hg({className:t,onClose:n,title:e="Notifications",...o}){var d,h;const{Header:r,Body:i}=to(),{settings:a}=Se(),{isPanelVisible:c}=St(),[l,u]=v.useState(!1),p=Be(),f=K("io-notifications-panel",((d=a.placement)==null?void 0:d.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",t);return mf(),v.useEffect(()=>{c||u(!1)},[c]),s.jsxs(s.Fragment,{children:[s.jsxs(Ke,{className:f,...o,children:[s.jsx(r,{title:e,onClose:n,onOpenSettings:()=>u(!0)}),s.jsx(i,{})]}),p&&c&&s.jsx(Mg,{isOpen:l,onClose:()=>u(!1)})]})}hf.displayName="ComponentsStoreProvider";const gf={Body:function({className:t,notifications:n,maxToasts:e=1,...o}){const r=K("io-toasts-body",t),{NotificationsList:i,Notification:a}=bf(),[c,l]=v.useState([]);return v.useEffect(()=>{const u=e<0?n.length:e,p=n.filter(f=>f.state==="Active").slice(0,u);for(const f of p)f.onShow();l(p)},[n,e]),s.jsx("div",{className:r,...o,children:s.jsx(i,{Notification:a,notifications:c,noNotificationText:""})})},Notification:Pi,NotificationsList:xs},vf=v.createContext(gf),yf=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...gf,...n}),[n]);return s.jsx(vf.Provider,{value:e,children:t})});function bf(t){return{...v.useContext(vf),...t}}function wf(){var o,r;const t=v.useContext(_e.IOConnectContext),{settings:n}=Se(),e=v.useCallback(async()=>{var c,l;const i=t.windows.my();if(!t||!i)return;const a=i.placementSettings;await i.place({...a,horizontalAlignment:((c=n.placement)==null?void 0:c.toasts)==="top-right"||((l=n.placement)==null?void 0:l.toasts)==="bottom-right"?"right":"left"})},[t,(o=n.placement)==null?void 0:o.toasts]);v.useEffect(()=>{var i;t&&((i=n.placement)!=null&&i.toasts)&&e().catch(console.error)},[t,e,(r=n.placement)==null?void 0:r.toasts])}function zg({className:t,maxToasts:n=10,...e}){var u,p,f,d,h,m,g,y;const{Header:o,Body:r,Footer:i}=bf(),{notifications:a,settings:c}=Se(),l=K("io-toasts",(((u=c.placement)==null?void 0:u.toasts)==="top-left"||((p=c.placement)==null?void 0:p.toasts)==="top-right")&&"io-toasts-top",(((f=c.placement)==null?void 0:f.toasts)==="top-right"||((d=c.placement)==null?void 0:d.toasts)==="bottom-right")&&"io-toasts-right",(((h=c.placement)==null?void 0:h.toasts)==="bottom-left"||((m=c.placement)==null?void 0:m.toasts)==="bottom-right")&&"io-toasts-bottom",(((g=c.placement)==null?void 0:g.toasts)==="top-left"||((y=c.placement)==null?void 0:y.toasts)==="bottom-left")&&"io-toasts-left",t);return wf(),s.jsxs("div",{className:l,...e,children:[o&&s.jsx(o,{}),s.jsx(r,{notifications:a,maxToasts:n}),i&&s.jsx(i,{})]})}yf.displayName="ComponentsStoreProvider";var xf=Object.freeze({__proto__:null,Notification:Pi,NotificationBody:tf,NotificationBodyDescription:rf,NotificationBodyIcon:nf,NotificationBodyTitle:of,NotificationFooter:af,NotificationFooterButton:sf,NotificationHeader:Yd,NotificationHeaderBadge:Kd,NotificationHeaderButtonClose:ef,NotificationHeaderButtonSnooze:Qd,NotificationHeaderCount:Zd,NotificationHeaderIcon:qd,NotificationHeaderTimestamp:Xd,NotificationHeaderTitle:Jd,NotificationStack:df,NotificationsList:xs,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:p}=function(){const d=v.useContext(_e.IOConnectContext),[h,m]=v.useState(!1),[g,y]=v.useState("newest"),[w,E]=v.useState("all"),[k,C]=v.useState(""),[j,S]=v.useState(!1),D=Be(),{isBulkActionsSupported:$}=Se();return v.useEffect(()=>{const W=tt.onPanelVisibilityChanged(J=>m(J));return()=>{W()}},[]),v.useEffect(()=>{D!==null&&D&&(async()=>{const W=await d.notifications.panel.isVisible();m(W)})()},[d.notifications.panel,D]),v.useEffect(()=>{h||(S(!1),E("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:g,setSortBy:W=>{y(W)},viewNotificationsBy:w,setViewBy:W=>{E(W)},searchQuery:k,setSearch:W=>{C(W)},isBulkActionsVisible:j,showBulkActions:()=>{$&&S(!0)},hideBulkActions:()=>{$&&S(!1)}}}(),f=v.useMemo(()=>({searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:p}),[n,e,o,r,i,a,c,l,u,p]);return s.jsx(Ld.Provider,{value:f,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:p,close:f,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:E,selectNotification:k,selectAllNotifications:C,clearMany:j,snooze:S,snoozeMany:D,setState:$,setStates:W,setCount:J}=_g(),B=v.useMemo(()=>({notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:p,onClose:f,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:E,selectNotification:k,selectAllNotifications:C,clearMany:j,snooze:S,snoozeMany:D,setState:$,setStates:W,setCount:J}),[n,e,o,r,i,a,c,l,u,p,f,d,h,m,g,y,w,E,k,C,j,S,D,$,W,J]);return s.jsx(dd.Provider,{value:B,children:t})},Panel:function({components:t,settings:n,...e}){return s.jsx(ws,{components:n,children:s.jsx(hf,{components:t,children:s.jsx(Hg,{...e})})})},PanelBody:Wd,PanelFooter:$d,PanelFooterButtonClearAll:Vd,PanelFooterButtonClearAllOld:Gd,PanelFooterButtons:Ud,PanelHeader:Rd,PanelHeaderCaptionTitle:Fd,SettingsAllowNotifications:fd,SettingsCloseNotificationOnClick:hd,SettingsGeneral:sd,SettingsHideToastsAfter:vd,SettingsMarkAsNew:yd,SettingsMarkAsRead:bd,SettingsPanel:Md,SettingsPanelAlwaysOnTop:gd,SettingsPanelAutoHide:md,SettingsPlacement:kd,SettingsPlacementPanel:Ed,SettingsPlacementToasts:Sd,SettingsShowNotificationBadge:pd,SettingsSnooze:jd,SettingsSnoozeDuration:Od,SettingsStacking:wd,SettingsSubscribeAll:Id,SettingsSubscribeApp:Ad,SettingsSubscribeMuteAll:Pd,SettingsSubscribeMuteApp:Td,SettingsSubscriptions:Nd,SettingsToastStackBy:Cd,SettingsToastStacking:xd,Toasts:function({components:t,...n}){return s.jsx(yf,{components:t,children:s.jsx(zg,{...n})})},useAddRemoveApps:ys,useHidePanelOnFocusLost:function(t=!0){const n=v.useContext(_e.IOConnectContext),e=Be();return v.useEffect(()=>{var r;if(!n||!t||e===null||!e)return;const o=(r=n.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||n.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[n,e,t]),n},useHidePanelOnKeyUp:function(t="Escape"){const{hidePanel:n}=Se();mm(t,n)},useNotificationStacking:cd,useNotificationsContext:Se,useNotificationsPanelContext:St,usePanelWindowPlacement:mf,useSelectNotifications:ld,useShowHidePanelWindow:function(t=!0){const n=v.useContext(_e.IOConnectContext),e=n==null?void 0:n.windows.my(),o=Be(),{isPanelVisible:r}=St();return v.useEffect(()=>{n&&e&&o&&(r?e.show().then(()=>{t&&e.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):e.hide().catch(i=>console.error("Error hiding window:",i)))},[n,e,o,r,t]),{myWindow:e}},useToastsWindowPlacement:wf});const Wg=t=>{const{General:n,Layouts:e,Downloads:o,System:r}=gr();return s.jsxs(Eo,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{})]})},$g=({className:t,title:n="General",...e})=>{const{Theme:o,PinnedPosition:r,MinimizeToTray:i,ShowTutorialOnStartup:a}=gr();return s.jsxs(Ye,{className:K("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{})]})},Yc=(t="dark")=>{switch(t){case"dark":return"Dark";case"light":return"Light";default:return t}},Cs=({className:t,title:n="Theme",...e})=>{const{currentTheme:o,selectTheme:r}=(()=>{const a=v.useContext(_e.IOConnectContext),[c,l]=v.useState(null),u=v.useCallback(p=>{var f;return(f=a==null?void 0:a.themes)==null?void 0:f.select(p)},[a]);return v.useEffect(()=>{var d,h;if(!a)return;let p=!1;const f=m=>{p||l(m)};return(d=a.themes)==null||d.onChanged(f),(h=a.themes)==null||h.getCurrent().then(f).catch(console.warn),()=>{p=!0}},[a]),{currentTheme:c,selectTheme:u}})(),i=(()=>{const a=v.useContext(_e.IOConnectContext),[c,l]=v.useState([]);return v.useEffect(()=>{var u;a&&((u=a.themes)==null||u.list().then(l).catch(console.warn))},[a]),c})();return s.jsxs("div",{className:K("flex jc-between ai-center",t),...e,children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:Yc(o==null?void 0:o.name)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:i.map(({name:a})=>s.jsx(ae.Item,{onClick:()=>r(a),children:Yc(a)},a))})})]})]})},Ug=({prefKey:t,options:n,disabled:e,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Ht({prefKey:t});return s.jsxs(ae,{variant:"light",disabled:r||e,...o,children:[s.jsx(ae.Button,{children:i}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:n.map(c=>s.jsx(ae.Item,{onClick:()=>(async l=>{if(l!==i)try{await a(l)}catch(u){console.error("Failed to update platform preference:",u)}})(c),children:c},c))})})]})},Vg=({className:t,label:n="Pinned position",...e})=>s.jsx(Ye,{className:K("io-block-list-gap",t),...e,children:s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ug,{className:t,prefKey:Au,options:["Left","Right"],...e})]})}),an=({prefKey:t,...n})=>{const{isLoading:e,value:o=!1,update:r}=Ht({prefKey:t});return s.jsx(ft,{checked:o,disabled:e,onChange:i=>r(i.target.checked),...n})},Gg=({align:t="right",label:n="Allow docking",...e})=>s.jsx(an,{align:t,label:n,prefKey:Pu,...e}),Yg=({align:t="right",label:n="Minimize to tray",...e})=>s.jsx(an,{align:t,label:n,prefKey:Tu,...e}),Zg=({align:t="right",label:n="Auto-close on starting apps and workspaces",...e})=>s.jsx(an,{align:t,label:n,prefKey:_u,disabled:!0,...e}),Kg=({align:t="right",label:n="Show tutorial on startup",...e})=>s.jsx(an,{align:t,label:n,prefKey:Du,...e}),qg=({className:t,title:n="Layouts",...e})=>{const{LayoutsSaveCurrentOnExit:o,LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:i}=gr();return s.jsxs(Ye,{className:K("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(i,{}),s.jsx(r,{})]})},Jg=({align:t="right",label:n="Restore last saved on startup",...e})=>s.jsx(an,{align:t,label:n,prefKey:Mu,...e}),Xg=({align:t="right",label:n="Save current on exit",...e})=>s.jsx(an,{align:t,label:n,prefKey:Lu,...e}),ks=({align:t="right",label:n="Show prompt for unsaved changes",...e})=>s.jsx(an,{align:t,label:n,prefKey:Ru,...e}),Es=({align:t="right",label:n="Show prompt for deleting",...e})=>s.jsx(an,{align:t,label:n,prefKey:Fu,...e}),Qg=({className:t,title:n="Downloads",...e})=>{const{DownloadsLocation:o}=gr();return s.jsx(Ye,{className:K("io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},e0=({align:t="right",label:n="Ask where to save each file before downloading",...e})=>s.jsx(an,{align:t,label:n,prefKey:Bu,...e}),t0=({className:t,label:n="Location",...e})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=Pn();return s.jsxs(Ye,{className:K("io-block-list-gap",t),...e,children:[s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ge,{text:"Change",onClick:r,disabled:i})]}),s.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},n0=({className:t,title:n="System",...e})=>{const{SystemRestartSection:o,SystemShutdownSection:r}=gr();return s.jsxs(Ye,{className:K("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{})]})};var ra=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],bo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},lr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Tt=function(t,n){return n===void 0&&(n=2),("000"+t).slice(-1*n)},Ut=function(t){return t===!0?1:0};function Zc(t,n){var e;return function(){var o=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,r)},n)}}var ia=function(t){return t instanceof Array?t:[t]};function Nt(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function He(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Pr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Cf(t,n){return n(t)?t:t.parentNode?Cf(t.parentNode,n):void 0}function Tr(t,n){var e=He("div","numInputWrapper"),o=He("input","numInput "+t),r=He("span","arrowUp"),i=He("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var a in n)o.setAttribute(a,n[a]);return e.appendChild(o),e.appendChild(r),e.appendChild(i),e}function Lt(t){try{return typeof t.composedPath=="function"?t.composedPath()[0]:t.target}catch{return t.target}}var aa=function(){},ai=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},o0={D:aa,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*Ut(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:aa,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:aa,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},Wn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},er={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[er.w(t,n,e)]},F:function(t,n,e){return ai(er.n(t,n,e)-1,!1,n)},G:function(t,n,e){return Tt(er.h(t,n,e))},H:function(t){return Tt(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[Ut(t.getHours()>11)]},M:function(t,n){return ai(t.getMonth(),!0,n)},S:function(t){return Tt(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return Tt(t.getFullYear(),4)},d:function(t){return Tt(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Tt(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return Tt(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},kf=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?lr:o,i=t.isMobile,a=i!==void 0&&i;return function(c,l,u){var p=u||r;return e.formatDate===void 0||a?l.split("").map(function(f,d,h){return er[f]&&h[d-1]!=="\\"?er[f](c,p,e):f!=="\\"?f:""}).join(""):e.formatDate(c,l,p)}},Va=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?lr:o;return function(i,a,c,l){if(i===0||i){var u,p=l||r,f=i;if(i instanceof Date)u=new Date(i.getTime());else if(typeof i!="string"&&i.toFixed!==void 0)u=new Date(i);else if(typeof i=="string"){var d=a||(e||bo).dateFormat,h=String(i).trim();if(h==="today")u=new Date,c=!0;else if(e&&e.parseDate)u=e.parseDate(i,d);else if(/Z$/.test(h)||/GMT$/.test(h))u=new Date(i);else{for(var m=void 0,g=[],y=0,w=0,E="";y<d.length;y++){var k=d[y],C=k==="\\",j=d[y-1]==="\\"||C;if(Wn[k]&&!j){E+=Wn[k];var S=new RegExp(E).exec(i);S&&(m=!0)&&g[k!=="Y"?"push":"unshift"]({fn:o0[k],val:S[++w]})}else C||(E+=".")}u=e&&e.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),g.forEach(function(D){var $=D.fn,W=D.val;return u=$(u,W,p)||u}),u=m?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return c===!0&&u.setHours(0,0,0,0),u;e.errorHandler(new Error("Invalid date provided: "+f))}}};function Rt(t,n,e){return e===void 0&&(e=!0),e!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):t.getTime()-n.getTime()}var r0=function(t,n,e){return t>Math.min(n,e)&&t<Math.max(n,e)},sa=function(t,n,e){return 3600*t+60*n+e},i0=function(t){var n=Math.floor(t/3600),e=(t-3600*n)/60;return[n,e,t-3600*n-60*e]},a0={DAY:864e5};function ca(t){var n=t.defaultHour,e=t.defaultMinute,o=t.defaultSeconds;if(t.minDate!==void 0){var r=t.minDate.getHours(),i=t.minDate.getMinutes(),a=t.minDate.getSeconds();n<r&&(n=r),n===r&&e<i&&(e=i),n===r&&e===i&&o<a&&(o=t.minDate.getSeconds())}if(t.maxDate!==void 0){var c=t.maxDate.getHours(),l=t.maxDate.getMinutes();(n=Math.min(n,c))===c&&(e=Math.min(l,e)),n===c&&e===l&&(o=t.maxDate.getSeconds())}return{hours:n,minutes:e,seconds:o}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var o=function(a){a&&Object.keys(a).forEach(function(c){return t[c]=a[c]})},r=0,i=n;r<i.length;r++)o(i[r]);return t});var Ct=function(){return Ct=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ct.apply(this,arguments)},Kc=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var o=Array(t),r=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,c=i.length;a<c;a++,r++)o[r]=i[a];return o},s0=300;function c0(t,n){var e={config:Ct(Ct({},bo),nt.defaultConfig),l10n:lr};function o(){var x;return((x=e.calendarContainer)===null||x===void 0?void 0:x.getRootNode()).activeElement||document.activeElement}function r(x){return x.bind(e)}function i(){var x=e.config;x.weekNumbers===!1&&x.showMonths===1||x.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var b=(e.days.offsetWidth+1)*x.showMonths;e.daysContainer.style.width=b+"px",e.calendarContainer.style.width=b+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function a(x){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||Rt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),O=ca(e.config);b.setHours(O.hours,O.minutes,O.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}x!==void 0&&x.type!=="blur"&&function(R){R.preventDefault();var ne=R.type==="keydown",q=Lt(R),z=q;e.amPM!==void 0&&q===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]);var F=parseFloat(z.getAttribute("min")),Z=parseFloat(z.getAttribute("max")),le=parseFloat(z.getAttribute("step")),ie=parseInt(z.value,10),oe=R.delta||(ne?R.which===38?1:-1:0),ee=ie+le*oe;if(z.value!==void 0&&z.value.length===2){var ye=z===e.hourElement,Ae=z===e.minuteElement;ee<F?(ee=Z+ee+Ut(!ye)+(Ut(ye)&&Ut(!e.amPM)),Ae&&g(void 0,-1,e.hourElement)):ee>Z&&(ee=z===e.hourElement?ee-Z-Ut(!e.amPM):F,Ae&&g(void 0,1,e.hourElement)),e.amPM&&ye&&(le===1?ee+ie===23:Math.abs(ee-ie)>le)&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]),z.value=Tt(ee)}}(x);var N=e._input.value;c(),Pe(),e._input.value!==N&&e._debouncedChange()}function c(){if(e.hourElement!==void 0&&e.minuteElement!==void 0){var x,b,O=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(e.minuteElement.value,10)||0)%60,R=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(x=O,b=e.amPM.textContent,O=x%12+12*Ut(b===e.l10n.amPM[1]));var ne=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.minDate,!0)===0,q=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var z=sa(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),F=sa(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Z=sa(O,N,R);if(Z>F&&Z<z){var le=i0(z);O=le[0],N=le[1],R=le[2]}}else{if(q){var ie=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;(O=Math.min(O,ie.getHours()))===ie.getHours()&&(N=Math.min(N,ie.getMinutes())),N===ie.getMinutes()&&(R=Math.min(R,ie.getSeconds()))}if(ne){var oe=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;(O=Math.max(O,oe.getHours()))===oe.getHours()&&N<oe.getMinutes()&&(N=oe.getMinutes()),N===oe.getMinutes()&&(R=Math.max(R,oe.getSeconds()))}}u(O,N,R)}}function l(x){var b=x||e.latestSelectedDateObj;b&&b instanceof Date&&u(b.getHours(),b.getMinutes(),b.getSeconds())}function u(x,b,O){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(x%24,b,O||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Tt(e.config.time_24hr?x:(12+x)%12+12*Ut(x%12==0)),e.minuteElement.value=Tt(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[Ut(x>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Tt(O)))}function p(x){var b=Lt(x),O=parseInt(b.value)+(x.delta||0);(O/1e3>1||x.key==="Enter"&&!/[^\d]/.test(O.toString()))&&ve(O)}function f(x,b,O,N){return b instanceof Array?b.forEach(function(R){return f(x,R,O,N)}):x instanceof Array?x.forEach(function(R){return f(R,b,O,N)}):(x.addEventListener(b,O,N),void e._handlers.push({remove:function(){return x.removeEventListener(b,O,N)}}))}function d(){I("onChange")}function h(x,b){var O=x!==void 0?e.parseDate(x):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),N=e.currentYear,R=e.currentMonth;try{O!==void 0&&(e.currentYear=O.getFullYear(),e.currentMonth=O.getMonth())}catch(ne){ne.message="Invalid date supplied: "+O,e.config.errorHandler(ne)}b&&e.currentYear!==N&&(I("onYearChange"),S()),!b||e.currentYear===N&&e.currentMonth===R||I("onMonthChange"),e.redraw()}function m(x){var b=Lt(x);~b.className.indexOf("arrow")&&g(x,b.classList.contains("arrowUp")?1:-1)}function g(x,b,O){var N=x&&Lt(x),R=O||N&&N.parentNode&&N.parentNode.firstChild,ne=ke("increment");ne.delta=b,R&&R.dispatchEvent(ne)}function y(x,b,O,N){var R=Y(b,!0),ne=He("span",x,b.getDate().toString());return ne.dateObj=b,ne.$i=N,ne.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),x.indexOf("hidden")===-1&&Rt(b,e.now)===0&&(e.todayDateElem=ne,ne.classList.add("today"),ne.setAttribute("aria-current","date")),R?(ne.tabIndex=-1,xe(b)&&(ne.classList.add("selected"),e.selectedDateElem=ne,e.config.mode==="range"&&(Nt(ne,"startRange",e.selectedDates[0]&&Rt(b,e.selectedDates[0],!0)===0),Nt(ne,"endRange",e.selectedDates[1]&&Rt(b,e.selectedDates[1],!0)===0),x==="nextMonthDay"&&ne.classList.add("inRange")))):ne.classList.add("flatpickr-disabled"),e.config.mode==="range"&&function(q){return!(e.config.mode!=="range"||e.selectedDates.length<2)&&Rt(q,e.selectedDates[0])>=0&&Rt(q,e.selectedDates[1])<=0}(b)&&!xe(b)&&ne.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&x!=="prevMonthDay"&&N%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),I("onDayCreate",ne),ne}function w(x){x.focus(),e.config.mode==="range"&&se(x)}function E(x){for(var b=x>0?0:e.config.showMonths-1,O=x>0?e.config.showMonths:-1,N=b;N!=O;N+=x)for(var R=e.daysContainer.children[N],ne=x>0?0:R.children.length-1,q=x>0?R.children.length:-1,z=ne;z!=q;z+=x){var F=R.children[z];if(F.className.indexOf("hidden")===-1&&Y(F.dateObj))return F}}function k(x,b){var O=o(),N=de(O||document.body),R=x!==void 0?x:N?O:e.selectedDateElem!==void 0&&de(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&de(e.todayDateElem)?e.todayDateElem:E(b>0?1:-1);R===void 0?e._input.focus():N?function(ne,q){for(var z=ne.className.indexOf("Month")===-1?ne.dateObj.getMonth():e.currentMonth,F=q>0?e.config.showMonths:-1,Z=q>0?1:-1,le=z-e.currentMonth;le!=F;le+=Z)for(var ie=e.daysContainer.children[le],oe=z-e.currentMonth===le?ne.$i+q:q<0?ie.children.length-1:0,ee=ie.children.length,ye=oe;ye>=0&&ye<ee&&ye!=(q>0?ee:-1);ye+=Z){var Ae=ie.children[ye];if(Ae.className.indexOf("hidden")===-1&&Y(Ae.dateObj)&&Math.abs(ne.$i-ye)>=Math.abs(q))return w(Ae)}e.changeMonth(Z),k(E(Z),0)}(R,b):w(R)}function C(x,b){for(var O=(new Date(x,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((b-1+12)%12,x),R=e.utils.getDaysInMonth(b,x),ne=window.document.createDocumentFragment(),q=e.config.showMonths>1,z=q?"prevMonthDay hidden":"prevMonthDay",F=q?"nextMonthDay hidden":"nextMonthDay",Z=N+1-O,le=0;Z<=N;Z++,le++)ne.appendChild(y("flatpickr-day "+z,new Date(x,b-1,Z),0,le));for(Z=1;Z<=R;Z++,le++)ne.appendChild(y("flatpickr-day",new Date(x,b,Z),0,le));for(var ie=R+1;ie<=42-O&&(e.config.showMonths===1||le%7!=0);ie++,le++)ne.appendChild(y("flatpickr-day "+F,new Date(x,b+1,ie%R),0,le));var oe=He("div","dayContainer");return oe.appendChild(ne),oe}function j(){if(e.daysContainer!==void 0){Pr(e.daysContainer),e.weekNumbers&&Pr(e.weekNumbers);for(var x=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var O=new Date(e.currentYear,e.currentMonth,1);O.setMonth(e.currentMonth+b),x.appendChild(C(O.getFullYear(),O.getMonth()))}e.daysContainer.appendChild(x),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&se()}}function S(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var x=function(N){return!(e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth())&&!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(x(b)){var O=He("option","flatpickr-monthDropdown-month");O.value=new Date(e.currentYear,b).getMonth().toString(),O.textContent=ai(b,e.config.shorthandCurrentMonth,e.l10n),O.tabIndex=-1,e.currentMonth===b&&(O.selected=!0),e.monthsDropdownContainer.appendChild(O)}}}function D(){var x,b=He("div","flatpickr-month"),O=window.document.createDocumentFragment();e.config.showMonths>1||e.config.monthSelectorType==="static"?x=He("span","cur-month"):(e.monthsDropdownContainer=He("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),f(e.monthsDropdownContainer,"change",function(q){var z=Lt(q),F=parseInt(z.value,10);e.changeMonth(F-e.currentMonth),I("onMonthChange")}),S(),x=e.monthsDropdownContainer);var N=Tr("cur-year",{tabindex:"-1"}),R=N.getElementsByTagName("input")[0];R.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&R.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(R.setAttribute("max",e.config.maxDate.getFullYear().toString()),R.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var ne=He("div","flatpickr-current-month");return ne.appendChild(x),ne.appendChild(N),O.appendChild(ne),b.appendChild(O),{container:b,yearElement:R,monthElement:x}}function $(){Pr(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var x=e.config.showMonths;x--;){var b=D();e.yearElements.push(b.yearElement),e.monthElements.push(b.monthElement),e.monthNav.appendChild(b.container)}e.monthNav.appendChild(e.nextMonthNav)}function W(){e.weekdayContainer?Pr(e.weekdayContainer):e.weekdayContainer=He("div","flatpickr-weekdays");for(var x=e.config.showMonths;x--;){var b=He("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return J(),e.weekdayContainer}function J(){if(e.weekdayContainer){var x=e.l10n.firstDayOfWeek,b=Kc(e.l10n.weekdays.shorthand);x>0&&x<b.length&&(b=Kc(b.splice(x,b.length),b.splice(0,x)));for(var O=e.config.showMonths;O--;)e.weekdayContainer.children[O].innerHTML=`
9
+ <span class='flatpickr-weekday'>
10
+ `+b.join("</span><span class='flatpickr-weekday'>")+`
11
+ </span>
12
+ `}}function B(x,b){b===void 0&&(b=!0);var O=b?x:x-e.currentMonth;O<0&&e._hidePrevMonthArrow===!0||O>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=O,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,I("onYearChange"),S()),j(),I("onMonthChange"),Me())}function A(x){return e.calendarContainer.contains(x)}function fe(x){if(e.isOpen&&!e.config.inline){var b=Lt(x),O=A(b),N=!(b===e.input||b===e.altInput||e.element.contains(b)||x.path&&x.path.indexOf&&(~x.path.indexOf(e.input)||~x.path.indexOf(e.altInput)))&&!O&&!A(x.relatedTarget),R=!e.config.ignoredFocusElements.some(function(ne){return ne.contains(b)});N&&R&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&a(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ve(x){if(!(!x||e.config.minDate&&x<e.config.minDate.getFullYear()||e.config.maxDate&&x>e.config.maxDate.getFullYear())){var b=x,O=e.currentYear!==b;e.currentYear=b||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),O&&(e.redraw(),I("onYearChange"),S())}}function Y(x,b){var O;b===void 0&&(b=!0);var N=e.parseDate(x,void 0,b);if(e.config.minDate&&N&&Rt(N,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&N&&Rt(N,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var R=!!e.config.enable,ne=(O=e.config.enable)!==null&&O!==void 0?O:e.config.disable,q=0,z=void 0;q<ne.length;q++){if(typeof(z=ne[q])=="function"&&z(N)||z instanceof Date&&N!==void 0&&z.getTime()===N.getTime())return R;if(typeof z=="string"){var F=e.parseDate(z,void 0,!0);return F&&F.getTime()===N.getTime()?R:!R}if(typeof z=="object"&&N!==void 0&&z.from&&z.to&&N.getTime()>=z.from.getTime()&&N.getTime()<=z.to.getTime())return R}return!R}function de(x){return e.daysContainer!==void 0&&x.className.indexOf("hidden")===-1&&x.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(x)}function he(x){var b=x.target===e._input,O=e._input.value.trimEnd()!==Ie();!b||!O||x.relatedTarget&&A(x.relatedTarget)||e.setDate(e._input.value,!0,x.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Oe(x){var b=Lt(x),O=e.config.wrap?t.contains(b):b===e._input,N=e.config.allowInput,R=e.isOpen&&(!N||!O),ne=e.config.inline&&O&&!N;if(x.keyCode===13&&O){if(N)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(A(b)||R||ne){var q=!!e.timeContainer&&e.timeContainer.contains(b);switch(x.keyCode){case 13:q?(x.preventDefault(),a(),P()):L(x);break;case 27:x.preventDefault(),P();break;case 8:case 46:O&&!e.config.allowInput&&(x.preventDefault(),e.clear());break;case 37:case 39:if(q||O)e.hourElement&&e.hourElement.focus();else{x.preventDefault();var z=o();if(e.daysContainer!==void 0&&(N===!1||z&&de(z))){var F=x.keyCode===39?1:-1;x.ctrlKey?(x.stopPropagation(),B(F),k(E(1),0)):k(void 0,F)}}break;case 38:case 40:x.preventDefault();var Z=x.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?x.ctrlKey?(x.stopPropagation(),ve(e.currentYear-Z),k(E(1),0)):q||k(void 0,7*Z):b===e.currentYearElement?ve(e.currentYear-Z):e.config.enableTime&&(!q&&e.hourElement&&e.hourElement.focus(),a(x),e._debouncedChange());break;case 9:if(q){var le=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(ee){return ee}),ie=le.indexOf(b);if(ie!==-1){var oe=le[ie+(x.shiftKey?-1:1)];x.preventDefault(),(oe||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&x.shiftKey&&(x.preventDefault(),e._input.focus())}}if(e.amPM!==void 0&&b===e.amPM)switch(x.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],c(),Pe();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],c(),Pe()}(O||A(b))&&I("onKeyDown",x)}function se(x,b){if(b===void 0&&(b="flatpickr-day"),e.selectedDates.length===1&&(!x||x.classList.contains(b)&&!x.classList.contains("flatpickr-disabled"))){for(var O=x?x.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),R=Math.min(O,e.selectedDates[0].getTime()),ne=Math.max(O,e.selectedDates[0].getTime()),q=!1,z=0,F=0,Z=R;Z<ne;Z+=a0.DAY)Y(new Date(Z),!0)||(q=q||Z>R&&Z<ne,Z<N&&(!z||Z>z)?z=Z:Z>N&&(!F||Z<F)&&(F=Z));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b)).forEach(function(le){var ie=le.dateObj.getTime(),oe=z>0&&ie<z||F>0&&ie>F;if(oe)return le.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(ee){le.classList.remove(ee)});q&&!oe||(["startRange","inRange","endRange","notAllowed"].forEach(function(ee){le.classList.remove(ee)}),x!==void 0&&(x.classList.add(O<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<O&&ie===N?le.classList.add("startRange"):N>O&&ie===N&&le.classList.add("endRange"),ie>=z&&(F===0||ie<=F)&&r0(ie,N,O)&&le.classList.add("inRange")))})}}function H(){!e.isOpen||e.config.static||e.config.inline||V()}function Q(x){return function(b){var O=e.config["_"+x+"Date"]=e.parseDate(b,e.config.dateFormat),N=e.config["_"+(x==="min"?"max":"min")+"Date"];O!==void 0&&(e[x==="min"?"minDateHasTime":"maxDateHasTime"]=O.getHours()>0||O.getMinutes()>0||O.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(R){return Y(R)}),e.selectedDates.length||x!=="min"||l(O),Pe()),e.daysContainer&&(T(),O!==void 0?e.currentYearElement[x]=O.getFullYear().toString():e.currentYearElement.removeAttribute(x),e.currentYearElement.disabled=!!N&&O!==void 0&&N.getFullYear()===O.getFullYear())}}function me(){return e.config.wrap?t.querySelector("[data-input]"):t}function pe(){typeof e.config.locale!="object"&&nt.l10ns[e.config.locale]===void 0&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Ct(Ct({},nt.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?nt.l10ns[e.config.locale]:void 0),Wn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Wn.l="("+e.l10n.weekdays.longhand.join("|")+")",Wn.M="("+e.l10n.months.shorthand.join("|")+")",Wn.F="("+e.l10n.months.longhand.join("|")+")",Wn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",Ct(Ct({},n),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&nt.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=kf(e),e.parseDate=Va({config:e.config,l10n:e.l10n})}function V(x){if(typeof e.config.position!="function"){if(e.calendarContainer!==void 0){I("onPreCalendarPosition");var b=x||e._positionElement,O=Array.prototype.reduce.call(e.calendarContainer.children,function(Te,Ne){return Te+Ne.offsetHeight},0),N=e.calendarContainer.offsetWidth,R=e.config.position.split(" "),ne=R[0],q=R.length>1?R[1]:null,z=b.getBoundingClientRect(),F=window.innerHeight-z.bottom,Z=ne==="above"||ne!=="below"&&F<O&&z.top>O,le=window.pageYOffset+z.top+(Z?-O-2:b.offsetHeight+2);if(Nt(e.calendarContainer,"arrowTop",!Z),Nt(e.calendarContainer,"arrowBottom",Z),!e.config.inline){var ie=window.pageXOffset+z.left,oe=!1,ee=!1;q==="center"?(ie-=(N-z.width)/2,oe=!0):q==="right"&&(ie-=N-z.width,ee=!0),Nt(e.calendarContainer,"arrowLeft",!oe&&!ee),Nt(e.calendarContainer,"arrowCenter",oe),Nt(e.calendarContainer,"arrowRight",ee);var ye=window.document.body.offsetWidth-(window.pageXOffset+z.right),Ae=ie+N>window.document.body.offsetWidth,Ve=ye+N>window.document.body.offsetWidth;if(Nt(e.calendarContainer,"rightMost",Ae),!e.config.static)if(e.calendarContainer.style.top=le+"px",Ae)if(Ve){var je=function(){for(var Te=null,Ne=0;Ne<document.styleSheets.length;Ne++){var qe=document.styleSheets[Ne];if(qe.cssRules){try{qe.cssRules}catch{continue}Te=qe;break}}return Te??(Kt=document.createElement("style"),document.head.appendChild(Kt),Kt.sheet);var Kt}();if(je===void 0)return;var Ee=window.document.body.offsetWidth,Ce=Math.max(0,Ee/2-N/2),ue=je.cssRules.length,be="{left:"+z.left+"px;right:auto;}";Nt(e.calendarContainer,"rightMost",!1),Nt(e.calendarContainer,"centerMost",!0),je.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+be,ue),e.calendarContainer.style.left=Ce+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ye+"px";else e.calendarContainer.style.left=ie+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,x)}function T(){e.config.noCalendar||e.isMobile||(S(),Me(),j())}function P(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function L(x){x.preventDefault(),x.stopPropagation();var b=Cf(Lt(x),function(Z){return Z.classList&&Z.classList.contains("flatpickr-day")&&!Z.classList.contains("flatpickr-disabled")&&!Z.classList.contains("notAllowed")});if(b!==void 0){var O=b,N=e.latestSelectedDateObj=new Date(O.dateObj.getTime()),R=(N.getMonth()<e.currentMonth||N.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=O,e.config.mode==="single")e.selectedDates=[N];else if(e.config.mode==="multiple"){var ne=xe(N);ne?e.selectedDates.splice(parseInt(ne),1):e.selectedDates.push(N)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=N,e.selectedDates.push(N),Rt(N,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(Z,le){return Z.getTime()-le.getTime()}));if(c(),R){var q=e.currentYear!==N.getFullYear();e.currentYear=N.getFullYear(),e.currentMonth=N.getMonth(),q&&(I("onYearChange"),S()),I("onMonthChange")}if(Me(),j(),Pe(),R||e.config.mode==="range"||e.config.showMonths!==1?e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus():w(O),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var z=e.config.mode==="single"&&!e.config.enableTime,F=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(z||F)&&P()}d()}}e.parseDate=Va({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=f,e._setHoursFromDate=l,e._positionCalendar=V,e.changeMonth=B,e.changeYear=ve,e.clear=function(x,b){if(x===void 0&&(x=!0),b===void 0&&(b=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var O=ca(e.config);u(O.hours,O.minutes,O.seconds)}e.redraw(),x&&I("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),I("onClose")},e.onMouseOver=se,e._createElement=He,e.createDay=y,e.destroy=function(){e.config!==void 0&&I("onDestroy");for(var x=e._handlers.length;x--;)e._handlers[x].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var b=e.calendarContainer.parentNode;if(b.lastChild&&b.removeChild(b.lastChild),b.parentNode){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(O){try{delete e[O]}catch{}})},e.isEnabled=Y,e.jumpToDate=h,e.updateValue=Pe,e.open=function(x,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(x){x.preventDefault();var O=Lt(x);O&&O.blur()}return e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),void I("onOpen")}if(!(e._input.disabled||e.config.inline)){var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),I("onOpen"),V(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&(e.config.allowInput!==!1||x!==void 0&&e.timeContainer.contains(x.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=T,e.set=function(x,b){if(x!==null&&typeof x=="object")for(var O in Object.assign(e.config,x),x)G[O]!==void 0&&G[O].forEach(function(N){return N()});else e.config[x]=b,G[x]!==void 0?G[x].forEach(function(N){return N()}):ra.indexOf(x)>-1&&(e.config[x]=ia(b));e.redraw(),Pe(!0)},e.setDate=function(x,b,O){if(b===void 0&&(b=!1),O===void 0&&(O=e.config.dateFormat),x!==0&&!x||x instanceof Array&&x.length===0)return e.clear(b);U(x,O),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),h(void 0,b),l(),e.selectedDates.length===0&&e.clear(!1),Pe(b),b&&I("onChange")},e.toggle=function(x){if(e.isOpen===!0)return e.close();e.open(x)};var G={locale:[pe,J],showMonths:[$,i,W],minDate:[h],maxDate:[h],positionElement:[te],clickOpens:[function(){e.config.clickOpens===!0?(f(e._input,"focus",e.open),f(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function U(x,b){var O=[];if(x instanceof Array)O=x.map(function(N){return e.parseDate(N,b)});else if(x instanceof Date||typeof x=="number")O=[e.parseDate(x,b)];else if(typeof x=="string")switch(e.config.mode){case"single":case"time":O=[e.parseDate(x,b)];break;case"multiple":O=x.split(e.config.conjunction).map(function(N){return e.parseDate(N,b)});break;case"range":O=x.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,b)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(x)));e.selectedDates=e.config.allowInvalidPreload?O:O.filter(function(N){return N instanceof Date&&Y(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,R){return N.getTime()-R.getTime()})}function re(x){return x.slice().map(function(b){return typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b}).filter(function(b){return b})}function te(){e._positionElement=e.config.positionElement||e._input}function I(x,b){if(e.config!==void 0){var O=e.config[x];if(O!==void 0&&O.length>0)for(var N=0;O[N]&&N<O.length;N++)O[N](e.selectedDates,e.input.value,e,b);x==="onChange"&&(e.input.dispatchEvent(ke("change")),e.input.dispatchEvent(ke("input")))}}function ke(x){var b=document.createEvent("Event");return b.initEvent(x,!0,!0),b}function xe(x){for(var b=0;b<e.selectedDates.length;b++){var O=e.selectedDates[b];if(O instanceof Date&&Rt(O,x)===0)return""+b}return!1}function Me(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(x,b){var O=new Date(e.currentYear,e.currentMonth,1);O.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=ai(O.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=O.getMonth().toString(),x.value=O.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ie(x){var b=x||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(O){return e.formatDate(O,b)}).filter(function(O,N,R){return e.config.mode!=="range"||e.config.enableTime||R.indexOf(O)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Pe(x){x===void 0&&(x=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ie(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ie(e.config.altFormat)),x!==!1&&I("onValueUpdate")}function ge(x){var b=Lt(x),O=e.prevMonthNav.contains(b),N=e.nextMonthNav.contains(b);O||N?B(O?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var b=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],O=Ct(Ct({},JSON.parse(JSON.stringify(t.dataset||{}))),n),N={};e.config.parseDate=O.parseDate,e.config.formatDate=O.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ie){e.config._enable=re(ie)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ie){e.config._disable=re(ie)}});var R=O.mode==="time";if(!O.dateFormat&&(O.enableTime||R)){var ne=nt.defaultConfig.dateFormat||bo.dateFormat;N.dateFormat=O.noCalendar||R?"H:i"+(O.enableSeconds?":S":""):ne+" H:i"+(O.enableSeconds?":S":"")}if(O.altInput&&(O.enableTime||R)&&!O.altFormat){var q=nt.defaultConfig.altFormat||bo.altFormat;N.altFormat=O.noCalendar||R?"h:i"+(O.enableSeconds?":S K":" K"):q+" h:i"+(O.enableSeconds?":S":"")+" K"}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Q("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Q("max")});var z=function(ie){return function(oe){e.config[ie==="min"?"_minTime":"_maxTime"]=e.parseDate(oe,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:z("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:z("max")}),O.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,N,O);for(var F=0;F<b.length;F++)e.config[b[F]]=e.config[b[F]]===!0||e.config[b[F]]==="true";for(ra.filter(function(ie){return e.config[ie]!==void 0}).forEach(function(ie){e.config[ie]=ia(e.config[ie]||[]).map(r)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),F=0;F<e.config.plugins.length;F++){var Z=e.config.plugins[F](e)||{};for(var le in Z)ra.indexOf(le)>-1?e.config[le]=ia(Z[le]).map(r).concat(e.config[le]):O[le]===void 0&&(e.config[le]=Z[le])}O.altInputClass||(e.config.altInputClass=me().className+" "+e.config.altInputClass),I("onParseConfig")}(),pe(),function(){if(e.input=me(),!e.input)return void e.config.errorHandler(new Error("Invalid input element specified"));e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=He(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),te()}(),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var b=e.config.defaultDate||(e.input.nodeName!=="INPUT"&&e.input.nodeName!=="TEXTAREA"||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);b&&U(b,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(b,O){return b===void 0&&(b=e.currentMonth),O===void 0&&(O=e.currentYear),b===1&&(O%4==0&&O%100!=0||O%400==0)?29:e.l10n.daysInMonth[b]}},e.isMobile||function(){var b=window.document.createDocumentFragment();if(e.calendarContainer=He("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(b.appendChild((e.monthNav=He("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=He("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=He("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,$(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(z){e.__hidePrevMonthArrow!==z&&(Nt(e.prevMonthNav,"flatpickr-disabled",z),e.__hidePrevMonthArrow=z)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(z){e.__hideNextMonthArrow!==z&&(Nt(e.nextMonthNav,"flatpickr-disabled",z),e.__hideNextMonthArrow=z)}}),e.currentYearElement=e.yearElements[0],Me(),e.monthNav)),e.innerContainer=He("div","flatpickr-innerContainer"),e.config.weekNumbers){var O=function(){e.calendarContainer.classList.add("hasWeeks");var z=He("div","flatpickr-weekwrapper");z.appendChild(He("span","flatpickr-weekday",e.l10n.weekAbbreviation));var F=He("div","flatpickr-weeks");return z.appendChild(F),{weekWrapper:z,weekNumbers:F}}(),N=O.weekWrapper,R=O.weekNumbers;e.innerContainer.appendChild(N),e.weekNumbers=R,e.weekWrapper=N}e.rContainer=He("div","flatpickr-rContainer"),e.rContainer.appendChild(W()),e.daysContainer||(e.daysContainer=He("div","flatpickr-days"),e.daysContainer.tabIndex=-1),j(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),b.appendChild(e.innerContainer)}e.config.enableTime&&b.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var z=ca(e.config);e.timeContainer=He("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var F=He("span","flatpickr-time-separator",":"),Z=Tr("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=Z.getElementsByTagName("input")[0];var le=Tr("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=le.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?z.hours:function(oe){switch(oe%24){case 0:case 12:return 12;default:return oe%12}}(z.hours)),e.minuteElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():z.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Z),e.timeContainer.appendChild(F),e.timeContainer.appendChild(le),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var ie=Tr("flatpickr-second");e.secondElement=ie.getElementsByTagName("input")[0],e.secondElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():z.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(He("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(ie)}return e.config.time_24hr||(e.amPM=He("span","flatpickr-am-pm",e.l10n.amPM[Ut((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Nt(e.calendarContainer,"rangeMode",e.config.mode==="range"),Nt(e.calendarContainer,"animate",e.config.animate===!0),Nt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(b);var ne=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!ne&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var q=He("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(q,e.element),q.appendChild(e.element),e.altInput&&q.appendChild(e.altInput),q.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(N){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+N+"]"),function(R){return f(R,"click",e[N])})}),e.isMobile)return void function(){var N=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=He("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=N,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}f(e.mobileInput,"change",function(R){e.setDate(Lt(R).value,!1,e.mobileFormatStr),I("onChange"),I("onClose")})}();var b=Zc(H,50);if(e._debouncedChange=Zc(d,s0),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&f(e.daysContainer,"mouseover",function(N){e.config.mode==="range"&&se(Lt(N))}),f(e._input,"keydown",Oe),e.calendarContainer!==void 0&&f(e.calendarContainer,"keydown",Oe),e.config.inline||e.config.static||f(window,"resize",b),window.ontouchstart!==void 0?f(window.document,"touchstart",fe):f(window.document,"mousedown",fe),f(window.document,"focus",fe,{capture:!0}),e.config.clickOpens===!0&&(f(e._input,"focus",e.open),f(e._input,"click",e.open)),e.daysContainer!==void 0&&(f(e.monthNav,"click",ge),f(e.monthNav,["keyup","increment"],p),f(e.daysContainer,"click",L)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var O=function(N){return Lt(N).select()};f(e.timeContainer,["increment"],a),f(e.timeContainer,"blur",a,{capture:!0}),f(e.timeContainer,"click",m),f([e.hourElement,e.minuteElement],["focus","click"],O),e.secondElement!==void 0&&f(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&f(e.amPM,"click",function(N){a(N)})}e.config.allowInput&&f(e._input,"blur",he)}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),Pe(!1)),i();var x=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&x&&V(),I("onReady")}(),e}function wo(t,n){for(var e=Array.prototype.slice.call(t).filter(function(a){return a instanceof HTMLElement}),o=[],r=0;r<e.length;r++){var i=e[r];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=c0(i,n||{}),o.push(i._flatpickr)}catch(a){console.error(a)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return wo(this,t)},HTMLElement.prototype.flatpickr=function(t){return wo([this],t)});var nt=function(t,n){return typeof t=="string"?wo(window.document.querySelectorAll(t),n):t instanceof Node?wo([t],n):wo(t,n)};nt.defaultConfig={},nt.l10ns={en:Ct({},lr),default:Ct({},lr)},nt.localize=function(t){nt.l10ns.default=Ct(Ct({},nt.l10ns.default),t)},nt.setDefaults=function(t){nt.defaultConfig=Ct(Ct({},nt.defaultConfig),t)},nt.parseDate=Va({}),nt.formatDate=kf({}),nt.compareDates=Rt,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(t){return wo(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=nt);const l0=["onCreate","onDestroy"],la=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],u0=t=>{const n=v.useMemo(()=>({...t}),[t]),{defaultValue:e,options:o={},value:r,children:i,render:a}=n,c=v.useMemo(()=>((d,h)=>(la.forEach(m=>{const g=h[m],y=d[m];if(g){y&&!Array.isArray(y)?d[m]=[d[m]]:d[m]||(d[m]=[]);const w=Array.isArray(g)?g:[g];d[m].length===0?d[m]=w:d[m].push(...w)}}),la.forEach(m=>{delete h[m]}),l0.forEach(m=>{delete h[m]}),d))(o,n),[o,n]),l=v.useRef(null),u=v.useRef(void 0);v.useImperativeHandle(t.ref,()=>({get flatpickr(){return u.current}}),[]),v.useEffect(()=>{var d;if(c.onClose=c.onClose||(()=>{var m;(m=l.current)!=null&&m.blur&&l.current.blur()}),u.current=(((h=nt)==null?void 0:h.default)||nt)(l.current,c),u.current&&r!==void 0&&u.current.setDate(r,!1),t.onCreate&&t.onCreate(u.current),u.current){const m=Object.getOwnPropertyNames(c);for(let g=m.length-1;g>=0;g--){const y=m[g];let w=c[y];(w==null?void 0:w.toString())!==((d=u.current.config[y])==null?void 0:d.toString())&&(la.includes(y)&&!Array.isArray(w)&&(w=[w]),u.current.set(y,w))}r!==void 0&&r!==u.current.input.value&&u.current.setDate(r,!1)}var h;return()=>{t.onDestroy&&t.onDestroy(u.current),u.current&&u.current.destroy(),u.current=void 0}},[c,o,n,r,t]);const p=v.useCallback(d=>{l.current=d},[]);if(a)return a({...n,defaultValue:e,value:r},p);const f=v.useCallback(d=>{var h,m;t&&t.onChange&&(Array.isArray(t==null?void 0:t.onChange)?(h=t==null?void 0:t.onChange)==null||h.forEach(()=>[new Date(d.target.value)],(r==null?void 0:r.toString())||""):typeof t.onChange=="function"&&((m=t==null?void 0:t.onChange)==null||m.call(t,[new Date(d.target.value)],(r==null?void 0:r.toString())||"",u.current)))},[t,r]);return o.wrap?s.jsx("div",{className:"flatpickr",ref:p,children:i}):s.jsx("input",{onChange:f,...n,value:r==null?void 0:r.toString(),defaultValue:e,ref:p})},qc="T42.GD.Execute",Ef=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Sf=(t,n)=>t in n;function d0({time:t,frequency:n,day:e}){const o=new Date(`01/01/2000 ${t}`),r=o.getMinutes(),i=o.getHours();let a="*";return n==="weekly"&&e&&(a=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Sf(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(e).toString()),`${r} ${i} * * ${a}`}function f0(t){const n=v.useContext(_e.IOConnectContext),{value:e,update:o}=Ht({prefKey:_r(t)}),{value:r,update:i}=Ht({prefKey:_r(t,"Time")}),{value:a,update:c}=Ht({prefKey:_r(t,"Frequency")}),{value:l,update:u}=Ht({prefKey:_r(t,"Day")}),p=v.useCallback(async()=>{try{await n.interop.invoke(qc,{command:`cancel-${t}`})}catch(d){console.error(d)}},[n,t]),f=v.useCallback(async()=>{try{const d=d0({time:r??"12:00 AM",frequency:a??"daily",day:a==="weekly"?l:"*"});await n.interop.invoke(qc,{command:`schedule-${t}`,args:{cronTime:d,discardUnsavedLayoutChanges:!1}})}catch(d){console.error(`Failed to update cron job for ${t}:`,d)}},[n,t,r,a,l]);return v.useEffect(()=>{n&&e&&f()},[n,e,f]),{enabled:e??!1,time:r??"12:00 AM",frequency:a??"daily",day:l??"Monday",setEnabled:async d=>{d||await p();try{await o(d)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async d=>{try{await i(d)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async d=>{try{await c(d),d==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async d=>{var h;if(h=d,Ef.includes(h))try{await u(d)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function _r(t,n){const e=t==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return n?`${e}${n}`:e}function jf({className:t,variant:n,...e}){const o=K("io-block-list-gap",n,t),{enabled:r,time:i,frequency:a,day:c,setEnabled:l,setTime:u,setFrequency:p,setDay:f}=f0(n);return s.jsxs(Ye,{className:o,...e,children:[s.jsx(ft,{label:`Schedule ${n}`,align:"right",onChange:d=>l(d.target.checked),checked:r}),s.jsxs("div",{className:"scheduler-controls",children:[s.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[s.jsx(Xe,{variant:"clock"}),s.jsx(u0,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:i,clickOpens:!0},value:i,onClose:async([d])=>{const h=d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await u(h)}})]}),s.jsxs(Jt,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[s.jsx(Jt.Item,{onClick:()=>p("daily"),children:"Daily"}),s.jsx(Jt.Item,{onClick:()=>p("weekly"),children:"Weekly"})]}),a==="weekly"&&s.jsx(Jt,{text:c,icon:"chevron-down",iconRight:!0,children:Ef.map(d=>s.jsx(Jt.Item,{onClick:()=>f(d),children:d},d))})]})]})}function p0({className:t,...n}){return s.jsx(jf,{...n,className:t,variant:"restart"})}function h0({className:t,...n}){return s.jsx(jf,{...n,className:t,variant:"shutdown"})}const Of={Body:Wg,General:$g,Theme:Cs,PinnedPosition:Vg,AllowDocking:Gg,MinimizeToTray:Yg,AutoClose:Zg,ShowTutorialOnStartup:Kg,Layouts:qg,LayoutsRestoreLastSaved:Jg,LayoutsSaveCurrentOnExit:Xg,LayoutsShowUnsavedChangesPrompt:ks,LayoutsShowDeletePrompt:Es,Downloads:Qg,DownloadsAskForEachDownload:e0,DownloadsLocation:t0,System:n0,SystemRestartSection:p0,SystemShutdownSection:h0},Nf=v.createContext(Of),m0=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...Of,...n}),[n]);return s.jsx(Nf.Provider,{value:e,children:t})});m0.displayName="PreferencesPanelComponentsStoreProvider";const gr=()=>v.useContext(Nf),g0=({className:t,onClose:n,title:e="Platform Preferences",children:o,...r})=>s.jsxs(Ke,{className:K("io-preferences-panel",t),...r,children:[s.jsxs(Ke.Header,{children:[s.jsx(Ke.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ke.Header.ButtonGroup,{children:s.jsx(Ke.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),o]}),If=t=>{const{General:n,Layouts:e,Widget:o}=vr();return s.jsxs(Eo,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{})]})},Af=({className:t,title:n="General",...e})=>{const{Theme:o}=vr();return s.jsx(Ye,{className:K("io-block io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},Pf=({className:t,title:n="Layouts",...e})=>{const{LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=vr();return s.jsxs(Ye,{className:K("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(r,{}),s.jsx(o,{})]})},Tf=({className:t,title:n="Widget",...e})=>{const{WidgetEnableForExternalApps:o}=vr();return s.jsx(Ye,{className:K("io-block io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},_f=({align:t="right",label:n="Enable for external apps",...e})=>s.jsx(an,{align:t,label:n,prefKey:Hu,...e}),Df={Body:If,General:Af,Theme:Cs,Layouts:Pf,LayoutsShowUnsavedChangesPrompt:ks,LayoutsShowDeletePrompt:Es,Widget:Tf,WidgetEnableForExternalApps:_f},Mf=v.createContext(Df),Lf=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...Df,...n}),[n]);return s.jsx(Mf.Provider,{value:e,children:t})});Lf.displayName="PreferencesPanelComponentsStoreProvider";const vr=()=>v.useContext(Mf),v0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=vr();return s.jsx(g0,{title:n,onClose:t,...e,children:s.jsx(o,{})})};var y0=Object.freeze({__proto__:null,General:Af,Layouts:Pf,LayoutsShowDeletePrompt:Es,LayoutsShowUnsavedChangesPrompt:ks,Panel:({components:t,...n})=>s.jsx(Lf,{components:t,children:s.jsx(v0,{...n})}),PanelBody:If,Theme:Cs,Widget:Tf,WidgetEnableForExternalApps:_f});const b0=({name:t,value:n})=>s.jsxs("div",{className:"io-profile-section-item",children:[s.jsx("div",{className:"io-profile-section-item-name",children:t}),s.jsx("div",{className:"io-profile-section-item-value",children:n})]}),Rf=({className:t,items:n,title:e})=>s.jsxs("div",{className:K("io-profile-section-body",t),children:[e&&s.jsx(nn,{className:"io-profile-section-title",text:e}),n.map(({name:o,value:r})=>s.jsx(b0,{name:o,value:r},o))]}),Ss=({className:t,items:n,title:e})=>s.jsxs("section",{className:K("io-profile-section",t),children:[s.jsx(Rf,{items:n,title:e}),s.jsx(xi,{className:"mt-8"})]}),Ff=({title:t="License",...n})=>s.jsx(Ss,{title:t,...n}),Bf=({title:t="Version",...n})=>s.jsx(Ss,{title:t,...n}),Hf=({title:t="Plugins",...n})=>s.jsx(Ss,{title:t,...n}),zf=({className:t})=>{const n=Si()?"io.Connect Desktop":"io.Connect Browser";return s.jsxs("div",{className:K("io-trademark-container",t),children:[s.jsx("h4",{className:"io-trademark-title",children:n}),s.jsxs("p",{className:"io-trademark-text",children:[n,"® is a registered trademark of"," ",s.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},Wf=({avatarInitials:t=Si()?"CD":"CB",className:n,items:e,onLogout:o,title:r})=>s.jsxs("section",{className:K("io-profile-section",n),children:[s.jsxs("div",{className:"io-user-details-container",children:[s.jsx("div",{className:"io-user-avatar",children:t}),s.jsx(Rf,{className:"mt-12",items:e,title:r})]}),o&&s.jsx(Ge,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),s.jsx(xi,{className:"mt-8"})]}),$f={LicenseSection:Ff,ProductsInfoSection:Bf,PluginsSection:Hf,Trademark:zf,UserSection:Wf},Uf=v.createContext($f),Vf=v.memo(({children:t,components:n})=>{const e=v.useMemo(()=>({...$f,...n}),[n]);return s.jsx(Uf.Provider,{value:e,children:t})});Vf.displayName="ProfilePanelComponentsStoreProvider";const w0=t=>{const n=new Date(t);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>n.toLocaleDateString("en",e)).join(" ")},x0=t=>{if(!t)return{items:[]};const n=[...t.email?[{name:"Email",value:t.email}]:[],...t.type?[{name:"User Type",value:t.type}]:[],...t.role?[{name:"User Role",value:t.role}]:[]];if(t.firstName||t.lastName){const e=[t.firstName,t.lastName].filter(o=>!!o);return{avatarInitials:e.map(o=>o.charAt(0)).join(""),items:n,title:e.join(" ")}}return t.username?{avatarInitials:t.username.charAt(0),items:n,title:t.username}:t.email?{avatarInitials:t.email.charAt(0),items:n}:{items:n}},C0=t=>{const n=new Date(2023,5,6),e=t.expiration<n.getTime()?1e3:1;return{items:[{name:"Type",value:t.type},{name:"Expiration Date",value:w0(t.expiration*e)}]}},k0=t=>({items:t.map(n=>({name:n.name,value:n.version}))}),E0=t=>{var e;const n={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:t.platform.apiVersion},{name:"io.Connect Browser client",value:t.client.apiVersion},...t.workspaces?[{name:"Workspaces API",value:t.workspaces.apiVersion}]:[],...(e=t.workspaces)!=null&&e.container&&Sf(t.workspaces.container.type,n)?[{name:n[t.workspaces.container.type],value:t.workspaces.container.version}]:[],...t.home?[{name:"Home UI",value:t.home.version}]:[],...t.search?[{name:"Search API",value:t.search.apiVersion}]:[],...t.modals?[{name:"Modals API",value:t.modals.apiVersion}]:[]]}},S0=()=>{const t=window.glue42gd??window.iodesktop;if(!t)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:n,env:e}=t,o=[{name:"Environment",value:e.env},{name:"Region",value:e.region}];return n?{avatarInitials:n.charAt(0),items:o,title:n}:{items:o}},j0=t=>({items:Object.entries(t??{}).map(([e,o])=>({name:e,value:o}))}),O0=t=>({items:t.map(({product:e,version:o})=>({name:e,value:o}))}),N0=t=>Si()?(async n=>{const{licInfo:e,productInfo:o}=(await n.interop.invoke("T42.GD.GetInfo")).returned;return{user:S0(),license:j0(e),productsInfo:O0(o)}})(t):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const n=await window.iobrowser.system.getProfileData();return{user:x0(n.user),license:C0(n.license),plugins:k0(n.plugins),productsInfo:E0(n.productsInfo)}})(),I0=({className:t,onClose:n,onLogout:e,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:c,Trademark:l,UserSection:u}=v.useContext(Uf),p=v.useContext(_e.IOConnectContext),[f,d]=v.useState(null);return v.useEffect(()=>{p&&(async()=>{const m=await N0(p);d(m)})().catch(console.error)},[p]),s.jsxs(Ke,{className:K("io-profile-panel",t),...r,children:[s.jsxs(Ke.Header,{children:[s.jsx(Ke.Header.Title,{size:"large",text:o}),s.jsx(Ke.Header.ButtonGroup,{children:s.jsx(Ke.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsxs(Ke.Body,{children:[f!=null&&f.user.items.length||f!=null&&f.user.title?s.jsx(u,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:e,title:f.user.title}):null,s.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[f!=null&&f.license.items.length?s.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?s.jsx(a,{items:f.productsInfo.items}):null,(h=f==null?void 0:f.plugins)!=null&&h.items.length?s.jsx(c,{items:f.plugins.items}):null]}),s.jsx(l,{className:"mt-auto"})]})]})};var A0=Object.freeze({__proto__:null,LicenseSection:Ff,Panel:({components:t,...n})=>s.jsx(Vf,{components:t,children:s.jsx(I0,{...n})}),PluginsSection:Hf,ProductsInfoSection:Bf,Trademark:zf,UserSection:Wf});const P0=y0,tr=t=>"items"in t,wt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Ga=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),Gf=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",si={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},Yf=Gf()?[]:[{name:si.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:si.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],ci={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},Zf=[{name:ci.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:ci.DELETE,displayName:"Delete",icon:"trash-can"}],ur={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Ti=new Intl.Collator(void 0,{sensitivity:"base"}),Kf=(t,n)=>Ti.compare(t.title,n.title),qf=(t,n)=>Ti.compare(n.title,t.title),js=t=>{const{items:n,sortOrder:e,ascendingCompare:o,descendingCompare:r}=t;if(e===ur.DISABLED)return n;const i=e===ur.ASCENDING?o:r;return[...n].sort(i)},xo={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},Ya=(t,n,e,o)=>{const{isFolderCollapsible:r}=o,i="/",[a,...c]=e.split(i),l=t.findIndex(p=>tr(p)&&p.title===a),u=l!==-1?t[l]:null;return u?[...t.slice(0,l),{...u,items:c.length>0?Ya(u.items,n,c.join(i),o):[...u.items,n]},...t.slice(l+1)]:[...t,{id:a,title:a,items:c.length>0?Ya([],n,c.join(i),o):[n],isCollapsible:r}]},li=t=>{const{title:n,userProperties:e}=t,{folder:o}=e;return o?`${o}/${n}`:n},T0=(t,n)=>Ti.compare(li(t),li(n)),_0=(t,n)=>Ti.compare(li(n),li(t)),D0=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=ur.ASCENDING}=e,a=js({items:t,sortOrder:r,ascendingCompare:T0,descendingCompare:_0}).reduce((c,l)=>{var f;const u={id:l.id,title:l.title,description:l.caption,type:wt.APPLICATION,icon:"application",iconSrc:l.icon,openInstances:(f=n[l.name])==null?void 0:f.length,contextMenuActions:Yf},p=l.userProperties.folder;return p?Ya(c,u,p,e):[...c,u]},[]);return{id:xo.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var M0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Za={exports:{}},Dr={exports:{}},ze={};/** @license React v16.13.1
13
+ * react-is.production.min.js
14
+ *
15
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */var Jc;function L0(){if(Jc)return ze;Jc=1;var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,w=t?Symbol.for("react.responder"):60118,E=t?Symbol.for("react.scope"):60119;function k(j){if(typeof j=="object"&&j!==null){var S=j.$$typeof;switch(S){case n:switch(j=j.type,j){case l:case u:case o:case i:case r:case f:return j;default:switch(j=j&&j.$$typeof,j){case c:case p:case m:case h:case a:return j;default:return S}}case e:return S}}}function C(j){return k(j)===u}return ze.AsyncMode=l,ze.ConcurrentMode=u,ze.ContextConsumer=c,ze.ContextProvider=a,ze.Element=n,ze.ForwardRef=p,ze.Fragment=o,ze.Lazy=m,ze.Memo=h,ze.Portal=e,ze.Profiler=i,ze.StrictMode=r,ze.Suspense=f,ze.isAsyncMode=function(j){return C(j)||k(j)===l},ze.isConcurrentMode=C,ze.isContextConsumer=function(j){return k(j)===c},ze.isContextProvider=function(j){return k(j)===a},ze.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===n},ze.isForwardRef=function(j){return k(j)===p},ze.isFragment=function(j){return k(j)===o},ze.isLazy=function(j){return k(j)===m},ze.isMemo=function(j){return k(j)===h},ze.isPortal=function(j){return k(j)===e},ze.isProfiler=function(j){return k(j)===i},ze.isStrictMode=function(j){return k(j)===r},ze.isSuspense=function(j){return k(j)===f},ze.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===o||j===u||j===i||j===r||j===f||j===d||typeof j=="object"&&j!==null&&(j.$$typeof===m||j.$$typeof===h||j.$$typeof===a||j.$$typeof===c||j.$$typeof===p||j.$$typeof===y||j.$$typeof===w||j.$$typeof===E||j.$$typeof===g)},ze.typeOf=k,ze}var We={};/** @license React v16.13.1
20
+ * react-is.development.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Xc;function R0(){return Xc||(Xc=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,w=t?Symbol.for("react.responder"):60118,E=t?Symbol.for("react.scope"):60119;function k(I){return typeof I=="string"||typeof I=="function"||I===o||I===u||I===i||I===r||I===f||I===d||typeof I=="object"&&I!==null&&(I.$$typeof===m||I.$$typeof===h||I.$$typeof===a||I.$$typeof===c||I.$$typeof===p||I.$$typeof===y||I.$$typeof===w||I.$$typeof===E||I.$$typeof===g)}function C(I){if(typeof I=="object"&&I!==null){var ke=I.$$typeof;switch(ke){case n:var xe=I.type;switch(xe){case l:case u:case o:case i:case r:case f:return xe;default:var Me=xe&&xe.$$typeof;switch(Me){case c:case p:case m:case h:case a:return Me;default:return ke}}case e:return ke}}}var j=l,S=u,D=c,$=a,W=n,J=p,B=o,A=m,fe=h,ve=e,Y=i,de=r,he=f,Oe=!1;function se(I){return Oe||(Oe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(I)||C(I)===l}function H(I){return C(I)===u}function Q(I){return C(I)===c}function me(I){return C(I)===a}function pe(I){return typeof I=="object"&&I!==null&&I.$$typeof===n}function V(I){return C(I)===p}function T(I){return C(I)===o}function P(I){return C(I)===m}function L(I){return C(I)===h}function G(I){return C(I)===e}function U(I){return C(I)===i}function re(I){return C(I)===r}function te(I){return C(I)===f}We.AsyncMode=j,We.ConcurrentMode=S,We.ContextConsumer=D,We.ContextProvider=$,We.Element=W,We.ForwardRef=J,We.Fragment=B,We.Lazy=A,We.Memo=fe,We.Portal=ve,We.Profiler=Y,We.StrictMode=de,We.Suspense=he,We.isAsyncMode=se,We.isConcurrentMode=H,We.isContextConsumer=Q,We.isContextProvider=me,We.isElement=pe,We.isForwardRef=V,We.isFragment=T,We.isLazy=P,We.isMemo=L,We.isPortal=G,We.isProfiler=U,We.isStrictMode=re,We.isSuspense=te,We.isValidElementType=k,We.typeOf=C}()),We}var Qc;function Jf(){return Qc||(Qc=1,process.env.NODE_ENV==="production"?Dr.exports=L0():Dr.exports=R0()),Dr.exports}/*
27
+ object-assign
28
+ (c) Sindre Sorhus
29
+ @license MIT
30
+ */var ua,el;function F0(){if(el)return ua;el=1;var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function o(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var l=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(p){u[p]=p}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ua=r()?Object.assign:function(i,a){for(var c,l=o(i),u,p=1;p<arguments.length;p++){c=Object(arguments[p]);for(var f in c)n.call(c,f)&&(l[f]=c[f]);if(t){u=t(c);for(var d=0;d<u.length;d++)e.call(c,u[d])&&(l[u[d]]=c[u[d]])}}return l},ua}var da,tl;function Os(){if(tl)return da;tl=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return da=t,da}var fa,nl;function Xf(){return nl||(nl=1,fa=Function.call.bind(Object.prototype.hasOwnProperty)),fa}var pa,ol;function B0(){if(ol)return pa;ol=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var n=Os(),e={},o=Xf();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function r(i,a,c,l,u){if(process.env.NODE_ENV!=="production"){for(var p in i)if(o(i,p)){var f;try{if(typeof i[p]!="function"){var d=Error((l||"React class")+": "+c+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=i[p](a,p,l,c,null,n)}catch(m){f=m}if(f&&!(f instanceof Error)&&t((l||"React class")+": type specification of "+c+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in e)){e[f.message]=!0;var h=u?u():"";t("Failed "+c+" type: "+f.message+(h??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(e={})},pa=r,pa}var ha,rl;function H0(){if(rl)return ha;rl=1;var t=Jf(),n=F0(),e=Os(),o=Xf(),r=B0(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(c){var l="Warning: "+c;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return ha=function(c,l){var u=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function f(H){var Q=H&&(u&&H[u]||H[p]);if(typeof Q=="function")return Q}var d="<<anonymous>>",h={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:E(),arrayOf:k,element:C(),elementType:j(),instanceOf:S,node:J(),objectOf:$,oneOf:D,oneOfType:W,shape:A,exact:fe};function m(H,Q){return H===Q?H!==0||1/H===1/Q:H!==H&&Q!==Q}function g(H,Q){this.message=H,this.data=Q&&typeof Q=="object"?Q:{},this.stack=""}g.prototype=Error.prototype;function y(H){if(process.env.NODE_ENV!=="production")var Q={},me=0;function pe(T,P,L,G,U,re,te){if(G=G||d,re=re||L,te!==e){if(l){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ke=G+":"+L;!Q[ke]&&me<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Q[ke]=!0,me++)}}return P[L]==null?T?P[L]===null?new g("The "+U+" `"+re+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new g("The "+U+" `"+re+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:H(P,L,G,U,re)}var V=pe.bind(null,!1);return V.isRequired=pe.bind(null,!0),V}function w(H){function Q(me,pe,V,T,P,L){var G=me[pe],U=de(G);if(U!==H){var re=he(G);return new g("Invalid "+T+" `"+P+"` of type "+("`"+re+"` supplied to `"+V+"`, expected ")+("`"+H+"`."),{expectedType:H})}return null}return y(Q)}function E(){return y(a)}function k(H){function Q(me,pe,V,T,P){if(typeof H!="function")return new g("Property `"+P+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var L=me[pe];if(!Array.isArray(L)){var G=de(L);return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an array."))}for(var U=0;U<L.length;U++){var re=H(L,U,V,T,P+"["+U+"]",e);if(re instanceof Error)return re}return null}return y(Q)}function C(){function H(Q,me,pe,V,T){var P=Q[me];if(!c(P)){var L=de(P);return new g("Invalid "+V+" `"+T+"` of type "+("`"+L+"` supplied to `"+pe+"`, expected a single ReactElement."))}return null}return y(H)}function j(){function H(Q,me,pe,V,T){var P=Q[me];if(!t.isValidElementType(P)){var L=de(P);return new g("Invalid "+V+" `"+T+"` of type "+("`"+L+"` supplied to `"+pe+"`, expected a single ReactElement type."))}return null}return y(H)}function S(H){function Q(me,pe,V,T,P){if(!(me[pe]instanceof H)){var L=H.name||d,G=se(me[pe]);return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("instance of `"+L+"`."))}return null}return y(Q)}function D(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function Q(me,pe,V,T,P){for(var L=me[pe],G=0;G<H.length;G++)if(m(L,H[G]))return null;var U=JSON.stringify(H,function(te,I){var ke=he(I);return ke==="symbol"?String(I):I});return new g("Invalid "+T+" `"+P+"` of value `"+String(L)+"` "+("supplied to `"+V+"`, expected one of "+U+"."))}return y(Q)}function $(H){function Q(me,pe,V,T,P){if(typeof H!="function")return new g("Property `"+P+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var L=me[pe],G=de(L);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an object."));for(var U in L)if(o(L,U)){var re=H(L,U,V,T,P+"."+U,e);if(re instanceof Error)return re}return null}return y(Q)}function W(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var Q=0;Q<H.length;Q++){var me=H[Q];if(typeof me!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Oe(me)+" at index "+Q+"."),a}function pe(V,T,P,L,G){for(var U=[],re=0;re<H.length;re++){var te=H[re],I=te(V,T,P,L,G,e);if(I==null)return null;I.data&&o(I.data,"expectedType")&&U.push(I.data.expectedType)}var ke=U.length>0?", expected one of type ["+U.join(", ")+"]":"";return new g("Invalid "+L+" `"+G+"` supplied to "+("`"+P+"`"+ke+"."))}return y(pe)}function J(){function H(Q,me,pe,V,T){return ve(Q[me])?null:new g("Invalid "+V+" `"+T+"` supplied to "+("`"+pe+"`, expected a ReactNode."))}return y(H)}function B(H,Q,me,pe,V){return new g((H||"React class")+": "+Q+" type `"+me+"."+pe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function A(H){function Q(me,pe,V,T,P){var L=me[pe],G=de(L);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));for(var U in H){var re=H[U];if(typeof re!="function")return B(V,T,P,U,he(re));var te=re(L,U,V,T,P+"."+U,e);if(te)return te}return null}return y(Q)}function fe(H){function Q(me,pe,V,T,P){var L=me[pe],G=de(L);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));var U=n({},me[pe],H);for(var re in U){var te=H[re];if(o(H,re)&&typeof te!="function")return B(V,T,P,re,he(te));if(!te)return new g("Invalid "+T+" `"+P+"` key `"+re+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(me[pe],null," ")+`
31
+ Valid keys: `+JSON.stringify(Object.keys(H),null," "));var I=te(L,re,V,T,P+"."+re,e);if(I)return I}return null}return y(Q)}function ve(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every(ve);if(H===null||c(H))return!0;var Q=f(H);if(Q){var me=Q.call(H),pe;if(Q!==H.entries){for(;!(pe=me.next()).done;)if(!ve(pe.value))return!1}else for(;!(pe=me.next()).done;){var V=pe.value;if(V&&!ve(V[1]))return!1}}else return!1;return!0;default:return!1}}function Y(H,Q){return H==="symbol"?!0:Q?Q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Q instanceof Symbol:!1}function de(H){var Q=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":Y(Q,H)?"symbol":Q}function he(H){if(typeof H>"u"||H===null)return""+H;var Q=de(H);if(Q==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return Q}function Oe(H){var Q=he(H);switch(Q){case"array":case"object":return"an "+Q;case"boolean":case"date":case"regexp":return"a "+Q;default:return Q}}function se(H){return!H.constructor||!H.constructor.name?d:H.constructor.name}return h.checkPropTypes=r,h.resetWarningCache=r.resetWarningCache,h.PropTypes=h,h},ha}var ma,il;function z0(){if(il)return ma;il=1;var t=Os();function n(){}function e(){}return e.resetWarningCache=n,ma=function(){function o(a,c,l,u,p,f){if(f!==t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:e,resetWarningCache:n};return i.PropTypes=i,i},ma}if(process.env.NODE_ENV!=="production"){var W0=Jf(),$0=!0;Za.exports=H0()(W0.isElement,$0)}else Za.exports=z0()();var U0=Za.exports;const X=_i(U0);var Qf={exports:{}};/*!
32
+ Copyright (c) 2018 Jed Watson.
33
+ Licensed under the MIT License (MIT), see
34
+ http://jedwatson.github.io/classnames
35
+ */(function(t){(function(){var n={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(i=r(i,o(c)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var c in i)n.call(i,c)&&i[c]&&(a=r(a,c));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(e.default=e,t.exports=e):window.classNames=e})()})(Qf);var V0=Qf.exports;const ot=_i(V0);function Ka(t){"@babel/helpers - typeof";return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ka(t)}var G0;function Di(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G0;return n?t.split(" ").map(function(e){return n[e]||e}).join(" "):t}function Y0(t,n){var e={};return Object.keys(t).forEach(function(o){n.indexOf(o)===-1&&(e[o]=t[o])}),e}function Z0(t,n){for(var e=Array.isArray(n)?n:[n],o=e.length,r,i={};o>0;)o-=1,r=e[o],i[r]=t[r];return i}var K0=(typeof window>"u"?"undefined":Ka(window))==="object"&&window.Element||function(){};function q0(t,n,e){if(!(t[n]instanceof K0))return new Error("Invalid prop `"+n+"` supplied to `"+e+"`. Expected prop to be an instance of Element. Validation failed.")}X.oneOfType([X.string,X.func,q0,X.shape({current:X.any})]);var Ns=X.oneOfType([X.func,X.string,X.shape({$$typeof:X.symbol,render:X.func}),X.arrayOf(X.oneOfType([X.func,X.string,X.shape({$$typeof:X.symbol,render:X.func})]))]),J0={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},al=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Mr={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},X0=["className","cssModule","variant","innerRef"];function qa(){return qa=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},qa.apply(this,arguments)}function sl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Q0(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?sl(Object(e),!0).forEach(function(o){ev(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):sl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function ev(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function tv(t,n){if(t==null)return{};var e=nv(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function nv(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var ov={active:X.bool,"aria-label":X.string,onClick:X.func,variant:X.oneOf(["white"]),className:X.string,cssModule:X.object,innerRef:X.oneOfType([X.object,X.string,X.func])};function ep(t){var n=t.className;t.cssModule;var e=t.variant,o=t.innerRef,r=tv(t,X0),i=Di(ot(n,"btn-close",e&&"btn-close-".concat(e)));return v.createElement("button",qa({ref:o,type:"button",className:i},Q0({"aria-label":"close"},r)))}ep.propTypes=ov;var rv=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function Ja(){return Ja=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ja.apply(this,arguments)}function iv(t,n){if(t==null)return{};var e=av(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function av(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var sv={active:X.bool,"aria-label":X.string,block:X.bool,children:X.node,className:X.string,cssModule:X.object,close:X.bool,color:X.string,disabled:X.bool,innerRef:X.oneOfType([X.object,X.func,X.string]),onClick:X.func,outline:X.bool,size:X.string,tag:Ns};function ui(t){var n=v.useCallback(function(E){if(t.disabled){E.preventDefault();return}if(t.onClick)return t.onClick(E)},[t.onClick,t.disabled]),e=t.active,o=t["aria-label"],r=t.block,i=t.className,a=t.close,c=t.cssModule,l=t.color,u=l===void 0?"secondary":l,p=t.outline,f=t.size,d=t.tag,h=d===void 0?"button":d,m=t.innerRef,g=iv(t,rv);if(a)return v.createElement(ep,g);var y="btn".concat(p?"-outline":"","-").concat(u),w=Di(ot(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:e,disabled:t.disabled}),c);return g.href&&h==="button"&&(h="a"),v.createElement(h,Ja({type:h==="button"&&g.onClick?"button":void 0},g,{className:w,ref:m,onClick:n,"aria-label":o}))}ui.propTypes=sv;var cl=function(n){return n.reduce(function(e,o){var r=o[0],i=o[1];return e[r]=i,e},{})},ll=typeof window<"u"&&window.document&&window.document.createElement?_.useLayoutEffect:_.useEffect,Dt="top",Yt="bottom",Zt="right",Mt="left",Is="auto",yr=[Dt,Yt,Zt,Mt],So="start",dr="end",cv="clippingParents",tp="viewport",Uo="popper",lv="reference",ul=yr.reduce(function(t,n){return t.concat([n+"-"+So,n+"-"+dr])},[]),np=[].concat(yr,[Is]).reduce(function(t,n){return t.concat([n,n+"-"+So,n+"-"+dr])},[]),uv="beforeRead",dv="read",fv="afterRead",pv="beforeMain",hv="main",mv="afterMain",gv="beforeWrite",vv="write",yv="afterWrite",bv=[uv,dv,fv,pv,hv,mv,gv,vv,yv];function on(t){return t?(t.nodeName||"").toLowerCase():null}function zt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function no(t){var n=zt(t).Element;return t instanceof n||t instanceof Element}function Gt(t){var n=zt(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function As(t){if(typeof ShadowRoot>"u")return!1;var n=zt(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function wv(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},r=n.attributes[e]||{},i=n.elements[e];!Gt(i)||!on(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var c=r[a];c===!1?i.removeAttribute(a):i.setAttribute(a,c===!0?"":c)}))})}function xv(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var r=n.elements[o],i=n.attributes[o]||{},a=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),c=a.reduce(function(l,u){return l[u]="",l},{});!Gt(r)||!on(r)||(Object.assign(r.style,c),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const Cv={name:"applyStyles",enabled:!0,phase:"write",fn:wv,effect:xv,requires:["computeStyles"]};function tn(t){return t.split("-")[0]}var Jn=Math.max,di=Math.min,jo=Math.round;function Xa(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function op(){return!/^((?!chrome|android).)*safari/i.test(Xa())}function Oo(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),r=1,i=1;n&&Gt(t)&&(r=t.offsetWidth>0&&jo(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&jo(o.height)/t.offsetHeight||1);var a=no(t)?zt(t):window,c=a.visualViewport,l=!op()&&e,u=(o.left+(l&&c?c.offsetLeft:0))/r,p=(o.top+(l&&c?c.offsetTop:0))/i,f=o.width/r,d=o.height/i;return{width:f,height:d,top:p,right:u+f,bottom:p+d,left:u,x:u,y:p}}function Ps(t){var n=Oo(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function rp(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&As(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function hn(t){return zt(t).getComputedStyle(t)}function kv(t){return["table","td","th"].indexOf(on(t))>=0}function Tn(t){return((no(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mi(t){return on(t)==="html"?t:t.assignedSlot||t.parentNode||(As(t)?t.host:null)||Tn(t)}function dl(t){return!Gt(t)||hn(t).position==="fixed"?null:t.offsetParent}function Ev(t){var n=/firefox/i.test(Xa()),e=/Trident/i.test(Xa());if(e&&Gt(t)){var o=hn(t);if(o.position==="fixed")return null}var r=Mi(t);for(As(r)&&(r=r.host);Gt(r)&&["html","body"].indexOf(on(r))<0;){var i=hn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function br(t){for(var n=zt(t),e=dl(t);e&&kv(e)&&hn(e).position==="static";)e=dl(e);return e&&(on(e)==="html"||on(e)==="body"&&hn(e).position==="static")?n:e||Ev(t)||n}function Ts(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function nr(t,n,e){return Jn(t,di(n,e))}function Sv(t,n,e){var o=nr(t,n,e);return o>e?e:o}function ip(){return{top:0,right:0,bottom:0,left:0}}function ap(t){return Object.assign({},ip(),t)}function sp(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var jv=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,ap(typeof n!="number"?n:sp(n,yr))};function Ov(t){var n,e=t.state,o=t.name,r=t.options,i=e.elements.arrow,a=e.modifiersData.popperOffsets,c=tn(e.placement),l=Ts(c),u=[Mt,Zt].indexOf(c)>=0,p=u?"height":"width";if(!(!i||!a)){var f=jv(r.padding,e),d=Ps(i),h=l==="y"?Dt:Mt,m=l==="y"?Yt:Zt,g=e.rects.reference[p]+e.rects.reference[l]-a[l]-e.rects.popper[p],y=a[l]-e.rects.reference[l],w=br(i),E=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,k=g/2-y/2,C=f[h],j=E-d[p]-f[m],S=E/2-d[p]/2+k,D=nr(C,S,j),$=l;e.modifiersData[o]=(n={},n[$]=D,n.centerOffset=D-S,n)}}function Nv(t){var n=t.state,e=t.options,o=e.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||rp(n.elements.popper,r)&&(n.elements.arrow=r))}const Iv={name:"arrow",enabled:!0,phase:"main",fn:Ov,effect:Nv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function No(t){return t.split("-")[1]}var Av={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Pv(t,n){var e=t.x,o=t.y,r=n.devicePixelRatio||1;return{x:jo(e*r)/r||0,y:jo(o*r)/r||0}}function fl(t){var n,e=t.popper,o=t.popperRect,r=t.placement,i=t.variation,a=t.offsets,c=t.position,l=t.gpuAcceleration,u=t.adaptive,p=t.roundOffsets,f=t.isFixed,d=a.x,h=d===void 0?0:d,m=a.y,g=m===void 0?0:m,y=typeof p=="function"?p({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var w=a.hasOwnProperty("x"),E=a.hasOwnProperty("y"),k=Mt,C=Dt,j=window;if(u){var S=br(e),D="clientHeight",$="clientWidth";if(S===zt(e)&&(S=Tn(e),hn(S).position!=="static"&&c==="absolute"&&(D="scrollHeight",$="scrollWidth")),S=S,r===Dt||(r===Mt||r===Zt)&&i===dr){C=Yt;var W=f&&S===j&&j.visualViewport?j.visualViewport.height:S[D];g-=W-o.height,g*=l?1:-1}if(r===Mt||(r===Dt||r===Yt)&&i===dr){k=Zt;var J=f&&S===j&&j.visualViewport?j.visualViewport.width:S[$];h-=J-o.width,h*=l?1:-1}}var B=Object.assign({position:c},u&&Av),A=p===!0?Pv({x:h,y:g},zt(e)):{x:h,y:g};if(h=A.x,g=A.y,l){var fe;return Object.assign({},B,(fe={},fe[C]=E?"0":"",fe[k]=w?"0":"",fe.transform=(j.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",fe))}return Object.assign({},B,(n={},n[C]=E?g+"px":"",n[k]=w?h+"px":"",n.transform="",n))}function Tv(t){var n=t.state,e=t.options,o=e.gpuAcceleration,r=o===void 0?!0:o,i=e.adaptive,a=i===void 0?!0:i,c=e.roundOffsets,l=c===void 0?!0:c,u={placement:tn(n.placement),variation:No(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,fl(Object.assign({},u,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:l})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,fl(Object.assign({},u,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const _v={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Tv,data:{}};var Lr={passive:!0};function Dv(t){var n=t.state,e=t.instance,o=t.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,c=a===void 0?!0:a,l=zt(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&u.forEach(function(p){p.addEventListener("scroll",e.update,Lr)}),c&&l.addEventListener("resize",e.update,Lr),function(){i&&u.forEach(function(p){p.removeEventListener("scroll",e.update,Lr)}),c&&l.removeEventListener("resize",e.update,Lr)}}const Mv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Dv,data:{}};var Lv={left:"right",right:"left",bottom:"top",top:"bottom"};function Vr(t){return t.replace(/left|right|bottom|top/g,function(n){return Lv[n]})}var Rv={start:"end",end:"start"};function pl(t){return t.replace(/start|end/g,function(n){return Rv[n]})}function _s(t){var n=zt(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function Ds(t){return Oo(Tn(t)).left+_s(t).scrollLeft}function Fv(t,n){var e=zt(t),o=Tn(t),r=e.visualViewport,i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;var u=op();(u||!u&&n==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c+Ds(t),y:l}}function Bv(t){var n,e=Tn(t),o=_s(t),r=(n=t.ownerDocument)==null?void 0:n.body,i=Jn(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Jn(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+Ds(t),l=-o.scrollTop;return hn(r||e).direction==="rtl"&&(c+=Jn(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:c,y:l}}function Ms(t){var n=hn(t),e=n.overflow,o=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+o)}function cp(t){return["html","body","#document"].indexOf(on(t))>=0?t.ownerDocument.body:Gt(t)&&Ms(t)?t:cp(Mi(t))}function or(t,n){var e;n===void 0&&(n=[]);var o=cp(t),r=o===((e=t.ownerDocument)==null?void 0:e.body),i=zt(o),a=r?[i].concat(i.visualViewport||[],Ms(o)?o:[]):o,c=n.concat(a);return r?c:c.concat(or(Mi(a)))}function Qa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Hv(t,n){var e=Oo(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function hl(t,n,e){return n===tp?Qa(Fv(t,e)):no(n)?Hv(n,e):Qa(Bv(Tn(t)))}function zv(t){var n=or(Mi(t)),e=["absolute","fixed"].indexOf(hn(t).position)>=0,o=e&&Gt(t)?br(t):t;return no(o)?n.filter(function(r){return no(r)&&rp(r,o)&&on(r)!=="body"}):[]}function Wv(t,n,e,o){var r=n==="clippingParents"?zv(t):[].concat(n),i=[].concat(r,[e]),a=i[0],c=i.reduce(function(l,u){var p=hl(t,u,o);return l.top=Jn(p.top,l.top),l.right=di(p.right,l.right),l.bottom=di(p.bottom,l.bottom),l.left=Jn(p.left,l.left),l},hl(t,a,o));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function lp(t){var n=t.reference,e=t.element,o=t.placement,r=o?tn(o):null,i=o?No(o):null,a=n.x+n.width/2-e.width/2,c=n.y+n.height/2-e.height/2,l;switch(r){case Dt:l={x:a,y:n.y-e.height};break;case Yt:l={x:a,y:n.y+n.height};break;case Zt:l={x:n.x+n.width,y:c};break;case Mt:l={x:n.x-e.width,y:c};break;default:l={x:n.x,y:n.y}}var u=r?Ts(r):null;if(u!=null){var p=u==="y"?"height":"width";switch(i){case So:l[u]=l[u]-(n[p]/2-e[p]/2);break;case dr:l[u]=l[u]+(n[p]/2-e[p]/2);break}}return l}function fr(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=o===void 0?t.placement:o,i=e.strategy,a=i===void 0?t.strategy:i,c=e.boundary,l=c===void 0?cv:c,u=e.rootBoundary,p=u===void 0?tp:u,f=e.elementContext,d=f===void 0?Uo:f,h=e.altBoundary,m=h===void 0?!1:h,g=e.padding,y=g===void 0?0:g,w=ap(typeof y!="number"?y:sp(y,yr)),E=d===Uo?lv:Uo,k=t.rects.popper,C=t.elements[m?E:d],j=Wv(no(C)?C:C.contextElement||Tn(t.elements.popper),l,p,a),S=Oo(t.elements.reference),D=lp({reference:S,element:k,strategy:"absolute",placement:r}),$=Qa(Object.assign({},k,D)),W=d===Uo?$:S,J={top:j.top-W.top+w.top,bottom:W.bottom-j.bottom+w.bottom,left:j.left-W.left+w.left,right:W.right-j.right+w.right},B=t.modifiersData.offset;if(d===Uo&&B){var A=B[r];Object.keys(J).forEach(function(fe){var ve=[Zt,Yt].indexOf(fe)>=0?1:-1,Y=[Dt,Yt].indexOf(fe)>=0?"y":"x";J[fe]+=A[Y]*ve})}return J}function $v(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=e.boundary,i=e.rootBoundary,a=e.padding,c=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?np:l,p=No(o),f=p?c?ul:ul.filter(function(m){return No(m)===p}):yr,d=f.filter(function(m){return u.indexOf(m)>=0});d.length===0&&(d=f);var h=d.reduce(function(m,g){return m[g]=fr(t,{placement:g,boundary:r,rootBoundary:i,padding:a})[tn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function Uv(t){if(tn(t)===Is)return[];var n=Vr(t);return[pl(t),n,pl(n)]}function Vv(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!0:a,l=e.fallbackPlacements,u=e.padding,p=e.boundary,f=e.rootBoundary,d=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,g=e.allowedAutoPlacements,y=n.options.placement,w=tn(y),E=w===y,k=l||(E||!m?[Vr(y)]:Uv(y)),C=[y].concat(k).reduce(function(V,T){return V.concat(tn(T)===Is?$v(n,{placement:T,boundary:p,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:g}):T)},[]),j=n.rects.reference,S=n.rects.popper,D=new Map,$=!0,W=C[0],J=0;J<C.length;J++){var B=C[J],A=tn(B),fe=No(B)===So,ve=[Dt,Yt].indexOf(A)>=0,Y=ve?"width":"height",de=fr(n,{placement:B,boundary:p,rootBoundary:f,altBoundary:d,padding:u}),he=ve?fe?Zt:Mt:fe?Yt:Dt;j[Y]>S[Y]&&(he=Vr(he));var Oe=Vr(he),se=[];if(i&&se.push(de[A]<=0),c&&se.push(de[he]<=0,de[Oe]<=0),se.every(function(V){return V})){W=B,$=!1;break}D.set(B,se)}if($)for(var H=m?3:1,Q=function(T){var P=C.find(function(L){var G=D.get(L);if(G)return G.slice(0,T).every(function(U){return U})});if(P)return W=P,"break"},me=H;me>0;me--){var pe=Q(me);if(pe==="break")break}n.placement!==W&&(n.modifiersData[o]._skip=!0,n.placement=W,n.reset=!0)}}const Gv={name:"flip",enabled:!0,phase:"main",fn:Vv,requiresIfExists:["offset"],data:{_skip:!1}};function ml(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function gl(t){return[Dt,Zt,Yt,Mt].some(function(n){return t[n]>=0})}function Yv(t){var n=t.state,e=t.name,o=n.rects.reference,r=n.rects.popper,i=n.modifiersData.preventOverflow,a=fr(n,{elementContext:"reference"}),c=fr(n,{altBoundary:!0}),l=ml(a,o),u=ml(c,r,i),p=gl(l),f=gl(u);n.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}const Zv={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Yv};function Kv(t,n,e){var o=tn(t),r=[Mt,Dt].indexOf(o)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,a=i[0],c=i[1];return a=a||0,c=(c||0)*r,[Mt,Zt].indexOf(o)>=0?{x:c,y:a}:{x:a,y:c}}function qv(t){var n=t.state,e=t.options,o=t.name,r=e.offset,i=r===void 0?[0,0]:r,a=np.reduce(function(p,f){return p[f]=Kv(f,n.rects,i),p},{}),c=a[n.placement],l=c.x,u=c.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=u),n.modifiersData[o]=a}const Jv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qv};function Xv(t){var n=t.state,e=t.name;n.modifiersData[e]=lp({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const Qv={name:"popperOffsets",enabled:!0,phase:"read",fn:Xv,data:{}};function e1(t){return t==="x"?"y":"x"}function t1(t){var n=t.state,e=t.options,o=t.name,r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!1:a,l=e.boundary,u=e.rootBoundary,p=e.altBoundary,f=e.padding,d=e.tether,h=d===void 0?!0:d,m=e.tetherOffset,g=m===void 0?0:m,y=fr(n,{boundary:l,rootBoundary:u,padding:f,altBoundary:p}),w=tn(n.placement),E=No(n.placement),k=!E,C=Ts(w),j=e1(C),S=n.modifiersData.popperOffsets,D=n.rects.reference,$=n.rects.popper,W=typeof g=="function"?g(Object.assign({},n.rects,{placement:n.placement})):g,J=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),B=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,A={x:0,y:0};if(S){if(i){var fe,ve=C==="y"?Dt:Mt,Y=C==="y"?Yt:Zt,de=C==="y"?"height":"width",he=S[C],Oe=he+y[ve],se=he-y[Y],H=h?-$[de]/2:0,Q=E===So?D[de]:$[de],me=E===So?-$[de]:-D[de],pe=n.elements.arrow,V=h&&pe?Ps(pe):{width:0,height:0},T=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:ip(),P=T[ve],L=T[Y],G=nr(0,D[de],V[de]),U=k?D[de]/2-H-G-P-J.mainAxis:Q-G-P-J.mainAxis,re=k?-D[de]/2+H+G+L+J.mainAxis:me+G+L+J.mainAxis,te=n.elements.arrow&&br(n.elements.arrow),I=te?C==="y"?te.clientTop||0:te.clientLeft||0:0,ke=(fe=B==null?void 0:B[C])!=null?fe:0,xe=he+U-ke-I,Me=he+re-ke,Ie=nr(h?di(Oe,xe):Oe,he,h?Jn(se,Me):se);S[C]=Ie,A[C]=Ie-he}if(c){var Pe,ge=C==="x"?Dt:Mt,x=C==="x"?Yt:Zt,b=S[j],O=j==="y"?"height":"width",N=b+y[ge],R=b-y[x],ne=[Dt,Mt].indexOf(w)!==-1,q=(Pe=B==null?void 0:B[j])!=null?Pe:0,z=ne?N:b-D[O]-$[O]-q+J.altAxis,F=ne?b+D[O]+$[O]-q-J.altAxis:R,Z=h&&ne?Sv(z,b,F):nr(h?z:N,b,h?F:R);S[j]=Z,A[j]=Z-b}n.modifiersData[o]=A}}const n1={name:"preventOverflow",enabled:!0,phase:"main",fn:t1,requiresIfExists:["offset"]};function o1(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function r1(t){return t===zt(t)||!Gt(t)?_s(t):o1(t)}function i1(t){var n=t.getBoundingClientRect(),e=jo(n.width)/t.offsetWidth||1,o=jo(n.height)/t.offsetHeight||1;return e!==1||o!==1}function a1(t,n,e){e===void 0&&(e=!1);var o=Gt(n),r=Gt(n)&&i1(n),i=Tn(n),a=Oo(t,r,e),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!e)&&((on(n)!=="body"||Ms(i))&&(c=r1(n)),Gt(n)?(l=Oo(n,!0),l.x+=n.clientLeft,l.y+=n.clientTop):i&&(l.x=Ds(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function s1(t){var n=new Map,e=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function r(i){e.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(c){if(!e.has(c)){var l=n.get(c);l&&r(l)}}),o.push(i)}return t.forEach(function(i){e.has(i.name)||r(i)}),o}function c1(t){var n=s1(t);return bv.reduce(function(e,o){return e.concat(n.filter(function(r){return r.phase===o}))},[])}function l1(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function u1(t){var n=t.reduce(function(e,o){var r=e[o.name];return e[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var vl={placement:"bottom",modifiers:[],strategy:"absolute"};function yl(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function d1(t){t===void 0&&(t={});var n=t,e=n.defaultModifiers,o=e===void 0?[]:e,r=n.defaultOptions,i=r===void 0?vl:r;return function(c,l,u){u===void 0&&(u=i);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},vl,i),modifiersData:{},elements:{reference:c,popper:l},attributes:{},styles:{}},f=[],d=!1,h={state:p,setOptions:function(w){var E=typeof w=="function"?w(p.options):w;g(),p.options=Object.assign({},i,p.options,E),p.scrollParents={reference:no(c)?or(c):c.contextElement?or(c.contextElement):[],popper:or(l)};var k=c1(u1([].concat(o,p.options.modifiers)));return p.orderedModifiers=k.filter(function(C){return C.enabled}),m(),h.update()},forceUpdate:function(){if(!d){var w=p.elements,E=w.reference,k=w.popper;if(yl(E,k)){p.rects={reference:a1(E,br(k),p.options.strategy==="fixed"),popper:Ps(k)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(J){return p.modifiersData[J.name]=Object.assign({},J.data)});for(var C=0;C<p.orderedModifiers.length;C++){if(p.reset===!0){p.reset=!1,C=-1;continue}var j=p.orderedModifiers[C],S=j.fn,D=j.options,$=D===void 0?{}:D,W=j.name;typeof S=="function"&&(p=S({state:p,options:$,name:W,instance:h})||p)}}}},update:l1(function(){return new Promise(function(y){h.forceUpdate(),y(p)})}),destroy:function(){g(),d=!0}};if(!yl(c,l))return h;h.setOptions(u).then(function(y){!d&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){p.orderedModifiers.forEach(function(y){var w=y.name,E=y.options,k=E===void 0?{}:E,C=y.effect;if(typeof C=="function"){var j=C({state:p,name:w,instance:h,options:k}),S=function(){};f.push(j||S)}})}function g(){f.forEach(function(y){return y()}),f=[]}return h}}var f1=[Mv,Qv,_v,Cv,Jv,Gv,n1,Iv,Zv],p1=d1({defaultModifiers:f1}),h1=typeof Element<"u",m1=typeof Map=="function",g1=typeof Set=="function",v1=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Gr(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,o,r;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(!Gr(t[o],n[o]))return!1;return!0}var i;if(m1&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!Gr(o.value[1],n.get(o.value[0])))return!1;return!0}if(g1&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(v1&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;if(h1&&t instanceof Element)return!1;for(o=e;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&t.$$typeof)&&!Gr(t[r[o]],n[r[o]]))return!1;return!0}return t!==t&&n!==n}var y1=function(n,e){try{return Gr(n,e)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const b1=_i(y1);var w1=[],x1=function(n,e,o){o===void 0&&(o={});var r=_.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||w1},a=_.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=a[0],l=a[1],u=_.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,g=Object.keys(m.elements);Hl.flushSync(function(){l({styles:cl(g.map(function(y){return[y,m.styles[y]||{}]})),attributes:cl(g.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),p=_.useMemo(function(){var d={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return b1(r.current,d)?r.current||d:(r.current=d,d)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),f=_.useRef();return ll(function(){f.current&&f.current.setOptions(p)},[p]),ll(function(){if(!(n==null||e==null)){var d=o.createPopper||p1,h=d(n,e,p);return f.current=h,function(){h.destroy(),f.current=null}}},[n,e,o.createPopper]),{state:f.current?f.current.state:null,styles:c.styles,attributes:c.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}},C1=["className","cssModule","size","vertical","tag"];function es(){return es=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},es.apply(this,arguments)}function bl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function k1(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?bl(Object(e),!0).forEach(function(o){E1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function E1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function S1(t,n){if(t==null)return{};var e=j1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function j1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var O1={"aria-label":X.string,className:X.string,cssModule:X.object,role:X.string,size:X.string,tag:Ns,vertical:X.bool};function up(t){var n=t.className,e=t.cssModule,o=t.size,r=t.vertical,i=t.tag,a=i===void 0?"div":i,c=S1(t,C1),l=Di(ot(n,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),e);return v.createElement(a,es({},k1({role:"group"},c),{className:l}))}up.propTypes=O1;function N1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function ts(t,n){return ts=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ts(t,n)}function I1(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,ts(t,n)}const wl={disabled:!1};var A1=process.env.NODE_ENV!=="production"?X.oneOfType([X.number,X.shape({enter:X.number,exit:X.number,appear:X.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&X.oneOfType([X.string,X.shape({enter:X.string,exit:X.string,active:X.string}),X.shape({enter:X.string,enterDone:X.string,enterActive:X.string,exit:X.string,exitDone:X.string,exitActive:X.string})]);const dp=v.createContext(null);var P1=function(n){return n.scrollTop},Jo="unmounted",Ln="exited",Rn="entering",ho="entered",ns="exiting",mn=function(t){I1(n,t);function n(o,r){var i;i=t.call(this,o,r)||this;var a=r,c=a&&!a.isMounting?o.enter:o.appear,l;return i.appearStatus=null,o.in?c?(l=Ln,i.appearStatus=Rn):l=ho:o.unmountOnExit||o.mountOnEnter?l=Jo:l=Ln,i.state={status:l},i.nextCallback=null,i}n.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===Jo?{status:Ln}:null};var e=n.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Rn&&a!==ho&&(i=Rn):(a===Rn||a===ho)&&(i=ns)}this.updateStatus(!1,i)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,i,a,c;return i=a=c=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,c=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:c}},e.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===Rn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this);a&&P1(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ln&&this.setState({status:Jo})},e.performEnter=function(r){var i=this,a=this.props.enter,c=this.context?this.context.isMounting:r,l=this.props.nodeRef?[c]:[Un.findDOMNode(this),c],u=l[0],p=l[1],f=this.getTimeouts(),d=c?f.appear:f.enter;if(!r&&!a||wl.disabled){this.safeSetState({status:ho},function(){i.props.onEntered(u)});return}this.props.onEnter(u,p),this.safeSetState({status:Rn},function(){i.props.onEntering(u,p),i.onTransitionEnd(d,function(){i.safeSetState({status:ho},function(){i.props.onEntered(u,p)})})})},e.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),c=this.props.nodeRef?void 0:Un.findDOMNode(this);if(!i||wl.disabled){this.safeSetState({status:Ln},function(){r.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:ns},function(){r.props.onExiting(c),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Ln},function(){r.props.onExited(c)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},e.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(c){a&&(a=!1,i.nextCallback=null,r(c))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},e.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this),c=r==null&&!this.props.addEndListener;if(!a||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],p=l[1];this.props.addEndListener(u,p)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===Jo)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=N1(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(dp.Provider,{value:null},typeof a=="function"?a(r,c):v.cloneElement(v.Children.only(a),c))},n}(v.Component);mn.contextType=dp;mn.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:X.shape({current:typeof Element>"u"?X.any:function(t,n,e,o,r,i){var a=t[n];return X.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,n,e,o,r,i)}}),children:X.oneOfType([X.func.isRequired,X.element.isRequired]).isRequired,in:X.bool,mountOnEnter:X.bool,unmountOnExit:X.bool,appear:X.bool,enter:X.bool,exit:X.bool,timeout:function(n){var e=A1;n.addEndListener||(e=e.isRequired);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return e.apply(void 0,[n].concat(r))},addEndListener:X.func,onEnter:X.func,onEntering:X.func,onEntered:X.func,onExit:X.func,onExiting:X.func,onExited:X.func}:{};function so(){}mn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:so,onEntering:so,onEntered:so,onExit:so,onExiting:so,onExited:so};mn.UNMOUNTED=Jo;mn.EXITED=Ln;mn.ENTERING=Rn;mn.ENTERED=ho;mn.EXITING=ns;const Ls=mn;function os(t){"@babel/helpers - typeof";return os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},os(t)}var T1=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],co;function fi(){return fi=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},fi.apply(this,arguments)}function _1(t,n){if(t==null)return{};var e=D1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function D1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function M1(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function xl(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function L1(t,n,e){return n&&xl(t.prototype,n),e&&xl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&rs(t,n)}function rs(t,n){return rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},rs(t,n)}function F1(t){var n=H1();return function(){var o=pi(t),r;if(n){var i=pi(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return B1(this,r)}}function B1(t,n){if(n&&(os(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fp(t)}function fp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pi(t){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pi(t)}function Cl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Io(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?Cl(Object(e),!0).forEach(function(o){vo(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Cl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function vo(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var z1=Io(Io({},Ls.propTypes),{},{horizontal:X.bool,isOpen:X.bool,children:X.oneOfType([X.arrayOf(X.node),X.node]),tag:Ns,className:X.node,navbar:X.bool,cssModule:X.object,innerRef:X.shape({current:X.object})}),W1=Io(Io({},Ls.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:J0.Collapse}),$1=(co={},vo(co,Mr.ENTERING,"collapsing"),vo(co,Mr.ENTERED,"collapse show"),vo(co,Mr.EXITING,"collapsing"),vo(co,Mr.EXITED,"collapse"),co);function U1(t){return $1[t]||"collapse"}var Rs=function(t){R1(e,t);var n=F1(e);function e(o){var r;return M1(this,e),r=n.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||v.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(fp(r))}),r}return L1(e,[{key:"onEntering",value:function(r,i){var a=this.getNode();this.setState({dimension:this.getDimension(a)}),this.props.onEntering(a,i)}},{key:"onEntered",value:function(r,i){var a=this.getNode();this.setState({dimension:null}),this.props.onEntered(a,i)}},{key:"onExit",value:function(){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onExit(r)}},{key:"onExiting",value:function(){var r=this.getNode();this.getDimension(r),this.setState({dimension:0}),this.props.onExiting(r)}},{key:"onExited",value:function(){var r=this.getNode();this.setState({dimension:null}),this.props.onExited(r)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(r){return this.props.horizontal?r.scrollWidth:r.scrollHeight}},{key:"render",value:function(){var r=this,i=this.props,a=i.tag,c=i.horizontal,l=i.isOpen,u=i.className,p=i.navbar,f=i.cssModule,d=i.children;i.innerRef;var h=_1(i,T1),m=this.state.dimension,g=Z0(h,al),y=Y0(h,al);return v.createElement(Ls,fi({},g,{in:l,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(w){var E=U1(w),k=Di(ot(u,c&&"collapse-horizontal",E,p&&"navbar-collapse"),f),C=m===null?null:vo({},c?"width":"height",m);return v.createElement(a,fi({},y,{style:Io(Io({},y.style),C),className:k,ref:r.nodeRef}),d)})}}]),e}(v.Component);Rs.propTypes=z1;Rs.defaultProps=W1;const pp=Rs,V1=t=>{const{className:n,isOpen:e,showCollapseIcon:o,showFolderIcon:r,title:i,...a}=t;return s.jsx(ut.ItemHeader,{className:ot("io-base-section-header",n),prepend:r&&s.jsx(Xe,{size:"16",variant:e?"folder-open":"folder"}),append:o&&s.jsx(Xe,{className:ot("collapse-icon",!e&&"collapsed"),size:"10",variant:"expand"}),tooltip:i,...a,children:i})},hp=()=>{const[t,n]=v.useState([]),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;const o=l=>{const{name:u,title:p,caption:f,icon:d,userProperties:h}=l;return{id:u,name:u,title:p??u,caption:f,icon:d,userProperties:h}},r=e.appManager.onAppAdded(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(p=>[...p,u])}),i=e.appManager.onAppChanged(l=>{const u=o(l);n(p=>[...p.filter(f=>f.id!==u.id),u])}),a=e.appManager.onAppRemoved(l=>{const u=o(l);n(p=>p.filter(f=>f.id!==u.id))}),c=[r,a,i];return()=>c.forEach(l=>l())},[e]),t},G1=()=>{const[t,n]=v.useState({}),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;const o=e.appManager.onInstanceStarted(a=>{n(c=>{const l=c[a.application.name]??[];return{...c,[a.application.name]:[...l,a.id]}})}),r=e.appManager.onInstanceStopped(a=>{n(c=>({...c,[a.application.name]:c[a.application.name].filter(l=>l!==a.id)}))}),i=[o,r];return()=>i.forEach(a=>a())},[e]),t},Y1=t=>{v.useEffect(()=>{var e;if(!((e=window.iobrowser)!=null&&e.platformStarted)||t)return;const n=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t])},Fs=()=>{const[t,n]=v.useState(),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{var o;try{const i=!((o=e.windows.my())!=null&&o.name)?Co.getFrameId():void 0;n(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[e,Co.getFrameId,n]),t},Le={SUCCESS:"success",WARNING:"warning"},Z1={success:5*1e3,warning:10*1e3},Fe=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Ga(r);try{if(e===Le.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n&&n.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:Z1[e]};await n.modals.alerts.request(a)}catch(a){n.logger.warn(`Failed to request alert. ${Ga(a)}`)}},K1=async t=>{var o;const{io:n,item:e}=t;try{await((o=n.appManager.application(e.id))==null?void 0:o.start())}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new window.`,error:r})}},q1=async t=>{const{io:n,item:e,frameId:o}=t;if(!n.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=n.workspaces.getBuilder(r);i.addGroup().addWindow({appName:e.id});try{await i.create()}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new Workspace.`,error:a})}},J1={[si.OPEN_IN_NEW_WINDOW]:K1,[si.OPEN_IN_NEW_WORKSPACE]:q1},mp=()=>{const t=v.useContext(_e.IOConnectContext),n=Fs();return(e,o)=>{J1[o]({io:t,item:e,frameId:n})}},To={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Bs="(.|\\s)*\\S(.|\\s)*",X1=async t=>{var i;const{io:n,layout:e,showDeletePromptPref:o,updateShowDeletePromptPref:r}=t;if("modals"in n&&n.modals&&o){const a="delete",c="do-not-ask-again",{isEnterPressed:l,responseButtonClicked:u,inputs:p}=await n.modals.dialogs.request({templateName:To.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${e.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:c,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=p==null?void 0:p.find(h=>h.id===c))==null?void 0:i.checked)&&r(!1),!(l||(u==null?void 0:u.id)===a))return}try{await n.layouts.remove("Global",e.name),e.isDefault&&await n.layouts.clearDefaultGlobal(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully deleted.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Layout "${e.name}".`,error:a})}},Q1=async t=>{var f;const{io:n,layout:e,setDefaultLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${e.name}"`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The new Layout name must be different from the current one.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.rename(h,u),e.isDefault&&await o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully renamed to "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}".`,error:d})}}},ey=async t=>{const{io:n,layout:e}=t;try{await n.layouts.save({name:e.name,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was saved successfully.`})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}".`,error:o})}},ty=async t=>{var f;const{io:n,layout:e,setActiveLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot save Layout under a new name because io dialogs are not enabled");return}const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${e.name}" as`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.import([{...h,name:u}],"merge"),e.isActive&&o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${u}".`,error:d})}}},ny=async t=>{const{io:n,layout:e,setDefaultLayout:o}=t;try{await o({name:e.name}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully set as the default Layout.`})}catch{await Fe({io:n,variant:Le.WARNING,text:`Failed to set Layout "${e.name}" as the default Layout.`})}},oy=async t=>{const{io:n,layout:e,closeLaunchpad:o}=t;try{await n.layouts.restore({name:e.name}),o(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was loaded successfully.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Layout "${e.name}".`,error:r})}},ry={delete:X1,rename:Q1,save:ey,saveAs:ty,setAsDefault:ny,load:oy},iy="interopio_home_ui_auth0_validation_error",ay="interopio_home_ui_user",sy="interopio_home_ui_platform_window",wr="interopio_home_ui_platform_setup",gp="interopio_home_ui_active_layout";var gt=function(t){return{ok:!0,result:t}},st=function(t){return{ok:!1,error:t}},cy=function(t){return t.ok===!0?Promise.resolve(t.result):Promise.reject(t.error)},ly=function(t,n){return n.ok===!0?n.result:t},uy=function(t){if(t.ok===!0)return t.result;throw t.error},dy=function(t,n){return n.ok===!0?gt(t(n.result)):n},kl=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:gt(t(n.result,e.result))},ga=function(t,n){return n.ok===!0?n:st(t(n.error))},fy=function(t,n){return n.ok===!0?t(n.result):n};/*! *****************************************************************************
36
+ Copyright (c) Microsoft Corporation.
37
+
38
+ Permission to use, copy, modify, and/or distribute this software for any
39
+ purpose with or without fee is hereby granted.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
42
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
43
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
44
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
+ PERFORMANCE OF THIS SOFTWARE.
48
+ ***************************************************************************** */var is=function(){return is=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},is.apply(this,arguments)};function py(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function as(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!as(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(var e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!as(t[o[e]],n[o[e]]))return!1;return!0}}var Xo=function(t){return Array.isArray(t)},Rr=function(t){return typeof t=="object"&&t!==null&&!Xo(t)},hy=function(t){switch(typeof t){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return t instanceof Array?"an array":t===null?"null":"an object";default:return JSON.stringify(t)}},ln=function(t,n){return"expected "+t+", got "+hy(n)},Vo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Go=function(t,n){var e=n.at,o=py(n,["at"]);return is({at:t+(e||"")},o)},pt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ga(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return cy(e.run(o))},this.runWithException=function(o){return uy(e.run(o))},this.map=function(o){return new t(function(r){return dy(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return fy(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?gt(n):st({message:ln("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?gt(n):st({message:ln("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?gt(n):st({message:ln("a boolean",n)})})},t.constant=function(n){return new t(function(e){return as(e,n)?gt(n):st({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Rr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return e[r]===void 0?st({message:"the key '"+r+"' is required but was not present"}):st(Go("."+r,i.error))}return gt(o)}else return Rr(e)?gt(e):st({message:ln("an object",e)})})},t.array=function(n){return new t(function(e){if(Xo(e)&&n){var o=function(r,i){return ga(function(a){return Go("["+i+"]",a)},n.decode(r))};return e.reduce(function(r,i,a){return kl(function(c,l){return c.concat([l])},r,o(i,a))},gt([]))}else return Xo(e)?gt(e):st({message:ln("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Xo(e)){if(e.length!==n.length)return st({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(i.ok)o[r]=i.result;else return st(Go("["+r+"]",i.error))}return gt(o)}else return st({message:ln("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return kl(Object.assign,a,c.decode(i))},gt({}))})},t.anyJson=function(){return new t(function(n){return gt(n)})},t.unknownJson=function(){return new t(function(n){return gt(n)})},t.dict=function(n){return new t(function(e){if(Rr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok===!0)o[r]=i.result;else return st(Go("."+r,i.error))}return gt(o)}else return st({message:ln("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?gt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return st({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return gt(ly(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return st({at:Vo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Rr(r))return st({at:Vo(n.slice(0,i+1)),message:ln("an object",r)});if(typeof n[i]=="number"&&!Xo(r))return st({at:Vo(n.slice(0,i+1)),message:ln("an array",r)});r=r[n[i]]}return ga(function(a){return r===void 0?{at:Vo(n),message:"path does not exist"}:Go(Vo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return gt(n)})},t.fail=function(n){return new t(function(e){return st({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),my=pt.string,gy=pt.number,Ao=pt.boolean,jt=pt.anyJson;pt.unknownJson;var An=pt.constant,Qe=pt.object,vy=pt.array;pt.tuple;pt.dict;var De=pt.optional,pr=pt.oneOf;pt.union;pt.intersection;pt.withDefault;pt.valueAt;pt.succeed;var yy=pt.fail;pt.lazy;const _t=my().where(t=>t.length>0,"Expected a non-empty string"),by=gy().where(t=>t>=0,"Expected a non-negative number");Ao();const Wt=(t,n)=>{const e=typeof t;return e==="function"?jt():yy(`The provided argument as ${n} should be of type function, provided: ${typeof e}`)},vp=Qe({name:_t}),wy="Welcome",xy=t=>t.components.reduce((e,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);e.push(...r)}return e},[]),El=t=>t.trim().length>0,Cy=(t,n)=>{const[e,o]=v.useState(void 0),[r,i]=rn("sessionStorage",gp,vp),a=v.useRef(!1),c=Vs(),l=Gs(),u=v.useContext(_e.IOConnectContext),p=v.useCallback(async({name:f})=>{try{await u.layouts.setDefaultGlobal(f)}catch(d){console.error("Failed to set default Layout: ",{error:d})}},[u]);return v.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(f=>{o(f)})},[u]),v.useEffect(()=>{if(u)return u.layouts.onRestored(f=>{i({name:f.name})})},[u]),v.useEffect(()=>{if(u)return u.layouts.onRemoved(f=>{(f==null?void 0:f.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),v.useEffect(()=>{if(u)return u.layouts.onRenamed((f,d)=>{(d==null?void 0:d.name)===(r==null?void 0:r.name)&&i({name:f.name})})},[u,r]),v.useEffect(()=>{var d;if(!u||!((d=window.iobrowser)!=null&&d.platformStarted)||a.current)return;(async()=>{var w;a.current=!0;const h=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(E=>E.name===wy);if(!h||(o({name:h.name}),r))return;if(t(!0),n){await c(h.name),t(!1);return}const m=await((w=u.workspaces)==null?void 0:w.getWorkspace(E=>E.children.length===0)),g=await u.layouts.get(h.name,"Global");if(!g)throw new Error("Default Global Layout not found.");const y=xy(g);Promise.all(y.map((E,k)=>l({id:E,reuseWorkspaceId:k===0?m==null?void 0:m.id:void 0}))),t(!1)})().catch(h=>console.error("Initial Global Layout setup failed. ",Ga(h)))},[u,r,c,l,n]),{defaultLayout:e,activeLayout:r,setDefaultLayout:p,setActiveLayout:i}},yp=v.createContext(void 0),gn=()=>{const t=v.useContext(yp);if(t===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return t},ky=({children:t,close:n,isGlobalLayoutsAvailable:e})=>{const[o,r]=v.useState(!1),{defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l}=Cy(r,e),u=v.useMemo(()=>({close:n,defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l,isLayoutOperationBlocked:o,setIsLayoutOperationBlocked:r}),[n,i,a,c,l,o]);return s.jsx(yp.Provider,{value:u,children:t})},_o={CUSTOM_PREFS:"customPrefs",COLLAPSED_SECTIONS:"_launchpad_collapsedSections",FAVORITES:"_launchpad_favorites",IS_LAYOUTS_PANEL_OPEN:"_launchpad_isLayoutsPanelOpen",IS_LAUNCHPAD_COLLAPSED:"_launchpad_isCollapsed",IS_LAUNCHPAD_PINNED:"_launchpad_isPinned",LAYOUTS_SHOW_UNSAVED_CHANGES_PROMPT:"_layouts_showUnsavedChangesPrompt",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt",WIDGET_ENABLE_FOR_EXTERNAL_APPS:"_widget_enableForExternalApps"},ro=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:_o.IS_LAUNCHPAD_PINNED}),r=v.useCallback(()=>n(i=>!i),[n]);return{error:o,isLaunchpadPinned:t,isLoading:e,toggle:r}},bp=()=>{const t=v.useContext(_e.IOConnectContext),{setActiveLayout:n,setDefaultLayout:e,close:o}=gn(),{isLaunchpadPinned:r}=ro(),{value:i,update:a}=Ht({prefKey:_o.LAYOUTS_SHOW_DELETE_PROMPT}),c=()=>{r||o==null||o()};return v.useCallback(async u=>{const{layout:p,actionName:f}=u;return await ry[f]({io:t,layout:p,setActiveLayout:n,setDefaultLayout:e,closeLaunchpad:c,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[t,e,n,o,i,a])},Do=()=>{const{isLayoutOperationBlocked:t,setIsLayoutOperationBlocked:n}=gn();return async e=>{if(!t){n(!0);try{await e()}catch(o){console.error("Layout operation failed: ",{error:o})}n(!1)}}},wp={CREATE_WORKSPACE:"createWorkspace"},Ey=async t=>{const{io:n,item:e}=t;if(n.workspaces)try{await n.workspaces.restoreWorkspace(e.id,{newFrame:!0})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Workspace "${e.title}".`,error:o})}},Sy=async t=>{const{io:n,item:e,removeFavorite:o}=t;if(n.workspaces){if("modals"in n&&n.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await n.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${e.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await n.workspaces.layouts.delete(e.id),await o(e),await Fe({io:n,variant:Le.SUCCESS,text:`"Workspace ${e.title}" was successfully deleted.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Workspace "${e.title}".`,error:r})}}},jy=async t=>{const{io:n}=t;if(n.workspaces)try{await n.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(e){await Fe({io:n,variant:Le.WARNING,text:"Failed to create a new Workspace.",error:e})}},Oy={[ci.OPEN_IN_NEW_WINDOW]:Ey,[ci.DELETE]:Sy,[wp.CREATE_WORKSPACE]:jy};class xp{constructor(){At(this,"queue",[]);At(this,"isExecutingQueue",!1)}enqueue(n){return new Promise((e,o)=>{this.queue.push({action:n,resolve:e,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const n=this.queue.shift();if(!n){this.isExecutingQueue=!1;return}try{const e=await n.action();n.resolve(e)}catch(e){n.reject(e)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(n=>setTimeout(n,0))}}const Cp=()=>{const[t,n]=v.useState([]),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!(e!=null&&e.workspaces))return;let o=!1;const r=e.workspaces.layouts.onSaved(({name:a})=>{o||t.find(({id:c})=>c===a)||n(c=>[...c,{id:a,title:a}])}),i=e.workspaces.layouts.onRemoved(({name:a})=>{o||n(c=>c.filter(({title:l})=>l!==a))});return()=>{o=!0,[r,i].forEach(async a=>{try{(await a)()}catch(c){console.error(c)}})}},[e,t]),t},Sl=new xp,Li=()=>{const{value:t,update:n,isLoading:e}=Ht({prefKey:_o.FAVORITES}),o=hp(),r=Cp(),i=v.useMemo(()=>(t??[]).filter(l=>l.type===wt.APPLICATION?o.some(u=>u.id===l.id):l.type===wt.WORKSPACE?r.some(u=>u.id===l.id):!0),[t,o,r]),a=v.useCallback(({openInstances:l,...u})=>Sl.enqueue(()=>n((p=[])=>{const f=p.find(d=>d.id===u.id&&d.type&&u.type);return f?p.filter(d=>d!==f):[u,...p]})),[n]),c=v.useCallback(l=>Sl.enqueue(()=>n((u=[])=>u.filter(p=>!(p.id===l.id&&p.type===l.type)))),[n]);return{favorites:i,toggleFavorite:a,removeFavorite:c,isLoading:e}},kp=()=>{const t=v.useContext(_e.IOConnectContext),{removeFavorite:n}=Li();return(e,o)=>{Oy[o]({io:t,item:e,removeFavorite:n})}},Ny=()=>{const t=v.useContext(_e.IOConnectContext);return async n=>t.interop.methods().every(e=>e.name!==(n==null?void 0:n.method))?console.error("Interop method not found."):await t.interop.invoke(n.method,n.params,n.target).catch(e=>console.error({error:e}))},Iy=()=>{const[t,n]=v.useState(!1),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;let o;return(async()=>{var r;try{o=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(()=>n(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[e]),t};var ss={exports:{}};(function(t,n){(function(e,o){var r="1.0.38",i="",a="?",c="function",l="undefined",u="object",p="string",f="major",d="model",h="name",m="type",g="vendor",y="version",w="architecture",E="console",k="mobile",C="tablet",j="smarttv",S="wearable",D="embedded",$=500,W="Amazon",J="Apple",B="ASUS",A="BlackBerry",fe="Browser",ve="Chrome",Y="Edge",de="Firefox",he="Google",Oe="Huawei",se="LG",H="Microsoft",Q="Motorola",me="Opera",pe="Samsung",V="Sharp",T="Sony",P="Xiaomi",L="Zebra",G="Facebook",U="Chromium OS",re="Mac OS",te=function(q,z){var F={};for(var Z in q)z[Z]&&z[Z].length%2===0?F[Z]=z[Z].concat(q[Z]):F[Z]=q[Z];return F},I=function(q){for(var z={},F=0;F<q.length;F++)z[q[F].toUpperCase()]=q[F];return z},ke=function(q,z){return typeof q===p?xe(z).indexOf(xe(q))!==-1:!1},xe=function(q){return q.toLowerCase()},Me=function(q){return typeof q===p?q.replace(/[^\d\.]/g,i).split(".")[0]:o},Ie=function(q,z){if(typeof q===p)return q=q.replace(/^\s\s*/,i),typeof z===l?q:q.substring(0,$)},Pe=function(q,z){for(var F=0,Z,le,ie,oe,ee,ye;F<z.length&&!ee;){var Ae=z[F],Ve=z[F+1];for(Z=le=0;Z<Ae.length&&!ee&&Ae[Z];)if(ee=Ae[Z++].exec(q),ee)for(ie=0;ie<Ve.length;ie++)ye=ee[++le],oe=Ve[ie],typeof oe===u&&oe.length>0?oe.length===2?typeof oe[1]==c?this[oe[0]]=oe[1].call(this,ye):this[oe[0]]=oe[1]:oe.length===3?typeof oe[1]===c&&!(oe[1].exec&&oe[1].test)?this[oe[0]]=ye?oe[1].call(this,ye,oe[2]):o:this[oe[0]]=ye?ye.replace(oe[1],oe[2]):o:oe.length===4&&(this[oe[0]]=ye?oe[3].call(this,ye.replace(oe[1],oe[2])):o):this[oe]=ye||o;F+=2}},ge=function(q,z){for(var F in z)if(typeof z[F]===u&&z[F].length>0){for(var Z=0;Z<z[F].length;Z++)if(ke(z[F][Z],q))return F===a?o:F}else if(ke(z[F],q))return F===a?o:F;return q},x={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},b={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},O={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,me+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+fe]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+fe]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+fe],y],[/\bfocus\/([\w\.]+)/i],[y,[h,de+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI "+fe]],[/fxios\/([-\w\.]+)/i],[y,[h,de]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+fe]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+fe],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,pe+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],y],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,y],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,G],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,ve+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,ve+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+fe]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,ge,x]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,de+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,y],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[w,"amd64"]],[/(ia32(?=;))/i],[[w,xe]],[/((?:i[346]|x)86)[;\)]/i],[[w,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[w,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[w,"armhf"]],[/windows (ce|mobile); ppc;/i],[[w,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[w,/ower/,i,xe]],[/(sun4\w)[;\)]/i],[[w,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[w,xe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[g,pe],[m,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[g,pe],[m,k]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[g,J],[m,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[g,J],[m,C]],[/(macintosh);/i],[d,[g,J]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[g,V],[m,k]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[g,Oe],[m,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[g,Oe],[m,k]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[g,P],[m,k]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[g,P],[m,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[g,"OPPO"],[m,k]],[/\b(opd2\d{3}a?) bui/i],[d,[g,"OPPO"],[m,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[g,"Vivo"],[m,k]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[g,"Realme"],[m,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[g,Q],[m,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[g,Q],[m,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[g,se],[m,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[g,se],[m,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[g,"Lenovo"],[m,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[g,"Nokia"],[m,k]],[/(pixel c)\b/i],[d,[g,he],[m,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[g,he],[m,k]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[g,T],[m,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[g,T],[m,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[g,"OnePlus"],[m,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[g,W],[m,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[g,W],[m,k]],[/(playbook);[-\w\),; ]+(rim)/i],[d,g,[m,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[g,A],[m,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[g,B],[m,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[g,B],[m,k]],[/(nexus 9)/i],[d,[g,"HTC"],[m,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[d,/_/g," "],[m,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[g,"Acer"],[m,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[g,"Meizu"],[m,k]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[g,"Ulefone"],[m,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,d,[m,k]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,d,[m,C]],[/(surface duo)/i],[d,[g,H],[m,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[g,"Fairphone"],[m,k]],[/(u304aa)/i],[d,[g,"AT&T"],[m,k]],[/\bsie-(\w*)/i],[d,[g,"Siemens"],[m,k]],[/\b(rct\w+) b/i],[d,[g,"RCA"],[m,C]],[/\b(venue[\d ]{2,7}) b/i],[d,[g,"Dell"],[m,C]],[/\b(q(?:mv|ta)\w+) b/i],[d,[g,"Verizon"],[m,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[g,"Barnes & Noble"],[m,C]],[/\b(tm\d{3}\w+) b/i],[d,[g,"NuVision"],[m,C]],[/\b(k88) b/i],[d,[g,"ZTE"],[m,C]],[/\b(nx\d{3}j) b/i],[d,[g,"ZTE"],[m,k]],[/\b(gen\d{3}) b.+49h/i],[d,[g,"Swiss"],[m,k]],[/\b(zur\d{3}) b/i],[d,[g,"Swiss"],[m,C]],[/\b((zeki)?tb.*\b) b/i],[d,[g,"Zeki"],[m,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],d,[m,C]],[/\b(ns-?\w{0,9}) b/i],[d,[g,"Insignia"],[m,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[g,"NextBook"],[m,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],d,[m,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],d,[m,k]],[/\b(ph-1) /i],[d,[g,"Essential"],[m,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[g,"Envizen"],[m,C]],[/\b(trio[-\w\. ]+) b/i],[d,[g,"MachSpeed"],[m,C]],[/\btu_(1491) b/i],[d,[g,"Rotor"],[m,C]],[/(shield[\w ]+) b/i],[d,[g,"Nvidia"],[m,C]],[/(sprint) (\w+)/i],[g,d,[m,k]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[g,H],[m,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[g,L],[m,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[g,L],[m,k]],[/smart-tv.+(samsung)/i],[g,[m,j]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[g,pe],[m,j]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,se],[m,j]],[/(apple) ?tv/i],[g,[d,J+" TV"],[m,j]],[/crkey/i],[[d,ve+"cast"],[g,he],[m,j]],[/droid.+aft(\w+)( bui|\))/i],[d,[g,W],[m,j]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[g,V],[m,j]],[/(bravia[\w ]+)( bui|\))/i],[d,[g,T],[m,j]],[/(mitv-\w{5}) bui/i],[d,[g,P],[m,j]],[/Hbbtv.*(technisat) (.*);/i],[g,d,[m,j]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,Ie],[d,Ie],[m,j]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,j]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,d,[m,E]],[/droid.+; (shield) bui/i],[d,[g,"Nvidia"],[m,E]],[/(playstation [345portablevi]+)/i],[d,[g,T],[m,E]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[g,H],[m,E]],[/((pebble))app/i],[g,d,[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[g,J],[m,S]],[/droid.+; (glass) \d/i],[d,[g,he],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[d,[g,L],[m,S]],[/(quest( \d| pro)?)/i],[d,[g,G],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,D]],[/(aeobc)\b/i],[d,[g,W],[m,D]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[m,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[m,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,k]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,Y+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,ge,b]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,ge,b],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,re],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,de+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,ve+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,U],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},N=function(q,z){if(typeof q===u&&(z=q,q=o),!(this instanceof N))return new N(q,z).getResult();var F=typeof e!==l&&e.navigator?e.navigator:o,Z=q||(F&&F.userAgent?F.userAgent:i),le=F&&F.userAgentData?F.userAgentData:o,ie=z?te(O,z):O,oe=F&&F.userAgent==Z;return this.getBrowser=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.browser),ee[f]=Me(ee[y]),oe&&F&&F.brave&&typeof F.brave.isBrave==c&&(ee[h]="Brave"),ee},this.getCPU=function(){var ee={};return ee[w]=o,Pe.call(ee,Z,ie.cpu),ee},this.getDevice=function(){var ee={};return ee[g]=o,ee[d]=o,ee[m]=o,Pe.call(ee,Z,ie.device),oe&&!ee[m]&&le&&le.mobile&&(ee[m]=k),oe&&ee[d]=="Macintosh"&&F&&typeof F.standalone!==l&&F.maxTouchPoints&&F.maxTouchPoints>2&&(ee[d]="iPad",ee[m]=C),ee},this.getEngine=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.engine),ee},this.getOS=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.os),oe&&!ee[h]&&le&&le.platform&&le.platform!="Unknown"&&(ee[h]=le.platform.replace(/chrome os/i,U).replace(/macos/i,re)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Z},this.setUA=function(ee){return Z=typeof ee===p&&ee.length>$?Ie(ee,$):ee,this},this.setUA(Z),this};N.VERSION=r,N.BROWSER=I([h,y,f]),N.CPU=I([w]),N.DEVICE=I([d,g,m,E,k,j,C,S,D]),N.ENGINE=N.OS=I([h,y]),t.exports&&(n=t.exports=N),n.UAParser=N;var R=typeof e!==l&&(e.jQuery||e.Zepto);if(R&&!R.ua){var ne=new N;R.ua=ne.getResult(),R.ua.get=function(){return ne.getUA()},R.ua.set=function(q){ne.setUA(q);var z=ne.getResult();for(var F in z)R.ua[F]=z[F]}}})(typeof window=="object"?window:M0)})(ss,ss.exports);var Ay=ss.exports;const Fn=new Ay.UAParser,Py=()=>_.useMemo(()=>({os:Fn.getOS(),browser:Fn.getBrowser(),cpu:Fn.getCPU(),device:Fn.getDevice(),engine:Fn.getEngine(),ua:Fn.getUA()}),[]),Ty=()=>_.useMemo(()=>Fn.getBrowser(),[]),Hs=()=>{const{ua:t}=Py();return t.includes("io-connect-desktop")},Ep=()=>{const[t,n]=v.useState([]),[e,o]=v.useState(!1),r=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!r)return;let i=!1;const a=[],c=r.layouts.onAdded(p=>{if(p.type!=="Global"||i)return;o(!0);const{name:f}=p;n(d=>[...d,{name:f}])}),l=r.layouts.onRemoved(p=>{p.type!=="Global"||i||n(f=>f.filter(d=>d.name!==p.name))}),u=r.layouts.onRenamed((p,f)=>{if(p.type!=="Global"||i)return;const{name:d}=p;n(h=>{const m=h.findIndex(g=>g.name===(f==null?void 0:f.name));return m===-1?h:[...h.slice(0,m),{name:d},...h.slice(m+1)]})});return a.push(c,l,u),()=>{i=!0,a.forEach(p=>p())}},[r]),{layouts:t,isInitialized:e}},Sp=()=>{const[t,n]=v.useState([]),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;const o=e.notifications.onRaised(a=>n(c=>[...c,a])),r=e.notifications.onClosed(a=>n(c=>c.filter(l=>l.id!==a.id))),i=e.notifications.onStateChanged(({id:a},c)=>{n(l=>{const u=l.findIndex(p=>p.id===a);return u===-1?l:[...l.slice(0,u),{...l[u],state:c},...l.slice(u+1)]})});return e.notifications.list().then(n).catch(console.error),()=>{o(),r(),i()}},[e]),t},_y=()=>{const[t,n]=v.useState({}),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;const o=e.notifications.onConfigurationChanged(r=>n(r));return()=>{o()}},[e]),t},zs=t=>{const{handler:n,skip:e}=t;v.useEffect(()=>{if(e)return;const o=r=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&n(r)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[n,e])},Ws=t=>{const{eventType:n,handler:e,ref:o,skip:r}=t;v.useEffect(()=>{if(r)return;const i=a=>{const c=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(c)):o.current&&!o.current.contains(c))&&e(a)};return document.addEventListener(n,i,!0),()=>{document.removeEventListener(n,i,!0)}},[n,e,o,r])},Dy=Qe({name:_t}),xr=Qe({isCompleted:Ao()}),rn=(t,n,e)=>{const[o,r]=v.useState(()=>{try{const c=window[t].getItem(n);return c?JSON.parse(c):null}catch(c){return console.log(c),null}}),i=`${t}-${n}`;v.useEffect(()=>{const c=l=>{r(l.detail)};return window.addEventListener(i,c),()=>{window.removeEventListener(i,c)}},[i]);const a=v.useCallback(c=>{try{if(!c){window[t].removeItem(n),r(null);return}const l=e.run(c);if(!l.ok){console.warn(`Error validating the value to be stored: ${l.error.message}`);return}const u=l.result;r(u),window[t].setItem(n,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(l){console.log(l)}},[n,t,i,e]);return[o,a]},$s=()=>{const[t,n]=rn("sessionStorage",sy,Dy);return{isPlatformWindow:!t||window.name===t.name,setPlatformWindow:n}},Us=()=>{const[t,n]=v.useState([]);return v.useEffect(()=>{const e=({key:i})=>{n(a=>a.includes(i)?a:a.concat(i))},o=i=>{n(a=>a.filter(c=>c!==i.key))},r=()=>{n([])};return document.addEventListener("keydown",e),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),t.length===1?t[0]:null},Vs=()=>{const t=v.useContext(_e.IOConnectContext);return v.useCallback(async(n,e)=>{if(t)try{await t.layouts.restore({name:n}),e==null||e({name:n}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${n}" was loaded successfully.`})}catch(o){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Layout "${n}".`,error:o})}},[t])},Ri={CONTROL:"Control",SHIFT:"Shift"},Gs=()=>{const t=v.useContext(_e.IOConnectContext),n=Fs();return async({id:e,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Ri.CONTROL?{newFrame:!0}:{frameId:n,reuseWorkspaceId:r};await((i=t.workspaces)==null?void 0:i.restoreWorkspace(e,a))}catch(a){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Workspace "${e}".`,error:a})}}},My=t=>{const[n,e]=v.useState([]),[o,r]=v.useState(!0),i=v.useRef(null),a=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{const c=a==null?void 0:a.search;if(!c)return;const l=[],u=[];return(async f=>{r(!0),e([]);const d=await c.query({search:f.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(d===i.current)return;i.current=d;const h=d.onResults(y=>{y.results.forEach(w=>{u.find(k=>k.id===w.id&&k.type.name===w.type.name)||u.push(w)}),r(!1),e([...u])}),m=d.onCompleted(()=>{r(!1)}),g=d.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});l.push(h,m,g)})(t),()=>{l.forEach(f=>f())}},[a,t]),{resultsToRender:n,isLoading:o}},jp=()=>{const t=v.useContext(_e.IOConnectContext),n=async({id:o})=>{var r;await((r=t.appManager.application(o))==null?void 0:r.start())},e=async({id:o,modifier:r})=>{var u,p;const i=await((u=t.workspaces)==null?void 0:u.getWorkspace(f=>f.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Ri.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((p=t.appManager.application(o))==null?void 0:p.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(Gf()?n:e)(o)}catch(r){await Fe({io:t,variant:Le.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},Ly=()=>{const[t,n]=v.useState({}),e=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{if(!e)return;const o=[];return(async()=>{var r,i;try{const a=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(l=>n(u=>({...u,[l.title]:[...u[l.title]??[],l.id]}))));o.push(a);const c=await((i=e.workspaces)==null?void 0:i.onWorkspaceClosed(({workspaceId:l})=>n(u=>{const p={...u};for(const f in p)if(p[f].includes(l)){p[f]=p[f].filter(d=>d!==l);break}return p})));o.push(c)}catch(a){console.error(a)}})(),()=>o.forEach(r=>r==null?void 0:r())},[e]),t},Op=t=>t.key==="Enter"||t.key===" ",Fi=(t,n)=>typeof t>"u"?{}:{tabIndex:0,onClick:t,onKeyDown:e=>{Op(e)&&(e.preventDefault(),t==null||t(e)),n==null||n(e)}},Np=({event:t,currentIndex:n,moveFocus:e,min:o,max:r,onClose:i})=>{switch(t.key){case"ArrowUp":{e(Math.max(n-1,o));break}case"ArrowDown":{e(Math.min(n+1,r));break}case"Home":{e(o);break}case"End":{e(r);break}case"Escape":{if(i){i();break}return}default:return}t.stopPropagation(),t.preventDefault()};const Ry=v.forwardRef((t,n)=>{const{title:e,actions:o,className:r,onClose:i,onActionItemClick:a,...c}=t,l=v.useRef({}),[u,p]=v.useState(0),f=d=>{var h;(h=l.current[d])==null||h.focus(),p(d)};return v.useEffect(()=>{var d;(d=l.current[u])==null||d.focus()},[]),s.jsxs(ut,{ref:n,className:ot(r,"context-menu"),onClick:d=>d.stopPropagation(),onKeyDown:d=>Np({event:d,currentIndex:u,min:0,max:o.length-1,moveFocus:f,onClose:i}),...c,children:[e&&s.jsx(ut.ItemSection,{children:e}),o.map((d,h)=>{const m=d.displayName||d.name,g=d.iconSrc?s.jsx(Ou,{size:"16",src:d.iconSrc,alt:`${m} icon`}):d.icon&&s.jsx(Xe,{size:"16",variant:d.icon});return s.jsxs(v.Fragment,{children:[s.jsx(ut.Item,{ref:y=>l.current[h]=y,prepend:g,disabled:d.disabled,tabIndex:-1,...Fi(y=>a(y,d)),children:m}),d.separatorAfter&&s.jsx("li",{className:"context-menu-separator","aria-hidden":!0})]},d.name)})]})});function Ys(t){const{title:n,buttonSize:e="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:c,buttonVariant:l,placement:u,offset:p,shouldCloseOnOutsideScroll:f=!1,shouldCloseOnWindowBlur:d=!1}=t,[h,m]=v.useState(!1),[g,y]=v.useState(null),[w,E]=v.useState(null),k=v.useRef(null),C=v.useRef(null),j=v.useMemo(()=>[C,k],[]),S=v.useCallback(()=>m(!1),[]),{styles:D,attributes:$}=x1(g,w,{placement:u,modifiers:[{name:"offset",options:{offset:p}}]});v.useEffect(()=>{k.current=g},[g]),v.useEffect(()=>{C.current=w},[w]),Ws({eventType:"mouseup",handler:S,ref:j,skip:!h}),zs({handler:S,skip:!h}),v.useEffect(()=>{if(!(!d||!h))return window.addEventListener("blur",S),()=>{window.removeEventListener("blur",S)}},[S,h,d]),v.useEffect(()=>{if(!f||!w)return;const B=A=>{if(w.contains(A.target)){A.preventDefault();return}S()};return document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("wheel",B,{passive:!1}),()=>{document.removeEventListener("touchmove",B),document.removeEventListener("wheel",B)}},[S,w,f]);const W=B=>{B.stopPropagation(),m(A=>!A),w==null||w.focus()},J=(B,A)=>{B.stopPropagation(),c(B,A),S()};return s.jsxs(s.Fragment,{children:[s.jsx(Ue,{ref:y,size:e,icon:o,iconSize:r,variant:l,...Fi(W),tabIndex:a?0:-1}),h&&s.jsx(Ry,{ref:E,title:n,actions:i,onActionItemClick:J,onClose:()=>{g==null||g.focus(),S()},style:D.popper,...$.popper})]})}const Fy=t=>{const{isFavoritismEnabled:n=!0,item:e,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...c}=t,{favorites:l,toggleFavorite:u,isLoading:p}=Li(),{description:f,icon:d="application",iconSrc:h,openInstances:m=0,title:g,tooltip:y,className:w,contextMenuActions:E=[]}=e,k=n&&l.some(D=>D.type===e.type&&D.title===e.title),C=D=>{if(Op(D)){o(D),D.preventDefault(),D.stopPropagation();return}r(D)},j=h?s.jsx(Ou,{size:"16",src:h,alt:`${g} icon`}):s.jsx(Xe,{size:"16",variant:d}),S=s.jsxs(s.Fragment,{children:[m!==0&&s.jsx("span",{className:"open-instances io-text-smaller",children:m===1?"Opened":`${m} opened`}),(n||E.length>0)&&s.jsxs(Re,{className:"item-actions",children:[n&&s.jsx(Ue,{...Fi(D=>{D.stopPropagation(),u(e)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:k?"star-full":"star",disabled:p}),E.length>0&&s.jsx(Ys,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:g,actions:E,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})]})]});return s.jsx(ut.Item,{ref:a,tabIndex:i?0:-1,className:ot("io-base-section-item",w),onKeyDown:C,onClick:o,prepend:j,append:S,description:f,tooltip:y??g,...c,children:g})},By=new xp,Hy=()=>{const{value:t,update:n}=Ht({prefKey:_o.COLLAPSED_SECTIONS}),e=v.useCallback(o=>By.enqueue(()=>n((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[n]);return{collapsedSections:t,toggleSection:e}},Zs=t=>{const{config:n,level:e=1,path:o=n.id,onItemClick:r}=t,{isCollapsible:i=!0}=n,a=Us(),[c,l]=v.useState(0),u=v.useRef({}),{collapsedSections:p,toggleSection:f}=Hy(),d=i?!(p!=null&&p.includes(o)):!0,h=n.items.filter(C=>tr(C)),m=n.items.filter(C=>!tr(C)),g=[...h,...m],y=16,w=24,E=C=>{var j,S;(S=(j=u.current[C])==null?void 0:j.querySelector("[tabIndex]"))==null||S.focus(),l(C)},k=async()=>{i&&await f(o)};return s.jsxs(ut.ItemWithSubItems,{className:e===1?"main-section":void 0,children:[s.jsx(V1,{className:e===1?"io-list-item-title main-section-header":void 0,isOpen:d,onClick:k,showCollapseIcon:i,showFolderIcon:e!==1,style:{paddingLeft:`${y+w*Math.max(0,e-2)}px`},title:n.title}),s.jsx(pp,{isOpen:d,tag:ut,children:g.map((C,j)=>tr(C)?s.jsx(Zs,{config:C,level:e+1,onItemClick:r,path:`${o}/${C.id}`},C.id):s.jsx(Fy,{style:{paddingLeft:`${y+w*(e-1)}px`},liRef:S=>u.current[j]=S,isFavoritismEnabled:C.type===wt.APPLICATION||C.type===wt.WORKSPACE,item:C,onClick:(S,D)=>r==null?void 0:r(S,{item:C,modifier:a,selectedContextMenuActionName:D==null?void 0:D.name}),onKeyDown:S=>{Np({event:S,moveFocus:E,currentIndex:c,min:0,max:g.length-1})},isFocused:c===j},C.id))})]})},Ip=t=>`${t.type}-${t.id}`,zy=(t,n)=>Ap(t)[n],Ap=t=>t.reduce((n,e)=>tr(e)?{...n,...Ap(e.items)}:{...n,[Ip(e)]:e},{}),Pp=v.createContext(void 0),Wy=()=>{const t=v.useContext(Pp);if(t===void 0)throw new Error("useSection must be used within a SectionProvider");return t},$y=({children:t})=>{const[n,e]=v.useState(null),o=v.useMemo(()=>[n,e],[n]);return s.jsx(Pp.Provider,{value:o,children:t})},Bi=({config:t,onItemClick:n})=>{const[e,o]=Wy(),r=gn(),i=Us(),{isLaunchpadPinned:a}=ro(),c=(l,u)=>{const{item:p,selectedContextMenuActionName:f}=u;o({itemName:Ip(p),selectedContextMenuActionName:f})};return v.useEffect(()=>{var f;if(!n||!e)return;const{itemName:l,selectedContextMenuActionName:u}=e,p=zy(t.items,l);p&&(n({item:p,modifier:i,selectedContextMenuActionName:u}),o(null),!(i===Ri.SHIFT||a)&&((f=r.close)==null||f.call(r)))},[e,t.items,r,n,i,o,a]),s.jsx(Zs,{config:t,onItemClick:c})};function Tp(t){const{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}=t,r=hp(),i=G1(),a=jp(),c=mp(),l=v.useMemo(()=>D0(r,i,{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}),[r,i,n,e,o]),u=p=>{const{item:f,modifier:d,selectedContextMenuActionName:h}=p;if(!h)return a({id:f.id,title:f.title,modifier:d});c(f,h)};return s.jsx(Bi,{config:l,onItemClick:u})}const Uy=(t,n)=>{const{isSectionCollapsible:e,sortOrder:o=ur.DISABLED}=n,r=js({items:t,sortOrder:o,ascendingCompare:Kf,descendingCompare:qf});return{id:xo.FAVORITES,title:"Favorites",items:r,isCollapsible:e}},_p=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,{favorites:o}=Li(),r=v.useMemo(()=>Uy(o,{isSectionCollapsible:n,sortOrder:e}),[o,n,e]);return o.length>0?s.jsx(Bi,{config:r}):null},Dp=t=>{const{active:n,className:e,children:o,...r}=t;return s.jsx(Ue,{className:ot("launchpad-button",{active:n},e),"aria-label":"Launchpad",variant:"circle",size:"32",title:n?"Close Launchpad":"Open Launchpad",...r,children:o??s.jsx(Xe,{variant:"logo"})})};var Vy=function(n){return Gy(n)&&!Yy(n)};function Gy(t){return!!t&&typeof t=="object"}function Yy(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||qy(t)}var Zy=typeof Symbol=="function"&&Symbol.for,Ky=Zy?Symbol.for("react.element"):60103;function qy(t){return t.$$typeof===Ky}function Jy(t){return Array.isArray(t)?[]:{}}function hr(t,n){return n.clone!==!1&&n.isMergeableObject(t)?Po(Jy(t),t,n):t}function Xy(t,n,e){return t.concat(n).map(function(o){return hr(o,e)})}function Qy(t,n){if(!n.customMerge)return Po;var e=n.customMerge(t);return typeof e=="function"?e:Po}function eb(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function jl(t){return Object.keys(t).concat(eb(t))}function Mp(t,n){try{return n in t}catch{return!1}}function tb(t,n){return Mp(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function nb(t,n,e){var o={};return e.isMergeableObject(t)&&jl(t).forEach(function(r){o[r]=hr(t[r],e)}),jl(n).forEach(function(r){tb(t,r)||(Mp(t,r)&&e.isMergeableObject(n[r])?o[r]=Qy(r,e)(t[r],n[r],e):o[r]=hr(n[r],e))}),o}function Po(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||Xy,e.isMergeableObject=e.isMergeableObject||Vy,e.cloneUnlessOtherwiseSpecified=hr;var o=Array.isArray(n),r=Array.isArray(t),i=o===r;return i?o?e.arrayMerge(t,n,e):nb(t,n,e):hr(n,e)}Po.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(o,r){return Po(o,r,e)},{})};var ob=Po,rb=ob;const ib=_i(rb),On={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},Hi="getScreenDetails"in window,ab={header:{showHeader:!0,showSearch:!0},mode:"default"},sb=({className:t,children:n})=>s.jsx("header",{className:ot("launchpad-header",t),children:n}),Lp=({className:t})=>{const{isLaunchpadPinned:n,isLoading:e,toggle:o}=ro();return s.jsx(Ue,{className:t,size:"32",variant:"circle",icon:n?"unpin":"pin",onClick:o,disabled:e})},cb=v.forwardRef((t,n)=>{const{onSearch:e,searchTerm:o,onClear:r,className:i}=t,a=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),s.jsx(Qn,{id:"search-input",className:ot("search-bar",i),ref:n,placeholder:"Find anything",value:o,onChange:e,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),Rp=()=>{const{defaultLayout:t,activeLayout:n}=gn();return e=>({name:e,isDefault:e===(t==null?void 0:t.name),isActive:e===(n==null?void 0:n.name)})},lb=()=>{const t=bp(),n=Rp(),e=Do();return async(o,r)=>{const{id:i}=o,a=n(i);await e(()=>t({layout:a,actionName:r}))}},ub=()=>{const t=mp(),n=kp(),e=lb();return o=>{if(o===wt.APPLICATION)return t;if(o===wt.WORKSPACE)return n;if(o===wt.LAYOUT)return e}},lo={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},Fp=t=>[{name:lo.RENAME,displayName:"Rename",icon:"pen-line"},{name:lo.SAVE,displayName:"Save",disabled:!t.isActive,icon:"floppy"},{name:lo.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:lo.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:lo.SET_AS_DEFAULT,displayName:"Set as Default",disabled:t.isDefault,icon:"user-gear",separatorAfter:!0},{name:lo.LOAD,displayName:"Load",icon:"spinner"}],db=t=>{const n=Rp();return t.reduce((e,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return e;let a=[];if(r.name===wt.APPLICATION)a=Yf;else if(r.name===wt.WORKSPACE)a=Zf;else if(r.name===wt.LAYOUT){const p=n(i);a=Fp(p)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:p,method:f,params:d,target:h})=>({name:p,interopParams:{method:f,params:d,target:h}})));const c={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},l=e.findIndex(({title:p})=>r.displayName?p===r.displayName:p===r.name),u=e[l];return u?[...e.slice(0,l),{...u,items:[...u.items,c]},...e.slice(l+1)]:[...e,{id:r.name,title:r.displayName||r.name,items:[c]}]},[])};function fb(t){const{resultsToRender:n,isLoading:e}=My(t.searchTerm),{close:o}=gn(),r=Ny(),i=Gs(),a=jp(),c=Vs(),l=ub(),u=db(n),p=Do(),{isLaunchpadPinned:f}=ro(),d=(m,g)=>{const y=l(m.type);y==null||y(m,g)},h=async(m,g)=>{var $;const{item:y,modifier:w,selectedContextMenuActionName:E}=g,{type:k,id:C,title:j,mainAction:S}=y,D=E?($=y.contextMenuActions)==null?void 0:$.find(W=>W.name===E):null;D!=null&&D.interopParams?r(D.interopParams):E?d(y,E):S?r(S):k===wt.APPLICATION?a({id:C,title:j,modifier:w}):k===wt.WORKSPACE?i({id:C,modifier:w}):k===wt.LAYOUT&&p(()=>c(C)),!(w===Ri.SHIFT||f)&&(o==null||o())};return e?s.jsx("p",{className:"search-loading",children:"Loading..."}):n.length===0?s.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):s.jsx(ut,{children:u.map((m,g)=>s.jsx(Zs,{config:m,onItemClick:h},m.id||g))})}const pb=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=ur.ASCENDING}=e,a=js({items:t,sortOrder:r,ascendingCompare:Kf,descendingCompare:qf}).map(c=>{var l;return{...c,type:wt.WORKSPACE,icon:"workspace",openInstances:(l=n[c.title])==null?void 0:l.length,contextMenuActions:Zf}});return{id:xo.WORKSPACES,title:"Workspaces",items:[...a,{id:wp.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:wt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},Bp=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,o=Cp(),r=Ly(),i=Gs(),a=kp(),c=v.useMemo(()=>pb(o,r,{isSectionCollapsible:n,sortOrder:e}),[o,r,n,e]),l=u=>{const{item:p,modifier:f,selectedContextMenuActionName:d}=u;return d?a(p,d):p.type===wt.ACTION_BUTTON?a(p,p.id):i({id:p.id,modifier:f})};return s.jsx(Bi,{config:c,onItemClick:l})},hb=[{placementId:xo.FAVORITES,Component:_p},{placementId:xo.WORKSPACES,Component:Bp},{placementId:xo.APPLICATIONS,Component:Tp}],mb=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:_o.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:t,setIsLayoutsPanelOpen:n,isLoading:e}},gb=({layoutName:t})=>{const n=v.useContext(_e.IOConnectContext),e=Do(),o=r=>{r.stopPropagation(),e(async()=>{try{await n.layouts.save({name:t,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${t}" was saved successfully.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${t}".`,error:a})}})};return s.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout"})},vb=({layout:t})=>{const n=bp(),e=Do(),o=async(r,i)=>{r.stopPropagation(),await e(()=>n({layout:t,actionName:i.name}))};return s.jsx(Ys,{buttonSize:"24",iconSize:"12",title:t.name,icon:"ellipsis-vertical",actions:Fp(t),onActionItemClick:o,placement:"top-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})},Hp=({layouts:t})=>{const{isLaunchpadPinned:n}=ro(),{close:e}=gn(),o=Vs(),r=Do(),i=()=>{n||e==null||e()},a=c=>r(()=>o(c.name,i));return s.jsx(ut,{className:"layouts-list",variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},children:t.map(c=>s.jsx(ut.Item,{className:"layouts-list-item",onClick:()=>a(c),append:s.jsxs(s.Fragment,{children:[c.isDefault&&s.jsx(Nu,{variant:"default",title:"Default Layout",children:"Default"}),s.jsxs(up,{children:[c.isActive&&s.jsx(gb,{layoutName:c.name}),s.jsx(vb,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,children:c.name},c.name))})},yb=()=>{const{layouts:t}=Ep(),{activeLayout:n,defaultLayout:e}=gn(),o=v.useMemo(()=>t.map(r=>({...r,isActive:r.name===(n==null?void 0:n.name),isDefault:r.name===(e==null?void 0:e.name)})),[t,n,e]);return s.jsx(Hp,{layouts:o})},bb=()=>{const{defaultLayout:t,activeLayout:n}=gn();return n?s.jsx(Hp,{layouts:[{...n,isDefault:n.name===(t==null?void 0:t.name),isActive:!0}]}):s.jsx("p",{className:"io-text-small no-active-layout",children:"Choose which Layout to load"})},wb=()=>{const t=v.useContext(_e.IOConnectContext),{setActiveLayout:n}=gn(),e=Do(),o=async()=>{var f;if(!("modals"in t&&t.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await t.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u)){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await t.layouts.save({name:u}),n({name:u}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(d){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}".`,error:d})}};return s.jsx(Re,{variant:"fullwidth",className:"create-layout-btn-group",children:s.jsx(Ge,{variant:"primary",text:"Create Layout",onClick:()=>e(o)})})};const xb=()=>{const t=v.useRef(null),{layouts:n,isInitialized:e}=Ep(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=mb();v.useEffect(()=>{!e||n.length>0||!o||r(!1)},[n,e,o,r]);const i=v.useCallback(()=>r(a=>!a),[r]);return s.jsxs("footer",{className:"layouts-panel",ref:t,children:[s.jsx(xi,{className:"layouts-panel-separator"}),s.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button",...Fi(n.length?i:void 0),children:[s.jsx(nn,{tag:"h2",size:"normal",text:n.length>0?"Layouts":"Start using Layouts"}),n.length>0&&s.jsx(Ue,{className:ot("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24"})]}),s.jsx(pp,{isOpen:o,tag:"div",children:s.jsx(yb,{})}),n.length>0&&!o?s.jsx(bb,{}):s.jsx(wb,{})]})},Cb=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:_o.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:t,setIsLaunchpadCollapsed:n,isLoading:e}};const zp=t=>{const{isOpen:n=!0,onClose:e,className:o,settings:r={},components:i={},windowManagementPermissionState:a="granted",...c}=t,l=v.useMemo(()=>ib(ab,r),[r]),{showSearch:u,showHeader:p}=l.header??{},{sections:f=hb}=i,{BeforeSearch:d,AfterSearch:h}=i.header??{},[m,g]=v.useState(""),y=v.useRef(null),w=Hi&&a==="granted",E=Fs(),{isLaunchpadPinned:k}=ro(),{isLaunchpadCollapsed:C,setIsLaunchpadCollapsed:j}=Cb();v.useEffect(()=>{var $;n&&(($=y.current)==null||$.focus())},[n]),v.useEffect(()=>{k&&j(!1)},[j,k]);const S=$=>{const W=$.target.value;El(W)&&C&&j(!1),g(W)},D=()=>{var $;g(""),($=y.current)==null||$.focus()};return s.jsx(ky,{close:e,isGlobalLayoutsAvailable:w,children:s.jsxs("div",{className:ot("launchpad",o),...c,children:[p&&s.jsxs(sb,{className:E||k?void 0:"draggable",children:[d&&s.jsx(d,{}),u&&s.jsx(cb,{ref:y,searchTerm:m,onSearch:S,onClear:D,className:E?void 0:"non-draggable"}),h&&s.jsx(h,{}),h===void 0&&l.mode!=="pinned"&&s.jsx(Lp,{className:"ms-auto"})]}),s.jsxs("div",{className:ot("launchpad-body",C?"collapsed":void 0),children:[s.jsx("main",{className:"launchpad-main",children:El(m)?s.jsx(fb,{searchTerm:m}):s.jsx($y,{children:s.jsx(ut,{children:f.map(({Component:$,placementId:W})=>s.jsx($,{},W))})})}),w&&s.jsx(xb,{})]})]})})},Wp=v.createContext(void 0),$p=()=>{const t=v.useContext(Wp);if(t===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return t},kb=()=>{const t=Hi?[On.NOTIFICATIONS,On.WINDOW_MANAGEMENT]:[On.NOTIFICATIONS];return Promise.all(t.map(async n=>{const e=await navigator.permissions.query({name:n});return e.stableName=n,e}))},Up=v.createContext(void 0),_n=()=>{const t=v.useContext(Up);if(t===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return t},Eb=({children:t})=>{const[n,e]=rn("localStorage",wr,xr),[o,r]=v.useState([]),i=v.useMemo(()=>o.reduce((f,d)=>({...f,[d.stableName]:{state:d.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[c,l]=v.useState(!1),u={isLoggingOut:c,setIsLoggingOut:l};v.useEffect(()=>{let f=!1;const d=kb().then(h=>{if(f)return;r(h);const m=[];let g=!1;return h.forEach((y,w)=>{const E=k=>{if(f||!k.target||g)return;const C=k.target;if(C.state==="prompt")return e({isCompleted:!1}),g=!0,window.location.reload();r(S=>[...S.slice(0,w),C,...S.slice(w+1)])};y.addEventListener("change",E),m.push(()=>y.removeEventListener("change",E))}),m}).catch(console.warn);return()=>{f=!0,d.then(h=>{h==null||h.forEach(m=>m())})}},[e]);const p=v.useMemo(()=>({permission:a,login:u}),[a,u]);return s.jsx(Up.Provider,{value:p,children:t})},Sb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),s.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),s.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),s.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),jb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),Ob=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),s.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),s.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),s.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),Nb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),s.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),s.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),Ib=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),s.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),Ab={edgeNotificationsPermissionTimeout:15e3},et={WINDOW_MANAGEMENT:On.WINDOW_MANAGEMENT,NOTIFICATIONS:On.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},Pb={name:et.WINDOW_MANAGEMENT,label:`Allow window management${Hi?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
49
+ windows and share context data between opened windows.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt.
50
+ Click the "Open permissions prompt" button again and grant the Window Management
51
+ permission to allow the platform to function properly.`},Image:Nb,actionBtnText:"Open permission prompt"},Tb={name:et.NOTIFICATIONS,label:"Allow browser notifications",heading:"Allow Browser Notifications",description:`By granting this permission you will be able to receive platform notifications in the notification center of your
52
+ operating system.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt or your browser automatically blocks notifications.
53
+ To allow browser notifications, go to your browser settings or click the "Bell" icon
54
+ in the address bar and allow notifications for this site.`},Image:Sb,actionBtnText:"Open permission prompt"},_b={name:et.POPUPS,label:"Allow pop-ups",heading:"Allow Pop-ups",description:"By granting this permission you will be able to eject apps from Workspaces and save them as part of a Layout.",instructions:{initial:`Click the "Test Pop-Up Settings" button. It should open two pop-ups in order to test the
55
+ browser pop-up settings.`,additional:`It seems that pop-ups are disabled in your browser.
56
+ To allow pop-ups, go to your browser settings or click the "Pop-up blocked" icon
57
+ in the address bar and allow pop-ups for this site.`},Image:jb,actionBtnText:"Test pop-up settings"},Db={name:et.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:Ob,actionBtnText:"Continue to the platform"},Yr=[Pb,Tb,_b,Db],Fr={isCompleted:!1,state:"prompt"},Mb={[et.WINDOW_MANAGEMENT]:Fr,[et.NOTIFICATIONS]:Fr,[et.POPUPS]:Fr,[et.PWA_INSTALL]:Fr},Lb=({isOpen:t,onClose:n})=>{var a;const{launchpadComponents:e,launchpadSettings:o}=$p(),{permission:r}=_n(),i=(a=r.statuses[et.WINDOW_MANAGEMENT])==null?void 0:a.state;return s.jsx(zp,{components:e,isOpen:t,onClose:n,settings:o,windowManagementPermissionState:i})};const Vp=v.forwardRef((t,n)=>{const{className:e,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:c="left"}=t;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),s.jsx("div",{className:ot(e,"panel-wrapper",c,{open:o,pinned:a}),ref:n,children:i&&s.jsx(i,{isOpen:o,onClose:r})})}),Ks=t=>{const{Button:n,Panel:e,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:c}=t,[l,u]=v.useState(!1),p=v.useRef(null),f=v.useCallback(async()=>{u(!1),await(c==null?void 0:c())},[c]),d=()=>{if(l){f();return}u(!0)},h=!l||r;return Ws({eventType:"mouseup",handler:f,ref:p,skip:h}),zs({handler:f,skip:h}),s.jsxs(a,{ref:p,children:[s.jsx(n,{active:l,onClick:d}),s.jsx(Vp,{className:o,isOpen:l,onClose:f,Panel:e,pinned:r,position:i})]})};const Gp=({Button:t=Dp})=>{const{isLaunchpadPinned:n}=ro();return s.jsx(Ks,{Button:t,Panel:Lb,panelWrapperClassName:"launchpad-panel-wrapper",pinned:n})};var cs=function(t,n){return cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])},cs(t,n)};function Rb(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");cs(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}var yt=function(){return yt=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yt.apply(this,arguments)};function Fb(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function uo(t,n,e,o){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function c(p){try{u(o.next(p))}catch(f){a(f)}}function l(p){try{u(o.throw(p))}catch(f){a(f)}}function u(p){p.done?i(p.value):r(p.value).then(c,l)}u((o=o.apply(t,n||[])).next())})}function fo(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(p){return l([u,p])}}function l(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(e=0)),e;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(p){u=[6,p],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Qt(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}var $n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Js(t,n){return t(n={exports:{}},n.exports),n.exports}var Bn=Js(function(t,n){Object.defineProperty(n,"__esModule",{value:!0});var e=function(){function o(){var r=this;this.locked=new Map,this.addToLocked=function(i,a){var c=r.locked.get(i);c===void 0?a===void 0?r.locked.set(i,[]):r.locked.set(i,[a]):a!==void 0&&(c.unshift(a),r.locked.set(i,c))},this.isLocked=function(i){return r.locked.has(i)},this.lock=function(i){return new Promise(function(a,c){r.isLocked(i)?r.addToLocked(i,a):(r.addToLocked(i),a())})},this.unlock=function(i){var a=r.locked.get(i);if(a!==void 0&&a.length!==0){var c=a.pop();r.locked.set(i,a),c!==void 0&&setTimeout(c,0)}else r.locked.delete(i)}}return o.getInstance=function(){return o.instance===void 0&&(o.instance=new o),o.instance},o}();n.default=function(){return e.getInstance()}});qs(Bn);var Bb=qs(Js(function(t,n){var e=$n&&$n.__awaiter||function(p,f,d,h){return new(d||(d=Promise))(function(m,g){function y(k){try{E(h.next(k))}catch(C){g(C)}}function w(k){try{E(h.throw(k))}catch(C){g(C)}}function E(k){k.done?m(k.value):new d(function(C){C(k.value)}).then(y,w)}E((h=h.apply(p,f||[])).next())})},o=$n&&$n.__generator||function(p,f){var d,h,m,g,y={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return g={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(E){return function(k){return function(C){if(d)throw new TypeError("Generator is already executing.");for(;y;)try{if(d=1,h&&(m=2&C[0]?h.return:C[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,C[1])).done)return m;switch(h=0,m&&(C=[2&C[0],m.value]),C[0]){case 0:case 1:m=C;break;case 4:return y.label++,{value:C[1],done:!1};case 5:y.label++,h=C[1],C=[0];continue;case 7:C=y.ops.pop(),y.trys.pop();continue;default:if(m=y.trys,!((m=m.length>0&&m[m.length-1])||C[0]!==6&&C[0]!==2)){y=0;continue}if(C[0]===3&&(!m||C[1]>m[0]&&C[1]<m[3])){y.label=C[1];break}if(C[0]===6&&y.label<m[1]){y.label=m[1],m=C;break}if(m&&y.label<m[2]){y.label=m[2],y.ops.push(C);break}m[2]&&y.ops.pop(),y.trys.pop();continue}C=f.call(p,y)}catch(j){C=[6,j],h=0}finally{d=m=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([E,k])}}},r=$n;Object.defineProperty(n,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},getItem:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},clear:function(){return e(r,void 0,void 0,function(){return o(this,function(p){return[2,window.localStorage.clear()]})})},removeItem:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},setItem:function(p,f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},keySync:function(p){return window.localStorage.key(p)},getItemSync:function(p){return window.localStorage.getItem(p)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(p){return window.localStorage.removeItem(p)},setItemSync:function(p,f){return window.localStorage.setItem(p,f)}};function c(p){return new Promise(function(f){return setTimeout(f,p)})}function l(p){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<p;h++)d+=f[Math.floor(Math.random()*f.length)];return d}var u=function(){function p(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,p.waiters===void 0&&(p.waiters=[])}return p.prototype.acquireLock=function(f,d){return d===void 0&&(d=5e3),e(this,void 0,void 0,function(){var h,m,g,y,w,E,k;return o(this,function(C){switch(C.label){case 0:h=Date.now()+l(4),m=Date.now()+d,g=i+"-"+f,y=this.storageHandler===void 0?a:this.storageHandler,C.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return C.sent(),y.getItemSync(g)!==null?[3,5]:(w=this.id+"-"+f+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return C.sent(),y.setItemSync(g,JSON.stringify({id:this.id,iat:h,timeoutKey:w,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return C.sent(),(E=y.getItemSync(g))!==null&&(k=JSON.parse(E)).id===this.id&&k.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(g,h),[2,!0]):[3,7];case 5:return p.lockCorrector(this.storageHandler===void 0?a:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:C.sent(),C.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},p.prototype.refreshLockWhileAcquired=function(f,d){return e(this,void 0,void 0,function(){var h=this;return o(this,function(m){return setTimeout(function(){return e(h,void 0,void 0,function(){var g,y,w;return o(this,function(E){switch(E.label){case 0:return[4,Bn.default().lock(d)];case 1:return E.sent(),this.acquiredIatSet.has(d)?(g=this.storageHandler===void 0?a:this.storageHandler,(y=g.getItemSync(f))===null?(Bn.default().unlock(d),[2]):((w=JSON.parse(y)).timeRefreshed=Date.now(),g.setItemSync(f,JSON.stringify(w)),Bn.default().unlock(d),this.refreshLockWhileAcquired(f,d),[2])):(Bn.default().unlock(d),[2])}})})},1e3),[2]})})},p.prototype.waitForSomethingToChange=function(f){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var m=!1,g=Date.now(),y=!1;function w(){if(y||(window.removeEventListener("storage",w),p.removeFromWaiting(w),clearTimeout(E),y=!0),!m){m=!0;var k=50-(Date.now()-g);k>0?setTimeout(h,k):h(null)}}window.addEventListener("storage",w),p.addToWaiting(w);var E=setTimeout(w,Math.max(0,f-Date.now()))})];case 1:return d.sent(),[2]}})})},p.addToWaiting=function(f){this.removeFromWaiting(f),p.waiters!==void 0&&p.waiters.push(f)},p.removeFromWaiting=function(f){p.waiters!==void 0&&(p.waiters=p.waiters.filter(function(d){return d!==f}))},p.notifyWaiters=function(){p.waiters!==void 0&&p.waiters.slice().forEach(function(f){return f()})},p.prototype.releaseLock=function(f){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,d.sent()]}})})},p.prototype.releaseLock__private__=function(f){return e(this,void 0,void 0,function(){var d,h,m,g;return o(this,function(y){switch(y.label){case 0:return d=this.storageHandler===void 0?a:this.storageHandler,h=i+"-"+f,(m=d.getItemSync(h))===null?[2]:(g=JSON.parse(m)).id!==this.id?[3,2]:[4,Bn.default().lock(g.iat)];case 1:y.sent(),this.acquiredIatSet.delete(g.iat),d.removeItemSync(h),Bn.default().unlock(g.iat),p.notifyWaiters(),y.label=2;case 2:return[2]}})})},p.lockCorrector=function(f){for(var d=Date.now()-5e3,h=f,m=[],g=0;;){var y=h.keySync(g);if(y===null)break;m.push(y),g++}for(var w=!1,E=0;E<m.length;E++){var k=m[E];if(k.includes(i)){var C=h.getItemSync(k);if(C!==null){var j=JSON.parse(C);(j.timeRefreshed===void 0&&j.timeAcquired<d||j.timeRefreshed!==void 0&&j.timeRefreshed<d)&&(h.removeItemSync(k),w=!0)}}}w&&p.notifyWaiters()},p.waiters=void 0,p}();n.default=u}));const Hb={timeoutInSeconds:60},Yp={name:"auth0-spa-js",version:"2.1.3"},Zp=()=>Date.now();class Et extends Error{constructor(n,e){super(e),this.error=n,this.error_description=e,Object.setPrototypeOf(this,Et.prototype)}static fromPayload({error:n,error_description:e}){return new Et(n,e)}}class Xs extends Et{constructor(n,e,o,r=null){super(n,e),this.state=o,this.appState=r,Object.setPrototypeOf(this,Xs.prototype)}}class mr extends Et{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,mr.prototype)}}class Qs extends mr{constructor(n){super(),this.popup=n,Object.setPrototypeOf(this,Qs.prototype)}}class ec extends Et{constructor(n){super("cancelled","Popup closed"),this.popup=n,Object.setPrototypeOf(this,ec.prototype)}}class tc extends Et{constructor(n,e,o){super(n,e),this.mfa_token=o,Object.setPrototypeOf(this,tc.prototype)}}class zi extends Et{constructor(n,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${Ol(n,["default"])}', scope: '${Ol(e)}')`),this.audience=n,this.scope=e,Object.setPrototypeOf(this,zi.prototype)}}function Ol(t,n=[]){return t&&!n.includes(t)?t:""}const Zr=()=>window.crypto,va=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let n="";return Array.from(Zr().getRandomValues(new Uint8Array(43))).forEach(e=>n+=t[e%t.length]),n},Nl=t=>btoa(t),ls=t=>{var{clientId:n}=t,e=Qt(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:n},e))).toString()},Il=t=>(n=>decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),zb=async(t,n)=>{const e=await fetch(t,n);return{ok:e.ok,json:await e.json()}},Wb=async(t,n,e)=>{const o=new AbortController;let r;return n.signal=o.signal,Promise.race([zb(t,n),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},e)})]).finally(()=>{clearTimeout(r)})},$b=async(t,n,e,o,r,i,a)=>{return c={auth:{audience:n,scope:e},timeout:r,fetchUrl:t,fetchOptions:o,useFormData:a},l=i,new Promise(function(u,p){const f=new MessageChannel;f.port1.onmessage=function(d){d.data.error?p(new Error(d.data.error)):u(d.data),f.port1.close()},l.postMessage(c,[f.port2])});var c,l},Ub=async(t,n,e,o,r,i,a=1e4)=>r?$b(t,n,e,o,a,r,i):Wb(t,o,a);async function Vb(t,n){var{baseUrl:e,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:c}=t,l=Qt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u=c?ls(l):JSON.stringify(l);return await async function(p,f,d,h,m,g,y){let w,E=null;for(let $=0;$<3;$++)try{w=await Ub(p,d,h,m,g,y,f),E=null;break}catch(W){E=W}if(E)throw E;const k=w.json,{error:C,error_description:j}=k,S=Qt(k,["error","error_description"]),{ok:D}=w;if(!D){const $=j||`HTTP error. Unable to fetch ${p}`;throw C==="mfa_required"?new tc(C,$,S.mfa_token):C==="missing_refresh_token"?new zi(d,h):new Et(C||"request_error",$)}return S}(`${e}/oauth/token`,o,r||"default",i,{method:"POST",body:u,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Yp))}},n,c)}const Br=(...t)=>{return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n};class en{constructor(n,e="@@auth0spajs@@",o){this.prefix=e,this.suffix=o,this.clientId=n.clientId,this.scope=n.scope,this.audience=n.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(n){const[e,o,r,i]=n.split("::");return new en({clientId:o,scope:i,audience:r},e)}static fromCacheEntry(n){const{scope:e,audience:o,client_id:r}=n;return new en({scope:e,audience:o,clientId:r})}}class Gb{set(n,e){localStorage.setItem(n,JSON.stringify(e))}get(n){const e=window.localStorage.getItem(n);if(e)try{return JSON.parse(e)}catch{return}}remove(n){localStorage.removeItem(n)}allKeys(){return Object.keys(window.localStorage).filter(n=>n.startsWith("@@auth0spajs@@"))}}class Kp{constructor(){this.enclosedCache=function(){let n={};return{set(e,o){n[e]=o},get(e){const o=n[e];if(o)return o},remove(e){delete n[e]},allKeys:()=>Object.keys(n)}}()}}class Yb{constructor(n,e,o){this.cache=n,this.keyManifest=e,this.nowProvider=o||Zp}async setIdToken(n,e,o){var r;const i=this.getIdTokenCacheKey(n);await this.cache.set(i,{id_token:e,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(n){const e=await this.cache.get(this.getIdTokenCacheKey(n.clientId));if(!e&&n.scope&&n.audience){const o=await this.get(n);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(n,e=0){var o;let r=await this.cache.get(n.toKey());if(!r){const c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(n,c);l&&(r=await this.cache.get(l))}if(!r)return;const i=await this.nowProvider(),a=Math.floor(i/1e3);return r.expiresAt-e<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},await this.cache.set(n.toKey(),r),r.body):(await this.cache.remove(n.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(n.toKey()))):r.body}async set(n){var e;const o=new en({clientId:n.client_id,scope:n.scope,audience:n.audience}),r=await this.wrapCacheEntry(n);await this.cache.set(o.toKey(),r),await((e=this.keyManifest)===null||e===void 0?void 0:e.add(o.toKey()))}async clear(n){var e;const o=await this.getCacheKeys();o&&(await o.filter(r=>!n||r.includes(n)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((e=this.keyManifest)===null||e===void 0?void 0:e.clear()))}async wrapCacheEntry(n){const e=await this.nowProvider();return{body:n,expiresAt:Math.floor(e/1e3)+n.expires_in}}async getCacheKeys(){var n;return this.keyManifest?(n=await this.keyManifest.get())===null||n===void 0?void 0:n.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(n){return new en({clientId:n},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(n,e){return e.filter(o=>{var r;const i=en.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),c=((r=n.scope)===null||r===void 0?void 0:r.split(" "))||[],l=i.scope&&c.reduce((u,p)=>u&&a.has(p),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===n.clientId&&i.audience===n.audience&&l})[0]}}class Zb{constructor(n,e,o){this.storage=n,this.clientId=e,this.cookieDomain=o,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(n){this.storage.save(this.storageKey,n,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Yo=t=>typeof t=="number",Kb=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],qb=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const n=(i=>{const a=i.split("."),[c,l,u]=a;if(a.length!==3||!c||!l||!u)throw new Error("ID token could not be decoded");const p=JSON.parse(Il(l)),f={__raw:i},d={};return Object.keys(p).forEach(h=>{f[h]=p[h],Kb.includes(h)||(d[h]=p[h])}),{encoded:{header:c,payload:l,signature:u},header:JSON.parse(Il(c)),claims:f,user:d}})(t.id_token);if(!n.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(n.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${n.claims.iss}"`);if(!n.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(n.header.alg!=="RS256")throw new Error(`Signature algorithm of "${n.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!n.claims.aud||typeof n.claims.aud!="string"&&!Array.isArray(n.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(n.claims.aud)){if(!n.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${n.claims.aud.join(", ")}"`);if(n.claims.aud.length>1){if(!n.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(n.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${n.claims.azp}"`)}}else if(n.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${n.claims.aud}"`);if(t.nonce){if(!n.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(n.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${n.claims.nonce}"`)}if(t.max_age&&!Yo(n.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(n.claims.exp==null||!Yo(n.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Yo(n.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const e=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(n.claims.exp+e),o>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${o}) is after expiration time (${r})`);if(n.claims.nbf!=null&&Yo(n.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(n.claims.nbf-e),o<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${o}) is before ${i}`)}if(n.claims.auth_time!=null&&Yo(n.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(n.claims.auth_time)+t.max_age+e),o>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${o}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!n.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==n.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_id}"`)}else{const a=i.toLowerCase();if(!n.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==n.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_name}"`)}}return n};var Yn=Js(function(t,n){var e=$n&&$n.__assign||function(){return e=Object.assign||function(l){for(var u,p=1,f=arguments.length;p<f;p++)for(var d in u=arguments[p])Object.prototype.hasOwnProperty.call(u,d)&&(l[d]=u[d]);return l},e.apply(this,arguments)};function o(l,u){if(!u)return"";var p="; "+l;return u===!0?p:p+"="+u}function r(l,u,p){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*f.expires),f.expires=d}return o("Expires",f.expires?f.expires.toUTCString():"")+o("Domain",f.domain)+o("Path",f.path)+o("Secure",f.secure)+o("SameSite",f.sameSite)}(p)}function i(l){for(var u={},p=l?l.split("; "):[],f=/(%[\dA-F]{2})+/gi,d=0;d<p.length;d++){var h=p[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(f,decodeURIComponent)]=m.replace(f,decodeURIComponent)}catch{}}return u}function a(){return i(document.cookie)}function c(l,u,p){document.cookie=r(l,u,e({path:"/"},p))}n.__esModule=!0,n.encode=r,n.parse=i,n.getAll=a,n.get=function(l){return a()[l]},n.set=c,n.remove=function(l,u){c(l,"",e(e({},u),{expires:-1}))}});qs(Yn),Yn.encode,Yn.parse,Yn.getAll;var Jb=Yn.get,qp=Yn.set,Jp=Yn.remove;const mo={get(t){const n=Jb(t);if(n!==void 0)return JSON.parse(n)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),qp(t,JSON.stringify(n),o)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Jp(t,e)}},Xb={get(t){return mo.get(t)||mo.get(`_legacy_${t}`)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),qp(`_legacy_${t}`,JSON.stringify(n),o),mo.save(t,n,e)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Jp(t,e),mo.remove(t,n),mo.remove(`_legacy_${t}`,n)}},Qb={get(t){if(typeof sessionStorage>"u")return;const n=sessionStorage.getItem(t);return n!=null?JSON.parse(n):void 0},save(t,n){sessionStorage.setItem(t,JSON.stringify(n))},remove(t){sessionStorage.removeItem(t)}};function ew(t,n,e){var o=n===void 0?null:n,r=function(l,u){var p=atob(l);if(u){for(var f=new Uint8Array(p.length),d=0,h=p.length;d<h;++d)f[d]=p.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return p}(t,e!==void 0&&e),i=r.indexOf(`
58
+ `,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}var Al,Pl,Tl,ya,tw=(Al="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Pl=null,Tl=!1,function(t){return ya=ya||ew(Al,Pl,Tl),new Worker(ya,t)});const ba={};class nw{constructor(n,e){this.cache=n,this.clientId=e,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(n){var e;const o=new Set(((e=await this.cache.get(this.manifestKey))===null||e===void 0?void 0:e.keys)||[]);o.add(n),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(n){const e=await this.cache.get(this.manifestKey);if(e){const o=new Set(e.keys);return o.delete(n),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(n){return`@@auth0spajs@@::${n}`}}const ow={memory:()=>new Kp().enclosedCache,localstorage:()=>new Gb},_l=t=>ow[t],Dl=t=>{const{openUrl:n,onRedirect:e}=t,o=Qt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:n===!1||n?n:e})},wa=new Bb;class rw{constructor(n){let e,o;if(this.userCache=new Kp().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await wa.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),n),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),n.authorizationParams)}),typeof window<"u"&&(()=>{if(!Zr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Zr().subtle===void 0)throw new Error(`
59
+ auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
60
+ `)})(),n.cache&&n.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),n.cache)o=n.cache;else{if(e=n.cacheLocation||"memory",!_l(e))throw new Error(`Invalid cache location "${e}"`);o=_l(e)()}this.httpTimeoutMs=n.httpTimeoutInSeconds?1e3*n.httpTimeoutInSeconds:1e4,this.cookieStorage=n.legacySameSiteCookie===!1?mo:Xb,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(a=>`auth0.${a}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=n.sessionCheckExpiryDays||1;const r=n.useCookiesForTransactions?this.cookieStorage:Qb;var i;this.scope=Br("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Zb(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Zp,this.cacheManager=new Yb(o,o.allKeys?void 0:new nw(o,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((a,c)=>a?a.startsWith("https://")?a:`https://${a}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&e==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new tw)}_url(n){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Yp)));return`${this.domainUrl}${n}&auth0Client=${e}`}_authorizeUrl(n){return this._url(`/authorize?${ls(n)}`)}async _verifyIdToken(n,e,o){const r=await this.nowProvider();return qb({iss:this.tokenIssuer,aud:this.options.clientId,id_token:n,nonce:e,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(n){n?this.cookieStorage.save(this.orgHintCookieName,n,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(n,e,o){const r=Nl(va()),i=Nl(va()),a=va(),c=(p=>{const f=new Uint8Array(p);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(f))))})(await(async p=>await Zr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(p)))(a)),l=((p,f,d,h,m,g,y,w)=>Object.assign(Object.assign(Object.assign({client_id:p.clientId},p.authorizationParams),d),{scope:Br(f,d.scope),response_type:"code",response_mode:w||"query",state:h,nonce:m,redirect_uri:y||p.authorizationParams.redirect_uri,code_challenge:g,code_challenge_method:"S256"}))(this.options,this.scope,n,r,i,c,n.redirect_uri||this.options.authorizationParams.redirect_uri||o,e==null?void 0:e.response_mode),u=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:r,url:u}}async loginWithPopup(n,e){var o;if(n=n||{},!(e=e||{}).popup&&(e.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(n.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=r.url;const i=await(c=>new Promise((l,u)=>{let p;const f=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(f),clearTimeout(d),window.removeEventListener("message",p,!1),u(new ec(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(f),u(new Qs(c.popup)),window.removeEventListener("message",p,!1)},1e3*(c.timeoutInSeconds||60));p=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(f),window.removeEventListener("message",p,!1),c.popup.close(),h.data.response.error)return u(Et.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",p)}))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new Et("state_mismatch","Invalid state");const a=((o=n.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.user}async getIdTokenClaims(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.claims}async loginWithRedirect(n={}){var e;const o=Dl(n),{openUrl:r,fragment:i,appState:a}=o,c=Qt(o,["openUrl","fragment","appState"]),l=((e=c.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:p}=u,f=Qt(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:a}),l&&{organization:l}));const d=i?`${p}#${i}`:p;r?await r(d):window.location.assign(d)}async handleRedirectCallback(n=window.location.href){const e=n.split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const{state:o,code:r,error:i,error_description:a}=(f=>{f.indexOf("#")>-1&&(f=f.substring(0,f.indexOf("#")));const d=new URLSearchParams(f);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(e.join("")),c=this.transactionManager.get();if(!c)throw new Et("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new Xs(i,a||i,o,c.appState);if(!c.code_verifier||c.state&&c.state!==o)throw new Et("state_mismatch","Invalid state");const l=c.organization,u=c.nonce,p=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:r},p?{redirect_uri:p}:{}),{nonceIn:u,organization:l}),{appState:c.appState}}async checkSession(n){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(n)}catch{}}async getTokenSilently(n={}){var e;const o=Object.assign(Object.assign({cacheMode:"on"},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Br(this.scope,(e=n.authorizationParams)===null||e===void 0?void 0:e.scope)})}),r=await((i,a)=>{let c=ba[a];return c||(c=i().finally(()=>{delete ba[a],c=null}),ba[a]=c),c})(()=>this._getTokenSilently(o),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return n.detailedResponse?r:r==null?void 0:r.access_token}async _getTokenSilently(n){const{cacheMode:e}=n,o=Qt(n,["cacheMode"]);if(e!=="off"){const r=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(r)return r}if(e!=="cache-only"){if(!await(async(r,i=3)=>{for(let a=0;a<i;a++)if(await r())return!0;return!1})(()=>wa.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new mr;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),e!=="off"){const u=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(u)return u}const r=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:i,access_token:a,oauthTokenScope:c,expires_in:l}=r;return Object.assign(Object.assign({id_token:i,access_token:a},c?{scope:c}:null),{expires_in:l})}finally{await wa.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(n={},e={}){var o;const r=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Br(this.scope,(o=n.authorizationParams)===null||o===void 0?void 0:o.scope)})});return e=Object.assign(Object.assign({},Hb),e),await this.loginWithPopup(r,e),(await this.cacheManager.get(new en({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(n){n.clientId!==null?n.clientId=n.clientId||this.options.clientId:delete n.clientId;const e=n.logoutParams||{},{federated:o}=e,r=Qt(e,["federated"]),i=o?"&federated":"";return this._url(`/v2/logout?${ls(Object.assign({clientId:n.clientId},r))}`)+i}async logout(n={}){const e=Dl(n),{openUrl:o}=e,r=Qt(e,["openUrl"]);n.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(n.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(r);o?await o(i):o!==!1&&window.location.assign(i)}async _getTokenFromIFrame(n){const e=Object.assign(Object.assign({},n.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!e.organization&&(e.organization=o);const{url:r,state:i,nonce:a,code_verifier:c,redirect_uri:l,scope:u,audience:p}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Et("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,g,y=60)=>new Promise((w,E)=>{const k=window.document.createElement("iframe");k.setAttribute("width","0"),k.setAttribute("height","0"),k.style.display="none";const C=()=>{window.document.body.contains(k)&&(window.document.body.removeChild(k),window.removeEventListener("message",j,!1))};let j;const S=setTimeout(()=>{E(new mr),C()},1e3*y);j=function(D){if(D.origin!=g||!D.data||D.data.type!=="authorization_response")return;const $=D.source;$&&$.close(),D.data.response.error?E(Et.fromPayload(D.data.response)):w(D.data.response),clearTimeout(S),window.removeEventListener("message",j,!1),setTimeout(C,2e3)},window.addEventListener("message",j,!1),window.document.body.appendChild(k),k.setAttribute("src",m)}))(r,this.domainUrl,f);if(i!==d.state)throw new Et("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},n.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:n.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:a,organization:e.organization});return Object.assign(Object.assign({},h),{scope:u,oauthTokenScope:h.scope,audience:p})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(n){const e=await this.cacheManager.get(new en({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw new zi(n.authorizationParams.audience||"default",n.authorizationParams.scope)}const o=n.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof n.timeoutInSeconds=="number"?1e3*n.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},n.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:o}),r&&{timeout:r}));return Object.assign(Object.assign({},i),{scope:n.authorizationParams.scope,oauthTokenScope:i.scope,audience:n.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw i}}async _saveEntryInCache(n){const{id_token:e,decodedToken:o}=n,r=Qt(n,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,n.id_token,n.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const n=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new en({clientId:this.options.clientId,audience:n,scope:this.scope})),o=this.userCache.get("@@user@@");return e&&e.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:n,audience:e,clientId:o}){const r=await this.cacheManager.get(new en({scope:n,audience:e,clientId:o}),60);if(r&&r.access_token){const{access_token:i,oauthTokenScope:a,expires_in:c}=r,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},a?{scope:a}:null),{expires_in:c})}}async _requestToken(n,e){const{nonceIn:o,organization:r}=e||{},i=await Vb(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},n),this.worker),a=await this._verifyIdToken(i.id_token,o,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:n.scope,audience:n.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}}var Xp={isAuthenticated:!1,isLoading:!0},un=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},iw=yt(yt({},Xp),{buildAuthorizeUrl:un,buildLogoutUrl:un,getAccessTokenSilently:un,getAccessTokenWithPopup:un,getIdTokenClaims:un,loginWithRedirect:un,loginWithPopup:un,logout:un,handleRedirectCallback:un}),Qp=v.createContext(iw),Ml=function(t){Rb(n,t);function n(e,o){var r=t.call(this,o||e)||this;return r.error=e,r.error_description=o,Object.setPrototypeOf(r,n.prototype),r}return n}(Error),aw=/[?&]code=[^&]+/,sw=/[?&]state=[^&]+/,cw=/[?&]error=[^&]+/,lw=function(t){return t===void 0&&(t=window.location.search),(aw.test(t)||cw.test(t))&&sw.test(t)},eh=function(t){return function(n){return n instanceof Error?n:n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?"error_description"in n&&typeof n.error_description=="string"?new Ml(n.error,n.error_description):new Ml(n.error):new Error(t)}},Ll=eh("Login failed"),xa=eh("Get access token failed"),th=function(t){var n;t!=null&&t.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=t.authorizationParams||{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((n=t==null?void 0:t.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},uw=function(t,n){switch(n.type){case"LOGIN_POPUP_STARTED":return yt(yt({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return yt(yt({},t),{isAuthenticated:!!n.user,user:n.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return t.user===n.user?t:yt(yt({},t),{isAuthenticated:!!n.user,user:n.user});case"LOGOUT":return yt(yt({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return yt(yt({},t),{isLoading:!1,error:n.error})}},dw=function(t){return th(t),yt(yt({},t),{auth0Client:{name:"auth0-react",version:"2.3.0"}})},fw=function(t){window.history.replaceState({},document.title,(t==null?void 0:t.returnTo)||window.location.pathname)},pw=function(t){var n=t.children,e=t.skipRedirectCallback,o=t.onRedirectCallback,r=o===void 0?fw:o,i=t.context,a=i===void 0?Qp:i,c=Fb(t,["children","skipRedirectCallback","onRedirectCallback","context"]),l=v.useState(function(){return new rw(dw(c))})[0],u=v.useReducer(uw,Xp),p=u[0],f=u[1],d=v.useRef(!1),h=v.useCallback(function(S){return f({type:"ERROR",error:S}),S},[]);v.useEffect(function(){d.current||(d.current=!0,function(){return uo(void 0,void 0,void 0,function(){var S,D,$;return fo(this,function(W){switch(W.label){case 0:return W.trys.push([0,7,,8]),S=void 0,lw()&&!e?[4,l.handleRedirectCallback()]:[3,3];case 1:return D=W.sent().appState,[4,l.getUser()];case 2:return S=W.sent(),r(D,S),[3,6];case 3:return[4,l.checkSession()];case 4:return W.sent(),[4,l.getUser()];case 5:S=W.sent(),W.label=6;case 6:return f({type:"INITIALISED",user:S}),[3,8];case 7:return $=W.sent(),h(Ll($)),[3,8];case 8:return[2]}})})}())},[l,r,e,h]);var m=v.useCallback(function(S){return th(S),l.loginWithRedirect(S)},[l]),g=v.useCallback(function(S,D){return uo(void 0,void 0,void 0,function(){var $,W;return fo(this,function(J){switch(J.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),J.label=1;case 1:return J.trys.push([1,3,,4]),[4,l.loginWithPopup(S,D)];case 2:return J.sent(),[3,4];case 3:return $=J.sent(),h(Ll($)),[2];case 4:return[4,l.getUser()];case 5:return W=J.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:W}),[2]}})})},[l]),y=v.useCallback(function(S){return S===void 0&&(S={}),uo(void 0,void 0,void 0,function(){return fo(this,function(D){switch(D.label){case 0:return[4,l.logout(S)];case 1:return D.sent(),(S.openUrl||S.openUrl===!1)&&f({type:"LOGOUT"}),[2]}})})},[l]),w=v.useCallback(function(S){return uo(void 0,void 0,void 0,function(){var D,$,W,J;return fo(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,3,5]),[4,l.getTokenSilently(S)];case 1:return D=B.sent(),[3,5];case 2:throw $=B.sent(),xa($);case 3:return W=f,J={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return W.apply(void 0,[(J.user=B.sent(),J)]),[7];case 5:return[2,D]}})})},[l]),E=v.useCallback(function(S,D){return uo(void 0,void 0,void 0,function(){var $,W,J,B;return fo(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(S,D)];case 1:return $=A.sent(),[3,5];case 2:throw W=A.sent(),xa(W);case 3:return J=f,B={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return J.apply(void 0,[(B.user=A.sent(),B)]),[7];case 5:return[2,$]}})})},[l]),k=v.useCallback(function(){return l.getIdTokenClaims()},[l]),C=v.useCallback(function(S){return uo(void 0,void 0,void 0,function(){var D,$,W;return fo(this,function(J){switch(J.label){case 0:return J.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(S)];case 1:return[2,J.sent()];case 2:throw D=J.sent(),xa(D);case 3:return $=f,W={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return $.apply(void 0,[(W.user=J.sent(),W)]),[7];case 5:return[2]}})})},[l]),j=v.useMemo(function(){return yt(yt({},p),{getAccessTokenSilently:w,getAccessTokenWithPopup:E,getIdTokenClaims:k,loginWithRedirect:m,loginWithPopup:g,logout:y,handleRedirectCallback:C})},[p,w,E,k,m,g,y,C]);return v.createElement(a.Provider,{value:j},n)},nh=function(t){return t===void 0&&(t=Qp),v.useContext(t)};const oh=({className:t,children:n,Logo:e})=>s.jsxs("div",{className:ot("info-page-container",t),children:[s.jsx(e,{className:"info-page-logo"}),s.jsx("div",{className:"info-page-wrapper",children:n})]}),hw={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},mw={loginPageLogo:hw},gw="200px",Cr=({logoSrc:t=mw.loginPageLogo.value,width:n=gw,className:e="logo"})=>s.jsx("img",{width:n,src:t,className:e,alt:"Login logo"}),rh=()=>s.jsx("span",{className:"spinner"});const Dn=({Logo:t=Cr,text:n="Loading..."})=>s.jsx("div",{className:"system-loader-background",children:s.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[s.jsx(t,{}),s.jsx("h1",{className:"system-loader-text io-title",children:n}),s.jsx(rh,{})]})});const ih=({children:t,description:n,heading:e,Image:o,title:r,className:i})=>s.jsxs("div",{className:ot("info-card",i),children:[r&&s.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&s.jsx("div",{className:"info-card-image",children:s.jsx(o,{})}),e&&s.jsx("h3",{className:"info-card-heading io-title",children:e}),s.jsx("p",{className:"info-card-description io-text-default-lh16",children:n}),t]}),vw=({activeStepName:t,showWarnIcon:n,stepsStatuses:e})=>s.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Yr.map(({name:o,label:r},i)=>{const a=o===t,c=e[o].state,l=n&&a?s.jsx(Xe,{variant:"exclamation-mark",size:"12"}):s.jsxs("span",{children:[i+1,"."]});return s.jsx("li",{className:ot(a&&"active"),children:s.jsxs("div",{className:"setup-flow-list-item",children:[s.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[c==="prompt"&&l,c==="granted"&&s.jsx(Xe,{variant:"check-solid",size:"12"}),c==="denied"&&s.jsx(Xe,{variant:"close",size:"12"})]}),r]})},o)})}),yw=({edgeNotificationsPermissionTimeout:t,isNotificationsPermissionPromptOpen:n})=>{const{name:e}=Ty(),[o,r]=v.useState(!1);return v.useEffect(()=>{if(!n||e!=="Edge")return;const i=setTimeout(()=>r(!0),t);return()=>clearTimeout(i)},[e,t,n]),v.useEffect(()=>{n&&!o||r(!1)},[n,o,r]),{hasEdgeNotificationsPermissionError:o}},bw=(t,n)=>{const{type:e,payload:o}=n;switch(e){case"completed":return{...t,[o.stepName]:{...t[o.stepName],isCompleted:!0}};case"skipped":return{...t,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...t,[o.stepName]:{isCompleted:o.stepName===et.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+e)}},ww=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:On.WINDOW_MANAGEMENT});o==="prompt"&&n()}).finally(e)},xw=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:On.NOTIFICATIONS});o==="prompt"&&n()}).finally(e)},Cw=t=>{const{handleDeferredStep:n,handleOperationComplete:e,dispatchAction:o}=t,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),c=window.open(r,void 0,i);a==null||a.close(),c==null||c.close();const l=!(a&&c);l&&n(),o({type:"stateUpdated",payload:{stepName:et.POPUPS,state:l?"denied":"granted"}}),e()},kw=t=>{const{dispatchAction:n}=t;n({type:"completed",payload:{stepName:et.PWA_INSTALL}})},Ew={[et.WINDOW_MANAGEMENT]:ww,[et.NOTIFICATIONS]:xw,[et.POPUPS]:Cw,[et.PWA_INSTALL]:kw},Sw=({settings:t})=>{const{permission:n}=_n(),[e,o]=rn("localStorage",wr,xr),[r,i]=v.useReducer(bw,Mb),[a,c]=v.useState(!1),[l,u]=v.useState(!1),p=Yr.find(y=>!r[y.name].isCompleted);if(!p)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=p.name,d=Yr[Yr.length-1].name,{hasEdgeNotificationsPermissionError:h}=yw({edgeNotificationsPermissionTimeout:t.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:l&&f===On.NOTIFICATIONS}),m=()=>{c(!1),u(!0),Ew[f]({handleDeferredStep:()=>c(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),f===d&&o({isCompleted:!0})},g=()=>{c(!1),i({type:"skipped",payload:{stepName:f}})};return v.useEffect(()=>{h&&(u(!1),c(!0))},[h]),v.useEffect(()=>{var y,w;c(!1),i({type:"stateUpdated",payload:{stepName:et.WINDOW_MANAGEMENT,state:Hi?(y=n.statuses[et.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:et.NOTIFICATIONS,state:(w=n.statuses[et.NOTIFICATIONS])==null?void 0:w.state}})},[n.statuses]),s.jsxs(ih,{description:p.description,heading:p.heading,Image:p.Image,title:"Platform Setup",children:[s.jsx(vw,{activeStepName:f,showWarnIcon:a&&f!==et.POPUPS,stepsStatuses:r}),s.jsx("p",{className:"io-text-default-lh16",children:a?p.instructions.additional:p.instructions.initial}),s.jsxs(Re,{children:[s.jsx(ui,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:l,onClick:m,children:p.actionBtnText}),f!==d&&f!==et.WINDOW_MANAGEMENT&&s.jsx(ui,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:l,onClick:g,children:"Skip"})]}),l&&s.jsx(rh,{})]})};const nc=({components:{Logo:t=Cr,Loader:n=Dn}={},settings:e={}})=>{const{permission:o}=_n();return o.isLoading?s.jsx(n,{text:"Checking browser permissions..."}):s.jsx(oh,{Logo:t,children:s.jsx(Sw,{settings:{...Ab,...e}})})};const oc=({errorMessage:t})=>{const n="https://support.interop.io",e=s.jsxs(s.Fragment,{children:["It seems that the following error prevents io.Connect Browser",s.jsx("br",{}),"from operating properly:",s.jsxs("span",{className:"browser-start-failed-error",children:["“",t,"”"]}),s.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),s.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return s.jsx(oh,{Logo:Cr,children:s.jsx(ih,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:e,Image:Ib,children:s.jsx(ui,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},ah=()=>s.jsxs(s.Fragment,{children:[s.jsx(nn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),s.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",s.jsx("br",{}),"digital transformation."]})]}),sh=({Logo:t,children:n,className:e})=>s.jsx("div",{className:"login-page-background",children:s.jsxs("div",{className:ot(e,"login-form-container flex flex-column ai-center"),children:[s.jsx(t,{}),n]})}),jw=({onLogin:t,isLoading:n,validationError:e,components:{Logo:o=Cr,Heading:r=ah,Loader:i=Dn}={}})=>n?s.jsx(i,{text:"Verifying credentials..."}):s.jsxs(sh,{Logo:o,children:[s.jsx(r,{}),s.jsx(Ge,{className:"auth0-login-btn",onClick:t,size:"large",variant:"primary",children:"Log In"}),e&&s.jsx(yh,{variant:"critical",text:e.message})]}),Rl=(t,n)=>{const e=n.value,o=e.trim().length>3;return{value:e,isValid:o}},Ow=({onLogin:t,setIsLoading:n,loginError:e,setLoginError:o,userInputName:r="email"})=>{const[i,a]=v.useReducer(Rl,{value:"",isValid:!1}),[c,l]=v.useReducer(Rl,{value:"",isValid:!1}),[u,p]=v.useState(!1),[f,d]=v.useState(!1),{isValid:h}=i,{isValid:m}=c,g=h&&m,y=j=>a({value:j.target.value}),w=j=>l({value:j.target.value}),E=()=>{h||p(!0)},k=()=>{m||d(!0)},C=async j=>{if(j.preventDefault(),!!g){n(!0);try{await t(i.value,c.value)}catch(S){o(S)}n(!1)}};return s.jsxs("form",{className:"simple-login-form",onSubmit:C,children:[s.jsx(Qn,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:E,onFocus:()=>p(!1)}),s.jsx(Qn,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:c.value,onChange:w,onBlur:k,onFocus:()=>d(!1)}),s.jsx(Ge,{type:"submit",size:"large",variant:"primary",children:"Log In"}),e&&s.jsxs("div",{className:"login-error-feedback",children:[s.jsx(Xe,{className:"error-icon",variant:"close",size:"12"}),e.message]})]})};const Nw=({onLogin:t,userInputName:n,components:{Logo:e=Cr,Heading:o=ah,Loader:r=Dn}={}})=>{const[i,a]=v.useState(!1),[c,l]=v.useState(null);return i?s.jsx(r,{text:"Verifying credentials..."}):s.jsxs(sh,{Logo:e,children:[s.jsx(o,{}),s.jsx(Ow,{onLogin:t,setIsLoading:a,loginError:c,setLoginError:l,userInputName:n})]})};function Iw(t,n){const[e,o]=v.useState(!0),r=v.useContext(_e.IOConnectContext);return v.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(t)}catch(l){console.warn(l);return}const c=a.getAllGroups().find(l=>l.id===n);c&&(i=await c.onLockConfigurationChanged(({showAddWindowButton:l})=>{l!==void 0&&o(l)}),o(!!c.showAddWindowButton))})(),()=>i==null?void 0:i()},[t,n,r.workspaces]),e}const Aw=({groupId:t,workspaceId:n})=>{const e=Iw(n,t),o=v.useCallback(r=>{Co.showAddApplicationPopup({bounds:r,groupId:t,workspaceId:n})},[t,n]);return e&&s.jsx(Co.AddWindowButton,{title:"Add App",visible:e,showPopup:o})},Pw=t=>s.jsx(Co.GroupHeaderButtons,{...t,addWindow:{visible:!1,showPopup:t.addWindow.showPopup}}),Tw=()=>null;const ch=({className:t,components:n,onClose:e,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=xf;return s.jsx(r,{children:s.jsx(i,{children:s.jsx(a,{className:t,components:n,onClose:e,title:o})})})};const lh=P0.Panel;const uh=({className:t,components:n,onClose:e,title:o})=>{const r=v.useContext(_e.IOConnectContext),{onLogout:i}=$p(),[a,c]=rn("sessionStorage",gp,vp),{login:{setIsLoggingOut:l}}=_n(),u=v.useCallback(async()=>{var p;if("modals"in r&&r.modals){const f="log-out",{isEnterPressed:d,responseButtonClicked:h}=await r.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:f,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(d||(h==null?void 0:h.id)===f))return}Un.flushSync(()=>l(!0));try{i==null||i()}catch(f){console.error(f)}c(null),await((p=r.webPlatform)==null?void 0:p.system.shutdown()),window.location.reload()},[r,i]);return s.jsx(A0.Panel,{className:t,components:n,onClose:e,onLogout:u,title:o})},_w=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:t=>t(lh)},{name:"notificationSettingsPanel",displayName:"Notification Settings",icon:"bell",onClick:t=>t(ch),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:t=>t(uh)}],Dw=t=>({onClose:n})=>s.jsx(t,{className:"system-menu-panel",onClose:n});const dh=({actions:t,panelWrapperClassName:n})=>{const[e,o]=v.useState(),r=v.useRef(null),i=Us(),a=v.useCallback(()=>o(void 0),[]),c=!!e;v.useEffect(()=>{!c||i!=="Escape"||a()},[c,i]);const l=v.useCallback((u,p)=>{const f=t.find(({name:h})=>h===p.name);if(!f){console.error(`Action named ${p.name} is not part of the provided list of actions: ${JSON.stringify(t)}!`);return}const d=h=>{const m=Dw(h);o(()=>m)};f.onClick(d)},[t]);return Ws({eventType:"mouseup",handler:a,ref:r,skip:!c}),zs({handler:a,skip:!c}),s.jsxs(s.Fragment,{children:[s.jsx(Ys,{buttonSize:"32",iconSize:"16",actions:t,onActionItemClick:l,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8]}),s.jsx(Vp,{className:ot("system-menu-panel-wrapper",n),isOpen:c,onClose:a,Panel:e,position:"right",ref:r})]})},Mw=()=>{const{showNotificationBadge:t}=_y(),n=Sp(),o=v.useMemo(()=>n.filter(({state:r})=>r==="Active"||r==="Stale"),[n]).length;return o>0&&t?s.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const fh=t=>{const{className:n,active:e,...o}=t;return s.jsxs("div",{className:ot(n,"notifications-icon"),...o,children:[s.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),s.jsx(Mw,{})]})},ph=({className:t,components:n,onClose:e,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:c}=xf;return s.jsx(i,{children:s.jsx(a,{children:s.jsx(c,{className:t,components:n,onClose:e,settings:o,title:r})})})},Lw=()=>{const t=Sp(),n=v.useContext(_e.IOConnectContext),e=v.useCallback(async()=>{await Promise.all(t.map(({id:o})=>n.notifications.setState(o,"Seen")))},[t]);return s.jsxs("li",{className:"default-header-system-menu",children:[s.jsx(Ks,{Button:fh,Panel:ph,onClose:e,position:"right"}),s.jsx(dh,{actions:_w})]})};const Rw=()=>s.jsx(Lw,{}),rc=({onLogout:t,workspaces:n,launchpad:e,Loader:o=Dn,isBeforeunloadDialogEnabled:r})=>{var g,y,w,E;const{LogoComponent:i,SystemButtonsComponent:a}=((g=n==null?void 0:n.components)==null?void 0:g.header)??{},{setPlatformWindow:c}=$s(),{isInitialSetupCompleted:l}=Qu(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,p=i??(u?Gp:Tw),f=a??(u?Rw:void 0),d=Iy(),{login:{isLoggingOut:h}}=_n();Y1(r===!1||h),v.useEffect(()=>{u&&c({name:window.name})},[u,c]);const m=v.useMemo(()=>({onLogout:t,launchpadSettings:e==null?void 0:e.settings,launchpadComponents:e==null?void 0:e.components}),[t,e==null?void 0:e.settings,e==null?void 0:e.components]);return s.jsxs(Wp.Provider,{value:m,children:[(!d||!l)&&s.jsx(o,{text:"Loading io.Connect Home..."}),s.jsx(Co,{components:{...n==null?void 0:n.components,header:{...(w=n==null?void 0:n.components)==null?void 0:w.header,LogoComponent:p,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:Aw,ButtonsComponent:Pw,...(E=n==null?void 0:n.components)==null?void 0:E.groupHeader}}})]})},Fw=Qe({id:_t,username:De(_t),email:De(_t),firstName:De(_t),lastName:De(_t),token:De(_t),password:De(_t)}),Bw=({config:t})=>{var w,E,k,C;const{setupFlow:n,login:e,workspaces:o,launchpad:r,getIOConnectConfig:i}=t,[a,c]=rn("localStorage",ay,Fw),[l]=rn("localStorage",wr,xr),[u,p]=v.useState(null),{login:{isLoggingOut:f}}=_n(),d=Hs(),h=((w=t.components)==null?void 0:w.SystemLoader)??Dn,m=((E=t.components)==null?void 0:E.IOInitErrorScreen)??oc,g=v.useCallback(async(j,S)=>{const D=await e.onLogin(j,S);c(D)},[e,c]),y=v.useCallback(()=>{var j;(j=e.onLogout)==null||j.call(e),c(null)},[e.onLogout,c]);return f?s.jsx(h,{text:"Logging out..."}):a?!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!d?s.jsx(nc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(_e.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:p,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Oi,{launchpadMode:(k=r==null?void 0:r.settings)==null?void 0:k.mode,children:s.jsx(rc,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(C=t.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:h})})}):s.jsx(Nw,{onLogin:g,userInputName:e.userInputName,components:{...e.components,Loader:h}})},Hw=Qe({message:_t}),zw=t=>{const n=nh(),[e,o]=v.useState(void 0),[r,i]=rn("sessionStorage",iy,Hw),a=v.useMemo(()=>n.user?(t==null?void 0:t(n.user))??{ok:!0}:null,[n.user,t]),c=(a==null?void 0:a.ok)===!1,l=n.isLoading||n.isAuthenticated&&!e,u=c||l,p=v.useMemo(()=>{var f;return a!=null&&a.ok&&((f=n.user)!=null&&f.email)&&e?{username:n.user.name,id:n.user.email,token:e}:null},[n.user,e,a==null?void 0:a.ok]);return v.useEffect(()=>{n.isAuthenticated&&n.getAccessTokenSilently().then(o).catch(console.warn)},[n]),v.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),n.logout()}},[n,i,a]),{isLoading:u,validationError:r,user:p}},us={POPUP:"popup",REDIRECT:"redirect"},Ww=({config:t})=>{var k,C,j,S;const n=nh(),{setupFlow:e,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=t,{isLoading:c,validationError:l,user:u}=zw(o.validateUser),f=(o.loginType??us.REDIRECT)===us.REDIRECT?n.loginWithRedirect:n.loginWithPopup,[d]=rn("localStorage",wr,xr),[h,m]=v.useState(null),{login:{isLoggingOut:g}}=_n(),y=Hs(),w=((k=t.components)==null?void 0:k.SystemLoader)??Dn,E=((C=t.components)==null?void 0:C.IOInitErrorScreen)??oc;return g?s.jsx(w,{text:"Logging out..."}):u?!(d!=null&&d.isCompleted)&&(e==null?void 0:e.enabled)!==!1&&!y?s.jsx(nc,{settings:e==null?void 0:e.settings,components:{...e==null?void 0:e.components,Loader:w}}):h&&!h.message.includes("has already been started")?s.jsx(E,{errorMessage:h.message}):s.jsx(_e.IOConnectProvider,{settings:a({type:"auth0",user:{...n.user,id:u.id,token:u.token}}),onInitError:m,fallback:s.jsx(w,{text:"Initializing the platform..."}),children:s.jsx(Oi,{launchpadMode:(j=r==null?void 0:r.settings)==null?void 0:j.mode,children:s.jsx(rc,{workspaces:i,launchpad:r,onLogout:n.logout,isBeforeunloadDialogEnabled:(S=t.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:w})})}):s.jsx(jw,{onLogin:f,isLoading:c,validationError:l,components:{...o.components,Loader:w}})},Fl=({config:t})=>{var g,y,w,E;const{setupFlow:n,launchpad:e,workspaces:o,getIOConnectConfig:r}=t,{onLogout:i,user:a}=t.login??{},{isPlatformWindow:c}=$s(),[l]=rn("localStorage",wr,xr),[u,p]=v.useState(null),{login:{isLoggingOut:f}}=_n(),d=Hs(),h=((g=t.components)==null?void 0:g.SystemLoader)??Dn,m=((y=t.components)==null?void 0:y.IOInitErrorScreen)??oc;return f?s.jsx(h,{text:"Logging out..."}):!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&c&&!d?s.jsx(nc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(_e.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:p,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Oi,{launchpadMode:(w=e==null?void 0:e.settings)==null?void 0:w.mode,children:s.jsx(rc,{workspaces:o,launchpad:e,onLogout:i,isBeforeunloadDialogEnabled:(E=t.settings)==null?void 0:E.isBeforeunloadDialogEnabled,Loader:h})})})},hh=Qe({Logo:De(jt().andThen(t=>Wt(t,"Logo"))),Heading:De(jt().andThen(t=>Wt(t,"Heading")))}),$w=pr(...Object.values(us).map(t=>An(t))),Uw=Qe({type:An("auth0"),validateUser:De(jt().andThen(t=>Wt(t,"validateUser"))),loginType:De($w),providerOptions:jt(),components:De(hh)}),Vw=Qe({type:An("simple"),onLogin:jt().andThen(t=>Wt(t,"onLogin")),onLogout:De(jt().andThen(t=>Wt(t,"onLogout"))),userInputName:De(_t),components:De(hh)}),Gw=Qe({id:_t,username:_t}),Yw=Qe({type:An("custom"),onLogout:jt().andThen(t=>Wt(t,"onLogout")),user:Gw}),Zw=pr(Uw,Vw,Yw),Kw=Qe({edgeNotificationsPermissionTimeout:De(by)}),qw=Qe({Logo:De(jt().andThen(t=>Wt(t,"Logo")))}),Jw=Qe({enabled:De(Ao()),components:De(qw),settings:De(Kw)}),Xw=Qe({components:De(jt())}),Qw=Qe({BeforeSearch:pr(An(null),De(jt().andThen(t=>Wt(t,"BeforeSearch")))),AfterSearch:pr(An(null),De(jt().andThen(t=>Wt(t,"AfterSearch"))))}),e2=Qe({Component:jt().andThen(t=>Wt(t,"Component")),placementId:_t}),t2=Qe({header:De(Qw),sections:De(vy(e2))}),n2=Qe({showHeader:De(Ao()),showSearch:De(Ao())}),o2=Qe({header:De(n2),mode:De(pr(An("pinned"),An("default")))}),r2=Qe({components:De(t2),settings:De(o2)}),i2=Qe({SystemLoader:De(jt().andThen(t=>Wt(t,"SystemLoader"))),IOInitErrorScreen:De(jt().andThen(t=>Wt(t,"IOInitErrorScreen")))}),a2=Qe({isBeforeunloadDialogEnabled:De(Ao())}),s2=Qe({getIOConnectConfig:jt().andThen(t=>Wt(t,"getIOConnectConfig")),login:De(Zw),setupFlow:De(Jw),workspaces:De(Xw),launchpad:De(r2),components:De(i2),settings:De(a2)}),c2=({config:t})=>{var i;const n=v.useMemo(()=>s2.runWithException(t),[t]),e=n.login,{isPlatformWindow:o}=$s();if(!e||!o){const{login:a,...c}=n;return s.jsx(Fl,{config:c})}if(e.type==="custom")return s.jsx(Fl,{config:n});if(e.type==="simple")return s.jsx(Bw,{config:n});const{providerOptions:r}=e;return s.jsx(pw,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:s.jsx(Ww,{config:n})})};const l2=({config:t})=>s.jsx(Eb,{children:s.jsx(c2,{config:t})});exports.ApplicationsSection=Tp;exports.FavoritesSection=_p;exports.IOConnectHome=l2;exports.Launchpad=zp;exports.LaunchpadAccess=Gp;exports.LaunchpadButton=Dp;exports.LaunchpadPinButton=Lp;exports.NotificationSettingsPanel=ch;exports.NotificationsIcon=fh;exports.NotificationsPanel=ph;exports.PanelWithToggleButton=Ks;exports.PlatformPrefsProvider=Oi;exports.PreferencesPanel=lh;exports.ProfilePanel=uh;exports.Section=Bi;exports.SystemLoader=Dn;exports.SystemMenu=dh;exports.WorkspacesSection=Bp;exports.useFavorites=Li;exports.usePlatformPref=Ht;exports.usePlatformPrefs=Qu;
61
+ //# sourceMappingURL=index.js.map