PageSourceSearch

https://www.mob.ch/_nuxt/switch-language-mixin.8qHKZHEP.js

js mob.ch collected 2026-10-02 04:51:19 UTC 2,572 bytes, 1 lines download raw bytes

1import{aa as h,ao as f,a_ as m,a$ as p}from"./entry.nP9U-F0k.js";const w={computed:{...h({__:"config/__",byKey:"config/byKey",currentLanguageCode:"config/currentLanguageCode",confirmLanguageSwitchParams:"config/confirmLanguageSwitchParams",languageSwitchUrl:"config/languageSwitchUrl",availableLanguages:"config/availableLanguages"}),hasAI(){return this.availableLanguages?.some(a=>a.isAI)}},methods:{switchLanguage(a,i,r){if(this.currentLanguageCode===a)return;if(this.confirmLanguageSwitchParams){this.$bus.$emit("show-confirm-language-switch-modal",()=>{this.switchLanguage(a)});return}if(this.$isExternalEmbedded){const t=location.hostname.substring(location.hostname.lastIndexOf(".",location.hostname.lastIndexOf(".")-1)),n=f("locale",{domain:t,path:"/"});if(a=m(a),n.value=a,this.rewriteExternalUrlLanguage(a))return!1}let e=this.languageSwitchUrl||window.location.href;if(e.includes("lang=")&&(e=e.replace(/lang=[a-zA-Z]{2}/,"")),e.includes("?")&&e.includes("#")){let t="",n="",s="";e.indexOf("?")>e.indexOf("#")?(n=e.substring(e.indexOf("#")+1,e.lastIndexOf("?")),t=e?.split("?")[1],s=e?.split("#")[0]):(t=e.substring(e.indexOf("?")+1,e.lastIndexOf("#")),n=e?.split("#")[1],s=e?.split("?")[0]),e=`${s}?lang=${a}&${t}#${n}`}else if(e.includes("#")){const t=e?.split("#");e=`${t[0]}?lang=${a}#${t[1]}`}else if(e.includes("?")){const t=e?.split("?");e=`${t[0]}?lang=${a}&${t[1]}`}else e+=`?lang=${a}`;return this.$digitalDataLayer?.pushClickEvent({eventType:"navigation",label:i?this.getLanguageSwitchText(i):a,primaryCategory:"generic navigation",location:"header",variant:"language"},{linkObject:{componentLink:{href:e}},htmlNode:r?.currentTarget}),window.location.assign(p(e)),!1},rewriteExternalUrlLanguage(a){const i=location.pathname,r=Object.fromEntries(new URLSearchParams(window.location.search)),e=this.byKey("routerBase");if(!i.startsWith(e))return!1;const t=e.length,n=i.indexOf("/",t)+1;let s;n===0?s=`${i}/`:s=i.substring(t-1,n);for(const l of this.availableLanguages){const g=[{searchString:`/${l.code}/`,replaceString:`/${a}/`},{searchString:`_${l.code}/`,replaceString:`_${a}/`},{searchString:`/${l.code}_`,replaceString:`/${a}_`}].filter(c=>s.includes(c.searchString));if(g.length===0)continue;let o=location.origin+e.substring(0,e.length-1)+s.replace(g[0].searchString,g[0].replaceString);if(n!==0&&(o+=i.substring(n)),Object.entries(r).length>0){const c=Object.keys(r).map(u=>`${encodeURIComponent(u)}=${encodeURIComponent(r[u])}`).join("&");o+=`?${c}`}return location.replace(o),!0}},getLanguageSwitchText(a){return this.__(a)}}};export{w as s};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.