1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
define("ajax.shared",["require","exports"],function(n,t){function r(n){var r=keyMap[n]?keyMap[n]:keyMap.Prefix+n,i=document.getElementById(r),t;return!i&&document.getElementsByClassName&&(t=document.getElementsByClassName(r),i=t&&t.length?t[0]:null),i}function u(n){var f=sj_ce("a"),t,r,u;return f.href=n,t=f.pathname,t[0]!=="/"&&(t="/"+t),t=t.replace(i,"/"),r="",t==="/"?r=t:(u=n.indexOf(t),r=u>-1?n.substr(u):""),r}function f(n,t,i){for(;n&&n!==document;n=n.parentNode){if(n[t]===i)return n;if(n===undefined)break}}var i=/^(\/)(\1+)/;t.useSetBag=!1;t.ajaxUrlBag="";t.getPlaceholder=r;t.getRelativeUrl=u;t.getParentContainer=f});define("ajax.cache.mm",["require","exports"],function(n,t){function a(n,t){e[n]=t}function v(n,t,i,r){if(n>=0){var u=p(n);switch(t){case"Script":u.ScriptHolder.push(r);break;case"Style":u.Style+=r;break;case"EOS":u.Script=u.ScriptHolder;delete u.ScriptHolder;u[t]=r;h(i,u);break;default:u[t]=r}}}function y(n){if(sessionStorage){var t=sessionStorage.getItem(u+n);return t?JSON.parse(t):null}return null}function h(n,t){if(sessionStorage)try{var f=sessionStorage.getItem(s+n);f=f?parseInt(f)+1:1;sessionStorage.setItem(s+n,f);(i!="/search"||f>1)&&(sessionStorage.setItem(u+n,JSON.stringify(t)),r[i]&&e[i]&&(r[i].push(n),r[i].length>e[i]&&(sessionStorage.removeItem(r[i][0]),r[i].shift())))}catch(o){}t={}}function p(n){while(n>=f.length)f.push({Style:"",SearchForm:"",Content:"",ScriptHolder:[]});return f[n]}function c(){var e,r,f,s,n,t,a;if(sessionStorage){for(e in sessionStorage)e.indexOf(u)===0&&sessionStorage.removeItem(e);var v="",y=document.body.getElementsByTagName("style"),p=l.getCssHolder();for(n=0;n<y.length;n++)r=y[n],r.hasAttribute("data-rms")||(v+=r.outerHTML,p.appendChild(r));for(f=[],s=document.body.getElementsByTagName("script"),n=0;n<s.length;n++)t=s[n],t.hasAttribute("data-rms")||(t.text.length>0?f.push({Content:t.text}):t.src.length>0&&f.push({Content:t.src,Method:"reference"}));a=window.location.href.substr(window.location.href.indexOf(i));h(a,{Style:v,SearchForm:_G.SRF,Content:_G.CNT,Script:f,IG:_G.IG,Title:document.title,Url:a,EOS:1});o.unbind("onP1",c)}}var o=n("event.custom"),l=n("dom"),i=location.pathname,s="bingc#",u="bing#",f=[],e={},r={"/videos/search":[],"/images/search":[]};t.setQuota=a;t.cacheItem=v;t.fetch=y;o.bind("onP1",c,!0)});define("ajax.history.mm",["require","exports"],function(n,t){function f(n){history.pushState(i,i,n)}function e(n){history.replaceState(i,i,n)}function o(){var n=window.location.href,t=n.indexOf(u),i;t>=0?(i=n.substr(t),r.fire("ajax.state",i)):window.location.assign(n)}var r=n("event.custom"),u=location.pathname,i="";t.pushState=f;t.replaceState=e;window.addEventListener("popstate",o,!1)});define("ajax.framework.mm",["require","exports","ajax.cache.mm","ajax.history.mm"],function(n,t,i,r){function fr(n){for(var t=0;t<w.length;t++)if(w[t]===n)return;w.push(n)}function er(n){et=n}function or(n){ot=n}function sr(n){st=n}function hr(n){p=n}function ni(){var n="onpopstate"in _w,t;h||(h=k.get("_SS","SID"),yt="jsonv2");_w.keyMap&&_w.JSON&&document.getElementsByClassName&&h&&n&&(wt=k.get("SRCHHPGUSR","AS"),ht(),f.bind("ajax.state",dr),f.bind("ajax.state.update",gr),vt.bind(document,"keydown",function(n){n.keyCode===27&&d.preventDefault(n)}),cr(),f.fire("ajaxReady"));n&&h||(t=n?"":"History NA",t+=h?"":"SID NA",sj_log("CI.Ajax","H5Support",t),ct());f.unbind("onP1",ni)}function ht(){f.bind("ErrorInstrumentation",function(){ct()});var n=document.getElementById("sb_form");n&&(wt==="0"?vt.bind(n,"submit",ci):n.submit=ci);document.onclick=lr;window.sj_lc=function(n){nu(n,s.as)}}function ct(){k.set("_SS","h5comp","0",!1,"/")}function cr(){var n=document.createElement("style"),t;n.setAttribute("data-rms","1");t="#"+c+"{position:absolute;background-color:white;opacity:0.6;z-index:10}";t+="a,a *{-ms-touch-action:manipulation;touch-action:manipulation}";n.textContent!==nt?n.textContent=t:n.styleSheet.cssText+=t;document.body.appendChild(n)}function lr(n){var r,t;if(!n.defaultPrevented&&!n.ctrlKey&&!n.shiftKey&&n.button!==2&&n.button!=1&&(r=n.target,t=e.getParentContainer(r,"tagName","A"),t&&(t.target==="_self"||!t.target)&&t.getAttribute("data-noajax")!=="1")){var u=t.pathname,f=t.hostname?t.hostname:location.hostname,i=t.href;if(i=i.replace(bi,""),i&&(t.href=i),p&&p(t))return;f===location.hostname&&u.indexOf(g)===0&&(i=b(i.substr(i.indexOf(g))),i!==b(y)&&(it(i,s.click,r),n.preventDefault()))}}function ti(n,t,i){var r,u,f;i!==kt&&(kt=i);for(r in n)if(r==="Script")for(u=0;u<n[r].length;u++)f=n[r][u],ii(t,r,i,f);else ii(t,r,i,n[r])}function ii(n,t,r,u){for(var e=!1,f=0;f<w.length;f++)if(w[f](n,t,r,u,v)){e=!0;break}e||ri(n,t,r,u);i.cacheItem(n,t,r,u)}function ri(n,t,i,r){var f,u;if(i===y)switch(t){case"Script":r.Method==="reference"?a.includeScriptReference(r.Content):a.includeScript(r.Content);break;case"Style":tu();a.getCssHolder().innerHTML+="<div><\/div>"+r;break;case"IG":_G.IG=r;break;case"Title":bt.innerHTML=r;document.title=bt.value;break;case"EOS":e.ajaxPerf?ar(i):(fi(),ht(),hi(),si(i),ei());break;case"HBop":u=document.createElement("div");document.getElementById(keyMap.Content).appendChild(u);u.outerHTML=r;break;case"RmsDefer":case"EmbDivs":f=e.getPlaceholder(t);f||(f=document.createElement("div"),document.body.appendChild(f));f.outerHTML=r;break;case"Content":ui(t,r);tt!==null&&(sb_ct(tt),tt=null);break;case"LangSwitch":case"MarketSwitch":u=document.createElement("div");document.body.appendChild(u);u.outerHTML=r;break;default:ui(t,r)}}function ar(n){if(u){var t=u.onload,i=sb_st(function(){lt(n);u.onload=function(){}},1e3);u.onload=function(){sb_ct(i);lt(n);t&&t()}}else lt(n)}function lt(n){l.performance=u&&u.contentWindow&&u.contentWindow.performance;fi();ht();hi();si(n);ei()}function ui(n,t){var i=e.getPlaceholder(n);i&&(i.outerHTML=t)}function fi(){_G.PPS=!1;si_PP(new Date)}function vr(){f.fire("ajax.unload");pt&&li(!1);rt.clear();d.forEach(vi,function(n){window.hasOwnProperty(n)&&(window[n]=nt,delete window[n])});d.forEach(yi,function(n){for(var i,r=document.getElementsByClassName(n),t=0;t<r.length;t++)i=r[t],i.parentNode.removeChild(i)});uu();f.reset();ai.reset();try{window.scrollTo(0,0)}catch(n){}}function yr(){var n=e.getPlaceholder("AutoSug"),t=e.getPlaceholder("SearchForm"),i=e.getPlaceholder("header");n&&t&&i&&(n.style.display="none",t.className="",i.className="")}function pr(n){var i,u;if(yr(),i=st?st(n):document.getElementById(keyMap.Content),i){var t=i.getBoundingClientRect(),f=t.width===nt?Math.abs(t.right-t.left):t.width,e=wr(i,"paddingLeft");f=f-(e?parseInt(e):0);var s=t.height===nt?Math.abs(t.bottom-t.top):t.height,o="px",r=document.getElementById(c);r||(r=document.createElement("div"),r.setAttribute("id",c));r.style.height=s+o;r.style.width=f+o;u=i.childNodes;u&&u.length&&i.insertBefore(r,u[0])}}function wr(n,t){var i;if(window.getComputedStyle)i=getComputedStyle(n,null);else if(n.currentStyle)i=n.currentStyle;else return null;return i[t]}function br(){var n=document.getElementById(c);n&&n.parentNode.removeChild(n)}function ei(){e.ajaxPerf?f.fire("ajax.load",l):f.fire("ajax.load");pt&&li(!0);f.fire("onHTML");f.fire("onPP");f.fire("onP1Lazy");e.ajaxPerf?f.fire("ajax.postload",l):f.fire("ajax.postload");try{window.scrollTo(0,0)}catch(n){}l={};br()}function it(n,t,i){o=gi;try{if(window.performance&&performance.now&&performance.now()>wi){at(n,"PageExpired",o,t);return}y=n;v=t;ut=!0;vr();o=nr;kr(n,t,i)}catch(u){var f=o===dt&&!document.getElementById(c)?!1:!0,r=""+u;f?at(n,r,o,t):oi(r,o)}}function kr(n,r,f){var p,e,a,w,y,b;ft.indexOf(n)===-1&&(t.enableLocalCache&&r===s.history&&(p=i.fetch(n))?(o=dt,l.fromCache=!0,ti(p,-1,n)):(l.fromCache=!1,e=window.AjaxCB.length,o=tr,ft.push(n),a=k.get("_SS","SID"),a&&(h=a),w=n+(n.indexOf("&sid=")===-1?"&sid="+h:"")+"&format="+yt+"&jsoncbid="+e,u&&u.parentNode&&u.parentNode.removeChild(u),u=document.createElement("iframe"),u.style.display="none",document.body.appendChild(u),window.AjaxCB.push(function(t){ti(t,e,n)}),di=new Date,y=function(t,i){return function(){document.getElementById(c)&&at(n,"FailedRequest",t,i)}},u.onload=y(gt,v),b=window.location.protocol+"//"+window.location.host+w,u.contentWindow.location.assign(b),tt=rt.setTimeout(y(rr,v),t.timeout),o=ir,pr(f)))}function at(n,t,i,r){oi(t,i);n=n+ur+i;var u="assign";r===s.history&&(u="replace");rt.setTimeout(function(){return window.location[u](n)},pi)}function oi(n,t){if(t<gt&&typeof onerror=="function")window.onerror(n,"Ajax.Bundle.MM",t);else sj_log("CI.Error","Ajax.MM",n+t),ct()}function si(n){v!==s.history&&r.pushState(n);ft=[]}function dr(n){if(n&&n.length>1){var t=b(n[1]),i=b(y);if(et!=null&&et(t,i))return;t&&t!==i&&it(t,s.history)}}function gr(n){n&&n.length>1&&n[1]&&(y=e.getRelativeUrl(n[1]))}function nu(n,t){var i=e.getRelativeUrl(n);i.indexOf(g)===0&&(ot==null||ot(n))?(i=b(i),it(i,t)):window.location.assign(n)}function b(n){if(!n)return n;var t=n.indexOf("#");return t===-1?n:n.substring(0,t)}function tu(){var n,i,t;ut&&(n=a.getCssHolder(),n.id="ajaxStylesBackup",i=a.getCssHolder(),t=n.nextSibling,t&&n.parentNode.insertBefore(i,t),ut=!1)}function hi(){var n=document.getElementById("ajaxStylesBackup");n&&n.parentNode.removeChild(n)}function iu(n,t){var i=t&&t.action?t.action:g;return e.getRelativeUrl(i)+"?q="+encodeURIComponent(n)}function ru(n){for(var r="",i=n.getElementsByTagName("input"),t=0;t<i.length;t++)i[t].type==="hidden"&&(r+="&"+i[t].name+"="+encodeURIComponent(i[t].value));return r}function ci(n){var t=document.getElementById(keyMap.SearchForm),u=document.getElementById(keyMap.SBoxId),r=u.value,i;if(ki.test(r)){if(i=iu(r,t)+ru(t),p&&p(null,t,i))return;d.preventDefault(n);it(i,s.as)}}function uu(){var n=document.getElementById(keyMap.Notification),t;n&&(n.parentNode.removeChild(n),t=document.getElementById("id_h"),t&&(t.style.top="0"))}function li(n){var t=document.getElementById("b_ajax_np"),r,i;t&&(r=n?"data-complete-np":"data-loading-np",i=t.getAttribute(r),i&&t.setAttribute("aria-label",i))}var k=n("cookies"),a=n("dom"),rt=n("env"),f=n("event.custom"),vt=n("event.native"),ai=n("rmsajax"),d=n("shared"),e=n("ajax.shared");(function(n){n[n.click=1]="click";n[n.history=2]="history";n[n.as=3]="as"})(t.Origin||(t.Origin={}));var s=t.Origin,u=null,g=location.pathname,h=_G.SID,yt="snrjson",ut=!1,pt=typeof _G!="undefined"&&typeof _G.EF!="undefined"&&_G.EF.ajaxbnp===1,v=s.click,y=e.getRelativeUrl(window.location.href),ft=[],vi=["Bnp","RMS_IACL","sched","TP","bepns","Identity","initComCtrl","ccal","ccal_bundle"],yi=["bubblePlaceholder","irhc","vrhc"],c="ajaxMaskLayer",nt,tt=null;t.enableLocalCache=!0;t.timeout=1e4;var pi=30,wi=864e5,bi=/(&|%26)sid(=|%3d)\w+(&|%26)format(=|%3d)(jsonv2|snrjson)(&|%26)jsoncbid(=|%3d)\d+/gm,ki=/\S/,wt,bt=sj_ce("textarea"),kt,di=si_ST,o,gi=10,nr=20,tr=30,ir=40,dt=50,gt=60,rr=70,ur="&ajf=",l={},et=null,ot=null,st=null,p=null,w=[];t.registerRenderCallback=fr;t.setHistoryChangeCallback=er;t.setLocationChangeCallback=or;t.setContentMaskCallback=sr;t.setBeforeLoadCallback=hr;t.renderItem=ri;f.bind("onP1",ni,!0);window.AjaxCB=[]});define("ajax.render.mm",["require","exports","ajax.cache.mm","ajax.framework.mm"],function(n,t,i,r){function a(n){for(var i=0,t=0;t<u.length;t++)if(u[t].url.indexOf(n)>-1){i=u[t].pos;break}return i}function b(n,t,i,u,e){var c=!1,s,h;switch(t){case"EOS":f=i;r.renderItem(n,t,i,u);s="";h=0;e==r.Origin.history&&(o=h=a(i),s="if(typeof (_w.LateLoad) != 'undefined') _w.LateLoad.updateImages()");s="if(typeof (_w.VideoDenseResult) != 'undefined') _w.VideoDenseResult.init("+h+");"+s;w.includeScript(s);c=!0}return c}function k(n,t,i,u,s){var h=!1;switch(t){case"EOS":f=i;r.renderItem(n,t,i,u);e(i)||s==r.Origin.history&&(o=a(i));h=!0}return h}function d(){if(s=="/images/search")r.registerRenderCallback(k);else if(s=="/videos/search")r.registerRenderCallback(b);else return;r.enableLocalCache=!1;r.timeout=keyMap.Timeout;r.setHistoryChangeCallback(rt);r.setLocationChangeCallback(ut);r.setContentMaskCallback(ft);r.setBeforeLoadCallback(it)}function h(n,t){if(t)if(v(t)){if(y(t)||!n||!v(n)||y(n))return!1}else if(!e(t)&&n&&e(n)||e(t)&&n&&!e(n))return!1;return!0}function e(n){return n.match(/\/images\/search.*[?&]view=detailv2\b/i)!=null}function v(n){return n.match(/\/videos\/search.*[?&]view=detail\b/i)!=null}function y(n){return/\?.+\bvrth=1\b/.test(n)}function g(n){return n&&n.getAttribute("data-ajax-allowed")==="1"}function nt(n,t,i){for(;n&&n!==document;n=n.parentNode){if(n[t]&&n[t].indexOf(i)!==-1)return n;if(n===undefined)break}}function tt(n,t){if(!n||!t)return!1;for(var i=0;i<t.length;i++)if(nt(n,t[i][0],t[i][1])!==undefined&&!g(n))return!0;return!1}function it(n,t,i){var r=!1,u=t?t.target:null,f;return u=="_blank"||u=="_parent"?(_w.open(i,u),r=!0):(f=n?l.getParentContainer(n,"tagName","A"):null,h(f?f.href:null,window.location.href)?n&&!e(window.location.href)?tt(n,[["className","dg_u"],["className","vtrc_c"],["className","mm_vrcc"],["id","stp_c"],["className","mc_vtvc"]])&&(r=!0):typeof DgConfig=="undefined"&&(r=!0):r=!0,r&&i&&window.location.assign(i)),r}function rt(n,t){var i=!1;return(n.indexOf("#view=detail")>-1||p(n)||p(t)||!h(n,t))&&(i=!0),i}function p(n){return n&&n.indexOf("ajaxhist=0")>-1}function ut(n){return h(n,window.location.href)}function ft(n){if(n&&l.getParentContainer(n,"id","mmvm_car")!==undefined)return document.getElementById(keyMap.VideoMaskContent);var t=document.getElementById(keyMap.ImageDetailMaskContent);return t?t:document.getElementById(keyMap.Content)}function et(){o=_w.pageYOffset||Math.max(sb_de.scrollTop,sj_b.scrollTop)}function ot(){f===undefined&&(f=window.location.href.substr(window.location.href.indexOf(s)));for(var n=0;n<u.length;n++)if(u[n].url==f){u[n].pos=o;break}n==u.length&&u.push({url:f,pos:o})}var w=n("dom"),c=n("event.custom"),l=n("ajax.shared"),s=location.pathname,u=[],o=0,f;i.setQuota(s,10);c.bind("onP1",d,!0);c.bind("ajax.unload",ot,!0);sj_be(_w,"scroll",et)}) |