@next-bricks/advanced 0.30.2 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/1860.f38d415d.js +2 -0
  3. package/dist/chunks/1860.f38d415d.js.map +1 -0
  4. package/dist/chunks/1972.5ed0dc71.js +2 -0
  5. package/dist/chunks/{1972.ad141da3.js.map → 1972.5ed0dc71.js.map} +1 -1
  6. package/dist/chunks/5114.810601d4.js +2 -0
  7. package/dist/chunks/{5114.6a07608b.js.map → 5114.810601d4.js.map} +1 -1
  8. package/dist/chunks/5479.a0737c65.js +2 -0
  9. package/dist/chunks/5479.a0737c65.js.map +1 -0
  10. package/dist/chunks/{6800.2beb77f5.js → 6800.f81b7880.js} +2 -2
  11. package/dist/chunks/{6800.2beb77f5.js.map → 6800.f81b7880.js.map} +1 -1
  12. package/dist/chunks/9591.ac4c49ed.js +2 -0
  13. package/dist/chunks/{9591.23f76529.js.map → 9591.ac4c49ed.js.map} +1 -1
  14. package/dist/chunks/capture-snapshot.e27021c2.js +2 -0
  15. package/dist/chunks/{capture-snapshot.48b18b48.js.map → capture-snapshot.e27021c2.js.map} +1 -1
  16. package/dist/chunks/eo-cascader.e98924ff.js +2 -0
  17. package/dist/chunks/{eo-cascader.5f5da9a1.js.map → eo-cascader.e98924ff.js.map} +1 -1
  18. package/dist/chunks/eo-next-table.48d82c28.js +2 -0
  19. package/dist/chunks/eo-next-table.48d82c28.js.map +1 -0
  20. package/dist/chunks/eo-table.c0994851.js +2 -0
  21. package/dist/chunks/{eo-table.5096d2b9.js.map → eo-table.c0994851.js.map} +1 -1
  22. package/dist/chunks/eo-tree-select.b21fc381.js +2 -0
  23. package/dist/chunks/{eo-tree-select.c5971b71.js.map → eo-tree-select.b21fc381.js.map} +1 -1
  24. package/dist/chunks/{eo-tree.0eacf9b4.js → eo-tree.f7c335ee.js} +2 -2
  25. package/dist/chunks/{eo-tree.0eacf9b4.js.map → eo-tree.f7c335ee.js.map} +1 -1
  26. package/dist/chunks/eo-workbench-layout.61a79efb.js +2 -0
  27. package/dist/chunks/{eo-workbench-layout.3f7a252b.js.map → eo-workbench-layout.61a79efb.js.map} +1 -1
  28. package/dist/chunks/{main.43a47dd6.js → main.ec1e0fe2.js} +2 -2
  29. package/dist/chunks/{main.43a47dd6.js.map → main.ec1e0fe2.js.map} +1 -1
  30. package/dist/{index.3872fb15.js → index.a1c6dbb6.js} +2 -2
  31. package/dist/{index.3872fb15.js.map → index.a1c6dbb6.js.map} +1 -1
  32. package/dist-types/next-table/Table.d.ts +1 -2
  33. package/dist-types/next-table/index.d.ts +2 -0
  34. package/package.json +4 -3
  35. package/dist/chunks/1860.5b3717a3.js +0 -2
  36. package/dist/chunks/1860.5b3717a3.js.map +0 -1
  37. package/dist/chunks/1972.ad141da3.js +0 -2
  38. package/dist/chunks/5114.6a07608b.js +0 -2
  39. package/dist/chunks/5479.57b02b48.js +0 -2
  40. package/dist/chunks/5479.57b02b48.js.map +0 -1
  41. package/dist/chunks/9591.23f76529.js +0 -2
  42. package/dist/chunks/capture-snapshot.48b18b48.js +0 -2
  43. package/dist/chunks/eo-cascader.5f5da9a1.js +0 -2
  44. package/dist/chunks/eo-next-table.174e4889.js +0 -2
  45. package/dist/chunks/eo-next-table.174e4889.js.map +0 -1
  46. package/dist/chunks/eo-table.5096d2b9.js +0 -2
  47. package/dist/chunks/eo-tree-select.c5971b71.js +0 -2
  48. package/dist/chunks/eo-workbench-layout.3f7a252b.js +0 -2
package/dist/bricks.json CHANGED
@@ -42,5 +42,5 @@
42
42
  "eo-form-item"
43
43
  ]
44
44
  },
