Facebook
From Big Goat, 2 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 175
  1. DDG.Data.Experiments = {
  2.     about_module: {
  3.         versions: ["v35-1", "v35-2", "v35-3", "v35-4", "v36-7", "v37-1", "v37-2", "v37-3"],
  4.         variants: ["a", "b"]
  5.     },
  6.     stack_overflow: {
  7.         versions: ["v35-5", "v35-6", "v35-7", "v36-1", "v36-2", "v36-3"],
  8.         variants: ["a", "b"]
  9.     },
  10.     spelling: {
  11.         versions: ["v33-6", "v33-7", "v34-1", "v34-2", "v34-3"],
  12.         variants: ["a", "b"]
  13.     },
  14.     region_override: {
  15.         versions: ["v38-2", "v38-3", "v38-4", "v38-5", "v38-6", "v38-7", "v39-1", "v39-2"],
  16.         variants: ["a", "b"]
  17.     },
  18.     control: {
  19.         versions: ["v39-3", "v39-4", "v39-5", "v39-6", "v39-7", "v40-1", "v40-2", "v40-3", "v40-4", "v40-5", "v40-6", "v40-7"],
  20.         variants: ["a", "b"]
  21.     },
  22.     filter_label: {
  23.         versions: ["v41-1", "v41-2", "v41-3", "v41-4", "v41-5", "v41-6", "v41-7"],
  24.         variants: ["a", "b", "c", "d"]
  25.     },
  26.     filters_above_organics: {
  27.         versions: ["v42-1", "v42-2", "v42-3", "v42-4", "v42-5", "v42-6", "v42-7"],
  28.         variants: ["a", "b", "c", "d"]
  29.     },
  30.     organic_ux: {
  31.         versions: ["v44-1", "v44-2", "v44-3", "v44-4", "v44-5", "v44-6", "v44-7"],
  32.         variants: ["a", "b", "c", "d", "e"],
  33.         locale: "en_us"
  34.     },
  35.     static_news: {
  36.         versions: ["v47-6", "v47-7", "v48-1", "v48-2", "v48-3", "v48-4", "v48-5"],
  37.         variants: ["a", "b"]
  38.     },
  39.     control2: {
  40.         versions: ["v51-2", "v51-3", "v51-4", "v51-5"],
  41.         variants: ["a", "b"]
  42.     },
  43.     safe_search_filter: {
  44.         versions: ["v52-1", "v52-2", "v52-3", "v52-4", "v52-5", "v52-6", "v52-7"],
  45.         variants: ["a", "b"]
  46.     },
  47.     map_module: {
  48.         versions: ["v57-1", "v57-2", "v57-3", "v57-4", "v57-5", "v57-6", "v57-7"],
  49.         variants: ["a", "b"],
  50.         locale: "en_us"
  51.     },
  52.     images_ux: {
  53.         versions: ["v58-1"],
  54.         variants: ["a", "b"]
  55.     },
  56.     images_ux_detail: {
  57.         versions: ["v58-6", "v58-7"],
  58.         variants: ["a", "b"]
  59.     },
  60.     images_ux_filters: {
  61.         versions: ["v59-1", "v59-2", "v59-3"],
  62.         variants: ["a", "b"],
  63.         englishOnly: true
  64.     },
  65.     placeholder_delay: {
  66.         versions: ["v61-1", "v61-2", "v61-3"],
  67.         variants: ["a", "b"]
  68.     },
  69.     back_button: {
  70.         versions: ["v63-1", "v63-2", "v63-3", "v63-4", "v63-5", "v63-6"],
  71.         variants: ["a", "b"]
  72.     },
  73.     fixed_ux_header: {
  74.         versions: ["v64-3", "v64-4", "v64-5", "v64-6", "v64-7"],
  75.         variants: ["a", "b"]
  76.     },
  77.     ad_layouts: {
  78.         versions: ["v66-1", "v66-2", "v66-3", "v66-4", "v66-5", "v66-6", "v66-7", "v67-1"],
  79.         variants: ["a", "b", "c"]
  80.     },
  81.     ad_layouts_2: {
  82.         versions: ["v67-2", "v67-3", "v67-4", "v67-5", "v67-6", "v67-7"],
  83.         variants: ["b", "c"]
  84.     },
  85.     serp_ui: {
  86.         versions: ["v88-3", "v88-4", "v88-5", "v88-6", "v88-7", "v89-1", "v89-2", "v89-3", "v89-4"],
  87.         variants: ["q", "r"],
  88.         platformName: "androidwos"
  89.     },
  90.     chrome_desktop_us_portableapps_control: {
  91.         versions: ["v121-2", "v121-3", "v121-4", "v121-5", "v121-6", "v121-7", "v122-1", "v122-2", "v122-3", "v122-4", "v122-5", "v122-6", "v122-7"],
  92.         variants: ["o"],
  93.         locale: "en_us",
  94.         desktopOnly: true,
  95.         displayBrowserName: "Chrome"
  96.     },
  97.     serp_show_hide_bolding: {
  98.         versions: ["v124-1", "v124-2", "v124-3", "v124-4", "v124-5", "v124-6", "v124-7", "v125-1", "v125-2", "v125-3", "v125-4"],
  99.         variants: ["a", "b", "c"]
  100.     },
  101.     green_urls: {
  102.         versions: ["v127-1", "v127-2", "v127-3", "v127-4", "v127-5", "v127-6", "v127-7", "v128-1"],
  103.         variants: ["a", "b", "c", "d"]
  104.     },
  105.     chrome_desktop_store_install_en: {
  106.         allocation: [0.5, 1],
  107.         variants: ["e", "f"],
  108.         desktopOnly: true,
  109.         englishOnly: true,
  110.         atb: true,
  111.         active: false,
  112.         displayBrowserName: "Chrome",
  113.         canInstallExtension: true
  114.     },
  115.     chrome_desktop_store_install_non_en: {
  116.         allocation: [0.5, 1],
  117.         variants: ["g", "h"],
  118.         desktopOnly: true,
  119.         nonEnglishOnly: true,
  120.         atb: true,
  121.         active: false,
  122.         displayBrowserName: "Chrome",
  123.         canInstallExtension: true
  124.     },
  125.     serp_footer: {
  126.         versions: ["v129-6", "v129-7", "v130-1", "v130-2", "v130-3", "v130-4", "v130-5", "v130-6"],
  127.         englishOnly: true,
  128.         desktopOnly: true,
  129.         variants: ["e", "f"]
  130.     },
  131.     safe_search_moderate_default: {
  132.         versions: ["v136-2", "v136-3", "v136-4", "v136-5", "v136-6", "v136-7", "v137-1", "v137-2"],
  133.         variants: ["a", "b"]
  134.     },
  135.     region_toggle_default: {
  136.         versions: ["v140-2", "v140-3", "v140-4", "v140-5", "v140-6", "v140-7", "v141-1", "v141-2", "v141-3"],
  137.         variants: ["a", "b"],
  138.         desktopOnly: true
  139.     },
  140.     deemphasize_http_links: {
  141.         versions: ["v143-7", "v144-1", "v144-2", "v144-3", "v144-4", "v144-5", "v144-6"],
  142.         variants: ["a", "b", "c"]
  143.     },
  144.     no_ads: {
  145.         versions: ["v148-2", "v148-3", "v148-4", "v148-5", "v148-6"],
  146.         variants: ["a", "b"],
  147.         desktopOnly: true
  148.     },
  149.     fonts: {
  150.         versions: ["v154-1", "v154-2", "v154-3", "v154-4", "v154-5", "v154-6"],
  151.         variants: ["a", "b"],
  152.         mobileAppVariants: {
  153.             sa: "a",
  154.             sb: "b",
  155.             sc: "a",
  156.             sd: "b"
  157.         }
  158.     },
  159.     ui_updates: {
  160.         pixelId: "uiu",
  161.         versions: ["v155-1", "v155-2", "v155-3", "v155-4", "v155-5", "v155-6", "v155-7", "v156-1", "v156-2", "v156-3", "v156-4", "v156-5", "v156-6", "v156-7"],
  162.         variants: ["a", "b"],
  163.         mobileAppVariants: {
  164.             sa: "a",
  165.             sb: "b",
  166.             sc: "a",
  167.             sd: "b"
  168.         }
  169.     },
  170.     post_install_onboarding: {
  171.         versions: ["v157-1", "v157-2", "v157-3", "v157-4", "v157-5", "v157-6", "v157-7"],
  172.         variants: ["a", "b"],
  173.         desktopOnly: true
  174.     },
  175.     regions_toggle_exp: {
  176.         pixelId: "rtl",
  177.         versions: ["v158-1", "v158-2", "v158-3", "v158-4", "v158-5", "v158-6", "v158-7", "v159-1", "v159-2", "v159-3", "v159-4", "v159-5", "v159-6", "v159-7"],
  178.         variants: ["a", "b"],
  179.         countries: ["DE", "FR", "PL", "CA", "IT", "ES", "AU", "BR", "NL", "GB", "ID"],
  180.         desktopOnly: true
  181.     },
  182.     welcome_message: {
  183.         pixelId: "wcm",
  184.         versions: ["v163-1", "v163-2", "v163-3", "v163-4", "v163-5", "v163-6"],
  185.         variants: ["a", "b"],
  186.         desktopOnly: true,
  187.         englishOnly: true
  188.     },
  189.     less_prominent_answerbar: {
  190.         pixelId: "lpab",
  191.         versions: ["v163-7", "v164-1", "v164-2", "v164-3", "v164-4", "v164-5", "v164-6"],
  192.         variants: ["a", "b"],
  193.         desktopOnly: true
  194.     },
  195.     settings_dropdown: {
  196.         pixelId: "sdd",
  197.         versions: ["v165-3", "v165-4", "v165-5", "v165-6", "v165-7", "v166-1", "v166-2"],
  198.         variants: ["a", "b", "c"],
  199.         desktopOnly: true,
  200.         englishOnly: true
  201.     },
  202.     welcome_message_2: {
  203.         pixelId: "wcm2",
  204.         versions: ["v166-3", "v166-4", "v166-5", "v166-6", "v166-6", "v167-1"],
  205.         variants: ["a", "b"],
  206.         desktopOnly: true,
  207.         englishOnly: true
  208.     },
  209.     homepage_landing: {
  210.         allocation: [0.033, 0.066, 0.1],
  211.         variants: ["a", "b", "c"],
  212.         desktopOnly: true,
  213.         englishOnly: true,
  214.         atb: true,
  215.         active: false,
  216.         canInstallExtension: true,
  217.         defaultThemeOnly: true,
  218.         stickyAtbVariant: true
  219.     },
  220.     homepage_fullbleed_landing: {
  221.         allocation: [0, 0.2, 0.4],
  222.         variant: "g",
  223.         variants: ["x", "w"],
  224.         desktopOnly: true,
  225.         englishOnly: true,
  226.         atb: true,
  227.         active: false,
  228.         canInstallExtension: true,
  229.         defaultThemeOnly: true,
  230.         minScreenSize: {
  231.             width: 800,
  232.             height: 600
  233.         },
  234.         filter: function() {
  235.             return window.locale !== "en_GB"
  236.         }
  237.     },
  238.     homepage_fullbleed_regional_landing: {
  239.         allocation: [0, 1],
  240.         variant: "g",
  241.         variants: ["y"],
  242.         desktopOnly: true,
  243.         englishOnly: true,
  244.         atb: true,
  245.         active: false,
  246.         canInstallExtension: true,
  247.         defaultThemeOnly: true,
  248.         minScreenSize: {
  249.             width: 800,
  250.             height: 600
  251.         },
  252.         filter: function() {
  253.             return window.locale === "en_GB"
  254.         }
  255.     },
  256.     welcome_message_3: {
  257.         pixelId: "wcm3",
  258.         versions: ["v168-1", "v168-2", "v168-3", "v168-4", "v168-5", "v168-6", "v168-7"],
  259.         variants: ["a", "b", "c", "d"],
  260.         desktopOnly: true,
  261.         englishOnly: true
  262.     },
  263.     extension_optin: {
  264.         versions: ["v169-3", "v169-4", "v169-5", "v169-6", "v169-7", "v170-1", "v170-2", "v170-3", "v170-4", "v170-5"],
  265.         allocation: [0.5, 1],
  266.         variants: ["k", "l"],
  267.         desktopOnly: true,
  268.         englishOnly: true,
  269.         canInstallExtension: true
  270.     },
  271.     mobile_cards: {
  272.         pixelId: "mcds",
  273.         versions: ["v169-2", "v169-3", "v169-4", "v169-5", "v169-6", "v169-7", "v170-1", "v170-7", "v171-1", "v171-2"],
  274.         variants: ["a", "b"],
  275.         appsOnly: true,
  276.         displayBrowserName: "DDG iPhone",
  277.         mobileAppVariants: {
  278.             sc: "a",
  279.             se: "b"
  280.         }
  281.     },
  282.     ct_retention_exp: {
  283.         pixelId: "ctexp",
  284.         versions: ["v174-7", "v175-1", "v175-2", "v175-3", "v175-4", "v175-5", "v175-6", "v175-7"],
  285.         variants: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
  286.         countries: ["AT", "AU", "BE", "BR", "CA", "CH", "DE", "DK", "ES", "FI", "FR", "GB", "ID", "IE", "IN", "IT", "JP", "MX", "NL", "NO", "NZ", "PL", "RU", "SE", "SG", "US"],
  287.         desktopOnly: true
  288.     },
  289.     post_install_homepage: {
  290.         pixelId: "pih",
  291.         versions: ["v177-3", "v177-4", "v177-5", "v177-6", "v177-7", "v178-1"],
  292.         variants: ["a", "b"],
  293.         desktopOnly: true,
  294.         englishOnly: true,
  295.         canInstallExtension: true,
  296.         defaultThemeOnly: true,
  297.         minScreenSize: {
  298.             width: 900,
  299.             height: 600
  300.         }
  301.     },
  302.     mixed_modules: {
  303.         variants: ["a", "b"],
  304.         pixelId: "miaexp",
  305.         versions: ["v192-7", "v193-1", "v193-2", "v193-3", "v193-4", "v193-5", "v193-6", "v193-7"],
  306.         mobileAppVariants: {
  307.             sc: "a",
  308.             se: "b"
  309.         }
  310.     },
  311.     mobile_cards_refinements: {
  312.         variants: ["a", "b", "c"],
  313.         pixelId: "crdexp",
  314.         versions: ["v203-2", "v203-3", "v203-4", "v203-5", "v203-6", "v203-7", "v204-1"],
  315.         mobileAppVariants: {
  316.             sc: "a",
  317.             sd: "b",
  318.             se: "c"
  319.         }
  320.     },
  321.     autocomplete_delay: {
  322.         variants: ["a", "b"],
  323.         pixelId: "acdexp",
  324.         versions: ["v208-3", "v208-4", "v208-5", "v208-6", "v208-7", "v209-1"]
  325.     },
  326.     organic_atb_measure: {
  327.         allocation: [0, 0.1],
  328.         variant: "r",
  329.         variants: ["z"],
  330.         desktopOnly: true,
  331.         englishOnly: true,
  332.         atb: true,
  333.         active: false,
  334.         canInstallExtension: true
  335.     },
  336.     mobile_header: {
  337.         pixelId: "mhdr",
  338.         versions: ["v211-4", "v211-5", "v211-6", "v211-7", "v212-1", "v212-2", "v212-3"],
  339.         variants: ["a", "b"],
  340.         appsOnly: true,
  341.         mobileAppVariants: {
  342.             sc: "a",
  343.             se: "b"
  344.         }
  345.     },
  346.     home_brand_messaging: {
  347.         allocation: [0, 0.1, 0.2],
  348.         variants: ["a", "d"],
  349.         desktopOnly: true,
  350.         englishOnly: true,
  351.         atb: true,
  352.         active: false,
  353.         canInstallExtension: true,
  354.         defaultThemeOnly: true,
  355.         minScreenSize: {
  356.             width: 800,
  357.             height: 600
  358.         }
  359.     },
  360.     dynamic_slotting: {
  361.         pixelId: "sltret",
  362.         versions: ["v213-2", "v213-3", "v213-4", "v213-5", "v213-6", "v213-7", "v214-1", "v214-2"],
  363.         variants: ["a", "b"],
  364.         mobileAppVariants: {
  365.             sc: "a",
  366.             se: "b"
  367.         }
  368.     },
  369.     privacy_nudge: {
  370.         allocation: [0.3, 0.5, 0.7],
  371.         variant: "r",
  372.         variants: ["y", "z"],
  373.         desktopOnly: true,
  374.         englishOnly: true,
  375.         atb: true,
  376.         active: false,
  377.         canInstallExtension: true,
  378.         displayBrowserName: "Chrome"
  379.     },
  380.     ct_test: {
  381.         pixelId: "cttest",
  382.         versions: ["v217-2", "v217-3"],
  383.         variants: ["a", "b"]
  384.     },
  385.     larger_extension_tracker_list: {
  386.         allocation: [0.3, 0.5, 0.7],
  387.         variant: "l",
  388.         variants: ["m", "n"],
  389.         desktopOnly: true,
  390.         atb: true,
  391.         active: false,
  392.         canInstallExtension: true
  393.     },
  394.     desktop_mobile_app_promo: {
  395.         allocation: [0, 0.2, 0.4, 0.8],
  396.         variant: "p",
  397.         variants: ["v", "w", "x"],
  398.         desktopOnly: true,
  399.         englishOnly: true,
  400.         trap: true,
  401.         atb: true,
  402.         active: false,
  403.         canInstallExtension: true,
  404.         displayBrowserName: "Chrome"
  405.     },
  406.     cross_product_promotion_mobile: {
  407.         allocation: [0.6, 0.7, 0.8, 0.9, 1],
  408.         variant: "x",
  409.         variants: ["u", "z", "m", "n"],
  410.         mobileOnly: true,
  411.         englishOnly: true,
  412.         atb: true,
  413.         active: false,
  414.         trap: true,
  415.         stickyAtbVariant: true,
  416.         displayBrowserName: "Safari",
  417.         filter: function(a) {
  418.             return (a.device.isSafari && a.device.isEnglish && a.device.isIOS8p && !a.device.isIPad)
  419.         }
  420.     },
  421.     msh2exp: {
  422.         variants: ["a", "b"],
  423.         versions: ["v234-7", "v235-1", "v235-2", "v235-3", "v235-4", "v235-5", "v235-6"],
  424.         pixelId: "msh2exp",
  425.         appsOnly: true,
  426.         mobileAppVariants: {
  427.             sc: "a",
  428.             se: "b"
  429.         },
  430.         filter: function(a) {
  431.             return a.device && a.device.isMobile
  432.         }
  433.     },
  434.     extension_fingerprint_protection_control: {
  435.         allocation: [0.8, 0.9],
  436.         variant: "c",
  437.         variants: ["k"],
  438.         active: true,
  439.         atb: true,
  440.         canInstallExtension: true
  441.     },
  442.     extension_fingerprint_protection_exp: {
  443.         allocation: [0.9, 1],
  444.         variant: "f",
  445.         variants: ["k"],
  446.         active: true,
  447.         atb: true,
  448.         canInstallExtension: true
  449.     },
  450.     default_region_toggle: {
  451.         pixelId: "drt",
  452.         versions: ["v236-2", "v236-3", "v236-4", "v236-5", "v236-6", "v236-7", "v237-1", "v237-2", "v237-3", "v237-4", "v237-5", "v237-6", "v238-7"],
  453.         variants: ["a", "b"],
  454.         countries: ["AU", "AT", "DK", "FI", "FR", "DE", "IT", "IE", "NZ", "NO", "ES", "SE", "GB"]
  455.     }
  456. };
  457. DDG.Data.Onboarding = {
  458.     _: {},
  459.     a: {
  460.         description: "UrbanDictionary campaign 1",
  461.         variant: "z",
  462.         urbanDictionaryLandingPage: true
  463.     },
  464.     b: {},
  465.     c: {
  466.         description: "UrbanDictionary campaign 2",
  467.         variant: "z",
  468.         urbanDictionaryLandingPage: true
  469.     },
  470.     d: {
  471.         description: "UrbanDictionary campaign 3",
  472.         variant: "z",
  473.         urbanDictionaryLandingPage: true
  474.     },
  475.     e: {
  476.         description: "UrbanDictionary campaign 4",
  477.         variant: "z",
  478.         urbanDictionaryLandingPage: true
  479.     },
  480.     f: {},
  481.     g: {},
  482.     h: {},
  483.     i: {},
  484.     j: {},
  485.     k: {
  486.         description: "UrbanDictionary campaign 7",
  487.         variant: "z",
  488.         urbanDictionaryLandingPage: true
  489.     },
  490.     l: {
  491.         description: "UrbanDictionary campaign 8",
  492.         variant: "z",
  493.         urbanDictionaryLandingPage: true
  494.     },
  495.     m: {
  496.         description: "UrbanDictionary campaign 9",
  497.         variant: "z",
  498.         urbanDictionaryLandingPage: true
  499.     },
  500.     n: {
  501.         description: "UrbanDictionary campaign 10",
  502.         variant: "z",
  503.         urbanDictionaryLandingPage: true
  504.     },
  505.     o: {
  506.         description: "UrbanDictionary campaign 11",
  507.         variant: "z",
  508.         urbanDictionaryLandingPage: true
  509.     },
  510.     p: {
  511.         description: "UrbanDictionary campaign 12",
  512.         variant: "z",
  513.         urbanDictionaryLandingPage: true
  514.     },
  515.     q: {
  516.         description: "UrbanDictionary campaign 13",
  517.         variant: "z",
  518.         urbanDictionaryLandingPage: true
  519.     },
  520.     r: {
  521.         description: "UrbanDictionary campaign 14",
  522.         variant: "z",
  523.         urbanDictionaryLandingPage: true
  524.     },
  525.     s: {
  526.         description: "UrbanDictionary campaign 15",
  527.         variant: "z",
  528.         urbanDictionaryLandingPage: true
  529.     },
  530.     t: {},
  531.     u: {
  532.         description: "PortableApps One Button Modal",
  533.         modalButtons: 1
  534.     },
  535.     v: {
  536.         description: "Youtube Video Campaign"
  537.     },
  538.     w: {},
  539.     x: {
  540.         description: "Youtube Video Campaign"
  541.     },
  542.     y: {},
  543.     z: {
  544.         description: "Pagefair 2",
  545.         variant: "y",
  546.         urbanDictionaryLandingPage: true
  547.     }
  548. };
  549. DDG.Data.Apps = {
  550.     isIPhone: "https://itunes.apple.com/us/app/id663592361?mt=8",
  551.     isAndroid: "market://details?id=com.duckduckgo.mobile.android"
  552. };
  553. ! function(a) {
  554.     a.Data.Homepage = {
  555.         queries: [{
  556.             href: "/?q=tilt+shift+images&ia=images",
  557.             label: "tilt shift images"
  558.         }, {
  559.             href: "/?q=thailand+beach+images&ia=images",
  560.             label: "thailand beach images"
  561.         }, {
  562.             href: "/?q=gopro+videos&ia=videos",
  563.             label: "gopro videos"
  564.         }, {
  565.             href: "/?q=jimmy+fallon+videos&ia=videos",
  566.             label: "jimmy fallon videos"
  567.         }, {
  568.             href: "/?q=weather+in+encinitas&ia=weather",
  569.             label: "weather in encinitas"
  570.         }, {
  571.             href: "/?q=weather+in+paris&ia=weather",
  572.             label: "weather in paris"
  573.         }, {
  574.             href: "/?q=sorbet+recipes&ia=recipes",
  575.             label: "sorbet recipes"
  576.         }, {
  577.             href: "/?q=tilapia+recipes&ia=recipes",
  578.             label: "tilapia recipes"
  579.         }, {
  580.             href: "/?q=thai+food+in+San+Francisco&ia=places",
  581.             label: "thai food in San Francisco"
  582.         }, {
  583.             href: "/?q=bars+near+me",
  584.             label: "bars near me"
  585.         }, {
  586.             href: "/?q=katz%27s+deli+new+york&ia=places",
  587.             label: "katz's deli new york"
  588.         }, {
  589.             href: "/?q=orange&ia=meanings",
  590.             label: "orange"
  591.         }, {
  592.             href: "/?q=daft+punk+soundcloud&ia=soundcloud",
  593.             label: "daft punk soundcloud"
  594.         }, {
  595.             href: "/?q=8oz+to+grams&ia=answer",
  596.             label: "8oz to grams"
  597.         }, {
  598.             href: "/?q=define+superlative&ia=definition",
  599.             label: "define superlative"
  600.         }, {
  601.             href: "/?q=people+in+space&ia=answer",
  602.             label: "people in space"
  603.         }]
  604.     }
  605. }(DDG);
  606. DDG.Data.StaticIAs = [{
  607.     id: "images",
  608.     name: "Images",
  609.     type: "static",
  610.     answerType: "Images",
  611.     meta: {
  612.         idField: "image",
  613.         itemType: l("Images"),
  614.         linkPrimaryText: 1,
  615.         autoExpand: 0,
  616.         developer: [{
  617.             name: "DDG Team"
  618.         }],
  619.         signal_from: "images"
  620.     },
  621.     parameters: [{
  622.         key: "size",
  623.         values: [{
  624.             id: "",
  625.             name: lp("size", "All Sizes")
  626.         }, {
  627.             id: "Small",
  628.             name: lp("size", "Small")
  629.         }, {
  630.             id: "Medium",
  631.             name: lp("size", "Medium")
  632.         }, {
  633.             id: "Large",
  634.             name: lp("size", "Large")
  635.         }, {
  636.             id: "Wallpaper",
  637.             name: lp("size", "Wallpaper")
  638.         }]
  639.     }, {
  640.         key: "type",
  641.         values: [{
  642.             id: "",
  643.             name: lp("image-type", "All Types")
  644.         }, {
  645.             id: "photo",
  646.             name: lp("image-type", "Photograph")
  647.         }, {
  648.             id: "clipart",
  649.             name: lp("image-type", "Clipart")
  650.         }, {
  651.             id: "gif",
  652.             name: lp("image-type", "Animated GIF")
  653.         }, {
  654.             id: "transparent",
  655.             name: lp("image-type", "Transparent")
  656.         }]
  657.     }, {
  658.         key: "layout",
  659.         values: [{
  660.             id: "",
  661.             name: lp("image-layout", "All Layouts")
  662.         }, {
  663.             id: "Square",
  664.             name: lp("image-layout", "Square")
  665.         }, {
  666.             id: "Tall",
  667.             name: lp("image-layout", "Tall")
  668.         }, {
  669.             id: "Wide",
  670.             name: lp("image-layout", "Wide")
  671.         }]
  672.     }, {
  673.         key: "color",
  674.         values: [{
  675.             id: "",
  676.             name: lp("image-color", "All Colors")
  677.         }, {
  678.             id: "color",
  679.             name: lp("image-color", "Color Only")
  680.         }, {
  681.             id: "Monochrome",
  682.             name: lp("image-color", "Black and White")
  683.         }, {
  684.             id: "Red",
  685.             name: lp("color", "Red")
  686.         }, {
  687.             id: "Orange",
  688.             name: lp("color", "Orange")
  689.         }, {
  690.             id: "Yellow",
  691.             name: lp("color", "Yellow")
  692.         }, {
  693.             id: "Green",
  694.             name: lp("color", "Green")
  695.         }, {
  696.             id: "Blue",
  697.             name: lp("color", "Blue")
  698.         }, {
  699.             id: "Purple",
  700.             name: lp("color", "Purple")
  701.         }, {
  702.             id: "Pink",
  703.             name: lp("color", "Pink")
  704.         }, {
  705.             id: "Brown",
  706.             name: lp("color", "Brown")
  707.         }, {
  708.             id: "Black",
  709.             name: lp("color", "Black")
  710.         }, {
  711.             id: "Gray",
  712.             name: lp("color", "Gray")
  713.         }, {
  714.             id: "Teal",
  715.             name: lp("color", "Teal")
  716.         }, {
  717.             id: "White",
  718.             name: lp("color", "White")
  719.         }]
  720.     }],
  721.     sources: [{
  722.         id: "ddg",
  723.         name: "DuckDuckGo",
  724.         requeryURL: "/i.js?l=" + window.rl + "&o=json&q="
  725.     }],
  726.     region: true,
  727.     safeSearch: true,
  728.     templates: DDG.Data.templates.groups.images,
  729.     deferredURL: "/i.js?l=" + window.rl + "&o=json&q=",
  730.     allowModuleIA: true,
  731.     isFullPage: true,
  732.     supportsInfiniteScroll: true
  733. }, {
  734.     id: "videos",
  735.     name: "Videos",
  736.     model: "Video",
  737.     type: "static",
  738.     parameters: [{
  739.         key: "publishedAfter",
  740.         values: [{
  741.             id: "",
  742.             name: l("Any Time")
  743.         }, {
  744.             id: "d",
  745.             name: l("Past Day")
  746.         }, {
  747.             id: "w",
  748.             name: l("Past Week")
  749.         }, {
  750.             id: "m",
  751.             name: l("Past Month")
  752.         }]
  753.     }, {
  754.         key: "videoDefinition",
  755.         values: [{
  756.             id: "",
  757.             name: lp("video-resolution", "Any Resolution")
  758.         }, {
  759.             id: "high",
  760.             name: lp("video-resolution", "High Definition")
  761.         }, {
  762.             id: "standard",
  763.             name: lp("video-resolution", "Standard Definition")
  764.         }]
  765.     }, {
  766.         key: "videoDuration",
  767.         showDescriptions: true,
  768.         values: [{
  769.             id: "",
  770.             name: lp("video-duration", "Any Duration"),
  771.             description: lp("video-duration", "Show videos of any length")
  772.         }, {
  773.             id: "short",
  774.             name: lp("video-duration", "Short"),
  775.             description: lp("video-duration", "Less than 4 minutes")
  776.         }, {
  777.             id: "medium",
  778.             name: lp("video-duration", "Medium"),
  779.             description: lp("video-duration", "Between 4 and 20 minutes")
  780.         }, {
  781.             id: "long",
  782.             name: lp("video-duration", "Long"),
  783.             description: lp("video-duration", "More than 20 minutes")
  784.         }]
  785.     }, {
  786.         key: "videoLicense",
  787.         values: [{
  788.             id: "",
  789.             name: lp("video-license", "Any License")
  790.         }, {
  791.             id: "creativeCommon",
  792.             name: lp("video-license", "Creative Commons")
  793.         }, {
  794.             id: "youtube",
  795.             name: lp("video-license", "YouTube Standard")
  796.         }]
  797.     }],
  798.     sources: [{
  799.         id: "ddg",
  800.         name: "DuckDuckGo",
  801.         requeryURL: "/v.js?l=" + window.rl + "&o=json&sr=1&q="
  802.     }],
  803.     region: true,
  804.     safeSearch: true,
  805.     meta: {
  806.         idField: "id",
  807.         itemType: l("Videos"),
  808.         developer: [{
  809.             name: "DDG Team"
  810.         }],
  811.         signal_from: "videos",
  812.         linkPrimaryText: 1,
  813.         autoExpand: 0,
  814.         detailOverlay: "VideoDetailOverlay",
  815.         primaryText: l("Videos")
  816.     },
  817.     templates: DDG.Data.templates.groups.videos,
  818.     deferredURL: "/v.js?l=" + window.rl + "&o=json&sr=1&q=",
  819.     allowModuleIA: true,
  820.     moreText: l("More Videos"),
  821.     isFullPage: true,
  822.     supportsInfiniteScroll: true
  823. }, {
  824.     id: "news",
  825.     name: "News",
  826.     answerType: "News",
  827.     moreText: l("More News"),
  828.     type: "static",
  829.     meta: {
  830.         developer: [{
  831.             name: "DDG Team"
  832.         }],
  833.         signal_from: "news",
  834.         itemType: l("News Articles"),
  835.         rerender: ["image"],
  836.         primaryText: l("Recent News")
  837.     },
  838.     safeSearch: true,
  839.     region: true,
  840.     date: true,
  841.     allowVertical: true,
  842.     isFullPage: true,
  843.     templates: {
  844.         item: "news_item"
  845.     },
  846.     deferredURL: function() {
  847.         return "/news.js?l=" + window.rl + "&o=json&noamp=" + (DDG.device.isDesktop ? 1 : 0) + "&q="
  848.     },
  849.     experimentalDeferredURL: "/news.js?l=" + window.rl + "&o=json&exp=1&q="
  850. }];
  851. ! function(a) {
  852.     a.Data.HiddenFields = {
  853.         DATE_FILTER: "df",
  854.         DATE_SORT: "ds",
  855.         IA_REQUERY: "iar"
  856.     }
  857. }(DDG);
  858. ! function(a) {
  859.     var b = a.Models;
  860.     b.Base = function(c) {
  861.         this.setMaxListeners(500);
  862.         $.extend(this, c)
  863.     };
  864.     b.Base.prototype = $.extend({}, EventEmitter2.prototype, a.Utils.Events, {
  865.         set: function(c, i, f) {
  866.             if (typeof c === "object") {
  867.                 for (var e in c) {
  868.                     this.set(e, c[e], i)
  869.                 }
  870.             }
  871.             f = f || {};
  872.             var h = this[c],
  873.                 g = h !== i;
  874.             this[c] = i;
  875.             !f.silent && g && this._emitChange(c, h)
  876.         },
  877.         clear: function(c, e) {
  878.             this.set(c, null, e)
  879.         },
  880.         UUID: function() {
  881.             return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(g) {
  882.                 var f = Math.random() * 16 | 0,
  883.                     e = g == "x" ? f : (f & 3 | 8);
  884.                 return e.toString(16)
  885.             })
  886.         },
  887.         getInstance: function(c) {
  888.             if (!this["_" + c]) {
  889.                 this["_" + c] = a[c]
  890.             }
  891.             return this["_" + c]
  892.         },
  893.         _emitChange: function(c, e) {
  894.             var f = this[c];
  895.             this.emit("change:" + c, f, e);
  896.             this.emit("change", c, f, e)
  897.         }
  898.     })
  899. }(DDG);
  900. ! function(m) {
  901.     var b = m.Models.Base,
  902.         c, p = 1440,
  903.         o = 1079,
  904.         n = 864,
  905.         g = 590,
  906.         j = 425,
  907.         i = [{
  908.             id: "xl",
  909.             width: p
  910.         }, {
  911.             id: "l",
  912.             width: o
  913.         }, {
  914.             id: "m",
  915.             width: n
  916.         }, {
  917.             id: "s",
  918.             width: g
  919.         }, {
  920.             id: "xs",
  921.             width: j
  922.         }],
  923.         f = {
  924.             xl: 94,
  925.             l: 94,
  926.             m: 58,
  927.             s: 0,
  928.             xs: 0
  929.         },
  930.         e = j,
  931.         a = g,
  932.         h = Math.ceil(g * 1.25);
  933.     m.Models.Device = c = function(y) {
  934.         b.call(this, y);
  935.         this.isEnglish = window.locale && window.locale.substring(0, 2) === "en";
  936.         var q = this.ua,
  937.             z = y.host || window.location.host;
  938.         this.isEdge = !!/edge\//.test(q);
  939.         this.isEdgeChromium = !!/edg\//.test(q);
  940.         this.isEdgeMobile = !!/(edgios|edga)/.test(q);
  941.         if (!(this.isEdge || this.isEdgeChromium)) {
  942.             this.isIE = !!document.all;
  943.             this.isIE9 = !!/msie 9/.test(q);
  944.             this.isIE10p = !!/msie 1[0123456789]/.test(q);
  945.             this.isIE11p = !!(/trident\/[789]/.test(q) || /edge\/[0123456789]/.test(q));
  946.             if (this.isIE10p || this.isIE11p) {
  947.                 this.isIE = true
  948.             }
  949.         }
  950.         this.isWindowsPhone = !!/windows phone/.test(q);
  951.         this.isSafari = !!(!this.isWindowsPhone && !this.isEdgeMobile && /\([windows|macintosh|ipad|iphone].* version.* safari/.test(q));
  952.         this.safariVersion = -1;
  953.         if (this.isSafari) {
  954.             var s = q.match(/version\/([0-9][0-9]?\.[0-9])/);
  955.             this.safariVersion = (s) ? parseFloat(s[1]) : -1
  956.         }
  957.         this.isWebkit = !!/webkit/.test(q);
  958.         this.isYandex = !!/yabrowser/.test(q);
  959.         this.isBeakerBrowser = !!/beakerbrowser/.test(q);
  960.         this.isVivaldi = !!/vivaldi/.test(q);
  961.         this.isBrave = !!navigator.brave && typeof navigator.brave.isBrave === "function" || (this.isIOS8p && this.isFirefox && /(\d{2}\.){3}\d{2}/.test(q)) || /brave chrome/.test(q);
  962.         this.isChromiumBased = !!(/chrome(?!frame)|crios/.test(q) && !this.isIE && !this.isEdge);
  963.         this.isChrome = !!(this.isChromiumBased && !this.isVivaldi && !this.isYandex && !/opr\/[0-9][0-9]?/.test(q) && !this.isBeakerBrowser && !this.isEdgeMobile && !this.isEdgeChromium && !this.isBrave);
  964.         this.isFirefox = !!/firefox|fxios/.test(q);
  965.         this.firefoxVersion = -1;
  966.         if (this.isFirefox) {
  967.             var x = q.match(/(firefox|fxios)\/([0-9]+\.[0-9]+)/);
  968.             this.firefoxVersion = (x) ? parseFloat(x[2]) : -1
  969.         }
  970.         this.isFirefox38AndUp = this.firefoxVersion > 37;
  971.         this.isFirefox51AndUp = this.firefoxVersion > 50;
  972.         this.isFirefoxLessThan57 = this.isFirefox && this.firefoxVersion < 57;
  973.         this.isFirefoxLessThan67 = this.isFirefox && this.firefoxVersion < 67;
  974.         this.isFirefox67 = this.isFirefox && (Math.floor(this.firefoxVersion) === 67);
  975.         this.isFirefox68AndUp = this.isFirefox && this.firefoxVersion >= 68;
  976.         this.isFirefoxFocus = !!/focus/.test(q);
  977.         this.operaVersion = -1;
  978.         this.isOpera = !!/opera/.test(q);
  979.         if (this.isOpera) {
  980.             var t = q.match(/version\/([0-9.]+)/);
  981.             if (t) {
  982.                 this.operaVersion = parseFloat(t[1], 10)
  983.             }
  984.         } else {
  985.             if (/opr\/[0-9][0-9]?/.test(q)) {
  986.                 this.operaVersion = parseInt(q.match(/opr\/([0-9][0-9]?)/)[1], 10)
  987.             }
  988.         }
  989.         this.isOperaMini = !!/opera mini|opios/.test(q);
  990.         this.isOperaMobile = !!/opera mobi/.test(q);
  991.         this.isOSX = !!/mac os x [0-9]/.test(q);
  992.         this.isOSXMavericksAndUp = !!/mac os x 10(_|\.)(1\d|9)/.test(q) || !!/mac os x 11(_|\.)[0-9]{1,2}/.test(q);
  993.         this.isOSXCatalinaAndUp = !!/mac os x 10(_|\.)(1[5-9])/.test(q) || !!/mac os x 11(_|\.)[0-9]{1,2}/.test(q);
  994.         this.isIPod = !!/ipod/.test(q);
  995.         this.isIPadOS = (this.isOSX && navigator.maxTouchPoints);
  996.         this.isIPad = !!(this.isIPadOS || /ipad/.test(q));
  997.         this.isIPhone = !!(!this.isWindowsPhone && /iphone/.test(q));
  998.         this.isIDevice = (this.isIPad || this.isIPhone || /\Wios\W/.test(q));
  999.         this.isIOS8p = !!((this.isIDevice && (this.isIPadOS || /os (8|9|[1-9][0-9])|os 10_10/.test(q))));
  1000.         this.isIOS8pSafari = !!((this.isIOS8p && !this.isChrome && !this.isOperaMini && !this.isFirefox));
  1001.         this.isAndroid = !!(!this.isWindowsPhone && /android/.test(q));
  1002.         this.isLegacyAndroid = this.isAndroid && /android ([1-3](\..+)?|4(\.[0-2].*)?)(;|$)/.test(q);
  1003.         this.isAndroid4_3AndUp = this.isAndroid && !this.isLegacyAndroid;
  1004.         this.isBlackberry = !!/blackberry/.test(q);
  1005.         this.chromeVersion = -1;
  1006.         if (this.isChromiumBased) {
  1007.             var v = q.match(/(chrome|crios)\/([0-9][0-9]?)/);
  1008.             this.chromeVersion = (v) ? parseInt(v[2], 10) : -1
  1009.         }
  1010.         this.isChrome31AndUpOnAndroid = !!(this.isAndroid && this.isChrome && this.chromeVersion > 30);
  1011.         this.isChrome48AndUp = !!(this.isChrome && this.chromeVersion > 47);
  1012.         this.isAndroidChromeNoOpenSearch = !!(this.isAndroid && this.isChrome && this.chromeVersion > 31 && this.chromeVersion < 57);
  1013.         this.isSilk = !!/silk/.test(q);
  1014.         this.isKonqueror = !!/konqueror/.test(q);
  1015.         this.isWindows = !!/windows/.test(q);
  1016.         this.isWindows10 = !!/windows nt 10/.test(q);
  1017.         this.isLinux = !!(!this.isAndroid && /linux/.test(q));
  1018.         this.isOnion = !!z.match(/\.onion$/i);
  1019.         this.isDDGIgnore = !!/ddgignore/.test(q);
  1020.         this.isDDGTest = !!/ddgtest/.test(q);
  1021.         this.isSamsung = !!/samsungbrowser/.test(q);
  1022.         this.isDDGApp = !!(y.qs && y.qs.match(/(\&|\?)t\=(ddg_ios|ddg_android)/)) || /DuckDuckGo\/[57]$/i.test(q);
  1023.         this.isUCBrowser = !!/(ucbrowser)/.test(q);
  1024.         this.isUCBrowserIOS = this.isUCBrowser && this.isIPhone;
  1025.         this.isRetina = is_retina = this.dpr > 1;
  1026.         this.is2x = m.is2x = this.dpr > 1;
  1027.         this.is3x = m.is3x = this.dpr > 2;
  1028.         this.hasFixedHeaderSupport = !this.isIDevice;
  1029.         this.isAppleDevice = this.isIDevice || this.isOSX;
  1030.         if (this.isIDevice) {
  1031.             if (this.isChrome) {
  1032.                 this.hasFixedHeaderSupport = this.chromeVersion >= 57
  1033.             } else {
  1034.                 if (this.isFirefox) {
  1035.                     this.hasFixedHeaderSupport = this.firefoxVersion >= 7.2
  1036.                 } else {
  1037.                     if (this.isUCBrowserIOS) {
  1038.                         this.hasFixedHeaderSupport = false
  1039.                     } else {
  1040.                         this.hasFixedHeaderSupport = this.isIOS8pSafari
  1041.                     }
  1042.                 }
  1043.             }
  1044.         }
  1045.         var u = "Browser";
  1046.         if (this.isDDGIgnore) {
  1047.             u = "Ignore"
  1048.         } else {
  1049.             if (/seamonkey/.test(q)) {
  1050.                 u = "SeaMonkey"
  1051.             } else {
  1052.                 if (/iceape/.test(q)) {
  1053.                     u = "Iceape"
  1054.                 } else {
  1055.                     if (/palemoon/.test(q)) {
  1056.                         u = "PaleMoon"
  1057.                     } else {
  1058.                         if (this.isBrave) {
  1059.                             u = "Brave"
  1060.                         } else {
  1061.                             if (this.isSamsung) {
  1062.                                 u = "Samsung Internet"
  1063.                             } else {
  1064.                                 if (this.isFirefox) {
  1065.                                     u = "Firefox"
  1066.                                 } else {
  1067.                                     if (/opr\//.test(q) || ((this.isAndroid || this.isIDevice) && (this.isOperaMobile || this.isOperaMini || this.operaVersion !== -1))) {
  1068.                                         u = "Opera"
  1069.                                     } else {
  1070.                                         if (this.isFirefoxFocus) {
  1071.                                             u = "Focus"
  1072.                                         } else {
  1073.                                             if (this.isUCBrowser) {
  1074.                                                 u = "UC Browser"
  1075.                                             } else {
  1076.                                                 if (this.isEdge || this.isEdgeChromium || this.isEdgeMobile) {
  1077.                                                     u = "Edge"
  1078.                                                 } else {
  1079.                                                     if (this.isAndroid) {
  1080.                                                         u = "Android"
  1081.                                                     } else {
  1082.                                                         if (/xbox/.test(q)) {
  1083.                                                             u = "xBox"
  1084.                                                         } else {
  1085.                                                             if (/midori/.test(q)) {
  1086.                                                                 u = "Midori"
  1087.                                                             } else {
  1088.                                                                 if (/maxthon/.test(q)) {
  1089.                                                                     u = "Maxthon"
  1090.                                                                 } else {
  1091.                                                                     if (this.isYandex) {
  1092.                                                                         u = "Yandex"
  1093.                                                                     } else {
  1094.                                                                         if (/vivaldi/.test(q)) {
  1095.                                                                             u = "Vivaldi"
  1096.                                                                         } else {
  1097.                                                                             if (this.isChrome) {
  1098.                                                                                 u = "Chrome"
  1099.                                                                             } else {
  1100.                                                                                 if (/fennec/.test(q)) {
  1101.                                                                                     u = "Fennec"
  1102.                                                                                 } else {
  1103.                                                                                     if (/epiphany/.test(q)) {
  1104.                                                                                         u = "Epiphany"
  1105.                                                                                     } else {
  1106.                                                                                         if (this.isFirefox) {
  1107.                                                                                             u = "Firefox"
  1108.                                                                                         } else {
  1109.                                                                                             if (/uzbl/.test(q)) {
  1110.                                                                                                 u = "Uzbl"
  1111.                                                                                             } else {
  1112.                                                                                                 if (this.isIE && navigator.platform === "Win64" && !k() && Modernizr.touch && document.documentElement.clientWidth == screen.width) {
  1113.                                                                                                     u = "IEMetro"
  1114.                                                                                                 } else {
  1115.                                                                                                     if (this.isIE) {
  1116.                                                                                                         u = "IE"
  1117.                                                                                                     } else {
  1118.                                                                                                         if (this.isOpera) {
  1119.                                                                                                             u = "Opera"
  1120.                                                                                                         } else {
  1121.                                                                                                             if (this.isIPad) {
  1122.                                                                                                                 u = "iPad"
  1123.                                                                                                             } else {
  1124.                                                                                                                 if (this.isIPhone) {
  1125.                                                                                                                     u = "iPhone"
  1126.                                                                                                                 } else {
  1127.                                                                                                                     if (/arora/.test(q)) {
  1128.                                                                                                                         u = "Arora"
  1129.                                                                                                                     } else {
  1130.                                                                                                                         if (this.isSafari) {
  1131.                                                                                                                             u = "Safari"
  1132.                                                                                                                         } else {
  1133.                                                                                                                             if (this.isKonqueror) {
  1134.                                                                                                                                 u = "Konqueror"
  1135.                                                                                                                             } else {
  1136.                                                                                                                                 if (this.isBlackberry) {
  1137.                                                                                                                                     u = "Blackberry"
  1138.                                                                                                                                 } else {
  1139.                                                                                                                                     if (/phantomjs/.test(q)) {
  1140.                                                                                                                                         u = "PhantomJS"
  1141.                                                                                                                                     } else {
  1142.                                                                                                                                         if (this.isIDevice) {
  1143.                                                                                                                                             u = "iOS"
  1144.                                                                                                                                         }
  1145.                                                                                                                                     }
  1146.                                                                                                                                 }
  1147.                                                                                                                             }
  1148.                                                                                                                         }
  1149.                                                                                                                     }
  1150.                                                                                                                 }
  1151.                                                                                                             }
  1152.                                                                                                         }
  1153.                                                                                                     }
  1154.                                                                                                 }
  1155.                                                                                             }
  1156.                                                                                         }
  1157.                                                                                     }
  1158.                                                                                 }
  1159.                                                                             }
  1160.                                                                         }
  1161.                                                                     }
  1162.                                                                 }
  1163.                                                             }
  1164.                                                         }
  1165.                                                     }
  1166.                                                 }
  1167.                                             }
  1168.                                         }
  1169.                                     }
  1170.                                 }
  1171.                             }
  1172.                         }
  1173.                     }
  1174.                 }
  1175.             }
  1176.         }
  1177.         if (this.isDDGApp) {
  1178.             u = "DDG " + u
  1179.         }
  1180.         this.browserName = m.browserName = u;
  1181.         this.pixelBrowserName = (this.isUCBrowser) ? "ucbrowser" : u.toLowerCase();
  1182.         this.pixelPlatformName = this._getPixelPlatformName();
  1183.         this.pixelBrowserVersion = this._getPixelBrowserVersion();
  1184.         this.displayBrowserName = this.browserName;
  1185.         if (u === "IEMetro") {
  1186.             this.displayBrowserName = "IE"
  1187.         } else {
  1188.             if (u === "iPhone" || u === "iPad") {
  1189.                 this.displayBrowserName = "Safari"
  1190.             } else {
  1191.                 if (u === "Android") {
  1192.                     this.displayBrowserName = "Chrome"
  1193.                 }
  1194.             }
  1195.         }
  1196.         this._updateScreenSize();
  1197.         this._updateIsMobileDevice();
  1198.         this.isSafariWithNativeDDG = this._isSafariWithNativeDDG();
  1199.         this.isFirefoxWithNativeDDG = this._isFirefoxWithNativeDDG();
  1200.         if ((this.isIPhone && !this.isIPod) || (/mac os x 10[_.]1\d/.test(this.ua)) || (this.isAndroid && /mobile/.test(this.ua) && (this.isChrome || this.isFirefox || this.isEdgeMobile || this.isUCBrowser)) || this.isWindowsPhone || this.isBlackberry) {
  1201.             this.canMakePhoneCalls = true
  1202.         } else {
  1203.             this.canMakePhoneCalls = false
  1204.         }
  1205.         if (this.isMobileDevice && this.browserName === "Firefox") {
  1206.             if (screen.width && screen.width < this.width) {
  1207.                 this.width = viewport_width = screen.width
  1208.             }
  1209.             if (screen.height && screen.height < this.height) {
  1210.                 this.height = viewport_height = screen.height
  1211.             }
  1212.             this._updateIsMobileDevice()
  1213.         }
  1214.         var r = (this.width < 600 || (this.width < 800 && this.height < 500)) ? 1 : 0;
  1215.         if (r !== this.isMobile) {
  1216.             this.isMobile = is_mobile = r;
  1217.             this.emit("changed:mobile")
  1218.         }
  1219.         this.isDesktop = !this.isMobile && !this.isMobileDevice;
  1220.         this.hasMetaReferrerSupport = !!((this.chromeVersion > 20 && !this.isMobileDevice) || (this.chromeVersion >= 50) || (this.safariVersion > 7 && !this.isWindows && !this.isMobileDevice) || (this.isIOS8pSafari || (this.safariVersion >= 8 && this.isIDevice)) || (this.operaVersion > 14 && !this.isMobileDevice) || this.isFirefox38AndUp || (this.isIOS8p && this.isFirefox) || this.isBrave || this.isUCBrowser);
  1221.         this.$scrollDoc = $("html,body");
  1222.         this.pixelId = (this.isMobile || this.isMobileDevice) ? "m" : "d";
  1223.         if (this.isMobileDevice) {
  1224.             this._wasPortrait = this.isMobilePortrait()
  1225.         }
  1226.         window.onresize = $.throttle(200, this._onResize.bind(this));
  1227.         window.onscroll = this._onScroll.bind(this);
  1228.         if (typeof document.hidden !== "undefined") {
  1229.             this._visibilityChange = "visibilitychange";
  1230.             this._visibilityState = "visibilityState"
  1231.         } else {
  1232.             if (typeof document.mozHidden !== "undefined") {
  1233.                 this._visibilityChange = "mozvisibilitychange";
  1234.                 this._visibilityState = "mozVisibilityState"
  1235.             }
  1236.         }
  1237.         if (this._visibilityChange) {
  1238.             d.addEventListener(this._visibilityChange, this._onVisibilityChange.bind(this), false)
  1239.         }
  1240.     };
  1241.     c.prototype = $.extend({}, b.prototype, {
  1242.         scrollTop: function(s, r, q) {
  1243.             if (typeof s === "undefined") {
  1244.                 if (typeof this._scrollTop !== "undefined") {
  1245.                     return this._scrollTop
  1246.                 }
  1247.                 return this._scrollTop = m.$doc.scrollTop()
  1248.             }
  1249.             if (s === this.scrollTop()) {
  1250.                 if (q) {
  1251.                     q()
  1252.                 }
  1253.                 return this._scrollTop = s
  1254.             }
  1255.             if (r && !$.isNumeric(r)) {
  1256.                 r = m.animation_speed
  1257.             }
  1258.             if (!r) {
  1259.                 this.$scrollDoc.scrollTop(s);
  1260.                 if (q) {
  1261.                     q()
  1262.                 }
  1263.             } else {
  1264.                 this.$scrollDoc.animate({
  1265.                     scrollTop: s
  1266.                 }, r, q)
  1267.             }
  1268.             return this._scrollTop = s
  1269.         },
  1270.         getBrowserMoreURL: function() {
  1271.             var q = "https://help.duckduckgo.com/desktop/";
  1272.             if (this.isChrome) {
  1273.                 return q + "chrome"
  1274.             } else {
  1275.                 if (this.isOpera) {
  1276.                     return q + "opera"
  1277.                 } else {
  1278.                     if (this.isSafari && !this.isSafariWithNativeDDG) {
  1279.                         return q + "safari"
  1280.                     } else {
  1281.                         if (this.browserName === "SeaMonkey") {
  1282.                             return "https://addons.mozilla.org/seamonkey/addon/duckduckgo-ssl/"
  1283.                         } else {
  1284.                             if (this.isFirefox) {
  1285.                                 return q + "firefox"
  1286.                             }
  1287.                         }
  1288.                     }
  1289.                 }
  1290.             }
  1291.         },
  1292.         canAddToBrowser: function() {
  1293.             var q = this.getAddToBrowserDirections();
  1294.             return q.useForSearch || q.setAsHomepage
  1295.         },
  1296.         getAddToBrowserDirections: function() {
  1297.             if (this._addToBrowserDirections) {
  1298.                 return this._addToBrowserDirections
  1299.             }
  1300.             var q = this.browserName,
  1301.                 s, r;
  1302.             if (!this._hasInstallationInstructions()) {
  1303.                 return this._addToBrowserDirections = {}
  1304.             }
  1305.             if (q === "IE") {
  1306.                 r = "ie"
  1307.             } else {
  1308.                 if (q === "SeaMonkey") {
  1309.                     r = "seamonkey"
  1310.                 } else {
  1311.                     if (q === "PaleMoon") {
  1312.                         r = "palemoon"
  1313.                     } else {
  1314.                         if (m.addToBrowser.canAddToBraveIOS()) {
  1315.                             r = "brave_ios"
  1316.                         } else {
  1317.                             if (m.addToBrowser.canAddToMobileFirefox() && this.isAndroid) {
  1318.                                 r = "firefox_android"
  1319.                             } else {
  1320.                                 if (m.addToBrowser.canAddToMobileFirefox() && this.isIDevice) {
  1321.                                     r = "firefox_ios"
  1322.                                 } else {
  1323.                                     if (this.isFirefoxWithNativeDDG) {
  1324.                                         r = "firefox"
  1325.                                     } else {
  1326.                                         if (q === "Firefox") {
  1327.                                             r = "firefox_old"
  1328.                                         } else {
  1329.                                             if (m.device.isUCBrowser && (this.isAndroid || this.isIDevice)) {
  1330.                                                 r = "uc_browser_mobile"
  1331.                                             } else {
  1332.                                                 if (m.addToBrowser.canAddToChromeMobile() && this.isAndroid) {
  1333.                                                     r = "chrome_android_default"
  1334.                                                 } else {
  1335.                                                     if (m.addToBrowser.canAddToChromeMobile() && this.isIDevice) {
  1336.                                                         r = "chrome_ios_default"
  1337.                                                     } else {
  1338.                                                         if (this.isEdgeMobile && this.isAndroid) {
  1339.                                                             r = "edge_android_default"
  1340.                                                         } else {
  1341.                                                             if (this.isEdgeMobile && this.isIDevice) {
  1342.                                                                 r = "edge_ios_default"
  1343.                                                             } else {
  1344.                                                                 if (m.addToBrowser.canAddToBraveAndroid()) {
  1345.                                                                     r = "chrome_android_default"
  1346.                                                                 } else {
  1347.                                                                     if (this.isChrome && this.isAndroid) {
  1348.                                                                         r = "chrome_android"
  1349.                                                                     } else {
  1350.                                                                         if (q === "Chrome") {
  1351.                                                                             r = "chrome"
  1352.                                                                         } else {
  1353.                                                                             if (q === "Maxthon" && !this.isOSX) {
  1354.                                                                                 r = "maxthon"
  1355.                                                                             } else {
  1356.                                                                                 if (this.isSafariWithNativeDDG) {
  1357.                                                                                     r = "safari"
  1358.                                                                                 } else {
  1359.                                                                                     if (this.isIOS8p && this.isSafari) {
  1360.                                                                                         r = "ios8"
  1361.                                                                                     } else {
  1362.                                                                                         if (q === "Safari" && window.postMessage && this.isOSX) {
  1363.                                                                                             r = "safari_old"
  1364.                                                                                         } else {
  1365.                                                                                             if (q === "Safari" && window.postMessage) {
  1366.                                                                                                 r = "safari_windows"
  1367.                                                                                             } else {
  1368.                                                                                                 if (q === "Opera") {
  1369.                                                                                                     r = "opera"
  1370.                                                                                                 } else {
  1371.                                                                                                     if (q === "Vivaldi") {
  1372.                                                                                                         r = "vivaldi"
  1373.                                                                                                     } else {
  1374.                                                                                                         if (q === "Edge") {
  1375.                                                                                                             r = "edge"
  1376.                                                                                                         } else {
  1377.                                                                                                             if (q === "Brave") {
  1378.                                                                                                                 r = "brave"
  1379.                                                                                                             }
  1380.                                                                                                         }
  1381.                                                                                                     }
  1382.                                                                                                 }
  1383.                                                                                             }
  1384.                                                                                         }
  1385.                                                                                     }
  1386.                                                                                 }
  1387.                                                                             }
  1388.                                                                         }
  1389.                                                                     }
  1390.                                                                 }
  1391.                                                             }
  1392.                                                         }
  1393.                                                     }
  1394.                                                 }
  1395.                                             }
  1396.                                         }
  1397.                                     }
  1398.                                 }
  1399.                             }
  1400.                         }
  1401.                     }
  1402.                 }
  1403.             }
  1404.             if (q === "IE") {
  1405.                 s = "ie"
  1406.             } else {
  1407.                 if (q.match(/^Firefox|PaleMoon|SeaMonkey$/)) {
  1408.                     s = "firefox"
  1409.                 } else {
  1410.                     if (q === "Maxthon") {
  1411.                         s = "maxthon"
  1412.                     } else {
  1413.                         if (q === "Chrome") {
  1414.                             s = "chrome"
  1415.                         } else {
  1416.                             if (q === "Safari") {
  1417.                                 s = "safari"
  1418.                             } else {
  1419.                                 if (q === "Opera") {
  1420.                                     s = "opera"
  1421.                                 } else {
  1422.                                     if (q === "Vivaldi") {
  1423.                                         s = "vivaldi"
  1424.                                     } else {
  1425.                                         if (q === "Edge") {
  1426.                                             s = "edge"
  1427.                                         }
  1428.                                     }
  1429.                                 }
  1430.                             }
  1431.                         }
  1432.                     }
  1433.                 }
  1434.             }
  1435.             return this._addToBrowserDirections = {
  1436.                 useForSearch: r && ("use_for_search_" + r),
  1437.                 setAsHomepage: s && ("set_as_homepage_" + s)
  1438.             }
  1439.         },
  1440.         DDGisBrowserDefault: function() {
  1441.             return this.ua.match(/palemoon|porteus|qupzilla|lxle/gi)
  1442.         },
  1443.         isTeapot: function() {
  1444.             return this.width >= a && this.height <= h
  1445.         },
  1446.         isMobileLandscape: function() {
  1447.             return this.isMobile && this.width > this.height && (this.isAndroid && this.width >= e)
  1448.         },
  1449.         isMobilePortrait: function() {
  1450.             return this.isMobile && !this.isMobileLandscape()
  1451.         },
  1452.         widthBreakpoint: function() {
  1453.             var q = i.length;
  1454.             while (--q) {
  1455.                 var r = i[q];
  1456.                 if (this.width < r.width) {
  1457.                     return r.id
  1458.                 }
  1459.             }
  1460.             return i[0].id
  1461.         },
  1462.         gutterSize: function() {
  1463.             return f[this.widthBreakpoint()]
  1464.         },
  1465.         isPrv: function() {
  1466.             var s = "prv",
  1467.                 r = w.sessionStorage;
  1468.             try {
  1469.                 r.setItem(s, "1");
  1470.                 r.removeItem(s)
  1471.             } catch (q) {
  1472.                 if (q.code === DOMException.QUOTA_EXCEEDED_ERR && r.length === 0) {
  1473.                     return true
  1474.                 }
  1475.             }
  1476.             return false
  1477.         },
  1478.         getCountry: function(q) {
  1479.             if (this.countryCode) {
  1480.                 return q && q(null, this.countryCode)
  1481.             }
  1482.             $.ajax({
  1483.                 url: "/country.json",
  1484.                 success: function(r) {
  1485.                     this.countryCode = r && r.country;
  1486.                     return q && q(null, this.countryCode)
  1487.                 }.bind(this),
  1488.                 error: function(r) {
  1489.                     return q && q(r)
  1490.                 }
  1491.             })
  1492.         },
  1493.         getLang: function() {
  1494.             var r = "en",
  1495.                 q = m.settings.get(m.settings.LANGUAGE_KEY);
  1496.             if (q && q !== "wt_WT") {
  1497.                 r = q.slice(0, 2)
  1498.             } else {
  1499.                 if (w.locale) {
  1500.                     r = w.locale.slice(0, 2)
  1501.                 }
  1502.             }
  1503.             return r
  1504.         },
  1505.         getLocale: function() {
  1506.             var q = m.settings.get(m.settings.LANGUAGE_KEY);
  1507.             if (q && q !== "wt_WT") {
  1508.                 return q
  1509.             } else {
  1510.                 if (w.locale) {
  1511.                     return w.locale
  1512.                 }
  1513.             }
  1514.             return "en_US"
  1515.         },
  1516.         getColorScheme: function() {
  1517.             var r = window.matchMedia("(prefers-color-scheme: dark)"),
  1518.                 q = window.matchMedia("(prefers-color-scheme: light)");
  1519.             if (r.matches) {
  1520.                 return "dark"
  1521.             } else {
  1522.                 if (q.matches) {
  1523.                     return "light"
  1524.                 }
  1525.             }
  1526.         },
  1527.         _updateScreenSize: function() {
  1528.             var q, r, s = document.documentElement;
  1529.             q = Math.max(s.clientWidth, window.innerWidth || 0);
  1530.             r = Math.max(s.clientHeight, window.innerHeight || 0);
  1531.             if (q !== this.width || r !== this.height) {
  1532.                 this.width = viewport_width = q;
  1533.                 this.height = viewport_height = r;
  1534.                 return true
  1535.             }
  1536.             return false
  1537.         },
  1538.         _updateIsMobileDevice: function() {
  1539.             var q = /mobile/.test(this.ua) ? 1 : 0;
  1540.             if (this.isOperaMobile || this.isOperaMini || this.isIDevice || this.isAndroid || this.isSilk || (this.width < 600 && this.height < 400)) {
  1541.                 q = 1
  1542.             }
  1543.             this.isMobileDevice = is_mobile_device = q
  1544.         },
  1545.         _isSafariWithNativeDDG: function() {
  1546.             if (this.browserName !== "Safari" || this.isMobileDevice) {
  1547.                 return false
  1548.             }
  1549.             var q = new RegExp("version/(\\d+)\\.(\\d+)(?:\\.(\\d+))?.*safari/").exec(this.ua);
  1550.             if (!q || !q.length) {
  1551.                 return false
  1552.             }
  1553.             q.shift();
  1554.             q = q.map(function(r) {
  1555.                 return r || 0
  1556.             }).join("");
  1557.             return q && q > 706
  1558.         },
  1559.         _isFirefoxWithNativeDDG: function() {
  1560.             if (this.browserName !== "Firefox") {
  1561.                 return false
  1562.             }
  1563.             return navigator.buildID && parseInt(navigator.buildID, 10) >= 20141028112145
  1564.         },
  1565.         _getPixelBrowserVersion: function() {
  1566.             var q = 0;
  1567.             if (this.isChrome) {
  1568.                 q = this.chromeVersion
  1569.             } else {
  1570.                 if (this.isFirefox) {
  1571.                     q = this.firefoxVersion
  1572.                 } else {
  1573.                     if (this.isSafari) {
  1574.                         q = this.safariVersion
  1575.                     } else {
  1576.                         if (this.operaVersion !== -1) {
  1577.                             q = this.operaVersion
  1578.                         } else {
  1579.                             if (this.isIE11p) {
  1580.                                 q = 11
  1581.                             } else {
  1582.                                 if (this.isIE10p) {
  1583.                                     q = 10
  1584.                                 } else {
  1585.                                     if (this.isIE9) {
  1586.                                         q = 9
  1587.                                     }
  1588.                                 }
  1589.                             }
  1590.                         }
  1591.                     }
  1592.                 }
  1593.             }
  1594.             return q
  1595.         },
  1596.         _getPixelPlatformName: function() {
  1597.             var q = "other";
  1598.             if (this.isAndroid) {
  1599.                 q = "android"
  1600.             } else {
  1601.                 if (this.isIPod) {
  1602.                     q = "ipod"
  1603.                 } else {
  1604.                     if (this.isIPad) {
  1605.                         q = "ipad"
  1606.                     } else {
  1607.                         if (this.isIPhone) {
  1608.                             q = "iphone"
  1609.                         } else {
  1610.                             if (this.isWindowsPhone) {
  1611.                                 q = "winphone"
  1612.                             } else {
  1613.                                 if (this.isWindows) {
  1614.                                     q = "windows"
  1615.                                 } else {
  1616.                                     if (this.isLinux) {
  1617.                                         q = "linux"
  1618.                                     } else {
  1619.                                         if (this.isBlackberry) {
  1620.                                             q = "blackberry"
  1621.                                         } else {
  1622.                                             if (this.isOSX) {
  1623.                                                 q = "mac"
  1624.                                             } else {
  1625.                                                 if (this.browserName === "DDG iOS") {
  1626.                                                     q = "ios"
  1627.                                                 }
  1628.                                             }
  1629.                                         }
  1630.                                     }
  1631.                                 }
  1632.                             }
  1633.                         }
  1634.                     }
  1635.                 }
  1636.             }
  1637.             return q
  1638.         },
  1639.         _hasInstallationInstructions: function() {
  1640.             if (this.isSilk) {
  1641.                 return false
  1642.             }
  1643.             var q = true;
  1644.             if (this.isMobileDevice || this.isMobile) {
  1645.                 q = m.addToBrowser.canAddToMobileBrowser() || this.isAndroidChromeNoOpenSearch
  1646.             }
  1647.             return q
  1648.         },
  1649.         _onResize: function(q) {
  1650.             if (this._updateScreenSize()) {
  1651.                 q.isRotation = this.isMobileDevice && this._wasPortrait != this.isMobilePortrait();
  1652.                 this._wasPortrait = this.isMobilePortrait();
  1653.                 this.emit("resize", q)
  1654.             }
  1655.         },
  1656.         _onScroll: function(q) {
  1657.             delete this._scrollTop;
  1658.             this.emit("scroll", q)
  1659.         },
  1660.         _onVisibilityChange: function(q) {
  1661.             this.emit("visibilitychange", d[this._visibilityState])
  1662.         }
  1663.     });
  1664.  
  1665.     function k() {
  1666.         var q;
  1667.         try {
  1668.             q = !!new ActiveXObject("htmlfile")
  1669.         } catch (r) {}
  1670.         return q
  1671.     }
  1672. }(DDG);
  1673. ! function(c) {
  1674.     var a = c.Models.Base,
  1675.         e = 500,
  1676.         b = {
  1677.             13: "enter",
  1678.             27: "escape",
  1679.             32: "space",
  1680.             37: "left",
  1681.             38: "up",
  1682.             39: "right",
  1683.             40: "down",
  1684.             16: "shift",
  1685.             17: "ctrl",
  1686.             18: "alt",
  1687.             91: "cmd",
  1688.             74: "k",
  1689.             75: "j"
  1690.         };
  1691.     c.Models.Keyboard = function(f) {
  1692.         a.call(this, f);
  1693.         if (!c.device.isMobileDevice) {
  1694.             $(document).on("keydown", this._onKeydown.bind(this))
  1695.         }
  1696.     };
  1697.     c.Models.Keyboard.prototype = $.extend({}, a.prototype, {
  1698.         namespaced: function(f) {
  1699.             if (!f) {
  1700.                 return !!this.namespace
  1701.             }
  1702.             return this.namespace && this.namespace.match(f)
  1703.         },
  1704.         focusedOnInput: function() {
  1705.             var f = document.activeElement;
  1706.             return f && (f.nodeName === "INPUT" || f.nodeName === "TEXTAREA" || f.localName === "button")
  1707.         },
  1708.         keyCodeIsOneOf: function(h, g) {
  1709.             var f = b[h];
  1710.             return (f && g.indexOf(f) > -1)
  1711.         },
  1712.         _onKeydown: function(h) {
  1713.             var g = h.keyCode;
  1714.             clearTimeout(this._activeTimeout);
  1715.             this.set("active", 1);
  1716.             if (!fq && (!kk || kk == "1") && !h.ctrlKey && !h.metaKey && !this.focusedOnInput() && c.duckbar && c.duckbar.areOrganicsShowing) {
  1717.                 if (this.enableSERPShortcuts) {
  1718.                     this._onSERPKeydown(h)
  1719.                 }
  1720.                 if (g == 13) {
  1721.                     nke()
  1722.                 }
  1723.                 if (g == 84) {
  1724.                     nkt()
  1725.                 }
  1726.             }
  1727.             var f = b[g];
  1728.             if (f && !h.altKey && !h.shiftKey) {
  1729.                 if (this.namespace) {
  1730.                     this.emit(f + "." + this.namespace, h)
  1731.                 }
  1732.                 this.emit(f, h)
  1733.             }
  1734.             this._activeTimeout = setTimeout(function() {
  1735.                 clearTimeout(this._activeTimeout);
  1736.                 this.set("active")
  1737.             }.bind(this), e)
  1738.         },
  1739.         _onSERPKeydown: function(g) {
  1740.             var f = g.keyCode;
  1741.             if (f == 40 || f == 74) {
  1742.                 if (this.nativeUpDown) {
  1743.                     return
  1744.                 }
  1745.                 g.preventDefault();
  1746.                 nkda()
  1747.             }
  1748.             if (f == 38 || f == 75) {
  1749.                 if (this.nativeUpDown) {
  1750.                     return
  1751.                 }
  1752.                 g.preventDefault();
  1753.                 nkua()
  1754.             }
  1755.             if (f == 191) {
  1756.                 if (c.device.isFirefox) {
  1757.                     g.preventDefault()
  1758.                 }
  1759.                 nks()
  1760.             }
  1761.             if (f == 79 || f == 76) {
  1762.                 nko()
  1763.             }
  1764.             if (f == 222 || f == 86) {
  1765.                 nkn()
  1766.             }
  1767.             if (f == 111 || f == 72) {
  1768.                 nks()
  1769.             }
  1770.             if (f == 32) {
  1771.                 nksb()
  1772.             }
  1773.             if (f == 77) {
  1774.                 nkm()
  1775.             }
  1776.             if (f == 68) {
  1777.                 nkd(g)
  1778.             }
  1779.         }
  1780.     })
  1781. }(DDG);
  1782. ! function(c) {
  1783.     var b = c.Models,
  1784.         a = b.Base;
  1785.     b.SelectList = function(e) {
  1786.         a.call(this, e);
  1787.         this.select(e.selectedId || this.values[0].id)
  1788.     };
  1789.     b.SelectList.prototype = $.extend({}, a.prototype, {
  1790.         select: function(e) {
  1791.             var f;
  1792.             this.values.forEach(function(g) {
  1793.                 if (g.id === e) {
  1794.                     g.selected = true;
  1795.                     f = g
  1796.                 } else {
  1797.                     g.selected = false
  1798.                 }
  1799.             });
  1800.             if (!f) {
  1801.                 this.select(this.values[0].id)
  1802.             } else {
  1803.                 this.set("selected", f)
  1804.             }
  1805.         }
  1806.     })
  1807. }(DDG);
  1808. ! function(f) {
  1809.     var e = f.Models,
  1810.         c = e.Base,
  1811.         b = "d",
  1812.         a = 10;
  1813.     e.Deep = function(h) {
  1814.         this._backData = h.backData;
  1815.         this._device = h.device;
  1816.         this._page = h.page;
  1817.         this._pixel = h.pixel;
  1818.         this._settings = h.settings;
  1819.         this._adFeed = h.adFeed;
  1820.         this.hideRelated = window.iqa;
  1821.         this.results = {};
  1822.         this.resultDomains = {};
  1823.         var g = this.getInstance("adFeed");
  1824.         g.on("change:ads", function() {
  1825.             if (this.results.a && this.results.a.length) {
  1826.                 this.getInstance("pixel").fire("sad", {
  1827.                     b: 1,
  1828.                     r: "ad"
  1829.                 });
  1830.                 return
  1831.             }
  1832.             if (this._heldOrganics) {
  1833.                 this.nrnWrapper("d", this._heldOrganics);
  1834.                 delete this._heldOrganics
  1835.             }
  1836.         }.bind(this));
  1837.         g.on("change:lateAds", function() {
  1838.             if (g.lateAds.length) {
  1839.                 nrn("a", g.lateAds, 1)
  1840.             }
  1841.         })
  1842.     };
  1843.     e.Deep.prototype = $.extend({}, c.prototype, {
  1844.         isLastResult: false,
  1845.         isOutOfResults: false,
  1846.         pageNumber: 1,
  1847.         started: 0,
  1848.         finished: 0,
  1849.         _currentPageItems: {
  1850.             a: [],
  1851.             d: []
  1852.         },
  1853.         timeSinceStarted: function() {
  1854.             return this.started ? new Date().getTime() - this.started : 0
  1855.         },
  1856.         timeSinceFinished: function() {
  1857.             return this.finished ? new Date().getTime() - this.finished : 0
  1858.         },
  1859.         getResultCount: function() {
  1860.             return r1c
  1861.         },
  1862.         getFirstSource: function() {
  1863.             return this.results && this.results.d && this.results.d[0] && this.results.d[0].s
  1864.         },
  1865.         getAttributionSource: function() {
  1866.             if (!this.results || !this.results.d || this.results.d.length <= 5) {
  1867.                 return ""
  1868.             }
  1869.             var g = this.getFirstSource();
  1870.             if (g === "yandexru" || g === "yandextr") {
  1871.                 return "yandex"
  1872.             }
  1873.             return ""
  1874.         },
  1875.         canShowAttribution: function() {
  1876.             return !this.showedAttribution && !!this.getAttributionSource()
  1877.         },
  1878.         getNewsItems: function(h) {
  1879.             if (!this.results.d || !this.results.d.length) {
  1880.                 return
  1881.             }
  1882.             var g = [];
  1883.             for (var k = 0; k < this.results.d.length; k++) {
  1884.                 var m = this.results.d[k],
  1885.                     j = m.da && m.da.split(",");
  1886.                 if (j && j.indexOf("news") > -1) {
  1887.                     var n = m.d.split("/")[0];
  1888.                     g.push({
  1889.                         title: m.t,
  1890.                         excerpt: m.a,
  1891.                         url: m.u,
  1892.                         source: n,
  1893.                         fetch_image: f.Data.NewsImageDomains.indexOf(n) > -1,
  1894.                         rank: k
  1895.                     })
  1896.                 }
  1897.             }
  1898.             if (h && g.length === 1 && g[0].rank < 5) {
  1899.                 return []
  1900.             }
  1901.             return g
  1902.         },
  1903.         addResults: function(h, g) {
  1904.             if (!this.results[h]) {
  1905.                 this.results[h] = g
  1906.             } else {
  1907.                 this.results[h] = this.results[h].concat(g)
  1908.             }
  1909.             this._emitChange("results")
  1910.         },
  1911.         _checkBackClickFromSecondPage: function() {
  1912.             if (!this.getInstance("settings").autoloadDisabled() || this._hasShownFirstPage) {
  1913.                 return
  1914.             }
  1915.             var h = this.getInstance("backData").getId(),
  1916.                 g = h && h.match(/r([1a])-([0-9]*)/);
  1917.             if (g) {
  1918.                 this._hasShownFirstPage = (g[1] === "1" && parseInt(g[2], 10) > 8) || (g[1] === "a" && parseInt(g[2], 10) > 0)
  1919.             }
  1920.         },
  1921.         nrnWrapper: function(o, j) {
  1922.             var n = this.getInstance("page").ads,
  1923.                 k = this.getInstance("adFeed"),
  1924.                 h = this.getInstance("settings").autoloadDisabled() && o === b;
  1925.             if (o === "d" && !this._hasShownFirstPage) {
  1926.                 for (var m = 0; m < j.length; m++) {
  1927.                     if (j[m].k) {
  1928.                         k.setDefaultAds([j[m]], n.adxExperiment);
  1929.                         break
  1930.                     }
  1931.                 }
  1932.                 var g = k.getAds();
  1933.                 if (k.yjsFeedActive) {
  1934.                     if (k.loading) {
  1935.                         this._heldOrganics = j;
  1936.                         k.organicsLoaded();
  1937.                         return
  1938.                     } else {
  1939.                         if (g.length) {
  1940.                             this.nrnWrapper("a", g)
  1941.                         }
  1942.                     }
  1943.                 } else {
  1944.                     if (!(this.results.a && this.results.a.length) && g.length) {
  1945.                         this.nrnWrapper("a", g)
  1946.                     }
  1947.                 }
  1948.             }
  1949.             this._checkBackClickFromSecondPage();
  1950.             if (h && !this._hasShownFirstPage) {
  1951.                 this._currentPageItems[o] = j.slice(0, a);
  1952.                 this._pendingOrganics = j.slice(a);
  1953.                 this._hasShownFirstPage = true;
  1954.                 j = this._currentPageItems[o]
  1955.             } else {
  1956.                 this._currentPageItems[o] = j
  1957.             }
  1958.             this.addResults(o, j);
  1959.             if (o === "a" && !n.isBlocked() && j.length) {
  1960.                 this._sendAdImpressions(j)
  1961.             }
  1962.             if (o === "a" && this.pageNumber === 1) {
  1963.                 n.setAds(j)
  1964.             }
  1965.             if (this._currentPageItems.a.length && this._currentPageItems.d.length) {
  1966.                 this._splitNrnResults()
  1967.             } else {
  1968.                 if (o === "d") {
  1969.                     nrn(o, j, true, true);
  1970.                     this._setFirstPageRendered();
  1971.                     this._currentPageItemsReset()
  1972.                 }
  1973.             }
  1974.         },
  1975.         pageNumberIncrement: function() {
  1976.             return ++this.pageNumber
  1977.         },
  1978.         pageNumberDecrement: function() {
  1979.             return --this.pageNumber
  1980.         },
  1981.         hasPendingResults: function() {
  1982.             return this._pendingOrganics && this._pendingOrganics.length
  1983.         },
  1984.         showPendingResults: function() {
  1985.             if (this.hasPendingResults()) {
  1986.                 var g = this._pendingOrganics;
  1987.                 this._pendingOrganics = null;
  1988.                 this.nrnWrapper("d", g);
  1989.                 f.ImageLoader.registerAll($(".js-lazyload-icons"), "scrollY")
  1990.             }
  1991.         },
  1992.         hasMoreResultsToLoad: function() {
  1993.             var h = this.results.d ? this.results.d.length : 0;
  1994.             var i = this.hasPendingResults();
  1995.             var g = "";
  1996.             if (i) {
  1997.                 g = this._pendingOrganics[i - 1].n
  1998.             } else {
  1999.                 if (h) {
  2000.                     g = this.results.d[h - 1].n
  2001.                 }
  2002.             }
  2003.             return !!g
  2004.         },
  2005.         _currentPageItemsReset: function() {
  2006.             this._currentPageItems.a = [];
  2007.             this._currentPageItems.d = []
  2008.         },
  2009.         _sendAdImpressions: function(j) {
  2010.             var h = {},
  2011.                 k = this.getInstance("page"),
  2012.                 i = false;
  2013.             h.n = j.length;
  2014.             h.rl = window.rl;
  2015.             j.forEach(function(q, p) {
  2016.                 q.adn = j.length;
  2017.                 if (q.l && q.l.indexOf("sponsored__sitelink-description") > -1) {
  2018.                     i = true
  2019.                 }
  2020.                 if (this.pageNumber === 1) {
  2021.                     q.adf = 1
  2022.                 }
  2023.             }.bind(this));
  2024.             h.sld = i ? 1 : 0;
  2025.             var o = j[0].d;
  2026.             o = o.split("/");
  2027.             o = o.shift();
  2028.             if (o) {
  2029.                 h.d = o
  2030.             }
  2031.             var n = k.ads.adx;
  2032.             if (n && n !== "ctl") {
  2033.                 h.adx = n
  2034.             }
  2035.             if (window.sourceTag) {
  2036.                 h.st = window.sourceTag
  2037.             }
  2038.             if (k.ads.adxExperiment) {
  2039.                 h.adx_name = k.ads.adxExperiment
  2040.             }
  2041.             try {
  2042.                 var g = j.map(function(p) {
  2043.                     return p.d
  2044.                 }).join(",");
  2045.                 h.ds = g
  2046.             } catch (m) {}
  2047.             this.getInstance("pixel").fire("ad", j[0].s || "default", h)
  2048.         },
  2049.         _canShowSouthAds: function() {
  2050.             return this.pageNumber === 1 && f.settings.isDefault("kav") && f.settings.isDefault("k1") && !this.getInstance("adFeed").isUsingDefaultAds()
  2051.         },
  2052.         _splitNrnResults: function() {
  2053.             var m = true,
  2054.                 h = false,
  2055.                 k, g, i = this.getInstance("page").ads,
  2056.                 j = this.getInstance("device").isMobile ? 1 : 2;
  2057.             if (this.getInstance("settings").autoloadDisabled() && !this._hasRenderedFirstPage) {
  2058.                 this._blockResultSplit = true;
  2059.                 if (this._currentPageItems.d.length < 10) {
  2060.                     this._blockResultSplit = false
  2061.                 }
  2062.             }
  2063.             if (this._currentPageItems.a.length > j && !this._blockResultSplit) {
  2064.                 nrn("a", this._currentPageItems.a.slice(0, j), m);
  2065.                 nrn("d", this._currentPageItems.d.slice(0, 15), m, h);
  2066.                 this.pageNumber++;
  2067.                 this.emit("add-separator");
  2068.                 nrn("a", this._currentPageItems.a.slice(j, this._currentPageItems.a.length), m);
  2069.                 h = true;
  2070.                 nrn("d", this._currentPageItems.d.slice(15, this._currentPageItems.d.length), m, h)
  2071.             } else {
  2072.                 if (this._currentPageItems.a.length && i.adx !== "rel2" && this._canShowSouthAds()) {
  2073.                     k = i.getNorthAds(this._currentPageItems.a);
  2074.                     nrn("a", k, m, h);
  2075.                     g = i.getSouthAds(this._currentPageItems.a);
  2076.                     h = g.length === 0;
  2077.                     nrn("d", this._currentPageItems.d, m, h);
  2078.                     if (g.length) {
  2079.                         h = true;
  2080.                         nrn("a", g, m, h)
  2081.                     }
  2082.                 } else {
  2083.                     if (this._currentPageItems.a.length) {
  2084.                         nrn("a", this._currentPageItems.a, m, h);
  2085.                         h = true;
  2086.                         nrn("d", this._currentPageItems.d, m, h)
  2087.                     }
  2088.                 }
  2089.             }
  2090.             this._currentPageItemsReset();
  2091.             this._setFirstPageRendered()
  2092.         },
  2093.         _setFirstPageRendered: function() {
  2094.             if (!this.finished) {
  2095.                 this.set("finished", new Date().getTime())
  2096.             }
  2097.             this.emit("rendered");
  2098.             if (this.getInstance("settings").autoloadDisabled()) {
  2099.                 this._hasRenderedFirstPage = true;
  2100.                 this._blockResultSplit = false
  2101.             }
  2102.         }
  2103.     })
  2104. }(DDG);
  2105. ! function(c) {
  2106.     var b = c.Models,
  2107.         a = b.Base,
  2108.         f = [{
  2109.             name: l("Any Time"),
  2110.             id: ""
  2111.         }, {
  2112.             name: l("Past Day"),
  2113.             id: "d"
  2114.         }, {
  2115.             name: l("Past Week"),
  2116.             id: "w"
  2117.         }, {
  2118.             name: l("Past Month"),
  2119.             id: "m"
  2120.         }, {
  2121.             name: l("Past Year"),
  2122.             id: "y"
  2123.         }],
  2124.         e = 4;
  2125.     b.Search = function(g) {
  2126.         this.dateFilterId = window[c.Data.HiddenFields.DATE_FILTER];
  2127.         this.deepAnswerIAs = {};
  2128.         this.isAdultQuery = window.iqa;
  2129.         this.isMinusQuery = window.iqm;
  2130.         this.isQuoteQuery = window.iqq;
  2131.         this.isDomainQuery = window.iqd;
  2132.         this.isVertical = false;
  2133.         this.isSiteQuery = window.rq && window.rq.indexOf("site%3A") !== -1;
  2134.         a.call(this, g);
  2135.         this.on("change:dateFilterId", this._setDateFilter.bind(this));
  2136.         this.on("change:isVertical", this._changedVertical.bind(this));
  2137.         this._setDateFilter()
  2138.     };
  2139.     b.Search.prototype = $.extend({}, a.prototype, {
  2140.         _dateFilters: f,
  2141.         requery: function() {
  2142.             this.emit("requery")
  2143.         },
  2144.         addBangToSiteInQuery: function(g, h) {
  2145.             return h.replace(new RegExp("(^|\\s)(" + g + ")($|\\s)", "i"), "$1!$2$3")
  2146.         },
  2147.         isLatLonQuery: function() {
  2148.             return !!c.get_query().match(/latitude|longitude/gi)
  2149.         },
  2150.         getDateFilterName: function() {
  2151.             return this._dateFilterName
  2152.         },
  2153.         getResultCount: function() {
  2154.             return window.r1c || 0
  2155.         },
  2156.         _changedVertical: function() {
  2157.             if (this.isVertical && this.dateFilterId === f[e].id) {
  2158.                 this._hadPastYear = true;
  2159.                 this.set("dateFilterId", "")
  2160.             } else {
  2161.                 if (!this.isVertical && this._hadPastYear) {
  2162.                     this.set("dateFilterId", f[e].id)
  2163.                 }
  2164.             }
  2165.         },
  2166.         _setDateFilter: function() {
  2167.             this._dateFilters.forEach(function(g) {
  2168.                 if (g.id === this.dateFilterId) {
  2169.                     g.selected = 1;
  2170.                     this._dateFilterName = g.name
  2171.                 } else {
  2172.                     g.selected = 0
  2173.                 }
  2174.             }.bind(this))
  2175.         },
  2176.         getDateFilters: function() {
  2177.             if (this.isVertical) {
  2178.                 return this._dateFilters.slice(0, e)
  2179.             }
  2180.             return this._dateFilters
  2181.         },
  2182.         getSiteQuery: function(q) {
  2183.             if (!q) {
  2184.                 return false
  2185.             }
  2186.             q = decodeURIComponentSafe(q);
  2187.             q = c.strip_html(q);
  2188.             var h, g, t = false,
  2189.                 n, s = [],
  2190.                 o, r = q,
  2191.                 p = [];
  2192.             n = q.match(/((NOT )?SITE:)([^\s]+)/);
  2193.             if (n) {
  2194.                 t = !!n[2];
  2195.                 p = n[3].split(",");
  2196.                 r = q.substring(0, n.index - 1);
  2197.                 for (var m = 0; m < p.length; m++) {
  2198.                     if (!p[m]) {
  2199.                         continue
  2200.                     }
  2201.                     h = [];
  2202.                     for (var k = 0; k < p.length; k++) {
  2203.                         if (k !== m) {
  2204.                             h.push(p[k])
  2205.                         }
  2206.                     }
  2207.                     o = (t) ? " NOT SITE:" : " SITE:";
  2208.                     g = (h.length) ? o + h.join(",") : "";
  2209.                     s.push({
  2210.                         site: p[m],
  2211.                         clearQuery: encodeURIComponent(r + g)
  2212.                     })
  2213.                 }
  2214.             }
  2215.             if (!this.isYhsSource() && t && (s.length > 1 || rqd.toLowerCase().indexOf("not site:") !== -1)) {
  2216.                 s = []
  2217.             }
  2218.             return {
  2219.                 str: q,
  2220.                 query: r,
  2221.                 sites: s,
  2222.                 isExcluding: t
  2223.             }
  2224.         },
  2225.         isYhsSource: function() {
  2226.             return this.src === "yhs"
  2227.         },
  2228.         isQuotedQuery: function() {
  2229.             return c.get_query().match(/(\'.+\')|(\".+\")/)
  2230.         }
  2231.     })
  2232. }(DDG);
  2233. ! function(b) {
  2234.     var a = b.Models.Base;
  2235.     b.Models.Search.Spelling = function(c) {
  2236.         a.call(this, c);
  2237.         this.type = this.type.toLowerCase();
  2238.         this.query = decodeURIComponentSafe(c.link);
  2239.         this.recourseQuery = decodeURIComponentSafe(c.recourseLink);
  2240.         this.parsedQuery = c.suggestion && c.suggestion.replace(/<\/?[^>]+(>|$)/g, "");
  2241.         if (this.type === "nmrc") {
  2242.             this.parsedQuery = window.rq
  2243.         }
  2244.     };
  2245.     b.Models.Search.Spelling.prototype = $.extend({}, a.prototype, {
  2246.         isValidType: function() {
  2247.             return (this.type && this.type.match(/irf|dym|nmrc/))
  2248.         },
  2249.         makeSpellingURL: function(f, e, c) {
  2250.             if (c) {
  2251.                 f += "&iar=" + c + "&ia=" + c
  2252.             }
  2253.             var g = b.searchExperiments ? b.searchExperiments.getExperimentGroup("rspexp2") : null;
  2254.             return "/?q=" + f + (e ? "&norw=1" : "") + (w.rv ? "&v=" + w.rv : "") + (w.kurl ? w.kurl : "") + (g ? "&rspexp=" + g : "")
  2255.         }
  2256.     })
  2257. }(DDG);
  2258. var d = document;
  2259. var w = window;
  2260. var cd, dz, da, fk, fb, fs, fm, fe, fl, fo, fa, fn, fq, fz, ie, io, ir, is, ga, gd, rc, rd, rs, rsd, rdc, rsc, rtc, rii, rin, rir, rl, rp, reb, rebc, sx, sy, tl, tlz, tac, tr, ts, tn, tsl, tz, nir, kurl, is_mobile, dow, iosx;
  2261. fb = irl = il = dz = da = dam = daiq = daia = fz = tl = tlz = sx = sy = fl = fo = fa = fn = rdc = rtc = rsc = rii = rin = rebc = tsl = tac = tn = tz = fe = fmx = fmy = ieof = iad = iad2 = iad3 = iadt = 0;
  2262. kurl = "";
  2263. rpc = fk = fs = 1;
  2264. tr = new Array();
  2265. ts = new Array();
  2266. rsd = new Array();
  2267. reb = new Array();
  2268. ! function(c) {
  2269.     var b = c.Models,
  2270.         a = b.Base;
  2271.     b.Hidden = function(f) {
  2272.         a.call(this, f);
  2273.         this._vals = {};
  2274.         for (var g in c.Data.HiddenFields) {
  2275.             var e = c.Data.HiddenFields[g];
  2276.             if (window[e]) {
  2277.                 this.set(e, window[e])
  2278.             }
  2279.         }
  2280.     };
  2281.     b.Hidden.prototype = $.extend({}, a.prototype, {
  2282.         set: function(e, f) {
  2283.             this._vals[e] = f;
  2284.             this.emit("change")
  2285.         },
  2286.         get: function(e) {
  2287.             return this._vals[e]
  2288.         },
  2289.         clear: function(e) {
  2290.             delete this._vals[e];
  2291.             this.emit("change")
  2292.         },
  2293.         toJSON: function() {
  2294.             return $.extend({}, this._vals)
  2295.         }
  2296.     })
  2297. }(DDG);
  2298. ! function(c) {
  2299.     var a = c.Models.Base,
  2300.         b = {
  2301.             Firefox: {
  2302.                 canInstall: function() {
  2303.                     return !this.device.isMobileDevice && this.device.isFirefox && !this.device.isFirefoxLessThan57
  2304.                 },
  2305.                 url: "https://addons.mozilla.org/firefox/downloads/latest/duckduckgo-for-firefox/addon-385621-latest.xpi",
  2306.                 reviewsUrl: "https://addons.mozilla.org/firefox/addon/duckduckgo-for-firefox/reviews/",
  2307.                 watchCSSForSuccess: true
  2308.             },
  2309.             Chrome: {
  2310.                 canInstall: function() {
  2311.                     return !this.device.isMobileDevice && this.device.isChrome && ((this.device.isWindows && this.device.chromeVersion >= 36) || (this.device.isOSX && this.device.chromeVersion >= 56))
  2312.                 },
  2313.                 url: "https://chrome.google.com/webstore/detail/bkdgflcldnnnapblkhphbgpggdiikppg"
  2314.             },
  2315.             Edge: {
  2316.                 canInstall: function() {
  2317.                     if (c.device.isEnglish) {
  2318.                         return false
  2319.                     }
  2320.                     return !this.device.isMobileDevice && this.device.isEdgeChromium && ((this.device.isWindows && this.device.chromeVersion >= 36) || (this.device.isOSX && this.device.chromeVersion >= 56))
  2321.                 },
  2322.                 url: "https://chrome.google.com/webstore/detail/bkdgflcldnnnapblkhphbgpggdiikppg"
  2323.             },
  2324.             Brave: {
  2325.                 canInstall: function() {
  2326.                     return !this.device.isMobileDevice && this.device.isBrave && ((this.device.isWindows && this.device.chromeVersion >= 36) || (this.device.isOSX && this.device.chromeVersion >= 56))
  2327.                 },
  2328.                 url: "https://chrome.google.com/webstore/detail/bkdgflcldnnnapblkhphbgpggdiikppg"
  2329.             },
  2330.             Vivaldi: {
  2331.                 canInstall: function() {
  2332.                     return false
  2333.                 },
  2334.                 url: "https://chrome.google.com/webstore/detail/bkdgflcldnnnapblkhphbgpggdiikppg"
  2335.             },
  2336.             Safari: {
  2337.                 canInstall: function() {
  2338.                     return !this.device.isMobileDevice && this.device.isOSX && this.device.isOSXCatalinaAndUp && !this.device.isIPadOS && this.device.isSafari && this.device.safariVersion >= 13 && document.location.pathname.indexOf("/app") === 0
  2339.                 },
  2340.                 url: "https://apps.apple.com/app/duckduckgo-privacy-essentials/id1482920575",
  2341.                 watchCSSForSuccess: true
  2342.             }
  2343.         };
  2344.     c.Models.Extension = function(e) {
  2345.         a.call(this, e);
  2346.         this.device = (e && e.device) || c.device;
  2347.         $.extend(this, b[this.device.browserName] || {})
  2348.     };
  2349.     c.Models.Extension.prototype = $.extend({}, a.prototype, {
  2350.         canInstall: function() {
  2351.             return false
  2352.         },
  2353.         isInstalled: function(f) {
  2354.             if (typeof this._isInstalled !== "undefined" && !(f && f.nocache)) {
  2355.                 return this._isInstalled
  2356.             }
  2357.             var e = $('<div class="ddg-extension-check ddg-extension-hide"></div>');
  2358.             $("body").append(e);
  2359.             this._isInstalled = e.is(":hidden") && !c.device.isDDGApp;
  2360.             e.remove();
  2361.             return this._isInstalled
  2362.         }
  2363.     })
  2364. }(DDG);
  2365. ! function(c) {
  2366.     var b = c.Models.Base,
  2367.         a = "kos";
  2368.     c.Models.Onboarding = function(f) {
  2369.         b.call(this, f);
  2370.         var e = this.getLastRecordedStep();
  2371.         this.set("step", e >= 2 && !c.extension.isInstalled({
  2372.             nocache: true
  2373.         }) ? 1 : e)
  2374.     };
  2375.     c.Models.Onboarding.prototype = $.extend({}, b.prototype, {
  2376.         setStep: function(e) {
  2377.             switch (e) {
  2378.                 case 0:
  2379.                     if (!this.hasBeenExposed()) {
  2380.                         c.settings.set(a, "0")
  2381.                     }
  2382.                     this.set("step", e);
  2383.                     break;
  2384.                 case 1:
  2385.                     if (this.getLastRecordedStep() < 1) {
  2386.                         c.settings.set(a, "1")
  2387.                     }
  2388.                     this.set("step", e);
  2389.                     break;
  2390.                 case 2:
  2391.                     if (this.getLastRecordedStep() !== 2) {
  2392.                         c.settings.set(a, "2")
  2393.                     }
  2394.                     this.set("step", e);
  2395.                     break;
  2396.                 case 3:
  2397.                     if (this.getLastRecordedStep() < 3) {
  2398.                         c.settings.set(a, "3")
  2399.                     }
  2400.                     this.set("step", e);
  2401.                     break
  2402.             }
  2403.         },
  2404.         getStep: function() {
  2405.             return this.step
  2406.         },
  2407.         getLastRecordedStep: function() {
  2408.             var e = parseInt(c.settings.get(a), 10);
  2409.             return e > 0 ? e : 0
  2410.         },
  2411.         hasBeenExposed: function() {
  2412.             return !c.settings.isDefault(a)
  2413.         },
  2414.         hasStarted: function() {
  2415.             return this.step > 0
  2416.         },
  2417.         hasCompleted: function() {
  2418.             return this.step === 3 && c.extension.isInstalled({
  2419.                 nocache: true
  2420.             })
  2421.         },
  2422.         isResumable: function() {
  2423.             return this.step > 0
  2424.         },
  2425.         hasCompletedStep1: function() {
  2426.             return c.extension.isInstalled({
  2427.                 nocache: true
  2428.             }) || this.step >= 2
  2429.         }
  2430.     })
  2431. }(DDG);
  2432. ! function(h) {
  2433.     var b = h.Models.Base,
  2434.         k = 3,
  2435.         e = "cppm-s-v2",
  2436.         j = "cppm-i-v2",
  2437.         g = "cppm-d-v2";
  2438.     h.Models.MobileOnboarding = function(m) {
  2439.         b.call(this, m);
  2440.         var p, s, q;
  2441.         this.hasStorage = true;
  2442.         this.wasExposedToV1 = false;
  2443.         try {
  2444.             if (window.localStorage) {
  2445.                 for (var o = 0; o < window.localStorage.length; o++) {
  2446.                     var n = window.localStorage.key(o);
  2447.                     if (n && /^cppm-.*-v[12]$/.test(n)) {
  2448.                         window.localStorage.removeItem(n)
  2449.                     }
  2450.                 }
  2451.                 if (this.useLocalStorage) {
  2452.                     p = window.localStorage.getItem(e);
  2453.                     s = window.localStorage.getItem(j);
  2454.                     q = window.localStorage.getItem(g)
  2455.                 }
  2456.             } else {
  2457.                 this.hasStorage = false
  2458.             }
  2459.         } catch (r) {
  2460.             this.hasStorage = false
  2461.         }
  2462.         this.set("statuses", i(p));
  2463.         this.set("impressions", a(s));
  2464.         this.set("isDirty", String(q) === "true");
  2465.         this.set("openStatuses", i())
  2466.     };
  2467.     h.Models.MobileOnboarding.prototype = $.extend({}, b.prototype, {
  2468.         completeStep: function(n) {
  2469.             this.set("statuses", this.statuses.map(function(q, p) {
  2470.                 if (p === n) {
  2471.                     return "completed"
  2472.                 }
  2473.                 return q
  2474.             }));
  2475.             if (this.useLocalStorage) {
  2476.                 var m = c(this.statuses);
  2477.                 try {
  2478.                     if (window.localStorage) {
  2479.                         window.localStorage.setItem(e, m)
  2480.                     }
  2481.                 } catch (o) {}
  2482.             }
  2483.         },
  2484.         trackRenderedStep: function(n) {
  2485.             this.set("impressions", this.impressions.map(function(q, p) {
  2486.                 if (p === n) {
  2487.                     return true
  2488.                 }
  2489.                 return q
  2490.             }));
  2491.             if (this.useLocalStorage) {
  2492.                 var m = f(this.impressions);
  2493.                 try {
  2494.                     if (window.localStorage) {
  2495.                         window.localStorage.setItem(j, m)
  2496.                     }
  2497.                 } catch (o) {}
  2498.             }
  2499.         },
  2500.         markDirty: function() {
  2501.             if (!this.isResumable()) {
  2502.                 this.set("isDirty", true);
  2503.                 if (this.useLocalStorage) {
  2504.                     try {
  2505.                         if (window.localStorage) {
  2506.                             window.localStorage.setItem(g, "true")
  2507.                         }
  2508.                     } catch (m) {}
  2509.                 }
  2510.             }
  2511.         },
  2512.         setOpenStatuses: function() {
  2513.             this.set("openStatuses", this.getStatuses())
  2514.         },
  2515.         isResumable: function() {
  2516.             return this.isDirty || this.statuses.some(function(m) {
  2517.                 return m === "completed"
  2518.             })
  2519.         },
  2520.         hasBeenExposed: function() {
  2521.             return this.getImpressions().some(function(m) {
  2522.                 return m
  2523.             })
  2524.         },
  2525.         hasCompletedAllSteps: function() {
  2526.             return this.statuses.every(function(m) {
  2527.                 return m === "completed"
  2528.             })
  2529.         },
  2530.         hasDdgAsDefault: function() {
  2531.             return this.statuses[0] === "completed"
  2532.         },
  2533.         hasDdgApp: function() {
  2534.             return this.statuses[1] === "completed"
  2535.         },
  2536.         hasDdgExtension: function() {
  2537.             return this.statuses[2] === "completed"
  2538.         },
  2539.         getStatuses: function() {
  2540.             return this.statuses.slice()
  2541.         },
  2542.         getOpenStatuses: function() {
  2543.             return this.openStatuses.slice()
  2544.         },
  2545.         getImpressions: function() {
  2546.             return this.impressions.slice()
  2547.         },
  2548.         getPixelStatuses: function(m) {
  2549.             m = m || this.getStatuses();
  2550.             return (c(m).replace("0", this.createPixelStep(0)).replace("1", this.createPixelStep(1)).replace("2", this.createPixelStep(2)).replace("3", this.createPixelStep(3)) + "n")
  2551.         },
  2552.         createPixelStep: function(m) {
  2553.             switch (m) {
  2554.                 case 0:
  2555.                     return "d";
  2556.                 case 1:
  2557.                     return "a";
  2558.                 case 2:
  2559.                     return "e";
  2560.                 case 3:
  2561.                     return "c";
  2562.                 default:
  2563.                     return ""
  2564.             }
  2565.         },
  2566.         getPixelOpenStatuses: function() {
  2567.             return this.getPixelStatuses(this.getOpenStatuses())
  2568.         },
  2569.         getPixelImpressionStatuses: function() {
  2570.             return (f(this.getImpressions()).replace("0", this.createPixelStep(0)).replace("1", this.createPixelStep(1)).replace("2", this.createPixelStep(2)).replace("3", this.createPixelStep(3)) + "n")
  2571.         },
  2572.         getStatus: function(m) {
  2573.             return this.statuses[m]
  2574.         },
  2575.         getResumeStep: function(m) {
  2576.             m = m || 0;
  2577.             var o = m;
  2578.             for (var n = m; n < this.statuses.length; n++) {
  2579.                 if (this.statuses[n] !== "completed") {
  2580.                     o = n;
  2581.                     break
  2582.                 }
  2583.             }
  2584.             return this.statuses[o] === "completed" ? this.statuses.length : o
  2585.         },
  2586.         getProgressValue: function() {
  2587.             return this.statuses.filter(function(m) {
  2588.                 return m === "completed"
  2589.             }).length
  2590.         }
  2591.     });
  2592.  
  2593.     function i(o) {
  2594.         var m, n = [];
  2595.         if (!o) {
  2596.             for (m = 0; m < k; m++) {
  2597.                 n.push("pending")
  2598.             }
  2599.         } else {
  2600.             var p = o.split("-");
  2601.             for (m = 0; m < k; m++) {
  2602.                 n.push(p.indexOf(m.toString()) === -1 ? "pending" : "completed")
  2603.             }
  2604.         }
  2605.         return n
  2606.     }
  2607.  
  2608.     function c(o) {
  2609.         var m = [];
  2610.         for (var n = 0; n < o.length; n++) {
  2611.             if (o[n] === "completed") {
  2612.                 m.push(n)
  2613.             }
  2614.         }
  2615.         return m.join("-")
  2616.     }
  2617.  
  2618.     function a(n) {
  2619.         var m, o = [];
  2620.         if (!n) {
  2621.             for (m = 0; m < (k + 1); m++) {
  2622.                 o.push(false)
  2623.             }
  2624.         } else {
  2625.             var p = n.split("-");
  2626.             for (m = 0; m < (k + 1); m++) {
  2627.                 o.push(p.indexOf(m.toString()) !== -1)
  2628.             }
  2629.         }
  2630.         return o
  2631.     }
  2632.  
  2633.     function f(o) {
  2634.         var m = [];
  2635.         for (var n = 0; n < o.length; n++) {
  2636.             if (o[n]) {
  2637.                 m.push(n)
  2638.             }
  2639.         }
  2640.         return m.join("-")
  2641.     }
  2642. }(DDG);
  2643. ! function(c) {
  2644.     var a = c.Models.Base,
  2645.         b = 700,
  2646.         e = 2500;
  2647.     c.Models.AdFeed = function(f) {
  2648.         this._pixel = f.pixel;
  2649.         a.call(this, f);
  2650.         this.ads = [];
  2651.         this.defaultAds = []
  2652.     };
  2653.     c.Models.AdFeed.prototype = $.extend({}, a.prototype, {
  2654.         setDefaultAds: function(f, h) {
  2655.             var g = DDG.searchExperiments.v7exp && DDG.searchExperiments.v7exp.activeGroup === "a";
  2656.             if (this.ads.length || !f || !f.length || g) {
  2657.                 return
  2658.             }
  2659.             this.set("defaultAds", f.map(function(j) {
  2660.                 var i = this._makeAffiliateAd(j, h);
  2661.                 return {
  2662.                     a: j.a.substring(0, 75) + (j.a.length > 75 ? "..." : ""),
  2663.                     d: j.d,
  2664.                     m: 0,
  2665.                     s: i.s,
  2666.                     p: 1,
  2667.                     c: i.c,
  2668.                     u: i.u,
  2669.                     h: 0,
  2670.                     k: 0,
  2671.                     i: j.i,
  2672.                     t: j.t.substring(0, 60) + (j.t.length > 60 ? "..." : ""),
  2673.                     "IE fix": 1
  2674.                 }
  2675.             }.bind(this)))
  2676.         },
  2677.         getAds: function() {
  2678.             var f = [];
  2679.             if (this.ads && this.ads.length) {
  2680.                 f = this.ads
  2681.             } else {
  2682.                 if (this.defaultAds && this.defaultAds.length) {
  2683.                     f = this.defaultAds
  2684.                 }
  2685.             }
  2686.             return f
  2687.         },
  2688.         setAds: function(g) {
  2689.             var f = this.getInstance("pixel");
  2690.             if (this.blockReallyLateAds) {
  2691.                 f.fire("sad", {
  2692.                     b: 1,
  2693.                     r: "late"
  2694.                 });
  2695.                 return
  2696.             } else {
  2697.                 if (!this.loading) {
  2698.                     if (g && g.length) {
  2699.                         g.forEach(function(h) {
  2700.                             h.late = true;
  2701.                             delete h.l
  2702.                         })
  2703.                     }
  2704.                     f.fire("sad", {
  2705.                         b: 0,
  2706.                         r: "late"
  2707.                     });
  2708.                     this.set("lateAds", g || []);
  2709.                     return
  2710.                 }
  2711.             }
  2712.             clearTimeout(this._fallbackToDefaultTimeout);
  2713.             delete this._fallbackToDefaultTimeout;
  2714.             this.set("loading", false);
  2715.             this.set("ads", g || [])
  2716.         },
  2717.         isUsingDefaultAds: function() {
  2718.             return !this.ads.length && this.defaultAds.length
  2719.         },
  2720.         load: function(g) {
  2721.             if (this.loading) {
  2722.                 return
  2723.             }
  2724.             var f = nrj(g);
  2725.             f.addEventListener("error", function() {
  2726.                 this.setAds([])
  2727.             }.bind(this));
  2728.             this.set("yjsFeedActive", true);
  2729.             this.set("loading", true)
  2730.         },
  2731.         organicsLoaded: function() {
  2732.             this._fallbackToDefaultTimeout = setTimeout(function() {
  2733.                 this.set("loading");
  2734.                 this.set("ads", [])
  2735.             }.bind(this), b);
  2736.             this._blockAdsCompletelyTimeout = setTimeout(function() {
  2737.                 this.set("blockReallyLateAds", true)
  2738.             }.bind(this), e)
  2739.         },
  2740.         _makeAffiliateAd: function(g, h) {
  2741.             var f = h ? "&adx_name=" + h : "";
  2742.             return {
  2743.                 c: "/y.js?u2=" + encodeURIComponent(g.c) + f + (window.ra ? "&a=" + window.ra : "") + ("&vqd=" + window.vqd),
  2744.                 u: "/y.js?u2=" + encodeURIComponent(g.u) + f + (window.ra ? "&a=" + window.ra : "") + ("&vqd=" + window.vqd),
  2745.                 s: g.k
  2746.             }
  2747.         }
  2748.     })
  2749. }(DDG);
  2750. ! function(c) {
  2751.     var a = c.Models.Base,
  2752.         b = {
  2753.             ctl: {
  2754.                 rightRailSecond: true
  2755.             },
  2756.             def: {
  2757.                 rightRailSecond: true
  2758.             },
  2759.             nav: {
  2760.                 rightRailSecond: true
  2761.             },
  2762.             tasb: {
  2763.                 siteLinksBothAds: true
  2764.             },
  2765.             tas1: {
  2766.                 siteLinksFirstAdOnly: true
  2767.             },
  2768.             tas2: {
  2769.                 siteLinksSecondAdOnly: true
  2770.             },
  2771.             oag: {
  2772.                 rightRailSecond: true,
  2773.                 siteLinksFirstAdOnly: true
  2774.             },
  2775.             rel2: {
  2776.                 rightRailBoth: true
  2777.             },
  2778.             none: {
  2779.                 rightRailSecond: false,
  2780.                 rightRailBoth: false,
  2781.                 smallFirst: false,
  2782.                 smallSecond: false,
  2783.                 siteLinksFirstAdOnly: false,
  2784.                 siteLinksSecondAdOnly: false,
  2785.                 siteLinksBothAds: false
  2786.             }
  2787.         };
  2788.     c.Models.Ads = function(e) {
  2789.         this._deep = e.deep;
  2790.         this._device = e.device;
  2791.         this._settings = e.settings;
  2792.         a.call(this, e);
  2793.         this.ads = [];
  2794.         this.setBucket("def");
  2795.         this.on("change:ads", this._updateLayout.bind(this))
  2796.     };
  2797.     c.Models.Ads.prototype = $.extend({}, a.prototype, {
  2798.         block: function() {
  2799.             this.set("blocked", 1)
  2800.         },
  2801.         isBlocked: function() {
  2802.             return !!(this.blocked || !this.getInstance("settings").isDefault("k1"))
  2803.         },
  2804.         setAds: function(e) {
  2805.             if (this.isBlocked() || !e || !e.length) {
  2806.                 return
  2807.             }
  2808.             this.set("ads", e)
  2809.         },
  2810.         getAds: function() {
  2811.             return this.ads
  2812.         },
  2813.         getNorthAds: function(f) {
  2814.             return f;
  2815.             var e = 2;
  2816.             if (this.rightRailSecond) {
  2817.                 e = 1
  2818.             } else {
  2819.                 if (this.rightRailBoth) {
  2820.                     e = 0
  2821.                 }
  2822.             }
  2823.             e = Math.min(f.length, e);
  2824.             if (!this.canShowRightRailAds()) {
  2825.                 return f.slice(0, e)
  2826.             }
  2827.             return f.slice(0, e + 1)
  2828.         },
  2829.         getSouthAds: function(h) {
  2830.             return [];
  2831.             var e, g = (h.length > 1) ? this.numTopAds : 0,
  2832.                 f = h.length;
  2833.             if (g - f === 0) {
  2834.                 g = 0;
  2835.                 f = 1
  2836.             }
  2837.             if (f - g > 1) {
  2838.                 g = f - 1
  2839.             }
  2840.             e = h.slice(g, f);
  2841.             e.forEach(function(i) {
  2842.                 delete i.l
  2843.             });
  2844.             return e
  2845.         },
  2846.         hasAds: function() {
  2847.             var e = this.getAds();
  2848.             return !!e.length
  2849.         },
  2850.         getNumberOfTopAds: function() {
  2851.             return this.numTopAds
  2852.         },
  2853.         hasGoodAds: function() {
  2854.             return true;
  2855.             return (this.adx === "tas" || this.adx === "tasb" || this.adx === "tas1" || this.adx === "tas2" || this.adx === "oag")
  2856.         },
  2857.         canShowGoodAdsLayout: function() {
  2858.             return (!this.getInstance("device").isMobile && this.hasGoodAds() && (this.getInstance("deep").pageNumber === 1))
  2859.         },
  2860.         canShowEnhancedSiteLinks: function(e) {
  2861.             if (!this.canShowGoodAdsLayout()) {
  2862.                 return false
  2863.             }
  2864.             return (this.siteLinksSecondAdOnly && e > 0) || (this.siteLinksFirstAdOnly && e === 0) || this.siteLinksBothAds
  2865.         },
  2866.         setBucket: function(f, e) {
  2867.             f = "tas1";
  2868.             if (this._firstBatchShown) {
  2869.                 return
  2870.             }
  2871.             if (this.getInstance("device").isMobile) {
  2872.                 f = "none"
  2873.             }
  2874.             if (b[f]) {
  2875.                 this.adx = f
  2876.             }
  2877.             var g = c.backData.getData();
  2878.             this.adxExperiment = g.adx_name || e || "none"
  2879.         },
  2880.         _updateLayout: function() {
  2881.             var e = this.ads.length;
  2882.             $.extend(this, b.none);
  2883.             if (this.adx !== "none") {
  2884.                 $.extend(this, b[this.adx])
  2885.             }
  2886.             if (e < 2) {
  2887.                 this.rightRailSecond = false
  2888.             }
  2889.             if (this.rightRailSecond) {
  2890.                 this.smallSecond = true
  2891.             } else {
  2892.                 if (this.rightRailBoth) {
  2893.                     this.smallFirst = true;
  2894.                     this.smallSecond = true
  2895.                 }
  2896.             }
  2897.             if (!this.canShowRightRailAds()) {
  2898.                 this.rightRailBoth = false;
  2899.                 this.rightRailSecond = false
  2900.             }
  2901.         },
  2902.         setFirstBatchShown: function() {
  2903.             if (this._firstBatchShown) {
  2904.                 return
  2905.             }
  2906.             this._firstBatchShown = true;
  2907.             var e = 2;
  2908.             if (this.rightRailSecond) {
  2909.                 e = 1
  2910.             } else {
  2911.                 if (this.rightRailBoth) {
  2912.                     e = 0
  2913.                 }
  2914.             }
  2915.             if (DDG.pageLayout.isSlottingExperiment()) {
  2916.                 e = 10
  2917.             }
  2918.             this.numTopAds = Math.min(this.getAds().length, e);
  2919.             this.smallFirst = false;
  2920.             this.smallSecond = false;
  2921.             this.rightRailSecond = false;
  2922.             this.rightRailBoth = false
  2923.         },
  2924.         canShowRightRailAds: function() {
  2925.             var f = this.getInstance("device"),
  2926.                 e = this.getInstance("settings");
  2927.             return !f.isMobileDevice && e.isDefault("kw") && e.isDefault("km")
  2928.         },
  2929.         hasRightRailAds: function() {
  2930.             if (!this.canShowRightRailAds()) {
  2931.                 return false
  2932.             }
  2933.             var e = this.getAds().length;
  2934.             if (e && (e > 2 || this.rightRailBoth || this.rightRailSecond || this.rightRailFirst)) {
  2935.                 return true
  2936.             }
  2937.             return false
  2938.         },
  2939.         canShowAdExtensions: function(f, e) {
  2940.             return !this.getInstance("device").isMobile && f === 0 && this.adx !== "rel2" && e === 1
  2941.         }
  2942.     })
  2943. }(DDG);
  2944. ! function(b) {
  2945.     var a = b.Models.Base;
  2946.     b.Models.AdSitelinks = function(c) {
  2947.         a.call(this, c);
  2948.         this.hasSitelinkDescriptions = c.sitelinksMarkup && c.sitelinksMarkup.indexOf("sponsored__sitelink-description") > -1;
  2949.         if (c.isShowingLargeSitelinks) {
  2950.             this.hasSitelinkDescriptions = false;
  2951.             this.showEnhancedSiteLinks = false
  2952.         }
  2953.         if (/ebay\.co\.uk|amazon\.co\.uk/i.test(this.domain)) {
  2954.             this.hasSitelinkDescriptions = false;
  2955.             this.showEnhancedSiteLinks = false
  2956.         }
  2957.     };
  2958.     b.Models.AdSitelinks.prototype = $.extend({}, a.prototype, {
  2959.         canShowLargeSitelinks: function() {
  2960.             if (this.isShowingLargeSitelinks || !this.hasSitelinkDescriptions || !this.isFirstPageOfAds) {
  2961.                 return false
  2962.             }
  2963.             return this.canShowGoodAdsLayout || this.layoutName === "def"
  2964.         },
  2965.         getSitelinkHtml: function() {
  2966.             return this._getSitelinkHtml(this.sitelinksMarkup, this.showEnhancedSiteLinks, this.canShowGoodAdsLayout)
  2967.         },
  2968.         _getSitelinkHtml: function(g, j, e) {
  2969.             if (!g) {
  2970.                 return ""
  2971.             }
  2972.             var c = this._splitSitelinks(g, j || this.canShowLargeSitelinks());
  2973.             var h = (j && g.indexOf("sponsored__sitelink-description") > -1);
  2974.             var i;
  2975.             var f = "result__sitelinks";
  2976.             if (this.canShowLargeSitelinks()) {
  2977.                 c = c.slice(0, 4);
  2978.                 f += " result__sitelinks--large";
  2979.                 i = this._getLargeAdSitelinks(c)
  2980.             } else {
  2981.                 if (e && h) {
  2982.                     c = c.slice(0, 3);
  2983.                     i = this._getGoodAdSitelinks(c)
  2984.                 } else {
  2985.                     if (e && !h) {
  2986.                         f += " result__sitelinks--nodesc";
  2987.                         c = c.slice(0, 6);
  2988.                         i = c.join('<span class="js-sitelink-comma sponsored__sitelink__comma">,</span>')
  2989.                     } else {
  2990.                         c = c.slice(0, 3);
  2991.                         i = c.join('<span class="js-sitelink-comma sponsored__sitelink__comma">,</span>')
  2992.                     }
  2993.                 }
  2994.             }
  2995.             this.tid = this._matchTids(this.tid, c.length);
  2996.             if (this.canShowLargeSitelinks()) {
  2997.                 return '<div class="result__snippet"><span class="' + f + '">' + i + "</span></div>"
  2998.             }
  2999.             return '<span class="' + f + '">' + i + "</span>"
  3000.         },
  3001.         _splitSitelinks: function(i, c) {
  3002.             var e = [],
  3003.                 j = "</a>",
  3004.                 f = "</div>",
  3005.                 g, h;
  3006.             while (i.length) {
  3007.                 if (i.indexOf("<a") !== 0) {
  3008.                     break
  3009.                 }
  3010.                 h = i.indexOf(j);
  3011.                 if (h === -1) {
  3012.                     break
  3013.                 }
  3014.                 h += j.length;
  3015.                 g = i.slice(0, h);
  3016.                 i = i.slice(h);
  3017.                 if (i.indexOf("<div") === 0) {
  3018.                     h = i.indexOf(f);
  3019.                     if (h === -1) {
  3020.                         break
  3021.                     }
  3022.                     h += f.length;
  3023.                     if (c) {
  3024.                         g += i.slice(0, h)
  3025.                     }
  3026.                     i = i.slice(h)
  3027.                 }
  3028.                 e.push(g)
  3029.             }
  3030.             return e
  3031.         },
  3032.         _getLargeAdSitelinks: function(e) {
  3033.             var c = '<div class="sponsored__sitelink-row">';
  3034.             e.forEach(function(g, f) {
  3035.                 if (f % 2 === 0 && f > 0) {
  3036.                     c += '</div><div class="sponsored__sitelink-row">'
  3037.                 }
  3038.                 c += '<div class="sponsored__sitelink-col">' + g + "</div>"
  3039.             });
  3040.             return c + "</div>"
  3041.         },
  3042.         _getGoodAdSitelinks: function(e) {
  3043.             var c = "";
  3044.             e.forEach(function(f) {
  3045.                 f = f.replace(/(<div[^>]+>)/, "$1 - ");
  3046.                 c += '<div class="sponsored__sitelink-wrap">' + f + "</div>"
  3047.             });
  3048.             return c
  3049.         },
  3050.         _matchTids: function(h, e) {
  3051.             if (!e || !h) {
  3052.                 return h
  3053.             }
  3054.             var c = h.split("\t"),
  3055.                 g = {
  3056.                     ad: c.splice(0, 1),
  3057.                     sitelinks: c
  3058.                 };
  3059.             g.sitelinks = g.sitelinks.slice(0, e);
  3060.             var f = g.ad.concat(g.sitelinks).join("\t");
  3061.             return f
  3062.         }
  3063.     })
  3064. }(DDG);
  3065. ! function(e) {
  3066.     var i = e.Data.Settings.regions,
  3067.         h = "kl",
  3068.         f = "kah",
  3069.         c = "wt-wt",
  3070.         j = 3,
  3071.         a = e.Models.Base,
  3072.         n;
  3073.     n = e.Models.Settings.Region = function(o) {
  3074.         this.settings = o.settings;
  3075.         this.prevRegions = [];
  3076.         o.id = o.id || this.settings.get(h);
  3077.         o.prevId = o.prevId || this.settings.get(f);
  3078.         a.call(this, o);
  3079.         this.settings.on("change:" + h, this.setId.bind(this));
  3080.         this.settings.on("change:" + f, this.setPrevId.bind(this))
  3081.     };
  3082.     n.prototype = $.extend({}, a.prototype, {
  3083.         getId: function() {
  3084.             return (window.rlo && window.rl) || this.id || this.getDefaultId()
  3085.         },
  3086.         getPrevId: function() {
  3087.             return (this.id === this.prevId || this.prevId === this.getDefaultId()) ? null : this.prevId
  3088.         },
  3089.         getPrevRegions: function() {
  3090.             return this.prevRegions
  3091.         },
  3092.         getDefaultId: function() {
  3093.             return c
  3094.         },
  3095.         hasRegion: function() {
  3096.             return this.getId() && this.getId() !== this.getDefaultId()
  3097.         },
  3098.         hasPrevRegion: function() {
  3099.             return this.getPrevId() && this.getPrevId() !== this.getDefaultId()
  3100.         },
  3101.         hasRegionOrSuggested: function() {
  3102.             return this.hasRegion() || this.hasPrevRegion() || this.suggestedRegion
  3103.         },
  3104.         hasUSRegion: function() {
  3105.             return this.getId() && this.getId() !== this.getDefaultId() && this.getId().split("-")[0] === "us"
  3106.         },
  3107.         isValidRegion: function(o) {
  3108.             return !!i[o]
  3109.         },
  3110.         setId: function(s, q, p) {
  3111.             if (s === this.id || !this.isValidRegion(s)) {
  3112.                 return p && p()
  3113.             }
  3114.             var o = this,
  3115.                 r;
  3116.             this.id = s;
  3117.             if (s !== c) {
  3118.                 r = this.prevRegions.indexOf(s);
  3119.                 if (r !== -1) {
  3120.                     this.prevRegions.splice(r, 1)
  3121.                 }
  3122.                 this.prevRegions.unshift(s);
  3123.                 this._trimPrevRegions()
  3124.             }
  3125.             if (q && q.saveToSettings) {
  3126.                 if (!q.dontSavePrev) {
  3127.                     this.settings.set(f, this.prevRegions.join(","))
  3128.                 }
  3129.                 this.settings.set(h, s, {
  3130.                     saveToCloud: true,
  3131.                     updateURLParams: true,
  3132.                     fallbackToURLParam: q.fallbackToURLParam
  3133.                 }, function() {
  3134.                     o.emit("change:id", o.id);
  3135.                     p && p()
  3136.                 })
  3137.             } else {
  3138.                 this.emit("change:id", this.id);
  3139.                 p && p()
  3140.             }
  3141.         },
  3142.         setPrevId: function(o) {
  3143.             if (o) {
  3144.                 this.prevRegions = o.split(",")
  3145.             } else {
  3146.                 this.prevRegions = []
  3147.             }
  3148.             this._trimPrevRegions();
  3149.             this.prevId = this.prevRegions[0]
  3150.         },
  3151.         setDefault: function() {
  3152.             this.setId(this.getDefaultId(), {
  3153.                 saveToSettings: true
  3154.             })
  3155.         },
  3156.         reset: function(o) {
  3157.             this.prevId = null;
  3158.             this.settings.clear(f);
  3159.             this.setId(this.getDefaultId(), {
  3160.                 saveToSettings: true,
  3161.                 dontSavePrev: true
  3162.             }, o)
  3163.         },
  3164.         disableSuggested: function(o) {
  3165.             this.setPrevId(this.getDefaultId());
  3166.             this.set({
  3167.                 suggestedRegion: null
  3168.             });
  3169.             this.settings.set(f, this.prevId, {
  3170.                 saveToCloud: true
  3171.             }, o)
  3172.         },
  3173.         disabledSuggested: function() {
  3174.             return this.prevId && this.prevId === this.getDefaultId()
  3175.         },
  3176.         getName: function(o) {
  3177.             o = o || this.getId();
  3178.             return l(i[o] || i[this.getDefaultId()])
  3179.         },
  3180.         getSmallIconURL: function(o) {
  3181.             return k(o || this.getId())
  3182.         },
  3183.         getXSmallIconURL: function(o) {
  3184.             return b(o || this.getId())
  3185.         },
  3186.         getLargeIconURL: function(o) {
  3187.             return g(o || this.getId())
  3188.         },
  3189.         getAll: function() {
  3190.             var u = [],
  3191.                 s, p = this.getId(),
  3192.                 o = function(y, v, x) {
  3193.                     return {
  3194.                         id: y,
  3195.                         name: l(v),
  3196.                         countryCode: m(y),
  3197.                         selected: x
  3198.                     }
  3199.                 };
  3200.             var r = this.getPrevRegions();
  3201.             if (this.suggestedRegion && r.indexOf(this.suggestedRegion) === -1) {
  3202.                 r.push(this.suggestedRegion)
  3203.             }
  3204.             for (var t in i) {
  3205.                 if (t !== c && r.indexOf(t) === -1) {
  3206.                     u.push(o(t, i[t], p === t))
  3207.                 }
  3208.             }
  3209.             u.unshift(o(c, i[c], p === c));
  3210.             if (r.length && !(r.length === 1 && r[0] === c)) {
  3211.                 u[0].showDivider = true
  3212.             }
  3213.             for (var q = r.length - 1; q >= 0; q--) {
  3214.                 s = o(r[q], i[r[q]], p === r[q]);
  3215.                 if (r[q] !== c && s.name) {
  3216.                     u.unshift(s)
  3217.                 }
  3218.             }
  3219.             return u
  3220.         },
  3221.         fetchSuggested: function(o) {
  3222.             e.device.getCountry(this._onFetchedSuggested.bind(this, o))
  3223.         },
  3224.         _onFetchedSuggested: function(y, r, q) {
  3225.             if (!q) {
  3226.                 return y && y()
  3227.             }
  3228.             var u = q.toLowerCase(),
  3229.                 t = [],
  3230.                 x = function(A) {
  3231.                     this.set({
  3232.                         suggestedRegion: A
  3233.                     });
  3234.                     y && y(null, A)
  3235.                 }.bind(this);
  3236.             if (u === "us") {
  3237.                 return y && y()
  3238.             }
  3239.             if (u === "gb") {
  3240.                 u = "uk"
  3241.             }
  3242.             for (var z in i) {
  3243.                 var o = z.split("-")[0];
  3244.                 if (o === u) {
  3245.                     t.push(z)
  3246.                 }
  3247.             }
  3248.             if (!t.length) {
  3249.                 return y && y()
  3250.             }
  3251.             if (t.length === 1 || !window.locale) {
  3252.                 return x(t[0])
  3253.             }
  3254.             var p = window.locale.split("_")[0];
  3255.             for (var s = 0; s < t.length; s++) {
  3256.                 var v = t[s].split("-")[1];
  3257.                 if (p === v) {
  3258.                     return x(t[s])
  3259.                 }
  3260.             }
  3261.             return x(t[0])
  3262.         },
  3263.         _trimPrevRegions: function() {
  3264.             var o = j;
  3265.             if (this.suggestedRegion) {
  3266.                 o -= 1
  3267.             }
  3268.             if (this.prevRegions.length > o) {
  3269.                 this.prevRegions = this.prevRegions.slice(0, o)
  3270.             }
  3271.         }
  3272.     });
  3273.     var m = function(o) {
  3274.             return o.split("-")[0]
  3275.         },
  3276.         k = function(o) {
  3277.             return "/assets/flags/" + (DDG.is3x ? "60" : DDG.is2x ? "40" : "20") + "/" + m(o) + ".png?v=4"
  3278.         },
  3279.         b = function(o) {
  3280.             return "/assets/flags/" + (DDG.is3x ? "48" : DDG.is2x ? "32" : "16") + "/" + m(o) + ".png?v=3"
  3281.         },
  3282.         g = function(o) {
  3283.             return "/assets/flags/" + (DDG.is3x ? "96" : DDG.is2x ? "64" : "32") + "/" + m(o) + ".png?v=4"
  3284.         }
  3285. }(DDG);
  3286. ! function(b) {
  3287.     var a = "kae",
  3288.         c = b.Data.Settings[a];
  3289.     b.Models.Settings.Themes = {
  3290.         KEY: a,
  3291.         getSystemTheme: function() {
  3292.             if (!b.device.getColorScheme) {
  3293.                 return
  3294.             }
  3295.             var e = b.device.getColorScheme();
  3296.             if (e) {
  3297.                 return this._getThemeForColorScheme(e)
  3298.             }
  3299.         },
  3300.         getAll: function() {
  3301.             return DDG.objectToArray(c.values)
  3302.         },
  3303.         getSettingsForTheme: function(i) {
  3304.             var h = c.values[i],
  3305.                 e = c.values[c["default"]].settings;
  3306.             if (h) {
  3307.                 return $.extend({}, e, h.settings)
  3308.             }
  3309.             var f = tinycolor(i);
  3310.             if (f.isValid()) {
  3311.                 var g = f.toHexString();
  3312.                 return $.extend({}, e, {
  3313.                     kj: g,
  3314.                     k7: g
  3315.                 })
  3316.             }
  3317.             return $.extend({}, e)
  3318.         },
  3319.         enableColorSchemeDetection: function(e) {
  3320.             if (!this.colorSchemeMatching) {
  3321.                 this.matcher = e;
  3322.                 this.prefersDarkMode = window.matchMedia("(prefers-color-scheme: dark)");
  3323.                 this.prefersLightMode = window.matchMedia("(prefers-color-scheme: light)");
  3324.                 this.prefersDarkMode.addListener(e);
  3325.                 this.prefersLightMode.addListener(e);
  3326.                 this.colorSchemeMatching = true
  3327.             }
  3328.         },
  3329.         disableColorSchemeDetection: function() {
  3330.             if (this.colorSchemeMatching) {
  3331.                 this.prefersDarkMode.removeListener(this.matcher);
  3332.                 this.prefersLightMode.removeListener(this.matcher);
  3333.                 this.colorSchemeMatching = false
  3334.             }
  3335.         },
  3336.         _getThemeForColorScheme: function(f) {
  3337.             if (!f) {
  3338.                 return
  3339.             }
  3340.             var e = this.getAll(),
  3341.                 g = e.find(function(h) {
  3342.                     return h.colorScheme && h.colorScheme === f
  3343.                 });
  3344.             if (g) {
  3345.                 return g
  3346.             }
  3347.         }
  3348.     }
  3349. }(DDG);
  3350. ! function(h) {
  3351.     var b = "/settings.js",
  3352.         g = "application/json",
  3353.         j = "Error ",
  3354.         f = " CloudSave Settings",
  3355.         e = j + "Loading" + f,
  3356.         c = j + "Saving" + f,
  3357.         i = j + "Deleting" + f,
  3358.         a = {
  3359.             url: b,
  3360.             type: "POST",
  3361.             dataType: "json",
  3362.             contentType: g,
  3363.             processData: false
  3364.         };
  3365.     h.Models.Settings.CloudSave = {
  3366.         keyField: "objectKey",
  3367.         isKeyField: function(k) {
  3368.             return k === this.keyField || k === "key"
  3369.         },
  3370.         load: function(k, m) {
  3371.             if (!k) {
  3372.                 return m(e)
  3373.             }
  3374.             $.ajax({
  3375.                 url: b + "?key=" + k,
  3376.                 dataType: "json",
  3377.                 success: function(n) {
  3378.                     m(null, n)
  3379.                 },
  3380.                 error: function() {
  3381.                     m(e)
  3382.                 }
  3383.             })
  3384.         },
  3385.         save: function(k, n, m) {
  3386.             if (!k || !n) {
  3387.                 return m && m(c)
  3388.             }
  3389.             $.ajax($.extend({
  3390.                 data: JSON.stringify({
  3391.                     command: "write",
  3392.                     objectKey: k,
  3393.                     obj: n
  3394.                 }),
  3395.                 success: function() {
  3396.                     m && m(null, n)
  3397.                 },
  3398.                 error: function() {
  3399.                     m && m(c)
  3400.                 }
  3401.             }, a))
  3402.         },
  3403.         destroy: function(k, m) {
  3404.             if (!k) {
  3405.                 return m(i)
  3406.             }
  3407.             $.ajax($.extend({
  3408.                 type: "POST",
  3409.                 data: JSON.stringify({
  3410.                     command: "delete",
  3411.                     objectKey: k
  3412.                 }),
  3413.                 success: function() {
  3414.                     m && m(null, true)
  3415.                 },
  3416.                 error: function(n) {
  3417.                     m && m(i)
  3418.                 }
  3419.             }, a))
  3420.         },
  3421.         phraseToKey: function(k) {
  3422.             var m = new jsSHA(k, "ASCII"),
  3423.                 n = m.getHash("SHA-512", "HEX");
  3424.             return n
  3425.         },
  3426.         validatePassPhrase: function(k, n) {
  3427.             if (!k) {
  3428.                 return n(lp("cloudsave", "Please enter a pass phrase"))
  3429.             }
  3430.             if (k.length < 9) {
  3431.                 return n(lp("cloudsave", "Pass phrase must be at least 9 characters long"))
  3432.             }
  3433.             var m = this.phraseToKey(k);
  3434.             $.ajax({
  3435.                 url: b + "?key=" + m,
  3436.                 dataType: "json",
  3437.                 success: function() {
  3438.                     n(lp("cloudsave", "Pass phrase is already taken."))
  3439.                 },
  3440.                 error: function() {
  3441.                     n(null, true)
  3442.                 }
  3443.             })
  3444.         },
  3445.         suggestPassPhrase: function(m) {
  3446.             var n = 20,
  3447.                 k = 4;
  3448.             $.ajax($.extend({
  3449.                 type: "POST",
  3450.                 data: JSON.stringify({
  3451.                     command: "passphrase",
  3452.                     n: n
  3453.                 }),
  3454.                 success: function(o) {
  3455.                     var q = o.passphrase.split(" "),
  3456.                         r = "";
  3457.                     q.sort(function() {
  3458.                         return 0.5 - Math.random()
  3459.                     });
  3460.                     for (var p = 0; p < k; p++) {
  3461.                         r += q[p] + " "
  3462.                     }
  3463.                     m(null, r.trim())
  3464.                 },
  3465.                 error: function() {
  3466.                     m(true)
  3467.                 }
  3468.             }, a))
  3469.         }
  3470.     }
  3471. }(DDG);
  3472. ! function(g) {
  3473.     var b = g.Models.Base,
  3474.         f = g.Models.Settings,
  3475.         e = "kp",
  3476.         a = {
  3477.             "1": {
  3478.                 name: lp("safe search", "Strict"),
  3479.                 description: lp("safe search", "No adult content")
  3480.             },
  3481.             "-1": {
  3482.                 name: lp("safe search", "Moderate"),
  3483.                 description: lp("safe search", "No explicit images or videos")
  3484.             },
  3485.             "-2": {
  3486.                 name: lp("setting", "Off"),
  3487.                 description: lp("safe search", "Don't filter adult content")
  3488.             }
  3489.         },
  3490.         c = "-1";
  3491.     f.SafeSearch = function(h) {
  3492.         b.call(this, h);
  3493.         this.settings.on("change:" + e, this._onSettingChange.bind(this))
  3494.     };
  3495.     f.SafeSearch.prototype = $.extend({}, b.prototype, {
  3496.         getId: function() {
  3497.             return this.id || c
  3498.         },
  3499.         getAll: function() {
  3500.             var h = [],
  3501.                 j;
  3502.             for (var i in a) {
  3503.                 j = {
  3504.                     id: i,
  3505.                     name: a[i].name,
  3506.                     description: a[i].description
  3507.                 };
  3508.                 j.selected = j.id === this.getId();
  3509.                 h.push(j)
  3510.             }
  3511.             return h
  3512.         },
  3513.         isActive: function() {
  3514.             return this.getId() !== c
  3515.         },
  3516.         getName: function() {
  3517.             return a[this.getId()].name
  3518.         },
  3519.         isStrict: function() {
  3520.             return this.getId() === "1"
  3521.         },
  3522.         isModerate: function() {
  3523.             return this.getId() === "-1"
  3524.         },
  3525.         isOff: function() {
  3526.             return this.getId() === "-2"
  3527.         },
  3528.         setId: function(j, i) {
  3529.             var h = {
  3530.                 saveToCloud: true,
  3531.                 updateURLParams: true,
  3532.                 fallbackToURLParam: true
  3533.             };
  3534.             this.settings.set(e, j, h, i)
  3535.         },
  3536.         setTemporaryId: function(i, h) {
  3537.             g.hidden.set(e, i);
  3538.             h && h()
  3539.         },
  3540.         _onSettingChange: function() {
  3541.             var h = this.settings.get(e);
  3542.             this.set("id", h)
  3543.         }
  3544.     })
  3545. }(DDG);
  3546. ! function(p, i) {
  3547.     var u = "January 12, 2025",
  3548.         q = "abcdefghijklmnopqrstuvwxyz",
  3549.         j = i.location.protocol + "//" + i.location.host + "/",
  3550.         v = /<|>|\//g,
  3551.         s = p.Data.Settings,
  3552.         n = "kay",
  3553.         g = "mapkit.SpileTestResults",
  3554.         e = p.Models.Settings.CloudSave,
  3555.         k = p.Models.Settings.Themes,
  3556.         f = p.Models.Base,
  3557.         r;
  3558.     r = p.Models.Settings.Settings = function(x) {
  3559.         x = x || {};
  3560.         if (x.cloudSaveKey) {
  3561.             this.setCloudSaveKey(x.cloudSaveKey)
  3562.         }
  3563.         this._settings = {};
  3564.         this._savedSettings = {};
  3565.         this._urlSettings = {};
  3566.         this.region = new p.Models.Settings.Region({
  3567.             settings: this
  3568.         });
  3569.         this.safeSearch = new p.Models.Settings.SafeSearch({
  3570.             settings: this
  3571.         });
  3572.         this.cloudsave = e;
  3573.         this.themes = k;
  3574.         this._updateDeviceDependentSettings();
  3575.         this._setFromURLParams();
  3576.         this._setFromQuerystring();
  3577.         this._backfillGlobals();
  3578.         this._setFromCookie();
  3579.         this._restoreCloudSaveKey();
  3580.         this._useColorScheme()
  3581.     };
  3582.     r.prototype = $.extend({}, f.prototype, {
  3583.         THEME_KEY: k.KEY,
  3584.         AUTOCOMPLETE_KEY: "kac",
  3585.         LANGUAGE_KEY: "kad",
  3586.         POST_KEY: "kg",
  3587.         MOBILE_INSTRUCTIONS_KEY: "kas",
  3588.         DEFAULT_FIELD_CLASS: "FormField",
  3589.         TYPE_TO_FIELD_CLASS: {
  3590.             "boolean": "BooleanFormField",
  3591.             color: "ColorFormField",
  3592.             composite: "CompositeFormField",
  3593.             thumbnail: "ThumbnailFormField",
  3594.             theme: "ThemeFormField",
  3595.             dropdowncustom: "DropDownCustomFormField",
  3596.             clear: "ClearFormField"
  3597.         },
  3598.         get: function(x) {
  3599.             if (x === "kl") {
  3600.                 return this._getRegionSetting()
  3601.             }
  3602.             var y = this._settings[x] || this.getDefault(x);
  3603.             y = o(x, y);
  3604.             return y
  3605.         },
  3606.         _getRegionSetting: function() {
  3607.             if (this._settings.kl) {
  3608.                 return this._settings.kl
  3609.             }
  3610.             if (this._isInRegionToggleExp() && this._isRegionWithDefaultRegionToggle()) {
  3611.                 var z = navigator.language || "en-US";
  3612.                 var y = window.ct === "GB" ? "uk" : (window.ct || "US").toLowerCase();
  3613.                 if (y === "us") {
  3614.                     return "wt-wt"
  3615.                 }
  3616.                 var A = z.split("-")[0];
  3617.                 var x = y + "-" + A;
  3618.                 var B = p.Data.Settings.regions;
  3619.                 return Object.keys(B).indexOf(x) !== -1 ? x : "wt-wt"
  3620.             }
  3621.             return "wt-wt"
  3622.         },
  3623.         _isInRegionToggleExp: function() {
  3624.             var z = p.Data.Experiments.default_region_toggle;
  3625.             if (!z) {
  3626.                 return false
  3627.             }
  3628.             var A = p.history.get("atb");
  3629.             if (!A) {
  3630.                 return false
  3631.             }
  3632.             var x = z.versions || [];
  3633.             var y = A.slice(0, 6);
  3634.             return x.includes(y) && A[6] === "b"
  3635.         },
  3636.         _isRegionWithDefaultRegionToggle: function() {
  3637.             var x = ["AU", "AT", "DK", "FI", "FR", "DE", "IT", "IE", "NZ", "NO", "ES", "SE", "GB"];
  3638.             return x.indexOf(window.ct) !== -1
  3639.         },
  3640.         getDefault: function(x) {
  3641.             var y = s[x];
  3642.             return y && y["default"]
  3643.         },
  3644.         isDefault: function(x) {
  3645.             return this.get(x) === this.getDefault(x)
  3646.         },
  3647.         hasCustomLinkStyles: function() {
  3648.             return !(this.isDefault("kae") && this.isDefault("k9") && this.isDefault("kaa") && this.isDefault("k8") && this.isDefault("kx") && this.isDefault("kaf") && this.isDefault("kai") && this.isDefault("kf") && this.isDefault("k7") && this.isDefault("k18"))
  3649.         },
  3650.         getData: function(z) {
  3651.             var A = $.extend({}, s[z]);
  3652.             A.id = z;
  3653.             if (typeof A.values === "string") {
  3654.                 A.values = $.extend({}, s[A.values])
  3655.             }
  3656.             if (A.values && A.order) {
  3657.                 var B, x = {};
  3658.                 for (var y = 0; y < A.order.length; y++) {
  3659.                     B = A.order[y];
  3660.                     if (A.values[B]) {
  3661.                         x[B] = A.values[B]
  3662.                     }
  3663.                 }
  3664.                 for (B in A.values) {
  3665.                     if (!x[B]) {
  3666.                         x[B] = A.values[B]
  3667.                     }
  3668.                 }
  3669.                 A.values = x
  3670.             }
  3671.             return A
  3672.         },
  3673.         getFieldClass: function(x) {
  3674.             return this.TYPE_TO_FIELD_CLASS[x] || this.DEFAULT_FIELD_CLASS
  3675.         },
  3676.         set: function(x, A, z, y) {
  3677.             z = z || {};
  3678.             A = o(x, A);
  3679.             if (typeof A === "undefined" || A === "" || A === null || (x !== this.THEME_KEY && this.isDefault(this.THEME_KEY) && A === this.getDefault(x))) {
  3680.                 this.clear(x, z, y);
  3681.                 if (x === this.THEME_KEY && z.forceTheme) {
  3682.                     this._applyTheme(this.getDefault(x), z)
  3683.                 }
  3684.                 return y && y()
  3685.             }
  3686.             this._settings[x] = A;
  3687.             i[x] = A;
  3688.             if (z.saveToCookie || typeof z.saveToCookie === "undefined") {
  3689.                 if (typeof A === "string") {
  3690.                     A = A.replace("#", "")
  3691.                 }
  3692.                 this._savedSettings[x] = A;
  3693.                 t(h(x), A, z);
  3694.                 if (z.fallbackToURLParam && !document.cookie) {
  3695.                     this._urlSettings[x] = A
  3696.                 }
  3697.             }
  3698.             if (z.updateURLParams && this._urlSettings[x]) {
  3699.                 this._urlSettings[x] = A
  3700.             }
  3701.             if (!z.silent) {
  3702.                 this.emit("change:" + x, A)
  3703.             }
  3704.             this.emit("change", x);
  3705.             if (x === this.THEME_KEY) {
  3706.                 this._applyTheme(A, z)
  3707.             }
  3708.             if (z.saveToCloud && this._cloudSaveKey) {
  3709.                 this.saveToCloud(y)
  3710.             } else {
  3711.                 y && y()
  3712.             }
  3713.         },
  3714.         setTheme: function(z, y, x) {
  3715.             y = y || {};
  3716.             y.forceTheme = true;
  3717.             this.set(this.THEME_KEY, z, y, x)
  3718.         },
  3719.         setBulk: function(z, y) {
  3720.             if (z[this.THEME_KEY]) {
  3721.                 this.set(this.THEME_KEY, z[this.THEME_KEY], y)
  3722.             }
  3723.             for (var x in z) {
  3724.                 if (x !== this.THEME_KEY) {
  3725.                     this.set(x, z[x], y)
  3726.                 }
  3727.             }
  3728.         },
  3729.         setTParam: function(x) {
  3730.             this._urlSettings.t = x;
  3731.             this.set("t", x, {
  3732.                 saveToCookie: false
  3733.             })
  3734.         },
  3735.         clear: function(x, z, y) {
  3736.             z = z || {};
  3737.             i[x] = "";
  3738.             delete this._settings[x];
  3739.             delete this._savedSettings[x];
  3740.             if (z.saveToCookie || typeof z.saveToCookie === "undefined") {
  3741.                 t(h(x), "", {
  3742.                     expires: new Date(),
  3743.                     clear: true
  3744.                 })
  3745.             }
  3746.             if (z.updateURLParams) {
  3747.                 delete this._urlSettings[x]
  3748.             }
  3749.             if (z.saveToCloud) {
  3750.                 this.saveToCloud(y)
  3751.             }
  3752.             try {
  3753.                 if (x === n) {
  3754.                     i.localStorage && i.localStorage.removeItem(g)
  3755.                 } else {
  3756.                     if (x === e.keyField) {
  3757.                         i.localStorage && i.localStorage.removeItem(e.keyField)
  3758.                     }
  3759.                 }
  3760.             } catch (A) {}
  3761.             if (!z.silent) {
  3762.                 this.emit("change:" + x)
  3763.             }
  3764.             this.emit("change", x)
  3765.         },
  3766.         clearAll: function() {
  3767.             for (var x in this._settings) {
  3768.                 this.clear(x)
  3769.             }
  3770.         },
  3771.         toQueryString: function(x) {
  3772.             return $.param(this.toJSON(x))
  3773.         },
  3774.         toJSON: function(x) {
  3775.             x = x || {};
  3776.             if (x.onlyURLParams) {
  3777.                 return $.extend({}, this._urlSettings)
  3778.             }
  3779.             return $.extend({}, x.all ? this._settings : this._savedSettings)
  3780.         },
  3781.         toBookmarkletURL: function(y) {
  3782.             var x = this.toQueryString(y);
  3783.             return x ? j + "?" + x : j
  3784.         },
  3785.         toCloudSaveBookmarkletURL: function() {
  3786.             var x = this.getCloudSaveKey();
  3787.             return x ? j + "?key=" + x : j
  3788.         },
  3789.         getCloudSaveKey: function() {
  3790.             return this._cloudSaveKey
  3791.         },
  3792.         setCloudSaveKey: function(x) {
  3793.             b(e.keyField, x);
  3794.             this._cloudSaveKey = x;
  3795.             this.emit("change:cloudsave");
  3796.             return x
  3797.         },
  3798.         setCloudSavePassPhrase: function(x) {
  3799.             return this.setCloudSaveKey(e.phraseToKey(x))
  3800.         },
  3801.         loadFromCloud: function(x) {
  3802.             x = x || {};
  3803.             e.load(this._cloudSaveKey, function(A, z) {
  3804.                 if (z) {
  3805.                     if (x && x.clearAll) {
  3806.                         this.clearAll()
  3807.                     }
  3808.                     this._cloudSettings = z;
  3809.                     for (var y in z) {
  3810.                         if (this._urlSettings[y]) {
  3811.                             delete z[y]
  3812.                         }
  3813.                     }
  3814.                     this.setBulk(z);
  3815.                     b(e.keyField, this._cloudSaveKey)
  3816.                 } else {
  3817.                     this.clearCloudSave()
  3818.                 }
  3819.                 this.emit(x.initial ? "loaded-initial" : "loaded", A, z)
  3820.             }.bind(this))
  3821.         },
  3822.         saveToCloud: function(x) {
  3823.             e.save(this._cloudSaveKey, this._savedSettings, x)
  3824.         },
  3825.         clearCloudSave: function(y, x) {
  3826.             if (y && y.deleteFromServer) {
  3827.                 e.destroy(this._cloudSaveKey, x)
  3828.             }
  3829.             this.clear(e.keyField);
  3830.             this._cloudSaveKey = null;
  3831.             this.emit("change:cloudsave")
  3832.         },
  3833.         getFontName: function(y) {
  3834.             var x = s.fonts[y];
  3835.             if ((x && x === "Proxima Nova") || (y && !y.match(/^([a-zA-Z0-9\-\s]+)$/))) {
  3836.                 x = "DDG_ProximaNova, DDG_ProximaNova_UI_1, DDG_ProximaNova_UI_2, DDG_ProximaNova_UI_3, DDG_ProximaNova_UI_4, DDG_ProximaNova_UI_5, DDG_ProximaNova_UI_6"
  3837.             }
  3838.             return x
  3839.         },
  3840.         useRedirect: function() {
  3841.             return this.isDefault("kd") && !p.device.hasMetaReferrerSupport
  3842.         },
  3843.         autoloadDisabled: function() {
  3844.             return this.isDefault("kav")
  3845.         },
  3846.         getDropdownSettings: function() {
  3847.             var z = {};
  3848.             for (var x in s) {
  3849.                 if (s[x].dropdownSettings && s[x].dropdownSettings.category) {
  3850.                     var y = s[x].dropdownSettings.category;
  3851.                     if (!z[y]) {
  3852.                         z[y] = []
  3853.                     }
  3854.                     z[y][x] = s[x]
  3855.                 }
  3856.             }
  3857.             return z
  3858.         },
  3859.         getThemePalette: function(y, z) {
  3860.             var x = this.get("kae"),
  3861.                 A = k.getSettingsForTheme(x);
  3862.             if (A.palette && A[y] === z) {
  3863.                 return A.palette
  3864.             }
  3865.         },
  3866.         _updateDeviceDependentSettings: function() {
  3867.             var y, z, x;
  3868.             for (y in s) {
  3869.                 if (s[y].deviceDependent) {
  3870.                     x = s[y].values;
  3871.                     if (typeof x === "string") {
  3872.                         x = s[x]
  3873.                     }
  3874.                     for (z in x) {
  3875.                         if (!this._isValueValidForDevice(x[z])) {
  3876.                             delete x[z]
  3877.                         } else {
  3878.                             if (!s[y]["default"]) {
  3879.                                 s[y]["default"] = z
  3880.                             }
  3881.                         }
  3882.                     }
  3883.                 }
  3884.             }
  3885.         },
  3886.         _isValueValidForDevice: function(A) {
  3887.             var z = true,
  3888.                 y, x;
  3889.             if (A.onDevices) {
  3890.                 z = false;
  3891.                 for (y = 0; y < A.onDevices.length; y++) {
  3892.                     x = A.onDevices[y];
  3893.                     if (p.device[x]) {
  3894.                         z = true;
  3895.                         break
  3896.                     }
  3897.                 }
  3898.             }
  3899.             if (z && A.notOnDevices) {
  3900.                 for (y = 0; y < A.notOnDevices.length; y++) {
  3901.                     x = A.notOnDevices[y];
  3902.                     if (p.device[x]) {
  3903.                         z = false;
  3904.                         break
  3905.                     }
  3906.                 }
  3907.             }
  3908.             return z
  3909.         },
  3910.         isDarkTheme: function() {
  3911.             return p.settings.get("kae") === "d" || p.settings.get("kae") === "t"
  3912.         },
  3913.         _applyTheme: function(A, y) {
  3914.             y = y || {};
  3915.             var z = k.getSettingsForTheme(A);
  3916.             this.applyingTheme = true;
  3917.             for (var x in z) {
  3918.                 if (!y.forceTheme && this._settings[x]) {
  3919.                     continue
  3920.                 }
  3921.                 this.clear(x);
  3922.                 this.set(x, z[x] || this.getDefault(x), {
  3923.                     saveToCookie: false
  3924.                 })
  3925.             }
  3926.             this.applyingTheme = false;
  3927.             this.emit("change:themeApplied")
  3928.         },
  3929.         _setFromQuerystring: function() {
  3930.             for (var x in p.history.curState) {
  3931.                 var y = p.history.curState[x];
  3932.                 if (y.match(v)) {
  3933.                     continue
  3934.                 }
  3935.                 if (e.isKeyField(x) && !this.getCloudSaveKey()) {
  3936.                     this._urlSettings[x] = y;
  3937.                     this.setCloudSaveKey(y)
  3938.                 } else {
  3939.                     if (x.charAt(0) === "k" || x === "t" || x === "atb" || x === "va") {
  3940.                         this._urlSettings[x] = y
  3941.                     }
  3942.                 }
  3943.             }
  3944.             this.setBulk(this._urlSettings, {
  3945.                 saveToCookie: false
  3946.             })
  3947.         },
  3948.         _setFromURLParams: function() {
  3949.             if (!i.settings_url_params) {
  3950.                 return
  3951.             }
  3952.             for (var x in i.settings_url_params) {
  3953.                 var y = i.settings_url_params[x];
  3954.                 if (e.isKeyField(x) && !this.getCloudSaveKey()) {
  3955.                     this._urlSettings[x] = y;
  3956.                     this.setCloudSaveKey(y)
  3957.                 } else {
  3958.                     if (!this._urlSettings[x]) {
  3959.                         this._urlSettings[x] = y
  3960.                     }
  3961.                 }
  3962.             }
  3963.             this.setBulk(this._urlSettings, {
  3964.                 saveToCookie: false
  3965.             })
  3966.         },
  3967.         _setFromCookie: function() {
  3968.             if (!document.cookie) {
  3969.                 return
  3970.             }
  3971.             var A = {},
  3972.                 z = document.cookie.split("; ");
  3973.             for (var y = 0; y < z.length; y++) {
  3974.                 var B = z[y].split("=");
  3975.                 if (B && B.length == 2) {
  3976.                     var x = a(B[0]),
  3977.                         C = c(B[1]);
  3978.                     if (C.match(v)) {
  3979.                         continue
  3980.                     }
  3981.                     if (e.isKeyField(x)) {
  3982.                         this.clear(e.keyField);
  3983.                         p.pixel.fire("cls", {
  3984.                             c: 1
  3985.                         });
  3986.                         this.setCloudSaveKey(C)
  3987.                     } else {
  3988.                         if (C && !this._urlSettings[x]) {
  3989.                             A[x] = C
  3990.                         }
  3991.                     }
  3992.                 }
  3993.             }
  3994.             this.setBulk(A)
  3995.         },
  3996.         _isLoadableSetting: function(x, y) {
  3997.             if (!x || !y) {
  3998.                 return false
  3999.             }
  4000.             if (!s.hasOwnProperty(x) && !e.isKeyField(x)) {
  4001.                 return false
  4002.             }
  4003.             if (y.match(v)) {
  4004.                 return false
  4005.             }
  4006.             return !this._urlSettings[x]
  4007.         },
  4008.         _backfillGlobals: function() {
  4009.             var y = 0,
  4010.                 x, A;
  4011.             for (; y < 10; y++) {
  4012.                 x = a(y.toString());
  4013.                 if (!i[x]) {
  4014.                     i[x] = ""
  4015.                 }
  4016.             }
  4017.             for (y = 0; y < q.length; y++) {
  4018.                 var z = q.charAt(y);
  4019.                 x = a(z);
  4020.                 A = a("a" + z);
  4021.                 if (!i[x]) {
  4022.                     i[x] = ""
  4023.                 }
  4024.                 if (!i[A]) {
  4025.                     i[A] = ""
  4026.                 }
  4027.             }
  4028.         },
  4029.         _setDefaultTheme: function(y) {
  4030.             var x = y || k.getSystemTheme();
  4031.             if (x && x.id !== this.getDefault(this.THEME_KEY)) {
  4032.                 p.Data.Settings.kae["default"] = x.id
  4033.             }
  4034.         },
  4035.         _useColorScheme: function() {
  4036.             var y = k.getSystemTheme();
  4037.             if (!y) {
  4038.                 return
  4039.             }
  4040.             if (!this._settings[this.THEME_KEY] && !this._hasCustomizedTheme()) {
  4041.                 this.setTheme(y.id, {
  4042.                     saveToCookie: false
  4043.                 });
  4044.                 this._enableColorSchemeMatching()
  4045.             } else {
  4046.                 if (this._savedSettings[this.THEME_KEY] == y.id && !this._hasCustomizedTheme()) {
  4047.                     this.clear(this.THEME_KEY);
  4048.                     this._useColorScheme()
  4049.                 } else {
  4050.                     if (!this._settings[this.THEME_KEY] && this._hasCustomizedTheme()) {
  4051.                         var x = DDG.Data.Settings.kae.values["-1"];
  4052.                         y = x
  4053.                     }
  4054.                 }
  4055.             }
  4056.             this.on("change:themeApplied", this._themeSettingListener);
  4057.             this._setDefaultTheme(y)
  4058.         },
  4059.         _colorSchemeMatch: function(y) {
  4060.             if (y.matches) {
  4061.                 var x = k.getSystemTheme();
  4062.                 if (x) {
  4063.                     this._setDefaultTheme(x);
  4064.                     this.setTheme(x.id, {
  4065.                         saveToCookie: false
  4066.                     })
  4067.                 }
  4068.             }
  4069.         },
  4070.         _enableColorSchemeMatching: function() {
  4071.             this.themes.enableColorSchemeDetection(this._colorSchemeMatch.bind(this));
  4072.             this._toggleAppearanceSettingListeners(true)
  4073.         },
  4074.         _disableColorSchemeMatching: function() {
  4075.             this.themes.disableColorSchemeDetection();
  4076.             this._toggleAppearanceSettingListeners(false)
  4077.         },
  4078.         _themeSettingListener: function() {
  4079.             var x = k.getSystemTheme(),
  4080.                 y = this.get(this.THEME_KEY) === x.id;
  4081.             if (y && !this._hasCustomizedTheme()) {
  4082.                 this.clear("kae");
  4083.                 if (!this.themes.colorSchemeMatching) {
  4084.                     this._enableColorSchemeMatching()
  4085.                 }
  4086.             } else {
  4087.                 this._disableColorSchemeMatching()
  4088.             }
  4089.         },
  4090.         _appearanceSettingListener: function(z) {
  4091.             var x = z.substring(7);
  4092.             if (this.themes.colorSchemeMatching && !this.isDefault(x) && !this.applyingTheme) {
  4093.                 var y = this.get(this.THEME_KEY);
  4094.                 this.set(this.THEME_KEY, y);
  4095.                 this._disableColorSchemeMatching()
  4096.             }
  4097.         },
  4098.         _toggleAppearanceSettingListeners: function(y) {
  4099.             if (y === null) {
  4100.                 return