EnstylerJS

MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect

目前為 2017-10-18 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        EnstylerJS
// @namespace   Enstyler
// @description MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect
// @include     https://nl.pepper.com/*
// @include     https://www.preisjaeger.at/*
// @include     https://www.mydealz.de/*
// @include     https://www.hotukdeals.com/*
// @include     https://userstyles.org/styles/128262/*
// @include     https://www.amazon.*/gp/aw/*
// @version     3.10.186-min
// @grant       GM_getValue
// @grant       GM_setValue
// @grant       GM_xmlhttpRequest
// //@require     http://code.jquery.com/jquery-3.1.1.min.js
// //@require     http://openuserjs.org/src/libs/sizzle/GM_config.js
// // gnadelwartz hosted includes
// @require     https://cdn.rawgit.com/gnadelwartz/zepto-modules/468559e1b3dc6463a0eada49ff71d7b5407a8a26/zepto-noajax-min.js
// @require     https://cdn.rawgit.com/gnadelwartz/GM_config/0e4b1e4c0dd6b08499082c679850ebc0f56e6ca4/GM_config-min.js
// @require     https://cdn.rawgit.com/gnadelwartz/Enstyler/665c6b0497b8f726b643cb47ae5876dd20e57fb7/translations.js
// @require     https://cdn.rawgit.com/bitwiseshiftleft/sjcl/4fc74ff92fd6b836cc596cc0ee940ef6cc8db7c6/sjcl.js
// @require     https://cdn.rawgit.com/pieroxy/lz-string/c58a22021000ac2d99377cc0bf9ac193a12563c5/libs/lz-string.min.js
// @run-at      document-start
// ==/UserScript==
// @ the original development source with comments can be found here: https://greasyfork.org/de/scripts/24244-enstylerjs-develop
// @ if you don't trust this minimized script use the development source.
"use strict";

function EnstylerInit() {
  (enUserLogin = $(".avatar--type-nav").length) ? (enUserName = $(".navDropDown a").attr(enHREF), enUserName = enUserName.replace(/.*\/profile\/([^\/]+).*/, "$1"), GM_setValue("enConfSyncUser", enUserName)) : enUserName = GM_getValue("enConfSyncUser"), 
  DEBUG && (enDebugLog("User: " + enUserName), enDebugLog("SyncKey: " + enSyncKey), enDebugLog("AutoSync: " + enAutoSync), enDebugLog("NoScript: " + enNoScript)), enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1"), 
  DEBUG && enDebugLog("Section: " + enSection);
}

function EnstylerDealActions() {
  if (enCSSDealz = GM_config.get("enConfCSSDealz"), myDealAction = GM_config.get("enConfDealAction"), myTouch = GM_config.get("enConfTouch"), myCompact = GM_config.get("enConfCompact"), myFixHtml = GM_config.get("enConfFixHtml"), 
  myVotebar = GM_config.get("enConfDealVotebar"), myVotescale = GM_config.get("enConfDealVotescale"), myDealAction) {
    $("footer ul").length && (enDealFooter = "%0D%0A%0D%0A-- %0D%0A" + $("footer ul li p").first().html().replace(/<br>/g, "%0D%0A").replace(/<.*?>/g, ""));
    var e = enLocParser.pathname, n = 0;
    switch ("" != enUserName && (e = e.replace(enUserName + "/", "")), $(".ico--type-grid-subNavActive, .thread-list--type-card ").length && (n = 1), enDealAdd = enDealAction[0] + enDealAction[1 + n] + enDealAction[3], 
    !0) {
     case e.endsWith("profile/saved-deals"):
      enDealAdd += enDealAction[4] + enDealAction[5 + n], +enDealAction[7], enDealUnbook = !0;
      break;

     case e.endsWith("profile/diskussion"):
     case enUserLogin && e.endsWith(enUserName):
      enDealAdd += enDealAction[8] + enDealAction[9 + n] + enDealAction[11];
    }
    enDealAdd = enLangLocalize(enDealAdd + enDealAction[12] + enDealAction[13 + n] + enDealAction[15], enDealLang, enLANG), enSocialAdd = enLangLocalize(enDealAction[16] + enDealAction[17] + enDealAction[19], enDealLang, enLANG);
    var t = enHideTemp;
    myCompact && (t += ".space--fromW3-t-3 {padding: .3em !important;} .threadGrid-headerMeta, .threadGrid-title {height: 2.3em;}.space--mt-2, .space--mv-2 {margin-top: .25em;} .vote-box {height: 2.1em}"), 
    myTouch && (t += "article .threadGrid-footerMeta .ico:before, article .threadItem-footerMeta .ico:before, article .threadCardLayout--row--small .ico:before{-webkit-transform: scale(1.5); transform: scale(1.5); width: 1.5em; left: .4em;}.ico--reduce3 {left: .4em;}article a.btn--circle {-webkit-transform: scale(1.5); transform: scale(1.5); left: -1em; margin-left: 3em; width: 4em;}.vote-down, .vote-up {padding-top: 0.25em; padding-bottom: 0.25em}"), 
    addStyleString(t);
  }
  EnstylerDealActionsDo();
}

