Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deriv-com/custom-scripts

Package Overview
Dependencies
Maintainers
0
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deriv-com/custom-scripts - npm Package Compare versions

Comparing version 1.26.3 to 1.26.4

2

dist/js/footer_scripts.min.js

@@ -1,1 +0,1 @@

import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as o,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,o,n){let i="";if(o){let e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(t||"")+i+`;domain=${n};path=/`:e+"="+(t||"")+i+";path=/"}function r(e){let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].trim();if(n.startsWith(e+"="))return n.substring(e.length+1)}return null}function c(e,t){const o={};return e.split(";").forEach((e=>{const[t,n]=e.split("=").map((e=>e.trim()));o[t]=decodeURIComponent(n)})),o[t]}function a(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}const d="green.derivws.com";window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,o=["deriv.com","deriv.be","deriv.me"].find((e=>t.endsWith(e)));return o?`https://oauth.${o}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=c(document.cookie,"test_im_country"),o=c(document.cookie,"clients_country"),n=c(document.cookie,"client_information");return n?(null==(e=JSON.parse(n))?void 0:e.residence)||o:t||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const o=localStorage.getItem("config.app_id");if(o)return o;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const l=()=>(null==window?void 0:window.localStorage)&&localStorage.getItem("config.server_url")||d,u=()=>{const e=l(),t=c(document.cookie,"webflow-user-language");let o=window.getAppId(),n=(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})();"function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin&&(o=61554,n=61554));let i=t?t.toLowerCase():"en";"zh-cn"!==i&&"zh-tw"!==i||(i=i.replace("-","_"));const r=(e=>{let t="";return e&&Object.keys(e).forEach((o=>{t+=`&${o}=${e[o]}`})),t})((()=>{const e=c(document.cookie,"utm_data");if(e){const t=JSON.parse(e),o={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{t.hasOwnProperty(e)&&(o[e]=t[e])})),o}return null})()),a=c(document.cookie,"affiliate_tracking"),s=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${o}&l=${i}&brand=deriv${s}${r}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${n}&l=${i}&brand=deriv${s}${r}&platform=${d}`};window.establishWebSocketConnection=()=>new Promise(((e,t)=>{const o=c(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=l();window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(t=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var o;null==(o=null==window?void 0:window.websocket)||o.close(),t(e)}))})),window.socketMessageSend=async(e,t)=>{var o;try{return(null==window?void 0:window.websocket)&&(null==(o=null==window?void 0:window.websocket)?void 0:o.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,o)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,o)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const w=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],m=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],g=()=>{const e=window.getClientCountry();w.forEach((t=>{const o="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&o)return t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!o){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),m.forEach((t=>{e&&t.countries.includes(e)?t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{if(t){const o=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(o.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}}))})):t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")}))}))}))};document.addEventListener("DOMContentLoaded",(function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://deriv.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();o!==c(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),g()}catch(e){g()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then((e=>{c(document.cookie,"clients_country")!==e.website_status.clients_country&&(s("clients_country"),i("clients_country",e.website_status.clients_country,30)),g()})).catch((e=>{}))}));const p=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function f(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!c(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>o,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",(function(){(()=>{var e;const t=window.location.pathname,o=window.location.hash,n=window.location.search,i=t.split("/"),r=i[1],s=p.includes(r||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("product-explorer")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&a(r);const l=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=s?r:l;if((s||"en"!==l)&&r!==l)if(s&&r!==l)a(u);else if(!d){const e=(s?i.map((e=>e===r?u:e)).join("/"):u+i.join("/"))+n+o;window.location.href="/"+e}})()})),document.addEventListener("DOMContentLoaded",(()=>{const e=f();e.onAuthStatusChange((()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){const e=document.querySelectorAll(".logged-in-btn");e.forEach((e=>{e.classList.remove("hide-element")})),"function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin&&e.forEach((e=>{e.href="https://hub.deriv.com/tradershub/cfds"})));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}))}));const h=document.querySelector(".banner_disclaimer"),v=document.querySelector(".main-wrapper");if(h){new ResizeObserver((e=>{for(let t of e)if(t.target===h){let e=t.target.getBoundingClientRect();v&&(v.style.paddingTop=e.height+"px")}})).observe(h)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const b=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let y=!1,_=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(b,"remote_config/deriv-com/chat");n(e,(e=>{const o=e.val();y=o.live_chat,_=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=_?"visible":"hidden"),i&&(i.style.visibility=y?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach((e=>{e.style.visibility="hidden"}))}if(r){const e=document.querySelectorAll(".livechatbtn");y?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const t=document.querySelectorAll(".whatsapp_chat");_?t.forEach((e=>{e.style.visibility="visible"})):t.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,o;(y||_)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),y||_||null==(o=null==t?void 0:t.classList)||o.add("hide-element")}))}),(e=>{var o;null==(o=null==t?void 0:t.classList)||o.remove("hide-element")}))}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const k=document.querySelector(".redirection_background-wrapper"),L=document.getElementById("cancel-redirect"),E=document.getElementById("proceed-redirect"),S="tracking_status",q="tracking_status_decline",x=window.dataLayer,z=c(document.cookie,"client_information"),A=!!z,C=document.getElementById("accept-cookie"),j=document.getElementById("dont-accept-cookie"),O=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{x&&window.dataLayer.push({loggedIn:A,language:c(document.cookie,"webflow-user-language")||"en",...A&&{visitorId:null==z?void 0:z.loginid,currency:null==z?void 0:z.currency,email:null==z?void 0:z.email}}),!window.location.pathname.includes("eu")||r(S)||r(q)||(O.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==C||C.addEventListener("click",(()=>{i(S,!0),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==j||j.addEventListener("click",(()=>{i(q,!0),i(S,!1),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&k&&L&&E){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let t="",o="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),r=new URL(window.location.href);e.includes(i.host)||i.host===r.host||n.addEventListener("click",(function(e){e.preventDefault(),t=i.href,o=n.target||"_self",k.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),L.addEventListener("click",(function(){k.classList.add("hide-element"),document.body.style.overflow="auto",t=""})),E.addEventListener("click",(function(){t&&(window.open(t,o),t="",k.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")}));const $=document.querySelectorAll(".navbar_accordion-item");function D(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}$.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"})),$.forEach((e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",(function(){const e=t.classList.contains("open");if($.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"})),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(D,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const M=new URL(window.location.href),R=new URLSearchParams(M.search),T=R.get("t");if(R.has("referrer")&&null!=T){c(document.cookie,"referrer_token")!==T&&(s("referrer_token"),i("referrer_token",T,365,".deriv.com"))}const B=document.getElementById("navbar-home_login");B&&B.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const N=document.getElementById("res-navbar-home_login");N&&N.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const H=document.getElementById("white-navbar_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const U=document.getElementById("res-white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",(()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")})),e.addEventListener("mouseleave",(()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")}))}t&&t.addEventListener("click",(function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let o=e-t.offsetHeight,n=document.querySelector(".new-navbar_menu");n&&(n.style.height=`${o}px`)}})),e.forEach((t=>{t.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}})),document.addEventListener("DOMContentLoaded",(()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some((t=>e.includes(t)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}))})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(t&&o.length)for(let e of o)e.innerText=t}}));let F=document.querySelectorAll(".w-locales-items");if(F.length>0){F.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let t=document.querySelector('a[hreflang="'+e+'"]');t&&window.location.pathname!==t.getAttribute("href")&&t.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let t=r("webflow-user-language"),o=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],n=window.location.pathname,c=!1;o.some((e=>n.includes(e))),t&&c&&e(t)}document.addEventListener("DOMContentLoaded",(function(){const e=c(document.cookie,"webflow-user-language"),t=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const o=window.getClientCountry();o&&t.includes(o)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));
import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as o,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,o,n){let i="";if(o){let e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(t||"")+i+`;domain=${n};path=/`:e+"="+(t||"")+i+";path=/"}function r(e){let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].trim();if(n.startsWith(e+"="))return n.substring(e.length+1)}return null}function c(e,t){const o={};return e.split(";").forEach((e=>{const[t,n]=e.split("=").map((e=>e.trim()));o[t]=decodeURIComponent(n)})),o[t]}function a(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}const d="green.derivws.com";window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,o=["deriv.com","deriv.be","deriv.me"].find((e=>t.endsWith(e)));return o?`https://oauth.${o}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=c(document.cookie,"test_im_country"),o=c(document.cookie,"clients_country"),n=c(document.cookie,"client_information");return n?(null==(e=JSON.parse(n))?void 0:e.residence)||o:t||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const o=localStorage.getItem("config.app_id");if(o)return o;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const l=()=>{try{return localStorage.getItem("config.server_url")||d}catch(e){return d}},u=()=>{const e=l(),t=c(document.cookie,"webflow-user-language");let o=window.getAppId(),n=(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})();"function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin&&(o=61554,n=61554));let i=t?t.toLowerCase():"en";"zh-cn"!==i&&"zh-tw"!==i||(i=i.replace("-","_"));const r=(e=>{let t="";return e&&Object.keys(e).forEach((o=>{t+=`&${o}=${e[o]}`})),t})((()=>{const e=c(document.cookie,"utm_data");if(e){const t=JSON.parse(e),o={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{t.hasOwnProperty(e)&&(o[e]=t[e])})),o}return null})()),a=c(document.cookie,"affiliate_tracking"),s=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${o}&l=${i}&brand=deriv${s}${r}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${n}&l=${i}&brand=deriv${s}${r}&platform=${d}`};window.establishWebSocketConnection=()=>new Promise(((e,t)=>{const o=c(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=l();window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(t=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var o;null==(o=null==window?void 0:window.websocket)||o.close(),t(e)}))})),window.socketMessageSend=async(e,t)=>{var o;try{return(null==window?void 0:window.websocket)&&(null==(o=null==window?void 0:window.websocket)?void 0:o.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,o)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,o)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const w=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],m=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],g=()=>{const e=window.getClientCountry();w.forEach((t=>{const o="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&o)return t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!o){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),m.forEach((t=>{e&&t.countries.includes(e)?t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{if(t){const o=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(o.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}}))})):t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")}))}))}))};document.addEventListener("DOMContentLoaded",(function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://deriv.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();o!==c(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),g()}catch(e){g()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then((e=>{c(document.cookie,"clients_country")!==e.website_status.clients_country&&(s("clients_country"),i("clients_country",e.website_status.clients_country,30)),g()})).catch((e=>{}))}));const p=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function f(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!c(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>o,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",(function(){(()=>{var e;const t=window.location.pathname,o=window.location.hash,n=window.location.search,i=t.split("/"),r=i[1],s=p.includes(r||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("product-explorer")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&a(r);const l=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=s?r:l;if((s||"en"!==l)&&r!==l)if(s&&r!==l)a(u);else if(!d){const e=(s?i.map((e=>e===r?u:e)).join("/"):u+i.join("/"))+n+o;window.location.href="/"+e}})()})),document.addEventListener("DOMContentLoaded",(()=>{const e=f();e.onAuthStatusChange((()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){const e=document.querySelectorAll(".logged-in-btn");e.forEach((e=>{e.classList.remove("hide-element")})),"function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin&&e.forEach((e=>{e.href="https://hub.deriv.com/tradershub/cfds"})));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}))}));const h=document.querySelector(".banner_disclaimer"),v=document.querySelector(".main-wrapper");if(h){new ResizeObserver((e=>{for(let t of e)if(t.target===h){let e=t.target.getBoundingClientRect();v&&(v.style.paddingTop=e.height+"px")}})).observe(h)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const b=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let y=!1,_=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(b,"remote_config/deriv-com/chat");n(e,(e=>{const o=e.val();y=o.live_chat,_=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=_?"visible":"hidden"),i&&(i.style.visibility=y?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach((e=>{e.style.visibility="hidden"}))}if(r){const e=document.querySelectorAll(".livechatbtn");y?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const t=document.querySelectorAll(".whatsapp_chat");_?t.forEach((e=>{e.style.visibility="visible"})):t.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,o;(y||_)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),y||_||null==(o=null==t?void 0:t.classList)||o.add("hide-element")}))}),(e=>{var o;null==(o=null==t?void 0:t.classList)||o.remove("hide-element")}))}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const k=document.querySelector(".redirection_background-wrapper"),L=document.getElementById("cancel-redirect"),E=document.getElementById("proceed-redirect"),S="tracking_status",q="tracking_status_decline",x=window.dataLayer,z=c(document.cookie,"client_information"),A=!!z,C=document.getElementById("accept-cookie"),j=document.getElementById("dont-accept-cookie"),O=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{x&&window.dataLayer.push({loggedIn:A,language:c(document.cookie,"webflow-user-language")||"en",...A&&{visitorId:null==z?void 0:z.loginid,currency:null==z?void 0:z.currency,email:null==z?void 0:z.email}}),!window.location.pathname.includes("eu")||r(S)||r(q)||(O.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==C||C.addEventListener("click",(()=>{i(S,!0),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==j||j.addEventListener("click",(()=>{i(q,!0),i(S,!1),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&k&&L&&E){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let t="",o="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),r=new URL(window.location.href);e.includes(i.host)||i.host===r.host||n.addEventListener("click",(function(e){e.preventDefault(),t=i.href,o=n.target||"_self",k.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),L.addEventListener("click",(function(){k.classList.add("hide-element"),document.body.style.overflow="auto",t=""})),E.addEventListener("click",(function(){t&&(window.open(t,o),t="",k.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")}));const $=document.querySelectorAll(".navbar_accordion-item");function D(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}$.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"})),$.forEach((e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",(function(){const e=t.classList.contains("open");if($.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"})),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(D,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const M=new URL(window.location.href),R=new URLSearchParams(M.search),T=R.get("t");if(R.has("referrer")&&null!=T){c(document.cookie,"referrer_token")!==T&&(s("referrer_token"),i("referrer_token",T,365,".deriv.com"))}const B=document.getElementById("navbar-home_login");B&&B.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const N=document.getElementById("res-navbar-home_login");N&&N.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const H=document.getElementById("white-navbar_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()}));const U=document.getElementById("res-white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=u()})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",(()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")})),e.addEventListener("mouseleave",(()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")}))}t&&t.addEventListener("click",(function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let o=e-t.offsetHeight,n=document.querySelector(".new-navbar_menu");n&&(n.style.height=`${o}px`)}})),e.forEach((t=>{t.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}})),document.addEventListener("DOMContentLoaded",(()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some((t=>e.includes(t)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}))})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(t&&o.length)for(let e of o)e.innerText=t}}));let F=document.querySelectorAll(".w-locales-items");if(F.length>0){F.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let t=document.querySelector('a[hreflang="'+e+'"]');t&&window.location.pathname!==t.getAttribute("href")&&t.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let t=r("webflow-user-language"),o=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],n=window.location.pathname,c=!1;o.some((e=>n.includes(e))),t&&c&&e(t)}document.addEventListener("DOMContentLoaded",(function(){const e=c(document.cookie,"webflow-user-language"),t=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const o=window.getClientCountry();o&&t.includes(o)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));
{
"name": "@deriv-com/custom-scripts",
"version": "1.26.3",
"version": "1.26.4",
"private": false,

@@ -5,0 +5,0 @@ "publishConfig": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc