Skip to content

Instantly share code, notes, and snippets.

@JayPanoz
Last active April 21, 2018 10:23
Show Gist options
  • Save JayPanoz/f31ca54f9e478717b68b120a1fd443da to your computer and use it in GitHub Desktop.
Save JayPanoz/f31ca54f9e478717b68b120a1fd443da to your computer and use it in GitHub Desktop.
What KP does behind the scenes for KFX
/*
* Copyright (c) 2015 Amazon.com. All rights reserved.
KP 3.21.0
*/
var fa = {
SUCCESS: 0,
HTML_LOAD_FAILURE: 1,
INJECTION_FAILURE: 2,
JAVASCRIPT_FAILURE: 3,
INTERNAL_FAILURE: 4,
INVALID_ARGUMENTS: 5,
DOCUMENT_INVALID: 6,
INCOMPATIBLE_PHANTOMJS: 7,
MEDIA_QUERY_USED_FOR_NON_FIXED_LAYOUT: 8,
FAILURE_FROM_SIMULATOR: 9,
UNSUPPORTED_PSEUDO_SELECTORS: 10,
MEDIA_QUERY_USED_FOR_FIXED_LAYOUT: 11,
UNSUPPORTED_VALUE_FROM_TOP_DOWN_TRANSFORMER: 12,
FIXED_LAYOUT_WITH_TEXT: 13,
FONT_SIZE_ZERO: 14,
PREPROCESS_TRANSFORMER_FAILED: 15,
PATTERN_FAILURE_START: 20,
PATTERN_FAILURE_FLOAT_LEFT_CLEAR_BOTH: 21,
PATTERN_FAILURE_FLOAT_RIGHT_CLEAR_BOTH: 22,
PATTERN_FAILURE_FLOAT_LEFT_CLEAR_LEFT: 23,
PATTERN_FAILURE_FLOAT_RIGHT_CLEAR_RIGHT: 24,
PATTERN_FAILURE_MINH_POS_ABS_HEIGHT: 25,
PATTERN_FAILURE_DISPLAY_INLINE_BOXSIZING: 26,
PATTERN_FAILURE_WEBKIT_TRANSFORM_TRANSLATE: 27,
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATEX: 28,
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATEY: 29,
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATE3d: 30,
PATTERN_FAILURE_WEBKIT_TRANSFORM_SCALE3d: 31,
PATTERN_FAILURE_BGIMAGE_LINEAR_GRADIENT: 32,
PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_LEFT_INLINE: 33,
PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_RIGHT_INLINE: 34,
PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_LEFT_INLINE: 35,
PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_RIGHT_INLINE: 36,
PATTERN_FAILURE_END: 121,
RULE_FAILURE_UNSUPPORTED_STYLE: 130,
RULE_FAILURE_UNSUPPORTED_CONTENT_BEFORE_LI: 131,
RULE_FAILURE_FIRSTLINE_UNSUPPORTED_DISPLAY_TAG: 132,
RULE_FAILURE_INLINECHILD_UNSUPPORTED_DISPLAY_TAG: 133,
RULE_FAILURE_FIRSTLETTER_UNSUPPORTED: 134,
RULE_FAILURE_FIRSTLETTER_NOT_FOUND: 135,
EMPTY_TAG_AFTER_FLOAT: 136,
DROP_CAP_PARA_LINE_HEIGHT_ZERO: 137,
MATHML_UNSUPPORTED_TAG: 138
},
ga = {
ATTRIBUTE_STYLE: "style"
},
ha = {
error: function(a) {
console.error("[ERROR] : " + a)
},
warn: function(a) {
console.warn("[WARNING] : " + a)
},
info: function(a) {
console.log("[INFO] : " + a)
}
},
ia = {
width: 1200,
height: 1E3
},
f = {
errorCodeList: {
SUCCESS: {
id: 0,
category: "SKIPPABLE",
desc: "Success"
},
HTML_LOAD_FAILURE: {
id: 1,
category: "FATAL",
desc: "HTML Load Failure"
},
INJECTION_FAILURE: {
id: 2,
category: "FATAL",
desc: "Injection Failure"
},
JAVASCRIPT_FAILURE: {
id: 3,
category: "FATAL",
desc: "Javascript Failure"
},
INTERNAL_FAILURE: {
id: 4,
category: "FATAL",
desc: "Internal failure occured during processing"
},
INVALID_ARGUMENTS: {
id: 5,
category: "FATAL",
desc: "Invalid Arguments"
},
DOCUMENT_INVALID: {
id: 6,
category: "FATAL",
desc: "Document Invalid"
},
INCOMPATIBLE_PHANTOMJS: {
id: 7,
category: "FATAL",
desc: "Incompatible PhantomJS"
},
MEDIA_QUERY_USED_FOR_NON_FIXED_LAYOUT: {
id: 8,
category: "SKIPPABLE",
desc: "Mobi Media Query used for Non Fixed Layout Book"
},
FAILURE_FROM_SIMULATOR: {
id: 9,
category: "SKIPPABLE",
desc: "Preprocessor Failure from simulator."
},
UNSUPPORTED_PSEUDO_SELECTORS: {
id: 10,
category: "SKIPPABLE",
desc: "Unsupported pseudo selectors used, hence failing"
},
MEDIA_QUERY_USED_FOR_FIXED_LAYOUT: {
id: 11,
category: "SKIPPABLE",
desc: "Unsupported Media Query used for Fixed Layout Book"
},
UNSUPPORTED_VALUE_FROM_TOP_DOWN_TRANSFORMER: {
id: 12,
category: "SKIPPABLE",
desc: "Unsupported Value From Top Down Transformer"
},
FIXED_LAYOUT_WITH_TEXT: {
id: 13,
category: "SKIPPABLE",
desc: "FL Book with text is not supported"
},
FONT_SIZE_ZERO: {
id: 14,
category: "SKIPPABLE",
desc: "Font Size Zero"
},
PREPROCESS_TRANSFORMER_FAILED: {
id: 15,
category: "SKIPPABLE",
desc: "Internal failure occured during processing"
},
BOX_POSITION_CALCULATION_FAILURE: {
id: 16,
category: "SKIPPABLE",
desc: "Box Positions can not be calcuated for non box elements"
},
OBJECT_NOT_INITIALIZED: {
id: 17,
category: "SKIPPABLE",
desc: "The object has not been initialized : "
},
VALIDATOR_FAILURE: {
id: 18,
category: "FATAL",
desc: "Validator encountered a failure : "
},
INVALID_PROPERTY_VALUE: {
id: 19,
category: "SKIPPABLE",
desc: "Unexpected call happened to fetch value."
},
PATTERN_FAILURE_START: {
id: 20,
category: "UNUSED",
desc: "Unused Error Code marking the start of pattern failure error codes."
},
PATTERN_FAILURE_FLOAT_LEFT_CLEAR_BOTH: {
id: 21,
category: "SKIPPABLE",
desc: "Pattern Failure Float Left Clear Both"
},
PATTERN_FAILURE_FLOAT_RIGHT_CLEAR_BOTH: {
id: 22,
category: "SKIPPABLE",
desc: "Pattern Failure Float Right Clear Both"
},
PATTERN_FAILURE_FLOAT_LEFT_CLEAR_LEFT: {
id: 23,
category: "SKIPPABLE",
desc: "Pattern Failure Float Left Clear Left"
},
PATTERN_FAILURE_FLOAT_RIGHT_CLEAR_RIGHT: {
id: 24,
category: "SKIPPABLE",
desc: "Pattern Failure Float Right Clear Right"
},
PATTERN_FAILURE_MINH_POS_ABS_HEIGHT: {
id: 25,
category: "SKIPPABLE",
desc: "Pattern Failure Min H Pos Abs Height"
},
PATTERN_FAILURE_DISPLAY_INLINE_BOXSIZING: {
id: 26,
category: "SKIPPABLE",
desc: "Pattern Failure Display Inline Boxsizing"
},
PATTERN_FAILURE_WEBKIT_TRANSFORM_TRANSLATE: {
id: 27,
category: "SKIPPABLE",
desc: "Pattern Failure Webkit Transform Translate"
},
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATEX: {
id: 28,
category: "SKIPPABLE",
desc: "Pattern Failure Webkit Transform Rotate X"
},
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATEY: {
id: 29,
category: "SKIPPABLE",
desc: "Pattern Failure Webkit Transform Rotate Y"
},
PATTERN_FAILURE_WEBKIT_TRANSFORM_ROTATE3d: {
id: 30,
category: "SKIPPABLE",
desc: "Pattern Failure Webkit Transform Rotate 3D"
},
PATTERN_FAILURE_WEBKIT_TRANSFORM_SCALE3d: {
id: 31,
category: "SKIPPABLE",
desc: "Pattern Failure Webkit Transform Scale 3D"
},
PATTERN_FAILURE_BGIMAGE_LINEAR_GRADIENT: {
id: 32,
category: "SKIPPABLE",
desc: "Pattern Failure Background Image Linear Gradient"
},
PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_LEFT_INLINE: {
id: 33,
category: "SKIPPABLE",
desc: "Pattern Failure Background Color Margin Left Inline"
},
PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_RIGHT_INLINE: {
id: 34,
category: "SKIPPABLE",
desc: "Pattern Failure Background Color Margin Right Inline"
},
PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_LEFT_INLINE: {
id: 35,
category: "SKIPPABLE",
desc: "Pattern Failure Background Image Margin Left Inline"
},
PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_RIGHT_INLINE: {
id: 36,
category: "SKIPPABLE",
desc: "Pattern Failure Background Image Margin Right Inline"
},
PATTERN_FAILURE_END: {
id: 121,
category: "UNUSED",
desc: "Unused Error Code marking the end of pattern failure error codes."
},
RULE_FAILURE_UNSUPPORTED_STYLE: {
id: 130,
category: "SKIPPABLE",
desc: "Tag cannot be handled for the given html file. Tag & HtmlFile :: "
},
RULE_FAILURE_UNSUPPORTED_CONTENT_BEFORE_LI: {
id: 131,
category: "SKIPPABLE",
desc: "li tag cannot be handled for the given html file. Selector & HtmlFile :: "
},
RULE_FAILURE_FIRSTLINE_UNSUPPORTED_DISPLAY_TAG: {
id: 132,
category: "SKIPPABLE",
desc: "FirstLine::first-line is applied to unsupported display tag. Display = "
},
RULE_FAILURE_INLINECHILD_UNSUPPORTED_DISPLAY_TAG: {
id: 133,
category: "SKIPPABLE",
desc: "FirstLine::Inline node is having child nodes with unsupported display. Display = "
},
RULE_FAILURE_FIRSTLETTER_UNSUPPORTED: {
id: 134,
category: "SKIPPABLE",
desc: "first-letter cannot be handled for the given html file. HtmlFile ::"
},
RULE_FAILURE_FIRSTLETTER_NOT_FOUND: {
id: 135,
category: "SKIPPABLE",
desc: "FirstLetter::Could not find valid first letter content"
},
EMPTY_TAG_AFTER_FLOAT: {
id: 136,
category: "SKIPPABLE",
desc: "Found empty tag without explicit height after a float"
},
DROP_CAP_PARA_LINE_HEIGHT_ZERO: {
id: 137,
category: "SKIPPABLE",
desc: "Found dropcap paragraph with zero line height"
},
MATHML_UNSUPPORTED_TAG: {
id: 138,
category: "FATAL",
desc: "Found unsupported mathml tag"
}
},
Pa: function(a) {
return (a = f.ha(a)) ? a.id : -1
},
Ee: function(a) {
return (a = f.ha(a)) ? a.category : -1
},
ha: function(a) {
return f.errorCodeList[a]
}
},
q = {};
function r(a, b, c) {
this.errorCode = a;
this.errorMessage = b;
this.srcId = c
}
r.prototype.Pa = function() {
return f.Pa(this.errorCode)
};
function w(a) {
return a.errorCode
}
q.ab = function() {
jsonData = {
errorInfo: []
};
for (var a = 0; a < q.errorList.length; a++) jsonData.errorInfo[a] = q.$d(q.errorList[a]);
return JSON.stringify(jsonData)
};
q.$d = function(a) {
return {
errorCode: String(a.Pc),
srcId: String(a.ee),
data: String(a.message)
}
};
q.errorList = [];
q.bb = function() {
q.skipFailures = !0
};
q.yb = function(a, b) {
var c = f.ha(a);
return "[GRACEFUL_CONV]:" + c.id + ":" + a + ":" + c.desc + " " + b
};
q.ic = function(a) {
return "SKIPPABLE" == a.category && !0 === q.skipFailures ? !1 : !0
};
q.h = function(a, b) {
b || (b = "");
var c = f.ha(a);
if (!c) throw new r(a, d, -1);
var d = q.yb(a, b);
if (q.ic(c)) throw new r(a, d, -1);
q.errorList.push(c.id)
};
q.h = function(a, b, c) {
c || (c = "");
b && null != b || (b = -1);
var d = f.ha(a);
if (!d) throw new r(a, e, b);
var e = q.yb(a, c);
if (q.ic(d)) throw new r(a, e, b);
q.errorList.push({
Pc: d.id,
ee: b,
message: c
})
};
q.Zc = function() {
return q.ab()
};
var ja = "min-height:*:%;position:absolute:*|height:*:*|DIRECT_DESCENDANT|PATTERN_FAILURE_MINH_POS_ABS_HEIGHT background-image:-webkit-linear-gradient:*||NONE|PATTERN_FAILURE_BGIMAGE_LINEAR_GRADIENT|STARTS_WITH display:inline:*;margin-left:*|display:inline:*;background-color:*|DESCENDANT|PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_LEFT_INLINE display:inline:*;margin-right:*|display:inline:*;background-color:*|DESCENDANT|PATTERN_FAILURE_BACKGROUND_COLOR_MARGIN_RIGHT_INLINE display:inline:*;margin-left:*|display:inline:*;background-image:*|DESCENDANT|PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_LEFT_INLINE display:inline:*;margin-right:*|display:inline:*;background-image:*|DESCENDANT|PATTERN_FAILURE_BACKGROUND_IMAGE_MARGIN_RIGHT_INLINE".split(" ");
function ka(a) {
var b = {
value: void 0,
unit: ""
};
if (null === a) return b;
a = a.trim();
b.value = a;
if (-1 !== a.search(/^[-A-Za-z\s]+$/)) return b;
for (var c = 3; 1 <= c; c--)
if (-1 !== [
["%"], "em px pt cm in ex mm pc".split(" "), ["rem"]
][c - 1].indexOf(a.slice(-c))) {
var d = a.substr(0, a.length - c); - 1 !== d.search(/^-?\d*\.?\d+$/) && (b.value = d, b.unit = a.substr(a.length - c));
break
}
return b
}
function ya() {
function a(a) {
a = a.split("|");
this.ruleNodes = [];
this.ruleNodes.push(new b(a[0].trim()));
this.ruleNodes.push(new b(a[1].trim()));
this.relation = a[2];
this.errorCode = a[3];
this.searchType = a[4]
}
function b(a) {
this.styleNodes = [];
this.visitors = [];
if (void 0 !== a) {
a = a.split(";");
for (var b = 0; b < a.length; b++) {
var d = a[b].trim();
"" !== d && this.styleNodes.push(new c(d))
}
}
}
function c(a) {
a = a.split(":");
3 === a.length ? (this.styleName = a[0].trim(), this.styleValue = a[1].trim(), this.styleUnit = a[2].trim()) : 2 === a.length &&
(this.styleName = a[0].trim(), a = ka(a[1].trim()), this.styleValue = a.value, this.styleUnit = "" === a.unit ? "*" : a.unit)
}
var d = document,
e = this,
g = {
NONE: "NONE",
ANY: "ANY",
BEFORE: "BEFORE",
DESCENDANT: "DESCENDANT",
DIRECT_DESCENDANT: "DIRECT_DESCENDANT"
},
h = [];
c.prototype.Ld = function(a, b, c) {
if (void 0 === c || null == c) return a === b || "*" === a || "*" === b ? !0 : !1;
switch (c) {
case "STARTS_WITH":
if (0 == b.indexOf(a)) return !0;
break;
case "ANY":
if (-1 != b.indexOf(a)) return !0;
break;
default:
if (a === b || "*" === a || "*" === b) return !0
}
return !1
};
c.prototype.Oc =
function(a, b) {
return this.styleName === a.styleName && this.Ld(this.styleValue.toLowerCase().trim(), a.styleValue.toLowerCase().trim(), b) && (this.styleUnit === a.styleUnit || "*" === this.styleUnit || "*" === a.styleUnit)
};
c.prototype.toString = function() {
return "(" + this.styleName + "," + this.styleValue + "," + this.styleUnit + ")"
};
b.prototype.lc = function(a, b) {
for (var c = 0; c < this.styleNodes.length; c++) {
for (var d = !1, e = 0; e < a.styleNodes.length; e++)
if (this.styleNodes[c].Oc(a.styleNodes[e], b)) {
d = !0;
break
}
if (!d) return !1
}
return !0
};
b.prototype.pa = function(a) {
this.visitors.push([!0, a])
};
b.prototype.ne = function(a) {
for (var b = 0; b < this.visitors.length; b++) !this.visitors[b][0] || void 0 !== a && this.visitors[b][1] !== a || (this.visitors[b][0] = !1, this.visitors[b][1] = void 0)
};
b.prototype.za = function() {
for (var a = [], b = 0; b < this.visitors.length; b++) this.visitors[b][0] && a.push(this.visitors[b][1]);
return a
};
b.prototype.Md = function(a) {
for (var b = 0; b < this.visitors.length; b++)
if (this.visitors[b][0] && this.visitors[b][1] === a) return !0;
return !1
};
b.prototype.toString =
function() {
for (var a = "[ StyleNodes => ", b = 0; b < this.styleNodes.length; b++) a += this.styleNodes[b].toString() + ", ";
if (0 < this.visitors.length)
for (a += " Visitors => ", b = 0; b < this.visitors.length; b++) a += "(" + this.visitors[b][0] + ", " + this.visitors[b][1] + ")";
return a + "]"
};
a.prototype.toString = function() {
for (var a = "{ " + this.relation + " ", b = 0; b < this.ruleNodes.length; b++) a += this.ruleNodes[b].toString() + " | ";
return a + "}"
};
e.Od = function() {
for (var b = [], c = 0; c < ja.length; c++) b.push(new a(ja[c]));
return b
};
e.qb = function(a) {
if (a.nodeType ===
d.ELEMENT_NODE || a.nodeType === d.DOCUMENT_NODE) {
var b = e.we(a),
c = {};
if (void 0 === b.status) return c;
if ("PASS" !== b.status) return c.failProcessing = !0, c.errorCode = b.errorCode, c.srcId = b.srcId, c;
for (var b = null != a.childNodes ? a.childNodes.length : 0, g = 0; g < b; g++) {
var h = this.qb(a.childNodes[g]);
if (null != h && h.failProcessing) return c.failProcessing = !0, c.errorCode = h.errorCode, c.srcId = h.srcId, c
}
e.Ic(a);
c.failProcessing = !1;
c.errorCode = "SUCCESS";
return c
}
};
e.we = function(a) {
var b = {},
c = e.Jc(a),
d = a.getAttribute("amzn-src-id");
if (0 === c.styleNodes.length) return b;
for (var p = 0; p < h.length; p++) {
var t = h[p],
u = [];
u.push(t.ruleNodes[0].lc(c, t.searchType));
u.push(t.ruleNodes[1].lc(c, t.searchType));
if (u[0] || u[1]) switch (t.relation) {
case g.NONE:
if (u[0]) return b.status = "FAIL_NONE", b.srcId = d, b.errorCode = t.errorCode, b;
break;
case g.ANY:
if (u[0]) {
if (0 < t.ruleNodes[1].za().length) return b.status = "FAIL_ANY", b.errorCode = t.errorCode, b.srcId = d, b;
t.ruleNodes[0].pa(a)
} else {
if (0 < t.ruleNodes[0].za().length) return b.status = "FAIL_ANY", b.errorCode = t.errorCode,
b.srcId = d, b;
t.ruleNodes[1].pa(a)
}
break;
case g.BEFORE:
if (u[0]) t.ruleNodes[0].pa(a);
else if (0 < t.ruleNodes[0].za().length) return b.status = "FAIL_BEFORE", b.errorCode = t.errorCode, b.srcId = d, b;
break;
case g.DESCENDANT:
if (u[1]) t.ruleNodes[1].pa(a);
else if (0 < t.ruleNodes[1].za().length) return b.status = "FAIL_DESCENDANT", b.errorCode = t.errorCode, b.srcId = d, b;
break;
case g.DIRECT_DESCENDANT:
if (u[1]) t.ruleNodes[1].pa(a);
else if (t.ruleNodes[1].Md(a.parentNode)) return b.status = "FAIL_DIRECT_DESCENDANT", b.errorCode = t.errorCode,
b.srcId = d, b
}
}
b.status = "PASS";
return b
};
e.Ic = function(a) {
for (var b = 0; b < h.length; b++) {
var c = h[b];
if (c.relation === g.DESCENDANT || c.relation === g.DIRECT_DESCENDANT)
for (var d = 0; d < c.ruleNodes.length; d++) c.ruleNodes[d].ne(a)
}
};
e.Jc = function(a) {
a = a.attributes.getNamedItem("style");
return void 0 !== a && void 0 !== a.nodeValue ? new b(a.nodeValue.trim()) : new b
};
e.La = function() {
h = e.Od();
return e.qb(d.documentElement)
}
}
function za(a) {
var b = x;
this.document = document;
this.a = b;
this.skipFailures = a;
this.Za = ["margin-left", "margin-right", "text-indent"];
this.Vb = {};
this.Xb = {};
for (a = 0; a < this.Za.length; a++) this.Vb[this.Za[a]] = 0, this.Xb[this.Za[a]] = 0
}
function Aa(a, b, c) {
var d = a[b];
if (null === d || void 0 === d) a = "Property : " + b + ", Expected property should be one of : " + a, q.h("INVALID_PROPERTY_VALUE", c.getAttribute("amzn-src-id"), a);
return d
}
function Ba(a, b) {
this.document = a;
this.Kb = b;
this.cc = ["margin-left", "margin-right"]
}
Ba.prototype.g = function() {
var a = this.document.body.style;
if (null === a || void 0 === a) console.log("Body does not have style. Skipping the normalization.");
else
for (var b = 0; b < this.cc.length; b++) {
var c = a,
d = this.cc[b],
e = c[d];
if (null === e || void 0 === e || "" === e) console.log(d + " is not defined at body. Skipping the normalization.");
else {
if (!(e = Ca(this, d)) && !(e = "margin-left" === d && Ca(this, "text-indent"))) {
var e = d,
g = Aa(this.Kb.Vb, e, this.document.body);
5E4 <= g ? (console.log(e + " exceeds the max limit value:" + g), e = !0) :
e = !1
}
e || (console.log("Removing the property:" + d + ", value:" + c[d] + " from body tag"), c[d] = "")
}
}
};
function Ca(a, b) {
var c = Aa(a.Kb.Xb, b, a.document.body);
return 0 > c ? (console.log(b + " has negative value:" + c), !0) : !1
}
function Da(a) {
this.document = a
}
Da.prototype.g = function(a) {
Ea(this, a)
};
function Ea(a, b) {
if (b.nodeType !== Node.ELEMENT_NODE) return !1;
for (var c = b.childNodes, d = !0, e = 0; e < c.length; e++) c[e].nodeType === Node.ELEMENT_NODE && (Ea(a, c[e]) || (d = !1));
"absolute" === b.style.position && (d = !1);
if (c = "relative" === b.style.position)
if (c = d) var c = getComputedStyle(b).getPropertyValue("top"),
e = getComputedStyle(b).getPropertyValue("left"),
g = getComputedStyle(b).getPropertyValue("right"),
h = getComputedStyle(b).getPropertyValue("bottom"),
c = Fa(c) && Fa(e) && Fa(g) && Fa(h) ? !0 : !1;
c && (b.style.removeProperty("position"),
b.style.removeProperty("top"), b.style.removeProperty("left"), b.style.removeProperty("right"), b.style.removeProperty("bottom"));
"relative" === b.style.position && (d = !0);
return d
}
function Fa(a) {
return "0px" !== a && "" !== a && null !== a && "auto" !== a ? !1 : !0
}
function Ga(a) {
this.document = a
}
function Ha(a) {
if (null === a) return null;
a = a.trim().split(";");
var b = "";
for (i = 0; i < a.length; i++) {
var c = a[i].trim().split(":")[1];
void 0 !== c && null !== c && (b = b + a[i].trim() + ";")
}
return b
}
Ga.prototype.g = function(a) {
if (void 0 !== a.style && null !== a.style && "" !== a.style.fontSize) {
var b = parseFloat(a.style.fontSize);
isNaN(b) || 0 != b || (a.style.fontSize = "2px")
}
a.setAttribute("style", Ha(a.getAttribute("style")))
};
function Ia(a, b) {
this.document = a;
this.Bc = b.addDisplay;
this.zc = b.addBorderColor;
this.Cc = b.addListStyleType;
this.Ac = b.addBorderWidth;
this.hasZIndexStyle = !1
}
Ia.prototype.g = function(a, b) {
if (a.nodeType == Node.ELEMENT_NODE && "object" === typeof a.style) {
this.Bc && (a.style.display = a.ownerDocument.defaultView.getComputedStyle(a).display);
if (this.zc) {
var c = a.ownerDocument.defaultView.getComputedStyle(a);
"" !== a.style.borderLeftStyle && (a.style.borderLeftColor = c.borderLeftColor);
"" !== a.style.borderRightStyle && (a.style.borderRightColor = c.borderRightColor);
"" !== a.style.borderTopStyle && (a.style.borderTopColor = c.borderTopColor);
"" !== a.style.borderBottomStyle && (a.style.borderBottomColor =
c.borderBottomColor)
}
this.Ac && (null != a.parentNode && (c = a.parentNode.style, null != c && void 0 !== c && ("" !== a.style.borderLeftStyle && "inherit" === a.style.borderLeftWidth && ("" !== c.borderLeftWidth ? a.style.borderLeftWidth = c.borderLeftWidth : a.style.borderLeftWidth = "0px"), "" !== a.style.borderRightStyle && "inherit" === a.style.borderRightWidth && ("" !== c.borderRightWidth ? a.style.borderRightWidth = c.borderRightWidth : a.style.borderRightWidth = "0px"), "" !== a.style.borderTopStyle && "inherit" === a.style.borderTopWidth && ("" !== c.borderTopWidth ?
a.style.borderTopWidth = c.borderTopWidth : a.style.borderTopWidth = "0px"), "" !== a.style.borderBottomStyle && "inherit" === a.style.borderBottomWidth && ("" !== c.borderBottomWidth ? a.style.borderBottomWidth = c.borderBottomWidth : a.style.borderBottomWidth = "0px"))), "inherit" === a.style.borderLeftWidth && (a.style.borderLeftWidth = ""), "inherit" === a.style.borderRightWidth && (a.style.borderRightWidth = ""), "inherit" === a.style.borderTopWidth && (a.style.borderTopWidth = ""), "inherit" === a.style.borderBottomWidth && (a.style.borderBottomWidth =
""));
!this.Cc || "ul" != a.nodeName.toLowerCase() && "ol" != a.nodeName.toLowerCase() || ("" == a.style.listStyleType && (a.style.listStyleType = a.ownerDocument.defaultView.getComputedStyle(a).listStyleType), b.ma && "" == a.style.listStylePosition && (a.style.listStylePosition = a.ownerDocument.defaultView.getComputedStyle(a).listStylePosition), b.la && "" == a.style.listStyleImage && (a.style.listStyleImage = a.ownerDocument.defaultView.getComputedStyle(a).listStyleImage), "0px" === a.ownerDocument.defaultView.getComputedStyle(a).marginTop &&
(a.style.marginTop = "0em"), "0px" === a.ownerDocument.defaultView.getComputedStyle(a).marginBottom && (a.style.marginBottom = "0em"));
"" != a.style.zIndex && (this.hasZIndexStyle = !0);
"inline" === a.ownerDocument.defaultView.getComputedStyle(a).display && (a.style.clear = "")
}
};
function Ja(a) {
this.document = a
}
Ja.prototype.g = function(a) {
if (a.nodeType == Node.ELEMENT_NODE && "object" === typeof a.style) {
var b = a.style.width,
c = a.style.height,
d = a.style.marginTop,
e = a.style.marginBottom,
g = a.ownerDocument.defaultView.getComputedStyle(a, "");
"auto" == b && "auto" != g.width && y.T(g.width) && (a.style.width = g.width);
"auto" == c && "auto" != g.height && y.T(g.height) && (a.style.height = g.height);
"auto" == d && "auto" != g.marginTop && (a.style.marginTop = g.marginTop);
"auto" == e && "auto" != g.marginBottom && (a.style.marginBottom = g.marginBottom)
}
};
function Ka() {
Ka.prototype.Nc = function(a) {
for (var b = document.createNodeIterator(a, NodeFilter.SHOW_ELEMENT), c; null !== (c = b.nextNode());)
if (null !== c) {
var d = c.ownerDocument.defaultView.getComputedStyle(c).opacity;
"1" !== d && "0" !== d && (0 < c.childNodes.length && 0 < c.innerText.trim().length ? console.log("Backdrop: Non empty backdrop found for the target id:" + c.id) : c.setAttribute(x.AMZN_NODE_TYPE, x.AMZN_BACKDROP))
}
b = a.querySelectorAll("[" + x.AMZN_NODE_TYPE + "=" + x.AMZN_BACKDROP + "]");
if (null !== b && 1 < b.length)
for (console.log("Backdrop: Found multiple backdrops for the target id:" +
a.id), a = 0; a < b.length; a++) b[a].removeAttribute(x.AMZN_NODE_TYPE)
}
}
function La(a) {
this.document = a
}
La.prototype.g = function(a) {
if (a.nodeType == Node.ELEMENT_NODE && null != a.style) {
var b = a.nodeName.toLowerCase();
"big" != b && "small" != b || null == a.style || "" != a.style.fontSize || (a.style.fontSize = a.ownerDocument.defaultView.getComputedStyle(a).getAbsolutePropertyCSSValue("font-size").cssText)
}
};
function Ma(a) {
this.document = a;
this.G = []
}
Ma.prototype.register = function(a) {
null != a && this.G.push(a)
};
Ma.prototype.transformNode = function(a) {
if (a.nodeType == document.ELEMENT_NODE || a.nodeType == document.DOCUMENT_NODE) {
if (null != a.childNodes)
for (var b = 0; b < a.childNodes.length; b++) this.transformNode(a.childNodes[b]);
for (B in this.G) this.G[B].g(a)
}
};
function Na(a) {
this.document = a
}
Na.prototype.g = function(a) {
if ("center" === a.nodeName.toLowerCase()) {
a = this.document.createNodeIterator(a, NodeFilter.SHOW_ELEMENT);
for (var b = null; null !== (b = a.nextNode());) {
var c = b.getAttribute("align"),
c = c ? c.toLowerCase().trim() : "";
"table" === b.nodeName.toLowerCase() && "left" !== c && "right" !== c && b.setAttribute("align", "center")
}
}
};
function Oa() {
this.G = [];
this.Yb = !1;
this.G.push(new Pa)
}
Oa.prototype.g = function(a) {
for (var b = 0; b < this.G.length; b++) Qa(a) && (this.Yb = !0)
};
function Pa() {}
function Qa(a) {
if (x.b(a) || x.b(a.style) || a.nodeType !== Node.ELEMENT_NODE) return !1;
var b = a.nodeName.toLowerCase(),
c = a.style.display;
if ("td" !== b && "th" !== b && "li" !== b && "tr" !== b && "tbody" !== b && "table-cell" === c || "tr" !== b && "table-row" === c || "table" !== b && "table" === c || "table" === b && "inline-table" === c || "inline-block" === a.style.display) return !0;
if ("left" === a.style["float"] || "right" === a.style["float"]) {
if (0 > x.D(a.style.marginLeft) || 0 > x.D(a.style.marginRight) || 0 > x.D(a.style.paddingLeft) || 0 > x.D(a.style.paddingRight) ||
0 > x.D(a.style.textIndent)) return !0;
for (; a.nodeType != Node.ELEMENT_NODE || "html" !== a.nodeName.toLowerCase();)
if (b = a, a = a.nextSibling, x.b(a)) {
if (a = b.parentNode, x.b(a)) break
} else {
if (a.nodeType === Node.TEXT_NODE && "" !== a.nodeValue.trim()) break;
if (a.nodeType === Node.ELEMENT_NODE) {
if ("true" !== a.getAttribute("amzn-isemptynode")) break;
return !0
}
}
}
return !1
}
function Ra(a) {
this.document = a
}
Ra.prototype.g = function(a) {
if (a.nodeType == document.ELEMENT_NODE && null != a.style && void 0 != a.style) {
if ("bdi" == a.nodeName.toLowerCase() && "" == a.style.direction) {
var b = a.getAttribute("dir");
(!b || "ltr" != b && "rtl" != b && "auto" != b) && a.setAttribute("dir", "auto")
}
var c = a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue("direction").cssText || "ltr";
"relative" === a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue("position").cssText && (Sa(a, "left", "right", c), Sa(a, "top", "bottom",
c));
b = a.getAttribute("dir");
"auto" == b && (a.style.direction = c)
}
};
function Sa(a, b, c, d) {
var e = a.style[b],
g = a.style[c];
if (D(e) || D(g)) "auto" === e && "auto" === g ? (a.style[b] = "0", a.style[c] = "0") : "auto" === e ? a.style[b] = D(g) ? 0 - parseInt(g, 0) : "0px" : "auto" === g ? a.style[c] = D(e) ? 0 - parseInt(e, 0) : "0px" : D(e) && D(g) && ("ltr" === d ? a.style[c] = 0 - parseInt(e, 0) : a.style[b] = 0 - parseInt(g, 0))
}
function D(a) {
return void 0 !== a && "" !== a
}
function Ta(a, b) {
this.document = a;
this.a = b;
this.dropCapData = []
}
function lb(a, b) {
var c = b.childNodes;
if (1 !== c.length && Node.TEXT_NODE !== c[0].nodeType) return console.log("Dropcap: node has only one text node"), !1;
var d = a.a.Ob(c[0].nodeValue),
c = a.a.Dd(c[0].nodeValue);
if (!d && !c) return console.log("Dropcap: the character is a high quote character"), !1;
d = a.document.defaultView.getComputedStyle(b);
return "relative" !== d.position && "static" !== d.position ? (console.log("Dropcap: the character is not relatively positioned."), !1) : void 0 === b.style.bottom ? (console.log("Dropcap: bottom style is applied"), !1) : !0
}
function mb(a, b) {
if (!nb(a, b)) return !1;
var c = ob(a, b);
if (!c) return console.log("Dropcap::Unable to populate dropcap data"), !1;
for (var d = b.nextSibling; null !== d && (b.nodeType !== Node.TEXT_NODE || a.a.Ba(b)) && nb(a, d);) {
c = ob(a, d);
d.setAttribute("amznDropCapProcessed", "true");
if (!c) return !1;
d = d.nextSibling
}
return !0
}
function ob(a, b) {
if (a.a.Pb(b)) return console.log("DropCap::Not a drop cap since Float is applied to image"), !1;
if ("" === b.textContent.trim()) return console.log("DropCap::Tag with float style is not having any textual content in it"), !1;
if (a.a.md(b)) console.log("DropCap::Node has only one text child"), pb(a, b);
else {
var c = b.childNodes;
if (2 === c.length && c[0].nodeType === Node.ELEMENT_NODE && c[1].nodeType === Node.ELEMENT_NODE) {
var d = c[0];
if (!lb(a, d)) return console.log("DropCap::DropCap node doesn't have only one text child"), !1;
var e = a.a.X(d).nodeValue,
c = a.a.X(c[1]);
c.nodeValue = e + c.nodeValue;
b.removeChild(d);
pb(a, b)
}
}
return !0
}
function pb(a, b) {
var c = a.a.X(b);
c ? (1 !== c.nodeValue.trim().length && console.log("DropCap::MulitCharacter Dropcap found"), a.dropCapData.push(new qb(b, c))) : console.log("DropCap::DropCap Text Node could not be found")
}
function nb(a, b) {
if (!b.style || "left" !== a.document.defaultView.getComputedStyle(b)["float"]) return !1;
console.log("DropCap::Floating Style is Used here");
return !0
}
function rb(a, b, c, d) {
this.document = a;
this.a = b;
this.dropCapData = c;
this.paragraphData = d;
this.dropCapLines = void 0
}
function sb(a, b) {
this.document = a;
this.a = b;
this.paragraphData = void 0
}
function tb(a, b) {
E.s(a, "Document Object is not valid");
E.s(b, "HtmlCSSUtils object is not valid");
this.document = a;
this.a = b;
this.qc = "width height top left right bottom margin-left margin-right margin-top margin-bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom font-size line-height vertical-align float".split(" ")
}
tb.prototype.$a = function(a) {
if (null !== a && a.style)
for (var b = 0; b < this.qc.length; b++) a.style.removeProperty(this.qc[b])
};
function ub(a, b) {
E.s(b, "Input Node object is not a valid object");
E.qa(Node.ELEMENT_NODE, b.nodeType, "Input Node not an Element");
if ("true" === b.getAttribute("dropcap")) a.$a(b), b.style.display = "inline";
else try {
if ("true" !== b.getAttribute("amznDropCapProcessed")) {
a.Ea(b);
for (var c = 0; c < b.childNodes.length; c++) b.childNodes[c].nodeType === Node.ELEMENT_NODE && ub(new tb(a.document, a.a), b.childNodes[c])
}
} catch (d) {
console.log("DropCap::Exception Occured : " + d.stack), "DROP_CAP_PARA_LINE_HEIGHT_ZERO" == w(d) && q.h(w(d),
d.srcId)
}
}
tb.prototype.Ea = function(a) {
var b = new Ta(this.document, this.a),
c = mb(b, a);
if (c) {
b = b.dropCapData;
a = new sb(this.document, this.a);
if (0 === b.length) c = !1;
else {
var d = a.a.Db(b[b.length - 1].elementNode);
d ? (c = a.a.Ab(d), a.paragraphData = new qb(c, d), c = !0) : (console.log("DropCap::Could not find Paragraph next to Drop Cap"), c = !1)
}
if (c && (a = a.paragraphData, c = vb(new wb(this.document, this.a, b, a)))) {
d = new rb(this.document, this.a, b, a);
var e = d.dropCapData[d.dropCapData.length - 1],
c = e.elementNode,
e = d.a.M(e.textNode)[0],
e = e.maxYBottom -
e.maxYTop;
d.paragraphData.elementNode.ownerDocument.defaultView.getComputedStyle(d.paragraphData.elementNode);
var g = F.C(d.a.U(d.paragraphData.elementNode, "line-height", !0)),
h = d.a.M(d.paragraphData.textNode)[0];
0 == g && (q.h("DROP_CAP_PARA_LINE_HEIGHT_ZERO", c.getAttribute("amzn-src-id")), g = 1);
c = (e - h.capheight) / g + 1;
console.log("DropCap::Absolute DropCap Lines Value :: " + c);
d.dropCapLines = Math.ceil(c);
2 > d.dropCapLines ? (console.log("DropCap::DropCapLines should be minimum of 2 to make sense. Hence, not detecting them as DropCap"),
c = !1) : (console.log("DropCap::DropCapLines=" + d.dropCapLines), c = !0);
if (c) {
b = new xb(this.document, this.a, b, a, d.dropCapLines);
d = b.dropCapData[b.dropCapData.length - 1];
a = d.elementNode;
d = d.textNode;
c = b.a.M(b.paragraphData.textNode)[0];
b.a.wb(a);
for (var e = b.a.M(d)[0], c = c.left - e.right, e = b.document.defaultView.getComputedStyle(d.parentNode), g = b.document.defaultView.getComputedStyle(b.paragraphData.elementNode), h = "", k = 0; k < b.nonIgnorableDropCapStyles.length; k++) {
var m = e.getPropertyCSSValue(b.nonIgnorableDropCapStyles[k]).cssText;
g.getPropertyCSSValue(b.nonIgnorableDropCapStyles[k]).cssText !== m && (h = h + b.nonIgnorableDropCapStyles[k] + ":" + m + ";")
}
h = h + "display:inline;";
F.C(b.document.defaultView.getComputedStyle(b.paragraphData.elementNode).fontSize);
if ("normal" === b.a.U(d.parentNode, "white-space", !1)) {
e = "";
for (g = 0; g < b.dropCapData.length; g++) e += b.dropCapData[g].textNode.nodeValue.trim();
b.paragraphData.elementNode.setAttribute("dropcap_lines", b.dropCapLines);
b.paragraphData.elementNode.setAttribute("dropcap_chars", e.length);
g = b.document.createElement("span");
for (k = d; null !== k.parentNode && !k.parentNode.getAttribute("amzn-src-id") && (k = k.parentNode, k.parentNode.nodeType === Node.ELEMENT_NODE););
null !== k.parentNode && k.parentNode.nodeType === Node.ELEMENT_NODE && k.parentNode.getAttribute("amzn-src-id") && g.setAttribute("amzn-src-id", k.parentNode.getAttribute("amzn-src-id"));
null !== a.getAttribute("id") && g.setAttribute("id", a.getAttribute("id"));
null !== a.getAttribute("name") && g.setAttribute("name", a.getAttribute("name"));
g.setAttribute("style", h);
g.setAttribute("dropcap",
"true");
h = yb(b, b.dropCapData[0].elementNode, g, e);
if (1 == e.length) d = b.document.createTextNode(), d.nodeValue = e, g.appendChild(d);
else {
k = b.document.createTextNode();
k.nodeValue = e.slice(0, -1);
m = b.document.createTextNode();
m.nodeValue = e.slice(-1);
var l = b.document.createElement("span");
l.setAttribute("style", zb(b, d, c));
l.appendChild(m);
g.appendChild(k);
g.appendChild(l)
}
b.paragraphData.elementNode.setAttribute("dropcap_chars", e.length + h);
a.parentNode === b.paragraphData.elementNode ? b.paragraphData.elementNode.insertBefore(g,
a) : b.paragraphData.elementNode.insertBefore(g, b.paragraphData.elementNode.childNodes[0]);
for (a = 0; a < b.dropCapData.length; a++) b.dropCapData[a].elementNode.parentNode.removeChild(b.dropCapData[a].elementNode)
}
}
}
}
};
function xb(a, b, c, d, e) {
this.document = a;
this.a = b;
this.dropCapData = c;
this.paragraphData = d;
this.dropCapLines = e;
this.nonIgnorableDropCapStyles = "color font-family font-style font-weight font-variant text-shadow".split(" ")
}
function yb(a, b, c, d) {
var e = 0,
g = b.childNodes;
if (0 == g.length) b != d && "IMG" == b.nodeName.toUpperCase().trim() && (c.appendChild(b), e++);
else
for (b = 0; b < g.length && g[b] != d; b++) e += yb(a, g[b], c, d);
return e
}
function zb(a, b, c) {
a = a.document.defaultView.getComputedStyle(b.parentNode);
a = F.C(a.fontSize);
return "display:inline; letter-spacing:" + c / a + "em;"
}
function wb(a, b, c, d) {
this.document = a;
this.a = b;
this.dropCapData = c;
this.paragraphData = d;
this.supportedDropCapStyles = "float font-size line-height vertical-align margin-top margin-bottom margin-left margin-right padding-top padding-bottom padding-left padding-right width height color font-family font-style font-weight font-variant word-spacing letter-spacing text-indent text-align display".split(" ");
this.invalidTagsForDropcaps = ["td", "th"]
}
function vb(a) {
if (-1 != a.invalidTagsForDropcaps.indexOf(a.dropCapData[0].elementNode.nodeName.toLowerCase())) return console.log("DropCap::Invalid tag used .Not a valid dropcap"), !1;
var b = 0;
if (1 < a.dropCapData.length && a.a.Ob(a.dropCapData[0].textNode.nodeValue.trim()))
if (b = Ab(a, a.dropCapData[0].elementNode, a.dropCapData[0].textNode, !0)) b = 1;
else return !1;
var c = Bb(a, a.dropCapData[0].elementNode),
d;
d = a.dropCapData[0];
var e = a.paragraphData,
g = a.a.X(e.elementNode);
d = g === d.textNode || g === e.textNode ? !0 : !1;
if (!1 ===
c) return console.log("DropCap::DropCap is not the first text node inside the line."), !1;
if (!1 === d) return console.log("DropCap::Neither DropCap nor it's paragraph is the first node inside the para's block parent."), !1;
for (c = b; c < a.dropCapData.length; c++)
if (b = Ab(a, a.dropCapData[c].elementNode, a.dropCapData[c].textNode, !1), !b) return !1;
return !0
}
function Bb(a, b) {
var c = a.a.Bb(b, !1);
return void 0 === c ? (c = b.parentNode, void 0 !== c.style && ("left" === c.style["float"].toLowerCase() || "right" === c.style["float"].toLowerCase()) || "inline" !== c.ownerDocument.defaultView.getComputedStyle(c).display ? !0 : Bb(a, c)) : c.nodeType !== Node.ELEMENT_NODE || void 0 !== c.style && ("left" === c.style["float"].toLowerCase() || "right" === c.style["float"].toLowerCase()) ? !1 : "inline" !== c.ownerDocument.defaultView.getComputedStyle(c).display ? !0 : !1
}
function Ab(a, b, c, d) {
var e = a.a.M(c);
if (1 !== e.length) return console.log("DropCap::Found Many Text Runs for Drop Caps"), !1;
var g = a.document.defaultView.getComputedStyle(c.parentNode),
h = a.document.defaultView.getComputedStyle(a.paragraphData.textNode.parentNode);
if ("normal" !== g.whiteSpace) return console.log("DropCap::DropCap with whitespace other than normal is not currently handled"), !1;
g = F.C(g.fontSize);
h = F.C(h.fontSize);
h = g / h;
if (!d && 1.5 > h) return console.log("DropCap::Not a valid DropCap since font size is lesser than Paragraph Font Size. Ratio: " +
h), !1;
a.a.wb(b);
d = a.a.M(a.paragraphData.textNode)[0];
e = e[0];
h = e.baselineposition + e.maxYTop;
g = d.baselineposition + d.maxYTop;
e.Ec + e.Wb <= d.Ec + d.Wb && console.log("DropCap::DropCap Bottom position is above the first line of paragraph. Could be a RaisedCap!!! Hence not detecting as dropcap");
h < g ? console.log("DropCap::DropCap Top is above the paragraph top") : console.log("DropCap::DropCap Top is below the paragraph top");
h < g - d.Be && console.log("DropCap::DropCap Top is way above the paragraph top");
0 < e.Wb && console.log("DropCap::DropCap Character has descent associated with it");
a.a.Ib(c.parentNode, a.paragraphData.elementNode, ["font-size", "font-family", "font-style", "font-weight"]) || console.log("DropCap::DropCap and paragraph are not having same font properties");
Cb(a, a.paragraphData.elementNode, b) || console.log("DropCap::Paragraph is not having same font / line height properties");
return !0
}
function Cb(a, b, c) {
E.s(b, "Input node not an object");
E.B(Node.ELEMENT_NODE === b.nodeType, "Input node not an element node");
if (b === c) return !0;
if (!a.a.Ib(b, a.paragraphData.elementNode, ["font-size", "font-family", "font-style", "font-weight", "line-height"])) return !1;
for (var d = 0; d < b.childNodes.length; d++)
if (b.childNodes[d].nodeType === Node.ELEMENT_NODE && (!Cb(a, b.childNodes[d]), c)) return !1;
return !0
}
function Db(a) {
this.document = document;
this.Lc = a;
this.ra = ia
}
function Eb(a) {
this.kc = {};
this.Wa = a;
this.pe = "background-size counter-increment -webkit-background-size counter-reset -webkit-transform transform -webkit-box-shadow box-shadow visibility background-color min-width text-overflow caption-side start unicode-bidi direction".split(" ");
this.se = ["caption", "video", "audio"];
for (index = 0; index < a.length; index++) {
var b = a[index].selector;
featureDataKey = a[index].srcId;
x.b(b) || (featureDataKey += "-" + b);
this.Wa[index].Ma = featureDataKey;
this.kc[featureDataKey] = index
}
}
Eb.prototype.g = function(a) {
if (a.nodeType == document.ELEMENT_NODE) {
var b = a.getAttribute("amzn-src-id"),
c = a.getAttribute("amzn-selector");
featureDataKey = b;
x.b(c) || (featureDataKey += "-" + c);
b = this.kc[featureDataKey];
if (!x.b(b)) a: {
this.Wa[b].Ta = a,
b = this.Wa[b];b.isSupported = !0;
for (var c = b.styleList, d = 0; d < c.length; d++)
if (-1 != this.pe.indexOf(c[d].name)) {
b.isSupported = !1;
break a
} - 1 != this.se.indexOf(a.nodeName.toLowerCase()) && (b.isSupported = !1)
}
}
};
function Fb() {
this.A = new Gb
}
function Hb(a, b) {
var c = G(a.A, b);
if (!x.b(c)) {
x.b(c.c) && (c.c = new H(0, 0, 0, 0));
var d = new Ib,
e = c.f;
d.va = c.c.bottom - c.c.top;
d.ea = c.c.right - c.c.left;
e = x.cd(e);
x.b(e) ? (d.Da = d.va, d.na = d.ea) : (d.Da = e.height, d.na = e.width);
d.ka = c.c.left;
d.oa = c.c.right;
for (var e = c, g = !1, h = !1; !x.b(e);) {
prevRenderDataInfo = I(e, a.A, J, !1);
if (x.b(prevRenderDataInfo) || x.b(prevRenderDataInfo.c)) break;
d.aa = x.aa(c.c, prevRenderDataInfo.c);
x.xa(prevRenderDataInfo.c, c.c) === N ? (d.Hb = !0, g || (d.ka = c.c.left - prevRenderDataInfo.c.right, g = !0)) : h || (d.Ha =
c.c.top - prevRenderDataInfo.c.bottom, h = !0);
if (c.c.top - prevRenderDataInfo.c.bottom > 2 * ia.height) break;
e = prevRenderDataInfo
}
e = c;
for (h = g = !1; !x.b(e);) {
nextRenderDataInfo = I(e, a.A, P, !1);
if (x.b(nextRenderDataInfo) || x.b(nextRenderDataInfo.c)) break;
d.aa = x.aa(c.c, nextRenderDataInfo.c);
x.xa(nextRenderDataInfo.c, c.c) === N ? (d.Gb = !0, g || (d.oa = nextRenderDataInfo.c.left - c.c.right, g = !0)) : h || (d.ua = nextRenderDataInfo.c.top - c.c.bottom, h = !0);
e = nextRenderDataInfo;
if (nextRenderDataInfo.c.top - c.c.bottom > 2 * ia.height) break
}
return d
}
}
function Ib() {
this.na = this.ea = this.ua = this.Ha = this.oa = this.ka = 0;
this.aa = this.Gb = this.Hb = !1
}
Ib.prototype.toString = function() {
return "left-offset " + this.ka + ", right-offset " + this.oa + ", top-offset " + this.Ha + ", bottom-offset " + this.ua + ", content-box-width " + this.ea + ", content-box-height " + this.va + ", overall-box-width " + this.na + ", overall-box-height " + this.Da + ", prev-sibling-inlined " + this.Hb + ", next-sibling-inlined " + this.Gb + ", isOverlapping " + this.aa
};
window.processHtmlFileForDropStyle = Jb;
function Jb(a) {
console.log("Handle Html file :: " + a.htmlFile);
q.bb();
console.log("Drop style html processor :: ");
var b = new Db(a);
console.log("starting preprocessing");
(new Kb(b.document, !1, !0, !0, x, !1, b.ra, !0)).g();
console.log("Done with preprocessing");
console.log("Style inliner started");
var c = new Q(x, b.document, S);
c.W = !0;
c.register(new Lb(b.document, x));
c.transformNode(b.document.documentElement, new T(b.document.documentElement));
console.log("Style inliner ended");
console.log("pseudoSelectorHandler started");
c = new Q(x, b.document);
new Mb(b.document);
c.register(new Nb(b.document, x, 0, !0));
c.transformNode(b.document.documentElement, new T(b.document.documentElement));
console.log("pseudoSelectorHandler ended");
console.log("NodeIdGenerator started");
c = new Q(x, b.document, S);
c.W = !0;
var d = new Ob,
e = new Eb(b.Lc.affectedElementList);
c.register(d);
c.register(e);
c.transformNode(b.document.documentElement, new T(b.document.documentElement));
console.log("NodeIdGenerator ended");
x.Fb();
x.dc();
console.log("Invoking Html Relayout to avoid any discrepency cause by removing the style sheet and inlining styles. " +
b.ra.width + "x" + b.ra.height);
document.body.style.width = b.ra.width + "px";
document.body.style.height = b.ra.height + "px";
document.body.relayout();
c = a.affectedElementList;
d = {};
b = {};
console.log("Getting Render data tree");
e = new Fb;
for (index = 0; index < c.length; index++) {
var g = c[index].Ma,
h = c[index].Ta,
k = c[index].isSupported;
x.b(h) || x.b(k) || !k || (h = Hb(e, h), d[g] = h)
}
console.log("Removing the unsupported styles/attributes");
for (index = 0; index < c.length; index++) {
var m = {},
g = c[index].Ma,
h = c[index].Ta,
k = c[index].isSupported;
if (!x.b(h) && !x.b(k) && k) {
b[g] = m;
for (var e = c[index], g = h, h = m, m = "", l = e.attrList, k = 0; k < l.length; k++) {
var n = l[k].name,
p = l[k].replacedValue;
g.setAttribute(n, p);
m += n + ":" + l[k].actualValue + ","
}
m += "STYLE::";
e = e.styleList;
for (k = 0; k < e.length; k++) n = e[k].name, p = e[k].replacedValue, "vertical-align" === n.toLowerCase() && g.setAttribute("valign", ""), g.style[n] = p, m += n + ":" + e[k].actualValue + ",";
h.DEBUG = m
}
}
console.log("Doing a Document Relayout after removing all the unsupported style and sttributes");
document.body.relayout();
ha.info("Re-calculating the render treee");
e = new Fb;
for (index = 0; index < c.length; index++) g = c[index].Ma, m = d[g], x.b(m) || (h = c[index].Ta, k = c[index].isSupported, x.b(h) || x.b(k) || !k || (h = Hb(e, h), g = b[g], g["1"] = h.ka - m.ka, g["2"] = h.oa - m.oa, g["3"] = h.Ha - m.Ha, g["4"] = h.ua - m.ua, g["5"] = h.ea - m.ea, g["6"] = h.va - m.va, g["7"] = h.na - m.na, g["8"] = h.Da - m.Da));
c = {};
c.featureData = b;
c.htmlFile = a.htmlFile;
console.log("Returing the feature data");
return c
}
function U(a, b, c) {
this.document = a;
this.a = b;
this.isFixedLayout = c;
this.Qd = "hr img li svg svg:svg audio svg:image video".split(" ");
this.Ka = [];
this.fa = {}
}
function Pb(a, b) {
if (null == b || b.nodeType != document.ELEMENT_NODE) return !1;
var c = b.childNodes.length;
if (0 === c) return !1;
for (var d = 0; d < c; d++) {
var e = b.childNodes[d];
if (null != e && null != e.tagName && "br" === e.tagName.toLowerCase() || !0 === Pb(a, e)) return !0
}
return !1
}
U.prototype.Ea = function(a) {
if (a.nodeType == document.TEXT_NODE) return x.Fa(a);
if (a.nodeType != document.ELEMENT_NODE) return !1;
var b = a.ownerDocument.defaultView.getComputedStyle(a, ""),
c = this.Na(b, a),
d;
var e = a.nodeName.toLowerCase();
d = !0; - 1 === this.Qd.indexOf(e) || "hr" == e && null != a.style.visibility && void 0 != a.style.visibility && "hidden" === a.style.visibility.toLowerCase() || (d = !1);
void 0 != a.style.pageBreakBefore && null != a.style.pageBreakBefore && "always" === a.style.pageBreakBefore.toLowerCase() && (d = !1);
if (x.i(a.style.borderLeftStyle) ||
x.i(a.style.borderRightStyle) || x.i(a.style.borderTopStyle) || x.i(a.style.borderBottomStyle)) d = !1;
e = a.ownerDocument.defaultView.getComputedStyle(a).backgroundColor;
this.a.Sb(a.style.backgroundColor, e) && (d = !1);
"" != a.style.backgroundImage && (d = !1);
if (x.Ua(a) && "0" == a.getAttribute("width")) d = !0;
else {
for (var e = !0, g = null != a.childNodes ? a.childNodes.length : 0, h = 0; h < g; h++) {
var k = this.Ea(a.childNodes[h]);
a.childNodes[h].nodeType !== document.COMMENT_NODE && (k || (e = !1))
}
d = d && e
}
if (!d || "list-item" === a.style.display) return !1;
if (e = "inline" === a.style.display) e = "br" === a.tagName.toLowerCase() && V(this, a) || Pb(this, a);
e && (a.style.display = "block", a.style.removeProperty("width"), a.style.removeProperty("height"), c = this.Na(b, a));
if ("" !== a.style["float"] && null != c && ("" === c || 0 == c) && "" === a.style.width) return a.style.display = "none", d;
"block" == a.style.display || "table" == a.style.display || x.Ua(a) ? (b = c, this.Ka.push(a), this.fa[a.j] = {}, c = a.ownerDocument.defaultView.getComputedStyle(a, ""), null == b ? a = !1 : (a.setAttribute("amzn-isemptynode", "true"),
this.fa[a.j].marginTop = c.marginTop, this.fa[a.j].marginBottom = c.marginBottom, this.fa[a.j].height = b, a = !0)) : a = d;
return a
};
function V(a, b) {
var c;
a: if (c = b.previousSibling, void 0 === c || null == c) {
for (var d = b.parentElement; void 0 !== d && null != d && null === d.previousElementSibling;) {
if (void 0 !== d.style.display && a.S(d)) break a;
d = d.parentElement
}
if (void 0 === d || null == d || a.S(d)) break a;
c = d.previousElementSibling;
c = 0 < c.childElementCount ? c.lastElementChild : c
}
if (void 0 === c || null == c) return !0;
if (c.nodeType === document.TEXT_NODE) return 0 != c.textContent.trim().length ? !1 : V(a, c);
if (c.nodeType === document.COMMENT_NODE) return V(a, c);
if (c.nodeType ===
document.ELEMENT_NODE) {
if (null != c.tagName && "br" === c.tagName.toLowerCase() || void 0 !== c.getAttribute("amzn-isemptynode") && "true" === c.getAttribute("amzn-isemptynode") || null != c.style && void 0 !== c.style.display && "block" === c.style.display) return !0;
if (null != c.style && void 0 !== c.style.display && "inline" === c.style.display) return 0 != c.textContent.trim().length ? !1 : V(a, c);
if ("math/mml" === c.type && "script" === c.tagName.toLowerCase()) return V(a, c)
}
return !1
}
U.prototype.Na = function(a, b) {
var c = this.o(a.height),
d = this.o(a.paddingTop),
e = this.o(a.paddingBottom);
if ("br" === b.tagName.toLowerCase()) return this.o(a.lineHeight) + "px";
if (null == c || null == d || null == e) return "";
c = c + d + e;
return 0 === c ? "" : c + "px"
};
U.prototype.o = function(a) {
if (null == a || void 0 == a || !this.a.v(a, "px")) return null;
a = parseInt(a.substr(0, a.length - 2));
return NaN === a ? null : a
};
U.prototype.S = function(a) {
return "block" === a.style.display.toLowerCase() || "table-cell" === a.style.display.toLowerCase() || "table-row" === a.style.display.toLowerCase() || "table" === a.style.display.toLowerCase() || "list-item" === a.style.display.toLowerCase() || "list" === a.style.display.toLowerCase() ? !0 : !1
};
var Qb = {
ce: function(a, b) {
httpEquivEncoding = "";
headNode = a.head;
if (null == headNode || void 0 == headNode) headNode = a.createElement("head"), a.documentElement.appendChild(headNode);
this.de(a);
for (var c = 0; c < headNode.childNodes.length; c++)
if (childNode = headNode.childNodes[c], "meta" == childNode.nodeName.toLowerCase() && "string" === typeof childNode.httpEquiv && "content-type" == childNode.httpEquiv.toLowerCase()) {
if ("" == childNode.getAttribute("content").trim()) {
childNode.content = "type=text/html;charset=" + b;
return
}
for (var d =
childNode.content.split(";"), e = "", c = 0; c < d.length; c++) part = d[c], part = part.trim(), 0 == part.indexOf("charset") && (d[c] = "charset = " + b), e = e + ";" + d[c];
childNode.content = e;
return
}
metaNode = a.createElement("meta");
metaNode.httpEquiv = "content-type";
metaNode.content = "text/html; charset=" + b;
headNode.appendChild(metaNode)
},
de: function(a) {
htmlNode = a.head.parentNode;
null == htmlNode || void 0 == headNode || null != htmlNode.getAttribute("xmlns") && "" != htmlNode.getAttribute("xmlns").trim() || htmlNode.setAttribute("xmlns", "http://www.w3.org/1999/xhtml")
},
ae: function(a, b) {
headNode = a.head;
for (var c = 0; c < headNode.childNodes.length; c++)
if (childNode = headNode.childNodes[c], "meta" == childNode.nodeName.toLowerCase() && "" == childNode.charset) {
childNode.charset = b;
return
}
metaNode = a.createElement("meta");
charsetAttribute = a.createAttribute("charset");
charsetAttribute.nodeValue = b;
metaNode.attributes.setNamedItem(charsetAttribute);
headNode.appendChild(metaNode)
}
};
function Rb(a) {
var b = document,
c = this,
d = {},
e = ["base"],
g = !1;
c.La = function() {
c.nc(b);
for (var a = !1, k = 0; k < e.length; k++) a |= d[e[k]];
return 0 !== a || g ? !0 : !1
};
c.nc = function(d) {
if (!(d.nodeType != b.ELEMENT_NODE && d.nodeType != b.DOCUMENT_NODE || d.nodeType !== b.DOCUMENT_NODE && "none" === d.style.display)) {
for (var e = null != d.childNodes ? d.childNodes.length : 0, g = 0; g < e; g++) c.nc(d.childNodes[g]);
d.nodeType !== b.DOCUMENT_NODE && (c.Hc(d), c.Wd(d), a || c.Gc(d))
}
};
c.Hc = function(a) {
for (var b = 0; b < e.length; b++) a.tagName.toLowerCase() === e[b] &&
(this.srcId = a.getAttribute("amzn-src-id"), d[e[b]] = !0)
};
c.Wd = function(a) {
"hidden" == a.ownerDocument.defaultView.getComputedStyle(a, "").visibility && delete a
};
c.Gc = function(a) {
if ("auto" !== a.style.height && "" !== a.style.height && "img" !== a.tagName.toLowerCase() && "hr" !== a.tagName.toLowerCase() && "inline" !== a.ownerDocument.defaultView.getComputedStyle(a).display) {
var c = a.ownerDocument.defaultView.getComputedStyle(a).height,
d = a.ownerDocument.defaultView.getComputedStyle(a).lineHeight;
if ("0px" !== c) {
if ("normal" ===
d) {
var e = a.style.lineHeight;
a.style.lineHeight = "1.3em";
d = a.ownerDocument.defaultView.getComputedStyle(a).lineHeight;
a.style.lineHeight = e
}
e = d.lastIndexOf("px") === d.length - 2;
if (c.lastIndexOf("px") === c.length - 2 && e) {
var e = parseFloat(c.substr(0, c.length - 2)),
n = parseFloat(d.substr(0, d.length - 2));
!(a.nodeType === Node.ELEMENT_NODE && e < n && "" === a.textContent.trim()) && e < n && (g |= 1, this.srcId = a.getAttribute("amzn-src-id"), console.log(b.location.href + " -- Found a height(" + c + ") lesser than line height(" + d + ") for tag(" +
a.tagName + ")"), console.log(b.location.href + " -- Actual height(" + a.style.height + "), Actual line height(" + a.style.lineHeight + ")"))
}
}
}
}
}
function Sb(a) {
this.A = a
}
function Tb(a, b, c) {
if (!x.$(c.f)) return !1;
b["17"] = "1";
if ("right" === c.f.style["float"]) return !0;
b = I(c, a.A, P, !1);
if (null === b) return !1;
var d = b.c.top >= c.c.bottom ? 0 : Ub(b.F) ? 2 : 1,
e = b.f,
g = e;
e.nodeType !== Node.ELEMENT_NODE && (g = e.parentNode);
e = g.ownerDocument.defaultView.getComputedStyle(g).textAlign;
if (1 == d && ("right" === e || "center" === e)) return !0;
for (; 1 === d;) {
e = I(b, a.A, P, !1);
if (null === e) return !1;
e = e.c.top >= c.c.bottom ? 0 : Ub(e.F) ? 2 : 1;
if (0 === e) break;
d += e
}
return 1 < d ? !0 : !1
}
function Vb(a, b, c, d) {
a = Wb(b, a.A, d);
if (x.b(a)) return !1;
a = W(a);
return 2 !== a.length || 1 !== a[0].m.length || a[0].m[0].f.nodeType !== Node.ELEMENT_NODE || a[0].m[0].f.textContent.trim() !== c ? !1 : !0
}
function Xb(a, b, c) {
a = Wb(b, a.A, c);
if (x.b(a)) return !1;
a = W(a);
if (!Yb(a)) return !1;
b = W(b);
return 0 === a[1].m.length || 0 === b[1].m.length || 0 === a[1].m[0].F.length || 0 === b[1].m[0].F.length || a[1].m[0].F[0].u.left != b[1].m[0].F[0].u.left ? !1 : !0
}
function Zb(a, b, c) {
if (!x.b(a)) {
for (var d = [], e = [], g = -1, h = -1, k = [], m = 0; m < a.length; m++) {
var l = a[m],
n = l.ga;
n.nodeType === Node.TEXT_NODE && (n.ba = !0, n.Kc = !0);
var p = l.u;
$b(l) && (l = l.m[0].f, x.Sa(l.style, l.ownerDocument.defaultView.getComputedStyle(l)) && (p = x.Yc(l)));
k.push(p);
if (p.top < g || -1 === g) g = p.top;
if (p.bottom > h || -1 === h) h = p.bottom;
d.push(n.j.toString())
}
for (m = 0; m < a.length; m++) l = k[m], n = "0", p = l.top - g, l = h - l.bottom, x.$(c) ? n = "0" : p > l && (n = "1"), e.push(n);
a = a[a.length - 1].ja;
d.push(a.j.toString());
a.ba = !0;
a.Ja = !0;
b["13"] =
JSON.stringify(d);
b["14"] = JSON.stringify(e)
}
}
function ac(a, b, c) {
if (!x.b(a)) {
var d = a.f;
if (!x.b(d)) {
a = [];
var e = b.length;
a.push(d.j.toString());
for (d = 0; d < b.length; d++) {
var g = b[d];
x.b(g) || (g = g.f, x.b(g) || g.nodeType == Node.ELEMENT_NODE && a.push(g.j.toString()))
}
b = b[e - 1];
x.b(b) || (b = b.f, a.push(b.j.toString()), b.ba = !0, b.Ja = !0, c["13"] = JSON.stringify(a))
}
}
}
function Yb(a) {
return x.b(a) || 2 !== a.length || x.b(a[0].u) || x.b(a[1].u) ? !1 : !0
}
function bc(a, b, c) {
var d;
(d = !(c.c.left >= a.c.right || c.c.right <= a.c.left) || null == a.f.style || null == c.f.style) || (d = a.f.style.display, d = !(d === c.f.style.display && ("inline-block" === d || "table-cell" === d) || a.f.style["float"] === c.f.style["float"] && x.$(a.f)));
if (d || "inline-block" === a.f.style.display && "" === a.f.style.width && "" === c.f.style.width) return !1;
cc(b, c.c);
return !0
}
function dc(a) {
this.document = a
}
dc.prototype.g = function(a) {
"object" === typeof a && "number" === typeof a.nodeType && a.nodeType === Node.ELEMENT_NODE && "font" === a.nodeName.toLowerCase() && "object" === typeof a.style && (this.Ra(a), null != a.getAttribute("face") && "" == a.style.fontFamily && (a.style.fontFamily = a.getAttribute("face")), null != a.getAttribute("color") && "" == a.style.color && (a.style.color = a.ownerDocument.defaultView.getComputedStyle(a, "").color))
};
dc.prototype.Ra = function(a) {
null != a.getAttribute("size") && "" == a.style.fontSize && (a.getAttribute("size"), a.style.fontSize = a.ownerDocument.defaultView.getComputedStyle(a).getAbsolutePropertyCSSValue("font-size").cssText)
};
function T(a) {
this.document = document;
this.node = a;
this.la = this.ma = this.Va = this.Yd = !1;
this.Xa = ""
}
function ec(a, b) {
this.document = a;
this.ia = b;
this.Rd = ["img", "table"];
this.Jb = ["img", "video", "svg"];
this.tc = ["-amzn-max-crop-percentage"]
}
ec.prototype.g = function(a) {
if (a.nodeType == Node.ELEMENT_NODE && null != a.style) {
var b = a.style.height,
b = b.trim(),
c = b.lastIndexOf("%");
if (!x.zd(a) && "" === a.style[this.tc]) {
if (-1 !== c && c + 1 === b.length && (void 0 === a.parentNode.style || -1 !== this.Jb.indexOf(a.nodeName.toLowerCase()) || "" !== a.parentNode.style.height && "auto" !== a.parentNode.style.height || (a.style.height = ""), "body" === a.nodeName.toLowerCase())) {
for (index = 0; index < a.childNodes.length; index++) b = a.childNodes[index], null != b.style && (c = b.style.minHeight, null !==
c && void 0 !== c && (minHeight = b.style.minHeight.trim(), "" != minHeight && "%" === x.R(minHeight) && (b = x.D(minHeight), b = b * x.D(a.style.height.trim()) / 100, a.childNodes[index].style.minHeight = b + "%")));
a.style.height = ""
}
if (-1 !== this.Jb.indexOf(a.nodeName.toLowerCase()) && void 0 !== a.parentNode.style && !x.Ua(a)) {
if (!(b = "" === a.parentNode.style.height)) {
a: if (b = a.parentNode.childNodes, 3 < b.length) b = !1;
else {
for (c = 0; c < b.length; c++)
if (b[c] === a) {
if ("img" == a.nodeName.toLowerCase() && null !== a.getAttribute("src") && x.v(a.getAttribute("src"),
".svg")) {
var d = a.style.height;
if (null === d || "" == d)
if (d = a.getAttribute("height"), null === d || "" == d) continue;
for (var e = x.D(d.trim()), d = x.R(d.trim()), g = a.parentNode, h = 1; null !== g;) {
var k = g.getAttribute("height");
null !== g.style && "" != g.style.height && (k = g.style.height);
if (null !== k && "" != k) {
var m = x.D(k.trim()),
k = x.R(k.trim());
if ("%" == k) h = h * m / 100;
else if ("%" == d) {
newHeightValue = e / 100 * h * m;
newHeightValue = newHeightValue + k;
a.style.height = newHeightValue;
break
}
}
"html" != g.nodeName.toLowerCase() ? g = g.parentNode : g = null
}
}
} else if (b[c].nodeType !==
document.TEXT_NODE || !x.Fa(b[c])) {
b = !1;
break a
}
b = !0
}b = !b
}
if (b) return;
b = a.ownerDocument.defaultView.getComputedStyle(a.parentNode).height;
c = a.ownerDocument.defaultView.getComputedStyle(a).height;
if (b === c) {
a.parentNode.style.height = "";
return
}
}
b = a.style.height.trim();
!0 !== this.ia && "" !== b && "auto" !== b && -1 === this.Rd.indexOf(a.nodeName.toLowerCase()) && (a.style.height = "", a.style.minHeight = b)
}
}
};
function Kb(a, b, c, d, e, g, h, k, m, l, n) {
this.document = a;
this.a = e;
this.skipFailures = k;
this.isUnsuppportedPseudoSelectorPresent = this.isInvalidMediaPresent = this.isUnsupportedMediaPresent = !1;
this.srcId = null;
this.data = "";
this.isFixedLayout = b;
this.isFailFlWithText = g;
this.viewPortDimension = h;
this.transformMobi8MediaQuery = c;
this.ignoreMobi7MediaQuery = d;
this.isFlWithoutText = this.hasMobi7OrMobi8MediaQuery = !1;
this.ignorableMediaQueries = "max-height max-width max-device-width max-device-height device-width device-height".split(" ");
this.enablingMediaQueries = ["min-height", "min-width", "min-device-width", "min-device-height"];
this.ignorableStylesInMediaQueries = "height width margin-right text-indent background-repeat padding-left display margin-left margin-bottom margin-top text-align font_style font_variant font-size font-family font-style font-weight line-height text-transform font-variant text-decoration vertical-align bottom background-size min-height padding-top padding-right text-rendering padding-bottom top background-position clear letter-spacing orphans font_weight word-spacing left max-width min-width right widows".split(" ");
this.RESOLUTION_FOR_SKIPING_STYLES_CHECK = 600;
this.ORIENTATION = "orientation";
this.PORTRAIT = "portrait";
this.DEVICE_ASPECT_RATIO = "device-aspect-ratio";
this.NO_VALUE_OR_UNKNON_MEDIA_VALUE = "unknown";
this.isAllowUnsupMQ = m;
this.unsupListOfMQs = l;
this.mqToAllow = n
}
Kb.prototype.g = function() {
this.isFixedLayout && this.isFailFlWithText && (this.a.Ya(document.body) && q.h("FIXED_LAYOUT_WITH_TEXT"), this.isFlWithoutText = !0);
var a = this.document.getElementsByTagName("link");
if (0 !== a.length)
for (var b = 0; b < a.length; b++)
if (this.a.sd(a[b])) {
var c = a[b].getAttribute("media");
if (null !== c) {
c = fc(this, c, null);
if (this.isUnsupportedMediaPresent) break;
a[b].setAttribute("media", c)
}
}
a = this.document.styleSheets;
if (null !== a && void 0 !== a)
for (b = a.length, c = 0; c < b; c++) gc(this, a[c]);
this.isFixedLayout &&
("" == document.body.style.marginLeft && (document.body.style.marginLeft = "0px"), "" == document.body.style.marginRight && (document.body.style.marginRight = "0px"), "" == document.body.style.marginBottom && (document.body.style.marginBottom = "0px"), "" == document.body.style.marginTop && (document.body.style.marginTop = "0px"))
};
function gc(a, b) {
if (void 0 !== b && null !== b && null !== b.rules && void 0 !== b.rules)
for (var c = b.rules, d = 0; d < c.length; d++) {
var e = c[d];
e.type === CSSRule.IMPORT_RULE && (hc(a, e), gc(a, e.styleSheet));
e.type === CSSRule.MEDIA_RULE && hc(a, e)
}
}
function hc(a, b) {
if ((b.type === CSSRule.MEDIA_RULE || b.type === CSSRule.IMPORT_RULE) && 0 !== b.media.length) {
var c = b.media.mediaText.toLowerCase();
if (null !== c) {
var d = fc(a, c, b);
a.isUnsupportedMediaPresent ? (console.log("Unsupported Media query " + b.cssText), a.data = c) : b.media.mediaText = d
}
}
}
function ic(a, b, c) {
var d = a.a.N(b.toLowerCase().trim(), " ", "");
if ("(min-width:600px)" === d && a.isFixedLayout && a.isFlWithoutText) return jc(a);
if ("screenand(-webkit-min-device-pixel-ratio:0)" === d) return !0;
if ("onlyscreenand(min-device-aspect-ratio:16,'/',10)" === d && a.isFixedLayout) {
if (!jc(a) || null === c) return !1;
d = c.cssRules;
if (null !== d && 1 === d.length && d[0].type === CSSRule.STYLE_RULE && d[0].selectorText === a.a.BODY_TAG) {
var e = d[0],
d = a.a.N(e.cssText.trim(), " ", "");
if (7 === d.match(/(background+)/g).length && 8 === d.split(";").length) return e.style.backgroundImage =
null, !0
}
}
b = X.V(b);
for (var d = !1, g = 0; g < b.length; g++) {
var e = X.zb(b[g]),
h = X.Qb(a.enablingMediaQueries, e);
null !== h && !0 === h.mediaPresent && (d = !0);
if (!(null !== h && parseInt(h.value) <= a.RESOLUTION_FOR_SKIPING_STYLES_CHECK && d)) {
a.ORIENTATION in e && (d = !0);
if (!d || null == c || null == c.cssRules) return !1;
for (h = 0; h < c.cssRules.length; h++)
if (e = a.document.querySelectorAll(c.cssRules[h].selectorText), null !== e && 0 != e.length)
for (var e = c.cssRules[h], k = 0; k < e.style.length; k++)
if (-1 == a.ignorableStylesInMediaQueries.indexOf(e.style[k].toLowerCase())) return !1
}
}
return !0
}
function jc(a) {
var b = a.document.getElementsByTagName("img");
if (null !== b && 1 === b.length) {
var b = b[0],
c = b.ownerDocument.defaultView.getComputedStyle(b, ""),
b = c.width,
b = b.substring(0, b.length - 2),
c = c.height,
c = c.substring(0, c.length - 2);
if (.05 > Math.abs(1 - a.viewPortDimension.width / b) && .05 > Math.abs(1 - a.viewPortDimension.height / c)) return !0
}
return !1
}
function kc(a, b) {
if (null === b) return !1;
for (i = 0; i < b.length; i++) {
if (b[i].type !== CSSRule.STYLE_RULE) return !0;
var c = a.document.querySelectorAll(b[i].selectorText);
if (null !== c && 0 < c.length) return !0
}
return !1
}
function fc(a, b, c) {
if (X.Ed(b)) return "all";
if (!X.Ub(b) && X.ld(b)) return a.isInvalidMediaPresent = !0, b;
if (X.Rc(b)) return "ignored-media";
if (a.transformMobi8MediaQuery && X.Gd(b)) return a.hasMobi7OrMobi8MediaQuery = !0, "all";
if (a.ignoreMobi7MediaQuery && X.Fd(b)) return a.hasMobi7OrMobi8MediaQuery = !0, "amzn-mobi";
if (void 0 !== c && null !== c && c.type !== CSSRule.IMPORT_RULE && !kc(a, c.cssRules)) return null;
var d;
a: {
d = X.V(b);
for (var e = !1, g = 0; g < d.length; g++) {
var h = X.zb(d[g]),
k = X.Qb(a.ignorableMediaQueries, h);
if (!(null !== k &&
k.value < a.RESOLUTION_FOR_SKIPING_STYLES_CHECK)) {
null !== k && !0 === k.mediaPresent && (e = !0);
a.DEVICE_ASPECT_RATIO in h && (e = !0);
a.ORIENTATION in h && h[a.ORIENTATION] !== a.PORTRAIT && (e = !0);
if (!e || null == c || null == c.cssRules) {
d = !1;
break a
}
for (k = 0; k < c.cssRules.length; k++) {
var m = a.document.querySelectorAll(c.cssRules[k].selectorText);
if (null !== m && 0 != m.length)
for (m = 0; m < c.cssRules[k].style.length; m++) {
var l = c.cssRules[k].style[m].toLowerCase();
if (-1 == a.ignorableStylesInMediaQueries.indexOf(l) && (-1 == l.indexOf("color") ||
!X.ud(h))) {
d = !1;
break a
}
}
}
}
}
d = !0
}
if (d) return "ignored-media";
if (ic(a, b, c)) return "all";
c = b.split(",");
for (d = 0; d < c.length; d++)
if (e = a.a.N(c[d].trim(), " ", ""), 1 == a.isAllowUnsupMQ) {
if (a.mqToAllow == e) return "all";
if (d == c.length - 1) return b.toLowerCase()
} else return -1 == a.unsupListOfMQs.indexOf(e) && a.unsupListOfMQs.push(e), "amzn-mobi";
console.log("Detected presence of media query : " + b.toLowerCase());
a.isUnsupportedMediaPresent = !0;
return null
}
function lc(a, b) {
this.document = a;
this.ia = b;
this.ve = "left right center top bottom texttop baseline middle absmiddle absbottom".split(" ");
this.kb = "width";
this.gb = "height"
}
lc.prototype.g = function(a) {
if (a.nodeType === Node.ELEMENT_NODE && "img" === a.nodeName.toLowerCase()) {
var b = a.getAttribute("align");
null !== b && -1 === this.ve.indexOf(b.toLowerCase()) && a.removeAttribute("align");
mc(a, this.kb, a.ownerDocument.defaultView.getComputedStyle(a, "").width);
mc(a, this.gb, a.ownerDocument.defaultView.getComputedStyle(a, "").height);
if (this.ia && "object" === typeof a.style) {
var b = a.style.width,
c = a.style.height;
"" === b && (b = a.getAttribute(this.kb));
"" === c && (c = a.getAttribute(this.gb));
var d = a.ownerDocument.defaultView.getComputedStyle(a,
"");
null !== b && 0 < b.indexOf("%") && y.T(d.width) && (a.style.width = d.width);
null !== c && 0 < c.indexOf("%") && y.T(d.height) && (a.style.height = d.height);
null != b && "" !== b || null === c || "" === c || !y.T(d.width) || (a.style.width = d.width);
null != c && "" !== c || null === b || "" === b || !y.T(d.height) || (a.style.height = d.height);
null != c && "" !== c || null != b && "" !== b || !y.T(d.width) || !y.T(d.height) || (a.style.width = d.width, a.style.height = d.height)
}
}
};
function mc(a, b, c) {
if (null !== a.getAttribute(b)) {
var d = a.getAttribute(b).trim();
"auto" === d || x.v(d, "%") && !isNaN(d.substr(0, d.length - 1)) ? a.setAttribute(b, d) : a.setAttribute(b, c)
}
}
function Gb() {
this.sb = {};
this.jc = !1
}
function G(a, b) {
if (x.b(b) || x.b(b.j)) return null;
var c = a.sb[b.j];
if (x.b(c)) {
c = new nc(b);
if (b.nodeType != document.ELEMENT_NODE || x.b(b.style)) {
if (b.nodeType == document.TEXT_NODE) {
var d = x.M(c.f);
if (!x.b(d))
for (var e = 0; e < d.length; e++) {
var g = c,
h = d[e],
h = new H(h.top, h.left, h.baselineposition, h.right);
g.cb.push(new oc(h));
pc(g, h)
}
}
} else {
d = x.Oa(c.f);
e = c.f.style.display;
x.b(e) || 0 === e.trim().length || "none" === e || "inline" === e || null == d || (c.S = !0, c.K = new H(d.top, d.left, d.bottom, d.right));
"img" === c.f.nodeName.toLowerCase() &&
"none" !== c.f.style.display && null != d && (c.c = new H(d.top, d.left, d.bottom, d.right));
e = c.f.childNodes;
for (g = 0; g < e.length; g++) {
var k = G(a, e[g]);
x.b(k) || (h = c, h.da.push(k), null != k.c ? pc(h, k.c) : null != k.K && pc(h, k.K))
}!x.b(c.c) || x.b(d) || x.b(c.K) || (c.c = new H(d.top, d.left, d.bottom, d.right), c.wd = !0)
}
for (d = 0; d < c.cb.length; d++) qc(c, c.cb[d]);
for (e = 0; e < c.da.length; e++)
for (g = c.da[e].F, d = 0; d < g.length; d++) qc(c, g[d]);
0 == c.F.length && null != c.c && c.F.push(new oc(new H(c.c.top, c.c.left, c.c.bottom, c.c.right)));
a.sb[b.j] = c;
a.jc &&
b.nodeType === Node.ELEMENT_NODE && (d = c, e = "", g = d.c, h = x.Oa(b), k = b.ownerDocument.defaultView.getComputedStyle(b), x.b(h) ? (e += "top:" + k.top + ";", e += "left:" + k.left + ";", e += "right:" + k.right + ";", e += "bottom:" + k.bottom + ";") : (e += "top:" + h.top + "px;", e += "left:" + h.left + "px;", e += "right:" + h.right + "px;", e += "bottom:" + h.bottom + "px;"), x.b(g) || d.wd || (e += "contentTop:" + g.top + "px;", e += "contentLeft:" + g.left + "px;", e += "contentRight:" + g.right + "px;", e += "contentBottom:" + g.bottom + "px;"), x.nb(b, e))
}
return c
}
function rc(a, b) {
this.document = a;
this.a = b
}
rc.prototype.g = function(a) {
var b;
if (!(b = "string" === typeof this.a.Z(a, "line-height")) && (b = "HTML" !== a.nodeName && "BODY" !== a.nodeName)) {
b = this.a.U(a, "font-size", !0);
var c = this.a.U(a.parentNode, "font-size", !0);
b = b !== c ? !0 : !1
}
if (b) {
b = this.a.U(a, "line-height");
c = 1.2;
if ("normal" === b) c = 1.2;
else {
b = this.a.U(a, "line-height", !0);
b = sc(b);
c = this.a.U(a, "font-size", !0);
c = sc(c);
if (void 0 === c && void 0 === b) {
console.error("computed value is in unexpected format for node id:" + a.id);
return
}
0 == c ? (console.log("font-size : 0 (zero) is found during line-height relativization for node id: " +
a.id), c = 0) : c = b / c
}
c = c.toFixed(3);
this.a.Pd(a, c + "em")
}
};
function sc(a) {
if (void 0 !== a && 2 < a.length) return a = a.substr(0, a.length - 2);
console.error("Value is in unexpected format [" + a + "]")
}
function Mb(a, b, c, d, e) {
this.document = a;
this.platform = b;
this.ue = c;
this.mb = e;
this.a = d;
this.od = tc(this, a.location.href)
}
Mb.prototype.g = function(a) {
if (a.nodeType == document.ELEMENT_NODE) {
if ("string" === typeof a.src && "" != a.src.trim()) {
var b = Y(this, a.src);
this.a.bc(a, "src", b, this.mb)
}
b = a.getAttribute("href");
"string" === typeof b && "" != b.trim() && (b = Y(this, b), this.a.bc(a, "href", b, this.mb));
a: if (null != a.style) {
if ("" != a.style.backgroundImage.trim()) {
for (var b = "", c = a.style.backgroundImage.split(","), d = 0; d < c.length; d++) {
if (-1 == c[d].indexOf("url")) break a;
a.style.backgroundImage = "";
var e = uc(Y(this, vc(c[d])));
void 0 !== e && ("" != b ?
b = b + "," + e : b = e)
}
this.a.hc(a, "background-image", b)
}
"" != a.style.listStyleImage.trim() && (b = a.style.listStyleImage, -1 != b.indexOf("url") && (b = uc(Y(this, vc(b))), a.style.listStyleImage = "", this.a.hc(a, "list-style-image", b)))
}
}
};
function uc(a) {
return "url('" + a + "')"
}
function vc(a) {
a = a.trim();
var b = a.toLowerCase();
if (0 != b.indexOf("url(")) return a;
for (var c = b.indexOf(")"), d = b.indexOf("(", 4); - 1 != d && !(d > c);) c = b.indexOf(")", c), d = b.indexOf("(", d);
return a.substring(4, c)
}
function tc(a, b) {
var c = b;
if (0 == c.indexOf("file://")) {
var d = 0;
"Win32" == a.platform ? (d = 8, c = c.toLowerCase()) : d = 7;
c = c.substring(d)
}
try {
c = decodeURIComponent(c)
} catch (e) {}
"Win32" == a.platform && (c = c.replace(/\//g, "\\"));
return c
}
function Y(a, b) {
if ("string" === typeof b) {
b = b.trim();
if ("" === b) return b;
b = a.a.ec(b);
var c;
(c = "string" !== typeof b ? !1 : 0 === b.toLowerCase().trim().indexOf("data:")) || (c = b, "string" === typeof c ? (c = c.toLowerCase().trim(), c = 0 == c.indexOf("http://") || 0 == c.indexOf("https://") || 0 == c.indexOf("www.") || 0 == c.indexOf("ftp://") || 0 == c.indexOf("mailto:") ? !0 : !1) : c = void 0);
if (c) return b;
var d = tc(a, b);
if (a.ue) {
var e = "/";
"Win32" == a.platform && (e = "\\");
c = d.split(e);
e = a.od.split(e);
if (c[0] != e[0]) c = d;
else {
for (var d = "", g = 0, g = 1; g <
e.length && g < c.length && c[g] == e[g]; g++);
if (g == e.length && e.length == c.length) c = c[g - 1];
else {
for (var h = g; h < e.length - 1; h++) d += "../";
for (h = g; h < c.length; h++) d = d + c[h] + "/";
c = d.substring(0, d.length - 1)
}
}
} else c = d;
return c
}
}
window.cleanMathJaxOutput = wc;
function wc() {
for (var a = document.getElementsByClassName("MathJax_SVG"), b = 0; b < a.length; b++) {
for (var c = a[b], d = c.childNodes, e = 0; e < d.length; e++)
if ("svg" == d[e].tagName) {
var g = d[e],
h = document.createElement("defs");
g.insertBefore(h, g.childNodes[0]);
for (var g = g.getElementsByTagName("use"), k = 0; k < g.length; ++k) {
var m = g[k].getAttribute("href");
h.appendChild(document.getElementById(m.substr(1)).cloneNode(!0))
}
}
c.style.fontSize = "inherit";
"inline-block" === c.style.display && (c.style.display = "inline")
}
x.Ga(document.getElementsByTagName("math"));
x.removeNode(document.getElementById("MathJax_Message"));
x.removeNode(document.getElementById("MathJax_SVG_Tooltip"));
(a = document.getElementById("MathJax_SVG_Hidden")) && x.removeNode(a.parentNode);
x.Ga(document.getElementsByClassName("MathJax_Preview"));
x.Ga(document.getElementsByClassName("MJX_Assistive_MathML"));
x.Ga(document.getElementsByClassName("MJX_Assistive_MathML MJX_Assistive_MathML_Block"))
}
window.validateSupportedTags = xc;
function xc(a) {
var b = ["maction", "mglyph", "semantics"];
a && (a = a.querySelectorAll(b.join()), 0 < a.length && yc("MathML Jax - unknown node type, " + a[0].nodeName))
}
window.throwMathmlSpecificError = yc;
function yc(a) {
Array.isArray(a) && (a = a.slice(0, Math.min(2, a.length)).join(","));
throw '{"message":"' + a + '","errorCode":"MATHML_UNSUPPORTED_TAG"}';
}
var X = {
supportedMediaQuery: ["screen", "all", ""],
unsupportedorValidMediaQuery: "print;braille;embossed;handheld;projection;speech;tty;tv;not all".split(";"),
amazonSpecificMediaQuery: ["amzn-mobi", "amzn-kf8"],
checkForSpecialCharectors: [" ", ",", ":"],
ignorePXCheckForTheseMedias: ["orientation", "device-aspect-ratio"],
DEVICE_WIDTH: "device-width",
DEVICE_HEIGHT: "device-height",
NO_VALUE_OR_UNKNON_MEDIA_VALUE: "unknown",
V: function(a) {
a = x.N(a.toLowerCase().trim(), "only", "");
a = x.N(a, ", '/',", "/");
a = a.split(",");
for (index =
0; index < a.length; index++) {
var b = a[index];
a[index] = -1 === b.indexOf("not") ? x.N(b, " ", "") : b.trim()
}
return a
},
Ed: function(a) {
E.L(a, "Input media text is not a valid string");
a = this.V(a);
for (var b = 0; b < a.length; b++)
if (-1 !== this.supportedMediaQuery.indexOf(a[b])) return !0;
return !1
},
Ub: function(a) {
E.L(a, "Input media text is not a valid string");
for (var b = 0; b < this.unsupportedorValidMediaQuery.length; b++)
if (a.toLowerCase().trim() == this.unsupportedorValidMediaQuery[b]) return !0;
for (b = 0; b < this.amazonSpecificMediaQuery.length; b++)
if (a.toLowerCase().trim() ==
this.amazonSpecificMediaQuery[b]) return !0;
return !1
},
Rc: function(a) {
E.L(a, "Input media text is not a valid string");
a = this.V(a);
for (var b = 0; b < a.length; b++)
if (-1 == this.unsupportedorValidMediaQuery.indexOf(a[b])) return !1;
return !0
},
ld: function(a) {
E.L(a, "Input media text is not a valid string");
var b = this.V(a);
if (2 == b.length && "not" == b[0] && !this.Ub(b[1])) return !0;
for (b = 0; b < this.checkForSpecialCharectors.length; b++)
if (-1 != a.toLowerCase().trim().indexOf(this.checkForSpecialCharectors[b])) return !1;
return !0
},
Gd: function(a) {
E.L(a, "Input media text is not a valid string");
a = this.V(a);
for (var b = 0; b < a.length; b++)
if ("amzn-kf8" === a[b] || "not amzn-mobi" === a[b]) return !0;
return !1
},
Fd: function(a) {
E.L(a, "Input media text is not a valid string");
a = this.V(a);
for (var b = 0; b < a.length; b++)
if ("amzn-mobi" === a[b] || "not amzn-kf8" === a[b]) return !0;
return !1
},
zb: function(a) {
a = x.N(a, "(", "");
a = x.N(a, ")", "");
a = a.split("and");
for (var b = {}, c = 0; c < a.length; c++) {
var d = a[c].split(":"),
e = d[0];
1 == d.length ? b[e] = this.NO_VALUE_OR_UNKNON_MEDIA_VALUE :
(d = d[1], b[e] = -1 !== d.indexOf("px") ? d.split("px")[0] : -1 !== X.ignorePXCheckForTheseMedias.indexOf(e) ? d : this.NO_VALUE_OR_UNKNON_MEDIA_VALUE)
}
return b
},
ud: function(a) {
if (this.DEVICE_HEIGHT in a && this.DEVICE_WIDTH in a) {
var b = a[this.DEVICE_HEIGHT];
a = a[this.DEVICE_WIDTH];
if (600 == b && 800 == a || 800 == b && 600 == a) return !0
}
return !1
},
Qb: function(a, b) {
for (var c = 0; c < a.length; c++) {
var d = a[c];
if (d in b && b[d] !== this.NO_VALUE_OR_UNKNON_MEDIA_VALUE) return {
mediaPresent: !0,
value: b[d]
}
}
return {
mediaPresent: !1
}
}
};
function Ob() {
this.Mc = 1
}
Ob.prototype.g = function(a) {
a.j = this.Mc++;
a.nodeType === Node.ELEMENT_NODE && a.setAttribute("amzn-node-id", a.j)
};
function qb(a, b) {
this.elementNode = a;
this.textNode = b
}
var F = {
C: function(a) {
E.L(a, "Input Argument is not String");
a = parseInt(a);
E.rc(a, "Input String is not having proper numeric value");
return a
},
Fe: function(a) {
E.L(a, "Input Argument is not String");
a = parseFloat(a);
E.rc(a, "Input String is not having proper numeric value");
return a
}
};
function zc(a) {
this.document = a
}
function Ac(a) {
pageBreakNode = a.document.createElement("div");
pageBreakNode.style.pageBreakBefore = "always";
pageBreakNode.style.display = "block";
pageBreakNode.setAttribute("handlersProcessed", "true");
return pageBreakNode
}
zc.prototype.g = function(a) {
if (a.nodeType === Node.ELEMENT_NODE && null !== a.style) {
if ("always" === a.style.pageBreakAfter || "left" === a.style.pageBreakAfter || "right" === a.style.pageBreakAfter) {
var b = a.nextSibling;
null !== b ? a.parentNode.insertBefore(Ac(this), b) : a.parentNode.appendChild(Ac(this));
a.style.pageBreakAfter = "";
a.setAttribute("handlersProcessed", "true")
}
if ("always" === a.style.pageBreakBefore || "left" === a.style.pageBreakBefore || "right" === a.style.pageBreakBefore) "body" !== a.tagName.toLowerCase() && a.parentNode.insertBefore(Ac(this),
a), a.style.pageBreakBefore = "", a.setAttribute("handlersProcessed", "true")
}
};
function Bc(a) {
this.document = a;
this.ca = new Ka;
null !== this.ca && void 0 !== this.ca || console.log("Error:Unable to create the backdrop detector")
}
Bc.prototype.g = function(a) {
if (a.nodeType == document.ELEMENT_NODE && "a" == a.nodeName.toLowerCase()) {
var b = a.attributes.getNamedItem("data-app-amzn-magnify");
if (null != b) {
var b = b.nodeValue,
c = null;
try {
c = JSON.parse(b)
} catch (d) {
return
}
if (void 0 != c && null != c) {
b = c.ordinal;
if (void 0 == b || null == b) b = "1";
var e = c.sourceId,
g = null;
void 0 != e && null != e && (g = document.getElementById(e));
c = c.targetId;
null != c && void 0 != c && (c = document.getElementById(c), null != c && (null != g && void 0 != g && 0 == c.innerHTML.trim().length && (c.innerHTML = g.innerHTML),
null != c.style && (c.style.display = "block", c.setAttribute(x.AMZN_NODE_TYPE, x.AMZN_PANEL), c.setAttribute("ordinal", b), a.setAttribute("ordinal", b), null !== this.ca && void 0 !== this.ca && this.ca.Nc(c))))
}
}
}
};
function Cc(a, b, c, d) {
this.document = a;
this.a = b;
this.Dc = c;
this.pd = d;
this.te = "li ol ul a br hr table caption tr th td thead tbody tfoot col colgroup svg img".split(" ");
this.qe = ["float", "position", "vertical-align"];
this.re = ["position", "vertical-align"];
this.pc = "width height margin-top margin-bottom margin-left margin-right padding-top padding-bottom padding-left padding-right box-shadow -webkit-box-shadow border-left-style border-right-style border-top-style border-bottom-style outline-style".split(" ");
this.oe = ["br"];
this.ye = "box-shadow -webkit-box-shadow border-left-style border-right-style border-top-style border-bottom-style outline-style background-color background-image".split(" ");
this.he = ["center", "left", "right"];
this.fe = ["block", "inline", "inline-block"];
this.ge = ["block", "inline-block"];
this.yc = "span";
this.jb = "float";
this.xc = "margin-right";
this.hb = "display";
this.wc = "left";
this.ib = "inline";
this.Tc = [this.jb, this.xc, this.hb];
this.Zd = [this.hb];
this.isTextPresentInHtml = !1
}
Cc.prototype.g = function(a) {
"body" === a.nodeName.toLowerCase() && this.a.Ya(a) && (this.isTextPresentInHtml = !0);
if (a.nodeType === document.ELEMENT_NODE) {
var b = a.ownerDocument.defaultView.getComputedStyle(a);
if ("inline" === b.display) {
var c = a.style;
x.Sa(c, b) || (c.removeProperty("padding-top"), c.removeProperty("padding-bottom"))
}
}
Dc(this, a) && (a.style.removeProperty("width"), a.style.removeProperty("height"), a.style.removeProperty("margin-top"), a.style.removeProperty("margin-bottom"), a.setAttribute("amzn-pattern-type",
"inline-to-block"));
a.nodeType === document.ELEMENT_NODE && void 0 !== a.style.fontFamily && "''" === a.style.fontFamily && a.style.removeProperty("font-family");
if (this.Dc && a && "inline-block" === a.style.display)
if (0 <= this.te.indexOf(a.nodeName.toLowerCase())) console.log("IB_INFO_UNSUPPORTED_TAG_CURRENT:" + a.nodeName.toLowerCase());
else if ((b = a.parentNode) && b.nodeType !== Node.DOCUMENT_NODE && "none" !== b.style.display)
if (x.Aa(a, this.qe)) console.log("IB_INFO_UNSUPPORTED_STYLE_CURRENT:" + a.style.verticalAlign + ":" + a.style["float"] +
":" + a.style.position + ":" + a.nodeName.toLowerCase());
else if (x.Aa(b, this.re)) console.log("IB_INFO_UNSUPPORTED_STYLE_PARENT:" + b.style.verticalAlign + ":" + b.style["float"] + ":" + b.style.position + ":" + b.nodeName.toLowerCase());
else {
for (var d = c = 0, e = 0; e < b.childNodes.length; e++) b.childNodes[e].nodeType === Node.ELEMENT_NODE ? c++ : b.childNodes[e].nodeType === Node.TEXT_NODE && 0 != b.childNodes[e].nodeValue.trim().length && d++;
var g = x.Bb(a, !0),
h = x.Qa(a),
k = parseFloat(a.parentNode.ownerDocument.defaultView.getComputedStyle(a.parentNode,
"").width),
m = parseFloat(a.ownerDocument.defaultView.getComputedStyle(a, "").width),
l = e = !1,
n = !1,
p = !1;
if (void 0 === g || null == g) l = e = !0, g = "undef";
else if (g.nodeType === Node.TEXT_NODE) g = "TEXT", l = !0;
else {
var t = g.ownerDocument.defaultView.getComputedStyle(g, "");
if (null == t) l = e = !0, g = "undef";
else {
var u = t.display,
t = parseFloat(t.width);
"block" === u ? e = !0 : "inline-block" === u && t === k ? e = !0 : "inline" === u && x.wa(g) && (l = !0);
g = u + "#" + g.nodeName.toLowerCase()
}
}
void 0 === h || null == h ? (p = n = !0, h = "undef") : h.nodeType === Node.TEXT_NODE ?
(h = "TEXT", p = !0) : (t = h.ownerDocument.defaultView.getComputedStyle(h, ""), null == t ? (p = n = !0, h = "undef") : (u = t.display, t = parseFloat(t.width), "block" === u ? n = !0 : "inline-block" === u && t === k ? n = !0 : "inline" === u && x.wa(h) && (p = !0), h = u + "#" + h.nodeName.toLowerCase()));
if (0 > this.fe.indexOf(b.style.display.toLowerCase())) console.log("IB_INFO_UNSUPPORTED_DISPLAY_PARENT:" + b.style.display);
else if (m === k && "block" === b.style.display) a.style.display = "block", Ec(this, a, "Block");
else {
if (!(u = e && n)) a: if (this.isTextPresentInHtml || "" ===
a.style.width || "%" !== x.R(a.style.width) || m !== parseInt(k * x.D(a.style.width) / 100)) u = !1;
else {
k = a.parentNode;
for (m = 0; m < k.childNodes.length; m++)
if (u = k.childNodes[m], u.nodeType === Node.ELEMENT_NODE && u !== a && 0 !== parseFloat(u.ownerDocument.defaultView.getComputedStyle(u).width)) {
u = !1;
break a
}
u = !0
}
if (u && 0 <= this.ge.indexOf(b.style.display.toLowerCase())) a && b && (Fc(a, a.style.width.trim()), a.ownerDocument.defaultView.getComputedStyle(a), b = b.ownerDocument.defaultView.getComputedStyle(b), c = d = !1, x.Aa(a, this.ye) && (c = !0), void 0 !== b.textAlign && 0 <= this.he.indexOf(b.textAlign) && (d = a.getAttribute("computedstyle"), d += "parent_text_align:" + b.textAlign + ";", a.setAttribute("computedstyle", d), d = !0), d || c ? a.setAttribute("amzn-pattern-type", "inline-block-to-block") : (a.style.display = "block", Ec(this, a, "Block")));
else if (l && p && ("block" === b.style.display || "inline" === b.style.display)) {
if (a) {
b = a.style.width.trim();
e = a.childNodes;
d = null;
c = !1;
if (0 < e.length) {
d = e[0];
d = d.nodeType === Node.TEXT_NODE && "" === d.nodeValue.trim() ? x.Qa(d) : d;
if (void 0 ===
d || d.nodeType !== Node.ELEMENT_NODE) d = null;
e = null;
null !== d && void 0 === x.Qa(d) && (c = !0, e = d.style.width);
c && void 0 !== e && null !== e && e === b && (a.style.width = "", console.log("IB_INFO_WIDTH_REMOVED"))
}
Fc(a, b);
b = a.ownerDocument.defaultView.getComputedStyle(a);
if (x.wa(a))
if (x.Aa(a, this.pc))
for (b = x.gd(a, this.pc).split(","), c = 0; c < b.length; c++) console.log("IB_INFO_INLINE_UNSUPPORTED_STYLES:" + b[c]);
else x.Sa(a.style, b) ? console.log("IB_INFO_INLINE_UNSUPPORTED_BG:" + a.nodeName.toLowerCase()) : x.rb(a, this.oe) ? console.log("IB_INFO_INLINE_UNSUPPORTED_INNER_TAG:" +
a.nodeName.toLowerCase()) : (a.style.display = "inline", Ec(this, a, "Inline"));
else console.log("IB_INFO_INLINE_UNSUPPORTED_INNER_DISPLAY:" + a.nodeName.toLowerCase())
}
} else console.log("IB_INFO_MULTIPLE_SIBLING:" + c + ":" + d + ":" + a.style.width + ":" + a.nodeName.toLowerCase()), console.log("IB_INFO_ADJACENT_SIBLING:" + (e ? 1 : 0) + ":" + (n ? 1 : 0) + ":" + a.style.width + ":" + a.nodeName.toLowerCase()), console.log("IB_INFO_DISP_ADJACENT_SIBLING:" + (e ? 1 : 0) + ":" + (n ? 1 : 0) + ":" + g + ":" + h)
}
}
a.nodeType === Node.ELEMENT_NODE && a.nodeName.toLowerCase() ===
this.yc && (b = x.$c(a.parentNode), null != b && b == a && (a = x.bd(b), null != a && "object" === typeof b.style && "object" === typeof a.style && Gc(this.Tc, b) && Gc(this.Zd, a) && b.style["float"].toLowerCase() === this.wc && a.ownerDocument.defaultView.getComputedStyle(a).display.toLowerCase() === this.ib && (b.style.display = this.ib, b.style.removeProperty(this.jb))))
};
function Ec(a, b, c) {
var d = {};
d.layoutType = c;
d.htmlId = b.getAttribute("id");
null === d.htmlId && (d.htmlId = "");
d.amznNodeId = b.getAttribute("amzn-node-id");
null === d.amznNodeId && (d.amznNodeId = "");
d.htmlName = a.a.getFileName(a.pd);
console.log("IB_DEBUG_PATTERN_SUCCESS:" + JSON.stringify(d))
}
function Fc(a, b) {
if (a)
for (var c = a.childNodes, d = 0; d < c.length; d++) {
var e = c[d];
if (e.nodeType === Node.ELEMENT_NODE) {
var g = e.style.width.trim(),
h = void 0 === g || null === g || "" === g.trim();
void 0 !== b && null !== b && "" !== b.trim() || h || "%" !== x.R(g) || (e.style.width = "")
}
}
}
function Dc(a, b) {
if (b.nodeType !== document.ELEMENT_NODE || "inline" !== b.style.display) return !1;
var c = x.l(b.style.paddingLeft) || x.l(b.style.paddingRight) || x.l(b.style.paddingTop) || x.l(b.style.paddingBottom),
d = x.i(b.style.borderLeftStyle) || x.i(b.style.borderRightStyle) || x.i(b.style.borderTopStyle) || x.i(b.style.borderBottomStyle),
e = x.l(b.style.marginLeft) || x.l(b.style.marginRight),
g = x.i(b.style.outlineStyle);
if (!(d || c || e || g)) return !1;
c = b.childNodes;
if (1 !== c.length) return !1;
c = c[0];
if (c.nodeType !== document.TEXT_NODE ||
10 < c.nodeValue.length || 1 != a.a.M(c).length) return !1;
a: {
for (d = b.parentNode; null !== d && d.nodeType === document.ELEMENT_NODE;) {
if ("block" === d.style.display) break a;
d = d.parentNode
}
d = null
}
if (null === d) return !1;
d = b.ownerDocument.createNodeIterator(d, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT);
e = null;
for (g = ""; e = d.nextNode();)
if (e.nodeType === document.TEXT_NODE && (g += e.nodeValue.trim()), e.nodeType === document.ELEMENT_NODE && "img" === e.nodeName.toLowerCase()) return !1;
return g.trim() !== c.nodeValue.trim() ? !1 : !0
}
function Gc(a, b) {
for (var c = 0; c < b.style.length; c++)
if (-1 == a.indexOf(b.style[c])) return !1;
return !0
}
function Hc(a, b) {
this.document = a;
this.a = b;
this.positionRelatedStyles = ["top", "left", "right", "bottom"];
this.ignorableStylesForAbsolutelyPositionedImages = ["margin-top", "margin-bottom", "margin-right", "margin-left", "z-index"]
}
Hc.prototype.g = function(a) {
var b = a.nodeName.toLowerCase(),
c = this.document.defaultView.getComputedStyle(a),
d = "absolute" === a.style.position;
"img" !== b || "none" === c.display ? d && Ic(this, a) : d && (this.$a(a.style), Ic(this, a), a.style.display = "inline");
"relative" === a.style.position && ("inline" === a.ownerDocument.defaultView.getComputedStyle(a, "").display && "img" !== a.nodeName.toLowerCase() && "" === a.style["vertical-align"] && (Jc(a, "top", -1), Jc(a, "bottom", 1)), Ic(this, a));
if ("" === a.style.position || "static" === a.style.position)
for (a.style.removeProperty("position"),
b = 0; b < this.positionRelatedStyles.length; b++) a.style.removeProperty(this.positionRelatedStyles[b])
};
function Jc(a, b, c) {
if ("" !== a.style[b]) {
var d = a.style[b];
a.style["vertical-align"] = c * x.D(d) + x.R(d);
a.style.removeProperty(b)
}
}
Hc.prototype.$a = function(a) {
for (var b = 0; b < this.ignorableStylesForAbsolutelyPositionedImages.length; b++) a.removeProperty(this.ignorableStylesForAbsolutelyPositionedImages[b])
};
function Ic(a, b) {
for (var c = 0; c < a.positionRelatedStyles.length; c++) b.style.removeProperty(a.positionRelatedStyles[c]);
b.style.removeProperty("position")
}
function Nb(a, b, c, d) {
this.document = a;
this.a = b;
this.skipFailures = d;
this.qd = [34, 39, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 33, 34, 35, 37, 38, 39, 40, 41, 42, 44, 46, 47, 58, 59, 63, 64, 91, 92, 93, 123, 125, 130, 132, 133, 134, 135, 137, 145, 146, 147, 148, 149, 155, 160, 161, 167, 171, 182, 183, 187, 191, 8224, 8225, 8226, 8230, 8240, 8250];
this.sc = "&#8203;";
this.mc = ["block"];
this.fb = "span"
}
Nb.prototype.g = function(a) {
if (a.nodeType === Node.ELEMENT_NODE) {
for (var b in this.a.beforeAndAfterSelectors) {
var c = a,
d = b,
e = c.getAttribute(d);
if (e && "" !== e.trim()) {
if (-1 !== e.indexOf("counter") || -1 !== e.indexOf("open-quote") || -1 !== e.indexOf("close-quote") || -1 !== e.indexOf("attr(")) {
var g = d + " " + c.nodeName.toLowerCase() + " " + this.document.location.pathname;
q.h("RULE_FAILURE_UNSUPPORTED_STYLE", c.getAttribute("amzn-src-id"), g)
}
var e = this.a.Xc(e),
g = e.content,
h = e.style,
e = void 0;
"" === g && "" === h || "none" === g || "normal" ===
g || (-1 !== g.indexOf("url") ? (e = document.createElement("img"), e.setAttribute("src", vc(g))) : (e = g, "" !== g && (e = this.sc + g + this.sc), e = Kc(h, e)), e.setAttribute("amzn-isAddedContent", "true"), g = c.getAttribute("amzn-src-id"), x.b(g) || e.setAttribute("amzn-src-id", g), d === this.a.BEFORE ? (g = c.ownerDocument.defaultView.getComputedStyle(c).listStyleType, "li" === c.nodeName.toLowerCase() && "none" !== g && (g = d + " " + this.document.location.pathname, q.h("RULE_FAILURE_UNSUPPORTED_CONTENT_BEFORE_LI", c.getAttribute("amzn-src-id"), g)),
c.insertBefore(e, c.firstChild), e.setAttribute("amzn-selector", "before")) : (c.insertBefore(e, null), e.setAttribute("amzn-selector", "after")))
}
}
if (c = (b = a.getAttribute(this.a.FIRST_LETTER_STYLE)) && "" !== b.trim()) c = a.ownerDocument.defaultView.getComputedStyle(a).display, "block" === c ? c = !0 : (d = a.childNodes, "inline" === c && 1 === d.length && d[0].nodeType === Node.TEXT_NODE ? c = !1 : (c = this.document.location.pathname, q.h("RULE_FAILURE_FIRSTLETTER_UNSUPPORTED", a.getAttribute("amzn-src-id"), c), c = void 0));
if (c && (c = this.a.X(a))) {
d =
c.nodeValue.replace(/^\u200B/g, "");
d = d.replace(/^\s+/g, "");
e = 0;
g = !1;
h = d.length;
for (e = 0; e < h; e++)
if (-1 === this.qd.indexOf(d.charCodeAt(e))) {
if (g) break;
g = !0
}
g || q.h("RULE_FAILURE_FIRSTLETTER_NOT_FOUND", a.getAttribute("amzn-src-id"));
b = Kc(b, d.substr(0, e));
c.parentNode.insertBefore(b, c);
c.nodeValue = d.substring(e);
a.removeAttribute(this.a.FIRST_LETTER_STYLE)
}(b = a.getAttribute(this.a.FIRST_LINE_STYLE)) && "" !== b.trim() && (c = this.document.defaultView.getComputedStyle(a).display, "inline" !== c && "none" !== c && (-1 ===
this.mc.indexOf(c) && q.h("RULE_FAILURE_FIRSTLINE_UNSUPPORTED_DISPLAY_TAG", a.getAttribute("amzn-src-id"), c), c = Lc(this, a))) && (d = this.document.createElement(this.fb), d.setAttribute("style", b), d.setAttribute(this.a.FICTIONAL_FIRST_LINE_TAG, "true"), d.style.display = "none", c.parentNode.insertBefore(d, c.parentNode.childNodes[0]), a.removeAttribute(this.a.FIRST_LINE_STYLE))
}
};
function Lc(a, b) {
for (var c = b.childNodes, d = 0; d < c.length; d++) {
var e = c[d];
if (Node.ELEMENT_NODE === e.nodeType) {
var g = a.document.defaultView.getComputedStyle(e),
h = g.display;
if (Mc(g)) continue;
if ("inline" === h) {
if (cd(a, e)) return e;
continue
} - 1 === a.mc.indexOf(h) && q.h("RULE_FAILURE_FIRSTLINE_UNSUPPORTED_DISPLAY_TAG", e.getAttribute("amzn-src-id"), h);
return Lc(a, e)
}
if (Node.TEXT_NODE === e.nodeType && id(a, e)) return e
}
return null
}
function id(a, b) {
var c = b.nodeValue;
return "pre" === a.document.defaultView.getComputedStyle(b.parentNode)["white-space"] && "" !== c || "" !== c.trim() ? !0 : !1
}
function Mc(a) {
if ("none" === a.display || "none" !== a["float"]) return !0;
a = a.position;
return "fixed" === a || "absolute" === a ? !0 : !1
}
function cd(a, b) {
if (a.a.Pb(b)) return !0;
for (var c = b.childNodes, d = 0; d < c.length; d++) {
var e = c[d];
if (Node.TEXT_NODE === e.nodeType) {
if (id(a, e)) return !0;
break
}
var g = a.document.defaultView.getComputedStyle(e);
if (!Mc(g) && (g = g.display, "inline" !== g && q.h("RULE_FAILURE_INLINECHILD_UNSUPPORTED_DISPLAY_TAG", e.getAttribute("amzn-src-id"), g), e = cd(a, e))) return e
}
return !1
}
function Kc(a, b) {
var c = document.createElement("span");
c.setAttribute("style", a);
c.innerHTML = b;
return c
}
function jd(a) {
this.document = a
}
jd.prototype.g = function(a, b) {
a.nodeType === Node.ELEMENT_NODE && b.Va && a.marginBeforeCollapsable && a.marginBeforeQuirk && (a.style.marginTop = "0px")
};
function kd(a, b, c, d) {
this.document = a;
this.a = b;
this.le = c;
this.me = d
}
kd.prototype.g = function(a) {
if ("object" === typeof a && "number" === typeof a.nodeType && a.nodeType == document.ELEMENT_NODE && null != a.style && void 0 != a.style) {
var b = this.a.Y(a, "font-size"),
c = this.a.Y(a.parentNode, "font-size"),
d = null;
"string" === typeof b && (d = parseFloat(b));
b = null;
"string" === typeof c ? b = parseFloat(c) : "html" === a.nodeName.toLowerCase().trim() && (b = 16);
this.le && this.Ra(a, d, b);
if (this.me) a: if (c = d, b = this.a.Z(a, "text-indent"), "string" === typeof b && (!this.a.v(b, "em") || this.a.v(b, "rem"))) {
var e = this.a.Y(a,
"text-indent");
if (this.a.v(e, "%")) {
if ("object" !== typeof a.parentNode && "object" !== typeof a.parentNode.style) break a;
b = this.a.Y(a.parentNode, "width");
if ("string" !== typeof b) break a;
e = parseFloat(e);
e = e * parseFloat(b) / 100;
e = e + "px"
}
b = parseFloat(e);
"number" === typeof c && "number" === typeof b && (a.style.textIndent = b / c + "em")
}
c = ["margin-top", "margin-bottom"];
for (b = 0; b < c.length; b++) {
e = this.a.Z(a, c[b]);
if ("string" !== typeof e) break;
if (!this.a.v(e, "rem")) break;
e = this.a.Y(a, c[b]);
e = parseFloat(e);
if ("number" !== typeof e ||
"number" !== typeof d) break;
a.style[c[b]] = e / d + "em"
}
}
};
kd.prototype.Ra = function(a, b, c) {
var d = this.a.Z(a, "font-size");
"string" !== typeof d || this.a.v(d, "em") && !this.a.v(d, "rem") || "number" !== typeof b || "number" !== typeof c || (a.style.fontSize = b / c + "em")
};
function nc(a) {
this.f = a;
this.da = [];
this.F = [];
this.c = null;
this.cb = [];
this.S = !1;
this.K = null
}
function oc(a) {
this.u = a
}
function qc(a, b) {
var c = 0 < a.F.length ? a.F[a.F.length - 1] : null;
null == c ? a.F.push(b) : c.u.bottom == b.u.bottom ? c.u.right = b.u.right : a.F.push(b)
}
function pc(a, b) {
null == a.c ? a.c = new H(b.top, b.left, b.bottom, b.right) : (cc(a.c, b), null != a.K && null != a.c && (a.c.left < a.K.left && (a.c.left = a.K.left), a.c.right > a.K.right && (a.c.right = a.K.right), a.c.top < a.K.top && (a.c.top = a.K.top), a.c.bottom > a.K.bottom && (a.c.bottom = a.K.bottom)))
}
function ld(a) {
this.u = a;
this.m = [];
this.ja = this.ga = null
}
function W(a) {
if (null != a.O) return a.O;
var b = a.da,
c = null;
a.O = [];
for (var d = null, e = null, g = 0; g < b.length; g++) {
var h = a.da[g];
null === d && (d = h.f);
e = h.f;
if (!(null == h.c || h.f.nodeType == Node.TEXT_NODE && x.Ba(h.f)))
if (h.S) {
null != c && (a.O.push(c), c.ja = e, c = null);
var k = new ld(h.c);
k.ga = d;
k.ja = e;
k.m.push(h);
a.O.push(k);
e = d = null
} else if (null == c) {
for (var k = a.O, c = h, h = W(c), m = h.length, l = 0; l < m - 1; l++) k.push(h[l]);
0 < m ? curInlinedEntry = md(k, h[m - 1]) : (curInlinedEntry = new ld(c.c), curInlinedEntry.ga = curInlinedEntry.ja = c.f, curInlinedEntry.m.push(c));
c = curInlinedEntry;
null != c && (d = c.ga)
} else {
k = a.O;
l = h;
m = c;
c = W(l);
h = c.length;
if (0 < h) {
var l = k,
n = c[0];
n.m[0].S ? (l.push(m), l.push(n), m = null) : (cc(m.u, n.c), m.m.push(n.m[0]));
if (1 < h) {
l = k;
n = c;
null != m && l.push(m);
for (var m = n.length, p = 1; p < m - 1; p++) l.push(n[p]);
m = md(k, c[h - 1])
}
} else cc(m.u, l.c), m.m.push(l);
c = m
}
}
null != c && (c.ga = d, c.ja = e, a.O.push(c));
return a.O
}
function md(a, b) {
return b.m[0].S ? (a.push(b), null) : b
}
function cc(a, b) {
x.b(b) || x.b(a) || (b.top < a.top && (a.top = b.top), b.bottom > a.bottom && (a.bottom = b.bottom), b.left < a.left && (a.left = b.left), b.right > a.right && (a.right = b.right))
}
function nd(a) {
var b = a.c;
if (null == a.c || b.top == b.bottom) return !0;
a = a.f;
if (null != a && a.nodeType == Node.TEXT_NODE && null != a.nodeValue && void 0 != a.nodeValue && 0 == a.nodeValue.trim().length) return !0;
if (null == a || a.nodeType != Node.ELEMENT_NODE) return !1;
a = a.getAttribute("amzn-isemptynode");
return null != a && "true" === a.toLowerCase() ? !0 : !1
}
var J = "1",
P = "2";
function od(a, b, c, d) {
var e = [];
for (d = void 0 == d ? a.c : d;;) {
var g = !0,
h = a.f.style;
x.b(h) || "left" !== h["float"] && "right" !== h["float"] || (g = !1);
a = I(a, b, c, g);
if (null == a) break;
if (x.xa(a.c, d) !== N) break;
if (a.c.top !== a.c.bottom && (c === J && a.c.bottom === d.top || c === P && a.c.top === d.bottom)) break;
e.push(a)
}
return e
}
function I(a, b, c, d) {
for (a = a.f; a.nodeType != Node.ELEMENT_NODE || "html" !== a.nodeName.toLowerCase();) {
var e = a;
a = c == J ? a.previousSibling : c == P ? a.nextSibling : null;
if (null != a) {
if (x.b(a.j)) continue;
e = G(b, a);
if (nd(e)) continue;
return e
}
a = e.parentNode;
e = a.style.display;
if (x.b(a)) break;
if (d && (x.Mb(a) || "inline-block" == e)) break
}
return null
}
function pd(a) {
for (var b = a.length, c = 0; c < b; c++)
for (var d = a[c].u, e = c + 1; e < b; e++) {
var g = a[e].u;
if (d.right > g.left || x.xa(d, g) !== N) return !1
}
return !0
}
function Ub(a) {
return 1 >= a.length || pd(a) ? !1 : !0
}
function Wb(a, b, c) {
a = I(a, b, c, !1);
if (x.b(a)) return null;
for (b = null;;) {
b = W(a);
if (x.b(b)) break;
if (1 == b.length && $b(b[0])) a = b[0].m[0];
else return a
}
return null
}
function $b(a) {
return 1 == a.m.length && a.m[0].S
}
function qd(a, b, c) {
this.document = a;
this.gc = b;
this.Zb = c
}
function rd(a, b) {
this.a = a;
this.tb = b
}
function sd(a, b) {
if (null == b) return "";
if (b.nodeType == document.TEXT_NODE) {
var c = a.a.Lb(b.nodeValue);
return a.a.lb(b, c)
}
if (b.nodeType == document.COMMENT_NODE) return "\x3c!-- " + b.nodeValue + " --\x3e";
if (b.nodeType == document.DOCUMENT_TYPE_NODE) return "";
if (b.nodeType == document.ELEMENT_NODE || b.nodeType == document.DOCUMENT_NODE) {
c = null != b.childNodes ? b.childNodes.length : 0;
nodeContent = "";
for (var d = 0; d < c; d++) nodeContent += sd(a, b.childNodes[d]);
if (b.nodeType == document.DOCUMENT_NODE) return nodeContent;
a.a.ac(b);
for (var c =
b.attributes, d = "", e = 0; e < c.length; e++) {
var g = c[e].name,
h = c[e].value,
k = a.a.xb(g);
a.tb && a.a.td(g) || (a.tb && void 0 != b.getAttribute(k) && (h = b.getAttribute(k)), d += g + '="' + a.a.Lb(h) + '" ')
}
c = d;
d = b.tagName.toLowerCase();
if (a.a.Jd(d)) return nodeContent;
a.a.xd(d) ? nodeContent = "<" + d + " " + c + "/>" : (d = a.a.Sd(d), nodeContent = "<" + d + " " + c + ">" + nodeContent + "</" + d + ">");
return a.a.lb(b, nodeContent)
}
return ""
}
function td(a) {
this.a = a
}
td.prototype.ab = function(a) {
jsonData = {
fontFaceRules: []
};
for (var b = 0; b < a.length; b++) {
var c = a[b],
d = c.rule;
jsonData.fontFaceRules[b] = {
cssPath: c.href,
fontFamily: d.style["font-family"],
src: d.style.modifiedsrc,
fontWeight: d.style["font-weight"],
fontStyle: d.style["font-style"],
fontStretch: d.style["font-stretch"]
}
}
return JSON.stringify(jsonData)
};
function ud(a, b) {
this.A = new Gb;
this.Sc = new Sb(this.A);
this.document = a;
this.fc = b;
this.G = [];
this.ub = {};
this.vc = "512px";
this.uc = "16px";
b.fontSize === this.uc && b.width === this.vc && (this.A.jc = !0)
}
ud.prototype.register = function(a) {
this.G.push(a)
};
ud.prototype.g = function(a) {
if (!x.b(a.j)) {
for (var b = !1, c = 0; c < this.G.length; c++)
if (Qa(a)) {
b = !0;
break
}
if (b) {
var d = G(this.A, a),
b = this.ub;
a = a.j;
var e = this.Sc,
c = od(d, e.A, J),
g = od(d, e.A, P),
h = x.Wc(d.f),
k = G(e.A, h),
h = {};
h["1"] = c.length.toString();
h["2"] = g.length.toString();
if (0 == c.length && 0 == g.length) {
var m = W(k);
if (!x.b(m)) {
h["3"] = m.length.toString();
var l = d.f;
if (!x.b(l.textContent)) {
var n = d.f.style.display,
p = l.ownerDocument.defaultView.getComputedStyle(l, "")["vertical-align"];
"table-cell" !== n || "middle" != p &&
"top" != p && "bottom" != p || 1 !== x.Td(k.f) || (Zb(m, h, l), h["15"] = "1")
}
}
}
m = W(k);
x.b(m) || (h["3"] = m.length.toString(), !Yb(m) || 1 !== m[0].m.length || m[0].m[0] !== d || (h["4"] = "1", l = m[0].u.right - m[1].u.left, n = m[0].u.right - m[0].u.left, 0 < l && (!x.$(d.f) || 20 < 100 * l / n) || x.$(d.f) && 0 <= x.D(d.f.style.marginLeft) || (h["5"] = "1", Zb(m, h, d.f), x.b(d.f.textContent) || (m = d.f.textContent.trim(), 0 != m.length && (x.Cd(m) ? h["8"] = "1" : (l = m.replace(/[.,(){}#]/g, ""), x.Hd(l) || x.Id(l) || x.Bd(l) ? h["9"] = "1" : 1 == m.length && (Vb(e, k, m, J) || Vb(e, k, m, P)) && (h["10"] =
"1")))), pd(k.F) && (h["6"] = "1"), !Xb(e, k, J) && !Xb(e, k, P)))) || (h["7"] = "1");
b: if (k = d.f, !x.b(k) && k.nodeType == Node.ELEMENT_NODE && ("inline-block" === k.ownerDocument.defaultView.getComputedStyle(k, "").display || x.$(k)) && !nd(d)) {
k = new H(d.c.top, d.c.left, d.c.bottom, d.c.right);
for (m = 0; m < c.length; m++)
if (!bc(d, k, c[m])) break b;
for (m = 0; m < g.length; m++)
if (!bc(d, k, g[m])) break b;
m = od(d, e.A, J, k);
k = od(d, e.A, P, k);
m.length == c.length && k.length == g.length && (h["11"] = (c.length + g.length + 1).toString(), ac(d, g, h))
}
b: if (k = d.f, !x.b(k) &&
k.nodeType == Node.ELEMENT_NODE && (m = k.ownerDocument.defaultView.getComputedStyle(k, "").display, "table-cell" === m && null != d.c && (k = new H(d.c.top, d.c.left, d.c.bottom, d.c.right), l = h["5"], 0 < g.length && "1" !== l && 0 === x.$b(c, m).length))) {
m = x.$b(g, m);
for (l = 0; l < m.length; l++)
if (!bc(d, k, m[l])) break b;
h["11"] = (m.length + 1).toString();
ac(d, m, h)
}
if (Tb(e, h, d)) h["16"] = "1";
else if (pd(d.F) && (h["12"] = "1"), e = "inline-block" != d.f.style.display || 0 == c.length && 0 == g.length ? !1 : !0, void 0 == h["13"] && e && (0 < g.length && ac(d, g, h), 0 < c.length &&
0 == g.length && !x.b(d) && (d = d.f, !x.b(d)))) {
g = [];
for (e = 0; e < c.length; e++) k = c[e], x.b(k) || (k = k.f, x.b(k) || k.nodeType == Node.ELEMENT_NODE && g.push(k.j.toString()));
g.push(d.j.toString());
g.push(d.j.toString());
d.ba = !0;
d.Ja = !0;
h["13"] = JSON.stringify(g)
}
b[a] = h
}
}
};
function vd(a, b) {
this.document = a;
this.Ia = "azimuth border-collapse border-spacing caption-side color cursor direction elevation empty-cells font-family font-size font-style font-variant font-weight font letter-spacing line-height list-style-image list-style-position list-style-type list-style orphans pitch-range pitch quotes richness speak-header speak-numeral speak-punctuation speak speech-rate stress text-align text-indent text-transform visibility voice-family volume white-space widows word-spacing".split(" ");
this.ob =
"width height top left right bottom margin-left margin-right margin-top margin-bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom min-height max-height min-width max-width".split(" ");
this.Uc = ["margin-left", "margin-right", "margin-top", "margin-bottom"];
this.ia = b;
this.ta = ["border-width", "border-top-width", "border-bottom-width", "border-left-width", "border-right-width"];
this.jd = ["font-family"];
this.Qc = ["", "''", '""']
}
vd.prototype.g = function(a) {
for (var b = a.style, c = {}, d = 0; d < b.length; d++) {
var e = b[d];
c[e] = b[e];
var g = c,
h = e;
if ("font" == h) {
if (h = g.font) "inherit" == h.trim().toLowerCase() && (g["font-style"] = "inherit", g["font-variant"] = "inherit", g["font-weight"] = "inherit", g["font-size"] = "inherit", g["line-height"] = "inherit", g["font-family"] = "inherit"), fontCSSProperties = h.split(" ", 4), fontFamilyOffset = 0, 4 == fontCSSProperties.length && (g["font-style"] = fontCSSProperties[0], fontFamilyOffset += fontCSSProperties[0].length + 1, g["font-variant"] =
fontCSSProperties[1], fontFamilyOffset += fontCSSProperties[1].length + 1, g["font-weight"] = fontCSSProperties[2], fontFamilyOffset += fontCSSProperties[2].length + 1, fontSizeBarLineHeight = fontCSSProperties[3], fontFamilyOffset += fontCSSProperties[3].length + 1, splitted = fontSizeBarLineHeight.split("/"), g["font-size"] = splitted[0], g["line-height"] = splitted[1], g["font-family"] = h.substring(fontFamilyOffset, h.length)), delete g.font
} else if (0 == h.indexOf("border")) {
var k = g[h];
null != h && void 0 != h && null != k && void 0 != k && ("inherit" !==
k ? "border-width" === h.toLowerCase().trim() && "initial" === k ? (g["border-top-width"] = k, g["border-bottom-width"] = k, g["border-right-width"] = k, g["border-left-width"] = k, delete g[h]) : g[h] = k : ("border-color" == h ? (g["border-top-color"] = "inherit", g["border-bottom-color"] = "inherit", g["border-right-color"] = "inherit", g["border-left-color"] = "inherit", delete g[h]) : "border-style" == h && (g["border-top-style"] = "inherit", g["border-bottom-style"] = "inherit", g["border-right-style"] = "inherit", g["border-left-style"] = "inherit",
delete g[h]), "border-width" == h && "inherit" == k && (g["border-top-width"] = k, g["border-bottom-width"] = k, g["border-right-width"] = k, g["border-left-width"] = k, delete g[h])))
} else 0 == h.indexOf("padding") ? (k = g[h], null != h && void 0 != h && null != k && void 0 != k && ("inherit" !== k ? g[h] = k : "padding" == h ? (g["padding-top"] = "inherit", g["padding-bottom"] = "inherit", g["padding-right"] = "inherit", g["padding-left"] = "inherit", delete g.padding) : g[h] = k)) : 0 == h.indexOf("margin") && (k = g[h], null != h && void 0 != h && null != k && void 0 != k && ("inherit" !==
k ? g[h] = k : "margin" == h ? (g["margin-top"] = "inherit", g["margin-bottom"] = "inherit", g["margin-right"] = "inherit", g["margin-left"] = "inherit", delete g.margin) : g[h] = k))
}
for (e in c)
if (b = c, d = e, g = b[d], this.ia && -1 != this.ob.indexOf(d) && 0 < g.indexOf("%") && (g = a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue(d).cssText, b[d] = g), b = c, d = e, 0 <= this.jd.indexOf(d.toLowerCase().trim()) && 0 <= this.Qc.indexOf(b[d].replace(" ", "")) && delete b[d], b = a, d = c, g = e, (h = d[g]) && null !== b.parentNode && "inherit" === h.trim().toLowerCase())
if (b.parentNode.nodeType ===
Node.DOCUMENT_NODE) - 1 !== this.Ia.indexOf(g) && delete d[g];
else if (null != b.parentNode && b.parentNode.nodeType != Node.DOCUMENT_NODE && null != b.parentNode.style)
if (h = -1 == this.ob.indexOf(g) ? !1 : !0, k = -1 == this.Uc.indexOf(g) ? !1 : !0, -1 !== this.Ia.indexOf(g)) delete d[g];
else {
var m = b.parentNode.style.getPropertyCSSValue(g);
null === m && 0 > this.ta.indexOf(g) && delete d[g];
null !== m && k ? d[g] = b.ownerDocument.defaultView.getComputedStyle(b).getPropertyCSSValue(g).cssText : h || null == m || (d[g] = b.parentNode.style.getPropertyCSSValue(g).cssText)
}
x.Eb(c);
e = c["background-attachment"];
void 0 !== e && "fixed" == e.trim().toLowerCase() && (c["background-origin"] = "border-box");
void 0 !== a.tagName && "body" === a.tagName.toLowerCase() && void 0 !== c["background-origin"] && (c["background-origin"] = "border-box");
0 != a.tagName.toLowerCase().indexOf("li") && "list-item" == c.display && (c.display = "block");
e = c.color;
b = !0;
null != c.color && null != c["-webkit-text-fill-color"] && (b = !1);
void 0 === c["-webkit-text-stroke-width"] && null == c["-webkit-text-stroke-width"] && b && null != c["-webkit-text-stroke-color"] &&
delete c["-webkit-text-stroke-color"];
void 0 !== c["-webkit-text-fill-color"] && void 0 !== c.color && delete c.color;
void 0 !== c["-webkit-text-stroke-color"] && null != c["-webkit-text-stroke-color"] || void 0 === c["-webkit-text-stroke-width"] && null == c["-webkit-text-stroke-width"] || null != e && (c["-webkit-text-stroke-color"] = e);
e = "background-size background-origin background-repeat background-repeat-x background-repeat-y background-size-x background-size-y background-position background-position-x background-attachment background-position-y".split(" ");
if (void 0 === c["background-image"])
for (b = 0; b < e.length; b++) void 0 !== c[e[b]] && delete c[e[b]];
if ("mbp:pagebreak" === a.tagName.toLowerCase().trim()) {
for (var l in c) delete c[l];
c["page-break-before"] = "always";
c.display = "block"
}
if (null != a && "hr" === a.tagName.toLowerCase().trim())
if (l = a.parentNode, e = l.ownerDocument.defaultView.getComputedStyle(l, "").display, "table" === l.nodeName || "tr" === l.nodeName || "table" !== e && "table-row" !== e || null != c.width) {
if (l = a.attributes, null != l) {
null != c.color && (c.color = "rgb(128,128,128)");
b = e = !1;
for (d = 0; d < l.length; d++) "color" === l[d].name && (b || null == c["background-color"] ? c["background-color"] = l[d].value : (e = !0, c.color = l[d].value)), e || "noshade" !== l[d].name || (null != c["background-color"] ? c.color = "rgb(128,128,128)" : (b = !0, c["background-color"] = "rgb(128,128,128)")), "size" === l[d].name && (l[d].value = parseInt(l[d].value) + "px"), "width" === l[d].name && (g = l[d].value, null != g && "%" !== g.slice(-1) && (l[d].value = parseInt(g) + "px"), null == a.getAttribute("align") && a.setAttribute("align", "center"), wd(a, c));
null !=
c.width && wd(a, c)
}
} else c.border = "0";
"br" === a.tagName.toLowerCase().trim() && (l = a.getAttribute("clear"), null !== l && (c.clear = l, a.removeAttribute("clear")), l = a.ownerDocument.defaultView.getComputedStyle(a.parentNode, ""), null != c["text-decoration"] || null != l.textDecoration && "none" != l.textDecoration) && (c["text-decoration"] = "none");
l = c["letter-spacing"];
null !== l && 0 >= parseFloat(l, 10) && delete c["letter-spacing"];
l = ["skewz", "prospective", "scalez"];
void 0 != c["-webkit-transform"] && null != c["-webkit-transform"] &&
(-1 != l.indexOf(c["-webkit-transform"].substr(0, c["-webkit-transform"].indexOf("(")).toLowerCase()) ? delete c["-webkit-transform"] : "inline" != c.display && "inline-block" != c.display || delete c["-webkit-transform"]);
"li" === a.tagName.toLowerCase().trim() && void 0 !== c.display && "list-item" !== c.display && (c["list-style-type"] = "none");
if ("img" === a.tagName.toLowerCase().trim() && (l = a.attributes, null !== l))
for (e = 0; e < l.length; e++) "align" !== l[e].name || "left" !== l[e].value.toLowerCase().trim() && "right" !== l[e].value.toLowerCase().trim() ||
(c["float"] = l[e].value, a.removeAttribute("align"));
l = {};
for (var n in c) {
a: if (e = a, b = n, d = c[n], "initial" == d && -1 == this.Ia.indexOf(b) && 0 > this.ta.indexOf(b)) e = !0;
else {
if ("auto" === d) {
if ("height" === b) {
e.removeAttribute("height");
e = !0;
break a
}
if ("width" === b) {
e.removeAttribute("width");
e = !0;
break a
}
}
e = "background-color" === b && "transparent" === d ? !0 : !1
}e || (l[n] = c[n])
}
document.body === a && (a.setAttribute("body-margin-left", a.style.marginLeft), a.setAttribute("body-margin-right", a.style.marginRight), a.setAttribute("body-margin-left-importance",
a.style.getPropertyPriority("margin-left")), a.setAttribute("body-margin-right-importance", a.style.getPropertyPriority("margin-right")));
var c = "",
p;
for (p in l) c += "" + p + ":" + l[p] + ";";
a.setAttribute("style", c);
n = a.ownerDocument.defaultView.getComputedStyle(a, "");
p = "font_style:" + n.fontStyle + ";";
p += "font_weight:" + n.fontWeight + ";";
p += "font_variant:" + n.fontVariant + ";";
p += "width:" + n.width + ";";
p += "height:" + n.height + ";";
p += "text-align:" + x.J(a, n, "text-align") + ";";
p += "font-size:" + n.fontSize + ";";
p += "margin-left:" +
x.J(a, n, "margin-left") + ";";
p += "margin-right:" + x.J(a, n, "margin-right") + ";";
p += "margin-top:" + x.J(a, n, "margin-top") + ";";
p += "margin-bottom:" + x.J(a, n, "margin-bottom") + ";";
p += "padding-left:" + x.J(a, n, "padding-left") + ";";
p += "padding-right:" + x.J(a, n, "padding-right") + ";";
p += "padding-top:" + x.J(a, n, "padding-top") + ";";
p += "padding-bottom:" + x.J(a, n, "padding-bottom") + ";";
p += "text-indent:" + x.J(a, n, "text-indent") + ";";
p += "vertical-align:" + x.J(a, n, "vertical-align") + ";";
p += "line-height:" + x.J(a, n, "line-height") + ";";
if (!0 ===
x.Rb(a) && (c = a.getElementsByTagName("g"), 0 < c.length && (n = x.J(a, n, "color"), l = c[0].getElementsByTagName("g"), l.length && (l = l[0].getAttribute("fill"), "rgb(0, 0, 0)" !== n && null == l))))
for (l = 0; l < c.length; l++) c[l].setAttribute("fill", n), c[l].setAttribute("stroke", n);
x.nb(a, p);
this.pb && null !== a.style && void 0 !== a.style && xd(this.pb, a.style);
null !== a && (p = a.nodeName.toLowerCase(), "ul" != p && "ol" != p || x.w(a.style.listStyleImage) || (p = a.parentNode.nodeName.toLowerCase(), c = a.parentNode, "ul" != p && "ol" != p || "" == c.style.listStyleImage ||
(a.style.listStyleImage = c.style.getPropertyCSSValue("list-style-image").cssText)));
if (null !== a) {
if (x.w(a.style.outlineStyle) && !x.w(a.style.outlineWidth) || "initial" === a.style.outlineWidth) a.style.outlineWidth = a.ownerDocument.defaultView.getComputedStyle(a).outlineWidth;
if (x.w(a.style.outlineStyle) && !x.w(a.style.outlineColor) || "initial" === a.style.outlineColor) a.style.outlineColor = a.ownerDocument.defaultView.getComputedStyle(a).color
}
if (a)
for (p = a.ownerDocument.defaultView.getComputedStyle(a).color, c = ["border-left-color", "border-right-color", "border-top-color", "border-bottom-color"], n = 0; n < c.length; n++) l = c[n], e = a.style[l], x.w(e) && "currentcolor" === e.toLowerCase() && (a.style[l] = p);
"left" !== a.style["float"] && "right" !== a.style["float"] || "0" != x.D(a.style.width) || (a.style.width = "")
};
function wd(a, b) {
null != b["margin-left"] && "auto" !== b["margin-left"] && (a.setAttribute("align", "left"), null != b["margin-right"] && delete b["margin-right"]);
null != b["margin-right"] && "auto" !== b["margin-right"] && a.setAttribute("align", "right")
}
function Lb(a, b) {
this.document = a;
this.a = b;
this.hasStyleAppliedUsingPseudoSelector = !1
}
Lb.prototype.g = function(a) {
if (a.nodeType == document.ELEMENT_NODE) {
a.setAttribute("style", yd(this, a, ""));
zd(this, a, this.a.FIRST_LETTER_STYLE, "first-letter");
zd(this, a, this.a.FIRST_LINE_STYLE, "first-line");
for (var b in this.a.beforeAndAfterSelectors) zd(this, a, b, this.a.beforeAndAfterSelectors[b])
}
};
function zd(a, b, c, d) {
d = yd(a, b, d);
"" !== d && (a.hasStyleAppliedUsingPseudoSelector = !0, b.setAttribute(c, d))
}
function yd(a, b, c) {
var d = b.ownerDocument.defaultView.getMatchedCSSRules(b, c);
c = "" === c;
var e = {},
g = {};
if (null != d)
for (var h = d.length, k = 0; k < h; k++) Ad(a, e, g, d[k].style);
c && Ad(a, e, g, b.style);
for (var m in g) e[m] = g[m] + "!important";
x.Eb(e);
inlinedStyle = "";
for (var l in e) inlinedStyle += "" + l + ":" + e[l] + ";";
return inlinedStyle
}
Lb.prototype.Z = function(a) {
return a.cssText
};
function Ad(a, b, c, d) {
if (null != d) {
var e = 0,
g = d.length;
for (a = a.a.ad(d.cssText); e < g;) {
var h = d[e],
k = a[h],
m = d.getPropertyCSSValue(h).cssText,
l = null,
l = !0 === k ? c : b;
l[h] = m;
e++
}
}
}
function Bd(a) {
this.document = a
}
Bd.prototype.g = function(a) {
if (a.nodeType == Node.ELEMENT_NODE && null != a.style) {
var b = a.nodeName.toLowerCase();
"sub" != b && "sup" != b || null == a.style || ("" == a.style.fontSize && (a.style.fontSize = a.ownerDocument.defaultView.getComputedStyle(a).getAbsolutePropertyCSSValue("font-size").cssText), "" == a.style.verticalAlign && (a.style.verticalAlign = "sub" == b ? "sub" : "super"))
}
};
function Cd(a, b) {
this.document = a;
this.a = b;
this.je = ["table", "tr", "th", "td"];
this.ie = ["td", "th"];
this.xe = ["tbody", "tr"]
}
Cd.prototype.g = function(a, b) {
if (a.nodeType === document.ELEMENT_NODE && "table" === a.nodeName.toLowerCase()) {
var c = a.ownerDocument.defaultView.getComputedStyle(a, ""),
d = a.style,
e = x.i(c.borderSpacing);
!x.i(d.borderSpacing) && e && (d.borderSpacing = c.borderSpacing);
d = a.style;
e = x.i(c.borderCollapse);
!x.i(d.borderCollapse) && e && (d.borderCollapse = c.borderCollapse);
b && (c = a.style, x.w(c.display) && ("inline" == c.display || "inline-table" == c.display) && (x.w(b.Xa) && "center" == b.Xa && (c.display = "table", c.marginLeft = "auto", c.marginRight =
"auto"), x.w(c.width) && "100%" == c.width || x.w(c.minWidth) && "100%" == c.minWidth)) && (c.display = "table")
}
if (!(a.nodeType !== document.ELEMENT_NODE || 0 > this.je.indexOf(a.nodeName.toLowerCase()))) {
c = a.ownerDocument.defaultView.getComputedStyle(a, "");
d = a.style;
e = x.i(c.borderLeftStyle);
!x.i(d.borderLeftStyle) && e && (d.borderLeftStyle = c.borderLeftStyle);
e = x.i(c.borderRightStyle);
!x.i(d.borderRightStyle) && e && (d.borderRightStyle = c.borderRightStyle);
e = x.i(c.borderTopStyle);
!x.i(d.borderTopStyle) && e && (d.borderTopStyle =
c.borderTopStyle);
e = x.i(c.borderBottomStyle);
!x.i(d.borderBottomStyle) && e && (d.borderBottomStyle = c.borderBottomStyle);
var d = a.style,
e = x.l(d.borderLeftWidth),
g = x.l(c.borderLeftWidth);
!e && g && (d.borderLeftWidth = c.borderLeftWidth);
e = x.l(d.borderRightWidth);
g = x.l(c.borderRightWidth);
!e && g && (d.borderRightWidth = c.borderRightWidth);
e = x.l(d.borderTopWidth);
g = x.l(c.borderTopWidth);
!e && g && (d.borderTopWidth = c.borderTopWidth);
e = x.l(d.borderBottomWidth);
g = x.l(c.borderBottomWidth);
!e && g && (d.borderBottomWidth = c.borderBottomWidth);
d = a.style;
e = x.l(d.paddingLeft);
g = x.l(c.paddingLeft);
!e && g && (d.paddingLeft = c.paddingLeft);
e = x.l(d.paddingRight);
g = x.l(c.paddingRight);
!e && g && (d.paddingRight = c.paddingRight);
e = x.l(d.paddingTop);
g = x.l(c.paddingTop);
!e && g && (d.paddingTop = c.paddingTop);
e = x.l(d.paddingBottom);
g = x.l(c.paddingBottom);
!e && g && (d.paddingBottom = c.paddingBottom)
}
a.nodeType === document.ELEMENT_NODE && (c = a.nodeName.toLowerCase(), 0 <= this.ie.indexOf(c) ? (c = a.ownerDocument.defaultView.getComputedStyle(a, ""), null !== c && x.w(c.verticalAlign) &&
(a.style.verticalAlign = c.verticalAlign)) : 0 <= this.xe.indexOf(c) && null !== a.style && x.w(a.style.verticalAlign) && (a.style.verticalAlign = ""))
};
function Dd(a) {
this.document = a
}
Dd.prototype.g = function(a) {
if (a.nodeType === document.ELEMENT_NODE && null !== a.style && void 0 !== a.style) {
var b = a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue("direction").cssText || "ltr",
c = a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue("text-align").cssText;
void 0 !== c && (c = c.trim().toLowerCase(), b = b.trim().toLowerCase(), "start" === c || "" !== a.style.textAlign && "initial" === a.style.textAlign ? a.style.textAlign = "ltr" === b ? "left" : "right" : "end" === c && (a.style.textAlign =
"ltr" === b ? "right" : "left"))
}
};
function Ed(a) {
this.document = a;
this.ke = ["thin", "thick", "medium"]
}
function Z(a, b) {
b = b.trim().toLowerCase();
return -1 !== a.ke.indexOf(b) ? !0 : !1
}
Ed.prototype.g = function(a) {
a.nodeType == Node.ELEMENT_NODE && null !== a.style && (Z(this, a.style.borderLeftWidth) && (a.style.borderLeftWidth = a.ownerDocument.defaultView.getComputedStyle(a).borderLeftWidth), Z(this, a.style.borderRightWidth) && (a.style.borderRightWidth = a.ownerDocument.defaultView.getComputedStyle(a).borderRightWidth), Z(this, a.style.borderTopWidth) && (a.style.borderTopWidth = a.ownerDocument.defaultView.getComputedStyle(a).borderTopWidth), Z(this, a.style.borderBottomWidth) && (a.style.borderBottomWidth =
a.ownerDocument.defaultView.getComputedStyle(a).borderBottomWidth), Z(this, a.style.outlineWidth) && (a.style.outlineWidth = a.ownerDocument.defaultView.getComputedStyle(a).outlineWidth))
};
var S = 0,
Fd = 1;
function Q(a, b, c) {
this.a = a;
this.document = b;
this.G = [];
this.Ud = void 0 == c ? Fd : c;
this.W = !1
}
Q.prototype.register = function(a) {
null != a && this.G.push(a)
};
Q.prototype.transformNode = function(a, b) {
if (this.Ud != Fd || a.nodeType == document.ELEMENT_NODE || a.nodeType == document.DOCUMENT_NODE)
if (a.nodeType != document.ELEMENT_NODE || null === a.getAttribute("handlersProcessed") || this.W) {
var c = new T(a);
c.Va = a.marginBeforeIgnored ? !0 : b.Va;
c.ma = b.ma;
c.la = b.la;
if (void 0 !== c.node.tagName && !x.b(b.node.style)) {
var d = b.node.tagName.toLowerCase();
"ol" !== d && "ul" !== d && "li" !== d && (void 0 !== b.node.style.listStylePosition && "" !== b.node.style.listStylePosition && (c.ma = !0), void 0 !== b.node.style.listStyleImage &&
"" !== b.node.style.listStyleImage && (c.la = !0))
}
b.node.style && (c.Xa = b.node.style.textAlign);
for (B in this.G) this.G[B].g(a, c);
if (!x.b(a.childNodes))
for (d = 0; d < a.childNodes.length; d++) this.transformNode(a.childNodes[d], c);
c.Yd && (c.node.style.width = "", c.node.style.height = "");
c.ma = !1;
c.la = !1
}
};
function Gd(a, b) {
this.document = a;
this.Fc = ["border-top-width", "border-bottom-width", "border-left-width", "border-right-width"];
this.sa = ["border-top-color", "border-bottom-color", "border-left-color", "border-right-color"];
this.ta = ["border-top-style", "border-bottom-style", "border-left-style", "border-right-style"];
this.a = b
}
Gd.prototype.g = function(a) {
for (var b = 0; b < this.sa.length; b++)
if ("" != a.style[this.sa[b]] && this.a.Nb(a.style[this.sa[b]])) {
var c = a.ownerDocument.defaultView.getComputedStyle(a).getPropertyValue(this.Fc[b]);
"" !== c && 3 >= this.a.D(c) && (a.style[this.ta[b]] = "", a.style[this.sa[b]] = "")
}
"" != a.style.backgroundColor && this.a.Nb(a.style.backgroundColor) && (a.style.backgroundColor = "")
};
function Hd(a, b) {
this.a = x;
this.rd = a;
this.oc = ["max-width", "max-height"];
this.Ca = {
"line-height": "numeric",
"font-variant": "*",
"font-size": "*",
"font-weight": "*",
"font-family": "*",
"font-style": "*"
};
this.eb = [];
this.yd = b
}
function xd(a, b) {
if (null != b) {
for (var c in a.oc) b.removeProperty(a.oc[c]);
if (a.yd)
for (c in a.Ca) {
var d = b[c];
"numeric" === a.Ca[c] ? "" === d.trim() || isNaN(d.trim()) || b.removeProperty(c) : "*" === a.Ca[c] ? b.removeProperty(c) : d.trim() === a.Ca[c] && b.removeProperty(c)
}
}
if (!a.rd.isFixedLayout)
for (var e in a.eb)
if (c = b.getPropertyCSSValue(a.eb[e])) c = c.cssText.toLowerCase(), (a.a.v(c, "pt") || a.a.v(c, "px") || a.a.v(c, "in") || a.a.v(c, "cm") || a.a.v(c, "mm") || a.a.v(c, "pc")) && b.removeProperty(a.eb[e])
}
var x = {
META_TAG: "meta",
BODY_TAG: "body",
STYLE_TAG: "style",
LINK_TAG: "link",
MBP_PAGEBREAK_TAG: "mbp:pagebreak",
MPB_PAGEBREAK_TAG: "mpb:pagebreak",
AMZN_NODE_TYPE: "node-type",
AMZN_PANEL: "panel",
AMZN_BACKDROP: "backdrop",
HTTPEQUIV_ATTR: "http-equiv",
CHARSET_ATTR: "charset",
CONTENT_ATTR: "content",
STYLE_ATTR: "style",
REL_ATTR: "rel",
EPUB_TYPE_ATTR: "epub:type",
TYPE_ATTR: "type",
HREF_ATTR: "href",
STYLESHEET_VAL: "stylesheet",
TEXTCSS_VAL: "text/css",
LAYOUT_CSS_VAL: "amzn:layout-css",
KI_NODE: "amzn:kindle-illustrated",
defaultStyleValueMap: {}
};
x.defaultStyleValueMap["float"] = "none";
x.defaultStyleValueMap["vertical-align"] = "baseline";
x.defaultStyleValueMap.position = "static";
x.defaultStyleValueMap["border-left-style"] = "none";
x.defaultStyleValueMap["border-right-style"] = "none";
x.defaultStyleValueMap["border-top-style"] = "none";
x.defaultStyleValueMap["border-bottom-style"] = "none";
x.defaultStyleValueMap["outline-style"] = "none";
x.LIST_TAGS = "ol ul li dl dt dd".split(" ");
x.EMPTY_CONTENT_IGNORABLE_SELECTOR = [":before", ":after"];
x.Ne = ["screen", "all", ""];
x.Oe = "print braille embossed handheld projection speech tty tv".split(" ");
x.Ae = ["amzn-mobi", "amzn-kf8"];
x.Ce = [" ", ",", ":"];
x.nd = [34, 39, 8216, 8217, 8219, 8220, 8221];
x.Nd = [8218, 8222];
x.FIRST_LETTER_STYLE = "data-first-letter-style";
x.BEFORE = "data-before";
x.beforeAndAfterSelectors = {
"data-before": "before",
"data-after": "after"
};
x.FIRST_LINE_STYLE = "data-first-line-style";
x.FICTIONAL_FIRST_LINE_TAG = "data-fictional-first-line-tag";
x.enableMathML = !1;
x.mathmlSVGClass = "mathjax_svg";
var N = 3;
function Id(a, b) {
this.x = a;
this.y = b
}
function Jd(a, b) {
this.I = a;
this.H = b
}
function H(a, b, c, d) {
this.top = a;
this.bottom = c;
this.left = b;
this.right = d
}
H.prototype.toString = function() {
return "(top : " + this.top + "), (left : " + this.left + "), (bottom : " + this.bottom + "), (right : " + this.right + ")"
};
x.bb = function() {
x.skipFailures = !0
};
x.ya = function(a) {
return this.b(a.left) || this.b(a.top) || this.b(a.right) || this.b(a.bottom) ? null : new Jd(new Id(a.left, a.top), new Id(a.right, a.bottom))
};
x.Lb = function(a) {
a = a.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
for (var b = "", c = a.length, d = 0; d < c; d++) 13 == a.charCodeAt(d) ? b += "&#13;" : b += a.charAt(d);
return b
};
x.be = function(a) {
this.enableMathML = a
};
x.Ua = function(a) {
return !0 === this.enableMathML ? this.Rb(a) : !1
};
x.Rb = function(a) {
return a ? "svg" === a.nodeName.toLowerCase() && null != a.parentNode && "span" === a.parentNode.nodeName.toLowerCase() && a.parentNode.className.toLowerCase() === this.mathmlSVGClass ? !0 : !1 : !1
};
x.xd = function(a) {
a = a.toLowerCase();
var b = "area br col embed hr img input link meta param".split(" "),
c;
for (c in b)
if (a == b[c]) return !0;
return !1
};
x.Jd = function(a) {
a = a.toLowerCase();
return -1 != [this.MBP_PAGEBREAK_TAG, this.MPB_PAGEBREAK_TAG].indexOf(a) ? !0 : !1
};
x.Sd = function(a) {
a = a.toLowerCase();
return {
"o:p": "span",
section: "div"
}[a] || a
};
x.Me = function() {
return !1
};
x.ed = function() {
var a = CSSRule.FONT_FACE_RULE,
b = document.styleSheets,
c = [];
styleSheetsLength = null != b ? b.length : 0;
for (var d = 0; d < styleSheetsLength; d++) c.push.apply(c, this.Cb(b[d], a));
return c
};
x.Cb = function(a, b) {
var c = [];
if (null == a) return c;
for (var d = a.rules, e = 0; e < d.length; e++)
if (d[e].type == CSSRule.IMPORT_RULE) c.push.apply(c, this.Cb(a.rules[e].styleSheet, b));
else if (d[e].type == b) {
var g = a.href;
null == g && (g = document.location.href);
c.push({
rule: d[e],
href: g
})
}
return c
};
x.removeNode = function(a) {
a && a.parentNode.removeChild(a)
};
x.Ga = function(a) {
if (a)
for (; 0 != a.length;) this.removeNode(a[0])
};
x.dc = function() {
for (var a = document.getElementsByTagName(this.STYLE_TAG), b = a.length - 1; 0 <= b; b--) styleTag = a[b], styleTag.parentNode.removeChild(styleTag)
};
x.Fb = function() {
for (var a = document, b = a.getElementsByTagName(this.LINK_TAG), c = b.length - 1; 0 <= c; c--)
if (linkTag = b[c], (null != linkTag.attributes.getNamedItem(this.REL_ATTR) ? linkTag.attributes.getNamedItem(this.REL_ATTR).nodeValue : "").trim().toLowerCase() == this.STYLESHEET_VAL)
if (x.Ad(null != linkTag.attributes.getNamedItem(this.TYPE_ATTR) ? linkTag.attributes.getNamedItem(this.TYPE_ATTR).nodeValue : "")) {
null != linkTag.attributes.getNamedItem(this.EPUB_TYPE_ATTR) && linkTag.attributes.removeNamedItem(this.EPUB_TYPE_ATTR);
var d = a.createAttribute(this.EPUB_TYPE_ATTR);
d.value = this.LAYOUT_CSS_VAL;
linkTag.attributes.setNamedItem(d)
} else linkTag.parentNode.removeChild(linkTag)
};
x.zd = function(a) {
return null != a.attributes.getNamedItem(this.EPUB_TYPE_ATTR) && -1 !== a.attributes.getNamedItem(this.EPUB_TYPE_ATTR).nodeValue.indexOf(this.KI_NODE) ? !0 : !1
};
x.Ad = function(a) {
a = a.trim().toLowerCase().split("/");
if (2 != a.length || "text" != a[0].trim()) return !1;
a = a[1].trim().split("+");
return 2 != a.length || "amzn" != a[0].trim() || "css" != a[1].trim() ? !1 : !0
};
x.ze = function(a, b) {
var c = b.getElementsByTagName(this.STYLE_TAG),
d = null;
0 != c.length ? d = c[c.length - 1] : (d = b.createElement(this.STYLE_TAG), b.head.appendChild(d));
content = "";
for (c = 0; c < a.length; c++) content += a[c].cssText;
d.innerHTML = d.innerHTML + content
};
x.hc = function(a, b, c) {
styleItem = a.attributes.getNamedItem(this.STYLE_ATTR);
styleItem.nodeValue = styleItem.nodeValue + b + ":" + c + ";"
};
x.bc = function(a, b, c, d) {
var e = this.xb(b);
d && void 0 != e ? "string" === typeof a.getAttribute(e) ? console.log("Failed to add dummy attribute " + e + " since it is already present") : a.setAttribute(e, c) : a.setAttribute(b, c)
};
x.dummyAttributeMap = {};
x.dummyAttributeMap.src = "amznaddedsrc";
x.dummyAttributeMap.href = "amznaddedhref";
x.additionalStyleAttribute = "amznAddedAdditionalStyle";
x.dummyAttributes = [];
for (var B in x.dummyAttributeMap) x.dummyAttributes.push(x.dummyAttributeMap[B]);
x.xb = function(a) {
return this.dummyAttributeMap[a]
};
x.td = function(a) {
return 0 <= this.dummyAttributes.indexOf(a) ? !0 : !1
};
x.Pd = function(a, b) {
E.s(a, "Input node not a valid object");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input node is not an element node");
E.L("line-height", "Input style name is not a valid string");
E.L(b, "Input style value is not a valid string");
null === a.getAttribute("amznAddedAdditionalStyle") && a.setAttribute("amznAddedAdditionalStyle", "");
a.setAttribute("amznAddedAdditionalStyle", a.getAttribute("amznAddedAdditionalStyle") + "line-height:" + b + ";")
};
x.Vc = function(a) {
E.s(a, "Input node not a valid object");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input node is not an element node");
return null === a.getAttribute("amznAddedAdditionalStyle") ? "" : a.getAttribute("amznAddedAdditionalStyle")
};
x.Vd = function(a) {
E.s(a, "Input node not a valid object");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input node is not an element node");
a.removeAttribute("amznAddedAdditionalStyle")
};
x.vb = function(a) {
var b = x.AMZN_NODE_TYPE;
return null != a.attributes && null != a.attributes.getNamedItem(b) ? a.attributes.getNamedItem(b).nodeValue : null
};
x.v = function(a, b) {
return "string" !== typeof a || "string" !== typeof b || a.length < b.length ? !1 : a.indexOf(b) === a.length - b.length ? !0 : !1
};
x.Ab = function(a) {
for (var b = a.parentNode;;) {
if (b.nodeType != Node.ELEMENT_NODE) return null;
if ("block" == a.ownerDocument.defaultView.getComputedStyle(b, "").display) return b;
b = b.parentNode
}
};
x.De = function(a, b) {
function c(a) {
for (var b = []; a; a = a.parentNode) b.unshift(a);
return b
}
if (null === a || null === b) return null;
for (var d = c(a), e = c(b), g = d.length - 1; 0 <= g; g--)
if (d[g] === e[g]) {
var h = d[g];
if ("block" === h.ownerDocument.defaultView.getComputedStyle(h, "").display) return h
}
return null
};
var y = {
T: function(a) {
if (null == a || void 0 == a || "string" != typeof a) return !1;
a = parseFloat(a);
return "number" != typeof a || isNaN(a) || 25 > a ? !1 : !0
}
};
x.M = function(a) {
E.s(a, "Input Text Node is not a valid object");
var b = a.textRunData;
a = [];
if ("" === b.trim()) return a;
for (var b = b.split(";"), c = 0; c < b.length; c++) {
var d = b[c];
if ("" !== d.trim()) {
for (var d = d.split(","), e = {}, g = 0; g < d.length; g++) {
var h = d[g].split(":"),
k = h[0],
h = F.C(h[1]);
e[k] = h
}
e.right = e.left + e.logicalwidth;
e.baselineposition = e.top + e.ascent;
a[c] = e
}
}
return a
};
x.fd = function(a) {
if (a.nodeType != Node.ELEMENT_NODE && a.nodeType != Node.TEXT_NODE) return 0;
if (a.nodeType == Node.TEXT_NODE) return this.M(a).length;
if (a.nodeType == Node.ELEMENT_NODE) {
a = a.childNodes;
var b = a.length;
if (0 == b) return 0;
for (var c = 0, d = 0; d < b; d++) {
var e = this.fd(a[d]);
null != e && void 0 != e && (c += e)
}
return c
}
};
x.Oa = function(a) {
return this.b(a) || a.nodeType != Node.ELEMENT_NODE || -1 === a.contentBoxTopPosition || -1 === a.contentBoxBottomPosition || -1 === a.contentBoxLeftPosition || -1 === a.contentBoxRightPosition ? null : new H(a.contentBoxTopPosition, a.contentBoxLeftPosition, a.contentBoxBottomPosition, a.contentBoxRightPosition)
};
x.wb = function(a) {
var b = a.ownerDocument.defaultView.getComputedStyle(a);
a.nodeType !== Node.ELEMENT_NODE || "block" !== b.display && "table" !== b.display && "img" !== a.nodeName.toLowerCase() ? q.h("BOX_POSITION_CALCULATION_FAILURE", a.getAttribute("amzn-src-id")) : (F.C(b.top), F.C(b.marginTop), F.C(b.left), F.C(b.marginLeft), F.C(b.top), F.C(b.height), F.C(b.marginBottom), F.C(b.left), F.C(b.width), F.C(b.marginRight))
};
x.Ie = function(a, b) {
for (; a.parentNode !== a.ownerDocument && a.parentNode !== b;) a = a.parentNode;
return a.parentNode === a.ownerDocument ? !1 : !0
};
x.Ba = function(a) {
E.s(a, "Input Text Node is not a valid object");
E.qa(Node.TEXT_NODE, a.nodeType);
return "" !== a.nodeValue.trim() ? !1 : !0
};
x.X = function(a) {
E.s(a);
E.B(a.nodeType === Node.ELEMENT_NODE || a.nodeType === Node.TEXT_NODE, "Input Node can only be either text node or element node");
a = a.ownerDocument.createNodeIterator(a, NodeFilter.SHOW_TEXT);
for (var b = null; null !== (b = a.nextNode());)
if (!this.Ba(b)) return b;
return null
};
x.Db = function(a) {
E.s(a, "Node is not a valid object");
for (var b = a.nextSibling; null != b;)
if (b.nodeType === Node.COMMENT_NODE) b = b.nextSibling;
else if (b.nodeType === Node.ELEMENT_NODE || b.nodeType === Node.TEXT_NODE) {
var c = this.X(b);
if (c) return c;
b = b.nextSibling
}
return a.parentNode === a.ownerDocument ? null : this.Db(a.parentNode)
};
x.Ge = function(a, b) {
E.s(a, "Input Text Node is not a valid object");
E.B(0 < b, "Input Line Number should not be lesser than or equal to zero");
var c = this.M(a);
return c.length >= b ? c[b - 1] : null
};
x.md = function(a) {
E.s(a);
E.B(a.nodeType === Node.ELEMENT_NODE, "Input Node can only be element node");
a = a.ownerDocument.createNodeIterator(a, NodeFilter.SHOW_TEXT);
for (var b = !1, c = null; null !== (c = a.nextNode());)
if (!this.Ba(c)) {
if (b) return !1;
b = !0
}
return b
};
x.Ib = function(a, b, c) {
E.s(a, "Input node1 is not a valid object");
E.s(b, "Input node2 is not a valid object");
E.s(c, "Input style name is not a valid array");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input node1 is not a valid element node");
E.B(Node.ELEMENT_NODE === b.nodeType, "Input node2 is not a valid element node");
a = a.ownerDocument.defaultView.getComputedStyle(a);
b = b.ownerDocument.defaultView.getComputedStyle(b);
for (var d = 0; d < c.length; d++)
if (a.getPropertyCSSValue(c[d]).cssText !== b.getPropertyCSSValue(c[d]).cssText) return !1;
return !0
};
x.Z = function(a, b) {
return a.style.getPropertyValue(b)
};
x.U = function(a, b, c) {
if ("object" !== typeof a || "object" !== typeof a.style || a.nodeType != Node.ELEMENT_NODE || "string" !== typeof b) return null;
var d = b.toLowerCase();
return !0 !== c || "line-height" !== d && "font-size" !== d ? a.ownerDocument.defaultView.getComputedStyle(a, "").getPropertyCSSValue(b).cssText : a.ownerDocument.defaultView.getComputedStyle(a, "").getAbsolutePropertyCSSValue(b).cssText
};
x.sd = function(a) {
E.s(a, "Input link tag is not a valid object");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input link tag is not a valid element node");
var b = "";
return null === (b = a.getAttribute(this.REL_ATTR)) || this.STYLESHEET_VAL !== b.toLowerCase().trim() || null === (b = a.getAttribute(this.TYPE_ATTR)) || this.TEXTCSS_VAL !== b.toLowerCase().trim() ? !1 : "string" === typeof a.getAttribute(this.HREF_ATTR) ? !0 : !1
};
x.Pb = function(a) {
E.s(a, "Input node is not a valid object");
E.B(Node.ELEMENT_NODE === a.nodeType, "Input node is not a valid element node");
a = a.nodeName.toLowerCase().trim();
return "img" === a || "image" === a ? !0 : !1
};
x.vd = function(a) {
E.s(a, "Input node is not a valid object");
var b = a.selectorText;
a = a.cssText;
E.B(a > b, "Input CSS Rule is not valid. CSS Selector name length cannot be greater than CSS Rule length");
b = a.substring(b.length);
a = b.indexOf("{") + 1;
var c = b.lastIndexOf("}");
E.B(0 < a && a < b.length, "Input CSS Rule is not valid as it missing the { symbol");
E.B(0 < c && a < b.length, "Input CSS Rule is not valid as it missing the } symbol");
return "" === b.substring(a, c).trim() ? !0 : !1
};
x.Ke = function(a, b) {
E.s(a, "Input node is not a valid object");
if (x.vd(a)) return !0;
if (0 <= this.EMPTY_CONTENT_IGNORABLE_SELECTOR.indexOf(b)) {
var c = a.style.content;
if (void 0 === c) return !0;
var c = a.style.content.trim(),
d = c.indexOf("'"),
e = c.lastIndexOf("'"),
g = c.length;
0 === d && e === g - 1 && (c = c.substring(d + 1, g - 1));
if ("" === c) return !0
}
return !1
};
x.Ob = function(a) {
E.L(a, "Input Text is not a string object");
return -1 !== this.nd.indexOf(a.charCodeAt(0)) ? !0 : !1
};
x.Dd = function(a) {
E.L(a, "Input Text is not a string object");
return -1 !== this.Nd.indexOf(a.charCodeAt(0)) ? !0 : !1
};
x.l = function(a) {
return null == a || "" == a.replace(/\s/g, "") || null != a.match(/^\d/) && 0 == this.D(a) ? !1 : !0
};
x.i = function(a) {
return this.w(a) && "none" !== a ? !0 : !1
};
x.kd = function(a) {
return this.w(a) ? !0 : !1
};
x.Le = function(a) {
return a ? 0 <= this.LIST_TAGS.indexOf(a.nodeName.toLowerCase()) ? !0 : !1 : !1
};
x.w = function(a) {
return null !== a && void 0 !== a && "" !== a ? !0 : !1
};
x.N = function(a, b, c) {
return a.split(b).join(c)
};
x.Z = function(a, b) {
return a.style.getPropertyValue(b)
};
x.Y = function(a, b) {
return "object" !== typeof a || "object" !== typeof a.style || a.nodeType != Node.ELEMENT_NODE || "string" !== typeof b ? null : a.ownerDocument.defaultView.getComputedStyle(a, "").getAbsolutePropertyCSSValue(b).cssText
};
x.J = function(a, b, c) {
b = b[c];
switch (c) {
case "margin-top":
case "margin-left":
case "margin-right":
case "margin-bottom":
case "padding-top":
case "padding-left":
case "padding-right":
case "padding-bottom":
case "text-indent":
return "%" === this.R(b) ? (a = this.dd(a), this.b(a) ? b : b.substring(0, b.length - 1) * a / 100 + "px") : b;
case "text-align":
return "-webkit-center" === b ? "center" : b;
default:
return b
}
};
x.dd = function(a) {
if ("object" !== typeof a || a.nodeType != Node.ELEMENT_NODE && a.nodeType != Node.DOCUMENT_NODE || "object" !== typeof a.parentNode || "object" !== typeof a.parentNode.style) return null;
a = this.Ab(a);
if (null == a) return null;
a = this.Y(a, "width");
return null == a ? null : parseFloat(a)
};
x.Sb = function(a, b) {
return "" == a || "rgb(255, 255, 255)" === b || -1 !== b.indexOf("rgba(255, 255, 255,") ? !1 : !0
};
x.Bb = function(a, b) {
for (var c = a; void 0 !== c;) {
c = c.previousSibling;
if (null === c) break;
if (c.nodeType === Node.ELEMENT_NODE) {
if (b || 0 !== c.childNodes.length) return c;
console.log("DropCap::PrevSibling is element node with no child")
} else if (c.nodeType !== Node.TEXT_NODE || "" !== c.nodeValue.trim()) return c
}
};
x.Qa = function(a) {
for (; void 0 !== a;) {
a = a.nextSibling;
if (null === a) break;
if (a.nodeType !== Node.TEXT_NODE || "" !== a.nodeValue.trim()) return a
}
};
x.R = function(a) {
return this.v(a, "rem") ? "rem" : this.v(a, "%") ? "%" : a.substring(a.length - 2, a.length)
};
x.D = function(a) {
return null == a ? null : parseFloat(a.substr(0, a.length - this.R(a).length))
};
x.Nb = function(a) {
if (void 0 === a || null === a || "" === a) return !1;
if ("transparent" === a) return !0;
var b = a.substr(0, 4);
if ("rgba" !== b && "hsla" !== b) return !1;
a = a.replace(")", "");
a = a.split(",");
return 4 !== a.length ? !1 : 0 >= parseFloat(a[3].trim()) ? !0 : !1
};
x.Sa = function(a, b) {
return this.i(a.borderLeftStyle) || this.i(a.borderRightStyle) || this.i(a.borderTopStyle) || this.i(a.borderBottomStyle) || this.i(a.outlineStyle) || this.kd(a.boxShadow) || this.Sb(a.backgroundColor, b.backgroundColor) || this.w(a.backgroundImage) ? !0 : !1
};
x.He = function(a, b) {
if (!a || !b) return !1;
for (var c = a.style, d = 0; d < c.length; d++)
if (0 <= b.indexOf(c[d].toLowerCase())) return !0;
return !1
};
x.wa = function(a) {
if (!a || a.nodeType !== document.ELEMENT_NODE) return !1;
for (var b = 0; b < a.childNodes.length; b++) {
var c = a.childNodes[b];
if (c.nodeType === document.ELEMENT_NODE) {
var d = c.ownerDocument.defaultView.getComputedStyle(c, "").display;
if ("inline" !== d && "none" !== d || !this.wa(c)) return !1
}
}
return !0
};
x.Td = function(a) {
var b = 0;
if (!a || a.nodeType !== document.ELEMENT_NODE) return 0;
for (var c = 0; c < a.childNodes.length; c++) {
var d = a.childNodes[c];
d.nodeType === document.ELEMENT_NODE && this.Mb(d) && b++
}
return b
};
x.$b = function(a, b) {
for (var c = a.length, d = [], e = 0; e < c; e++) {
var g = a[e],
h = g.f;
x.b(h) || h.nodeType == Node.ELEMENT_NODE && h.ownerDocument.defaultView.getComputedStyle(h, "").display == b && d.push(g)
}
return d
};
x.Na = function(a, b) {
return "br" === b.tagName.toLowerCase() ? this.o(a.lineHeight) : "block" !== a.display ? null : this.o(a.height)
};
x.o = function(a) {
if (null === a || void 0 === a || !this.v(a, "px")) return null;
a = parseInt(a.substr(0, a.length - 2));
return isNaN(a) ? null : a
};
x.rb = function(a, b) {
if (!a || a.nodeType !== document.ELEMENT_NODE || !b) return !1;
for (var c = 0; c < a.childNodes.length; c++) {
var d = a.childNodes[c];
if (d.nodeType === document.ELEMENT_NODE && (0 <= b.indexOf(d.nodeName.toLowerCase().trim()) || this.rb(d, b))) return !0
}
return !1
};
x.Aa = function(a, b) {
if (!a || !b) return !1;
for (var c = a.style, d = 0; d < c.length; d++)
if (0 <= b.indexOf(c[d].toLowerCase())) {
var e = c.getPropertyCSSValue(c[d]).cssText,
g = x.defaultStyleValueMap[c[d]];
if (void 0 === g || null === g || this.w(e) && e.toLowerCase().trim() !== g) return !0
}
return !1
};
x.gd = function(a, b) {
if (!a || !b) return !1;
for (var c = [], d = a.style, e = 0; e < d.length; e++)
if (0 <= b.indexOf(d[e].toLowerCase())) {
var g = d.getPropertyCSSValue(d[e]).cssText,
h = this.defaultStyleValueMap[d[e]];
void 0 === h || null === h ? c.push(d[e]) : this.w(g) && g.toLowerCase().trim() !== h && c.push(d[e])
}
return c.toString()
};
x.Xd = function() {
var a = CSSRule.STYLE_RULE,
b = document.styleSheets;
if (b)
for (var c = b.length, d = 0; d < c; d++) {
var e = b[d],
g = e.cssRules ? e.cssRules : e.rules;
if (g)
for (var h = 0; h < g.length;) g[h].type === a ? (e.removeRule(h), g = e.cssRules ? e.cssRules : e.rules) : h++
}
};
x.Eb = function(a) {
var b = a["background-repeat-x"],
c = a["background-repeat-y"];
void 0 != b && void 0 != c && (a["background-repeat"] = b + " " + c)
};
x.Fa = function(a) {
var b = this.N(a.textContent, "\n", ""),
c = !1,
d = a.parentNode.ownerDocument.defaultView.getComputedStyle(a.parentNode).textDecoration;
if (-1 != d.indexOf("underline") || -1 != d.indexOf("overline") || -1 != d.indexOf("line-through")) c = !0;
return 0 !== b.length && c ? !1 : 0 === a.textContent.trim().length ? !0 : !1
};
x.Xc = function(a) {
var b, c = document.createElement("span");
c.style.cssText = a;
if (void 0 === c.style || "" === c.style) return {
content: "",
style: ""
};
b = c.style.content;
"" === b && -1 !== a.indexOf("content") && (b = this.hd(a));
c.style.content = "";
a = c.style;
b = this.ec(b);
return {
content: b,
style: a.cssText
}
};
x.ec = function(a) {
a = 0 == a.indexOf('"') && a.lastIndexOf('"') == a.length - 1 ? a.substring(1, a.length - 1) : a;
return a = 0 == a.indexOf("'") && a.lastIndexOf("'") == a.length - 1 ? a.substring(1, a.length - 1) : a
};
x.hd = function(a) {
var b = a.split(";");
a = "";
for (var c = 0; c < b.length; c++)
if (-1 !== b[c].indexOf("content")) {
b = b[c].split(":");
2 == b.length && (a = b[1]);
break
}
return a
};
x.ac = function(a) {
var b = this.Vc(a);
"" !== b && (a.setAttribute(ga.ATTRIBUTE_STYLE, a.getAttribute(ga.ATTRIBUTE_STYLE) + ";" + b), a.style.cssText = a.style.cssText);
this.Vd(a)
};
x.ad = function(a) {
var b = {};
if (null == a) return b;
a = a.split(";");
for (var c = 0; c < a.length; c++) {
var d = a[c].toLowerCase().split(":")[0].trim();
"" !== d && (b[d] = -1 !== a[c].toLowerCase().indexOf("!important") || -1 !== a[c].toLowerCase().indexOf("! important") ? !0 : !1)
}
return b
};
x.Ya = function(a) {
if (null !== a) {
if (a.nodeType === document.TEXT_NODE && !0 !== this.Fa(a)) return !0;
a = a.childNodes;
if (null !== a)
for (var b = 0; b < a.length; b++)
if (this.Ya(a[b])) return !0
}
return !1
};
x.$c = function(a) {
a = a.childNodes;
for (var b = 0; b < a.length; b++) {
var c = a[b];
if (c.nodeType == Node.ELEMENT_NODE || c.nodeType == Node.TEXT_NODE) {
if (!this.Tb(c)) return null;
if (!this.Fa(c)) return c
}
}
};
x.bd = function(a) {
for (a = a.nextSibling; null != a;)
if (a.nodeType != Node.ELEMENT_NODE) a = a.nextSibling;
else if (this.Kd(a)) a = a.nextSibling;
else return a;
return null
};
x.Tb = function(a) {
if (0 < a.childNodes.length)
for (var b = 0; b < a.childNodes.length; b++) {
if ((a.childNodes[b].nodeType == Node.ELEMENT_NODE || a.childNodes[b].nodeType == Node.TEXT_NODE) && !this.Tb(a.childNodes[b])) return !1
} else if (a.nodeType != Node.TEXT_NODE) return !1;
return !0
};
x.Kd = function(a) {
return 0 !== this.N(a.textContent, "\n", "").length ? !1 : 0 === a.textContent.trim().length ? !0 : !1
};
x.xa = function(a, b) {
if (this.b(a) || this.b(b)) return null;
var c = x.ya(a),
d = x.ya(b);
return null == c || null == d ? null : c.I.y > d.H.y ? 2 : c.H.y < d.I.y ? 1 : N
};
x.b = function(a) {
return null == a || void 0 == a
};
x.Je = function(a) {
return this.b(a) || "string" === typeof a && "" === a.trim()
};
x.Mb = function(a) {
if (a.nodeType != Node.ELEMENT_NODE || this.b(a.style.display)) return !1;
a = a.style.display.toLowerCase();
return "block" === a || "table" === a || "table-caption" === a || "table-header-group" === a || "table-footer-group" === a || "table-row-group" === a || "table-cell" === a || "table-row" === a || "list-item" === a ? !0 : !1
};
x.getFileName = function(a) {
if (null === a || void 0 === a) return a;
a = a.replace(/^.*[\\\/]/, "");
var b = a.split(".");
2 < b.length && "html" === b[b.length - 1] && (a = a.substring(0, a.length - 5));
return a
};
x.Bd = function(a) {
if (this.b(a)) return !1;
a = a.trim();
return 1 == a.length && a.match(/[a-z]/i) ? !0 : !1
};
x.Hd = function(a) {
if (this.b(a)) return !1;
a = a.trim();
return 0 < a.length && a.match(/^[0-9]+$/) ? !0 : !1
};
x.Id = function(a) {
if (this.b(a)) return !1;
a = a.trim().toUpperCase();
for (var b = 0; b < a.length; b++) {
var c = a[b];
if ("M" != c && "D" != c && "C" != c && "L" != c && "X" != c && "V" != c && "I" != c) return !1
}
return !0
};
x.Cd = function(a) {
if (this.b(a)) return !1;
a = a.trim();
return "\u25c9" == a || "\u2022" == a || "\u25cf" == a || "\u2013" == a || "\u25a1" == a ? !0 : !1
};
x.Wc = function(a) {
var b = a;
if (this.b(b)) return null;
for (;;) {
b = b.parentNode;
if (this.b(b)) return null;
if (b.nodeType === Node.ELEMENT_NODE) {
var c = a.ownerDocument.defaultView.getComputedStyle(b, "").display;
if ("table-cell" === a.ownerDocument.defaultView.getComputedStyle(a, "").display.trim().toLowerCase() && "table-cell" === c.trim().toLowerCase() || "block" === c.trim().toLowerCase() || "table-row" === c.trim().toLowerCase() || "table" === c.trim().toLowerCase() || "list-item" === c.trim().toLowerCase()) return b
}
}
};
x.nb = function(a, b) {
var c = a.getAttribute("computedstyle");
this.b(c) && (c = "");
a.setAttribute("computedstyle", c + b)
};
x.lb = function(a, b) {
if (this.b(a.j) || this.b(a.ba) || !0 !== a.ba) return b;
var c = a.ownerDocument.createElement("span");
c.style.display = "none";
c.setAttribute("amzn-node-id", a.j.toString());
c.setAttribute("amzn-marker", "true");
c = sd(new rd(this, !1), c);
!0 === a.Kc && (b = c + b);
return !0 === a.Ja ? b + c : b
};
x.Yc = function(a) {
var b = this.Oa(a);
if (this.b(b)) return null;
a = a.ownerDocument.defaultView.getComputedStyle(a);
b.top = b.top - this.P(a, "padding-top") - this.P(a, "border-top-width");
b.bottom = b.bottom + this.P(a, "padding-bottom") + this.P(a, "border-bottom-width");
b.left = b.left - this.P(a, "padding-left") - this.P(a, "border-left-width");
b.right = b.right + this.P(a, "padding-right") + this.P(a, "border-right-width");
return b
};
x.P = function(a, b) {
var c = this.D(a[b]);
return 0 > c ? 0 : c
};
x.$ = function(a) {
return a.nodeType !== Node.ELEMENT_NODE ? !1 : "right" === a.style["float"] || "left" === a.style["float"] ? !0 : !1
};
x.aa = function(a, b) {
if (this.b(a) || this.b(b)) return null;
var c = x.ya(a),
d = x.ya(b);
return null == c || null == d ? null : !(!(c.H.x <= d.H.x && c.I.x >= d.I.x && c.H.y <= d.H.y && c.I.y >= d.I.y || d.H.x <= c.H.x && d.I.x >= c.I.x && d.H.y <= c.H.y && d.I.y >= c.I.y) && (c.H.x < d.I.x || c.I.x > d.H.x || c.H.y < d.I.y || c.I.y > d.H.y))
};
x.cd = function(a) {
var b = a.ownerDocument.defaultView.getComputedStyle(a, "");
a = x.o(b.height);
var c = x.o(b.width);
if (x.b(a) || x.b(c)) return null;
var d = x.o(b.marginTop),
e = x.o(b.marginBottom);
x.b(d) || x.b(e) || (a = a + d + e);
d = x.o(b.marginLeft);
e = x.o(b.marginRight);
x.b(d) || x.b(e) || (c = c + d + e);
d = x.o(b.paddingTop);
e = x.o(b.paddingBottom);
x.b(d) || x.b(e) || (a = a + d + e);
d = x.o(b.paddingLeft);
e = x.o(b.paddingRight);
x.b(d) || x.b(e) || (c = c + d + e);
d = x.o(b.borderTopWidth);
e = x.o(b.borderBottomWidth);
x.b(d) || x.b(e) || (a = a + d + e);
d = x.o(b.borderLeftWidth);
b = x.o(b.borderRightWidth);
x.b(d) || x.b(b) || (c = c + d + b);
b = {};
b.width = c;
b.height = a;
return b
};
var E = {
qa: function(a, b, c) {
c || (c = "Expected Type : " + a + " , Actual : " + b);
a !== b && q.h("VALIDATOR_FAILURE", c)
},
B: function(a, b) {
b || (b = "Not True");
a || q.h("VALIDATOR_FAILURE", b)
},
L: function(a, b) {
this.qa("string", typeof a, b)
},
Pe: function(a, b) {
b || (b = "Not Null");
this.qa("object", typeof a, b);
this.B(null === a, b)
},
s: function(a, b) {
b || (b = "Not an object");
this.qa("object", typeof a, b);
this.B(null !== a, b)
},
rc: function(a, b) {
b || (b = "Not a Number");
this.B(!1 === isNaN(a), b)
}
};
window.doProcessingOnWebPage = Kd;
function Kd(a) {
void 0 === document.wellFormed && q.h("INCOMPATIBLE_PHANTOMJS");
document.wellFormed || q.h("DOCUMENT_INVALID");
x.be(a.enableMathML);
ha.info("Document Compat Mode:" + document.compatMode);
var b = a.isURLRelative,
c = a.relativizeUnits,
d = a.fontSizeRelativize,
e = a.lineHeightRelativize,
g = a.textIndentRelativize,
h = a.marginRelativize,
k = a.paddingRelativize,
m = a.horizontalStyleNormalization,
l = a.handleAutoUnit,
n = a.isFixedLayout,
p = a.ignoreMobi7MediaQuery,
t = a.transformMobi8MediaQuery,
u = a.failFlWithText,
Nd = a.allowInlineBlockConversion,
la = a.skipFailures,
Od = a.allowAllMQ,
Pd = new za(la);
la && q.bb();
var Qd = document.documentElement.style.width;
a.isFixedLayout || (document.documentElement.style.width = "512px");
var z = new Kb(document, n, t, p, x, u, a.viewPortDimension, la, Od, a.unsupListOfMQs, a.media);
try {
z.g()
} catch (ma) {
if (ma instanceof r && w(ma)) throw ma;
q.h("INTERNAL_FAILURE", ma.stack)
}
a.unsupListOfMQs = z.unsupListOfMQs;
z.isUnsupportedMediaPresent ? n ? q.h("MEDIA_QUERY_USED_FOR_FIXED_LAYOUT", z.srcId, z.data) : q.h("MEDIA_QUERY_USED_FOR_NON_FIXED_LAYOUT",
z.srcId, z.data) : !0 === z.isUnsuppportedPseudoSelectorPresent && !1 === n && q.h("UNSUPPORTED_PSEUDO_SELECTORS", z.srcId, z.data);
var Nc = new Hd(a, z.isFlWithoutText),
na = document.styleSheets;
if (null != na && void 0 != na)
for (var Rd = na.length, Ua = 0; Ua < Rd; Ua++) {
var Oc = na[Ua];
if (null != Oc) {
var Va = Oc.rules;
if (null != Va)
for (var Wa = 0; Wa < Va.length; Wa++) {
var Pc = Va[Wa];
Pc.type === CSSRule.STYLE_RULE && xd(Nc, Pc.style)
}
}
}
var Xa = new Q(x, document, S),
Ya = new Bc(document),
Qc = new Lb(document, x);
Xa.register(Ya);
Xa.register(Qc);
try {
Xa.transformNode(document.documentElement,
new T(document.documentElement))
} catch (oa) {
if (oa instanceof r && w(oa)) throw oa;
q.h("PREPROCESS_TRANSFORMER_FAILED", oa.stack)
}
Qc.hasStyleAppliedUsingPseudoSelector && x.Xd();
var v = new Q(x, document),
Sd = a.htmlFiles[a.htmlFiles.length - 1].inputHtml,
Td = new rc(document, x),
Rc = new Mb(document, navigator.platform, b, x, !0),
Ud = new Ga(document),
Sc = new vd(document, n);
Sc.pb = Nc;
var Ya = new Bc(document),
Vd = new kd(document, x, d, g),
Wd = new dc(document),
Xd = new Gd(document, x),
Yd = new La(document),
Zd = new Bd(document),
$d = new zc(document),
ae = new Ja(document),
Tc = new Ia(document, {
addDisplay: !0,
addBorderColor: !1,
addListStyleType: !0,
addBorderWidth: !0
}),
be = new Ed(document),
ce = new lc(document, n),
de = new jd(document),
ee = new Cd(document, x),
fe = new Ra(document),
ge = new Dd(document),
he = new Cc(document, x, Nd, Sd),
R = new Nb(document, x, 0, la),
ie = new Hc(document, x),
je = new Na(document);
v.register(R);
v.register(Ya);
v.register(Ud);
v.register(Wd);
v.register(Yd);
v.register(Zd);
v.register(Sc);
v.register(je);
a.isFixedLayout || v.register(ie);
v.register(Xd);
v.register(ee);
v.register($d);
v.register(Tc);
v.register(ge);
v.register(he);
v.register(be);
e && v.register(Td);
(c || d || g) && v.register(Vd);
l && v.register(ae);
v.register(Rc);
v.register(ce);
v.register(de);
v.register(fe);
try {
v.transformNode(document.documentElement, new T(document.documentElement))
} catch (pa) {
if (pa instanceof r && w(pa)) throw pa;
var C = "INTERNAL_FAILURE_TOPDOWN_TRANSFORMER " + pa.stack;
q.h("INTERNAL_FAILURE", C)
}
var qa = new Q(x, document, S);
qa.W = !0;
var aa = new Oa;
qa.register(new Ob);
qa.register(aa);
try {
qa.transformNode(document.documentElement,
new T(document.documentElement))
} catch (ra) {
if (ra instanceof r && w(ra)) throw ra;
C = "INTERNAL_FAILURE_TOPDOWN_TRANSFORMER " + ra.stack;
q.h("INTERNAL_FAILURE", C)
}
a.isFixedLayout || (document.documentElement.style.width = Qd);
var Za = new Ma(document),
ke = new Da(document);
Za.register(new ec(document, n));
Za.register(ke);
try {
Za.transformNode(document.documentElement)
} catch (sa) {
if (sa instanceof r && w(sa)) throw sa;
C = "INTERNAL_FAILURE_BOTTOMUP_TRANSFORMER " + sa.stack;
q.h("INTERNAL_FAILURE", C)
}
n || ub(new tb(document, x),
document.documentElement);
try {
var Uc = new Rb(n),
le = Uc.La()
} catch (ta) {
if (ta instanceof r && w(ta)) throw ta;
C = "INTERNAL_FAILURE_FAILURE_SIMULATOR: " + ta.stack;
q.h("INTERNAL_FAILURE", C)
}
le && q.h("FAILURE_FROM_SIMULATOR", Uc.srcId);
failProcessingForStyles = (new ya).La();
if (failProcessingForStyles.failProcessing) {
var Vc = failProcessingForStyles.errorCode,
Wc = f.Pa(Vc),
C = -1 !== Wc ? "Preprocessor Failure Pattern Detected Code = " + Wc : "";
q.h(Vc, failProcessingForStyles.srcId, C)
}
var Xc = null;
try {
var ba = new U(document, x, n);
if (!ba.isFixedLayout) {
var me = document.documentElement.style.width,
ne = document.documentElement.style.height,
oe = document.documentElement.style.lineHeight;
document.documentElement.style.width = "1200px";
document.documentElement.style.height = "1920px";
document.documentElement.style.lineHeight = "1.2em";
ba.Ea(document.body);
for (var pe in ba.Ka) {
var O = ba.Ka[pe],
$a = ba.fa[O.j],
ua = O.style.clear;
O.removeAttribute("style");
O.style.marginTop = $a.marginTop;
O.style.marginBottom = $a.marginBottom;
O.style.height = $a.height;
null !== ua && void 0 !== ua && "" !== ua && (O.style.clear = ua)
}
document.documentElement.style.width = me;
document.documentElement.style.height = ne;
document.documentElement.style.lineHeight = oe
}
var ab = new Q(x, document),
aa = new Oa;
ab.register(aa);
ab.W = !0;
try {
ab.transformNode(document.documentElement, new T(document.documentElement))
} catch (va) {
if (va instanceof r && w(va)) throw va;
C = "INTERNAL_FAILURE_TOPDOWN_TRANSFORMER " + va.stack;
q.h("INTERNAL_FAILURE", C)
}
var bb = a.renditionSetting,
qe = aa.Yb;
if (null != bb && void 0 != bb && qe) {
for (var ca =
new qd(this.document, bb, aa.G), re = document.body.style.fontSize, se = document.body.style.width, Yc = {}, cb = 0; cb < ca.gc.length; cb++) {
for (var Zc = ca.gc[cb], $c = new ud(ca.document, Zc), db = 0; db < ca.Zb.length; db++) $c.register(ca.Zb[db]);
var da = $c;
document.body.style.fontSize = da.fc.fontSize;
document.body.style.width = da.fc.width;
document.body.relayout();
var eb = new Q(x, da.document, S);
eb.W = !0;
eb.register(da);
eb.transformNode(document.documentElement, new T(document.documentElement));
Yc[Zc.name] = da.ub
}
document.body.style.fontSize =
re;
document.body.style.width = se;
Xc = Yc
}
for (var ad = x.ed(), bd = ad, fb = 0; fb < bd.length; fb++) {
var gb = bd[fb].rule;
if (null == gb.style.modifiedsrc) {
var te = uc(Y(Rc, vc(gb.style.src)));
gb.style.modifiedsrc = te
}
}
x.Fb();
x.dc();
Qb.ce(document, a.outputEncoding);
Qb.ae(document, a.outputEncoding);
"true" == document.documentElement.getAttribute("custom_width_added") && (document.documentElement.style.removeProperty("width"), document.documentElement.removeAttribute("custom_width_added"));
if (Tc.hasZIndexStyle) {
Ld(new Md, document.body,
1);
a: {
var hb = document.querySelectorAll("a.app-amzn-magnify");
if (null != hb) {
for (var K = [], dd = !1, ed = !1, A = 0; A < hb.length; A++) {
var fd = hb[A].attributes.getNamedItem("data-app-amzn-magnify");
if (null != fd) {
var gd = fd.nodeValue,
wa = null;
try {
wa = JSON.parse(gd)
} catch (ve) {
console.log("JSON Parsing error for data-app-amzn-magnify value=" + gd);
continue
}
if (void 0 != wa && null != wa) {
var ib = wa.targetId;
if (null != ib && void 0 != ib) {
var L = document.getElementById(ib);
null != L && void 0 !== L && null != L.style && "" !== L.style.position && "absolute" ===
L.style.position && (K.push(L), "" !== L.style.zIndex && (dd = !0, 0 > Number(L.style.zIndex) && (ed = !0)))
}
}
}
}
if (dd)
if (ed) console.log("Z-INDEX-CASE-4:NegativeValue");
else {
for (var jb = K[0].parentElement, A = 0; A < K.length; A++)
if (jb !== K[A].parentElement) {
console.log("Z-INDEX-CASE-4:DifferentParent");
break a
}
console.log("Z-INDEX-CASE-4:Fixed");
jb = K[0].parentElement;
for (A = 0; A < K.length; A++) jb.appendChild(K[A]), K[A].style.zIndex = ""
}
}
}
}
m && k && h && (new Ba(document, Pd)).g()
} catch (xa) {
if (xa instanceof r && w(xa)) throw xa;
q.h("INTERNAL_FAILURE",
xa.stack)
}
for (var hd = R.document.querySelectorAll(R.fb + "[" + R.a.FICTIONAL_FIRST_LINE_TAG + "]"), kb = 0; kb < hd.length; kb++) {
var ea = hd[kb];
R.a.ac(ea);
ea.parentNode.setAttribute(R.a.FIRST_LINE_STYLE, ea.getAttribute("style"));
ea.parentNode.removeChild(ea)
}
serializedHtmlContent = sd(new rd(x, !0), document);
fontFaceSerializedContent = (new td(x)).ab(ad);
var M = {};
M.htmlContent = serializedHtmlContent;
M.fontFaceContent = fontFaceSerializedContent;
M.hasMobi7OrMobi8MediaQuery = z.hasMobi7OrMobi8MediaQuery;
M.status = fa.SUCCESS;
M.unsupListOfMQs = a.unsupListOfMQs;
M.featureInfo = Xc;
M.errorStack = q.Zc();
return M
}
"use strict";
function Md() {
this.document = document
}
function Ld(a, b, c) {
if (b.nodeType === document.ELEMENT_NODE) {
var d = b.style.zIndex,
e = b.style.position,
g = 0;
"" === e || "static" === e ? ("" !== d && console.log("Z-INDEX-CASE-2:Fixed"), b.style.zIndex = "", b.nodeName.toLowerCase() === x.BODY_TAG && ue(b)) : ("0" === d && (console.log("Z-INDEX-CASE-1:Fixed"), b.style.zIndex = ""), b.hasChildNodes() && (1 < c && console.log("Z-INDEX-CASE-5:HasSibling"), ue(b)));
for (c = 0; c < b.childNodes.length; c++) b.childNodes[c].nodeType === document.ELEMENT_NODE && g++;
for (c = 0; c < b.childNodes.length; c++) Ld(a, b.childNodes[c],
g)
}
}
function ue(a) {
var b = null,
c = 0,
d = !0,
e = a.childNodes;
if (1 == e.length) b = a.childNodes[0];
else
for (var g = 0; g < e.length; g++) {
var h = e[g];
if (h.nodeType === document.ELEMENT_NODE) c++, 1 == c ? b = h : b = null;
else if (h.nodeType === document.TEXT_NODE) {
if (0 !== h.nodeValue.trim().length) {
b = null;
d = !1;
break
}
} else if (h.nodeType !== document.COMMENT_NODE) {
b = null;
d = !1;
break
}
}
if (null != b && b.nodeType === document.ELEMENT_NODE && "" !== b.style.zIndex) b.style.zIndex = "", console.log("Z-INDEX-CASE-3:Fixed");
else if (!0 === d) {
a = a.childNodes;
b = !0;
c =
"minusInfinite";
for (e = d = 0; e < a.length; e++)
if (g = a[e], g.nodeType === document.ELEMENT_NODE)
if (d++, "absolute" === g.style.position || "relative" === g.style.position) {
if (x.vb(g) !== x.AMZN_PANEL)
if (g = Number(g.style.zIndex), 1 == d && (c = g), c > g) {
b = !1;
console.log("Z-INDEX-CASE-5:UnOrderedZIndex");
break
} else c = g
} else {
"minusInfinite" === c && 1 < d && console.log("Z-INDEX-CASE-5:NonPositionedElement");
b = !1;
break
}
if (!0 === b && "minusInfinite" !== c) {
for (e = 0; e < a.length; e++) a[e].nodeType === document.ELEMENT_NODE && x.vb(a[e]) !== x.AMZN_PANEL &&
(a[e].style.zIndex = "");
console.log("Z-INDEX-CASE-5:Fixed")
}
}
};
/*
* Copyright (c) 2015 Amazon.com. All rights reserved.
*/
var l = {
u: function(a) {
var b = require("fs");
if (!b.isFile(a)) return null;
a = b.open(a, "r");
b = a.read();
a.close();
return b
},
o: function(a, b, c) {
null == c && (c = "UTF-8");
a = require("fs").open(a, {
charset: c,
mode: "w"
});
a.writeLine(b);
a.close()
},
l: function(a) {
return require("fs").absolute(a)
},
s: function(a) {
var b = require("fs"),
c = document.location.pathname,
c = c.substring(0, c.lastIndexOf(b.separator) + 1);
return b.isFile(c + a) ? !0 : !1
}
};
"use strict";
function m(a) {
null == a && (a = require("system").args);
if (2 > a.length || 3 < a.length) console.log("Invalid number of arguments: Usage - scripts/rasterize.js workListFile outputFile"), phantom.exit(4);
this.args = a
}
m.prototype.b = function(a) {
return a.args[1]
};
function n(a) {
this.fs = require("fs");
this.f = new m(a);
this.a = [];
this.fatal = !1
}
n.prototype.b = function(a) {
var b = a.f,
c = l.l(b.b(b)),
b = void 0;
try {
b = a.fs.read(c)
} catch (d) {
console.log(d)
}
if (b) {
c = void 0;
try {
c = JSON.parse(b)
} catch (e) {
console.log(e)
}
if (c) return c.workList;
a.fatal = !0;
a.a.push("Unable JSON parse worklist file");
console.log("Unable JSON parse worklist file")
} else a.fatal = !0, a.a.push("Unable read worklist"), console.log("Unable read worklist from " + c)
};
n.prototype.exit = function(a) {
phantom.exit(a)
};
"use strict";
function p() {
this.i = {
svg: !0,
path: !0,
g: !0,
polyline: !0,
polygon: !0,
rect: !0,
line: !0,
circle: !0,
ellipse: !0,
radialgradient: !0,
lineargradient: !0,
stop: !0,
fegaussianblur: !0,
filter: !0,
defs: !0,
clippath: !0,
use: !0,
title: !0,
metadata: !0
}
}
p.prototype.j = function(a, b, c) {
b = b.clipRect;
void 0 !== b && (0 == b.hasPercentUnits ? 1 == c.scaleToCanvas ? (c = a.viewportSize.width / b.width, a.viewportSize = {
width: a.viewportSize.width,
height: a.viewportSize.width / (b.width / b.height)
}, a.zoomFactor = c) : a.clipRect = {
top: 0,
left: 0,
width: b.width,
height: b.height
} : a.clipRect = {
top: 0,
left: 0,
width: b.width * a.viewportSize.width / 100,
height: b.height * a.viewportSize.height / 100
})
};
p.prototype.h = function(a, b) {
function c(a) {
return null == a ? null : a.trim().toLowerCase()
}
var d = {},
e = "#" + b.backgroundColor.toString(16),
f = document.getElementsByTagName("svg");
if (1 > f.length) return d.error = "No svg tags found", d.errorCode = 12001, d;
if (1 < f.length) return d.error = "Nested svg tags not supported", d.errorCode = 12002, d;
f = f[0];
if (f.hasAttribute("style")) return d.error = "style tags found in root doc", d.errorCode = 12003, d;
var g = document.createAttribute("style");
g.value = "background-color:" + e + ";";
f.setAttributeNode(g);
var e = Array.prototype.slice.call(f.getElementsByTagNameNS("http://www.w3.org/2000/svg", "*")).map(function(a) {
return a.nodeName.toLowerCase()
}),
k;
for (k in a.i) a.i.hasOwnProperty(k) && (e = e.filter(function(a) {
return a != k
}));
if (0 < e.length) return d.error = "Unknown tags found " + e, d.errorCode = 12004, d;
e = c(f.getAttribute("width"));
f = c(f.getAttribute("height"));
if (null != e && null != f) {
var g = !1,
h = function(a, b) {
if (null == a) return null;
var c = a;
a.search(b) == a.length - b.length && (c = a.replace(b, ""));
return c
},
e = h(e, "px"),
f = h(f, "px"); - 1 != e.search("%") && -1 != f.search("%") && (g = !0, e = h(e, "%"), f = h(f, "%"));
h = /^[0-9]*.?[0-9]+$/;
h.test(e) && h.test(f) ? (h = {
top: 0,
left: 0
}, h.width = parseInt(e), h.height = parseInt(f), h.hasPercentUnits = g, d.clipRect = h) : (d.error = "Invalid physical units found " + e + " " + f, d.errorCode = 12005)
} else if (null != e && null == f || null == e && null != f) d.error = "Invalid physical units found " + e + " " + f, d.errorCode = 12005;
return d
};
"use strict";
function q() {}
q.prototype.j = function(a, b, c) {
b = b.clipRect;
void 0 !== b && (1 == c.scaleToCanvas ? (a.viewportSize = {
width: b.width,
height: b.height
}, a.zoomFactor = 1, a.clipRect = {
top: 1 * b.top,
left: 1 * b.left,
width: 1 * b.width,
height: 1 * b.height
}) : a.clipRect = {
top: b.top,
left: b.left,
width: b.width,
height: b.height
})
};
q.prototype.h = function(a, b) {
var c = {},
d = document.querySelectorAll('[amzn-src-id="' + b.nodeID + '"]'),
e = "#" + b.backgroundColor.toString(16);
if (1 > d.length) return c.error = "No tags found", c.errorCode = 13001, c;
d = d[0];
if (null === d.style) {
var f = document.createAttribute("style");
f.value = "background-color:" + e + ";";
d.setAttributeNode(f)
} else d.style.backgroundColor = e;
document.body.insertBefore(d, document.body.firstChild);
for (var e = document.body.childNodes, f = 1, g = e.length; f < g; f++) void 0 === e[f].style && (e[f].style = document.createElement("STYLE")),
e[f].style.display = "none";
d.setAttribute("width", b.maxWidth);
d.setAttribute("height", b.maxHeight);
document.body.relayout();
if (-1 === d.contentBoxTopPosition || -1 === d.contentBoxBottomPosition || -1 === d.contentBoxLeftPosition || -1 === d.contentBoxRightPosition) return c.error = "Tag position is invalid", c.errorCode = 13002, c;
var e = {},
f = d.contentBoxTopPosition,
g = d.contentBoxLeftPosition,
k = d.contentBoxRightPosition - g,
d = d.contentBoxBottomPosition - f;
e.top = f;
e.left = g;
e.width = k;
e.height = d;
c.clipRect = e;
return c
};
"use strict";
function r(a) {
a = a.c;
var b = a.f.args[2],
c = {};
c.fatal = a.fatal;
c.statusList = a.a;
c = JSON.stringify(c);
b ? l.o(b, c) : console.log(c);
a.exit(0)
}
"use strict";
var t = new function(a) {
this.c = a;
this.m = a.b(a)
}(new n);
(function u(b, c, d) {
b = c.m;
if (d >= b.length) r(c);
else {
var e = b[d],
f = {},
g = require("webpage").create();
g.onConsoleMessage = function(b) {
console.log(b)
};
g.viewportSize = {
width: e.maxWidth,
height: e.maxHeight
};
f.index = d;
f.sourceFile = e.sourceFile;
g.open(e.sourceFile, function(b) {
"success" !== b ? (f.errors = "Unable to load address " + f.v, f.errorCode = 12007, c.c.a.push(f), g.close(), u(c, c, d + 1)) : window.setTimeout(function() {
var b = "svg" === e.jsRasterizerType ? new p : new q,
k = g.evaluate(b.h, b, e);
b.j(g, k, e);
b = k.error;
k = k.errorCode;
b ? (f.errors = b, f.errorCode = k) : (g.render(e.outputPath, {
format: e.format
}), f.success = !0);
c.c.a.push(f);
g.close();
u(c, c, d + 1)
}, 200)
})
}
})(t, t, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment