Sponsored
Ensure product quality with Testex's wide range of testing solutions | Know More Texworld Apparel Sourcing Paris Weaving the Future | Get Your Free Badge Discover the Oeko-Tex Labelling Guide for Your Products | Learn More
', document.body.appendChild(e), setInterval(ra, 100) } catch (e) { } }(); if (function (e) { var t = he("lang"); if (t && t !== e) { var n = window.location.search.replace("lang=" + t, "lang=" + e); try { window.history.replaceState(null, "", window.location.pathname + n) } catch (e) { } } De = e }(e), nn()) return fn(), void oa(r); if (e === xt.language_from) return Oe("onPageLanguageSet", e), fn(), Gt(null, e), xt.loading_bar && oa(r), document.documentElement.setAttribute("lang", e), void Pe("languageChanged", e, t || ""); dn(Vt(), e).then((function (n) { fn(), Gt(n, e), document.documentElement.setAttribute("lang", e), Pe("languageChanged", e, t || ""), xt.loading_bar && oa(r) })).catch((function (e) { throw xt.loading_bar && oa(r), fn(), Ve().removeItem(F), e })), Oe("onPageLanguageSet", e) } } function sa(e) { return !(!xt.is_connect || ze() === e) && (!xt.host || xt.previewHash && window.location.hostname.includes(z) || function () { if (xt.subdirectory) return [xt.host].concat(l); return xt.languages.map((function (e) { return e.connect_host_destination && e.connect_host_destination.host })).concat([xt.host].concat(l)) }().includes(window.location.hostname) ? (tt(e, (function (e) { return window.location.replace(e) })), !0) : (me() || M.warn('"' + window.location.hostname + '" is not configured with Weglot. Please contact support@weglot.com', { sendToDatadog: !1 }), !1)) } je("initialized", (function () { xt.translate_search && !xt.switcher_editor && function () { var e = xt.search_forms, t = xt.search_parameter; if (t) { for (var n = 0, r = ue(document, e); n < r.length; n += 1) { var o = r[n]; o.addEventListener("submit", (function (e) { e.preventDefault(); var n = e.target.elements[t].value; gn(n, (function (e) { Le.set("wg-search-form", n), o.elements[t].value = e, o.submit() })) })); var a = void 0; -1 !== window.location.search.indexOf(t + "=") && o.elements && o.elements[t] && (a = Le.get("wg-search-form")) && (o.elements[t].value = a) } Le.erase("wg-search-form") } else M.warn("Search parameter name required for search translation.", { sendToDatadog: !1 }) }() }), !0); var la = !1; function ua() { window.addEventListener("message", ga, !1); var e = document.createElement("meta"); e.name = "google", e.content = "notranslate", document.head && document.head.appendChild(e); document.documentElement && -1 === ["cms.e.jimdo.com", "proxy.weglot.com"].indexOf(window.location.host) && document.documentElement.setAttribute("translate", "no"); var t = document.head.querySelector("link[href*=weglot_shopify]"); t && document.head.removeChild(t) } function fa() { if (xt.api_key) { je("initialized", (function () { xt.page_views_enabled && (xt.is_connect ? tt(xt.language_from, (function (e) { return Zt(e) })) : Zt()) }), !0); try { H(document, xt) } catch (e) { M.error(e) } if (Oe("onWeglotSetup"), !pa.initialized || window.Turbolinks) { Qo = function () { var e = rn(); if (xt.is_connect) { var t = document.documentElement.dataset.wgTranslated || (xt.subdirectory ? qe() : Me()); if (t !== xt.language_from) return t; if (xt.technology_name === J) { if (Le.get("wg_checkout_redirect")) return xt.language_from; var n = Le.get("wg_checkout_language"); if (n && !xt.shopifyCheckout && !me() && e.includes(n)) return Le.erase("wg_checkout_language"), n } var r = cn(); return t === xt.language_from && r && e.includes(r) ? r : xt.language_from } var o = he("lang"); if (o && e.includes(o)) return la = !0, o; var a = ln(); if (a && e.includes(a)) return a; var i = cn(); if (i && e.includes(i)) return la = !0, i; return xt.language_from }(), ze(); var e = nn(); if ((ea = Qo && Qo !== xt.language_from && document.documentElement.dataset.wgTranslated !== Qo && !e && !document.documentElement.dataset.wgExcludedUrl && !xt.switcher_editor) && xt.wait_transition ? ve("@keyframes wg{from{color:transparent;}to{color:transparent;}}body *{color:transparent!important;animation:1s linear infinite wg!important;}", B) : fn(), xt.delayStart) return je("start", (function () { return da() }), !0); ke(da) } } } function da() { if (!document.querySelector("#has-script-tags") || document.querySelector("#has-script-tags") && (document.head.innerHTML.indexOf("weglot_script_tag") > 0 || document.documentElement.innerHTML.indexOf("weglot_script_tag") > 0)) try { aa(Qo, la, ea) } catch (e) { fn(), M.error(e, { consoleOverride: "There has been an error initializing, " + e.stack }) } else fn(); Zo = !1, pa.initialized = !0 } function ga(e) { if (e.data) try { var t = JSON.parse(e.data); switch (t.message) { case "Weglot.detect": e.source.postMessage(JSON.stringify({ message: "Weglot.ready", data: { initialized: pa.initialized, options: xt } }), e.origin); break; case "Weglot.switchTo": ia(t.language) } } catch (e) { } } function _a(e) { try { for (var t = null, n = 0, r = [/cdn(?:-staging)?\.weglot\.(?:com|us)\/weglot\.min\.js\?([^#]+)/, /cdn(?:-staging)?\.weglot\.(?:com|us)\/weglot-switcher-editor\.js\?([^#]+)/, /cdn(?:-staging)?\.weglot\.(?:com|us)\/weglot_squarespace-[0-9]+\.min\.js\?([^#]+)/]; n < r.length; n += 1) { if (t = r[n].exec(e)) break } if (!t) return null; var o = t[1].split("&").map((function (e) { var t = e.split("="), n = t[0], r = t[1]; try { return [n, decodeURIComponent(r)] } catch (e) { return [n, r] } })).reduce((function (e, t) { var n, r = t[0], o = t[1]; return Object.assign({}, e, ((n = {})[r] = "true" === o || "false" !== o && o, n)) }), { api_key: "" }); return o.api_key ? o : null } catch (e) { console.log(e), M.warn(e) } } var pa = window.Weglot || { initialized: !1, options: xt, dynamic: "", switchTo: ia, setup: function (e) { ua(), Zo || (Zo = !0, Ae(Lt(), "polyfillReady", (function () { bt(e).then((function () { return fa() })).catch((function () { M.warn("Your setup is deprecated, please save settings in your dashboard to hide this message.", { sendToDatadog: !1 }); var t = e.api_key; e.translation_engine = t && t.length >= 36 ? 2 : 1, function (e) { try { var t = ["api_key", "originalLanguage", "destinationLanguages"]; if (!e || t.some((function (t) { return !e[t] }))) throw { wgErrMsg: "You have to provide at least: " + t.join(", ") }; Ct(vt(e)) } catch (e) { throw new Error(e && e.wgErrMsg || "Error while reading Weglot options") } }(e), fa() })) }))) }, initialize: function (e) { ua(), Zo || (Zo = !0, Ae(Lt(), "polyfillReady", (function () { bt(e).then((function () { return fa() })) }))) }, on: function (e, t) { return je(e, t, !1) }, off: function (e, t) { var n, r = !1, o = function (t) { return Te[t].name === e && !Te[t].internal }; n = "function" == typeof t ? function (e) { return o(e) && Te[e].callback === t } : function (e) { return o(e) }; for (var a = Te.length - 1; a >= 0; a--)n(a) && (Te.splice(a, 1), r = !0); return r }, getStoredLang: ln, getLanguageName: ao, getCurrentLang: ze, polyReady: Nt, getCache: function () { return jt }, addNodes: function (e) { var t = Ft(e); return $t(t), na(t) }, search: gn, translate: function (e, t) { void 0 === e && (e = {}); var n = e.words, r = e.languageTo; if (void 0 === r && (r = ze()), !Array.isArray(n) || "object" != typeof n[0]) { var o = "Weglot.translate: 1st arg must be an array of objects"; return M.error(o, { sendToDatadog: !1 }), t && t(null, o), Promise.reject() } return r === xt.language_from ? (t && t(n.map((function (e) { return e.w }))), Promise.resolve(n.map((function (e) { return e.w })))) : new Promise((function (e, o) { dn(n, r, { title: !1, cdn: !0 }).then((function (n) { if (!n || !n.to_words) throw n; t && t(n.to_words), e(n.to_words) })).catch((function (e) { o(e), t && t(null, e) })) })) }, getBestAvailableLanguage: an, getAvailableLanguages: rn }; return Ae(Lt(), "polyfillReady", (function () { Ko(document); for (var e = 0, t = [document.currentScript].concat(Array.from(document.scripts)); e < t.length; e += 1) { var n = t[e], r = n && (n.src || n.getAttribute && n.getAttribute("data-src")); if (r) { var o = _a(r); if (o) return void pa.initialize(o) } } })), pa }();