// create OffAmazonPayments Widgets namespace if (!OffAmazonPayments || typeof(OffAmazonPayments) == "undefined") { var OffAmazonPayments = {}; // Make sure the base namespace exists } // store time when we start processing our first JS OffAmazonPayments.ZERO_TIME = (new Date()).getTime(); // zero time marker try { window.performance.mark('apay-t0'); } catch (e){} /* http://www.JSON.org/json2.js 2010-03-20 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html */ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';function f(n){return n<10?'0'+n:n}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key)}if(typeof rep==='function'){value=rep.call(holder,key,value)}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null'}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i)[^>]*$|^#([\w-]+)$/,aT=/^.[^:#\[\.,]*$/,ao=/\S/,H=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,q=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,aw=navigator.userAgent,b=false,av=[],aB,a1=Object.prototype.toString,aV=Object.prototype.hasOwnProperty,az=Array.prototype.push,au=Array.prototype.slice,a6=Array.prototype.indexOf;ai.fn=ai.prototype={init:function(s,c){var A,w;if(!s){return this}if(s.nodeType){this.context=this[0]=s;this.length=1;return this}if(s==="body"&&!c){this.context=M;this[0]=M.body;this.selector="body";this.length=1;return this}if(typeof s==="string"){if((A=a7.exec(s))&&(A[1]||!c)){if(A[1]){w=c?c.ownerDocument||c:M;if(s=q.exec(s)){if(ai.isPlainObject(c)){s=[M.createElement(s[1])];ai.fn.attr.call(s,c,true)}else{s=[w.createElement(s[1])]}}else{s=a3([A[1]],[w]);s=(s.cacheable?s.fragment.cloneNode(true):s.fragment).childNodes}return ai.merge(this,s)}else{if(c=M.getElementById(A[2])){if(c.id!==A[2]){return at.find(s)}this.length=1;this[0]=c}this.context=M;this.selector=s;return this}}else{if(!c&&/^\w+$/.test(s)){this.selector=s;this.context=M;s=M.getElementsByTagName(s);return ai.merge(this,s)}else{return !c||c.jquery?(c||at).find(s):ai(c).find(s)}}}else{if(ai.isFunction(s)){return at.ready(s)}}if(s.selector!==I){this.selector=s.selector;this.context=s.context}return ai.makeArray(s,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return au.call(this,0)},get:function(c){return c==null?this.toArray():c<0?this.slice(c)[0]:this[c]},pushStack:function(s,c,A){var w=ai();ai.isArray(s)?az.apply(w,s):ai.merge(w,s);w.prevObject=this;w.context=this.context;if(c==="find"){w.selector=this.selector+(this.selector?" ":"")+A}else{if(c){w.selector=this.selector+"."+c+"("+A+")"}}return w},each:function(s,c){return ai.each(this,s,c)},ready:function(c){ai.bindReady();if(ai.isReady){c.call(M,ai)}else{av&&av.push(c)}return this},eq:function(c){return c===-1?this.slice(c):this.slice(c,+c+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(au.apply(this,arguments),"slice",au.call(arguments).join(","))},map:function(c){return this.pushStack(ai.map(this,function(s,w){return c.call(s,w,s)}))},end:function(){return this.prevObject||ai(null)},push:az,sort:[].sort,splice:[].splice};ai.fn.init.prototype=ai.fn;ai.extend=ai.fn.extend=function(){var s=arguments[0]||{},c=1,K=arguments.length,F=false,G,w,A,J;if(typeof s==="boolean"){F=s;s=arguments[1]||{};c=2}if(typeof s!=="object"&&!ai.isFunction(s)){s={}}if(K===c){s=this;--c}for(;c
a";var G=J.getElementsByTagName("*"),w=J.getElementsByTagName("a")[0];if(!(!G||!G.length||!w)){ai.support={leadingWhitespace:J.firstChild.nodeType===3,tbody:!J.getElementsByTagName("tbody").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(w.getAttribute("style")),hrefNormalized:w.getAttribute("href")==="/a",opacity:/^0.55$/.test(w.style.opacity),cssFloat:!!w.style.cssFloat,checkOn:J.getElementsByTagName("input")[0].value==="on",optSelected:M.createElement("select").appendChild(M.createElement("option")).selected,parentNode:J.removeChild(J.appendChild(M.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};K.type="text/javascript";try{K.appendChild(M.createTextNode("window."+F+"=1;"))}catch(A){}L.insertBefore(K,L.firstChild);if(aO[F]){ai.support.scriptEval=true;delete aO[F]}try{delete K.test}catch(c){ai.support.deleteExpando=false}L.removeChild(K);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function s(){ai.support.noCloneEvent=false;J.detachEvent("onclick",s)});J.cloneNode(true).fireEvent("onclick")}J=M.createElement("div");J.innerHTML="";L=M.createDocumentFragment();L.appendChild(J.firstChild);ai.support.checkClone=L.cloneNode(true).cloneNode(true).lastChild.checked;ai(function(){var N=M.createElement("div");N.style.width=N.style.paddingLeft="1px";M.body.appendChild(N);ai.boxModel=ai.support.boxModel=N.offsetWidth===2;M.body.removeChild(N).style.display="none"});L=function(N){var P=M.createElement("div");N="on"+N;var O=N in P;if(!O){P.setAttribute(N,"return;");O=typeof P[N]==="function"}return O};ai.support.submitBubbles=L("submit");ai.support.changeBubbles=L("change");L=K=J=G=w=null}})();ai.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aH="jQuery"+aF(),e=0,aS={};ai.extend({cache:{},expando:aH,noData:{embed:true,object:true,applet:true},data:function(s,c,F){if(!(s.nodeName&&ai.noData[s.nodeName.toLowerCase()])){s=s==aO?aS:s;var w=s[aH],A=ai.cache;if(!w&&typeof c==="string"&&F===I){return null}w||(w=++e);if(typeof c==="object"){s[aH]=w;A[w]=ai.extend(true,{},c)}else{if(!A[w]){s[aH]=w;A[w]={}}}s=A[w];if(F!==I){s[c]=F}return typeof c==="string"?s[c]:s}},removeData:function(s,c){if(!(s.nodeName&&ai.noData[s.nodeName.toLowerCase()])){s=s==aO?aS:s;var F=s[aH],w=ai.cache,A=w[F];if(c){if(A){delete A[c];ai.isEmptyObject(A)&&ai.removeData(s)}}else{if(ai.support.deleteExpando){delete s[ai.expando]}else{s.removeAttribute&&s.removeAttribute(ai.expando)}delete w[F]}}}});ai.fn.extend({data:function(s,c){if(typeof s==="undefined"&&this.length){return ai.data(this[0])}else{if(typeof s==="object"){return this.each(function(){ai.data(this,s)})}}var A=s.split(".");A[1]=A[1]?"."+A[1]:"";if(c===I){var w=this.triggerHandler("getData"+A[1]+"!",[A[0]]);if(w===I&&this.length){w=ai.data(this[0],s)}return w===I&&A[1]?this.data(A[0]):w}else{return this.trigger("setData"+A[1]+"!",[A[0],c]).each(function(){ai.data(this,s,c)})}},removeData:function(c){return this.each(function(){ai.removeData(this,c)})}});ai.extend({queue:function(s,c,A){if(s){c=(c||"fx")+"queue";var w=ai.data(s,c);if(!A){return w||[]}if(!w||ai.isArray(A)){w=ai.data(s,c,ai.makeArray(A))}else{w.push(A)}return w}},dequeue:function(s,c){c=c||"fx";var A=ai.queue(s,c),w=A.shift();if(w==="inprogress"){w=A.shift()}if(w){c==="fx"&&A.unshift("inprogress");w.call(s,function(){ai.dequeue(s,c)})}}});ai.fn.extend({queue:function(s,c){if(typeof s!=="string"){c=s;s="fx"}if(c===I){return ai.queue(this[0],s)}return this.each(function(){var w=ai.queue(this,s,c);s==="fx"&&w[0]!=="inprogress"&&ai.dequeue(this,s)})},dequeue:function(c){return this.each(function(){ai.dequeue(this,c)})},delay:function(s,c){s=ai.fx?ai.fx.speeds[s]||s:s;c=c||"fx";return this.queue(c,function(){var w=this;setTimeout(function(){ai.dequeue(w,c)},s)})},clearQueue:function(c){return this.queue(c||"fx",[])}});var be=/[\n\t]/g,U=/\s+/,a8=/\r/g,aM=/href|src|style/,aU=/(button|input)/i,ax=/(button|input|object|select|textarea)/i,S=/^(a|area)$/i,aY=/radio|checkbox/;ai.fn.extend({attr:function(s,c){return ap(this,s,c,true,ai.attr)},removeAttr:function(c){return this.each(function(){ai.attr(this,c,"");this.nodeType===1&&this.removeAttribute(c)})},addClass:function(L){if(ai.isFunction(L)){return this.each(function(O){var N=ai(this);N.addClass(L.call(this,O,N.attr("class")))})}if(L&&typeof L==="string"){for(var K=(L||"").split(U),J=0,F=this.length;J-1){return true}}return false},val:function(s){if(s===I){var c=this[0];if(c){if(ai.nodeName(c,"option")){return(c.attributes.value||{}).specified?c.value:c.text}if(ai.nodeName(c,"select")){var K=c.selectedIndex,F=[],G=c.options;c=c.type==="select-one";if(K<0){return null}var w=c?K:0;for(K=c?K+1:G.length;w=0}else{if(ai.nodeName(this,"select")){var N=ai.makeArray(O);ai("option",this).each(function(){this.selected=ai.inArray(ai(this).val(),N)>=0});if(!N.length){this.selectedIndex=-1}}else{this.value=O}}}})}});ai.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(s,c,G,A){if(!s||s.nodeType===3||s.nodeType===8){return I}if(A&&c in ai.attrFn){return ai(s)[c](G)}A=s.nodeType!==1||!ai.isXMLDoc(s);var F=G!==I;c=A&&ai.props[c]||c;if(s.nodeType===1){var w=aM.test(c);if(c in s&&A&&!w){if(F){c==="type"&&aU.test(s.nodeName)&&s.parentNode&&ai.error("type property can't be changed");s[c]=G}if(ai.nodeName(s,"form")&&s.getAttributeNode(c)){return s.getAttributeNode(c).nodeValue}if(c==="tabIndex"){return(c=s.getAttributeNode("tabIndex"))&&c.specified?c.value:ax.test(s.nodeName)||S.test(s.nodeName)&&s.href?0:I}return s[c]}if(!ai.support.style&&A&&c==="style"){if(F){s.style.cssText=""+G}return s.style.cssText}F&&s.setAttribute(c,""+G);s=!ai.support.hrefNormalized&&A&&w?s.getAttribute(c,2):s.getAttribute(c);return s===null?I:s}return ai.style(s,c,G)}});var ay=/\.(.*)$/,r=function(c){return c.replace(/[^\w\s\.\|`]/g,function(s){return"\\"+s})};ai.event={add:function(P,O,L,J){if(!(P.nodeType===3||P.nodeType===8)){if(P.setInterval&&P!==aO&&!P.frameElement){P=aO}var K,F;if(L.handler){K=L;L=K.handler}if(!L.guid){L.guid=ai.guid++}if(F=ai.data(P)){var G=F.events=F.events||{},s=F.handle;if(!s){F.handle=s=function(){return typeof ai!=="undefined"&&!ai.event.triggered?ai.event.handle.apply(s.elem,arguments):I}}s.elem=P;O=O.split(" ");for(var A,w=0,c;A=O[w++];){F=K?ai.extend({},K):{handler:L,data:J};if(A.indexOf(".")>-1){c=A.split(".");A=c.shift();F.namespace=c.slice(0).sort().join(".")}else{c=[];F.namespace=""}F.type=A;F.guid=L.guid;var Q=G[A],N=ai.event.special[A]||{};if(!Q){Q=G[A]=[];if(!N.setup||N.setup.call(P,J,c,s)===false){if(P.addEventListener){P.addEventListener(A,s,false)}else{P.attachEvent&&P.attachEvent("on"+A,s)}}}if(N.add){N.add.call(P,F);if(!F.handler.guid){F.handler.guid=L.guid}}Q.push(F);ai.event.global[A]=true}P=null}}},global:{},remove:function(R,Q,O,L){if(!(R.nodeType===3||R.nodeType===8)){var N,J=0,K,A,G,F,c,T,P=ai.data(R),s=P&&P.events;if(P&&s){if(Q&&Q.type){O=Q.handler;Q=Q.type}if(!Q||typeof Q==="string"&&Q.charAt(0)==="."){Q=Q||"";for(N in s){ai.event.remove(R,N+Q)}}else{for(Q=Q.split(" ");N=Q[J++];){F=N;K=N.indexOf(".")<0;A=[];if(!K){A=N.split(".");N=A.shift();G=new RegExp("(^|\\.)"+ai.map(A.slice(0).sort(),r).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(c=s[N]){if(O){F=ai.event.special[N]||{};for(w=L||0;w=0){N.type=J=J.slice(0,-1);N.exclusive=true}if(!K){N.stopPropagation();ai.event.global[J]&&ai.each(ai.cache,function(){this.events&&this.events[J]&&ai.event.trigger(N,L,this.handle.elem)})}if(!K||K.nodeType===3||K.nodeType===8){return I}N.result=I;N.target=K;L=ai.makeArray(L);L.unshift(N)}N.currentTarget=K;(G=ai.data(K,"handle"))&&G.apply(K,L);G=K.parentNode||K.ownerDocument;try{if(!(K&&K.nodeName&&ai.noData[K.nodeName.toLowerCase()])){if(K["on"+J]&&K["on"+J].apply(K,L)===false){N.result=false}}}catch(A){}if(!N.isPropagationStopped()&&G){ai.event.trigger(N,L,G,true)}else{if(!N.isDefaultPrevented()){G=N.target;var F,c=ai.nodeName(G,"a")&&J==="click",w=ai.event.special[J]||{};if((!w._default||w._default.call(K,N)===false)&&!c&&!(G&&G.nodeName&&ai.noData[G.nodeName.toLowerCase()])){try{if(G[J]){if(F=G["on"+J]){G["on"+J]=null}ai.event.triggered=true;G[J]()}}catch(s){}if(F){G["on"+J]=F}ai.event.triggered=false}}}},handle:function(s){var c,J,F,G;s=arguments[0]=ai.event.fix(s||aO.event);s.currentTarget=this;c=s.type.indexOf(".")<0&&!s.exclusive;if(!c){J=s.type.split(".");s.type=J.shift();F=new RegExp("(^|\\.)"+J.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}G=ai.data(this,"events");J=G[s.type];if(G&&J){J=J.slice(0);G=0;for(var w=J.length;G-1?ai.map(s.options,function(A){return A.selected}).join("-"):""}else{if(s.nodeName.toLowerCase()==="select"){w=s.selectedIndex}}}return w},bd=function(s,c){var F=s.target,w,A;if(!(!t.test(F.nodeName)||F.readOnly)){w=ai.data(F,"_change_data");A=j(F);if(s.type!=="focusout"||F.type!=="radio"){ai.data(F,"_change_data",A)}if(!(w===I||A===w)){if(w!=null||A){s.type="change";return ai.event.trigger(s,c,F)}}}};ai.event.special.change={filters:{focusout:bd,click:function(s){var c=s.target,w=c.type;if(w==="radio"||w==="checkbox"||c.nodeName.toLowerCase()==="select"){return bd.call(this,s)}},keydown:function(s){var c=s.target,w=c.type;if(s.keyCode===13&&c.nodeName.toLowerCase()!=="textarea"||s.keyCode===32&&(w==="checkbox"||w==="radio")||w==="select-multiple"){return bd.call(this,s)}},beforeactivate:function(c){c=c.target;ai.data(c,"_change_data",j(c))}},setup:function(){if(this.type==="file"){return false}for(var c in g){ai.event.add(this,c+".specialChange",g[c])}return t.test(this.nodeName)},teardown:function(){ai.event.remove(this,".specialChange");return t.test(this.nodeName)}};g=ai.event.special.change.filters}M.addEventListener&&ai.each({focus:"focusin",blur:"focusout"},function(s,c){function w(A){A=ai.event.fix(A);A.type=c;return ai.event.handle.call(this,A)}ai.event.special[c]={setup:function(){this.addEventListener(s,w,true)},teardown:function(){this.removeEventListener(s,w,true)}}});ai.each(["bind","one"],function(s,c){ai.fn[c]=function(K,F,G){if(typeof K==="object"){for(var w in K){this[c](w,F,K[w],G)}return this}if(ai.isFunction(F)){G=F;F=I}var A=c==="one"?ai.proxy(G,function(L){ai(this).unbind(L,A);return G.apply(this,arguments)}):G;if(K==="unload"&&c!=="one"){this.one(K,F,G)}else{w=0;for(var J=this.length;w0){bl=bn;break}}}bn=bn[bb]}aa[Y]=bl}}}var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,R=0,O=Object.prototype.toString,P=false,K=true;[0,0].sort(function(){K=false;return 0});var N=function(bm,bl,ba,ab){ba=ba||[];var Z=bl=bl||M;if(bl.nodeType!==1&&bl.nodeType!==9){return[]}if(!bm||typeof bm!=="string"){return ba}for(var aa=[],br,bs,bo,bb,bq=true,bn=s(bl),bp=bm;(Q.exec(""),br=Q.exec(bp))!==null;){bp=br[3];aa.push(br[1]);if(br[2]){bb=br[3];break}}if(aa.length>1&&F.exec(bm)){if(aa.length===2&&L.relative[aa[0]]){bs=X(aa[0]+aa[1],bl)}else{for(bs=L.relative[aa[0]]?[bl]:N(aa.shift(),bl);aa.length;){bm=aa.shift();if(L.relative[bm]){bm+=aa.shift()}bs=X(bm,bs)}}}else{if(!ab&&aa.length>1&&bl.nodeType===9&&!bn&&L.match.ID.test(aa[0])&&!L.match.ID.test(aa[aa.length-1])){br=N.find(aa.shift(),bl,bn);bl=br.expr?N.filter(br.expr,br.set)[0]:br.set[0]}if(bl){br=ab?{expr:aa.pop(),set:c(ab)}:N.find(aa.pop(),aa.length===1&&(aa[0]==="~"||aa[0]==="+")&&bl.parentNode?bl.parentNode:bl,bn);bs=br.expr?N.filter(br.expr,br.set):br.set;if(aa.length>0){bo=c(bs)}else{bq=false}for(;aa.length;){var Y=aa.pop();br=Y;if(L.relative[Y]){br=aa.pop()}else{Y=""}if(br==null){br=bl}L.relative[Y](bo,br,bn)}}else{bo=[]}}bo||(bo=bs);bo||N.error(Y||bm);if(O.call(bo)==="[object Array]"){if(bq){if(bl&&bl.nodeType===1){for(bm=0;bo[bm]!=null;bm++){if(bo[bm]&&(bo[bm]===true||bo[bm].nodeType===1&&A(bl,bo[bm]))){ba.push(bs[bm])}}}else{for(bm=0;bo[bm]!=null;bm++){bo[bm]&&bo[bm].nodeType===1&&ba.push(bs[bm])}}}else{ba.push.apply(ba,bo)}}else{c(bo,ba)}if(bb){N(bb,Z,ba,ab);N.uniqueSort(ba)}return ba};N.uniqueSort=function(Z){if(J){P=K;Z.sort(J);if(P){for(var Y=1;Y":function(ab,aa){var Z=typeof aa==="string";if(Z&&!/\W/.test(aa)){aa=aa.toLowerCase();for(var Y=0,ba=ab.length;Y=0)){Z||Y.push(aa)}else{if(Z){ab[bl]=false}}}}return false},ID:function(Y){return Y[1].replace(/\\/g,"")},TAG:function(Y){return Y[1].toLowerCase()},CHILD:function(Z){if(Z[1]==="nth"){var Y=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(Z[2]==="even"&&"2n"||Z[2]==="odd"&&"2n+1"||!/\D/.test(Z[2])&&"0n+"+Z[2]||Z[2]);Z[2]=Y[1]+(Y[2]||1)-0;Z[3]=Y[3]-0}Z[0]=R++;return Z},ATTR:function(ab,aa,Z,Y,ba,bb){aa=ab[1].replace(/\\/g,"");if(!bb&&L.attrMap[aa]){ab[1]=L.attrMap[aa]}if(ab[2]==="~="){ab[4]=" "+ab[4]+" "}return ab},PSEUDO:function(ab,aa,Z,Y,ba){if(ab[1]==="not"){if((Q.exec(ab[3])||"").length>1||/^\w/.test(ab[3])){ab[3]=N(ab[3],null,null,aa)}else{ab=N.filter(ab[3],aa,Z,true^ba);Z||Y.push.apply(Y,ab);return false}}else{if(L.match.POS.test(ab[0])||L.match.CHILD.test(ab[0])){return true}}return ab},POS:function(Y){Y.unshift(true);return Y}},filters:{enabled:function(Y){return Y.disabled===false&&Y.type!=="hidden"},disabled:function(Y){return Y.disabled===true},checked:function(Y){return Y.checked===true},selected:function(Y){return Y.selected===true},parent:function(Y){return !!Y.firstChild},empty:function(Y){return !Y.firstChild},has:function(aa,Z,Y){return !!N(Y[3],aa).length},header:function(Y){return/h\d/i.test(Y.nodeName)},text:function(Y){return"text"===Y.type},radio:function(Y){return"radio"===Y.type},checkbox:function(Y){return"checkbox"===Y.type},file:function(Y){return"file"===Y.type},password:function(Y){return"password"===Y.type},submit:function(Y){return"submit"===Y.type},image:function(Y){return"image"===Y.type},reset:function(Y){return"reset"===Y.type},button:function(Y){return"button"===Y.type||Y.nodeName.toLowerCase()==="button"},input:function(Y){return/input|select|textarea|button/i.test(Y.nodeName)}},setFilters:{first:function(Z,Y){return Y===0},last:function(ab,aa,Z,Y){return aa===Y.length-1},even:function(Z,Y){return Y%2===0},odd:function(Z,Y){return Y%2===1},lt:function(aa,Z,Y){return ZY[3]-0},nth:function(aa,Z,Y){return Y[3]-0===Z},eq:function(aa,Z,Y){return Y[3]-0===Z}},filter:{PSEUDO:function(ab,aa,Z,Y){var ba=aa[1],bb=L.filters[ba];if(bb){return bb(ab,Z,aa,Y)}else{if(ba==="contains"){return(ab.textContent||ab.innerText||W([ab])||"").indexOf(aa[3])>=0}else{if(ba==="not"){aa=aa[3];Z=0;for(Y=aa.length;Z=0}},ID:function(Z,Y){return Z.nodeType===1&&Z.getAttribute("id")===Y},TAG:function(Z,Y){return Y==="*"&&Z.nodeType===1||Z.nodeName.toLowerCase()===Y},CLASS:function(Z,Y){return(" "+(Z.className||Z.getAttribute("class"))+" ").indexOf(Y)>-1},ATTR:function(ab,aa){var Z=aa[1];ab=L.attrHandle[Z]?L.attrHandle[Z](ab):ab[Z]!=null?ab[Z]:ab.getAttribute(Z);Z=ab+"";var Y=aa[2];aa=aa[4];return ab==null?Y==="!=":Y==="="?Z===aa:Y==="*="?Z.indexOf(aa)>=0:Y==="~="?(" "+Z+" ").indexOf(aa)>=0:!aa?Z&&ab!==false:Y==="!="?Z!==aa:Y==="^="?Z.indexOf(aa)===0:Y==="$="?Z.substr(Z.length-aa.length)===aa:Y==="|="?Z===aa||Z.substr(0,aa.length+1)===aa+"-":false},POS:function(ab,aa,Z,Y){var ba=L.setFilters[aa[2]];if(ba){return ba(ab,Z,aa,Y)}}}},F=L.match.POS;for(var w in L.match){L.match[w]=new RegExp(L.match[w].source+/(?![^\[]*\])(?![^\(]*\))/.source);L.leftMatch[w]=new RegExp(/(^(?:.|\r|\n)*?)/.source+L.match[w].source.replace(/\\(\d+)/g,function(Z,Y){return"\\"+(Y-0+1)}))}var c=function(Z,Y){Z=Array.prototype.slice.call(Z,0);if(Y){Y.push.apply(Y,Z);return Y}return Z};try{Array.prototype.slice.call(M.documentElement.childNodes,0)}catch(G){c=function(ab,aa){aa=aa||[];if(O.call(ab)==="[object Array]"){Array.prototype.push.apply(aa,ab)}else{if(typeof ab.length==="number"){for(var Z=0,Y=ab.length;Z";var Y=M.documentElement;Y.insertBefore(aa,Y.firstChild);if(M.getElementById(Z)){L.find.ID=function(ab,ba,bb){if(typeof ba.getElementById!=="undefined"&&!bb){return(ba=ba.getElementById(ab[1]))?ba.id===ab[1]||typeof ba.getAttributeNode!=="undefined"&&ba.getAttributeNode("id").nodeValue===ab[1]?[ba]:I:[]}};L.filter.ID=function(ab,ba){var bb=typeof ab.getAttributeNode!=="undefined"&&ab.getAttributeNode("id");return ab.nodeType===1&&bb&&bb.nodeValue===ba}}Y.removeChild(aa);Y=aa=null})();(function(){var Y=M.createElement("div");Y.appendChild(M.createComment(""));if(Y.getElementsByTagName("*").length>0){L.find.TAG=function(ab,aa){aa=aa.getElementsByTagName(ab[1]);if(ab[1]==="*"){ab=[];for(var Z=0;aa[Z];Z++){aa[Z].nodeType===1&&ab.push(aa[Z])}aa=ab}return aa}}Y.innerHTML="";if(Y.firstChild&&typeof Y.firstChild.getAttribute!=="undefined"&&Y.firstChild.getAttribute("href")!=="#"){L.attrHandle.href=function(Z){return Z.getAttribute("href",2)}}Y=null})();M.querySelectorAll&&function(){var aa=N,Z=M.createElement("div");Z.innerHTML="

