/*! * name: @fe/by-vendors * v: 1.1.2_8705081bb3b3 * build: 2026-07-16T08:45:20.911Z */ !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.ByVendors=t():e.ByVendors=t()}("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:this,(()=>(()=>{var e={752:e=>{function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{byComplianceSdk:()=>u,byDeadpoolSdk:()=>b,byDynamicDomain:()=>i,byDynamicSymbol:()=>h,byEnv:()=>r,byFetch:()=>e,byGtm:()=>v,byHelpers:()=>p,byI18nLoader:()=>f,byLanguageDetector:()=>E,byLogger:()=>a,byMetas:()=>t,byRequest:()=>y,byRouteFinder:()=>d,bySensors:()=>m,bySharedSettings:()=>c,byStorage:()=>l,bySymbolList:()=>g,byThemeLoader:()=>w,byUniframeToolkit:()=>s});var e={};n.r(e),n.d(e,{createFetchInstance:()=>k});var t={};n.r(t),n.d(t,{APP_DEEPLINK_PREFIX_EU:()=>ue,APP_DEEPLINK_PREFIX_GLOBAL:()=>le,APP_DEEPLINK_PREFIX_JPN:()=>pe,APP_DEEPLINK_PREFIX_MINI:()=>ge,APP_DEEPLINK_PREFIX_THA:()=>he,APP_DEEPLINK_PREFIX_TUR:()=>de,APP_DEEPLINK_PREFIX_USA:()=>ce,APP_ONELINK:()=>fe,APP_ONELINK_JPN:()=>be,APP_ONELINK_THA:()=>ve,APP_ONELINK_TUR:()=>me,APP_ONELINK_USA:()=>ye,BRAND_CN:()=>C,BRAND_GEO:()=>D,BRAND_GLOBAL:()=>P,BRAND_HKG:()=>$,BRAND_NAME:()=>L,BRAND_NAME_FIRST_CHAR_UPPER:()=>R,BRAND_NAME_UPPER:()=>I,BRAND_TUR:()=>x,BRAND_TUR_OLD:()=>U,BRAND_USA:()=>_,DOMAIN_ARE:()=>Q,DOMAIN_EU:()=>V,DOMAIN_GEO:()=>ee,DOMAIN_HKG:()=>X,DOMAIN_IDN:()=>Y,DOMAIN_JPN:()=>ne,DOMAIN_JPN_OLD:()=>oe,DOMAIN_KAZ:()=>z,DOMAIN_NLD:()=>Z,DOMAIN_THA:()=>ie,DOMAIN_TUR:()=>J,DOMAIN_TUR_OLD:()=>W,DOMAIN_USA:()=>re,DOMAIN_WWW:()=>te,REPLACE_DOMAIN_WHITE_LIST:()=>we,UA_APP:()=>M,UA_APP_EU:()=>q,UA_APP_IDN:()=>F,UA_APP_JPN:()=>H,UA_APP_THA:()=>B,UA_APP_TUR:()=>j,UA_APP_USA:()=>G,URL_TESTNET:()=>se,URL_WWW:()=>ae,getDomain:()=>K});var r={};n.r(r),n.d(r,{API2_HOST:()=>Qe,COOKIE_DOMAIN:()=>Ye,DEADPOOL_URL_PREFIX:()=>ct,ENV_API2_HOST:()=>je,ENV_COOKIE_DOMAIN:()=>$e,ENV_DEADPOOL_URL_PREFIX:()=>lt,ENV_HOST:()=>Ke,ENV_HOSTNAME:()=>Ve,ENV_NODE_ENV:()=>Ge,ENV_ORIGIN_HOST:()=>Be,ENV_PORT:()=>ze,ENV_PROTOCOL:()=>He,ENV_RUNTIME_ENV:()=>Me,ENV_SERVICE_DOMAINS:()=>Fe,ENV_WS2_HOST:()=>qe,REGULATED_SITE_HOSTS:()=>st,RUNTIME_ENV:()=>Ze,SERVICE_DOMAINS:()=>tt,SITE_ID:()=>st,TG_PLATFORM:()=>Et,WS2_HOST:()=>Xe,getPlatform:()=>Tt,getRelativeUrl:()=>It,getSiteId:()=>rt,getWwwUrlBySiteId:()=>it,getXUserAgent:()=>Nt,isApp:()=>yt,isAppEu:()=>pt,isAppJpn:()=>mt,isAppTha:()=>ft,isAppTr:()=>ht,isAppUSA:()=>gt,isBrowser:()=>ut,isDev:()=>Ue,isGlobalApp:()=>dt,isLocal:()=>Lt,isMobile:()=>bt,isProd:()=>_e,isProdOrTestnet:()=>Ie,isSSL:()=>xe,isTGMiniApp:()=>wt,isTest:()=>Pe,isTestnet:()=>Re,platform:()=>Ot,protocol:()=>De,repaired_hostname:()=>nt,s3TransformPath:()=>kt,xUserPlatform:()=>At});var i={};n.r(i),n.d(i,{AFFILIATES_HOST:()=>Zt,API2_HOST:()=>cn,BLOG_HOST:()=>fn,CDN_STATIC:()=>on,CDN_STATIC_PROD:()=>nn,CHAT_URL:()=>sn,DOMAIN:()=>Xt,DOMAIN_TYPE:()=>en,DYNAMIC_ENV:()=>Ht,OPTION_ALL_ENV:()=>pn,OPTION_TEST_GATEWAY_HOST:()=>dn,OPTION_TEST_WS_HOST:()=>hn,REPLACE_DOMAIN_WHITE_LIST:()=>we,TOKEN_COOKIE_KEY:()=>tn,WS2_HOST:()=>un,ZENDESK_HOST:()=>gn,api2Prefix:()=>Yt,apiProtocol:()=>an,cdnStatic:()=>Bt,currentDomain:()=>Kt,getContentDomain:()=>Rt,getHelpLink:()=>bn,helpCenterHost:()=>vn,helpLang:()=>yn,replaceContentDomain:()=>_t,ws2Prefix:()=>Qt,ws2Protocol:()=>ln,zBaseLink:()=>mn});var s={};n.r(s),n.d(s,{UniRequest:()=>Bn});var a={};n.r(a),n.d(a,{TRACE_AJAX_TYPES:()=>Ao,TRACE_TYPES:()=>Oo,addEvent:()=>xo,initModuleEventLog:()=>Do,initRenderComponentEventLog:()=>Co,monitorInstance:()=>ko});var l={};n.r(l),n.d(l,{addCookie:()=>Ko,getCookie:()=>Vo,sessionStorage:()=>Jo,storage:()=>zo});var c={};n.r(c),n.d(c,{ADA_LOCALE_MAP:()=>er,APP_QR_CODE_PATH:()=>Xo,GA_UID_KEY:()=>To,GLOBAL_SITE_KEY:()=>Zo,GLOBAL_THEME_KEY:()=>Wo,GTM_ID:()=>Cr,GTM_ID_LEARN:()=>$r,GUID_KEY:()=>Eo,LANG_KEY:()=>wo,LOGO_PATH:()=>Qo,PLATFORM_SUPPORT_LANGUAGES:()=>vr,PLATFORM_SUPPORT_LANGUAGES_MAP:()=>br,REG_REF_KEY:()=>_r,RTL_LANGUAGES:()=>Rr,SITE_DEFAULT_LANGUAGE:()=>Er,SITE_DEFAULT_LANGUAGE_MAP:()=>wr,SITE_ID:()=>st,SITE_ID_HOST_MAP:()=>Te,SITE_SUPPORTED_LANGUAGES:()=>Tr,SUPPORTED_LANGUAGES:()=>sr,SUPPORTED_LANGUAGES_ALL_SITES:()=>vr,SUPPORTED_LANGUAGES_ALL_SITES_MAP:()=>br,SUPPORTED_LANGUAGES_ARE:()=>gr,SUPPORTED_LANGUAGES_EU:()=>dr,SUPPORTED_LANGUAGES_GBR:()=>or,SUPPORTED_LANGUAGES_GEO:()=>hr,SUPPORTED_LANGUAGES_GLOBAL:()=>ir,SUPPORTED_LANGUAGES_GLOBAL_DISPLAY:()=>nr,SUPPORTED_LANGUAGES_GLOBAL_HIDDEN:()=>rr,SUPPORTED_LANGUAGES_HKG:()=>ar,SUPPORTED_LANGUAGES_IDN:()=>pr,SUPPORTED_LANGUAGES_JPN:()=>fr,SUPPORTED_LANGUAGES_KAZ:()=>ur,SUPPORTED_LANGUAGES_NLD:()=>lr,SUPPORTED_LANGUAGES_THA:()=>yr,SUPPORTED_LANGUAGES_TUR:()=>cr,SUPPORTED_LANGUAGES_USA:()=>mr,TDID_V2_KEY:()=>Yo,THEME_KEY:()=>So,TRADING_VIEW_LOCALE_MAP:()=>tr,domainSiteIdMap:()=>Ir,getAppDeeplinkPrefix:()=>Ur,getAppLanguage:()=>Ar,getFormattedConfigs:()=>vo,getHreflangHtml:()=>bo,getOriginalConfigs:()=>yo,getSiteIdByLanguage:()=>Lr,getSiteLanguage:()=>Or,getSupportLanguage:()=>kr,regulatedSiteHosts:()=>st,rtlLanguagesList:()=>Rr,setSiteLanguage:()=>Nr});var u={};n.r(u),n.d(u,{ByComplianceSDK:()=>Mr,regulatedSiteHosts:()=>st});var d={};n.r(d),n.d(d,{getServiceHost:()=>si,initRoute:()=>ai,serviceDomainList:()=>Jr});var h={};n.r(h),n.d(h,{FETCH_SYMBOL_OPTION_ACTION:()=>Ys,FETCH_SYMBOL_OPTION_FILTER:()=>Qs,PREDICTION_TYPE:()=>oa,UNDERLYING_TYPE:()=>na,default:()=>ul});var p={};n.r(p),n.d(p,{clamp:()=>Hl,countDown:()=>rc,crossCombine:()=>Bl,deepClone:()=>ql,displayThousands:()=>yc,flatMapDepth:()=>Xl,formatCountDown:()=>ic,formatNumber:()=>vc,getMainDomainName:()=>Oc,getQueryParams:()=>Sc,getQueryParamsWithSpecialChars:()=>Tc,getUrlObject:()=>Nc,guid:()=>Ec,intercept:()=>sc,isFinite:()=>$l,isFromInternalByMainDomain:()=>Ac,isFunction:()=>jl,isInteger:()=>Ml,isNaN:()=>Cl,isNumber:()=>Dl,isObject:()=>Rl,isObjectLike:()=>Ll,isPlainObject:()=>Il,isString:()=>Al,isSymbol:()=>_l,isUndefined:()=>kl,loadScript:()=>bc,localDate:()=>nc,localDateTime:()=>tc,localTime:()=>oc,map:()=>Fl,omit:()=>Gl,partition:()=>Kl,pick:()=>Vl,reduceNum:()=>cc,tendTo5:()=>uc,toFinite:()=>Ul,toInteger:()=>xl,toNumber:()=>Pl,toThousands:()=>ac,transformNum:()=>lc});var g={};n.r(g),n.d(g,{API_KEY_MAP:()=>xc,default:()=>Lu});var f={};n.r(f),n.d(f,{I18nBackend:()=>Ed,I18nLanguageDetector:()=>vd,initI18nInstance:()=>Ad});var m={};n.r(m),n.d(m,{fastFetchABTest:()=>Ud,getSensorsInstance:()=>Id,login:()=>xd,track:()=>Rd,trackClick:()=>_d,trackExposure:()=>Pd});var y={};n.r(y),n.d(y,{SUPPORTED_METHOD:()=>Gd,request:()=>Fd});var v={};n.r(v),n.d(v,{addGtmListener:()=>Hd,pushEvent:()=>Bd});var b={};n.r(b),n.d(b,{DeadpoolCacheSdk:()=>zd});var w={};n.r(w),n.d(w,{getSite:()=>uh,getTheme:()=>dh,initTheme:()=>lh,reinit:()=>ch,setSite:()=>oh,setTheme:()=>sh,toggleTheme:()=>ah});var E={};n.r(E),n.d(E,{detectLanguageAndRedirect:()=>bh,detectSiteLanguage:()=>yh,detectSiteLanguageAndRedirect:()=>vh,getSiteLanguageFromClientLanguage:()=>mh});let S=null;try{S="AbortController"in window}catch(e){S=null}const T="json",N={},O=e=>e>=200&&e<300;class A{constructor(e={},t={}){this.defaultOpts={...N,...e},this.globalTimeout=t.timeout||3e4,this.validateStatus=t.validateStatus||O,this.defaultRespType=t.defaultRespType||T,this.interceptors={response:[],request:[],errorHandler:[],finally:[]}}get(e,t={},n){let o=e;if(t.body){const e=t.body;Object.keys(e).forEach((t=>{const n=`${t}=${e[t]}`;o=o.indexOf("?")>-1?`${o}&${n}`:`${o}?${n}`})),delete t.body}return this.fetch(o,{...t,method:"get"},n)}post(e,t={},n){return this.fetch(e,{...t,method:"post"},n)}delete(e,t={},n){return this.fetch(e,{...t,method:"delete"},n)}put(e,t={},n){return this.fetch(e,{...t,method:"put"},n)}fetch(e,t={},n){const o=n||this.defaultRespType,{timeout:r,...i}=t,s="number"!==typeof r||Number.isNaN(r)?this.globalTimeout:r,a={url:e,...this.defaultOpts,...i,headers:{...this.defaultOpts.headers,...i.headers}},l=this.interceptors.request.reduce(((t,n)=>n(t,e)),a);let c;const u=S?new AbortController:{};l.signal=u.signal;const d=new Promise(((t,n)=>{c=setTimeout((()=>{n({ret_code:9000001,ret_msg:"Request timeout, please re-try!",url:e}),S&&u.abort()}),s)})),h=fetch(e,l);return Promise.race([h,d]).then((e=>(clearTimeout(c),e))).then((e=>this.validateStatus(e.status)?e.ok?new Promise((t=>{e[(e=>{const t=String(e).toLowerCase();return{json:!0,text:!0,formData:!0,blob:!0,arrayBuffer:!0}[t]?t:T})(o)]().then((n=>{t({headers:e.headers,data:n})}))})):{headers:{},data:{}}:Promise.reject({status:e.status,statusText:e.statusText}))).then((({data:t,headers:n})=>this.interceptors.response.reduce(((e,t)=>e.then(t)),Promise.resolve({headers:n,data:t,config:l,url:e})))).catch((t=>(clearTimeout(c),this.interceptors.errorHandler.forEach((n=>n(t,l,e))),Promise.reject(t)))).finally((()=>{this.interceptors.finally.forEach((t=>t(l,e)))}))}}const k=(e={},t={})=>{"undefined"!==typeof window&&"fetch"in window||console&&console.error&&console.error("fetch function doesn't detected in you environment");const n=new A(e,t),o=n.fetch.bind(n);return o.get=n.get.bind(n),o.post=n.post.bind(n),o.put=n.put.bind(n),o.delete=n.delete.bind(n),o.interceptors=n.interceptors,o},L=String.fromCharCode(98,121,98,105,116),I=L.toUpperCase(),R=String.fromCharCode(66,121,98,105,116),_="abfinance",P=`${L}global`,U=`${L}-tr`,x=`${L}tr`,D=`${L}georgia`,C=`${L}-cn`,$=String.fromCharCode(98,121,104,107,98,105,116),M=`${L}_app`,j=`${L}_app_tr`,q=`${L}_app_eu`,F=`${L}_app_idn`,G="bit_app_us",B="bit_app_tha",H="bit_app_jpn",K=e=>`${L}.${e}`,V=K("eu"),z=K("kz"),J=K("tr"),W=`${U}.com`,Z=K("nl"),Y=K("id"),Q=K("ae"),X=`${$}.com`,ee=`${D}.ge`,te=K("com"),ne="manepa.jp",oe="moneypartners.co.jp",re="abfinance.com",ie="waanx.com",se=`https://testnet.${L}.com`,ae=`https://www.${L}.com`,le=`${L}app://`,ce="bitusapp://",ue=`${L}-eu://`,de=`${L}-tr://`,he="waanxapp://",pe="bit-jpn://",ge="by-mini://",fe=`https://${L}.onelink.me`,me=`https://${x}.onelink.me`,ye="https://bitappus.onelink.me",ve="https://waanx.onelink.me",be="https://moneypartners.onelink.me",we=[`${L}.com`,`${P}.com`,"bytick.com",`${L}-global.com`,`${L}.biz`,`${L}.global`,`${L}.org`,`${L}s.org`,`${L}gum.com`,`${L}gum.org`,`${L}s.io`,`${L}.cloud`,`${L}x.global`,X,Z,Q,`${L}.com.hk`,J,W,z,V,`${L}-ge.com`,Y,ee,re,ie,ne,oe,"fullbetacloud.com","bycloud.org"],Ee=(e,t)=>!e||e===t,Se=(e,t)=>{if(!Array.isArray(e)||!e.length)return{};const{siteId:n,account:o,regulationCountry:r}=t,i=e.reduce(((e,t)=>{if(null===t||void 0===t||!t.action)return e;let i=t.siteId;const s=t.account,a=t.rc,l=t.logic;"GLOBAL"===i&&(i=I);let c=!1;if(Ee(i,n)&&("or"===l?Ee(s,o)||Ee(a,r):Ee(s,o)&&Ee(a,r))&&(c=!0),c){const n=e[t.element];e[t.element]=((null===n||void 0===n?void 0:n.priority)||0)>(t.priority||0)?n:t}return e}),{});return Object.entries(i).reduce(((e,[t,n])=>({...e,[t]:{action:n.action,...n.ext&&{ext:n.ext}}})),{})},Te={HKG:X,TUR:J,TUR_OLD:W,KAZ:z,NLD:Z,GEO:ee,IDN:Y,ARE:Q,EU:V,JPN:ne,JPN_OLD:oe,USA:re,THA:ie};var Ne;let Oe,Ae="",ke={};const Le=`__${I}_GLOBAL_CONFIG__`;"undefined"!==typeof window&&window.location&&(Oe=window.location.hostname,Ae=window.location.protocol,ke=window.__GLOBAL_PROXY_CONFIG__||window[Le]||{});const Ie=!!Oe&&(/^[^.]+\.[^.]+\.[^.]+$/.test(Oe)||/^[^.]+\.[^.]+\.[^.]+\.(hk|uae|us|uk|jp|fr|de|au|ca|br|in|ru)$/.test(Oe)),Re=Ie&&!!Oe&&/^[^.]*testnet[^.]*\./.test(Oe),_e=Ie&&!Re,Pe=!Re&&!_e,Ue=Pe,xe="https:"===Ae,De=Ae,Ce=ke.enableAutoman&&ke.automan||{},$e=Ce.AUTOMAN_COOKIE_DOMAIN,Me=Ce.AUTOMAN_RUNTIME_ENV,je=Ce.AUTOMAN_API2_HOST,qe=Ce.AUTOMAN_WS2_HOST,Fe=Ce.AUTOMAN_SERVICE_DOMAINS,Ge=Ce.AUTOMAN_NODE_ENV||"production",Be=Ce.AUTOMAN_ORIGIN_HOST,He=Ce.AUTOMAN_PROTOCOL,Ke=Ce.AUTOMAN_HOST,Ve=Ce.AUTOMAN_HOSTNAME,ze=Ce.AUTOMAN_PORT;function Je(e,t,n){return"undefined"!==typeof process&&"MISSING_ENV_VAR"[e]?"MISSING_ENV_VAR"[e]:void 0!==t&&null!==t&&""!==t?t:n}let We="local";Re?We="testnet":_e?We="prod":Pe&&(We="test");const Ze=Je("RUNTIME_ENV",Me,We)||We,Ye=Je("COOKIE_DOMAIN",$e),Qe=Je("API2_HOST",je),Xe=Je("WS2_HOST",qe);let et="";Re?et=`${P}.com`:_e?et="bycbe.com, byapis.com":Pe&&(et=`${C}.com`);const tt=Je("SERVICE_DOMAINS",Fe,et)||et;let nt=Oe;const ot=["cloud","announcements","sandbox","blog","newblog","learn","affiliates","institution"];if(Oe&&ot.some((e=>Oe.includes(e)))){const e=new RegExp(`(?:(?:${ot.join("|")})-testnet|testnet-(?:${ot.join("|")}))`,"g"),t=new RegExp(`^(?:${ot.join("|")})(?=.)`,"g");nt=Oe.replace(e,"testnet").replace(t,"www")}function rt(e){var t,n,o,r,i,s,a,l,c,u,d,h,p;if("undefined"===typeof window&&!e)return(null===(h=process)||void 0===h||null===(p="MISSING_ENV_VAR")?void 0:p.BUILD_SITE_ID)||I;let g=e||"";return!g&&"undefined"!==typeof window&&window.location&&(g=window.location.hostname||""),null!==(t=g)&&void 0!==t&&t.includes(V)?"EU":null!==(n=g)&&void 0!==n&&n.includes(z)?"KAZ":null!==(o=g)&&void 0!==o&&o.includes(J)||null!==(r=g)&&void 0!==r&&r.includes(W)?"TUR":null!==(i=g)&&void 0!==i&&i.includes(ee)?"GEO":null!==(s=g)&&void 0!==s&&s.includes(Y)?"IDN":/^[^.]+\.[^.]+\.[^.]+\.hk$/.test(g)||/^[^.]+\.[^.]+\.[^.]+\.[^.]+\.hk$/.test(g)||null!==(a=g)&&void 0!==a&&a.includes(X)?"HKG":/^[^.]+\.[^.]+\.ae$/.test(g)||/^[^.]+\.[^.]+\.[^.]+\.ae$/.test(g)?"ARE":/^[^.]+\.[^.]+\.nl$/.test(g)||/^[^.]+\.[^.]+\.[^.]+\.nl$/.test(g)?"NLD":null!==(l=g)&&void 0!==l&&l.includes(ne)||null!==(c=g)&&void 0!==c&&c.includes(oe)?"JPN":null!==(u=g)&&void 0!==u&&u.includes(re)?"USA":null!==(d=g)&&void 0!==d&&d.includes(ie)?"THA":I}const it=e=>{let t=Te[e];return t||(t=te),`https://www.${t}`},st=rt(),at="USA"===st?"//www.byore-test-1.abfinance.com":`//www.unify-test-1.${L}.com`,lt=Ce.AUTOMAN_DEADPOOL_URL_PREFIX,ct=Je("DEADPOOL_URL_PREFIX",lt,at)||at,ut="undefined"!==typeof window,dt=()=>!!ut&&new RegExp(M).test(navigator.userAgent.toLowerCase()),ht=()=>!!ut&&new RegExp(j).test(navigator.userAgent.toLowerCase()),pt=()=>!!ut&&new RegExp(q).test(navigator.userAgent.toLowerCase()),gt=()=>!!ut&&new RegExp(G).test(navigator.userAgent.toLowerCase()),ft=()=>!!ut&&new RegExp(B).test(navigator.userAgent.toLowerCase()),mt=()=>!!ut&&new RegExp(H).test(navigator.userAgent.toLowerCase()),yt=()=>dt()||pt()||ft()||ht()||gt()||mt(),vt=["android","ios"];function bt(e={}){var t,n;let o=null===e||void 0===e?void 0:e.ua;if(o||"undefined"===typeof navigator||(o=navigator.userAgent),"object"===typeof o&&null!==(t=o)&&void 0!==t&&null!==(n=t.headers)&&void 0!==n&&n["user-agent"]&&(o=o.headers["user-agent"]),"string"!==typeof o)return!1;let r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|Telegram-Android/i.test(o)||!!e.tablet&&/android|ipad|playbook|silk/i.test(o);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==o.indexOf("Macintosh")&&-1!==o.indexOf("Safari")&&(r=!0),r}function wt(){var e;return"undefined"!==typeof window&&!(null===(e=window)||void 0===e||!e.TelegramWebviewProxy)}const Et={PC:"pc_tg",IOS:"ios_tg",ANDROID:"android_tg"};function St(){var e,t,n,o;if("undefined"===typeof window)return null;const r=(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)||"",i=(null===(n=window)||void 0===n||null===(o=n.navigator)||void 0===o?void 0:o.platform)||"";let s=null;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(i)?s="macos":-1!==["iPhone","iPad","iPod"].indexOf(i)?s="ios":-1!==["Win32","Win64","Windows","WinCE"].indexOf(i)?s="windows":/Android/.test(r)?s="android":!s&&/Linux/.test(i)&&(s="linux"),s}const Tt=e=>{try{if(ut){if(wt()){const e=St();return e&&vt.includes(e)?"ios"===e?Et.IOS:Et.ANDROID:Et.PC}return null!==e&&void 0!==e?e:bt()?"h5":"pc"}return null!==e&&void 0!==e?e:bt()?"h5":"pc"}catch(t){return null!==e&&void 0!==e?e:bt()?"h5":"pc"}},Nt=()=>{try{if(ut){if(!wt())return;const e=St()||(bt()?"android":"windows"),t=vt.includes(e)?"phone":"pc";return`company/${L} platform/tg-mini system/${e} device/${t}`}return}catch(e){return}},Ot=Tt(),At=Nt(),kt=new Map([["https://fh-static.bycsi.com","/common-static/fhs"],["https://prod-usa-fht-web-0145-wu.s3.ap-southeast-1.amazonaws.com","/common-static/fhs"],["https://d1.abfinance.com","/bycsi-root"],["https://t1.bycsi.com","/bycsi-root"],["https://t1.abfinance.com","/bycsi-root"],["https://s1.bycsi.com","/bycsi-root"],["https://s1.abfinance.com","/bycsi-root"]]),Lt="undefined"!==typeof process&&"development"===(null===(Ne="MISSING_ENV_VAR")?void 0:Ne.NODE_ENV)||"development"===Ge||"development"===Me;function It(e,t=!1){try{if(!e)return e;if(e.startsWith("/bycsi-root"))return Lt||t?`${ct}${e}`:e;if(/deadpool/.test(e)){let n=e,o=!1,r="";try{const t=new URL(e);n=t.pathname,r=t.origin,o=!0}catch{n=e}return n.includes(`/${L}/deadpool-testnet`)?n=n.replace(`/${L}/deadpool-testnet`,"/bycsi-root/deadpool"):n.includes("/deadpool-test")?n=n.replace("/deadpool-test","/bycsi-root/deadpool"):n.includes(`/${L}/deadpool`)&&(n=n.replace(`/${L}/deadpool`,"/bycsi-root/deadpool")),Lt||t?`${ct}${n}`:n}const n=new URL(e);if(!kt.has(n.origin))return e;let o=e;return o=e.replace(n.origin,kt.get(n.origin)),(Lt||t)&&(o=n.origin.includes("t1.bycsi.com")?`${se}${o}`:`${ae}${o}`),o}catch(n){return(Lt||t)&&e.startsWith("/bycsi-root")?`${ct}${e}`:e}}const Rt=e=>{if("undefined"!==typeof window){const{protocol:t}=window.location;let{hostname:n}=window.location;we.some((e=>n.match(new RegExp(`${e}$`))))||(n=`www.${L}.com`),n.endsWith(".nl")&&"blog"===e&&(n=n.replace(/\.nl$/,".com")),n.endsWith(".com.hk")&&["blog","learn"].includes(e)&&(n=n.replace(/\.com\.hk$/,".com"));const o=new RegExp(`\\.${X}\\.com$`),r=`${L}.com`;n.match(o)&&["blog","learn"].includes(e)&&(n=n.replace(o,`.${r}`));const i=n.split(".");if(i.length<=2)return`${t}//${e}.${r}`;let s=i[0];const a="blog"===e?"newblog":e;return s=s.includes("testnet")?`testnet-${a}`:e,i[0]=s,n=i.join("."),`${t}//${n}`}return""},_t=e=>{if("undefined"!==typeof window){var t;const n=new URL(e),o=null===(t=n.hostname.match(/learn|blog|announcements/))||void 0===t?void 0:t[0];if(!o)return e;const r=new URL(Rt(o));return n.hostname=r.hostname,n.toString()}return e},Pt="undefined"!==typeof De&&"https:"===De?"wss:":"ws:";let Ut=!0,xt="USA"===st?"byore-test-1":"unify-test-1",Dt="USA"===st?_:L,Ct="com",$t="";if("development"!==Ge&&nt){Ut=!1;const e=nt.split(".");3===e.length&&([xt,Dt,Ct]=e),4===e.length&&(Ie?([xt,Dt,Ct,$t]=e,Ct=`${Ct}.${$t}`):[,xt,Dt,Ct]=e),5===e.length&&([,xt,Dt,Ct,$t]=e,Ct=`${Ct}.${$t}`)}const Mt=Ut&&("dev-3"===xt||"test-3"===xt),jt=/^(www|m)$/,qt="testnet"===xt||"m-testnet"===xt,Ft="s1.bycsi.com",Gt=/^(www|m|testnet|m-testnet)$/.test(xt),Bt=qt?"t1.bycsi.com":Ft,Ht=xt,Kt=`${Dt}.${Ct}`;let Vt="api2."+(jt.test(xt)?"":`${xt}.`),zt="ws2."+(jt.test(xt)?"":`${xt}.`),Jt="chat."+(jt.test(xt)?"":`${xt}.`),Wt="affiliates.";qt&&(Vt="api2-testnet.",Jt="chat-testnet.",zt="ws2-testnet.",Wt="affiliates-testnet."),Gt||(Wt=`affiliates.${xt}.`);const Zt=`https://${Wt}${Dt}.${Ct}`,Yt=Vt,Qt=zt,Xt=Dt,en=Ct,tn=$e||"b_t_c_k"+(jt.test(xt)?"":`_${xt}`),nn=`https://${Ft}`,on=`https://${Bt}`,rn=De||"https:",sn=`${rn}//${Jt}${Dt}.${Ct}/chat/by-chat-widget.js`,an=Mt?"https:":rn,ln=Mt?"wss:":Pt,cn=je||"/x-api",un=qe||`${ln}//${Qt}${Dt}.${Ct}`,dn=`${rn}//infra-gateway.${xt}.${Dt}.${Ct}`,hn=`${ln}//www.${xt}.${Dt}.${Ct}`,pn=jt.test(xt)?"":`_${xt}`,gn=`https://help.${Dt}.com`,fn=`https://blog.${Dt}.com`,mn=`${gn}/hc`,yn={"en-US":"en-us","zh-CN":"zh-cn","zh-TW":"zh-tw","ja-JP":"ja","ko-KR":"ko","ru-RU":"en-us","vi-VN":"en-us"},vn=Gt?"":ae,bn=(e,t)=>`${vn}/${e||"en-US"}/help-center/${t}`;let wn=function(e){return e.ALL="all",e.MANUAL="manual",e.TTL="ttl",e}({});class En{constructor(){this.cache=new Map,this.maxCache=20,this.timer={},this.freezedCacheDeletion={}}get(e){return this.cache.get(e)}set(e,t,n=6e4){if(this.maxCache>0&&this.cache.size>=this.maxCache){const e=[...this.cache.keys()][0];this.cache.delete(e),this.timer[e]&&clearTimeout(this.timer[e])}this.cache.set(e,t),n>0&&(this.timer[e]=setTimeout((()=>{this.allowDeleteCacheEntry(e,wn.TTL)&&(this.cache.delete(e),delete this.timer[e])}),n))}delete(e){return delete this.timer[e],this.cache.delete(e)}clear(){Object.entries(this.timer).forEach((([e])=>{this.allowDeleteCacheEntry(e,wn.MANUAL)&&delete this.timer[e]})),this.cache.forEach(((e,t)=>{this.allowDeleteCacheEntry(t,wn.MANUAL)&&this.cache.delete(t)}))}clearOneCache(e){Object.entries(this.timer).forEach((([t])=>{this.allowDeleteCacheEntry(t,wn.MANUAL)&&e===t&&delete this.timer[t]})),this.cache.forEach(((t,n)=>{this.allowDeleteCacheEntry(n,wn.MANUAL)&&e===n&&this.cache.delete(n)}))}freezeCacheDeletion(e={}){this.freezedCacheDeletion={...this.freezedCacheDeletion,...e}}allowDeleteCacheEntry(e,t){return!Object.entries(this.freezedCacheDeletion).some((([n,o])=>e.includes(n)&&(o===wn.ALL||t===o)))}}class Sn{constructor(){this.middlewares=[]}use(e){if("function"!==typeof e)throw new TypeError("Middleware is not a function.");this.middlewares.push(e)}execute(e){const t=function(e){if(!Array.isArray(e))throw new TypeError("Middlewares must be an array!");const t=e.length;for(let n=0;nr(i+1))))}catch(e){return Promise.reject(e)}}(0)}}([...this.middlewares]);return t(e)}}class Tn extends Error{constructor(e,t,n="RequestError"){super(e),this.name="RequestError",this.request=t,this.type=n}}class Nn extends Error{constructor(e,t,n,o,r="ResponseError"){super(t||e.statusText),this.name="ResponseError",this.data=n,this.response=e,this.request=o,this.type=r}}function On(){let e;return"undefined"!==typeof process&&null!=process.versions&&null!==process.versions.node&&(e="NODE"),"undefined"!==typeof XMLHttpRequest&&(e="BROWSER"),e}class An{resolve=()=>{};reject=()=>{};constructor(e){const t=new Promise(((t,n)=>{this.resolve=t,this.reject=n,e&&e(t,n)}));return t.resolve=this.resolve,t.reject=this.reject,t}}let kn=!1,Ln=["/v2/private/user/profile"];try{kn="AbortController"in window}catch(e){kn=!1}async function In(e){return Promise.resolve(e)}async function Rn(e){var t;const n=null===e||void 0===e||null===(t=e.interceptors)||void 0===t?void 0:t.instanceRequest;return n&&Array.isArray(n)?async function(e,t){return t.reduce(((t,n)=>t.then(((t={})=>(e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,n(e.req.url,e.req.options,e.operations))))),Promise.resolve()).then(((t={})=>(e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,Promise.resolve(e))))}(e,n):Promise.resolve(e)}async function _n(e,t){const n="function"===typeof e.clone?e.clone():e;let o=Promise.resolve(n);return t.interceptors.instanceResponse.forEach((e=>{o=o.then((n=>{const o="BROWSER"===On()&&"function"===typeof n.clone?n.clone():n;return e(o,t.req.options,t.operations)}))})),o}function Pn(e,t){const{req:{url:n,options:o={}},cache:r,cacheKey:i}=e;e.operations.createRequestError=t=>new Tn(t,e.req);const{useCache:s=!1,timeout:a=3e4,validateStatus:l=e=>e>=200&&e<300,ttl:c=6e4}=o;let u=r.get(i);if(!u||!s){u=new An,s&&r.set(i,u,c);const o=In(e).then((e=>Rn(e))).then((async e=>{const o=e.req.options;let c;kn&&(c=new AbortController);const d=fetch(n,{...o,signal:c?c.signal:void 0}).catch((t=>{throw u.reject(new Tn((null===t||void 0===t?void 0:t.message)||"Faild to fetch, http network error",null===e||void 0===e?void 0:e.req)),new Tn("http network error",e.req)})),h=function(e,t,n){let o;return{promise:new Promise(((r,i)=>{o=setTimeout((()=>{i(new Tn(`timeout of ${e}ms exceeded`,t,"Timeout")),n()}),e)})),timer:o}}(a,e.req,(()=>{kn&&c.abort()}));return Promise.race([d,h.promise]).then((e=>{const t="BROWSER"===On()&&"function"===typeof e.clone?e.clone():e;return l(t.status)&&s&&(t.useCache=!0,u.resolve(t)),e})).then((t=>(e.operations.createResponseError=(n,o)=>new Nn(t,n,o,e.req),async function(e,t){const n=t.interceptors.globalResponseMap[t.req.url];if(n&&Array.isArray(n)){const o="BROWSER"===On()&&"function"===typeof e.clone?e.clone():e;n.forEach((e=>e(o,t.req.options,t.operations)))}}(t,e),t))).then((t=>_n(t,e))).then((n=>(e.res=n,t()))).catch((t=>(null!==Ln&&void 0!==Ln&&Ln.every((t=>{var n;return!(null!==e&&void 0!==e&&null!==(n=e.req)&&void 0!==n&&n.url.includes(t))}))&&r.delete(i),Promise.reject(t)))).finally((()=>{h.timer&&clearTimeout(h.timer)}))}));return o}return In(e).then((e=>Rn(e))).then((()=>u)).then((t=>(e.operations.createResponseError=(n,o)=>new Nn(t,n,o,e.req),_n(t,e)))).then((n=>(e.res=n,t()))).catch((e=>Promise.reject(e)))}function Un(e,t){let n;return t().then((()=>{if(!e)return Promise.resolve();const{res:t,req:o={}}=e;if(!t)throw new Nn(void 0,"No response object",null,o,"NoResponseError");n="BROWSER"===On()&&"function"===typeof t.clone?t.clone():t,n.useCache=t.useCache||!1;const{options:{responseType:r="json"}={}}=o;if("json"===r)return t.text().then((e=>{try{return JSON.parse(e)}catch(t){return e}}));try{return t[r]()}catch(e){throw new Nn(n,"responseType not support",null,o,"ParseError")}})).then((t=>{const{req:o={}}=e,{options:{cacheType:r,ttl:i,validateStatus:s=e=>e>=200&&e<300}={}}=o;if(n){if(!s(n.status))throw new Nn(n,"http error",t,o,"HttpError");if("persist"===r)try{var a;null===e||void 0===e||null===(a=e.storage)||void 0===a||a.set(e.cacheKey,{data:t},i)}catch(e){}e.finalResult={data:t,response:n}}})).catch((t=>{if(t instanceof Tn||t instanceof Nn)throw t;const{req:n,res:o}=e;throw t.request=t.request||n,t.response=t.response||o,t.type=t.type||t.name,t.data=t.data||void 0,t}))}function xn(e,t){if(!e)return t();const{req:{options:n={},url:o=""}={}}=e,{params:r}=n;return n.method=n.method?n.method.toUpperCase():"GET",n.credentials=n.credentials||"same-origin",r&&(e.req.originUrl=o,e.req.url=Object.entries(r).reduce(((e,[t,n])=>{const o=`${t}=${n}`;return e.indexOf("?")>-1?`${e}&${o}`:`${e}?${o}`}),o)),e.req.options=n,t()}function Dn(e,t){if(!e)return t();const{req:{options:n={}}={}}=e,{method:o="get"}=n;if(!["post","put","patch","delete"].includes(o.toLowerCase()))return t();const{requestType:r="json",data:i}=n;if(i){const e=Object.prototype.toString.call(i);"[object Object]"===e||"[object Array]"===e?"json"===r&&(n.headers={Accept:"application/json","Content-Type":"application/json;charset=UTF-8",...n.headers},n.body=JSON.stringify(i)):(n.headers={Accept:"application/json",...n.headers},n.body=i)}return e.req.options=n,t()}const Cn=class{constructor(e={},t={}){this.defaultOpts=e,this.cache=t.cache,this.storage=t.storage,this.interceptors={globalRequestMap:t.requestInterceptors||{},globalResponseMap:t.responseInterceptors||{},instanceRequest:t.instanceRequestInterceptors||[],instanceResponse:t.instanceResponseInterceptors||[]},this.onion=new Sn,this.onion.use(Dn),this.onion.use(xn),this.onion.use(Un),this.onion.use(Pn)}get(e,t={}){return this.fetch(e,{...t,method:"get"})}post(e,t={}){return this.fetch(e,{...t,method:"post"})}delete(e,t={}){return this.fetch(e,{...t,method:"delete"})}put(e,t={}){return this.fetch(e,{...t,method:"put"})}patch(e,t={}){return this.fetch(e,{...t,method:"patch"})}fetch(e,t={}){const n={...this.defaultOpts,...t,headers:{...this.defaultOpts.headers,...t.headers}},{data:o,params:r,method:i,rewriteCacheKey:s}=t,a=s?s(e):e,l=JSON.stringify({url:a,params:r,method:i,data:o}),c={req:{url:e,options:n},res:null,cache:this.cache,storage:this.storage,cacheKey:l,interceptors:this.interceptors,operations:{clearCache:()=>function(e){e.clear&&e.clear()}(this.cache),clearOneCache:()=>this.cache.clearOneCache(l),clearStorage:()=>this.storage.delete(l)}};return new Promise(((e,n)=>{if(null!==t&&void 0!==t&&t.useCache&&"persist"===(null===t||void 0===t?void 0:t.cacheType)&&this.storage.get(l)){const t=this.storage.get(l);e(t)}else this.onion.execute(c).then((()=>e(c.finalResult))).catch((t=>{const{errorHandler:o}=c.req.options;if(o)try{const n=o(t);e(n)}catch(e){n(e)}n(t)}))}))}};class $n{max_cache_size=4718592;isOverflowSize(){try{let t=0;for(let n=0;nthis.max_cache_size}catch(e){return!1}}get=e=>{if(window.localStorage)try{const t=localStorage.getItem(e)||"{}",{expireAt:n,data:o}=JSON.parse(t);if(!o)return null;return Date.now()<=n?o:(this.delete(e),null)}catch(e){return null}return null};set(e,t,n=6e4){try{if(this.isOverflowSize()||!window.localStorage)return;const o=Date.now();localStorage.setItem(e,JSON.stringify({expireAt:o+n,data:t}))}catch(e){}}delete=e=>{window.localStorage&&localStorage.removeItem(e)}}class Mn{constructor(e){this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[],e&&e.rewriteCacheKey&&delete e.rewriteCacheKey,this.fetch=new Cn(e,{cache:Mn.cache,storage:Mn.storage,requestInterceptors:Mn.requestInterceptors,responseInterceptors:Mn.responseInterceptors,instanceRequestInterceptors:this.instanceRequestInterceptors,instanceResponseInterceptors:this.instanceResponseInterceptors})}static storage=new $n;static cache=new En;static version="2.0.0";static requestInterceptors={};static responseInterceptors={};static getGlobalSharableEntry=()=>{const e=qn(Mn.version);return jn().SharedUniRequest[e]};static addGlobalRequestInterceptors(e){Object.entries(e).forEach((([e,t])=>{Array.isArray(Mn.requestInterceptors[e])||(Mn.requestInterceptors[e]=[]),t.forEach((t=>Mn.requestInterceptors[e].push(t)))}))}static addGlobalResponseInterceptors(e){Object.entries(e).forEach((([e,t])=>{Array.isArray(Mn.responseInterceptors[e])||(Mn.responseInterceptors[e]=[]),t.forEach((t=>Mn.responseInterceptors[e].push(t)))}))}addInstanceRequestInterceptors(e){e.forEach((e=>this.instanceRequestInterceptors.push(e)))}addInstanceResponseInterceptors(e){e.forEach((e=>this.instanceResponseInterceptors.push(e)))}request(e,t={}){return this.fetch.get(e,t)}get(e,t={}){return this.fetch.get(e,t)}post(e,t={}){return this.fetch.post(e,t)}patch(e,t={}){return this.fetch.patch(e,t)}put(e,t={}){return this.fetch.put(e,t)}delete(e,t={}){return this.fetch.delete(e,t)}freezeCacheDeletion(e={}){this.fetch.cache.freezeCacheDeletion(e)}}function jn(){return"undefined"!==typeof window?window:n.g}function qn(e){return e.split(".")[0]||"0"}const Fn=qn(Mn.version),Gn=jn();Gn.SharedUniRequest||(Gn.SharedUniRequest={}),Gn.SharedUniRequest[Fn]||(Gn.SharedUniRequest[Fn]={cache:new En,requestInterceptors:{},responseInterceptors:{}}),Mn.cache=Gn.SharedUniRequest[Fn].cache,Mn.requestInterceptors=Gn.SharedUniRequest[Fn].requestInterceptors,Mn.responseInterceptors=Gn.SharedUniRequest[Fn].responseInterceptors;const Bn=Mn,Hn=new Bn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"}});Hn.addInstanceResponseInterceptors([async(e,t,n)=>{try{const t=e.clone(),i=await t.json();if(!i)return;const{ret_code:s}=i;var o,r;if([10007,33003,10009].includes(s))null!==(o=e.url)&&void 0!==o&&null!==(r=o.includes)&&void 0!==r&&r.call(o,"/v2/private/user/profile")||n.clearOneCache();return e}catch(e){return e}}]);const Kn=Hn,Vn=Ie?cn:"undefined"!==typeof window&&localStorage.getItem("complianceSDKApi2Host")||cn,zn="REGULATION_RESTRICT_OPERATE",Jn=async()=>{try{let t=(()=>{const e=localStorage.getItem(zn);if(e)try{const{expiredTime:t,restrictOperate:n}=JSON.parse(e);if(Date.now()<=t)return n}catch(e){}return null})();if(null===t){var e;const{data:n}=await(async()=>Kn.get(`${Vn}/compliance/v1/wall/regulation-info`,{useCache:!0}))();t=null===n||void 0===n||null===(e=n.result)||void 0===e?void 0:e.restrictOperate,(e=>{const t=Date.now()+1e4;localStorage.setItem(zn,JSON.stringify({restrictOperate:e,expiredTime:t}))})(t)}return t?"EEA":""}catch(e){return null}},Wn=`https://www.${P}.com`,Zn=`https://www.${J}`,Yn=`https://www.${V}`,Qn=`https://www.${z}`,Xn=`https://www.${ee}`,eo=`https://www.${Y}`,to=`https://www.${re}`,no=`https://www.${ie}`,oo=`https://www.${ne}`,ro=[{domain:ae,locale:"en",hreflang:"x-default"},{domain:ae,locale:"en",hreflang:"en"},{domain:ae,locale:"fr-FR",hreflang:"fr"},{domain:ae,locale:"es-ES",hreflang:"es-ES"},{domain:ae,locale:"es-MX",hreflang:"es-MX"},{domain:ae,locale:"es-AR",hreflang:"es-AR"},{domain:ae,locale:"pt-BR",hreflang:"pt-BR"},{domain:ae,locale:"pt-PT",hreflang:"pt-PT"},{domain:ae,locale:"vi-VN",hreflang:"vi-VN"},{domain:ae,locale:"ja-JP",hreflang:"ja-JP"},{domain:ae,locale:"zh-TW",hreflang:"zh-TW"},{domain:ae,locale:"ru-RU",hreflang:"ru-RU"},{domain:ae,locale:"uk-UA",hreflang:"uk-UA"},{domain:ae,locale:"ar-SA",hreflang:"ar-SA"},{domain:ae,locale:"en-GB",hreflang:"en-GB"},{domain:Wn,locale:"zh-MY",hreflang:"zh-MY"},{domain:Wn,locale:"en",hreflang:"en-MY"},{domain:`https://www.${L}-global.com`,locale:"id-ID",hreflang:"id-ID"}],io=[{domain:Zn,locale:"tr-TUR",hreflang:"tr-TR"},{domain:Zn,locale:"en-TR",hreflang:"en-TR"}],so=[{domain:Qn,locale:"kk-KAZ",hreflang:"kk-KZ"},{domain:Qn,locale:"en-KAZ",hreflang:"en-KZ"},{domain:Qn,locale:"ru-KAZ",hreflang:"ru-KZ"}],ao=[{domain:Yn,locale:"de-EU",hreflang:"de"},{domain:Yn,locale:"es-EU",hreflang:"es"},{domain:Yn,locale:"pt-EU",hreflang:"pt"},{domain:Yn,locale:"pl-EU",hreflang:"pl"},{domain:Yn,locale:"ro-EU",hreflang:"ro"},{domain:Yn,locale:"it-EU",hreflang:"it"},{domain:Yn,locale:"fr-EU",hreflang:"fr-FR"},{domain:Yn,locale:"nl-EU",hreflang:"nl"},{domain:Yn,locale:"en-EU",hreflang:"en-DE"},{domain:Yn,locale:"en-EU",hreflang:"en-ES"},{domain:Yn,locale:"en-EU",hreflang:"en-FR"},{domain:Yn,locale:"en-EU",hreflang:"en-IT"},{domain:Yn,locale:"en-EU",hreflang:"en-PL"},{domain:Yn,locale:"en-EU",hreflang:"en-PT"},{domain:Yn,locale:"en-EU",hreflang:"en-RO"},{domain:Yn,locale:"en-EU",hreflang:"en-AT"},{domain:Yn,locale:"en-EU",hreflang:"en-SE"},{domain:Yn,locale:"en-EU",hreflang:"en-FI"},{domain:Yn,locale:"cs-EU",hreflang:"cs"},{domain:Yn,locale:"hu-EU",hreflang:"hu"},{domain:Yn,locale:"lt-EU",hreflang:"lt"},{domain:Yn,locale:"el-EU",hreflang:"el"},{domain:Yn,locale:"en-EU",hreflang:"en-CZ"},{domain:Yn,locale:"en-EU",hreflang:"en-GR"},{domain:Yn,locale:"en-EU",hreflang:"en-LT"},{domain:Yn,locale:"en-EU",hreflang:"en-HU"},{domain:Yn,locale:"fi-EU",hreflang:"fi"},{domain:Yn,locale:"sv-EU",hreflang:"sv"},{domain:Yn,locale:"da-EU",hreflang:"da"},{domain:Yn,locale:"no-EU",hreflang:"no"}],lo=[{domain:Xn,locale:"en-GEO",hreflang:"en-GE"},{domain:Xn,locale:"ru-GEO",hreflang:"ru-GE"},{domain:Xn,locale:"ka-GEO",hreflang:"ka-GE"}],co=[{domain:eo,locale:"id-IDN",hreflang:"id-ID"},{domain:eo,locale:"en-IDN",hreflang:"en-ID"}],uo=[{domain:to,locale:"en-USA",hreflang:"x-default"},{domain:to,locale:"en-USA",hreflang:"en-US"}],ho=[{domain:no,locale:"en-THA",hreflang:"x-default"},{domain:no,locale:"en-THA",hreflang:"en-TH"},{domain:no,locale:"th-THA",hreflang:"th-TH"}],po=[{domain:oo,locale:"ja-JPN",hreflang:"x-default"},{domain:oo,locale:"en-JPN",hreflang:"en-JP"},{domain:oo,locale:"ja-JPN",hreflang:"ja-JP"}],go=[I,"EU","KAZ","GEO","TUR"],fo={[I]:ro,EU:ao,KAZ:so,GEO:lo,IDN:co,USA:uo,TUR:io,THA:ho,JPN:po};class mo{static getConfigs(e){return(Array.isArray(e)&&e.length>0?e:go).reduce(((e,t)=>e.concat(fo[null===t||void 0===t?void 0:t.toUpperCase()]||[])),[])}static isLocaleSegment(e){return e.match(/^(\/?([a-z]{2,3}-[A-Z]{2,3}|[a-z]{2}))?$/)}static processPath(e){const t=e.split("/").filter(Boolean);let n=-1;t.forEach(((e,t)=>{this.isLocaleSegment(e)&&(n=t)}));const o=e.endsWith("/");return{segments:t,localeIndex:n,hasTrailingSlash:o}}static generateUrl(e,t){const{segments:n,localeIndex:o,hasTrailingSlash:r}=t,i=[...n];return-1!==o?i[o]=e.locale:i.unshift(e.locale),`${e.domain}/${i.join("/")}${r?"/":""}`}static generateHreflangArray(e,t){const n=this.processPath(e),o=n.segments[n.localeIndex]||"en",r=Lr(o),i=["USA","THA","JPN"].includes(r)?[r]:t,s=this.getConfigs(i),a=null===s||void 0===s?void 0:s.filter((e=>e.locale===o));let l;if(a.length>0)[l]=a;else{l={domain:`https://www.${Te[r]||te}`,locale:o,hreflang:"en"}}const c=[...n.segments];-1!==n.localeIndex?c[n.localeIndex]=l.locale:c.unshift(l.locale);const u=`${l.domain}/${c.join("/")}${n.hasTrailingSlash?"/":""}`,d=s.map((e=>({href:this.generateUrl(e,n),hreflang:e.hreflang,isCanonical:!1})));return[{href:u,hreflang:"x-default",isCanonical:!0},...d]}static generateHreflangHtml(e){const t=e.find((e=>e.isCanonical)),n=e.filter((e=>!e.isCanonical)).map((({href:e,hreflang:t})=>``));return t?`\n${n.join("\n")}`:n.join("\n")}}const yo=e=>mo.getConfigs(e),vo=(e,t)=>mo.generateHreflangArray(e,t),bo=(e,t)=>mo.generateHreflangHtml(vo(e,t)),wo="LANG_KEY",Eo="_by_l_g_d",So="THEME_KEY",To="GA_UID_KEY";var No;const Oo={AJAX:"ajax",ACTION:"action",RESOURCE:"resource",AJAX_REQUEST:"ajax-request",REQUEST_ERROR:"request-error"},Ao={SC:"sc",EC:"ec"};let ko=null;var Lo,Io,Ro,_o,Po,Uo;"undefined"!==typeof window&&null!==(No=window)&&void 0!==No&&No.Monitor&&(ko=null===(Lo=window)||void 0===Lo||null===(Io=Lo.Monitor)||void 0===Io||null===(Ro=Io.getInstance)||void 0===Ro?void 0:Ro.call(Io,{appId:324}),null!==(_o=ko)&&void 0!==_o&&_o.initialized||null===(Po=ko)||void 0===Po||null===(Uo=Po.init)||void 0===Uo||Uo.call(Po,{name:"BY_GLOBALS",appId:324,traceWhiteList:["api2","x-api"],disableGlobalRequestProxy:!0,disableGlobalResourceProxy:!0}));const xo=e=>{var t,n;const o={r:"undefined"!==typeof window?window.location.href:"",t:Oo.ACTION,...e||{}};null===(t=ko)||void 0===t||null===(n=t.log)||void 0===n||n.call(t,o)},Do=(e="",t="LOCAL_VERSION")=>{xo({v:t,m:e,t:Oo.RESOURCE,ext:{m:"init_module"}})},Co=(e="",t="LOCAL_VERSION")=>{xo({v:t,m:e,t:Oo.RESOURCE,ext:{m:"init_component"}})},$o=I+"_LANG_KEY",Mo=I+"_THEME_KEY",jo=I+"_GA_UID",qo={[$o]:wo,[Mo]:So,[jo]:To},Fo=["setItem","getItem","removeItem"];function Go(e,t,n){if("undefined"!==typeof window)try{var o;xo({t:Oo.ACTION,m:"legacy_storage_interceptor",ext:{action:e,legacyKey:t,newKey:n,page:(null===(o=window.location)||void 0===o?void 0:o.href)||""}})}catch(e){}}let Bo=null,Ho=!1;if("undefined"!==typeof window&&"undefined"!==typeof localStorage&&window.Storage)try{Bo={setItem:window.Storage.prototype.setItem,getItem:window.Storage.prototype.getItem,removeItem:window.Storage.prototype.removeItem}}catch(Vc){console.error("[LocalStorage] Failed to capture native methods:",Vc)}function Ko(e,t,n,o,r){let i=t;-1!==t.indexOf(";")&&(i=escape(t));let s=`${e}=${i}`;if(n&&(s+=`; domain=${n}`),o&&(s+=`; path=${o}`),r>0){const e=new Date;e.setTime(e.getTime()+60*r*1e3),s+=`;expires=${e.toUTCString()}`}"undefined"!==typeof window&&(document.cookie=s)}function Vo(e){if("undefined"!==typeof window){const t=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return t?unescape(t[2]):null}return null}"undefined"!==typeof window&&"undefined"!==typeof localStorage&&(Bo&&Fo.forEach((e=>{try{null!==Bo.getItem.call(localStorage,e)&&Bo.removeItem.call(localStorage,e)}catch(e){}})),function(){if("undefined"===typeof window||!window.Storage||!Bo)return!1;try{const e=window.Storage;if(e.prototype.__lsInterceptorInstalled)return!0;const t=Bo.setItem,n=Bo.getItem,o=Bo.removeItem;return e.prototype.setItem=function(e,n){if(this!==window.localStorage)return t.call(this,e,n);if(Ho)return t.call(this,e,n);if(e in qo){Ho=!0;try{Go("set",e,qo[e])}finally{Ho=!1}}t.call(this,e,n)},e.prototype.getItem=function(e){if(this!==window.localStorage)return n.call(this,e);if(Ho)return n.call(this,e);if(e in qo){Ho=!0;try{Go("get",e,qo[e])}finally{Ho=!1}}return n.call(this,e)},e.prototype.removeItem=function(e){if(this!==window.localStorage)return o.call(this,e);o.call(this,e)},e.prototype.__lsInterceptorInstalled=!0,!0}catch(e){return console.error("[LocalStorage] Failed to install interceptor:",e),!1}}()&&function(){if(Bo)try{Object.keys(qo).forEach((e=>{null!==Bo.getItem.call(localStorage,e)&&Bo.removeItem.call(localStorage,e)}))}catch(e){console.error("[LocalStorage] Failed to cleanup legacy keys:",e)}}());const zo={set:(e,t)=>"undefined"!==typeof window&&window.localStorage?void 0===t?localStorage.removeItem(e):localStorage.setItem(e,t):null,setObject(e,t){return this.set(e,JSON.stringify(t))},get(e){if("undefined"!==typeof window&&window.localStorage)try{return localStorage.getItem(e)}catch(e){return null}return""},getObject(e){try{return JSON.parse(this.get(e))}catch(e){return{}}},remove(e){"undefined"!==typeof window&&window.localStorage&&localStorage.removeItem(e)}},Jo={set:(e,t)=>"undefined"!==typeof window&&window.sessionStorage?void 0===t?sessionStorage.removeItem(e):sessionStorage.setItem(e,t):null,setObject(e,t){return this.set(e,JSON.stringify(t))},get(e){if("undefined"!==typeof window&&window.sessionStorage)try{return sessionStorage.getItem(e)}catch(e){return null}return""},getObject(e){try{return JSON.parse(this.get(e))}catch(e){return{}}},remove(e){"undefined"!==typeof window&&window.sessionStorage&&sessionStorage.removeItem(e)}},Wo="GLOBAL_THEME_KEY",Zo="GLOBAL_SITE_KEY",Yo="TDID_V2_KEY",Qo={dark:`${nn}/asset/image/logo-white.svg`,light:`${nn}/asset/image/logo-dark.svg`},Xo=`${nn}/assets/image/d-${Xt}.png`,er={"en-US":"en",en:"en","zh-MY":"zh","ja-JP":"ja","ko-KR":"ko","ru-RU":"ru","vi-VN":"vi","zh-TW":"zh-tw","zh-HK":"zh-tw","en-HK":"en","es-ES":"es","pt-BR":"pt","fr-FR":"fr","id-ID":"id","uk-UA":"uk","kk-KZ":"kk","ar-SA":"ar","pt-PT":"pt","es-MX":"es","es-AR":"es","es-419":"es"},tr={"ro-RO":"ro","en-US":"en",en:"en","zh-MY":"zh","ja-JP":"ja","ko-KR":"ko","ru-RU":"ru","vi-VN":"vi","zh-TW":"zh_TW","zh-HK":"zh_TW","es-ES":"es","tr-TR":"tr","pt-BR":"pt","fr-FR":"fr","id-ID":"id_ID","uk-UA":"en","kk-KZ":"en","ar-SA":"ar","hi-IN":"en","pt-PT":"pt","es-MX":"es","es-AR":"es","es-419":"es"},nr=[{label:"English",lang:"EN",value:"en"},{label:"Bahasa Indonesia",lang:"ID",value:"id-ID"},{label:"Español (Internacional)",lang:"ES",value:"es-ES"},{label:"Español (México)",lang:"ES",value:"es-MX"},{label:"Español (Argentina)",lang:"ES",value:"es-AR"},{label:"қазақша",lang:"KK",value:"kk-KZ"},{label:"Français",lang:"FR",value:"fr-FR"},{label:"Português (Brasil)",lang:"BR",value:"pt-BR"},{label:"Português (Internacional)",lang:"PT",value:"pt-PT"},{label:"Русский",lang:"RU",value:"ru-RU"},{label:"Tiếng Việt",lang:"VI",value:"vi-VN"},{label:"Українська",lang:"UK",value:"uk-UA"},{label:"العربيه",lang:"AR",value:"ar-SA"},{label:"日本語",lang:"JA",value:"ja-JP"},{label:"简体中文 (马来西亚)",lang:"ZH",value:"zh-MY"},{label:"繁體中文",lang:"ZH",value:"zh-TW"}],or=[{label:"English (Great Britain)",lang:"EN",value:"en-GB"}],rr=[{label:"Polski",lang:"PL",value:"pl-PL"},{label:"Românǎ",lang:"RO",value:"ro-RO"}],ir=[...nr,...or,...rr];let sr=nr;const ar=[{label:"繁體中文 (香港)",lang:"ZH",value:"zh-HK"},{label:"English(Hong Kong)",lang:"EN",value:"en-HK"}],lr=[{label:"Dutch",lang:"NL",value:"nl-NL"},{label:"English (Netherlands)",lang:"EN",value:"en-NL"}],cr=[{label:"Türkçe",lang:"TR",value:"tr-TUR"},{label:"English (Türkiye)",lang:"EN",value:"en-TR"}],ur=[{label:"Русский (Казахстан)",lang:"RU",value:"ru-KAZ"},{label:"Қазақша (Қазақстан)",lang:"KK",value:"kk-KAZ"},{label:"English (Kazakhstan)",lang:"EN",value:"en-KAZ"}],dr=[{label:"English",lang:"EN",value:"en-EU"},{label:"Čeština",lang:"CS",value:"cs-EU"},{label:"Dansk",lang:"DA",value:"da-EU"},{label:"Deutsch",lang:"DE",value:"de-EU"},{label:"Español",lang:"ES",value:"es-EU"},{label:"Ελληνικά",lang:"EL",value:"el-EU"},{label:"Français",lang:"FR",value:"fr-EU"},{label:"Italiano",lang:"IT",value:"it-EU"},{label:"Lietuvių",lang:"LT",value:"lt-EU"},{label:"Magyar",lang:"HU",value:"hu-EU"},{label:"Nederlands",lang:"NL",value:"nl-EU"},{label:"Norsk",lang:"NO",value:"no-EU"},{label:"Polski",lang:"PL",value:"pl-EU"},{label:"Português",lang:"PT",value:"pt-EU"},{label:"Română",lang:"RO",value:"ro-EU"},{label:"Suomi",lang:"FI",value:"fi-EU"},{label:"Svenska",lang:"SV",value:"sv-EU"}],hr=[{label:"ქართული (საქართველო)",lang:"KA",value:"ka-GEO"},{label:"Русский (Грузия)",lang:"RU",value:"ru-GEO"},{label:"English (Georgia)",lang:"EN",value:"en-GEO"}],pr=[{label:"Bahasa Indonesia",lang:"ID",value:"id-IDN"},{label:"English (Indonesia)",lang:"EN",value:"en-IDN"}],gr=[{label:"English (UAE)",lang:"EN",value:"en-ARE"},{label:"العربيه",lang:"AR",value:"ar-ARE"}],fr=[{label:"日本語",lang:"JA",value:"ja-JPN"},{label:"English (Japan)",lang:"EN",value:"en-JPN"}],mr=[{label:"English",lang:"EN",value:"en-USA"}],yr=[{label:"Thai",lang:"TH",value:"th-THA"},{label:"English",lang:"EN",value:"en-THA"}],vr=[...ir,...ar,...cr,...ur,...lr,...dr,...hr,...pr,...gr,...mr,...yr,...fr],br={[I]:ir,HKG:ar,TUR:cr,KAZ:ur,NLD:lr,EU:dr,GEO:hr,IDN:pr,ARE:gr,USA:mr,THA:yr,JPN:fr},wr={[I]:"en",HKG:"zh-HK",TUR:"tr-TUR",KAZ:"kk-KAZ",NLD:"nl-NL",EU:"en-EU",GEO:"en-GEO",IDN:"id-IDN",ARE:"en-ARE",USA:"en-USA",THA:"th-THA",JPN:"ja-JPN"};let Er="en";Er=wr[st]||"en";let Sr=br[st];st===I&&(Sr=nr),Sr&&(sr=Sr);const Tr=br[st];const Nr=e=>{"undefined"!==typeof window&&zo.set(wo,e)},Or=()=>{var e,t;if("undefined"===typeof window)return Er;let n=zo.get(wo)||(null===(e=navigator)||void 0===e?void 0:e.language);["ko-KR","zh-CN"].includes(n)&&(n="en");const o=(Tr||[]).find((e=>e.value===n));return n=null!==(t=null===o||void 0===o?void 0:o.value)&&void 0!==t?t:Er,n},Ar=()=>{if("undefined"===typeof window)return null;const e=Vo(_e?"b_l_a_k":"b_l_a_k_testnet");return e&&""!==e.trim()?e:null},kr=e=>sr.find((t=>e===t.value))?e:Er,Lr=e=>((e,t)=>{const n=Object.entries(t).find((([t,n])=>n.some((t=>t.value===e))));return n?n[0]:I})(e,br),Ir=[{hostname:[Te.NLD],siteId:"NLD"},{hostname:[Te.ARE],siteId:"ARE"},{hostname:[Te.HKG],siteId:"HKG"},{hostname:[Te.TUR_OLD,Te.TUR],siteId:"TUR"},{hostname:[Te.KAZ],siteId:"KAZ"},{hostname:[Te.EU],siteId:"EU"},{hostname:[Te.GEO],siteId:"GEO"},{hostname:[Te.IDN],siteId:"IDN"},{hostname:[Te.JPN_OLD,Te.JPN],siteId:"JPN"},{hostname:[Te.USA],siteId:"USA"},{hostname:[Te.THA],siteId:"THA"}],Rr=["ar-SA","ar-ARE"],_r=`REG_REF_${Ze}`,Pr={[I]:le,USA:ce,EU:ue,TUR:de,THA:he,JPN:pe},Ur=e=>Pr[e||st]||le,xr={[I]:"GTM-PMHBL76",USA:"GTM-TT967TJN"},Dr={[I]:"GTM-NN3QBWC",USA:"GTM-TT967TJN"},Cr=xr[st]||xr[I],$r=Dr[st]||Dr[I];class Mr{constructor(e){this.version="__COMPLIANCE_SDK_VERSION__",this.initialConfig=Se(e,{siteId:st}),this.latestConfig={},this.subscribers=[],this.profileReady=!1,this.regulationReady=!1,this.needAccount=!1,this.filtersParams={account:"",regulationCountry:""},this.regulatedSiteHosts=st,this.config=e,this.parseConfig=Se,"undefined"!==typeof window&&Jn().then((e=>{this.setRegulationCountry(e)}))}setAccount(e){const t=String(e);t&&(this.filtersParams.account=t,this.profileReady=!0,this.updateLatestConfig())}setRegulationCountry(e){this.filtersParams.regulationCountry=e||"",this.regulationReady=!0,this.updateLatestConfig((e=>{this.initialConfig=e}))}setNeedAccount(e){this.needAccount=e}updateLatestConfig(e){const t=this.latestConfig,n=this.parseConfig(this.config,{siteId:this.regulatedSiteHosts,...this.filtersParams});((e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]&&e[t].action===n.action&&e[t].ext===n.ext)))(t,n)||(this.latestConfig=n,null===e||void 0===e||e(n),this.publish())}subscribe(e){return"function"===typeof e&&(this.needAccount&&!this.profileReady||!this.regulationReady||e(this.latestConfig),this.subscribers.push(e)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter((t=>t!==e))}publish(){this.subscribers.forEach((e=>e(this.latestConfig)))}injectConfig(e){this.config=e,this.updateLatestConfig()}}"undefined"!==typeof window&&(window.RegulatedSiteHosts=st,window.ByComplianceConfig=Mr,window.PlatformSupportedLanguage=Tr);const jr="undefined"!==typeof window?new Bn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"},timeout:1e4}):{};"undefined"!==typeof window&&jr.freezeCacheDeletion({"/brief-symbol-list":"manual"});let qr={domain:"",weight:0};function Fr(e={}){const t=Object.keys(e).reduce(((t,n)=>({...t,[n]:e[n].reduce(((e,t)=>({factor:e.factor-.03,weight:e.weight+t*e.factor})),{factor:.1,weight:0}).weight})),{}),n=Object.keys(t).reduce(((e,n)=>e.domain?e.weight>t[n]?{domain:n,weight:t[n]}:e:{domain:n,weight:t[n]}),{domain:"",weight:0});if("undefined"!==typeof window&&window&&window.$_router_info&&n.domain,!qr.domain)return qr=n,n;if(qr.domain&&qr.domain!==n.domain){if(qr.weight-n.weight>5)return qr=n,n;const e=t[qr.domain];return e-n.weight>25||e-qr.weight>30?(qr=n,n):qr}return qr.weight>n.weight&&(qr=n),qr}const Gr=k(),Br=e=>{const t=e.filter((({domain:e})=>"auto"!==e)).map((e=>((e,t)=>{const n=performance.now();return Gr.get(`${e}/t1`).then((()=>{const e=performance.now();return{domain:t,span:e-n}})).catch((()=>({domain:t,span:15e3})))})(e.api2,e.domain)));return Promise.all(t)},Hr="by_route_record",Kr=Jo.getObject(Hr)||{},Vr=e=>[`${an}//${Re?Yt.replace("-","-1-"):Yt.replace(".","-1.")}${e.trim()}`,`${an}//${Re?Yt.replace("-","-2-"):Yt.replace(".","-2.")}${e.trim()}`],zr=e=>[`${ln}//${Re?Qt.replace("-","-1-"):Qt.replace(".","-1.")}${e.trim()}`,`${ln}//${Re?Qt.replace("-","-2-"):Qt.replace(".","-2.")}${e.trim()}`],Jr=[{domain:Kt,api2:cn,ws2:un},{domain:`${Kt}@1`,api2:Vr(Kt)[0],ws2:zr(Kt)[0]},{domain:`${Kt}@2`,api2:Vr(Kt)[1],ws2:zr(Kt)[1]},{domain:"auto"}],Wr={API2_HOST:cn,WS2_HOST:un};let Zr=cn,Yr=un;const Qr=e=>{const t=Jr.findIndex((({domain:t})=>t===e)),n=t>-1,o=Jr[0];return{idx:n?t:0,item:n?Jr[t]:o}},Xr=[];let ei="";const ti=e=>{if(ei&&ei===e)return;ei=e;const{item:t}=Qr(e);t.api2&&(Zr=t.api2),t.ws2&&(Yr=t.ws2),Xr.forEach((e=>e(t)))};let ni=!1;const oi=()=>{setInterval((()=>{var e;ni||document&&document.hidden||(ni=!0,(e=Jr,Br(e).then(((e=[])=>e.every((({span:e})=>-1===e))?"":(e.forEach((({domain:e,span:t})=>{const n=Kr[e];Kr[e]=n?[].concat(t,n).slice(0,3):[t,...new Array(2).fill(100)]})),Jo.setObject(Hr,Kr),Fr(Kr).domain)))).then(ti).finally((()=>{ni=!1})))}),3e4)},ri="route_chosen_v2",ii=zo.get(ri);"auto"===ii?(ti(0===Object.keys(Kr).length?Kt:Fr(Kr).domain),oi()):ii&&!ii.includes(Kt)?(zo.remove(ri),ti(null)):ti(ii),Object.defineProperties(Wr,{API2_HOST:{get:()=>"/x-api"},WS2_HOST:{get:()=>Yr}});const si=()=>({API2_HOST:"/x-api",WS2_HOST:Yr}),ai=ii?Qr(ii):{idx:3,item:Jr[3]}; /*! * decimal.js v10.5.0 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2025 Michael Mclaughlin * MIT Licence */ var li,ci,ui=9e15,di=1e9,hi="0123456789abcdef",pi="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",gi="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",fi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ui,maxE:ui,crypto:!1},mi=!0,yi="[DecimalError] ",vi=yi+"Invalid argument: ",bi=yi+"Precision limit exceeded",wi=yi+"crypto unavailable",Ei="[object Decimal]",Si=Math.floor,Ti=Math.pow,Ni=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Oi=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ai=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ki=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Li=1e7,Ii=pi.length-1,Ri=gi.length-1,_i={toStringTag:Ei};function Pi(e){var t,n,o,r=e.length-1,i="",s=e[0];if(r>0){for(i+=s,t=1;tn)throw Error(vi+e)}function xi(e,t,n,o){var r,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=7,r=0):(r=Math.ceil((t+1)/7),t%=7),i=Ti(10,7-t),a=e[r]%i|0,null==o?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==i||n>3&&a+1==i/2)&&(e[r+1]/i/100|0)==Ti(10,t-2)-1||(a==i/2||0==a)&&0==(e[r+1]/i/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(o||n<4)&&9999==a||!o&&n>3&&4999==a):s=((o||n<4)&&a+1==i||!o&&n>3&&a+1==i/2)&&(e[r+1]/i/1e3|0)==Ti(10,t-3)-1,s}function Di(e,t,n){for(var o,r,i=[0],s=0,a=e.length;sn-1&&(void 0===i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/n|0,i[o]%=n)}return i.reverse()}_i.absoluteValue=_i.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),$i(e)},_i.ceil=function(){return $i(new this.constructor(this),this.e+1,2)},_i.clampedTo=_i.clamp=function(e,t){var n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(vi+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new o(n)},_i.comparedTo=_i.cmp=function(e){var t,n,o,r,i=this,s=i.d,a=(e=new i.constructor(e)).d,l=i.s,c=e.s;if(!s||!a)return l&&c?l!==c?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-c:0;if(l!==c)return l;if(i.e!==e.e)return i.e>e.e^l<0?1:-1;for(t=0,n=(o=s.length)<(r=a.length)?o:r;ta[t]^l<0?1:-1;return o===r?0:o>r^l<0?1:-1},_i.cosine=_i.cos=function(){var e,t,n=this,o=n.constructor;return n.d?n.d[0]?(e=o.precision,t=o.rounding,o.precision=e+Math.max(n.e,n.sd())+7,o.rounding=1,n=function(e,t){var n,o,r;if(t.isZero())return t;o=t.d.length,o<32?r=(1/Xi(4,n=Math.ceil(o/3))).toString():(n=16,r="2.3283064365386962890625e-10");e.precision+=n,t=Qi(e,1,t.times(r),new e(1));for(var i=n;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}(o,es(o,n)),o.precision=e,o.rounding=t,$i(2==ci||3==ci?n.neg():n,e,t,!0)):new o(1):new o(NaN)},_i.cubeRoot=_i.cbrt=function(){var e,t,n,o,r,i,s,a,l,c,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(mi=!1,(i=u.s*Ti(u.s*u,1/3))&&Math.abs(i)!=1/0?o=new d(i.toString()):(n=Pi(u.d),(i=((e=u.e)-n.length+1)%3)&&(n+=1==i||-2==i?"0":"00"),i=Ti(n,1/3),e=Si((e+1)/3)-(e%3==(e<0?-1:2)),(o=new d(n=i==1/0?"5e"+e:(n=i.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),s=(e=d.precision)+3;;)if(c=(l=(a=o).times(a).times(a)).plus(u),o=Ci(c.plus(u).times(a),c.plus(l),s+2,1),Pi(a.d).slice(0,s)===(n=Pi(o.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||($i(o,e+1,1),t=!o.times(o).times(o).eq(u));break}if(!r&&($i(a,e+1,0),a.times(a).times(a).eq(u))){o=a;break}s+=4,r=1}return mi=!0,$i(o,e,d.rounding,t)},_i.decimalPlaces=_i.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-Si(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},_i.dividedBy=_i.div=function(e){return Ci(this,new this.constructor(e))},_i.dividedToIntegerBy=_i.divToInt=function(e){var t=this.constructor;return $i(Ci(this,new t(e),0,1,1),t.precision,t.rounding)},_i.equals=_i.eq=function(e){return 0===this.cmp(e)},_i.floor=function(){return $i(new this.constructor(this),this.e+1,3)},_i.greaterThan=_i.gt=function(e){return this.cmp(e)>0},_i.greaterThanOrEqualTo=_i.gte=function(e){var t=this.cmp(e);return 1==t||0===t},_i.hyperbolicCosine=_i.cosh=function(){var e,t,n,o,r,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;n=s.precision,o=s.rounding,s.precision=n+Math.max(i.e,i.sd())+4,s.rounding=1,(r=i.d.length)<32?t=(1/Xi(4,e=Math.ceil(r/3))).toString():(e=16,t="2.3283064365386962890625e-10"),i=Qi(s,1,i.times(t),new s(1),!0);for(var l,c=e,u=new s(8);c--;)l=i.times(i),i=a.minus(l.times(u.minus(l.times(u))));return $i(i,s.precision=n,s.rounding=o,!0)},_i.hyperbolicSine=_i.sinh=function(){var e,t,n,o,r=this,i=r.constructor;if(!r.isFinite()||r.isZero())return new i(r);if(t=i.precision,n=i.rounding,i.precision=t+Math.max(r.e,r.sd())+4,i.rounding=1,(o=r.d.length)<3)r=Qi(i,2,r,r,!0);else{e=(e=1.4*Math.sqrt(o))>16?16:0|e,r=Qi(i,2,r=r.times(1/Xi(5,e)),r,!0);for(var s,a=new i(5),l=new i(16),c=new i(20);e--;)s=r.times(r),r=r.times(a.plus(s.times(l.times(s).plus(c))))}return i.precision=t,i.rounding=n,$i(r,t,n,!0)},_i.hyperbolicTangent=_i.tanh=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+7,o.rounding=1,Ci(n.sinh(),n.cosh(),o.precision=e,o.rounding=t)):new o(n.s)},_i.inverseCosine=_i.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),o=t.precision,r=t.rounding;return-1!==n?0===n?e.isNeg()?Fi(t,o,r):new t(0):new t(NaN):e.isZero()?Fi(t,o+4,r).times(.5):(t.precision=o+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=o,t.rounding=r,e.times(2))},_i.inverseHyperbolicCosine=_i.acosh=function(){var e,t,n=this,o=n.constructor;return n.lte(1)?new o(n.eq(1)?0:NaN):n.isFinite()?(e=o.precision,t=o.rounding,o.precision=e+Math.max(Math.abs(n.e),n.sd())+4,o.rounding=1,mi=!1,n=n.times(n).minus(1).sqrt().plus(n),mi=!0,o.precision=e,o.rounding=t,n.ln()):new o(n)},_i.inverseHyperbolicSine=_i.asinh=function(){var e,t,n=this,o=n.constructor;return!n.isFinite()||n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,o.rounding=1,mi=!1,n=n.times(n).plus(1).sqrt().plus(n),mi=!0,o.precision=e,o.rounding=t,n.ln())},_i.inverseHyperbolicTangent=_i.atanh=function(){var e,t,n,o,r=this,i=r.constructor;return r.isFinite()?r.e>=0?new i(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=i.precision,t=i.rounding,o=r.sd(),Math.max(o,e)<2*-r.e-1?$i(new i(r),e,t,!0):(i.precision=n=o-r.e,r=Ci(r.plus(1),new i(1).minus(r),n+e,1),i.precision=e+4,i.rounding=1,r=r.ln(),i.precision=e,i.rounding=t,r.times(.5))):new i(NaN)},_i.inverseSine=_i.asin=function(){var e,t,n,o,r=this,i=r.constructor;return r.isZero()?new i(r):(t=r.abs().cmp(1),n=i.precision,o=i.rounding,-1!==t?0===t?((e=Fi(i,n+4,o).times(.5)).s=r.s,e):new i(NaN):(i.precision=n+6,i.rounding=1,r=r.div(new i(1).minus(r.times(r)).sqrt().plus(1)).atan(),i.precision=n,i.rounding=o,r.times(2)))},_i.inverseTangent=_i.atan=function(){var e,t,n,o,r,i,s,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&d+4<=Ri)return(s=Fi(u,d+4,h).times(.25)).s=c.s,s}else{if(!c.s)return new u(NaN);if(d+4<=Ri)return(s=Fi(u,d+4,h).times(.5)).s=c.s,s}for(u.precision=a=d+10,u.rounding=1,e=n=Math.min(28,a/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(mi=!1,t=Math.ceil(a/7),o=1,l=c.times(c),s=new u(c),r=c;-1!==e;)if(r=r.times(l),i=s.minus(r.div(o+=2)),r=r.times(l),void 0!==(s=i.plus(r.div(o+=2))).d[t])for(e=t;s.d[e]===i.d[e]&&e--;);return n&&(s=s.times(2<this.d.length-2},_i.isNaN=function(){return!this.s},_i.isNegative=_i.isNeg=function(){return this.s<0},_i.isPositive=_i.isPos=function(){return this.s>0},_i.isZero=function(){return!!this.d&&0===this.d[0]},_i.lessThan=_i.lt=function(e){return this.cmp(e)<0},_i.lessThanOrEqualTo=_i.lte=function(e){return this.cmp(e)<1},_i.logarithm=_i.log=function(e){var t,n,o,r,i,s,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(r=n[0];r%10===0;)r/=10;i=1!==r}if(mi=!1,s=Ji(c,a=d+5),o=t?qi(u,a+10):Ji(e,a),xi((l=Ci(s,o,a,1)).d,r=d,h))do{if(s=Ji(c,a+=10),o=t?qi(u,a+10):Ji(e,a),l=Ci(s,o,a,1),!i){+Pi(l.d).slice(r+1,r+15)+1==1e14&&(l=$i(l,d+1,0));break}}while(xi(l.d,r+=10,h));return mi=!0,$i(l,d,h)},_i.minus=_i.sub=function(e){var t,n,o,r,i,s,a,l,c,u,d,h,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN):e=new g(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,h=e.d,a=g.precision,l=g.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!c[0])return new g(3===l?-0:0);e=new g(p)}return mi?$i(e,a,l):e}if(n=Si(e.e/7),u=Si(p.e/7),c=c.slice(),i=u-n){for((d=i<0)?(t=c,i=-i,s=h.length):(t=h,n=u,s=c.length),i>(o=Math.max(Math.ceil(a/7),s)+2)&&(i=o,t.length=1),t.reverse(),o=i;o--;)t.push(0);t.reverse()}else{for((d=(o=c.length)<(s=h.length))&&(s=o),o=0;o0;--o)c[s++]=0;for(o=h.length;o>i;){if(c[--o](s=(i=Math.ceil(a/7))>s?i+1:s+1)&&(r=s,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for((s=c.length)-(r=u.length)<0&&(r=s,n=u,u=c,c=n),t=0;r;)t=(c[--r]=c[r]+u[r]+t)/Li|0,c[r]%=Li;for(t&&(c.unshift(t),++o),s=c.length;0==c[--s];)c.pop();return e.d=c,e.e=ji(c,o),mi?$i(e,a,l):e},_i.precision=_i.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(vi+e);return n.d?(t=Gi(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},_i.round=function(){var e=this,t=e.constructor;return $i(new t(e),e.e+1,t.rounding)},_i.sine=_i.sin=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+Math.max(n.e,n.sd())+7,o.rounding=1,n=function(e,t){var n,o=t.d.length;if(o<3)return t.isZero()?t:Qi(e,2,t,t);n=(n=1.4*Math.sqrt(o))>16?16:0|n,t=t.times(1/Xi(5,n)),t=Qi(e,2,t,t);for(var r,i=new e(5),s=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(i.plus(r.times(s.times(r).minus(a))));return t}(o,es(o,n)),o.precision=e,o.rounding=t,$i(ci>2?n.neg():n,e,t,!0)):new o(NaN)},_i.squareRoot=_i.sqrt=function(){var e,t,n,o,r,i,s=this,a=s.d,l=s.e,c=s.s,u=s.constructor;if(1!==c||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(mi=!1,0==(c=Math.sqrt(+s))||c==1/0?(((t=Pi(a)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=Si((l+1)/2)-(l<0||l%2),o=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):o=new u(c.toString()),n=(l=u.precision)+3;;)if(o=(i=o).plus(Ci(s,i,n+2,1)).times(.5),Pi(i.d).slice(0,n)===(t=Pi(o.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($i(o,l+1,1),e=!o.times(o).eq(s));break}if(!r&&($i(i,l+1,0),i.times(i).eq(s))){o=i;break}n+=4,r=1}return mi=!0,$i(o,l,u.rounding,e)},_i.tangent=_i.tan=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+10,o.rounding=1,(n=n.sin()).s=1,n=Ci(n,new o(1).minus(n.times(n)).sqrt(),e+10,0),o.precision=e,o.rounding=t,$i(2==ci||4==ci?n.neg():n,e,t,!0)):new o(NaN)},_i.times=_i.mul=function(e){var t,n,o,r,i,s,a,l,c,u=this,d=u.constructor,h=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!h||!h[0]||!p||!p[0])return new d(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:h&&p?0*e.s:e.s/0);for(n=Si(u.e/7)+Si(e.e/7),(l=h.length)<(c=p.length)&&(i=h,h=p,p=i,s=l,l=c,c=s),i=[],o=s=l+c;o--;)i.push(0);for(o=c;--o>=0;){for(t=0,r=l+o;r>o;)a=i[r]+p[o]*h[r-o-1]+t,i[r--]=a%Li|0,t=a/Li|0;i[r]=(i[r]+t)%Li|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=ji(i,n),mi?$i(e,d.precision,d.rounding):e},_i.toBinary=function(e,t){return ts(this,2,e,t)},_i.toDecimalPlaces=_i.toDP=function(e,t){var n=this,o=n.constructor;return n=new o(n),void 0===e?n:(Ui(e,0,di),void 0===t?t=o.rounding:Ui(t,0,8),$i(n,e+n.e+1,t))},_i.toExponential=function(e,t){var n,o=this,r=o.constructor;return void 0===e?n=Mi(o,!0):(Ui(e,0,di),void 0===t?t=r.rounding:Ui(t,0,8),n=Mi(o=$i(new r(o),e+1,t),!0,e+1)),o.isNeg()&&!o.isZero()?"-"+n:n},_i.toFixed=function(e,t){var n,o,r=this,i=r.constructor;return void 0===e?n=Mi(r):(Ui(e,0,di),void 0===t?t=i.rounding:Ui(t,0,8),n=Mi(o=$i(new i(r),e+r.e+1,t),!1,e+o.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},_i.toFraction=function(e){var t,n,o,r,i,s,a,l,c,u,d,h,p=this,g=p.d,f=p.constructor;if(!g)return new f(p);if(c=n=new f(1),o=l=new f(0),s=(i=(t=new f(o)).e=Gi(g)-p.e-1)%7,t.d[0]=Ti(10,s<0?7+s:s),null==e)e=i>0?t:c;else{if(!(a=new f(e)).isInt()||a.lt(c))throw Error(vi+a);e=a.gt(t)?i>0?t:c:a}for(mi=!1,a=new f(Pi(g)),u=f.precision,f.precision=i=7*g.length*2;d=Ci(a,t,0,1,1),1!=(r=n.plus(d.times(o))).cmp(e);)n=o,o=r,r=c,c=l.plus(d.times(r)),l=r,r=t,t=a.minus(d.times(r)),a=r;return r=Ci(e.minus(n),o,0,1,1),l=l.plus(r.times(c)),n=n.plus(r.times(o)),l.s=c.s=p.s,h=Ci(c,o,i,1).minus(p).abs().cmp(Ci(l,n,i,1).minus(p).abs())<1?[c,o]:[l,n],f.precision=u,mi=!0,h},_i.toHexadecimal=_i.toHex=function(e,t){return ts(this,16,e,t)},_i.toNearest=function(e,t){var n=this,o=n.constructor;if(n=new o(n),null==e){if(!n.d)return n;e=new o(1),t=o.rounding}else{if(e=new o(e),void 0===t?t=o.rounding:Ui(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(mi=!1,n=Ci(n,e,0,t,1).times(e),mi=!0,$i(n)):(e.s=n.s,n=e),n},_i.toNumber=function(){return+this},_i.toOctal=function(e,t){return ts(this,8,e,t)},_i.toPower=_i.pow=function(e){var t,n,o,r,i,s,a=this,l=a.constructor,c=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Ti(+a,c));if((a=new l(a)).eq(1))return a;if(o=l.precision,i=l.rounding,e.eq(1))return $i(a,o,i);if((t=Si(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return r=Hi(l,a,n,o),e.s<0?new l(1).div(r):$i(r,o,i);if((s=a.s)<0){if(tl.maxE+1||t0?s/0:0):(mi=!1,l.rounding=a.s=1,n=Math.min(12,(t+"").length),(r=zi(e.times(Ji(a,o+n)),o)).d&&xi((r=$i(r,o+5,1)).d,o,i)&&(t=o+10,+Pi((r=$i(zi(e.times(Ji(a,t+n)),t),t+5,1)).d).slice(o+1,o+15)+1==1e14&&(r=$i(r,o+1,0))),r.s=s,mi=!0,l.rounding=i,$i(r,o,i))},_i.toPrecision=function(e,t){var n,o=this,r=o.constructor;return void 0===e?n=Mi(o,o.e<=r.toExpNeg||o.e>=r.toExpPos):(Ui(e,1,di),void 0===t?t=r.rounding:Ui(t,0,8),n=Mi(o=$i(new r(o),e,t),e<=o.e||o.e<=r.toExpNeg,e)),o.isNeg()&&!o.isZero()?"-"+n:n},_i.toSignificantDigits=_i.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(Ui(e,1,di),void 0===t?t=n.rounding:Ui(t,0,8)),$i(new n(this),e,t)},_i.toString=function(){var e=this,t=e.constructor,n=Mi(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},_i.truncated=_i.trunc=function(){return $i(new this.constructor(this),this.e+1,1)},_i.valueOf=_i.toJSON=function(){var e=this,t=e.constructor,n=Mi(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Ci=function(){function e(e,t,n){var o,r=0,i=e.length;for(e=e.slice();i--;)o=e[i]*t+r,e[i]=o%n|0,r=o/n|0;return r&&e.unshift(r),e}function t(e,t,n,o){var r,i;if(n!=o)i=n>o?1:-1;else for(r=i=0;rt[r]?1:-1;break}return i}function n(e,t,n,o){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(o,r,i,s,a,l){var c,u,d,h,p,g,f,m,y,v,b,w,E,S,T,N,O,A,k,L,I=o.constructor,R=o.s==r.s?1:-1,_=o.d,P=r.d;if(!_||!_[0]||!P||!P[0])return new I(o.s&&r.s&&(_?!P||_[0]!=P[0]:P)?_&&0==_[0]||!P?0*R:R/0:NaN);for(l?(p=1,u=o.e-r.e):(l=Li,p=7,u=Si(o.e/p)-Si(r.e/p)),k=P.length,O=_.length,v=(y=new I(R)).d=[],d=0;P[d]==(_[d]||0);d++);if(P[d]>(_[d]||0)&&u--,null==i?(S=i=I.precision,s=I.rounding):S=a?i+(o.e-r.e)+1:i,S<0)v.push(1),g=!0;else{if(S=S/p+2|0,d=0,1==k){for(h=0,P=P[0],S++;(d1&&(P=e(P,h,l),_=e(_,h,l),k=P.length,O=_.length),N=k,w=(b=_.slice(0,k)).length;w=l/2&&++A;do{h=0,(c=t(P,b,k,w))<0?(E=b[0],k!=w&&(E=E*l+(b[1]||0)),(h=E/A|0)>1?(h>=l&&(h=l-1),1==(c=t(f=e(P,h,l),b,m=f.length,w=b.length))&&(h--,n(f,k=10;h/=10)d++;y.e=d+u*p-1,$i(y,a?i+y.e+1:i,s,g)}return y}}();function $i(e,t,n,o){var r,i,s,a,l,c,u,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(r=1,a=d[0];a>=10;a/=10)r++;if((i=t-r)<0)i+=7,s=t,l=(u=d[h=0])/Ti(10,r-s-1)%10|0;else if((h=Math.ceil((i+1)/7))>=(a=d.length)){if(!o)break e;for(;a++<=h;)d.push(0);u=l=0,r=1,s=(i%=7)-7+1}else{for(u=a=d[h],r=1;a>=10;a/=10)r++;l=(s=(i%=7)-7+r)<0?0:u/Ti(10,r-s-1)%10|0}if(o=o||t<0||void 0!==d[h+1]||(s<0?u:u%Ti(10,r-s-1)),c=n<4?(l||o)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||o||6==n&&(i>0?s>0?u/Ti(10,r-s):0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=Ti(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=h,a=1,h--):(d.length=h+1,a=Ti(10,7-i),d[h]=s>0?(u/Ti(10,r-s)%Ti(10,s)|0)*a:0),c)for(;;){if(0==h){for(i=1,s=d[0];s>=10;s/=10)i++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,d[0]==Li&&(d[0]=1));break}if(d[h]+=a,d[h]!=Li)break;d[h--]=0,a=1}for(i=d.length;0===d[--i];)d.pop()}return mi&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+Bi(o):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):r<0?(i="0."+Bi(-r-1)+i,n&&(o=n-s)>0&&(i+=Bi(o))):r>=s?(i+=Bi(r+1-s),n&&(o=n-r-1)>0&&(i=i+"."+Bi(o))):((o=r+1)0&&(r+1===s&&(i+="."),i+=Bi(o))),i}function ji(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function qi(e,t,n){if(t>Ii)throw mi=!0,n&&(e.precision=n),Error(bi);return $i(new e(pi),t,1,!0)}function Fi(e,t,n){if(t>Ri)throw Error(bi);return $i(new e(gi),t,n,!0)}function Gi(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Bi(e){for(var t="";e--;)t+="0";return t}function Hi(e,t,n,o){var r,i=new e(1),s=Math.ceil(o/7+4);for(mi=!1;;){if(n%2&&ns((i=i.times(t)).d,s)&&(r=!0),0===(n=Si(n/2))){n=i.d.length-1,r&&0===i.d[n]&&++i.d[n];break}ns((t=t.times(t)).d,s)}return mi=!0,i}function Ki(e){return 1&e.d[e.d.length-1]}function Vi(e,t,n){for(var o,r,i=new e(t[0]),s=0;++s17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(mi=!1,l=g):l=t,a=new h(.03125);e.e>-2;)e=e.times(a),d+=5;for(l+=o=Math.log(Ti(2,d))/Math.LN10*2+5|0,n=i=s=new h(1),h.precision=l;;){if(i=$i(i.times(e),l,1),n=n.times(++u),Pi((a=s.plus(Ci(i,n,l,1))).d).slice(0,l)===Pi(s.d).slice(0,l)){for(r=d;r--;)s=$i(s.times(s),l,1);if(null!=t)return h.precision=g,s;if(!(c<3&&xi(s.d,l-o,p,c)))return $i(s,h.precision=g,p,mi=!0);h.precision=l+=10,n=i=a=new h(1),u=0,c++}s=a}}function Ji(e,t){var n,o,r,i,s,a,l,c,u,d,h,p=1,g=e,f=g.d,m=g.constructor,y=m.rounding,v=m.precision;if(g.s<0||!f||!f[0]||!g.e&&1==f[0]&&1==f.length)return new m(f&&!f[0]?-1/0:1!=g.s?NaN:f?0:g);if(null==t?(mi=!1,u=v):u=t,m.precision=u+=10,o=(n=Pi(f)).charAt(0),!(Math.abs(i=g.e)<15e14))return c=qi(m,u+2,v).times(i+""),g=Ji(new m(o+"."+n.slice(1)),u-10).plus(c),m.precision=v,null==t?$i(g,v,y,mi=!0):g;for(;o<7&&1!=o||1==o&&n.charAt(1)>3;)o=(n=Pi((g=g.times(e)).d)).charAt(0),p++;for(i=g.e,o>1?(g=new m("0."+n),i++):g=new m(o+"."+n.slice(1)),d=g,l=s=g=Ci(g.minus(1),g.plus(1),u,1),h=$i(g.times(g),u,1),r=3;;){if(s=$i(s.times(h),u,1),Pi((c=l.plus(Ci(s,new m(r),u,1))).d).slice(0,u)===Pi(l.d).slice(0,u)){if(l=l.times(2),0!==i&&(l=l.plus(qi(m,u+2,v).times(i+""))),l=Ci(l,new m(p),u,1),null!=t)return m.precision=v,l;if(!xi(l.d,u-10,y,a))return $i(l,m.precision=v,y,mi=!0);m.precision=u+=10,c=s=g=Ci(d.minus(1),d.plus(1),u,1),h=$i(g.times(g),u,1),r=a=1}l=c,r+=2}}function Wi(e){return String(e.s*e.s/0)}function Zi(e,t){var n,o,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(o=t.search(/e/i))>0?(n<0&&(n=o),n+=+t.slice(o+1),t=t.substring(0,o)):n<0&&(n=t.length),o=0;48===t.charCodeAt(o);o++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(o,r)){if(r-=o,e.e=n=n-o-1,e.d=[],o=(n+1)%7,n<0&&(o+=7),oe.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ki.test(t))return Zi(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Oi.test(t))n=16,t=t.toLowerCase();else if(Ni.test(t))n=2;else{if(!Ai.test(t))throw Error(vi+t);n=8}for((i=t.search(/p/i))>0?(l=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),s=(i=t.indexOf("."))>=0,o=e.constructor,s&&(i=(a=(t=t.replace(".","")).length)-i,r=Hi(o,new o(n),i,2*i)),i=u=(c=Di(t,n,Li)).length-1;0===c[i];--i)c.pop();return i<0?new o(0*e.s):(e.e=ji(c,u),e.d=c,mi=!1,s&&(e=Ci(e,r,4*a)),l&&(e=e.times(Math.abs(l)<54?Ti(2,l):Bs.pow(2,l))),mi=!0,e)}function Qi(e,t,n,o,r){var i,s,a,l,c=e.precision,u=Math.ceil(c/7);for(mi=!1,l=n.times(n),a=new e(o);;){if(s=Ci(a.times(l),new e(t++*t++),c,1),a=r?o.plus(s):o.minus(s),o=Ci(s.times(l),new e(t++*t++),c,1),void 0!==(s=a.plus(o)).d[u]){for(i=u;s.d[i]===a.d[i]&&i--;);if(-1==i)break}i=a,a=o,o=s,s=i}return mi=!0,s.d.length=u+1,s}function Xi(e,t){for(var n=e;--t;)n*=e;return n}function es(e,t){var n,o=t.s<0,r=Fi(e,e.precision,1),i=r.times(.5);if((t=t.abs()).lte(i))return ci=o?4:1,t;if((n=t.divToInt(r)).isZero())ci=o?3:2;else{if((t=t.minus(n.times(r))).lte(i))return ci=Ki(n)?o?2:3:o?4:1,t;ci=Ki(n)?o?1:4:o?3:2}return t.minus(r).abs()}function ts(e,t,n,o){var r,i,s,a,l,c,u,d,h,p=e.constructor,g=void 0!==n;if(g?(Ui(n,1,di),void 0===o?o=p.rounding:Ui(o,0,8)):(n=p.precision,o=p.rounding),e.isFinite()){for(g?(r=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):r=t,(s=(u=Mi(e)).indexOf("."))>=0&&(u=u.replace(".",""),(h=new p(1)).e=u.length-s,h.d=Di(Mi(h),10,r),h.e=h.d.length),i=l=(d=Di(u,10,r)).length;0==d[--l];)d.pop();if(d[0]){if(s<0?i--:((e=new p(e)).d=d,e.e=i,d=(e=Ci(e,h,n,o,0,r)).d,i=e.e,c=li),s=d[n],a=r/2,c=c||void 0!==d[n+1],c=o<4?(void 0!==s||c)&&(0===o||o===(e.s<0?3:2)):s>a||s===a&&(4===o||c||6===o&&1&d[n-1]||o===(e.s<0?8:7)),d.length=n,c)for(;++d[--n]>r-1;)d[n]=0,n||(++i,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,u="";s1)if(16==t||8==t){for(s=16==t?4:3,--l;l%s;l++)u+="0";for(l=(d=Di(u,r,t)).length;!d[l-1];--l);for(s=1,u="1.";sl)for(i-=l;i--;)u+="0";else it)return e.length=t,!0}function os(e){return new this(e).abs()}function rs(e){return new this(e).acos()}function is(e){return new this(e).acosh()}function ss(e,t){return new this(e).plus(t)}function as(e){return new this(e).asin()}function ls(e){return new this(e).asinh()}function cs(e){return new this(e).atan()}function us(e){return new this(e).atanh()}function ds(e,t){e=new this(e),t=new this(t);var n,o=this.precision,r=this.rounding,i=o+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?Fi(this,o,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=Fi(this,i,1).times(.5)).s=e.s:t.s<0?(this.precision=i,this.rounding=1,n=this.atan(Ci(e,t,i,1)),t=Fi(this,i,1),this.precision=o,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Ci(e,t,i,1)):(n=Fi(this,i,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function hs(e){return new this(e).cbrt()}function ps(e){return $i(e=new this(e),e.e+1,2)}function gs(e,t,n){return new this(e).clamp(t,n)}function fs(e){if(!e||"object"!==typeof e)throw Error(yi+"Object expected");var t,n,o,r=!0===e.defaults,i=["precision",1,di,"rounding",0,8,"toExpNeg",-ui,0,"toExpPos",0,ui,"maxE",0,ui,"minE",-ui,0,"modulo",0,9];for(t=0;t=i[t+1]&&o<=i[t+2]))throw Error(vi+n+": "+o);this[n]=o}if(n="crypto",r&&(this[n]=fi[n]),void 0!==(o=e[n])){if(!0!==o&&!1!==o&&0!==o&&1!==o)throw Error(vi+n+": "+o);if(o){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(wi);this[n]=!0}else this[n]=!1}return this}function ms(e){return new this(e).cos()}function ys(e){return new this(e).cosh()}function vs(e,t){return new this(e).div(t)}function bs(e){return new this(e).exp()}function ws(e){return $i(e=new this(e),e.e+1,3)}function Es(){var e,t,n=new this(0);for(mi=!1,e=0;e=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=r%1e7;else{if(!crypto.randomBytes)throw Error(wi);for(t=crypto.randomBytes(o*=4);i=214e7?crypto.randomBytes(4).copy(t,i):(a.push(r%1e7),i+=4);i=o/4}else for(;i=10;r/=10)o++;o<7&&(n-=7-o)}return s.e=n,s.d=a,s}function Us(e){return $i(e=new this(e),e.e+1,this.rounding)}function xs(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ds(e){return new this(e).sin()}function Cs(e){return new this(e).sinh()}function $s(e){return new this(e).sqrt()}function Ms(e,t){return new this(e).sub(t)}function js(){var e=0,t=arguments,n=new this(t[e]);for(mi=!1;n.s&&++ei.maxE?(r.e=NaN,r.d=null):e.e=10;n/=10)t++;return void(mi?t>i.maxE?(r.e=NaN,r.d=null):tNumber.isNaN(Number(e))?0:Number(e),aa=(e,t)=>new Hs(e).mul(t).toNumber(),la=[10,50,200],ca=({ratios:e="1,2,4,10",tickSize:t,priceScale:n})=>Number(t)&&e&&e.split?e.split(",").map((e=>{const o=aa(Number(t),Number(e));let r={priceScale:n};return 1===Number(e)&&(r={...r,isDefault:!0}),{label:o,ratio:Number(e),value:o,meta:r}})):[],ua=e=>{let t=[];return Number(e)?(la.forEach((n=>{const o=aa(Number(e),Number(n));t=[...t,{label:`+${o}`,value:o},{label:`-${o}`,value:-o}]})),t):t},da=(e,t)=>e&&0!==sa(e)?sa(e):sa(t),ha=()=>{if("undefined"===typeof window)return"";try{var e;let t=Vo(tn);return null!==(e=window)&&void 0!==e&&e.tracing&&window.tracing.addEvent({t:"dynamic-symbol-get-cookie",m:t}),t&&"null"!==t.toLowerCase()&&"undefined"!==t.toLowerCase()||(t=""),t}catch(e){return""}},pa=e=>{const t={prod:"s1.bycsi.com",testnet:"t1.bycsi.com"};if(_e&&e&&e.indexOf(t.testnet)>-1)return e;if(!e)return"";const n=Object.values(t).find((t=>-1!==e.indexOf(t)));if(!n)return e;const o=n.length,r=e.indexOf(n);return`/bycsi-root${e.substr(r+o)}`},ga=(...e)=>{var t,n,o;return null===(t=window)||void 0===t||null===(n=t.tracing)||void 0===n||null===(o=n.addEvent)||void 0===o?void 0:o.call(n,...e)},fa=e=>e?(Object.entries(e).forEach((([t,n])=>{ia[t]&&Array.isArray(n)&&(e[t]=n.map((e=>(e=>e?Object.entries(e).reduce(((e,[t,n])=>(e[ta[t]||t]=n,e)),{}):{})(e))))})),e):e,ma={InversePerpetual:[],LinearPerpetual:[],InverseFutures:[],UsdcPerpetual:[],UsdcFutures:[],allTags:""};let ya=null,va=null;async function ba(){if(ya)return ya;if(va)return va;const e="EU"===st?"symbols-eu.json":"symbols-default.json";return va=(async()=>{try{const t=await fetch(`/static/by-vendors/fallback/${e}`);if(!t.ok)throw new Error(`Failed to load fallback symbols: ${t.status}`);const n=await t.json();return ya=n,n}catch(e){return console.warn("[by-vendors] Failed to load fallback JSON, using minimal structure:",e),ya=ma,ma}finally{va=null}})(),va}const wa=ma;const Ea=10011501,Sa=10011502,Ta=10011503,Na=10011504,Oa=10011505,Aa=10011506,ka=10011507,La=10011508,Ia=(e,t)=>t.some((t=>e instanceof t));let Ra,_a;const Pa=new WeakMap,Ua=new WeakMap,xa=new WeakMap;let Da={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Pa.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ja(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ca(e){Da=e(Da)}function $a(e){return(_a||(_a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(qa(this),t),ja(this.request)}:function(...t){return ja(e.apply(qa(this),t))}}function Ma(e){return"function"===typeof e?$a(e):(e instanceof IDBTransaction&&function(e){if(Pa.has(e))return;const t=new Promise(((t,n)=>{const o=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),o()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)}));Pa.set(e,t)}(e),Ia(e,Ra||(Ra=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Da):e)}function ja(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const o=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(ja(e.result)),o()},i=()=>{n(e.error),o()};e.addEventListener("success",r),e.addEventListener("error",i)}));return xa.set(t,e),t}(e);if(Ua.has(e))return Ua.get(e);const t=Ma(e);return t!==e&&(Ua.set(e,t),xa.set(t,e)),t}const qa=e=>xa.get(e);const Fa=["get","getKey","getAll","getAllKeys","count"],Ga=["put","add","delete","clear"],Ba=new Map;function Ha(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(Ba.get(t))return Ba.get(t);const n=t.replace(/FromIndex$/,""),o=t!==n,r=Ga.includes(n);if(!(n in(o?IDBIndex:IDBObjectStore).prototype)||!r&&!Fa.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,r?"readwrite":"readonly");let s=i.store;return o&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),r&&i.done]))[0]};return Ba.set(t,i),i}Ca((e=>({...e,get:(t,n,o)=>Ha(t,n)||e.get(t,n,o),has:(t,n)=>!!Ha(t,n)||e.has(t,n)})));const Ka=["continue","continuePrimaryKey","advance"],Va={},za=new WeakMap,Ja=new WeakMap,Wa={get(e,t){if(!Ka.includes(t))return e[t];let n=Va[t];return n||(n=Va[t]=function(...e){za.set(this,Ja.get(this)[t](...e))}),n}};async function*Za(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,Wa);for(Ja.set(n,t),xa.set(n,qa(t));t;)yield n,t=await(za.get(n)||t.continue()),za.delete(n)}function Ya(e,t){return t===Symbol.asyncIterator&&Ia(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ia(e,[IDBIndex,IDBObjectStore])}Ca((e=>({...e,get:(t,n,o)=>Ya(t,n)?Za:e.get(t,n,o),has:(t,n)=>Ya(t,n)||e.has(t,n)})));const Qa=()=>{"undefined"!==typeof window&&zs.forEach((e=>{try{localStorage.removeItem(e)}catch{}}))},Xa=async e=>{if("undefined"===typeof window||!window.indexedDB)throw new Error("IndexedDB not supported");try{return await function(e,t,{blocked:n,upgrade:o,blocking:r,terminated:i}={}){const s=indexedDB.open(e,t),a=ja(s);return o&&s.addEventListener("upgradeneeded",(e=>{o(ja(s.result),e.oldVersion,e.newVersion,ja(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),r&&e.addEventListener("versionchange",(e=>r(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}(e,1,{upgrade(e,t){if(t<1){(async e=>{try{let t=null;if(t=localStorage.getItem(Vs),!t)try{const e=localStorage.getItem(Ks);if(e){const n=JSON.parse(e);t=JSON.stringify(null===n||void 0===n?void 0:n.dynamicSymbol)}}catch(e){}if(!t)return;const n=JSON.parse(t);try{await e.put({key:Vs,value:n}),localStorage.removeItem(Vs),Qa()}catch(e){console.warn("Migration failed, IndexedDB write failed:",e)}}catch(e){console.warn("Migration error:",e.message)}})(e.createObjectStore(Zs,{keyPath:"key"}))}}})}catch(e){throw ga({t:"action",c:La,m:null===e||void 0===e?void 0:e.message}),e}},el=async(e,t)=>{try{try{const n=await Xa(Ws);await n.put(Zs,{key:e,value:t})}catch(e){}return!0}catch(e){return!1}},tl=async e=>{try{try{const t=await Xa(Ws),n=await t.get(Zs,e);if(null!=(null===n||void 0===n?void 0:n.value))return n.value}catch(e){}try{const t=await Xa(Js),n=await t.get(Zs,e);return null!=(null===n||void 0===n?void 0:n.value)?(el(e,n.value),n.value):null}catch(e){return null}}catch(e){return null}},nl=async()=>{if("undefined"===typeof window)return null;try{const e=await tl(Vs);if(e)return e}catch(e){}let e=null;try{e=JSON.parse(localStorage.getItem(Vs))}catch(e){ga({t:"action",c:Ea,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}if(!e)try{const n=localStorage.getItem(Ks);var t;if(n)e=null===(t=JSON.parse(n))||void 0===t?void 0:t.dynamicSymbol,ga({t:"action",c:Sa,m:"use v4 data"})}catch(e){ga({t:"action",c:Ta,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}return e},ol=()=>!!window&&(yt()||gt()),rl=async({http:e,url:t,token:n,useCache:o}={http:null,url:"",token:"",useCache:!1})=>{var r;const i=await e.get(`${t}${n?`&token=${n.substr(-8)}`:""}`,{headers:ol()&&{UserToken:n},useCache:o}),{result:s,ret_code:a}=(null===i||void 0===i?void 0:i.data)||{};if(s&&0===a)return(async e=>{var t,n;if("undefined"!==typeof window&&(null!==e&&void 0!==e&&null!==(t=e.LinearPerpetual)&&void 0!==t&&t.length||null!==e&&void 0!==e&&null!==(n=e.UsdcPerpetual)&&void 0!==n&&n.length)){try{return void await el(Vs,e)}catch(e){}try{Qa(),localStorage.setItem(Vs,JSON.stringify(e))}catch(e){ga({t:"action",c:Na,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}}})(s),null!==s&&void 0!==s&&null!==(r=s.LinearPerpetual)&&void 0!==r&&r.length?null===i||void 0===i?void 0:i.data:void 0},il=async({fetchOptions:e={}}={})=>{const{fetchSuccessCallback:t,resolveData:n,...o}=e;let r;try{r=await nl()}catch(e){}const i=rl(o);return i.then((e=>{null!==e&&void 0!==e&&e.result&&(null===t||void 0===t||t(n(e.result)))})),r?(i.catch((e=>{var t;ga({t:"action",c:Oa,m:null===e||void 0===e?void 0:e.message,cm:null===e||void 0===e||null===(t=e.request)||void 0===t?void 0:t.url})})),r={result:r}):r=await i,r},sl=async({fetchOptions:e})=>{let t;try{t=await rl(e)}catch(e){var n;if(!t)ga({t:"action",c:Aa,m:null===e||void 0===e?void 0:e.message,cm:null===e||void 0===e||null===(n=e.request)||void 0===n?void 0:n.url}),t=await nl()}return t},al={symbol:"",symbolName:"",coin:"",baseCoin:"",contractStatus:"Closed",contractType:"",maxPrice:0,minPrice:0,maxQty:0,minQty:0,balanceFraction:4,upnlFraction:4,priceScale:4,tickSize:0,tickSizeFraction:0,priceStep:0,priceFraction:0,lotStep:0,lotSize:0,lotFraction:0,obDepthMergeTimes:"1,2,4,10",indexSort:0,initMargin:0,maintainMargin:0,imIncrements:0,rLBases:0,rLIncrements:0,section:[],symbolDepths:[],priceInputLabels:[],quarter:"UnKnown",symbolTags:"",startTradingTime:0,settleTime:0,expectStartTradingTime:0,avatarUrl:{},isPopular:!1,valueScale:0,feeRateTagId:0,displayName:"",mark:[],underlyingType:0,agreement:0,predictionType:0},ll=e=>{const{symbolName:t,symbolAlias:n,baseCurrency:o,quoteCurrency:r,contractStatus:i,contractType:s,maxPrice:a,minPrice:l,minQty:c,maxNewOrderQty:u,maxNewMarketOrderQty:d,walletBalanceFraction:h,upnlFraction:p,priceScale:g,tickSize:f,tickSizeFraction:m,lotFraction:y,lotSize:v,priceFraction:b,obDepthMergeTimes:w,indexSort:E,baseInitialMarginRateE4:S,stepInitialMarginRateE4:T,baseMaintenanceMarginRateE4:N,stepMaintenanceMarginRateE4:O,baseMaxOrdPzValue:A,stepMaxOrdPzValue:k,section:L,quarter:I,symbolTags:R,startTradingTimeE3:_,settleTimeE3:P,isPopular:U,darkIcon:x,lightIcon:D,maxLeverageE2:C,minLeverageE2:$,maxDesignatedMarginE8:M,minDesignatedMarginE8:j,riskMaxLeverageE2:q,riskMinLeverageE2:F,supportCopyTrade:G,symbol:B,symbolDisplay:H,symbolStatus:K,valueScale:V,symbolLabelIcon:z,expectStartTradingTime:J,expectCurrentTimestamp:W,expectDisplay:Z,expectUrl:Y,minNotionalValue:Q,isPreListing:X,preListingInfo:ee,feeRateTagId:te,utaSupportOnly:ne,displayName:oe,maxPostOnlyOrderSize:re,mark:ie,underlyingType:se,agreement:ae,predictionType:le}=e,ce=(ue=o)?{dark:`/bycsi-root/assets/image/coins/dark/${null===ue||void 0===ue?void 0:ue.toLowerCase()}.svg`,light:`/bycsi-root/assets/image/coins/light/${null===ue||void 0===ue?void 0:ue.toLowerCase()}.svg`}:{dark:"/bycsi-root/assets/image/coins/default-dark.png",light:"/bycsi-root/assets/image/coins/default-light.png"};var ue;return{symbol:t,symbolName:n,coin:o,baseCoin:r,contractStatus:i,contractType:s,maxPrice:sa(a),minPrice:sa(l),maxQty:sa(u),minQty:sa(c),maxMarketQty:da(d,u),balanceFraction:sa(h),upnlFraction:sa(p),priceScale:g,tickSize:sa(f),tickSizeFraction:m,priceStep:Number(f)*Number(`1e${m||0}`),priceFraction:b,lotStep:Number(v)*Number(`1e${y||0}`),lotSize:sa(v),lotFraction:y,obDepthMergeTimes:w,indexSort:E,initMargin:sa(S)/100,maintainMargin:sa(N)/100,imIncrements:sa(T)/100,mmIncrements:sa(O)/100,rLBases:sa(A),rLIncrements:sa(k),section:L,symbolDepths:ca({ratios:w,tickSize:f,priceScale:b}),priceInputLabels:ua(f),quarter:I,symbolTags:R,startTradingTime:sa(_),settleTime:sa(P),avatarUrl:{dark:pa(x)||(null===ce||void 0===ce?void 0:ce.dark),light:pa(D)||(null===ce||void 0===ce?void 0:ce.light)},isPopular:U,supportCopyTrade:G,copyTradeMaxLvg:sa(C)/100,copyTradeMinLvg:sa($)/100,copyTradeMaxDesignMargin:sa(M)/1e8,copyTradeMinDesignMargin:sa(j)/1e8,copyTradeRiskMaxLvg:sa(q)/100,copyTradeRiskMinLvg:sa(F)/100,symbolId:B,symbolDisplay:H,symbolStatus:K,valueScale:V,symbolLabelIcon:z,expectStartTradingTime:J,expectCurrentTimestamp:W,expectDisplay:Z,expectUrl:Y,minNotionalValue:Q,isPreListing:X,preListingInfo:ee,feeRateTagId:te,utaSupportOnly:ne,displayName:oe||n,maxPostOnlyOrderSize:sa(re),mark:ie,underlyingType:se,agreement:sa(ae),predictionType:sa(le)}};class cl{constructor(e){if(cl.instance||(cl.instance=this),e){const t={...e};this.options=t}return cl.instance}#e={};#t=e=>{this.symbolStatus=ra[e]||ra.REJECTED};#n=e=>{const t={},n={},o={};return Object.entries(e).forEach((([e,r])=>{ia[e]?(t[e]=[],n[e]=[],r.forEach((o=>{const r=ll(o);t[e].push(r),r.symbolDisplay!==ea&&n[e].push(r)}))):o[e]=r})),{allList:t,tradingList:n,others:o}};#o=e=>{const t={},n={};return Object.entries(e).reduce(((e,[,t])=>[...e,...Array.isArray(t)?t:[]]),[]).forEach((e=>{t[e.symbol]=e,e.symbolDisplay!==ea&&(n[e.symbol]=e)})),{totalSymbolConfig:t,tradingSymbolConfig:n}};#r=(e={})=>{const t=fa(e);this.originData=t;const{allList:n,tradingList:o,others:r}=this.#n(t);this.totalSymbolList=n,this.allSymbolList=o;const{totalSymbolConfig:i,tradingSymbolConfig:s}=this.#o(this.totalSymbolList)||{totalSymbolConfig:al,tradingSymbolConfig:al};return this.totalSymbolConfig=i,this.allSymbolConfig=s,{symbolStatus:this.symbolStatus,totalSymbolConfig:this.totalSymbolConfig,totalSymbolList:this.totalSymbolList,allSymbolConfig:this.allSymbolConfig,allSymbolList:this.allSymbolList,originData:t,others:r}};version=8;symbolStatus="";allSymbolConfig={};allSymbolList={};totalSymbolConfig={};totalSymbolList={};originData={};#i=(e,t,n,o)=>new Promise((r=>{(t===Ys.NETWORK_FIRST?sl:il)({fetchOptions:{http:jr,url:e,token:ha(),useCache:n,fetchSuccessCallback:o,resolveData:this.#r}}).then((async({result:e}={})=>{if(e)this.#t(ra.RESOLVED),r(this.#r(e));else{this.#t(ra.REJECTED);const e=await nl();let t=e;if(!e)try{t=await ba(),ga({t:"action",c:ka,m:"then: use async fallback data"})}catch(e){t=wa,ga({t:"action",c:ka,m:"then: use minimal fallback"})}r(this.#r(t))}})).catch((async e=>{this.#t(ra.REJECTED);const t=await nl();let n=t;if(!t)try{n=await ba(),ga({t:"action",c:ka,m:"catch: use async fallback data"})}catch(e){n=wa,ga({t:"action",c:ka,m:"catch: use minimal fallback"})}r(this.#r(n))}))}));#s=e=>{let t=je||si().API2_HOST,n=Xs;if(null!==e&&void 0!==e&&e.length){const[o,r]=e;"string"===typeof o?(t=o,n={...n,...r}):n={...n,...o}}const{action:o,filter:r,useCache:i,fetchSuccessCallback:s}=n;return{api2Host:t,action:o,filter:r,useCache:i,fetchSuccessCallback:s}};fetchSymbolList=async(...e)=>{this.#t(ra.PENDING);const{api2Host:t,action:n,filter:o,useCache:r,fetchSuccessCallback:i}=this.#s(e),s=await(async()=>{if("undefined"===typeof window)return null;try{const e=await tl(Vs);if(e)return e}catch(e){}let e=null;try{e=JSON.parse(localStorage.getItem(Vs))}catch(e){ga({t:"action",c:Ea,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}return e})(),a=`${t}/contract/v5/product/brief-symbol-list?${(e=>Object.entries(e).reduce(((e,[t,n])=>n?`${e}${t}=${n}&`:e),"").slice(0,-1))({filter:o,version:null===s||void 0===s?void 0:s.version})}`;return this.#i(a,n,r,i)};fetchSymbol=async(e,t,n={})=>{const{api2Host:o}=this.#s([]),r=`${o}/contract/v5/product/dynamic-symbol-item?symbol=${e}`;try{const o=await jr.get(r,{headers:ol()&&{UserToken:ha()},...n}).catch((()=>({}))),{result:i}=(null===o||void 0===o?void 0:o.data)||{};if(i.item){const n=this.originData[t],o=n.findIndex((t=>ll(t).symbol===e));return n.splice(o,1,i.item),this.#r(this.originData)}return{}}catch(e){return{}}};static getInstance(e){return this.instance||(this.instance=new cl(e)),this.instance}}const ul=cl,dl=Object.prototype,hl=n.g&&n.g.Object===Object&&n.g||function(){return this}()||("undefined"!==typeof globalThis?globalThis:void 0),pl=(null===hl||void 0===hl?void 0:hl.isFinite)||Number.isFinite,gl=1/0,fl=Symbol?Symbol.toStringTag:void 0,ml=Symbol?Symbol.isConcatSpreadable:void 0,yl=dl.toString,vl=dl.propertyIsEnumerable,bl=dl.hasOwnProperty,wl=/^\s+|\s+$/g,El=/^[-+]0x[0-9a-f]+$/i,Sl=/^0b[01]+$/i,Tl=/^0o[0-7]+$/i,Nl=parseInt,Ol=dl.toString,Al=e=>"string"===typeof e,kl=e=>void 0===e,Ll=e=>!!e&&"object"==typeof e,Il=e=>!!e&&"object"===typeof e&&e.constructor===Object,Rl=e=>{var t=typeof e;return!!e&&("object"==t||"function"==t)},_l=e=>"symbol"==typeof e||Ll(e)&&"[object Symbol]"==Ol.call(e),Pl=e=>{if("number"==typeof e)return e;if(_l(e))return NaN;if(Rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(wl,"");var n=Sl.test(e);return n||Tl.test(e)?Nl(e.slice(2),n?2:8):El.test(e)?NaN:+e},Ul=e=>e?(e=Pl(e))===gl||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0,xl=e=>{var t=Ul(e),n=t%1;return t===t?n?t-n:t:0},Dl=e=>"number"==typeof e||Ll(e)&&"[object Number]"==Ol.call(e),Cl=e=>Dl(e)&&e!=+e,$l=e=>"number"==typeof e&&pl(e),Ml=e=>"number"==typeof e&&e==xl(e),jl=e=>{var t=Rl(e)?Ol.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t},ql=e=>{if(null===e)return null;const t=Object.assign({},e);return Object.keys(t).forEach((n=>t[n]="object"===typeof e[n]?ql(e[n]):e[n])),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},Fl=(e,t)=>Array.isArray(e)?e.map(t):Il(e)?Object.keys(e).map((n=>t(e[n],n))):[],Gl=(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{}),Bl=(e,t)=>e.reduce(((e,n)=>[...e,...t.map((e=>[n,e]))]),[]),Hl=(e,t,n)=>(t=(t=+t)===t?t:0,n=(n=+n)===n?n:0,(e=+e)===e&&(e=(e=e<=n?e:n)>=t?e:t),e),Kl=(e,t)=>e.reduce(((e,n,o,r)=>(e[t(n,o,r)?0:1].push(n),e)),[[],[]]),Vl=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{});function zl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":fl&&fl in Object(e)?function(e){var t=bl.call(e,fl),n=e[fl];try{e[fl]=void 0;var o=!0}catch(e){}var r=yl.call(e);return o&&(t?e[fl]=n:delete e[fl]),r}(e):Ol.call(e)}function Jl(e){return Ll(e)&&"[object Arguments]"==zl(e)}var Wl=Jl(function(){return arguments}())?Jl:function(e){return Ll(e)&&bl.call(e,"callee")&&!vl.call(e,"callee")};const Zl=e=>Array.isArray(e)||Wl(e)||!!(ml&&e&&e[ml]);function Yl(e,t){for(var n=-1,o=t.length,r=e.length;++n0&&n(a)?t>1?Ql(a,t-1,n,o,r):Yl(r,a):o||(r[r.length]=a)}return r}const Xl=(e,t,n)=>(n=void 0===n?1:xl(n),Ql(Fl(e,t),n,Zl,!1,[]));function ec(e){const t=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),r=e.getHours(),i=e.getMinutes(),s=e.getSeconds(),a={year:Number.isNaN(t)?"--":t,month:Number.isNaN(n)?"--":n,day:Number.isNaN(o)?"--":o,hours:Number.isNaN(r)?"--":r,minutes:Number.isNaN(i)?"--":i,seconds:Number.isNaN(s)?"--":s};return Object.keys(a).forEach((e=>{a[e]<10&&(a[e]=`0${a[e]}`)})),a}function tc(e){if(!e)return e;const t=ec("object"===typeof e?e:new Date(e));return`${t.year}-${t.month}-${t.day} ${t.hours}:${t.minutes}:${t.seconds}`}function nc(e){if(!e)return e;const t=ec("object"===typeof e?e:new Date(e));return`${t.year}-${t.month}-${t.day}`}function oc(e){if(!e)return e;const t=ec("object"===typeof e?e:new Date(e));return`${t.hours}:${t.minutes}:${t.seconds}`}function rc(e,t){if(!e)return e;const n="object"===typeof e?e:new Date(e),{hours:o,minutes:r,seconds:i}=function(e,t=0){const n=(e-(new Date).getTime())/1e3,o=Math.floor(n/3600/24),r=Math.floor((n-24*o*3600)/3600),i=Math.floor((n-24*o*3600-3600*r)/60),s={days:o,hours:r+t,minutes:i,seconds:Math.floor(n-24*o*3600-3600*r-60*i)};return Object.keys(s).forEach((e=>{s[e]<10&&(s[e]=`0${s[e]}`)})),s}(n,t);return`${o}:${r}:${i}`}function ic(e){const t=Math.floor(e/3600/24),n=Math.floor((e-24*t*3600)/3600),o=Math.floor((e-24*t*3600-3600*n)/60),r={hours:n,minutes:o,seconds:Math.floor(e-24*t*3600-3600*n-60*o)};return Object.keys(r).forEach((e=>{r[e]<10&&(r[e]=`0${r[e]}`)})),e>86400?Math.ceil(e/3600/24):`${r.hours}:${r.minutes}:${r.seconds}`}const sc=(e,t=8)=>{let n=Number(e);!Cl(n)&&$l(n)||(n=0);let o=Number(t);Cl(o)&&(o=8);let r="";if(Ml(n))if(o>0){r=`${n}.`;for(let e=0;e=0||r.indexOf("E-")>=0)&&(r=n.toFixed(o+1));const e=r.split("."),t=e[0];if(0===o)return`${t}`;const i=e[1];if(i.length{const n=sc(e,t);let o="(\\d)(?=(\\d{3})+\\.)";return-1===n.indexOf(".")&&(o="(\\d)(?=(\\d{3})+$)"),n.replace(new RegExp(o,"g"),"$1,")},lc=(e,t,n="div")=>{if(!Dl(1*e)||!Dl(1*t))return null;return new Hs(1*e)[n](new Hs(1*t)).toNumber()},cc=(e,t="en-US",n=!0)=>{if(!Dl(1*e)||Cl(1*e))return null;const o=new Intl.NumberFormat(t,{notation:"compact"}).format(1*e);return n?null===o||void 0===o?void 0:o.toLocaleLowerCase():o},uc=(e,t=1)=>{const n=10**(t-1);return Math.floor(Number(e)*n*2)/2/n},dc=["id-ID","nl-NL","nl-EU","pt-PT","pt-EU","pt-BR","es-ES","es-EU","es-MX","es-AR","vi-VN","ro-RO","ro-EU","de-DE","de","de-EU","it-IT","it-EU","it","tr-TR","tr-TUR","id-IDN"],hc=["ru-RU","uk-UA","pl-PL","pl-EU","fr-FR","fr","fr-EU","kk-KZ","kk-KAZ","ka-GEO","ru-GEO"];let pc;const gc=e=>dc.includes(e)?"TYPE1":hc.includes(e)?"TYPE2":"DEFAULT",fc=(e,t)=>{let n="en";["TYPE1"].includes(t)?n="id-ID":["TYPE2"].includes(t)&&(n="ru-RU");try{pc=new Intl.NumberFormat(n,{minimumFractionDigits:0,maximumFractionDigits:0})}catch(e){console.warn("Invalid locale, falling back to en"),pc=new Intl.NumberFormat("en")}return["TYPE2"].includes(t)&&e>=1e3&&e<1e4?e:pc.format(e)},mc=(e,t)=>{if(""===t||null===t||void 0===t||Number.isNaN(t)||+t<0)return null===e||void 0===e?void 0:e.toString();const n=t?+t:0;let o=e.toString();const r=o.indexOf(".");return-1!==r?(o=o.slice(0,r+1+n),n<=0?o.split(".")[0]:o):o},yc=(e,t,n="en")=>{var o;if(0===e)return"0";if(!e||Number.isNaN(+e))return e;const r=gc(n),i=["TYPE1","TYPE2"].includes(r)?",":".",s=(null===(o=mc(e,t))||void 0===o?void 0:o.replace(/\./g,i)).split(i);return s[0]=fc(s[0],r),s.join(i)},vc=(e,t,n="en")=>{var o,r;if(0===e)return"0";if(!e||Number.isNaN(+e))return e;const i=t||(0===t?0:4),s=gc(n),a=null===(o=Number(e))||void 0===o?void 0:o.toFixed(i),l=["TYPE1","TYPE2"].includes(s)?",":".",c=(null===(r=mc(a,i))||void 0===r?void 0:r.replace(/\./g,l)).split(l);return c[0]=fc(c[0],s),c.join(l)};const bc=({url:e,async:t,name:n,...o})=>new Promise((r=>{(function(e){const t=Array.from(document.getElementsByTagName("script"));let n=!1;for(let o=0,r=t.length;o{r({name:n})}}));function wc(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function Ec(){return`${wc()}${wc()}-${wc()}-${wc()}-${wc()}-${wc()}${wc()}${wc()}`}const Sc=e=>{const{search:t}=e;return t?t.slice(1).split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return{...e,[n]:decodeURIComponent(o)}}),{}):{}},Tc=e=>{const[,t]=e.href.split("?");return t?t.split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return{...e,[n]:decodeURIComponent(o)}}),{}):{}},Nc=e=>{let t;if(!e)return t;try{t=new URL(e)}catch(e){console.warn(e)}return t},Oc=(e="")=>{const t=e.split(".");return t.slice(-(t.length-1)).join(".")},Ac=(e="",t="")=>Oc(e)===Oc(t);let kc="prod";_e?kc="prod":Re?kc="testnet":Pe&&(kc="test");const Lc="SPOT_SYMBOLS_DATA_COMMON",Ic="SPOT_SYMBOLS_DATA",Rc="/spot/api/basic/symbol_list_all",_c="/spot/api/basic/symbol_list_v2",Pc="/spot/api/basic/symbol_list_v3",Uc=`/common-static/fhs/global-search/algolia/downgrade/algolia-downgrade-${kc}.json`,xc={si:"symbolId",sn:"symbolName",bti:"baseTokenId",btn:"baseTokenName",qti:"quoteTokenId",qtn:"quoteTokenName",bp:"basePrecision",qp:"quotePrecision",miq:"minTradeQuantity",mia:"minTradeAmount",mip:"minPricePrecision",dm:"digitMerge",ss:"showStatus",l:"label",ap:"allowPlan",maq:"maxTradeQuantity",mmq:"maxMarketTradeQty",maa:"maxTradeAmount",nv:"noticeVisible",st:"symbolType",lul:"ltUnderlying",ld:"ltDirection",t:"tags",tfn:"tokenFullName",iu:"iconUrl",ot:"onlineTime",m:"mark",qtr:"quoteTokenLeverageRatio",btr:"baseTokenLeverageRatio",le:"loanEnabled",bb:"isBanBuy",bs:"isBanSell",idu:"iconDayUrl",ts:"tradeStatus",zft:"zeroFeeType",lpp:"limitOrderPriceLimitPercentage",mpp:"marketOrderPriceLimitPercentage",v:"volume",obs:"orderBookShow"},Dc="undefined"!==typeof window,Cc=(e,t)=>{var n,o,r;return Dc?null===(n=window)||void 0===n||null===(o=n.Monitor)||void 0===o||null===(r=o.log)||void 0===r?void 0:r.call(o,{t:e,...t}):null},$c=e=>{if(null===e||void 0===e||!e.length)return[];const t=Object.entries(xc);return e.map((e=>t.reduce(((t,[n,o])=>(n&&(t[o]=e[n]),t)),{})))},Mc=(e,t=!1)=>null!==e&&void 0!==e&&e.length?t?$c(e):e.map((e=>(e.quoteTokenSymbols&&(e.quoteTokenSymbols=$c(e.quoteTokenSymbols)),e))):[],jc=e=>e.reduce(((e,t)=>{var n;if(null!==t&&void 0!==t&&null!==(n=t.quoteTokenSymbols)&&void 0!==n&&n.length){const n=t.quoteTokenSymbols.map((e=>({...e,tokenType:t.tokenType})));e.push(...n)}return e}),[]),qc=(e=[],t)=>e.reduce(((e,n)=>{var o;return e[null!==(o=n[t])&&void 0!==o?o:n.symbolId]=n,e}),{}),Fc=e=>{const t=jc(e);return qc(t)},Gc=(e,t,n)=>{!0===e?Object.assign(t,n):Object.keys(n).forEach((e=>{e in t||(t[e]=n[e])}))},Bc=(e=[],t=[],{key:n="si",tokenId:o,isFromCdn:r}={})=>{if(null===t||void 0===t||!t.length)return e;const i=qc(e,n);return t.forEach((t=>{if(r&&!t.isFromCdn&&(t.isFromCdn=!0),!o||t.quoteTokenId===o){var s;const o=i[null!==(s=t[n])&&void 0!==s?s:t.symbolId];o?Object.assign(o,t):e.push(t)}})),e},Hc=(e=[],t=[],n,{key:o="si",isNeedReplace:r,isFromCdn:i,tokenId:s}={})=>{if(!0===i)Bc(e,t,{key:o,tokenId:s,isFromCdn:i});else{const i=qc(t,o);for(let t=0;tje||si().API2_HOST,Vc=e=>{let t=500,n="Request failed. Please try again later.";try{if(null!==e&&void 0!==e&&e.response){var o;const r=e.response,i=r.data||{};t=i.ext_code||(null===r||void 0===r||null===(o=r.request)||void 0===o?void 0:o.status)||(null===r||void 0===r?void 0:r.status)||t,n=i.ret_msg||i.error||n}}catch(e){}return{success:!1,code:t,message:n,result:null}};const zc=e=>{const t=(null===e||void 0===e?void 0:e.data)||e;return function(e){if(e&&(void 0===e.ret_code&&(e.ret_code=e.retCode),void 0===e.ret_msg))try{e.ret_msg=decodeURIComponent(e.retMsg)}catch{e.ret_msg=e.retMsg}}(t),n=t,"[object Object]"!==Object.prototype.toString.call(n)?(e=>{let t=500,n="Request failed. Please try again later.";try{if(null!==e&&void 0!==e&&e.response){var o;const r=e.response,i=r.data||{};t=i.ext_code||(null===r||void 0===r||null===(o=r.request)||void 0===o?void 0:o.status)||(null===r||void 0===r?void 0:r.status)||t,n=i.ret_msg||i.error||n}}catch(e){}return{success:!1,code:t,message:n,result:null}})("Invalid response data"):(t.success=0===t.ret_code,t.code=t.ret_code,t.message=t.ret_msg||0===t.ret_code?t.ret_msg:"Access error, please try again later",t.result=Object.prototype.hasOwnProperty.call(t,"result")?t.result:null,t);var n},Jc=(e,t=null)=>{try{return JSON.parse(e)}catch(e){return t}};function Wc(e,{ignoreNull:t=!1}={}){return!t||null!==e&&void 0!==e?Array.isArray(e)?e:[e]:[]}function Zc(e){if("string"!==typeof e||-1===e.indexOf("."))return 0;const t=e.split(".");return t[1]?t[1].length:0}function Yc(){if("undefined"!==typeof window&&"undefined"!==typeof window.location){const{origin:e}=window.location;return"development"===Ge?Be||"":e}if(Ke||Ve){const e=Ke||Ve;if(e)return`${He||"http"}://${e}:${ze||80}`}return null}const Qc=e=>{const t=[],n=[],o=[],r={},i=[],s=[],a={},l=()=>({symbols:o,symbolMap:qc(o),quoteTags:r,totalCurrencys:t,quoteCurrencys:n,allFiatCurrency:i,fiatCurrency:s,qouteTokenInfo:a});try{return Wc(e,{ignoreNull:!0}).forEach((e=>{e.quoteTokenSymbols=Wc(e.quoteTokenSymbols,{ignoreNull:!0}),e.quoteTags=Wc(e.quoteTags,{ignoreNull:!0}),a[e.tokenId]=((e,t)=>{if("object"!==typeof e||null===e)return e;const n=new Set(t),o=e=>{if("object"!==typeof e||null===e)return e;if(Array.isArray(e))return e.map(o);const t={};return Object.keys(e).forEach((r=>{n.has(r)||(t[r]=o(e[r]))})),t};return o(e)})(e,["quoteTokenSymbols","quoteTags"]),"REAL_MONEY"!==e.tokenType||i.includes(e.tokenName)||i.push(e.tokenName),e.quoteTokenSymbols.forEach((r=>{r.tags=Wc(r.tags,{ignoreNull:!0}),r.baseTokenName=r.baseTokenName.toUpperCase(),r.quoteTokenName=r.quoteTokenName.toUpperCase(),t.find((t=>t.value===e.tokenName))||t.push({value:e.tokenName,iconType:e.zeroFeeType||0}),"REAL_MONEY"===e.tokenType||n.find((t=>t.value===e.tokenName))||n.push({value:e.tokenName,iconType:e.zeroFeeType||0}),"REAL_MONEY"===e.tokenType&&(s.find((t=>t.value===e.tokenName))||s.push({value:e.tokenName,iconType:r.zeroFeeType||0}),r.isFiat=!0),o.push({...r,quantityPrecision:Zc(r.basePrecision),pricePrecision:Zc(r.minPricePrecision),amountPrecision:Zc(r.quotePrecision)})})),e.quoteTags.forEach((t=>{e.quoteTokenSymbols.some((e=>{var n;return!(!e.tags.includes(t)||null!==(n=r[e.quoteTokenName])&&void 0!==n&&n.includes(t))&&(r[e.quoteTokenName]?r[e.quoteTokenName].push(t):r[e.quoteTokenName]=[t],!0)}))}))})),l()}catch(e){return l()}},Xc=e=>({all:e,symbols:jc(e),symbolsMap:Fc(e),handleSymbols:Qc}),eu="symbol_list_error",tu="symbol_list_storage_error",nu="symbol_list_execution_error",ou=11511503,ru=11511504,iu=11511505,su=11511506,au=11511507,lu=11511508,cu=11511509,uu=11511510,du=11511511,hu=11511512,pu=11511513,gu=11511514,fu=11511515,mu=11511516,yu=11511517,vu=new Bn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"},timeout:8e3});vu.freezeCacheDeletion({"/symbol_list_all":wn.MANUAL,"/symbol_list_v2":wn.MANUAL,"/symbol_list_v3":wn.MANUAL}),vu.addInstanceRequestInterceptors([(e,t)=>(t.requestTime=Date.now(),{url:e,options:t})]),vu.addInstanceResponseInterceptors([async(e,t,n)=>{try{const t=e.clone();return await t.json()?e:Promise.reject(n.createResponseError("Non Response!",void 0))}catch(e){return Promise.reject(e)}}]);const bu=vu,wu=async e=>{Cc(eu,{c:uu,m:"fallback to v2"});try{localStorage.removeItem(Lc)}catch(e){Cc(tu,{c:fu,m:"delete localStorage error"})}let t={};try{t=await bu.get(`${Kc()}${_c}`,e),t=zc(t)}catch(e){Cc(eu,{c:du,m:e.message||"fallback to v2 request error"}),t=zc(e)}return Promise.resolve(t)},Eu=(e,t,{setIsMergeError:n,isNeedReplace:o,isFromCdn:r,key:i}={})=>{if(!Array.isArray(e)||!Array.isArray(t))return[];let s=!1;for(let a=0;a{null===n||void 0===n||n(),s=!0}),{isNeedReplace:o,isFromCdn:r,key:i,tokenId:l.tokenId}),s)break}return e},Su=Symbol.for("sharedSpotSymbolsData"),Tu=(()=>{if(!Dc)return{};try{const e=window.top||window;return e.location.href,e}catch{return window}})();Dc&&!Tu[Su]&&(Tu[Su]={symbolsPromise:null,retryInProgress:!1,cacheSymbolsData:null,cacheSymbolsDataCdn:null,getSymbolsRetryTimes:0,BACKOFF_ID:"GET_SYMBOLS"});const Nu=Tu[Su]||{},Ou={quoteTokenResult:[{tokenId:"USDT",tokenName:"USDT",tokenFullName:null,quoteTokenSymbols:[{symbolId:"BTCUSDT",symbolName:"BTCUSDT",baseTokenId:"BTC",baseTokenName:"BTC",quoteTokenId:"USDT",quoteTokenName:"USDT",basePrecision:"0.000001",quotePrecision:"0.00000001",minTradeQuantity:"0.000048",minTradeAmount:"1",minPricePrecision:"0.01",digitMerge:"100,10,1,0.1,0.01",showStatus:!0,label:null,allowPlan:!0,maxTradeQuantity:"71.73956243",maxTradeAmount:"4000000",noticeVisible:!1,symbolType:"CHAIN_TOKEN",ltUnderlying:"",ltDirection:"",tags:["BTC Ecosystem","PoW","Margin Trading"],tokenFullName:"Bitcoin",iconUrl:"/bycsi-root/app/assets/token/62942131f968981af06a885a79f864ba.svg",onlineTime:0,mark:[],quoteTokenLeverageRatio:"10",baseTokenLeverageRatio:"10",loanEnabled:!0,isBanBuy:!1,isBanSell:!1,iconDayUrl:"/bycsi-root/app/assets/token/d9c8c35b4223b50d9773d7d5294d019f.svg",tradeStatus:3,zeroFeeType:0,limitOrderPriceLimitPercentage:3,marketOrderPriceLimitPercentage:3,volume:"64933718986.350261940000000000"},{symbolId:"ETHUSDT",symbolName:"ETHUSDT",baseTokenId:"ETH",baseTokenName:"ETH",quoteTokenId:"USDT",quoteTokenName:"USDT",basePrecision:"0.00001",quotePrecision:"0.0000001",minTradeQuantity:"0.00062",minTradeAmount:"1",minPricePrecision:"0.01",digitMerge:"100,10,1,0.1,0.01",showStatus:!0,label:null,allowPlan:!0,maxTradeQuantity:"1878.2340843",maxTradeAmount:"4000000",noticeVisible:!1,symbolType:"CHAIN_TOKEN",ltUnderlying:"",ltDirection:"",tags:["ETH Ecosystem","Margin Trading"],tokenFullName:"Ethereum",iconUrl:"/bycsi-root/app/assets/token/35a48e2a91411dcdb00c7fdd443676a9.svg",onlineTime:0,mark:[],quoteTokenLeverageRatio:"10",baseTokenLeverageRatio:"10",loanEnabled:!0,isBanBuy:!1,isBanSell:!1,iconDayUrl:"/bycsi-root/app/assets/token/8f413d7ed51fa4bc3d206d6abf41f4dc.svg",tradeStatus:3,zeroFeeType:0,limitOrderPriceLimitPercentage:3,marketOrderPriceLimitPercentage:3,volume:"19455704679.052111300000000000"}],quoteTags:["0 Fees","Adventure Zone","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","AI","Modular-BCs","DePIN","LSD","DeFi","GameFi","Inscriptions","Meme","PoW","Stablecoin","Innovation Zone","ETP (Leveraged Tokens)","Margin Trading","Launchpool","Launchpad"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"USDC",tokenName:"USDC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["0 Fees","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","AI","Modular-BCs","DePIN","DeFi","GameFi","Meme","PoW","Margin Trading","Launchpool","Launchpad"],tokenType:"CHAIN_TOKEN",zeroFeeType:1},{tokenId:"USDE",tokenName:"USDE",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"EUR",tokenName:"EUR",tokenFullName:null,quoteTags:["SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","Meme"],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"BRL",tokenName:"BRL",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"PLN",tokenName:"PLN",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"TRY",tokenName:"TRY",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"BTC",tokenName:"BTC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["0 Fees","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","DeFi","GameFi","PoW","Margin Trading"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"USTC",tokenName:"USTC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"ETH",tokenName:"ETH",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","LSD","DeFi"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"DAI",tokenName:"DAI",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"BRZ",tokenName:"BRZ",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"SPOTTEST1",tokenName:"SPOTTEST1",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"",zeroFeeType:0},{tokenId:"SPOTTEST3",tokenName:"SPOTTEST",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"",zeroFeeType:0},{tokenId:"SPOTTEST2",tokenName:"SPOTTEST2",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"BIT",tokenName:"BIT",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0}],version:""};n(752);const Au={},ku=e=>{Au[e]&&(clearTimeout(Au[e].$timer),delete Au[e])},Lu=async(e=(()=>"undefined"!==typeof localStorage&&localStorage.getItem("LANG_KEY")||"en")(),{useCache:t=!0,isRequestCdn:n=!1}={})=>Dc?(Nu.symbolsPromise||(Nu.symbolsPromise=new Promise((o=>{const r=async(i=!1)=>{try{try{localStorage.removeItem("spotSymbolData")}catch(e){Cc(tu,{c:fu,m:"delete localStorage error"})}if(Nu.cacheSymbolsData=Jc(localStorage.getItem(Ic)),Nu.cacheSymbolsDataCdn=Jc(localStorage.getItem(Lc)),i){var s;ku(Nu.BACKOFF_ID);let e=!1,t=[];if(!0===n){let n={};n=await(async()=>{let e={};try{var t,n,o,r;e=await bu.get(`${Yc()}${Uc}`);const i=(null===(t=e)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.defaultTradeRecommended)||void 0===o||null===(r=o.spots)||void 0===r?void 0:r.length)>0;e=zc({result:i?e.data:null,ret_code:i?0:500,ret_msg:i?"success":"error"})}catch(t){Cc(eu,{c:pu,m:t.message||"request cdn json symbols error"}),e=zc(t)}return Promise.resolve(e)})();const{success:o,result:r}=n;var a,l;if(o)e=!(null===r||void 0===r||!r.switch),t=null!==(a=null===r||void 0===r||null===(l=r.defaultTradeRecommended)||void 0===l?void 0:l.spots)&&void 0!==a?a:[];Cc(eu,{c:hu,m:"use cdn json symbols data",s:e})}if(null!==(s=Nu.cacheSymbolsData)&&void 0!==s&&s.quoteTokenResult){if(e){Cc(eu,{c:mu,m:"use cdn json symbols and localStorage data",s:e}),Eu(Nu.cacheSymbolsData.quoteTokenResult,Mc(t,!0),{isFromCdn:!0});try{localStorage.setItem(Ic,JSON.stringify(Nu.cacheSymbolsData))}catch(e){Cc(tu,{c:gu,m:e.message||"set localStorage error"})}}else Cc(eu,{c:ou,m:"use localStorage data"});o(Xc(Nu.cacheSymbolsData.quoteTokenResult))}else e?(Cc(eu,{c:yu,m:"use cdn json symbols and hard code data",s:e}),Eu(Ou.quoteTokenResult,Mc(t,!0),{isFromCdn:!0})):Cc(eu,{c:ru,m:"use hard code data"}),o(Xc(Ou.quoteTokenResult))}else{var c,u,d,h,p,g;let n="",i="",s={};null!==(c=Nu.cacheSymbolsData)&&void 0!==c&&null!==(u=c.quoteTokenResult)&&void 0!==u&&u.length&&null!==(d=Nu.cacheSymbolsData)&&void 0!==d&&d.version&&(i=Nu.cacheSymbolsData.version),null!==(h=Nu.cacheSymbolsDataCdn)&&void 0!==h&&null!==(p=h.quoteTokenSymbols)&&void 0!==p&&p.length&&null!==(g=Nu.cacheSymbolsDataCdn)&&void 0!==g&&g.lastModifiedTime&&(n=Nu.cacheSymbolsDataCdn.lastModifiedTime);let a={headers:{lang:e,"Accept-Language":e},useCache:t,rewriteCacheKey:t=>`${t}&${e}`},l={...a};n&&(l={...l,params:{last_modified_at:n}}),i&&(a={...a,params:{version:i}});try{let e=!1;const t=()=>{e=!0},n=await Promise.all([bu.get(`${Kc()}${Rc}`,l),bu.get(`${Kc()}${Pc}`,a)]),o=zc(n[0]),r=zc(n[1]);if(o.success){var f;null!==(f=Nu.cacheSymbolsDataCdn)&&void 0!==f&&f.quoteTokenSymbols&&(o.result.quoteTokenSymbols=Bc(Nu.cacheSymbolsDataCdn.quoteTokenSymbols,o.result.quoteTokenSymbols));try{localStorage.setItem(Lc,JSON.stringify(o.result))}catch(e){Cc(tu,{c:gu,m:e.message||"set localStorage error"})}}o.success&&r.success&&(Eu(r.result.quoteTokenResult,o.result.quoteTokenSymbols,{setIsMergeError:t}),e||(s=r)),!e&&o.success&&r.success||(e?Cc(eu,{c:au,m:"merge symbols error"}):o.success?r.success||Cc(eu,{c:cu,m:"symbol_v3 request error"}):Cc(eu,{c:lu,m:"symbol_all request error"}),s=await wu(a))}catch(e){Cc(eu,{c:su,m:e.message||"all/v3 request error"}),s=await wu(a)}const{success:m,result:y}=s;if(!m||!y)return void r(!0);y.quoteTokenResult?y.quoteTokenResult=Mc(y.quoteTokenResult):y.quoteTokenResult=Nu.cacheSymbolsData.quoteTokenResult,ku(Nu.BACKOFF_ID);try{localStorage.setItem(Ic,JSON.stringify(y))}catch(e){Cc(tu,{c:gu,m:e.message||"set localStorage error"})}o(Xc(y.quoteTokenResult))}}catch(e){Cc(nu,{c:iu,m:e.message||"code execution error"}),Nu.retryInProgress=!1,r(!0)}};r()})).finally((()=>{Nu.retryInProgress=!1,Nu.symbolsPromise=null}))),Nu.symbolsPromise):Promise.resolve(Xc([])),Iu=e=>"string"===typeof e,Ru=()=>{let e,t;const n=new Promise(((n,o)=>{e=n,t=o}));return n.resolve=e,n.reject=t,n},_u=e=>null==e?"":""+e,Pu=/###/g,Uu=e=>e&&e.indexOf("###")>-1?e.replace(Pu,"."):e,xu=e=>!e||Iu(e),Du=(e,t,n)=>{const o=Iu(t)?t.split("."):t;let r=0;for(;r{const{obj:o,k:r}=Du(e,t,Object);if(void 0!==o||1===t.length)return void(o[r]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Du(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Du(e,s,Object),a?.obj&&"undefined"!==typeof a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},$u=(e,t)=>{const{obj:n,k:o}=Du(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},Mu=(e,t,n)=>{for(const o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?Iu(e[o])||e[o]instanceof String||Iu(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):Mu(e[o],t[o],n):e[o]=t[o]);return e},ju=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var qu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Fu=e=>Iu(e)?e.replace(/[&<>"'\/]/g,(e=>qu[e])):e;const Gu=[" ",",","?","!",";"],Bu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Hu=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const o=t.split(n);let r=e;for(let e=0;e-1&&se?.replace("_","-"),Vu={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class zu{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Vu,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,o){return o&&!this.debug?null:(Iu(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new zu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new zu(this.logger,e)}}var Ju=new zu;class Wu{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,n])=>{for(let o=0;o{for(let r=0;r-1&&this.options.ns.splice(t,1)}getResource(e,t,n,o={}){const r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Iu(n)&&r?s.push(...n.split(r)):s.push(n)));const a=$u(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Iu(n)?Hu(this.data?.[e]?.[t],n,r):a}addResource(e,t,n,o,r={silent:!1}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),o=t,t=s[1]),this.addNamespaces(t),Cu(this.data,s,o),r.silent||this.emit("added",e,t,n,o)}addResources(e,t,n,o={silent:!1}){for(const o in n)(Iu(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});o.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,o,r,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),o=n,n=t,t=s[1]),this.addNamespaces(t);let a=$u(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?Mu(a,n,r):a={...a,...n},Cu(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Yu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,r){return e.forEach((e=>{t=this.processors[e]?.process(t,n,o,r)??t})),t}};const Qu={},Xu=e=>!Iu(e)&&"boolean"!==typeof e&&"number"!==typeof e;class ed extends Wu{constructor(e,t={}){super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ju.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const o=this.resolve(e,n);return void 0!==o?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";const o=Gu.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===o.length)return!0;const r=Bu.getRegExp(`(${o.map((e=>"?"===e?"\\?":e)).join("|")})`);let i=!r.test(e);if(!i){const t=e.indexOf(n);t>0&&!r.test(e.substring(0,t))&&(i=!0)}return i})(e,n,o);if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Iu(r)?[r]:r};const i=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(i[0])>-1)&&(r=i.shift()),e=i.join(o)}return{key:e,namespaces:Iu(r)?[r]:r}}translate(e,t,n){let o="object"===typeof t?{...t}:t;if("object"!==typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof options&&(o={...o}),o||(o={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],o),l=a[a.length-1];let c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=o.lng||this.language,d=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?r?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:`${l}${c}${s}`:r?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:s;const h=this.resolve(e,o);let p=h?.res;const g=h?.usedKey||s,f=h?.exactUsedKey||s,m=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!Iu(o.count),b=ed.hasDefaultValue(o),w=v?this.pluralResolver.getSuffix(u,o.count,o):"",E=o.ordinal&&v?this.pluralResolver.getSuffix(u,o.count,{ordinal:!1}):"",S=v&&!o.ordinal&&0===o.count,T=S&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${w}`]||o[`defaultValue${E}`]||o.defaultValue;let N=p;y&&!p&&b&&(N=T);const O=Xu(N),A=Object.prototype.toString.apply(N);if(!(y&&N&&O&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||Iu(m)&&Array.isArray(N))if(y&&Iu(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,o,n));else{let t=!1,r=!1;!this.isValidLookup(p)&&b&&(t=!0,p=T),this.isValidLookup(p)||(r=!0,p=s);const a=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:p,d=b&&T!==p&&this.options.updateMissing;if(r||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,s,d?T:p),i){const e=this.resolve(s,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n{const r=b&&n!==p?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,d,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,d,o),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,o);S&&o[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],s+t,o[`defaultValue${t}`]||T)}))})):n(e,s,T))}p=this.extendTranslation(p,e,o,h,n),r&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}${c}${s}`),(r||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?p:void 0,o))}else{if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,N,{...o,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(o),h):e}if(i){const e=Array.isArray(N),t=e?[]:{},n=e?f:g;for(const e in N)if(Object.prototype.hasOwnProperty.call(N,e)){const r=`${n}${i}${e}`;t[e]=b&&!p?this.translate(r,{...o,defaultValue:Xu(T)?T[e]:void 0,joinArrays:!1,ns:a}):this.translate(r,{...o,joinArrays:!1,ns:a}),t[e]===r&&(t[e]=N[e])}p=t}}return r?(h.res=p,h.usedParams=this.getUsedParamsDetails(o),h):p}extendTranslation(e,t,n,o,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Iu(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!Iu(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||o.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=Iu(i)?[i]:i;return null!=e&&s?.length&&!1!==n.applyPostProcessor&&(e=Yu.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,o,r,i,s;return Iu(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;o=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!Iu(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Iu(t.context)||"number"===typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach((e=>{this.isValidLookup(n)||(s=e,Qu[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(s)||(Qu[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((o=>{if(this.isValidLookup(n))return;i=o;const s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,o,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(o,t.count,t));const n=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(s.push(l+e),t.ordinal&&0===e.indexOf(r)&&s.push(l+e.replace(r,this.options.pluralSeparator)),d&&s.push(l+n)),h){const o=`${l}${this.options.contextSeparator}${t.context}`;s.push(o),u&&(s.push(o+e),t.ordinal&&0===e.indexOf(r)&&s.push(o+e.replace(r,this.options.pluralSeparator)),d&&s.push(o+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(r=a,n=this.getResource(o,e,a,t))})))}))})),{res:n,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Iu(e.replace);let o=n?e.replace:e;if(n&&"undefined"!==typeof e.count&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const e of t)delete o[e]}return o}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class td{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ju.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ku(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Ku(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Iu(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find((e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:e.indexOf("-")>0&&o.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),Iu(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],r=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Iu(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):Iu(e)&&r(this.formatLanguageCode(e)),n.forEach((e=>{o.indexOf(e)<0&&r(this.formatLanguageCode(e))})),o}}const nd={zero:0,one:1,two:2,few:3,many:4,other:5},od={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class rd{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ju.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ku("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:o});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let i;try{i=new Intl.PluralRules(n,{type:o})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),od;if(!e.match(/-|_/))return od;const o=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(o,t)}return this.pluralRulesCache[r]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>nd[e]-nd[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const id=(e,t,n,o=".",r=!0)=>{let i=((e,t,n)=>{const o=$u(e,n);return void 0!==o?o:$u(t,n)})(e,t,n);return!i&&r&&Iu(n)&&(i=Hu(e,n,o),void 0===i&&(i=Hu(t,n,o))),i},sd=e=>e.replace(/\$/g,"$$$$");class ad{constructor(e={}){this.logger=Ju.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:o,prefix:r,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:Fu,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==o&&o,this.prefix=r?ju(r):i||"{{",this.suffix=s?ju(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?ju(d):h||ju("$t("),this.nestingSuffix=p?ju(p):g||ju(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,o){let r,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const r=id(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,n,{...o,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),i=r.shift().trim(),s=r.join(this.formatSeparator).trim();return this.format(id(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...o,...t,interpolationkey:i})};this.resetRegExp();const c=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>sd(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?sd(this.escape(e)):sd(e)}].forEach((t=>{for(s=0;r=t.regex.exec(e);){const n=r[1].trim();if(i=l(n),void 0===i)if("function"===typeof c){const t=c(e,r,o);i=Iu(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))i="";else{if(u){i=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Iu(i)||this.useRawValueToEscape||(i=_u(i));const a=t.safeValue(i);if(e=e.replace(r[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}})),e}nest(e,t,n={}){let o,r,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const o=e.split(new RegExp(`${n}[ ]*{`));let r=`{${o[1]}`;e=o[0],r=this.interpolate(r,i);const s=r.match(/'/g),a=r.match(/"/g);((s?.length??0)%2===0&&!a||a.length%2!==0)&&(r=r.replace(/'/g,'"'));try{i=JSON.parse(r),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!Iu(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),a=e,l=!0}if(r=t(s.call(this,o[1].trim(),i),i),r&&o[0]===e&&!Iu(r))return r;Iu(r)||(r=_u(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),l&&(r=a.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const ld=e=>{const t={};return(n,o,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(Ku(o),r),t[s]=a),a(n)}},cd=e=>(t,n,o)=>e(Ku(n),o)(t);class ud{constructor(e={}){this.logger=Ju.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ld:cd;this.formats={number:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:n(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:n(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:n(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ld(t)}format(e,t,n,o={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find((e=>e.indexOf(")")>-1))){const e=r.findIndex((e=>e.indexOf(")")>-1));r[0]=[r[0],...r.splice(1,e)].join(this.formatSeparator)}const i=r.reduce(((e,t)=>{const{formatName:r,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);"currency"===t&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach((e=>{if(e){const[t,...o]=e.split(":"),r=o.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=r),"false"===r&&(n[i]=!1),"true"===r&&(n[i]=!0),isNaN(r)||(n[i]=parseInt(r,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[r]){let t=e;try{const s=o?.formatParams?.[o.interpolationkey]||{},a=s.locale||s.lng||o.locale||o.lng||n;t=this.formats[r](e,a,{...i,...o,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e}),e);return i}}class dd extends Wu{constructor(e,t,n,o={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=Ju.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,t,n,o){const r={},i={},s={},a={};return e.forEach((e=>{let o=!0;t.forEach((t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,o=!1,void 0===i[s]&&(i[s]=!0),void 0===r[s]&&(r[s]=!0),void 0===a[t]&&(a[t]=!0)))})),o||(s[e]=!0)})),(Object.keys(r).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),!t&&n&&this.store.addResourceBundle(r,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:o,k:r}=Du(e,t,Object);o[r]=o[r]||[],o[r].push(n)})(n.loaded,[r],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,o=0,r=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:r,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&o{this.read.call(this,e,t,n,o+1,2*r,i)}),r):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"===typeof n.then?n.then((e=>s(null,e))).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Iu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Iu(t)&&(t=[t]);const r=this.queueLoad(e,t,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${t}loading namespace ${r} for language ${o} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${r} for language ${o}`,i),this.loaded(e,n,i)}))}saveMissing(e,t,n,o,r,i={},s=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(void 0!==n&&null!==n&&""!==n){if(this.backend?.create){const a={...i,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;r=5===l.length?l(e,t,n,o,a):l(e,t,n,o),r&&"function"===typeof r.then?r.then((e=>s(null,e))).catch(s):s(null,r)}catch(e){s(e)}else l(e,t,n,o,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const hd=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"===typeof e[1]&&(t=e[1]),Iu(e[1])&&(t.defaultValue=e[1]),Iu(e[2])&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),pd=e=>(Iu(e.ns)&&(e.ns=[e.ns]),Iu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Iu(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"===typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),gd=()=>{};class fd extends Wu{constructor(e={},t){var n;if(super(),this.options=pd(e),this.services={},this.logger=Ju,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"===typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"===typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Iu(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=hd();this.options={...n,...this.options,...pd(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=e=>e?"function"===typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Ju.init(o(this.modules.logger),this.options):Ju.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ud;const t=new td(this.options);this.store=new Zu(this.options.resources,this.options);const r=this.services;r.logger=Ju,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new rd(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=o(e),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new ad(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new dd(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new ed(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=gd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const r=Ru(),i=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),r}loadResources(e,t=gd){let n=t;const o=Iu(e)?e:this.language;if("function"===typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===o?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(o)t(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,n){const o=Ru();return"function"===typeof e&&(n=e,e=void 0),"function"===typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=gd),this.services.backendConnector.reload(e,t,(e=>{o.resolve(),n(e)})),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Yu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ru();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,i)=>{i?this.isLanguageChangingTo===e&&(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(r,((...e)=>this.t(...e)))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Iu(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Iu(t)?[t]:t);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,(e=>{r(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const o=(e,t,...r)=>{let i;i="object"!==typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t},i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const s=this.options.keySeparator||".";let a;return a=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${s}${e}`)):i.keyPrefix?`${i.keyPrefix}${s}${e}`:e,this.t(a,i)};return Iu(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||o&&!i(r,e)))}loadNamespaces(e,t){const n=Ru();return this.options.ns?(Iu(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ru();Iu(e)&&(e=[e]);const o=this.options.preload||[],r=e.filter((e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return r.length?(this.options.preload=o.concat(r),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new td(hd());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new fd(e,t)}cloneInstance(e={},t=gd){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},r=new fd(o);void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e));if(["store","services","language"].forEach((e=>{r[e]=this[e]})),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((n,o)=>(n[o]={...e[t][o]},n)),e[t]),e)),{});r.store=new Zu(e,o),r.services.resourceStore=r.store}return r.translator=new ed(r.services,o),r.translator.on("*",((e,...t)=>{r.emit(e,...t)})),r.init(o,t),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const md=fd.createInstance();md.createInstance=fd.createInstance;md.createInstance,md.dir,md.init,md.loadResources,md.reloadResources,md.use,md.changeLanguage,md.getFixedT,md.t,md.exists,md.setDefaultNamespace,md.hasLoadedNamespace,md.loadNamespaces,md.loadLanguages;class yd{constructor(e,t={},n={}){this.init(e,t)}init(e,t){const n=(()=>{const e=rt(),t=br[e],n=t?t.map((e=>e.value)):[];return{defaultLanguage:Er,cacheKey:"i18nextLng",supportLangs:n}})();this.options={...n,...t}}detect(){if("undefined"===typeof window)return this.options.defaultLanguage;const{cacheKey:e,supportLangs:t=[],defaultLanguage:n}=this.options,{searchParams:o}=new URL(window.location.href),r=o.get("lang")||zo.get(e)||navigator.language,i=t.indexOf(r)>-1?r:n;var s;["announcements","learn","blog"].some((e=>window.location.hostname.includes(e)))||(null===(s=document.querySelector("html"))||void 0===s||s.setAttribute("lang",i));return zo.set(e,i),i}}yd.type="languageDetector",yd.prototype.cacheUserLanguage=()=>{};const vd=yd,bd={projectId:"",loadPath:"/locales/{{lng}}/{{ns}}.json",version:"latest",requestOptions:{}};class wd{constructor(e,t={},n={}){this.init(e,t)}init(e,t){this.services=e,this.options={...bd,...t},this.fetch=t.fetch}getResourceUrl(e,t,n){return this.services.interpolator.interpolate(n,{lng:e,ns:t,projectId:this.options.projectId})}read(e,t,n){const o=this.getResourceUrl(e,t,this.options.loadPath);this.fetch(o,this.options.requestOptions).then((e=>{n(null,e)})).catch((r=>{if(console.error(`Load ${o} resource failed!`,r),"TypeError: Failed to fetch"===r.toString())if(this.options.fallbackPath||o.startsWith("/common-static/fhs")){const r=this.options.fallbackPath?this.getResourceUrl(e,t,this.options.fallbackPath):o.replace("/common-static/fhs","/fht-frontend/common-static/frontend-web");this.fetch(r,this.options.requestOptions).then((e=>{n(null,e)})).catch((e=>{console.error(`Load fallback ${r} resource failed!`,e),n(null,{})}))}else n(null,{});else n(null,{})}))}}wd.type="backend";const Ed=wd,Sd=Lt?"https://fh-static.bycsi.com":"/common-static/fhs";const Td=function(){let e;return Pe&&(e="/test-{{lng}}.json?v=1"),Re&&(e="/testnet-{{lng}}.json?v=1"),_e&&(e="/{{lng}}.json?v=1"),`${Sd}/i18n-upload/low-cache/project/release/{{ns}}${e}`}(),Nd=k({});Nd.interceptors.response.push((e=>Promise.resolve(e.data)));const Od=br[st].map((e=>e.value)),Ad=({projectId:e,ns:t,defaultNS:n,defaultLang:o,keySeparator:r=!1,injectUsePlugins:i=[]})=>(md.isInitialized||(md.use(Ed).use(vd),i.length&&i.forEach((e=>{md.use(e)})),md.init({detection:{cacheKey:wo,supportLangs:Od},backend:{loadPath:Td,projectId:e,fetch:Nd},fallbackLng:!1,load:"currentOnly",ns:t,defaultNS:n,keySeparator:r,interpolation:{escapeValue:!1}})),md);let kd;const Ld=async(e=30)=>new Promise((t=>{window.sensorsDataAnalytic201505&&t(window.sensorsDataAnalytic201505),setTimeout((()=>{e>0?Ld(e-1).then(t):t(null)}),100)})),Id=async()=>kd||(kd=await Ld(),kd||{}),Rd=(e,t)=>{Id().then((n=>{var o;null===n||void 0===n||null===(o=n.track)||void 0===o||o.call(n,e,t||{})}))},_d=(e,t)=>{Id().then((n=>{var o;null===n||void 0===n||null===(o=n.click)||void 0===o||o.call(n,{page_name:e,...t||{}})}))},Pd=(e,t)=>{Id().then((n=>{var o;null===n||void 0===n||null===(o=n.exposure)||void 0===o||o.call(n,{page_name:e,...t||{}})}))},Ud=(e={})=>Id().then((()=>{var t,n,o,r;return((null===(t=window)||void 0===t||null===(n=t.sensors)||void 0===n?void 0:n.fastFetchABTest)||(null===(o=window)||void 0===o||null===(r=o.skynet)||void 0===r?void 0:r.fastFetchABTest))(e)})),xd=(...e)=>{Id().then((t=>{var n;null===t||void 0===t||null===(n=t.login)||void 0===n||n.call(t,...e)}))},Dd=e=>{const{host:t}=window.location,n=-1!==t.indexOf("localhost")?"localhost":t.replace(/^www|m|testnet/,"");Ko(tn,e,n,"/",10080)},{getTraceparent:Cd,getHeaders:$d,successHooks:Md,errorHooks:jd}=(null===ko||void 0===ko?void 0:ko.request)||{},qd=({startTime:e,retCode:t,status:n,retMsg:o,reqUrl:r,c:i,t:s,m:a,p:l,ext:c})=>{const u={m:a,c:i,t:s||Oo.AJAX,d:performance.now()-e,p:l?`pc-uniframe-${l}`:"pc-uniframe",r:2===r.split(cn).length?r.split(cn)[1]:r,rt:window?window.location.href:"",ext:{code:t,hc:n,msg:o,env:Ge,href:window?window.location.href:"",...c}};xo(u)},Fd=new Bn({credentials:"include",headers:(()=>{const e=Tt("pc"),t=Nt(),n={Accept:"application/json","Content-Type":"application/json",platform:"pc"};return t&&(e&&(n.platform=e),t&&(n["X-User-Agent"]=t)),n})(),async errorHandler(e){var t,n,o,r,i,s,a,l;const c=null===(t=e.request.options.context)||void 0===t?void 0:t.from,u=null===(n=e.response)||void 0===n||null===(o=n.clone)||void 0===o?void 0:o.call(n),d=await(null===u||void 0===u?void 0:u.json()),h=null!==(r=null===d||void 0===d?void 0:d.ret_code)&&void 0!==r?r:null===d||void 0===d?void 0:d.retCode;var p,g;[10007,33003,10009].includes(h)||qd({startTime:Date.now(),c:87001,t:Oo.REQUEST_ERROR,m:null===e||void 0===e?void 0:e.message,reqUrl:null===e||void 0===e||null===(p=e.request)||void 0===p?void 0:p.url,status:null===e||void 0===e||null===(g=e.response)||void 0===g?void 0:g.status,ext:{from:c}});const f=(null===e||void 0===e||null===(i=e.request)||void 0===i?void 0:i.options)||{},m=Date.now();return null===jd||void 0===jd||jd({type:1,traceparent:null===f||void 0===f?void 0:f._trace,url:null===e||void 0===e||null===(s=e.request)||void 0===s?void 0:s.url,fetchError:{err:e,input:null===e||void 0===e||null===(a=e.request)||void 0===a?void 0:a.url,init:f},startTime:f._startTime,endTime:m,code:h,status:null===e||void 0===e||null===(l=e.response)||void 0===l?void 0:l.status}),Promise.reject(e)}});Fd.addInstanceRequestInterceptors([(e,t)=>{var n,o;t._startTime=null===Date||void 0===Date?void 0:Date.now();const r=null===e||void 0===e?void 0:e.split("?"),i=null===r||void 0===r?void 0:r[1];if(yt()){const e=Vo(tn);e&&(t.headers.UserToken=e)}const s=null===Cd||void 0===Cd?void 0:Cd(e),a=(null===$d||void 0===$d?void 0:$d(e,s))||{};return t.headers={...(null===t||void 0===t?void 0:t.headers)||{},...a},t._trace=s,qd({startTime:t._startTime,t:Oo.AJAX_REQUEST,m:null!==i&&void 0!==i?i:t.body,reqUrl:e,c:null===(n=t.event)||void 0===n?void 0:n.c,p:null===(o=t.event)||void 0===o?void 0:o.p}),{url:e,options:t}}]),Fd.addInstanceResponseInterceptors([async(e,t,n)=>{try{var o;const l=e.clone(),c=await l.json(),{url:u}=e;var r;if(-1!==u.indexOf("/private/user/profile"))window.GA_UID=null===c||void 0===c||null===(r=c.result)||void 0===r?void 0:r.id;if(!c){var i;const o=null===n||void 0===n||null===(i=n.createResponseError)||void 0===i?void 0:i.call(n,"Non Response!",void 0);return null===jd||void 0===jd||jd({type:1,traceparent:null===t||void 0===t?void 0:t._trace,url:null===e||void 0===e?void 0:e.url,fetchError:{err:o,input:null===e||void 0===e?void 0:e.url,init:t},startTime:t._startTime,endTime:g,code:(null===c||void 0===c?void 0:c.ret_code)||(null===c||void 0===c?void 0:c.retCode),status:null===e||void 0===e?void 0:e.status,msg:null===o||void 0===o?void 0:o.message,message:null===o||void 0===o?void 0:o.message}),Promise.reject(n.createResponseError("Non Response!",void 0))}if(yt()){const e=null===c||void 0===c?void 0:c.token;"undefined"!==typeof e&&null!==e&&Dd(e)}const d=null!==(o=null===c||void 0===c?void 0:c.ret_code)&&void 0!==o?o:null===c||void 0===c?void 0:c.retCode,h=null===c||void 0===c?void 0:c.ret_msg,{event:p={}}=t;qd({startTime:t._startTime,retCode:d,retMsg:h,status:l.status,reqUrl:e.url,c:p.c,m:p.scSave?JSON.stringify(null===c||void 0===c?void 0:c.result):"",p:p.p,t:Oo.AJAX});const g=Date.now();if(null===Md||void 0===Md||Md({type:1,traceparent:t._trace,url:null===e||void 0===e?void 0:e.url,fetchResponse:{res:e,input:null===e||void 0===e?void 0:e.url,init:t},startTime:t._startTime,endTime:g}),0===d)return e;var s,a;return[10007,33003,10009].includes(d)?(yt()&&Dd(""),null!==e&&void 0!==e&&null!==(s=e.url)&&void 0!==s&&null!==(a=s.includes)&&void 0!==a&&a.call(s,"/v2/private/user/profile")||n.clearOneCache(),Promise.reject(n.createResponseError("user no permission",c))):Promise.reject(n.createResponseError("bad business ret_code",c))}catch(e){return Promise.reject(e)}}]);const Gd=["get","post","patch","put","delete"];window.dataLayer=window.dataLayer||[];const Bd=(e,t,n)=>{window.dataLayer.push({event:"GAEvent",eventAction:e,eventCategory:t,eventLabel:n})},Hd=()=>{document.addEventListener("click",(function(e){const{buried:t}=e.target.dataset;if(!t)return;const n=t.split(",");Bd(...n)}),!0)},Kd=new Bn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"}});const Vd=new class{max_cache_size=4718592;constructor(){this.timer={}}isOverflowSize(){try{let t=0;for(let n=0;nthis.max_cache_size}catch(e){return!1}}get=(e,t=!1)=>{if(window.localStorage)try{const n=localStorage.getItem(e)||"{}",{expireAt:o,deleteAt:r,data:i}=JSON.parse(n);if(!i)return null;const s=Date.now();return t&&s<=r||!t&&s<=o?i:(s>r&&this.delete(e),null)}catch(e){return null}return null};set(e,t,n=6e4){try{if(this.isOverflowSize()||!window.localStorage)return;const o=Date.now();localStorage.setItem(e,JSON.stringify({expireAt:o+n,deleteAt:o+36e5,data:t}))}catch(e){}}delete=e=>{try{window.localStorage&&localStorage.removeItem(e)}catch(e){}}};class zd{_defaultOptions={useCache:!0};_defaultTtl=6e4;_configUrl=`${cn}/v3/config/web`;_bannerUrl=`${cn}/v3/config/banner`;constructor(e){null!==e&&void 0!==e&&e.ttl&&(this._defaultTtl=null===e||void 0===e?void 0:e.ttl)}genBannerUrl(e){return`dpsdk_banner_${JSON.stringify(e)}`}getConfigUrl(e){return`dpsdk_config_${JSON.stringify(e)}`}validateStatus(e){return e>=500&&e<600}async fetchBanner(e){if(!e||!e.data)return Promise.reject("deadpool banner api,data 参数缺失!");const{data:t,ttl:n}=e,o=n||this._defaultTtl,r=this.genBannerUrl(e.data);try{if(Vd.get(r))return Vd.get(r);const e=await Kd.post(this._bannerUrl,{...this._defaultOptions,ttl:o,data:t});return 10006===e.data.ret_code&&Vd.get(r,!0)?Vd.get(r,!0):(0===e.data.ret_code&&Vd.set(r,{data:e.data},o),e)}catch(e){var i;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(i=e.response)||void 0===i?void 0:i.status)){var s;const t=null===(s=e.response)||void 0===s?void 0:s.status;if(t&&t>=500&&t<600){return Vd.get(r,!0)}}return Promise.reject(e)}}async fetchConfig(e){if(!e||!e.data)return Promise.reject("deadpool config api,data 参数缺失!");const{data:t,ttl:n}=e,o=this.getConfigUrl(e.data),r=n||this._defaultTtl;try{var i,s;if(Vd.get(o))return Vd.get(o);const e=await Kd.post(this._configUrl,{...this._defaultOptions,ttl:this._defaultTtl,data:t});if(10006===(null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.ret_code)&&Vd.get(o,!0))return Vd.get(o,!0);var a,l,c;if(0===(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.ret_code))e.data.countryCode=null===e||void 0===e||null===(a=e.response)||void 0===a||null===(l=a.headers)||void 0===l||null===(c=l.get)||void 0===c?void 0:c.call(l,"X-Country-Code"),Vd.set(o,{data:e.data},r);return e}catch(e){var u;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(u=e.response)||void 0===u?void 0:u.status)){var d;const t=null===(d=e.response)||void 0===d?void 0:d.status;if(t&&t>=500&&t<600){return Vd.get(o,!0)}}return Promise.reject(e)}}async apiWithStorageWrappered(e){let t=null;const{payload:n,requestFn:o,storageKey:r,ttl:i}=e||{};if(!o||!r)return Promise.reject("wrapper storage 调用参数异常,缺少 requestFn、storageKey,请检查!");if(Vd.get(r))return Vd.get(r);try{const e=i||this._defaultTtl,s=await o({payload:n,storageKey:r});if(t=s,0===t.ret_code&&Vd.set(r,s,e),10006===t.ret_code&&Vd.get(r,!0)){return Vd.get(r,!0)}return t}catch(e){var s;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(s=e.response)||void 0===s?void 0:s.status)){return Vd.get(r,!0)}return Promise.reject(e)}}}const Jd="data-theme",Wd="data-site";let Zd=!1;const Yd={usa:/(^|\.)abfinance\.com$/i,tha:/(^|\.)waanx\.com$/i,jpn:/(^|\.)(manepa\.jp|moneypartners\.co\.jp)$/i};function Qd(e){return["global","usa","tha","jpn"].includes(e)}function Xd(e){return null!==e&&void 0!==e&&["light","dark"].includes(e)}function eh(e){for(const n in Yd){var t;if(null!==(t=Yd[n])&&void 0!==t&&t.test(e))return n}return""}function th(e){var t;if(null!==e&&void 0!==e&&e.site&&Qd(null===e||void 0===e||null===(t=e.site)||void 0===t?void 0:t.toLowerCase()))return e.site;if("undefined"!==typeof location){const e=new URLSearchParams(location.search).get("site");if(e&&Qd(e))return e}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).searchParams.get("site");if(t&&Qd(t))return t}catch(e){console.error("detectSite error",e)}if("undefined"!==typeof document){const e=document.documentElement.getAttribute("data-site");if(e&&Qd(e))return e}if("undefined"!==typeof location){const e=location.hostname;if(Qd(eh(e)))return eh(e)}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).hostname;if(Qd(eh(t)))return eh(t)}catch(e){console.error("detectSite hostname error",e)}return"global"}function nh(e){if(null!==e&&void 0!==e&&e.theme&&Xd(e.theme))return e.theme;if("undefined"!==typeof location){const e=new URLSearchParams(location.search).get("theme");if(Xd(e))return e}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).searchParams.get("theme");if(Xd(t))return t}catch(e){console.error("detectTheme error",e)}if("undefined"!==typeof document){const e=document.documentElement.getAttribute(Jd);if(Xd(e))return e}return"light"}function oh(e){"undefined"!==typeof document&&(Qd(e)?(document.documentElement.removeAttribute(Wd),document.documentElement.setAttribute(Wd,e),"undefined"!==typeof localStorage&&localStorage.setItem(Zo,e)):console.error("setSite error, not allowed site",e))}function rh(){if("undefined"===typeof location)return!1;const e=new URLSearchParams(location.search).get("theme");return null!==e&&Xd(e)}function ih(e){"undefined"!==typeof document&&(e&&Xd(e)?(document.documentElement.removeAttribute(Jd),document.documentElement.setAttribute(Jd,e)):console.error("setTheme error, not allowed theme",e))}function sh(e){"undefined"!==typeof document&&(rh()?console.warn("Theme is locked by URL parameter, cannot change theme"):ih(e))}function ah(){if("undefined"===typeof document)return;if(rh())return void console.warn("Theme is locked by URL parameter, cannot toggle theme");sh("light"===(document.documentElement.getAttribute(Jd)||"light")?"dark":"light")}function lh(e){"undefined"!==typeof window?function(e){var t;if("undefined"===typeof document)return;Zd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=th(e),o=nh(e);oh(n),ih(o)}(e):e&&function(e){if("undefined"!==typeof document){var t;Zd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=th(e),o=nh(e);document.documentElement.setAttribute(Wd,n),document.documentElement.setAttribute(Jd,o)}}(e)}function ch(e){var t;if("undefined"===typeof document)return;Zd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=th(e),o=nh(e);oh(n),ih(o)}function uh(){if("undefined"===typeof document)return"global";const e=document.documentElement.getAttribute(Wd);return e&&Qd(e)?e:"global"}function dh(){if("undefined"===typeof document)return"light";const e=document.documentElement.getAttribute(Jd);return Xd(e)?e:"light"}const hh=JSON.parse('{"en":{"EU":"en-EU","TUR":"en-TR","KAZ":"en-KAZ","GEO":"en-GEO","HKG":"en-HK","ARE":"en-ARE","IDN":"en-IDN","USA":"en-USA"},"en-US":{"GLOBAL":"en","EU":"en-EU","TUR":"en-TR","KAZ":"en-KAZ","GEO":"en-GEO","HKG":"en-HK","ARE":"en-ARE","IDN":"en-IDN","USA":"en-USA"},"en-GB":{"GLOBAL":"en","EU":"en-EU"},"es-ES":{"EU":"es-EU"},"es":{"GLOBAL":"es-ES","EU":"es-EU"},"es-MX":{},"es-AR":{},"pt-BR":{},"pt-PT":{"EU":"pt-EU"},"vi":{"GLOBAL":"vi-VN"},"vi-VN":{},"ja":{"GLOBAL":"ja-JP"},"ja-JP":{},"id":{"GLOBAL":"id-ID","IDN":"id-IDN"},"id-ID":{"IDN":"id-IDN"},"uk":{"GLOBAL":"uk-UA"},"uk-UA":{},"ru":{"GLOBAL":"ru-RU","KAZ":"ru-KAZ","GEO":"ru-GEO"},"ru-RU":{"KAZ":"ru-KAZ","GEO":"ru-GEO"},"ar":{"GLOBAL":"ar-SA","ARE":"ar-ARE"},"ar-SA":{},"kk":{"GLOBAL":"kk-KZ","KAZ":"kk-KAZ"},"kk-KZ":{"GLOBAL":"kk-KZ","KAZ":"kk-KAZ"},"zh-TW":{"HKG":"zh-HK"},"zh-CN":{"GLOBAL":"zh-MY"},"zh-HK":{"GLOBAL":"zh-TW"},"it":{"EU":"it-EU"},"it-IT":{"EU":"it-EU"},"nl":{"EU":"nl-EU"},"nl-NL":{"EU":"nl-EU"},"ro":{"EU":"ro-EU"},"ro-RO":{"EU":"ro-EU"},"cs":{"EU":"cs-EU"},"cs-CZ":{"EU":"cs-EU"},"el":{"EU":"el-EU"},"el-GR":{"EU":"el-EU"},"fr":{"GLOBAL":"fr-FR","EU":"fr-EU"},"fr-FR":{"GLOBAL":"fr-FR","EU":"fr-EU"},"lt":{"EU":"lt-EU"},"lt-LT":{"EU":"lt-EU"},"hu":{"EU":"hu-EU"},"hu-HU":{"EU":"hu-EU"},"de":{"EU":"de-EU"},"de-DE":{"EU":"de-EU"},"da":{"EU":"da-EU"},"da-DK":{"EU":"da-EU"},"no":{"EU":"no-EU"},"no-NO":{"EU":"no-EU"},"pl":{"EU":"pl-EU"},"pl-PL":{"EU":"pl-EU"},"pt":{"EU":"pt-EU"},"tr":{"TUR":"tr-TUR"},"tr-TR":{"TUR":"tr-TUR"},"ka":{"GEO":"ka-GEO"},"ka-GE":{"GEO":"ka-GEO"},"zh":{"HKG":"zh-HK"},"ar-AE":{"ARE":"ar-ARE"}}'),ph=new Set(rr.map((e=>e.value)));function gh(e,t){var n,o,r;if(!e)throw new Error("[isValidLanguage]language param is required");if(!t)throw new Error("[isValidLanguage]siteId param is required");return Boolean(null!==(n=null===(o=br[t])||void 0===o||null===(r=o.find)||void 0===r?void 0:r.call(o,(t=>t.value.toLowerCase()===e.toLowerCase())))&&void 0!==n&&n)}function fh(e){var t,n,o;const r=null===(t=new URL(e||window.location.href).pathname.split("/"))||void 0===t||null===(n=t.filter)||void 0===n||null===(o=n.call(t,Boolean))||void 0===o?void 0:o[0];if(r&&/^[a-z]{2,3}(-[a-z]{2,3}|-[A-Z]{2,3})?$/.test(r))return r}function mh(e,t){const n=hh[e],o=t===I,r=o?"GLOBAL":t;if(n&&o&&n.GBR)return n.GBR;const i=null===n||void 0===n?void 0:n[r];return!i||o&&ph.has(i)?void 0:i}function yh(e,t){if("undefined"===typeof window)return;const n=e=>"function"===typeof t?t(e,st):Array.isArray(t)?t.some((t=>t.toLowerCase()===e.toLowerCase())):gh(e,st);if(yt()){const e=Ar(),o=window.localStorage.getItem(wo);if(e&&n(e))return o&&o!==e&&xo({t:"LANGUAGE_DETECT_APP_CONFLICT",ext:{appLanguage:e,localStorageLanguage:o,selected:"app",site:st,hasLanguageValidator:Boolean(t),languageValidatorType:Array.isArray(t)?"array":"function"===typeof t?"function":"default"}}),e}const o=window.localStorage.getItem(wo);if(o&&n(o))return o;const r=e||window.navigator.languages;if(Array.isArray(r)&&r.length>0)for(const e of r){const t=mh(e,st);if(t&&n(t))return t;if(n(e))return e}return function(e){var t,n;if(!e)throw new Error("[getSiteFallbackLanguage]siteId param is required");return null===(t=br[e])||void 0===t||null===(n=t[0])||void 0===n?void 0:n.value}(st)}function vh(e,t,n,o){bh({url:e,languages:t,fallbackFunction:n,languageValidator:o,addReferrer:!1})}function bh(e){var t,n;if("undefined"===typeof window)return;const{url:o,languages:r,fallbackFunction:i,languageValidator:s,addReferrer:a=!1}=e||{},l=fh(o),c=!!l&&gh(l,st);if(c)return;const u=yh(r,s);if(xo({t:"LANGUAGE_DETECT_REDIRECT",ext:{url:o,locationUrl:window.location.href,languages:r,navigatorLanguages:window.navigator.languages,site:st,siteLanguages:null===(t=br[st])||void 0===t||null===(n=t.map)||void 0===n?void 0:n.call(t,(e=>e.value)),languageInUrl:c?l:void 0,languageDetected:u,languageDetectedValid:Boolean(u),addReferrer:a}}),!u){if(i)i();else{const e=new URL(window.location.href);e.pathname="/",window.location.replace(e.toString())}return}let d=function(e,t){if(!e)throw new Error("[addLanguageToUrl]url param is required");if(!t)throw new Error("[addLanguageToUrl]language param is required");const n=fh(e);if(n&&gh(n,st))return e.replace(`/${n}`,`/${t}`);const o=new URL(e);return o.pathname=`/${t}${o.pathname}`,o.toString()}(o||window.location.href,u);a&&document.referrer&&(d=function(e,t,n){if(!e||!t||!n)return e;try{const o=new URL(e);return o.searchParams.has(t)?o.searchParams.set(t,n):o.searchParams.append(t,n),o.toString()}catch(n){return xo({t:"LANGUAGE_DETECT_ADD_QUERY_PARAM_ERROR",ext:{url:e,key:t,error:n instanceof Error?n.message:String(n)}}),e}}(d,"referrer",document.referrer)),window.location.replace(d)}})(),o})()));