@next-bricks/ai-portal 0.70.1 → 0.70.3

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 (271) hide show
  1. package/dist/bricks.json +45 -45
  2. package/dist/chunks/1097.05983e91.js +3 -0
  3. package/dist/chunks/{1097.9e80dcca.js.LICENSE.txt → 1097.05983e91.js.LICENSE.txt} +2 -0
  4. package/dist/chunks/1097.05983e91.js.map +1 -0
  5. package/dist/chunks/{1889.b7766f77.js → 1889.803775eb.js} +2 -2
  6. package/dist/chunks/{1889.b7766f77.js.map → 1889.803775eb.js.map} +1 -1
  7. package/dist/chunks/3171.9d323cbe.js +2 -0
  8. package/dist/chunks/3171.9d323cbe.js.map +1 -0
  9. package/dist/chunks/{3186.f231329a.js → 3186.ca53075a.js} +2 -2
  10. package/dist/chunks/{3186.f231329a.js.map → 3186.ca53075a.js.map} +1 -1
  11. package/dist/chunks/3840.6080d56e.js +3 -0
  12. package/dist/chunks/3840.6080d56e.js.map +1 -0
  13. package/dist/chunks/{4864.bee3bb30.js → 4864.beefe6d5.js} +2 -2
  14. package/dist/chunks/{4864.bee3bb30.js.map → 4864.beefe6d5.js.map} +1 -1
  15. package/dist/chunks/5399.ef4bb3aa.js +2 -0
  16. package/dist/chunks/5399.ef4bb3aa.js.map +1 -0
  17. package/dist/chunks/551.ae5171a6.js +3 -0
  18. package/dist/chunks/551.ae5171a6.js.map +1 -0
  19. package/dist/chunks/5552.53024929.js +2 -0
  20. package/dist/chunks/5552.53024929.js.map +1 -0
  21. package/dist/chunks/6277.c8a6013f.js +2 -0
  22. package/dist/chunks/6277.c8a6013f.js.map +1 -0
  23. package/dist/chunks/6376.c35ff317.js +2 -0
  24. package/dist/chunks/6376.c35ff317.js.map +1 -0
  25. package/dist/chunks/7669.6f177bf2.js +3 -0
  26. package/dist/chunks/7669.6f177bf2.js.map +1 -0
  27. package/dist/chunks/794.214aa08f.js +3 -0
  28. package/dist/chunks/794.214aa08f.js.map +1 -0
  29. package/dist/chunks/948.c96c7036.js +3 -0
  30. package/dist/chunks/948.c96c7036.js.map +1 -0
  31. package/dist/chunks/action-buttons.68666920.js.map +1 -1
  32. package/dist/chunks/activity-timeline.96e7aaea.js.map +1 -1
  33. package/dist/chunks/ai-agents.cffd08a0.js.map +1 -1
  34. package/dist/chunks/ai-employees.267c3626.js.map +1 -1
  35. package/dist/chunks/blank-state.648eea95.js.map +1 -1
  36. package/dist/chunks/chat-box.060b8727.js +3 -0
  37. package/dist/chunks/chat-box.060b8727.js.map +1 -0
  38. package/dist/chunks/chat-input.e913e9ed.js +3 -0
  39. package/dist/chunks/chat-input.e913e9ed.js.map +1 -0
  40. package/dist/chunks/chat-panel-welcome.2f7c6c8b.js.map +1 -1
  41. package/dist/chunks/{chat-panel.3160f2e8.js → chat-panel.63207d2f.js} +2 -2
  42. package/dist/chunks/chat-panel.63207d2f.js.map +1 -0
  43. package/dist/chunks/chat-stream.393c8241.js.map +1 -1
  44. package/dist/chunks/cruise-canvas.bfae3138.js.map +1 -1
  45. package/dist/chunks/dropdown-select.336442ba.js.map +1 -1
  46. package/dist/chunks/elevo-card.49b42ed0.js.map +1 -1
  47. package/dist/chunks/elevo-logo.25e3b889.js.map +1 -1
  48. package/dist/chunks/elevo-sidebar.dfaaf9d1.js +3 -0
  49. package/dist/chunks/elevo-sidebar.dfaaf9d1.js.map +1 -0
  50. package/dist/chunks/flow-tabs.ee1290c2.js.map +1 -1
  51. package/dist/chunks/goal-card-list.74ab5767.js.map +1 -1
  52. package/dist/chunks/home-container.f1829834.js.map +1 -1
  53. package/dist/chunks/icon-button.545ffb24.js.map +1 -1
  54. package/dist/chunks/main.5e1b11a5.js +2 -0
  55. package/dist/chunks/main.5e1b11a5.js.map +1 -0
  56. package/dist/chunks/mcp-tools.f132c502.js.map +1 -1
  57. package/dist/chunks/notice-dropdown.63cb2415.js.map +1 -1
  58. package/dist/chunks/page-container.2185f2e0.js.map +1 -1
  59. package/dist/chunks/preview-container.a0ca6e2f.js.map +1 -1
  60. package/dist/chunks/project-knowledges.51731410.js.map +1 -1
  61. package/dist/chunks/running-flow.37a428cf.js.map +1 -1
  62. package/dist/chunks/show-case.44e995fc.js.map +1 -1
  63. package/dist/chunks/show-cases.c3921ea0.js.map +1 -1
  64. package/dist/chunks/space-chat-guide.b9f77cb5.js +3 -0
  65. package/dist/chunks/space-chat-guide.b9f77cb5.js.map +1 -0
  66. package/dist/chunks/space-logo.994f7a25.js.map +1 -1
  67. package/dist/chunks/space-workbench.9d48eec0.js +2 -0
  68. package/dist/chunks/space-workbench.9d48eec0.js.map +1 -0
  69. package/dist/chunks/stage-flow.9b6fad93.js.map +1 -1
  70. package/dist/chunks/stat-with-mini-chart.1509cf8c.js.map +1 -1
  71. package/dist/chunks/sticky-container.d3f7054e.js.map +1 -1
  72. package/dist/chunks/tab-list.ee97567f.js.map +1 -1
  73. package/dist/examples.json +56 -44
  74. package/dist/index.34851313.js +2 -0
  75. package/dist/index.34851313.js.map +1 -0
  76. package/dist/manifest.json +624 -343
  77. package/dist/types.json +1309 -1309
  78. package/dist-types/action-buttons/i18n.d.ts +1 -1
  79. package/dist-types/action-buttons/index.d.ts +10 -1
  80. package/dist-types/activity-timeline/i18n.d.ts +1 -1
  81. package/dist-types/activity-timeline/index.d.ts +10 -1
  82. package/dist-types/ai-agents/i18n.d.ts +1 -1
  83. package/dist-types/ai-agents/index.d.ts +10 -1
  84. package/dist-types/ai-employees/i18n.d.ts +1 -1
  85. package/dist-types/ai-employees/index.d.ts +16 -1
  86. package/dist-types/blank-state/index.d.ts +10 -1
  87. package/dist-types/chat-box/i18n.d.ts +1 -1
  88. package/dist-types/chat-input/i18n.d.ts +1 -1
  89. package/dist-types/chat-input/index.d.ts +37 -1
  90. package/dist-types/chat-panel/ChatPanelContent.d.ts +2 -2
  91. package/dist-types/chat-panel/index.d.ts +48 -6
  92. package/dist-types/chat-stream/Aside/FlowApp/i18n.d.ts +1 -1
  93. package/dist-types/chat-stream/i18n.d.ts +1 -1
  94. package/dist-types/chat-stream/index.d.ts +62 -1
  95. package/dist-types/cruise-canvas/NodeReplay/i18n.d.ts +1 -1
  96. package/dist-types/cruise-canvas/ToolCallDetail/i18n.d.ts +1 -1
  97. package/dist-types/cruise-canvas/i18n.d.ts +1 -1
  98. package/dist-types/cruise-canvas/index.d.ts +71 -1
  99. package/dist-types/dropdown-select/i18n.d.ts +1 -1
  100. package/dist-types/dropdown-select/index.d.ts +3 -1
  101. package/dist-types/elevo-card/index.d.ts +5 -1
  102. package/dist-types/elevo-logo/index.d.ts +3 -1
  103. package/dist-types/elevo-sidebar/i18n.d.ts +1 -1
  104. package/dist-types/elevo-sidebar/index.d.ts +19 -2
  105. package/dist-types/flow-tabs/index.d.ts +5 -1
  106. package/dist-types/gantt-chart/i18n.d.ts +1 -1
  107. package/dist-types/gantt-chart/index.d.ts +3 -1
  108. package/dist-types/goal-card-list/i18n.d.ts +1 -1
  109. package/dist-types/goal-card-list/index.d.ts +8 -1
  110. package/dist-types/home-container/index.d.ts +4 -1
  111. package/dist-types/icon-button/index.d.ts +4 -1
  112. package/dist-types/mcp-tools/i18n.d.ts +1 -1
  113. package/dist-types/mcp-tools/index.d.ts +3 -1
  114. package/dist-types/notice-dropdown/i18n.d.ts +1 -1
  115. package/dist-types/notice-list/i18n.d.ts +1 -1
  116. package/dist-types/page-container/index.d.ts +7 -0
  117. package/dist-types/preview-container/i18n.d.ts +1 -1
  118. package/dist-types/preview-container/index.d.ts +4 -0
  119. package/dist-types/project-conversations/i18n.d.ts +1 -1
  120. package/dist-types/project-knowledges/i18n.d.ts +1 -1
  121. package/dist-types/project-knowledges/index.d.ts +5 -0
  122. package/dist-types/running-flow/index.d.ts +3 -0
  123. package/dist-types/shared/ActivityPlan/i18n.d.ts +1 -1
  124. package/dist-types/shared/AskUser/i18n.d.ts +1 -1
  125. package/dist-types/shared/ChatBox/i18n.d.ts +1 -1
  126. package/dist-types/shared/CreatedView/i18n.d.ts +1 -1
  127. package/dist-types/shared/FilePreview/i18n.d.ts +1 -1
  128. package/dist-types/shared/FileUpload/i18n.d.ts +1 -1
  129. package/dist-types/shared/NodeFeedback/i18n.d.ts +1 -1
  130. package/dist-types/show-case/i18n.d.ts +1 -1
  131. package/dist-types/show-case/index.d.ts +5 -0
  132. package/dist-types/show-cases/i18n.d.ts +1 -1
  133. package/dist-types/show-cases/index.d.ts +4 -0
  134. package/dist-types/space-workbench/chat-panel-welcome/i18n.d.ts +1 -1
  135. package/dist-types/space-workbench/chat-panel-welcome/index.d.ts +3 -0
  136. package/dist-types/space-workbench/i18n.d.ts +1 -1
  137. package/dist-types/space-workbench/index.d.ts +7 -0
  138. package/dist-types/space-workbench/space-chat-guide/i18n.d.ts +1 -1
  139. package/dist-types/space-workbench/space-chat-guide/index.d.ts +3 -0
  140. package/dist-types/space-workbench/space-logo/index.d.ts +1 -0
  141. package/dist-types/stage-flow/i18n.d.ts +1 -1
  142. package/dist-types/stage-flow/index.d.ts +21 -0
  143. package/dist-types/stat-with-mini-chart/index.d.ts +10 -0
  144. package/dist-types/sticky-container/index.d.ts +3 -0
  145. package/dist-types/tab-list/index.d.ts +4 -0
  146. package/docs/action-buttons.md +59 -10
  147. package/docs/action-buttons.react.md +80 -0
  148. package/docs/activity-timeline.md +51 -7
  149. package/docs/activity-timeline.react.md +109 -0
  150. package/docs/ai-agents.md +62 -2
  151. package/docs/ai-agents.react.md +73 -0
  152. package/docs/ai-employees.md +76 -2
  153. package/docs/ai-employees.react.md +106 -0
  154. package/docs/blank-state.md +62 -2
  155. package/docs/blank-state.react.md +77 -0
  156. package/docs/chat-box.md +134 -52
  157. package/docs/chat-box.react.md +142 -0
  158. package/docs/chat-input.md +117 -1
  159. package/docs/chat-input.react.md +117 -0
  160. package/docs/chat-panel-welcome.md +39 -0
  161. package/docs/chat-panel-welcome.react.md +41 -0
  162. package/docs/chat-panel.md +86 -3
  163. package/docs/chat-panel.react.md +109 -0
  164. package/docs/chat-stream.md +149 -2
  165. package/docs/chat-stream.react.md +155 -0
  166. package/docs/cruise-canvas.md +159 -0
  167. package/docs/cruise-canvas.react.md +159 -0
  168. package/docs/dropdown-select.md +37 -8
  169. package/docs/dropdown-select.react.md +144 -0
  170. package/docs/elevo-card.md +75 -1
  171. package/docs/elevo-card.react.md +104 -0
  172. package/docs/elevo-logo.md +13 -1
  173. package/docs/elevo-logo.react.md +27 -0
  174. package/docs/elevo-sidebar.md +150 -1
  175. package/docs/elevo-sidebar.react.md +149 -0
  176. package/docs/flow-tabs.md +97 -2
  177. package/docs/flow-tabs.react.md +102 -0
  178. package/docs/gantt-chart.md +101 -0
  179. package/docs/gantt-chart.react.md +125 -0
  180. package/docs/goal-card-list.md +149 -13
  181. package/docs/goal-card-list.react.md +185 -0
  182. package/docs/home-container.md +48 -2
  183. package/docs/home-container.react.md +51 -0
  184. package/docs/icon-button.md +128 -2
  185. package/docs/icon-button.react.md +120 -0
  186. package/docs/mcp-tools.md +105 -2
  187. package/docs/mcp-tools.react.md +117 -0
  188. package/docs/notice-dropdown.md +53 -10
  189. package/docs/notice-dropdown.react.md +167 -0
  190. package/docs/notice-list.md +53 -5
  191. package/docs/notice-list.react.md +121 -0
  192. package/docs/page-container.md +80 -3
  193. package/docs/page-container.react.md +83 -0
  194. package/docs/preview-container.md +22 -32
  195. package/docs/preview-container.react.md +71 -0
  196. package/docs/project-conversations.md +85 -4
  197. package/docs/project-conversations.react.md +110 -0
  198. package/docs/project-knowledges.md +73 -8
  199. package/docs/project-knowledges.react.md +85 -0
  200. package/docs/running-flow.md +57 -2
  201. package/docs/running-flow.react.md +90 -0
  202. package/docs/show-case.md +48 -3
  203. package/docs/show-case.react.md +60 -0
  204. package/docs/show-cases.md +52 -2
  205. package/docs/show-cases.react.md +92 -0
  206. package/docs/space-chat-guide.md +32 -0
  207. package/docs/space-chat-guide.react.md +39 -0
  208. package/docs/space-logo.md +53 -0
  209. package/docs/space-logo.react.md +46 -0
  210. package/docs/space-workbench.md +45 -2
  211. package/docs/space-workbench.react.md +102 -0
  212. package/docs/stage-flow.md +122 -26
  213. package/docs/stage-flow.react.md +112 -0
  214. package/docs/stat-with-mini-chart.md +64 -159
  215. package/docs/stat-with-mini-chart.react.md +113 -0
  216. package/docs/sticky-container.md +56 -3
  217. package/docs/sticky-container.react.md +60 -0
  218. package/docs/tab-list.md +74 -3
  219. package/docs/tab-list.react.md +73 -0
  220. package/package.json +2 -2
  221. package/dist/chunks/1097.9e80dcca.js +0 -3
  222. package/dist/chunks/1097.9e80dcca.js.map +0 -1
  223. package/dist/chunks/2341.0e70532b.js +0 -2
  224. package/dist/chunks/2341.0e70532b.js.map +0 -1
  225. package/dist/chunks/3171.45ef4669.js +0 -2
  226. package/dist/chunks/3171.45ef4669.js.map +0 -1
  227. package/dist/chunks/3573.7b0bb780.js +0 -3
  228. package/dist/chunks/3573.7b0bb780.js.map +0 -1
  229. package/dist/chunks/4459.dbfa8706.js +0 -3
  230. package/dist/chunks/4459.dbfa8706.js.map +0 -1
  231. package/dist/chunks/4837.570099ad.js +0 -2
  232. package/dist/chunks/4837.570099ad.js.map +0 -1
  233. package/dist/chunks/5399.501fc322.js +0 -2
  234. package/dist/chunks/5399.501fc322.js.map +0 -1
  235. package/dist/chunks/5552.09658542.js +0 -2
  236. package/dist/chunks/5552.09658542.js.map +0 -1
  237. package/dist/chunks/6380.b8610c4b.js +0 -3
  238. package/dist/chunks/6380.b8610c4b.js.map +0 -1
  239. package/dist/chunks/7202.a893b0e6.js +0 -3
  240. package/dist/chunks/7202.a893b0e6.js.map +0 -1
  241. package/dist/chunks/948.e601f18c.js +0 -3
  242. package/dist/chunks/948.e601f18c.js.map +0 -1
  243. package/dist/chunks/9599.02a5e6e3.js +0 -2
  244. package/dist/chunks/9599.02a5e6e3.js.map +0 -1
  245. package/dist/chunks/9848.4b1f38c9.js +0 -3
  246. package/dist/chunks/9848.4b1f38c9.js.LICENSE.txt +0 -1
  247. package/dist/chunks/9848.4b1f38c9.js.map +0 -1
  248. package/dist/chunks/chat-box.1ac7555a.js +0 -3
  249. package/dist/chunks/chat-box.1ac7555a.js.map +0 -1
  250. package/dist/chunks/chat-input.444c80bb.js +0 -3
  251. package/dist/chunks/chat-input.444c80bb.js.map +0 -1
  252. package/dist/chunks/chat-panel.3160f2e8.js.map +0 -1
  253. package/dist/chunks/elevo-sidebar.a197a77f.js +0 -3
  254. package/dist/chunks/elevo-sidebar.a197a77f.js.map +0 -1
  255. package/dist/chunks/main.9d171af9.js +0 -2
  256. package/dist/chunks/main.9d171af9.js.map +0 -1
  257. package/dist/chunks/space-chat-guide.84f4a1e7.js +0 -3
  258. package/dist/chunks/space-chat-guide.84f4a1e7.js.map +0 -1
  259. package/dist/chunks/space-workbench.8c064898.js +0 -2
  260. package/dist/chunks/space-workbench.8c064898.js.map +0 -1
  261. package/dist/index.0edd6320.js +0 -2
  262. package/dist/index.0edd6320.js.map +0 -1
  263. /package/dist/chunks/{3573.7b0bb780.js.LICENSE.txt → 3840.6080d56e.js.LICENSE.txt} +0 -0
  264. /package/dist/chunks/{4459.dbfa8706.js.LICENSE.txt → 551.ae5171a6.js.LICENSE.txt} +0 -0
  265. /package/dist/chunks/{7202.a893b0e6.js.LICENSE.txt → 7669.6f177bf2.js.LICENSE.txt} +0 -0
  266. /package/dist/chunks/{6380.b8610c4b.js.LICENSE.txt → 794.214aa08f.js.LICENSE.txt} +0 -0
  267. /package/dist/chunks/{948.e601f18c.js.LICENSE.txt → 948.c96c7036.js.LICENSE.txt} +0 -0
  268. /package/dist/chunks/{chat-box.1ac7555a.js.LICENSE.txt → chat-box.060b8727.js.LICENSE.txt} +0 -0
  269. /package/dist/chunks/{chat-input.444c80bb.js.LICENSE.txt → chat-input.e913e9ed.js.LICENSE.txt} +0 -0
  270. /package/dist/chunks/{elevo-sidebar.a197a77f.js.LICENSE.txt → elevo-sidebar.dfaaf9d1.js.LICENSE.txt} +0 -0
  271. /package/dist/chunks/{space-chat-guide.84f4a1e7.js.LICENSE.txt → space-chat-guide.b9f77cb5.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 948.e601f18c.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[948],{11369:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(17545);function r(e){var t=function(e){if("object"!=(0,o.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,o.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,o.A)(t)?t:t+""}},12559:(e,t,n)=>{function o(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>o})},17545:(e,t,n)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}n.d(t,{A:()=>o})},24586:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(11369);function r(e,t,n){return(t=(0,o.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},30948:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>sn,Notification:()=>hn,StoryboardFunctionRegistryFactory:()=>ve,__secret_internals:()=>o,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>Vi,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Pt,checkIfOfComputed:()=>_t,createHistory:()=>A,createRuntime:()=>Mi,customEditors:()=>qi,customProcessors:()=>x,customTemplates:()=>Ne,fetchByProvider:()=>Xi,getAuth:()=>Wi,getBasePath:()=>p,getCssPropertyValue:()=>le,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>kr,getRealValue:()=>Ji,getRuntime:()=>xi,getThemeVariant:()=>de,getV2RuntimeFromDll:()=>S,handleHttpError:()=>pn,httpErrorToString:()=>ln,instantiateModalStack:()=>Zi,isLoggedIn:()=>Gi,isNetworkError:()=>Tr,isUnauthenticatedError:()=>cn,logout:()=>zi,matchPath:()=>zt,registerWidgetFunctions:()=>Ve,registerWidgetI18n:()=>N,resetReloadForError:()=>Mr,setUIVersion:()=>Cr,shouldReloadForError:()=>Pr,unstable_createRoot:()=>Yi});var o={};n.r(o),n.d(o,{addRealTimeDataInspectHook:()=>Vo,debugDataValue:()=>Uo,getAddedContracts:()=>No,getAllContextValues:()=>Mo,getBrickPackages:()=>Ni,getBrickPackagesById:()=>xo,getContextValue:()=>Po,getLegalRuntimeValue:()=>Fo,getRenderId:()=>$o,legacyDoTransform:()=>go,legacyTransformIntermediateData:()=>vo,legacyTransformProperties:()=>mo,loadBricks:()=>Bo,loadEditors:()=>Lo,mountUseBrick:()=>Eo,renderUseBrick:()=>wo,setRealTimeDataInspectRoot:()=>Ko,symbolForRootRuntimeContext:()=>yo,unmountUseBrick:()=>So,updateSnippetPreviewSettings:()=>Oo,updateStoryboard:()=>Ao,updateStoryboardByRoute:()=>ko,updateStoryboardBySnippet:()=>To,updateStoryboardByTemplate:()=>Io,updateTemplatePreviewSettings:()=>Co});var r=n(24586),i=n(70918),s=n(86121),a=n(70829),l=n(67177),c=n(45599),u=n(40410),d=n(21302),f=(n(26036),n(11732));function p(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(41030);function g(e,t){const n=(0,h.orderBy)(e,(e=>{var t,n;return null!==(t=null===(n=e.app.homepage)||void 0===n?void 0:n.length)&&void 0!==t?t:0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&m(n,t))return e}}function m(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function v(e){var t;return!e||(null===(t=xi().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let b,y=!1;function w(e,t){y=!confirm(e),t(!y)}function E(e){const{push:t,replace:n}=e;function o(o){return function(r,i,s){let a;const l="string"==typeof r;return a=l?(0,f.parsePath)(r).pathname:r.pathname,"string"==typeof a&&a.startsWith("/")&&v(function(e){var t,n;return g(null!==(t=null===(n=Ti)||void 0===n?void 0:n.storyboards)&&void 0!==t?t:[],e)}(a))?location["push"===o?"assign":"replace"](l?p()+r.substring(1):e.createHref(r)):("push"===o?t:n)(r,i,s)}}return{push:o("push"),replace:o("replace")}}function S(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function A(){if(!b){const e=(0,f.createBrowserHistory)({basename:p().replace(/\/$/,""),getUserConfirmation:w});Object.assign(e,function(e){const{push:t,replace:n}=e;function o(e,n,o){y=!1,t(e,n),null==o||o(y)}function r(e,t,o){y=!1,n(e,t),null==o||o(y)}function i(t){return function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;const{extraQuery:a,clear:l,keepHash:c,...u}=i,d=new URLSearchParams(l?"":e.location.search),f={};Object.assign(f,n,a);for(const[e,t]of Object.entries(f))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?o:r)(`?${d.toString()}${c?e.location.hash:""}`,u,s)}}let s;return{pushQuery:i("push"),replaceQuery:i("replace"),pushAnchor:function(t,n,r){o({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,r)},reload:function(t){r({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){s=e},getBlockMessage:function(){return s},unblock:function(){s=void 0},...E({...e,push:o,replace:r})}}(e)),b=e}return b}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return b};var I=n(74635),C=n(12559),R=n(22919),T=n(71321),O=n(95188),_=n(29283),P=n(94167),M=new WeakMap;const x=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,i.A)(this,M,new Map)}define(e,t){const[n,o]=e.split(".");let r=(0,a.A)(M,this).get(n);if(r||(r=new Map,(0,a.A)(M,this).set(n,r)),r.has(o))throw new Error(`Custom processor of "${e}" already registered`);r.set(o,t)}get(e){return(0,a.A)(M,this).get(e)}};function B(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=L("app",t.id),o=[];return Object.entries(n.i18n).forEach((t=>{let[n,r]=t;l.i18n.addResourceBundle(n,e,r),o.push(n)})),()=>{for(const t of o)l.i18n.removeResourceBundle(t,e)}}}function L(e,t){return`${e}/${t}`}function $(e){return l.i18n.getFixedT(null,L("widget",e))}const N=function(){const e=S();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=L("widget",e);Object.entries(t).forEach((e=>{let[t,o]=e;l.i18n.addResourceBundle(t,n,o)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",D="devtools-panel-change";let j,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||j&&"Evaluations"!==j))return;const o=()=>{var o;null===(o=n.emit)||void 0===o||o.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(o):setTimeout(o,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const z=()=>{throw new Error("Can't modify read-only proxy object")},G={set:z,defineProperty:z,deleteProperty:z,setPrototypeOf:z};function H(e){return new Proxy(e,G)}function q(e){let{get:t,ownKeys:n}=e;return W()?H(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let X="light";const Y=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);X=e}function Z(){return X}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){Y.setItem(J,{...oe(),...e})}function oe(){let e;try{e=Y.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!=e?e:{}}let re="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);re=e}function se(){return document.documentElement.dataset.mode}function ae(e){e?ie(e):e=re,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function le(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}let ce="default";function ue(e){if("default"!==e&&"elevo"!==e)return ue("default");ce!==e&&(document.documentElement.dataset.variant=ce=e,window.dispatchEvent(new CustomEvent("variant.change",{detail:e})))}function de(){return ce}const fe=new Map;function pe(e,t){const n={};for(const o of e){const e=he(o,t);void 0!==e&&(n[o]=e)}return n}function he(e,t){var n,o,r;let{collectCoverage:i,widgetId:s,widgetVersion:a,isolatedRoot:c,app:u,appendI18nNamespace:d,storyboardFunctions:f,isStoryboardFunction:g}=t;switch(e){case"BASE_URL":return i?"/next":p().replace(/\/$/,"");case"FN":return c?fe.get(c):f;case"IMG":return i?{get:e=>`mock/images/${e}`}:s?null==Pi||null===(n=Pi.images)||void 0===n?void 0:n.widgetImagesFactory(s,a):null==Pi||null===(o=Pi.images)||void 0===o?void 0:o.imagesFactory(u.id,u.isBuildPush,u.currentVersion);case"I18N":return i?h.identity:s?$(s):l.i18n.getFixedT(null,[d,L("app",u.id)].filter(Boolean));case"I18N_TEXT":return i?ge:l.i18nText;case"LANGUAGE":return i?"zh":l.i18n.language||"zh";case"PERMISSIONS":return H({check:i?me:null==Pi||null===(r=Pi.checkPermissions)||void 0===r?void 0:r.checkPermissions});case"THEME":return H({getTheme:i?()=>"light":Z,getCssPropertyValue:i?()=>"":le});case"console":return g?H(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function ge(e){return null==e?void 0:e.en}function me(){return!0}function ve(){let{widgetId:e,widgetVersion:t,isolatedRoot:n,collectCoverage:o,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=new Map,s=null==r?void 0:r({precookFunction:T.precookFunction,cook:T.cook,supply:P.supply}),a=new Proxy(Object.freeze({}),{get:(e,t)=>function(e){const t=i.get(e);if(!t)return;if(t.processed)return t.cooked;let n;o&&(n=o.createCollector(e));const a=!s&&!n&&t.transformed;if(a){const e=c(a.globals);t.cooked=new Function(...a.globals,`"use strict";return (${a.source})`)(...a.globals.map((t=>(0,u.hasOwnProperty)(e,t)?e[t]:void 0)))}else{const e=(0,T.precookFunction)(t.source,{typescript:t.typescript,hooks:n&&{beforeVisit:n.beforeVisit},cacheKey:t}),o=c(e.attemptToVisitGlobals);t.cooked=(0,T.cook)(e.function,t.source,{rules:{noVar:!0},globalVariables:s?{...o,...null!=s&&s.LodashWithStaticFields&&e.attemptToVisitGlobals.has("_")?{_:{...o._,...s.LodashWithStaticFields}}:null,...null!=s&&s.ArrayConstructor&&e.attemptToVisitGlobals.has("Array")?{Array:s.ArrayConstructor}:null,...null!=s&&s.ObjectWithStaticFields&&e.attemptToVisitGlobals.has("Object")?{Object:{...o.Object,...s.ObjectWithStaticFields}}:null}:o,ArrayConstructor:null==s?void 0:s.ArrayConstructor,hooks:n&&{beforeEvaluate:n.beforeEvaluate,beforeCall:n.beforeCall,beforeBranch:n.beforeBranch},debug:!!r})}return t.processed=!0,t.cooked}(t)});let l;function c(r){return(0,P.supply)(r,pe(r,{collectCoverage:o,widgetId:e,widgetVersion:t,isolatedRoot:n,app:l,storyboardFunctions:a,isStoryboardFunction:!0}),!!o)}return{storyboardFunctions:a,registerStoryboardFunctions:function(e,t){if(t&&(l=t),i.clear(),Array.isArray(e))for(const t of e){var n;let e=t.deps;null==e&&(e=(0,O.collectMemberUsageInFunction)(t,"FN",!!o),e.delete(t.name));const r=null!==(n=t.perm)&&void 0!==n?n:(0,O.collectMemberUsageInFunction)(t,"PERMISSIONS",!!o).has("check");i.set(t.name,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:e,hasPermissionsCheck:r})}},updateStoryboardFunction(e,t){const n={...t,name:e},o=(0,O.collectMemberUsageInFunction)(n,"FN",!0),r=(0,O.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");i.set(e,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:o,hasPermissionsCheck:r})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const o=i.get(e);return!!o&&(o.hasPermissionsCheck||[...o.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,T.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,T.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:be,registerStoryboardFunctions:ye,checkPermissionsUsage:we}=ve();var Ee={};try{Ee.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,o=e.defineProperty,r=i.prototype;function i(){t.set(this,n(null))}function s(e,t,n){o(e,t,{configurable:!0,writable:!0,value:n})}function a(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}s(r,"addEventListener",(function(e,n,o){for(var r=t.get(this),i=r[e]||(r[e]=[]),s=0,a=i.length;s<a;s++)if(i[s].listener===n)return;i.push({target:this,listener:n,options:o})})),s(r,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(s(e,"target",this),s(e,"currentTarget",this),n.slice(0).some(a,e),delete e.currentTarget,delete e.target),!0})),s(r,"removeEventListener",(function(e,n){for(var o=t.get(this),r=o[e]||(o[e]=[]),i=0,s=r.length;i<s;i++)if(r[i].listener===n)return void r.splice(i,1)})),Ee.EventTarget=i}(Object,new WeakMap)}const Se=Ee.EventTarget;let Ae=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const ke=new Map([[Ae.xLarge,"1920px"],[Ae.large,"1600px"],[Ae.medium,"1280px"],[Ae.small,"1024px"],[Ae.xSmall,0]]),Ie=new Se,Ce={},Re={};function Te(e,t){let n=!1;Ce[t]=e.matches;for(const[e]of ke)if(Ce[e]&&Re.breakpoint!==e){Re.breakpoint=e,n=!0;break}n&&Ie.dispatchEvent(new CustomEvent("change",{detail:Re}))}ke.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);Te(n,t),n.addEventListener?n.addEventListener("change",(e=>{Te(e,t)})):n.addListener((e=>{Te(e,t)}))}));const Oe=()=>Re;function _e(e){return function(t){var n;const o="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(n=o.getItem(t))&&void 0!==n?n:"null")}}function Pe(e){var t,n;return!(null===(t=e?e.flags:null===(n=xi())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Me(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];const i=0===o.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${i}`,...o):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${i}`,...o)}const xe=new Set(["prefix"]);var Be=new WeakMap,Le=new WeakMap;class $e{constructor(e){(0,i.A)(this,Be,new Map),(0,i.A)(this,Le,void 0),(0,s.A)(Le,this,e)}define(e,t){var n,o,r,i;let s=(0,a.A)(Be,this).has(e);s?console.warn(`Custom template of "${e}" already registered.`):(s=!!customElements.get(e),s&&console.warn(`Custom template of "${e}" already defined by customElements.`));const l=Pe(),c=null!==(n=null===(o=t.proxy)||void 0===o?void 0:o.properties)&&void 0!==n?n:{},u=[],d=[];for(const[t,n]of Object.entries(c))n.asVariable?(Me(l,"Template `asVariable`",e,t),l||d.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&u.push([t,n]);const f={...t,proxy:{...t.proxy,properties:Object.fromEntries(u)},state:(t.state?l?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(d.map((e=>({name:e,expose:!0}))))};(0,a.A)(Be,this).set(e,{...f,name:e});const p=(g=f.state,(0,h.uniq)(null!==(m=null==g?void 0:g.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==m?m:[]));var g,m;const v=Object.entries(null!==(r=null===(i=f.proxy)||void 0===i?void 0:i.methods)&&void 0!==r?r:{}),b=p.concat(u.map((e=>e[0]))),y=v.map((e=>e[0])),w=b.concat(y).filter((e=>e in HTMLElement.prototype&&!xe.has(e)));if(w.length>0&&(Me(l,"Using native HTMLElement properties as template properties or methods",e,...w),l))throw new Error(`In custom template "${e}", ${w.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return b}static get _dev_only_definedMethods(){return y}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const o=document.createElement("slot");t.appendChild(n),t.appendChild(o),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of p)u.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of u)Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refProperty)&&void 0!==t?t:e]},set(t){var o;const r=null===(o=this.$$getElementByRef)||void 0===o?void 0:o.call(this,n.ref);var i;r&&(r[null!==(i=n.refProperty)&&void 0!==i?i:e]=t)},enumerable:!0});for(const[e,n]of v)Object.defineProperty(t.prototype,e,{value(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,a.A)(Be,this).get(e)}clearIsolatedRegistry(){(0,a.A)(Le,this)&&(0,a.A)(Be,this).clear()}}const Ne=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new $e,Ue=new Map;function Fe(e,t,n){let{tplStateStoreId:o,tplStateStoreMap:r}=e;if(!o)throw new Error(`Using "${t}" outside of a custom template${null!=n?n:""}`);const i=r.get(o);if(!i)throw new Error(`Template state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}function De(e,t,n){const o=Fe(e,t,n).hostBrick.element;if(!o)throw new Error(`Template host element is gone when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return o}const je=new Map,Ke=new Proxy(Object.freeze({}),{get:(e,t)=>je.get(t)}),Ve=function(){const e=S();if(e)return function(t,n,o){return e.getRuntime().registerWidgetFunctions(t,n,o)}}()||function(e,t,n){if(je.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:o,registerStoryboardFunctions:r}=ve({widgetId:e,widgetVersion:n});je.set(e,o),r(t)},We=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ze=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(We);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ge=e=>"*"===e||"x"===e||"X"===e,He=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},qe=(e,t)=>{if(Ge(e)||Ge(t))return 0;const[n,o]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(He(e),He(t));return n>o?1:n<o?-1:0},Xe=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const o=qe(e[n]||"0",t[n]||"0");if(0!==o)return o}return 0},Ye=(e,t,n)=>{Ze(n);const o=((e,t)=>{const n=ze(e),o=ze(t),r=n.pop(),i=o.pop(),s=Xe(n,o);return 0!==s?s:r&&i?Xe(r.split("."),i.split(".")):r||i?r?-1:1:0})(e,t);return Je[n].includes(o)},Je={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Qe=Object.keys(Je),Ze=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===Qe.indexOf(e))throw new Error(`Invalid operator, expected one of ${Qe.join("|")}`)};function et(e,t){let n=Ki(e);if(!n&&null!=Pi&&Pi.checkInstalledApps&&(n=Pi.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const o=t.match(/^([><]=?|=)(.*)$/);try{if(!o)throw new TypeError(`Invalid match version: ${t}`);return Ye(n.currentVersion,o[2],o[1])}catch(e){console.error(e)}return!1}function tt(e,t,n){let{formStateStoreId:o,formStateStoreMap:r}=e;if(!o)throw new Error(`Using "${t}" outside of form renderer${null!=n?n:""}`);const i=r.get(o);if(!i)throw new Error(`Form state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}const nt=new Map;async function ot(e){var t;const n=null==Pi||null===(t=Pi.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=Pi.flowApi.FLOW_API_PROVIDER);let o=nt.get(e);if(o)return o;if(e.includes("-")&&!customElements.get(e))if(n)Pi.flowApi.registerFlowApiProvider();else if(await(0,c.loadBricksImperatively)([e],Ni()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return o=document.createElement(e),nt.set(e,o),o}let rt=new WeakSet;function it(e){if((0,u.isObject)(e)&&!st(e))if(rt.add(e),Array.isArray(e))e.forEach(it);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(it)}}function st(e){return rt.has(e)}const at=new Map;async function lt(e,t,n){var o;const{useProvider:r,method:i="resolve",args:s,params:a,options:l,filename:c,onReject:u}=e,{provider:d,field:f}=e;if(d&&!r)throw new Error(`You're using "provider: ${d}" which is dropped in v3, please use "useProvider" instead`);const p=null!=f;if(p){const e=Pe();if(Me(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const g=!Array.isArray(s)&&a&&null!=Pi&&null!==(o=Pi.flowApi)&&void 0!==o&&o.isFlowApiProvider(r)?{params:a,options:l,filename:c}:null,[m,v,b]=await Promise.all([ot(r),kt(s,t),kt(g,t)]),y=null==n?void 0:n.renderId,w=ut(m,r,i,null!=b&&b.params?b:null!=v?v:[],n,s,(()=>!!y&&y!==Fi()));let E,{transform:S}=e;try{const e=await w;E=p?(0,h.get)(e,f):e,it(E)}catch(e){if(!function(e){return!(null==e||!e.transform)}(u))throw e;S=u.transform,E=e}return S?"string"==typeof S?{[S]:E}:kt(S,{...t,data:E}):E}function ct(){at.clear()}async function ut(e,t,n,o,r,i,s){let a,l;try{a=JSON.stringify({useProvider:t,method:n,args:o})}catch(e){if(!i)throw e;a=JSON.stringify({useProvider:t,method:n,originalArgs:i})}return"reload"!==(null==r?void 0:r.cache)&&(l=at.get(a)),l||(l=(async r=>{const i=null!=Pi&&null!==(r=Pi.flowApi)&&void 0!==r&&r.isFlowApiProvider(t)?await Pi.flowApi.getArgsOfFlowApi(t,o,n):o;return e[n](...i)})(),null!=s&&s()||at.set(a,l)),l}const dt=Symbol.for("pre.evaluated.raw"),ft=Symbol.for("pre.evaluated.context");function pt(e){return!(null==e||!e[dt])}function ht(e){return e[dt]}function gt(e){return"string"==typeof e?(0,T.shouldAllowRecursiveEvaluations)(e):(0,T.shouldAllowRecursiveEvaluations)(e[dt])}const mt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function vt(e){return mt.has(e.constructor)?e.constructor:TypeError}function bt(e,t,n){const{run:o}=yt(e,t,n,!1);return o()}function yt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;const r=[];if("string"!=typeof e){const n=(0,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ft],...n},e=e[dt]}const i={usedArgs:new Set},s={usedArgs:new Set};let a;try{a=(0,T.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,O.collectAppGetMenuUsage)(i,e,t),(0,O.collectInstalledAppsHasUsage)(s,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(vt(t))(n)}if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(s.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const l={},{attemptToVisitGlobals:d}=a;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:r,run:()=>Object.keys(t).length>0?{[dt]:e,[ft]:t}:e};let f,p,g,m;const v=Pe(t);let b,y;(d.has("STATE")||!v&&d.has("TPL"))&&(m=Fe(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(y=tt(t,"FORM_STATE",`: "${e}"`));const w=W();if(o||w){if(d.has("CTX")&&(f=(0,O.strictCollectMemberUsage)(e,"CTX"),o&&r.push(t.ctxStore.waitFor(f))),m){if(g=(0,O.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,O.strictCollectMemberUsage)(e,"TPL");for(const e of t)g.add(e)}o&&r.push(m.waitFor(g))}y&&(b=(0,O.strictCollectMemberUsage)(e,"FORM_STATE"),o&&r.push(y.waitFor(b))),d.has("PROCESSORS")&&(p=(0,O.strictCollectMemberUsage)(e,"PROCESSORS",2),o&&r.push((0,c.loadProcessorsImperatively)(p,Ni())))}if(o){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,O.strictCollectMemberUsage)(e,"FN")];n=we(t)}if(n&&r.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=Pi&&Pi.menu){const e=[...i.usedArgs];r.push(Promise.all(e.map((e=>Pi.menu.fetchMenuById(e,t,{getStoryboardByAppId:ji,resolveData:lt,asyncComputeRealValue:kt})))))}var E;s.usedArgs.size>0&&r.push(null==Pi||null===(E=Pi.checkInstalledApps)||void 0===E?void 0:E.waitForCheckingApps([...s.usedArgs]))}return{blockingList:r,run(){var n,o,r,i;const{ctxStore:s,data:c,event:w,unsafe_penetrate:E}=t,S=E?Di():t,{app:A,location:k,query:I,match:C,flags:R,sys:O}=S,_=null!==(n=S.overrideApp)&&void 0!==n?n:A;for(const n of d)switch(n){case"ANCHOR":l[n]=k.hash?k.hash.substring(1):null;break;case"APP":if(null==_)throw new ReferenceError(`APP is not defined, in "${e}"`);l[n]={...(0,h.cloneDeep)(_),getMenu:null==Pi||null===(o=Pi.menu)||void 0===o?void 0:o.getMenuById};break;case"CTX":l[n]=q({get(e,t){if("DS"===t&&!s.has(t)){var n;const e=null===(n=Di())||void 0===n?void 0:n.ctxStore;if(null!=e&&e.has(t))return e.getValue(t)}return s.getValue(t)},ownKeys:()=>f?Array.from(f):[]});break;case"DATA":l[n]=c;break;case"EVENT":l[n]=w;break;case"FLAGS":l[n]=H(R);break;case"FORM_STATE":l[n]=q({get:(e,t)=>y.getValue(t),ownKeys:()=>Array.from(b)});break;case"HASH":l[n]=k.hash;break;case"INSTALLED_APPS":l[n]=H({has:et});break;case"ITEM":case"INDEX":case"SIZE":{const o="ITEM"===n?"forEachItem":"INDEX"===n?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,o)?l[n]=t[o]:console.error(`Using \`${n}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":l[n]=H({getItem:_e("local")});break;case"MEDIA":l[n]=H(Oe());break;case"MISC":l[n]=xi().getMiscSettings();break;case"PARAMS":if(null==I)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);l[n]=new URLSearchParams(I);break;case"PATH":l[n]=H(null!==(r=null==C?void 0:C.params)&&void 0!==r?r:{});break;case"PATH_NAME":l[n]=k.pathname;break;case"PROCESSORS":l[n]=q({get(e,t){const n=x.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return q({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of p){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==I)throw new ReferenceError(`QUERY is not defined, in "${e}"`);l[n]=Object.fromEntries(Array.from(I.keys()).map((e=>[e,I.get(e)])));break;case"QUERY_ARRAY":if(null==I)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);l[n]=Object.fromEntries(Array.from(I.keys()).map((e=>[e,I.getAll(e)])));break;case"SESSION_STORAGE":l[n]=H({getItem:_e("session")});break;case"TPL":if(Me(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":l[n]=q({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(g)});break;case"SYS":l[n]=H(null!=O?O:{});break;case"CONSTANTS":l[n]=q({get(e,t){if(null==_||!_.constants||!(0,u.hasOwnProperty)(_.constants,t))throw new ReferenceError(`CONSTANTS.${t} is not defined`);return _.constants[t]},ownKeys:()=>null!=_&&_.constants?Object.keys(_.constants):[]});break;case"__WIDGET_FN__":l[n]=Ke;break;case"__WIDGET_IMG__":l[n]=null==Pi||null===(i=Pi.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":l[n]=$}Object.assign(l,pe(a.attemptToVisitGlobals,{storyboardFunctions:be,app:_,appendI18nNamespace:t.appendI18nNamespace,isolatedRoot:t.isolatedRoot}));try{const t=(0,T.cook)(a.expression,a.source,{globalVariables:(0,P.supply)(a.attemptToVisitGlobals,l)});return V("evaluation",{raw:e,context:l,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(vt(t))(n)}}}}let wt=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function Et(e){switch(e){case wt.USE_BRICK_PROPERTIES:case wt.USE_BRICK_TRANSFORM:case wt.USE_BRICK_EVENTS:case wt.USE_BRICK_IF:case wt.USE_BRICK_LIFECYCLE:case wt.USE_BRICK_DATA_SOURCE:return!0}return!1}function St(e,t,n){if(Et(e))return e;if(t)switch(e){case wt.USE_BRICK:return wt.USE_BRICK_ITEM;case wt.USE_BRICK_SLOTS_ITEM_BRICKS:return wt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case wt.INITIAL:if("useBrick"===n)return wt.USE_BRICK;break;case wt.USE_BRICK:case wt.USE_BRICK_ITEM:case wt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return wt.USE_BRICK_PROPERTIES;case"transform":return wt.USE_BRICK_TRANSFORM;case"dataSource":return wt.USE_BRICK_DATA_SOURCE;case"events":return wt.USE_BRICK_EVENTS;case"slots":return wt.USE_BRICK_SLOTS;case"children":return wt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return wt.USE_BRICK_IF;case"lifeCycle":return wt.USE_BRICK_LIFECYCLE}break;case wt.USE_BRICK_SLOTS:return wt.USE_BRICK_SLOTS_ITEM;case wt.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return wt.USE_BRICK_SLOTS_ITEM_BRICKS}return wt.INITIAL}const At=["app","location","query","match","flags","sys"];async function kt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=pt(e);if(o||"string"==typeof e){var r;const i=n.$$lazyForUseBrick&&Et(n.$$stateOfUseBrick);let s,a=!1;if(o||(0,T.isEvaluable)(e))s=await async function(e,t,n){const{blockingList:o,run:r}=yt(e,t,n,!0);return await Promise.all(o),r()}(e,t,{lazy:i}),a=gt(e);else if(i||null!==(r=t.app)&&void 0!==r&&r.noPlaceholders)s=e,a=!0;else{const o=t.unsafe_penetrate?{...(0,h.pick)(Di(),At),...(0,h.omit)(t,At)}:t;s=((0,u.hasOwnProperty)(o,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?Rt:_.inject)(e,o)}return a||it(s),s}if(!(0,u.isObject)(e)||st(e)||"function"==typeof e)return e;if(Array.isArray(e)){const o=Ct(n,!0);return Promise.all(e.map((e=>kt(e,t,o))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[o,r]=e;return Promise.all([kt(o,t),kt(r,t,Ct(n,!1,o))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function It(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=pt(e);if(o||"string"==typeof e){var r;const i=n.$$lazyForUseBrick&&Et(n.$$stateOfUseBrick);let s,a=!1;if(o||(0,T.isEvaluable)(e))s=bt(e,t),a=gt(e);else if(i||null!==(r=t.app)&&void 0!==r&&r.noPlaceholders)s=e,a=!0;else{const o=t.unsafe_penetrate?{...(0,h.pick)(Di(),At),...(0,h.omit)(t,At)}:t;s=((0,u.hasOwnProperty)(o,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?Rt:_.inject)(e,o)}return a||it(s),s}if(!(0,u.isObject)(e)||st(e)||"function"==typeof e)return e;if(Array.isArray(e)){const o=Ct(n,!0);return e.map((e=>It(e,t,o)))}return Object.fromEntries(Object.entries(e).map((e=>{let[o,r]=e;return[It(o,t),It(r,t,Ct(n,!1,o))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function Ct(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:St(e.$$stateOfUseBrick,t,n)}:e}function Rt(e){return e}async function Tt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||pt(e.if)?await kt(e.if,t):e.if)}function Ot(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||pt(e.if)?It(e.if,t):e.if)}function _t(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const Pt=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Ot(e,{data:t})};function Mt(e){let t=!1,n=!1,o=!1;if("string"==typeof e?(0,T.isEvaluable)(e):pt(e)){const r="string"==typeof e?e:ht(e);if((0,T.isTrackAll)(r)){const e=(0,O.trackAll)(r);e&&(t=e.context,n=e.state,o=e.formState)}else t=(0,O.track)(r,"track context","CTX"),n=(0,O.track)(r,"track state","STATE"),o=(0,O.track)(r,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:o}}async function xt(e,t){for(const[n,o,r]of e)if(n===t){const e=await o;if(void 0!==e||!r)return e}}async function Bt(e){const t={};for(const[n,o,r]of e){const e=await o;void 0===e&&r||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function Lt(e,t){if(t)for(const[i,s]of Object.entries(t))switch(i){case"style":case"dataset":for(const[t,a]of Object.entries(s))"style"===i?(n=e.style,r=a,(o=t).startsWith("--")?n.setProperty(o,r):"float"===o?n.cssFloat=r:n[o]=r):e[i][t]=a;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${i}\` is prohibited`);default:i.startsWith("data-")?e.setAttribute(i,String(s)):e[i]=s}var n,o,r}function $t(e,t,n){const o=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,o]=e;const r=It(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?wt.USE_BRICK:wt.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(r))return[n,r]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Lt(e,o)}))}function Nt(e,t,n){if(n)for(const{contextNames:o,stateNames:r,propValue:i}of t){if(o)for(const t of o)n.disposes.push(e.ctxStore.onChange(t,n.listener));if(r)for(const t of r){const o=Fe(e,"STATE",`: "${i}"`);n.disposes.push(o.onChange(t,n.listener))}}}function Ut(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ft(e){return e&&e.sensitive?"":"i"}function Dt(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var o=n.strict,r=void 0!==o&&o,i=n.start,s=void 0===i||i,a=n.end,l=void 0===a||a,c=n.encode,u=void 0===c?function(e){return e}:c,d=n.delimiter,f=void 0===d?"/#?":d,p=n.endsWith,h="[".concat(Ut(void 0===p?"":p),"]|$"),g="[".concat(Ut(f),"]"),m=s?"^":"",v=0,b=e;v<b.length;v++){var y=b[v];if("string"==typeof y)m+=Ut(u(y));else{var w=Ut(u(y.prefix)),E=Ut(u(y.suffix));if(y.pattern)if(t&&t.push(y),w||E)if("+"===y.modifier||"*"===y.modifier){var S="*"===y.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(y.pattern,")(?:").concat(E).concat(w,"(?:").concat(y.pattern,"))*)").concat(E,")").concat(S)}else m+="(?:".concat(w,"(").concat(y.pattern,")").concat(E,")").concat(y.modifier);else{if("+"===y.modifier||"*"===y.modifier)throw new TypeError('Can not repeat "'.concat(y.name,'" without a prefix and suffix'));m+="(".concat(y.pattern,")").concat(y.modifier)}else m+="(?:".concat(w).concat(E,")").concat(y.modifier)}}if(l)r||(m+="".concat(g,"?")),m+=n.endsWith?"(?=".concat(h,")"):"$";else{var A=e[e.length-1],k="string"==typeof A?g.indexOf(A[A.length-1])>-1:void 0===A;r||(m+="(?:".concat(g,"(?=").concat(h,"))?")),k||(m+="(?=".concat(g,"|").concat(h,")"))}return new RegExp(m,Ft(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var o=e[n];if("*"!==o&&"+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o)if(":"!==o)if("("!==o)t.push({type:"CHAR",index:n,value:e[n++]});else{var r=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--r){a++;break}}else if("("===e[a]&&(r++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(r)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var l=e.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=t.prefixes,r=void 0===o?"./":o,i=t.delimiter,s=void 0===i?"/#?":i,a=[],l=0,c=0,u="",d=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},f=function(e){var t=d(e);if(void 0!==t)return t;var o=n[c],r=o.type,i=o.index;throw new TypeError("Unexpected ".concat(r," at ").concat(i,", expected ").concat(e))},p=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},h=function(e){var t=a[a.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var o=n[t];if(e.indexOf(o)>-1)return!0}return!1}(n)?"[^".concat(Ut(s),"]+?"):"(?:(?!".concat(Ut(n),")[^").concat(Ut(s),"])+?")};c<n.length;){var g=d("CHAR"),m=d("NAME"),v=d("PATTERN");if(m||v){var b=g||"";-1===r.indexOf(b)&&(u+=b,b=""),u&&(a.push(u),u=""),a.push({name:m||l++,prefix:b,suffix:"",pattern:v||h(b),modifier:d("MODIFIER")||""})}else{var y=g||d("ESCAPED_CHAR");if(y)u+=y;else if(u&&(a.push(u),u=""),d("OPEN")){b=p();var w=d("NAME")||"",E=d("PATTERN")||"",S=p();f("CLOSE"),a.push({name:w||(E?l++:""),pattern:w&&!E?h(b):E,prefix:b,suffix:S,modifier:d("MODIFIER")||""})}else f("END")}}return a}(e,n),t,n)}function jt(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,o=0,r=n.exec(e.source);r;)t.push({name:r[1]||o++,prefix:"",suffix:"",modifier:"",pattern:""}),r=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var o=e.map((function(e){return jt(e,t,n).source}));return new RegExp("(?:".concat(o.join("|"),")"),Ft(n))}(e,t,n):Dt(e,t,n)}const Kt=new Map,Vt=1e4;let Wt=0;function zt(e,t){const{path:n,exact:o=!1,strict:r=!1,sensitive:i=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:s,keys:a}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let o=Kt.get(n);o||Kt.set(n,o=new Map);const r=o.get(e);if(r)return r;const i=[],s={regexp:jt(e,i,t),keys:i};return Wt<Vt&&(o.set(e,s),Wt++),s}(n,{end:o,strict:r,sensitive:i}),l=s.exec(e);if(!l)return null;const[c,...u]=l,d=e===c;return o&&!d?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:d,params:a.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function Gt(e,t,n){return zt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Ht=Symbol.for("tpl.asyncComputedPropsFromHost"),qt=Symbol.for("tpl.stateStoreId"),Xt=Symbol.for("tpl.externalForEachItem"),Yt=Symbol.for("tpl.externalForEachIndex"),Jt=Symbol.for("tpl.externalForEachSize"),Qt=new Set;let Zt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e.LICENSE_EXPIRED="LICENSE_EXPIRED",e.LICENSE_BLOCKED="LICENSE_BLOCKED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e.RELOAD="RELOAD",e}({});const en={[Zt.REQUEST_FAILED]:"Request Failed",[Zt.SOMETHING_WENT_WRONG]:"Something went wrong!",[Zt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Zt.NETWORK_ERROR]:"Network error, please check your network.",[Zt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[Zt.LICENSE_BLOCKED]:"The page is not authorized, please contact the platform administrator",[Zt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[Zt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[Zt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[Zt.UNKNOWN_ERROR]:"Oops! Something went wrong",[Zt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[Zt.GO_BACK_HOME]:"Go back to home page",[Zt.RELOAD]:"Reload"},tn={[Zt.REQUEST_FAILED]:"请求失败",[Zt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Zt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Zt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[Zt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[Zt.LICENSE_BLOCKED]:"该页面未授权,请联系平台管理员",[Zt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[Zt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[Zt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[Zt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[Zt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[Zt.GO_BACK_HOME]:"回到首页",[Zt.RELOAD]:"刷新"},nn="core/runtime",on={en,zh:tn};let rn;const sn=Object.freeze({show:function(e){if(rn)return rn.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function an(e){const{search:t,pathname:n}=e,o=n?window.btoa(encodeURIComponent(n)):"",r=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${o}; path=/`,document.cookie=`SALOGINQUERY=${r}; path=/`}function ln(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return l.i18n.t(`${nn}:${Zt.NETWORK_ERROR}`);if(e instanceof R.HttpResponseError&&e.responseJson){if("string"==typeof e.responseJson.error)return e.responseJson.error;if("string"==typeof e.responseJson.msg)return e.responseJson.msg}return null==e?"Unknown error":e.toString()}function cn(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let un,dn,fn=!1;function pn(e){if(e instanceof R.HttpAbortError)return;if(cn(e)&&!window.NO_AUTH_GUARD){if(fn)return;return fn=!0,void sn.show({type:"confirm",content:l.i18n.t(`${nn}:${Zt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=xi().getFeatureFlags()["sso-enabled"],t=k();an(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),fn=!1}),(()=>{fn=!1}))}console.error(e);const t=ln(e);t!==un&&(un=t,sn.show({type:"error",title:l.i18n.t(`${nn}:${Zt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{un=void 0})))}const hn=Object.freeze({show:function(e){dn?dn.resolve(e):alert(e.message)}});class gn{static getInstance(){return gn.instance||(gn.instance=new gn),gn.instance}constructor(){(0,r.A)(this,"debugMode",!1),(0,r.A)(this,"debugType","none"),this.initDebugMode(),this.setupWindowAPI()}initDebugMode(){if("true"!==new URLSearchParams(window.location.search).get("__debugConsole__"))return"true"===localStorage.getItem("debugConsole")?(this.debugMode=!0,this.debugType="persistent",void console.log("🔧 调试模式已开启(持久模式 - 内部调试)")):"true"===sessionStorage.getItem("debugConsole")?(this.debugMode=!0,this.debugType="session",void console.log("🔧 调试模式已开启(会话模式 - 关闭标签页后失效)")):void 0;this.activateSessionDebug()}activateSessionDebug(){this.debugMode=!0,this.debugType="session",sessionStorage.setItem("debugConsole","true"),console.log("🔧 调试模式已通过URL参数激活(会话模式)")}setupWindowAPI(){window.debugConsole={enable:()=>(this.debugMode=!0,this.debugType="session",sessionStorage.setItem("debugConsole","true"),console.log("🔧 调试模式已开启(会话模式 - 关闭标签页后失效)"),this.debugMode),enablePersistent:()=>(this.debugMode=!0,this.debugType="persistent",localStorage.setItem("debugConsole","true"),console.log("🔧 调试模式已开启(持久模式 - 内部调试)"),this.debugMode),disable:()=>(this.debugMode=!1,this.debugType="none",sessionStorage.removeItem("debugConsole"),localStorage.removeItem("debugConsole"),console.log("🔧 调试模式已关闭"),this.debugMode),toggle:()=>(this.debugMode?(this.debugMode=!1,this.debugType="none",sessionStorage.removeItem("debugConsole"),localStorage.removeItem("debugConsole"),console.log("🔧 调试模式已关闭")):(this.debugMode=!0,this.debugType="session",sessionStorage.setItem("debugConsole","true"),console.log("🔧 调试模式已开启(会话模式 - 关闭标签页后失效)")),this.debugMode),togglePersistent:()=>(this.debugMode&&"persistent"===this.debugType?(this.debugMode=!1,this.debugType="none",sessionStorage.removeItem("debugConsole"),localStorage.removeItem("debugConsole"),console.log("🔧 调试模式已关闭")):(this.debugMode=!0,this.debugType="persistent",localStorage.setItem("debugConsole","true"),console.log("🔧 调试模式已开启(持久模式 - 内部调试)")),this.debugMode),status:()=>{const e={debugMode:this.debugMode,debugType:this.debugType,description:this.getStatusDescription()};return console.log("🔧 调试状态:",e),e},help:()=>{console.log("\n🔧 混合调试控制台使用说明:\n\n👥 生产环境使用(临时调试):\n window.debugConsole.enable() - 开启会话调试(关闭标签页后失效)\n window.debugConsole.disable() - 关闭调试模式\n window.debugConsole.toggle() - 切换会话调试模式\n\n👨‍💻 开发人员使用(长期调试):\n window.debugConsole.enablePersistent() - 开启持久调试(长期有效)\n window.debugConsole.togglePersistent() - 切换持久调试模式\n window.debugConsole.disable() - 关闭调试模式\n\n🔍 其他功能:\n window.debugConsole.status() - 查看当前状态\n window.debugConsole.help() - 显示此帮助信息\n\n🌐 URL参数:\n ?__debugConsole__=true - 通过URL激活会话调试模式\n\n📝 说明:\n - 会话模式:刷新页面后仍然有效,关闭标签页后失效\n - 持久模式:长期有效,除非手动关闭\n ")}},this.debugMode?console.log(`🔧 调试模式已开启(${"persistent"===this.debugType?"持久模式":"会话模式"})`):console.log("💡 提示:使用 window.debugConsole.help() 查看使用说明")}getStatusDescription(){if(!this.debugMode)return"调试模式已关闭";switch(this.debugType){case"persistent":return"持久模式 - 内部调试(长期有效)";case"session":return"会话模式 - 临时调试(关闭标签页后失效)";default:return"未知模式"}}isDebugMode(){return this.debugMode}getDebugType(){return this.debugType}shouldLog(e){return"error"===e||this.debugMode}}(0,r.A)(gn,"instance",void 0);const mn=gn.getInstance();function vn(e,t,n){t&&Object.entries(t).forEach((t=>{let[o,r]=t;const i=Sn(r,n,{element:e});e.addEventListener(o,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([o,i]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(r))e.$$eventListeners.push([o,null,t])}))}function bn(e){return"string"==typeof e.action}function yn(e){return"string"==typeof e.useProvider}function wn(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function En(e){return!!e.then}function Sn(e,t,n){return function(o){var r,i;for(const s of[].concat(e))if(Ot(s,{...t,event:o}))if(En(s))Sn(s.then,t,n)(o);else if(bn(s)){const[e,a]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":Cn(o,a,s.args,s.callback,t);break;case"window.open":Rn(o,s.args,t);break;case"window.postMessage":Tn(o,s.args,t);break;case"parent.postMessage":On(o,s.args,t);break;case"location.reload":case"location.assign":Bn(o,a,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Ln(o,e,a,s.args,t);break;case"event.preventDefault":o.preventDefault();break;case"event.stopPropagation":o.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":$n(o,a,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Nn(o,a,s.args,t);break;case"handleHttpError":pn(o.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":case"context.set":Pn(o,a,s.args,null===(r=s.batch)||void 0===r||r,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":case"state.set":Mn(o,a,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Dn(s.args,t,o);De(t,s.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":xn(o,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Un(o,a,s.args,t,n,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":{const[e]=Dn(s.args,t,o);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ae("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else yn(s)?An(o,s,t,n):wn(s)?kn(o,s,t,n):console.error("unknown event handler:",s);else s.else&&Sn(s.else,t,n)(o)}}function An(e,t,n,o){const r="saveAs"!==t.method?"resolve":"saveAs";In(e,t.useProvider,t,r,n,o)}function kn(e,t,n,o){let r=[];const i=t.target,s=t.targetRef;let a=i;if(("string"==typeof i?(0,T.isEvaluable)(i):pt(i))&&(a=It(i,{...n,event:e})),"string"==typeof a)if("_self"===a)r.push(o.element);else if(t.multiple)r=Array.from(document.querySelectorAll(a));else{const e=document.querySelector(a);null!==e&&r.push(e)}else if(a)a instanceof HTMLElement?r.push(a):console.error("unexpected target:",a);else if(s){let t=s;("string"==typeof s?(0,T.isEvaluable)(s):pt(s))&&(t=It(s,{...n,event:e}));const o=[].concat(t),i=De(n,"targetRef",`: ${o.join(", ")}`);r.push(...o.map((e=>{var t;return null===(t=i.$$getElementByRef)||void 0===t?void 0:t.call(i,e)})).filter(Boolean))}0!==r.length?function(e){return!!e.method}(t)?r.forEach((r=>{In(e,r,t,t.method,n,o,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&$t(r,t.properties,{...n,event:e}):console.error("target not found:",i||s)}async function In(e,t,n,o,r,i,s){const a=yn(n),l=async()=>{var i;const l=a?await ot(t):t;if("function"!=typeof l[o])throw new Error(`target <${l.tagName.toLowerCase()}> has no method: ${o}`);const c=yn(n);let u,d=c?function(e,t,n){return Array.isArray(e)?It(e,{...t,event:n}):e}(n.args,r,e):Dn(n.args,r,e,s);var f;return c&&null!=Pi&&null!==(i=Pi.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)?(!Array.isArray(n.args)&&n.params&&(d=It((0,h.pick)(n,"params","options","filename"),{...r,event:e})),u=await Pi.flowApi.getArgsOfFlowApi(n.useProvider,null!=d?d:[],o,null===(f=n.sse)||void 0===f?void 0:f.stream)):u=null!=d?d:[],l[o](...u)};if(!n.callback)return void l();const c=Fn(n.callback,r,i),u={progress:c("progress"),success:c("success"),error:c("error"),finally:c("finally")};if(a){var d,f;const t={...r,event:e};if(It(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:o,error:r,finally:i}=t;const s=Fi();try{const t=await e();for await(const e of t){if(s!==Fi())return;null==n||n(e)}if(s!==Fi())return;null==o||o()}catch(e){if(s!==Fi())return;null==r||r(e)}finally{null==i||i()}}(l,u);if(It(null===(f=n.poll)||void 0===f?void 0:f.enabled,t))return void function(e,t,n,o){let{progress:r,success:i,error:s,finally:a}=t;const{expectPollStopImmediately:l,expectPollEnd:c}=n,{interval:u,leadingRequestDelay:d,continueOnError:f,delegateLoadingBar:p}=It((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),o),g=Fi();let m;async function v(){let t;Qt.delete(m);try{var n;if(t=null===(n=It(l,o))||void 0===n?void 0:n(),t)null==a||a();else{var d;const n=await e(),s=null===(d=It(l,o))||void 0===d?void 0:d();var h;t=s||g!==Fi(),t?s&&(null==a||a()):(null==r||r(n),null!==(h=It(c,o))&&void 0!==h&&h(n)?(p&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==a||a()):b(null!=u?u:3e3))}}catch(e){var v;const n=null===(v=It(l,o))||void 0===v?void 0:v();t=n||g!==Fi(),t?n&&(null==a||a()):(null==s||s(e),f?b(null!=u?u:3e3):null==a||a())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}function b(e){m=setTimeout(v,e),Qt.add(m)}b(null!=d?d:0),p&&window.dispatchEvent(new Event("request.start"))}(l,u,n.poll,t)}try{const e=await l();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function Cn(e,t,n,o,r){let i=0,s=!1,a=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,s=!0;break;case"reload":s=!0;break;case"block":i=1,a="setBlockMessage"}let l=[];if(i>0&&(l=Dn(n,r,e,{useEventDetailAsDefault:!0}),l.length=i),s&&o){const e=Fn(o,r,void 0);l.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[a](...l)}function Rn(e,t,n){const[o,r,i]=Dn(t,n,e);window.open(o,r||"_self",i)}function Tn(e,t,n){const o=Dn(t,n,e);1===o.length&&o.push(location.origin),window.postMessage(...o)}function On(e,t,n){if(parent===window)throw new Error("parent is the window itself");const o=Dn(t,n,e);parent.postMessage(...o)}function _n(e,t,n,o,r,i){t?o.updateValues(e,n,(e=>Dn(e,r,i)[0])):e.forEach((e=>{const{name:t,value:s}=Dn([e],r,i)[0];o.updateValue(t,s,n)}))}function Pn(e,t,n,o,r,i){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[o,s]=Dn(n,i,e);i.ctxStore.updateValue(o,s,t,r,i)}else _n(n,o,t,i.ctxStore,i,e)}function Mn(e,t,n,o,r,i){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)_n(n,o,"replace",Fe(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[o,s]=Dn(n,i,e);Fe(i,`state.${t}`,`: ${o}`).updateValue(o,s,"update"===t?"replace":t,r,i)}}function xn(e,t,n,o){const[r,i]=Dn(t,o,e);tt(o,"formstate.update",`: ${r}`).updateValue(r,i,"replace",n,o)}function Bn(e,t,n,o){if("assign"===t){const[t]=Dn(n,o,e);location.assign(t)}else location[t]()}function Ln(e,t,n,o,r){const i="localStorage"===t?localStorage:sessionStorage,[s,a]=Dn(o,r,e);"setItem"===n?void 0!==a&&i.setItem(s,JSON.stringify(a)):i.removeItem(s)}function $n(e,t,n,o){mn.shouldLog(t)&&console[t](...Dn(n,o,e,{useEventAsDefault:!0}))}function Nn(e,t,n,o){const r=Dn(n,o,e,{useEventAsDefault:!0});hn.show({type:t,message:r[0]})}async function Un(e,t,n,o,r,i){const s=()=>{var r;const i=Dn(n,o,e);return null==Pi||null===(r=Pi.messageDispatcher)||void 0===r?void 0:r[t](...i)};if(!i)return void s();const a=Fn(i,o,r);try{const e=await s();a("success")(e)}catch(e){a("error")(e)}finally{a("finally")()}}function Fn(e,t,n){return function(o){return function(r){const i=null==e?void 0:e[o];if(i)try{const e=new CustomEvent(`callback.${o}`,{detail:r});Sn(i,t,n)(e)}catch(e){console.error(e)}else"error"===o&&console.error("Unhandled callback error:",r)}}}function Dn(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?It(e,{...t,event:n}):o.useEventAsDefault?[n]:o.useEventDetailAsDefault?[n.detail]:[]}function jn(e){var t;const{ref:n,runtimeContext:o,element:r}=e;if(!n||!o.tplStateStoreId)return;const{hostBrick:i}=Fe(o,"bindTemplateProxy"),s=i.tplHostMetadata;s.internalBricksByRef.set(n,e);const a=null===(t=s.proxy)||void 0===t?void 0:t.events;if(a)for(const[e,t]of Object.entries(a))if(t.ref===n){var l,c,u;const n=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},o=null!==(l=t.refEvent)&&void 0!==l?l:e;r.addEventListener(o,n),null!==(u=(c=r).$$proxyListeners)&&void 0!==u||(c.$$proxyListeners=[]),r.$$proxyListeners.push([o,n])}}function Kn(e){const{ref:t,runtimeContext:n,element:o}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:r}=Fe(n,"unbindTemplateProxy");r.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of null!==(i=o.$$proxyListeners)&&void 0!==i?i:[]){var i;o.removeEventListener(e,t)}delete o.$$proxyListeners}let Vn=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.ABSTRACT=3]="ABSTRACT",e}({});function Wn(e){e.replaceChildren()}function zn(e,t){e.mounted=!0,window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const o=[];for(;n;){if(n.mounted=!0,n.tag===Vn.BRICK){var r;const i=n.type;i.includes("-")&&!customElements.get(i)&&console.error(`Undefined custom element: ${i}`),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const s=t&&n===e.child?t:document.createElement(i);if(n.element=s,n.slotId&&s.setAttribute("slot",n.slotId),n.iid&&(s.dataset.iid=n.iid),null!==(r=n.tplHostMetadata)&&void 0!==r&&r.tplStateStoreId&&(s.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Lt(s,n.properties),vn(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=Fe({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),jn(n),n.portal)o.push(s);else if(n.return){let e=n.return;for(;e;){if(e.tag!==Vn.ABSTRACT){e.childElements||(e.childElements=[]),e.childElements.push(s);break}e=e.return}}}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var i;let e=n.return;for(;e;){var s;if(e.tag!==Vn.ABSTRACT&&e.childElements)e.tag===Vn.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===Vn.ROOT&&o.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...o),e.sibling)break;e=e.return}n=null===(i=e)||void 0===i?void 0:i.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const Gn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Hn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Jn=new WeakMap,Qn=new WeakMap,Zn=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakSet;class oo{constructor(e,t){var n;(0,I.A)(this,no),(0,r.A)(this,"scope",void 0),(0,r.A)(this,"unknownBricks",void 0),(0,r.A)(this,"renderId",void 0),(0,i.A)(this,qn,void 0),(0,i.A)(this,Xn,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,i.A)(this,Yn,new Map),(0,i.A)(this,Jn,void 0),(0,i.A)(this,Qn,new Map),(0,i.A)(this,Zn,void 0),(0,i.A)(this,eo,new WeakMap),(0,i.A)(this,to,new Map),this.scope=e,this.unknownBricks=null!==(n=null==t?void 0:t.unknownBricks)&&void 0!==n?n:"throw",(0,s.A)(qn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,s.A)(Zn,this,e)}memoizeMenuRequestNode(e,t){(0,a.A)(eo,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,a.A)(Zn,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,a.A)(eo,this).get(t);(0,a.A)(eo,this).set(t,n);let r,i=e.child;for(;i&&i!==o;)r=i,i=i.sibling;r?(r.sibling=n,n.sibling=null==o?void 0:o.sibling):e.child=n,await(0,a.A)(qn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,a.A)(qn,this).bailout(e)}reCatch(e,t){return(0,a.A)(qn,this).catch(e,t,!1,!0)}async didPerformIncrementalRender(e,t){let n=!1;const o=[];for(const{parentRoutes:r,callback:i}of[...(0,a.A)(to,this).values()].reverse()){const s=r[r.length-1];if(o.includes(s))continue;const a=await i(e,t);a&&o.push(...r.slice(0,-1)),!1!==a&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,a.A)(to,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...Gn,..."page"===this.scope?Hn:[]];for(const o of n){const n=t[o];n&&(0,a.A)(Xn,this)[o].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,a.A)(Qn,this).get(e);n?n.add(t):(0,a.A)(Qn,this).set(e,new Set([t]))}reRender(e,t,n){var o,r,i,s,a;if(e.tag!==Vn.ROOT&&e.disposed)return;const[l,c]=function(e){let t,n,o=e,r=0;for(;o;){if(o.tag===Vn.BRICK)o.portal?n=o:t=o;else if(o.child&&o.tag===Vn.ABSTRACT){o=o.child,r++;continue}if(r<=0)break;if(o.sibling)o=o.sibling;else{var i;let e=o.return;for(r--;e&&!e.sibling;)e=e.return,r--;if(r<=0)break;o=null===(i=e)||void 0===i?void 0:i.sibling}}return[t,n]}(n),u=null!==(o=l?null===(r=l.element)||void 0===r?void 0:r.nextSibling:null===(i=uo(n,!1))||void 0===i?void 0:i.element)&&void 0!==o?o:null,d=[];let f,p=c?null==c||null===(s=c.element)||void 0===s?void 0:s.nextSibling:null===(a=uo(n,!0))||void 0===a?void 0:a.element;for(;p&&(d.push(p),p instanceof HTMLElement&&"DIV"===p.tagName);)p=p.nextSibling;let h=e.child;for(;h&&h!==n;){if(h.sibling===n){f=h;break}h=h.sibling}const g=document.createDocumentFragment(),m=document.createDocumentFragment(),v={tag:Vn.ROOT,container:g,createPortal:m,child:t};for(h=t;h;)h.return=v,h=h.sibling;const[b,y]=fo(n);for((0,C.A)(no,this,ro).call(this,b),(0,C.A)(no,this,io).call(this,y),zn(v),f?f.sibling=t:e.child=t,t.sibling=n.sibling,(0,C.A)(no,this,so).call(this,y),(0,C.A)(no,this,so).call(this,b),h=t;h;)h.return=e,h=h.sibling;if(g.hasChildNodes()){const t=function(e){let t=e;for(;t.tag===Vn.ABSTRACT;)if(t=t.return,!t)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");return t}(e);var w,E;t.tag===Vn.ROOT?null===(w=t.container)||void 0===w||w.insertBefore(g,u):null===(E=t.element)||void 0===E||E.insertBefore(g,u)}if(m.hasChildNodes()){var S;let e=t;for(;e&&e.return;)e=e.return;if((null===(S=e)||void 0===S?void 0:S.tag)!==Vn.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const n="function"==typeof e.createPortal?e.createPortal():e.createPortal;let o=null;for(const e of d)if(n.contains(e)){o=e;break}n.insertBefore(m,o)}const[A]=fo(t);(0,C.A)(no,this,ao).call(this,A)}dispose(){for(const e of Object.values((0,a.A)(Xn,this)))e.length=0;for(const e of(0,a.A)(Yn,this).values()){for(const t of e)t.disconnect();e.length=0}(0,a.A)(Yn,this).clear(),(0,a.A)(Jn,this)&&(Ie.removeEventListener("change",(0,a.A)(Jn,this)),(0,s.A)(Jn,this,void 0)),(0,a.A)(Qn,this).clear(),(0,a.A)(to,this).clear(),(0,s.A)(eo,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(no,this,lo).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(no,this,lo).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(no,this,lo).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(no,this,lo).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(no,this,lo).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(no,this,lo).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,a.A)(Xn,this).onScrollIntoView)(0,C.A)(no,this,co).call(this,e,t)}initializeMediaChange(){(0,s.A)(Jn,this,(e=>{(0,C.A)(no,this,lo).call(this,"onMediaChange",new CustomEvent("media.change",{detail:H(e.detail)}))})),Ie.addEventListener("change",(0,a.A)(Jn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,a.A)(Xn,this).onMessage)for(const o of[].concat(n)){var t;null==Pi||null===(t=Pi.messageDispatcher)||void 0===t||t.onMessage(o.channel,(t=>{Sn(o.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==Pi||null===(e=Pi.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(no,this,lo).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(no,this,lo).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(no,this,lo).call(this,"onUnmount",new CustomEvent("unmount"))}}function ro(e){const t=[...Gn,..."page"===this.scope?Hn:[]],n=[];for(const o of t){const t=(0,h.remove)((0,a.A)(Xn,this)[o],(t=>e.has(t.brick)));"onUnmount"===o&&n.push(...t)}for(const t of e){var o,r,i;const e=(0,a.A)(Yn,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,a.A)(Yn,this).delete(t)}Kn(t),null===(o=t.element)||void 0===o||delete o.$$tplStateStore,null===(r=t.element)||void 0===r||r.remove(),null===(i=t.disposes)||void 0===i||i.forEach((e=>e())),delete t.disposes}const s=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)Sn(t,e.runtimeContext,e)(s)}function io(e){for(const n of e){var t;null===(t=n.disposes)||void 0===t||t.forEach((e=>e())),delete n.disposes}}function so(e){for(const t of e)delete t.child,delete t.sibling,delete t.return,t.disposed=!0,t.tag===Vn.BRICK&&(delete t.element,delete t.runtimeContext),Object.freeze(t)}function ao(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:o}of(0,a.A)(Xn,this).onMount)e.has(n)&&Sn(o,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,a.A)(Xn,this).onScrollIntoView)e.has(t)&&(0,C.A)(no,this,co).call(this,t,n)}function lo(e,t){for(const{brick:n,handlers:o}of(0,a.A)(Xn,this)[e])Sn(o,n.runtimeContext,n)(t);const n=(0,a.A)(Qn,this).get(e);if(n)for(const e of n)e()}function co(e,t){var n;const o=null!==(n=t.threshold)&&void 0!==n?n:.1,r=new IntersectionObserver(((n,r)=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=o&&(Sn(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),r.disconnect())}))}),{threshold:o});r.observe(e.element);let i=(0,a.A)(Yn,this).get(e);i||(i=[],(0,a.A)(Yn,this).set(e,i)),i.push(r)}function uo(e,t){let n=e;for(;n;){if(n!==e&&n.tag===Vn.BRICK&&(t?n.portal:!n.portal))return n;if(n!==e&&n.child&&n.tag===Vn.ABSTRACT)n=n.child;else if(n.sibling)n=n.sibling;else{var o;let e=n.return;for(;e;){if(e.tag!==Vn.ABSTRACT)return;if(e.sibling)break;e=e.return}n=null===(o=e)||void 0===o?void 0:o.sibling}}}function fo(e){const t=new Set,n=new Set;let o=e;for(;o;)if(o.tag===Vn.BRICK?t.add(o):o.tag===Vn.ABSTRACT&&n.add(o),o.child)o=o.child;else{if(o===e)break;if(o.sibling)o=o.sibling;else{var r;let i=o.return;for(;i;){if(i===e)return[t,n];if(i.sibling)break;i=i.return}o=null===(r=i)||void 0===r?void 0:r.sibling}}return[t,n]}const po=new Map;function ho(e){return po.get(e)}function go(e,t,n){const o=S();if(o)return o.doTransform(e,t,n);if(n)throw new Error("Legacy doTransform does not support options in v3");return It(t,{...Di(),data:e},{noInject:!0})}function mo(e,t,n,o,r,i){const s=S();if(s)return s.transformProperties(e,t,n,o,r,i);if(i)throw new Error("Legacy transformProperties does not support options in v3");const a=function(e,t,n,o){const r={},i=n?(0,h.get)(e,n):e;if(Array.isArray(t))for(const e of t)bo(r,i,e.to,e.from,e.mapArray);else bo(r,i,t,void 0,o);return r}(t,n,o,r);for(const[t,n]of Object.entries(a))(0,h.set)(e,t,n);return e}function vo(e,t,n,o){const r=n?(0,h.get)(e,n):e;return t?mo({},r,t,void 0,o):r}function bo(e,t,n,o,r){if(!n)return;let i=o?(0,h.get)(t,o):t,s=Array.isArray(i);if(s||!0!==r?s&&!1===r&&(s=!1):(s=!0,i=[i]),"string"!=typeof n)for(const[t,o]of Object.entries(n))e[t]=s?i.map((e=>go(e,o))):go(i,o);else e[n]=i}const yo=Symbol.for("root.runtimeContext");async function wo(e,t,n){var o,r,i,s;const[a,l,c]=gr({...null!==(o=e[yo])&&void 0!==o?o:Di(),data:t,pendingPermissionsPreCheck:[]});a.inUseBrick=!0,null!==(r=a.tplStateStoreMap)&&void 0!==r||(a.tplStateStoreMap=new Map),null!==(i=a.formStateStoreMap)&&void 0!==i||(a.formStateStoreMap=new Map);const u=new oo("fragment"),d={tag:Vn.ROOT,createPortal:null},f=Pe(),p=await fr(d,f&&!n?e:{errorBoundary:n,...e},a,u,[],{}),h=[...l,...c];let g;await hr(p,a,h);let m=p.node;for(;m;){if(m.tag===Vn.BRICK){g=m;break}m=m.child}if(null!==(s=g)&&void 0!==s&&s.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return d.child=p.node,{tagName:g?g.type:null,renderRoot:d,rendererContext:u,scopedStores:h}}function Eo(e,t){let n,{renderRoot:o,rendererContext:r,scopedStores:i}=e;o.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},zn(o,t),r.dispatchOnMount(),r.initializeScrollIntoView(),r.initializeMediaChange(),r.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function So(e,t){let{rendererContext:n}=e;t.portal&&(Wn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function Ao(e,t){const n=ji(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),B(n)}function ko(e,t){const n=ji(e);let o=!1;function r(e){e.forEach(((n,s)=>{"routes"===n.type?r(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(o=!0,e[s]=t):Array.isArray(n.bricks)&&i(n.bricks)}))}function i(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?r(t.routes):i(t.bricks)}))}r(n.routes),o||n.routes.unshift(t)}function Io(e,t,n){const o=`${e}.${t.name}`;Ne.define(o,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Co(e,t.name,n)}function Co(e,t,n){_o(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function Ro(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function To(e,t){var n;_o(e,Ro(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const Oo=To;function _o(e,t,n,o){const{routes:r}=ji(e),i=r.findIndex((e=>e.path===t)),s={path:t,bricks:n,context:o,menu:!1,exact:!0};-1===i?r.unshift(s):r.splice(i,1,s)}function Po(e,t){let{tplStateStoreId:n}=t;const o=Di();return n?Fe({...o,tplStateStoreId:n},"STATE").getValue(e):o.ctxStore.getValue(e)}function Mo(e){let{tplStateStoreId:t}=e;const n=Di();return t?Fe({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function xo(e){return Ni().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function Bo(e){return(0,c.loadBricksImperatively)(e,Ni())}function Lo(e,t){return(0,c.loadEditorsImperatively)(e,null!=t?t:Ni())}function $o(){return Fi()}async function No(e,t){let{appId:n,updateStoryboardType:o,collectUsedContracts:r}=t;const i=ji(n);let s;if("route"===o)s={routes:[e]};else if("template"===o)s={meta:{customTemplates:[e]}};else if("snippet"===o){var a;const t=Ro(e.snippetId);s={routes:[null==i||null===(a=i.routes)||void 0===a?void 0:a.find((e=>e.path===t))]}}const l=[];return s&&r&&(await r(s)).forEach((e=>{var t;const[n,o,r]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===o&&e.name===r))||l.push(e)})),l}async function Uo(e,t){let{tplStateStoreId:n,routeId:o}=t;const r={...Di(),tplStateStoreId:n,match:ho(o)};return e.resolve?lt(e.resolve,r,{cache:"reload"}):kt(e.value,r)}function Fo(e){var t;const n=Di();return{app:null!==(t=null==n?void 0:n.overrideApp)&&void 0!==t?t:null==n?void 0:n.app,location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(n,["query","sys"]),match:ho(null==e?void 0:e.routeId)}}let Do;const jo=[];function Ko(e){Do=e;const t=Mo({tplStateStoreId:e.tplStateStoreId});Wo({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Vo(e){jo.push(e)}function Wo(e){setTimeout((()=>{for(const t of jo)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const zo=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Go{constructor(e,t,n,o){(0,r.A)(this,"type",void 0),(0,r.A)(this,"data",new Map),(0,r.A)(this,"changeEventType",void 0),(0,r.A)(this,"pendingStack",[]),(0,r.A)(this,"hostBrick",void 0),(0,r.A)(this,"stateStoreId",void 0),(0,r.A)(this,"batchUpdate",!1),(0,r.A)(this,"batchUpdateContextsNames",[]),(0,r.A)(this,"rendererContext",void 0),(0,r.A)(this,"routeMap",new WeakMap),(0,r.A)(this,"routeStackMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=o}has(e){return this.data.has(e)}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Do){const{tplStateStoreId:n}=Do;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Wo({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const o={},r={},i=[];e.forEach((e=>{const{name:r,value:s}=n([e]),a=this.data.get(r);i.push(...this.getAffectListByContext(r)),a&&(o[r]=a),this.updateValue(r,s,t)})),i.filter((e=>!o[e])).forEach((e=>{const t=this.data.get(e);t&&(r[e]=t)}));const s=e=>{for(const n in e){var t;const o=e[n];null===(t=o.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:o.value}))}};s(o),s(r),this.batchUpdate=!1}updateValue(e,t,n,o,r){const i=this.data.get(e);if(!i)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n){if("replace"===n)i.value=t;else if("assign"===n)(0,u.isObject)(i.value)?Object.assign(i.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),i.value=t);else{let e=t;if("function"==typeof t&&(e=t(i.value)),Object.is(i.value,e))return;i.value=e}this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}))}else{if(!i.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let s;"load"===n&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));const a=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==Fi()};if(s||(s=i.loading=i.load({cache:"load"===n?"default":"reload",...t}),s.then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||a(e)||null!=o&&o.error||pn(e)}))),o){const e=Fn(o,r);s.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!a(t)&&o.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,o){if(Array.isArray(e)&&e.length>0){const r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const o=new Map;for(const r of e){const e=[r.if,r.value,r.resolve],i=(0,O.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,O.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)i.usedProperties.add(e);t.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}o.set(r,i)}return o}(e,n,arguments.length>3?arguments[3]:void 0),r=new Map;for(const e of Array.from(o.keys()).map((e=>e.name))){var i;r.set(e,(null!==(i=r.get(e))&&void 0!==i?i:0)+1)}const s=Array.from(o.values()).some((e=>e.hasNonStaticUsage)),a=new WeakSet,l=new Map,c=new Map([...new Set(e.map((e=>e.name)))].map((e=>{const t=new Promise(((t,n)=>{l.set(e,{resolve:t,reject:n})}));return t.catch((()=>{})),[e,t]}))),u=async e=>{var n;a.add(e);const i=await t(e);o.delete(e);const s=null!==(n=r.get(e.name))&&void 0!==n?n:0;if(i){if(l.get(e.name).resolve(),r.delete(e.name),0===s)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===s?(l.get(e.name).resolve(),r.delete(e.name)):r.set(e.name,s-1);await f()};let d=s;async function f(){const e=Array.from(o.entries()).filter(function(e,t){return(n,o)=>t?0===o:![...n[1].usedProperties].some((t=>e.has(t)))}(r,d)).map((e=>e[0])).filter((e=>!a.has(e)));await Promise.all(e.map(u))}const p=f().then((async()=>{o.size>0&&(function(e,t){const n=new Map(e),o=new Set(Array.from(n.keys()).map((e=>e.name))),r=()=>{let e=!1;for(const[t,r]of n.entries())[...r.usedProperties].some((e=>o.has(e)))||(n.delete(t),o.delete(t.name),e=!0);e&&r()};if(r(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(o,n),d=!0,await f());for(const e of l.values())e.resolve()})).catch((e=>{for(const t of l.values())t.reject(e);throw e}));return p.catch((()=>{})),{pendingResult:p,pendingContexts:c}}(e,(e=>this.resolve(e,t,n,o)),this.type,Pe(t));if(Array.isArray(o))for(const e of o){const t=this.routeStackMap.get(e);t?t.add(r):this.routeStackMap.set(e,new Set([r]))}this.pendingStack.push(r)}}onChange(e,t){var n;const o=null===(n=this.data.get(e))||void 0===n?void 0:n.eventTarget;return null==o||o.addEventListener(this.changeEventType,t),()=>{null==o||o.removeEventListener(this.changeEventType,t)}}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,o){if(!await Tt(e,t))return!1;let r,i,s,a,l,c;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(r=await xt(n,e.name)),void 0===r){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");l=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,O.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const o={transform:"value",...e.resolve};if(a=await Tt(e.resolve,t),(a||l)&&(i=async e=>{var n;return(await lt(o,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),a)c=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===c?r=await i():"async"===c&&(s=i());else if(!n)return!1}a&&"eager"===c||void 0===e.value||(r=await kt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:r,eventTarget:new Se,useResolve:a,load:i,loaded:"eager"===c,loading:s,async:"async"===c,deps:[]};if("lazy"===c){const{trigger:t}=e.resolve;var f;t&&zo.includes(t)&&(null===(f=this.rendererContext)||void 0===f||f.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,Sn(e.onChange,t)),e.track){const n=(0,O.strictCollectMemberUsage)(l?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(d.deps=[...n]);for(const o of n)this.onChange(o,this.batchAddListener((()=>{d.useResolve=l?Ot(e.resolve,t):!!i,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,It(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),Array.isArray(o))for(const t of o){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e){for(const t of e)this.data.delete(t);this.routeMap.delete(t)}const n=this.routeStackMap.get(t);void 0!==n&&((0,h.pull)(this.pendingStack,...n),this.routeStackMap.delete(t))}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function Ho(e,t,n,o){const{reversedProxies:r,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:a,hostBrick:l}=e;let c;if(t&&r){const e=r.properties.get(t);e&&(m=i,c=e.map((e=>{let{from:t,to:n}=e;const o=m.filter((e=>e[0]===t));if(o.length>0&&n.refProperty)return[n.refProperty,xt(o,t),!0]})).filter(Boolean));const a=r.slots.get(t);if(a&&o)throw new Error(`Can not have proxied slot ref when the ref target has a slot element child, check your template "${l.type}" and ref "${t}"`);if(a&&s){const e=new Map;for(const{from:t,to:o}of a){var d,f,p,g;const r=null!==(d=null===(f=s[t])||void 0===f?void 0:f.bricks)&&void 0!==d?d:[];if(!r.length)continue;const i=null!==(p=o.refSlot)&&void 0!==p?p:t;let a=e.get(i);if(!a){a=[];const t=(0,u.hasOwnProperty)(n,i)?n[i].bricks.length+1:1;for(let e=0;e<t;e+=1)a.push([]);e.set(i,a)}const c=null!==(g=o.refPosition)&&void 0!==g?g:-1,m=(0,u.hasOwnProperty)(l.runtimeContext,"forEachItem");a[(0,h.clamp)(c<0?a.length+c:c,0,a.length-1)].push(...m?qo(r,l.runtimeContext.forEachItem,l.runtimeContext.forEachIndex,l.runtimeContext.forEachSize):r)}for(const[t,o]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=o.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var m;return{[Ht]:c,[qt]:a}}function qo(e,t,n,o){return e.map((e=>{var r;let{children:i,slots:s,...a}=e;return{...a,[Xt]:t,[Yt]:n,[Jt]:o,slots:":forEach"===a.brick?br(i,s):Object.fromEntries(Object.entries(null!==(r=br(i,s))&&void 0!==r?r:{}).map((e=>{let[r,i]=e;return[r,"routes"===i.type?{type:"routes",routes:Xo(i.routes,t,n,o)}:{type:"bricks",bricks:qo(i.bricks,t,n,o)}]})))}}))}function Xo(e,t,n,o){return e.map((e=>"routes"===e.type?{...e,routes:Xo(e.routes,t,n,o)}:"redirect"===e.type?e:{...e,bricks:qo(e.bricks,t,n,o)}))}function Yo(e,t,n){var o,r,i,s;if(null!=e.if&&!e.if||"string"==typeof e.if)throw new Error(`Can not use "if" in a slot currently, check your template "${t.hostBrick.type}"`);const a=String(null!==(o=null===(r=e.properties)||void 0===r?void 0:r.name)&&void 0!==o?o:"");if((0,T.isEvaluable)(a))throw new Error(`Can not use an expression as slot name "${a}" currently, check your template "${t.hostBrick.type}"`);if(t.usedSlots.has(a))throw new Error(`Can not have multiple slots with the same name "${a}", check your template "${t.hostBrick.type}"`);if(t.usedSlots.add(a),t.externalSlots&&(0,u.hasOwnProperty)(t.externalSlots,a)){var l;const e=null!==(l=t.externalSlots[a].bricks)&&void 0!==l?l:[];if(e.length>0){const n=t.hostBrick.runtimeContext;return(0,u.hasOwnProperty)(n,"forEachItem")?qo(e,n.forEachItem,n.forEachIndex,n.forEachSize):e}}const c=br(e.children,e.slots);return(null!==(i=null==c||null===(s=c[""])||void 0===s?void 0:s.bricks)&&void 0!==i?i:[]).flatMap((e=>n(e,t)))}function Jo(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return(0,u.isObject)(r)&&"useBrick"===t?Array.isArray(r)?[t,r.flatMap((e=>o(e)))]:[t,o(r)]:[t,n(r)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function o(e,r){if("slot"===e.brick)return null==r||r(),Yo(e,t,(e=>o(e)));const{properties:i,slots:s,children:a,...l}=e,c=br(a,s);let u=!1;const d=()=>{u=!0},f=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t;let[n,r]=e;return[n,{type:"bricks",bricks:(null!==(t=r.bricks)&&void 0!==t?t:[]).flatMap((e=>o(e,d)))}]})));return{...l,properties:n(i),slots:f,...Ho(t,l.ref,f,u)}}return n(e)}function Qo(e,t,n){if(null===e.if&&delete e.if,"slot"===e.brick)return null==n||n(),Yo(e,t,Qo);const{properties:o,slots:r,children:i,...s}=e,a=br(i,r);let l=!1;const c=()=>{l=!0},u=Object.fromEntries(Object.entries(null!=a?a:{}).map((e=>{var n;let[o,r]=e;return[o,{type:"bricks",bricks:(null!==(n=r.bricks)&&void 0!==n?n:[]).flatMap((e=>Qo(e,t,c)))}]})));return{...s,properties:Jo(o,t),slots:u,...Ho(t,s.ref,u,l)}}const Zo="form-renderer.form-renderer",er=Symbol.for("form.stateStoreId"),tr=["forms.general-form","form.general-form","eo-form"];function nr(e,t,n){const{id:o,bricks:r,events:i,context:s,mountPoint:a,instanceId:l}=e;let{brick:c,properties:d}=e;const f=t.find((e=>e.fieldId===o));if(f){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},o=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...o(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...o()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...o(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...o(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...o(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...o(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...o(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...o()}};break;default:t={brick:"forms.general-input",properties:{...n,...o(),placeholder:e.description}}}return t}(f);c||(c=e.brick),d={...e.properties,...d}}const p={brick:c,properties:d,iid:l,slot:a,events:i,context:s,children:or(r,t,n),[er]:n};return(0,u.hasOwnProperty)(e,"if")&&(p.if=e.if),p}function or(e,t,n){if(Array.isArray(e))return e.map((e=>nr(e,t,n)))}var rr=new WeakSet;class ir extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,rr),(0,r.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(rr,this,sr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(rr,this,sr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(rr,this,sr).call(this,"resetFields",t)}getFieldsValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,C.A)(rr,this,sr).call(this,"getFieldsValue",t)}}function sr(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,i=null==r||null===(n=r.tagName)||void 0===n?void 0:n.toLowerCase();if(tr.includes(i))return r[e](...o);console.error(`no ${e} method in the container element`,{container:i})}class ar extends Error{constructor(e){super(e),this.name="PageError",Error.captureStackTrace&&Error.captureStackTrace(this,c.BrickLoadError)}}async function lr(e,t,n){const{title:o,variant:r,showLink:i,showDescription:s}=function(e){var t,n;return e instanceof ar?"page blocked"===e.message?{showLink:"home",title:l.i18n.t(`${nn}:${Zt.LICENSE_BLOCKED}`),variant:"no-permission"}:"app not found"===e.message?{showLink:"home",title:l.i18n.t(`${nn}:${Zt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:l.i18n.t(`${nn}:${Zt.PAGE_NOT_FOUND}`)}:e instanceof c.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement?{showDescription:!0,title:l.i18n.t(`${nn}:${Zt.NETWORK_ERROR}`),variant:"internet-disconnected",showLink:"reload"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:l.i18n.t(`${nn}:${Zt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:l.i18n.t(`${nn}:${Zt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:l.i18n.t(`${nn}:${Zt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){var a;const n=null!==(a=Ui().error)&&void 0!==a?a:"illustrations.error-message";if(!1!==n){const a="eo-link",l=(i?[n,a]:[n]).filter((e=>!customElements.get(e)));try{await Promise.race([(0,c.loadBricksImperatively)(l,Ni()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const u={tag:Vn.BRICK,type:n,properties:{errorTitle:o,description:s?ln(e):void 0,variant:r,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return i&&(u.child=cr(i,a,u,"")),u}catch(e){console.error("Failed to load brick:",l.join(", "),e)}}}const u=n&&!!customElements.get("easyops-default-error"),d={tag:Vn.BRICK,type:u?"easyops-default-error":"div",properties:{errorTitle:o,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t},f={tag:Vn.BRICK,type:"div",properties:{textContent:u?s?ln(e):"":s?`${o}: ${ln(e)}`:o},runtimeContext:null,return:d};return d.child=f,n&&i&&(f.sibling=cr(i,"a",d,u?"link":"")),d}function cr(e,t,n,o){return{tag:Vn.BRICK,type:t,slotId:o,properties:{textContent:"home"===e?l.i18n.t(`${nn}:${Zt.GO_BACK_HOME}`):"reload"===e?l.i18n.t(`${nn}:${Zt.RELOAD}`):l.i18n.t(`${nn}:${Zt.GO_BACK_TO_PREVIOUS_PAGE}`),href:"home"===e?p():"reload"===e?location.href:void 0},events:"previous"===e?{click:{action:"history.goBack"}}:void 0,runtimeContext:null,return:n}}async function ur(e,t,n,o,r,i,s,a,l){const u=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=Gt(n,t.app.homepage,t.location.pathname);if(e&&await Tt(n,t))return t.app.noAuthGuard||n.public||null==Pi||!Pi.auth||Pi.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),d={blockingList:[]},f=d.menuRequestNode={return:i};switch(u){case"missed":break;case"unauthenticated":d.unauthenticated=!0;break;default:{var p;const i=d.route=u.route;d.path=u.match.path;const m={...n,match:u.match};i.iid&&(h=i.iid,g=u.match,po.set(h,g)),a&&m.ctxStore.disposeDataInRoutes(t);const v=r.concat(i);m.ctxStore.define(i.context,m,void 0,v),m.pendingPermissionsPreCheck.push(null==Pi||null===(p=Pi.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(i,(e=>kt(e,m))));const{preLoadBricks:b}=i;if(Array.isArray(b)&&d.blockingList.push((0,c.loadBricksImperatively)(b,Ni())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await kt(i.redirect,m):(await lt({transform:"redirect",...i.redirect},m)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);d.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return kt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,m);n&&(f.request=n),a||o.memoizeMenuRequestNode(t,f);const r=(0,O.strictCollectMemberUsage)(i.context,"PROCESSORS",2);let u;r.size>0&&d.blockingList.push(yr((0,c.loadProcessorsImperatively)(r,Ni()),"processors",[...r].join(", "),o.unknownBricks)),u="routes"===i.type?await ur(e,i.routes,m,o,v,f,s,void 0,l):await dr(e,i.bricks,m,o,v,f,s,void 0,l),mr(d,u),vr(f,u.menuRequestNode)}}}var h,g;return d}async function dr(e,t,n,o,r,i,s,a,l){!function(e,t){function n(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(n);else for(const[t,r]of Object.entries(e))(0,u.isObject)(r)&&"useBrick"===t?Array.isArray(r)?r.forEach((e=>o(e,!0))):o(r,!0,!0):n(r)}function o(e,r,i){if(r&&(e[yo]=t),n(e.properties),!i)return;const s=br(e.children,e.slots);for(const e of Object.values(null!=s?s:{}))for(const t of null!==(a=e.bricks)&&void 0!==a?a:[]){var a;o(t,r)}}for(const t of e)o(t)}(t,n);const c={blockingList:[]};return(await Promise.all(t.map((t=>fr(e,t,n,o,r,i,s,a&&new Map(a),l))))).forEach((e=>{mr(c,e)})),c}async function fr(e,t,n,o,r,i,s){let a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,l=arguments.length>8?arguments[8]:void 0;try{return await async function(e,t,n,o,r,i,s,a,l){var d;const f={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;const{if:p,permissionsPreCheck:g,...v}=t;if(function(e){return"string"==typeof e?(0,T.isTrackAll)(e):pt(e)&&(0,T.isTrackAll)(ht(e))}(p))return fr(e,{brick:":if",iid:t.iid,dataSource:p,permissionsPreCheck:g,slots:{"":{type:"bricks",bricks:[v]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,o,r,i,s,a,l);const b=t[qt],y=t[er],w={...n,tplStateStoreId:b,formStateStoreId:y};(0,u.hasOwnProperty)(t,Xt)&&(w.forEachItem=t[Xt],w.forEachIndex=t[Yt],w.forEachSize=t[Jt]);const E=Pe(w),{context:S}=t;if(Array.isArray(S)&&S.length>0&&(Me(E,"Defining context on bricks","check your brick:",t),E||w.ctxStore.define(S,w)),w.pendingPermissionsPreCheck.push(null==Pi||null===(d=Pi.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(t,(e=>kt(e,w)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!pt(e.if)?_t(await lt(e.if,t)):Tt(e,t)}(t,w))return f;const A=t.brick;if(A.startsWith(":")){var k;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(A);const{dataSource:n}=t,{contextNames:l,stateNames:c}=Mt(n),d=!(!l&&!c),f=async(d,f,p)=>{var h;const g=await kt(n,d);p&&Nt(d,[{contextNames:l,stateNames:c,propValue:n}],f);const m=":forEach"===A?"":":switch"===A?String(g):g?"":"else",v=br(t.children,t.slots),b=v&&(0,u.hasOwnProperty)(v,m)&&(null===(h=v[m])||void 0===h?void 0:h.bricks),y={blockingList:[]},w={tag:Vn.ABSTRACT,return:e,iid:t.iid};if(y.node=w,!Array.isArray(b))return y;let E;switch(A){case":forEach":if(!Array.isArray(g))break;E=await async function(e,t,n,o,r,i,s,a,l,c){const u={blockingList:[]},d=t.length,f=await Promise.all(t.map(((t,u)=>Promise.all(n.map((n=>fr(e,n,{...o,forEachItem:t,forEachIndex:u,forEachSize:d},r,i,s,a,l&&new Map(l),c)))))));return f.flat().forEach((e=>{mr(u,e)})),u}(w,g,b,d,o,r,i,s,a,f);break;case":if":case":switch":E=await dr(w,b,d,o,r,i,s,a,f)}return E&&(w.child=E.node,mr(y,{...E,node:void 0})),y},p=async e=>{let{type:n,runtimeContext:o,tplStateStoreScope:r,formStateStoreScope:i}=e,s=!1;const a={disposes:[],listener:()=>{s=!0}};let l,c=0,u=!0;for(;u||s;){if(s=!1,l=await f(o,a,u&&"initial"===n),!s&&"rerender"===n){const e=[...r,...i];await hr(l,o,[o.ctxStore,...e])}if(a.disposes.forEach((e=>e())),a.disposes.length=0,u=!1,++c>10)throw new Error(`Maximum rerender stack overflowed (iid: ${t.iid})`)}return l};let g=await p({type:"initial",runtimeContext:w});const{onMount:m,onUnmount:v}=null!==(k=t.lifeCycle)&&void 0!==k?k:{};if(d){var I;let t=0;const r=async()=>{if(!e.mounted||e.disposed)return;const n=++t,[r,i,s]=gr(w),a=await p({type:"rerender",runtimeContext:r,tplStateStoreScope:i,formStateStoreScope:s});if(t===n&&e.mounted&&!e.disposed){v&&Sn(v,w)(new CustomEvent("unmount",{detail:{rerender:!0}})),o.reRender(e,a.node,g.node),g=a,m&&Sn(m,r)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of[...i,...s])e.mountAsyncData()}},i=(0,h.debounce)(r,0,{leading:!0,trailing:!0}),s=e.tag===Vn.ROOT?null:e,a=s?null!==(I=s.disposes)&&void 0!==I?I:s.disposes=[]:[];if(l)for(const e of l)a.push(w.ctxStore.onChange(e,i));if(c)for(const e of c){const t=Fe(w,"STATE",`: "${n}"`);a.push(t.onChange(e,i))}}return m&&o.registerArbitraryLifeCycle("onMount",(()=>{Sn(m,w)(new CustomEvent("mount",{detail:{rerender:!1}}))})),v&&o.registerArbitraryLifeCycle("onUnmount",(()=>{Sn(v,w)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),g}/\.tpl-/.test(A)&&!Ne.get(A)&&await yr((0,c.loadBricksImperatively)([A],Ni()),"brick",A,o.unknownBricks);const C=function(e,t){if(t.isolatedRoot){const n=Ue.get(t.isolatedRoot);return!(null==n||!n.get(e))&&e}if(!e.includes(".")&&e.startsWith("tpl-")&&t.app){const n=`${t.app.id}.${e}`;if(Ne.get(n))return n}return!!Ne.get(e)&&e}(A,w);if(C){var R;const e=null!==(R=a.get(C))&&void 0!==R?R:0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${C}"`);a.set(C,e+1)}else A.includes("-")&&!customElements.get(A)&&(A===Zo?customElements.get(Zo)||customElements.define(Zo,ir):f.blockingList.push(yr((0,c.enqueueStableLoadBricks)([A],Ni()),"brick",A,o.unknownBricks)));let _,P;if(A===Zo){var M,x;({formData:_,...P}=null!==(M=t.properties)&&void 0!==M?M:{}),null!==(x=t.properties)&&void 0!==x&&x.compute&&(_=await kt(_,w))}else{if(w.inUseBrick){const e=t.transform;e&&(Me(E,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',t),E||(P={...t.properties,...e}))}null!=P||(P=t.properties)}const B=[],L=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[o,r]=e;const{contextNames:i,stateNames:s,formStateNames:a}=Mt(r);return(i||s||a)&&n.push({contextNames:i,stateNames:s,formStateNames:a,propName:o,propValue:r}),[o,kt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===o?wt.USE_BRICK:wt.INITIAL})]})):[]}(P,w,B),$=t[Ht];$&&L.push(...$);const N="script"===A;if(N||"link"===A){const e=await Bt(L);if(N?e.src:"stylesheet"===e.rel&&e.href){var U;const t=null!==(U=window.PUBLIC_ROOT)&&void 0!==U?U:"";if(N){const{src:n,...o}=e;await yr((0,c.loadScript)(n,t,o),"script",n,"silent")}else{const{href:n,...o}=e;await yr((0,c.loadStyle)(n,t,o),"stylesheet",n,"silent")}return f}}const F={tag:Vn.BRICK,type:C||A,return:e,slotId:s,events:t.events,runtimeContext:w,portal:t.portal,iid:t.iid,ref:t.ref};f.node=F;const D=(0,O.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);D.size>0&&f.blockingList.push(yr((0,c.loadProcessorsImperatively)(D,Ni()),"processors",[...D].join(", "),o.unknownBricks));const j=[];Nt(w,B,l);j.push((async()=>{F.properties=await Bt(L),function(e,t){for(const o of t){var n;const t=()=>{e.element&&$t(e.element,{[o.propName]:o.propValue},e.runtimeContext)};if(null!==(n=e.disposes)&&void 0!==n||(e.disposes=[]),o.contextNames)for(const n of o.contextNames)e.disposes.push(e.runtimeContext.ctxStore.onChange(n,t));if(o.stateNames){const n=Fe(e.runtimeContext,"STATE",`: "${o.propValue}"`);for(const r of o.stateNames)e.disposes.push(n.onChange(r,t))}if(o.formStateNames){const n=tt(e.runtimeContext,"FORM_STATE",`: "${o.propValue}"`);for(const r of o.formStateNames)e.disposes.push(n.onChange(r,t))}}}(F,B)})()),o.registerBrickLifeCycle(F,t.lifeCycle);let K,V=t;C?V=function(e,t,n,o,r){var i;const s=(0,h.uniqueId)("tpl-state-"),a={...n.runtimeContext,tplStateStoreId:s};delete a.forEachItem,delete a.forEachIndex,delete a.forEachSize,delete a.formStateStoreId;const l=new Go("STATE",n,r,s);a.tplStateStoreMap.set(s,l),a.tplStateStoreScope&&a.tplStateStoreScope.push(l);const{bricks:c,proxy:u,state:d,contracts:f}=n.runtimeContext.isolatedRoot?Ue.get(n.runtimeContext.isolatedRoot).get(e):Ne.get(e);null==Pi||null===(i=Pi.flowApi)||void 0===i||i.collectWidgetContract(f),l.define(d,a,o);const{slots:p,children:g,...m}=t,v={...m,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const b={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=b.properties.get(t.ref);n||(n=[],b.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=b.slots.get(t.ref);n||(n=[],b.slots.set(t.ref,n)),n.push({from:e,to:t})}const y={reversedProxies:b,asyncHostPropertyEntries:o,externalSlots:br(g,p),tplStateStoreId:s,hostBrick:n,usedSlots:new Set};return v.slots={"":{type:"bricks",bricks:c.flatMap((e=>Qo(e,y)))}},v}(C,t,F,L,o):A===Zo&&(V=function(e,t,n,o,r){var i,s;const a="string"==typeof e?JSON.parse(e):e,l=(0,h.uniqueId)("form-state-"),c={...n.runtimeContext,formStateStoreId:l};delete c.forEachItem,delete c.forEachIndex,delete c.forEachSize,delete c.tplStateStoreId;const d=new Go("FORM_STATE",void 0,r,l);c.formStateStoreMap.set(l,d),c.formStateStoreScope&&c.formStateStoreScope.push(d);const f=null!==(i=a.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,c,o);const p=nr(a.formSchema,a.fields,l);return tr.includes(p.brick)&&t.events&&(p.events=function(e,t){const n=null!=e?e:{};for(const[e,o]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],o].flat():o;return n}(p.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[p]}]}:{...t,slots:void 0,children:[p]}}(_,t,F,L,o)),V.portal&&(F.slotId=void 0),C?(K={...w},delete K.forEachItem,delete K.forEachIndex,delete K.forEachSize):K=w;return j.push((async()=>{const e=br(V.children,V.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map((async(e,n)=>{let[s,c]=e;if("routes"!==c.type)return dr(F,c.bricks,K,o,r,i,s,a,l);let u={blockingList:[]};const d={tag:Vn.ABSTRACT,return:F};u.node=d;const p=r[r.length-1];null!=p&&p.incrementalSubRoutes&&(t.set(n,s),o.performIncrementalRender(c,r,(async(e,t)=>{const{homepage:n}=K.app,{pathname:a}=e;if(!m(n,a)||!r.every((e=>{let o,r;return(o=Gt(e,n,t.pathname))&&(r=Gt(e,n,a))&&(e!==p||function(e,t){if((0,h.isEqual)(e,t))return!0;const n=(e,t)=>String(Number(t))===t,o=(0,h.omitBy)(e,n),r=(0,h.omitBy)(t,n);return(0,h.isEqual)(o,r)}(o.params,r.params))})))return!1;ct();const[l,d,f]=gr({...K,location:e,query:new URLSearchParams(e.search)});let g,v=!1,b=[];const y={blockingList:[]},w={tag:Vn.ABSTRACT,return:F};y.node=w;try{if(g=await ur(w,c.routes,l,o,r,i,s,!0),g.route){if(o.reBailout(g))return!0;b=[...d,...f],await hr(g,l,[l.ctxStore,...b])}}catch(e){console.error("Incremental sub-router failed:",e);const t=await o.reCatch(e,w);if(!t)return!0;({failed:v,output:g}=t)}if(F.disposed)return!0;if(w.child=g.node,mr(y,{...g,node:void 0}),await o.reMergeMenuRequestNodes(i,c.routes,g.menuRequestNode),o.reRender(F,w,u.node),u=y,!v){l.ctxStore.mountAsyncData(g.route);for(const e of b)e.mountAsyncData()}return!0})));const g=await ur(d,c.routes,K,o,r,i,s,void 0,l);return d.child=g.node,mr(f,{...g,node:void 0}),vr(i,f.menuRequestNode=g.menuRequestNode),u}))),s={...f,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach((e=>{mr(s,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(s,e)})),s.node&&(F.child=s.node),mr(f,{...s,node:void 0}),vr(i,f.menuRequestNode=s.menuRequestNode)})()),await Promise.all(j),f}(e,t,n,o,r,i,s,a,l)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await lr(n,e),blockingList:[]};throw n}}function pr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function hr(e,t,n){return(0,c.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function gr(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function mr(e,t){const{blockingList:n,node:o,menuRequestNode:r,...i}=t;if(e.blockingList.push(...n),o)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=o}else e.node=o;Object.assign(e,i)}function vr(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function br(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...o}of e){const e=null!=t?t:"",r=wr(o)?"routes":"bricks";if((0,u.hasOwnProperty)(n,e)){const t=n[e];if(t.type!==r)throw new Error(`Slot "${e}" conflict between bricks and routes.`);t[r].push(o)}else n[e]={type:r,[r]:[o]}}}return n}function yr(e,t,n,o){return"silent"===o?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}function wr(e){return!!e.path&&!e.brick}let Er,Sr,Ar;function kr(){if(!Er){if(Er={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){Er.isInIframe=!0;try{if(window.origin===window.parent.origin){Er.isInIframeOfSameSite=!0;const e="/next/"===p(),t=window.parent.location.pathname,n=t.startsWith("/next/");Er.isInIframeOfNext=!(Number(e)^Number(n));const o=n?"/next":"";Er.isInIframeOfVisualBuilder=t.startsWith(`${o}/visual-builder/`)||t.startsWith(`${o}/visual-builder-`),Er.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(Er)}return Er}function Ir(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Ne.define(n,t)}}function Cr(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const Rr="basic.show-watermark";function Tr(e){return!!e&&(e instanceof c.BrickLoadError||e instanceof R.HttpFetchError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement)}const Or="reload-for-error-count",_r=2;function Pr(e){if(/upchat/i.test(navigator.userAgent)&&Tr(e)){var t;const e=+(null!==(t=sessionStorage.getItem(Or))&&void 0!==t?t:0);if(e<_r)return sessionStorage.setItem(Or,String(e+1)),!0;Mr()}return!1}function Mr(){sessionStorage.removeItem(Or)}var xr=new WeakMap,Br=new WeakMap,Lr=new WeakMap,$r=new WeakMap,Nr=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,Dr=new WeakMap,jr=new WeakMap,Kr=new WeakMap,Vr=new WeakMap,Wr=new WeakMap,zr=new WeakSet;class Gr{constructor(e){(0,I.A)(this,zr),(0,i.A)(this,xr,void 0),(0,i.A)(this,Br,!1),(0,i.A)(this,Lr,void 0),(0,i.A)(this,$r,void 0),(0,i.A)(this,Nr,void 0),(0,i.A)(this,Ur,new Set),(0,i.A)(this,Fr,0),(0,i.A)(this,Dr,void 0),(0,i.A)(this,jr,void 0),(0,i.A)(this,Kr,void 0),(0,i.A)(this,Vr,void 0),(0,i.A)(this,Wr,!1),(0,s.A)(xr,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(zr,this,Hr).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(zr,this,Hr).call(this,{location:e,action:t})))}getRenderId(){return(0,a.A)(Dr,this)}getRuntimeContext(){return(0,a.A)($r,this)}getRecentApps(){return{currentApp:(0,a.A)(jr,this),previousApp:(0,a.A)(Kr,this)}}getNavConfig(){return(0,a.A)(Vr,this)}bootstrap(){window.AbortController&&(Sr=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:Sr.signal,...e.options}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const o=t;t=e,(0,a.A)(Br,this)?(0,s.A)(Lr,this,{location:e,prevLocation:o,action:n}):(0,C.A)(zr,this,Xr).call(this,{location:e,prevLocation:o,action:n}).catch(pn)})),(0,C.A)(zr,this,Xr).call(this,{location:e.location})}}function Hr(e){var t;const n=k(),o=n.getBlockMessage();null===(t=(0,a.A)(Nr,this))||void 0===t||t.dispatchBeforePageLeave(e);const r=n.getBlockMessage();return!o&&r&&n.unblock(),r}function qr(e,t,n){var o,r;if((0,s.A)(Fr,this,(o=(0,a.A)(Fr,this),r=o++,o)),r>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function Xr(e){(0,s.A)(Br,this,!0);try{await(0,C.A)(zr,this,Yr).call(this,e)}finally{if((0,s.A)(Br,this,!1),(0,a.A)(Lr,this)){const e=(0,a.A)(Lr,this);(0,s.A)(Lr,this,void 0),await(0,C.A)(zr,this,Xr).call(this,e)}}}async function Yr(e){let{location:t,prevLocation:n,action:o}=e;if(n){var r,i,s,l;let e;const u={hash:void 0,state:void 0};var c;if(void 0!==t.key&&("POP"!==o||void 0!==n.key&&!1!==(null===(r=n.state)||void 0===r?void 0:r.notify))||(u.key=void 0),((0,f.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==o&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(e=!0),e||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(0,a.A)(Wr,this)||(e=await(null===(c=(0,a.A)(Nr,this))||void 0===c?void 0:c.didPerformIncrementalRender(t,n))),e)return;if(Sr&&(Sr.abort(),Sr=new AbortController),null===(l=(0,a.A)(Nr,this))||void 0===l||l.dispatchPageLeave(),"POP"===o&&v(g((0,a.A)(xr,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(zr,this,Jr).call(this,t,!n)}async function Jr(e,t){var n,o,r,i,l,u;const d=(0,s.A)(Dr,this,(0,h.uniqueId)("render-id-"));let f=null==Pi||null===(n=Pi.auth)||void 0===n||null===(o=n.isBlockedPath)||void 0===o?void 0:o.call(n,e.pathname);rt=new WeakSet,ct(),null==Pi||null===(r=Pi.flowApi)||void 0===r||r.clearCollectWidgetContract(),k().unblock();const p=null==Pi||null===(i=Pi.pageView)||void 0===i?void 0:i.create(),m=f?void 0:g((0,a.A)(xr,this),e.pathname),v=null===(l=(0,a.A)($r,this))||void 0===l?void 0:l.app,b=null==m||null===(u=m.app)||void 0===u?void 0:u.id;window.BOOTSTRAP_UNION_FILE&&b&&b!==(null==v?void 0:v.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:b,version:m.app.currentVersion}),null!=m&&m.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==Pi||null===(t=Pi.fulfilStoryboard)||void 0===t?void 0:t.call(Pi,e)),B(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(m);const y=(0,s.A)(jr,this,null==m?void 0:m.app);var w,E,S,A;y&&(null==m||null===(w=m.meta)||void 0===w||null===(w=w.blackList)||void 0===w||null===(E=w.forEach)||void 0===E||E.call(w,(e=>{var t,n;let o=e&&(e.to||e.url);if(o&&"string"==typeof o){if(o=o.split("?")[0].replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g,":$1"),e.to)try{o=It(o,{app:y})}catch(e){console.error(e)}else o=o.replace(/^\/next\//,"/");o&&o.startsWith("/")&&(null==Pi||null===(t=Pi.auth)||void 0===t||null===(n=t.addPathToBlackList)||void 0===n||n.call(t,o))}})),f=null==Pi||null===(S=Pi.auth)||void 0===S||null===(A=S.isBlockedPath)||void 0===A?void 0:A.call(S,e.pathname)),function(){var e,t,n,o,r,i,s,a;const l=xi().getFeatureFlags(),u=xi().getMiscSettings();if(!l["show-watermark"])return;const d="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),f=null!==(n=null==Pi||null===(o=Pi.auth)||void 0===o||null===(o=o.getAuth())||void 0===o?void 0:o.username)&&void 0!==n?n:"",p=null!==(r=u.watermarkConfig)&&void 0!==r?r:{flags:{}},g=[..."string"==typeof p.content?[p.content]:null!==(i=p.content)&&void 0!==i?i:[],null!==(s=p.flags)&&void 0!==s&&s["show-development"]&&d?"Development":"",null!==(a=p.flags)&&void 0!==a&&a["show-user"]?f:""].filter(Boolean);if(0===g.length)return;const m={content:g,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(p,["content","flags"])};Ar?Ar.resolve(m):(0,c.loadBricksImperatively)([Rr],Ni()).then((()=>{Ar=document.createElement(Rr),Ar.resolve(m)}),(e=>{console.error("Load watermark service failed:",e)}))}();const I=v&&y?v.id!==y.id:v!==y;(0,T.clearExpressionASTCache)(),I&&(0,T.clearFunctionASTCache)();const O=xi().getFeatureFlags(),_=(0,a.A)(Nr,this),P=(t,n)=>{null==p||p({status:"redirected"}),(0,a.A)(Ur,this).add(_),(0,C.A)(zr,this,qr).call(this,t,n,e)},M=()=>{const t=O["sso-enabled"]?"/sso-auth/login":"/auth/login";an(e),P(t,{from:e})},x=document.querySelector("#main-mount-point"),L=document.querySelector("#portal-mount-point"),$={tag:Vn.ROOT,container:x,createPortal:L},N=()=>{var e;Wn(x),Wn(L),(0,a.A)(Ur,this).add(_);for(const e of(0,a.A)(Ur,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,a.A)(Ur,this).clear(),null==Pi||null===(e=Pi.messageDispatcher)||void 0===e||e.reset(),I&&((0,s.A)(Kr,this,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:y}})))};if(Q(y&&(oe()[y.id]||y.theme)||"light"),ie("default"),ue(xi().getMiscSettings().globalThemeVariant),y&&!f){var U,F,D,j,K,W;null==Pi||null===(U=Pi.checkInstalledApps)||void 0===U||U.preCheckInstalledApps(m,(e=>!!Ki(e)));const n={bailout:e=>e.unauthenticated?(M(),!0):e.redirect?(P(e.redirect.path,e.redirect.state),!0):void(0,s.A)(Fr,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,s.A)(Vr,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,a.A)(Vr,this)}))},catch:async(t,n,o,r)=>{if(!cn(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const i=xi().getMiscSettings().noAuthGuardLoginPath;if(cn(t)&&i)return void P(i,{from:e});if(o)throw t;return!r&&Pr(t)?void window.location.reload():{failed:!0,output:{node:await lr(t,n,!r),blockingList:[]}}}(0,a.A)(Ur,this).add(_)}else M()}},o=(0,s.A)(Nr,this,new oo("page",{routeHelper:n,renderId:d})),r=(0,s.A)($r,this,{app:y,location:e,query:new URLSearchParams(e.search),flags:O,sys:{...null==Pi||null===(F=Pi.auth)||void 0===F?void 0:F.getAuth(),...kr(),settings:{brand:xi().getBrandSettings()}},ctxStore:new Go("CTX",void 0,o),pendingPermissionsPreCheck:[null==Pi||null===(D=Pi.checkPermissions)||void 0===D?void 0:D.preCheckPermissions(m)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.A)(Vr,this,void 0),Ir(m),ye(null===(j=m.meta)||void 0===j?void 0:j.functions,y),null==Pi||null===(K=Pi.flowApi)||void 0===K||K.collectContract(null===(W=m.meta)||void 0===W?void 0:W.contracts);let i,l=!1,c=[];try{po.clear();const e={};if(i=await ur($,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const o=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,o+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(o+1)],t}(m.routes),r,o,[],e),n.bailout(i))return;c=pr(r),await hr(i,r,c),e.child=i.menuRequestNode,o.setInitialMenuRequestNode(e),await n.mergeMenus(o.getMenuRequests())}catch(e){console.error("Router failed:",e),t&&(0,s.A)(Wr,this,!0);const o=await n.catch(e,$,t);if(!o)return;({failed:l,output:i}=o)}if(Mr(),$.child=i.node,(0,s.A)(Wr,this,!1),N(),i.route&&"routes"!==i.route.type||l){if(l||o.dispatchBeforePageLoad(),te(),ae(),Cr(null==y?void 0:y.uiVersion),zn($),window.scrollTo(0,0),l)null==p||p({status:"failed"});else{o.dispatchPageLoad(),o.dispatchAnchorLoad(),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of c)e.mountAsyncData();null==p||p({status:"ok",path:i.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Pi&&Pi.auth&&!Pi.auth.isLoggedIn())return void M();N()}te(),ae();const z=await lr(new ar(f?"page blocked":y?"page not found":"app not found"),$,!0);$.child=z,zn($),window.scrollTo(0,0),null==p||p({status:f?"blocked":"not-found"}),V("rendered")}const Qr="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function Zr(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function ei(e){return e<=1?"".concat(100*Number(e),"%"):e}function ti(e){return 1===e.length?"0"+e:String(e)}function ni(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oi(e){return ri(e)/255}function ri(e){return parseInt(e,16)}var ii={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function si(e){var t,n,o,r={r:0,g:0,b:0},i=1,s=null,a=null,l=null,c=!1,u=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(ii[e])e=ii[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=ui.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=ui.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ui.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=ui.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ui.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=ui.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ui.hex8.exec(e))?{r:ri(n[1]),g:ri(n[2]),b:ri(n[3]),a:oi(n[4]),format:t?"name":"hex8"}:(n=ui.hex6.exec(e))?{r:ri(n[1]),g:ri(n[2]),b:ri(n[3]),format:t?"name":"hex"}:(n=ui.hex4.exec(e))?{r:ri(n[1]+n[1]),g:ri(n[2]+n[2]),b:ri(n[3]+n[3]),a:oi(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=ui.hex3.exec(e))&&{r:ri(n[1]+n[1]),g:ri(n[2]+n[2]),b:ri(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(di(e.r)&&di(e.g)&&di(e.b)?(t=e.r,n=e.g,o=e.b,r={r:255*Zr(t,255),g:255*Zr(n,255),b:255*Zr(o,255)},c=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):di(e.h)&&di(e.s)&&di(e.v)?(s=ei(e.s),a=ei(e.v),r=function(e,t,n){e=6*Zr(e,360),t=Zr(t,100),n=Zr(n,100);var o=Math.floor(e),r=e-o,i=n*(1-t),s=n*(1-r*t),a=n*(1-(1-r)*t),l=o%6;return{r:255*[n,s,i,i,a,n][l],g:255*[a,n,n,s,i,i][l],b:255*[i,i,a,n,n,s][l]}}(e.h,s,a),c=!0,u="hsv"):di(e.h)&&di(e.s)&&di(e.l)&&(s=ei(e.s),l=ei(e.l),r=function(e,t,n){var o,r,i;if(e=Zr(e,360),t=Zr(t,100),n=Zr(n,100),0===t)r=n,i=n,o=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;o=ni(a,s,e+1/3),r=ni(a,s,e),i=ni(a,s,e-1/3)}return{r:255*o,g:255*r,b:255*i}}(e.h,s,l),c=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(i=e.a)),i=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(i),{ok:c,format:e.format||u,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:i}}var ai="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),li="[\\s|\\(]+(".concat(ai,")[,|\\s]+(").concat(ai,")[,|\\s]+(").concat(ai,")\\s*\\)?"),ci="[\\s|\\(]+(".concat(ai,")[,|\\s]+(").concat(ai,")[,|\\s]+(").concat(ai,")[,|\\s]+(").concat(ai,")\\s*\\)?"),ui={CSS_UNIT:new RegExp(ai),rgb:new RegExp("rgb"+li),rgba:new RegExp("rgba"+ci),hsl:new RegExp("hsl"+li),hsla:new RegExp("hsla"+ci),hsv:new RegExp("hsv"+li),hsva:new RegExp("hsva"+ci),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function di(e){return Boolean(ui.CSS_UNIT.exec(String(e)))}var fi=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function pi(e){var t=function(e,t,n){e=Zr(e,255),t=Zr(t,255),n=Zr(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),i=0,s=o,a=o-r,l=0===o?0:a/o;if(o===r)i=0;else{switch(o){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4}i/=6}return{h:i,s:l,v:s}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function hi(e){var t=e.r,n=e.g,o=e.b;return"#".concat(function(e,t,n){var o=[ti(Math.round(e).toString(16)),ti(Math.round(t).toString(16)),ti(Math.round(n).toString(16))];return o.join("")}(t,n,o))}function gi(e,t,n){var o;return(o=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?o+=360:o>=360&&(o-=360),o}function mi(e,t,n){return 0===e.h&&0===e.s?e.s:((o=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(o=1),n&&5===t&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2)));var o}function vi(e,t,n){var o;return(o=n?e.v+.05*t:e.v-.15*t)>1&&(o=1),Number(o.toFixed(2))}function bi(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],o=si(e),r=5;r>0;r-=1){var i=pi(o),s=hi(si({h:gi(i,r,!0),s:mi(i,r,!0),v:vi(i,r,!0)}));n.push(s)}n.push(hi(o));for(var a=1;a<=4;a+=1){var l=pi(o),c=hi(si({h:gi(l,a),s:mi(l,a),v:vi(l,a)}));n.push(c)}return"dark"===t.theme?fi.map((function(e){var o,r,i,s=e.index,a=e.opacity;return hi((o=si(t.backgroundColor||"#141414"),i=100*a/100,{r:((r=si(n[s])).r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b}))})):n}var yi={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wi={},Ei={};function Si(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Ai(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function ki(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Ii(e,t,n){return"dark"===t?bi(e,{theme:t,backgroundColor:n})[5]:e}function Ci(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Ai:Si)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?Ai:Si)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,o]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),o.map(((e,o)=>[" --palette-".concat(n,"-").concat(o+1,"-channel: ").concat(ki(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(o+1,": rgb(var(--palette-").concat(n,"-").concat(o+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[o,r]=e;return[o,bi(r,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((o=>{var[r,i]=o;return[" --theme-".concat(r,"-color-rgb-channel: ").concat(ki(Ii(t[i],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(r,"-color: var(--palette-").concat(i,"-6);")," --theme-".concat(r,"-border-color: var(--palette-").concat(i,"-3);")]," --theme-".concat(r,"-background: var(--palette-").concat(i,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Ai:Si)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let Ri,Ti,Oi,_i,Pi;function Mi(e){if(Ri)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case D:j=n.panel}})),Pi=null==e?void 0:e.hooks,(0,l.initializeI18n)(nn,on),d.locale(l.i18n.language),l.i18n.on("languageChanged",(()=>{d.locale(l.i18n.language)})),A(),Ri=new $i,Ri}Object.keys(yi).forEach((function(e){wi[e]=bi(yi[e]),wi[e].primary=wi[e][5],Ei[e]=bi(yi[e],{theme:"dark",backgroundColor:"#141414"}),Ei[e].primary=Ei[e][5]})),wi.red,wi.volcano,wi.gold,wi.orange,wi.yellow,wi.lime,wi.green,wi.cyan,wi.blue,wi.geekblue,wi.purple,wi.magenta,wi.grey;const xi=function(){const e=S();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return Ri};var Bi=new WeakMap,Li=new WeakMap;class $i{constructor(){(0,i.A)(this,Bi,!1),(0,i.A)(this,Li,!1),(0,r.A)(this,"version",3)}initialize(e){var t;if((0,a.A)(Bi,this))throw new Error("The runtime cannot be initialized more than once");(0,s.A)(Bi,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),Ti=e;const{notification:n,dialog:o}=Ui();var r;!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{dn=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{rn=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?Ci({type:"brandColor",...e.brandColor}):e.baseColors?Ci({type:"baseColors",...e.baseColors}):e.variables&&Ci({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,a.A)(Li,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.A)(Li,this,!0),Oi=new Gr(Ti.storyboards),await Oi.bootstrap()}getRecentApps(){var e,t;return null!==(e=null===(t=Oi)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Oi)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return et(e,t)}getFeatureFlags(){var e,t;return{...null===(e=Ti)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=Oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=Ti)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=Oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=Ti)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=Ti)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e,t;return null!==(e=null===(t=Ti)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=Ti)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=Oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=Oi)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,c.loadBricksImperatively)(e,Ni())}}function Ni(){var e,t,n,o;return null!=_i?_i:_i=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}(null!==(e=null!==(t=null!==(n=null===(o=Ti)||void 0===o?void 0:o.brickPackages)&&void 0!==n?n:Qr)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[],window.PUBLIC_DEPS)}function Ui(){var e,t;return null!==(e=null===(t=Ti)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function Fi(){var e;return null===(e=Oi)||void 0===e?void 0:e.getRenderId()}function Di(){var e;return null===(e=Oi)||void 0===e?void 0:e.getRuntimeContext()}function ji(e){var t;return null===(t=Ti)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Ki(e){var t;return null===(t=ji(e))||void 0===t?void 0:t.app}function Vi(){for(var e,t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];null==Pi||null===(e=Pi.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...o)}function Wi(){var e;return null==Pi||null===(e=Pi.auth)||void 0===e?void 0:e.getAuth()}function zi(){var e,t;return null==Pi||null===(e=Pi.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Gi(){var e;return null==Pi||null===(e=Pi.auth)||void 0===e?void 0:e.isLoggedIn()}var Hi=new WeakMap;const qi=new class{constructor(){(0,i.A)(this,Hi,new Map)}define(e,t){(0,a.A)(Hi,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,a.A)(Hi,this).set(e,t)}get(e){return(0,a.A)(Hi,this).get(e)}};async function Xi(e,t,n){return ut(await ot(e),e,"resolve",t,n)}function Yi(e){let t,{portal:n,scope:o="fragment",unknownBricks:r,supportsUseChildren:i,unsafe_penetrate:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n;t=n||(()=>(a=document.createElement("div"),a.style.position="absolute",a.style.width=a.style.height="0",document.body.append(a),a));let c,u,d=!1;const f="page"===o?void 0:Symbol("IsolatedRoot");return{async render(n){var p;let{theme:g,uiVersion:m,language:v,context:b,functions:y,templates:w,i18n:E,url:S,app:A}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(d)throw new Error("The root is unmounted and cannot be rendered any more");const k=[].concat(n);if(i){(0,O.replaceUseChildren)(k);for(const e of null!=w?w:[])Array.isArray(e.bricks)&&(0,O.replaceUseChildren)(e.bricks)}const I=c,C=(0,h.uniqueId)("render-id-");c=new oo(o,{unknownBricks:r,renderId:C});const R={ctxStore:new Go("CTX",void 0,c),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map,isolatedRoot:f,unsafe_penetrate:s,sys:{...null==Pi||null===(p=Pi.auth)||void 0===p?void 0:p.getAuth()}};if(S){const e=new URL(S);R.query=e.searchParams,R.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const T={tag:Vn.ROOT,container:e,createPortal:t};if("page"===o){var _;Q(null!=g?g:"light"),ie("default"),Cr(m),v&&await l.i18n.changeLanguage(v),null!=A||(A={id:"demo",homepage:"/demo"}),R.app=A;const e={app:A,meta:{i18n:E,customTemplates:w}};null===(_=u)||void 0===_||_(),u=B(e),Ir(e),ye(y,A)}else!function(e,t){let n=Ue.get(e);if(n||(n=new $e(!0),Ue.set(e,n)),n.clearIsolatedRegistry(),Array.isArray(t))for(const e of t)n.define(e.name,e)}(f,w),function(e,t){const{storyboardFunctions:n,registerStoryboardFunctions:o}=ve({isolatedRoot:e});fe.set(e,n),o(t)}(f,y);R.ctxStore.define(b,R);let P,M=!1,x=[];try{P=await dr(T,k,R,c,[],{}),x=pr(R),await hr(P,R,x)}catch(e){M=!0,P={node:await lr(e,T,"page"===o),blockingList:[]}}if(T.child=P.node,null==I||I.dispatchOnUnmount(),null==I||I.dispose(),Wn(e),a&&Wn(a),"page"===o&&(M||c.dispatchBeforePageLoad(),te(),ae()),zn(T),"page"===o&&window.scrollTo(0,0),!M){for(const e of x)e.mountAsyncData();"page"===o&&c.dispatchPageLoad(),c.dispatchOnMount(),c.initializeScrollIntoView(),c.initializeMediaChange(),c.initializeMessageDispatcher()}},unmount(){d||(d=!0,f&&(fe.delete(f),Ue.delete(f)),Wn(e),a&&(Wn(a),n||a.remove()))}}}function Ji(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...Di()};t&&(n.query=new URLSearchParams(k().location.search));const o=t=>{if("string"==typeof t){if((0,T.isEvaluable)(t)){const e=bt(t,n);return it(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||st(e)?t:Array.isArray(t)?t.map((e=>o(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[o(t),o(n)]})))};return o(e)}const Qi=[];function Zi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=-1;const n=()=>{if(t>-1){const e=Qi.indexOf(t);e>-1&&Qi.splice(e,1)}};return{push:()=>{var o;return n(),t=(null!==(o=Qi[Qi.length-1])&&void 0!==o?o:-1)+1,Qi.push(t),t+e},pull:n}}},70829:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(12559);function r(e,t){return e.get((0,o.A)(e,t))}},70918:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(72016);function r(e,t,n){(0,o.A)(e,t),t.set(e,n)}},72016:(e,t,n)=>{function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>o})},74635:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(72016);function r(e,t){(0,o.A)(e,t),t.add(e)}},86121:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(12559);function r(e,t,n){return e.set((0,o.A)(e,t),n),n}}}]);
3
- //# sourceMappingURL=948.e601f18c.js.map