function EnstylerDealActionsDo() {
  var e, n, t, a, o, i, l, s;
  enMyCSSID = genUserKey(MyCSS), (myDealAction || myTouch || myFixHtml || myVotebar) && $("article").not(".enClassActionDone, ." + enClassHidden).each(function() {
    var c = "c" != $(this).attr("id")[0];
    if (myDealAction && c) {
      e = $(".cept-comment-link", $(this)), n = $(".thread-title a", $(this)), s = n.length, s || (n = $(".thread-title", $(this))), DEBUGXXX && enDebugLog("DealActionDo: myDeal" + n[0]);
      var r = $(this).find(".userHtml");
      if (r.length && enTranslateText(r), enTranslateText(n), $("threadWidget-item", $(this)).length) return;
      o = $(".vote-temp", $(this)), o.length && (o = parseInt(o.text()), myVotebar && (l = $(".vote-temp", $(this)).attr("class").replace(/.*charcoal|.*vote-temp--/i, ""), DEBUGXXX && enDebugLog("DealActionDo: Temp " + o + " color: " + l), 
      i = o / (myVotescale / 70) + 10, 0 > i && (i *= -3), $(this).prepend('<div class="votebar vote-progress voteBar--' + l + '" style="width: ' + i + '%;"></div>')), $(this).hasClass("thread--type-card") && (o = 0), 
      o > myVotescale / 2.51 ? (DEBUGXXX && enDebugLog("DealActionDo: HOT " + n[0]), myVotebar ? ($(this).prepend(enDealFlame), $(this).find(".threadGrid").css("padding-top", "0")) : $(this).find(".vote-box").after(enDealFlame)) : -myVotescale / 10.1 > o && (DEBUGXXX && enDebugLog("DealActionDo: COLD " + n[0]), 
      myVotebar ? ($(this).prepend(enDealIce), $(this).find("threadGrid").css("padding-top", "0")) : $(this).find(".vote-box").after(enDealIce))), s ? ($("button.meta-ribbon-btn.hide--fromW3", $(this)).remove(), 
      $("span.meta-ribbon.hide--toW3", $(this)).removeClass("hide--toW3"), $(".threadGrid-title .thread-title.lineClamp--2", $(this)).removeClass("lineClamp--2"), r.length || (myCompact && ($(".threadGrid-image, .threadGrid-body", $(this)).remove(), 
      $(".threadGrid-dealBtn", $(this)).css("grid-column", "3")), $(".threadGrid-image", $(this)).css("width", "50%")), t = n[0].outerHTML.replace(/\n|\r/, "").replace(/^.*href="/, "").replace(/".*/, ""), a = enDealComposeMail($(this), n.text(), t, enDealAdd), 
      e.append(a)) : (enCSSDealz && $(this).find("a.btn--twitter").length && (a = $(this).find("a.btn--twitter")[0].outerHTML.replace(/&amp;text=/g, "?ID=" + enMyCSSID + "&amp;text="), $(this).find("a.btn--twitter").replaceWith(a), 
      a = $(this).find("a.btn--facebook")[0].outerHTML.replace(/&amp;title=/g, "?ID=" + enMyCSSID + "&amp;title="), $(this).find("a.btn--facebook").replaceWith(a), a = $(this).find("a.btn--whatsapp")[0].outerHTML.replace(/" rel="no/, "?ID=" + enMyCSSID + '" rel="no'), 
      $(this).find("a.btn--whatsapp").replaceWith(a)), a = enDealComposeMail($(this), n.text(), "" + enLocParser, enSocialAdd), $(this).find("a.btn--twitter").parent().append(a));
    }
    c && (a = $(this).find(".threadGrid-image, .threadCardLayout--row--image"), a.length && a.html(a.html().replace(/ img--dummy.*" data-lazy-img="{&quot;src&quot;:&quot;/, '" src="').replace(/&quot;,&quot;finishClass&quot;:.*">/, '">'))), 
    myFixHtml && $(this).find("div.userHtml").each(function() {
      $(this).html($(this).html().replace(/[^ -~Ä-ü€$✘►○●✰]+|(&nbsp;)+|(\n\r)+|<\/p>|<div>/g, " ").replace(/<\/div>/g, "<br>").replace(/<p>|<br>( *<br>)+/g, "<br><br>").replace(/(<li>)(<br>)+|<br>*(<br><\/li>)/g, "$1"));
    }), myTouch && c && $(this).find("button .avatar").each(function() {
      $(this).prop("outerHTML", $(this).prop("outerHTML").replace(/thread-avatar/, "avatar--type-m"));
    }), $(this).addClass("enClassActionDone");
  });
}

function enDealComposeMail(e, n, t, a) {
  DEBUGXX && void 0 === t && (t = "", enDebugLog("enDealComposeMail href missing!")), n = encodeURIComponent(("Gnadelwartz" == enUserName ? "KayDealz" : enInternationalName) + ": " + n.replace(/\r|\n|\t/g, " ").replace(/  */g, " ")), 
  n.length < 100 && e.find("span.thread-price").length && (n += encodeURIComponent(" -> " + e.find("span.thread-price").text().replace(/ |\t/g, "")));
  var o = t;
  return enCSSDealz && (o = t.replace(/^https:\/\/.*?\//, "https://dealz.rrr.de/" + enInternationalName + "/") + "?ID=" + enMyCSSID), a.replace(enPATTERN[enHREF], "\n\r" + t).replace(enPATTERN[enTEXT], truncStringWord(n, 160, "%20") + "&body=" + n + "%0D%0A%0D%0A" + o + enDealFooter);
}

function EnstylerPagePickerCreate() {
  if (EnstylerPagePickerRemove(), GM_config.get("enConfPagePicker")) {
    var e, n, t, a = 1, o = 1;
    if ($(selectList).empty(), $("div.text--color-charcoalTint").length) {
      var i = $("nav > div.text--color-charcoalTint").html().replace(/\r?\n|\r/g);
      isNaN(a = parseInt(i.replace(/.*currentPage=/, ""))) && (a = 1), isNaN(o = parseInt(i.replace(/.*lastPage=/, ""))) && (o = a);
    }
    for (x = 1; x <= o; ) t = document.createElement("option"), t.text = x, selectList.add(t), n = x, e = Math.abs(x - a), x < 10 || 5 > e ? x++ : x < 1e3 && e > 600 ? x += Math.floor(e / 100) : x += Math.floor(e / 2);
    a > o && (o = a), o > n && (t = document.createElement("option"), t.text = o, selectList.add(t)), selectList.value = a;
    var l = [ ".js-navDropDown-messages", EnstylerPageEnum + " js-navDropDown-messages vAlign--all-m" ];
    $(".test-loginButton").length && (l[0] = ".test-loginButton"), $(".voteBar").length && (l = [ ".voteBar--sticky-off--hide.hAlign--all-r", EnstylerPageEnum + " subNavMenu-link subNavMenu-btn voteBar--sticky-off--hide" ]), 
    selectList.setAttribute("class", l[1]), $(l[0]).before(selectList);
  }
}

function EnstylerPagePickerDo() {
  location.search.match(/^page=/) ? (DEBUG && enDebugLog("Picker from URL: " + location.search), selectList.value = parseint(location.search.replace(/^page=/, ""))) : $(".js-sticky .text--color-charcoalTint").length && (DEBUG && enDebugLog("Picker from pagenav: " + $(".js-sticky .text--color-charcoalTint").html().replace(/\r?\n|\r/g).split('--toW2">Seite')[1]), 
  selectList.value = parseInt($(".js-sticky .text--color-charcoalTint").html().replace(/\r?\n|\r/g).split('--toW2">' + EnstylerSiteConfig("page"))[1]));
}

function EnstylerPageAction() {
  var e = "page=" + $(this).val(), n = ("" + enLocParser).replace(/page=.*|#.*/, "");
  n += n.endsWith("?") || n.endsWith("&") ? e : "?" + e, "/deals/" == enSection && (n += "#thread-comments"), window.location = n;
}

function EnstylerPagePickerRemove() {
  $("." + EnstylerPageEnum).remove();
}

function EnstylerBlacklist() {
  enUserLogin && !GM_config.get("enConfWhitelist").includes(enUserName) && (GM_config.set("enConfWhitelist", "@" + enUserName + "," + GM_config.get("enConfWhitelist")), GM_config.setValue("enConfWhitelist", GM_config.get("enConfWhitelist")));
  var e = GM_config.get("enConfBlacklist").replace(unwantedRegex[0], "");
  enBlack = RegExp(e.replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"), enBlackTrue = !" ".match(enBlack), enBlackTrue || "" == e || alert(confLang("regexfailed")), enWhite = RegExp(GM_config.get("enConfWhitelist").replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"), 
  enWhiteTrue = !" ".match(enWhite), enBlackTemp = GM_config.get("enConfHideColder"), EnstylerBlacklistRemove(), EnstylerBlacklistDo();
}

function EnstylerBlacklistDo() {
  if (GM_config.get("enConfBlackEnable") && (enBlackTrue || enBlackTemp >= -900)) {
    var e;
    $("article").not("." + enClassBlackDone + ", .threadWidget-item").each(function() {
      $(this).addClass(enClassBlackDone), e = "c" != $(this).attr("id")[0] ? $("a.thread-category", $(this)).text() + " " + $(".thread-title a", $(this)).text() + " @" + $("a.user", $(this)).text() : $(".userHtml", $(this)).text() + " @" + $(".vwo-user-link", $(this)).text(), 
      e = e.replace(unwantedRegex[1], " "), enWhiteTrue && e.match(enWhite) || (parseInt($(".vote-temp", $(this)).text()) <= enBlackTemp || enBlackTrue && e.match(enBlack)) && ($(this).addClass(enClassHidden), 
      enBlacklisted++, EnstylerLastSeenSkip("#" + $(this).attr(enID)));
    }), EnstylerBlacklistShow();
  }
}

function EnstylerBlacklistShow() {
  enJSfieldDefs.enConfUnblacklist.label = enUnblackText.replace(enPATTERN[enTEXT], enBlacklisted);
}

function EnstylerBlacklistRemove() {
  EnstylerBlacklistUnhide(), $("." + enClassBlackDone).removeClass(enClassBlackDone);
}

function EnstylerBlacklistUnhide() {
  enBlacklisted = 0, EnstylerBlacklistShow(), $("." + enClassHidden).removeClass(enClassHidden);
}

function EnstylerFixedNav() {
  if (GM_config.get("enConfNavFixed") && "/deals/" != enSection && "/gutscheine/" != enSection) {
    var e = $("header").html();
    $("header").replaceWith('<header class="enFixedNav">' + e + "</header>");
    var n = myFixedCSS.every;
    enSection == EnstylerSiteConfig("discussion") && (DEBUGXX && enDebugLog("FixedNav DICUSSION detected"), n += myFixedCSS.discus), ($(".nav-subheadline").length || "/profile/" == enSection) && (n += myFixedCSS.subnav), 
    n = n.replace(enPATTERN[enTEXT], enMainHeigth), addStyleString(n);
  }
}

function EnstylerDealTime() {
  TodayStart.setHours(0, 0, 0, 0), $("section.thread-list--type-card").length || (today = enLangLocalize('<span class="hide--toW2"><EN-LANG:today>&nbsp;</span>', enTimeLang, enLANG), oclock = enLangLocalize('<span class="hide--toW2">&nbsp;<EN-LANG:oclock></span>', enTimeLang, enLANG)), 
  yesterday = enLangLocalize("<EN-LANG:yesterday> ", enTimeLang, enLANG), EnstylerDealTimeDo();
}

function EnstylerDealTimeDo() {
  if (GM_config.get("enConfDealTime")) {
    var e, n, t, a = Date.now();
    $(".meta-ribbon, time, .metaRibbon").not("." + EnstylerTimeSeen).each(function() {
      switch ($(this).addClass(EnstylerTimeSeen), e = $(this).attr("datetime"), void 0 !== e ? DealDate.setTime(1e3 * e) : (e = $(this).text(), DealDate.setTime(a - (60 * parseInt(e.replace(/.* ([0-9].*) [hu].*/, "$1")) + parseInt(e.replace(/.* ([0-9].*) m.*/, "$1"))) * enMs2Min)), 
      e = $(this).html(), n = (a - DealDate) / enMs2Min, t = ("" + DealDate).slice(16, 21), DEBUGXXX && enDebugLog("DealTimeDo: myTimeText: " + e), !0) {
       case t.length < 5 || 60 > n || n > 7200:
        return;

       case n > 1440:
        e += "&nbsp;(" + t + oclock + ")";
        break;

       case TodayStart > DealDate:
        e = yesterday + t + oclock;
        break;

       default:
        e += "&nbsp;(" + today + t + oclock + ")";
      }
      $(this).html(e);
    });
  }
}

function EnstylerLastSeen() {
  LastSeenOnce && (LastSeenOnce = !1, enSection.match(enMainSectionMatch) ? (enSeenArticle = GM_getValue(enSec, ""), SyncLastSeen(), EnstylerLastSeenDo(), "" == enLocParser.search && $("article").not(".threadWidget-item").each(function() {
    return $(this).length ? (GM_setValue(enSec, $(this).attr(enID)), GM_setValue(enSec + "Last", enSeenArticle), SaveLastSeen(), !1) : void 0;
  })) : EnstylerLastSeenLast());
}

function EnstylerLastSeenDo() {
  DEBUGXX && enDebugLog("Enter LastSeenDo: " + enSec), "" != enSec && (DEBUGXX && enDebugLog("LastSeenDo Execution: " + enSec + " " + enSeenArticle), GM_setValue("enLastCheck" + enSec, Date.now() / enMs2Min), 
  "" !== enSeenArticle || "" !== enLoadedArticle ? (GM_setValue(enSec + "Last", enSeenArticle), $("#" + enSeenArticle).addClass("enClassMarkArticle"), $("#" + enLoadedArticle).addClass("enClassMarkArticleLoad")) : GM_setValue(enSec, "thread_1"));
}

function EnstylerLastSeenLast() {
  var e = GM_getValue(enNewestBase + "LastSec", "");
  GM_setValue(e, GM_getValue(e + "Last", ""));
}

function EnstylerLastSeenSkip(e) {
  e == "#" + GM_getValue(enSec, "") && (GM_setValue(enSec, enSeenArticle), enSeenArticle = $(e).next().attr(enID), EnstylerLastSeenDo());
}

function enCheckUpdates() {
  if (GM_config.get("enConfInjectCSS")) {
    var e = Date.now() / enMs2Min - GM_getValue("enLastUpdateCheck", "0");
    DEBUG && enDebugLog("Update requested, intervall " + enUpdateInterval + " minutes , actual diff " + parseInt(e)), (e > enUpdateInterval || 0 > e) && (DEBUG && enDebugLog("Update started"), enUpdateCSS());
  }
}

function enUpdateCSS() {
  var e = parseInt(Date.now() / enMs2Min), n = enComposeUpdateOpt();
  enCacheExternalResource(enUpdateUrl + n, MyCSS), GM_setValue("enLastUpdateCheck", e), enSaveMyCSS();
}

function enComposeUpdateOpt() {
  var e = GM_getValue(enCssOpt, "");
  if ("" == e || !e.startsWith("#")) return "";
  e = e.replace(/\n/g, "");
  var n = e.split(";");
  e = "";
  for (var t = 0; t < n.length; t++) if ("" != n[t]) {
    var a = n[t].split(":");
    a.length < 2 || (e += "&" + a[1].slice(0, -1) + "=" + a[1]);
  }
  return e = "?" + e.slice(1), DEBUG && enDebugLog(e), e;
}

function EnstylerMenuActions() {
  return EnstylerNavRemove(), enMenuButton.setAttribute("style", "background-position: -.00071em -177em; width: .85786em; display: inline-block; height: 1.42929em; background-image: url(https://assets.mydealz.de/assets/img/icons_5a065.svg); background-repeat: no-repeat; background-size: 5.50071em 590.57214em;"), 
  $("#tour-filter .subNavMenu-layer").after(enMenuButton), enNoScript ? ($(".nav-link.navMenu-trigger").hide(), $("#tour-expired").hide(), $("#tour-expired").after('<div class="tGrid-cell hAlign--all-r subNavMenu subNavMenu--menu tGrid-cell vAlign--all-m subNav-item"><a class="ico ico--type-grid-subNavLayerText size--all-xxxl vAlign--all-m space--h-1" href="https://www.mydealz.de/?layout=grid"></a><a class="ico ico--type-list-subNavLayerActive size--all-xxxl vAlign--all-m space--h-1" href="https://www.mydealz.de/?layout=horizontal"></a><a class="ico ico--type-rows-subNavLayerText size--all-xxxl vAlign--all-m space--h-1" href="https://www.mydealz.de/?layout=text"></a></div>'), 
  $(".thread-list-sidebar").hide(), void $(".carousel").hide()) : (enInternational || EnstylerAddNav("Main", "<EN-LANG:discussion>", EnstylerSiteConfig("discussion"), "enMainDiscussion"), EnstylerAddNav("Main", "<EN-LANG:enstyler>", '<EN-LANG:enhref>" target="_blank', "enMainHomepage", "building"), 
  void EnstylerAddNav("MainButton", "<EN-LANG:settings>", showEnstylerConfig, EnstylerButton, "filter-subNavBg"));
}

function EnstylerAddNav(e, n, t, a, o) {
  (void 0 === o || "" == o) && (o = enNavIconPat);
  var i = !1, l = enMenuItemCode[e].replace(enPATTERN[enID], a).replace(enPATTERN[enTEXT], n);
  o != enNavIconPat && (l = l.split(enNavIconPat).join("--type-" + o)), "function" == typeof t ? i = !0 : l = l.replace(enPATTERN[enHREF], t), "M" == e[0] && ("" == enAddMain && $(".nav-link.navMenu-trigger").click(debounce(300, EnstylerMainDo)), 
  enAddMain += l, i && (enAddMainFunc[enAddMainCount++] = {
    ID: a,
    target: t
  }));
}

function EnstylerMainDo() {
  $(".popover-content nav .navMenu-div").first().before(enLangLocalize(enAddMain, enMenuLang, enLANG));
  var e = $(".popover--mainNav"), n = 35 * (enAddMain.split(enNavEntry).length - 1) + parseInt(e.attr("style").split("height: ")[1]);
  e.attr("style", e.attr("style").replace(/height: [0-9.]*px/, "height: " + n + "px"));
  for (var t = 0; enAddMainCount > t; t++) $("section #" + enAddMainFunc[t].ID).click(enAddMainFunc[t].target);
}

function EnstylerNavRemove() {
  enAddMain = "", enAddMainFunc = [], enAddMainCount = 0, $(".navMenu-page").unbind("click"), $("." + enNavEntry).remove();
}

function confLang(e) {
  return enLangLocalize("<EN-LANG:" + e + ">", enConfigLang, enLANG);
}

function showEnstylerConfig() {
  enGMConfigOpen ? GM_config.close() : (GM_config.open(), $(".popover--mainNav").remove(), enGMConfigOpen = !0);
}

function confLangOpen() {
  GM_config.set("enConfLang", GM_getValue("enLang", "")), $('.GM_config button[id$="_saveBtn"]').html(enConfigLang[enLANG].save), $('.GM_config button[id$="_closeBtn"]').html(enConfigLang[enLANG].close);
}

function SyncSettings() {
  EnGetValue(enCssOpt, enSetValue), EnGetValue(enSettings, enSetSettings);
}

function SaveSettings() {
  GM_config.get("enConfInjectCSS") && (EnSaveValue(enCssOpt, GM_getValue(enCssOpt)), enSaveMyCSS());
  for (var e = "", n = 0; n < enSaveSettings.length; n++) DEBUGXXX && enDebugLog("SaveSettings: " + n + " of " + enSaveSettings.length + " " + enSaveSettings[n]), e += enSaveSettings[n] + "=" + GM_config.get(enSaveSettings[n]) + "&";
  DEBUGXX && enDebugLog("SaveSettings: " + e), EnSaveValue(enSettings, e);
}

function SaveLastSeen() {
  if (enAutoSync) {
    var e = GM_config.get("enConfSyncTime") * enMs2Min / 2, n = Date.now() / enMs2Min, t = n - GM_getValue("enLastCheck" + enSec, "0");
    t > 5 && (delay = 500), DEBUGXX && enDebugLog("SaveLastSeen enLastCheck" + enSec + " dealy: " + e + "ms"), sleepAsync(function() {
      DEBUG && enDebugLog("LastSeen SAVE started"), EnSaveValue(enSec, GM_getValue(enSec, ""));
    }, GM_config.get("enConfSyncTime", 10) * enMs2Min / 2);
  }
}

function SyncLastSeen() {
  if (enAutoSync) {
    var e = Date.now() / enMs2Min, n = e - GM_getValue("enLastCheck" + enSec, "0");
    DEBUG && enDebugLog("LastSeen " + enSec + " requested, intervall " + enSyncInterval + " minutes , actual diff " + parseInt(n)), (n > enSyncInterval || 0 > n) && (DEBUG && enDebugLog("LastSeeen Update started"), 
    GM_setValue("enLastCheck" + enSec, e), EnGetValue(enSec, enSetLastSeen));
  }
}

function enSetLastSeen(e, n) {
  enLoadedArticle = n, EnstylerLastSeenDo(), enLoadedArticle.replace(/thread_/i, "") > enSeenArticle.replace(/thread_/i, "") && enSetValue(e + "Last", n);
}

function enSaveMyCSS() {
  EnSaveValue(MyCSS, GM_getValue(MyCSS).replace(/^.*?{/, "").replace(/} *@-moz-document.*/, ""), !1);
}

function checkSyncSettings() {
  var e = GM_config.fields.enSyncKeyInput.toValue();
  null === e && (e = $("#undefined_field_enSyncKeyInput").val());
  var n = GM_config.get("enConfSyncKey");
  DEBUGXXX && (enDebugLog("enConfSyncKey.input" + e), enDebugLog("enConfSyncKey.saved" + n)), e.length < 6 && (checkSyncReset(), e = enSyncOff), enSyncKey = e, GM_config.fields.enConfSyncKey.node.value = e, 
  GM_config.set("enConfSyncKey", e), GM_config.fields.enSyncKeyInput.value = e, GM_config.fields.enSyncKeyInput.reload(), DEBUGXXX && (enDebugLog("enConfSyncKey.value" + GM_config.fields.enSyncKeyInput.toValue()), 
  enDebugLog("enConfSyncKey.saved" + GM_config.get("enConfSyncKey")));
}

function checkSyncReset() {
  DEBUG && enDebugLog("checkSyncReset!!"), GM_config.fields.enSyncKeyInput.value = enSyncOff, GM_config.fields.enSyncKeyInput.reload(), $("#undefined_field_enSyncKeyInput").val(enSyncOff), syncCheckBug > 0 && ($("#undefined_field_enSyncKeyInput").on("change", function() {
    checkSyncSettings();
  }), syncCheckBug--);
}

function enSetSettings(e, n) {
  DEBUG && enDebugLog("enSetSettings: " + n);
  for (var t = n.split("&"), a = 0; a < t.length; a++) {
    GM_config.set("enConfSyncKey", enSyncOff);
    var o = t[a].split("=");
    o.length < 2 || (GM_config.fields[o[0]].value = o[1], GM_config.fields[o[0]].reload(), DEBUG && enDebugLog(o[0] + "=" + o[1]));
  }
}

function enSaveCSS() {
  enSendCSS(), enSetHome(), enUpdateCSS(), EnstylerHomeButton();
}

function enAmazonMobileRedirect() {
  var e = "" + enLocParser;
  return e.startsWith("https://www.amazon") ? ((DEBUG || DEBUGXX) && enDebugLog("On AMAZON ..."), GM_config.get("enConfAmazonRedirect") && ((DEBUG || DEBUGXX) && enDebugLog("AMAZON redirect enabled ..."), 
  e.includes("/gp/aw/d/") ? window.location.replace(e.replace("/gp/aw/d/", "/dp/")) : e.includes("/gp/aw/ol/") ? window.location.replace(e.replace("/gp/aw/ol/", "/gp/offer-listing/")) : (enDebugLog("AMAZON redirect failed ... redirect to main page"), 
  window.location = enLocParser.protocol + enLocParser.host)), !1) : !0;
}

function EnstylerStart() {
  if (EnstylerFixedNav(), DEBUG) var e, n = Date.now();
  EnstylerLastSeen(), DEBUG && (e = Date.now(), enDebugLog("Call lastseen took ms  : " + (e - n)), n = Date.now()), EnstylerDealTime(), DEBUG && (e = Date.now(), enDebugLog("Call dealtime took ms  : " + (e - n)), 
  n = Date.now()), EnstylerBlacklist(), DEBUG && (e = Date.now(), enDebugLog("Call blacklist took ms : " + (e - n)), n = Date.now()), EnstylerDealActions(), DEBUG && (e = Date.now(), enDebugLog("Call dealaction took ms: " + (e - n)));
}

function EnstylerRedo() {
  if (DEBUG) var e, n = Date.now(), t = Date.now();
  EnstylerLastSeenDo(), EnstylerPagePickerDo(), DEBUG && (e = Date.now(), enDebugLog("Call lastseen took ms  : " + (e - t)), t = Date.now()), EnstylerDealTimeDo(), DEBUG && (e = Date.now(), enDebugLog("Call dealtime took ms  : " + (e - t)), 
  t = Date.now()), EnstylerBlacklistDo(), DEBUG && (e = Date.now(), enDebugLog("Call blacklist took ms : " + (e - t)), t = Date.now()), EnstylerDealActionsDo(), DEBUG && (e = Date.now(), enDebugLog("Call dealaction took ms: " + (e - t))), 
  DEBUG && enDebugLog("DOMSubtreeModified took ms: " + (e - n));
}

function EnstylerDelayedInit() {
  var e = $(".nav").css("background-color"), n = shadeRGBColor($(".btn--mode-special").first().css("background-color"), .1), t = shadeRGBColor(e, .7);
  addStyleString(" .GM_config {background-color: " + e + " !important; color: " + t + "; top: " + enMainHeigth + "px !important;} .GM_config .section_header {background-color: " + shadeRGBColor(e, -.25) + " !important; color: " + t + " !important;} .nav-link-text:hover, .js-navDropDown-messages:hover, .js-navDropDown-activities:hover  { background-color: " + shadeRGBColor(e, .1) + " !important;} .GM_config input[type=button] { background-color: " + n + " !important; border-color: " + n + " !important; min-width: 10em;} .GM_config input[type=button]:hover, .btn--mode-special:hover { background-color: " + shadeRGBColor(n, .2) + " !important; border-color: " + shadeRGBColor(n, .2) + " !important;}"), 
  EnstylerMenuActions(), EnstylerPagePickerCreate(), $(".js-pagi-bottom").bind("DOMSubtreeModified", debounce(100, function() {
    EnstylerRedo();
  }));
}

function WaitForBody() {
  if (enAmazonMobileRedirect(), $("section, footer").length) {
    if (GM_config.get("enConfInjectCSS") && addStyleString(GM_getValue("Enstyler2_CSS", ""), 'domain("' + enLocParser.hostname), enLocParser.pathname.match(enDisableScript)) return enDebugLog("disable Enstyler for path: " + enLocParser.pathname), 
    void enDebugLog("regex: " + enDisableScript);
    WaitForDOM();
  } else setTimeout(WaitForBody, 10);
}

function WaitForDOM() {
  myColor = $(".nav, #navigation").css("background-color").replace(/rgba.*/, ""), $(".vwo-deal-button, #footer").length && "" == !myColor ? MAIN() : (DEBUG && enDebugLog(myColor), setTimeout(WaitForDOM, 100));
}

function MAIN() {
  DEBUG && (enInitTime = performance.now() - enInitTime), DEBUG && enDebugLog("Inittime: " + enInitTime + " ms");
  var e = Date.now();
  if (DEBUG && enDebugLog("Start Init"), EnstylerInit(), DEBUG && enDebugLog("Start CheckUpdate"), enCheckUpdates(), addStyleString(enCSS), document.body.appendChild(enGMFrame), "userstyles.org" != enInternationalSite) {
    var n = shadeRGBColor($(".bg--main").css("background-color"), -.08);
    addStyleString(".bg--off {background-color: " + n + "!important;}"), enMainHeigth = getOuterHeight("header"), EnstylerStart(), EnstylerStartupDelay = Date.now() - e, DEBUG && enDebugLog("Startup in ms: " + EnstylerStartupDelay), 
    EnstylerDelayedInit();
  } else DEBUG && enDebugLog("On Userstyle ..."), GM_config.get("enConfInjectCSS") && addStyleString(GM_getValue("Enstyler2_CSS", ""), "url(https://userstyles.org"), EnstylerHomeButton(), setUserClick(), 
  enSetHome(), GM_config.get("enConfInjectCSS") && addStyleString(".install-status { display: none; }"), "#style-info" == enLocParser.hash && showNotSaved();
}

function showEnstylerCSS() {
  enGetHome(), GM_config.open();
}

function EnstylerHomeButton() {
  $("#advancedsettings_area").attr("class", "advancedsettings_shown"), $(".advanced_button").remove(), $("select, input").unbind(), input.setAttribute("style", "font-size: 1.1em; padding: 0.8em;"), $("#button_middle").after(input), 
  window.scrollTo(0, 600);
}

function setUserClick() {
  $("#setting-455195").change(HideShowLogoSelect), $("#setting-451668").change(HideShowEnstyler);
}

function enGetHome() {
  var e, n, t, a = "";
  $("#style-settings select").each(function() {
    e = $(this).attr(enID), n = $(this).val(), t = $("option[value=" + n + "]").text(), a += "#" + e + ":" + n + ":" + t + ";\n";
  }), $("#style-settings input[type=text]").each(function() {
    e = $(this).attr(enID), n = $(this).val(), t = "RGB-Clolor", a += "#" + e + ":" + n + ":" + t + ";\n";
  }), $("#style-settings input:checked").each(function() {
    e = $(this).attr(enID), n = $(this).val(), t = $("label[for=" + e + "]").text(), a += "#" + e + ":" + n + ":" + t + ";\n";
  }), GM_config.set("saveOpt", a), GM_setValue(enCssOpt, a), EnSaveValue(enCssOpt, a);
}

function enSetHome() {
  input.value = confLang("options");
  var e = GM_getValue(enCssOpt, "");
  e = e.replace(/\n/g, "");
  var n = e.split(";");
  if ("" != e && e.startsWith("#")) {
    for (var t = 0; t < n.length; t++) {
      var a = n[t].split(":");
      a[0].startsWith("#setting") ? ($(a[0]).val(""), $(a[0]).val(a[1])) : a[0].startsWith("#option") ? $(a[0]).prop("checked", !0) : "" != a[0] && enDebugLog('ignoring unkown option: "' + a + '"');
    }
    addStyleString(GM_config.get("enConfInjectCSS") ? ".install-status { display: none; }" : ".install-status { display: inline; }"), HideShowLogoSelect(), HideShowEnstyler();
  }
}

function showNotSaved() {
  input.value = confLang("optnotsave"), EnstylerHomeButton();
}

function ShowHideItem(e, n, t, a) {
  $("#style-settings " + t).each(function() {
    -1 != $(this).text().indexOf(a) && ($(e).val() == n ? $(this).parent().addClass(enClassHidden) : $(this).parent().removeClass(enClassHidden));
  });
}

function HideShowLogoSelect() {
  ShowHideItem("#setting-455195", "ik-logo1", "label", "MyDealz Logo");
}

function HideShowEnstyler() {
  ShowHideItem("#setting-451668", "ik-compact1", "label", "... ");
}

function enSendCSS() {
  isFirefox && "#style-info" == enLocParser.hash && "string" == typeof GM_info.scriptHandler && GM_info.scriptHandler.match(/usi/i) && window.open(document.referrer + "/1/" + enComposeCSS());
}

function enCatchCSS() {
  var e = enLocParser.search.replace(/\?/, "#").replace(/=/g, ":").replace(/\&|$/g, ":notext;\n#");
  GM_setValue(enCssOpt, e), GM_setValue("enLastUpdateCheck", 0), window.close();
}

function enComposeCSS() {
  var e = GM_getValue(enCssOpt, "");
  if ("" == e || !e.startsWith("#")) return "";
  e = e.replace(/\n/g, "");
  var n = e.split(";");
  e = "";
  for (var t = 0; t < n.length; t++) if ("" != n[t]) {
    var a = n[t].split(":");
    a.length < 2 || (e += "&" + a[0] + "=" + a[1]);
  }
  return e = "?" + e.slice(1).replace(/#/g, ""), enDebugLog(e), e;
}

function mobileLog(e) {
  GM_setValue(saveLog, GM_getValue(saveLog) + e + "\n");
}

function mobileShowLog() {
  alert(GM_getValue(saveLog));
}

function mobileClearLog() {
  GM_setValue(saveLog, "Enstyler Log\n");
}

function EnstylerSiteConfig(e) {
  return enGetSiteConfig(enInternationalName, e);
}

function enGetSiteConfig(e, n) {
  return enSiteConfig.hasOwnProperty(e) && enSiteConfig[e].hasOwnProperty(n) ? enSiteConfig[e][n] : "";
}

function enLangLocalize(e, n, t) {
  return enDealLang.hasOwnProperty(t) || (t = "de"), e = e.replace(enLangPat, function(a, o) {
    return DEBUGXXX && (enDebugLog("enLangLocalize: " + e + " " + [ o ] + " " + t), enDebugLog(n[t])), n.hasOwnProperty(t) && n[t].hasOwnProperty(o) ? n[t][o] : o;
  }), e.match(enLangPat) ? enLangLocalize(e, n, t) : e;
}

function addStyleString(e, n) {
  if (void 0 === n && (n = ""), e.match(enUserScript.detect)) {
    "" == n && (n = enLocParser.hostname);
    var t = e.split(n);
    e = "";
    for (var a = 1; a < t.length; a++) -1 != t[a].indexOf("{") && (e += t[a].replace(enUserScript.split, "").replace(enUserScript.next, ""));
  }
  for (var o, i = 0, l = enCSSmax; e.length > l && (o = e.substring(l).indexOf("}.")) > 0; ) addStyleString(e.slice(i, l += o + 1)), i = l, l += enCSSmax;
  DEBUG && enDebugLog("applyed style length: " + (e.length - i));
  var s = document.createElement("style");
  s.innerHTML = e.slice(i), document.body.appendChild(s);
}

function capitalizeFirstLetter(e) {
  return e[0].toUpperCase() + e.slice(1);
}

function truncStringWord(e, n, t) {
  return void 0 === t && (t = " "), e.length > n ? (e = e.substr(0, n - 1), e.substr(0, e.lastIndexOf(t)) + "...") : e;
}

function sleepAsync(e, n) {
  setTimeout(e, n);
}

function shadeRGBColor(e, n) {
  if (void 0 === n && (n = .1), void 0 === e) return "rgba(0,0,0,0)";
  var t = e.split(","), a = 0 > n ? 0 : 255, o = 0 > n ? -1 * n : n, i = parseInt(t[0].slice(4)), l = parseInt(t[1]), s = parseInt(t[2]);
  return "rgb(" + (Math.round((a - i) * o) + i) + "," + (Math.round((a - l) * o) + l) + "," + (Math.round((a - s) * o) + s) + ")";
}

function debounce(e, n) {
  var t = null;
  return function() {
    clearTimeout(t), t = setTimeout(function() {
      n.call(this);
    }, e);
  };
}

function enCacheExternalResource(e, n) {
  GM_xmlhttpRequest({
    method: "GET",
    url: e,
    onload: function(t) {
      var a = t.responseText.replace(/\r\n/g, " ").replace(enStripComments, "").replace(enFixCSS, "100%");
      DEBUG && enDebugLog([ t.status, t.statusText, t.readyState, t.finalUrl, e, GM_getValue(enCssOpt, ""), t.responseHeaders ].join("\n") + "\n" + a.replace(/.*?(btn--mode-special[^}]*).*/, "$1}")), GM_setValue(n, a), 
      addStyleString(a);
    },
    onerror: function(e) {
      alert(confLang("cssfailed"));
    }
  });
}

function getOuterHeight(e) {
  e = "string" == typeof e ? document.querySelector(e) : e;
  var n = window.getComputedStyle(e), t = parseFloat(n.marginTop) + parseFloat(n.marginBottom);
  return Math.ceil(e.offsetHeight + t);
}

function enTranslateText(thisObj) {
  if (enLANG != enSiteLANG && thisObj.length) {
    var text = thisObj.html().replace(/\n|\r|\t/g, ""), html = text.replace(/.*?(<[ai].*)/, "$1");
    html === text && (html = "");
    var text = text.replace(/<(a|i).*$/, "");
    if ("" === text && (text = html, html = ""), text.length > enMaxTrans) return void (DEBUG && enDebugLog("translation to long:" + text));
    var query = enTranslateQuery.replace(/<ENSTYLER-LANG-HERE>/, enLANG).replace(/<ENSTYLER-HTML-HERE>/, encodeURI(text)), ret = GM_xmlhttpRequest({
      method: "GET",
      url: query,
      onload: function(res) {
        var trans = eval("(" + res.responseText + ")")[0][0][0];
        try {
          for (x = 1; x < 5; x++) trans += eval("(" + res.responseText + ")")[0][x][0];
        } catch (e) {}
        thisObj.html(trans + " " + html), DEBUG && (enDebugLog("Translate from: " + text), enDebugLog("===> " + trans + " " + html));
      }
    });
  }
}

function EnSaveValue(e, n, t) {
  if ("" != enUserName && enSyncKey != enSyncOff) {
    if (void 0 === t && (t = !0), DEBUGXX && enDebugLog("EnSaveValue crypt: " + t), e + n == enSaveUrlLast) return;
    enSaveUrlLast = e + n;
    var a = t ? enEncrypt(n) : LZString.compressToEncodedURIComponent(n), o = enSaveURL + "ID=" + genUserKey(e) + "&value=" + a;
    DEBUGXX && (enDebugLog("EnSaveValue URL: " + o), enDebugLog("EnSaveValue Key: " + e + " Value: " + n)), GM_xmlhttpRequest({
      method: "GET",
      url: o
    });
  }
}

function genUserKey(e) {
  return sha256_hex(enUserName + ":" + enSyncKey + "&key=" + e);
}

function EnGetValue(e, n, t) {
  if ("" == enUserName && (enUserName = GM_getValue("enConfSyncUser")), DEBUGXX && enDebugLog("enGetValue user: " + enUserName + " SyncID: " + enSyncKey + " key: " + e), "" != enUserName && enSyncKey != enSyncOff) {
    void 0 === t && (t = !0);
    var a = "https://dealz.rrr.de/enstyler/load.php?ID=" + genUserKey(e);
    DEBUGXX && enDebugLog("EnGetValue: " + a), GM_xmlhttpRequest({
      method: "GET",
      url: a,
      onload: function(a) {
        DEBUGXX && enDebugLog("EnCallback Key: " + e + " status=" + a.status), 200 === a.status && a.responseText.length > 5 ? (DEBUGXX && enDebugLog(enDecrypt(a.responseText)), n(e, t ? enDecrypt(a.responseText) : LZString.decompressFromEncodedURIComponent(a.responseText))) : DEBUGXX && enDebugLog("EnCallback Value: No stored value for " + e + a.responseText);
      }
    });
  }
}

function enSetValue(e, n) {
  DEBUGXX && enDebugLog("enSetValue " + e + " old: " + GM_getValue(e) + " new: " + n), GM_setValue(e + "", n + "");
}

function enEncrypt(e) {
  return btoa(sjcl.encrypt(sha256_hex(enUserName + ":" + enSyncKey), e));
}

function enDecrypt(e) {
  return sjcl.decrypt(sha256_hex(enUserName + ":" + enSyncKey), atob(e));
}

function sha256_hex(e) {
  return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(e));
}

var DEBUG = !1, DEBUGXX = !1, DEBUGXXX = !1, enLocParser = location, enInternationalSite = enLocParser.hostname.replace("www.", ""), enInternationalName = capitalizeFirstLetter(enInternationalSite.replace(/^\.|\..*/g, "")), enInternational = "Mydealz" != enInternationalName, enUpdateInterval = 1440, enMs2Min = 6e4, enUserLogin = !1, enUserName = "", enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1"), enSyncOff = "off", enSyncKey = enSyncOff, enAutoSync = !1, enSyncInterval = 5, isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

/Linux/i.test(navigator.userAgent) && void 0 !== GM_info.scriptHandler && GM_info.scriptHandler.startsWith("USI") && (isMobile = !0);

var saveLog = "enMobileLog", enDebugLog = console.error;

if (isMobile && (enDebugLog = mobileLog), DEBUG) {
  var enInitTime = performance.now();
  enDebugLog("DEBUG activated"), enDebugLog("International Site: " + enInternationalSite), enDebugLog("International Name: " + enInternationalName);
}

DEBUGXX && (enMs2Min = 1e4), DEBUGXXX && (enMs2Min = 1e3);

var enDisableScript = /settings$/, enLangPat = /<EN-LANG:(.*?)>/g, enLANG, enSiteLANG = void 0 === enSiteConfig[enInternationalName] ? "en" : enSiteConfig[enInternationalName].lang;

"" == (enLANG = GM_getValue("enLang", "")) && (GM_setValue("enLANG", ""), enLANG = enSiteLANG), DEBUG && (enDebugLog("Site Lang:     " + enSiteLANG), enDebugLog("Selected Lang: " + enLANG), enDebugLog("URL : " + enLocParser), 
enDebugLog("hostname : " + enLocParser.hostname), enDebugLog("pathname : " + enLocParser.pathname), enDebugLog("  search : " + enLocParser.search), enDebugLog("    hash : " + enLocParser.hash));

var enDealAction = [ '<a title="<EN-LANG:post>" class="link ico ico--pos-l ico--type-comment-blue linkPlain space--h-3"href="<ENSTYLER-HREF-HERE>#comment-form" data-handler="track" data-track="{&quot;action&quot;:&quot;scroll_to_comment_add_form&quot;,&quot;label&quot;:&quot;engagement&quot;}">', '<span class="hide--toW3"><EN-LANG:post></span><span class="hide--fromW3 hide--toW2"><EN-LANG:po></span>', "", "</a>", '<a title="<EN-LANG:remove>" class="link text--color-blue ico ico--type-bookmark-blue linkPlain ico--pos-l space--h-3"data-handler="track replace" data-replace="{&quot;endpoint&quot;:&quot;https://www.mydealz.de/threads/<ENSTYLER-THREADID-HERE>/remove&quot;,&quot;method&quot;:&quot;post&quot;}" data-track="{&quot;action&quot;:&quot;save_thread&quot;,&quot;label&quot;:&quot;engagement&quot;}">', '<span class="hide--toW3"><EN-LANG:remove></span><span class="hide--fromW3 hide--toW2"><EN-LANG:rem></span>', "", "</a>", '<a title="<EN-LANG:edit>" class="link text--color-blue ico ico--type-pencil-blue linkPlain ico--pos-l space--h-3"href="<ENSTYLER-HREF-HERE>/edit" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_Update startededit_form&quot;,&quot;beacon&quot;:true}">', '<span class="hide--toW3"><EN-LANG:edit></span><span class="hide--fromW3 hide--toW2"><EN-LANG:ed></span>', "", "<span></a>", '<a title="<EN-LANG:mail>" class="link text--color-blue ico ico--type-mail-blue linkPlain ico--pos-l space--h-3"href="mailto:?subject=<ENSTYLER-TEXT-HERE>" <span class="hide--toW3">', '<span class="hide--toW3"><EN-LANG:mail></span><span class="hide--fromW3 hide--toW2"><EN-LANG:ma></span>', "", "<span></a>", '<a title="<EN-LANG:mail>" class="btn btn--whatsapp btn--circle size--all-xs space--ml-2" style="background-color: #69be28;"', 'href="mailto:?subject=<ENSTYLER-TEXT-HERE>"><span class="ico ico--type-mail-white ico--reduce size--all-xxl">', "</span></a>", "</span></a>" ], enDealFlame = '<span class="vote-tempIco ico ico--type-flame2-red threadTempBadge-icon" style="position: unset; margin-left: .5em; font-size: 2em;"></span>', enDealIce = '<span class="vote-tempIco ico ico--type-snowflake-blueTint threadTempBadge-icon" style="position: unset; margin-left: .5em;"></span>', enHideTemp = ".threadTempBadge { display: none; } .flex--justify-space-between { justify-content: unset !important; }", enDealMarker = "#thread_", enDealAdd = "", enSocialAdd, enDealUnbook = !1, enDealFooter = "", enCSSDealz, enMyCSSID, myDealAction, myTouch, myFixHtml, myVotebar, myVotescale, myCompact, EnstylerPageEnum = "enPageEnum", selectList = document.createElement("select");

selectList.id = EnstylerPageEnum, selectList.setAttribute("class", EnstylerPageEnum), selectList.onchange = EnstylerPageAction;

var enClassHidden = "enClassHidden", enClassBlackDone = "enClassBlackDone", enBlacklisted = 0, unwantedRegex = [ /[\[\]\(\)\{\}\?\:\;\!\"\*\+\ ]/g, /[\[\]\(\)\{\}\?\.\:\;\!\"\*\+\,]/g ], enBlack, enBlackTrue, enWhite, enWhiteTrue, enBlackTemp, myFixedCSS = {
  every: ".enFixedNav { display: block; position: fixed; width: 100%; z-index: 120;} .subNav, .profileHeader, .tabbedInterface, .splitPage-wrapper {margin-top: <ENSTYLER-TEXT-HERE>px}",
  subnav: ".subNav {margin-top: 0 !important;} .nav-subheadline {margin-top: <ENSTYLER-TEXT-HERE>px}",
  discus: ".tGrid.page2-center.height--all-full {margin-top: calc(<ENSTYLER-TEXT-HERE>px + 10px);} #footer .page-content { padding-top: calc(<ENSTYLER-TEXT-HERE>px + 10px);}"
}, DealDate = new Date(), TodayStart = new Date(), EnstylerTimeSeen = "enTimeSeen", today = "", oclock = "", yesterday, enNewestBase = "enNewest" + enInternationalSite, enSec = enNewestBase + "-" + enSection.replace(/\//, ""), LastSeenOnce = !0, enSeenArticle = "", enLoadedArticle = "", enUpdateUrl = "https://userstyles.org/styles/128262/enstyler2-style-your-mydealz.css", MyCSS = "Enstyler2_CSS", enCssOpt = "EnstylerCssOpt", enMainSectionMatch = /^\/$|^\/hot$|^\/new$|^\/settings$|^\/discussed$|^\/hei%C3%9F$|^\/diskutiert$/, enHREF = "href", enID = "id", enTEXT = "text", enPATTERN = {
  href: /<ENSTYLER-HREF-HERE>/g,
  id: /<ENSTYLER-THREADID-HERE>/g,
  text: /<ENSTYLER-TEXT-HERE>/g
}, enNavEntry = "enNavEntry", enMenuItemCode = {
  Main: '<a class="enNavEntry navMenu-link" id="<ENSTYLER-THREADID-HERE>" href="<ENSTYLER-HREF-HERE>" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_main_target&quot;,&quot;beacon&quot;:true}"><span class="navMenu-link-ico ico ico--type-discussion-navMenuLayerItem navMenu-ico--selected--type-discussion navMenu-ico--hover--type-discussion"></span><ENSTYLER-TEXT-HERE></a>',
  Sub: '<li class="enNavEntry subNavMenu-item--separator test-tablink-discussed"><a  href="<ENSTYLER-HREF-HERE>" class="subNavMenu-item subNavMenu-link space--h-4 vAlign--all-m" id="<ENSTYLER-THREADID-HERE>" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_menu_target sort&quot;,&quot;label&quot;:&quot;diskutiert&quot;,&quot;beacon&quot;:true}"><span class="box--all-i size--all-xl vAlign--all-m"><ENSTYLER-TEXT-HERE></span><span class="js-vue-container--threadcount" data-handler="vue" data-vue="{&quot;count&quot;:null}"></span></a></li>',
  MainButton: '<a class="enNavEntry navMenu-link" id="<ENSTYLER-THREADID-HERE>"><span class="navMenu-link-ico ico  ico--type-discussion"></span><ENSTYLER-TEXT-HERE></a>',
  SubButton: '<li class="enNavEntry subNavMenu-item--separator test-tablink-discussed"><a  class="subNavMenu-item subNavMenu-link space--h-4 vAlign--all-m" id="<ENSTYLER-THREADID-HERE>"><span class="box--all-i size--all-xl vAlign--all-m"><ENSTYLER-TEXT-HERE></span></a></li>'
}, enMenuItemLength = enMenuItemCode.length, EnstylerButton = "EnstylerButton", enMenuButton = document.createElement("input");

enMenuButton.type = "button", enMenuButton.setAttribute(enID, "emergency"), enMenuButton.onclick = showEnstylerConfig, enMenuButton.value = "_";

var enNavIconPat = "--type-discussion", enAddMain = "", enAddMainFunc = [], enAddMainCount = 0, enJSAutoUpdate = GM_info.scriptWillUpdate, enUpdateWindow, enUnblackText = enLangLocalize("<EN-LANG:unblack> <ENSTYLER-TEXT-HERE> Dealz", enConfigLang, enLANG), enJSfieldDefs = {
  enstylerCSS: {
    section: [ confLang("features"), "" ],
    label: confLang("configcss"),
    type: "button",
    click: function() {
      enUpdateWindow = window.open("https://userstyles.org/styles/128262", "UserCSS", "left=0,top=0"), GM_setValue("enLastUpdateCheck", 0);
    }
  },
  enstylerJS: {
    label: confLang("userscript"),
    type: "button",
    click: function() {
      enUpdateWindow = window.open(DEBUG ? " https://greasyfork.org/scripts/24244-enstylerjs-develop/code/EnstylerJS Develop.user.js" : "https://greasyfork.org/scripts/24243-enstylerjs/code/EnstylerJS.user.js", "UserScript", "width=210,height=210,left=0,top=0"), 
      sleepAsync(enUpdateWindow.close, 5e3);
    }
  },
  dontCookies: {
    label: confLang("cookies"),
    type: "button",
    click: function() {
      window.open("https://addons.mozilla.org/firefox/addon/self-destructing-cookies/");
    }
  },
  mobileDebugClear: {
    label: "Clear Debuglog",
    type: "button",
    click: function() {
      mobileClearLog();
    }
  },
  mobileDebugShow: {
    label: "Show Debuglog on mobile",
    type: "button",
    click: function() {
      mobileShowLog();
    }
  },
  enConfInjectCSS: {
    label: confLang("injectcss"),
    type: "checkbox",
    default: !0
  },
  Section: {
    section: [ confLang("config"), "" ],
    type: "hidden"
  },
  enConfNavFixed: {
    label: confLang("navfixed"),
    type: "checkbox",
    default: !0
  },
  enConfDealAction: {
    label: confLang("dealaction"),
    type: "checkbox",
    default: !0
  },
  enConfDealVotebar: {
    label: confLang("dealvotebar"),
    type: "checkbox",
    default: !0
  },
  enConfDealVotescale: {
    label: confLang("dealvotescale"),
    type: "select",
    options: enSiteConfig.votescale,
    default: "500"
  },
  enConfTouch: {
    label: confLang("touch"),
    type: "checkbox",
    default: !0
  },
  enConfCompact: {
    label: confLang("compact"),
    type: "checkbox",
    default: !1
  },
  enConfCSSDealz: {
    label: confLang("cssdealz"),
    type: "checkbox",
    default: !0
  },
  enConfAmazonRedirect: {
    label: confLang("amazon"),
    type: "checkbox",
    default: !0
  },
  enConfPagePicker: {
    label: confLang("picker"),
    type: "checkbox",
    default: !0
  },
  enConfDealTime: {
    label: confLang("dealtime"),
    type: "checkbox",
    default: !0
  },
  enConfFixHtml: {
    label: confLang("fixhtml"),
    type: "checkbox",
    default: !0
  },
  enConfBlackEnable: {
    label: confLang("blacklist"),
    type: "checkbox",
    default: !0
  },
  enConfHideColder: {
    label: confLang("blackcold"),
    type: "select",
    options: enSiteConfig.blackcold,
    default: "-20"
  },
  enConfBlacklist: {
    label: confLang("black"),
    type: "text",
    size: 70,
    default: confLang("examples")
  },
  enConfWhitelist: {
    label: confLang("white"),
    type: "text",
    size: 70,
    default: ""
  },
  enConfUnblacklist: {
    label: confLang("unblack"),
    type: "button",
    click: function() {
      EnstylerBlacklistUnhide();
    }
  },
  enConfLang: {
    label: confLang("lang"),
    type: "select",
    options: enSiteConfig.languages,
    default: ""
  },
  enConfNoScript: {
    label: confLang("noscript"),
    title: confLang("noscripthint"),
    type: "checkbox",
    default: !1
  },
  syncsection: {
    section: [ confLang("syncconf"), "" ],
    type: "hidden"
  },
  enConfAutoSync: {
    label: confLang("autosync"),
    type: "checkbox",
    default: !0
  },
  enConfSyncTime: {
    label: confLang("synctime"),
    type: "select",
    options: enSiteConfig.synctimes,
    default: "10"
  },
  enSyncKeyInput: {
    label: confLang("synckey"),
    type: "text",
    size: 16,
    save: !1,
    default: "off"
  },
  enConfSyncKey: {
    type: "hidden",
    default: enSyncOff
  },
  enConfSync: {
    label: confLang("sync"),
    type: "button",
    click: function() {
      SyncSettings();
    }
  }
}, enSaveSettings = [ "enConfNavFixed", "enConfDealAction", "enConfDealVotebar", "enConfTouch", "enConfAmazonRedirect", "enConfPagePicker", "enConfFixHtml", "enConfDealTime", "enConfBlackEnable", "enConfHideColder", "enConfDealVotescale", "enConfBlacklist", "enConfWhitelist", "enConfLang", "enConfAutoSync", "enConfCompact" ], enHomefieldDefs = {
  saveOpt: {
    section: [ confLang("savecss"), "" ],
    label: confLang("howtocss"),
    type: "textarea",
    size: 70
  },
  enConfInjectCSS: {
    label: confLang("injectcss"),
    type: "checkbox",
    default: !0
  },
  enConfLang: {
    type: "hidden",
    options: enSiteConfig.languages,
    default: ""
  }
}, enGMFrame = document.createElement("div");

enGMFrame.setAttribute("class", "GM_config");

var enGMConfigOpen = !1, enRemoveConfig = [ {
  check: !1,
  switch: "enConfBlackEnable",
  remove: "enConfWhitelist"
}, {
  check: !1,
  switch: "enConfBlackEnable",
  remove: "enConfBlacklist"
}, {
  check: !1,
  switch: "enConfBlackEnable",
  remove: "enConfHideColder"
}, {
  check: !1,
  switch: "enConfBlackEnable",
  remove: "enConfUnblacklist"
} ], enSettings = "enSettings", syncCheckBug = 1;

if (window.location.hostname.endsWith("userstyles.org")) GM_config.init({
  id: "GM_config",
  title: DEBUG ? confLang("headline") + " >> Debug <<" : confLang("headline") + " CSS",
  fields: enHomefieldDefs,
  events: {
    open: function() {
      confLangOpen();
    },
    save: function() {
      enSaveCSS(), GM_config.close(), sleepAsync(window.close, 1e3);
    },
    close: function() {
      enGMConfigOpen = !1;
    }
  },
  frame: enGMFrame
}); else {
  var enFixedNavLast = !1;
  GM_config.init({
    id: enInternational ? "GM_config" + enInternationalSite : "GM_config",
    title: DEBUG ? confLang("headline") + " >> Debug <<" : confLang("headline"),
    fields: enJSfieldDefs,
    events: {
      init: function() {
        GM_config.fields.enSyncKeyInput.value = GM_config.fields.enConfSyncKey.value;
      },
      open: function(e) {
        syncCheckBug = 1, GM_config.get("enConfSyncKey").length < 6 && (DEBUG && enDebugLog("GM_confit.init enConfSyncKey: " + GM_config.get("enConfSyncKey")), GM_config.set("enConfSyncKey", enSyncOff), checkSyncReset()), 
        $("#GM_config_field_enSyncKeyInput").on("change", function() {
          checkSyncSettings();
        }), enFixedNavLast = GM_config.get("enConfNavFixed"), confLangOpen(), $(enRemoveConfig).each(function() {
          GM_config.get(this["switch"]) == this.check && GM_config.fields[this.remove].remove();
        }), enJSAutoUpdate && GM_config.fields.enstylerJS.remove(), isFirefox || (GM_config.fields.dontCookies.remove(), GM_config.fields.enConfNoScript.remove()), (DEBUG || DEBUGXX || DEBUGXXX) && isMobile ? enDebugLog("Debug on mobile device detected ...") : (GM_config.fields.mobileDebugShow.remove(), 
        GM_config.fields.mobileDebugClear.remove());
      },
      save: function() {
        "auto" == GM_config.get("enConfLang") ? GM_setValue("enLang", "") : GM_setValue("enLang", GM_config.get("enConfLang")), SaveSettings(), GM_setValue("enNoScript", GM_config.get("enConfNoScript")), window.location.reload(!1);
      },
      close: function() {
        enGMConfigOpen = !1, enCheckUpdates();
      }
    },
    frame: enGMFrame
  }), enSyncKey = GM_config.get("enConfSyncKey"), enAutoSync = GM_config.get("enConfAutoSync"), enSyncInterval = GM_config.get("enConfSyncTime", enSyncInterval);
}

var enCSS = '.threadWidget-footer::after {display: none !important}; .GM_config {left: 5% !iportant; top: 8% !important; height: auto !important; max-width: 35em !important; background-color: white;} .GM_config input, .GM_config button, .GM_config textarea { border: 1px solid; margin: 0.5em 0em 0.2em 1em; padding: 0.1em;} .GM_config .reset { font-size: 9pt; padding-right: 1em; } .GM_config { border: none !important; box-shadow: 1px 6px 9px -1px rgba(0, 0, 0, 0.3); left: 8% !important; height: auto !important; min-width: 21em; max-width: 37em !important; } .GM_config .config_header {font-size: 14pt !important; border: none !important; padding-top: 0.5em; color: #69be28; font-weight: bold; text-align: center;} .GM_config .section_header { border: none !important; background-color:#005293 !important; color: #8eaacd !important; text-align: center; margin-top: 1em;} .GM_config .field_label:hover {color: white;} .GM_config div[id$="_section_0"] {text-align: center;} .GM_config .config_var {display: inline-block;} .GM_config .field_label {display: inline-block; min-width: 14em;  margin-left: 2em; } .GM_config button, .GM_config input[type=button] { font-weight: bold; text-align: center; color: #fff; background-color:  #58a618 !important; } .GM_config button:hover {background-color: #a5d867 !important; border-color: #a5d867 !important;} .enClassHidden, #EnPopup_closeBtn {display: none;}', enMainHeigth, input = document.createElement("input");

input.type = "button", input.setAttribute(enID, EnstylerButton), input.onclick = showEnstylerCSS, input.value = confLang("options"), !enLocParser.hostname.endsWith("usertyle.org") && enLocParser.search.match(/ik-maxwidth/i) && enCatchCSS();

var isOpera = !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0, isFirefox = "undefined" != typeof InstallTrigger, isSafari = /constructor/i.test(window.HTMLElement) || function(e) {
  return "" + e == "[object SafariRemoteNotification]";
}(!window.safari || "undefined" != typeof safari && safari.pushNotification), isIE = !!document.documentMode, isEdge = !isIE && !!window.StyleMedia, isChrome = !!window.chrome && !!window.chrome.webstore, isBlink = (isChrome || isOpera) && !!window.CSS, enNoScript = GM_getValue("enNoScript", !1);

isFirefox && enNoScript && "userstyles.org" != enInternationalSite && window.addEventListener("beforescriptexecute", function(e) {
  e.stopPropagation(), e.preventDefault();
}, !0);

var enUserScript = {
  detect: /.*?@-moz-document .*?\{\s*/,
  split: /^.*?\{/,
  next: /}\s*@-moz-document.*/
}, enCSSmax = 16100, enStripComments = /\/\*.*?\*\/|   *|\t/g, enFixCSS = /1111.11%/g, enTranslateQuery = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=<ENSTYLER-LANG-HERE>&dt=t&q=<ENSTYLER-HTML-HERE>", enMaxTrans = 300, enSaveURL = "https://dealz.rrr.de/enstyler/save.php?", enSaveUrlLast = "";

WaitForBody();