";if(!(Z.querySelectorAll&&Z.querySelectorAll(".TEST").length===0)){N=function(ab,bl,bm,ba){bl=bl||M;if(!ba&&bl.nodeType===9&&!s(bl)){try{return c(bl.querySelectorAll(ab),bm)}catch(bb){}}return aa(ab,bl,bm,ba)};for(var Y in aa){N[Y]=aa[Y]}Z=null}}();(function(){var Y=M.createElement("div");Y.innerHTML="
";if(!(!Y.getElementsByClassName||Y.getElementsByClassName("e").length===0)){Y.lastChild.className="e";if(Y.getElementsByClassName("e").length!==1){L.order.splice(1,0,"CLASS");L.find.CLASS=function(ab,aa,Z){if(typeof aa.getElementsByClassName!=="undefined"&&!Z){return aa.getElementsByClassName(ab[1])}};Y=null}}})();var A=M.compareDocumentPosition?function(Z,Y){return !!(Z.compareDocumentPosition(Y)&16)}:function(Z,Y){return Z!==Y&&(Z.contains?Z.contains(Y):true)},s=function(Y){return(Y=(Y?Y.ownerDocument||Y:0).documentElement)?Y.nodeName!=="HTML":false},X=function(ab,aa){var Z=[],Y="",ba;for(aa=aa.nodeType?[aa]:aa;ba=L.match.PSEUDO.exec(ab);){Y+=ba[0];ab=ab.replace(L.match.PSEUDO,"")}ab=L.relative[ab]?ab+"*":ab;ba=0;for(var bb=aa.length;ba=0===A})};ai.fn.extend({find:function(s){for(var c=this.pushStack("","find",s),J=0,F=0,G=this.length;F0){for(var w=J;w0},closest:function(L,K){if(ai.isArray(L)){var J=[],F=this[0],G,w={},A;if(F&&L.length){G=0;for(var c=L.length;G-1:ai(F).is(G)){J.push({selector:A,elem:F});delete w[A]}}F=F.parentNode}}return J}var s=ai.expr.match.POS.test(L)?ai(L,K||this.context):null;return this.map(function(O,N){for(;N&&N.ownerDocument&&N!==K;){if(s?s.index(N)>-1:ai(N).is(L)){return N}N=N.parentNode}return null})},index:function(c){if(!c||typeof c==="string"){return ai.inArray(this[0],c?ai(c):this.parent().children())}return ai.inArray(c.jquery?c[0]:c,this)},add:function(s,c){s=typeof s==="string"?ai(s,c||this.context):ai.makeArray(s);c=ai.merge(this.get(),s);return this.pushStack(l(s[0])||l(c[0])?c:ai.unique(c))},andSelf:function(){return this.add(this.prevObject)}});ai.each({parent:function(c){return(c=c.parentNode)&&c.nodeType!==11?c:null},parents:function(c){return ai.dir(c,"parentNode")},parentsUntil:function(s,c,w){return ai.dir(s,"parentNode",w)},next:function(c){return ai.nth(c,2,"nextSibling")},prev:function(c){return ai.nth(c,2,"previousSibling")},nextAll:function(c){return ai.dir(c,"nextSibling")},prevAll:function(c){return ai.dir(c,"previousSibling")},nextUntil:function(s,c,w){return ai.dir(s,"nextSibling",w)},prevUntil:function(s,c,w){return ai.dir(s,"previousSibling",w)},siblings:function(c){return ai.sibling(c.parentNode.firstChild,c)},children:function(c){return ai.sibling(c.firstChild)},contents:function(c){return ai.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:ai.makeArray(c.childNodes)}},function(s,c){ai.fn[s]=function(F,w){var A=ai.map(this,c,F);f.test(s)||(w=F);if(w&&typeof w==="string"){A=ai.filter(w,A)}A=this.length>1?ai.unique(A):A;if((this.length>1||aW.test(w))&&a9.test(s)){A=A.reverse()}return this.pushStack(A,s,au.call(arguments).join(","))}});ai.extend({filter:function(s,c,w){if(w){s=":not("+s+")"}return ai.find.matches(s,c)},dir:function(s,c,A){var w=[];for(s=s[c];s&&s.nodeType!==9&&(A===I||s.nodeType!==1||!ai(s).is(A));){s.nodeType===1&&w.push(s);s=s[c]}return w},nth:function(s,c,A){c=c||1;for(var w=0;s;s=s[A]){if(s.nodeType===1&&++w===c){break}}return s},sibling:function(s,c){for(var w=[];s;s=s.nextSibling){s.nodeType===1&&s!==c&&w.push(s)}return w}});var ah=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,B=/(<([\w:]+)[^>]*?)\/>/g,aC=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,m=/<([\w:]+)/,ac=/"},aJ={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};aJ.optgroup=aJ.option;aJ.tbody=aJ.tfoot=aJ.colgroup=aJ.caption=aJ.thead;aJ.th=aJ.td;if(!ai.support.htmlSerialize){aJ._default=[1,"div
","
"]}ai.fn.extend({text:function(c){if(ai.isFunction(c)){return this.each(function(s){var w=ai(this);w.text(c.call(this,s,w.text()))})}if(typeof c!=="object"&&c!==I){return this.empty().append((this[0]&&this[0].ownerDocument||M).createTextNode(c))}return ai.text(this)},wrapAll:function(s){if(ai.isFunction(s)){return this.each(function(w){ai(this).wrapAll(s.call(this,w))})}if(this[0]){var c=ai(s,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&c.insertBefore(this[0]);c.map(function(){for(var w=this;w.firstChild&&w.firstChild.nodeType===1;){w=w.firstChild}return w}).append(this)}return this},wrapInner:function(c){if(ai.isFunction(c)){return this.each(function(s){ai(this).wrapInner(c.call(this,s))})}return this.each(function(){var s=ai(this),w=s.contents();w.length?w.wrapAll(c):s.append(c)})},wrap:function(c){return this.each(function(){ai(this).wrapAll(c)})},unwrap:function(){return this.parent().each(function(){ai.nodeName(this,"body")||ai(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.appendChild(c)})},prepend:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.insertBefore(c,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this)})}else{if(arguments.length){var c=ai(arguments[0]);c.push.apply(c,this.toArray());return this.pushStack(c,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this.nextSibling)})}else{if(arguments.length){var c=this.pushStack(this,"after",arguments);c.push.apply(c,ai(arguments[0]).toArray());return c}}},remove:function(s,c){for(var A=0,w;(w=this[A])!=null;A++){if(!s||ai.filter(s,[w]).length){if(!c&&w.nodeType===1){ai.cleanData(w.getElementsByTagName("*"));ai.cleanData([w])}w.parentNode&&w.parentNode.removeChild(w)}}return this},empty:function(){for(var s=0,c;(c=this[s])!=null;s++){for(c.nodeType===1&&ai.cleanData(c.getElementsByTagName("*"));c.firstChild;){c.removeChild(c.firstChild)}}return this},clone:function(s){var c=this.map(function(){if(!ai.support.noCloneEvent&&!ai.isXMLDoc(this)){var A=this.outerHTML,w=this.ownerDocument;if(!A){A=w.createElement("div");A.appendChild(this.cloneNode(true));A=A.innerHTML}return ai.clean([A.replace(ah,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(ar,"")],w)[0]}else{return this.cloneNode(true)}});if(s===true){bj(this,c);bj(this.find("*"),c.find("*"))}return c},html:function(s){if(s===I){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ah,""):null}else{if(typeof s==="string"&&!aP.test(s)&&(ai.support.leadingWhitespace||!ar.test(s))&&!aJ[(m.exec(s)||["",""])[1].toLowerCase()]){s=s.replace(B,bk);try{for(var c=0,A=this.length;c0||K.cacheable||this.length>1?A.cloneNode(true):A)}}s.length&&ai.each(s,E)}return this}});ai.fragments={};ai.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(s,c){ai.fn[s]=function(J){var F=[];J=ai(J);var G=this.length===1&&this[0].parentNode;if(G&&G.nodeType===11&&G.childNodes.length===1&&J.length===1){J[c](this[0]);return this}else{G=0;for(var w=J.length;G0?this.clone(true):this).get();ai.fn[c].apply(ai(J[G]),A);F=F.concat(A)}return this.pushStack(F,s,J.selector)}}});ai.extend({clean:function(O,N,L,J){N=N||M;if(typeof N.createElement==="undefined"){N=N.ownerDocument||N[0]&&N[0].ownerDocument||M}for(var K=[],F=0,G;(G=O[F])!=null;F++){if(typeof G==="number"){G+=""}if(G){if(typeof G==="string"&&!u.test(G)){G=N.createTextNode(G)}else{if(typeof G==="string"){G=G.replace(B,bk);var s=(m.exec(G)||["",""])[1].toLowerCase(),A=aJ[s]||aJ._default,w=A[0],c=N.createElement("div");for(c.innerHTML=A[1]+G+A[2];w--;){c=c.lastChild}if(!ai.support.tbody){w=ac.test(G);s=s==="table"&&!w?c.firstChild&&c.firstChild.childNodes:A[1]===""&&!w?c.childNodes:[];for(A=s.length-1;A>=0;--A){ai.nodeName(s[A],"tbody")&&!s[A].childNodes.length&&s[A].parentNode.removeChild(s[A])}}!ai.support.leadingWhitespace&&ar.test(G)&&c.insertBefore(N.createTextNode(ar.exec(G)[0]),c.firstChild);G=c.childNodes}}if(G.nodeType){K.push(G)}else{K=ai.merge(K,G)}}}if(L){for(F=0;K[F];F++){if(J&&ai.nodeName(K[F],"script")&&(!K[F].type||K[F].type.toLowerCase()==="text/javascript")){J.push(K[F].parentNode?K[F].parentNode.removeChild(K[F]):K[F])}else{K[F].nodeType===1&&K.splice.apply(K,[F+1,0].concat(ai.makeArray(K[F].getElementsByTagName("script"))));L.appendChild(K[F])}}}return K},cleanData:function(L){for(var K,J,F=ai.cache,G=ai.event.special,w=ai.support.deleteExpando,A=0,c;(c=L[A])!=null;A++){if(J=c[ai.expando]){K=F[J];if(K.events){for(var s in K.events){G[s]?ai.event.remove(c,s):aG(c,s,K.handle)}}if(w){delete c[ai.expando]}else{c.removeAttribute&&c.removeAttribute(ai.expando)}delete F[J]}}}});var h=/z-?index|font-?weight|opacity|zoom|line-?height/i,a4=/alpha\([^)]*\)/,aQ=/opacity=([^)]*)/,aE=/float/i,ad=/-([a-z])/ig,bf=/([A-Z])/g,aZ=/^-?\d+(?:px)?$/i,aI=/^-?\d/,af={position:"absolute",visibility:"hidden",display:"block"},y=["Left","Right"],k=["Top","Bottom"],bi=M.defaultView&&M.defaultView.getComputedStyle,al=ai.support.cssFloat?"cssFloat":"styleFloat",v=function(s,c){return c.toUpperCase()};ai.fn.css=function(s,c){return ap(this,s,c,true,function(F,w,A){if(A===I){return ai.curCSS(F,w)}if(typeof A==="number"&&!h.test(w)){A+="px"}ai.style(F,w,A)})};ai.extend({style:function(s,c,F){if(!s||s.nodeType===3||s.nodeType===8){return I}if((c==="width"||c==="height")&&parseFloat(F)<0){F=I}var w=s.style||s,A=F!==I;if(!ai.support.opacity&&c==="opacity"){if(A){w.zoom=1;c=parseInt(F,10)+""==="NaN"?"":"alpha(opacity="+F*100+")";s=w.filter||ai.curCSS(s,"filter")||"";w.filter=a4.test(s)?s.replace(a4,c):c}return w.filter&&w.filter.indexOf("opacity=")>=0?parseFloat(aQ.exec(w.filter)[1])/100+"":""}if(aE.test(c)){c=al}c=c.replace(ad,v);if(A){w[c]=F}return w[c]},css:function(s,c,J,F){if(c==="width"||c==="height"){var G,w=c==="width"?y:k;function A(){G=c==="width"?s.offsetWidth:s.offsetHeight;F!=="border"&&ai.each(w,function(){F||(G-=parseFloat(ai.curCSS(s,"padding"+this,true))||0);if(F==="margin"){G+=parseFloat(ai.curCSS(s,"margin"+this,true))||0}else{G-=parseFloat(ai.curCSS(s,"border"+this+"Width",true))||0}})}s.offsetWidth!==0?A():ai.swap(s,af,A);return Math.max(0,Math.round(G))}return ai.curCSS(s,c,J)},curCSS:function(s,c,G){var A,F=s.style;if(!ai.support.opacity&&c==="opacity"&&s.currentStyle){A=aQ.test(s.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return A===""?"1":A}if(aE.test(c)){c=al}if(!G&&F&&F[c]){A=F[c]}else{if(bi){if(aE.test(c)){c="float"}c=c.replace(bf,"-$1").toLowerCase();F=s.ownerDocument.defaultView;if(!F){return null}if(s=F.getComputedStyle(s,null)){A=s.getPropertyValue(c)}if(c==="opacity"&&A===""){A="1"}}else{if(s.currentStyle){G=c.replace(ad,v);A=s.currentStyle[c]||s.currentStyle[G];if(!aZ.test(A)&&aI.test(A)){c=F.left;var w=s.runtimeStyle.left;s.runtimeStyle.left=s.currentStyle.left;F.left=G==="fontSize"?"1em":A||0;A=F.pixelLeft+"px";F.left=c;s.runtimeStyle.left=w}}}}return A},swap:function(s,c,F){var w={};for(var A in c){w[A]=s.style[A];s.style[A]=c[A]}F.call(s);for(A in c){s.style[A]=w[A]}}});if(ai.expr&&ai.expr.filters){ai.expr.filters.hidden=function(s){var c=s.offsetWidth,A=s.offsetHeight,w=s.nodeName.toLowerCase()==="tr";return c===0&&A===0&&!w?true:c>0&&A>0&&!w?false:ai.curCSS(s,"display")==="none"};ai.expr.filters.visible=function(c){return !ai.expr.filters.hidden(c)}}var a2=aF(),aN=//gi,aj=/select|textarea/i,C=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aA=/=\?(&|$)/,i=/\?/,n=/(\?|&)_=.*?(&|$)/,a=/^(\w+:)?\/\/([^\/?#]+)/,a5=/%20/g,aR=ai.fn.load;ai.fn.extend({load:function(s,c,G){if(typeof s!=="string"){return aR.call(this,s)}else{if(!this.length){return this}}var A=s.indexOf(" ");if(A>=0){var F=s.slice(A,s.length);s=s.slice(0,A)}A="GET";if(c){if(ai.isFunction(c)){G=c;c=null}else{if(typeof c==="object"){c=ai.param(c,ai.ajaxSettings.traditional);A="POST"}}}var w=this;ai.ajax({url:s,type:A,dataType:"html",data:c,complete:function(J,K){if(K==="success"||K==="notmodified"){w.html(F?ai("
").append(J.responseText.replace(aN,"")).find(F):J.responseText)}G&&w.each(G,[J.responseText,K,J])}});return this},serialize:function(){return ai.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?ai.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aj.test(this.nodeName)||C.test(this.type))}).map(function(s,c){s=ai(this).val();return s==null?null:ai.isArray(s)?ai.map(s,function(w){return{name:c.name,value:w}}):{name:c.name,value:s}}).get()}});ai.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(s,c){ai.fn[c]=function(w){return this.bind(c,w)}});ai.extend({get:function(s,c,A,w){if(ai.isFunction(c)){w=w||A;A=c;c=null}return ai.ajax({type:"GET",url:s,data:c,success:A,dataType:w})},getScript:function(s,c){return ai.get(s,null,c,"script")},getJSON:function(s,c,w){return ai.get(s,c,w,"json")},post:function(s,c,A,w){if(ai.isFunction(c)){w=w||A;A=c;c={}}return ai.ajax({type:"POST",url:s,data:c,success:A,dataType:w})},ajaxSetup:function(c){ai.extend(ai.ajaxSettings,c)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aO.XMLHttpRequest&&(aO.location.protocol!=="file:"||!aO.ActiveXObject)?function(){return new aO.XMLHttpRequest}:function(){try{return new aO.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(aa){function Z(){X.success&&X.success.call(P,K,R,s);X.global&&W("ajaxSuccess",[s,X])}function Y(){X.complete&&X.complete.call(P,s,R);X.global&&W("ajaxComplete",[s,X]);X.global&&!--ai.active&&ai.event.trigger("ajaxStop")}function W(ba,bb){(X.context?ai(X.context):ai.event).trigger(ba,bb)}var X=ai.extend(true,{},ai.ajaxSettings,aa),Q,R,K,P=aa&&aa.context||X,L=X.type.toUpperCase();if(X.data&&X.processData&&typeof X.data!=="string"){X.data=ai.param(X.data,X.traditional)}if(X.dataType==="jsonp"){if(L==="GET"){aA.test(X.url)||(X.url+=(i.test(X.url)?"&":"?")+(X.jsonp||"callback")+"=?")}else{if(!X.data||!aA.test(X.data)){X.data=(X.data?X.data+"&":"")+(X.jsonp||"callback")+"=?"}}X.dataType="json"}if(X.dataType==="json"&&(X.data&&aA.test(X.data)||aA.test(X.url))){Q=X.jsonpCallback||"jsonp"+a2++;if(X.data){X.data=(X.data+"").replace(aA,"="+Q+"$1")}X.url=X.url.replace(aA,"="+Q+"$1");X.dataType="script";aO[Q]=aO[Q]||function(ba){K=ba;Z();Y();aO[Q]=I;try{delete aO[Q]}catch(bb){}c&&c.removeChild(G)}}if(X.dataType==="script"&&X.cache===null){X.cache=false}if(X.cache===false&&L==="GET"){var F=aF(),w=X.url.replace(n,"$1_="+F+"$2");X.url=w+(w===X.url?(i.test(X.url)?"&":"?")+"_="+F:"")}if(X.data&&L==="GET"){X.url+=(i.test(X.url)?"&":"?")+X.data}X.global&&!ai.active++&&ai.event.trigger("ajaxStart");F=(F=a.exec(X.url))&&(F[1]&&F[1]!==location.protocol||F[2]!==location.host);if(X.dataType==="script"&&L==="GET"&&F){var c=M.getElementsByTagName("head")[0]||M.documentElement,G=M.createElement("script");G.src=X.url;if(X.scriptCharset){G.charset=X.scriptCharset}if(!Q){var J=false;G.onload=G.onreadystatechange=function(){if(!J&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){J=true;Z();Y();G.onload=G.onreadystatechange=null;c&&G.parentNode&&c.removeChild(G)}}}c.insertBefore(G,c.firstChild);return I}var A=false,s=X.xhr();if(s){X.username?s.open(L,X.url,X.async,X.username,X.password):s.open(L,X.url,X.async);try{if(X.data||aa&&aa.contentType){s.setRequestHeader("Content-Type",X.contentType)}if(X.ifModified){ai.lastModified[X.url]&&s.setRequestHeader("If-Modified-Since",ai.lastModified[X.url]);ai.etag[X.url]&&s.setRequestHeader("If-None-Match",ai.etag[X.url])}F||s.setRequestHeader("X-Requested-With","XMLHttpRequest");s.setRequestHeader("Accept",X.dataType&&X.accepts[X.dataType]?X.accepts[X.dataType]+", */*":X.accepts._default)}catch(ab){}if(X.beforeSend&&X.beforeSend.call(P,s,X)===false){X.global&&!--ai.active&&ai.event.trigger("ajaxStop");s.abort();return false}X.global&&W("ajaxSend",[s,X]);var V=s.onreadystatechange=function(bb){if(!s||s.readyState===0||bb==="abort"){A||Y();A=true;if(s){s.onreadystatechange=ai.noop}}else{if(!A&&s&&(s.readyState===4||bb==="timeout")){A=true;s.onreadystatechange=ai.noop;R=bb==="timeout"?"timeout":!ai.httpSuccess(s)?"error":X.ifModified&&ai.httpNotModified(s,X.url)?"notmodified":"success";var bl;if(R==="success"){try{K=ai.httpData(s,X.dataType,X)}catch(ba){R="parsererror";bl=ba}}if(R==="success"||R==="notmodified"){Q||Z()}else{ai.handleError(X,s,R,bl)}Y();bb==="timeout"&&s.abort();if(X.async){s=null}}}};try{var T=s.abort;s.abort=function(){s&&T.call(s);V("abort")}}catch(O){}X.async&&X.timeout>0&&setTimeout(function(){s&&!A&&V("timeout")},X.timeout);try{s.send(L==="POST"||L==="PUT"||L==="DELETE"?X.data:null)}catch(N){ai.handleError(X,s,null,N);Y()}X.async||V();return s}},handleError:function(s,c,A,w){if(s.error){s.error.call(s.context||s,c,A,w)}if(s.global){(s.context?ai(s.context):ai.event).trigger("ajaxError",[c,s,w])}},active:0,httpSuccess:function(s){try{return !s.status&&location.protocol==="file:"||s.status>=200&&s.status<300||s.status===304||s.status===1223||s.status===0}catch(c){}return false},httpNotModified:function(s,c){var A=s.getResponseHeader("Last-Modified"),w=s.getResponseHeader("Etag");if(A){ai.lastModified[c]=A}if(w){ai.etag[c]=w}return s.status===304||s.status===0},httpData:function(s,c,F){var w=s.getResponseHeader("content-type")||"",A=c==="xml"||!c&&w.indexOf("xml")>=0;s=A?s.responseXML:s.responseText;A&&s.documentElement.nodeName==="parsererror"&&ai.error("parsererror");if(F&&F.dataFilter){s=F.dataFilter(s,c)}if(typeof s==="string"){if(c==="json"||!c&&w.indexOf("json")>=0){s=ai.parseJSON(s)}else{if(c==="script"||!c&&w.indexOf("javascript")>=0){ai.globalEval(s)}}}return s},param:function(s,c){function G(J,K){if(ai.isArray(K)){ai.each(K,function(L,N){c||/\[\]$/.test(J)?A(J,N):G(J+"["+(typeof N==="object"||ai.isArray(N)?L:"")+"]",N)})}else{!c&&K!=null&&typeof K==="object"?ai.each(K,function(L,N){G(J+"["+L+"]",N)}):A(J,K)}}function A(J,K){K=ai.isFunction(K)?K():K;F[F.length]=encodeURIComponent(J)+"="+encodeURIComponent(K)}var F=[];if(c===I){c=ai.ajaxSettings.traditional}if(ai.isArray(s)||s.jquery){ai.each(s,function(){A(this.name,this.value)})}else{for(var w in s){G(w,s[w])}}return F.join("&").replace(a5,"+")}});var bg={},bc=/toggle|show|hide/,aX=/^([+-]=)?([\d+-.]+)(.*)$/,aq,D=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];ai.fn.extend({show:function(s,c){if(s||s===0){return this.animate(aD("show",3),s,c)}else{s=0;for(c=this.length;s").appendTo("body");w=A.css("display");if(w==="none"){w="block"}A.remove();bg[F]=w}ai.data(this[s],"olddisplay",w)}}s=0;for(c=this.length;s=0;A--){if(w[A].elem===this){c&&w[A](true);w.splice(A,1)}}});c||this.dequeue();return this}});ai.each({slideDown:aD("show",1),slideUp:aD("hide",1),slideToggle:aD("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(s,c){ai.fn[s]=function(A,w){return this.animate(c,A,w)}});ai.extend({speed:function(s,c,A){var w=s&&typeof s==="object"?s:{complete:A||!A&&c||ai.isFunction(s)&&s,duration:s,easing:A&&c||c&&!ai.isFunction(c)&&c};w.duration=ai.fx.off?0:typeof w.duration==="number"?w.duration:ai.fx.speeds[w.duration]||ai.fx.speeds._default;w.old=w.complete;w.complete=function(){w.queue!==false&&ai(this).dequeue();ai.isFunction(w.old)&&w.old.call(this)};return w},easing:{linear:function(s,c,A,w){return A+w*s},swing:function(s,c,A,w){return(-Math.cos(s*Math.PI)/2+0.5)*w+A}},timers:[],fx:function(s,c,w){this.options=c;this.elem=s;this.prop=w;if(!c.orig){c.orig={}}}});ai.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(ai.fx.step[this.prop]||ai.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(c){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}return(c=parseFloat(ai.css(this.elem,this.prop,c)))&&c>-10000?c:parseFloat(ai.curCSS(this.elem,this.prop))||0},custom:function(s,c,F){function w(G){return A.step(G)}this.startTime=aF();this.start=s;this.end=c;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var A=this;w.elem=this.elem;if(w()&&ai.timers.push(w)&&!aq){aq=setInterval(ai.fx.tick,13)}},show:function(){this.options.orig[this.prop]=ai.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());ai(this.elem).show()},hide:function(){this.options.orig[this.prop]=ai.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(s){var c=aF(),F=true;if(s||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var w in this.options.curAnim){if(this.options.curAnim[w]!==true){F=false}}if(F){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;s=ai.data(this.elem,"olddisplay");this.elem.style.display=s?s:this.options.display;if(ai.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&ai(this.elem).hide();if(this.options.hide||this.options.show){for(var A in this.options.curAnim){ai.style(this.elem,A,this.options.orig[A])}}this.options.complete.call(this.elem)}return false}else{A=c-this.startTime;this.state=A/this.options.duration;s=this.options.easing||(ai.easing.swing?"swing":"linear");this.pos=ai.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||s](this.state,A,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};ai.extend(ai.fx,{tick:function(){for(var s=ai.timers,c=0;c
";s.insertBefore(c,s.firstChild);G=c.firstChild;A=G.firstChild;F=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=A.offsetTop!==5;this.doesAddBorderForTableAndCells=F.offsetTop===5;A.style.position="fixed";A.style.top="20px";this.supportsFixedPosition=A.offsetTop===20||A.offsetTop===15;A.style.position=A.style.top="";G.style.overflow="hidden";G.style.position="relative";this.subtractsBorderForOverflowNotVisible=A.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=s.offsetTop!==w;s.removeChild(c);ai.offset.initialize=ai.noop},bodyOffset:function(s){var c=s.offsetTop,w=s.offsetLeft;ai.offset.initialize();if(ai.offset.doesNotIncludeMarginInBodyOffset){c+=parseFloat(ai.curCSS(s,"marginTop",true))||0;w+=parseFloat(ai.curCSS(s,"marginLeft",true))||0}return{top:c,left:w}},setOffset:function(s,c,J){if(/static/.test(ai.curCSS(s,"position"))){s.style.position="relative"}var F=ai(s),G=F.offset(),w=parseInt(ai.curCSS(s,"top",true),10)||0,A=parseInt(ai.curCSS(s,"left",true),10)||0;if(ai.isFunction(c)){c=c.call(s,J,G)}J={top:c.top-G.top+w,left:c.left-G.left+A};"using" in c?c.using.call(s,J):F.css(J)}};ai.fn.extend({position:function(){if(!this[0]){return null}var s=this[0],c=this.offsetParent(),A=this.offset(),w=/^body|html$/i.test(c[0].nodeName)?{top:0,left:0}:c.offset();A.top-=parseFloat(ai.curCSS(s,"marginTop",true))||0;A.left-=parseFloat(ai.curCSS(s,"marginLeft",true))||0;w.top+=parseFloat(ai.curCSS(c[0],"borderTopWidth",true))||0;w.left+=parseFloat(ai.curCSS(c[0],"borderLeftWidth",true))||0;return{top:A.top-w.top,left:A.left-w.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||M.body;c&&!/^body|html$/i.test(c.nodeName)&&ai.css(c,"position")==="static";){c=c.offsetParent}return c})}});ai.each(["Left","Top"],function(s,c){var w="scroll"+c;ai.fn[w]=function(F){var G=this[0],A;if(!G){return null}if(F!==I){return this.each(function(){if(A=o(this)){A.scrollTo(!s?F:ai(A).scrollLeft(),s?F:ai(A).scrollTop())}else{this[w]=F}})}else{return(A=o(G))?"pageXOffset" in A?A[s?"pageYOffset":"pageXOffset"]:ai.support.boxModel&&A.document.documentElement[w]||A.document.body[w]:G[w]}}});ai.each(["Height","Width"],function(s,c){var w=c.toLowerCase();ai.fn["inner"+c]=function(){return this[0]?ai.css(this[0],w,false,"padding"):null};ai.fn["outer"+c]=function(A){return this[0]?ai.css(this[0],w,false,A?"margin":"border"):null};ai.fn[w]=function(A){var F=this[0];if(!F){return A==null?null:this}if(ai.isFunction(A)){return this.each(function(G){var J=ai(this);J[w](A.call(this,G,J[w]()))})}return"scrollTo" in F&&F.document?F.document.compatMode==="CSS1Compat"&&F.document.documentElement["client"+c]||F.document.body["client"+c]:F.nodeType===9?Math.max(F.documentElement["client"+c],F.body["scroll"+c],F.documentElement["scroll"+c],F.body["offset"+c],F.documentElement["offset"+c]):A===I?ai.css(F,w):this.css(w,typeof A==="string"?A:A+"px")}});aO.jQuery=aO.$=ai})(window); /** * Version: _V1528852527_ * Copyright 2011 Amazon.com, Inc., or its Affiliates. **/ (function e(b,g,d){function c(m,j){if(!g[m]){if(!b[m]){var i=typeof require=="function"&&require;if(!j&&i){return i(m,!0)}if(a){return a(m,!0)}var k=new Error("Cannot find module '"+m+"'");throw k.code="MODULE_NOT_FOUND",k}var h=g[m]={exports:{}};b[m][0].call(h.exports,function(l){var o=b[m][1][l];return c(o?o:l)},h,h.exports,e,b,g,d)}return g[m].exports}var a=typeof require=="function"&&require;for(var f=0;f1){clearTimeout(o.constants.TIMEOUT_ID)}var w=k.getWalletWidgets();if(typeof w!=="undefined"){for(var u=0;u0){var x=t.getSellerId();var z=i.constants.COUNTRY_CODE_TO_LANGUAGE_COUNTRY_MAP[k.COUNTRY_CODE];var A=q.isSupportedBrowser()?t.onClickHandler:q.notSupportedBrowserHandler(x,z);for(var w=0;w0){this.collector.addCounter("image-present-in-div");if(a.Utilities.isSellerInABTest(s.getCartOwnerId(),a.Tests.Default)){a.Utilities.bindButtonOnloadActions(E[0])}return}this.collector.addCounter("image-added-by-js");var D=this.buttonSettings;var v=this.getID();var w=this.buttonType===i.others.ButtonTypes.DONATION;var A=r.getButtonPath(D,this.buttonType===i.others.ButtonTypes.DONATION);if(!a.Utilities.isRebrandingABTest("BUTTON_REBRANDING",x)&&!w&&!a.Utilities.isSellerInRebrandingBlacklist(x)){A=s.getAPARebrandedButtonPath(D)}var C=(new Date()).getTime();var x=this.getSellerId();var y=this.buttonType;var z=function(){for(var F=0;F-1){return true}}return false}if(i()){f.LOADING_IMAGE_GIF=f.LOADING_IMAGE_LARGE_GIF}c.exports=f},{"./DynamicConfig.js":17}],14:[function(d,i,f){var c=d("./jquery");var m=d("./Constants");var p=d("./Utilities");var n=d("./InlineWidgetError");var g=d("./InlineWidget");var a=d("./EventTypes");var k=d("./Mediator").instance;var j=d("./LwaLogin");var h=d("./Config");var l=d("../widgets/MetricsCollector");var o="Form";function b(q){l.Collector.time("consentwidget-pre-render");this.type=m.others.WidgetTypes.Consent;g.call(this,q);var s;this.getConsentValue=function(){return s};this.setConsentValue=function(u){s=u};this.getConsentStatus=this.getConsentValue;this.onReady=q.onReady;this.onConsent=q.onConsent;var r=this.design.width;var t=this.design.height;k.register(this);c(this).bind(a.ON_CONSENT_WIDGET_READY,this,this.consentWidgetReadyEventHandler);c(this).bind(a.ON_CONSENT_STATUS_CHANGED,this,this.consentWidgetStatusChangeEventHandler);if(this.design.checkWidth){if(r===undefined){n.RaiseMissingParameterError(this,p.buildParamNameValueMap("design.width",r))}else{this.design.width=p.verifySize(r,undefined,m.constants.CONSENT_WIDGET.EDIT.min_width,m.constants.CONSENT_WIDGET.EDIT.max_width);n.RaiseOnErrorIfUndefined(this.design.width,m.constants.INVALID_PARAMETER_VALUE_MSG,p.buildParamNameValueMap("design.width",r),this)}}if(this.design.checkHeight){if(t===undefined){n.RaiseMissingParameterError(this,p.buildParamNameValueMap("design.height",t))}else{this.design.height=p.verifySize(t,undefined,m.constants.CONSENT_WIDGET.EDIT.min_height,m.constants.CONSENT_WIDGET.EDIT.max_height);n.RaiseOnErrorIfUndefined(this.design.height,m.constants.INVALID_PARAMETER_VALUE_MSG,p.buildParamNameValueMap("design.height",t),this)}}}b.prototype=p.createSubclass(g.prototype);b.prototype.constructor=b;b.prototype.consentWidgetReadyEventHandler=function(s){var q=s.data;var r=q.eventValue;this.setConsentValue(r);if(this.onReady!==undefined){this.onReady(q)}};b.prototype.consentWidgetStatusChangeEventHandler=function(s){var q=s.data;var r=q.eventValue;this.setConsentValue(r);if(this.onConsent!==undefined){this.onConsent(q)}};b.prototype.renderElements=function(){if(this.hasError!==undefined&&this.hasError){c("#"+this.locationID).empty();return false}var q=this;if(typeof j()!=="undefined"&&typeof j().Login!=="undefined"&&typeof j().Login.getClientId!=="undefined"&&typeof j().Login.getClientId()!=="undefined"){p.getAccessToken(q,q.renderConsent)}else{q.renderConsent(q,"")}};b.prototype.renderConsent=function(w,r){var v=w.getID()+"IFrame";var t=p.createIFrameString(v,w.design.width,w.design.height);var x=w.getID()+o;var q=h.WIDGET_ENDPOINT+h.CONSENT_URL_PATH;var s={action:"consentWidget",referringURL:window.top.location,cartOwnerId:w.getSellerId(),access_token:r,displayMode:m.others.DisplayModes.edit,agreementType:w.agreementType,widgetId:w.getID(),widgetWidth:w.design.width,widgetHeight:w.design.height,widgetDesignMode:w.design.designMode,widgetPadding:w.design.padding,browserWindowHeight:w.getBrowserWindowHeight(),coe:h.COE,env:h.ENV,ledgerCurrency:h.LEDGER_CURRENCY};if(typeof w.getContractId()!=="undefined"&&w.getContractId()!==null){s.contractId=w.getContractId()}if(w.error&&w.error.errorType){s.clientErrorType=w.error.errorType;s.clientErrorElementName=w.error.errorElementName;s.clientErrorElementValue=w.error.errorElementValue;s.clientErrorMessage=w.error.errorMessage}var u=p.createFormString(x,q,v,s);c("#"+x).remove();p.createWidgetContainer(w.locationID,w.getID(),w.design.width,w.design.height,t,w.type);p.createWidgetForm(w.locationID,w.getID(),w.design.width,w.design.height,u,x);if(m.constants.READY_TO_RENDER){l.Collector.timeEnd("consentwidget-pre-render");c("#"+x).submit()}};i.exports=b},{"../widgets/MetricsCollector":47,"./Config":13,"./Constants":16,"./EventTypes":18,"./InlineWidget":21,"./InlineWidgetError":22,"./LwaLogin":24,"./Mediator":25,"./Utilities":32,"./jquery":38}],15:[function(b,a,f){var c="AmazonPay: ";function d(g){if(typeof window.console==="undefined"){return}window.console.log(c+g)}a.exports={log:d}},{}],16:[function(a,g,b){var d=a("./Config");var i={};i.POPUP_WIN_WIDTH=520;i.POPUP_WIN_HEIGHT=670;i.POPUP_WIN_NAME="OffAmazonPaymentsPopupWindow";i.POPUP_LOADING_HTML_REBRANDING='
";i.POPUP_LOADING_HTML='
";i.BUTTON_URI="/gp/widgets/button";i.CartOwnerId="";i.HOSTED_PAYMENTS_URI="/gp/widgets/hosted/init";i.BRIDGE_IFRAME_NAME="OffAmazonPaymentsBridgeIframe";i.CONTRACT_FRAME_ID="OffAmazonPaymentsContractFrame";i.CONTRACT_FORM_ID="OffAmazonPaymentsContractForm";i.WIDGETID_PREFIX="OffAmazonPaymentsWidgets";i.WIDGETID_PARAM_NAME=";widgetId=";i.COUNTRY_CODE_TO_LANGUAGE_COUNTRY_MAP={US:"us",GB:"uk",DE:"de",IN:"uk",JP:"jp"};i.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX=d.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX;i.BUTTON_BASE_PATH_PREFIX=d.BUTTON_IMAGE_BASE_PATH_PREFIX;i.BUTTON_BASE_PATH_SUFFIX=d.BUTTON_IMAGE_BASE_PATH_SUFFIX;i.BUTTON_BASE_PATH=i.BUTTON_BASE_PATH_PREFIX+i.COUNTRY_CODE_TO_LANGUAGE_COUNTRY_MAP[d.COUNTRY_CODE]+i.BUTTON_BASE_PATH_SUFFIX;i.BUTTON_COLOR_SET=["orange","tan"];i.BUTTON_SIZE_SET=["medium","large","x-large"];i.BUTTON_BACKGROUND_SET=["dark","white"];i.BUTTON_LWA_COLOR_SET=["darkgray","lightgray","gold"];i.BUTTON_LWA_SIZE_SET=["small","medium","large","x-large"];i.BUTTON_LWA_TEXT_SET=["pwa","lwa","editorupdate","pay","a","login","hostedpayment","donate","dwa","amazonpay"];i.BUTTON_REBRANDED_IMAGE_NAME="button.png";i.BUTTON_LWA_TEXT_IMAGE_SET=["PwA.svg","LwA.png","EditOrUpdate.png","Pay.png","A.png","Login.png","PwA.svg","Donate.png","DwA.png"];i.BUTTON_DEFAULT_COLOR="orange";i.BUTTON_DEFAULT_SIZE="medium";i.BUTTON_DEFAULT_BACKGROUND="dark";i.BUTTON_PWA_BUTTONNAME="button.png";i.BUTTON_DEFAULT_COLOR_LWA="gold";i.BUTTON_DEFAULT_SIZE_LWA="medium";i.BUTTON_DEFAULT_TYPE="LwA";i.BUTTON_DEFAULT_TEXT=i.BUTTON_DEFAULT_TYPE+".png";i.SVG_NAMESPACE="http://www.w3.org/2000/svg";i.MEASURE_BUTTON_LATENCY_BASE_PATH_PREFIX=d.MEASURE_BUTTON_LATENCY_BASE_PATH_PREFIX;i.LATENCY_MEASURE_BUTTON_TYPE="PwA.png";i.APA_BUTTON_TYPE="apa";i.CLOUDFRONT_BUTTON_BASE_PATH=d.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX.replace(".net/",".net/default/");i.BUTTON_SVG_TEXT_SET=["login","lwa","pay","pwa","donate","dwa","editorupdate","a"];i.BUTTON_LWA_MULTILANGUAGE_SUPPORTED_TEXT_IMAGE_MAP={pwa:"PwA_25102014.png"};i.BUTTON_LWA_LANGUAGE_COUNTRY_MAP={"en-us":"us","en-gb":"uk","de-de":"de","fr-fr":"fr","it-it":"it","es-es":"es","ja-jp":"jp"};i.BUTTON_LWA_LANGUAGE_TO_REALM_MAP={"en-us":"en_GB","en-gb":"en_GB",en:"en_GB","fr-fr":"fr_FR",fr:"fr_FR","it-it":"it_IT",it:"it_IT","es-es":"es_ES",es:"es_ES","de-de":"de_DE",de:"de_DE","ja-jp":"ja_JP",ja:"ja_JP"};i.COUNTRY_CODE_TO_REALM_MAP={us:"en_US",gb:"en_GB",de:"de_DE",jp:"ja_JP"};i.REALM_TO_LANGUAGE_COUNTRY_MAP={en_US:"US",en_GB:"UK",de_DE:"DE",ja_JP:"JP",fr_FR:"FR",it_IT:"IT",es_ES:"ES"};i.REALM_TO_COUNTRY_CODE_MAP={en_US:"US",en_GB:"GB",de_DE:"DE",ja_JP:"JP",fr_FR:"FR",it_IT:"IT",es_ES:"ES"};i.FALLBACK_MULTILANGUAGE_BUYER_LANGUAGE_PREFERENCE={US:"en_US",GB:"en_GB",DE:"en_GB"};i.MULTILANGUAGE_ALLOWED_COUNTRY_CODES=["GB","DE"];i.MULTILANGUAGE_ALLOWED_SELLER_LANGUAGE_CODES=["en-gb","de-de","fr-fr","it-it","es-es"];i.MULTILANGUAGE_DEFAULT_BUTTON_IMAGE_SUB_PATH="lwa/gold/default/";i.TIMER_INTERVAL=100;i.IS_SANDBOX=d.IS_SANDBOX;i.CONTEXT=d.IS_SANDBOX==="true"?"sandbox":"live";i.READY_TO_RENDER=false;i.ADDRESS_WIDGET_PRESENT=false;i.TIMEOUT_ID=null;i.ADDRESS_WIDGET={READ:{min_width:290,max_width:600,default_width:400,min_height:150,max_height:400,default_height:185},EDIT:{min_width:280,max_width:600,default_width:400,min_height:228,max_height:400,default_height:228}};i.WALLET_WIDGET={READ:{min_width:290,max_width:600,default_width:400,min_height:150,max_height:400,default_height:185},EDIT:{min_width:280,max_width:600,default_width:400,min_height:228,max_height:400,default_height:228}};i.CONSENT_WIDGET={EDIT:{min_width:260,max_width:600,default_width:400,min_height:135,max_height:150,default_height:228}};i.DEFAULT_ADDRESSBOOK_PREF=true;i.UNIT_PX="PX";i.INVALID_PARAMETER_VALUE="InvalidParameterValue";i.INVALID_PARAMETER="InvalidParameter";i.INVALID_SMARTPHONE_PARAMETER_VALUE="InvalidParameterValueSmartPhone";i.INVALID_NON_SMARTPHONE_PARAMETER_VALUE="InvalidParameterValueNonSmartPhone";i.MISSING_PARAMETER="MissingParameter";i.MERCHANT_ABORTED="MerchantAborted";i.PARAM_NAME="${ParamName}";i.PARAM_VALUE="${ParamValue}";i.INVALID_VALUE_FOR_USE_AMAZON_ADDRESSBOOK="Invalid value specified for parameter useAmazonAddressBook";i.MISSING_SELLERID="Required parameter sellerId is not specified.";i.INVALID_PARAMETER_VALUE_MSG="Value "+i.PARAM_VALUE+" assigned to a parameter "+i.PARAM_NAME+" is not valid ";i.MISSING_PARAMETER_MSG="Required parameter "+i.PARAM_NAME+" is not specified.";i.MERCHANT_ABORTED_MSG="The error function was called in the hostedParametersProvider function.";i.PARAMETER_VALIDATION_FAILED_MSG="Parameter validation failed ";i.MERCHANTS_INVALID_PARAMETERS_MSG="Invalid parameters passed, please only provide parameters specified in the integration guide ";i.HOSTED_PAYMENTS_ACTION_NONE="None";i.HOSTED_PAYMENTS_ACTION_AUTHORIZE="Authorize";i.HOSTED_PAYMENTS_ACTION_AUTHORIZE_AND_CAPTURE="AuthorizeAndCapture";i.HOSTED_PAYMENTS_WIDGET_ID="";i.HOSTED_HTML_INTERFACE="HTML";i.HOSTED_JAVASCRIPT_INTERFACE="JavaScript";i.HOSTED_EXPERIENCE_TYPE_KEY="experienceType";i.HOSTED_INTERFACE_TYPE_KEY="interfaceType";i.RETURN_URL_MAX_LENGTH=256;i.CANCEL_RETURN_URL_MAX_LENGTH=256;i.CURRENCY_CODE_MAX_LENGTH=3;i.SELLER_NOTE_MAX_LENGTH=1024;i.SCOPE_MAX_LENGTH=256;i.SELLER_ORDER_ID_MAX_LENGTH=100;i.SELLER_STORE_NAME_MAX_LENGTH=100;i.PAYMENT_ACTION_MAX_LENGTH=20;i.LWA_CLIENT_ID_MAX_LENGTH=256;i.IS_DYNAMIC_BUTTON_USED=false;i.TIMEZONE_JUNE_OFFSET="junTimezoneOffset";i.TIMEZONE_JANUARY_OFFSET="janTimezoneOffset";i.TIMEZONE_JANUARY_REF_DATE=new Date(2010,0,1,0,0,0,0);i.TIMEZONE_JUNE_REF_DATE=new Date(2010,5,1,0,0,0,0);i.AMAZON_CREATED_BUTTON_IMAGE_CSS_CLASS="amazonpay-button-inner-image";var j={Button:"Button",AddressBook:"AddressBook",Wallet:"Wallet",Consent:"Consent"};var c={BIG_FISH_CHECKOUT:"paymentsOnlyProduct",DONATION:"donationProduct",HOSTED:"hostedPayment",HOSTED_DONATION:"hostedDonation"};var f={CartPage:"CartPage",DetailPage:"DetailPage"};var h={read:"read",edit:"edit"};var k={ShowAll:"Default",Default:"Default"};g.exports={config:{POLL_FOR_EVENTS:true},constants:i,dynamic_config_keys:{ENABLE_REBRANDING_BUTTON:"enableRebrandingButton",ENABLE_ACCOUNT_STATUS_CHECKING:"enableAccountStatusChecking",ENABLE_BUTTON_ABTESTING:"enableButtonABTesting",ENABLE_ABTEST_V2:"enableABTestV2",USE_STATIC_BRIDGE:"useStaticBridge",STATIC_BRIDGE_HOST:"staticBridgeHost",BUTTON_ABTESTING_BLACKLIST:"rebrandingMerchantBlackList",NEW_WIDGETS_ENABLED:"newWidgetsABTestingEnabled",NEW_WIDGETS_ALWAYS_SHOW_OLD:"alwaysShowOldWidgetsForMerchants",NEW_WIDGETS_ALWAYS_SHOW_NEW:"alwaysShowNewWidgetsForMerchants",NEW_WIDGETS_ABTESTING_FOR_ALL:"abtestingNewWidgetsForAll",NEW_WIDGETS_ABTESTING_MERCHANTS:"newWidgetsABTestingMerchants",SERVE_BUTTONS_FROM_CLOUDFRONT:"serveButtonsFromCloudFront",HIGHRES_BUTTON_IMAGE_USE_SRCSET:"highResButtonImageUseSrcset"},others:{WidgetTypes:j,ButtonTypes:c,CartOrigins:f,DisplayModes:h,PaymentInstrumentsDisplayOptions:k}}},{"./Config":13}],17:[function(b,h,c){var d;var k;var j="DynamicConfig";window.OffAmazonPayments;function a(m){if(!window.OffAmazonPayments){return null}var l=window.OffAmazonPayments[j];var n;if(typeof l!=="object"){return null}else{n=l[m];if(n===undefined){return null}else{return n}}}function f(l){return a(l)===true}function g(l){return Object.prototype.toString.call(l)==="[object Array]"}function i(n,m){var l=a(n);return g(l)&&l.indexOf(m)>=0}h.exports={get:a,valueForKeyIsTrue:f,valueInArray:i}},{}],18:[function(b,a,c){var d={Widgets:{}};d.Widgets.EventTypes={DOCUMENT_READY:"OffAmazonPayments.DocumentReadyEvent",REFRESH:"apay-refresh",WIDGET_REFRESH:"apay-widgetrefresh;widgetId=",EXPRESS_CHK_ONAUTHORIZE:"apay-pcId=",ON_ADDRESS_SELECT_PRE:"apay-addressselectpre;widgetId=",ON_ADDRESS_SELECT:"apay-addressselect;widgetId=",ON_PAYMENT_SELECT:"apay-paymentselect;widgetId=",ON_CLOSE:"apay-close;widgetId=",ON_PPH_WIDGET_CLOSE:"apay-close",PRIME_WIDGET_RESIZE:"apay-prime-resize;widgetId=",ON_ERROR:"apay-OffAmazonPayments_mec_",REDIRECT_URL:"apay-redirectUrl;widgetId=",CHANGE_HEIGHT:"apay-changeHeight",ON_CONSENT_WIDGET_READY:"apay-onConsentWidgetReady=",ON_CONSENT_STATUS_CHANGED:"apay-onConsentStatusChanged=",ON_PAYMENT_AUTHORIZATION:"apay-onPaymentAuthorization"};a.exports=d.Widgets.EventTypes},{}],19:[function(g,f,i){var h=g("../widgets/MetricsCollector");var c=g("./DynamicConfig");var d=g("./Constants");function b(j,m,l){function p(u){if(u){var x=new h.Collector(m);var v=Math.round(window.devicePixelRatio);var w=u.src;var t=w.split(".png")[0];var s=t+"_"+v+"x.png";var q=(l.color)?l.color:"default";u.setAttribute("devicePixelRatio",v);if(u&&u.clientWidth===0&&u.clientHeight===0){var y=new Image();y.onload=function(){u.setAttribute("width",y.width);u.setAttribute("height",y.height)};y.src=w}var r=new Image();r.onload=function(){if(u&&u.clientWidth!==0&&u.clientHeight!==0){u.style.setProperty("width",u.clientWidth+"px");u.style.setProperty("height",u.clientHeight+"px")}u.onload=null;u.setAttribute("data-metric-tags","highres");u.setAttribute("src",s)};r.onerror=function(){x.addCounter("high-res-button-not-found",[l.type,l.size,q,l.language]);x.publish()};r.src=s}}function n(r){var s=Math.round(window.devicePixelRatio);var u=r.src.split(".png")[0];var t=u+"_"+s+"x.png";var q=new Image();q.onload=function(){r.onload=null;r.setAttribute("srcset",t+" "+s+"x")};q.src=t}var k=c.valueForKeyIsTrue(d.dynamic_config_keys.HIGHRES_BUTTON_IMAGE_USE_SRCSET)?n:p;var o=a();if(j&&o&&j.clientWidth===0&&j.clientHeight===0){j.onload=function(){k(j)}}else{if(j&&o){k(j)}else{return false}}}function a(){if(window.matchMedia){var k=window.matchMedia("only screen and (-moz-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 2dppx)");var j=Math.round(window.devicePixelRatio);return(k&&k.matches||(j>1))}return false}f.exports={useRetinaImage:b,isRetinaDisplay:a}},{"../widgets/MetricsCollector":47,"./Constants":16,"./DynamicConfig":17}],20:[function(d,c,g){var h={jQuery:d("./jquery")};var b=d("../core/Constants");var a=d("../core/Utilities");var f=d("./Config");h.HostedPayments={};h.HostedPayments.done=function(m){try{h.HostedPayments.validate(m)}catch(j){return false}var i=f.WIDGET_ENDPOINT+b.constants.HOSTED_PAYMENTS_URI;m.action="hostedInit";m.cartOwnerId=m.sellerId;var l=Math.floor((Math.random()*1000000000)+1).toString();var k=a.createFormString(l,i,"_self",m);h.jQuery("#"+l).remove();h.jQuery("body").append(k);h.jQuery("#"+l).submit()};h.HostedPayments.isHostedPaymentsInput=function(i){return i===b.others.ButtonTypes.HOSTED||h.HostedPayments.isHostedDonation(i)};h.HostedPayments.isHostedDonation=function(i){return i===b.others.ButtonTypes.HOSTED_DONATION};h.HostedPayments.inputTypeToExperienceTypeMap={hostedPayment:"ExpressPayment",hostedDonation:"ExpressDonation"};h.HostedPayments.validate=function(z){var H="sellerId";var q="amount";var C="returnURL";var F="cancelReturnURL";var l="accessKey";var n="signature";var u="lwaClientId";var D="currencyCode";var v="sellerNote";var A="scope";var I="sellerOrderId";var w="paymentAction";var k="shippingAddressRequired";var t=b.constants.HOSTED_EXPERIENCE_TYPE_KEY;var r=b.constants.HOSTED_INTERFACE_TYPE_KEY;var j;if(o()){y();throw h.Widgets.Validation.validationException()}j=i();if(j.length>0){B(j);throw h.Widgets.Validation.validationException()}j=x();if(j.length>0){G(j);throw h.Widgets.Validation.validationException()}if(isNaN(z.amount)||Number(z.amount)<=0||Number(z.amount)>1000000){E(z.amount,q);throw h.Widgets.Validation.validationException()}if(!s()){E(z.paymentAction,w);throw h.Widgets.Validation.validationException()}if(!a.isEmptyOrUndefined(z.shippingAddressRequired)&&!a.isBoolean(z.shippingAddressRequired)){E(z.shippingAddressRequired,k);throw h.Widgets.Validation.validationException()}function i(){var J=new Array(H,q,C,l,n,u);var M=[];for(var L=0;LL){K.push(J)}}function o(){var J=new Array(H,q,C,F,l,n,u,D,v,A,I,w,k,t,r);for(var K in z){if(h.jQuery.inArray(K,J)===-1){return true}}}function s(){var J=new Array(b.constants.HOSTED_PAYMENTS_ACTION_NONE,b.constants.HOSTED_PAYMENTS_ACTION_AUTHORIZE,b.constants.HOSTED_PAYMENTS_ACTION_AUTHORIZE_AND_CAPTURE);return a.isEmptyOrUndefined(z.paymentAction)||h.jQuery.inArray(z.paymentAction,J)!==-1}function E(L,K){var J="Value '"+L+"' assigned to a parameter '"+K+"' is not valid";p(b.constants.INVALID_PARAMETER_VALUE,J)}function B(K){var J="Required parameters missing : "+K;p(b.constants.MISSING_PARAMETER,J)}function G(K){var J="Parameters '"+K+"' exceeds the maximum allowed length";p(b.constants.INVALID_PARAMETER_VALUE,J)}function y(){p(b.constants.INVALID_PARAMETER,b.constants.MERCHANTS_INVALID_PARAMETERS_MSG)}function p(K,J){a.sendOnErrorCallbackMessage(K,J,b.constants.HOSTED_PAYMENTS_WIDGET_ID)}};c.exports=h.HostedPayments},{"../core/Constants":16,"../core/Utilities":32,"./Config":13,"./jquery":38}],21:[function(c,i,f){var b=c("./jquery");var p=c("./Widget");var l=c("./Constants");var n=c("./Utilities");var d=c("./WidgetDesign");var k=c("./InlineWidgetError");var a=c("./EventTypes");var h=c("./CheckoutWidget");var j=c("./../widgets/MetricsCollector");var m="Form";var o={SAFARI:"safari"};function g(q){p.call(this,q);this.onErrorCallback=q.onError;if(q.scope){this.scope=q.scope;var r=new j.Collector(q.sellerId);r.addCounter("lwa-use-scopes-param",this.type);r.publish()}b(this).bind(a.ON_ERROR,this,h.prototype.onErrorCallbackHandler);var u=q.amazonOrderReferenceId||q.amazonBillingAgreementId||null;var s=l.others.DisplayModes.edit;if(typeof(q.displayMode)!=="undefined"){switch(q.displayMode.toLowerCase()){case l.others.DisplayModes.read.toLowerCase():s=l.others.DisplayModes.read;break;case l.others.DisplayModes.edit.toLowerCase():s=l.others.DisplayModes.edit;break;default:this.error=new k(l.constants.INVALID_PARAMETER_VALUE,null,"displayMode",q.displayMode)}}var v=l.others.PaymentInstrumentsDisplayOptions.ShowAll;this.getDisplayMode=function(){return s};this.getPaymentInstrumentsDisplayOptions=function(){return v};this.design=new d(q.design,this);this.agreementType=(!n.isEmptyOrUndefined(q.agreementType))?q.agreementType:"";this.getContractId=function(){return u};this.setContractId=function(w){u=w};this.onOrderReferenceCreate=q.onOrderReferenceCreate;this.onBillingAgreementCreate=q.onBillingAgreementCreate;this.onReady=q.onReady;var t=q.presentmentCurrency;this.getPresentmentCurrency=function(){return t};this.setPresentmentCurrency=function(w){t=w;return this};if(typeof this.onOrderReferenceCreate==="function"){b(this).bind(a.EXPRESS_CHK_ONAUTHORIZE,this,this.onOrderReferenceCreateHandler)}if(typeof this.onBillingAgreementCreate==="function"){b(this).bind(a.EXPRESS_CHK_ONAUTHORIZE,this,this.onBillingAgreementCreateHandler)}if(typeof this.onReady==="function"){b(this).bind(a.EXPRESS_CHK_ONAUTHORIZE,this,this.onReadyHandler)}b(this).bind(a.REFRESH,this,this.refreshEventHandler);b(this).bind(a.WIDGET_REFRESH,this,this.widgetRefreshEventHandler);b(this).bind(a.CHANGE_HEIGHT,this,this.widgetChangeHeightEventHandler)}g.prototype=n.createSubclass(p.prototype);g.prototype.constructor=g;g.prototype.refreshEventHandler=function(){var s=this.getID()+m;var r=this.getID()+"IFrame";if(b("#"+r).length!==0){b("#"+r).remove()}var q=n.createIFrameString(r,this.design.width,this.design.height);b("#"+this.getID()).append(q);b("#"+s).submit()};g.prototype.hideEventHandler=function(){var q=this.getID()+"IFrame";n.hide(q)};g.prototype.widgetRefreshEventHandler=function(s){var q=s.data;var r=q.eventValue;if(this.getID()===r){this.refreshEventHandler()}};g.prototype.widgetChangeHeightEventHandler=function(t){var q=t.data;var u=q.eventValue.split(";");var r=u[0];var s=u[1];if(this.getID()===r){this.changeHeightEventHandler(s)}};g.prototype.onOrderReferenceCreateHandler=function(s){b(this).unbind(a.EXPRESS_CHK_ONAUTHORIZE);var q=s.data.eventValue;var r={getAmazonOrderReferenceId:function(){return q}};this.onOrderReferenceCreate(r)};g.prototype.onBillingAgreementCreateHandler=function(r){b(this).unbind(a.EXPRESS_CHK_ONAUTHORIZE);var q=r.data.eventValue;var s={getAmazonBillingAgreementId:function(){return q}};this.onBillingAgreementCreate(s)};g.prototype.onReadyHandler=function(s){b(this).unbind(a.EXPRESS_CHK_ONAUTHORIZE);var r=s.data.eventValue;var t={};var q=function(){t.getAmazonBillingAgreementId=function(){return r};t.getAmazonOrderReferenceId=function(){return r};return t}();this.onReady(q)};g.prototype.getBrowserWindowHeight=function(){var q=b(window).height();if(navigator.userAgent.match(/OS [0-9](_\d)+ like Mac OS X/i)&&navigator.userAgent.toLowerCase().indexOf(o.SAFARI)>-1){q=q+60}return q};g.prototype.changeHeightEventHandler=function(t){var s=this.getID();var q=s+"IFrame";var v=s+m;var u=t*1+2;b("#"+s).height(u+"px");b("#"+q).height(t+"px");document.getElementById(q).height=t;b("#"+v).children("input:hidden[name='widgetHeight']").val(t);if(t>=document.body.clientHeight){var r=b("#"+s).offset().top;b(window).scrollTop(r)}};i.exports=g},{"./../widgets/MetricsCollector":47,"./CheckoutWidget":12,"./Constants":16,"./EventTypes":18,"./InlineWidgetError":22,"./Utilities":32,"./Widget":35,"./WidgetDesign":36,"./jquery":38}],22:[function(d,c,f){var g={Widgets:{InlineWidget:{}}};var b=d("./Constants");var a=d("./Utilities");g.Widgets.InlineWidget.Error=function(k,i,j,h){this.errorType=k;this.errorMessage=i;this.errorElementName=j;this.errorElementValue=h};g.Widgets.InlineWidget.Error.SetErrorIfParameterExists=function(k,m,h,i,l){if(m){var j=b.constants.INVALID_PARAMETER_VALUE;if(l==="smartphone"){j=b.constants.INVALID_SMARTPHONE_PARAMETER_VALUE}else{if(l==="nonSmartphone"){j=b.constants.INVALID_NON_SMARTPHONE_PARAMETER_VALUE}}i.error=new g.Widgets.InlineWidget.Error(j,h,k,m)}};g.Widgets.InlineWidget.Error.RaiseOnError=function(h,k,i,j){if(!j){j=b.constants.INVALID_PARAMETER_VALUE}h=a.formatMsg(h,k);a.sendOnErrorCallbackMessage(j,h,i.getID());i.hasError=true};g.Widgets.InlineWidget.Error.RaiseOnErrorIfUndefined=function(j,h,l,i,k){if(j===undefined){g.Widgets.InlineWidget.Error.RaiseOnError(h,l,i,k)}};g.Widgets.InlineWidget.Error.RaiseMissingParameterError=function(i,h){g.Widgets.InlineWidget.Error.RaiseOnError(b.constants.MISSING_PARAMETER_MSG,h,i,b.constants.MISSING_PARAMETER)};g.Widgets.InlineWidget.Error.isMissingParameter=function(i,h,j){if(a.isEmptyOrUndefined(h)){j.error=new g.Widgets.InlineWidget.Error(b.constants.MISSING_PARAMETER,b.constants.MISSING_PARAMETER_MSG,i,h);return true}return false};c.exports=g.Widgets.InlineWidget.Error},{"./Constants":16,"./Utilities":32}],23:[function(h,k,p){var w=h("./Utilities");var s=h("../widgets/MetricsCollector");var n=h("./Constants");var q=h("./Config");var x=h("./ZeroTime");var m=h("./ABTestingLoginConsent");var a=false;var d=[];function i(y){if(typeof y==="undefined"||y.type===undefined){return"undefined_button_type"}return y.type.toLowerCase()}function g(B,D,z,C,A){A=new s.Collector(z);u(A);A.addButtonInfoData(s.ProductTypes.LPA,s.PageActions.BUTTON_RENDER,B.type,z);var F=i(B);var H=C?[s.Tags.DYNAMIC,F]:[F];A.addCounter("lpa-buttonrender",H);if(C){l(A,z)}if(w.isSellerHidingButton(D)){A.addCounter("lpa-seller-hiding-button")}var E=B.color||n.constants.BUTTON_DEFAULT_COLOR_LWA;var G=B.size||n.constants.BUTTON_DEFAULT_SIZE_LWA;var y=B.type||n.constants.BUTTON_DEFAULT_TYPE;A.addCounter(E);A.addCounter(G);A.addCounter(y);A.addCounter(E.toLowerCase()+"_"+G.toLowerCase()+"_"+y.toLowerCase());w.addLpaButtonAttributesToMetrics(D,B,A);j(A,z,B);r(A,B);A.publish()}function l(z,y){z.addInfoOrEntry("additional-request-data","|svg-button:"+y,"info");z.addInfoOrEntry("svg-button","lpa-buttonrender-dynamic-"+y,"info")}function r(z,y){z.addInfoOrEntry("additional-request-data","|is-bml-merchant:"+w.isValidLanguagePassedBySeller(y),"info")}function j(A,z,y){var C=w.getLanguageForSeller(z,y);A.addInfoOrEntry("additional-request-data","|language:"+C,"info");if(w.isSellerAllowedForMultiLanguage(z,y)){var B=w.getBrowserLanguagePreference();if(w.isValidLanguagePassedBySeller(y)){A.addCounter("lpa-buttonrender-in-seller-language")}else{if(w.isBrowserLanguageSupported(B)){A.addCounter("lpa-buttonrender-in-browser-language")}else{A.addCounter("lpa-buttonrender-in-default-language")}}A.addCounter("lpa-buttonrender-in-"+C)}}function t(){while(d.length>0){var y=d.pop();if(typeof y==="function"){y()}}}function f(A,y,C){var z="C";if(w.readCookie("amazon-pay-abtesting-new-widgets")==="true"){z="T1"}var B=new OffAmazonPayments.Metrics.Collector(A);B.addInfoOrEntry("weblab-name","NEW_WIDGETS","info");B.addInfoOrEntry("weblab-treatment",z,"info");B.addInfoOrEntry("merchant-id",A,"info");B.addCounter(y);if(C){B.safePublish()}else{B.publish()}}function b(z,y,B){var D=m.getLoginConsentWeblabTreatmentValue();var C=m.getLwaAuiMigrationWeblabTreatmentValue();var A=new s.Collector(z);A.addInfoOrEntry("weblab-name","LWA_LOGIN_CONSENT_CUSTOMIZATION","info");A.addInfoOrEntry("weblab-treatment",D,"info");A.addInfoOrEntry("merchant-id",z,"info");A.addCounter(y);if(D==="T1"){A.addInfoOrEntry("weblab-name","LWA_AUI_MIGRATION","info");A.addInfoOrEntry("weblab-treatment",C,"info");A.addInfoOrEntry("merchant-id",z,"info");A.addCounter(y)}if(B){A.safePublish()}else{A.publish()}}function o(z,y){if(a===true){f(z,y,false)}else{d.push(function(){return f(z,y,false)})}}function c(){a=true}var v=h("./ResourceTiming");function u(y){y.addTiming("widgets-js-loading",x(),q.getWidgetCoreExecutionEndTime());v.logWidgetsJSLoadingTime(y)}k.exports={getLpaButtonType:i,publishMetricsForLPAButton:g,publishMetricsForLPAButtonLanguage:j,addWidgetsLoadLatencyMetric:u,queueOrPublishMetrics:o,publishPendingMetrics:t,publishButtonMetricsForNewWidgets:f,publishButtonMetricsForLoginConsentABTest:b,setWeblabDone:c}},{"../widgets/MetricsCollector":47,"./ABTestingLoginConsent":2,"./Config":13,"./Constants":16,"./ResourceTiming":29,"./Utilities":32,"./ZeroTime":37}],24:[function(b,a,c){a.exports=function(){return window.amazon}},{}],25:[function(c,b,d){var f={jQuery:c("./jquery"),Widgets:{}};var a=c("./Constants");f.Widgets.Mediator=function(){this.widgetCount=0;this.registry={}};f.Widgets.Mediator.Reset=function(){f.Widgets.mediator.widgetCount=0;f.Widgets.mediator.registry={}};f.Widgets.Mediator.prototype.generateUniqWidgetID=function(){return this.widgetCount++};f.Widgets.Mediator.prototype.getNumWidgetCount=function(){return this.widgetCount};f.Widgets.Mediator.prototype.register=function(g){this.registry[g.getID()]=g};f.Widgets.Mediator.prototype.notifyListeners=function(i){for(var h in this.registry){if(this.registry.hasOwnProperty(h)){var g=this.registry[h];g.eventValue=i.eventValue;g.error=i.error;f.jQuery(g).trigger(i.eventName,g)}}};f.Widgets.Mediator.prototype.getWalletWidgets=function(){return this.getWidgetsHelper(a.others.WidgetTypes.Wallet)};f.Widgets.Mediator.prototype.getAddressWidgets=function(){return this.getWidgetsHelper(a.others.WidgetTypes.AddressBook)};f.Widgets.Mediator.prototype.getWidgetsHelper=function(j){var i=[];for(var h in this.registry){if(this.registry.hasOwnProperty(h)){var g=this.registry[h];if(g.type===j){i.push(g)}}}return i};f.Widgets.mediator=new f.Widgets.Mediator();b.exports={Mediator:f.Widgets.Mediator,instance:f.Widgets.mediator}},{"./Constants":16,"./jquery":38}],26:[function(d,i,f){var m=d("./Constants");var c=d("./jquery");var o=d("./Utilities");var n=d("./InlineWidgetError");var g=d("./InlineWidget");var a=d("./EventTypes");var k=d("./Mediator").instance;var j=d("./LwaLogin");var h=d("./Config");var l=d("../widgets/MetricsCollector");var b="spaPaymentAuthorizationWidget";var q={min_width:400,max_width:600,default_width:400,min_height:400,max_height:500,default_height:400};function p(r){l.Collector.time("paymentAuthorizationWidget-pre-render");g.call(this,r);this.type=m.others.WidgetTypes.PaymentAuthorization;this.onPaymentAuthorization=r.onPaymentAuthorization;var s=this.design.width;var t=this.design.height;k.register(this);if(this.design.checkWidth){if(s===undefined){n.RaiseMissingParameterError(this,o.buildParamNameValueMap("design.width",s))}else{this.design.width=o.verifySize(s,undefined,q.min_width,q.max_width);n.RaiseOnErrorIfUndefined(this.design.width,m.constants.INVALID_PARAMETER_VALUE_MSG,o.buildParamNameValueMap("design.width",s),this)}}if(this.design.checkHeight){if(t===undefined){n.RaiseMissingParameterError(this,o.buildParamNameValueMap("design.height",t))}else{this.design.height=o.verifySize(t,undefined,q.min_height,q.max_height);n.RaiseOnErrorIfUndefined(this.design.height,m.constants.INVALID_PARAMETER_VALUE_MSG,o.buildParamNameValueMap("design.height",t),this)}}c(this).bind(a.ON_PAYMENT_AUTHORIZATION,this,this.onPaymentAuthorizationHandler)}p.prototype=o.createSubclass(g.prototype);p.prototype.constructor=p;p.prototype.onPaymentAuthorizationHandler=function(t){var r=t.data;var s=r.eventValue.widgetID;if(this.getID()===s){if(this.onPaymentAuthorization!==undefined){this.onPaymentAuthorization(r)}}};p.prototype.renderElements=function(){if(this.hasError!==undefined&&this.hasError){c("#"+this.locationID).empty();return false}var r=this;o.setLwaSandboxMode();if(typeof j()!=="undefined"&&typeof j().Login!=="undefined"&&typeof j().Login.getClientId!=="undefined"&&typeof j().Login.getClientId()!=="undefined"){o.getAccessToken(r,r.renderPaymentAuthorization)}else{r.renderPaymentAuthorization(r,"")}};p.prototype.renderPaymentAuthorization=function(x,s){var w=x.getID()+"IFrame";var u=o.createIFrameString(w,x.design.width,x.design.height);var y=x.getID()+"Form";var r=h.WIDGET_ENDPOINT+h.PAYMENT_AUTHORIZATION_URL_PATH;var t={action:b,referringURL:window.top.location,cartOwnerId:x.getSellerId(),marketplaceSellerId:x.getMarketplaceSellerId(),access_token:s,agreementType:x.agreementType,displayMode:x.getDisplayMode(),widgetId:x.getID(),widgetWidth:x.design.width,widgetHeight:x.design.height,widgetDesignMode:x.design.designMode,widgetPadding:x.design.padding,browserWindowHeight:x.getBrowserWindowHeight(),paymentInstrumentsDisplayOptions:x.getPaymentInstrumentsDisplayOptions(),clientId:o.getClientId()};if(typeof x.getContractId()!=="undefined"&&x.getContractId()!==null){t.contractId=x.getContractId()}n.isMissingParameter("sellerId",x.getSellerId(),x);if(x.error&&x.error.errorType){t.clientErrorType=x.error.errorType;t.clientErrorElementName=x.error.errorElementName;t.clientErrorElementValue=x.error.errorElementValue;t.clientErrorMessage=x.error.errorMessage}var v=o.createFormString(y,r,w,t);c("#"+y).remove();o.createWidgetContainer(x.locationID,x.getID(),x.design.width,x.design.height,u,x.type);o.createWidgetForm(x.locationID,x.getID(),x.design.width,x.design.height,v,y);if(m.constants.READY_TO_RENDER){l.Collector.timeEnd("paymentAuthorizationWidget-pre-render");c("#"+y).submit()}};i.exports=p},{"../widgets/MetricsCollector":47,"./Config":13,"./Constants":16,"./EventTypes":18,"./InlineWidget":21,"./InlineWidgetError":22,"./LwaLogin":24,"./Mediator":25,"./Utilities":32,"./jquery":38}],27:[function(d,c,f){var g={};var h=g.hasOwnProperty;function a(j,k){if(!h.call(g,j)){g[j]=[]}var i=g[j].push(k)-1;return{remove:function(){delete g[j][i]}}}function b(l){if(!h.call(g,l)){return false}var k=Array.prototype.slice.call(arguments,1);var j=g[l].length;var n;for(var m=0;m0&&m.indexOf("Widgets.js")>0}function j(){try{if(typeof window.performance==="undefined"){return null}var p=window.performance.getEntries(),m=p.length,n=0,o;for(;n0?this.taskQueue.shift():null};d.Widgets.TaskQueue.prototype.isEmpty=function(){return(this.taskQueue.length===0)};d.Widgets.Task=function(){};d.Widgets.Task.prototype.execute=function(){};d.Widgets.taskQueue=new d.Widgets.TaskQueue();a.exports={TaskQueue:d.Widgets.TaskQueue,getTaskQueue:function(){return d.Widgets.taskQueue},setTaskQueue:function(f){d.Widgets.taskQueue=f},Task:d.Widgets.Task}},{}],32:[function(i,k,m){var c={Widgets:{}};var r=i("./jquery");var l=i("./Constants");var j=i("./EventTypes");var d=i("./Mediator").instance;var b=i("./LwaLogin");var n=i("./TaskQueue");var p=i("./Config");var a=i("./SessionStabilizer");var v=i("./DynamicConfig");var o="never";var q={ERROR:"ERROR"};var s={WINDOW_ALREADY_OPEN:"Error caught in popup window already opened",IS_INVALID_DOCUMENT:"Error caught in isValidDocInclusion"};var h={LOADED:"loaded",COMPLETE:"complete"};c.Widgets.Mobile=(function(){var x=navigator.userAgent.toLowerCase();var w=new Array("iphone","ipod","series60","symbian","android","windows ce","blackberry","palm");return{isMobile:function(){for(var z=0;z-1){return true}}return false}}})();var t=function(){};t.isIE=function(){return navigator.userAgent.match(/Trident\/|MSIE|Edge\//i)?true:false};c.Widgets.Browser=function(){};c.Widgets.Browser.isFF=function(){return navigator.userAgent.match(/Firefox/i)};t.isWin=function(){return navigator.userAgent.match(/Windows/i)};t.isiOS=function(){return(navigator.userAgent.toLowerCase().match(/(ipad|iphone|ipod)/g)?true:false)};t.getClientId=function(){if(typeof b()!=="undefined"&&typeof b().Login!=="undefined"&&typeof b().Login.getClientId!=="undefined"&&typeof b().Login.getClientId()!=="undefined"){return b().Login.getClientId()}return null};t.isAmazonPaymentsButtonImage=function(w){return(w.indexOf(p.WIDGET_ENDPOINT+l.constants.BUTTON_URI)===0||w.indexOf(l.constants.BUTTON_BASE_PATH_PREFIX)===0||w.indexOf(l.constants.MEASURE_BUTTON_LATENCY_BASE_PATH_PREFIX)===0||w.indexOf(l.constants.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX)===0)||w.indexOf(l.constants.CLOUDFRONT_BUTTON_BASE_PATH)===0};t.getLanguageForSeller=function(x,w){if(t.isSellerAllowedForMultiLanguage(x,w)){if(t.isValidLanguagePassedBySeller(w)){return l.constants.BUTTON_LWA_LANGUAGE_TO_REALM_MAP[w.language.toLowerCase()]}var y=t.getBrowserLanguagePreference();if(t.isBrowserLanguageSupported(y)){return t.getBrowserLanguageToInternalLanguageMapping(y)}return l.constants.FALLBACK_MULTILANGUAGE_BUYER_LANGUAGE_PREFERENCE[p.COUNTRY_CODE]}return l.constants.COUNTRY_CODE_TO_REALM_MAP[p.COUNTRY_CODE.toLowerCase()]};t.isValidLanguagePassedBySeller=function(w){if(!t.isEmptyOrUndefined(w.language)&&t.isElementInArray(w.language.toLowerCase(),l.constants.MULTILANGUAGE_ALLOWED_SELLER_LANGUAGE_CODES)){return true}return false};t.isBrowserLanguageSupported=function(w){if(!t.isEmptyOrUndefined(w)&&(w in l.constants.BUTTON_LWA_LANGUAGE_TO_REALM_MAP||w.substr(0,2) in l.constants.BUTTON_LWA_LANGUAGE_TO_REALM_MAP)){return true}return false};t.getLanguageCountryForSeller=function(x,w){return l.constants.REALM_TO_LANGUAGE_COUNTRY_MAP[t.getLanguageForSeller(x,w)]};t.isSellerBlacklistedForMultiLanguage=function(w){var x=[];if(!t.isEmptyOrUndefined(p.MULTI_LANGUAGE_SELLER_BLACKLIST)){x=t.stringToArray(p.MULTI_LANGUAGE_SELLER_BLACKLIST)}return t.isElementInArray(w,x)};t.isSellerWhitelistedForNAAccountDomain=function(w){var x=[];if(!t.isEmptyOrUndefined(p.NA_ACCOUNT_DOMAIN_WHITELISTED_SELLERS)){x=t.stringToArray(p.NA_ACCOUNT_DOMAIN_WHITELISTED_SELLERS)}return t.isElementInArray(w,x)};t.isSellerAllowedForMultiLanguage=function(x,w){if(!t.isSellerBlacklistedForMultiLanguage(x)&&!t.isSellerAllowed(x,w)&&t.isElementInArray(p.COUNTRY_CODE,l.constants.MULTILANGUAGE_ALLOWED_COUNTRY_CODES)){return true}return false};t.getNavigatorLanguages=function(){return navigator.languages};t.getBrowserLanguagePreference=function(){var y;var w=t.getNavigatorLanguages();if(!t.isEmptyOrUndefined(w)){for(var x=0;x0){x+=w}window.top.location.replace(x)};t.removeFromHash=function(x,w){x=decodeURIComponent(x);x=x.replace(w,"");x=encodeURIComponent(x);return x};t.pollTaskQueue=function(){while(!n.getTaskQueue().isEmpty()){var w=n.getTaskQueue().pop();if(typeof(w.execute)==="function"){w.execute()}}window.setTimeout(t.pollTaskQueue,l.constants.TIMER_INTERVAL)};t.pollEvents=function(){var x=window.top.location.hash;if(!x){return}x=x.replace(/#/,"");var w=t.parseMessage(x);if(typeof(w.stringToBeRemoved)!=="undefined"){x=t.removeFromHash(x,w.stringToBeRemoved);t.setNewHash(x);d.notifyListeners(w)}};t.handleMessage=function(x){if(typeof(x)==="undefined"||x.origin!==p.WIDGET_ENDPOINT){return}var y=x.data;if(typeof(y)==="undefined"){return}var w=t.parseMessage(y);if(typeof(w.eventName)!=="undefined"){d.notifyListeners(w)}};t.parseMessage=function(H){var B={};var G;var E;var A;if(H.indexOf(j.EXPRESS_CHK_ONAUTHORIZE,0)>=0){A=H.indexOf(j.EXPRESS_CHK_ONAUTHORIZE,0);var x=H.substring(A+j.EXPRESS_CHK_ONAUTHORIZE.length);B.eventName=j.EXPRESS_CHK_ONAUTHORIZE;B.eventValue=x;B.stringToBeRemoved=j.EXPRESS_CHK_ONAUTHORIZE+x}else{if(H.indexOf(j.REFRESH,0)>=0){B.eventName=j.REFRESH;B.eventValue="";B.stringToBeRemoved=j.REFRESH}else{if(H.indexOf(j.WIDGET_REFRESH,0)>=0){A=H.indexOf(j.WIDGET_REFRESH,0);G=H.substring(A+j.WIDGET_REFRESH.length);B.eventName=j.WIDGET_REFRESH;B.eventValue=G;B.stringToBeRemoved=j.WIDGET_REFRESH+G}else{if(H.indexOf(j.ON_ADDRESS_SELECT,0)>=0){A=H.indexOf(j.ON_ADDRESS_SELECT,0);G=H.substring(A+j.ON_ADDRESS_SELECT.length);B.eventName=j.ON_ADDRESS_SELECT;B.eventValue=G;B.stringToBeRemoved=j.ON_ADDRESS_SELECT+G}else{if(H.indexOf(j.ON_ADDRESS_SELECT_PRE,0)>=0){A=H.indexOf(j.ON_ADDRESS_SELECT_PRE,0);G=H.substring(A+j.ON_ADDRESS_SELECT_PRE.length);B.eventName=j.ON_ADDRESS_SELECT_PRE;B.eventValue=G;B.stringToBeRemoved=j.ON_ADDRESS_SELECT_PRE+G}else{if(H.indexOf(j.ON_PAYMENT_SELECT,0)>=0){A=H.indexOf(j.ON_PAYMENT_SELECT,0);G=H.substring(A+j.ON_PAYMENT_SELECT.length);B.eventName=j.ON_PAYMENT_SELECT;B.eventValue=G;B.stringToBeRemoved=j.ON_PAYMENT_SELECT+G}else{if(H.indexOf(j.ON_CLOSE,0)>=0){A=H.indexOf(j.ON_CLOSE,0);G=H.substring(A+j.ON_CLOSE.length);B.eventName=j.ON_CLOSE;B.eventValue=G;B.stringToBeRemoved=j.ON_CLOSE+G}else{if(H.indexOf(j.ON_PPH_WIDGET_CLOSE,0)>=0){B.eventName=j.ON_PPH_WIDGET_CLOSE;B.eventValue="";B.stringToBeRemoved=j.ON_PPH_WIDGET_CLOSE}else{if(H.indexOf(j.ON_CONSENT_WIDGET_READY,0)>=0){A=H.indexOf(j.ON_CONSENT_WIDGET_READY,0);B.eventName=j.ON_CONSENT_WIDGET_READY;B.eventValue=H.substring(A+j.ON_CONSENT_WIDGET_READY.length);B.stringToBeRemoved=B.eventName+B.eventValue}else{if(H.indexOf(j.ON_CONSENT_STATUS_CHANGED,0)>=0){A=H.indexOf(j.ON_CONSENT_STATUS_CHANGED,0);B.eventName=j.ON_CONSENT_STATUS_CHANGED;B.eventValue=H.substring(A+j.ON_CONSENT_STATUS_CHANGED.length);B.stringToBeRemoved=B.eventName+B.eventValue}else{if(H.indexOf(j.ON_PAYMENT_AUTHORIZATION,0)>=0){var z={};A=H.indexOf(j.ON_PAYMENT_AUTHORIZATION);E=H.substring(A+j.ON_PAYMENT_AUTHORIZATION.length);A=E.indexOf(l.constants.WIDGETID_PARAM_NAME);z.widgetID=E.substring(A+l.constants.WIDGETID_PARAM_NAME.length);B.eventName=j.ON_PAYMENT_AUTHORIZATION;B.stringToBeRemoved=E;z.paymentAuthorizationResult=E.substring(1,A);B.eventValue=z}else{if(H.indexOf(j.ON_ERROR,0)>=0){A=H.indexOf(j.ON_ERROR);E=H.substring(A+j.ON_ERROR.length);A=E.indexOf(l.constants.WIDGETID_PARAM_NAME);G=E.substring(A+l.constants.WIDGETID_PARAM_NAME.length);B.eventName=j.ON_ERROR;B.eventValue=G;B.stringToBeRemoved=E;var y=E.substring(0,A);A=y.indexOf("=");var F=y.substring(0,A);var C=y.substring(A+"=".length);B.error=(function(J,I){return{getErrorCode:function(){return J},getErrorMessage:function(){return I}}})(F,C)}else{if(H.indexOf(j.REDIRECT_URL,0)>=0){A=H.indexOf(j.REDIRECT_URL,0);var w=H.substring(A+j.REDIRECT_URL.length);B.eventName=j.REDIRECT_URL;B.eventValue=w;B.stringToBeRemoved=j.REDIRECT_URL+w}else{if(H.indexOf(j.CHANGE_HEIGHT,0)>=0){A=H.indexOf(j.CHANGE_HEIGHT);E=H.substring(A+j.CHANGE_HEIGHT.length);A=E.indexOf(l.constants.WIDGETID_PARAM_NAME);G=E.substring(A+l.constants.WIDGETID_PARAM_NAME.length);B.eventName=j.CHANGE_HEIGHT;B.stringToBeRemoved=E;var D=E.substring(1,A);B.eventValue=G+";"+D}}}}}}}}}}}}}}return B};t.eraseCookie=function(w){t.createCookie(w,"",-1)};t.createCookie=function(y,A,w){var z="";if(w){var x=new Date();x.setTime(x.getTime()+(w*60*60*1000));z="; expires="+x.toGMTString()}document.cookie=y+"="+A+z+"; path=/"};t.isCookiePresent=function(x){var w=t.readCookie(x);if(undefined!==w&&null!==w){return true}else{return false}};t.readCookie=function(A){if(document.cookie&&document.cookie!==""){var y=document.cookie.split(";");for(var x=0;x";if(p.NEW_WIDGETS===true){z+='

'}else{z+="

"+G+"

"}if(B!==undefined){z+=B}z+="";r("#"+E).html(z);return r("#"+F)};t.isEmptyOrUndefined=function(w){return(typeof(w)==="undefined"||w===null||w.length===0)};t.isBoolean=function(w){return(typeof(w)==="boolean"||w.toLowerCase()==="true"||w.toLowerCase()==="false")};t.getDefaultWidgetContainerStyle=function(y,z,w,A){w=t.isEmptyOrUndefined(w)?"block":w;var x='style="padding: 0; margin: 0; overflow: hidden; display: '+w+"; ";if(/%/.test(String(y))&&/%/.test(String(z))){x+="width: "+y+"; height: "+z+"; "}else{x+="width: "+y+"px; height: "+z+"px; "}x+=p.getWidgetsBackgroundStyle(A);x+='position: relative;"';return x};t.createWidgetForm=function(G,H,z,F,E){var A=r("#"+G);var C=A.closest("form");var x;var y;if(typeof(C)!=="undefined"&&C.length>0){H+="WidgetForm";x=t.getDefaultWidgetContainerStyle(z,F,"none");y='id="'+H+'"';var D=""+E+"";r(D).insertAfter(C)}else{var B=r("#"+H);if(B.length===0){x=t.getDefaultWidgetContainerStyle(z,F);y='id="'+H+'"';var w="";A.html(w)}B=r("#"+H);B.append(E)}};t.createIFrameString=function(y,w,x){return t.createTransparentIframeStringWithSrc(y,"",w,x)};t.createTransparentIframeStringWithSrc=function(B,A,x,z){var w='style="margin: 0; padding: 0; box-sizing: border-box; -moz-box-sizing: border-box; border: 1px solid #bbb; border-radius: 6px; overflow: hidden; position: absolute; z-index: 12; visibility: visible; top: 0; left: 0"';var y='";return y};t.createIframeStringWithSrc=function(B,A,x,z){var w='style="margin: 0; padding: 0; border-width: 0; overflow: hidden;"';var y='";return y};t.hide=function(w){r("#"+w).css("visibility","hidden")};t.show=function(w){r("#"+w).css("visibility","visible")};t.createFormString=function(A,w,B,z){var y='style="display: none; margin: 0; padding: 0; border-width: 0; overflow: hidden;"';var x="
";r.each(z,function(C,D){x+=''});x+="
";return x};function u(w,x){return w.indexOf(x,w.length-x.length)!==-1}t.isValidSizeValue=function(w){if(w===undefined){return false}if(u(w.toUpperCase(),l.constants.UNIT_PX)){w=w.substring(0,w.length-l.constants.UNIT_PX.length)}if(w===null||typeof(w)==="undefined"||isNaN(w)){return false}return true};t.verifySize=function(y,z,x,w){if(!this.isValidSizeValue(y)){return z}y=parseFloat(y);if(yw){return w}return y};t.sendOnErrorCallbackMessage=function(z,x,w){var y={};y.eventName=j.ON_ERROR;y.eventValue=w;y.error=(function(B,A){return{getErrorCode:function(){return B},getErrorMessage:function(){return A}}})(z,x);d.notifyListeners(y)};t.baseDomainsMatch=function(z,w){if(typeof(z)!=="string"||typeof(w)!=="string"){return false}var x=true;var A=z.split(".");var y=w.split(".");if(A.length>=2&&y.length>=2){x=(A[A.length-1]===y[y.length-1])&&(A[A.length-2]===y[y.length-2])}return x};t.formatMsg=function(w,x){for(var y in x){if(x.hasOwnProperty(y)){w=w.replace(y,x[y])}}return w};t.buildParamNameValueMap=function(w,x){var y={};y[l.constants.PARAM_NAME]=w;y[l.constants.PARAM_VALUE]=x;return y};t.getValueBasedOnInput=function(w,y,x){if(typeof y!=="undefined"&&w.indexOf(y.toLowerCase())>-1){return y.toLowerCase()}return x};t.getButtonPathForLatencyMeasurement=function(w){var x=[l.constants.MEASURE_BUTTON_LATENCY_BASE_PATH_PREFIX,t.getValueBasedOnInput(l.constants.BUTTON_LWA_COLOR_SET,w.color,l.constants.BUTTON_DEFAULT_COLOR_LWA),t.getValueBasedOnInput(l.constants.BUTTON_LWA_SIZE_SET,w.size,l.constants.BUTTON_DEFAULT_SIZE_LWA),l.constants.LATENCY_MEASURE_BUTTON_TYPE];return x.join("/")};t.getRebrandingBlacklistedMerchants=function(){return v.get("rebrandingMerchantBlackList")};t.getMeasureLatencyFlag=function(){return v.get("measureNewButtonLatency")};t.overrideUsingCloudFrontImage=function(x,y,w){var z=t.getRebrandingBlacklistedMerchants();if(z!==null&&z.indexOf(y)>=0&&w.type.toLowerCase()==="pwa"){x=t.getButtonPathForLatencyMeasurement(w)}return x};function g(y,x){if(!x){x="T1"}var w=y.substr(0,y.lastIndexOf("."))+"_"+x;w+=y.substr(y.lastIndexOf("."));return w}t.getRebrandedButtonPath=function(E,C,z){if(E.type===undefined||E.type===null){return null}var A=E.type.toLowerCase();if((A!=="pwa")&&(A!=="pay")&&(A!=="amazonpay")&&(A!=="a")&&(A!=="hostedpayment")){return null}if(A==="pwa"||A==="hostedpayment"){A="amazonpay"}var x=t.getLanguageForSeller(z,E).toLowerCase();var y=p.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX;var D=t.getValueBasedOnInput(l.constants.BUTTON_LWA_COLOR_SET,E.color,l.constants.BUTTON_DEFAULT_COLOR_LWA);var F=t.getValueBasedOnInput(l.constants.BUTTON_LWA_SIZE_SET,E.size,l.constants.BUTTON_DEFAULT_SIZE_LWA);var G=g(l.constants.BUTTON_REBRANDED_IMAGE_NAME,C);var w=[x,A,D,F,G];var B=w.join("/");return(y+B)};t.getAPARebrandedButtonPath=function(E,z){if(p.COUNTRY_CODE==="JP"){return null}var A=l.constants.BUTTON_DEFAULT_COLOR;var C=l.constants.BUTTON_DEFAULT_SIZE;var B=l.constants.BUTTON_DEFAULT_BACKGROUND;var w="";if(E!==undefined){A=t.getValueBasedOnInput(l.constants.BUTTON_COLOR_SET,E.color,l.constants.BUTTON_DEFAULT_COLOR);C=t.getValueBasedOnInput(l.constants.BUTTON_SIZE_SET,E.size,l.constants.BUTTON_DEFAULT_SIZE);B=t.getValueBasedOnInput(l.constants.BUTTON_BACKGROUND_SET,E.background,l.constants.BUTTON_DEFAULT_BACKGROUND)}var y=p.REBRANDED_BUTTON_IMAGE_BASE_PATH_PREFIX;var D=g(l.constants.BUTTON_REBRANDED_IMAGE_NAME,z);var x=[l.constants.APA_BUTTON_TYPE,A,C,D];w=y+x.join("/");return w};t.getLWAButtonPath=function(y,C,w){var A=t.getLWAButtonBasePath(C);var z="lwa/";if(v.valueForKeyIsTrue(l.dynamic_config_keys.SERVE_BUTTONS_FROM_CLOUDFRONT)){A=l.constants.CLOUDFRONT_BUTTON_BASE_PATH}var B=l.constants.BUTTON_DEFAULT_TYPE;if(w){z="donation/"}if(y.type==="AmazonPay"){y.type="PwA"}z+=t.getValueBasedOnInput(l.constants.BUTTON_LWA_COLOR_SET,y.color,l.constants.BUTTON_DEFAULT_COLOR_LWA);z+="/";z+=t.getValueBasedOnInput(l.constants.BUTTON_LWA_SIZE_SET,y.size,l.constants.BUTTON_DEFAULT_SIZE_LWA);z+="/";if(typeof y.type!=="undefined"){if(l.constants.BUTTON_LWA_TEXT_SET.indexOf(y.type.toLowerCase())>-1){z+=l.constants.BUTTON_LWA_TEXT_IMAGE_SET[l.constants.BUTTON_LWA_TEXT_SET.indexOf(y.type.toLowerCase())];B=y.type}else{z+=l.constants.BUTTON_DEFAULT_TEXT}}else{z+=l.constants.BUTTON_DEFAULT_TEXT}var x=A+z;if(x.indexOf(B+".svg")!==-1){x=x.replace(/x-large|large|medium|small/,"svg")}return x};t.getLWAButtonBasePath=function(y){var x=l.constants.BUTTON_BASE_PATH_PREFIX+l.constants.COUNTRY_CODE_TO_LANGUAGE_COUNTRY_MAP[p.COUNTRY_CODE];var w=l.constants.REALM_TO_COUNTRY_CODE_MAP[y];if(w.toLowerCase()!==p.COUNTRY_CODE.toLowerCase()){x+="/"+y}x+=l.constants.BUTTON_BASE_PATH_SUFFIX;return x};t.getButtonPath=function(D,A){var w="";var y="";var x="";var z="";if(D!==undefined){w=t.getValueBasedOnInput(l.constants.BUTTON_COLOR_SET,D.color,l.constants.BUTTON_DEFAULT_COLOR);y=t.getValueBasedOnInput(l.constants.BUTTON_SIZE_SET,D.size,l.constants.BUTTON_DEFAULT_SIZE);x=t.getValueBasedOnInput(l.constants.BUTTON_BACKGROUND_SET,D.background,l.constants.BUTTON_DEFAULT_BACKGROUND)}else{w=l.constants.BUTTON_DEFAULT_COLOR;y=l.constants.BUTTON_DEFAULT_SIZE;x=l.constants.BUTTON_DEFAULT_BACKGROUND}if(c.ABTest.Utilities.isSellerInABTest(t.getCartOwnerId(),c.ABTest.Tests.Default)){z=c.ABTest.Utilities.getButtonPath(w,y)}else{var C=l.constants.BUTTON_BASE_PATH;var B="";if(A){B="donation/"}else{B="pwa/"}B+=w+"/"+y+"/"+x+"/";z=C+B}return z};t.isValidDocInclusion=function(){var x=true;try{var y=window.top.document.domain;var A=document.domain;x=t.baseDomainsMatch(y,A)}catch(z){if(window.ueLogError){var w={logLevel:q.ERROR,attribution:"Widget_core.js",message:s.IS_INVALID_DOCUMENT};window.ueLogError(z,w)}x=false}return x};t.performContractAction=function(A,x){var y=t.createIframeStringWithSrc(l.constants.CONTRACT_FRAME_ID,"",0,0);r("#"+l.constants.CONTRACT_FRAME_ID).remove();r("body").append(y);var w=p.WIDGET_ENDPOINT+p.CREATE_CONTRACT_URL_PATH;var z=t.createFormString(l.constants.CONTRACT_FORM_ID,w,l.constants.CONTRACT_FRAME_ID,A);r("#"+l.constants.CONTRACT_FORM_ID).remove();r("#"+x).append(z);r("#"+l.constants.CONTRACT_FORM_ID).submit()};t.getAccessToken=function(A,z){var x="";if(typeof(A)!=="undefined"&&A!==null){x=A.getSellerId()}t.setLwADomain(x);var w={scope:"payments:widget",interactive:o};if(A&&A.scope){w.scope=A.scope}var y=b().Login.authorize(w);y.onComplete(function(B){if(B.error){z(A,B.error)}else{z(A,B.access_token)}})};t.setLwaSandboxMode=function(){if(p.IS_SANDBOX==="true"&&typeof b()!=="undefined"&&typeof b().Login!=="undefined"){b().Login.setSandboxMode(true)}};t.setLanguage=function(x,w){if(typeof b()!=="undefined"&&typeof b().Login!=="undefined"){var y=t.getLanguageForSeller(x,w);if(t.isSellerAllowedForMultiLanguage(x,w)&&!t.isEmptyOrUndefined(w.language)){b().Login.setLanguageHint(y)}}};t.setLwADomain=function(w){if(typeof b()!=="undefined"&&typeof b().Login!=="undefined"){if(t.isSellerWhitelistedForNAAccountDomain(w)){b().Login.setDomain(p.NA_ACCOUNT_DOMAIN_ENDPOINT);b().Login.setLanguage(l.constants.COUNTRY_CODE_TO_REALM_MAP[p.COUNTRY_CODE.toLowerCase()])}else{b().Login.setDomain(v.get("LWAEndpointOverride")||p.LWA_ENDPOINT)}}};t.validationException=function(){return l.constants.PARAMETER_VALIDATION_FAILED_MSG};t.isSellerHidingButton=function(E){var w=r("#"+E).css("display");var B=r("#"+E+" > img").css("display");var H=(w==="none"||B==="none");var y=r("#"+E).css("opacity");var J=r("#"+E+" > img").css("opacity");var I=(y==="0"||J==="0");var x=r("#"+E).css("visibility");var D=r("#"+E+" > img").css("visibility");var z=(x==="hidden"||D==="hidden");var A=r("#"+E).css("position");var C=parseInt(r("#"+E).css("left"));var G=parseInt(r("#"+E).css("right"));var F=(A==="absolute"&&(C<0||G<0));return(H||I||z||F)};t.isSVGSupported=function(){return !!("createElementNS" in document&&document.createElementNS(l.constants.SVG_NAMESPACE,"svg").createSVGRect)};t.isSellerAllowed=function(x,w){if((typeof w.height!=="undefined")||(typeof w.width!=="undefined")){return true}return false};function f(x){x=x.toLowerCase();var w=(x.indexOf("ipod")>=0||x.indexOf("iphone")>=0||x.indexOf("ipad")>=0)&&!x.match(/\sos\s*6_0/);return w===true}t.createSubclass=function(w){function x(){}x.prototype=w;return new x()};t.imageInDOM=function(w){return w!==undefined&&w.width>1&&w.height>1};t.isElementInArray=function(w,x){if(!t.isEmptyOrUndefined(w)&&!t.isEmptyOrUndefined(x)){return r.inArray(w,x)>=0}return false};t.removeWhiteSpacesInString=function(w){if(w!==undefined){var x=w.replace(/\s+/g,"");return x}return w};t.stringToArray=function(w){var x=t.removeWhiteSpacesInString(w);return x.split(",")};t.createQueryString=function(A){var y="?";var z=true;for(var w in A){if(A.hasOwnProperty(w)){var x=A[w];if(z){y+=w+"="+encodeURIComponent(x);z=false}else{y+="&"+w+"="+encodeURIComponent(x)}}}return y};t.Timezone=function(){};t.Timezone.appendTimezoneDetails=function(w){w[l.constants.TIMEZONE_JANUARY_OFFSET]=t.Timezone._getJanuaryOffset();w[l.constants.TIMEZONE_JUNE_OFFSET]=t.Timezone._getJuneOffset();return w};t.Timezone._getJanuaryOffset=function(){return t.Timezone._getDateOffset(l.constants.TIMEZONE_JANUARY_REF_DATE)};t.Timezone._getJuneOffset=function(){return t.Timezone._getDateOffset(l.constants.TIMEZONE_JUNE_REF_DATE)};t.Timezone._getDateOffset=function(w){var x=-w.getTimezoneOffset();return(x!==null?x:0)};t.addLpaButtonAttributesToMetrics=function(w,y,A){var x="|color:"+t.getValueBasedOnInput(l.constants.BUTTON_LWA_COLOR_SET,y.color,l.constants.BUTTON_DEFAULT_COLOR_LWA);A.addInfoOrEntry("additional-request-data",x,"info");var z="|size:"+t.getValueBasedOnInput(l.constants.BUTTON_LWA_SIZE_SET,y.size,l.constants.BUTTON_DEFAULT_SIZE_LWA);A.addInfoOrEntry("additional-request-data",z,"info");t.addButtonDimensionAndMargin(A,w)};t.addApaButtonAttributesToMetrics=function(B,z){var w=l.constants.BUTTON_DEFAULT_COLOR;var x=l.constants.BUTTON_DEFAULT_SIZE;if(typeof(B)!=="undefined"){w=B.color;x=B.size}var y="|color:"+t.getValueBasedOnInput(l.constants.BUTTON_COLOR_SET,w,l.constants.BUTTON_DEFAULT_COLOR);z.addInfoOrEntry("additional-request-data",y,"info");var A="|size:"+t.getValueBasedOnInput(l.constants.BUTTON_SIZE_SET,x,l.constants.BUTTON_DEFAULT_SIZE);z.addInfoOrEntry("additional-request-data",A,"info")};t.addButtonDimensionAndMargin=function(A,x){var y=r("#"+x+" > img");var z="|dimension:"+y.width()+"x"+y.height();A.addInfoOrEntry("additional-request-data",z,"info");var w="|margin:"+parseInt(y.css("margin-top"),10)+"x"+parseInt(y.css("margin-bottom"),10)+"x"+parseInt(y.css("margin-left"),10)+"x"+parseInt(y.css("margin-right"),10);A.addInfoOrEntry("additional-request-data",w,"info")};t.shouldInvokeSetTimeoutOnSigninForUserAgent=f;k.exports=t},{"./Config":13,"./Constants":16,"./DynamicConfig":17,"./EventTypes":18,"./LwaLogin":24,"./Mediator":25,"./SessionStabilizer":30,"./TaskQueue":31,"./jquery":38}],33:[function(c,i,f){var b=c("./jquery");var r=c("./Utilities");var o=c("./Constants");var j=c("./LwaLogin");var p=c("./InlineWidgetError");var g=c("./InlineWidget");var l=c("./Mediator").instance;var a=c("./EventTypes");var h=c("./Config");var m=c("../widgets/MetricsCollector");var n=c("./PubSub");var q="Form";var k="spaWalletWidget";function d(s){m.Collector.time("walletwidget-pre-render");this.type=o.others.WidgetTypes.Wallet;g.call(this,s);this.onPaymentSelect=s.onPaymentSelect;this.theme=s.theme||h.defaultTheme;var t=this.design.width;var u=this.design.height;switch(this.getDisplayMode()){case o.others.DisplayModes.read:if(this.design.checkWidth){if(t===undefined){p.RaiseMissingParameterError(this,r.buildParamNameValueMap("design.width",t))}else{this.design.width=r.verifySize(t,undefined,o.constants.WALLET_WIDGET.READ.min_width,o.constants.WALLET_WIDGET.READ.max_width);p.RaiseOnErrorIfUndefined(this.design.width,o.constants.INVALID_PARAMETER_VALUE_MSG,r.buildParamNameValueMap("design.width",t),this)}}if(this.design.checkHeight){if(u===undefined){p.RaiseMissingParameterError(this,r.buildParamNameValueMap("design.height",u))}else{this.design.height=r.verifySize(u,undefined,o.constants.WALLET_WIDGET.READ.min_height,o.constants.WALLET_WIDGET.READ.max_height);p.RaiseOnErrorIfUndefined(this.design.height,o.constants.INVALID_PARAMETER_VALUE_MSG,r.buildParamNameValueMap("design.height",u),this)}}break;case o.others.DisplayModes.edit:if(this.design.checkWidth){if(t===undefined){p.RaiseMissingParameterError(this,r.buildParamNameValueMap("design.width",t))}else{this.design.width=r.verifySize(t,undefined,o.constants.WALLET_WIDGET.EDIT.min_width,o.constants.WALLET_WIDGET.EDIT.max_width);p.RaiseOnErrorIfUndefined(this.design.width,o.constants.INVALID_PARAMETER_VALUE_MSG,r.buildParamNameValueMap("design.width",t),this)}}if(this.design.checkHeight){if(u===undefined){p.RaiseMissingParameterError(this,r.buildParamNameValueMap("design.height",u))}else{this.design.height=r.verifySize(u,undefined,o.constants.WALLET_WIDGET.EDIT.min_height,o.constants.WALLET_WIDGET.EDIT.max_height);p.RaiseOnErrorIfUndefined(this.design.height,o.constants.INVALID_PARAMETER_VALUE_MSG,r.buildParamNameValueMap("design.height",u),this)}}break}b(this).bind(a.ON_PAYMENT_SELECT,this,this.onPaymentSelectHandler)}d.prototype=r.createSubclass(g.prototype);d.prototype.constructor=d;d.prototype.onPaymentSelectHandler=function(u){n.publish("WALLET_RENDER_COMPLETE",this.getID(),this.getSellerId(),this.locationID);var s=u.data;var t=s.eventValue;if(this.getID()===t){if(this.onPaymentSelect!==undefined){this.onPaymentSelect(s)}}};d.prototype.renderElements=function(){n.publish("WALLET_RENDER_START",this.getID());if(this.hasError!==undefined&&this.hasError){b("#"+this.locationID).empty();return false}var s=this;r.setLwaSandboxMode();if(typeof j()!=="undefined"&&typeof j().Login!=="undefined"&&typeof j().Login.getClientId!=="undefined"&&typeof j().Login.getClientId()!=="undefined"){r.getAccessToken(s,s.renderWallet)}else{s.renderWallet(s,"")}};d.prototype.renderWallet=function(z,D){c("./ABTestingNewWidgets").resetConfig(D,z.agreementType,z.getSellerId());var s=z.getID()+"IFrame";var x=r.createIFrameString(s,z.design.width,z.design.height);var t=z.getID()+q;var v=h.WIDGET_ENDPOINT+h.WALLET_URL_PATH;var B=document.getElementById(z.locationID);var y=(B!==null)?B.offsetWidth:z.design.width;var w=(B!==null)?B.offsetHeight:z.design.height;var A={action:k,referringURL:window.top.location,cartOwnerId:z.getSellerId(),marketplaceSellerId:z.getMarketplaceSellerId(),access_token:D,agreementType:z.agreementType,displayMode:z.getDisplayMode(),widgetId:z.getID(),widgetWidth:y,widgetHeight:w,widgetDesignMode:z.design.designMode,widgetPadding:z.design.padding,browserWindowHeight:z.getBrowserWindowHeight(),paymentInstrumentsDisplayOptions:z.getPaymentInstrumentsDisplayOptions(),clientId:r.getClientId(),coe:h.COE,env:h.ENV,ledgerCurrency:h.LEDGER_CURRENCY,theme:z.theme};A=r.Timezone.appendTimezoneDetails(A);if(typeof z.getContractId()!=="undefined"&&z.getContractId()!==null){A.contractId=z.getContractId()}else{if(typeof z.onOrderReferenceCreate==="function"){A.createContract=true}else{if(typeof z.onBillingAgreementCreate==="function"){A.createContract=true}else{if(typeof z.onReady==="function"){A.createContract=true}}}}if(typeof z.getPresentmentCurrency()!=="undefined"&&z.getPresentmentCurrency()!==null){A.presentmentCurrency=z.getPresentmentCurrency()}p.isMissingParameter("sellerId",z.getSellerId(),z);if(z.error&&z.error.errorType){A.clientErrorType=z.error.errorType;A.clientErrorElementName=z.error.errorElementName;A.clientErrorElementValue=z.error.errorElementValue;A.clientErrorMessage=z.error.errorMessage}var u=r.createFormString(t,v,s,A);b("#"+t).remove();r.createWidgetContainer(z.locationID,z.getID(),z.design.width,z.design.height,x,z.type,z.theme);r.createWidgetForm(z.locationID,z.getID(),z.design.width,z.design.height,u,t);var C=l.getAddressWidgets();if(o.constants.READY_TO_RENDER){if(C.length===0||C[0].rendered===true){m.Collector.timeEnd("walletwidget-pre-render");b("#"+t).submit()}else{o.constants.TIMEOUT_ID=window.setTimeout(function(){m.Collector.timeEnd("walletwidget-pre-render");b("#"+t).submit()},5000)}}};i.exports=d},{"../widgets/MetricsCollector":47,"./ABTestingNewWidgets":3,"./Config":13,"./Constants":16,"./EventTypes":18,"./InlineWidget":21,"./InlineWidgetError":22,"./LwaLogin":24,"./Mediator":25,"./PubSub":27,"./Utilities":32,"./jquery":38}],34:[function(b,i,d){var h=b("./CORS");var g=b("./Config");var p=b("./SessionStabilizer");var j="/abTestV2";var l=null;var k=false;var n=[];var c=[];function m(r,s){var q=r.pop();while(typeof q==="function"){q(s);q=r.pop()}}function o(u,t,q){if(!q&&l){u(l);return}if(k){if(typeof u==="function"){n.push(u)}if(typeof t==="function"){c.push(t)}return}k=true;var v=h.createRequest("GET",f(),true);if(v){var r=function(){k=false;l=null;if(typeof t==="function"){t()}m(c,null)};var s=function(){k=false;var w={};try{w=JSON.parse(v.responseText);l=w;if(typeof u==="function"){u(w)}m(n,l)}catch(x){l=null;if(typeof t==="function"){t()}m(c,null)}};v.onload=s;v.onerror=r;v.send()}}function a(t,s,r,q){p.setSessionDone(function(){o(function(u){if(u&&u.abTestResults&&u.abTestResults[t]){s({treatment:u.abTestResults[t],abtestName:t})}else{if(typeof r==="function"){r()}}},r,q)})}function f(){return g.WIDGET_ENDPOINT+j+"?countryOfEstablishment="+g.COE+"&ledgerCurrency="+g.LEDGER_CURRENCY+"&isSandbox="+g.IS_SANDBOX}i.exports={load:o,loadWithName:a}},{"./CORS":11,"./Config":13,"./SessionStabilizer":30}],35:[function(c,g,f){var b=c("./jquery");var j=c("./Utilities");var i=c("./Constants");var h=c("./Mediator").instance;var a=c("./EventTypes");var d=c("../widgets/MetricsCollector");function k(m){this.collector=new d.Collector();var l=i.constants.WIDGETID_PREFIX+h.generateUniqWidgetID();this.getID=function(){return l};this.getWidgetCount=function(){return h.getNumWidgetCount()};h.register(this);b(this).bind(a.DOCUMENT_READY,this,this.documentReadyEventHandler);this.getSellerId=function(){if(j.isEmptyOrUndefined(m.sellerId)){return""}return m.sellerId};this.getMarketplaceSellerId=function(){if(j.isEmptyOrUndefined(m.marketplaceSellerId)){return""}return m.marketplaceSellerId}}k.prototype.renderImpl=function(){this.renderElements();if(this.type===i.others.WidgetTypes.Button){this.bindClickHandler(this)}};k.prototype.removeEventListener=k.prototype.detachEvent=function(){};k.prototype.bind=function(l){var m=j.isValidDocInclusion();if(m){this.locationID=l;this.renderRequested=true;if(typeof this.design!=="undefined"&&this.design.designMode!==null&&this.design.designMode!==undefined){if((this.design.designMode==="smartphoneCollapsible"||this.design.designMode==="smartphoneNonCollapsible")&&(b("#"+l).width()!==null)){this.design.width=b("#"+l).width()}}if(this.type!==i.others.WidgetTypes.Button){this.renderImpl()}else{if(b("#"+this.locationID).length>0){this.renderImpl();b(this).unbind(a.DOCUMENT_READY,this.documentReadyEventHandler)}}}return this};k.prototype.renderElements=function(){return""};k.prototype.bindClickHandler=function(){return""};k.prototype.documentReadyEventHandler=function(m,l){if(this.renderRequested){l.renderImpl()}};k.prototype.getLocation=function(){return this.locationID};k.prototype.getWidgetType=function(){return this.type};k.prototype.encodeShippingRestrictions=function(){var l=JSON.stringify(this.shippingRestrictions);var m=l.replace(/\"/g,""");return m};g.exports=k},{"../widgets/MetricsCollector":47,"./Constants":16,"./EventTypes":18,"./Mediator":25,"./Utilities":32,"./jquery":38}],36:[function(c,f,d){var h=c("./InlineWidgetError");var i=c("./Utilities");var g=c("./Constants");var b=c("./ABTestingNewWidgets");var j={RESPONSIVE:"responsive",SMART_PHONE_COLLAPSIBLE:"smartphoneCollapsible",SMART_PHONE_NON_COLLAPSIBLE:"smartphoneNonCollapsible"};function a(k,l){if(typeof(k)!=="undefined"){this.checkWidth=true;this.checkHeight=true;this.name=k.name;this.colorTheme=k.colorTheme;if(k.size!==null&&k.size!==undefined){this.width=k.size.width;this.height=k.size.height}if(k.designMode!==null&&k.designMode!==undefined){if(k.designMode===j.SMART_PHONE_COLLAPSIBLE||k.designMode===j.SMART_PHONE_NON_COLLAPSIBLE||k.designMode===j.RESPONSIVE){this.designMode=k.designMode;h.SetErrorIfParameterExists("design.width",this.width,null,l,"smartphone");this.width=document.body.clientWidth;this.checkWidth=false;if(k.padding!==null&&k.padding!==undefined){if(i.isValidSizeValue(k.padding)){this.padding=parseFloat(k.padding)}else{h.RaiseOnError(g.constants.INVALID_PARAMETER_VALUE_MSG,i.buildParamNameValueMap("design.padding",k.padding),l)}}}else{l.error=new h(g.constants.INVALID_PARAMETER_VALUE,null,"design.designMode",k.designMode)}if(k.designMode===j.SMART_PHONE_COLLAPSIBLE){this.height=135;if(i.readCookie(b.cookie_name)==="true"){this.height=228}this.checkHeight=false}else{if(k.designMode===j.RESPONSIVE){this.height="100%";this.width="100%";this.checkHeight=false;this.checkWidth=false}}}else{this.designMode="";h.SetErrorIfParameterExists("design.padding",k.padding,null,l,"nonSmartphone")}}else{h.RaiseOnErrorIfUndefined(k,g.constants.INVALID_PARAMETER_VALUE_MSG,i.buildParamNameValueMap("design",""),l)}}f.exports=a},{"./ABTestingNewWidgets":3,"./Constants":16,"./InlineWidgetError":22,"./Utilities":32}],37:[function(b,a,c){a.exports=function(){if(window.OffAmazonPayments){return window.OffAmazonPayments.ZERO_TIME}else{return 0}}},{}],38:[function(b,a,c){(function(d){var f=(typeof window!=="undefined"?window["$"]:typeof d!=="undefined"?d["$"]:null);var g=f.noConflict(true);a.exports=g}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],39:[function(b,f,c){var j=b("../PubSub");var a=b("../jquery");var d=b("../../widgets/MetricsCollector").Collector;var g={};var m={address:"address_render_time",wallet:"wallet_render_time"};var l={address:"spaAddressWidget",wallet:"spaWalletWidget"};var k={address:"spaAddressWidgetRender",wallet:"spaWalletWidgetRender"};function i(n){return function(o){g[n+";"+o]=(new Date()).getTime()}}function h(n){return function(r,u,s){var q=(new Date()).getTime();var w=n+";"+r;var t=g[w];var v;if(t){v=new d(u);v.addInfoOrEntry("sub-page-type",l[n],"info");v.addInfoOrEntry("page-action",k[n],"info");v.addInfoOrEntry("merchant-id",u,"info");v.addTiming(m[n],t,q,[]);var p=a("#"+s);var o="wd:"+p.width()+"|ht:"+p.height();p=a("#"+r);o+="|s_ow:"+p.outerWidth()+"|s_oh:"+p.outerHeight();o+="|s_wd:"+p.width()+"|s_ht:"+p.height();o+="|w_wd:"+a(window).width()+"|w_ht:"+a(window).height();v.addInfoOrEntry("additional-request-data",o,"info");v.publish();delete g[w]}}}f.exports=function(){j.subscribe("ADDRESS_RENDER_START",i("address"));j.subscribe("ADDRESS_RENDER_COMPLETE",h("address"));j.subscribe("WALLET_RENDER_START",i("wallet"));j.subscribe("WALLET_RENDER_COMPLETE",h("wallet"))}},{"../../widgets/MetricsCollector":47,"../PubSub":27,"../jquery":38}],40:[function(b,a,c){var d={Widgets:{}};d.Widgets.Cookie=function(){};d.Widgets.Cookie.eraseCookie=function(f){d.Widgets.Cookie.createCookie(f,"",-1)};d.Widgets.Cookie.createCookie=function(h,j,f){var i="";if(f){var g=new Date();g.setTime(g.getTime()+(f*60*60*1000));i="; expires="+g.toGMTString()}document.cookie=h+"="+j+i+"; path=/"};d.Widgets.Cookie.readCookie=function(k){if(document.cookie&&document.cookie!==""){var h=document.cookie.split(";");for(var g=0;g=0))}function a(v,x,w,u){if(v){f();v.src=x;j.useRetinaImage(v,u,w)}}var s="amazonpay-button-image-tmp-styles";function p(u){var v=document.createElement("style");v.setAttribute("id",s);v.innerHTML="."+l.constants.AMAZON_CREATED_BUTTON_IMAGE_CSS_CLASS+"{opacity:0}";u.appendChild(v)}function f(){var u=document.getElementById(s);if(u){u.parentNode.removeChild(u)}}function d(x,v,B,u,A,z){if(!t.valueForKeyIsTrue(l.dynamic_config_keys.ENABLE_BUTTON_ABTESTING)){a(v,A,B,u);return}if(o(u)){a(v,A,B,u);return}p(x);var y=function(C){c(z,C,u);var E=C.treatment;if(E==="C"){a(v,A,B,u);return}var D=r.getRebrandedButtonPath(B,E);if(D!==null){a(v,D,B,u)}else{a(v,A,B,u)}};var w=function(){a(v,A,B,u)};if(t.valueForKeyIsTrue(l.dynamic_config_keys.ENABLE_ABTEST_V2)){h.loadWithName(b,y,w)}else{i(u,y,w)}}function i(v,x,w){var u=n.WIDGET_ENDPOINT+n.ABTEST_URL_PATH+r.createQueryString({merchantId:v,abtestName:b});r.jsonp({url:u,success:x,error:w})}k.exports={performButtonWeblab:d}},{"../ButtonCallbacks":8,"../Config":13,"../Constants":16,"../DynamicConfig":17,"../HighResButtons":19,"../Utilities":32,"../Weblab":34}],45:[function(d,m,g){var c=d("../core/jquery");var q=d("../core/Utilities");var p=d("../core/Constants");var k=d("../core/ButtonCallbacks");var l=d("../core/Config");var o=d("../widgets/MetricsCollector");var j=d("../core/HighResButtons");var n=d("../core/DynamicConfig");var r=d("../core/Weblab");var a={};a.Utilities={};a.Constants={};a.Constants.IMG_PATH_PREFIX="ABTesting";a.Constants.TREATMENT_C="C";a.Constants.TREATMENT_T1="T1";a.Constants.TREATMENT_T2="T2";a.Constants.TREATMENT_T3="T3";a.Constants.TREATMENT_T4="T4";a.Constants.TREATMENT_T5="T5";a.Constants.TREATMENT_T6="T6";a.Constants.TREATMENT_T7="T7";a.Constants.TREATMENT_T8="T8";a.Constants.TREATMENT_T9="T9";a.Constants.TREATMENT_T10="T10";a.Constants.COOKIE_TIME_TO_LIVE=24;var h="amazon-button-rebranding-temp-css";function b(u){var t=document.getElementById(u);var s=document.createElement("style");s.setAttribute("class",h);s.innerHTML="#"+u+" > ."+p.constants.AMAZON_CREATED_BUTTON_IMAGE_CSS_CLASS+" { display: none; }";if(t){if(t.childNodes.length>0){t.insertBefore(s,t.childNodes[0])}else{t.appendChild(s)}}}function i(u){var t=document.getElementById(u),s;if(t){s=t.querySelector("."+h);while(s!==null){t.removeChild(s);s=t.querySelector("."+h)}}}a.Utilities.appendButtonImageHiddingStyleEle=b;a.Utilities.removeButtonImageHiddingStyleEle=i;a.Utilities.createCookieForABTest=function(t,s){if(t!=undefined&&s!=undefined){q.createCookie(s,t,a.Constants.COOKIE_TIME_TO_LIVE)}};a.Utilities.buildQueryParamMap=function(u,t,v){var s=u||{};s[t]=v;return s};a.Utilities.ajaxCallForJSONPResponse=function(u,t,s){q.jsonp({url:u,success:t,error:s})};var f="weblabOverrides";a.Utilities.getExperimentValueAndCallback=function(z,w,y,G){var x=(new Date()).getTime();var C=a.Constants.TREATMENT_C;if(w&&w.defaultTreatment){C=w.defaultTreatment}var s="merchantId",u="abtestName",H="treatment";function B(J){var K=new Array(u,H);if(!q.isEmptyOrUndefined(J)){for(var L=0;L=0))};a.Utilities._abTestAfter=function(u,s,t){for(var w in a.Tests){var v=a.Tests[w];if(!v.ignoreCheckWhiteList){if(a.Utilities.isSellerInABTest(u,v)||a.Utilities.isRebrandingABTest(w,u)){a.Utilities.getExperimentValueAndCallback(u,v,v.callback(s,t,u),t)}}}};a.Utilities._abTestBefore=function(t,s){for(var v in a.Tests){var u=a.Tests[v];if(!u.ignoreCheckWhiteList){if(a.Utilities.isSellerInABTest(t,u)||a.Utilities.isRebrandingABTest(v,t)){b(s)}else{if(q.isCookiePresent(u.cookieName)){q.eraseCookie(u.cookieName)}}}}};a.Utilities._MULTI_BUTTONS_AbTestCallback=function(s){return function(u){function w(y){return y.length===2}function t(A){var y=A.getElementsByTagName("img");for(var z=0;z";c.DynamicButton.Constants.SANDBOX_WATERMARK_SVG="S";c.DynamicButton.Utilities.ButtonSpecification=function(p,q,o,m,n,l,r,k){this.text=p;this.size=q;this.language=l;this.bgColor=r;this.textColor=k;this.heightRequested=o;this.widthRequested=m;this.isAspectRatioToBeMaintained=n;this.smileyHorizontalPositionInPercentage=0;this.textHorizontalPositionInPercentage=0;this.smileyVerticalPositionInPercentage=c.DynamicButton.Constants.SMILEY_VERTICAL_POSITION_PCT;this.textVerticalPositionInPercentage=c.DynamicButton.Constants.TEXT_VERTICAL_POSITION_PCT;this.textHeightInPx=0;this.textWidthInPx=0;if(this.size%2===0){this.aspectRatio=c.DynamicButton.Constants.BUTTON_ASPECT_RATIO_DESKTOP[this.language][this.text]}else{this.aspectRatio=c.DynamicButton.Constants.BUTTON_ASPECT_RATIO_TOUCH[this.language][this.text]}if(!(this.heightRequested===0&&this.widthRequested===0)){this.aspectRatio=c.DynamicButton.Constants.BUTTON_ASPECT_RATIO_DESKTOP[this.language][this.text]}if(this.text===c.DynamicButton.Constants.TEXT_INDEX_FOR_ONLY_SMILEY_BUTTON){this.isTextOnButton=false}else{this.isTextOnButton=true}this.smileyTransformationRatio=0;this.buttonHeightInPx=0;this.buttonWidthInPx=0;this.input={};this.sellerId;c.DynamicButton.Constants.ButtonCount+=1;this.buttonCount=c.DynamicButton.Constants.ButtonCount};c.DynamicButton.Utilities.calculateSpacingWithText=function(p){p.textWidthInPx=(c.DynamicButton.Constants.TEXT_SIZE_WxH_ARRAY[p.language][p.text][c.DynamicButton.Constants.WIDTH_INDEX]/c.DynamicButton.Constants.TEXT_SIZE_WxH_ARRAY[p.language][p.text][c.DynamicButton.Constants.HEIGHT_INDEX])*p.textHeightInPx;var l=c.DynamicButton.Utilities.getSmileyTextSpacingInPx(p.buttonHeightInPx);var k=c.DynamicButton.Constants.DEFAULT_SMILEY_WIDTH_PX*p.smileyTransformationRatio;var o=c.DynamicButton.Utilities.getButtonPaddingInPx(l);var m=k+l+p.textWidthInPx+o*2;var n=p.buttonWidthInPx/2-m/2;p.smileyHorizontalPositionInPercentage=(n+o/2)/p.buttonWidthInPx*100;p.textHorizontalPositionInPercentage=(n+o/2+k+l)/p.buttonWidthInPx*100;return p};c.DynamicButton.Utilities.calculateSpacingWithoutText=function(m){var l=m.buttonHeightInPx-c.DynamicButton.Utilities.getSmileyVerticalSpacingInPx(m)*2;m.smileyTransformationRatio=l/c.DynamicButton.Constants.DEFAULT_SMILEY_HEIGHT_PX;var k=c.DynamicButton.Constants.DEFAULT_SMILEY_WIDTH_PX*m.smileyTransformationRatio;m.smileyHorizontalPositionInPercentage=((m.buttonWidthInPx-k)/2)/m.buttonWidthInPx*100;m.textHorizontalPositionInPercentage=0;return m};c.DynamicButton.Utilities.precomputeValues=function(k){k=c.DynamicButton.Utilities.computeDimensions(k);k=c.DynamicButton.Utilities.calculateSmileyTransformation(k);k=c.DynamicButton.Utilities.calculateTextTransformation(k);if(!k.isTextOnButton){k=c.DynamicButton.Utilities.calculateSpacingWithoutText(k)}else{k=c.DynamicButton.Utilities.calculateSpacingWithText(k)}return k};c.DynamicButton.Utilities.computeDimensions=function(p){var l=p.widthRequested;var k=p.heightRequested;var n;if(k===0&&l===0){l=c.DynamicButton.Constants.BUTTON_SIZE_WxH_ARRAY[p.text][p.size][c.DynamicButton.Constants.WIDTH_INDEX];k=c.DynamicButton.Constants.BUTTON_SIZE_WxH_ARRAY[p.text][p.size][c.DynamicButton.Constants.HEIGHT_INDEX]}else{if(k===0){n=c.DynamicButton.Constants.CONSTRAINT_MIN_HEIGHT_PX/p.aspectRatio;l=(l>n)?l:n;k=l*p.aspectRatio}else{if(l===0){k=(k>c.DynamicButton.Constants.CONSTRAINT_MIN_HEIGHT_PX)?k:c.DynamicButton.Constants.CONSTRAINT_MIN_HEIGHT_PX;l=k/p.aspectRatio}else{k=(k>c.DynamicButton.Constants.CONSTRAINT_MIN_HEIGHT_PX)?k:c.DynamicButton.Constants.CONSTRAINT_MIN_HEIGHT_PX;n=k/p.aspectRatio;l=(l>n)?l:n}}}var o=k/p.aspectRatio;var m=l*p.aspectRatio;if(p.isAspectRatioToBeMaintained){p.buttonWidthInPx=((l>o)?o:l);p.buttonHeightInPx=((k>m)?m:k)}else{p.buttonWidthInPx=((l>o)?l:o);p.buttonHeightInPx=k}return p};c.DynamicButton.Utilities.calculateSmileyTransformation=function(l){var k=l.buttonHeightInPx-c.DynamicButton.Utilities.getSmileyVerticalSpacingInPx(l)*2;l.smileyTransformationRatio=k/c.DynamicButton.Constants.DEFAULT_SMILEY_HEIGHT_PX;return l};c.DynamicButton.Utilities.calculateTextTransformation=function(k){k.textHeightInPx=k.buttonHeightInPx-c.DynamicButton.Utilities.getTextVerticalSpacingInPx(k)*2;return k};c.DynamicButton.Utilities.getSmileyVerticalSpacingInPx=function(k){return k.buttonHeightInPx/(100/k.smileyVerticalPositionInPercentage)};c.DynamicButton.Utilities.getTextVerticalSpacingInPx=function(k){return k.buttonHeightInPx/(100/k.textVerticalPositionInPercentage)};c.DynamicButton.Utilities.getButtonPaddingInPx=function(k){return k/c.DynamicButton.Constants.STANDARD_SPACING_DIVIDER};c.DynamicButton.Utilities.getSmileyTextSpacingInPx=function(k){return(k/c.DynamicButton.Constants.STANDARD_SPACING_DIVIDER)*c.DynamicButton.Constants.SPACING_TUNER_MULTIPLIER};c.DynamicButton.Utilities.createBackgroundSVG=function(s){var m="0 0 "+(s.buttonWidthInPx+2).toFixed(2)+" "+s.buttonHeightInPx.toFixed(2);var q="";var p=c.DynamicButton.Constants.BGCOLOR_ARRAY[s.bgColor][c.DynamicButton.Constants.BGCOLOR_START_INDEX];var n=c.DynamicButton.Constants.BGCOLOR_ARRAY[s.bgColor][c.DynamicButton.Constants.BGCOLOR_END_INDEX];var k=c.DynamicButton.Constants.BGCOLOR_ARRAY[s.bgColor][c.DynamicButton.Constants.BGCOLOR_BORDER_INDEX];var r="";var o="";var l="";return q+r+o+l};c.DynamicButton.Utilities.createASmileySVG=function(o){var m=o.textColor;var n="";var l="";var k=c.DynamicButton.Constants.A_WITH_SMILEY_SVG;return n+k+l};c.DynamicButton.Utilities.getSandboxWatermarkSign=function(p){var l=(p.buttonHeightInPx*(100-c.DynamicButton.Constants.SANDBOX_WATERMARK_VERTICAL_POSITION_PCT)/100).toFixed(2);var n=(((p.buttonWidthInPx-l-c.DynamicButton.Constants.MANDATORY_BUFFER_PX)/p.buttonWidthInPx)*100).toFixed(2);var o=c.DynamicButton.Constants.SANDBOX_WATERMARK_VERTICAL_POSITION_PCT;var m=(l/c.DynamicButton.Constants.DEFAULT_SANDBOX_WATERMARK_HEIGHT_PX).toFixed(2);var k=" "+c.DynamicButton.Constants.SANDBOX_WATERMARK_SVG;return k};c.DynamicButton.Utilities.createTextWrapperSVG=function(o,x,y){var t=c.DynamicButton.Constants.TEXT_SIZE_WxH_ARRAY[y.language][y.text][c.DynamicButton.Constants.WIDTH_INDEX];var m=c.DynamicButton.Constants.TEXT_SIZE_WxH_ARRAY[y.language][y.text][c.DynamicButton.Constants.HEIGHT_INDEX];var s=c.DynamicButton.Constants.TEXT_PATH_ADJUSTMENT[y.language][y.text][c.DynamicButton.Constants.RATIO_INDEX];var l=c.DynamicButton.Constants.TEXT_PATH_ADJUSTMENT[y.language][y.text][c.DynamicButton.Constants.SCALEX_INDEX];var k=c.DynamicButton.Constants.TEXT_PATH_ADJUSTMENT[y.language][y.text][c.DynamicButton.Constants.SCALEY_INDEX];var v=s*y.textWidthInPx/t;var r=(t*v).toFixed(2);var w=(m*v).toFixed(2);var z=l*v;var A=k*v;var q="";var n="";var p;if(f.IS_SANDBOX==="true"){p=c.DynamicButton.Utilities.getSandboxWatermarkSign(y)}else{p=""}var u=c.DynamicButton.Constants.BUTTON_SCRIPT_BASE_PATH+c.DynamicButton.Constants.FILEPATH_FOR_TEXT_SVG[y.language][y.text];h.ajaxSetup({cache:true});h.getScript(u,function(){var B=q+c.DynamicButton.Utilities.getTextSVG()+n;var C=""+B+"";h("#"+x+" div").html(o+C+p+"");a.publishMetricsForLPAButton(y.input,x,y.sellerId,true)});return y};c.DynamicButton.Utilities.mapSelectionBasedOnInput=function(q,l){var s=q.color||c.DynamicButton.Constants.DEFAULT_BACKGROUND_COLOR;var t=q.size||c.DynamicButton.Constants.DEFAULT_SIZE;var m=q.type||c.DynamicButton.Constants.DEFAULT_TYPE;switch(l){case"US":languageSelected=0;break;case"DE":languageSelected=1;break;case"FR":languageSelected=2;break;case"IT":languageSelected=3;break;case"ES":languageSelected=4;break;case"JP":languageSelected=5;break;default:languageSelected=0}switch(s.toLowerCase()){case j.GOLD:bgcolorSelected=0;textColor="#000000";break;case j.LIGHTGREY:bgcolorSelected=1;textColor="#000000";break;case j.DARKGREY:bgcolorSelected=2;textColor="#FFFFFF";break;default:bgcolorSelected=0;textColor="#000000"}var k=i.constants.BUTTON_LWA_SIZE_SET;if(k.indexOf(t.toLowerCase())>-1){sizeSelected=k.indexOf(t.toLowerCase())}else{sizeSelected=k.indexOf(c.DynamicButton.Constants.DEFAULT_SIZE.toLowerCase())}var p=i.constants.BUTTON_SVG_TEXT_SET;if(p.indexOf(m.toLowerCase())>-1){textSelected=p.indexOf(m.toLowerCase())}else{textSelected=p.indexOf(c.DynamicButton.Constants.DEFAULT_TYPE.toLowerCase())}var r=(typeof(q.height)==="number")?q.height:c.DynamicButton.Constants.USER_REQUESTED_DEFAULT_SIZE_PX;var o=(typeof(q.width)==="number")?q.width:c.DynamicButton.Constants.USER_REQUESTED_DEFAULT_SIZE_PX;var n=(typeof(q.aspectRatio)==="boolean")?q.aspectRatio:true;return new c.DynamicButton.Utilities.ButtonSpecification(textSelected,sizeSelected,r,o,n,languageSelected,bgcolorSelected,textColor)};c.DynamicButton.Utilities.getNontextSVGComponent=function(n){var l="";var k=c.DynamicButton.Utilities.createBackgroundSVG(n);var m=c.DynamicButton.Utilities.createASmileySVG(n);return(l+k+m)};c.DynamicButton.Utilities.createDynamicButton=function(l,n,k,m){var p=new c.DynamicButton.Utilities.mapSelectionBasedOnInput(l,n);p.input=l;p.sellerId=m;p=c.DynamicButton.Utilities.precomputeValues(p);var o=c.DynamicButton.Utilities.getNontextSVGComponent(p);if(!p.isTextOnButton){document.getElementById(k).innerHTML=o+""}else{c.DynamicButton.Utilities.createTextWrapperSVG(o,k,p)}return p};g.exports=c.DynamicButton},{"../core/Config":13,"../core/Constants":16,"../core/LPAMetricsHelper":23,"../core/jquery":38}],47:[function(b,h,d){var i=b("../core/Utilities");var g=b("../core/Config");var j=b("../core/utilities/MetricsStore");var k=b("../core/utilities/LocalStorageUtils").LocalStorageUtils;var a=b("../core/QueryString");var c={Metrics:{}};var f={};c.Metrics.QueryLogInfoKeys={SUB_PAGE_TYPE:"sub-page-type",PAGE_ACTION:"page-action",PAGE_TYPE_ID:"page-type-id",SELLER_ID:"merchant-id",WEBLAB_NAME:"weblab-name",WEBLAB_TREATMENT:"weblab-treatment",ADDITIONAL_REQUEST_DATA:"additional-request-data"};c.Metrics.PageActions={BUTTON_RENDER:"buttonrender",BUTTON_CLICK:"buttonclick"};c.Metrics.ProductTypes={APA:"apa",LPA:"lpa"};c.Metrics.MetricKeys={INFO:"info",ENTRIES:"entries"};c.Metrics.Tags={DYNAMIC:"dynamic"};c.Metrics.Collector=function(l){c.Metrics.Collector.prototype.constructor=c.Metrics.Collector;this.sellerId=l;this.metrics={};this.metrics.counters=[];this.metrics.timings=[];this.metrics.info=[];this.metrics.entries=[];this.id=(new Date()).getTime();this.published=false};c.Metrics.Collector.prototype.addTiming=function(n,l,o,m){if(!i.isEmptyOrUndefined(n)&&l!==null&&o!==null){this.metrics.timings.push(this.createTiming(n,l,o,m))}};c.Metrics.Collector.prototype.createTiming=function(o,m,p,n){var l={};l.name=o;l.time=Math.ceil(p-m);l.tags=n||[];return l};c.Metrics.Collector.prototype.addCounter=function(m,l){if(!i.isEmptyOrUndefined(m)){this.metrics.counters.push(this.createCounter(m,l))}};c.Metrics.Collector.prototype.createCounter=function(n,m){var l={};l.name=n;l.tags=m||[];return l};c.Metrics.Collector.prototype.addInfoOrEntry=function(l,n,m){if(!i.isEmptyOrUndefined(l)&&!i.isEmptyOrUndefined(n)){if(l===c.Metrics.QueryLogInfoKeys.ADDITIONAL_REQUEST_DATA&&m===c.Metrics.MetricKeys.INFO){this.addUpdateAdditionalRequestData(n);return}this.metrics[m].push(this.createInfo(l,n))}};c.Metrics.Collector.prototype.addUpdateAdditionalRequestData=function(o){var l=c.Metrics.QueryLogInfoKeys.ADDITIONAL_REQUEST_DATA;var n=this.metrics[c.Metrics.MetricKeys.INFO];if(!i.isEmptyOrUndefined(n)){for(var m=0;m=0){return}if(E.published){E=new c.Metrics.Collector(V)}var am=this.getAttribute("data-metric-name")||"lpa-button-loading";aj.push(this.getAttribute("data-abtest")==="true"?"abtest":"nonabtest");if(ah&&H){E.addTiming(am,H,ah,ai.concat(aj))}else{E.addTiming(am,G,ak,ai.concat(aj))}E.addTiming("lwa-button-clickable",z(),ak,ai.concat(aj));u.addLpaButtonAttributesToMetrics(K,Q,v);E.publish()};var af;var D=S.getElementsByTagName("img");var J;for(var Z=0;Z0){b(function(){g.each(function(){new OffAmazonPayments.HostedPayments.Donations.widget(e(this),e)})})}}a();return{cssFileName:d,widgetSelector:c}}; /** * Version: _V1528852527_ * Copyright 2011 Amazon.com, Inc., or its Affiliates. **/ if(typeof OffAmazonPayments==="undefined"){OffAmazonPayments={}}if(typeof OffAmazonPayments.HostedPayments==="undefined"){OffAmazonPayments.HostedPayments={}}if(typeof OffAmazonPayments.HostedPayments.Donations==="undefined"){OffAmazonPayments.HostedPayments.Donations={}}OffAmazonPayments.HostedPayments.Donations.widget=function(N,A){var L,p,G,M,E=N,f,c,s,i,r,h,d={"ap-light":true,"ap-dark":true};function J(){l();g();a();w();m();y()}function y(){if(L.preSelectedAmountsList){h=A(".ap-dw-selected",E);p=t(h.html())}else{h=A(i,E);p=t(h.val())}G=false;k();q()}function H(O){O=parseInt(O);if(isNaN(O)||O<0||O>3){return 1}return O}function m(){if(c){c.find(".ap-dw-list-item-link").click(n)}i.blur(C);i.focus(v)}function k(){i.val(B(p))}function u(O){if(O){h.removeClass("ap-dw-selected");h=O}h.addClass("ap-dw-selected");p=t(h.html());r.removeClass("ap-dw-selected ap-dw-value-set");K();k();q()}function I(O){s.addClass("ap-dw-error-active").html(O);r.addClass("ap-dw-error-active");f.addClass("ap-dw-error-active");G=true}function K(){s.removeClass("ap-dw-error-active");r.removeClass("ap-dw-error-active");f.removeClass("ap-dw-error-active");G=false}function q(){E.attr("data-ap-amount",p)}function D(){return p}function t(O){O=Number(O.replace(/[\$,]/g,""));return(Math.round(O*100)/100)}function n(O){if(h.hasClass("ap-dw-selected")&&h.get(0)===O.currentTarget){return}u(A(O.currentTarget))}function v(){if(i.val()===L.strings.defaultInputAmount||G){i.val("$")}r.addClass("ap-dw-selected");h.removeClass("ap-dw-selected")}function C(){if(e()){p=t(i.val());i.val(B(p));r.addClass("ap-dw-value-set");q()}}function o(O){if(G){O.preventDefault();O.stopPropagation();return false}M(O);return true}function B(O){if(typeof O!=="string"){O=O.toString()}O=O.replace(/[,\$]/g,"");O="$"+O.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");return O}function w(){var O=A("img",f);M=O.get(0).onclick;O.get(0).onclick=null;O.bind("click",o)}function j(O){if(isNaN(O)||O<0){I(L.errors.invalid);return false}else{if(OL.maxValue){I(L.errors.maxValue);return false}}}K();return true}function e(){var O=t(i.val());if(i.val()===""){i.val(L.strings.defaultInputAmount);return true}return j(O)}function a(){OffAmazonPayments.HostedPayments.LoadButtonInEl(A,f,E)}function l(){var P=E.attr("data-ap-widget-amount-presets"),O=E.attr("data-ap-widget-default-amount"),Q=E.attr("data-ap-widget-theme");L={minValue:5,maxValue:150000,cssTheme:(Q&&d[Q])?Q:"ap-light",strings:{defaultInputAmount:"$0",defaultAmountOther:"other",donate:"Donate",otherOptions:"Other Options"},errors:{minValue:"The amount you entered is less than the minimum value",maxValue:"The amount you entered is more than the maximum amount",invalid:"You entered an invalid amount"}};if(P){L.preSelectedAmount=H(O);L.preSelectedAmountsList=P.split(",")}else{if(O===L.strings.defaultAmountOther){L.preSelectedAmount=O}}}function g(){var S=E.get(0),R=document.createElement("div"),Q=document.createElement("span"),P=document.createElement("div"),O;S.className="ap-dw-container "+L.cssTheme;R.className="ap-dw-main";Q.className="ap-dw-error";P.className="ap-dw-button";P.id="ap-button-"+Math.floor((Math.random()*1000000000)+1).toString();if(L.preSelectedAmountsList){O=F(R);b(O);z(O);R.appendChild(O)}else{x(R,true)}R.appendChild(Q);s=A(Q);R.appendChild(P);f=A(P);S.appendChild(R)}function F(Q){var O=document.createElement("h3"),P=document.createElement("div");O.className="ap-dw-main-heading";O.innerHTML=L.strings.donate;Q.appendChild(O);P.className="ap-dw-content-container ap-dw-cf";return P}function b(S){var R=document.createElement("ul"),O,P;R.className="ap-dw-list ap-dw-cf";for(var Q=0;Q<4;Q++){O=document.createElement("li");P=document.createElement("a");O.className="ap-dw-list-item";if(Q===L.preSelectedAmount){P.className="ap-dw-list-item-link ap-dw-selected"}else{P.className="ap-dw-list-item-link"}P.innerHTML="$"+L.preSelectedAmountsList[Q];O.appendChild(P);R.appendChild(O)}S.appendChild(R);c=A(R)}function z(R){var S=document.createElement("div"),Q=document.createElement("div"),P=document.createElement("div"),O=document.createElement("h4");S.className="ap-dw-optional ap-dw-cf";Q.className="ap-dw-optional-container";P.className="ap-dw-optional-container";O.className="ap-dw-optional-heading";O.innerHTML=L.strings.otherOptions;x(P,false);Q.appendChild(O);S.appendChild(Q);S.appendChild(P);R.appendChild(S)}function x(R,Q){var P=document.createElement("div"),O=document.createElement("input");Q=Q?" ap-dw-input-only ap-dw-selected":"";P.className="ap-dw-optional-input-container"+Q;O.className="ap-dw-optional-input";O.type="text";O.value=L.strings.defaultInputAmount;P.appendChild(O);R.appendChild(P);r=A(P);i=A(O)}J();return{applyInputFormatRules:B,getAmount:D,getNumberValue:t,handleButtonClick:o}}; /** * Version: _V1528852527_ * Copyright 2011 Amazon.com, Inc., or its Affiliates. **/ var LOGIN_STATE={LOADED:"loaded",COMPLETE:"complete"};if(typeof OffAmazonPayments==="undefined"){OffAmazonPayments={}}if(OffAmazonPayments.Loader===undefined){OffAmazonPayments.Loader={loginJsUrl:"https://api-cdn.amazon.com/sdk/login1.js"}}if(OffAmazonPayments.HostedPayments===undefined){OffAmazonPayments.HostedPayments={}}OffAmazonPayments.Loader.LOGINJS_NAME="OffAmazonPaymentsLoginJS";OffAmazonPayments.Loader.CanLoadChildScriptsAsynchronously=function(){if(document.currentScript){return document.currentScript.async}return a();function b(c){var d=c.getAttribute("src");return(d!==null&&d.indexOf("OffAmazonPayments")!==-1&&d.indexOf("Widgets.js")!==-1)}function a(){var c=document.getElementsByTagName("script");var e;var d;var f;for(d=0;d0){for(var j=0;j<\/script>")}catch(h){var i=new OffAmazonPayments.Metrics.Collector();i.addCounter("chrome-browser-cross-origin-script-block");i.publish()}var b=document.getElementById(OffAmazonPayments.Loader.LOGINJS_NAME);if(b){d(b,c)}else{a()}}function c(){j();f(document).ready(g)}function d(e,k){if(e.readyState){e.onreadystatechange=function(){if(e.readyState===LOGIN_STATE.LOADED||e.readyState===LOGIN_STATE.COMPLETE){k()}}}else{e.onload=k}}function a(){var e=document.createElement("script");e.setAttribute("src",OffAmazonPayments.Loader.loginJsUrl);d(e,c);document.getElementsByTagName("script")[0].parentNode.appendChild(e)}};OffAmazonPayments.Loader.WrappedInUserErrorMetrics=function(a){return function(){try{a()}catch(c){var b=new OffAmazonPayments.Metrics.Collector();b.addCounter("js-user-error",window.location.host);b.publish();throw c}}};(function(c){var e;if(typeof amazon!=="undefined"){e=amazon}var b=OffAmazonPayments.Loader.WrappedInUserErrorMetrics;var f=b(window.onAmazonPaymentsReady||function(){});var d=b(window.AmazonPaymentReady||function(){});b(function(){if(typeof window._saved_onAmazonLoginReady==="function"){window._saved_onAmazonLoginReady();window.onAmazonLoginReady=window._saved_onAmazonLoginReady;delete window._saved_onAmazonLoginReady}})();var a=[f,d];var g=[OffAmazonPayments.HostedPayments.HtmlButtonLoader,OffAmazonPayments.HostedPayments.Donations];OffAmazonPayments.Loader.AddLwaScriptIfMissingAndPerformCallback(c,e,a,g)}(OffAmazonPayments.jQuery)); OffAmazonPayments.DynamicConfig={ "rebrandingMerchantBlackList": ["A1LUP9T9ADZJTX","A2QF570IEOEZL4","A1NP6GS0UOGPC5","A2XQ64JWDMR8FN","A3IWUTOTQMSZYA","A31F7GFAOMRQJZ","AE7CKJHBFKJ4G","A1Q369M2C7ILUR","ALQZB4PI0YCVW","A1JAOSGACL7V1G","AUDJ2SVBGV53F","A27K2SMVAN0TJ9","A175LKWYQ1WBIB","A1218JTXPK1FDN","A3IW95BME9LBP0","A2641W6IJ9WIK7","A3AV9JKRW5J0K","AJHX273HXBPMZ","A1AHMSQ5FMXMZ7","A25ONLSFRR6XYS","A2FQQKG3CEY2ZW","A3X9FZ21LLIWX","A2TR52CLDGPEGK","A140IDPMFIKDRV","A25IMQNBV4DDWX","A3TJ28DDZ2EIMA","A2LFGGIK3BYQKR","A1BM4DYZ9G3UHR","A2ZQ2XSI9KJ373","AD7S3RZ40K7BL","A109XUG209E1SR","A130Y5AF6Z7KAK","A13JGR0DTTEDV1","A1NGKO3BKQ6B6P","A1SZT82RBRDU5P","A1X70XMSJQOUIF","A24TQFDAVMWH10","A273N2L4YG88HY","A2AFBKAH5YQYG4","A2CT8SVRB9WXL1","A2F4YRU4SELH9","A2NZE4UHGV8S7W","A2Q3QSPE2HOG4T","A2ZZZWWR5QQD3V","A38GKEMPD30549","A39KYKHKR6MA05","A39V1VMT78QSH7","A3EX1KZ6EDBQNX","A4ES1HE89DCB","A4U8QO4UBSRDW","AHO3AJUTRCU1T","AIOVQ9IKNMTSG","AJSCF15KSKNAG","AS0HR1AXA0P2K","AW0ZJDK3ARB0N","AXN8FH7STRIFO","A30FVL0735QRBJ","A35EOB5ZMYRXSI","A2BFDVYNBQ89Q", "A2TPIY28J6VK2X"], "enableAccountStatusChecking": true, "newWidgetsABTestingEnabled": false, "newWidgetsABTestingMerchants": ["A3L1MEPNE90YE9","A301MOKR7J2O52","A2906204291OA0","A2VG2N28IEQS4H","AGMRN16DUU05L","A2R0A0L3A5S4UB","A248SFX4F4IZ91","AXABESOZ4WCBM","A35FXTRULZ7ETI","A26256N2D9TGAB","A31LWM2LL2XT05","A3THCZR0UTPPF5","A1U4AM9LJDRC46","A2BE5GKNETTJ3M","A2S62GNUK1SPD5","A1LNEMKFL8PIZX","A1MJZWVFGD006R", "A3L1MEPNE90YE9"], "useStaticBridge": true, "staticBridgeHost": "static-na.payments-amazon.com", "weblabOverrides": {"LWA_LOGIN_CONSENT_CUSTOMIZATION": "C", "LWA_AUI_MIGRATION": "C"}, "useStaticBridgeNewWidgets": true, "staticBridgeHostNewWidgets": "static-na.payments-amazon.com", "serveButtonsFromCloudFront": true, "enableButtonABTesting": true, "enableABTestV2": false, "highResButtonImageUseSrcset": true }