45
- "filePath": "bricks/advanced/dist/index.3872fb15.js"
45
+ "filePath": "bricks/advanced/dist/index.a1c6dbb6.js"
46
46
  }
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_next_bricks_advanced=self.webpackChunk_next_bricks_advanced||[]).push([[1860],{51860:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>ir,Notification:()=>vr,StoryboardFunctionRegistryFactory:()=>ve,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>re,authenticate:()=>qa,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Pt,checkIfOfComputed:()=>Tt,createHistory:()=>I,createRuntime:()=>La,customProcessors:()=>B,customTemplates:()=>xe,fetchByProvider:()=>Qa,getAuth:()=>Ga,getBasePath:()=>v,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>te,getHistory:()=>C,getPageInfo:()=>To,getRuntime:()=>Ua,getV2RuntimeFromDll:()=>k,handleHttpError:()=>fr,httpErrorToString:()=>lr,isLoggedIn:()=>Ya,isUnauthenticatedError:()=>cr,logout:()=>Ja,matchPath:()=>Ht,registerWidgetFunctions:()=>Fe,registerWidgetI18n:()=>j,setUIVersion:()=>Mo,unstable_createRoot:()=>Za});var n={};r.r(n),r.d(n,{addRealTimeDataInspectHook:()=>Dn,getAddedContracts:()=>Nn,getAllContextValues:()=>Bn,getBrickPackagesById:()=>Ln,getContextValue:()=>xn,getRenderId:()=>Un,legacyDoTransform:()=>Sn,mountUseBrick:()=>wn,renderUseBrick:()=>An,setRealTimeDataInspectRoot:()=>$n,symbolForRootRuntimeContext:()=>yn,unmountUseBrick:()=>En,updateSnippetPreviewSettings:()=>_n,updateStoryboard:()=>kn,updateStoryboardByRoute:()=>In,updateStoryboardBySnippet:()=>On,updateStoryboardByTemplate:()=>Cn,updateTemplatePreviewSettings:()=>Rn});var o=r(69740),a=r(86330),i=r(74635),s=r(24586),l=r(70918),c=r(17058),u=r(66154),d=r(48438),p=r(21302),f=(r(26036),r(32890));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(14223),m=r(41030);function g(e,t){var r=(0,m.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var o=n.app.homepage;if("string"==typeof o&&"/"===o[0]&&y(o,t))return n}}function y(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function A(e){var t;return!e||(null===(t=Ua().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var b,w=["extraQuery","clear","keepHash"],E=!1;function S(e,t){t(!(E=!confirm(e)))}function k(){var e,{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 I(){if(!b){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:S});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function a(e,t,n){E=!1,r(e,t),null==n||n(E)}function i(e,t,r){E=!1,n(e,t),null==r||r(E)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:l,keepHash:c}=n,u=(0,h.A)(n,w),d=new URLSearchParams(l?"":e.location.search),p={};for(var[f,v]of(Object.assign(p,r,s),Object.entries(p)))if(Array.isArray(v))for(var m of(d.delete(f),v))d.append(f,m);else null==v||""===v?d.delete(f):d.set(f,v);("push"===t?a:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,o)}}return(0,o.A)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){a((0,o.A)((0,o.A)({},e.location),{},{key:void 0,hash:t,state:(0,o.A)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,o.A)((0,o.A)({},e.location),{},{state:(0,o.A)((0,o.A)({},e.location.state),{},{notify:!0,noIncremental:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(o,a,i){var s,l="string"==typeof o;return"string"==typeof(s=l?(0,f.parsePath)(o).pathname:o.pathname)&&s.startsWith("/")&&A(function(e){var t,r;return g(null!==(t=null===(r=wa)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?v()+o.substring(1):e.createHref(o)):("push"===n?t:r)(o,a,i)}}return{push:n("push"),replace:n("replace")}}((0,o.A)((0,o.A)({},e),{},{push:a,replace:i})))}(e)),b=e}return b}var C=function(){var e=k();if(e)return e.getHistory}()||function(){return b},R=r(75290),T=r(75481),O=r(50050),P=r(35435),_=r(87731);function M(e,t){return e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))}var x=new WeakMap,B=function(){var e=k();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,l.A)(this,x,new Map)}define(e,t){var[r,n]=e.split("."),o=M(x,this).get(r);if(o||(o=new Map,M(x,this).set(r,o)),o.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));o.set(n,t)}get(e){return M(x,this).get(e)}};function L(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=U("app",t.id),o=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;c.i18n.addResourceBundle(t,n,r),o.push(t)})),()=>{for(var e of o)c.i18n.removeResourceBundle(e,n)}}}function U(e,t){return"".concat(e,"/").concat(t)}function N(e){return c.i18n.getFixedT(null,U("widget",e))}var F,j=function(){var e=k();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=U("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;c.i18n.addResourceBundle(t,r,n)}))},$="brick-next-devtools-panel",D="devtools-frame-active-change",K="devtools-panel-change",V=!0;function W(e,t){var r=H();if(r&&("evaluation"!==e||V&&(!F||"Evaluations"===F))){var n=()=>{var n;null===(n=r.emit)||void 0===n||n.call(r,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(n):setTimeout(n,0)}}function H(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var z=()=>{throw new Error("Can't modify read-only proxy object")},q={set:z,defineProperty:z,deleteProperty:z,setPrototypeOf:z};function G(e){return new Proxy(e,q)}function J(e){var{get:t,ownKeys:r}=e;return H()?G(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var Y="light",Q=new d.JsonStorage(localStorage),X="apps-theme";function Z(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));Y=e}function ee(){return Y}function te(){return document.documentElement.dataset.theme}function re(e){e?Z(e):e=ee(),e!==te()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){Q.setItem(X,(0,o.A)((0,o.A)({},oe()),e))}function oe(){var e,t;try{t=Q.getItem(X)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var ae="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));ae=e}function se(){return document.documentElement.dataset.mode}function le(e){e?ie(e):e=ae,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return r&&(null===(t=window.getComputedStyle(r))||void 0===t?void 0:t.getPropertyValue(e))||""}function ue(e,t){var r={};for(var n of e){var o=de(n,t);void 0!==o&&(r[n]=o)}return r}function de(e,t){var r,n,o,{collectCoverage:a,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return a?"/next":v().replace(/\/$/,"");case"FN":return d;case"IMG":return a?{get:e=>"mock/images/".concat(e)}:i?null==Sa||null===(r=Sa.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==Sa||null===(n=Sa.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return a?m.identity:i?N(i):c.i18n.getFixedT(null,[u,U("app",l.id)].filter(Boolean));case"I18N_TEXT":return a?pe:c.i18nText;case"PERMISSIONS":return G({check:a?fe:null==Sa||null===(o=Sa.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return G({getTheme:a?()=>"light":ee});case"console":return p?G(console):void 0;case"location":return a?{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 pe(e){return null==e?void 0:e.en}function fe(){return!0}function ve(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=new Map,i=new Proxy(Object.freeze({}),{get:(o,s)=>function(o){var s,l=a.get(o);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(o));var c=(0,T.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,T.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,_.supply)(c.attemptToVisitGlobals,ue(c.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:i,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),l.processed=!0,l.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),a.clear(),Array.isArray(t))for(var o of t){var i=(0,O.collectMemberUsageInFunction)(o,"FN",!!n),s=(0,O.collectMemberUsageInFunction)(o,"PERMISSIONS",!!n).has("check");a.set(o.name,{source:o.source,typescript:o.typescript,deps:i,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,o.A)((0,o.A)({},t),{},{name:e}),n=(0,O.collectMemberUsageInFunction)(r,"FN",!0),i=(0,O.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");a.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:i})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=a.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=ve(),ye={};try{ye.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,o=a.prototype;function a(){t.set(this,r(null))}function i(e,t,r){n(e,t,{configurable:!0,writable:!0,value:r})}function s(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}i(o,"addEventListener",(function(e,r,n){for(var o=t.get(this),a=o[e]||(o[e]=[]),i=0,s=a.length;i<s;i++)if(a[i].listener===r)return;a.push({target:this,listener:r,options:n})})),i(o,"dispatchEvent",(function(e){var r=t.get(this)[e.type];return r&&(i(e,"target",this),i(e,"currentTarget",this),r.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(o,"removeEventListener",(function(e,r){for(var n=t.get(this),o=n[e]||(n[e]=[]),a=0,i=o.length;a<i;a++)if(o[a].listener===r)return void o.splice(a,1)})),ye.EventTarget=a}(Object,new WeakMap)}const Ae=ye.EventTarget;var be=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),we=new Map([[be.xLarge,"1920px"],[be.large,"1600px"],[be.medium,"1280px"],[be.small,"1024px"],[be.xSmall,0]]),Ee=new Ae,Se={},ke={};function Ie(e,t){var r=!1;for(var[n]of(Se[t]=e.matches,we))if(Se[n]&&ke.breakpoint!==n){ke.breakpoint=n,r=!0;break}r&&Ee.dispatchEvent(new CustomEvent("change",{detail:ke}))}we.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Ie(r,t),r.addEventListener?r.addEventListener("change",(e=>{Ie(e,t)})):r.addListener((e=>{Ie(e,t)}))}));var Ce=()=>ke;function Re(e){return function(t){var r,n="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(r=n.getItem(t))&&void 0!==r?r:"null")}}function Te(e){var t,r;return!(null===(t=e?e.flags:null===(r=Ua())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];var a=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(a),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(a),...n)}function Pe(e,t){return e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))}var _e=new Set(["prefix"]),Me=new WeakMap,xe=function(){var e=k();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,l.A)(this,Me,new Map)}define(e,t){var r,n,a,i,s=Pe(Me,this).has(e);s?console.warn('Custom template of "'.concat(e,'" already registered.')):(s=!!customElements.get(e))&&console.warn('Custom template of "'.concat(e,'" already defined by customElements.'));var l=Te(),c=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},u=[],d=[];for(var[p,f]of Object.entries(c))f.asVariable?(Oe(l,"Template `asVariable`",e,p),l||d.push(p)):f.mergeProperty||f.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,p):f.ref&&u.push([p,f]);var v=(0,o.A)((0,o.A)({},t),{},{proxy:(0,o.A)((0,o.A)({},t.proxy),{},{properties:Object.fromEntries(u)}),state:(t.state?l?t.state:t.state.map((e=>(0,o.A)({expose:!0},e))):[]).concat(d.map((e=>({name:e,expose:!0}))))});Pe(Me,this).set(e,(0,o.A)((0,o.A)({},v),{},{name:e}));var h,g,y=(h=v.state,(0,m.uniq)(null!==(g=null==h?void 0:h.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[])),A=Object.entries(null!==(a=null===(i=v.proxy)||void 0===i?void 0:i.methods)&&void 0!==a?a:{}),b=y.concat(u.map((e=>e[0]))),w=A.map((e=>e[0])),E=b.concat(w).filter((e=>e in HTMLElement.prototype&&!_e.has(e)));if(E.length>0&&(Oe(l,"Using native HTMLElement properties as template properties or methods",e,...E),l))throw new Error('In custom template "'.concat(e,'", ').concat(E.map((e=>'"'.concat(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 w}$$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(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var S=function(r){if(u.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),1;Object.defineProperty(t.prototype,r,{get(){return this.$$tplStateStore.getValue(r)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(r,e,"replace")},enumerable:!0})};for(var k of y)S(k);var I=function(e,r){Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(r.ref)[null!==(t=r.refProperty)&&void 0!==t?t:e]},set(t){var n,o,a=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);a&&(a[null!==(o=r.refProperty)&&void 0!==o?o:e]=t)},enumerable:!0})};for(var[C,R]of u)I(C,R);var T=function(e,r){Object.defineProperty(t.prototype,e,{value(){var t;this.$$getElementByRef(r.ref)[null!==(t=r.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0})};for(var[O,P]of A)T(O,P);customElements.define(e,t)}}get(e){return Pe(Me,this).get(e)}};function Be(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:o}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var a=o.get(n);if(!a)throw new Error('Template state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return a}function Le(e,t,r){var n=Be(e,t,r).hostBrick.element;if(!n)throw new Error('Template host element is gone when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return n}var Ue=new Map,Ne=new Proxy(Object.freeze({}),{get:(e,t)=>Ue.get(t)}),Fe=function(){var e=k();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Ue.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:o}=ve({widgetId:e,widgetVersion:r});Ue.set(e,n),o(t)};const je=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$e=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(je);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},De=e=>"*"===e||"x"===e||"X"===e,Ke=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Ve=(e,t)=>{if(De(e)||De(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Ke(e),Ke(t));return r>n?1:r<n?-1:0},We=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ve(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},He=(e,t,r)=>{Ge(r);const n=((e,t)=>{const r=$e(e),n=$e(t),o=r.pop(),a=n.pop(),i=We(r,n);return 0!==i?i:o&&a?We(o.split("."),a.split(".")):o||a?o?-1:1:0})(e,t);return ze[r].includes(n)},ze={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},qe=Object.keys(ze),Ge=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 Je(e,t){var r=za(e);if(!r&&null!=Sa&&Sa.checkInstalledApps&&(r=Sa.checkInstalledApps.getCheckedApp(e)),!r||"running"===r.installStatus)return!1;if(!t||!r.currentVersion)return!0;var n=t.match(/^([><]=?|=)(.*)$/);try{if(!n)throw new TypeError("Invalid match version: ".concat(t));return He(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ye(e,t,r){var{formStateStoreId:n,formStateStoreMap:o}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var a=o.get(n);if(!a)throw new Error('Form state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return a}var Qe=new Map;function Xe(e){return Ze.apply(this,arguments)}function Ze(){return Ze=(0,a.A)((function*(e){var t,r=null==Sa||null===(t=Sa.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=Sa.flowApi.FLOW_API_PROVIDER);var n=Qe.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)Sa.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],Ka()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Qe.set(e,n),n})),Ze.apply(this,arguments)}var et=new WeakSet;function tt(e){if((0,d.isObject)(e)&&!rt(e))if(et.add(e),Array.isArray(e))e.forEach(tt);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(tt)}}function rt(e){return et.has(e)}var nt=new Map;function ot(e,t,r){return at.apply(this,arguments)}function at(){return(at=(0,a.A)((function*(e,t,r){var{useProvider:n,method:a="resolve",args:i=[],onReject:s}=e,{provider:l,field:c}=e;if(l&&!n)throw new Error("You're using \"provider: ".concat(l,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=c;if(u){var d=Te();if(Oe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([Xe(n),bt(i,t)]),h=null==r?void 0:r.renderId,g=it(f,n,a,v,r,i,!!h&&h!==Va()),{transform:y}=e;try{var A=yield g;tt(p=u?(0,m.get)(A,c):A)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;y=s.transform,p=e}return y?"string"==typeof y?{[y]:p}:bt(y,(0,o.A)((0,o.A)({},t),{},{data:p})):p}))).apply(this,arguments)}function it(e,t,r,n,o,a,i){return st.apply(this,arguments)}function st(){return st=(0,a.A)((function*(e,t,r,n,o,i,s){var l,c;try{l=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;l=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(c=nt.get(l)),c||(c=(0,a.A)((function*(){var o,a=null!=Sa&&null!==(o=Sa.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?yield Sa.flowApi.getArgsOfFlowApi(t,n,r):n;return e[r](...a)}))(),s||nt.set(l,c)),c})),st.apply(this,arguments)}var lt=Symbol.for("pre.evaluated.raw"),ct=Symbol.for("pre.evaluated.context");function ut(e){return!(null==e||!e[lt])}function dt(e){return e[lt]}function pt(e){return"string"==typeof e?(0,T.shouldAllowRecursiveEvaluations)(e):(0,T.shouldAllowRecursiveEvaluations)(e[lt])}var ft=new WeakSet([SyntaxError,TypeError,ReferenceError]);function vt(e){return ft.has(e.constructor)?e.constructor:TypeError}function ht(){return(ht=(0,a.A)((function*(e,t,r){var{blockingList:n,run:o}=mt(e,t,r,!0);return yield Promise.all(n),o()}))).apply(this,arguments)}function mt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,a=[];if("string"!=typeof e){var i=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,o.A)((0,o.A)({},e[ct]),i),e=e[lt]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,T.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,O.collectAppGetMenuUsage)(l,e,t),(0,O.collectInstalledAppsHasUsage)(c,e,t)}}})}catch(t){var p="".concat(t.message,', in "').concat(e,'"');throw new(vt(t))(p)}if(l.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(c.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var f,v,h,g,y={},{attemptToVisitGlobals:A}=s;if(r.lazy||A.has("EVENT")&&!(0,d.hasOwnProperty)(t,"event")||A.has("DATA")&&!(0,d.hasOwnProperty)(t,"data"))return{blockingList:a,run:()=>Object.keys(t).length>0?{[lt]:e,[ct]:t}:e};var b,w,E=Te(t);(A.has("STATE")||!E&&A.has("TPL"))&&(g=Be(t,"STATE",': "'.concat(e,'"'))),A.has("FORM_STATE")&&(w=Ye(t,"FORM_STATE",': "'.concat(e,'"')));var S=H();if(n||S){if(A.has("CTX")&&(f=(0,O.strictCollectMemberUsage)(e,"CTX"),n&&a.push(t.ctxStore.waitFor(f))),g){if(h=(0,O.strictCollectMemberUsage)(e,"STATE"),!E){var k=(0,O.strictCollectMemberUsage)(e,"TPL");for(var I of k)h.add(I)}n&&a.push(g.waitFor(h))}w&&(b=(0,O.strictCollectMemberUsage)(e,"FORM_STATE"),n&&a.push(w.waitFor(b))),A.has("PROCESSORS")&&(v=(0,O.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&a.push((0,u.loadProcessorsImperatively)(v,Ka())))}if(n){var C,R=A.has("PERMISSIONS");if(!R&&A.has("FN")){var P=[...(0,O.strictCollectMemberUsage)(e,"FN")];R=ge(P)}if(R&&a.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=Sa&&Sa.menu){var M=[...l.usedArgs];a.push(Promise.all(M.map((e=>Sa.menu.fetchMenuById(e,t,{getStoryboardByAppId:Ha,resolveData:ot,asyncComputeRealValue:bt})))))}c.usedArgs.size>0&&a.push(null==Sa||null===(C=Sa.checkInstalledApps)||void 0===C?void 0:C.waitForCheckingApps([...c.usedArgs]))}return{blockingList:a,run(){var r,n,a,i,{app:l,location:c,query:u,match:p,flags:S,sys:k,ctxStore:I,data:C,event:R}=t,O=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var P of A)switch(P){case"ANCHOR":y[P]=c.hash?c.hash.substring(1):null;break;case"APP":y[P]=(0,o.A)((0,o.A)({},(0,m.cloneDeep)(O)),{},{getMenu:null==Sa||null===(n=Sa.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[P]=J({get:(e,t)=>I.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[P]=C;break;case"EVENT":y[P]=R;break;case"FLAGS":y[P]=G(S);break;case"FORM_STATE":y[P]=J({get:(e,t)=>w.getValue(t),ownKeys:()=>Array.from(b)});break;case"HASH":y[P]=c.hash;break;case"INSTALLED_APPS":y[P]=G({has:Je});break;case"ITEM":case"INDEX":var M="ITEM"===P?"forEachItem":"forEachIndex";(0,d.hasOwnProperty)(t,M)?y[P]=t[M]:console.error("Using `".concat(P,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":y[P]=G({getItem:Re("local")});break;case"MEDIA":y[P]=G(Ce());break;case"MISC":y[P]=Ua().getMiscSettings();break;case"PARAMS":y[P]=new URLSearchParams(u);break;case"PATH":y[P]=G(null!==(a=null==p?void 0:p.params)&&void 0!==a?a:{});break;case"PATH_NAME":y[P]=c.pathname;break;case"PROCESSORS":y[P]=J({get(e,t){var r=B.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return J({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of v){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":y[P]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[P]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[P]=G({getItem:Re("session")});break;case"TPL":if(Oe(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":y[P]=J({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[P]=G(null!=k?k:{});break;case"__WIDGET_FN__":y[P]=Ne;break;case"__WIDGET_IMG__":y[P]=null==Sa||null===(i=Sa.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":y[P]=N}Object.assign(y,ue(s.attemptToVisitGlobals,{storyboardFunctions:he,app:O,appendI18nNamespace:t.appendI18nNamespace}));try{var x=(0,T.cook)(s.expression,s.source,{globalVariables:(0,_.supply)(s.attemptToVisitGlobals,y)});return W("evaluation",{raw:e,context:y,result:x}),x}catch(t){var L="".concat(t.message,', in "').concat(e,'"');throw new(vt(t))(L)}}}}var gt=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 yt(e){switch(e){case gt.USE_BRICK_PROPERTIES:case gt.USE_BRICK_TRANSFORM:case gt.USE_BRICK_EVENTS:case gt.USE_BRICK_IF:case gt.USE_BRICK_LIFECYCLE:case gt.USE_BRICK_DATA_SOURCE:return!0}return!1}function At(e,t,r){if(yt(e))return e;if(t)switch(e){case gt.USE_BRICK:return gt.USE_BRICK_ITEM;case gt.USE_BRICK_SLOTS_ITEM_BRICKS:return gt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case gt.INITIAL:if("useBrick"===r)return gt.USE_BRICK;break;case gt.USE_BRICK:case gt.USE_BRICK_ITEM:case gt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return gt.USE_BRICK_PROPERTIES;case"transform":return gt.USE_BRICK_TRANSFORM;case"dataSource":return gt.USE_BRICK_DATA_SOURCE;case"events":return gt.USE_BRICK_EVENTS;case"slots":return gt.USE_BRICK_SLOTS;case"children":return gt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return gt.USE_BRICK_IF;case"lifeCycle":return gt.USE_BRICK_LIFECYCLE}break;case gt.USE_BRICK_SLOTS:return gt.USE_BRICK_SLOTS_ITEM;case gt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return gt.USE_BRICK_SLOTS_ITEM_BRICKS}return gt.INITIAL}function bt(e,t){return wt.apply(this,arguments)}function wt(){return wt=(0,a.A)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ut(e);if(n||"string"==typeof e){var o,a=r.$$lazyForUseBrick&&yt(r.$$stateOfUseBrick),i=a;return n||(0,T.isEvaluable)(e)?(o=yield function(e,t,r){return ht.apply(this,arguments)}(e,t,{lazy:a}),i=pt(e)):o=a?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?P.transform:P.transformAndInject:r.noInject?kt:P.inject)(e,t),i||tt(o),o}if(!(0,d.isObject)(e)||rt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=St(r,!0);return Promise.all(e.map((e=>bt(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,o]=e;return Promise.all([bt(n,t),bt(o,t,St(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),wt.apply(this,arguments)}function Et(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ut(e);if(n||"string"==typeof e){var o,a=r.$$lazyForUseBrick&&yt(r.$$stateOfUseBrick),i=a;return n||(0,T.isEvaluable)(e)?(o=function(e,t,r){var{run:n}=mt(e,t,void 0,!1);return n()}(e,t),i=pt(e)):o=a?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?P.transform:P.transformAndInject:r.noInject?kt:P.inject)(e,t),i||tt(o),o}if(!(0,d.isObject)(e)||rt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=St(r,!0);return e.map((e=>Et(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,o]=e;return[Et(n,t),Et(o,t,St(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function St(e,t,r){return e.$$lazyForUseBrick?(0,o.A)((0,o.A)({},e),{},{$$stateOfUseBrick:At(e.$$stateOfUseBrick,t,r)}):e}function kt(e){return e}function It(e,t){return Ct.apply(this,arguments)}function Ct(){return(Ct=(0,a.A)((function*(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ut(e.if)?yield bt(e.if,t):e.if)}))).apply(this,arguments)}function Rt(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ut(e.if)?Et(e.if,t):e.if)}function Tt(e){return!(0,d.hasOwnProperty)(e,"if")||!!e.if}function Ot(){return(Ot=(0,a.A)((function*(e,t){return(0,d.isObject)(e.if)&&!ut(e.if)?Tt(yield ot(e.if,t)):It(e,t)}))).apply(this,arguments)}var Pt=function(){var e=k();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Rt(e,{data:t})};function _t(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,T.isEvaluable)(e):ut(e)){var o="string"==typeof e?e:dt(e);if((0,T.isTrackAll)(o)){var a=(0,O.trackAll)(o);a&&(t=a.context,r=a.state,n=a.formState)}else t=(0,O.track)(o,"track context","CTX"),r=(0,O.track)(o,"track state","STATE"),n=(0,O.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function Mt(e,t){return xt.apply(this,arguments)}function xt(){return(xt=(0,a.A)((function*(e,t){for(var[r,n,o]of e)if(r===t){var a=yield n;if(void 0!==a||!o)return a}}))).apply(this,arguments)}function Bt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=(0,a.A)((function*(e){var t={};for(var[r,n,o]of e){var a=yield n;void 0===a&&o||!("style"!==r&&"dataset"!==r||(0,d.isObject)(a))||(t[r]=a)}return t}))).apply(this,arguments)}function Ut(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[o,a]of Object.entries(n))e[r][o]=a;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Nt(e,t,r){var n=function(e,t){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,o=Et(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?gt.USE_BRICK:gt.INITIAL});if("style"!==r&&"dataset"!==r||(0,d.isObject)(o))return[r,o]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ut(e,n)}))}function Ft(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function jt(e){return e&&e.sensitive?"":"i"}function $t(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,o=void 0!==n&&n,a=r.start,i=void 0===a||a,s=r.end,l=void 0===s||s,c=r.encode,u=void 0===c?function(e){return e}:c,d=r.delimiter,p=void 0===d?"/#?":d,f=r.endsWith,v="[".concat(Ft(void 0===f?"":f),"]|$"),h="[".concat(Ft(p),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var A=y[g];if("string"==typeof A)m+=Ft(u(A));else{var b=Ft(u(A.prefix)),w=Ft(u(A.suffix));if(A.pattern)if(t&&t.push(A),b||w)if("+"===A.modifier||"*"===A.modifier){var E="*"===A.modifier?"?":"";m+="(?:".concat(b,"((?:").concat(A.pattern,")(?:").concat(w).concat(b,"(?:").concat(A.pattern,"))*)").concat(w,")").concat(E)}else m+="(?:".concat(b,"(").concat(A.pattern,")").concat(w,")").concat(A.modifier);else"+"===A.modifier||"*"===A.modifier?m+="((?:".concat(A.pattern,")").concat(A.modifier,")"):m+="(".concat(A.pattern,")").concat(A.modifier);else m+="(?:".concat(b).concat(w,")").concat(A.modifier)}}if(l)o||(m+="".concat(h,"?")),m+=r.endsWith?"(?=".concat(v,")"):"$";else{var S=e[e.length-1],k="string"==typeof S?h.indexOf(S[S.length-1])>-1:void 0===S;o||(m+="(?:".concat(h,"(?=").concat(v,"))?")),k||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,jt(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var o=1,a="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--o){s++;break}}else if("("===e[s]&&(o++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));a+=e[s++]}else a+=e[s++]+e[s++];if(o)throw new TypeError("Unbalanced pattern at ".concat(r));if(!a)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:a}),r=s}else{for(var i="",s=r+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,o=void 0===n?"./":n,a="[^".concat(Ft(t.delimiter||"/#?"),"]+?"),i=[],s=0,l=0,c="",u=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[l],o=n.type,a=n.index;throw new TypeError("Unexpected ".concat(o," at ").concat(a,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var f=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=f||"";-1===o.indexOf(m)&&(c+=m,m=""),c&&(i.push(c),c=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||a,modifier:u("MODIFIER")||""})}else{var g=f||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(i.push(c),c=""),u("OPEN")){m=p();var y=u("NAME")||"",A=u("PATTERN")||"",b=p();d("CLOSE"),i.push({name:y||(A?s++:""),pattern:y&&!A?a:A,prefix:m,suffix:b,modifier:u("MODIFIER")||""})}else d("END")}}return i}(e,r),t,r)}function Dt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,o=r.exec(e.source);o;)t.push({name:o[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),o=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return Dt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),jt(r))}(e,t,r):$t(e,t,r)}var Kt=new Map,Vt=1e4,Wt=0;function Ht(e,t){var{path:r,exact:n=!1,strict:o=!1,sensitive:a=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:i,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Kt.get(r);n||Kt.set(r,n=new Map);var o=n.get(e);if(o)return o;var a=[],i={regexp:Dt(e,a,t),keys:a};return Wt<Vt&&(n.set(e,i),Wt++),i}(r,{end:n,strict:o,sensitive:a}),l=i.exec(e);if(!l)return null;var[c,...u]=l,d=e===c;return n&&!d?null:{path:r,url:"/"===r&&""===c?"/":c,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function zt(){return(zt=(0,a.A)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=qt(r,t.app.homepage,t.location.pathname);if(n&&(yield It(r,t)))return t.app.noAuthGuard||r.public||null==Sa||!Sa.auth||Sa.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function qt(e,t,r){return Ht(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Gt,Jt=Symbol.for("tpl.asyncComputedPropsFromHost"),Yt=Symbol.for("tpl.stateStoreId"),Qt=Symbol.for("tpl.externalForEachItem"),Xt=Symbol.for("tpl.externalForEachIndex"),Zt=Symbol.for("tpl.externalNoForEach"),er=new Set,tr=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}({}),rr={[tr.REQUEST_FAILED]:"Request Failed",[tr.SOMETHING_WENT_WRONG]:"Something went wrong!",[tr.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[tr.NETWORK_ERROR]:"Network error, please check your network."},nr={[tr.REQUEST_FAILED]:"请求失败",[tr.SOMETHING_WENT_WRONG]:"出现了一些问题!",[tr.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[tr.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},or="core/runtime",ar={en:rr,zh:nr},ir=Object.freeze({show:function(e){return Gt?Gt.resolve(e):"confirm"===e.type?confirm(e.content)?new Promise((e=>setTimeout((()=>{e()}),1))):new Promise(((e,t)=>setTimeout((()=>{t()}),1))):(alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1e3))))}});function sr(e){var{search:t,pathname:r}=e,n=r?window.btoa(encodeURIComponent(r)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie="SALOGINPATH=".concat(n,"; path=/"),document.cookie="SALOGINQUERY=".concat(o,"; path=/")}function lr(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t("".concat(or,":").concat(tr.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 cr(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var ur,dr,pr=!1;function fr(e){if(!(e instanceof R.HttpAbortError)){if(cr(e)&&!window.NO_AUTH_GUARD){if(pr)return;return pr=!0,void ir.show({type:"confirm",content:c.i18n.t("".concat(or,":").concat(tr.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=Ua().getFeatureFlags()["sso-enabled"],sr((t=C()).location),t.push(e?"/sso-auth/login":"/auth/login",{from:(0,o.A)((0,o.A)({},t.location),{},{state:void 0})}),pr=!1}),(()=>{pr=!1}))}console.error(e);var t=lr(e);t!==ur&&(ur=t,ir.show({type:"error",title:c.i18n.t("".concat(or,":").concat(tr.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{ur=void 0})))}}var vr=Object.freeze({show:function(e){dr?dr.resolve(e):alert(e.message)}});function hr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,o]=t,a=br(o,r,{element:e});for(var i of(e.addEventListener(n,a),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,a]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(o)))e.$$eventListeners.push([n,null,i])}))}function mr(e){return"string"==typeof e.action}function gr(e){return"string"==typeof e.useProvider}function yr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function Ar(e){return!!e.then}function br(e,t,r){return function(n){var a,i;for(var s of[].concat(e))if(Rt(s,(0,o.A)((0,o.A)({},t),{},{event:n})))if(Ar(s))br(s.then,t,r)(n);else if(mr(s)){var[l,c]=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":Cr(n,c,s.args,s.callback,t);break;case"window.open":Rr(n,s.args,t);break;case"location.reload":case"location.assign":Mr(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":xr(n,l,c,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"event.stopPropagation":n.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":Br(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Lr(n,c,s.args,t);break;case"handleHttpError":fr(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Or(n,c,s.args,null===(a=s.batch)||void 0===a||a,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":Pr(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=jr(s.args,t,n);Le(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":_r(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Ur(n,c,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":re("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[p]=jr(s.args,t,n);re(p);break;case"mode.setDashboardMode":case"mode.setDefaultMode":le("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else gr(s)?wr(n,s,t,r):yr(s)?Sr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&br(s.else,t,r)(n)}}function wr(e,t,r,n){return Er.apply(this,arguments)}function Er(){return(Er=(0,a.A)((function*(e,t,r,n){try{kr(e,yield Xe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(lr(e))}}))).apply(this,arguments)}function Sr(e,t,r,n){var a=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,T.isEvaluable)(i):ut(i))&&(l=Et(i,(0,o.A)((0,o.A)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)a.push(n.element);else if(t.multiple)a=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&a.push(c)}else if(l)l instanceof HTMLElement?a.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,T.isEvaluable)(s):ut(s))&&(u=Et(s,(0,o.A)((0,o.A)({},r),{},{event:e})));var d=[].concat(u),p=Le(r,"targetRef",": ".concat(d.join(", ")));a.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==a.length?function(e){return!!e.method}(t)?a.forEach((o=>{kr(e,o,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Nt(a,t.properties,(0,o.A)((0,o.A)({},r),{},{event:e})):console.error("target not found:",i||s)}function kr(e,t,r,n,o,a,i){return Ir.apply(this,arguments)}function Ir(){return Ir=(0,a.A)((function*(e,t,r,n,i,s,l){if("function"==typeof t[n]){var c=function(){var o=(0,a.A)((function*(){var o,a=jr(r.args,i,e,l);return gr(r)&&null!=Sa&&null!==(o=Sa.flowApi)&&void 0!==o&&o.isFlowApiProvider(r.useProvider)&&(a=yield Sa.flowApi.getArgsOfFlowApi(r.useProvider,a,n)),t[n](...a)}));return function(){return o.apply(this,arguments)}}();if(r.callback){var u=Fr(r.callback,i,s),d={progress:u("progress"),success:u("success"),error:u("error"),finally:u("finally")};if(gr(r)){var p,f=(0,o.A)((0,o.A)({},i),{},{event:e});if(Et(null===(p=r.poll)||void 0===p?void 0:p.enabled,f))return void function(e,t,r,n){var o,{progress:i,success:s,error:l,finally:c}=t,{expectPollStopImmediately:u,expectPollEnd:d}=r,{interval:p,leadingRequestDelay:f,continueOnError:v,delegateLoadingBar:h}=Et((0,m.pick)(r,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),n),g=Va();function y(){return A.apply(this,arguments)}function A(){return(A=(0,a.A)((function*(){var t;er.delete(o);try{var r;if(!(t=null===(r=Et(u,n))||void 0===r?void 0:r())){var a,f,m=yield e();(t=(null===(a=Et(u,n))||void 0===a?void 0:a())||g!==Va())||(null==i||i(m),null!==(f=Et(d,n))&&void 0!==f&&f(m)?(h&&window.dispatchEvent(new Event("request.end")),null==s||s(m),null==c||c()):b(null!=p?p:3e3))}}catch(e){var y;(t=(null===(y=Et(u,n))||void 0===y?void 0:y())||g!==Va())||(null==l||l(e),v?b(null!=p?p:3e3):null==c||c())}finally{h&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function b(e){o=setTimeout(y,e),er.add(o)}b(null!=f?f:0),h&&window.dispatchEvent(new Event("request.start"))}(c,d,r.poll,f)}try{var v=yield c();d.success(v)}catch(e){d.error(e)}finally{d.finally()}}else c()}else console.error("target has no method:",{target:t,method:n})})),Ir.apply(this,arguments)}function Cr(e,t,r,n,o){var a=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":a=2,i=!0;break;case"reload":i=!0;break;case"block":a=1,s="setBlockMessage"}var l=[];if(a>0&&((l=jr(r,o,e,{useEventDetailAsDefault:!0})).length=a),i&&n){var c=Fr(n,o,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}C()[s](...l)}function Rr(e,t,r){var[n,o,a]=jr(t,r,e);window.open(n,o||"_self",a)}function Tr(e,t,r,n,o,a){t?n.updateValues(e,r,(e=>jr(e,o,a)[0])):e.forEach((e=>{var{name:t,value:i}=jr([e],o,a)[0];n.updateValue(t,i,r)}))}function Or(e,t,r,n,o,a){if(!Array.isArray(r)||!r.every(d.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=jr(r,a,e);a.ctxStore.updateValue(i,s,t,o,a)}else Tr(r,n,t,a.ctxStore,a,e)}function Pr(e,t,r,n,o,a){if(Array.isArray(r)&&r.every(d.isObject)&&"update"===t)Tr(r,n,"replace",Be(a,"state.".concat(t),": ".concat(JSON.stringify(r))),a,e);else{var[i,s]=jr(r,a,e);Be(a,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,o,a)}}function _r(e,t,r,n){var[o,a]=jr(t,n,e);Ye(n,"formstate.update",": ".concat(o)).updateValue(o,a,"replace",r,n)}function Mr(e,t,r,n){if("assign"===t){var[o]=jr(r,n,e);location.assign(o)}else location[t]()}function xr(e,t,r,n,o){var a="localStorage"===t?localStorage:sessionStorage,[i,s]=jr(n,o,e);"setItem"===r?void 0!==s&&a.setItem(i,JSON.stringify(s)):a.removeItem(i)}function Br(e,t,r,n){console[t](...jr(r,n,e,{useEventAsDefault:!0}))}function Lr(e,t,r,n){var o=jr(r,n,e,{useEventAsDefault:!0});vr.show({type:t,message:o[0]})}function Ur(e,t,r,n,o,a){return Nr.apply(this,arguments)}function Nr(){return(Nr=(0,a.A)((function*(e,t,r,n,o,a){var i=()=>{var o,a=jr(r,n,e);return null==Sa||null===(o=Sa.messageDispatcher)||void 0===o?void 0:o[t](...a)};if(a){var s=Fr(a,n,o);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Fr(e,t,r){return function(n){return function(o){var a=null==e?void 0:e[n];if(a)try{var i=new CustomEvent("callback.".concat(n),{detail:o});br(a,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",o)}}}function jr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?Et(e,(0,o.A)((0,o.A)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}function $r(e){var t,{ref:r,runtimeContext:n,element:o}=e;if(r&&n.tplStateStoreId){var{hostBrick:a}=Be(n,"bindTemplateProxy"),i=a.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var l=function(e){if(u.ref===r){var t,n,i,s=t=>{t.bubbles&&t.stopPropagation(),a.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(t=u.refEvent)&&void 0!==t?t:e;o.addEventListener(l,s),null!==(i=(n=o).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),o.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function Dr(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:o}=Be(r,"unbindTemplateProxy"),a=o.tplHostMetadata;for(var[i,s]of(a.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}var Kr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Vr(e){e.replaceChildren()}function Wr(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;for(var r=e.child,n=[];r;){if(r.tag===Kr.BRICK){var o,a=r.type;a.includes("-")&&!customElements.get(a)&&console.error("Undefined custom element: ".concat(a)),"basic-bricks.script-brick"===a&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(a);r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(o=r.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Ut(i,r.properties),hr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Be({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),$r(r),r.portal?n.push(i):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(i))}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var s,l=r.return;l;){var c;if(l.childElements)l.tag===Kr.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0;if(l.tag===Kr.ROOT&&n.length>0&&("function"==typeof l.createPortal?l.createPortal():l.createPortal).append(...n),l.sibling)break;l=l.return}r=null===(s=l)||void 0===s?void 0:s.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}function Hr(e,t){return e.get(qr(e,t))}function zr(e,t,r){return e.set(qr(e,t),r),r}function qr(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Gr=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Jr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],Yr=new WeakMap,Qr=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,nn=new WeakMap,on=new WeakMap,an=new WeakSet;class sn{constructor(e,t){var r;(0,i.A)(this,an),(0,s.A)(this,"scope",void 0),(0,s.A)(this,"unknownBricks",void 0),(0,s.A)(this,"renderId",void 0),(0,l.A)(this,Yr,void 0),(0,l.A)(this,Qr,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,l.A)(this,Xr,new Map),(0,l.A)(this,Zr,void 0),(0,l.A)(this,en,new Map),(0,l.A)(this,tn,void 0),(0,l.A)(this,rn,void 0),(0,l.A)(this,nn,void 0),(0,l.A)(this,on,[]),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",zr(Yr,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequests(e){zr(rn,this,e)}memoizeMenuRequests(e,t){Hr(nn,this)||zr(nn,this,new WeakMap),Hr(nn,this).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,a.A)((function*(){var o,a;for(var i of e){var s;if(o=null===(s=Hr(nn,n))||void 0===s?void 0:s.get(i)){a=i;break}}var l,c=Hr(rn,n),u=o?c.indexOf(o):-1;if(-1===u){if(!r.length)return;c.push(...r)}else c.splice(u,c.length-u,...r);a&&a!==t&&(null===(l=Hr(nn,n))||void 0===l||l.delete(a)),yield Hr(Yr,n).mergeMenus(c)}))()}reBailout(e){return Hr(Yr,this).bailout(e)}reCatch(e,t){return Hr(Yr,this).catch(e,t)}didPerformIncrementalRender(e,t){var r=this;return(0,a.A)((function*(){for(var n=Hr(on,r).length-1;n>=0;n--){var o=Hr(on,r)[n];if(yield o(e,t))return!0}return!1}))()}performIncrementalRender(e){Hr(on,this).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Gr,..."page"===this.scope?Jr:[]];for(var n of r){var o=t[n];o&&Hr(Qr,this)[n].push({brick:e,handlers:o})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=Hr(en,this).get(e);r?r.add(t):Hr(en,this).set(e,new Set([t]))}memoize(e,t,r,n){Hr(tn,this)||zr(tn,this,new WeakMap);var o=[null!=e?e:"",...t].join("."),a=Hr(tn,this).get(n);a||(a=new Map,Hr(tn,this).set(n,a)),a.set(o,{node:r,last:pn(r),lastNormal:fn(r),lastPortal:hn(r)})}reRender(e,t,r,n){var o,a=[null!=e?e:"",...t].join("."),i=Hr(tn,this).get(n).get(a),{node:s,last:l,lastNormal:c,lastPortal:u}=i,d=[];if((null==s?void 0:s.tag)===Kr.PLACEHOLDER){var p,f,v;o=null!==(p=null===(f=function(e){return vn(e,!0)}(s))||void 0===f?void 0:f.element)&&void 0!==p?p:null;var h=null===(v=function(e){return mn(e,!0)}(s))||void 0===v?void 0:v.element;h&&d.push(h)}else{var m,g,y;o=null!==(m=null==c||null===(g=c.element)||void 0===g?void 0:g.nextSibling)&&void 0!==m?m:null;for(var A=null==u||null===(y=u.element)||void 0===y?void 0:y.nextSibling;A&&(d.push(A),A instanceof HTMLElement&&"DIV"===A.tagName);)A=A.nextSibling}var b,w=pn(r);i.node=r,i.last=w,i.lastNormal=fn(r),i.lastPortal=hn(r);for(var E=n.child;E&&E!==l;){if(E.sibling===s){b=E;break}E=E.sibling}var S=document.createDocumentFragment(),k=document.createDocumentFragment(),I={tag:Kr.ROOT,container:S,createPortal:k,child:r};for(E=r;E;)E.return=I,E=E.sibling;var C,R,T=gn(s,l);for(qr(an,this,ln).call(this,T),Wr(I),b?b.sibling=r:n.child=r,w&&(w.sibling=null==l?void 0:l.sibling),E=r;E;)E.return=n,E=E.sibling;if(n.tag===Kr.ROOT?null===(C=n.container)||void 0===C||C.insertBefore(S,o):null===(R=n.element)||void 0===R||R.insertBefore(S,o),k.childNodes.length>0){for(var O,P=r;P&&P.return;)P=P.return;if((null===(O=P)||void 0===O?void 0:O.tag)!==Kr.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");var _="function"==typeof P.createPortal?P.createPortal():P.createPortal,M=null;for(var x of d)if(_.contains(x)){M=x;break}_.insertBefore(k,M)}var B=gn(r,w);qr(an,this,cn).call(this,B)}dispose(){for(var e of Object.values(Hr(Qr,this)))e.length=0;for(var t of Hr(Xr,this).values()){for(var r of t)r.disconnect();t.length=0}Hr(Xr,this).clear(),Hr(Zr,this)&&(Ee.removeEventListener("change",Hr(Zr,this)),zr(Zr,this,void 0)),zr(tn,this,void 0),zr(rn,this,void 0),zr(nn,this,void 0),Hr(en,this).clear(),Hr(on,this).length=0}dispatchBeforePageLoad(){qr(an,this,un).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");qr(an,this,un).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){qr(an,this,un).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){qr(an,this,un).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=C().location;e&&"#"!==e?qr(an,this,un).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):qr(an,this,un).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of Hr(Qr,this).onScrollIntoView)qr(an,this,dn).call(this,e,t)}initializeMediaChange(){zr(Zr,this,(e=>{qr(an,this,un).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),Ee.addEventListener("change",Hr(Zr,this))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==Sa||null===(r=Sa.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{br(t.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:r}))}))};for(var r of[].concat(n))t(r)};for(var{brick:r,handlers:n}of Hr(Qr,this).onMessage)t(r);null==Sa||null===(e=Sa.messageDispatcher)||void 0===e||e.onClose((()=>{qr(an,this,un).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){qr(an,this,un).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){qr(an,this,un).call(this,"onUnmount",new CustomEvent("unmount"))}}function ln(e){var t=[...Gr,..."page"===this.scope?Jr:[]],r=[];for(var n of t){var o=(0,m.remove)(Hr(Qr,this)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...o)}for(var a of e){var i,s,l=Hr(Xr,this).get(a);if(null!=l&&l.length){for(var c of l)c.disconnect();l.length=0,Hr(Xr,this).delete(a)}Dr(a),null===(i=a.element)||void 0===i||delete i.$$tplStateStore,null===(s=a.element)||void 0===s||s.remove()}var u=new CustomEvent("unmount");for(var{brick:d,handlers:p}of r)br(p,d.runtimeContext,d)(u)}function cn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of Hr(Qr,this).onMount)e.has(r)&&br(n,r.runtimeContext,r)(t);for(var{brick:o,handlers:a}of Hr(Qr,this).onScrollIntoView)e.has(o)&&qr(an,this,dn).call(this,o,a)}function un(e,t){for(var{brick:r,handlers:n}of Hr(Qr,this)[e])br(n,r.runtimeContext,r)(t);var o=Hr(en,this).get(e);if(o)for(var a of o)a()}function dn(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,o=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(br(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});o.observe(e.element);var a=Hr(Xr,this).get(e);a||(a=[],Hr(Xr,this).set(e,a)),a.push(o)}function pn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function fn(e){return vn(e,!1)}function vn(e,t){for(var r,n=e;n;){if(n.tag===Kr.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function hn(e){return mn(e,!1)}function mn(e,t){for(var r,n=e;n;){if(n.tag===Kr.BRICK&&n.portal){if(t)return n;r=n}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{for(var o,a=n.return;a&&!a.sibling;)a=a.return;n=null===(o=a)||void 0===o?void 0:o.sibling}}return r}function gn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Kr.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var o,a=n.return;a&&a!==t&&!a.sibling;)a=a.return;if(a===t)break;n=null===(o=a)||void 0===o?void 0:o.sibling}}return r}var yn=Symbol.for("root.runtimeContext");function An(e,t){return bn.apply(this,arguments)}function bn(){return(bn=(0,a.A)((function*(e,t){var r,n,a,i,s,[l,c,u]=ko((0,o.A)((0,o.A)({},null!==(r=e[yn])&&void 0!==r?r:Wa()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(n=l.tplStateStoreMap)&&void 0!==n||(l.tplStateStoreMap=new Map),null!==(a=l.formStateStoreMap)&&void 0!==a||(l.formStateStoreMap=new Map);var d=new sn("fragment"),p={tag:Kr.ROOT,createPortal:null},f=e.transform,v=Te();f&&Oe(v,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var h=yield Ao(p,v?e:(0,o.A)((0,o.A)({},e),{},{properties:(0,o.A)((0,o.A)({},e.properties),f)}),l,d,[]),m=[...c,...u];if(yield So(h,l,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Kr.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(s=h.node)&&void 0!==s&&s.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return p.child=h.node,{tagName:h.node?h.node.type:null,renderRoot:p,rendererContext:d,scopedStores:m}}))).apply(this,arguments)}function wn(e,t){var r,{renderRoot:n,rendererContext:o,scopedStores:a}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},Wr(n,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher(),a))i.mountAsyncData();return{portal:r}}function En(e,t){var{rendererContext:r}=e;t.portal&&(Vr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function Sn(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return Et(t,(0,o.A)((0,o.A)({},Wa()),{},{data:e}),{noInject:!0})}function kn(e,t){var r=Ha(e);Object.assign(r,(0,o.A)((0,o.A)({},t),{},{meta:(0,o.A)((0,o.A)({},r.meta),t.meta),$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),L(r)}function In(e,t){var r=Ha(e),n=!1,o=e=>"".concat(e.path,".").concat(e.exact),a=(e,r)=>e.map((e=>{var i=o(e);return"routes"===e.type?(e.routes=a(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=a(r.routes,o(t)),n||r.routes.unshift(t)}function Cn(e,t,r){var n="".concat(e,".").concat(t.name);xe.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Rn(e,t.name,r)}function Rn(e,t,r){Mn(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,o.A)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context","slots","children"))])}function Tn(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function On(e,t){var r;Mn(e,Tn(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var Pn,_n=On;function Mn(e,t,r,n){var{routes:o}=Ha(e),a=o.findIndex((e=>e.path===t)),i={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===a?o.unshift(i):o.splice(a,1,i)}function xn(e,t){var{tplStateStoreId:r}=t,n=Wa();return r?Be((0,o.A)((0,o.A)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function Bn(e){var{tplStateStoreId:t}=e,r=Wa();return t?Be((0,o.A)((0,o.A)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Ln(e){return Ka().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Un(){return Va()}function Nn(e,t){return Fn.apply(this,arguments)}function Fn(){return(Fn=(0,a.A)((function*(e,t){var r,{appId:n,updateStoryboardType:o,collectUsedContracts:a}=t,i=Ha(n);if("route"===o)r={routes:[e]};else if("template"===o)r={meta:{customTemplates:[e]}};else if("snippet"===o){var s,l=Tn(e.snippetId);r={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===l))]}}var c=[];return r&&a&&(yield a(r)).forEach((e=>{var t,[r,n,o]=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===n&&e.name===o))||c.push(e)})),c}))).apply(this,arguments)}var jn=[];function $n(e){Pn=e;var t=Bn({tplStateStoreId:e.tplStateStoreId});Kn({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Dn(e){jn.push(e)}function Kn(e){setTimeout((()=>{for(var t of jn)try{t(e)}catch(t){console.error("RealTimeDataInspectHook failed (".concat(e.changeType,"):"),t)}}))}var Vn=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Wn{constructor(e,t,r,n){(0,s.A)(this,"type",void 0),(0,s.A)(this,"data",new Map),(0,s.A)(this,"changeEventType",void 0),(0,s.A)(this,"pendingStack",[]),(0,s.A)(this,"hostBrick",void 0),(0,s.A)(this,"stateStoreId",void 0),(0,s.A)(this,"batchUpdate",!1),(0,s.A)(this,"batchUpdateContextsNames",[]),(0,s.A)(this,"rendererContext",void 0),(0,s.A)(this,"routeMap",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=r,this.stateStoreId=n}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Pn){var{tplStateStoreId:r}=Pn;(r?"STATE"===this.type&&this.stateStoreId===r:"CTX"===this.type)&&Kn({changeType:"update",tplStateStoreId:r,detail:{name:e,value:t}})}}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){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");var n={},o={},a=[];e.forEach((e=>{var{name:o,value:i}=r([e]),s=this.data.get(o);a.push(...this.getAffectListByContext(o)),s&&(n[o]=s),this.updateValue(o,i,t)})),a.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(o[e]=t)}));var i=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};i(n),i(o),this.batchUpdate=!1}updateValue(e,t,r,n,a){var i=this.data.get(e);if(!i)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?i.value=t:(0,d.isObject)(i.value)?Object.assign(i.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(e,'" for "context.assign", try "context.replace" instead.')),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which is not using resolve'));var s;"load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));var l=e=>{var t,r;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(r=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&r!==Va()};if(s||(s=i.loading=i.load((0,o.A)({cache:"load"===r?"default":"reload"},t))).then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||l(e)||null!=n&&n.error||fr(e)})),n){var c=Fr(n,a);s.then((e=>{c("success")({value:e}),c("finally")()}),(e=>{!l(e)&&n.error&&c("error")(e),c("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,r,n){if(Array.isArray(e)&&e.length>0){var o=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX",n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",r=arguments.length>2?arguments[2]:void 0,n=new Map;for(var o of e){var a=[o.if,o.value,o.resolve],i=(0,O.collectMemberUsage)(a,t);if(!r&&"STATE"===t){var s=(0,O.collectMemberUsage)(a,"TPL");for(var l of s.usedProperties)i.usedProperties.add(l);s.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}n.set(o,i)}return n}(e,r,arguments.length>3?arguments[3]:void 0),o=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;o.set(i,(null!==(s=o.get(i))&&void 0!==s?s:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),c=new WeakSet,u=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),p=function(){var e=(0,a.A)((function*(e){var r;c.add(e);var a=yield t(e);n.delete(e);var i=null!==(r=o.get(e.name))&&void 0!==r?r:0;if(a){if(u.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=l;function v(){return h.apply(this,arguments)}function h(){return h=(0,a.A)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(o,f)).map((e=>e[0])).filter((e=>!c.has(e)));yield Promise.all(e.map(p))})),h.apply(this,arguments)}return{pendingResult:v().then((0,a.A)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),o=()=>{var e=!1;for(var[t,a]of r.entries())[...a.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&o()};if(o(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r,n)),this.type,Te(t));this.pendingStack.push(o)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,a.A)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,a.A)((function*(){for(var{pendingContexts:t}of e.pendingStack)for(var r of t.values())r.catch((()=>{}));for(var{pendingResult:n}of e.pendingStack)yield n}))()}mountAsyncData(e){this.data.forEach((t=>{var r;if(t.async&&(!e||null!==(r=this.routeMap.get(e))&&void 0!==r&&r.has(t.name))){if(t.asyncMounted)return void console.error('Async data "'.concat(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)}))}}))}resolve(e,t,r,n){var i=this;return(0,a.A)((function*(){if(!(yield It(e,t)))return!1;var s,l,c,u,p,f;if(r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield Mt(r,e.name)),void 0===s){if(e.resolve){var v=(0,d.hasOwnProperty)(e,"value");p=e.track&&v&&(0,d.hasOwnProperty)(e.resolve,"if")&&(0,O.strictCollectMemberUsage)(e.resolve.if,i.type).size>0;var h=(0,o.A)({transform:"value"},e.resolve);if(((u=yield It(e.resolve,t))||p)&&(l=function(){var e=(0,a.A)((function*(e){var r;return(yield ot(h,t,(0,o.A)((0,o.A)({},e),{},{renderId:null===(r=i.rendererContext)||void 0===r?void 0:r.renderId}))).value}));return function(t){return e.apply(this,arguments)}}()),u)"eager"==(f=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield l():"async"===f&&(c=l());else if(!v)return!1}u&&"eager"===f||void 0===e.value||(s=yield bt(e.value,t))}if(i.data.has(e.name))throw new Error("".concat(i.type," '").concat(e.name,"' has already been declared"));var m={name:e.name,value:s,eventTarget:new Ae,useResolve:u,load:l,loaded:"eager"===f,loading:c,async:"async"===f,deps:[]};if("lazy"===f){var g,{trigger:y}=e.resolve;y&&Vn.includes(y)&&(null===(g=i.rendererContext)||void 0===g||g.registerArbitraryLifeCycle(y,(()=>{i.updateValue(e.name,void 0,"load")})))}if(e.onChange&&m.eventTarget.addEventListener(i.changeEventType,br(e.onChange,t)),e.track){var A=(0,O.strictCollectMemberUsage)(p?[e.resolve,e.value]:l?e.resolve:e.value,i.type);for(var b of(!l&&(m.deps=[...A]),A))i.onChange(b,i.batchAddListener((()=>{m.useResolve=p?Rt(e.resolve,t):!!l,m.useResolve?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,Et(e.value,t),"replace")}),e))}if(m.eventTarget.addEventListener(i.changeEventType,(t=>{i.notifyRealTimeDataChange(e.name,t.detail)})),i.data.set(e.name,m),Array.isArray(n))for(var w of n){var E=i.routeMap.get(w);E?E.add(e.name):i.routeMap.set(w,new Set([e.name]))}return!0}))()}disposeDataInRoutes(e){for(var t of e){var r=this.routeMap.get(t);if(void 0!==r)for(var n of r)this.data.delete(n)}}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}var Hn=r(11369);function zn(e,t,r){var n,o,{reversedProxies:a,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&a){var u=a.properties.get(t);u&&(o=i,n=u.map((e=>{var{from:t,to:r}=e,n=o.filter((e=>e[0]===t));if(n.length>0&&r.refProperty)return[r.refProperty,Mt(n,t),!0]})).filter(Boolean));var p=a.slots.get(t);if(p&&s){var f=new Map;for(var{from:v,to:h}of p){var g,y,A,b,w=null!==(g=null===(y=s[v])||void 0===y?void 0:y.bricks)&&void 0!==g?g:[];if(w.length){var E=null!==(A=h.refSlot)&&void 0!==A?A:v,S=f.get(E);if(!S){S=[];for(var k=(0,d.hasOwnProperty)(r,E)?r[E].bricks.length+1:1,I=0;I<k;I+=1)S.push([]);f.set(E,S)}var C=null!==(b=h.refPosition)&&void 0!==b?b:-1,R=(0,d.hasOwnProperty)(c.runtimeContext,"forEachItem");S[(0,m.clamp)(C<0?S.length+C:C,0,S.length-1)].push(..."base-layout-v3.tpl-scroll-load-list"!==e.__temporary_tpl_tag_name&&"shrcb-homepage.tpl-custom-scroll-load-list"!==e.__temporary_tpl_tag_name||R?qn(w,R,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex):w)}}var T=function(){(0,d.hasOwnProperty)(r,O)||(r[O]={type:"bricks",bricks:[]});var e=r[O];e.bricks=P.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[O]};for(var[O,P]of f.entries())T()}}return{[Jt]:n,[Yt]:l}}function qn(e,t,r,n){return e.map((e=>{var a,{children:i,slots:s,[Qt]:l,[Xt]:c,[Zt]:u}=e,d=(0,h.A)(e,["children","slots",Qt,Xt,Zt].map(Hn.A));return(0,o.A)((0,o.A)((0,o.A)({},d),t?{[Qt]:r,[Xt]:n}:{[Zt]:!0}),{},{slots:":forEach"===d.brick?Co(i,s):Object.fromEntries(Object.entries(null!==(a=Co(i,s))&&void 0!==a?a:{}).map((e=>{var[o,a]=e;return[o,"routes"===a.type?{type:"routes",routes:Gn(a.routes,t,r,n)}:{type:"bricks",bricks:qn(a.bricks,t,r,n)}]})))})}))}function Gn(e,t,r,n){return e.map((e=>"routes"===e.type?(0,o.A)((0,o.A)({},e),{},{routes:Gn(e.routes,t,r,n)}):"redirect"===e.type?e:(0,o.A)((0,o.A)({},e),{},{bricks:qn(e.bricks,t,r,n)})))}var Jn=["properties","slots","children"];function Yn(e,t){function r(e){return(0,d.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,o]=e;return(0,d.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(n)]:[t,n(o)]:[t,r(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:a,slots:i,children:s}=e,l=(0,h.A)(e,Jn),c=Co(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t,[r,o]=e;return[r,{type:"bricks",bricks:(null!==(t=o.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,o.A)((0,o.A)({},l),{},{properties:r(a),slots:u},zn(t,l.ref,u))}return r(e)}var Qn=["slots","children"],Xn=["properties","slots","children"];function Zn(e,t,r,n,a){var i,s=(0,m.uniqueId)("tpl-state-"),l=(0,o.A)((0,o.A)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.forEachIndex,delete l.formStateStoreId;var c=new Wn("STATE",r,a,s);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:p,contracts:f}=xe.get(e);null==Sa||null===(i=Sa.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(p,l,n);var{slots:v,children:g}=t,y=(0,h.A)(t,Qn),A=(0,o.A)((0,o.A)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var b={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[w,E]of Object.entries(d.properties)){var S=b.properties.get(E.ref);S||(S=[],b.properties.set(E.ref,S)),S.push({from:w,to:E})}if(null!=d&&d.slots)for(var[k,I]of Object.entries(d.slots)){var C=b.slots.get(I.ref);C||(C=[],b.slots.set(I.ref,C)),C.push({from:k,to:I})}var R={reversedProxies:b,asyncHostPropertyEntries:n,externalSlots:Co(g,v),tplStateStoreId:s,hostBrick:r,__temporary_tpl_tag_name:e};return A.slots={"":{type:"bricks",bricks:u.map((e=>eo(e,R)))}},A}function eo(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:a}=e,i=(0,h.A)(e,Xn),s=Co(a,n),l=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,o]=e;return[n,{type:"bricks",bricks:(null!==(r=o.bricks)&&void 0!==r?r:[]).map((e=>eo(e,t)))}]})));return(0,o.A)((0,o.A)({},i),{},{properties:Yn(r,t),slots:l},zn(t,i.ref,l))}var to="form-renderer.form-renderer",ro=Symbol.for("form.stateStoreId"),no=["forms.general-form","form.general-form","eo-form"];function oo(e,t,r){var{id:n,bricks:a,events:i,context:s,mountPoint:l,instanceId:c}=e,{brick:u,properties:p}=e,f=t.find((e=>e.fieldId===n));if(f){var v=function(e){var t,r={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},n=()=>{var t,r;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(r=e.limit)||void 0===r?void 0:r.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,o.A)((0,o.A)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUMS":t={brick:"forms.general-select",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{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:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{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:(0,o.A)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,o.A)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,o.A)((0,o.A)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,o.A)((0,o.A)((0,o.A)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),p=(0,o.A)((0,o.A)({},v.properties),p)}var h={brick:u,properties:p,iid:c,slot:l,events:i,context:s,children:ao(a,t,r),[ro]:r};return(0,d.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function ao(e,t,r){if(Array.isArray(e))return e.map((e=>oo(e,t,r)))}var io,so,lo,co=["blockingList","node","menuRequests","hasTrackingControls"],uo=["if","permissionsPreCheck"],po=["formData"],fo=["src"],vo=["href"];function ho(e,t,r,n,o,a,i){return mo.apply(this,arguments)}function mo(){return mo=(0,a.A)((function*(e,t,r,n,a,i,s){var l=yield function(e,t){return zt.apply(this,arguments)}(t,r),c={blockingList:[],menuRequests:[]};switch(l){case"missed":break;case"unauthenticated":c.unauthenticated=!0;break;default:var d,p=c.route=l.route;c.path=l.match.path;var f=(0,o.A)((0,o.A)({},r),{},{match:l.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=a.concat(p);f.ctxStore.define(p.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==Sa||null===(d=Sa.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(p,(e=>bt(e,f))));var{preLoadBricks:h}=p;if(Array.isArray(h)&&c.blockingList.push((0,u.loadBricksImperatively)(h,Ka())),"redirect"===p.type){var m;if("string"!=typeof(m="string"==typeof p.redirect?yield bt(p.redirect,f):(yield ot((0,o.A)({transform:"redirect"},p.redirect),f)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));c.redirect={path:m}}else{var g=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 bt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(p.menu,f);g&&c.menuRequests.push(g),"routes"===p.type?Io(c,yield ho(e,p.routes,f,n,v,i)):Io(c,yield go(e,p.bricks,f,n,v,i)),e.tag===Kr.BRICK&&n.memoizeMenuRequests(p,c.menuRequests)}}return c})),mo.apply(this,arguments)}function go(e,t,r,n,o,a,i,s){return yo.apply(this,arguments)}function yo(){return(yo=(0,a.A)((function*(e,t,r,n,o,a,i,s){var l={blockingList:[],menuRequests:[]},c=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>Ao(e,t,r,n,o,a,c.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(a,c.concat(r),t.node,e),Io(l,t)})),l}))).apply(this,arguments)}function Ao(e,t,r,n,o,a){return bo.apply(this,arguments)}function bo(){return bo=(0,a.A)((function*(e,t,r,n,i,s){var l,c,p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,v={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),v;var{if:g,permissionsPreCheck:A}=t,b=(0,h.A)(t,uo);if(function(e){return"string"==typeof e?(0,T.isTrackAll)(e):ut(e)&&(0,T.isTrackAll)(dt(e))}(g))return Ao(e,(0,o.A)({brick:":if",dataSource:g,permissionsPreCheck:A,slots:{"":{type:"bricks",bricks:[b]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,o.A)((0,o.A)({},e),{},{[r]:t[r]})),{})),r,n,i,s,p,f);var w=t[Yt],E=t[ro],S=(0,o.A)((0,o.A)({},r),{},{tplStateStoreId:w,formStateStoreId:E});(0,d.hasOwnProperty)(t,Qt)?(S.forEachItem=t[Qt],S.forEachIndex=t[Xt]):t[Zt]&&(delete S.forEachItem,delete S.forEachIndex);var{context:k}=t;if(Array.isArray(k)&&k.length>0){var I=Te(S);Oe(I,"Defining context on bricks","check your brick:",t),I||S.ctxStore.define(k,S)}if(S.pendingPermissionsPreCheck.push(null==Sa||null===(l=Sa.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>bt(e,S)))),!(yield function(e,t){return Ot.apply(this,arguments)}(t,S)))return v;var C=t.brick;if(C.startsWith(":")){var R;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(C);var{dataSource:P}=t,_=function(){var r=(0,a.A)((function*(r){var o,a=yield bt(P,r),l=":forEach"===C?"":":switch"===C?String(a):a?"":"else",c=Co(t.children,t.slots),u=c&&(0,d.hasOwnProperty)(c,l)&&(null===(o=c[l])||void 0===o?void 0:o.bricks);if(!Array.isArray(u))return{blockingList:[],menuRequests:[]};switch(C){case":forEach":return Array.isArray(a)?function(e,t,r,n,o,a,i,s,l){return wo.apply(this,arguments)}(e,a,u,r,n,i,s,f,p):{blockingList:[],menuRequests:[]};case":if":case":switch":return go(e,u,r,n,i,s,f,p)}}));return function(e){return r.apply(this,arguments)}}(),M=function(){var t=(0,a.A)((function*(t){var r,n=yield _(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Kr.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),x=yield M(S),{onMount:B,onUnmount:L}=null!==(R=t.lifeCycle)&&void 0!==R?R:{},{contextNames:U,stateNames:N}=_t(P);if(U||N){x.hasTrackingControls=!0;var F=0,j=function(){var t=(0,a.A)((function*(){var t=++F,[r,o,a]=ko(S),i=yield M(r),l=[...o,...a];if(yield So(i,r,l),F===t)for(var c of(L&&br(L,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,p,i.node,e),B&&br(B,r)(new CustomEvent("mount",{detail:{rerender:!0}})),l))c.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),$=(0,m.debounce)(j);if(U)for(var D of U)S.ctxStore.onChange(D,$);if(N)for(var K of N)Be(S,"STATE",': "'.concat(P,'"')).onChange(K,$)}return B&&n.registerArbitraryLifeCycle("onMount",(()=>{br(B,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),L&&n.registerArbitraryLifeCycle("onUnmount",(()=>{br(L,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),x}/\.tpl-/.test(C)&&!xe.get(C)&&(yield Ro((0,u.loadBricksImperatively)([C],Ka()),"brick",C,n.unknownBricks));var V,W,H=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(xe.get(r))return r}return!!xe.get(e)&&e}(C,null===(c=S.app)||void 0===c?void 0:c.id);if(H){var z,q=null!==(z=f.get(H))&&void 0!==z?z:0;if(q>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(H,'"'));f.set(H,q+1)}else C.includes("-")&&!customElements.get(C)&&(C===to?customElements.define(to,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):v.blockingList.push(Ro((0,u.enqueueStableLoadBricks)([C],Ka()),"brick",C,n.unknownBricks)));if(C===to){var G,J=null!==(G=t.properties)&&void 0!==G?G:{};({formData:V}=J),W=(0,h.A)(J,po)}else W=t.properties;var Y=[],Q=function(e,t,r){return(0,d.isObject)(e)?Object.entries(e).map((e=>{var[n,o]=e,{contextNames:a,stateNames:i,formStateNames:s}=_t(o);return(a||i||s)&&r.push({contextNames:a,stateNames:i,formStateNames:s,propName:n,propValue:o}),[n,bt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?gt.USE_BRICK:gt.INITIAL})]})):[]}(W,S,Y),X=t[Jt];X&&Q.push(...X);var Z="script"===C;if(Z||"link"===C){var ee=yield Bt(Q);if(Z?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(Z){var{src:ne}=ee,oe=(0,h.A)(ee,fo);yield Ro((0,u.loadScript)(ne,re,oe),"script",ne,"silent")}else{var{href:ae}=ee;oe=(0,h.A)(ee,vo),yield Ro((0,u.loadStyle)(ae,re,oe),"stylesheet",ae,"silent")}return v}}var ie={tag:Kr.BRICK,type:H||C,return:e,slotId:s,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};v.node=ie;var se=(0,O.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&v.blockingList.push(Ro((0,u.loadProcessorsImperatively)(se,Ka()),"processors",[...se].join(", "),n.unknownBricks));var le=[],ce=function(){var e=(0,a.A)((function*(){ie.properties=yield Bt(Q),function(e,t){var r=function(t){var r=()=>{e.element&&Nt(e.element,{[t.propName]:t.propValue},e.runtimeContext)};if(t.contextNames)for(var n of t.contextNames)e.runtimeContext.ctxStore.onChange(n,r);if(t.stateNames){var o=Be(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var a of t.stateNames)o.onChange(a,r)}if(t.formStateNames){var i=Ye(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)i.onChange(s,r)}};for(var n of t)r(n)}(ie,Y)}));return function(){return e.apply(this,arguments)}}();le.push(ce()),n.registerBrickLifeCycle(ie,t.lifeCycle);var ue,de=t;H?de=Zn(H,t,ie,Q,n):C===to&&(de=function(e,t,r,n,a){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,m.uniqueId)("form-state-"),u=(0,o.A)((0,o.A)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var p=new Wn("FORM_STATE",void 0,a,c);u.formStateStoreMap.set(c,p),u.formStateStoreScope&&u.formStateStoreScope.push(p);var f=null!==(i=l.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),p.define(f,u,n);var v=oo(l.formSchema,l.fields,c);return no.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,o]of Object.entries(t))r[n]=(0,d.hasOwnProperty)(r,n)?[r[n],o].flat():o;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,o.A)((0,o.A)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,o.A)((0,o.A)({},t),{},{slots:void 0,children:[v]})}(V,t,ie,Q,n)),de.portal&&(ie.slotId=void 0),H?(delete(ue=(0,o.A)({},S)).forEachItem,delete ue.forEachIndex):ue=S;var pe=function(){var e=(0,a.A)((function*(){var e=Co(de.children,de.slots);if(e){var t=new Map,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var[s,l]=e;if("routes"!==l.type)return go(ie,l.bricks,ue,n,i,s,f);var c=i[i.length-1];return null!=c&&c.incrementalSubRoutes&&(t.set(r,s),n.performIncrementalRender(function(){var e=(0,a.A)((function*(e,t){var{homepage:r}=ue.app,{pathname:a}=e;if(!y(r,a)||!i.every((e=>{var n,o;return(n=qt(e,r,t.pathname))&&(o=qt(e,r,a))&&(e!==c||(0,m.isEqual)(n.params,o.params))})))return!1;var u,[d,p,f]=ko((0,o.A)((0,o.A)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),v=!1,h=[];try{if(u=yield ho(ie,l.routes,d,n,i,s,!0),n.reBailout(u))return!0;h=[...p,...f],yield So(u,d,[d.ctxStore,...h]),yield n.reMergeMenuRequests(l.routes,u.route,u.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var g=n.reCatch(e,ie);if(!g)return!0;({failed:v,output:u}=g),yield n.reMergeMenuRequests(l.routes,u.route,u.menuRequests)}if(n.reRender(s,[],u.node,ie),!v)for(var A of(d.ctxStore.mountAsyncData(u.route),h))A.mountAsyncData();return!0}));return function(t,r){return e.apply(this,arguments)}}())),ho(ie,l.routes,ue,n,i,s)}))),s=(0,o.A)((0,o.A)({},v),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(t.get(r),[],e.node,ie),Io(s,e)})),s.node&&(ie.child=s.node),Io(v,(0,o.A)((0,o.A)({},s),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return le.push(pe()),yield Promise.all(le),v})),bo.apply(this,arguments)}function wo(){return(wo=(0,a.A)((function*(e,t,r,n,a,i,s,l,c){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,p)=>Ao(e,r,(0,o.A)((0,o.A)({},n),{},{forEachItem:t,forEachIndex:u}),a,i,s,c.concat(u*d+p),l&&new Map(l))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&a.memoize(s,c.concat(r),t.node,e),Io(u,t)})),u}))).apply(this,arguments)}function Eo(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function So(e,t,r){return(0,u.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function ko(e){var t=[],r=[];return[(0,o.A)((0,o.A)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function Io(e,t){var{blockingList:r,node:n,menuRequests:o,hasTrackingControls:a}=t,i=(0,h.A)(t,co);if(e.blockingList.push(...r),e.menuRequests.push(...o),n)if(e.node){for(var s=e.node;s.sibling;)s=s.sibling;s.sibling=n}else e.node=n;Object.assign(e,i)}function Co(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var o,a=null!==(o=n.slot)&&void 0!==o?o:"";(0,d.hasOwnProperty)(r,a)||(r[a]={type:"bricks",bricks:[]}),r[a].bricks.push(n)}return r}function Ro(e,t,r,n){return"silent"===n?e.catch((e=>{console.error('Load %s "%s" failed:',t,r,e)})):e}function To(){if(!io){if(io={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){io.isInIframe=!0;try{if(window.origin===window.parent.origin){io.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");io.isInIframeOfNext=0==(Number(e)^Number(r)),io.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),io.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(io)}return io}function Oo(e){var t;if(!e.$$registerCustomTemplateProcessed){e.$$registerCustomTemplateProcessed=!0;var r=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(r))for(var n of r){var o=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);xe.define(o,n)}}}function Po(){return Po=(0,a.A)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return _o.apply(this,arguments)}(e)),e.$$fulfilling})),Po.apply(this,arguments)}function _o(){return(_o=(0,a.A)((function*(e){var t;yield null==Sa||null===(t=Sa.fulfilStoryboard)||void 0===t?void 0:t.call(Sa,e),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}function Mo(e){var t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}var xo="basic.show-watermark";function Bo(e,t){return e.get(Uo(e,t))}function Lo(e,t,r){return e.set(Uo(e,t),r),r}function Uo(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var No=new WeakMap,Fo=new WeakMap,jo=new WeakMap,$o=new WeakMap,Do=new WeakMap,Ko=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,Ho=new WeakMap,zo=new WeakMap,qo=new WeakMap,Go=new WeakMap,Jo=new WeakSet;class Yo{constructor(e){(0,i.A)(this,Jo),(0,l.A)(this,No,void 0),(0,l.A)(this,Fo,!1),(0,l.A)(this,jo,void 0),(0,l.A)(this,$o,void 0),(0,l.A)(this,Do,void 0),(0,l.A)(this,Ko,void 0),(0,l.A)(this,Vo,new Set),(0,l.A)(this,Wo,0),(0,l.A)(this,Ho,void 0),(0,l.A)(this,zo,void 0),(0,l.A)(this,qo,void 0),(0,l.A)(this,Go,void 0),Lo(No,this,e);var t=C();window.addEventListener("beforeunload",(e=>{Uo(Jo,this,Qo).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>Uo(Jo,this,Qo).call(this,{location:e,action:t})))}getRenderId(){return Bo(Ho,this)}getRuntimeContext(){return Bo(Do,this)}getRecentApps(){return{currentApp:Bo(zo,this),previousApp:Bo(qo,this)}}getNavConfig(){return Bo(Go,this)}bootstrap(){var e=this;window.AbortController&&(so=new AbortController,R.http.interceptors.request.use((e=>{var t;return(0,o.A)((0,o.A)({},e),{},{options:(0,o.A)((0,o.A)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:so.signal})})})));var t=C();Lo(jo,this,t.location);var r=0;return t.listen(function(){var t=(0,a.A)((function*(t,n){var a,i,s,l,c,u,d=++r,p={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==Bo(jo,e).key&&!1!==(null===(a=Bo(jo,e).state)||void 0===a?void 0:a.notify))||(p.key=void 0),((0,f.locationsAreEqual)((0,o.A)((0,o.A)({},Bo(jo,e)),p),(0,o.A)((0,o.A)({},t),p))||"POP"!==n&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(c=!0),c||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(c=yield null===(u=Bo(Ko,e))||void 0===u?void 0:u.didPerformIncrementalRender(t,Bo(jo,e))),r===d)if(c)Lo(jo,e,t);else{if(so&&(so.abort(),so=new AbortController),Lo(jo,e,t),null===(l=Bo(Ko,e))||void 0===l||l.dispatchPageLeave(),"POP"===n&&A(g(Bo(No,e),t.pathname)))return void window.location.reload();Bo(Fo,e)?Lo($o,e,t):(W("locationChange"),Uo(Jo,e,Zo).call(e,t).catch(fr))}}));return function(e,r){return t.apply(this,arguments)}}()),Uo(Jo,this,Zo).call(this,t.location)}}function Qo(e){var t,r=C(),n=r.getBlockMessage();null===(t=Bo(Ko,this))||void 0===t||t.dispatchBeforePageLeave(e);var o=r.getBlockMessage();return!n&&o&&r.unblock(),o}function Xo(e,t,r){var n,o;if(Lo(Wo,this,(n=Bo(Wo,this),o=n++,n)),o>10){var a='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(a)}C().replace(e,t)}function Zo(e){return ea.apply(this,arguments)}function ea(){return(ea=(0,a.A)((function*(e){Lo(Fo,this,!0);try{yield Uo(Jo,this,ta).call(this,e)}finally{if(Lo(Fo,this,!1),Bo($o,this)){var t=Bo($o,this);Lo($o,this,void 0),yield Uo(Jo,this,Zo).call(this,t)}}}))).apply(this,arguments)}function ta(e){return ra.apply(this,arguments)}function ra(){return ra=(0,a.A)((function*(e){var t,r,n,i,s=this,l=Lo(Ho,this,(0,m.uniqueId)("render-id-"));et=new WeakSet,nt.clear(),null==Sa||null===(t=Sa.flowApi)||void 0===t||t.clearCollectWidgetContract(),C().unblock();var c=null==Sa||null===(r=Sa.pageView)||void 0===r?void 0:r.create(),d=g(Bo(No,this),e.pathname),p=null===(n=Bo(Do,this))||void 0===n?void 0:n.app,f=null==d||null===(i=d.app)||void 0===i?void 0:i.id;window.BOOTSTRAP_UNION_FILE&&f&&f!==(null==p?void 0:p.id)&&function(e){var{appId:t,version:r}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",r))}({appId:f,version:d.app.currentVersion}),null!=d&&d.app&&(yield function(e){return Po.apply(this,arguments)}(d));var v=Lo(zo,this,null==d?void 0:d.app);!function(){var e,t,r,n,a,i,s,l,c=Ua().getFeatureFlags(),d=Ua().getMiscSettings();if(c["show-watermark"]){var p="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!==(r=null==Sa||null===(n=Sa.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)&&void 0!==r?r:"",v=null!==(a=d.watermarkConfig)&&void 0!==a?a:{flags:{}},h=(0,o.A)({content:[..."string"==typeof v.content?[v.content]:null!==(i=v.content)&&void 0!==i?i:[],null!==(s=v.flags)&&void 0!==s&&s["show-development"]&&p?"Development":"",null!==(l=v.flags)&&void 0!==l&&l["show-user"]?f:""].filter(Boolean),zIndex:1001,width:200,font:{fontSize:28},gap:[190,190]},(0,m.omit)(v,["content","flags"]));lo?lo.resolve(h):(0,u.loadBricksImperatively)([xo],Ka()).then((()=>{(lo=document.createElement(xo)).resolve(h)}),(e=>{console.error("Load watermark service failed:",e)}))}}();var h,y=p&&v?p.id!==v.id:p!==v,A=Ua().getFeatureFlags(),b=Bo(Ko,this),w=(t,r)=>{null==c||c({status:"redirected"}),Bo(Vo,this).add(b),Uo(Jo,this,Xo).call(this,t,r,e)},E=()=>{var t=A["sso-enabled"]?"/sso-auth/login":"/auth/login";sr(e),w(t,{from:e})},S=document.querySelector("#main-mount-point"),k=document.querySelector("#portal-mount-point"),I={tag:Kr.ROOT,container:S,createPortal:k},T=()=>{var e;for(var t of(Vr(S),Vr(k),Bo(Vo,this).add(b),Bo(Vo,this)))t&&(t.dispatchOnUnmount(),t.dispose());Bo(Vo,this).clear(),null==Sa||null===(e=Sa.messageDispatcher)||void 0===e||e.reset(),y&&(Lo(qo,this,p),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:p,currentApp:v}})))};if(Z(v&&(oe()[v.id]||v.theme)||"light"),ie("default"),v){var O,P,_,M,x,B;null==Sa||null===(O=Sa.checkInstalledApps)||void 0===O||O.preCheckInstalledApps(d,(e=>!!za(e)));var L={bailout:e=>e.unauthenticated?(E(),!0):e.redirect?(w(e.redirect.path,e.redirect.state),!0):void Lo(Wo,this,0),mergeMenus:(h=(0,a.A)((function*(e){var t=yield Promise.all(e);Lo(Go,s,function(e){var t={breadcrumb:[]};for(var r of e){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(t))})),function(e){return h.apply(this,arguments)}),catch:(t,r)=>{if(!cr(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){var n=Ua().getMiscSettings().noAuthGuardLoginPath;return cr(t)&&n?void w(n,{from:e}):{failed:!0,output:{node:{tag:Kr.BRICK,type:"div",properties:{textContent:lr(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}Bo(Vo,this).add(b)}else E()}},U=Lo(Ko,this,new sn("page",{routeHelper:L,renderId:l})),N=Lo(Do,this,{app:v,location:e,query:new URLSearchParams(e.search),flags:A,sys:(0,o.A)((0,o.A)((0,o.A)({},null==Sa||null===(P=Sa.auth)||void 0===P?void 0:P.getAuth()),To()),{},{settings:{brand:Ua().getBrandSettings()}}),ctxStore:new Wn("CTX",void 0,U),pendingPermissionsPreCheck:[null==Sa||null===(_=Sa.checkPermissions)||void 0===_?void 0:_.preCheckPermissions(d)],tplStateStoreMap:new Map,formStateStoreMap:new Map});Lo(Go,this,void 0),Oo(d),me(null===(M=d.meta)||void 0===M?void 0:M.functions,v),null==Sa||null===(x=Sa.flowApi)||void 0===x||x.collectContract(null===(B=d.meta)||void 0===B?void 0:B.contracts);var F,j=!1,$=[];try{if(F=yield ho(I,function(e){if(window.parent===window)return e;var t=e,r=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(d.routes),N,U,[]),L.bailout(F))return;$=Eo(N),yield So(F,N,$),yield L.mergeMenus(F.menuRequests),U.setInitialMenuRequests(F.menuRequests)}catch(e){console.error("Router failed:",e);var D=L.catch(e,I);if(!D)return;({failed:j,output:F}=D)}if(I.child=F.node,T(),F.route&&"routes"!==F.route.type||j){if(j||U.dispatchBeforePageLoad(),re(),le(),Mo(null==v?void 0:v.uiVersion),Wr(I),window.scrollTo(0,0),j)null==c||c({status:"failed"});else{for(var K of(U.dispatchPageLoad(),U.dispatchAnchorLoad(),U.dispatchOnMount(),U.initializeScrollIntoView(),U.initializeMediaChange(),U.initializeMessageDispatcher(),$))K.mountAsyncData();null==c||c({status:"ok",path:F.path,pageTitle:document.title})}return void W("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Sa&&Sa.auth&&!Sa.auth.isLoggedIn())return void E();T()}re(),le();var V={tag:Kr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:I};I.child=V,Wr(I),window.scrollTo(0,0),null==c||c({status:"not-found"}),W("rendered")})),ra.apply(this,arguments)}var na="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null,oa=r(94579),aa=r(84501),ia=2,sa=.16,la=.05,ca=.05,ua=.15,da=5,pa=4,fa=[{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 va(e){var t=e.r,r=e.g,n=e.b,o=(0,oa.wE)(t,r,n);return{h:360*o.h,s:o.s,v:o.v}}function ha(e){var t=e.r,r=e.g,n=e.b;return"#".concat((0,oa.Ob)(t,r,n,!1))}function ma(e,t,r){var n;return(n=Math.round(e.h)>=60&&Math.round(e.h)<=240?r?Math.round(e.h)-ia*t:Math.round(e.h)+ia*t:r?Math.round(e.h)+ia*t:Math.round(e.h)-ia*t)<0?n+=360:n>=360&&(n-=360),n}function ga(e,t,r){return 0===e.h&&0===e.s?e.s:((n=r?e.s-sa*t:t===pa?e.s+sa:e.s+la*t)>1&&(n=1),r&&t===da&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function ya(e,t,r){var n;return(n=r?e.v+ca*t:e.v-ua*t)>1&&(n=1),Number(n.toFixed(2))}function Aa(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=(0,aa.RO)(e),o=da;o>0;o-=1){var a=va(n),i=ha((0,aa.RO)({h:ma(a,o,!0),s:ga(a,o,!0),v:ya(a,o,!0)}));r.push(i)}r.push(ha(n));for(var s=1;s<=pa;s+=1){var l=va(n),c=ha((0,aa.RO)({h:ma(l,s),s:ga(l,s),v:ya(l,s)}));r.push(c)}return"dark"===t.theme?fa.map((function(e){var n,o,a,i=e.index,s=e.opacity;return ha((n=(0,aa.RO)(t.backgroundColor||"#141414"),a=100*s/100,{r:((o=(0,aa.RO)(r[i])).r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b}))})):r}var ba,wa,Ea,Sa,ka={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"},Ia={},Ca={};function Ra(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Ta(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Oa(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Pa(e,t,r){return"dark"===t?Aa(e,{theme:t,backgroundColor:r})[5]:e}function _a(e){var t=[];if(["light","dark"].forEach((r=>{if(e[r])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Ta:Ra)("string"==typeof(r=t)?" --color-brand: ".concat(r,";\n"):[" --color-brand: ".concat(r.default,";")," --color-brand-hover: ".concat(r.hover,";")," --color-brand-active: ".concat(r.active,";"),""].join("\n"));var r}(r,e[r]));break;case"baseColors":t.push(function(e,t,r){return("dark"===e?Ta:Ra)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[r,n]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(r),n.map(((e,n)=>[" --palette-".concat(r,"-").concat(n+1,"-channel: ").concat(Oa(e),";")].concat("dark"===t?[]:" --palette-".concat(r,"-").concat(n+1,": rgb(var(--palette-").concat(r,"-").concat(n+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,r){return Object.fromEntries(Object.entries(e).map((e=>{var[n,o]=e;return[n,Aa(o,"dark"===t?{theme:t,backgroundColor:r}:void 0)]})))}(t,e,r),e),"\n").concat(function(e,t,r){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((n=>{var[o,a]=n;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(Oa(Pa(t[a],e,r)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(a,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(a,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(a,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,r)))}(r,e[r],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Ta:Ra)(function(e){return Object.entries(e).map((e=>{var[t,r]=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(r,";")})).concat("").join("\n")}(t))}(r,e[r]))}})),t.length>0){var r=document.createElement("style");return r.textContent=t.join("\n\n"),document.head.appendChild(r),()=>{r.remove()}}}function Ma(e,t,r){return e.set(Ba(e,t),r),r}function xa(e,t){return e.get(Ba(e,t))}function Ba(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function La(e){if(ba)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===$){var r=t.payload;switch(null==r?void 0:r.type){case D:V=r.active;break;case K:F=r.panel}}})),Sa=null==e?void 0:e.hooks,(0,c.initializeI18n)(or,ar),p.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{p.locale(c.i18n.language)})),I(),ba=new $a}Object.keys(ka).forEach((function(e){Ia[e]=Aa(ka[e]),Ia[e].primary=Ia[e][5],Ca[e]=Aa(ka[e],{theme:"dark",backgroundColor:"#141414"}),Ca[e].primary=Ca[e][5]})),Ia.red,Ia.volcano,Ia.gold,Ia.orange,Ia.yellow,Ia.lime,Ia.green,Ia.cyan,Ia.blue,Ia.geekblue,Ia.purple,Ia.magenta,Ia.grey;var Ua=function(){var e=k();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 ba},Na=new WeakMap,Fa=new WeakMap,ja=new WeakSet;class $a{constructor(){(0,i.A)(this,ja),(0,l.A)(this,Na,!1),(0,l.A)(this,Fa,!1),(0,s.A)(this,"version",3)}initialize(e){var t;if(xa(Na,this))throw new Error("The runtime cannot be initialized more than once");Ma(Na,this,!0),function(e){if(Array.isArray(e.storyboards)){var t=function(){if(r.locales){var e="tmp/".concat(r.id);Object.entries(r.locales).forEach((t=>{var[r,n]=t;c.i18n.addResourceBundle(r,e,n)})),r.localeName=c.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{c.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,d.isObject)(e.settings)&&(0,d.deepFreeze)(e.settings),e.brickPackages&&(0,d.deepFreeze)(e.brickPackages)}(e),wa=e;var r,{notification:n,dialog:a}=Ba(ja,this,Da).call(this);!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{dr=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==a&&function(e,t){t([e]).then((()=>{Gt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=a?a:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?_a((0,o.A)({type:"brandColor"},e.brandColor)):e.baseColors?_a((0,o.A)({type:"baseColors"},e.baseColors)):e.variables&&_a((0,o.A)({type:"variables"},e.variables)))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}bootstrap(e){var t=this;return(0,a.A)((function*(){if(e&&t.initialize(e),xa(Fa,t))throw new Error("The runtime cannot be bootstrapped more than once");Ma(Fa,t,!0),Ea=new Yo(wa.storyboards),yield Ea.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=Ea)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Ea)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Je(e,t)}getFeatureFlags(){var e,t;return(0,o.A)((0,o.A)((0,o.A)({},null===(e=wa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=Ea)||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(0,o.A)((0,o.A)({},null===(e=wa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=Ea)||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(0,o.A)({base_title:"DevOps 管理专家"},null===(e=wa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,o.A)({columns:7,rows:4},null===(e=wa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=wa)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=wa)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t=this.getBrandSettings().base_title;document.title=e?"".concat(e," - ").concat(t):t}getNavConfig(){var e;return null===(e=Ea)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,Ka())}}function Da(){var e,t;return null!==(e=null===(t=wa)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function Ka(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=function(e,t){if(null==t||!t.length)return e;var r=new Map;return[...e,...t].forEach((e=>{var t=e.filePath.split("/")[1];r.set(t,e)})),Array.from(r.values())}(null===(n=wa)||void 0===n?void 0:n.brickPackages,window.PUBLIC_DEPS))&&void 0!==r?r:na)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function Va(){var e;return null===(e=Ea)||void 0===e?void 0:e.getRenderId()}function Wa(){var e;return null===(e=Ea)||void 0===e?void 0:e.getRuntimeContext()}function Ha(e){var t;return null===(t=wa)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function za(e){var t;return null===(t=Ha(e))||void 0===t?void 0:t.app}function qa(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];null==Sa||null===(e=Sa.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Ga(){var e;return null==Sa||null===(e=Sa.auth)||void 0===e?void 0:e.getAuth()}function Ja(){var e,t;return null==Sa||null===(e=Sa.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Ya(){var e;return null==Sa||null===(e=Sa.auth)||void 0===e?void 0:e.isLoggedIn()}function Qa(e,t,r){return Xa.apply(this,arguments)}function Xa(){return(Xa=(0,a.A)((function*(e,t,r){return it(yield Xe(e),e,"resolve",t,r)}))).apply(this,arguments)}function Za(e){var t,{portal:r,scope:n="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;t=r||(()=>((i=document.createElement("div")).style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));var s,l,c=!1;return{render(r){var u=arguments;return(0,a.A)((function*(){var{theme:a,uiVersion:p,context:f,functions:v,templates:h,i18n:g}=u.length>1&&void 0!==u[1]?u[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");var y=[].concat(r),A=s,b=(0,m.uniqueId)("render-id-");s=new sn(n,{unknownBricks:o,renderId:b});var w={ctxStore:new Wn("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},E={tag:Kr.ROOT,container:e,createPortal:t};if("page"===n){var S;!function(e,t){function r(e){if((0,d.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(var[t,o]of Object.entries(e))(0,d.isObject)(o)&&"useBrick"===t?Array.isArray(o)?o.forEach((e=>n(e,!0))):n(o,!0):r(o)}function n(e,o){o&&(e[yn]=t);var{properties:a,slots:i,children:s}=e,l=Co(s,i);for(var c of(r(a),Object.values(null!=l?l:{})))for(var u of null!==(d=c.bricks)&&void 0!==d?d:[]){var d;n(u,o)}}for(var o of e)n(o)}(y,w),Z(null!=a?a:"light"),ie("default"),Mo(p);var k={id:"demo",homepage:"/demo"};w.app=k;var I={app:k,meta:{i18n:g,customTemplates:h}};null===(S=l)||void 0===S||S(),l=L(I),Oo(I),me(v,k)}w.ctxStore.define(f,w);var C,R=!1,T=[];try{C=yield go(E,y,w,s,[]),T=Eo(w),yield So(C,w,T)}catch(e){R=!0,C={node:{tag:Kr.BRICK,type:"div",properties:{textContent:lr(e)},return:E,runtimeContext:null},blockingList:[],menuRequests:[]}}if(E.child=C.node,null==A||A.dispatchOnUnmount(),null==A||A.dispose(),Vr(e),i&&Vr(i),"page"===n&&(R||s.dispatchBeforePageLoad(),re(),le()),Wr(E),"page"===n&&window.scrollTo(0,0),!R){for(var O of T)O.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,Vr(e),i&&(Vr(i),r||i.remove()))}}}}}]);
2
+ //# sourceMappingURL=1860.f38d415d.js.map