(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[8886],{526497(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{zX:()=>e.zX}),__webpack_require__(13133),__webpack_require__(807270),__webpack_require__(923171),__webpack_require__(460639),__webpack_require__(267555);var e=__webpack_require__(412710);__webpack_require__(800449),__webpack_require__(20926),__webpack_require__(641253),__webpack_require__(964634),__webpack_require__(566757),__webpack_require__(994824),__webpack_require__(620119),__webpack_require__(65686),__webpack_require__(575908),__webpack_require__(3073),__webpack_require__(895763),__webpack_require__(696681)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},798886(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{"default":()=>f});var e=__webpack_require__(515863);__webpack_require__.n(e);var t=__webpack_require__(67659);var r=__webpack_require__(833081);var n=__webpack_require__(147928);var a=__webpack_require__(856296);var i=__webpack_require__(526497);var l=__webpack_require__(868534);var c=__webpack_require__(392272);var s=__webpack_require__(665232);var o=__webpack_require__(544089);var u=__webpack_require__(440869);var h=__webpack_require__(301819);var v=__webpack_require__(967500);var d=__webpack_require__(374027);function f(){let a=(0,e.c)(14);(0,c.J)("PerpsLayout"),(0,s.U)();let o=(0,r.wA)();let{pathname:v,search:f}=(0,n.zy)();let y=(0,r.d4)(p);let E=(0,r.d4)(S,r.bN);let $;let _;a[0]!==E||a[1]!==y?($=()=>{(0,h.SB)().hydrateFromControllerCache(E,y)},_=[E,y],a[0]=E,a[1]=y,a[2]=$,a[3]=_):($=a[2],_=a[3]),(0,t.useLayoutEffect)($,_);let k;let P;a[4]!==o||a[5]!==v||a[6]!==f?(k=()=>{let e=f?`${v}${f}`:v;Promise.resolve(o((0,u.GSC)(e))).catch(w)},P=[o,v,f],a[4]=o,a[5]=v,a[6]=f,a[7]=k,a[8]=P):(k=a[7],P=a[8]),(0,t.useEffect)(k,P);let C;let L;a[9]!==o?(C=()=>()=>{(0,d.sz)(),Promise.resolve(o((0,u.GSC)(null))).catch(b)},L=[o],a[9]=o,a[10]=C,a[11]=L):(C=a[10],L=a[11]),(0,t.useLayoutEffect)(C,L);let T;a[12]===Symbol.for("react.memo_cache_sentinel")?(T=[],a[12]=T):T=a[12],(0,t.useEffect)(m,T);let z;return a[13]===Symbol.for("react.memo_cache_sentinel")?(z=t.createElement(l.pP,null,t.createElement(i.zX,null,t.createElement(n.sv,null))),a[13]=z):z=a[13],z}function m(){let e=null;let t=()=>{if(document.visibilityState==="hidden"){e=Date.now();return}let t=e;if(e=null,t!==null&&Date.now()-t<3e4)return;(0,o.Rb)("perpsCheckHealth").catch(y)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}function y(){}function b(){}function w(){}function S(e){let t=e.metamask;let r=t.activeProvider??a.x$.DefaultProvider;let n=`${r}:${t.isTestnet?"testnet":"mainnet"}`;let i=t.cachedMarketDataByProvider?.[n];let l=t.cachedUserDataByProvider?.[n];return{markets:i?.data,positions:l?.positions,orders:l?.orders,account:l?.accountState,address:l?.address}}function p(e){return(0,v._)(e)?.address??null}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);