-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathis_interactable.js
executable file
·27 lines (27 loc) · 15 KB
/
is_interactable.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function(){return (function(){var f=this||self;
function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
b&&"undefined"==typeof a.call)return"object";return b}function ea(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var fa=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},h=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1},ha=Array.prototype.every?function(a,
b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0};var ia={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var ja="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),ka=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,la=/^#(?:[0-9a-f]{3}){1,2}$/i,ma=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,na=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function k(a,b){this.code=a;this.a=r[a]||t;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}ea(k,Error);var t="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=t;r[30]=t;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state";
r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=t;r[9]="unknown command";var oa=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function v(a){return-1!=w.indexOf(a)};var w;a:{var y=f.navigator;if(y){var z=y.userAgent;if(z){w=z;break a}}w=""};function A(){return v("Firefox")||v("FxiOS")}function B(){return(v("Chrome")||v("CriOS"))&&!v("Edge")};function pa(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function C(){return v("iPhone")&&!v("iPod")&&!v("iPad")};var qa=A(),ra=C()||v("iPod"),sa=v("iPad"),ta=v("Android")&&!(B()||A()||v("Opera")||v("Silk")),ua=B(),va=v("Safari")&&!(B()||v("Coast")||v("Opera")||v("Edge")||v("Edg/")||v("OPR")||A()||v("Silk")||v("Android"))&&!(C()||v("iPad")||v("iPod"));function E(a){return(a=a.exec(w))?a[1]:""}(function(){if(qa)return E(/Firefox\/([0-9.]+)/);if(ua)return C()||v("iPad")||v("iPod")?E(/CriOS\/([0-9.]+)/):E(/Chrome\/([0-9.]+)/);if(va&&!(C()||v("iPad")||v("iPod")))return E(/Version\/([0-9.]+)/);if(ra||sa){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w);if(a)return a[1]+"."+a[2]}else if(ta)return(a=E(/Android\s+([0-9.]+)/))?a:E(/Version\/([0-9.]+)/);return""})();function F(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}F.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};F.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};F.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function G(a,b){this.width=a;this.height=b}G.prototype.aspectRatio=function(){return this.width/this.height};G.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};G.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};G.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function wa(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function H(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function I(a,b,c){a&&!c&&(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function xa(a){this.a=a||f.document||document};function J(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function K(a,b,c,d){this.f=a;this.a=b;this.b=c;this.c=d}K.prototype.ceil=function(){this.f=Math.ceil(this.f);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.c=Math.ceil(this.c);return this};K.prototype.floor=function(){this.f=Math.floor(this.f);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.c=Math.floor(this.c);return this};K.prototype.round=function(){this.f=Math.round(this.f);this.a=Math.round(this.a);this.b=Math.round(this.b);this.c=Math.round(this.c);return this};function M(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}M.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};M.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
M.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var ya="function"===typeof ShadowRoot,za="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" ");function N(a){return h(za,function(b){return J(a,b)})?a.disabled?!1:a.parentNode&&1==a.parentNode.nodeType&&J(a,"OPTGROUP")||J(a,"OPTION")?N(a.parentNode):!I(a,function(b){var c=b.parentNode;if(c&&J(c,"FIELDSET")&&c.disabled){if(!J(b,"LEGEND"))return!0;for(;b=void 0!==b.previousElementSibling?b.previousElementSibling:wa(b.previousSibling);)if(J(b,"LEGEND"))return!0}return!1},!0):!0}
function O(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return J(a)?a:null}
function P(a,b){b=pa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b="cssFloat";a:{var c=b;var d=H(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||Q(a,b);if(null===a)a=null;else if(0<=fa(ja,b)){b:{var e=a.match(ma);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(na))if(b=Number(d[1]),
c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=ia[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(ka,"#$1$1$2$2$3$3")),!la.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
function Q(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==aa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=O(a))?Q(a,b):null}
function R(a,b,c){function d(l){var u=T(l);return 0<u.height&&0<u.width?!0:J(l,"PATH")&&(0<u.height||0<u.width)?(l=P(l,"stroke-width"),!!l&&0<parseInt(l,10)):"hidden"!=P(l,"overflow")&&h(l.childNodes,function(D){return 3==D.nodeType||J(D)&&d(D)})}function e(l){return U(l)==V&&ha(l.childNodes,function(u){return!J(u)||e(u)||!d(u)})}if(!J(a))throw Error("Argument to isShown must be of type Element");if(J(a,"BODY"))return!0;if(J(a,"OPTION")||J(a,"OPTGROUP"))return a=I(a,function(l){return J(l,"SELECT")}),
!!a&&R(a,!0,c);var g=W(a);if(g)return!!g.image&&0<g.rect.width&&0<g.rect.height&&R(g.image,b,c);if(J(a,"INPUT")&&"hidden"==a.type.toLowerCase()||J(a,"NOSCRIPT"))return!1;g=P(a,"visibility");return"collapse"!=g&&"hidden"!=g&&c(a)&&(b||0!=Aa(a))&&d(a)?!e(a):!1}
function Ba(a){function b(c){if(J(c)&&"none"==P(c,"display"))return!1;var d;if((d=c.parentNode)&&d.shadowRoot&&void 0!==c.assignedSlot)d=c.assignedSlot?c.assignedSlot.parentNode:null;else if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(ya&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&J(d,"DETAILS")&&!d.open&&!J(c,"SUMMARY")?!1:!!d&&b(d):!0}return R(a,!0,
b)}var V="hidden";
function U(a){function b(m){function n(S){if(S==l)return!0;var ba=P(S,"display");return 0==ba.lastIndexOf("inline",0)||"contents"==ba||"absolute"==ca&&"static"==P(S,"position")?!1:!0}var ca=P(m,"position");if("fixed"==ca)return da=!0,m==l?null:l;for(m=O(m);m&&!n(m);)m=O(m);return m}function c(m){var n=m;if("visible"==D)if(m==l&&u)n=u;else if(m==u)return{x:"visible",y:"visible"};n={x:P(n,"overflow-x"),y:P(n,"overflow-y")};m==l&&(n.x="visible"==n.x?"auto":n.x,n.y="visible"==n.y?"auto":n.y);return n}
function d(m){if(m==l){var n=(new xa(g)).a;m=n.scrollingElement?n.scrollingElement:n.body||n.documentElement;n=n.parentWindow||n.defaultView;m=new F(n.pageXOffset||m.scrollLeft,n.pageYOffset||m.scrollTop)}else m=new F(m.scrollLeft,m.scrollTop);return m}var e=Ca(a),g=H(a),l=g.documentElement,u=g.body,D=P(l,"overflow"),da;for(a=b(a);a;a=b(a)){var p=c(a);if("visible"!=p.x||"visible"!=p.y){var q=T(a);if(0==q.width||0==q.height)return V;var x=e.a<q.a,L=e.b<q.b;if(x&&"hidden"==p.x||L&&"hidden"==p.y)return V;
if(x&&"visible"!=p.x||L&&"visible"!=p.y){x=d(a);L=e.b<q.b-x.y;if(e.a<q.a-x.x&&"visible"!=p.x||L&&"visible"!=p.x)return V;e=U(a);return e==V?V:"scroll"}x=e.c>=q.a+q.width;q=e.f>=q.b+q.height;if(x&&"hidden"==p.x||q&&"hidden"==p.y)return V;if(x&&"visible"!=p.x||q&&"visible"!=p.y){if(da&&(p=d(a),e.c>=l.scrollWidth-p.x||e.a>=l.scrollHeight-p.y))return V;e=U(a);return e==V?V:"scroll"}}}return"none"}
function T(a){var b=W(a);if(b)return b.rect;if(J(a,"HTML"))return a=H(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new G(a.clientWidth,a.clientHeight),new M(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new M(0,0,0,0)}return new M(c.left,c.top,c.right-c.left,c.bottom-c.top)}
function W(a){var b=J(a,"MAP");if(!b&&!J(a,"AREA"))return null;var c=b?a:J(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name){d='*[usemap="#'+c.name+'"]';c=H(c);if(!d)throw new k(32,"No selector specified");d=oa(d);try{var g=c.querySelector(d)}catch(l){throw new k(32,"An invalid or illegal selector was specified");}if(d=g&&1==g.nodeType?g:null)e=T(d),b||"default"==a.shape.toLowerCase()||(a=Da(a),b=Math.min(Math.max(a.a,0),e.width),g=Math.min(Math.max(a.b,0),e.height),e=new M(b+e.a,
g+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-g)))}return{image:d,rect:e||new M(0,0,0,0)}}
function Da(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new M(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new M(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var d=b,e=c,g=2;g+1<a.length;g+=2)b=Math.min(b,a[g]),d=Math.max(d,a[g]),c=Math.min(c,a[g+1]),e=Math.max(e,a[g+1]);return new M(b,c,d-b,e-c)}return new M(0,0,0,0)}function Ca(a){a=T(a);return new K(a.b,a.a+a.width,a.b+a.height,a.a)}
function Aa(a){var b=1,c=P(a,"opacity");c&&(b=Number(c));(a=O(a))&&(b*=Aa(a));return b};function Ea(a){return Ba(a)&&N(a)&&"none"!=P(a,"pointer-events")}var X=["_"],Y=f;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Ea?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Ea;; return this._.apply(null,arguments);}).apply(window, arguments);}