(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[2203],{532203(__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":()=>y});var e=__webpack_require__(303280);__webpack_require__.n(e);var t=__webpack_require__(860012);var r=__webpack_require__(48084);var n=__webpack_require__(107495);var a=__webpack_require__(798777);var l=__webpack_require__(762550);var i=__webpack_require__(92807);var c=__webpack_require__(59293);var s=__webpack_require__(358623);var o=__webpack_require__(609654);var u=__webpack_require__(79222);var h=__webpack_require__(895462);var v=__webpack_require__(365337);var d=__webpack_require__(264727);var f=__webpack_require__(731728);var m=__webpack_require__(330519);var S=__webpack_require__(749201);function y(){let a=(0,e.c)(20);(0,c.J)("PerpsLayout"),(0,s.U)();let o=(0,S.w)();let{pathname:v,search:y}=(0,n.zy)();let w=(0,r.d4)($);let _=(0,r.d4)(p,r.bN);let P=(0,r.d4)(d.mN);let T;let C;a[0]!==P?(T=()=>{(0,h.SB)().setUseTerminalApi(P)},C=[P],a[0]=P,a[1]=T,a[2]=C):(T=a[1],C=a[2]),(0,t.useEffect)(T,C);let L;let z;a[3]!==_||a[4]!==w||a[5]!==P?(L=()=>{(0,h.SB)().hydrateFromControllerCache({..._,markets:P?undefined:_.markets},w)},z=[_,w,P],a[3]=_,a[4]=w,a[5]=P,a[6]=L,a[7]=z):(L=a[6],z=a[7]),(0,t.useLayoutEffect)(L,z);let D;let g;a[8]!==o||a[9]!==v||a[10]!==y?(D=()=>{let e=y?`${v}${y}`:v;Promise.resolve(o((0,u.GSC)(e))).catch(k)},g=[o,v,y],a[8]=o,a[9]=v,a[10]=y,a[11]=D,a[12]=g):(D=a[11],g=a[12]),(0,t.useEffect)(D,g);let B;let G;a[13]!==o?(B=()=>()=>{(0,f.sz)(),Promise.resolve(o((0,u.GSC)(null))).catch(E)},G=[o],a[13]=o,a[14]=B,a[15]=G):(B=a[14],G=a[15]),(0,t.useLayoutEffect)(B,G);let H;a[16]===Symbol.for("react.memo_cache_sentinel")?(H=[],a[16]=H):H=a[16],(0,t.useEffect)(b,H);let M;a[17]===Symbol.for("react.memo_cache_sentinel")?(M=t.createElement(i.pP,null,t.createElement(l.zX,null,t.createElement(n.sv,null))),a[17]=M):M=a[17];let R;return a[18]!==y?(R=t.createElement(m.v6,{locationSearch:y},M),a[18]=y,a[19]=R):R=a[19],R}function b(){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(w)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}function w(){}function E(){}function k(){}function p(e){let t=e.metamask;let r=t.activeProvider??a.x$.DefaultProvider;let n=`${r}:${t.isTestnet?"testnet":"mainnet"}`;let l=t.cachedMarketDataByProvider?.[n];let i=t.cachedUserDataByProvider?.[n];return{markets:l?.data,positions:i?.positions,orders:i?.orders,account:i?.accountState,address:i?.address}}function $(e){return(0,v._)(e)?.address??null}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},762550(__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__(654352),__webpack_require__(93769),__webpack_require__(425462),__webpack_require__(650836),__webpack_require__(606760);var e=__webpack_require__(311441);__webpack_require__(918540),__webpack_require__(938685),__webpack_require__(791796),__webpack_require__(774153),__webpack_require__(663870),__webpack_require__(336795),__webpack_require__(454704),__webpack_require__(409823),__webpack_require__(22677),__webpack_require__(896289),__webpack_require__(227980),__webpack_require__(890194)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);