-
Notifications
You must be signed in to change notification settings - Fork 1
/
pikantny.min.js
56 lines (56 loc) · 28.8 KB
/
pikantny.min.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
window.pikantny=function(){function ea(a,b,c,f,d,e,h,g,k,m,l,n,p){this.stopPropagation=function(){this.bubbles=!1;this.__stopPropogation__=!this.bubbles};this.stopImmediatePropagation=function(){this.bubbles=!1;this.__stopImmediatePropogation__=this.__stopPropogation__=!this.bubbles};this.preventDefault=function(){this.__preventDefault__=this.defaultPrevented=!0};this.stop=function(){this.target.__pikantnyExtensions__.stop=this.stopped=!0};this.cancelable=l||!0;this.defaultPrevented=!1;this.bubbles=
n||!0;this.bubbled=!1;this.value=a;this.oldValue=b;this.target=c;this.attr=f;this.style=d;this.arguments=e;this.action=h;this.srcElement=g;this.type=k;this.stopped=!1;this.extended=p;m&&(this.target.__pikantnyExtensions__.stop=this.stopped=!0)}function La(a){this.attrListeners={};this.attrUpdateListeners={};this.parentAttrListeners={};this.parentAttrUpdateListeners={};this.events={};this.bubbledEvents={};this.inlinestyle=this.stop=void 0;this.preValue="";this.descValue=void 0;this.preChecked="";this.descChecked=
void 0;this.isPressed=!1;if(a){var b=Object.keys(a),c=0,f=b.length;for(c;c<f;c++){var d=b[c];this[d]=a[d]}}}function H(a,b){var c=a.length,f;for(f=0;f<c;f++){!1===a[f](b)&&(b.__preventDefault__=!0);if(b.__stopImmediatePropogation__)break;c!==a.length&&(x=Math.max(x-(c-a.length),-1),c=a.length)}}function I(a,b){var c=a.length,f;for(f=0;f<c;f++){b.target=a[f].parent;a[f].func(b);if(void 0!==b.__stopPropogation__)break;c!==a.length&&(x=Math.max(x-(c-a.length),-1),c=a.length)}}function p(a,b){"undefined"===
typeof a.__pikantnyExtensions__&&Object.defineProperty(a,"__pikantnyExtensions__",M(new La(b)));return a.__pikantnyExtensions__}function fa(a,b){return a.attrListeners[b]&&1<a.attrListeners[b].length||a.attrUpdateListeners[b]&&1<a.attrUpdateListeners[b].length?!1:!0}function ha(a,b){return a.parentAttrListeners[b]&&1<a.parentAttrListeners[b].length||a.parentAttrUpdateListeners[b]&&1<a.parentAttrUpdateListeners[b].length?!1:!0}function ia(a,b,c){var f=y.call(a,"*"),d=a.__pikantnyExtensions__||p(a);
if("object"===typeof b&&b.length)for(var e=0,h=b.length;e<h;e++){var g=(g=-1!==b[e].indexOf("update"))?"attrUpdateListeners":"attrListeners";var k=b[e].replace("update","");d[g][k]||(d[g][k]=[]);d[g][k].push(c);ja(a,f,b[e],c)}else g=(g=-1!==b.indexOf("update"))?"attrUpdateListeners":"attrListeners",k=b.replace("update",""),d[g][k]||(d[g][k]=[]),d[g][k].push(c),ja(a,f,b,c)}function ja(a,b,c,f){var d=-1===c.indexOf("update")?"parentAttrListeners":"parentAttrUpdateListeners";c=c.replace("update","");
for(var e=0,h=b.length,g;e<h;e++)g=b[e].__pikantnyExtensions__||p(b[e]),g[d][c]||(g[d][c]=[]),g[d][c].push({func:f,parent:a})}function ka(a,b,c){var f=y.call(a,"*");a=a.__pikantnyExtensions__||p(a);var d=c.toString();if("object"===typeof b&&b.length)for(var e=0,h=b.length;e<h;e++){var g=(g=-1!==b[e].indexOf("update"))?"attrUpdateListeners":"attrListeners";var k=b[e].replace("update","");if(g=a[g][k]){k=0;var m=g.length;k;a:for(;k<m;k++)if(g[k].toString()===d){g.splice(k,1);break a}}la(f,b[e],c)}else{g=
(g=-1!==b.indexOf("update"))?"attrUpdateListeners":"attrListeners";k=b.replace("update","");if(g=a[g][k])a:for(k=0,m=g.length,k;k<m;k++)if(g[k].toString()===d){g.splice(k,1);break a}la(f,b,c)}}function la(a,b,c){c=c.toString();var f=-1===b.indexOf("update")?"parentAttrListeners":"parentAttrUpdateListeners";b=b.replace("update","");for(var d=0,e=a.length,h;d<e;d++)if(h=a[d].__pikantnyExtensions__||p(a[d]),h=h[f][b]){var g=0,k=h.length;a:for(;g<k;g++)if(h[g].func.toString()===c){h.splice(g,1);break a}}}
function N(a,b){return Object.defineProperty(a,b,ma({value:void 0,writable:!0,enumerable:!0,configurable:!0},b))}function O(a,b){return Object.defineProperty(a.style,b,na(a,b))}function oa(a,b){b.__add||(b.__add=b.add,b.__remove=b.remove,b.add=Ma.bind(a),b.remove=Na.bind(a))}function r(a,b,c,f,d,e,h,g,k,m){a=new ea(c,f,a,b,k,h,g,a,b,e,void 0,void 0,m);c=d.attrListeners;d=d.parentAttrListeners;c[b]&&H(c[b],a);!a.__stopImmediatePropogation__&&c["*"]&&H(c["*"],a);a.bubbles&&(a.bubbled=!0,!a.__stopPropogation__&&
d[b]&&I(d[b],a),!a.__stopPropogation__&&d["*"]&&I(d["*"],a));return a.__preventDefault__?!1:!0}function q(a,b,c,f,d,e,h,g,k){a=new ea(c,f,a,b,g,e,h,a,b+"update",void 0,void 0,void 0,k);c=d.attrUpdateListeners;d=d.parentAttrUpdateListeners;c[b]&&H(c[b],a);!a.__stopImmediatePropogation__&&c["*"]&&H(c["*"],a);a.bubbles&&(a.bubbled=!0,!a.__stopPropogation__&&d[b]&&I(d[b],a),!a.__stopPropogation__&&d["*"]&&I(d["*"],a));return a.__preventDefault__?!1:!0}function M(a){return{value:a,writable:!0,enumerable:!1,
configurable:!0}}function pa(a,b,c){function f(a){v=k.call(this);n=this.__pikantnyExtensions__||p(this);l(this,e,a,v,n,n.stop)&&l(this,h,a,v,n,n.stop,void 0,void 0,void 0,e)&&(g.call(this,a),void 0===n.stop&&(m(this,e,a,v,n),m(this,h,a,v,n)));n.stop=void 0}function d(a){v=k.call(this);n=this.__pikantnyExtensions__||p(this);l(this,e,a,v,n,n.stop)&&(g.call(this,a),n.stop||m(this,e,a,v,n));n.stop=void 0}var e=b,h=c,g=a.set,k=a.get,m=q,l=r,n={},v;return{get:a.get,set:void 0!==h?f:d,enumerable:a.enumerable,
configurable:!0}}function ma(a,b,c){function f(a){n&&(v=e.value,l=this.__pikantnyExtensions__||p(this),m(this,h,a,v,l,l.stop)&&m(this,g,a,v,l,l.stop,void 0,void 0,void 0,h)&&(e.value=a,l.stop||(k(this,h,a,v,l),k(this,g,a,v,l))));l.stop=void 0}function d(a){n&&(v=e.value,l=this.__pikantnyExtensions__||p(this),m(this,h,a,v,l,l.stop)&&(e.value=a,l.stop||k(this,h,a,v,l)));l.stop=void 0}var e=a,h=b,g=c,k=q,m=r,l={},n=a.writable,v;return{get:function(){return e.value},set:g?f:d,enumerable:a.enumerable,
configurable:!0}}function qa(a,b,c){function f(){l=this.__pikantnyExtensions__||p(this);k(this,e,void 0,void 0,l,l.stop,arguments)&&k(this,h,void 0,void 0,l,l.stop,arguments,void 0,void 0,e)&&(n=g.apply(this,arguments),"addEventListener"===e&&"addEventListenerupdate"===arguments[0]&&(l.stop=!0),l.stop||(m(this,e,void 0,void 0,l,arguments,n),m(this,h,void 0,void 0,l,arguments,n)));l.stop=void 0;return n}function d(){l=this.__pikantnyExtensions__||p(this);k(this,e,void 0,void 0,l,l.stop,arguments)&&
(n=g.apply(this,arguments),"addEventListener"===e&&"addEventListenerupdate"===arguments[0]&&(l.stop=!0),l.stop||m(this,e,void 0,void 0,l,arguments,n));l.stop=void 0;return n}var e=b,h=c,g=a.value,k=r,m=q,l={},n;f.base=g;d.base=g;return{value:h?f:d,writable:!1,enumerable:a.enumerable,configurable:!1}}function P(a,b){var c=b,f=a.set,d=a.get,e=r,h=q,g={},k={},m,l;return{get:a.get,set:function(a){if(this instanceof Attr){m=d.call(this);g=this.ownerElement;c=this.nodeName;k=g.__pikantnyExtensions__||p(g);
if(e(g,c,a,m,k,k.stop)){if("style"===c){l=J(m,a);for(var b=0,n=Object.keys(l),r=n.length,q;b<r;b++)q=n[b],g.style[q]=l[q]}"style"!==c&&(z[q]?e(g,z[q],a,m,k,k.stop)&&f.call(this,a):f.call(this,a));k.stop||(h(g,c,a,m,k),z[q]&&h(g,z[q],a,m,k))}k.stop=void 0}else return f.call(this,a)},enumerable:a.enumerable,configurable:!0}}function Ma(a){var b=this.__pikantnyExtensions__||p(this),c=this.classList,f=c.__add,d=0;r(this,"class","",a,b,b.stop)&&r(this,"className","",a,b,b.stop)&&(d=f.call(c,a),b.stop||
(q(this,"class","",a,b),q(this,"className","",a,b)));return d}function Na(a){var b=this.__pikantnyExtensions__||p(this),c=this.classList,f=c.__remove,d=0;r(this,"class",a,"",b,b.stop)&&r(this,"className",a,"",b,b.stop)&&(d=f.call(c,a),b.stop||(q(this,"class",a,"",b),q(this,"className",a,"",b)));return d}function ra(a,b){var c=a.set,f=a.get,d=q,e=r,h={},g;return{get:a.get,set:function(a){g=f.call(this);h=this.__pikantnyExtensions__||p(this);e(this,b,a,g,h,h.stop)&&(c.call(this,a),h.stop||d(this,b,
a,h,g),Q(this,b,a,!1,g));h.stop=void 0},enumerable:!0,configurable:!0}}function C(a){for(var b=a.length,c;x<b;x++)c=a[0].__pikantnyExtensions__||p(a[0]),c.injectedInput||R(a[0])}function Oa(a,b){var c=this.__pikantnyExtensions__,f=a.replace("update",""),d=A(f),e=d.match(/(webkit|moz|ms)/);if(-1!==S.indexOf(d)||e&&0===e.index){e=y.call(this,"*");var h=e.length;var g=0;f=B(f);a=-1!==a.indexOf("update")?"update":"";c.__styleList__&&-1!==c.__styleList__.indexOf(d)||O(this,d);for(g;g<h;g++)c=e[g].__pikantnyExtensions__||
p(e[g]),c.__styleList__&&-1!==c.__styleList__.indexOf(d)||O(e[g],d);if(T(this,d,f))for(c=y.call(this,"*"),e=0,h=c.length;e<h;e++)T(c[e],d,f);ia(this,d+a,b);return d}if(-1!==["value","checked","selectedIndex"].indexOf(f))-1!==["INPUT","TEXTAREA","SELECT"].indexOf(this.nodeName)?c.injectedInput||R(this):0!==this.childNodes.length&&(d=y.call(this,"input"),f=y.call(this,"textarea"),c=y.call(this,"select"),"value"===a?(C(d),C(f),C(c)):"checked"===a?C(d):C(c,!0));else if(-1!==["class","className"].indexOf(f))for(e=
y.call(this,"*"),h=e.length,g=0,oa(this,this.classList),g;g<h;g++)oa(e[g],e[g].classList);else if(-1===D.indexOf(this)&&null===this.getAttribute(f)&&!this[f]&&-1===sa.indexOf(f))for(N(this,f),d=y.call(this,"*"),c=0,e=d.length;c<e;c++)N(d[c],f);ia(this,a,b)}function E(a,b,c){b=a.length;var f;for(0;x<b;x++){var d=a[x];(f=d.__pikantnyExtensions__)&&-1!==["INPUT","TEXTAREA","SELECT"].indexOf(d.nodeName)&&fa(f,c)&&ha(f,c)&&U(d.type,d)}}function Pa(a,b){var c=this.__pikantnyExtensions__,f=a.replace("update",
""),d=A(a),e=d.match(/(webkit|moz|ms)/);if(-1!==S.indexOf(d)||e&&0===e.index)return a=B(a),ka(this,[a,d],b),d;-1!==["value","checked","selectedIndex"].indexOf(f)&&fa(c,f)&&(-1!==["INPUT","TEXTAREA","SELECT"].indexOf(this.nodeName)?ha(c,f)&&U(this.type,this):0!==this.childNodes.length&&(d=y.call(this,"input"),c=y.call(this,"textarea"),e=y.call(this,"select"),"value"===a?(E(d,a,f),E(c,a,f),E(e,a,f)):"checked"===a?E(d,a,f):E(e,a,f)));ka(this,a,b);return a}function Q(a,b,c,f,d){var e=(a.__pikantnyExtensions__||
p(a)).events,h=e[b];a=y.call(a,"*");var g;h||(h=e[b]=[]);if(d&&-1!==h.indexOf(d)||f){h.splice(h.indexOf(d||c),1);var k=0;var m=a.length;for(k;k<m;k++){var l=a[k];l=l.__pikantnyExtensions__||p(l);l=l.bubbledEvents;(g=l[b])||(g=l[b]=[]);g.splice(g.indexOf(d||c),1)}}if(!f)for(e[b][h.length]=c,k=0,m=a.length,k;k<m;k++)l=a[k],l=l.__pikantnyExtensions__||p(l),l=l.bubbledEvents,(g=l[b])||(g=l[b]=[]),l[b][g.length]=c}function na(a,b){var c=a.style,f=c.removeProperty,d=c.setProperty,e=A(b),h=B(b),g=r,k=q,
m={},l=c[e],n=c[e];return{get:function(){return n},set:function(b){l=n;m=a.__pikantnyExtensions__||p(a);g(a,e,b,l,m,m.stop,void 0,void 0,h)&&(n=b,"string"===typeof b&&0===b.length?(m.inlinestyle=!0,f.call(c,h)):(m.inlinestyle=!0,d.call(c,h,b)),m.stop||k(a,e,b,l,m,!1,void 0,void 0,h));m.stop=void 0},enumerable:!0,configurable:!0}}function Qa(a){var b=a.style,c=r,f=q,d=Ra.get,e=a.__pikantnyExtensions__||p(a),h=b.csssText,g;return{get:d,set:function(b){h=d.call(this);if(c(a,"cssText",b,h,e,e.stop)){g=
J(h,b);for(var k=0,l=Object.keys(g),n=l.length,p;k<n;k++)p=l[k],this[p]=g[p];e.stop||f(a,"cssText",b,h,e)}e.stop=void 0},enumerable:!0,configurable:!1}}function Sa(a){var b=a.style,c=b.setProperty,f=A,d=B,e,h,g=r,k=q,m=a.__pikantnyExtensions__||p(a),l=void 0;return{value:function(n,p){if("string"===typeof p&&0===p.length)return b.removeProperty(n);if(m.inlinestyle)return m.inlinestyle=void 0,c.apply(this,arguments);e=f(n);h=d(n);g(a,e,void 0,void 0,m,m.stop,arguments,void 0,h)&&(l=c.apply(this,arguments),
m.stop||k(a,e,void 0,void 0,m,m.stop,arguments,l,h));m.stop=void 0},writable:!0,enumerable:!0,configurable:!1}}function Ta(a){var b=a.style.removeProperty,c=A,f=B,d,e,h=r,g=q,k=a.__pikantnyExtensions__||p(a),m=void 0;return{value:function(l){if(k.inlinestyle)return k.inlinestyle=void 0,b.apply(this,arguments);d=c(l);e=f(l);h(a,d,void 0,void 0,k,k.stop,arguments,void 0,e)&&(m=b.apply(this,arguments),k.stop||g(a,d,void 0,void 0,k,k.stop,arguments,m,e));k.stop=void 0},writable:!0,enumerable:!0,configurable:!1}}
function A(a){0===a.indexOf("-webkit")&&(a=a.replace("-webkit","webkit"));0===a.indexOf("-moz")&&(a=a.replace("-moz","moz"));0===a.indexOf("-ms")&&(a=a.replace("-ms","ms"));return a.replace(/\-(.)/g,function(a,c){return c.toUpperCase()})}function B(a){a=a.replace(/([A-Z])/g,"-$1");0===a.indexOf("webkit")&&(a=a.replace("webkit","-webkit"));0===a.indexOf("moz")&&(a=a.replace("moz","-moz"));0===a.indexOf("ms")&&(a=a.replace("ms","-ms"));return a.toLowerCase()}function J(a,b){b=b.split(";").reduce(function(a,
b){b=b.split(":");var c=A(b[0]);a[c]=b[1];return a},{});var c=0;a=a.split(";");for(var f=a.length,d;c<f;c++)d=a[c].split(":"),d=A(d[0]),b[d]||(b[d]="");return b}function T(a,b,c){var f=a.__pikantnyExtensions__||p(a),d=f.__styleList__;d||(d=f.__styleList__=[],f.__GCSTYLEFIX__=a.style,Object.defineProperty(a.style,"setProperty",Sa(a)),Object.defineProperty(a.style,"removeProperty",Ta(a)),Object.defineProperty(a.style,"cssText",Qa(a)));return-1===d.indexOf(b)?(Object.defineProperty(a.style,b,na(a,b,
c)),f.__styleList__[d.length]=b,!0):!1}function K(a){return"Backspace"===a.key||8===(a.keyCode||a.which)}function V(){(this.__pikantnyExtensions__||p(this)).__prevalue__=this.value;return!0}function W(a){if(a.defaultPrevented)return!1;var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=b.__prevalue__,h=d;if(b.isIME||-1!==ta.indexOf(a.key))return b.isIME=!0,"Enter"===a.key||13===(a.keyCode||a.which)?!!a.preventDefault():!0;b.isInputUpdate=void 0;b.isAltered=void 0;b.isIME=void 0;b.__prevalue__=
h;if(a.key&&1!==a.key.length&&!K(a))return!0;(d=(-1!==["V","v"].indexOf(a.key)||86===(a.keyCode||a.which))&&a.ctrlKey)||(d=(-1!==["X","x"].indexOf(a.key)||88===(a.keyCode||a.which))&&a.ctrlKey);if(d)return b.isAltered=!0;if(a.ctrlKey||a.altKey)return!0;d=this.value;var g=this.selectionStart,k=this.selectionEnd;this.selectionStart===this.selectionEnd?(g=d.substring(0,g),d=k===d.length?"":d.substring(k,d.length),d=g+(K(a)?"":1===a.key.length?a.key:"")+d):d=K(a)?d.substring(0,g-1)+d.substring(g,d.length):
d.substring(0,g)+(1===a.key.length?a.key:"")+d.substring(g,d.length);b.isKeyDownUpdate=!0;if(c(this,"value",d,h,b,b.stop))b.isPressed?(b.isPressedUpdate=!0,b.stop||f(this,"value",this.value,e,b),b.stop=void 0):b.isPressed=!0;else return b.stop=!0,b.latestValue=this.value,!!a.preventDefault();return!0}function X(a){var b=this.__pikantnyExtensions__,c=q,f=this.value,d=b.__prevalue__;if(b.isIME||-1!==ta.indexOf(a.key)||a.key&&1!==a.key.length&&!K(a)||a.ctrlKey||a.altKey)return!0;b.isPressedUpdate||b.stop||
c(this,"value",f,d,b);b.isKeyDownUpdate=!1;b.isPressedUpdate=!1;b.isPressed=!1;b.stop=void 0;b.latestValue=f;return!0}function Y(a){var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=b.__prevalue__,h="TEXTAREA"===this.nodeName;if(b.isIME)return!0;if(b.isAltered||!b.isKeyDownUpdate&&!b.isPressed){b.isInputUpdate=!0;if(c(this,"value",d,e,b,b.stop))b.stop||f(this,"value",d,e,b);else return(h?Z:F).set.call(this,e),b.stop=void 0,b.latestValue=this.value,!!a.preventDefault();b.latestValue=this.value;
b.stop=void 0}return!0}function aa(a){var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=b.latestValue,h="TEXTAREA"===this.nodeName;if(!b.isInputUpdate&&b.latestValue!==this.value)if(c(this,"value",d,e,b,b.stop))b.stop||f(this,"value",d,e,b);else return(h?Z:F).set.call(this,e),b.stop=void 0,!!a.preventDefault();b.stop=void 0;return!0}function ba(){var a=this.__pikantnyExtensions__;a.isIME=!0;a.__prevalue__=this.value;return!0}function ca(a){var b=this.__pikantnyExtensions__,c=q,f=this.value,
d=b.__prevalue__,e="TEXTAREA"===this.nodeName;if(r(this,"value",f,d,b,b.stop))b.stop||c(this,"value",f,d,b);else return a.preventDefault(),(e?Z:F).set.call(this,d),b.stop=void 0,b.isIME=!1,b.latestValue=this.value,!1;b.stop=void 0;b.isIME=!1;b.latestValue=this.value;return!0}function ua(){var a=this.__pikantnyExtensions__||p(this);a.__prevalue__=this.value;a.isInputUpdate=!1;return!0}function va(a){var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=b.__prevalue__;b.isInputUpdate=!0;if(c(this,
"value",d,e,b,b.stop))b.stop||f(this,"value",d,e,b);else return F.set.call(this,e),b.stop=void 0,!!a.preventDefault();b.stop=void 0;return!0}function wa(a){var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=b.__prevalue__;if(!b.isInputUpdate)if(c(this,"value",d,e,b,b.stop))b.stop||f(this,"value",d,e,b);else return F.set.call(this,e),b.stop=void 0,!!a.preventDefault();b.stop=void 0;return!0}function xa(){var a=this.__pikantnyExtensions__||p(this);a.__prevalue__=this.checked?"on":"off";a.__prechecked__=
this.checked;return!0}function ya(a){if(a.defaultPrevented)return!1;var b=this.__pikantnyExtensions__,c=r,f=this.checked?"on":"off",d=this.checked,e,h;b.isSpaceBarEvent=void 0;b.isFromMouseEvent=void 0;b.defaultPrevented=void 0;if(" "===a.key||32===(a.keyCode||a.which))if(b.isSpaceBarEvent=!0,!b.isPressed)if(b.__prevalue__=e=f,b.__prechecked__=h=this.checked,f=d?"off":"on",d=!d,b.isPressed=!0,c(this,"value",f,e,b,b.stop)){if(!c(this,"checked",d,h,b,b.stop))return b.defaultPrevented=!0,b.stop=!0,!!a.preventDefault()}else return b.defaultPrevented=
!0,b.stop=!0,!!a.preventDefault();return!0}function za(){this.__pikantnyExtensions__.isPressed=void 0;return!0}function Aa(a){if(a.defaultPrevented)return!1;if(0!==a.button)return!0;var b=this.__pikantnyExtensions__,c=r,f=this.checked?"off":"on",d=!this.checked,e=this.checked?"on":"off",h=this.checked;b.__prevalue__=e;b.__prechecked__=h;b.defaultPrevented=void 0;b.isPressed=void 0;b.isFromMouseEvent=!0;b.isSpaceBarEvent=void 0;if(c(this,"value",f,e,b,b.stop)){if(!c(this,"checked",d,h,b,b.stop))return b.defaultPrevented=
!0,b.stop=!0,!!a.preventDefault()}else return b.defaultPrevented=!0,b.stop=!0,!!a.preventDefault();return!0}function Ba(a){if(0!==a.button)return!0;var b=this.__pikantnyExtensions__,c=q,f=this.checked?"on":"off",d=this.checked,e=b.__prevalue__,h=b.__prechecked__;if(b.isFromMouseEvent||b.isSpaceBarEvent){if(b.defaultPrevented)return!!a.preventDefault();b.stop||(c(this,"value",f,e,b),c(this,"checked",d,h,b))}b.isPressed=void 0;b.stop=void 0;return!0}function Ca(){var a=this.__pikantnyExtensions__||
p(this);a.__prevalue__=this.value;a.__preindex__=this.selectedIndex;return!0}function Da(a){var b=this.__pikantnyExtensions__,c=r,f=q,d=this.value,e=this.selectedIndex,h=b.__prevalue__,g=b.__preindex__;if(c(this,"value",d,h,b,b.stop))if(c(this,"selectedIndex",e,g,b,b.stop))b.stop||(f(this,"value",d,h,b),f(this,"selectedIndex",e,g,b));else return Ea.set.call(this,g),Fa.set.call(this,h),b.stop=void 0,!!a.preventDefault();else return Ea.set.call(this,g),Fa.set.call(this,h),b.stop=void 0,!!a.preventDefault();
b.stop=void 0;return!0}function Ga(a){var b=a.target;U(a.oldValue,b,!0);Ha(b);return!0}function Ha(a){var b=a.__pikantnyExtensions__;b.nonStandard=!1;-1!==["checkbox","radio"].indexOf(a.type)?(t.call(a,"focus",xa),t.call(a,"keydown",ya),t.call(a,"keyup",za),t.call(a,"mousedown",Aa),t.call(a,"click",Ba)):null===a.selectionStart?(b.nonStandard=!0,t.call(a,"focus",ua),t.call(a,"input",va),t.call(a,"change",wa)):(t.call(a,"focus",V),t.call(a,"keydown",W),t.call(a,"keyup",X),t.call(a,"input",Y),t.call(a,
"change",aa),t.call(a,"compositionstart",ba),t.call(a,"compositionend",ca))}function U(a,b,c){var f=b.__pikantnyExtensions__;if("SELECT"===b.nodeName)return u.call(b,"focus",Ca),u.call(b,"change",Da),f.injectedInput=void 0,!0;f.nonStandard?(f.nonStandard=void 0,u.call(b,"focus",ua),u.call(b,"input",va),u.call(b,"change",wa)):-1===["checkbox","radio"].indexOf(a)?(u.call(b,"focus",V),u.call(b,"keydown",W),u.call(b,"keyup",X),u.call(b,"input",Y),u.call(b,"change",aa),u.call(b,"compositionstart",ba),
u.call(b,"compositionend",ca)):(u.call(b,"focus",xa),u.call(b,"keydown",ya),u.call(b,"keyup",za),u.call(b,"mousedown",Aa),u.call(b,"mouseup",Ba));c||(b.removeEventListener("typeupdate",Ga),f.injectedInput=void 0)}function R(a){var b=a.__pikantnyExtensions__||p(a);switch(a.nodeName){case "INPUT":Ha(a);a.addEventListener("typeupdate",Ga);b.injectedInput=!0;break;case "TEXTAREA":t.call(a,"focus",V);t.call(a,"keydown",W);t.call(a,"keyup",X);t.call(a,"input",Y);t.call(a,"change",aa);t.call(a,"compositionstart",
ba);t.call(a,"compositionend",ca);b.injectedInput=!0;break;case "SELECT":t.call(a,"focus",Ca),t.call(a,"change",Da),b.injectedInput=!0}}function w(a,b,c){c||(c=window);c.__pikantnyKeyList__||Object.defineProperty(c,"__pikantnyKeyList__",M([]));for(var f=0,d=Object.getOwnPropertyNames(b),e=d.length;f<e;f++)w.inject(a,b,d[f],c);return w}var G=["EventTarget","Node","Element","HTMLElement"].concat("HTMLVideoElement HTMLUnknownElement HTMLUListElement HTMLTrackElement HTMLTitleElement HTMLTextAreaElement HTMLTemplateElement HTMLTableSectionElement HTMLTableRowElement HTMLTableElement HTMLTableColElement HTMLTableCellElement HTMLTableCaptionElement HTMLStyleElement HTMLSpanElement HTMLSourceElement HTMLSlotElement HTMLShadowElement HTMLSelectElement HTMLScriptElement HTMLQuoteElement HTMLProgressElement HTMLPreElement HTMLPictureElement HTMLParamElement HTMLParagraphElement HTMLOutputElement HTMLOptionElement HTMLOptGroupElement HTMLObjectElement HTMLOListElement HTMLModElement HTMLMeterElement HTMLMetaElement HTMLMenuElement HTMLMediaElement HTMLMarqueeElement HTMLMapElement HTMLLinkElement HTMLLegendElement HTMLLabelElement HTMLLIElement HTMLInputElement HTMLImageElement HTMLIFrameElement HTMLHeadingElement HTMLHeadElement HTMLHRElement HTMLFrameSetElement HTMLFrameElement HTMLFormElement HTMLFontElement HTMLFieldSetElement HTMLEmbedElement HTMLDivElement HTMLDirectoryElement HTMLDialogElement HTMLDetailsElement HTMLDataListElement HTMLDListElement HTMLCanvasElement HTMLButtonElement HTMLBaseElement HTMLBRElement HTMLAudioElement HTMLAreaElement HTMLAnchorElement".split(" ")),
Ua="dispatchEvent Symbol constructor __proto__ stop length setAttribute removeAttribute addEventListener removeEventListener setProperty removeProperty getPropertyValue".split(" "),da={textContent:"html",innerHTML:"html",innerText:"html",outerHTML:"html",outerText:"html",appendChild:"html",removeChild:"html",replaceChild:"html",insertAdjacentHTML:"html",insertAdjacentElement:"html",insertAdjacentText:"html",insertBefore:"html",prepend:"html",className:"class"},sa=["html"],S=Object.getOwnPropertyNames(document.head.style).concat(Object.getOwnPropertyNames(document.head.style.__proto__)).concat(CSSStyleDeclaration?
Object.getOwnPropertyNames(CSSStyleDeclaration.prototype):[]).filter(function(a,b,c){return c.indexOf(a)===b}),Ia=Object.keys(HTMLElement.prototype).filter(function(a){return 0===a.indexOf("on")}).concat("onDOMContentLoaded onDOMAttributeNameChanged onDOMAttrModified onDOMCharacterDataModified onDOMNodeInserted onDOMNodeRemoved onDOMSubtreeModified".split(" ")),z={"class":"className",tabindex:"tabIndex"},ta=["Unidentified","Process"],D=[window,document];"undefined"===typeof EventTarget&&(window.EventTarget=
Node);var t=EventTarget.prototype.addEventListener,u=EventTarget.prototype.removeEventListener,Ja=function(){var a=Element.prototype.setAttribute;return function(){return a.apply(-1!==D.indexOf(this)?document.documentElement:this,arguments)}}(),Ka=function(){var a=Element.prototype.removeAttribute;return function(){return a.apply(-1!==D.indexOf(this)?document.documentElement:this,arguments)}}(),Va=function(){var a=Element.prototype.getAttribute;return function(){return a.apply(-1!==D.indexOf(this)?
document.documentElement:this,arguments)}}(),Fa=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"),Ea=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"selectedIndex"),F=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),Z=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value"),y=function(){var a=Element.prototype.querySelectorAll;return function(){return a.apply(-1!==D.indexOf(this)?document.documentElement:this,arguments)}}(),Ra=Object.getOwnPropertyDescriptor(CSSStyleDeclaration.prototype,
"cssText");void 0===Element.prototype.stop&&(Element.prototype.stop=function(){(this.__pikantnyExtensions__||p(this)).stop=!0;return this});void 0===Text.prototype.stop&&(Text.prototype.stop=function(){(this.__pikantnyExtensions__||p(this)).stop=!0;return this});Element.prototype.setAttribute=function(a,b){var c=Va.call(this,a),f=this.__pikantnyExtensions__||p(this),d;if(r(this,"setAttribute",void 0,void 0,f,f.stop,arguments)&&r(this,a,b,c,f,f.stop)){if("style"===a){var e=J(c,b);var h=Object.keys(e);
var g=h.length;for(d=0;d<g;d++){var k=h[d];this.style[k]=e[k]}}else z[a]?r(this,z[a],b,c,f,f.stop)&&Ja.call(this,a,b):Ja.call(this,a,b);f.stop||(q(this,"setAttribute",void 0,void 0,f,arguments),q(this,a,b,c,f,arguments),z[a]&&q(this,z[a],b,c,f,arguments))}f.stop=void 0};Element.prototype.removeAttribute=function(a){var b=this.attributes.getNamedItem(a)?this.attributes.getNamedItem(a).value:null,c=this.__pikantnyExtensions__||p(this);if(r(this,"removeAttribute",void 0,void 0,c,c.stop,arguments)&&r(this,
a,void 0,b,c,c.stop)){if("style"===a){var f=J(b,void 0);for(var d=0,e=Object.keys(f),h=e.length;d<h;d++){var g=e[d];this.style[g]=f[g]}}z[a]?r(this,z[a],void 0,b,c,c.stop)&&Ka.call(this,a):Ka.call(this,a);c.stop||(q(this,"removeAttribute",void 0,void 0,c,c.stop,arguments),q(this,a,void 0,b,c,c.stop,arguments),z[a]&&q(this,z[a],void 0,b,c,c.stop,arguments))}c.stop=void 0};Object.defineProperty(Node.prototype,"nodeValue",P(Object.getOwnPropertyDescriptor(Node.prototype,"nodeValue"),"nodeValue"));Object.defineProperty(Node.prototype,
"textContent",P(Object.getOwnPropertyDescriptor(Node.prototype,"textContent"),"textContent"));var L=Object.getOwnPropertyDescriptor(Attr.prototype,"value");L&&Object.defineProperty(Attr.prototype,"value",P(L,"value"));EventTarget.prototype.addEventListener=function(a,b,c){var f=this.__pikantnyExtensions__||p(this);r(this,"addEventListener",void 0,void 0,f,f.stop,arguments)&&(t.call(this,a,b,c),f.stop||q(this,"addEventListener",void 0,void 0,f,f.stop,arguments),-1===Ia.indexOf("on"+a)?Oa.apply(this,
arguments):Q(this,a,b,!1));f.stop=void 0};EventTarget.prototype.removeEventListener=function(a,b,c){var f=this.__pikantnyExtensions__||p(this);r(this,"removeEventListener",void 0,void 0,f,f.stop,arguments)&&(u.call(this,a,b,c),-1===Ia.indexOf("on"+a)?Pa.apply(this,arguments):Q(this,a,b,!0),f.stop||q(this,"removeEventListener",void 0,void 0,f,f.stop,arguments));f.stop=void 0};w.inject=function(a,b,c,f){f||(f=window);f.__pikantnyKeyList__||Object.defineProperty(f,"__pikantnyKeyList__",M([]));f=f.__pikantnyKeyList__;
if(-1!==Ua.indexOf(c)||0===c.indexOf("__"))return w;f[c]||(f[c]={});if(f[c][a])return w;var d=Object.getOwnPropertyDescriptor(b,c),e;if(!d)return w;d.configurable&&(da[c]?d.set?e=!!Object.defineProperty(b,c,pa(d,c,da[c])):"function"===typeof d.value&&(e=!!Object.defineProperty(b,c,qa(d,c,da[c]))):d.set?e=!!Object.defineProperty(b,c,pa(d,c)):"function"===typeof d.value?e=!!Object.defineProperty(b,c,qa(d,c)):d.value&&(e=!!Object.defineProperty(b,c,ma(d,c))),e&&(b=Object.getOwnPropertyDescriptor(HTMLElement.prototype,
"on"+c),e=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"on"+c+"update"),b||Object.defineProperty(HTMLElement.prototype,"on"+c,ra(c)),e||Object.defineProperty(HTMLElement.prototype,"on"+c+"update",ra(c,!0))),f[c][a]=d);return w};w.observables=function(a){return(a||window).__pikantnyKeyList__.slice()};w.isObservable=function(a,b){return void 0!==(b||window).__pikantnyKeyList__[a]};w.addEventListener=t.bind(document.documentElement);w.removeEventListener=u.bind(document.documentElement);w.getEventListeners=
function(a){a=a.__pikantnyExtensions__||p(a);var b=Object.keys(a.attrListeners),c=Object.keys(a.attrUpdateListeners),f=Object.keys(a.events),d={},e=0,h=b.length;for(e;e<h;e++)d[b[e]]=a.attrListeners[b[e]].slice();e=0;h=c.length;for(e;e<h;e++)d[c[e]+"update"]=a.attrUpdateListeners[c[e]].slice();e=0;h=f.length;for(e;e<h;e++)d[f[e]]=a.events[f[e]].slice();return d};w.getBubbledEventListeners=function(a){a=a.__pikantnyExtensions__||p(a);var b=Object.keys(a.parentAttrListeners),c=Object.keys(a.parentAttrUpdateListeners),
f=Object.keys(a.bubbledEvents),d={},e=0,h=b.length;for(e;e<h;e++)d[b[e]]=a.parentAttrListeners[b[e]].slice();e=0;h=c.length;for(e;e<h;e++)d[c[e]+"update"]=a.parentAttrUpdateListeners[c[e]].slice();e=0;h=f.length;for(e;e<h;e++)d[f[e]]=a.bubbledEvents[f[e]].slice();return d};var x=0;for(L=G.length;x<L;x++)void 0!==window[G[x]]&&void 0!==window[G[x]].prototype&&w(G[x],window[G[x]].prototype,window);(function(){function a(a,b,d,e,h){var c=h?"parentAttrUpdateListeners":"parentAttrListeners";h=Object.keys(e);
d=d[c];c=h.length;var f;for(f=0;f<c;f++){var m=h[f];var l=A(m);var n=l.match(/(webkit|moz|ms)/);-1!==S.indexOf(l)||n&&!n.index?e[l].length&&(void 0===b.style[l]&&O(b,l),T(b,l,B(m))):-1!==["value","checked","selectedIndex"].indexOf(m)&&-1!==["INPUT","TEXTAREA","SELECT"].indexOf(b.nodeName)?e[m].length&&R(b):null===b.getAttribute(m)&&void 0===b[m]&&-1===sa.indexOf(m)&&N(b,m);if(e[m].length)if(e[m][0].parent)d[m]=e[m].slice();else for(d[m]=[],l=e[m].length,n=0;n<l;n++)d[m][n]={parent:a,func:e[m][n]};
else for(d[m]=[],l=e[m].length,n=0;n<l;n++)d[m][n]={parent:a,func:e[m][n]}}}var b=y;document.documentElement.addEventListener("htmlupdate",function(c){if(3!==c.srcElement.nodeType&&8!==c.srcElement.nodeType){c=c.srcElement;var f=c.__pikantnyExtensions__||p(c,c.__pikantnyExtensionsPass__),d=b.call(c,"*"),e=d.length,h;for(h=0;h<e;h++){var g=d[h];if(!g.__pikantnyExtensions__){var k=p(g);a(c,g,k,f.attrListeners);a(c,g,k,f.attrUpdateListeners,!0);a(c,g,k,f.parentAttrListeners);a(c,g,k,f.parentAttrUpdateListeners,
!0)}}}})})();"function"===typeof define&&define.amd&&define("pikantny",function(){return w});"object"===typeof module&&"object"===typeof module.exports&&(module.exports.pikantny=w);return w}();