@next-core/brick-playground 1.10.138 → 1.10.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/core.1b056706.js +1 -0
- package/dist/preview/core.1b056706.js.map +1 -0
- package/dist/preview/index.html +1 -1
- package/dist/preview/{main.c4c7c0a7.js → main.173afb38.js} +1 -1
- package/dist/preview/{main.c4c7c0a7.js.map → main.173afb38.js.map} +1 -1
- package/package.json +3 -3
- package/dist/preview/core.db71edf1.js +0 -1
- package/dist/preview/core.db71edf1.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_core_preview=self.webpackChunk_next_core_preview||[]).push([[114],{4116:(e,t,r)=>{r.r(t);var n=r(9740),a=r(6330),o=r(6027),i=r(3230),s=r(8679),l=(r(9056),r(2445));function c(e,t){var r;null!==(r=t.options)&&void 0!==r&&null!==(r=r.interceptorParams)&&void 0!==r&&r.ignoreLoadingBar||window.dispatchEvent(new Event(e))}i.http.interceptors.request.use((e=>(c("request.start",e),e))),i.http.interceptors.response.use((function(e,t){return c("request.end",t),e}),(function(e,t){return c("request.end",t),Promise.reject(e)}));var u=document.querySelector("#global-loading-bar");u.classList.add("rendered");var d=!1,p=0;function f(){var e=p>0;e!==d&&(d=e,u.classList[e?"add":"remove"]("loading"))}window.addEventListener("request.start",(()=>{p++,f()})),window.addEventListener("request.end",(()=>{p>0&&(p--,f())}));var v,h=(0,o.createRuntime)(),m=document.querySelector("#preview-root"),g=document.querySelector("#portal-mount-point"),y=(0,o.unstable_createRoot)(m,{portal:g,scope:"page",unknownBricks:"silent"}),b=i.http.get(window.BOOTSTRAP_FILE,{responseType:"json"}).then((e=>{h.initialize(window.BOOTSTRAP_FILE_FIELD?(0,l.get)(e,window.BOOTSTRAP_FILE_FIELD):e)})),E=!1;function A(e){return w.apply(this,arguments)}function w(){return w=(0,a.A)((function*(e){E=!0;try{var{type:t,sources:r,options:n}=e;yield function(e,t){return k.apply(this,arguments)}(t,r,n)}finally{if(E=!1,v){var a=v;v=void 0,A(a)}}})),w.apply(this,arguments)}window._preview_only_render=(e,t,r)=>{E?v={type:e,sources:t,options:r}:A({type:e,sources:t,options:r})};var S=!1;function k(){return k=(0,a.A)((function*(e,t){var{yaml:r,html:n}=t,{theme:a,uiVersion:i,context:l,functions:c,templates:u,i18n:d,styleText:p,templatesAreArrayOfYaml:f}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{if(S||(S=!0,document.body.classList.add("bootstrap-ready"),(0,o.applyTheme)("light"===a?a:"dark-v2")),document.body.classList.remove("bootstrap-error"),"html"===e){(0,o.applyTheme)("light"===a?a:"dark-v2"),(0,o.setUIVersion)(i);var v=(new DOMParser).parseFromString(n,"text/html"),E=new Set;for(var A of v.body.querySelectorAll("*"))if(A.tagName.includes("-")){var w=A.tagName.toLowerCase();E.add(w)}else if("SCRIPT"===A.tagName){var k=A.text.matchAll(/\bdocument\.createElement\(\s*"([a-zA-Z0-9.]+-[-a-zA-Z0-9.]+)"\s*\)/g);for(var P of k)E.add(P[1])}yield b,yield h.loadBricks(E),m.replaceChildren(),g.replaceChildren();var x=[],C=v.querySelectorAll("script");for(var O of C){var T=document.createElement("script");T.text=O.text,T.type="module",x.push(T),O.remove()}m.append(...v.head.querySelectorAll("style"),...v.body.childNodes,...x)}else{var R=r?(0,s.safeLoad)(r,{schema:s.JSON_SCHEMA,json:!0}):null,B=[].concat(null!=R?R:[]);p&&B.push({brick:"style",portal:!0,properties:{textContent:p}});var L=I(l),_=I(c),M=I(u,f),F=I(d);yield b,yield y.render(B,{theme:"light"===a?a:"dark-v2",uiVersion:i,context:L,functions:_,templates:M,i18n:F})}}catch(e){console.error("Render failed:",e),document.body.classList.add("bootstrap-error"),g.textContent="",m.textContent="Render failed: ".concat(String(e))}})),k.apply(this,arguments)}function I(e,t){return"string"==typeof e?(0,s.safeLoad)(e,{schema:s.JSON_SCHEMA,json:!0}):t?e.map((e=>"string"==typeof e.yaml?(0,n.A)((0,n.A)({},(0,s.safeLoad)(e.yaml,{schema:s.JSON_SCHEMA,json:!0})),{},{name:e.name}):e)):e}},4712:(e,t,r)=>{r.r(t),r.d(t,{cook:()=>U,isEvaluable:()=>z,isTrackAll:()=>J,precook:()=>D,precookFunction:()=>W,preevaluate:()=>K,shouldAllowRecursiveEvaluations:()=>G});var n=r(4586);class a{constructor(){(0,n.A)(this,"VariableEnvironment",void 0),(0,n.A)(this,"LexicalEnvironment",void 0),(0,n.A)(this,"Function",void 0)}}class o{constructor(e){(0,n.A)(this,"OuterEnv",void 0),(0,n.A)(this,"bindingMap",new Map),this.OuterEnv=e}HasBinding(e){return this.bindingMap.has(e)}CreateMutableBinding(e,t){return this.bindingMap.set(e,{mutable:!0,deletable:t}),h(void 0)}CreateImmutableBinding(e,t){return this.bindingMap.set(e,{strict:t}),h(void 0)}InitializeBinding(e,t){var r=this.bindingMap.get(e);return Object.assign(r,{initialized:!0,value:t}),h(void 0)}SetMutableBinding(e,t,r){var n=this.bindingMap.get(e);if(!n.initialized)throw new ReferenceError("".concat(e," is not initialized"));if(!n.mutable)throw new TypeError("Assignment to constant variable");return n.value=t,h(void 0)}GetBindingValue(e,t){var r=this.bindingMap.get(e);if(!r.initialized)throw new ReferenceError("".concat(e," is not initialized"));return r.value}}class i extends o{}class s extends o{}var l=Symbol.for("SourceNode"),c=Symbol.for("FormalParameters"),u=Symbol.for("ECMAScriptCode"),d=Symbol.for("Environment"),p=Symbol.for("IsConstructor");class f{constructor(e,t,r){(0,n.A)(this,"Base",void 0),(0,n.A)(this,"ReferenceName",void 0),(0,n.A)(this,"Strict",void 0),this.Base=e,this.ReferenceName=t,this.Strict=r}}class v{constructor(e,t){(0,n.A)(this,"Type",void 0),(0,n.A)(this,"Value",void 0),this.Type=e,this.Value=t}}function h(e){return new v("normal",e)}var m=Symbol("empty completion");function g(e){var t=new Set,r=e=>{if(Array.isArray(e))for(var n of e)r(n);else if(e)switch(e.type){case"Identifier":return void t.add(e.name);case"VariableDeclaration":return r(e.declarations);case"VariableDeclarator":case"FunctionDeclaration":return r(e.id);case"ArrayPattern":return r(e.elements);case"AssignmentPattern":return r(e.left);case"ObjectPattern":return r(e.properties);case"Property":return r(e.value);case"RestElement":return r(e.argument)}};return r(e),Array.from(t)}function y(e){var t=e=>{if(Array.isArray(e))return e.some(t);if(e)switch(e.type){case"ArrayPattern":return t(e.elements);case"AssignmentPattern":return!0;case"ObjectPattern":return t(e.properties);case"Property":return e.computed||t(e.value);case"RestElement":return t(e.argument)}};return t(e)}function b(e,t){var r=[],n={var:t.var},a=(e,t)=>{if(Array.isArray(e))for(var o of e)a(o,t);else if(e){switch(e.type){case"FunctionDeclaration":return void(Number(!t.var)^Number(t.topLevel)&&r.push(e));case"VariableDeclaration":return void(Number(!t.var)^Number("var"===e.kind)&&r.push(e));case"SwitchCase":return void a(e.consequent,n);case"CatchClause":return void a(e.body,n)}if(t.var)switch(e.type){case"BlockStatement":case"DoWhileStatement":case"WhileStatement":return void a(e.body,n);case"IfStatement":return a(e.consequent,n),void a(e.alternate,n);case"ForStatement":return a(e.init,n),void a(e.body,n);case"ForInStatement":case"ForOfStatement":return a(e.left,n),void a(e.body,n);case"SwitchStatement":return void a(e.cases,n);case"TryStatement":return a(e.block,n),a(e.handler,n),void a(e.finalizer,n)}}};return a(e,t),r}function E(e){return"unresolvable"!==e.Base&&!(e.Base instanceof o)}function A(e,t){return e.Base.InitializeBinding(e.ReferenceName,t)}function w(e,t,r){if(null==t)return e;var n=Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));for(var a of n)if(!r.has(a)){var o=Object.getOwnPropertyDescriptor(t,a);null!=o&&o.enumerable&&(e[a]=t[a])}return e}function S(e,t){var r="const"===e.kind;for(var n of g(e))r?t.CreateImmutableBinding(n,!0):t.CreateMutableBinding(n,!1)}function k(e){return"normal"===e.Type||"continue"==e.Type}function I(e,t){return e.Value!==m?e:new v(e.Type,t)}function P(e){if(e instanceof v&&(e=e.Value),!(e instanceof f))return e;if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof o?e.Base.GetBindingValue(e.ReferenceName,e.Strict):e.Base[e.ReferenceName]}function x(e){return"symbol"==typeof e?e:String(e)}function C(e,t){return e[t]}function O(e,t){if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof o?e.Base.SetMutableBinding(e.ReferenceName,t,e.Strict):(e.Base[e.ReferenceName]=t,h(void 0))}function T(e){if(t=e,!(Array.isArray(t)||null!=t&&"function"==typeof t[Symbol.iterator]))throw new TypeError("".concat(typeof e," is not iterable"));var t;return e[Symbol.iterator]()}function R(e){if(null==e)throw new TypeError("Cannot destructure properties of undefined or null")}function B(e,t,r){return e?e.HasBinding(t)?new f(e,t,r):B(e.OuterEnv,t,r):new f("unresolvable",t,r)}function L(e,t,r){switch(t){case"+":return e+r;case"-":return e-r;case"/":return e/r;case"%":return e%r;case"*":return e*r;case"**":return e**r;case"==":return e==r;case"===":return e===r;case"!=":return e!=r;case"!==":return e!==r;case">":return e>r;case"<":return e<r;case">=":return e>=r;case"<=":return e<=r}throw new SyntaxError("Unsupported binary operator `".concat(t,"`"))}var _=new WeakSet([Function,Object,Function.prototype,Object.prototype,function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}()]);function M(e){if(_.has(e))throw new TypeError("Cannot access reserved objects such as `Function`.")}var F=new WeakSet([Array,Map,Set,URLSearchParams,WeakMap,WeakSet,RegExp]);function U(e,t){var r,{rules:n,globalVariables:o={},hooks:_={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},U="FunctionDeclaration"!==e.type,N=new i(null),j=new a;j.VariableEnvironment=N,j.LexicalEnvironment=N;var V=[j];for(var[D,$]of Object.entries(o))N.CreateImmutableBinding(D,!0),N.InitializeBinding(D,$);var H=new WeakMap;function q(e,r){var n,a,o;switch(null===(n=_.beforeEvaluate)||void 0===n||n.call(_,e),e.type){case"ArrayExpression":var s=[];for(var l of e.elements)if(l)if("SpreadElement"===l.type){var c=P(q(l.argument));s.push(...c)}else s.push(P(q(l)));else s.length+=1;return h(s);case"ArrowFunctionExpression":return de(e),h(oe(e,W().LexicalEnvironment,!1));case"BinaryExpression":var u=P(q(e.left)),d=q(e.right).Value,y=P(d);if(U&&"|>"===e.operator){if("function"!=typeof y){var b=t.substring(e.right.start,e.right.end);throw new TypeError("".concat(b," is not a function"))}var C;return d instanceof f&&E(d)&&(C=d.Base),h(y.call(C,u))}return h(L(u,e.operator,y));case"CallExpression":var R=q(e.callee,r).Value,B=P(R);return null==B&&(e.optional||null!=r&&r.skipped)?(r.skipped=!0,h(void 0)):(M(B),te(B,R,e.arguments,e.callee));case"ChainExpression":return q(e.expression,{});case"ConditionalExpression":return h(P(q(P(q(e.test))?e.consequent:e.alternate)));case"Identifier":return h(K(e.name));case"Literal":if(e.regex){if(null===e.value)throw new SyntaxError("Invalid regular expression: ".concat(e.raw));if(e.regex.flags.includes("u"))throw new SyntaxError("Unsupported unicode flag in regular expression: ".concat(e.raw))}return h(e.value);case"LogicalExpression":var N=P(q(e.left));switch(e.operator){case"&&":return h(N&&P(q(e.right)));case"||":return h(N||P(q(e.right)));case"??":return h(null!=N?N:P(q(e.right)));default:throw new SyntaxError("Unsupported logical operator '".concat(e.operator,"'"))}case"MemberExpression":var j=P(q(e.object,r).Value);if(null==j&&(e.optional||null!=r&&r.skipped))return r.skipped=!0,h(void 0);M(j);var V=e.computed?function(e,t,r){var n=x(P(q(t)));return new f(e,n,!0)}(j,e.property):function(e,t,r){var n=t.name;return new f(e,n,!0)}(j,e.property);return M(V),h(V);case"NewExpression":return function(e,r){var n=P(q(e)),a=re(r);if("function"!=typeof n||!1===n[p]){var o=t.substring(e.start,e.end);throw new TypeError("".concat(o," is not a constructor"))}if(!function(e){return F.has(e)||e===Date}(n)){var i=t.substring(e.start,e.end);throw new TypeError("".concat(i," is not an allowed constructor"))}return h(new n(...a))}(e.callee,e.arguments);case"ObjectExpression":var D={};for(var $ of e.properties)if("SpreadElement"===$.type)w(D,P(q($.argument)),new Set);else{if("init"!==$.kind)throw new SyntaxError("Unsupported object getter/setter");var H=$.computed||"Identifier"!==$.key.type?se($.key):$.key.name;if("__proto__"===H)throw new TypeError("Setting '__proto__' property is not allowed");D[H]=P(q($.value))}return h(D);case"SequenceExpression":var Y;for(var X of e.expressions)Y=h(P(q(X)));return Y;case"TemplateLiteral":var Z=[e.quasis[0].value.cooked],ae=0;for(var le of e.expressions){var ce=P(q(le));Z.push(String(ce)),Z.push(e.quasis[ae+=1].value.cooked)}return h(Z.join(""));case"TaggedTemplateExpression":var ue=q(e.tag).Value,pe=P(ue);return M(pe),te(pe,ue,e.quasi,e.tag);case"UnaryExpression":var fe=q(e.argument).Value;if(!U&&"delete"===e.operator){if(!(fe instanceof f))return h(!0);if(E(fe))return h(delete fe.Base[fe.ReferenceName])}return"typeof"===e.operator?fe instanceof f&&"unresolvable"===fe.Base?h("undefined"):h(typeof P(fe)):h(function(e,t){switch(t){case"!":return!e;case"+":return+e;case"-":return-e;case"void":return}throw new SyntaxError("Unsupported unary operator `".concat(t,"`"))}(P(fe),e.operator))}if(!U)switch(e.type){case"AssignmentExpression":if("="===e.operator){if("ArrayPattern"!==e.left.type&&"ObjectPattern"!==e.left.type){var ve=q(e.left).Value,he=P(q(e.right));return O(ve,he),h(he)}var me=P(q(e.right));return Q(e.left,me),h(me)}var ge=q(e.left).Value,ye=P(ge),be=P(q(e.right)),Ee=function(e,t,r){switch(t){case"+=":case"-=":case"*=":case"/=":case"%=":case"**=":return L(e,t.substr(0,t.length-1),r)}throw new SyntaxError("Unsupported assignment operator `".concat(t,"`"))}(ye,e.operator,be);return O(ge,Ee),h(Ee);case"BlockStatement":if(!e.body.length)return h(m);var Ae=W().LexicalEnvironment,we=new i(Ae);ee(e.body,we),W().LexicalEnvironment=we;var Se=ne(e.body);return W().LexicalEnvironment=Ae,Se;case"BreakStatement":return new v("break",m);case"ContinueStatement":return new v("continue",m);case"EmptyStatement":case"FunctionDeclaration":return h(m);case"DoWhileStatement":return z(function(e){for(var t;;){var r=q(e.body);if(!k(r))return I(r,t);if(r.Value!==m&&(t=r.Value),!P(q(e.test)))return h(t)}}(e));case"ExpressionStatement":case"TSAsExpression":return q(e.expression);case"ForInStatement":case"ForOfStatement":return z(function(e){var t=e.left,r="VariableDeclaration"===t.type?"var"===t.kind?"varBinding":"lexicalBinding":"assignment",n="lexicalBinding"===r?g(t):[],a="ForInStatement"===e.type?"enumerate":"iterate",o=function(e,t,r){var n=W(),a=n.LexicalEnvironment;if(e.length>0){var o=new i(a);for(var s of e)o.CreateMutableBinding(s,!1);n.LexicalEnvironment=o}var l=q(t);n.LexicalEnvironment=a;var c=P(l);if("enumerate"===r){if(null==c)return new v("break",m);var u=function*(e){for(var t in e)yield t}(c);return h(u)}return h(T(c))}(n,e.right,a);return"normal"!==o.Type?o:function(e,t,r,n,a){for(var o,s="assignment"===a?e:e.declarations[0].id,l=W().LexicalEnvironment,c="ObjectPattern"===s.type||"ArrayPattern"===s.type;;){var{done:u,value:d}=r.next();if(u)return h(o);var p=void 0,f=void 0;if("lexicalBinding"===a){if(S(e,f=new i(l)),W().LexicalEnvironment=f,!c){var[v]=g(s);p=K(v)}}else c||(p=q(s).Value);c?"assignment"===a?Q(s,d):ie(s,d,"varBinding"===a?void 0:f):"lexicalBinding"===a?A(p,d):O(p,d);var y=q(t);if(W().LexicalEnvironment=l,!k(y)){var b=I(y,o);if("enumerate"!==n&&void 0!==r.return){var E=r.return();if(!E||!["object","function"].includes(typeof E))throw new TypeError("Iterator result is not an object")}return b}y.Value!==m&&(o=y.Value)}}(t,e.body,o.Value,a,r)}(e));case"ForStatement":return z(function(e){var t;if("VariableDeclaration"===(null===(t=e.init)||void 0===t?void 0:t.type)){if("var"===e.init.kind)return q(e.init),J(e.test,e.update,e.body,[]);var r=W().LexicalEnvironment,n=new i(r),a="const"===e.init.kind,o=g(e.init);for(var s of o)a?n.CreateImmutableBinding(s,!0):n.CreateMutableBinding(s,!1);W().LexicalEnvironment=n,q(e.init);var l=a?[]:Array.from(o),c=J(e.test,e.update,e.body,l);return W().LexicalEnvironment=r,c}return e.init&&P(q(e.init)),J(e.test,e.update,e.body,[])}(e));case"FunctionExpression":return de(e),h(function(e){var t=W().LexicalEnvironment;if(e.id){var r=e.id.name,n=new i(t);n.CreateImmutableBinding(r,!1);var a=oe(e,n,!0);return n.InitializeBinding(r,a),a}return oe(e,t,!0)}(e));case"IfStatement":return P(q(e.test))?(null!==(a=_.beforeBranch)&&void 0!==a&&a.call(_,e,"if"),I(q(e.consequent),void 0)):(null!==(o=_.beforeBranch)&&void 0!==o&&o.call(_,e,"else"),e.alternate?I(q(e.alternate),void 0):h(void 0));case"ReturnStatement":var ke;return e.argument&&(ke=P(q(e.argument))),new v("return",ke);case"ThrowStatement":throw P(q(e.argument));case"UpdateExpression":var Ie=q(e.argument).Value,Pe=Number(P(Ie)),xe="++"===e.operator?Pe+1:Pe-1;return O(Ie,xe),h(e.prefix?xe:Pe);case"SwitchCase":return ne(e.consequent);case"SwitchStatement":var Ce=P(q(e.discriminant)),Oe=W().LexicalEnvironment,Te=new i(Oe);ee(e.cases,Te),W().LexicalEnvironment=Te;var Re=function(e,t){var r,n=e.findIndex((e=>!e.test)),a=n>=0,o=a?e.slice(0,n):e,i=!1;for(var s of o)if(i||(i=G(s,t)),i){var l=q(s);if(l.Value!==m&&(r=l.Value),"normal"!==l.Type)return I(l,r)}if(!a)return h(r);var c=!1,u=e.slice(n+1);if(!i)for(var d of u)if(c||(c=G(d,t)),c){var p=q(d);if(p.Value!==m&&(r=p.Value),"normal"!==p.Type)return I(p,r)}if(c)return h(r);var f=q(e[n]);if(f.Value!==m&&(r=f.Value),"normal"!==f.Type)return I(f,r);for(var v of u){var g=q(v);if(g.Value!==m&&(r=g.Value),"normal"!==g.Type)return I(g,r)}return h(r)}(e.cases,Ce);return W().LexicalEnvironment=Oe,z(Re);case"TryStatement":var Be;try{Be=q(e.block)}catch(t){if(!e.handler)throw t;var Le;null===(Le=_.beforeEvaluate)||void 0===Le||Le.call(_,e.handler),Be=function(e,t){if(!e.param)return q(e.body);var r=W().LexicalEnvironment,n=new i(r);for(var a of g(e.param))n.CreateMutableBinding(a,!1);W().LexicalEnvironment=n,ie(e.param,t,n);var o=q(e.body);return W().LexicalEnvironment=r,o}(e.handler,t)}finally{if(e.finalizer){var _e=q(e.finalizer);"normal"!==_e.Type&&(Be=_e)}}return Be;case"VariableDeclaration":var Me;for(var Fe of e.declarations)if(Fe.init)if("Identifier"===Fe.id.type){var Ue=K(Fe.id.name),Ne=P(q(Fe.init));Me="var"===e.kind?O(Ue,Ne):A(Ue,Ne)}else{var je=P(q(Fe.init));Me=ie(Fe.id,je,"var"===e.kind?void 0:W().LexicalEnvironment)}else Me="var"===e.kind?h(m):A(K(Fe.id.name),void 0);return Me;case"WhileStatement":return z(function(e){for(var t;;){if(!P(q(e.test)))return h(t);var r=q(e.body);if(!k(r))return I(r,t);r.Value!==m&&(t=r.Value)}}(e))}throw new SyntaxError("Unsupported node type `".concat(e.type,"`"))}function W(){return V[V.length-1]}function K(e,t){return t||(t=W().LexicalEnvironment),B(t,e,!0)}function z(e){return"break"===e.Type?e.Value===m?h(void 0):h(e.Value):e}function G(e,t){return t===P(q(e.test))}function J(e,t,r,n){var a;for(Y(n);;){if(e&&!P(q(e)))return h(a);var o=q(r);if(!k(o))return I(o,a);o.Value&&(a=o.Value),Y(n),t&&P(q(t))}}function Y(e){if(0!==e.length){var t=W().LexicalEnvironment,r=t.OuterEnv,n=new i(r);for(var a of e){n.CreateMutableBinding(a,!1);var o=t.GetBindingValue(a,!1);n.InitializeBinding(a,o)}W().LexicalEnvironment=n}}function Q(e,t){if("ObjectPattern"===e.type)return R(t),e.properties.length>0&&function(e,t){var r=new Set;for(var n of e)if("Property"===n.type){var a=n.computed||"Identifier"!==n.key.type?se(n.key):n.key.name,o="AssignmentPattern"===n.value.type?n.value.left:n.value;if("Identifier"===o.type){var i=K(o.name),s=C(t,a);"AssignmentPattern"===n.value.type&&void 0===s&&(s=P(q(n.value.right))),O(i,s),r.add(a)}else X(n.value,t,a),r.add(a)}else Z(n,t,r)}(e.properties,t),h(m);var r=T(t);return function(e,t){var r=h(m);for(var n of e)if(n){var a="RestElement"===n.type?n.argument:"AssignmentPattern"===n.type?n.left:n,o="ArrayPattern"===a.type||"ObjectPattern"===a.type,i=void 0;o||(i=q(a).Value);var s=void 0;if("RestElement"!==n.type){var{done:l,value:c}=t.next(),u=l?void 0:c;s="AssignmentPattern"===n.type&&void 0===u?P(q(n.right)):u}else{s=[];for(var d=0;;){var{done:p,value:f}=t.next();if(p)break;s[d]=f,d++}}r=o?Q(a,s):O(i,s)}else t.next(),r=h(m);return r}(e.elements,r)}function X(e,t,r){var n,a="AssignmentPattern"===e.type?e.left:e,o="ArrayPattern"===a.type||"ObjectPattern"===a.type;o||(n=q(a).Value);var i,s=C(t,r);return i="AssignmentPattern"===e.type&&void 0===s?P(q(e.right)):s,o?Q(a,i):O(n,i)}function Z(e,t,r){return O(q(e.argument).Value,w({},t,r))}function ee(e,t){var r=b(e,{var:!1,topLevel:!1});for(var n of r){var a="VariableDeclaration"===n.type&&"const"===n.kind;for(var o of g(n))a?t.CreateImmutableBinding(o,!0):t.CreateMutableBinding(o,!1);if("FunctionDeclaration"===n.type){var[i]=g(n),s=ae(n,t);t.InitializeBinding(i,s)}}}function te(e,r,n,a){var o;r instanceof f&&E(r)&&(o=r.Base);var i=re(n);if("function"!=typeof e){var s=t.substring(a.start,a.end);throw new TypeError("".concat(s," is not a function"))}var l=e.apply(o,i);return M(l),h(l)}function re(e){var t=[];if(Array.isArray(e))for(var r of e)if("SpreadElement"===r.type){var n=P(q(r.argument));t.push(...n)}else t.push(P(q(r)));else for(var a of(t.push(function(e){var t=H.get(e);if(t)return t;var r=e.quasis.map((e=>e.value.raw)),n=e.quasis.map((e=>e.value.cooked));return Object.freeze(r),Object.defineProperty(n,"raw",{value:r,writable:!1,enumerable:!1,configurable:!1}),Object.freeze(n),H.set(e,n),n}(e)),e.expressions))t.push(P(q(a)));return t}function ne(e){var t=h(m);for(var r of e){var n=q(r);if("normal"!==n.Type)return n;t=I(t,n.Value)}return t}function ae(e,t){return oe(e,t,!0)}function oe(e,t,r){var o=function(){return function(e,t){var r;null===(r=_.beforeCall)||void 0===r||r.call(_,e[l]),function(e){var t=new a;t.Function=e;var r=new s(e[d]);t.VariableEnvironment=r,t.LexicalEnvironment=r,V.push(t)}(e);var o=function(e,t){return function(e,t,r){return function(e,t){for(var r=W(),a=e[u],o=e[c],s=g(o),l=y(o),d=b(a,{var:!0,topLevel:!0}),p=g(d),f=[],v=[],h=d.length-1;h>=0;h--){var m=d[h];if("FunctionDeclaration"===m.type){de(m);var[E]=g(m);f.includes(E)||(f.unshift(E),v.unshift(m))}else if(null!=n&&n.noVar)throw new SyntaxError("Var declaration is not recommended, use `let` or `const` instead")}var A,w=r.LexicalEnvironment;for(var S of s)w.CreateMutableBinding(S,!1);if(ce(o,T(t),w),l)for(var k of(A=new i(w),r.VariableEnvironment=A,p)){A.CreateMutableBinding(k,!1);var I=void 0;s.includes(k)&&!f.includes(k)&&(I=w.GetBindingValue(k,!1)),A.InitializeBinding(k,I)}else{for(var P of p)s.includes(P)||(w.CreateMutableBinding(P,!1),w.InitializeBinding(P,void 0));A=w}var x=A;r.LexicalEnvironment=x;var C=b(a,{var:!1,topLevel:!0});for(var O of C)for(var R of g(O))"const"===O.kind?x.CreateImmutableBinding(R,!0):x.CreateMutableBinding(R,!1);for(var B of v){var[L]=g(B),_=ae(B,x);A.SetMutableBinding(L,_,!1)}}(t,r),Array.isArray(e)?ne(e):new v("return",P(q(e)))}(e[u],e,t)}(e,t);if(V.pop(),"return"===o.Type)return o.Value}(o,arguments)};return Object.defineProperties(o,{[l]:{value:e},[c]:{value:e.params},[u]:{value:"BlockStatement"===e.body.type?e.body.body:e.body},[d]:{value:t},[p]:{value:r}}),o}function ie(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){return r.InitializeBinding(e,t),h(m)}(e.name,t,r);case"ObjectPattern":return R(t),function(e,t,r){var n=new Set;for(var a of e){if("RestElement"===a.type)return le(a,t,r,n);if(a.computed||"Identifier"!==a.key.type){var o=se(a.key);ue(a.value,t,r,o),n.add(o)}else ue(a.value,t,r,a.key.name),n.add(a.key.name)}return h(m)}(e.properties,t,r);case"ArrayPattern":var n=T(t);return ce(e.elements,n,r)}}function se(e){return x(P(q(e)))}function le(e,t,r,n){var a=K(e.argument.name,r),o=w({},t,n);return r?A(a,o):O(a,o)}function ce(e,t,r){if(0===e.length)return h(m);var n;for(var a of e)if(a)if("RestElement"===a.type)if("Identifier"===a.argument.type)for(var o=K(a.argument.name,r),i=[],s=0;;){var{done:l,value:c}=t.next();if(l){n=r?A(o,i):O(o,i);break}i[s]=c,s++}else for(var u=[],d=0;;){var{done:p,value:f}=t.next();if(p){n=ie(a.argument,u,r);break}u[d]=f,d++}else{var v="AssignmentPattern"===a.type?a.left:a;switch(v.type){case"ObjectPattern":case"ArrayPattern":var g=void 0,{done:y,value:b}=t.next();y||(g=b),"AssignmentPattern"===a.type&&void 0===g&&(g=P(q(a.right))),n=ie(v,g,r);break;case"Identifier":var E=K(v.name,r),w=void 0,{done:S,value:k}=t.next();S||(w=k),"AssignmentPattern"===a.type&&void 0===w&&(w=P(q(a.right))),n=r?A(E,w):O(E,w)}}else t.next(),n=h(m);return n}function ue(e,t,r,n){if("Identifier"===e.type||"AssignmentPattern"===e.type&&"Identifier"===e.left.type){var a=K("Identifier"===e.type?e.name:e.left.name,r),o=C(t,n);return"AssignmentPattern"===e.type&&void 0===o&&(o=P(q(e.right))),r?A(a,o):O(a,o)}var i=C(t,n);return"AssignmentPattern"===e.type&&void 0===i&&(i=P(q(e.right))),ie("AssignmentPattern"===e.type?e.left:e,i,r)}function de(e){if(e.async||e.generator)throw new SyntaxError("".concat(e.async?"Async":"Generator"," function is not allowed"));if(U&&!e.expression)throw new SyntaxError("Only an `Expression` is allowed in `ArrowFunctionExpression`'s body")}if(U)return P(q(e));null===(r=_.beforeEvaluate)||void 0===r||r.call(_,e),de(e);var[pe]=g(e);N.CreateImmutableBinding(pe,!0);var fe=ae(e,N);return N.InitializeBinding(pe,fe),fe}var N=r(9740);class j{constructor(){(0,n.A)(this,"VariableEnvironment",void 0),(0,n.A)(this,"LexicalEnvironment",void 0)}}class V{constructor(e){(0,n.A)(this,"OuterEnv",void 0),(0,n.A)(this,"bindingSet",new Set),this.OuterEnv=e}HasBinding(e){return this.bindingSet.has(e)}CreateBinding(e){this.bindingSet.add(e)}}function D(e){var{expressionOnly:t,visitors:r,withParent:n,hooks:a={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=new Set,i=[],s=new V(null),l=new j;function c(){return i[i.length-1]}function u(e,t,r){for(var n of t)d(e[n],null==r?void 0:r.concat({node:e,key:n}))}function d(e,n){if(Array.isArray(e))e.forEach(((e,t)=>{d(e,n?n.slice(0,-1).concat((0,N.A)((0,N.A)({},n[n.length-1]),{},{index:t})):n)}));else if(e){var i,s;switch(null===(i=a.beforeVisit)||void 0===i||i.call(a,e,n),function(e){var t,n;r&&(t=r,n=e.type,Object.prototype.hasOwnProperty.call(t,n))&&r[e.type](e)}(e),e.type){case"Identifier":var l;return $=e.name,void(f(c().LexicalEnvironment,$)||(null===(l=a.beforeVisitGlobal)||void 0===l||l.call(a,e,n),o.add(e.name)));case"ArrayExpression":case"ArrayPattern":return void u(e,["elements"],n);case"ArrowFunctionExpression":return void h(m(e,c().LexicalEnvironment),n);case"AssignmentPattern":case"BinaryExpression":case"LogicalExpression":return void u(e,["left","right"],n);case"CallExpression":case"NewExpression":return void u(e,["callee","arguments"],n);case"ChainExpression":return void u(e,["expression"],n);case"ConditionalExpression":return void u(e,["test","consequent","alternate"],n);case"MemberExpression":return u(e,["object"],n),void(e.computed&&u(e,["property"],n));case"ObjectExpression":case"ObjectPattern":return void u(e,["properties"],n);case"Property":return e.computed&&u(e,["key"],n),void u(e,["value"],n);case"RestElement":case"SpreadElement":case"UnaryExpression":return void u(e,["argument"],n);case"SequenceExpression":case"TemplateLiteral":return void u(e,["expressions"],n);case"TaggedTemplateExpression":return void u(e,["tag","quasi"],n);case"Literal":return}if(!t)switch(e.type){case"AssignmentExpression":return void u(e,["right","left"],n);case"BlockStatement":if(!e.body.length)return;var y=c(),b=y.LexicalEnvironment,E=new V(b);return v(e.body,E),y.LexicalEnvironment=E,u(e,["body"],n),void(y.LexicalEnvironment=b);case"BreakStatement":case"ContinueStatement":case"EmptyStatement":return;case"CatchClause":var A=c(),w=A.LexicalEnvironment,S=new V(w);return p(e.param,S),A.LexicalEnvironment=S,u(e,["param","body"],n),void(A.LexicalEnvironment=w);case"DoWhileStatement":return void u(e,["body","test"],n);case"ExpressionStatement":case"TSAsExpression":return void u(e,["expression"],n);case"ForInStatement":case"ForOfStatement":var k="VariableDeclaration"===e.left.type&&"var"!==e.left.kind,I=c(),P=I.LexicalEnvironment;if(k){var x=new V(P);p(e.left,x),I.LexicalEnvironment=x}if(u(e,["right"],n),I.LexicalEnvironment=P,k){var C=new V(P);p(e.left,C),I.LexicalEnvironment=C}return u(e,["left","body"],n),void(I.LexicalEnvironment=P);case"ForStatement":var O,T="VariableDeclaration"===(null===(O=e.init)||void 0===O?void 0:O.type)&&"var"!==e.init.kind,R=c(),B=R.LexicalEnvironment;if(T){var L=new V(B);p(e.init,L),R.LexicalEnvironment=L}return u(e,["init","test","body","update"],n),void(R.LexicalEnvironment=B);case"FunctionDeclaration":var[_]=g(e),M=c().LexicalEnvironment,F=m(e,M);return M.CreateBinding(_),void h(F,n);case"FunctionExpression":return void h(function(e){var t=c().LexicalEnvironment;if(!e.id)return m(e,t);var r=e.id.name,n=new V(t);return n.CreateBinding(r),m(e,n)}(e),n);case"IfStatement":return void u(e,["test","consequent","alternate"],n);case"ReturnStatement":case"ThrowStatement":case"UpdateExpression":return void u(e,["argument"],n);case"SwitchCase":return void u(e,["test","consequent"],n);case"SwitchStatement":u(e,["discriminant"],n);var U=c(),j=U.LexicalEnvironment,D=new V(j);return v(e.cases,D),U.LexicalEnvironment=D,u(e,["cases"],n),void(U.LexicalEnvironment=j);case"TryStatement":return void u(e,["block","handler","finalizer"],n);case"VariableDeclaration":return void u(e,["declarations"],n);case"VariableDeclarator":return void u(e,["id","init"],n);case"WhileStatement":return void u(e,["test","body"],n)}(null===(s=a.beforeVisitUnknown)||void 0===s?void 0:s.call(a,e,n))||console.warn("Unsupported node type `".concat(e.type,"`"))}var $}function p(e,t){for(var r of g(e))t.CreateBinding(r)}function f(e,t){return!!e&&(e.HasBinding(t)||f(e.OuterEnv,t))}function v(e,t){p(b(e,{var:!1,topLevel:!1}),t)}function h(e,t){var r,n,a;r=e,n=new j,a=new V(r.Environment),n.VariableEnvironment=a,n.LexicalEnvironment=a,i.push(n),function(e,t){var r,n=c(),a=e.ECMAScriptCode,o=e.FormalParameters,i=y(o),s=g(b(a,{var:!0,topLevel:!0})),l=n.LexicalEnvironment;if(p(o,l),d(o,null==t?void 0:t.concat({node:e.Function,key:"params"})),i)for(var u of(r=new V(l),n.VariableEnvironment=r,s))r.CreateBinding(u);else{for(var f of s)l.CreateBinding(f);r=l}var v=r;n.LexicalEnvironment=v,p(b(a,{var:!1,topLevel:!0}),v)}(e,t),d(e.ECMAScriptCode,null==t?void 0:t.concat({node:e.Function,key:"body"}).concat("BlockStatement"===e.Function.body.type?{node:e.Function.body,key:"body"}:[])),i.pop()}function m(e,t){return{Function:e,FormalParameters:e.params,ECMAScriptCode:"BlockStatement"===e.body.type?e.body.body:e.body,Environment:t}}return l.VariableEnvironment=s,l.LexicalEnvironment=s,i.push(l),d(e,n?[]:void 0),o}var $=r(4223),H=r(2617),q=["typescript"];function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{typescript:r}=t,n=(0,$.A)(t,q),a=function(e){var{typescript:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,H.parse)(e,{plugins:["estree",t&&"typescript"].filter(Boolean),strictMode:!0,attachComment:!1}).program.body,n=t?[]:r;if(t)for(var a of r)if(a.type.startsWith("TS")){if(/Enum|Import|Export/.test(a.type))throw new SyntaxError("Unsupported TypeScript syntax: ".concat(a.type))}else n.push(a);if(0===n.length)throw new SyntaxError("Function declaration not found");if(n.length>1||"FunctionDeclaration"!==n[0].type)throw new SyntaxError("Expect a single function declaration at top level, but received: ".concat(n.map((e=>'"'.concat(e.type,'"'))).join(", ")));return n[0]}(e,{typescript:r});return{function:a,attemptToVisitGlobals:D(a,n)}}function K(e,t){var r=[],n=e.replace(/^\s*<%[~=]?\s|\s%>\s*$/g,(e=>(r.push(e),""))),a=function(e){return(0,H.parseExpression)(e,{plugins:["estree",["pipelineOperator",{proposal:"minimal"}]],attachComment:!1})}(n);return{expression:a,attemptToVisitGlobals:D(a,(0,N.A)((0,N.A)({},t),{},{expressionOnly:!0})),source:n,prefix:r[0],suffix:r[1]}}function z(e){return/^\s*<%[~=]?\s/.test(e)&&/\s%>\s*$/.test(e)}function G(e){return/^\s*<%~\s/.test(e)}function J(e){return/^\s*<%=\s/.test(e)&&/\s%>\s*$/.test(e)}},2308:(e,t,r)=>{r.r(t),r.d(t,{HttpAbortError:()=>$,HttpFetchError:()=>j,HttpParseError:()=>D,HttpResponseError:()=>V,createHttpInstance:()=>W,defaultAdapter:()=>K,fetch:()=>N,http:()=>H,isHttpAbortError:()=>q});var n={};r.r(n),r.d(n,{HttpAbortError:()=>v,HttpFetchError:()=>d,HttpParseError:()=>f,HttpResponseError:()=>p,createHttpInstance:()=>F,defaultAdapter:()=>x,fetch:()=>a,getUrlWithParams:()=>I,http:()=>M,isHttpAbortError:()=>S});var a=(e,t)=>{var r=new Request(e,Object.assign({credentials:"same-origin"},t));return self.fetch(r)},o=r(4635),i=r(918),s=r(4586),l=r(9740),c=r(4223),u=r(6330);class d extends Error{constructor(e){super(e),this.name="HttpFetchError",Error.captureStackTrace&&Error.captureStackTrace(this,d)}}class p extends Error{constructor(e,t){super(e.statusText),(0,s.A)(this,"response",void 0),(0,s.A)(this,"responseJson",void 0),this.name="HttpResponseError",Error.captureStackTrace&&Error.captureStackTrace(this,p),this.response=e,this.responseJson=t}}class f extends Error{constructor(e){super(e.statusText),(0,s.A)(this,"response",void 0),this.name="HttpParseError",Error.captureStackTrace&&Error.captureStackTrace(this,f),this.response=e}}class v extends Error{constructor(e){super(e),this.name="HttpAbortError"}}class h{constructor(){(0,s.A)(this,"handlers",[])}use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}forEach(e){this.handlers.forEach((t=>{null!==t&&e(t)}))}}var m=["params","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache"],g=["params","headers","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache"],y=["body","method"];function b(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 E(e){return null==e}var A=document.querySelector("base"),w=A?A.href:location.origin+"/",S=e=>e instanceof DOMException&&20===e.code,k=function(){var e=(0,u.A)((function*(e,t,r){return new Promise(function(){var n=(0,u.A)((function*(n,o){var i;r.url=e;var{responseType:s}=r.options||{};s||(s="json");try{i=yield a(e,t)}catch(e){return void o(S(e)?new v(e.toString()):new d(e.toString()))}if(i.ok){var l;try{l=yield i[s]()}catch(e){return void o(S(e)?new v(e.toString()):new f(i))}n({status:i.status,statusText:i.statusText,headers:i.headers,data:l})}else{var c;try{c=yield i.json()}catch(e){}o(new p(i,c))}}));return function(e,t){return n.apply(this,arguments)}}())}));return function(t,r,n){return e.apply(this,arguments)}}(),I=(e,t)=>{if(t){var r=new URL(e,w);t instanceof URLSearchParams?t.forEach((function(e,t){r.searchParams.append(t,e)})):Object.entries(t).forEach((e=>{var[t,n]=e;Array.isArray(n)?n.forEach((e=>{r.searchParams.append(t,E(e)?"":e)})):r.searchParams.append(t,E(n)?"":n)}));var{href:n}=r;return n.startsWith(w)?n.substr(w.length):n}return e},P=(e,t)=>{if(void 0!==e){var r=new Headers(t||{}),n="Content-Type",a=e;return r.has(n)||("string"==typeof e?r.set(n,"application/x-www-form-urlencoded"):e instanceof FormData||(r.set(n,"application/json"),a=JSON.stringify(e))),{body:a,headers:r}}return{headers:t}},x=e=>{var{url:t,method:r,data:n}=e;return["DELETE","GET","HEAD"].includes(e.method)?((e,t,r)=>{var n=r.options||{},{params:a,responseType:o,interceptorParams:i,observe:s,noAbortOnRouteChange:u,useCache:d}=n,p=(0,c.A)(n,m);return k(I(t,a),(0,l.A)((0,l.A)({},p),{},{method:e}),r)})(r,t,e):((e,t,r,n)=>{var a=n.options||{},{params:o,headers:i,responseType:s,interceptorParams:u,observe:d,noAbortOnRouteChange:p,useCache:f}=a,v=(0,c.A)(a,g);return k(I(t,o),(0,l.A)((0,l.A)({},v),{},{method:e},P(r,i)),n)})(r,t,n,e)},C=new WeakMap,O=new WeakSet;class T{constructor(e){var t,r,n=this;(0,o.A)(this,O),(0,s.A)(this,"interceptors",void 0),(0,i.A)(this,C,x),(0,s.A)(this,"request",function(){var e=(0,u.A)((function*(e,t,r){var a=t||{},{body:o,method:i}=a,s=(0,c.A)(a,y);return b(O,n,R).call(n,{url:e,data:o,method:i||"GET",options:(0,l.A)((0,l.A)({},r||{}),s)})}));return function(t,r,n){return e.apply(this,arguments)}}()),(0,s.A)(this,"simpleRequest",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(O,n,R).call(n,{url:t,method:e,options:r})})),(0,s.A)(this,"requestWithBody",(function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return b(O,n,R).call(n,{url:t,method:e,data:r,options:a})})),this.interceptors={request:new h,response:new h},null!=e&&e.adapter&&(t=C,r=e.adapter,t.set(b(t,this),r))}getUrlWithParams(e,t){return I(e,t)}getBodyAndHeaders(e,t){return P(e,t)}get(e,t){return b(O,this,R).call(this,{url:e,method:"GET",options:t})}delete(e,t){return b(O,this,R).call(this,{url:e,method:"DELETE",options:t})}head(e,t){return b(O,this,R).call(this,{url:e,method:"HEAD",options:t})}post(e,t,r){return b(O,this,R).call(this,{url:e,method:"POST",data:t,options:r})}put(e,t,r){return b(O,this,R).call(this,{url:e,method:"PUT",data:t,options:r})}patch(e,t,r){return b(O,this,R).call(this,{url:e,method:"PATCH",data:t,options:r})}}function R(e){var t=[],r=Promise.resolve(e);for(this.interceptors.request.forEach((e=>{t.push(e.fulfilled,e.rejected)})),t.push((e=>{return(t=C,t.get(b(t,this))).call(this,e);var t}),void 0),this.interceptors.response.forEach((r=>{t.push((t=>{var n;return null===(n=r.fulfilled)||void 0===n?void 0:n.call(r,t,e)}),(t=>{var n;return null===(n=r.rejected)||void 0===n?void 0:n.call(r,t,e)}))})),t.push((t=>{var r;return"response"===(null===(r=e.options)||void 0===r?void 0:r.observe)?t:t.data}),void 0);t.length;)r=r.then(t.shift(),t.shift());return r}var B,L,_,M=new T;function F(e){M=new T(e)}var{dll:U}=window;L=U&&null!==(B=window.BRICK_NEXT_VERSIONS)&&void 0!==B&&null!==(B=B["brick-container"])&&void 0!==B&&B.startsWith("2.")&&(_=U("JxWY"))?_:n;var{fetch:N,HttpFetchError:j,HttpResponseError:V,HttpParseError:D,HttpAbortError:$,http:H,isHttpAbortError:q,createHttpInstance:W,defaultAdapter:K}=L},7472:(e,t,r)=>{r.r(t),r.d(t,{i18n:()=>d,i18nText:()=>u,initializeI18n:()=>l});var n=r(2350),a=r(5253),o=r(6837),i=!1,s=new Set;function l(e,t){if(i||(i=!0,a.i18n.use(o.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&t&&!s.has(e))for(var[r,n]of(s.add(e),Object.entries(t)))a.i18n.addResourceBundle(r,e,n)}var c=r(9466);function u(e){var t;if(e){var r=null!==(t=a.i18n.language)&&void 0!==t?t:"zh-CN";if((0,c.hasOwnProperty)(e,r))return e[r];var n=r.split("-")[0];if(n!==r)return(0,c.hasOwnProperty)(e,n)?e[n]:void 0;var o="".concat(n,"-");for(var i of Object.keys(e))if(i.startsWith(o))return e[i]}}var d=n.default},5774:(e,t,r)=>{r.r(t),r.d(t,{inject:()=>S,transform:()=>w,transformAndInject:()=>k});var n=r(1030),a=r(8815),o=function(e){return e[e.Initial=0]="Initial",e[e.ExpectField=1]="ExpectField",e[e.ExpectOptionalBeginDefault=2]="ExpectOptionalBeginDefault",e[e.ExpectDefaultValue=3]="ExpectDefaultValue",e[e.ExpectOptionalBeginPipe=4]="ExpectOptionalBeginPipe",e[e.ExpectPipeIdentifier=5]="ExpectPipeIdentifier",e[e.ExpectOptionalBeginPipeParameter=6]="ExpectOptionalBeginPipeParameter",e[e.ExpectPipeParameter=7]="ExpectPipeParameter",e[e.ExpectPlaceholderEnd=8]="ExpectPlaceholderEnd",e}({}),i=function(e){return e.Raw="Raw",e.BeginPlaceHolder="BeginPlaceHolder",e.Field="Field",e.BeginDefault="BeginDefault",e.LiteralString="LiteralString",e.BeginPipe="BeginPipe",e.PipeIdentifier="PipeIdentifier",e.BeginPipeParameter="BeginPipeParameter",e.EndPlaceHolder="EndPlaceHolder",e.JsonValue="JsonValue",e}({}),s=function(e){return e[e.Array=0]="Array",e[e.Object=1]="Object",e[e.String=2]="String",e[e.Others=3]="Others",e}({});function l(e){return new RegExp("(".concat([].concat(e).map((e=>(0,n.escapeRegExp)(e))).join("|"),")\\{"))}function c(e){var t,r=A(e),n=null===(t=r.match(e.beginPlaceholder))||void 0===t?void 0:t[0],a=n?r.indexOf(n):-1;if(a>=0&&n&&"{"!==r.charAt(a+n.length)){var s=e.cursor+a;a>0&&e.tokens.push({type:i.Raw,value:r.substring(0,a)}),e.tokens.push({type:i.BeginPlaceHolder,loc:{start:s,end:s+n.length},value:n.substring(0,n.length-1)}),e.cursor+=a+n.length,e.status=o.ExpectField}else e.tokens.push({type:i.Raw,value:r}),e.cursor=e.raw.length}function u(e){e.cursor+=A(e).match(/^[ \r\n\t]*/)[0].length}function d(e){var[t]=A(e).match(/^(?:[\*\x2D\.0-9A-\[\]_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);e.tokens.push({type:i.Field,value:t}),e.cursor+=t.length,e.status=o.ExpectOptionalBeginDefault}function p(e){"="===A(e).charAt(0)?(e.tokens.push({type:i.BeginDefault}),e.cursor+=1,e.status=o.ExpectDefaultValue):e.status=o.ExpectOptionalBeginPipe}function f(e){E(e,o.ExpectOptionalBeginPipe)}function v(e){"|"===A(e).charAt(0)?(e.tokens.push({type:i.BeginPipe}),e.cursor+=1,e.status=o.ExpectPipeIdentifier):e.status=o.ExpectPlaceholderEnd}function h(e){var t=A(e).match(/^[a-zA-Z]\w*/);if(!t)throw new Error("Expected a pipe identifier at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));var r=t[0];e.tokens.push({type:i.PipeIdentifier,value:r}),e.cursor+=r.length,e.status=o.ExpectOptionalBeginPipeParameter}function m(e){":"===A(e).charAt(0)?(e.tokens.push({type:i.BeginPipeParameter}),e.cursor+=1,e.status=o.ExpectPipeParameter):e.status=o.ExpectOptionalBeginPipe}function g(e){E(e,o.ExpectOptionalBeginPipeParameter)}function y(e){if("}"!==A(e).charAt(0))throw new Error("Expected a placeholder end '}' at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:i.EndPlaceHolder,loc:{start:e.cursor,end:e.cursor+1}}),e.cursor+=1,e.status=o.Initial}var b=new Map([["false",!1],["null",null],["true",!0]]);function E(e,t){var r=A(e);if(/[0-9[{"]/.test(r.charAt(0))||/-[0-9]/.test(r.substring(0,2)))!function(e,t){for(var r=A(e),n=r.charAt(0),a="["===n?s.Array:"{"===n?s.Object:'"'===n?s.String:s.Others,o=0,l=0,c=0,u=!1,d=!1,p=!1;o<r.length;){var f=r.charAt(o);if(d)d=!1;else if(u)'"'===f?u=!1:"\\"===f&&(d=!0);else switch(f){case"[":c+=1;break;case"{":l+=1;break;case"]":c-=1;break;case"}":l-=1;break;case'"':u=!0}switch(o+=1,a){case s.Array:p=!c;break;case s.Object:p=!l;break;case s.String:p=!u;break;default:p=o<r.length&&/[^a-z0-9E.+-]/.test(r.charAt(o))}if(p)break}if(!p)throw new Error("Failed to match a JSON value at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:i.JsonValue,value:JSON.parse(r.substring(0,o))}),e.cursor+=o,e.status=t}(e,t);else{var[n]=A(e).match(/^(?:[\x2D0-9A-Z_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);b.has(n)?e.tokens.push({type:i.JsonValue,value:b.get(n)}):e.tokens.push({type:i.LiteralString,value:n}),e.cursor+=n.length,e.status=t}}function A(e){return e.raw.substring(e.cursor)}function w(e,t){return I(e,"@",t)}function S(e,t){return I(e,"$",t)}function k(e,t){return I(e,["@","$"],t)}function I(e,t,r){if(!function(e,t){return l(t).test(e)}(e,t))return e;var s,b,E=(s=r.data,function(e){var t=e.field?(0,n.get)(s,e.field):s;return void 0===t&&(t=e.defaultValue),(0,a.processPipes)(t,e.pipes)}),A=function(e,t){return function(r){var o,i,s=r.field.match(/^(?:(QUERY(?:_ARRAY)?|EVENT|query|event|APP|HASH|ANCHOR|SYS|FLAGS|CTX)\.)?(.+)$/);if(!s)return t.substring(r.loc.start,r.loc.end);var l,[,c,u]=s;!c&&/^[A-Z_]+$/.test(u)&&(c=u,u="*");var d={SYS:"sys",FLAGS:"flags"};switch(c){case"QUERY":case"query":l="*"===u?e.query:e.query.has(u)?e.query.get(u):void 0;break;case"QUERY_ARRAY":l=e.query.has(u)?e.query.getAll(u):void 0;break;case"EVENT":case"event":if(void 0===e.event)return t.substring(r.loc.start,r.loc.end);l="*"===u?e.event:(0,n.get)(e.event,u);break;case"APP":l="*"===u?null!==(o=e.overrideApp)&&void 0!==o?o:e.app:(0,n.get)(null!==(i=e.overrideApp)&&void 0!==i?i:e.app,u);break;case"HASH":l=e.location.hash;break;case"SYS":case"FLAGS":l="*"===u?e[d[c]]:(0,n.get)(e[d[c]],u);break;case"ANCHOR":var p=e.location.hash?e.location.hash.substr(1):null;l="*"===u?p:(0,n.get)(p,u);break;case"CTX":var f=t.substring(r.loc.start,r.loc.end);return console.error('CTX is not supported in placeholder any more: "'.concat(f,'"')),f;default:if(!e.match)return t.substring(r.loc.start,r.loc.end);l=e.match.params[u]}return void 0===l&&(l=r.defaultValue),(0,a.processPipes)(l,r.pipes)}}(r,e);return b=function(e,t){return function(e){var t,r={type:"InjectableString",elements:[]};function n(r){return r===e[0].type&&(t=e.shift(),!0)}function a(r){if(t=e.shift(),Array.isArray(r)?!r.includes(t.type):r!==t.type)throw new Error("Expected token: ".concat(r,", received token: ").concat(t.type))}for(;e.length>0;)if(n(i.Raw))r.elements.push({type:"RawString",value:t.value});else{a(i.BeginPlaceHolder);var o=t.loc.start,s=t.value;a(i.Field);var l={type:"Placeholder",symbol:s,field:t.value,defaultValue:void 0,pipes:[],loc:{start:o,end:o}};for(r.elements.push(l),n(i.BeginDefault)&&(a([i.JsonValue,i.LiteralString]),l.defaultValue=t.value);n(i.BeginPipe);){a(i.PipeIdentifier);var c={type:"PipeCall",identifier:t.value,parameters:[]};for(l.pipes.push(c);n(i.BeginPipeParameter);)a([i.JsonValue,i.LiteralString]),c.parameters.push(t.value)}a(i.EndPlaceHolder),l.loc.end=t.loc.end}return r}(function(e,t){for(var r={beginPlaceholder:l(t),raw:e,cursor:0,status:o.Initial,tokens:[]};r.cursor<e.length;)switch(r.status){case o.Initial:c(r);break;case o.ExpectField:u(r),d(r);break;case o.ExpectOptionalBeginDefault:u(r),p(r);break;case o.ExpectDefaultValue:u(r),f(r);break;case o.ExpectOptionalBeginPipe:u(r),v(r);break;case o.ExpectPipeIdentifier:u(r),h(r);break;case o.ExpectOptionalBeginPipeParameter:u(r),m(r);break;case o.ExpectPipeParameter:u(r),g(r);break;case o.ExpectPlaceholderEnd:u(r),y(r)}if(r.status!==o.Initial)throw new Error("Expected a placeholder end '}' at the end");return r.tokens}(e,t))}(e,t).elements.map((e=>"RawString"===e.type?e.value:"$"===e.symbol?A(e):E(e))),1===b.length?b[0]:b.join("")}},7457:(e,t,r)=>{r.r(t),r.d(t,{enqueueStableLoadBricks:()=>m,enqueueStableLoadProcessors:()=>g,flushStableLoadBricks:()=>h,loadBricksImperatively:()=>y,loadProcessorsImperatively:()=>E,loadScript:()=>i,loadSharedModule:()=>u,loadStyle:()=>s});var n=r(9740),a=new Map;function o(e,t,r,i){if(Array.isArray(t))return Promise.all(t.map((t=>o(e,t,r))));var s=r&&!/^https?:/.test(t)?"".concat(r).concat(t):t,l=a.get(s);if(l)return l;var c=new Promise(((t,r)=>{var a=()=>{window.dispatchEvent(new Event("request.end"))},o=document.createElement("style"===e?"link":"script");"script"===e?Object.assign(o,(0,n.A)((0,n.A)({type:"text/javascript",async:!0},i),{},{src:s})):Object.assign(o,(0,n.A)((0,n.A)({rel:"stylesheet"},i),{},{href:s})),o.onload=()=>{t(s),a()},o.onerror=e=>{r(e),a()};var l=document.currentScript||document.getElementsByTagName("script")[0];l.parentNode.insertBefore(o,l),window.dispatchEvent(new Event("request.start"))}));return a.set(s,c),c}function i(e,t,r){return o("script",e,t,r)}function s(e,t,r){return o("style",e,t,r)}var l,c=r(6330);function u(e,t){return d.apply(this,arguments)}function d(){return(d=(0,c.A)((function*(e,t){yield r.I("default");var n=window[e];return yield n.init(r.S.default),(yield n.get(t))()}))).apply(this,arguments)}var p,f=!1,v=new Promise((e=>{l=e}));function h(){f||l()}function m(e,t){return C(P("bricks",e,t))}function g(e,t){return C(P("processors",e,t))}function y(e,t){return b.apply(this,arguments)}function b(){return(b=(0,c.A)((function*(e,t){var r=P("bricks",e,t);return h(),C(r)}))).apply(this,arguments)}function E(e,t){var r=P("processors",e,t);return h(),C(r)}var A="v2-adapter.load-bricks";function w(e,t,r){var n=new Map,a=new Set,o=t=>{var i;if(!a.has(t)){var s,l,c;if(a.add(t),"processors"===e||t.includes(".")){[l,c]=t.split(".");var u="bricks/".concat("processors"===e?l.replace(/[A-Z]/g,(e=>"-".concat(e[0].toLocaleLowerCase()))).replace(/_[0-9]/g,(e=>"-".concat(e[1]))):l);s=r.get(u)}else{var d;for(var p of(c=t,r.values())){var f;if(null!==(f=p.elements)&&void 0!==f&&f.some((e=>e===c))){var v;if(null===(v=p.deprecatedElements)||void 0===v||!v.includes(t)){s=p;break}d=p}}!s&&d&&(s=d)}if(s){var h=n.get(s);h||(h=[],n.set(s,h)),h.push({fullName:t,lastName:c});var m=null===(i=s.dependencies)||void 0===i?void 0:i[t];if(m)for(var g of m)o(g)}else console.error("Package for ".concat(t," not found."))}};for(var i of t)o(i);return n}function S(e,t,r){return k.apply(this,arguments)}function k(){return(k=(0,c.A)((function*(e,t,r){var n="".concat("processors"===e?"./processors/":"./").concat(r.lastName);try{yield u(t,n)}catch(t){throw console.error(t),new Error("Load ".concat(e,' of "').concat(r.fullName,'" failed'))}}))).apply(this,arguments)}function I(e,t,r){return t.map(function(){var t=(0,c.A)((function*(t){var n;return yield i(t.filePath,null!==(n=window.PUBLIC_ROOT)&&void 0!==n?n:""),yield v,Promise.all(r.get(t).map((r=>S(e,t.id,r))))}));return function(e){return t.apply(this,arguments)}}())}function P(e,t,r){return x.apply(this,arguments)}function x(){return x=(0,c.A)((function*(e,t,r){var n=new Map;for(var a of r){var o,s=null!==(o=a.id)&&void 0!==o?o:T(a.filePath);n.set(s,a)}var u,d,v=w(e,t,n),h=[],m=[];for(var g of v.keys())if(g.id)"bricks/basic"===g.id?u=g:m.push(g);else if(h.push(g),!(d=n.get("bricks/v2-adapter")))throw new Error("Using v2 bricks, but v2-adapter not found");var y,b=d,E=u;if(E){var k,P=i(E.filePath,null!==(k=window.PUBLIC_ROOT)&&void 0!==k?k:"");f||(f=!0,P.then((()=>Promise.resolve())).then(l)),y=P.then((()=>Promise.all(v.get(E).map((t=>S(e,E.id,t))))))}var x=[y].concat(I(e,m,v));if(b&&h.length>0){if(!p){var C=w("bricks",[A],n),O=[...C.keys()],R=function(){var e=(0,c.A)((function*(){return yield Promise.all(I("bricks",O,C)),document.createElement(A)}));return function(){return e.apply(this,arguments)}}();p=R()}x.push(p.then((t=>Promise.all(h.map((n=>{var a=T(n.filePath).split("/")[1];return t.resolve(b.filePath,n.filePath,"bricks"===e?v.get(n).map((e=>"".concat(a,".").concat(e.lastName))):[],n.dll,r)}))))))}yield Promise.all(x)})),x.apply(this,arguments)}function C(e){return O.apply(this,arguments)}function O(){return(O=(0,c.A)((function*(e){window.dispatchEvent(new Event("request.start"));try{yield e}finally{window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function T(e){return e.split("/").slice(0,2).join("/")}},6605:(e,t,r)=>{r.r(t),r.d(t,{pipes:()=>n.pipes,processPipes:()=>o,utils:()=>n.utils});var n=r(161),a=new Map(Array.from(Object.entries(n.pipes)));function o(e,t){if(0===t.length)return e;var r=e;for(var n of t){var o=a.get(n.identifier);if(!o)return void console.warn("Unknown pipe: ".concat(n.identifier));r=o(r,...n.parameters)}return r}},6939:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>zt,Notification:()=>tr,StoryboardFunctionRegistryFactory:()=>ve,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>re,authenticate:()=>po,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Et,checkIfOfComputed:()=>yt,createHistory:()=>I,createRuntime:()=>Za,customProcessors:()=>_,customTemplates:()=>Be,fetchByProvider:()=>mo,getAuth:()=>fo,getBasePath:()=>v,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>te,getHistory:()=>P,getPageInfo:()=>va,getRuntime:()=>eo,getV2RuntimeFromDll:()=>k,handleHttpError:()=>er,httpErrorToString:()=>Jt,isLoggedIn:()=>ho,isUnauthenticatedError:()=>Yt,logout:()=>vo,matchPath:()=>Bt,registerWidgetFunctions:()=>Ue,registerWidgetI18n:()=>j,setUIVersion:()=>ya,unstable_createRoot:()=>yo});var n={};r.r(n),r.d(n,{addRealTimeDataInspectHook:()=>Cn,getAddedContracts:()=>kn,getAllContextValues:()=>An,getBrickPackagesById:()=>wn,getContextValue:()=>En,getRenderId:()=>Sn,legacyDoTransform:()=>un,mountUseBrick:()=>ln,renderUseBrick:()=>on,setRealTimeDataInspectRoot:()=>xn,symbolForRootRuntimeContext:()=>an,unmountUseBrick:()=>cn,updateSnippetPreviewSettings:()=>yn,updateStoryboard:()=>dn,updateStoryboardByRoute:()=>pn,updateStoryboardBySnippet:()=>mn,updateStoryboardByTemplate:()=>fn,updateTemplatePreviewSettings:()=>vn});var a=r(9740),o=r(6330),i=r(4635),s=r(4586),l=r(918),c=r(406),u=r(8984),d=r(9466),p=r(1302),f=(r(6036),r(2890));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(4223),m=r(1030);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 a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&y(a,t))return n}}function y(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function b(e){var t;return!e||(null===(t=eo().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var E,A=["extraQuery","clear","keepHash"],w=!1;function S(e,t){t(!(w=!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(!E){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:S});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){w=!1,r(e,t),null==n||n(w)}function i(e,t,r){w=!1,n(e,t),null==r||r(w)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:l,keepHash:c}=n,u=(0,h.A)(n,A),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?o:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,a)}}return(0,a.A)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.A)((0,a.A)({},e.location),{},{key:void 0,hash:t,state:(0,a.A)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.A)((0,a.A)({},e.location),{},{state:(0,a.A)((0,a.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(a,o,i){var s,l="string"==typeof a;return"string"==typeof(s=l?(0,f.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&b(function(e){var t,r;return g(null!==(t=null===(r=qa)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?v()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.A)((0,a.A)({},e),{},{push:o,replace:i})))}(e)),E=e}return E}var P=function(){var e=k();if(e)return e.getHistory}()||function(){return E},x=r(3230),C=r(4303),O=r(9472),T=r(351),R=r(3107);function B(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 L=new WeakMap,_=function(){var e=k();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,l.A)(this,L,new Map)}define(e,t){var[r,n]=e.split("."),a=B(L,this).get(r);if(a||(a=new Map,B(L,this).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return B(L,this).get(e)}};function M(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=F("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;c.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)c.i18n.removeResourceBundle(e,n)}}}function F(e,t){return"".concat(e,"/").concat(t)}function U(e){return c.i18n.getFixedT(null,F("widget",e))}var N,j=function(){var e=k();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=F("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;c.i18n.addResourceBundle(t,r,n)}))},V="brick-next-devtools-panel",D="devtools-frame-active-change",$="devtools-panel-change",H=!0;function q(e,t){var r=W();if(r&&("evaluation"!==e||H&&(!N||"Evaluations"===N))){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 W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var K=()=>{throw new Error("Can't modify read-only proxy object")},z={set:K,defineProperty:K,deleteProperty:K,setPrototypeOf:K};function G(e){return new Proxy(e,z)}function J(e){var{get:t,ownKeys:r}=e;return W()?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,a.A)((0,a.A)({},ae()),e))}function ae(){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 oe="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));oe=e}function se(){return document.documentElement.dataset.mode}function le(e){e?ie(e):e=oe,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 a=de(n,t);void 0!==a&&(r[n]=a)}return r}function de(e,t){var r,n,a,{collectCoverage:o,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return o?"/next":v().replace(/\/$/,"");case"FN":return d;case"IMG":return o?{get:e=>"mock/images/".concat(e)}:i?null==Ka||null===(r=Ka.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==Ka||null===(n=Ka.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return o?m.identity:i?U(i):c.i18n.getFixedT(null,[u,F("app",l.id)].filter(Boolean));case"I18N_TEXT":return o?pe:c.i18nText;case"PERMISSIONS":return G({check:o?fe:null==Ka||null===(a=Ka.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return G({getTheme:o?()=>"light":ee});case"console":return p?G(console):void 0;case"location":return o?{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]:{},o=new Map,i=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,l=o.get(a);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(a));var c=(0,C.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,C.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,R.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),o.clear(),Array.isArray(t))for(var a of t){var i=(0,O.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,O.collectMemberUsageInFunction)(a,"PERMISSIONS",!!n).has("check");o.set(a.name,{source:a.source,typescript:a.typescript,deps:i,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,a.A)((0,a.A)({},t),{},{name:e}),n=(0,O.collectMemberUsageInFunction)(r,"FN",!0),i=(0,O.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");o.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=o.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=r(3601),be=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),Ee=new Map([[be.xLarge,"1920px"],[be.large,"1600px"],[be.medium,"1280px"],[be.small,"1024px"],[be.xSmall,0]]),Ae=new ye.A,we={},Se={};function ke(e,t){var r=!1;for(var[n]of(we[t]=e.matches,Ee))if(we[n]&&Se.breakpoint!==n){Se.breakpoint=n,r=!0;break}r&&Ae.dispatchEvent(new CustomEvent("change",{detail:Se}))}Ee.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));ke(r,t),r.addEventListener?r.addEventListener("change",(e=>{ke(e,t)})):r.addListener((e=>{ke(e,t)}))}));var Ie=()=>Se;function Pe(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 xe(e){var t,r;return!(null===(t=e?e.flags:null===(r=eo())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Ce(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var o=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(o),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(o),...n)}function Oe(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 Te=new Set(["prefix"]),Re=new WeakMap,Be=function(){var e=k();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,l.A)(this,Re,new Map)}define(e,t){var r,n,o,i,s=Oe(Re,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=xe(),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?(Ce(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,a.A)((0,a.A)({},t),{},{proxy:(0,a.A)((0,a.A)({},t.proxy),{},{properties:Object.fromEntries(u)}),state:(t.state?l?t.state:t.state.map((e=>(0,a.A)({expose:!0},e))):[]).concat(d.map((e=>({name:e,expose:!0}))))});Oe(Re,this).set(e,(0,a.A)((0,a.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:[])),b=Object.entries(null!==(o=null===(i=v.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),E=y.concat(u.map((e=>e[0]))),A=b.map((e=>e[0])),w=E.concat(A).filter((e=>e in HTMLElement.prototype&&!Te.has(e)));if(w.length>0&&(Ce(l,"Using native HTMLElement properties as template properties or methods",e,...w),l))throw new Error('In custom template "'.concat(e,'", ').concat(w.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 E}static get _dev_only_definedMethods(){return A}$$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,a,o=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);o&&(o[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[P,x]of u)I(P,x);var C=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,T]of b)C(O,T);customElements.define(e,t)}}get(e){return Oe(Re,this).get(e)}};function Le(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var o=a.get(n);if(!o)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 o}function _e(e,t,r){var n=Le(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 Me=new Map,Fe=new Proxy(Object.freeze({}),{get:(e,t)=>Me.get(t)}),Ue=function(){var e=k();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Me.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=ve({widgetId:e,widgetVersion:r});Me.set(e,n),a(t)},Ne=r(5462);function je(e,t){var r=uo(e);if(!r&&null!=Ka&&Ka.checkInstalledApps&&(r=Ka.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(0,Ne.U)(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ve(e,t,r){var{formStateStoreId:n,formStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var o=a.get(n);if(!o)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 o}var De=new Map;function $e(e){return He.apply(this,arguments)}function He(){return He=(0,o.A)((function*(e){var t,r=null==Ka||null===(t=Ka.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=Ka.flowApi.FLOW_API_PROVIDER);var n=De.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)Ka.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],io()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),De.set(e,n),n})),He.apply(this,arguments)}var qe=new WeakSet;function We(e){if((0,d.isObject)(e)&&!Ke(e))if(qe.add(e),Array.isArray(e))e.forEach(We);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(We)}}function Ke(e){return qe.has(e)}var ze=new Map;function Ge(e,t,r){return Je.apply(this,arguments)}function Je(){return(Je=(0,o.A)((function*(e,t,r){var{useProvider:n,method:o="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=xe();if(Ce(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([$e(n),ut(i,t)]),h=null==r?void 0:r.renderId,g=Ye(f,n,o,v,r,i,!!h&&h!==so()),{transform:y}=e;try{var b=yield g;We(p=u?(0,m.get)(b,c):b)}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}:ut(y,(0,a.A)((0,a.A)({},t),{},{data:p})):p}))).apply(this,arguments)}function Ye(e,t,r,n,a,o,i){return Qe.apply(this,arguments)}function Qe(){return Qe=(0,o.A)((function*(e,t,r,n,a,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==a?void 0:a.cache)&&(c=ze.get(l)),c||(c=(0,o.A)((function*(){var a,o=null!=Ka&&null!==(a=Ka.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield Ka.flowApi.getArgsOfFlowApi(t,n,r):n;return e[r](...o)}))(),s||ze.set(l,c)),c})),Qe.apply(this,arguments)}var Xe=Symbol.for("pre.evaluated.raw"),Ze=Symbol.for("pre.evaluated.context");function et(e){return!(null==e||!e[Xe])}function tt(e){return e[Xe]}function rt(e){return"string"==typeof e?(0,C.shouldAllowRecursiveEvaluations)(e):(0,C.shouldAllowRecursiveEvaluations)(e[Xe])}var nt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function at(e){return nt.has(e.constructor)?e.constructor:TypeError}function ot(){return(ot=(0,o.A)((function*(e,t,r){var{blockingList:n,run:a}=it(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function it(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=[];if("string"!=typeof e){var i=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.A)((0,a.A)({},e[Ze]),i),e=e[Xe]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,C.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(at(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:b}=s;if(r.lazy||b.has("EVENT")&&!(0,d.hasOwnProperty)(t,"event")||b.has("DATA")&&!(0,d.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[Xe]:e,[Ze]:t}:e};var E,A,w=xe(t);(b.has("STATE")||!w&&b.has("TPL"))&&(g=Le(t,"STATE",': "'.concat(e,'"'))),b.has("FORM_STATE")&&(A=Ve(t,"FORM_STATE",': "'.concat(e,'"')));var S=W();if(n||S){if(b.has("CTX")&&(f=(0,O.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(f))),g){if(h=(0,O.strictCollectMemberUsage)(e,"STATE"),!w){var k=(0,O.strictCollectMemberUsage)(e,"TPL");for(var I of k)h.add(I)}n&&o.push(g.waitFor(h))}A&&(E=(0,O.strictCollectMemberUsage)(e,"FORM_STATE"),n&&o.push(A.waitFor(E))),b.has("PROCESSORS")&&(v=(0,O.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,u.loadProcessorsImperatively)(v,io())))}if(n){var P,x=b.has("PERMISSIONS");if(!x&&b.has("FN")){var T=[...(0,O.strictCollectMemberUsage)(e,"FN")];x=ge(T)}if(x&&o.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=Ka&&Ka.menu){var B=[...l.usedArgs];o.push(Promise.all(B.map((e=>Ka.menu.fetchMenuById(e,t,{getStoryboardByAppId:co,resolveData:Ge,asyncComputeRealValue:ut})))))}c.usedArgs.size>0&&o.push(null==Ka||null===(P=Ka.checkInstalledApps)||void 0===P?void 0:P.waitForCheckingApps([...c.usedArgs]))}return{blockingList:o,run(){var r,n,o,i,{app:l,location:c,query:u,match:p,flags:S,sys:k,ctxStore:I,data:P,event:x}=t,O=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var T of b)switch(T){case"ANCHOR":y[T]=c.hash?c.hash.substring(1):null;break;case"APP":y[T]=(0,a.A)((0,a.A)({},(0,m.cloneDeep)(O)),{},{getMenu:null==Ka||null===(n=Ka.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[T]=J({get:(e,t)=>I.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[T]=P;break;case"EVENT":y[T]=x;break;case"FLAGS":y[T]=G(S);break;case"FORM_STATE":y[T]=J({get:(e,t)=>A.getValue(t),ownKeys:()=>Array.from(E)});break;case"HASH":y[T]=c.hash;break;case"INSTALLED_APPS":y[T]=G({has:je});break;case"ITEM":case"INDEX":var B="ITEM"===T?"forEachItem":"forEachIndex";(0,d.hasOwnProperty)(t,B)?y[T]=t[B]:console.error("Using `".concat(T,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":y[T]=G({getItem:Pe("local")});break;case"MEDIA":y[T]=G(Ie());break;case"MISC":y[T]=eo().getMiscSettings();break;case"PARAMS":y[T]=new URLSearchParams(u);break;case"PATH":y[T]=G(null!==(o=null==p?void 0:p.params)&&void 0!==o?o:{});break;case"PATH_NAME":y[T]=c.pathname;break;case"PROCESSORS":y[T]=J({get(e,t){var r=_.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[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[T]=G({getItem:Pe("session")});break;case"TPL":if(Ce(w,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),w)break;case"STATE":y[T]=J({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[T]=G(null!=k?k:{});break;case"__WIDGET_FN__":y[T]=Fe;break;case"__WIDGET_IMG__":y[T]=null==Ka||null===(i=Ka.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":y[T]=U}Object.assign(y,ue(s.attemptToVisitGlobals,{storyboardFunctions:he,app:O,appendI18nNamespace:t.appendI18nNamespace}));try{var L=(0,C.cook)(s.expression,s.source,{globalVariables:(0,R.supply)(s.attemptToVisitGlobals,y)});return q("evaluation",{raw:e,context:y,result:L}),L}catch(t){var M="".concat(t.message,', in "').concat(e,'"');throw new(at(t))(M)}}}}var st=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 lt(e){switch(e){case st.USE_BRICK_PROPERTIES:case st.USE_BRICK_TRANSFORM:case st.USE_BRICK_EVENTS:case st.USE_BRICK_IF:case st.USE_BRICK_LIFECYCLE:case st.USE_BRICK_DATA_SOURCE:return!0}return!1}function ct(e,t,r){if(lt(e))return e;if(t)switch(e){case st.USE_BRICK:return st.USE_BRICK_ITEM;case st.USE_BRICK_SLOTS_ITEM_BRICKS:return st.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case st.INITIAL:if("useBrick"===r)return st.USE_BRICK;break;case st.USE_BRICK:case st.USE_BRICK_ITEM:case st.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return st.USE_BRICK_PROPERTIES;case"transform":return st.USE_BRICK_TRANSFORM;case"dataSource":return st.USE_BRICK_DATA_SOURCE;case"events":return st.USE_BRICK_EVENTS;case"slots":return st.USE_BRICK_SLOTS;case"children":return st.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return st.USE_BRICK_IF;case"lifeCycle":return st.USE_BRICK_LIFECYCLE}break;case st.USE_BRICK_SLOTS:return st.USE_BRICK_SLOTS_ITEM;case st.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return st.USE_BRICK_SLOTS_ITEM_BRICKS}return st.INITIAL}function ut(e,t){return dt.apply(this,arguments)}function dt(){return dt=(0,o.A)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=et(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&<(r.$$stateOfUseBrick),i=o;return n||(0,C.isEvaluable)(e)?(a=yield function(e,t,r){return ot.apply(this,arguments)}(e,t,{lazy:o}),i=rt(e)):a=o?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?vt:T.inject)(e,t),i||We(a),a}if(!(0,d.isObject)(e)||Ke(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=ft(r,!0);return Promise.all(e.map((e=>ut(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([ut(n,t),ut(a,t,ft(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),dt.apply(this,arguments)}function pt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=et(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&<(r.$$stateOfUseBrick),i=o;return n||(0,C.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=it(e,t,void 0,!1);return n()}(e,t),i=rt(e)):a=o?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?vt:T.inject)(e,t),i||We(a),a}if(!(0,d.isObject)(e)||Ke(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=ft(r,!0);return e.map((e=>pt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[pt(n,t),pt(a,t,ft(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function ft(e,t,r){return e.$$lazyForUseBrick?(0,a.A)((0,a.A)({},e),{},{$$stateOfUseBrick:ct(e.$$stateOfUseBrick,t,r)}):e}function vt(e){return e}function ht(e,t){return mt.apply(this,arguments)}function mt(){return(mt=(0,o.A)((function*(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||et(e.if)?yield ut(e.if,t):e.if)}))).apply(this,arguments)}function gt(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||et(e.if)?pt(e.if,t):e.if)}function yt(e){return!(0,d.hasOwnProperty)(e,"if")||!!e.if}function bt(){return(bt=(0,o.A)((function*(e,t){return(0,d.isObject)(e.if)&&!et(e.if)?yt(yield Ge(e.if,t)):ht(e,t)}))).apply(this,arguments)}var Et=function(){var e=k();if(e)return e.looseCheckIfByTransform}()||function(e,t){return gt(e,{data:t})};function At(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,C.isEvaluable)(e):et(e)){var a="string"==typeof e?e:tt(e);if((0,C.isTrackAll)(a)){var o=(0,O.trackAll)(a);o&&(t=o.context,r=o.state,n=o.formState)}else t=(0,O.track)(a,"track context","CTX"),r=(0,O.track)(a,"track state","STATE"),n=(0,O.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function wt(e,t){return St.apply(this,arguments)}function St(){return(St=(0,o.A)((function*(e,t){for(var[r,n,a]of e)if(r===t){var o=yield n;if(void 0!==o||!a)return o}}))).apply(this,arguments)}function kt(e){return It.apply(this,arguments)}function It(){return(It=(0,o.A)((function*(e){var t={};for(var[r,n,a]of e){var o=yield n;void 0===o&&a||!("style"!==r&&"dataset"!==r||(0,d.isObject)(o))||(t[r]=o)}return t}))).apply(this,arguments)}function Pt(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,o]of Object.entries(n))e[r][a]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function xt(e,t,r){var n=function(e,t){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=pt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?st.USE_BRICK:st.INITIAL});if("style"!==r&&"dataset"!==r||(0,d.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Pt(e,n)}))}var Ct=r(264),Ot=new Map,Tt=1e4,Rt=0;function Bt(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:o=!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=Ot.get(r);n||Ot.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:(0,Ct.MM)(e,o,t),keys:o};return Rt<Tt&&(n.set(e,i),Rt++),i}(r,{end:n,strict:a,sensitive:o}),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 Lt(){return(Lt=(0,o.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=_t(r,t.app.homepage,t.location.pathname);if(n&&(yield ht(r,t)))return t.app.noAuthGuard||r.public||null==Ka||!Ka.auth||Ka.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function _t(e,t,r){return Bt(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Mt,Ft=Symbol.for("tpl.asyncComputedPropsFromHost"),Ut=Symbol.for("tpl.stateStoreId"),Nt=Symbol.for("tpl.externalForEachItem"),jt=Symbol.for("tpl.externalForEachIndex"),Vt=Symbol.for("tpl.externalNoForEach"),Dt=new Set,$t=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}({}),Ht={[$t.REQUEST_FAILED]:"Request Failed",[$t.SOMETHING_WENT_WRONG]:"Something went wrong!",[$t.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[$t.NETWORK_ERROR]:"Network error, please check your network."},qt={[$t.REQUEST_FAILED]:"请求失败",[$t.SOMETHING_WENT_WRONG]:"出现了一些问题!",[$t.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[$t.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},Wt="core/runtime",Kt={en:Ht,zh:qt},zt=Object.freeze({show:function(e){return Mt?Mt.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 Gt(e){var{search:t,pathname:r}=e,n=r?window.btoa(encodeURIComponent(r)):"",a=t?window.btoa(encodeURIComponent(t)):"";document.cookie="SALOGINPATH=".concat(n,"; path=/"),document.cookie="SALOGINQUERY=".concat(a,"; path=/")}function Jt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof x.HttpFetchError)return c.i18n.t("".concat(Wt,":").concat($t.NETWORK_ERROR));if(e instanceof x.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 Yt(e){return e instanceof x.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var Qt,Xt,Zt=!1;function er(e){if(!(e instanceof x.HttpAbortError)){if(Yt(e)&&!window.NO_AUTH_GUARD){if(Zt)return;return Zt=!0,void zt.show({type:"confirm",content:c.i18n.t("".concat(Wt,":").concat($t.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=eo().getFeatureFlags()["sso-enabled"],Gt((t=P()).location),t.push(e?"/sso-auth/login":"/auth/login",{from:(0,a.A)((0,a.A)({},t.location),{},{state:void 0})}),Zt=!1}),(()=>{Zt=!1}))}console.error(e);var t=Jt(e);t!==Qt&&(Qt=t,zt.show({type:"error",title:c.i18n.t("".concat(Wt,":").concat($t.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Qt=void 0})))}}var tr=Object.freeze({show:function(e){Xt?Xt.resolve(e):alert(e.message)}});function rr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=sr(a,r,{element:e});for(var i of(e.addEventListener(n,o),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,o]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,i])}))}function nr(e){return"string"==typeof e.action}function ar(e){return"string"==typeof e.useProvider}function or(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function ir(e){return!!e.then}function sr(e,t,r){return function(n){var o,i;for(var s of[].concat(e))if(gt(s,(0,a.A)((0,a.A)({},t),{},{event:n})))if(ir(s))sr(s.then,t,r)(n);else if(nr(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":fr(n,c,s.args,s.callback,t);break;case"window.open":vr(n,s.args,t);break;case"location.reload":case"location.assign":br(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Er(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":Ar(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":wr(n,c,s.args,t);break;case"handleHttpError":er(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":mr(n,c,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":gr(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=Pr(s.args,t,n);_e(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":yr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Sr(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]=Pr(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 ar(s)?lr(n,s,t,r):or(s)?ur(n,s,t,r):console.error("unknown event handler:",s);else s.else&&sr(s.else,t,r)(n)}}function lr(e,t,r,n){return cr.apply(this,arguments)}function cr(){return(cr=(0,o.A)((function*(e,t,r,n){try{dr(e,yield $e(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(Jt(e))}}))).apply(this,arguments)}function ur(e,t,r,n){var o=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,C.isEvaluable)(i):et(i))&&(l=pt(i,(0,a.A)((0,a.A)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&o.push(c)}else if(l)l instanceof HTMLElement?o.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,C.isEvaluable)(s):et(s))&&(u=pt(s,(0,a.A)((0,a.A)({},r),{},{event:e})));var d=[].concat(u),p=_e(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{dr(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&xt(o,t.properties,(0,a.A)((0,a.A)({},r),{},{event:e})):console.error("target not found:",i||s)}function dr(e,t,r,n,a,o,i){return pr.apply(this,arguments)}function pr(){return pr=(0,o.A)((function*(e,t,r,n,i,s,l){if("function"==typeof t[n]){var c=function(){var a=(0,o.A)((function*(){var a,o=Pr(r.args,i,e,l);return ar(r)&&null!=Ka&&null!==(a=Ka.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(o=yield Ka.flowApi.getArgsOfFlowApi(r.useProvider,o,n)),t[n](...o)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var u=Ir(r.callback,i,s),d={progress:u("progress"),success:u("success"),error:u("error"),finally:u("finally")};if(ar(r)){var p,f=(0,a.A)((0,a.A)({},i),{},{event:e});if(pt(null===(p=r.poll)||void 0===p?void 0:p.enabled,f))return void function(e,t,r,n){var a,{progress:i,success:s,error:l,finally:c}=t,{expectPollStopImmediately:u,expectPollEnd:d}=r,{interval:p,leadingRequestDelay:f,continueOnError:v,delegateLoadingBar:h}=pt((0,m.pick)(r,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),n),g=so();function y(){return b.apply(this,arguments)}function b(){return(b=(0,o.A)((function*(){var t;Dt.delete(a);try{var r;if(!(t=null===(r=pt(u,n))||void 0===r?void 0:r())){var o,f,m=yield e();(t=(null===(o=pt(u,n))||void 0===o?void 0:o())||g!==so())||(null==i||i(m),null!==(f=pt(d,n))&&void 0!==f&&f(m)?(h&&window.dispatchEvent(new Event("request.end")),null==s||s(m),null==c||c()):E(null!=p?p:3e3))}}catch(e){var y;(t=(null===(y=pt(u,n))||void 0===y?void 0:y())||g!==so())||(null==l||l(e),v?E(null!=p?p:3e3):null==c||c())}finally{h&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function E(e){a=setTimeout(y,e),Dt.add(a)}E(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})})),pr.apply(this,arguments)}function fr(e,t,r,n,a){var o=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":o=2,i=!0;break;case"reload":i=!0;break;case"block":o=1,s="setBlockMessage"}var l=[];if(o>0&&((l=Pr(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var c=Ir(n,a,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}P()[s](...l)}function vr(e,t,r){var[n,a,o]=Pr(t,r,e);window.open(n,a||"_self",o)}function hr(e,t,r,n,a,o){t?n.updateValues(e,r,(e=>Pr(e,a,o)[0])):e.forEach((e=>{var{name:t,value:i}=Pr([e],a,o)[0];n.updateValue(t,i,r)}))}function mr(e,t,r,n,a,o){if(!Array.isArray(r)||!r.every(d.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=Pr(r,o,e);o.ctxStore.updateValue(i,s,t,a,o)}else hr(r,n,t,o.ctxStore,o,e)}function gr(e,t,r,n,a,o){if(Array.isArray(r)&&r.every(d.isObject)&&"update"===t)hr(r,n,"replace",Le(o,"state.".concat(t),": ".concat(JSON.stringify(r))),o,e);else{var[i,s]=Pr(r,o,e);Le(o,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,a,o)}}function yr(e,t,r,n){var[a,o]=Pr(t,n,e);Ve(n,"formstate.update",": ".concat(a)).updateValue(a,o,"replace",r,n)}function br(e,t,r,n){if("assign"===t){var[a]=Pr(r,n,e);location.assign(a)}else location[t]()}function Er(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=Pr(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function Ar(e,t,r,n){console[t](...Pr(r,n,e,{useEventAsDefault:!0}))}function wr(e,t,r,n){var a=Pr(r,n,e,{useEventAsDefault:!0});tr.show({type:t,message:a[0]})}function Sr(e,t,r,n,a,o){return kr.apply(this,arguments)}function kr(){return(kr=(0,o.A)((function*(e,t,r,n,a,o){var i=()=>{var a,o=Pr(r,n,e);return null==Ka||null===(a=Ka.messageDispatcher)||void 0===a?void 0:a[t](...o)};if(o){var s=Ir(o,n,a);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Ir(e,t,r){return function(n){return function(a){var o=null==e?void 0:e[n];if(o)try{var i=new CustomEvent("callback.".concat(n),{detail:a});sr(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function Pr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?pt(e,(0,a.A)((0,a.A)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}function xr(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=Le(n,"bindTemplateProxy"),i=o.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(),o.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;a.addEventListener(l,s),null!==(i=(n=a).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),a.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function Cr(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=Le(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}var Or=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Tr(e){e.replaceChildren()}function Rr(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;for(var r=e.child,n=[];r;){if(r.tag===Or.BRICK){var a,o=r.type;o.includes("-")&&!customElements.get(o)&&console.error("Undefined custom element: ".concat(o)),"basic-bricks.script-brick"===o&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(o);r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Pt(i,r.properties),rr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Le({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),xr(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===Or.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0),l.tag===Or.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 Br(e,t){return e.get(_r(e,t))}function Lr(e,t,r){return e.set(_r(e,t),r),r}function _r(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 Mr=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Fr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],Ur=new WeakMap,Nr=new WeakMap,jr=new WeakMap,Vr=new WeakMap,Dr=new WeakMap,$r=new WeakMap,Hr=new WeakMap,qr=new WeakMap,Wr=new WeakMap,Kr=new WeakSet;class zr{constructor(e,t){var r;(0,i.A)(this,Kr),(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,Ur,void 0),(0,l.A)(this,Nr,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,l.A)(this,jr,new Map),(0,l.A)(this,Vr,void 0),(0,l.A)(this,Dr,new Map),(0,l.A)(this,$r,void 0),(0,l.A)(this,Hr,void 0),(0,l.A)(this,qr,void 0),(0,l.A)(this,Wr,[]),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",Lr(Ur,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequests(e){Lr(Hr,this,e)}memoizeMenuRequests(e,t){Br(qr,this)||Lr(qr,this,new WeakMap),Br(qr,this).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,o.A)((function*(){var a,o;for(var i of e){var s;if(a=null===(s=Br(qr,n))||void 0===s?void 0:s.get(i)){o=i;break}}var l,c=Br(Hr,n),u=a?c.indexOf(a):-1;if(-1===u){if(!r.length)return;c.push(...r)}else c.splice(u,c.length-u,...r);o&&o!==t&&(null===(l=Br(qr,n))||void 0===l||l.delete(o)),yield Br(Ur,n).mergeMenus(c)}))()}reBailout(e){return Br(Ur,this).bailout(e)}reCatch(e,t){return Br(Ur,this).catch(e,t)}didPerformIncrementalRender(e,t){var r=this;return(0,o.A)((function*(){for(var n=Br(Wr,r).length-1;n>=0;n--){var a=Br(Wr,r)[n];if(yield a(e,t))return!0}return!1}))()}performIncrementalRender(e){Br(Wr,this).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Mr,..."page"===this.scope?Fr:[]];for(var n of r){var a=t[n];a&&Br(Nr,this)[n].push({brick:e,handlers:a})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=Br(Dr,this).get(e);r?r.add(t):Br(Dr,this).set(e,new Set([t]))}memoize(e,t,r,n){Br($r,this)||Lr($r,this,new WeakMap);var a=[null!=e?e:"",...t].join("."),o=Br($r,this).get(n);o||(o=new Map,Br($r,this).set(n,o)),o.set(a,{node:r,last:Xr(r),lastNormal:Zr(r),lastPortal:tn(r)})}reRender(e,t,r,n){var a,o=[null!=e?e:"",...t].join("."),i=Br($r,this).get(n).get(o),{node:s,last:l,lastNormal:c,lastPortal:u}=i,d=[];if((null==s?void 0:s.tag)===Or.PLACEHOLDER){var p,f,v;a=null!==(p=null===(f=function(e){return en(e,!0)}(s))||void 0===f?void 0:f.element)&&void 0!==p?p:null;var h=null===(v=function(e){return rn(e,!0)}(s))||void 0===v?void 0:v.element;h&&d.push(h)}else{var m,g,y;a=null!==(m=null==c||null===(g=c.element)||void 0===g?void 0:g.nextSibling)&&void 0!==m?m:null;for(var b=null==u||null===(y=u.element)||void 0===y?void 0:y.nextSibling;b&&(d.push(b),b instanceof HTMLElement&&"DIV"===b.tagName);)b=b.nextSibling}var E,A=Xr(r);i.node=r,i.last=A,i.lastNormal=Zr(r),i.lastPortal=tn(r);for(var w=n.child;w&&w!==l;){if(w.sibling===s){E=w;break}w=w.sibling}var S=document.createDocumentFragment(),k=document.createDocumentFragment(),I={tag:Or.ROOT,container:S,createPortal:k,child:r};for(w=r;w;)w.return=I,w=w.sibling;var P,x,C=nn(s,l);for(_r(Kr,this,Gr).call(this,C),Rr(I),E?E.sibling=r:n.child=r,A&&(A.sibling=null==l?void 0:l.sibling),w=r;w;)w.return=n,w=w.sibling;if(n.tag===Or.ROOT?null===(P=n.container)||void 0===P||P.insertBefore(S,a):null===(x=n.element)||void 0===x||x.insertBefore(S,a),k.childNodes.length>0){for(var O,T=r;T&&T.return;)T=T.return;if((null===(O=T)||void 0===O?void 0:O.tag)!==Or.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");var R="function"==typeof T.createPortal?T.createPortal():T.createPortal,B=null;for(var L of d)if(R.contains(L)){B=L;break}R.insertBefore(k,B)}var _=nn(r,A);_r(Kr,this,Jr).call(this,_)}dispose(){for(var e of Object.values(Br(Nr,this)))e.length=0;for(var t of Br(jr,this).values()){for(var r of t)r.disconnect();t.length=0}Br(jr,this).clear(),Br(Vr,this)&&(Ae.removeEventListener("change",Br(Vr,this)),Lr(Vr,this,void 0)),Lr($r,this,void 0),Lr(Hr,this,void 0),Lr(qr,this,void 0),Br(Dr,this).clear(),Br(Wr,this).length=0}dispatchBeforePageLoad(){_r(Kr,this,Yr).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");_r(Kr,this,Yr).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){_r(Kr,this,Yr).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){_r(Kr,this,Yr).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=P().location;e&&"#"!==e?_r(Kr,this,Yr).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):_r(Kr,this,Yr).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of Br(Nr,this).onScrollIntoView)_r(Kr,this,Qr).call(this,e,t)}initializeMediaChange(){Lr(Vr,this,(e=>{_r(Kr,this,Yr).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),Ae.addEventListener("change",Br(Vr,this))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==Ka||null===(r=Ka.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{sr(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 Br(Nr,this).onMessage)t(r);null==Ka||null===(e=Ka.messageDispatcher)||void 0===e||e.onClose((()=>{_r(Kr,this,Yr).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){_r(Kr,this,Yr).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){_r(Kr,this,Yr).call(this,"onUnmount",new CustomEvent("unmount"))}}function Gr(e){var t=[...Mr,..."page"===this.scope?Fr:[]],r=[];for(var n of t){var a=(0,m.remove)(Br(Nr,this)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var i,s,l=Br(jr,this).get(o);if(null!=l&&l.length){for(var c of l)c.disconnect();l.length=0,Br(jr,this).delete(o)}Cr(o),null===(i=o.element)||void 0===i||delete i.$$tplStateStore,null===(s=o.element)||void 0===s||s.remove()}var u=new CustomEvent("unmount");for(var{brick:d,handlers:p}of r)sr(p,d.runtimeContext,d)(u)}function Jr(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of Br(Nr,this).onMount)e.has(r)&&sr(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of Br(Nr,this).onScrollIntoView)e.has(a)&&_r(Kr,this,Qr).call(this,a,o)}function Yr(e,t){for(var{brick:r,handlers:n}of Br(Nr,this)[e])sr(n,r.runtimeContext,r)(t);var a=Br(Dr,this).get(e);if(a)for(var o of a)o()}function Qr(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,a=new IntersectionObserver(((r,a)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(sr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=Br(jr,this).get(e);o||(o=[],Br(jr,this).set(e,o)),o.push(a)}function Xr(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function Zr(e){return en(e,!1)}function en(e,t){for(var r,n=e;n;){if(n.tag===Or.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function tn(e){return rn(e,!1)}function rn(e,t){for(var r,n=e;n;){if(n.tag===Or.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 a,o=n.return;o&&!o.sibling;)o=o.return;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function nn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Or.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&o!==t&&!o.sibling;)o=o.return;if(o===t)break;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}var an=Symbol.for("root.runtimeContext");function on(e,t){return sn.apply(this,arguments)}function sn(){return(sn=(0,o.A)((function*(e,t){var r,n,o,i,s,[l,c,u]=ua((0,a.A)((0,a.A)({},null!==(r=e[an])&&void 0!==r?r:lo()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(n=l.tplStateStoreMap)&&void 0!==n||(l.tplStateStoreMap=new Map),null!==(o=l.formStateStoreMap)&&void 0!==o||(l.formStateStoreMap=new Map);var d=new zr("fragment"),p={tag:Or.ROOT,createPortal:null},f=e.transform,v=xe();f&&Ce(v,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var h=yield oa(p,v?e:(0,a.A)((0,a.A)({},e),{},{properties:(0,a.A)((0,a.A)({},e.properties),f)}),l,d,[]),m=[...c,...u];if(yield ca(h,l,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Or.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 ln(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:o}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},Rr(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),o))i.mountAsyncData();return{portal:r}}function cn(e,t){var{rendererContext:r}=e;t.portal&&(Tr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function un(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return pt(t,(0,a.A)((0,a.A)({},lo()),{},{data:e}),{noInject:!0})}function dn(e,t){var r=co(e);Object.assign(r,(0,a.A)((0,a.A)({},t),{},{meta:(0,a.A)((0,a.A)({},r.meta),t.meta),$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),M(r)}function pn(e,t){var r=co(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),o=(e,r)=>e.map((e=>{var i=a(e);return"routes"===e.type?(e.routes=o(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=o(r.routes,a(t)),n||r.routes.unshift(t)}function fn(e,t,r){var n="".concat(e,".").concat(t.name);Be.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),vn(e,t.name,r)}function vn(e,t,r){bn(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.A)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context","slots","children"))])}function hn(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function mn(e,t){var r;bn(e,hn(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var gn,yn=mn;function bn(e,t,r,n){var{routes:a}=co(e),o=a.findIndex((e=>e.path===t)),i={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===o?a.unshift(i):a.splice(o,1,i)}function En(e,t){var{tplStateStoreId:r}=t,n=lo();return r?Le((0,a.A)((0,a.A)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function An(e){var{tplStateStoreId:t}=e,r=lo();return t?Le((0,a.A)((0,a.A)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function wn(e){return io().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Sn(){return so()}function kn(e,t){return In.apply(this,arguments)}function In(){return(In=(0,o.A)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:o}=t,i=co(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,l=hn(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&&o&&(yield o(r)).forEach((e=>{var t,[r,n,a]=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===a))||c.push(e)})),c}))).apply(this,arguments)}var Pn=[];function xn(e){gn=e;var t=An({tplStateStoreId:e.tplStateStoreId});On({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Cn(e){Pn.push(e)}function On(e){setTimeout((()=>{for(var t of Pn)try{t(e)}catch(t){console.error("RealTimeDataInspectHook failed (".concat(e.changeType,"):"),t)}}))}var Tn=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Rn{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(gn){var{tplStateStoreId:r}=gn;(r?"STATE"===this.type&&this.stateStoreId===r:"CTX"===this.type)&&On({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={},a={},o=[];e.forEach((e=>{var{name:a,value:i}=r([e]),s=this.data.get(a);o.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,i,t)})),o.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[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(a),this.batchUpdate=!1}updateValue(e,t,r,n,o){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!==so()};if(s||(s=i.loading=i.load((0,a.A)({cache:"load"===r?"default":"reload"},t))).then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||l(e)||null!=n&&n.error||er(e)})),n){var c=Ir(n,o);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 a=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 a of e){var o=[a.if,a.value,a.resolve],i=(0,O.collectMemberUsage)(o,t);if(!r&&"STATE"===t){var s=(0,O.collectMemberUsage)(o,"TPL");for(var l of s.usedProperties)i.usedProperties.add(l);s.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}n.set(a,i)}return n}(e,r,arguments.length>3?arguments[3]:void 0),a=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;a.set(i,(null!==(s=a.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,o.A)((function*(e){var r;c.add(e);var o=yield t(e);n.delete(e);var i=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(o){if(u.get(e.name).resolve(),a.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),a.delete(e.name)):a.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,o.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)))}(a,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,o.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))),a=()=>{var e=!1;for(var[t,o]of r.entries())[...o.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),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,xe(t));this.pendingStack.push(a)}}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,o.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,o.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,o.A)((function*(){if(!(yield ht(e,t)))return!1;var s,l,c,u,p,f;if(r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield wt(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,a.A)({transform:"value"},e.resolve);if(((u=yield ht(e.resolve,t))||p)&&(l=function(){var e=(0,o.A)((function*(e){var r;return(yield Ge(h,t,(0,a.A)((0,a.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 ut(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 ye.A,useResolve:u,load:l,loaded:"eager"===f,loading:c,async:"async"===f,deps:[]};if("lazy"===f){var g,{trigger:y}=e.resolve;y&&Tn.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,sr(e.onChange,t)),e.track){var b=(0,O.strictCollectMemberUsage)(p?[e.resolve,e.value]:l?e.resolve:e.value,i.type);for(var E of(!l&&(m.deps=[...b]),b))i.onChange(E,i.batchAddListener((()=>{m.useResolve=p?gt(e.resolve,t):!!l,m.useResolve?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,pt(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 A of n){var w=i.routeMap.get(A);w?w.add(e.name):i.routeMap.set(A,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 Bn=r(1369);function Ln(e,t,r){var n,a,{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&o){var u=o.properties.get(t);u&&(a=i,n=u.map((e=>{var{from:t,to:r}=e,n=a.filter((e=>e[0]===t));if(n.length>0&&r.refProperty)return[r.refProperty,wt(n,t),!0]})).filter(Boolean));var p=o.slots.get(t);if(p&&s){var f=new Map;for(var{from:v,to:h}of p){var g,y,b,E,A=null!==(g=null===(y=s[v])||void 0===y?void 0:y.bricks)&&void 0!==g?g:[];if(A.length){var w=null!==(b=h.refSlot)&&void 0!==b?b:v,S=f.get(w);if(!S){S=[];for(var k=(0,d.hasOwnProperty)(r,w)?r[w].bricks.length+1:1,I=0;I<k;I+=1)S.push([]);f.set(w,S)}var P=null!==(E=h.refPosition)&&void 0!==E?E:-1,x=(0,d.hasOwnProperty)(c.runtimeContext,"forEachItem");S[(0,m.clamp)(P<0?S.length+P:P,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||x?_n(A,x,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex):A)}}var C=function(){(0,d.hasOwnProperty)(r,O)||(r[O]={type:"bricks",bricks:[]});var e=r[O];e.bricks=T.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[O]};for(var[O,T]of f.entries())C()}}return{[Ft]:n,[Ut]:l}}function _n(e,t,r,n){return e.map((e=>{var o,{children:i,slots:s,[Nt]:l,[jt]:c,[Vt]:u}=e,d=(0,h.A)(e,["children","slots",Nt,jt,Vt].map(Bn.A));return(0,a.A)((0,a.A)((0,a.A)({},d),t?{[Nt]:r,[jt]:n}:{[Vt]:!0}),{},{slots:":forEach"===d.brick?pa(i,s):Object.fromEntries(Object.entries(null!==(o=pa(i,s))&&void 0!==o?o:{}).map((e=>{var[a,o]=e;return[a,"routes"===o.type?{type:"routes",routes:Mn(o.routes,t,r,n)}:{type:"bricks",bricks:_n(o.bricks,t,r,n)}]})))})}))}function Mn(e,t,r,n){return e.map((e=>"routes"===e.type?(0,a.A)((0,a.A)({},e),{},{routes:Mn(e.routes,t,r,n)}):"redirect"===e.type?e:(0,a.A)((0,a.A)({},e),{},{bricks:_n(e.bricks,t,r,n)})))}var Fn=["properties","slots","children"];function Un(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,a]=e;return(0,d.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:o,slots:i,children:s}=e,l=(0,h.A)(e,Fn),c=pa(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t,[r,a]=e;return[r,{type:"bricks",bricks:(null!==(t=a.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,a.A)((0,a.A)({},l),{},{properties:r(o),slots:u},Ln(t,l.ref,u))}return r(e)}var Nn=["slots","children"],jn=["properties","slots","children"];function Vn(e,t,r,n,o){var i,s=(0,m.uniqueId)("tpl-state-"),l=(0,a.A)((0,a.A)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.forEachIndex,delete l.formStateStoreId;var c=new Rn("STATE",r,o,s);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:p,contracts:f}=Be.get(e);null==Ka||null===(i=Ka.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(p,l,n);var{slots:v,children:g}=t,y=(0,h.A)(t,Nn),b=(0,a.A)((0,a.A)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var E={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[A,w]of Object.entries(d.properties)){var S=E.properties.get(w.ref);S||(S=[],E.properties.set(w.ref,S)),S.push({from:A,to:w})}if(null!=d&&d.slots)for(var[k,I]of Object.entries(d.slots)){var P=E.slots.get(I.ref);P||(P=[],E.slots.set(I.ref,P)),P.push({from:k,to:I})}var x={reversedProxies:E,asyncHostPropertyEntries:n,externalSlots:pa(g,v),tplStateStoreId:s,hostBrick:r,__temporary_tpl_tag_name:e};return b.slots={"":{type:"bricks",bricks:u.map((e=>Dn(e,x)))}},b}function Dn(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,h.A)(e,jn),s=pa(o,n),l=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,a]=e;return[n,{type:"bricks",bricks:(null!==(r=a.bricks)&&void 0!==r?r:[]).map((e=>Dn(e,t)))}]})));return(0,a.A)((0,a.A)({},i),{},{properties:Un(r,t),slots:l},Ln(t,i.ref,l))}var $n="form-renderer.form-renderer",Hn=Symbol.for("form.stateStoreId"),qn=["forms.general-form","form.general-form","eo-form"];function Wn(e,t,r){var{id:n,bricks:o,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,a.A)((0,a.A)((0,a.A)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,a.A)((0,a.A)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,a.A)((0,a.A)((0,a.A)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,a.A)((0,a.A)((0,a.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,a.A)((0,a.A)((0,a.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,a.A)((0,a.A)((0,a.A)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,a.A)((0,a.A)((0,a.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,a.A)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,a.A)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,a.A)((0,a.A)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,a.A)((0,a.A)((0,a.A)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),p=(0,a.A)((0,a.A)({},v.properties),p)}var h={brick:u,properties:p,iid:c,slot:l,events:i,context:s,children:Kn(o,t,r),[Hn]:r};return(0,d.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function Kn(e,t,r){if(Array.isArray(e))return e.map((e=>Wn(e,t,r)))}var zn,Gn,Jn,Yn=["blockingList","node","menuRequests","hasTrackingControls"],Qn=["if","permissionsPreCheck"],Xn=["formData"],Zn=["src"],ea=["href"];function ta(e,t,r,n,a,o,i){return ra.apply(this,arguments)}function ra(){return ra=(0,o.A)((function*(e,t,r,n,o,i,s){var l=yield function(e,t){return Lt.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,a.A)((0,a.A)({},r),{},{match:l.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=o.concat(p);f.ctxStore.define(p.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==Ka||null===(d=Ka.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(p,(e=>ut(e,f))));var{preLoadBricks:h}=p;if(Array.isArray(h)&&c.blockingList.push((0,u.loadBricksImperatively)(h,io())),"redirect"===p.type){var m;if("string"!=typeof(m="string"==typeof p.redirect?yield ut(p.redirect,f):(yield Ge((0,a.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 ut(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?da(c,yield ta(e,p.routes,f,n,v,i)):da(c,yield na(e,p.bricks,f,n,v,i)),e.tag===Or.BRICK&&n.memoizeMenuRequests(p,c.menuRequests)}}return c})),ra.apply(this,arguments)}function na(e,t,r,n,a,o,i,s){return aa.apply(this,arguments)}function aa(){return(aa=(0,o.A)((function*(e,t,r,n,a,o,i,s){var l={blockingList:[],menuRequests:[]},c=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>oa(e,t,r,n,a,o,c.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(o,c.concat(r),t.node,e),da(l,t)})),l}))).apply(this,arguments)}function oa(e,t,r,n,a,o){return ia.apply(this,arguments)}function ia(){return ia=(0,o.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:b}=t,E=(0,h.A)(t,Qn);if(function(e){return"string"==typeof e?(0,C.isTrackAll)(e):et(e)&&(0,C.isTrackAll)(tt(e))}(g))return oa(e,(0,a.A)({brick:":if",dataSource:g,permissionsPreCheck:b,slots:{"":{type:"bricks",bricks:[E]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.A)((0,a.A)({},e),{},{[r]:t[r]})),{})),r,n,i,s,p,f);var A=t[Ut],w=t[Hn],S=(0,a.A)((0,a.A)({},r),{},{tplStateStoreId:A,formStateStoreId:w});(0,d.hasOwnProperty)(t,Nt)?(S.forEachItem=t[Nt],S.forEachIndex=t[jt]):t[Vt]&&(delete S.forEachItem,delete S.forEachIndex);var{context:k}=t;if(Array.isArray(k)&&k.length>0){var I=xe(S);Ce(I,"Defining context on bricks","check your brick:",t),I||S.ctxStore.define(k,S)}if(S.pendingPermissionsPreCheck.push(null==Ka||null===(l=Ka.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>ut(e,S)))),!(yield function(e,t){return bt.apply(this,arguments)}(t,S)))return v;var P=t.brick;if(P.startsWith(":")){var x;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(P);var{dataSource:T}=t,R=function(){var r=(0,o.A)((function*(r){var a,o=yield ut(T,r),l=":forEach"===P?"":":switch"===P?String(o):o?"":"else",c=pa(t.children,t.slots),u=c&&(0,d.hasOwnProperty)(c,l)&&(null===(a=c[l])||void 0===a?void 0:a.bricks);if(!Array.isArray(u))return{blockingList:[],menuRequests:[]};switch(P){case":forEach":return Array.isArray(o)?function(e,t,r,n,a,o,i,s,l){return sa.apply(this,arguments)}(e,o,u,r,n,i,s,f,p):{blockingList:[],menuRequests:[]};case":if":case":switch":return na(e,u,r,n,i,s,f,p)}}));return function(e){return r.apply(this,arguments)}}(),B=function(){var t=(0,o.A)((function*(t){var r,n=yield R(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Or.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),L=yield B(S),{onMount:_,onUnmount:M}=null!==(x=t.lifeCycle)&&void 0!==x?x:{},{contextNames:F,stateNames:U}=At(T);if(F||U){L.hasTrackingControls=!0;var N=0,j=function(){var t=(0,o.A)((function*(){var t=++N,[r,a,o]=ua(S),i=yield B(r),l=[...a,...o];if(yield ca(i,r,l),N===t)for(var c of(M&&sr(M,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,p,i.node,e),_&&sr(_,r)(new CustomEvent("mount",{detail:{rerender:!0}})),l))c.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),V=(0,m.debounce)(j);if(F)for(var D of F)S.ctxStore.onChange(D,V);if(U)for(var $ of U)Le(S,"STATE",': "'.concat(T,'"')).onChange($,V)}return _&&n.registerArbitraryLifeCycle("onMount",(()=>{sr(_,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),M&&n.registerArbitraryLifeCycle("onUnmount",(()=>{sr(M,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),L}/\.tpl-/.test(P)&&!Be.get(P)&&(yield fa((0,u.loadBricksImperatively)([P],io()),"brick",P,n.unknownBricks));var H,q,W=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(Be.get(r))return r}return!!Be.get(e)&&e}(P,null===(c=S.app)||void 0===c?void 0:c.id);if(W){var K,z=null!==(K=f.get(W))&&void 0!==K?K:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(W,'"'));f.set(W,z+1)}else P.includes("-")&&!customElements.get(P)&&(P===$n?customElements.define($n,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):v.blockingList.push(fa((0,u.enqueueStableLoadBricks)([P],io()),"brick",P,n.unknownBricks)));if(P===$n){var G,J=null!==(G=t.properties)&&void 0!==G?G:{};({formData:H}=J),q=(0,h.A)(J,Xn)}else q=t.properties;var Y=[],Q=function(e,t,r){return(0,d.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:o,stateNames:i,formStateNames:s}=At(a);return(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a}),[n,ut(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?st.USE_BRICK:st.INITIAL})]})):[]}(q,S,Y),X=t[Ft];X&&Q.push(...X);var Z="script"===P;if(Z||"link"===P){var ee=yield kt(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,ae=(0,h.A)(ee,Zn);yield fa((0,u.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:oe}=ee;ae=(0,h.A)(ee,ea),yield fa((0,u.loadStyle)(oe,re,ae),"stylesheet",oe,"silent")}return v}}var ie={tag:Or.BRICK,type:W||P,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(fa((0,u.loadProcessorsImperatively)(se,io()),"processors",[...se].join(", "),n.unknownBricks));var le=[],ce=function(){var e=(0,o.A)((function*(){ie.properties=yield kt(Q),function(e,t){var r=function(t){var r=()=>{e.element&&xt(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 a=Le(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}if(t.formStateNames){var i=Ve(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;W?de=Vn(W,t,ie,Q,n):P===$n&&(de=function(e,t,r,n,o){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,m.uniqueId)("form-state-"),u=(0,a.A)((0,a.A)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var p=new Rn("FORM_STATE",void 0,o,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=Wn(l.formSchema,l.fields,c);return qn.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,d.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,a.A)((0,a.A)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,a.A)((0,a.A)({},t),{},{slots:void 0,children:[v]})}(H,t,ie,Q,n)),de.portal&&(ie.slotId=void 0),W?(delete(ue=(0,a.A)({},S)).forEachItem,delete ue.forEachIndex):ue=S;var pe=function(){var e=(0,o.A)((function*(){var e=pa(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 na(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,o.A)((function*(e,t){var{homepage:r}=ue.app,{pathname:o}=e;if(!y(r,o)||!i.every((e=>{var n,a;return(n=_t(e,r,t.pathname))&&(a=_t(e,r,o))&&(e!==c||(0,m.isEqual)(n.params,a.params))})))return!1;var u,[d,p,f]=ua((0,a.A)((0,a.A)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),v=!1,h=[];try{if(u=yield ta(ie,l.routes,d,n,i,s,!0),n.reBailout(u))return!0;h=[...p,...f],yield ca(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 b of(d.ctxStore.mountAsyncData(u.route),h))b.mountAsyncData();return!0}));return function(t,r){return e.apply(this,arguments)}}())),ta(ie,l.routes,ue,n,i,s)}))),s=(0,a.A)((0,a.A)({},v),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(t.get(r),[],e.node,ie),da(s,e)})),s.node&&(ie.child=s.node),da(v,(0,a.A)((0,a.A)({},s),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return le.push(pe()),yield Promise.all(le),v})),ia.apply(this,arguments)}function sa(){return(sa=(0,o.A)((function*(e,t,r,n,o,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)=>oa(e,r,(0,a.A)((0,a.A)({},n),{},{forEachItem:t,forEachIndex:u}),o,i,s,c.concat(u*d+p),l&&new Map(l))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&o.memoize(s,c.concat(r),t.node,e),da(u,t)})),u}))).apply(this,arguments)}function la(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function ca(e,t,r){return(0,u.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function ua(e){var t=[],r=[];return[(0,a.A)((0,a.A)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function da(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,h.A)(t,Yn);if(e.blockingList.push(...r),e.menuRequests.push(...a),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 pa(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,o=null!==(a=n.slot)&&void 0!==a?a:"";(0,d.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function fa(e,t,r,n){return"silent"===n?e.catch((e=>{console.error('Load %s "%s" failed:',t,r,e)})):e}function va(){if(!zn){if(zn={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){zn.isInIframe=!0;try{if(window.origin===window.parent.origin){zn.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");zn.isInIframeOfNext=0==(Number(e)^Number(r)),zn.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),zn.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(zn)}return zn}function ha(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 a=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);Be.define(a,n)}}}function ma(){return ma=(0,o.A)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return ga.apply(this,arguments)}(e)),e.$$fulfilling})),ma.apply(this,arguments)}function ga(){return(ga=(0,o.A)((function*(e){var t;yield null==Ka||null===(t=Ka.fulfilStoryboard)||void 0===t?void 0:t.call(Ka,e),M(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}function ya(e){var t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}var ba="basic.show-watermark";function Ea(e,t){return e.get(wa(e,t))}function Aa(e,t,r){return e.set(wa(e,t),r),r}function wa(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 Sa=new WeakMap,ka=new WeakMap,Ia=new WeakMap,Pa=new WeakMap,xa=new WeakMap,Ca=new WeakMap,Oa=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Ba=new WeakMap,La=new WeakMap,_a=new WeakMap,Ma=new WeakSet;class Fa{constructor(e){(0,i.A)(this,Ma),(0,l.A)(this,Sa,void 0),(0,l.A)(this,ka,!1),(0,l.A)(this,Ia,void 0),(0,l.A)(this,Pa,void 0),(0,l.A)(this,xa,void 0),(0,l.A)(this,Ca,void 0),(0,l.A)(this,Oa,new Set),(0,l.A)(this,Ta,0),(0,l.A)(this,Ra,void 0),(0,l.A)(this,Ba,void 0),(0,l.A)(this,La,void 0),(0,l.A)(this,_a,void 0),Aa(Sa,this,e);var t=P();window.addEventListener("beforeunload",(e=>{wa(Ma,this,Ua).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>wa(Ma,this,Ua).call(this,{location:e,action:t})))}getRenderId(){return Ea(Ra,this)}getRuntimeContext(){return Ea(xa,this)}getRecentApps(){return{currentApp:Ea(Ba,this),previousApp:Ea(La,this)}}getNavConfig(){return Ea(_a,this)}bootstrap(){var e=this;window.AbortController&&(Gn=new AbortController,x.http.interceptors.request.use((e=>{var t;return(0,a.A)((0,a.A)({},e),{},{options:(0,a.A)((0,a.A)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:Gn.signal})})})));var t=P();Aa(Ia,this,t.location);var r=0;return t.listen(function(){var t=(0,o.A)((function*(t,n){var o,i,s,l,c,u,d=++r,p={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==Ea(Ia,e).key&&!1!==(null===(o=Ea(Ia,e).state)||void 0===o?void 0:o.notify))||(p.key=void 0),((0,f.locationsAreEqual)((0,a.A)((0,a.A)({},Ea(Ia,e)),p),(0,a.A)((0,a.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=Ea(Ca,e))||void 0===u?void 0:u.didPerformIncrementalRender(t,Ea(Ia,e))),r===d)if(c)Aa(Ia,e,t);else{if(Gn&&(Gn.abort(),Gn=new AbortController),Aa(Ia,e,t),null===(l=Ea(Ca,e))||void 0===l||l.dispatchPageLeave(),"POP"===n&&b(g(Ea(Sa,e),t.pathname)))return void window.location.reload();Ea(ka,e)?Aa(Pa,e,t):(q("locationChange"),wa(Ma,e,ja).call(e,t).catch(er))}}));return function(e,r){return t.apply(this,arguments)}}()),wa(Ma,this,ja).call(this,t.location)}}function Ua(e){var t,r=P(),n=r.getBlockMessage();null===(t=Ea(Ca,this))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function Na(e,t,r){var n,a;if(Aa(Ta,this,(n=Ea(Ta,this),a=n++,n)),a>10){var o='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(o)}P().replace(e,t)}function ja(e){return Va.apply(this,arguments)}function Va(){return(Va=(0,o.A)((function*(e){Aa(ka,this,!0);try{yield wa(Ma,this,Da).call(this,e)}finally{if(Aa(ka,this,!1),Ea(Pa,this)){var t=Ea(Pa,this);Aa(Pa,this,void 0),yield wa(Ma,this,ja).call(this,t)}}}))).apply(this,arguments)}function Da(e){return $a.apply(this,arguments)}function $a(){return $a=(0,o.A)((function*(e){var t,r,n,i,s=this,l=Aa(Ra,this,(0,m.uniqueId)("render-id-"));qe=new WeakSet,ze.clear(),null==Ka||null===(t=Ka.flowApi)||void 0===t||t.clearCollectWidgetContract(),P().unblock();var c=null==Ka||null===(r=Ka.pageView)||void 0===r?void 0:r.create(),d=g(Ea(Sa,this),e.pathname),p=null===(n=Ea(xa,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 ma.apply(this,arguments)}(d));var v=Aa(Ba,this,null==d?void 0:d.app);!function(){var e,t,r,n,o,i,s,l,c=eo().getFeatureFlags(),d=eo().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==Ka||null===(n=Ka.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)&&void 0!==r?r:"",v=null!==(o=d.watermarkConfig)&&void 0!==o?o:{flags:{}},h=(0,a.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"]));Jn?Jn.resolve(h):(0,u.loadBricksImperatively)([ba],io()).then((()=>{(Jn=document.createElement(ba)).resolve(h)}),(e=>{console.error("Load watermark service failed:",e)}))}}();var h,y=p&&v?p.id!==v.id:p!==v,b=eo().getFeatureFlags(),E=Ea(Ca,this),A=(t,r)=>{null==c||c({status:"redirected"}),Ea(Oa,this).add(E),wa(Ma,this,Na).call(this,t,r,e)},w=()=>{var t=b["sso-enabled"]?"/sso-auth/login":"/auth/login";Gt(e),A(t,{from:e})},S=document.querySelector("#main-mount-point"),k=document.querySelector("#portal-mount-point"),I={tag:Or.ROOT,container:S,createPortal:k},C=()=>{var e;for(var t of(Tr(S),Tr(k),Ea(Oa,this).add(E),Ea(Oa,this)))t&&(t.dispatchOnUnmount(),t.dispose());Ea(Oa,this).clear(),null==Ka||null===(e=Ka.messageDispatcher)||void 0===e||e.reset(),y&&(Aa(La,this,p),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:p,currentApp:v}})))};if(Z(v&&(ae()[v.id]||v.theme)||"light"),ie("default"),v){var O,T,R,B,L,_;null==Ka||null===(O=Ka.checkInstalledApps)||void 0===O||O.preCheckInstalledApps(d,(e=>!!uo(e)));var M={bailout:e=>e.unauthenticated?(w(),!0):e.redirect?(A(e.redirect.path,e.redirect.state),!0):void Aa(Ta,this,0),mergeMenus:(h=(0,o.A)((function*(e){var t=yield Promise.all(e);Aa(_a,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(!Yt(t)||window.NO_AUTH_GUARD){if(!(t instanceof x.HttpAbortError)){var n=eo().getMiscSettings().noAuthGuardLoginPath;return Yt(t)&&n?void A(n,{from:e}):{failed:!0,output:{node:{tag:Or.BRICK,type:"div",properties:{textContent:Jt(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}Ea(Oa,this).add(E)}else w()}},F=Aa(Ca,this,new zr("page",{routeHelper:M,renderId:l})),U=Aa(xa,this,{app:v,location:e,query:new URLSearchParams(e.search),flags:b,sys:(0,a.A)((0,a.A)((0,a.A)({},null==Ka||null===(T=Ka.auth)||void 0===T?void 0:T.getAuth()),va()),{},{settings:{brand:eo().getBrandSettings()}}),ctxStore:new Rn("CTX",void 0,F),pendingPermissionsPreCheck:[null==Ka||null===(R=Ka.checkPermissions)||void 0===R?void 0:R.preCheckPermissions(d)],tplStateStoreMap:new Map,formStateStoreMap:new Map});Aa(_a,this,void 0),ha(d),me(null===(B=d.meta)||void 0===B?void 0:B.functions,v),null==Ka||null===(L=Ka.flowApi)||void 0===L||L.collectContract(null===(_=d.meta)||void 0===_?void 0:_.contracts);var N,j=!1,V=[];try{if(N=yield ta(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),U,F,[]),M.bailout(N))return;V=la(U),yield ca(N,U,V),yield M.mergeMenus(N.menuRequests),F.setInitialMenuRequests(N.menuRequests)}catch(e){console.error("Router failed:",e);var D=M.catch(e,I);if(!D)return;({failed:j,output:N}=D)}if(I.child=N.node,C(),N.route&&"routes"!==N.route.type||j){if(j||F.dispatchBeforePageLoad(),re(),le(),ya(null==v?void 0:v.uiVersion),Rr(I),window.scrollTo(0,0),j)null==c||c({status:"failed"});else{for(var $ of(F.dispatchPageLoad(),F.dispatchAnchorLoad(),F.dispatchOnMount(),F.initializeScrollIntoView(),F.initializeMediaChange(),F.initializeMessageDispatcher(),V))$.mountAsyncData();null==c||c({status:"ok",path:N.path,pageTitle:document.title})}return void q("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Ka&&Ka.auth&&!Ka.auth.isLoggedIn())return void w();C()}re(),le();var H={tag:Or.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:I};I.child=H,Rr(I),window.scrollTo(0,0),null==c||c({status:"not-found"}),q("rendered")})),$a.apply(this,arguments)}var Ha,qa,Wa,Ka,za="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null,Ga=r(3999);function Ja(e){var t=[];if(["light","dark"].forEach((r=>{if(e[r])switch(e.type){case"brandColor":t.push((0,Ga.LP)(r,e[r]));break;case"baseColors":t.push((0,Ga.eC)(r,e[r],e.backgroundColor));break;case"variables":t.push((0,Ga.Gb)(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 Ya(e,t,r){return e.set(Xa(e,t),r),r}function Qa(e,t){return e.get(Xa(e,t))}function Xa(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 Za(e){if(Ha)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===V){var r=t.payload;switch(null==r?void 0:r.type){case D:H=r.active;break;case $:N=r.panel}}})),Ka=null==e?void 0:e.hooks,(0,c.initializeI18n)(Wt,Kt),p.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{p.locale(c.i18n.language)})),I(),Ha=new ao}var eo=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 Ha},to=new WeakMap,ro=new WeakMap,no=new WeakSet;class ao{constructor(){(0,i.A)(this,no),(0,l.A)(this,to,!1),(0,l.A)(this,ro,!1),(0,s.A)(this,"version",3)}initialize(e){var t;if(Qa(to,this))throw new Error("The runtime cannot be initialized more than once");Ya(to,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),qa=e;var r,{notification:n,dialog:o}=Xa(no,this,oo).call(this);!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{Xt=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{Mt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?Ja((0,a.A)({type:"brandColor"},e.brandColor)):e.baseColors?Ja((0,a.A)({type:"baseColors"},e.baseColors)):e.variables&&Ja((0,a.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,o.A)((function*(){if(e&&t.initialize(e),Qa(ro,t))throw new Error("The runtime cannot be bootstrapped more than once");Ya(ro,t,!0),Wa=new Fa(qa.storyboards),yield Wa.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=Wa)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Wa)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return je(e,t)}getFeatureFlags(){var e,t;return(0,a.A)((0,a.A)((0,a.A)({},null===(e=qa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=Wa)||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,a.A)((0,a.A)({},null===(e=qa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=Wa)||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,a.A)({base_title:"DevOps 管理专家"},null===(e=qa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,a.A)({columns:7,rows:4},null===(e=qa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=qa)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=qa)||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=Wa)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,io())}}function oo(){var e,t;return null!==(e=null===(t=qa)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function io(){var e,t,r,n,a;return(null!==(e=null!==(t=null!==(r=null===(n=qa)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:za)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]).concat(null!==(a=window.PUBLIC_DEPS)&&void 0!==a?a:[])}function so(){var e;return null===(e=Wa)||void 0===e?void 0:e.getRenderId()}function lo(){var e;return null===(e=Wa)||void 0===e?void 0:e.getRuntimeContext()}function co(e){var t;return null===(t=qa)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function uo(e){var t;return null===(t=co(e))||void 0===t?void 0:t.app}function po(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==Ka||null===(e=Ka.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function fo(){var e;return null==Ka||null===(e=Ka.auth)||void 0===e?void 0:e.getAuth()}function vo(){var e,t;return null==Ka||null===(e=Ka.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function ho(){var e;return null==Ka||null===(e=Ka.auth)||void 0===e?void 0:e.isLoggedIn()}function mo(e,t,r){return go.apply(this,arguments)}function go(){return(go=(0,o.A)((function*(e,t,r){return Ye(yield $e(e),e,"resolve",t,r)}))).apply(this,arguments)}function yo(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=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,o.A)((function*(){var{theme:o,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),b=s,E=(0,m.uniqueId)("render-id-");s=new zr(n,{unknownBricks:a,renderId:E});var A={ctxStore:new Rn("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},w={tag:Or.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,a]of Object.entries(e))(0,d.isObject)(a)&&"useBrick"===t?Array.isArray(a)?a.forEach((e=>n(e,!0))):n(a,!0):r(a)}function n(e,a){a&&(e[an]=t);var{properties:o,slots:i,children:s}=e,l=pa(s,i);for(var c of(r(o),Object.values(null!=l?l:{})))for(var u of null!==(d=c.bricks)&&void 0!==d?d:[]){var d;n(u,a)}}for(var a of e)n(a)}(y,A),Z(null!=o?o:"light"),ie("default"),ya(p);var k={id:"demo",homepage:"/demo"};A.app=k;var I={app:k,meta:{i18n:g,customTemplates:h}};null===(S=l)||void 0===S||S(),l=M(I),ha(I),me(v,k)}A.ctxStore.define(f,A);var P,x=!1,C=[];try{P=yield na(w,y,A,s,[]),C=la(A),yield ca(P,A,C)}catch(e){x=!0,P={node:{tag:Or.BRICK,type:"div",properties:{textContent:Jt(e)},return:w,runtimeContext:null},blockingList:[],menuRequests:[]}}if(w.child=P.node,null==b||b.dispatchOnUnmount(),null==b||b.dispose(),Tr(e),i&&Tr(i),"page"===n&&(x||s.dispatchBeforePageLoad(),re(),le()),Rr(w),"page"===n&&window.scrollTo(0,0),!x){for(var O of C)O.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,Tr(e),i&&(Tr(i),r||i.remove()))}}}},2561:(e,t,r)=>{r.r(t),r.d(t,{supply:()=>s});var n=r(9740),a=r(1030),o=r(1302),i=r(8815);function s(e,t,r){var a=(0,n.A)({},t);for(var o of(a[void 0]=void 0,e))if(!Object.prototype.hasOwnProperty.call(a,o)){var i=d(o,r);void 0!==i&&(a[o]=i)}return a}var l=new Set(["fill","pull","pullAll","pullAllBy","pullAllWith","pullAt","remove","reverse","assign","assignIn","assignInWith","assignWith","defaults","defaultsDeep","merge","mergeWith","set","setWith","unset","update","updateWith","after","ary","before","bind","bindKey","curry","curryRight","debounce","defer","delay","flip","memoize","negate","once","overArgs","partial","partialRight","rearg","rest","spread","throttle","unary","wrap"]),c=new Set(["lang","langData","locale","localeData","defineLocale","updateLocale","updateOffset"]),u=new Set(["Array","Boolean","Date","Infinity","JSON","Math","NaN","Number","String","RegExp","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","isFinite","isNaN","parseFloat","parseInt","Map","Set","URLSearchParams","WeakMap","WeakSet","atob","btoa"]);function d(e,t){switch(e){case"Object":return r=Object,n=["entries","fromEntries","keys","values"],Object.fromEntries(n.map((e=>[e,function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r[e].apply(r,n)}])));case"_":return Object.fromEntries(Object.entries(a).filter((e=>!l.has(e[0]))).concat(t?[["uniqueId",e=>"".concat(null!=e?e:"","42")]]:[]));case"moment":return Object.assign((function(){return o(...arguments)}),Object.fromEntries(Object.entries(o).filter((e=>!c.has(e[0])))));case"PIPES":return i.pipes;case"TAG_URL":return p(!0);case"SAFE_TAG_URL":return p();default:if(u.has(e))return window[e]}var r,n}function p(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var o=[];return t.forEach(((t,r)=>{o.push(t),r<n.length&&o.push(e?String(n[r]).replace(/[^/]+/g,(e=>encodeURIComponent(e))):encodeURIComponent(String(n[r])))})),o.join("")}}},1072:(e,t,r)=>{r.r(t),r.d(t,{JsonStorage:()=>c,createProviderClass:()=>o,deepFreeze:()=>i,hasOwnProperty:()=>s,isObject:()=>l,unwrapProvider:()=>d});var n=r(6330),a=r(5060);function o(e){return class extends HTMLElement{get $$typeof(){return"provider"}resolve(){return e(...arguments)}saveAs(t){var r=arguments;return(0,n.A)((function*(){for(var n=r.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=r[i];var s=yield e(...o);(0,a.saveAs)(s,t)}))()}}}function i(e){var t=Object.getOwnPropertyNames(e);for(var r of t){var n=e[r];n&&"object"==typeof n&&i(n)}return Object.freeze(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}class c{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"brick-next-";this.storage=e,this.prefix=t}setItem(e,t){this.storage.setItem(this.prefix+e,JSON.stringify(t))}getItem(e){var t;return JSON.parse(null!==(t=this.storage.getItem(this.prefix+e))&&void 0!==t?t:"null")}removeItem(e){return this.storage.removeItem(this.prefix+e)}clear(){return this.storage.clear()}}var u=new Map;function d(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=function(e){var t=u.get(e);return t||(t=document.createElement(e),u.set(e,t),t)}(e);return a.resolve(...r)}}},5177:(e,t,r)=>{function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(a,o){if("string"==typeof t?a.name===t:t.includes(a.name)){for(var i=[],s=1;s<=r;s++){var l=o[o.length-s];if("MemberExpression"===(null==l?void 0:l.node.type)&&"object"===l.key){var c=l.node;c.computed||"Identifier"!==c.property.type?c.computed&&"Literal"===c.property.type&&"string"==typeof c.property.value?i.push(n?"".concat(a.name,".").concat(c.property.value):c.property.value):e.hasNonStaticUsage=!0:i.push(n?"".concat(a.name,".").concat(c.property.name):c.property.name)}else e.hasNonStaticUsage=!0}i.length===r&&e.usedProperties.add(i.join("."))}}}function a(e,t){return function(r,n,a){if(n.name===e){var o=a[a.length-1],i=a[a.length-2];if("CallExpression"===(null==i?void 0:i.node.type)&&"callee"===(null==i?void 0:i.key)&&"MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key&&(o.node.computed?"Literal"===o.node.property.type&&o.node.property.value===t:"Identifier"===o.node.property.type&&o.node.property.name===t)){var s=i.node.arguments;if(s.length>0){var l=s[0];"Literal"===l.type&&"string"==typeof l.value?r.usedArgs.add(l.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>n,collectAppGetMenuUsage:()=>o,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>d,collectMemberUsageInFunction:()=>m,createProviderClass:()=>l.createProviderClass,scanPermissionActionsInAny:()=>E,scanPermissionActionsInStoryboard:()=>b,strictCollectMemberUsage:()=>u,track:()=>p,trackAll:()=>f,traverseStoryboardExpressions:()=>c,traverseStoryboardFunction:()=>h,traverseStoryboardFunctions:()=>v,unwrapProvider:()=>l.unwrapProvider});var o=a("APP","getMenu"),i=a("INSTALLED_APPS","has"),s=r(4303),l=r(8691);function c(e,t,r){var n=new WeakSet,{matchExpressionString:a,visitNotMatchedExpressionString:o,visitNonExpressionString:i,visitObject:c}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,s.isEvaluable)(r))if(a(r))try{(0,s.preevaluate)(r,{withParent:!0,hooks:{beforeVisitGlobal(e,n){t(e,n,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==o||o(r);else null==i||i(r);else if((0,l.isObject)(r)){if(n.has(r))return;for(var u of(n.add(r),null==c||c(r),Array.isArray(r)?r:Object.values(r)))e(u)}}(e)}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:n,nonStaticUsage:a,usedProperties:o}=d(e,t,r);if(n)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your expression: "').concat(a,'"'));return o}function d(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a={usedProperties:new Set,hasNonStaticUsage:!1},o=n(a,t,r);return c(e,((e,t,r)=>{o(e,t),a.hasNonStaticUsage&&(a.nonStaticUsage=r)}),t),a}function p(e,t,r){if(e.includes(t)){var a,o={usedProperties:new Set,hasNonStaticUsage:!1},{expression:i}=(0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(o,r)}});if("SequenceExpression"===i.type&&(a=i.expressions[0])&&"Literal"===a.type&&a.value===t){if(o.usedProperties.size>0)return o.usedProperties;console.warn('You are using "'.concat(t,'" but no `').concat(r,"` usage found in your expression: ").concat(JSON.stringify(e)))}}return!1}function f(e){if(e){var t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(t,["CTX","STATE","FORM_STATE"],1,!0)}}),t.usedProperties.size>0){var r=[...t.usedProperties],a={context:!1,state:!1,formState:!1},o={CTX:"context",STATE:"state",FORM_STATE:"formState"};return r.forEach((e=>{var[t,r]=e.split(".");a[o[t]]||(a[o[t]]=[]),a[o[t]].push(r)})),a}console.warn('You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: '.concat(JSON.stringify(e)))}return!1}function v(e,t){if(Array.isArray(e))for(var r of e)h(r,t)}function h(e,t,r){try{(0,s.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t}})}catch(t){r||console.error('Parse storyboard function "'.concat(e.name,'" failed:'),t)}}function m(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o={usedProperties:new Set,hasNonStaticUsage:!1};if(h(e,n(o,t,a),r),o.hasNonStaticUsage&&!r)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your function: "').concat(e.name,'"'));return o.usedProperties.delete(e.name),o.usedProperties}var g="PERMISSIONS",y="check";function b(e){var t,r=new Set,n=A(r),{customTemplates:a,functions:o}=null!==(t=e.meta)&&void 0!==t?t:{};return c([e.routes,a],n,g),v(o,n),Array.from(r)}function E(e){var t=new Set;return c(e,A(t),g),Array.from(t)}function A(e){return function(t,r){if(t.name===g){var n=r[r.length-1],a=r[r.length-2];if("CallExpression"===(null==a?void 0:a.node.type)&&"callee"===(null==a?void 0:a.key)&&"MemberExpression"===(null==n?void 0:n.node.type)&&"object"===n.key&&(n.node.computed?"Literal"===n.node.property.type&&n.node.property.value===y:"Identifier"===n.node.property.type&&n.node.property.name===y))for(var o of a.node.arguments)"Literal"===o.type&&"string"==typeof o.value&&e.add(o.value)}}}}}]);
|