text: import stream from"stream";import string_decoder from"string_decoder";var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var options,currentElement,sax=createCommonjsModule(function(e,t){!function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=a,e.createStream=function(e,t){return new a(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(t,r){if(!(this instanceof n))return new n(t,r);!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.opt=r||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!t,this.noscript=!(!t&&!this.opt.noscript),this.state=b.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(c)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),w(this,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t}),n.prototype={end:function(){M(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return F(this,"Cannot write after close. Assign an onready handler.");if(null===t)return M(this);"object"==typeof t&&(t=t.toString());var n=0,r="";for(;r=H(t,n++),this.c=r,r;)switch(this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++),this.state){case b.BEGIN:if(this.state=b.BEGIN_WHITESPACE,"\ufeff"===r)continue;R(this,r);continue;case b.BEGIN_WHITESPACE:R(this,r);continue;case b.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=n-1;r&&"<"!==r&&"&"!==r;)(r=H(t,n++))&&this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++);this.textNode+=t.substring(a,n-1)}"<"!==r||this.sawRoot&&this.closedRoot&&!this.strict?(m(r)||this.sawRoot&&!this.closedRoot||N(this,"Text data outside of root node."),"&"===r?this.state=b.TEXT_ENTITY:this.textNode+=r):(this.state=b.OPEN_WAKA,this.startTagPosition=this.position);continue;case b.SCRIPT:"<"===r?this.state=b.SCRIPT_ENDING:this.script+=r;continue;case b.SCRIPT_ENDING:"/"===r?this.state=b.CLOSE_TAG:(this.script+="<"+r,this.state=b.SCRIPT);continue;case b.OPEN_WAKA:if("!"===r)this.state=b.SGML_DECL,this.sgmlDecl="";else if(m(r));else if(E(p,r))this.state=b.OPEN_TAG,this.tagName=r;else if("/"===r)this.state=b.CLOSE_TAG,this.tagName="";else if("?"===r)this.state=b.PROC_INST,this.procInstName=this.procInstBody="";else{if(N(this,"Unencoded <"),this.startTagPosition+1<this.position){var l=this.position-this.startTagPosition;r=new Array(l).join(" ")+r}this.textNode+="<"+r,this.state=b.TEXT}continue;case b.SGML_DECL:(this.sgmlDecl+r).toUpperCase()===o?(C(this,"onopencdata"),this.state=b.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+r==="--"?(this.state=b.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+r).toUpperCase()===s?(this.state=b.DOCTYPE,(this.doctype||this.sawRoot)&&N(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===r?(C(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=b.TEXT):f(r)?(this.state=b.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case b.SGML_DECL_QUOTED:r===this.q&&(this.state=b.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case b.DOCTYPE:">"===r?(this.state=b.TEXT,C(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=b.DOCTYPE_DTD:f(r)&&(this.state=b.DOCTYPE_QUOTED,this.q=r));continue;case b.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=b.DOCTYPE);continue;case b.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=b.DOCTYPE:f(r)&&(this.state=b.DOCTYPE_DTD_QUOTED,this.q=r);continue;case b.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=b.DOCTYPE_DTD,this.q="");continue;case b.COMMENT:"-"===r?this.state=b.COMMENT_ENDING:this.comment+=r;continue;case b.COMMENT_ENDING:"-"===r?(this.state=b.COMMENT_ENDED,this.comment=I(this.opt,this.comment),this.comment&&C(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=b.COMMENT);continue;case b.COMMENT_ENDED:">"!==r?(N(this,"Malformed comment"),this.comment+="--"+r,this.state=b.COMMENT):this.state=b.TEXT;continue;case b.CDATA:"]"===r?this.state=b.CDATA_ENDING:this.cdata+=r;continue;case b.CDATA_ENDING:"]"===r?this.state=b.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=b.CDATA);continue;case b.CDATA_ENDING_2:">"===r?(this.cdata&&C(this,"oncdata",this.cdata),C(this,"onclosecdata"),this.cdata="",this.state=b.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=b.CDATA);continue;case b.PROC_INST:"?"===r?this.state=b.PROC_INST_ENDING:m(r)?this.state=b.PROC_INST_BODY:this.procInstName+=r;continue;case b.PROC_INST_BODY:if(!this.procInstBody&&m(r))continue;"?"===r?this.state=b.PROC_INST_ENDING:this.procInstBody+=r;continue;case b.PROC_INST_ENDING:">"===r?(C(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=b.TEXT):(this.procInstBody+="?"+r,this.state=b.PROC_INST_BODY);continue;case b.OPEN_TAG:E(h,r)?this.tagName+=r:(P(this),">"===r?D(this):"/"===r?this.state=b.OPEN_TAG_SLASH:(m(r)||N(this,"Invalid character in tag name"),this.state=b.ATTRIB));continue;case b.OPEN_TAG_SLASH:">"===r?(D(this,!0),O(this)):(N(this,"Forward-slash in opening tag not followed by >"),this.state=b.ATTRIB);continue;case b.ATTRIB:if(m(r))continue;">"===r?D(this):"/"===r?this.state=b.OPEN_TAG_SLASH:E(p,r)?(this.attribName=r,this.attribValue="",this.state=b.ATTRIB_NAME):N(this,"Invalid attribute name");continue;case b.ATTRIB_NAME:"="===r?this.state=b.ATTRIB_VALUE:">"===r?(N(this,"Attribute without value"),this.attribValue=this.attribName,L(this),D(this)):m(r)?this.state=b.ATTRIB_NAME_SAW_WHITE:E(h,r)?this.attribName+=r:N(this,"Invalid attribute name");continue;case b.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=b.ATTRIB_VALUE;else{if(m(r))continue;N(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",C(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?D(this):E(p,r)?(this.attribName=r,this.state=b.ATTRIB_NAME):(N(this,"Invalid attribute name"),this.state=b.ATTRIB)}continue;case b.ATTRIB_VALUE:if(m(r))continue;f(r)?(this.q=r,this.state=b.ATTRIB_VALUE_QUOTED):(N(this,"Unquoted attribute value"),this.state=b.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case b.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=b.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}L(this),this.q="",this.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:m(r)?this.state=b.ATTRIB:">"===r?D(this):"/"===r?this.state=b.OPEN_TAG_SLASH:E(p,r)?(N(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=b.ATTRIB_NAME):N(this,"Invalid attribute name");continue;case b.ATTRIB_VALUE_UNQUOTED:if(!y(r)){"&"===r?this.state=b.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}L(this),">"===r?D(this):this.state=b.ATTRIB;continue;case b.CLOSE_TAG:if(this.tagName)">"===r?O(this):E(h,r)?this.tagName+=r:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=b.SCRIPT):(m(r)||N(this,"Invalid tagname in closing tag"),this.state=b.CLOSE_TAG_SAW_WHITE);else{if(m(r))continue;T(p,r)?this.script?(this.script+="</"+r,this.state=b.SCRIPT):N(this,"Invalid tagname in closing tag."):this.tagName=r}continue;case b.CLOSE_TAG_SAW_WHITE:if(m(r))continue;">"===r?O(this):N(this,"Invalid characters in closing tag");continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var u,c;switch(this.state){case b.TEXT_ENTITY:u=b.TEXT,c="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:u=b.ATTRIB_VALUE_QUOTED,c="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:u=b.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===r?(this[c]+=B(this),this.entity="",this.state=u):E(this.entity.length?g:d,r)?this.entity+=r:(N(this,"Invalid character in entity name"),this[c]+="&"+this.entity+r,this.entity="",this.state=u);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;a<o;a++){var s=t[i[a]].length;if(s>n)switch(i[a]){case"textNode":_(t);break;case"cdata":C(t,"oncdata",t.cdata),t.cdata="";break;case"script":C(t,"onscript",t.script),t.script="";break;default:F(t,"Max buffer length exceeded: "+i[a])}r=Math.max(r,s)}var l=e.MAX_BUFFER_LENGTH-r;t.bufferCheckPosition=l+t.position}(this);return this},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;_(e=this),""!==e.cdata&&(C(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(C(e,"onscript",e.script),e.script="")}};try{t=stream.Stream}catch(e){t=function(){}}var r=e.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function a(e,i){if(!(this instanceof a))return new a(e,i);t.apply(this),this._parser=new n(e,i),this.writable=!0,this.readable=!0;var o=this;this._parser.onend=function(){o.emit("end")},this._parser.onerror=function(e){o.emit("error",e),o._parser.error=null},this._decoder=null,r.forEach(function(e){Object.defineProperty(o,"on"+e,{get:function(){return o._parser["on"+e]},set:function(t){if(!t)return o.removeAllListeners(e),o._parser["on"+e]=t,t;o.on(e,t)},enumerable:!0,configurable:!1})})}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=string_decoder.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,i){var n=this;return n._parser["on"+e]||-1===r.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,i)};var o="[CDATA[",s="DOCTYPE",l="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",c={xml:l,xmlns:u},p=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function f(e){return'"'===e||"'"===e}function y(e){return">"===e||m(e)}function E(e,t){return e.test(t)}function T(e,t){return!E(e,t)}var x,v,A,b=0;for(var S in e.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(t){var i=e.ENTITIES[t],n="number"==typeof i?String.fromCharCode(i):i;e.ENTITIES[t]=n}),e.STATE)e.STATE[e.STATE[S]]=S;function w(e,t,i){e[t]&&e[t](i)}function C(e,t,i){e.textNode&&_(e),w(e,t,i)}function _(e){e.textNode=I(e.opt,e.textNode),e.textNode&&w(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function F(e,t){return _(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,w(e,"onerror",t),e}function M(e){return e.sawRoot&&!e.closedRoot&&N(e,"Unclosed root tag"),e.state!==b.BEGIN&&e.state!==b.BEGIN_WHITESPACE&&e.state!==b.TEXT&&F(e,"Unexpected end"),_(e),e.c="",e.closed=!0,w(e,"onend"),n.call(e,e.strict,e.opt),e}function N(e,t){if("object"!=typeof e||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&F(e,t)}function P(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,i=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(i.ns=t.ns),e.attribList.length=0,C(e,"onopentagstart",i)}function k(e,t){var i=e.indexOf(":")<0?["",e]:e.split(":"),n=i[0],r=i[1];return t&&"xmlns"===e&&(n="xmlns",r=""),{prefix:n,local:r}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=k(e.attribName,!0),i=t.prefix,n=t.local;if("xmlns"===i)if("xml"===n&&e.attribValue!==l)N(e,"xml: prefix must be bound to "+l+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==u)N(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var r=e.tag,a=e.tags[e.tags.length-1]||e;r.ns===a.ns&&(r.ns=Object.create(a.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,C(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var i=e.tag,n=k(e.tagName);i.prefix=n.prefix,i.local=n.local,i.uri=i.ns[n.prefix]||"",i.prefix&&!i.uri&&(N(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),i.uri=n.prefix);var r=e.tags[e.tags.length-1]||e;i.ns&&r.ns!==i.ns&&Object.keys(i.ns).forEach(function(t){C(e,"onopennamespace",{prefix:t,uri:i.ns[t]})});for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],l=s[0],u=s[1],c=k(l,!0),p=c.prefix,h=c.local,d=""===p?"":i.ns[p]||"",g={name:l,value:u,prefix:p,local:h,uri:d};p&&"xmlns"!==p&&!d&&(N(e,"Unbound namespace prefix: "+JSON.stringify(p)),g.uri=p),e.tag.attributes[l]=g,C(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),C(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=b.TEXT:e.state=b.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function O(e){if(!e.tagName)return N(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=b.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=b.SCRIPT);C(e,"onscript",e.script),e.script=""}var t=e.tags.length,i=e.tagName;e.strict||(i=i[e.looseCase]());for(var n=i;t--;){if(e.tags[t].name===n)break;N(e,"Unexpected close tag")}if(t<0)return N(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=b.TEXT);e.tagName=i;for(var r=e.tags.length;r-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,C(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach(function(t){var i=a.ns[t];C(e,"onclosenamespace",{prefix:t,uri:i})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=b.TEXT}function B(e){var t,i=e.entity,n=i.toLowerCase(),r="";return e.ENTITIES[i]?e.ENTITIES[i]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(i=n).charAt(0)&&("x"===i.charAt(1)?(i=i.slice(2),r=(t=parseInt(i,16)).toString(16)):(i=i.slice(1),r=(t=parseInt(i,10)).toString(10))),i=i.replace(/^0+/,""),isNaN(t)||r.toLowerCase()!==i?(N(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function R(e,t){"<"===t?(e.state=b.OPEN_WAKA,e.startTagPosition=e.position):m(t)||(N(e,"Non-whitespace before first tag."),e.textNode=t,e.state=b.TEXT)}function H(e,t){var i="";return t<e.length&&(i=e.charAt(t)),i}b=e.STATE,String.fromCodePoint||(x=String.fromCharCode,v=Math.floor,A=function(){var e,t,i=[],n=-1,r=arguments.length;if(!r)return"";for(var a="";++n<r;){var o=Number(arguments[n]);if(!isFinite(o)||o<0||o>1114111||v(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?i.push(o):(e=55296+((o-=65536)>>10),t=o%1024+56320,i.push(e,t)),(n+1===r||i.length>16384)&&(a+=x.apply(null,i),i.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)}),optionsHelper={copyOptions:function(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){"spaces"in e&&("number"==typeof e.spaces||"string"==typeof e.spaces)||(e.spaces=0)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},arrayHelper={isArray:function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},expat={on:function(){},parse:function(){}},isArray=arrayHelper.isArray,pureJsParser=!0;function validateOptions(e){return options=optionsHelper.copyOptions(e),optionsHelper.ensureFlagExists("ignoreDeclaration",options),optionsHelper.ensureFlagExists("ignoreInstruction",options),optionsHelper.ensureFlagExists("ignoreAttributes",options),optionsHelper.ensureFlagExists("ignoreText",options),optionsHelper.ensureFlagExists("ignoreComment",options),optionsHelper.ensureFlagExists("ignoreCdata",options),optionsHelper.ensureFlagExists("ignoreDoctype",options),optionsHelper.ensureFlagExists("compact",options),optionsHelper.ensureFlagExists("alwaysArray",options),optionsHelper.ensureFlagExists("alwaysChildren",options),optionsHelper.ensureFlagExists("addParent",options),optionsHelper.ensureFlagExists("trim",options),optionsHelper.ensureFlagExists("nativeType",options),optionsHelper.ensureFlagExists("sanitize",options),optionsHelper.ensureFlagExists("instructionHasAttributes",options),optionsHelper.ensureFlagExists("captureSpacesBetweenElements",options),optionsHelper.ensureKeyExists("declaration",options),optionsHelper.ensureKeyExists("instruction",options),optionsHelper.ensureKeyExists("attributes",options),optionsHelper.ensureKeyExists("text",options),optionsHelper.ensureKeyExists("comment",options),optionsHelper.ensureKeyExists("cdata",options),optionsHelper.ensureKeyExists("doctype",options),optionsHelper.ensureKeyExists("type",options),optionsHelper.ensureKeyExists("name",options),optionsHelper.ensureKeyExists("elements",options),optionsHelper.ensureKeyExists("parent",options),optionsHelper.checkFnExists("doctype",options),optionsHelper.checkFnExists("instruction",options),optionsHelper.checkFnExists("cdata",options),optionsHelper.checkFnExists("comment",options),optionsHelper.checkFnExists("text",options),optionsHelper.checkFnExists("instructionName",options),optionsHelper.checkFnExists("elementName",options),optionsHelper.checkFnExists("attributeName",options),optionsHelper.checkFnExists("attributeValue",options),optionsHelper.checkFnExists("attributes",options),options}function nativeType(e){var t=Number(e);if(!isNaN(t))return t;var i=e.toLowerCase();return"true"===i||"false"!==i&&e}function addField(e,t){var i;if(options.compact){if(!currentElement[options[e+"Key"]]&&options.alwaysArray&&(currentElement[options[e+"Key"]]=[]),currentElement[options[e+"Key"]]&&!isArray(currentElement[options[e+"Key"]])&&(currentElement[options[e+"Key"]]=[currentElement[options[e+"Key"]]]),e+"Fn"in options&&"string"==typeof t&&(t=options[e+"Fn"](t,currentElement)),"instruction"===e&&("instructionFn"in options||"instructionNameFn"in options))for(i in t)if(t.hasOwnProperty(i))if("instructionFn"in options)t[i]=options.instructionFn(t[i],i,currentElement);else{var n=t[i];delete t[i],t[options.instructionNameFn(i,n,currentElement)]=n}isArray(currentElement[options[e+"Key"]])?currentElement[options[e+"Key"]].push(t):currentElement[options[e+"Key"]]=t}else{currentElement[options.elementsKey]||(currentElement[options.elementsKey]=[]);var r={};if(r[options.typeKey]=e,"instruction"===e){for(i in t)if(t.hasOwnProperty(i))break;r[options.nameKey]="instructionNameFn"in options?options.instructionNameFn(i,t,currentElement):i,options.instructionHasAttributes?(r[options.attributesKey]=t[i][options.attributesKey],"instructionFn"in options&&(r[options.attributesKey]=options.instructionFn(r[options.attributesKey],i,currentElement))):("instructionFn"in options&&(t[i]=options.instructionFn(t[i],i,currentElement)),r[options.instructionKey]=t[i])}else e+"Fn"in options&&(t=options[e+"Fn"](t,currentElement)),r[options[e+"Key"]]=t;options.addParent&&(r[options.parentKey]=currentElement),currentElement[options.elementsKey].push(r)}}function manipulateAttributes(e){var t;if("attributesFn"in options&&e&&(e=options.attributesFn(e,currentElement)),(options.trim||"attributeValueFn"in options||"attributeNameFn"in options)&&e)for(t in e)if(e.hasOwnProperty(t)&&(options.trim&&(e[t]=e[t].trim()),"attributeValueFn"in options&&(e[t]=options.attributeValueFn(e[t],t,currentElement)),"attributeNameFn"in options)){var i=e[t];delete e[t],e[options.attributeNameFn(t,e[t],currentElement)]=i}return e}function onInstruction(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||options.instructionHasAttributes)){for(var i,n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(i=n.exec(e.body));)t[i[1]]=i[2]||i[3]||i[4];t=manipulateAttributes(t)}if("xml"===e.name.toLowerCase()){if(options.ignoreDeclaration)return;currentElement[options.declarationKey]={},Object.keys(t).length&&(currentElement[options.declarationKey][options.attributesKey]=t),options.addParent&&(currentElement[options.declarationKey][options.parentKey]=currentElement)}else{if(options.ignoreInstruction)return;options.trim&&(e.body=e.body.trim());var r={};options.instructionHasAttributes&&Object.keys(t).length?(r[e.name]={},r[e.name][options.attributesKey]=t):r[e.name]=e.body,addField("instruction",r)}}function onStartElement(e,t){var i;if("object"==typeof e&&(t=e.attributes,e=e.name),t=manipulateAttributes(t),"elementNameFn"in options&&(e=options.elementNameFn(e,currentElement)),options.compact){var n;if(i={},!options.ignoreAttributes&&t&&Object.keys(t).length)for(n in i[options.attributesKey]={},t)t.hasOwnProperty(n)&&(i[options.attributesKey][n]=t[n]);e in currentElement||!options.alwaysArray||(currentElement[e]=[]),currentElement[e]&&!isArray(currentElement[e])&&(currentElement[e]=[currentElement[e]]),isArray(currentElement[e])?currentElement[e].push(i):currentElement[e]=i}else currentElement[options.elementsKey]||(currentElement[options.elementsKey]=[]),(i={})[options.typeKey]="element",i[options.nameKey]=e,!options.ignoreAttributes&&t&&Object.keys(t).length&&(i[options.attributesKey]=t),options.alwaysChildren&&(i[options.elementsKey]=[]),currentElement[options.elementsKey].push(i);i[options.parentKey]=currentElement,currentElement=i}function onText(e){options.ignoreText||(e.trim()||options.captureSpacesBetweenElements)&&(options.trim&&(e=e.trim()),options.nativeType&&(e=nativeType(e)),options.sanitize&&(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),addField("text",e))}function onComment(e){options.ignoreComment||(options.trim&&(e=e.trim()),addField("comment",e))}function onEndElement(e){var t=currentElement[options.parentKey];options.addParent||delete currentElement[options.parentKey],currentElement=t}function onCdata(e){options.ignoreCdata||(options.trim&&(e=e.trim()),addField("cdata",e))}function onDoctype(e){options.ignoreDoctype||(e=e.replace(/^ /,""),options.trim&&(e=e.trim()),addField("doctype",e))}function onError(e){e.note=e}var xml2js=function(e,t){var i=pureJsParser?sax.parser(!0,{}):i=new expat.Parser("UTF-8"),n={};if(currentElement=n,options=validateOptions(t),pureJsParser?(i.onopentag=onStartElement,i.ontext=onText,i.oncomment=onComment,i.onclosetag=onEndElement,i.onerror=onError,i.oncdata=onCdata,i.ondoctype=onDoctype,i.onprocessinginstruction=onInstruction):(i.on("startElement",onStartElement),i.on("text",onText),i.on("comment",onComment),i.on("endElement",onEndElement),i.on("error",onError)),pureJsParser)i.write(e).close();else if(!i.parse(e))throw new Error("XML parsing error: "+i.getError());if(n[options.elementsKey]){var r=n[options.elementsKey];delete n[options.elementsKey],n[options.elementsKey]=r,delete n.text}return n};function validateOptions$1(e){var t=optionsHelper.copyOptions(e);return optionsHelper.ensureSpacesExists(t),t}var currentElement$1,currentElementName,xml2json=function(e,t){var i,n,r;return i=validateOptions$1(t),n=xml2js(e,i),r="compact"in i&&i.compact?"_parent":"parent",("addParent"in i&&i.addParent?JSON.stringify(n,function(e,t){return e===r?"_":t},i.spaces):JSON.stringify(n,null,i.spaces)).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},isArray$1=arrayHelper.isArray;function validateOptions$2(e){var t=optionsHelper.copyOptions(e);return optionsHelper.ensureFlagExists("ignoreDeclaration",t),optionsHelper.ensureFlagExists("ignoreInstruction",t),optionsHelper.ensureFlagExists("ignoreAttributes",t),optionsHelper.ensureFlagExists("ignoreText",t),optionsHelper.ensureFlagExists("ignoreComment",t),optionsHelper.ensureFlagExists("ignoreCdata",t),optionsHelper.ensureFlagExists("ignoreDoctype",t),optionsHelper.ensureFlagExists("compact",t),optionsHelper.ensureFlagExists("indentText",t),optionsHelper.ensureFlagExists("indentCdata",t),optionsHelper.ensureFlagExists("indentAttributes",t),optionsHelper.ensureFlagExists("indentInstruction",t),optionsHelper.ensureFlagExists("fullTagEmptyElement",t),optionsHelper.ensureFlagExists("noQuotesForNativeAttributes",t),optionsHelper.ensureSpacesExists(t),"number"==typeof t.spaces&&(t.spaces=Array(t.spaces+1).join(" ")),optionsHelper.ensureKeyExists("declaration",t),optionsHelper.ensureKeyExists("instruction",t),optionsHelper.ensureKeyExists("attributes",t),optionsHelper.ensureKeyExists("text",t),optionsHelper.ensureKeyExists("comment",t),optionsHelper.ensureKeyExists("cdata",t),optionsHelper.ensureKeyExists("doctype",t),optionsHelper.ensureKeyExists("type",t),optionsHelper.ensureKeyExists("name",t),optionsHelper.ensureKeyExists("elements",t),optionsHelper.checkFnExists("doctype",t),optionsHelper.checkFnExists("instruction",t),optionsHelper.checkFnExists("cdata",t),optionsHelper.checkFnExists("comment",t),optionsHelper.checkFnExists("text",t),optionsHelper.checkFnExists("instructionName",t),optionsHelper.checkFnExists("elementName",t),optionsHelper.checkFnExists("attributeName",t),optionsHelper.checkFnExists("attributeValue",t),optionsHelper.checkFnExists("attributes",t),optionsHelper.checkFnExists("fullTagEmptyElement",t),t}function writeIndentation(e,t,i){return(!i&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function writeAttributes(e,t,i){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,currentElementName,currentElement$1));var n,r,a,o,s="";for(n in e)e.hasOwnProperty(n)&&(o=t.noQuotesForNativeAttributes&&"string"!=typeof e[n]?"":'"',r=(r=""+e[n]).replace(/"/g,"&quot;"),a="attributeNameFn"in t?t.attributeNameFn(n,r,currentElementName,currentElement$1):n,s+=t.spaces&&t.indentAttributes?writeIndentation(t,i+1,!1):" ",s+=a+"="+o+("attributeValueFn"in t?t.attributeValueFn(r,n,currentElementName,currentElement$1):r)+o);return e&&Object.keys(e).length&&t.spaces&&t.indentAttributes&&(s+=writeIndentation(t,i,!1)),s}function writeDeclaration(e,t,i){return currentElement$1=e,currentElementName="xml",t.ignoreDeclaration?"":"<?xml"+writeAttributes(e[t.attributesKey],t,i)+"?>"}function writeInstruction(e,t,i){if(t.ignoreInstruction)return"";var n;for(n in e)if(e.hasOwnProperty(n))break;var r="instructionNameFn"in t?t.instructionNameFn(n,e[n],currentElementName,currentElement$1):n;if("object"==typeof e[n])return currentElement$1=e,currentElementName=r,"<?"+r+writeAttributes(e[n][t.attributesKey],t,i)+"?>";var a=e[n]?e[n]:"";return"instructionFn"in t&&(a=t.instructionFn(a,n,currentElementName,currentElement$1)),"<?"+r+(a?" "+a:"")+"?>"}function writeComment(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,currentElementName,currentElement$1):e)+"--\x3e"}function writeCdata(e,t){return t.ignoreCdata?"":"<![CDATA["+("cdataFn"in t?t.cdataFn(e,currentElementName,currentElement$1):e)+"]]>"}function writeDoctype(e,t){return t.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in t?t.doctypeFn(e,currentElementName,currentElement$1):e)+">"}function writeText(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&amp;/g,"&")).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in t?t.textFn(e,currentElementName,currentElement$1):e)}function hasContent(e,t){var i;if(e.elements&&e.elements.length)for(i=0;i<e.elements.length;++i)switch(e.elements[i][t.typeKey]){case"text":if(t.indentText)return!0;break;case"cdata":if(t.indentCdata)return!0;break;case"instruction":if(t.indentInstruction)return!0;break;case"doctype":case"comment":case"element":default:return!0}return!1}function writeElement(e,t,i){currentElement$1=e,currentElementName=e.name;var n="",r="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;n+="<"+r,e[t.attributesKey]&&(n+=writeAttributes(e[t.attributesKey],t,i));var a=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return a||(a="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),a?(n+=">",e[t.elementsKey]&&e[t.elementsKey].length&&(n+=writeElements(e[t.elementsKey],t,i+1),currentElement$1=e,currentElementName=e.name),n+=t.spaces&&hasContent(e,t)?"\n"+Array(i+1).join(t.spaces):"",n+="</"+r+">"):n+="/>",n}function writeElements(e,t,i,n){return e.reduce(function(e,r){var a=writeIndentation(t,i,n&&!e);switch(r.type){case"element":return e+a+writeElement(r,t,i);case"comment":return e+a+writeComment(r[t.commentKey],t);case"doctype":return e+a+writeDoctype(r[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?a:"")+writeCdata(r[t.cdataKey],t);case"text":return e+(t.indentText?a:"")+writeText(r[t.textKey],t);case"instruction":var o={};return o[r[t.nameKey]]=r[t.attributesKey]?r:r[t.instructionKey],e+(t.indentInstruction?a:"")+writeInstruction(o,t,i)}},"")}function hasContentCompact(e,t,i){var n;for(n in e)if(e.hasOwnProperty(n))switch(n){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||i)return!0;break;case t.cdataKey:if(t.indentCdata||i)return!0;break;case t.instructionKey:if(t.indentInstruction||i)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function writeElementCompact(e,t,i,n,r){currentElement$1=e,currentElementName=t;var a="elementNameFn"in i?i.elementNameFn(t,e):t;if(null==e)return"fullTagEmptyElementFn"in i&&i.fullTagEmptyElementFn(t,e)||i.fullTagEmptyElement?"<"+a+"></"+a+">":"<"+a+"/>";var o="";if(t){if(o+="<"+a,"object"!=typeof e)return o+=">"+writeText(e,i)+"</"+a+">";e[i.attributesKey]&&(o+=writeAttributes(e[i.attributesKey],i,n));var s=hasContentCompact(e,i,!0)||e[i.attributesKey]&&"preserve"===e[i.attributesKey]["xml:space"];if(s||(s="fullTagEmptyElementFn"in i?i.fullTagEmptyElementFn(t,e):i.fullTagEmptyElement),!s)return o+="/>";o+=">"}return o+=writeElementsCompact(e,i,n+1,!1),currentElement$1=e,currentElementName=t,t&&(o+=(r?writeIndentation(i,n,!1):"")+"</"+a+">"),o}function writeElementsCompact(e,t,i,n){var r,a,o,s="";for(a in e)if(e.hasOwnProperty(a))for(o=isArray$1(e[a])?e[a]:[e[a]],r=0;r<o.length;++r){switch(a){case t.declarationKey:s+=writeDeclaration(o[r],t,i);break;case t.instructionKey:s+=(t.indentInstruction?writeIndentation(t,i,n):"")+writeInstruction(o[r],t,i);break;case t.attributesKey:case t.parentKey:break;case t.textKey:s+=(t.indentText?writeIndentation(t,i,n):"")+writeText(o[r],t);break;case t.cdataKey:s+=(t.indentCdata?writeIndentation(t,i,n):"")+writeCdata(o[r],t);break;case t.doctypeKey:s+=writeIndentation(t,i,n)+writeDoctype(o[r],t);break;case t.commentKey:s+=writeIndentation(t,i,n)+writeComment(o[r],t);break;default:s+=writeIndentation(t,i,n)+writeElementCompact(o[r],a,t,i,hasContentCompact(o[r],t))}n=n&&!s}return s}var AdType,AdPricingModel,CreativeType,TrackingEventType,mimetype,DeliveryType,js2xml=function(e,t){t=validateOptions$2(t);var i="";return currentElement$1=e,currentElementName="_root_",t.compact?i=writeElementsCompact(e,t,0,!0):(e[t.declarationKey]&&(i+=writeDeclaration(e[t.declarationKey],t,0)),e[t.elementsKey]&&e[t.elementsKey].length&&(i+=writeElements(e[t.elementsKey],t,0,!i))),i},json2xml=function(e,t){e instanceof Buffer&&(e=e.toString());var i=null;if("string"==typeof e)try{i=JSON.parse(e)}catch(e){throw new Error("The JSON structure is invalid")}else i=e;return js2xml(i,t)},lib={xml2js:xml2js,xml2json:xml2json,js2xml:js2xml,json2xml:json2xml};!function(e){e.inline="inline",e.wrapper="wrapper"}(AdType||(AdType={})),function(e){e.cpc="cpc",e.cpm="cpm",e.cpe="cpe",e.cpv="cpv"}(AdPricingModel||(AdPricingModel={})),function(e){e.linear="linear"}(CreativeType||(CreativeType={})),function(e){e.creativeView="creativeView",e.start="start",e.firstQuartile="firstQuartile",e.midpoint="midpoint",e.thirdQuartile="thirdQuartile",e.complete="complete",e.mute="mute",e.unmute="unmute",e.pause="pause",e.rewind="rewind",e.resume="resume",e.fullscreen="fullscreen",e.exitFullscreen="exitFullscreen",e.expand="expand",e.collapse="collapse",e.acceptInvitation="acceptInvitation",e.close="close",e.skip="skip",e.progress="progress"}(TrackingEventType||(TrackingEventType={})),function(e){e.IMAGE_GIF="image/gif",e.IMAGE_PNG="image/png",e.IMAGE_JPEG="image/jpeg",e.IMAGE_JPG="image/jpg",e.VIDEO_MP4="video/mp4"}(mimetype||(mimetype={})),function(e){e[e.streaming=1]="streaming",e[e.progressive=2]="progressive"}(DeliveryType||(DeliveryType={}));var AdBreakType,TrackingEvent,AdSourceTypes,customAdSourceTypes,adTagURITypes,VMAPParser=function(){function e(e,t){void 0===t&&(t=!1),this.debugMode=!1,e&&(this.xml=e),this.debugMode=t}return e.prototype.JSON=function(e){if(!e&&!this.xml)throw new Error("XML input is required.");var t=e||this.xml,i=lib.xml2json(t,{compact:!0,spaces:4}),n=JSON.parse(i).VMAP,r=Array.isArray(n.AdBreak)?n.AdBreak:[n.AdBreak];return{version:this.getVersion(n),breaks:r.map(this.getBreaks.bind(this))}},e.prototype.getVersion=function(e){return e._attributes?e._attributes.version:null},e.prototype.getBreaks=function(e){return{breakTypes:[e._attributes?e._attributes.breakType:null],breakId:e._attributes?e._attributes.breakId:null,timeOffset:e._attributes?e._attributes.timeOffset:null,adSource:{id:e.AdSource._attributes?e.AdSource._attributes.id:null,VASTAdData:this.parseVASTAdDataAds(e.AdSource.VASTAdData.VAST),adDataType:e.AdSource.adDataType,adTagURI:e.AdSource.adTagURL,allowMultipleAds:e.AdSource.allowMultipleAds,dataType:e.AdSource._attributes?e.AdSource._attributes.dataType:null,followRedirects:e.AdSource._attributes?e.AdSource._attributes.followRedirects:null,customAdData:e.AdSource.customAdData},extensions:e.Extensions?this.parseExtensions(e.Extensions.Extension):[],repeatAfter:e._attributes.repeatAfter}},e.prototype.parseVASTAdDataAds=function(e){return{version:e._attributes?e._attributes.version:null,ads:this.parseAd(e.Ad)}},e.prototype.parseAd=function(e){return this.debugMode&&console.debug("Parse ad",e.InLine),[{id:e._attributes.id,adSystem:{version:e.InLine.AdSystem._attributes?e.InLine.AdSystem._attributes.version:null,name:e.InLine.AdSystem._cdata},adTitle:e.InLine.AdTitle._cdata,adType:AdType.inline,extensions:e.InLine.Extensions.Extension?this.parseExtensions(e.InLine.Extensions.Extension):[],creative:this.parseCreative(e.InLine.Creatives.Creative),error:e.InLine.Error?e.InLine.Error._text:null,sequence:e.InLine.Sequence?e.InLine.Sequence._text:null,description:e.InLine.Description._text,advertiser:e.InLine.Advertiser?e.InLine.Advertiser._text:null,pricing:{value:e.InLine.Pricing._text,currency:e.InLine.Pricing._attributes?e.InLine.Pricing._attributes.currency:null,model:e.InLine.Pricing._attributes?e.InLine.Pricing._attributes.model:null},survey:e.InLine.Survey._text||e.InLine.Survey._cdata,impressions:e.InLine.Impression?this.parseImpression(e.InLine.Impression):[]}]},e.prototype.parseCreative=function(e){var t=this,i=e;Array.isArray(e)||(i=[e]);var n=[];return i.forEach(function(e){var i={id:e._attributes?e._attributes.id:null,adID:e._attributes?e._attributes.AdID:null,sequence:e._attributes?e._attributes.sequence:null,skipoffset:e.Linear._attributes.skipoffset,trackings:t.parseTrackingEvents(e.Linear.TrackingEvents.Tracking),videoClicks:t.parseVideoClicks(e.Linear.VideoClicks),extensions:e.CreativeExtensions,mediaFiles:t.parseMediaFile(e.Linear.MediaFiles.MediaFile),duration:e.Linear.Duration._text,creativeType:CreativeType.linear};n.push(i)}),n},e.prototype.parseMediaFile=function(e){var t=e;Array.isArray(e)||(t=[e]);var i=[];return t.forEach(function(e){var t={id:e._attributes?e._attributes.id:null,height:e._attributes?e._attributes.height:null,width:e._attributes?e._attributes.width:null,delivery:e._attributes?e._attributes.delivery:null,codec:e._attributes?e._attributes.codec:null,mimetype:e._attributes?e._attributes.type:null,apiFramework:e._attributes?e._attributes.apiFramework:null,bitrate:e._attributes?e._attributes.bitrate:null,minBitrate:e._attributes?e._attributes.minBitrate:null,maxBitrate:e._attributes?e._attributes.maxBitrate:null,scalable:e._attributes?e._attributes.scalable:null,maintainAspectRatio:e._attributes?e._attributes.maintainAspectRatio:null,uri:e._cdata};i.push(t)}),i},e.prototype.parseTrackingEvents=function(e){var t=e;Array.isArray(e)||(t=[e]);var i=[];return t.forEach(function(e){var t={uri:e._cdata,event:e._attributes?e._attributes.event:null};i.push(t)}),i},e.prototype.parseVideoClicks=function(e){var t={clickTrackings:[],clickThrough:{uri:"",id:""}};if(e.ClickThrough&&(t.clickThrough={uri:e.ClickThrough._cdata,id:e.ClickThrough._attributes?e.ClickThrough._attributes.id:null}),e.clickTrackings){var i=e.clickTrackings;Array.isArray(e.clickTrackings)||(i=[i]),t.clickTrackings=[],i.forEach(function(e){t.clickTrackings&&t.clickTrackings.push({uri:e._cdata,id:e._attributes?e._attributes.id:null})})}if(e.customClicks){var n=e.customClicks;Array.isArray(e.customClicks)||(n=[n]),t.customClicks=[],n.forEach(function(e){t.customClicks&&t.customClicks.push({uri:e._cdata,id:e._attributes?e._attributes.id:null})})}return t},e.prototype.parseExtensions=function(e){var t=e;Array.isArray(e)||(t=[e]);var i=[];return t.forEach(function(e){var t={value:e._text,extensionType:e._attributes?e._attributes.type:null};i.push(t)}),i},e.prototype.parseImpression=function(e){this.debugMode&&console.debug("parse Impression",e._cdata);var t=e;Array.isArray(e)||(t=[e]);var i=[];return t.forEach(function(e){i.push({uri:e._cdata})}),i},e}();new VMAPParser,function(e){e.linear="linear",e.nonlinear="nonlinear",e.display="display"}(AdBreakType||(AdBreakType={})),function(e){e.breakStart="breakStart",e.breakEnd="breakEnd",e.error="error"}(TrackingEvent||(TrackingEvent={})),function(e){e.VAST3="vast3",e.custom="custom",e.adTagURI="adTagURL"}(AdSourceTypes||(AdSourceTypes={})),function(e){e.vast1="vast1",e.vast2="vast2",e.proprietary="proprietary"}(customAdSourceTypes||(customAdSourceTypes={})),function(e){e.vast1="vast1",e.vast2="vast2",e.vast3="vast3",e.proprietary="proprietary"}(adTagURITypes||(adTagURITypes={}));var ImagePlayer=function(){function e(e,t,i){this.div=e,this.src=t,this.config=i}return e.prototype.play=function(){this.config.debug&&console.log("Play image ad",this.div),this.imageWrapper=this.getImageWrapperElement(),this.div.appendChild(this.imageWrapper)},e.prototype.stop=function(){this.imageWrapper.remove(),this.div.style.position="",this.div.style.top="",this.div.style.bottom="",this.div.style.left="",this.div.style.right="",this.div.style.zIndex=""},e.prototype.getImageWrapperElement=function(){var e=document.createElement("div"),t=document.createElement("img");return t.src=this.src,t.style.width="100%",t.style.height="100%",e.appendChild(t),this.div.style.position="absolute",this.div.style.top="0px",this.div.style.bottom="0px",this.div.style.left="0px",this.div.style.right="0px",this.div.style.zIndex="100",e.id="vmap-image-wrapper",e.style.position="absolute",e.style.top="0px",e.style.bottom="0px",e.style.left="0px",e.style.right="0px",e.style.backgroundColor="#000",e},e}(),VideoPlayer=function(){function e(e,t,i,n,r){void 0===r&&(r=!1),this.lastSrc="",this.debugMode=!1,this.debugMode&&console.debug("create new instance of video player."),this.jwplayer=e,this.div=i,this.player=t,this.src=n,this.debugMode=r}return e.prototype.play=function(){var e=this;this.debugMode&&console.debug("play ad video player."),this.player.setControls(!1);var t=this.getVideoElement();this.lastSrc=t.currentSrc,this.player.stop(),setTimeout(function(){t.setAttribute("src",e.src),t.pause(),e.debugMode&&console.log(t.getAttribute("src"),{video:t}),t.play()},1)},e.prototype.skip=function(e){this.debugMode&&console.debug("skip ad video player.",this.lastSrc);var t=this.getVideoElement();t.setAttribute("src",this.lastSrc),this.player.setControls(!0),e&&(t.pause(),setTimeout(function(){t.currentTime=.1,t.play()},10))},e.prototype.getVideoElement=function(){return this.player.getContainer().getElementsByTagName("video")[0]},e}(),CONFIG={PROVIDE_LINK:"https://clickyab.com",PROVIDE_NAME:"ClickYab",SKIP_TEXT:"حذف آگهی",DEFAULT_SKIP_TIME:7,DEFAULT_AD_TEXT:"مشاهده آگهی",REMAINING_TEXT:"باقیمانده"},Controller=function(){function e(e,t,i,n,r,a,o){void 0===a&&(a=!1),void 0===o&&(o=!1),this.showControllerBtn=!0,this.isMobile=window.navigator.userAgent.match(/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i),this.clickEvent=this.isMobile?"touchstart":"click",this.linkWrapper=!1,this.debugMode=!1,o&&console.debug("Create controller overlay instance."),this.div=t,this.player=e,this.title=i,this.src=n,this.skipAfter=r,this.linkWrapper=a,this.debugMode=this.debugMode}return e.prototype.show=function(){this.debugMode&&console.debug("Show controller overlay."),this.setTimeLine({position:0,duration:0,type:"start"}),this.overlay=this.getWrapperElement(),this.div.appendChild(this.overlay)},e.prototype.remove=function(){this.debugMode&&console.debug("Remove controller overlay element."),this.div.setAttribute("style",""),this.div.innerHTML=""},e.prototype.setOnSkip=function(e){this.onSkip=e},e.prototype.setOnEnd=function(e){this.onEnd=e},e.prototype.setOnAdClick=function(e){this.onOpenAdClick=e},e.prototype.setShowControllerBtn=function(e){this.showControllerBtn=e},e.prototype.getWrapperElement=function(){var e,t=this;return this.linkWrapper?((e=document.createElement("a")).href=this.src,e.target="blank"):e=document.createElement("div"),console.log(this.linkWrapper),this.linkWrapper||(e.onclick=function(){var e=!1;"function"==typeof t.player.getState&&"playing"===t.player.getState()&&(e=!0),"function"==typeof t.player.played&&t.player.played()&&(e=!0),e?t.player.pause():t.player.play()}),this.div.style.position="absolute",this.div.style.top="0px",this.div.style.bottom="0px",this.div.style.left="0px",this.div.style.right="0px",this.div.style.zIndex="100",e.id="vmap-wrapper",e.style.position="absolute",e.style.top="0px",e.style.bottom="0px",e.style.left="0px",e.style.right="0px",e.appendChild(this.getAdLink(this.title)),this.showControllerBtn&&e.appendChild(this.getPauseButton()),this.showControllerBtn&&e.appendChild(this.getFullScreenButton()),e.appendChild(this.getProviderClick()),e.appendChild(this.getTimeLineWrapper()),e.appendChild(this.getShadow()),setTimeout(function(){e.appendChild(t.getSkipAd())},1e3*this.skipAfter),e},e.prototype.setTimeLine=function(e){var t=e.position/e.duration*100;this.playerTimeLine&&(this.playerTimeLine.style.width=t+"%");var i=this.formatDuration(e.duration-e.position+1);this.skipCountDown&&(this.skipCountDown.innerHTML=i+" "+CONFIG.REMAINING_TEXT)},e.prototype.getSkipElement=function(){var e=document.createElement("span");return this.skipCountDown=e,this.skipCountDown},e.prototype.getTimeLineElement=function(){var e=document.createElement("div");return e.style.width="0",e.style.height="4px",e.style.position="absolute",e.style.backgroundColor="rgba(238, 187, 59, 1)",e.style.zIndex="999999",e.style.borderRadius="4px",e.style.transition="all 1s linear",this.playerTimeLine=e,e},e.prototype.getPauseButton=function(){var e=this,t=document.createElement("div");return t.innerHTML='<svg width="15px" height="16px" viewBox="0 0 15 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n          \x3c!-- Generator: Sketch 44.1 (41455) - http://www.bohemiancoding.com/sketch --\x3e\n          <title>pause</title>\n          <desc>Created with Sketch.</desc>\n          <defs></defs> +\n          <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n              <g id="Artboard" transform="translate(-33.000000, -33.000000)" fill-rule="nonzero" fill="#FAFAFA">\n                  <path d="M33,33 L39,33 L39,49 L33,49 L33,33 Z M41.3266667,33 L47.3266667,33 L47.3266667,49 L41.3266667,49 L41.3266667,33 Z" id="pause"></path>\n              </g>\n          </g>\n      </svg>',t.style.fontSize=(this.isMobile,"13px"),t.style.padding=(this.isMobile,"3px 5px"),t.style.textDecoration="none",t.style.display="block",t.style.position="absolute",t.style.left="10px",t.style.bottom="0px",t.style.textAlign="center",t.style.direction="rtl",t.style.color="rgb(255, 255, 255)",t.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",t.style.zIndex="214783647",t.style.marginRight="0px",t.style.boxShadow="0px",t.onclick=function(t){t.stopPropagation(),e.player.pause()},t},e.prototype.getFullScreenButton=function(){var e=this,t=document.createElement("div");return t.innerHTML='<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n          \x3c!-- Generator: Sketch 44.1 (41455) - http://www.bohemiancoding.com/sketch --\x3e\n          <title>fullscreen</title>\n          <desc>Created with Sketch.</desc>\n          <defs></defs>\n          <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n              <g id="Artboard" transform="translate(-33.000000, -265.000000)" fill-rule="nonzero" fill="#FAFAFA">\n                  <path d="M33,275.666667 L38.3333333,275.666667 L38.3333333,281 L33,281 L33,275.666667 Z M49,265 L49,281 L41,281 L41,278.333333 L46.3333333,278.333333 L46.3333333,267.666667 L35.6666667,267.666667 L35.6666667,273 L33,273 L33,265 L49,265 Z" id="fullscreen"></path>\n              </g>\n          </g>\n      </svg>',t.style.fontSize=(this.isMobile,"13px"),t.style.padding=(this.isMobile,"3px 5px"),t.style.textDecoration="none",t.style.display="block",t.style.position="absolute",t.style.right="10px",t.style.bottom="0px",t.style.textAlign="center",t.style.direction="rtl",t.style.color="rgb(255, 255, 255)",t.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",t.style.zIndex="214783647",t.style.marginRight="0px",t.style.boxShadow="0px",t.onclick=function(t){t.stopPropagation(),e.player.setFullscreen(!e.player.getFullscreen())},t},e.prototype.getProviderClick=function(){var e=this,t=document.createElement("div");return t.innerHTML='<a style="position: relative; top: 2px; text-decoration: none" target="_blank" href="'+CONFIG.PROVIDE_LINK+'" alt="'+CONFIG.PROVIDE_NAME+'">\n      <svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n          <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n              <g id="Artboard" transform="translate(-885.000000, -64.000000)" fill-rule="nonzero" fill="#FFFFFF">\n                  <path d="M892,64 C888.134007,64 885,67.1340068 885,71 C885,74.8659932 888.134007,78 892,78 C895.865993,78 899,74.8659932 899,71 C899,69.1434846 898.262502,67.3630072 896.949747,66.0502525 C895.636993,64.7374979 893.856515,64 892,64 Z M892.875,74.71875 L891.125,74.71875 L891.125,70.34375 L892.875,70.34375 L892.875,74.71875 Z M892.875,69.03125 L891.125,69.03125 L891.125,67.28125 L892.875,67.28125 L892.875,69.03125 Z" id="info"></path>\n              </g>\n          </g>\n      </svg>\n    </a>',t.appendChild(this.getSkipElement()),t.style.fontSize=(this.isMobile,"13px"),t.style.padding=(this.isMobile,"3px 5px"),t.style.textDecoration="none",t.style.display="block",t.style.position="absolute",t.style.right="10px",t.style.bottom="45px",t.style.textAlign="center",t.style.direction="rtl",t.style.color="rgb(255, 255, 255)",t.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",t.style.zIndex="214783647",t.style.marginRight="0px",t.style.boxShadow="0px",t.style.backgroundColor="rgba(0, 0, 0, 0.7)",t.onclick=function(t){t.stopPropagation(),e.player.pause()},t},e.prototype.getAdLink=function(e){var t=this,i=document.createElement("a");return i.href=this.src,i.target="_blank",i.innerHTML='<span style="margin-left: 3px"><svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n          <title>external link</title>\n          <desc>Created with Sketch.</desc>\n          <defs></defs>\n          <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n              <g id="Artboard" transform="translate(-886.000000, -95.000000)" fill-rule="nonzero" fill="#FFFFFF">\n                  <path d="M897.397841,95 C897.704317,95 897.952696,95.2483788 897.952696,95.5548548 L897.952696,99.3770099 C897.952696,99.6834858 897.704317,99.9318646 897.397841,99.9318646 C897.091365,99.9318646 896.842987,99.6834858 896.842987,99.3770099 L896.842987,96.9558497 L891.459403,102.339566 C891.35107,102.447899 891.209025,102.502132 891.067114,102.502132 C890.925202,102.502132 890.783157,102.447899 890.674825,102.339566 C890.458026,102.122901 890.458026,101.77152 890.674825,101.554855 L896.11997,96.1097095 L893.575553,96.1097095 C893.269077,96.1097095 893.020698,95.8613307 893.020698,95.5548548 C893.020698,95.2483788 893.269077,95 893.575553,95 L897.397841,95 Z M895.478636,100.58799 C895.785111,100.58799 896.03349,100.836502 896.03349,101.142844 L896.03349,105.520387 C896.03349,106.33628 895.36977,107 894.553878,107 L887.479613,107 C886.66372,107 886,106.33628 886,105.520387 L886,98.4461224 C886,97.6302301 886.66372,96.9665097 887.479613,96.9665097 L891.872613,96.9665097 C892.179089,96.9665097 892.427467,97.2148885 892.427467,97.5213645 C892.427467,97.8278405 892.179089,98.0762192 891.872613,98.0762192 L887.479613,98.0762192 C887.279071,98.0762192 887.10971,98.2455805 887.10971,98.4461224 L887.10971,105.520387 C887.10971,105.720929 887.279071,105.89029 887.479613,105.89029 L894.553878,105.89029 C894.754419,105.89029 894.923781,105.720929 894.923781,105.520387 L894.923781,101.142844 C894.923781,100.836368 895.17216,100.58799 895.478636,100.58799 Z" id="external-link"></path>\n              </g>\n          </g>\n      </svg></span>'+(e||CONFIG.DEFAULT_AD_TEXT),i.style.fontSize=this.isMobile?"13px":"14px",i.style.padding="3px 5px",i.style.textDecoration="none",i.style.display="block",i.style.position="absolute",i.style.right="10px",i.style.bottom="75px",i.style.textAlign="center",i.style.direction="rtl",i.style.color="rgb(255, 255, 255)",i.style.backgroundColor="rgba(0, 0, 0, 0.7)",i.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",i.style.zIndex="1999999",i.style.cursor="pointer",i.style.marginRight="0px",i.style.boxShadow="0px",i.onclick=function(e){e.stopPropagation(),t.onOpenAdClick&&t.onOpenAdClick()},i},e.prototype.getSkipAd=function(){var e=this,t=document.createElement("div");return t.style.fontSize=(this.isMobile,"13px"),t.style.padding=(this.isMobile,"7px 25px 8px 25px"),t.style.textDecoration="none",t.style.display="block",t.style.position="absolute",t.style.left="-1px",t.style.bottom=(this.isMobile,"50px"),t.style.textAlign="center",t.style.direction="rtl",t.style.color="rgba(255, 255, 255,1)",t.style.backgroundColor="rgba(0, 0, 0, 0.7)",t.style.fontFamily="Tahoma, Arial, Helvetica, sans-serif",t.style.zIndex="1999999",t.style.cursor="pointer",t.style.marginRight="0px",t.style.marginRight="0px",t.style.border="1px solid rgba(255,255,255, 0.20)",t.innerHTML='<svg style="position: relative; left: 5px; top: 4px" width="16" height="16" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><polygon fill="#fff" points="2,2 28,16 2,30"></polygon><rect fill="#fff" height="28" width="4" x="26" y="2"></rect></svg>'+CONFIG.SKIP_TEXT,t.onclick=function(t){t.preventDefault(),e.debugMode&&console.debug("skip ad."),e.onSkip&&e.onSkip()},t},e.prototype.getTimeLineWrapper=function(){var e=document.createElement("div");return e.style.width="96%",e.style.margin="2%",e.style.bottom="20px",e.style.position="absolute",e.style.height="4px",e.style.borderRadius="4px",e.style.backgroundColor="rgba(255, 255, 255, 0.4)",e.appendChild(this.getTimeLineElement()),e},e.prototype.getShadow=function(){var e=document.createElement("div");return e.setAttribute("class","shadowOverlay"),e.style.position="absolute",e.style.left="0",e.style.width="100%",e.style.height="15%",e.style.bottom="0",e.style.zIndex="999998",e.style.backgroundImage="-moz-linear-gradient(-90deg, rgba(0,0,0,0.00) 0%, #000000 100%)",e.style.backgroundImage="-webkit-linear-gradient(-90deg, rgba(0,0,0,0.00) 0%, #000000 100%)",e.style.backgroundImage="-ms-linear-gradient(-90deg, rgba(0,0,0,0.00) 0%, #000000 100%)",e.style.backgroundImage="-o-linear-gradient(-90deg, rgba(0,0,0,0.00) 0%, #000000 100%)",e.style.backgroundImage="linear-gradient(-90deg, rgba(0,0,0,0.00) 0%, #000000 100%)",e},e.prototype.formatDuration=function(e){var t=parseInt(e.toString(),10).toString(),i=Math.floor(parseInt(t,10)/3600).toString(),n=Math.floor((parseInt(t,10)-3600*parseInt(i,10))/60).toString(),r=(parseInt(t,10)-3600*parseInt(i,10)-60*parseInt(n,10)).toString();return parseInt(i,10)<10&&(i="0"+i),parseInt(n,10)<10&&(n="0"+n),parseInt(r,10)<10&&(r="0"+r),n+":"+r},e}(),fingerprint2_min=createCommonjsModule(function(e){var t,i;t=commonjsGlobal,i=function(){var e=function(t){if(!(this instanceof e))return new e(t);this.options=this.extend(t,{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]}),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return e.prototype={extend:function(e,t){if(null==e)return t;for(var i in e)null!=e[i]&&t[i]!==e[i]&&(t[i]=e[i]);return t},get:function(e){var t=this,i={data:[],push:function(e){var i=e.key,n=e.value;"function"==typeof t.options.preprocessor&&(n=t.options.preprocessor(i,n)),this.data.push({key:i,value:n})}};i=this.userAgentKey(i),i=this.languageKey(i),i=this.colorDepthKey(i),i=this.pixelRatioKey(i),i=this.hardwareConcurrencyKey(i),i=this.screenResolutionKey(i),i=this.availableScreenResolutionKey(i),i=this.timezoneOffsetKey(i),i=this.sessionStorageKey(i),i=this.localStorageKey(i),i=this.indexedDbKey(i),i=this.addBehaviorKey(i),i=this.openDatabaseKey(i),i=this.cpuClassKey(i),i=this.platformKey(i),i=this.doNotTrackKey(i),i=this.pluginsKey(i),i=this.canvasKey(i),i=this.webglKey(i),i=this.adBlockKey(i),i=this.hasLiedLanguagesKey(i),i=this.hasLiedResolutionKey(i),i=this.hasLiedOsKey(i),i=this.hasLiedBrowserKey(i),i=this.touchSupportKey(i),i=this.customEntropyFunction(i),this.fontsKey(i,function(i){var n=[];t.each(i.data,function(e){var t=e.value;void 0!==e.value.join&&(t=e.value.join(";")),n.push(t)});var r=t.x64hash128(n.join("~~~"),31);return e(r,i.data)})},customEntropyFunction:function(e){return"function"==typeof this.options.customFunction&&e.push({key:"custom",value:this.options.customFunction()}),e},userAgentKey:function(e){return this.options.excludeUserAgent||e.push({key:"user_agent",value:this.getUserAgent()}),e},getUserAgent:function(){return navigator.userAgent},languageKey:function(e){return this.options.excludeLanguage||e.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),e},colorDepthKey:function(e){return this.options.excludeColorDepth||e.push({key:"color_depth",value:screen.colorDepth||-1}),e},pixelRatioKey:function(e){return this.options.excludePixelRatio||e.push({key:"pixel_ratio",value:this.getPixelRatio()}),e},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(e){return this.options.excludeScreenResolution?e:this.getScreenResolution(e)},getScreenResolution:function(e){var t;return void 0!==(t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height])&&e.push({key:"resolution",value:t}),e},availableScreenResolutionKey:function(e){return this.options.excludeAvailableScreenResolution?e:this.getAvailableScreenResolution(e)},getAvailableScreenResolution:function(e){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),void 0!==t&&e.push({key:"available_resolution",value:t}),e},timezoneOffsetKey:function(e){return this.options.excludeTimezoneOffset||e.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),e},sessionStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&e.push({key:"session_storage",value:1}),e},localStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&e.push({key:"local_storage",value:1}),e},indexedDbKey:function(e){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&e.push({key:"indexed_db",value:1}),e},addBehaviorKey:function(e){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&e.push({key:"add_behavior",value:1}),e},openDatabaseKey:function(e){return!this.options.excludeOpenDatabase&&window.openDatabase&&e.push({key:"open_database",value:1}),e},cpuClassKey:function(e){return this.options.excludeCpuClass||e.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),e},platformKey:function(e){return this.options.excludePlatform||e.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),e},doNotTrackKey:function(e){return this.options.excludeDoNotTrack||e.push({key:"do_not_track",value:this.getDoNotTrack()}),e},canvasKey:function(e){return!this.options.excludeCanvas&&this.isCanvasSupported()&&e.push({key:"canvas",value:this.getCanvasFp()}),e},webglKey:function(e){return this.options.excludeWebGL?e:this.isWebGlSupported()?(e.push({key:"webgl",value:this.getWebglFp()}),e):e},adBlockKey:function(e){return this.options.excludeAdBlock||e.push({key:"adblock",value:this.getAdBlock()}),e},hasLiedLanguagesKey:function(e){return this.options.excludeHasLiedLanguages||e.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),e},hasLiedResolutionKey:function(e){return this.options.excludeHasLiedResolution||e.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),e},hasLiedOsKey:function(e){return this.options.excludeHasLiedOs||e.push({key:"has_lied_os",value:this.getHasLiedOs()}),e},hasLiedBrowserKey:function(e){return this.options.excludeHasLiedBrowser||e.push({key:"has_lied_browser",value:this.getHasLiedBrowser()}),e},fontsKey:function(e,t){return this.options.excludeJsFonts?this.flashFontsKey(e,t):this.jsFontsKey(e,t)},flashFontsKey:function(e,t){return this.options.excludeFlashFonts?t(e):this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()?void 0===this.options.swfPath?t(e):void this.loadSwfAndDetectFonts(function(i){e.push({key:"swf_fonts",value:i.join(";")}),t(e)}):t(e)},jsFontsKey:function(e,t){var i=this;return setTimeout(function(){var n=["monospace","sans-serif","serif"],r=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];i.options.extendedJsFonts&&(r=r.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),r=r.concat(i.options.userDefinedFonts);var a=document.getElementsByTagName("body")[0],o=document.createElement("div"),s=document.createElement("div"),l={},u={},c=function(){var e=document.createElement("span");return e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="72px",e.style.lineHeight="normal",e.innerHTML="mmmmmmmmmmlli",e},p=function(e,t){var i=c();return i.style.fontFamily="'"+e+"',"+t,i},h=function(e){for(var t=!1,i=0;i<n.length;i++)if(t=e[i].offsetWidth!==l[n[i]]||e[i].offsetHeight!==u[n[i]])return t;return t},d=function(){for(var e=[],t=0,i=n.length;t<i;t++){var r=c();r.style.fontFamily=n[t],o.appendChild(r),e.push(r)}return e}();a.appendChild(o);for(var g=0,m=n.length;g<m;g++)l[n[g]]=d[g].offsetWidth,u[n[g]]=d[g].offsetHeight;var f=function(){for(var e={},t=0,i=r.length;t<i;t++){for(var a=[],o=0,l=n.length;o<l;o++){var u=p(r[t],n[o]);s.appendChild(u),a.push(u)}e[r[t]]=a}return e}();a.appendChild(s);for(var y=[],E=0,T=r.length;E<T;E++)h(f[r[E]])&&y.push(r[E]);a.removeChild(s),a.removeChild(o),e.push({key:"js_fonts",value:y}),t(e)},1)},pluginsKey:function(e){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||e.push({key:"ie_plugins",value:this.getIEPlugins()}):e.push({key:"regular_plugins",value:this.getRegularPlugins()})),e},getRegularPlugins:function(){for(var e=[],t=0,i=navigator.plugins.length;t<i;t++)e.push(navigator.plugins[t]);return this.pluginsShouldBeSorted()&&(e=e.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),this.map(e,function(e){var t=this.map(e,function(e){return[e.type,e.suffixes].join("~")}).join(",");return[e.name,e.description,t].join("::")},this)},getIEPlugins:function(){var e=[];if(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window){e=this.map(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],function(e){try{return new ActiveXObject(e),e}catch(e){return null}})}return navigator.plugins&&(e=e.concat(this.getRegularPlugins())),e},pluginsShouldBeSorted:function(){for(var e=!1,t=0,i=this.options.sortPluginsFor.length;t<i;t++){var n=this.options.sortPluginsFor[t];if(navigator.userAgent.match(n)){e=!0;break}}return e},touchSupportKey:function(e){return this.options.excludeTouchSupport||e.push({key:"touch_support",value:this.getTouchSupport()}),e},hardwareConcurrencyKey:function(e){return this.options.excludeHardwareConcurrency||e.push({key:"hardware_concurrency",value:this.getHardwareConcurrency()}),e},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasIndexedDB:function(){try{return!!window.indexedDB}catch(e){return!0}},getHardwareConcurrency:function(){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:"unknown"},getNavigatorCpuClass:function(){return navigator.cpuClass?navigator.cpuClass:"unknown"},getNavigatorPlatform:function(){return navigator.platform?navigator.platform:"unknown"},getDoNotTrack:function(){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:"unknown"},getTouchSupport:function(){var e=0,t=!1;void 0!==navigator.maxTouchPoints?e=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){}return[e,t,"ontouchstart"in window]},getCanvasFp:function(){var e=[],t=document.createElement("canvas");t.width=2e3,t.height=200,t.style.display="inline";var i=t.getContext("2d");return i.rect(0,0,10,10),i.rect(2,2,6,6),e.push("canvas winding:"+(!1===i.isPointInPath(5,5,"evenodd")?"yes":"no")),i.textBaseline="alphabetic",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",this.options.dontUseFakeFontInCanvas?i.font="11pt Arial":i.font="11pt no-real-font-123",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),i.fillStyle="rgba(102, 204, 0, 0.2)",i.font="18pt Arial",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),i.globalCompositeOperation="multiply",i.fillStyle="rgb(255,0,255)",i.beginPath(),i.arc(50,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(0,255,255)",i.beginPath(),i.arc(100,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,255,0)",i.beginPath(),i.arc(75,100,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,0,255)",i.arc(75,75,75,0,2*Math.PI,!0),i.arc(75,75,25,0,2*Math.PI,!0),i.fill("evenodd"),e.push("canvas fp:"+t.toDataURL()),e.join("~")},getWebglFp:function(){var e,t=function(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"};if(!(e=this.getWebglCanvas()))return null;var i=[],n=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,n);var r=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),n.itemSize=3,n.numItems=3;var a=e.createProgram(),o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),e.compileShader(s),e.attachShader(a,o),e.attachShader(a,s),e.linkProgram(a),e.useProgram(a),a.vertexPosAttrib=e.getAttribLocation(a,"attrVertex"),a.offsetUniform=e.getUniformLocation(a,"uniformOffset"),e.enableVertexAttribArray(a.vertexPosArray),e.vertexAttribPointer(a.vertexPosAttrib,n.itemSize,e.FLOAT,!1,0,0),e.uniform2f(a.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,n.numItems),null!=e.canvas&&i.push(e.canvas.toDataURL()),i.push("extensions:"+e.getSupportedExtensions().join(";")),i.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),i.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),i.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),i.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),i.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),i.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),i.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),i.push("webgl max anisotropy:"+function(e){var t,i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");return i?(0===(t=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT))&&(t=2),t):null}(e)),i.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),i.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),i.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),i.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),i.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),i.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),i.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),i.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),i.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),i.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),i.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),i.push("webgl red bits:"+e.getParameter(e.RED_BITS)),i.push("webgl renderer:"+e.getParameter(e.RENDERER)),i.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),i.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),i.push("webgl vendor:"+e.getParameter(e.VENDOR)),i.push("webgl version:"+e.getParameter(e.VERSION));try{var l=e.getExtension("WEBGL_debug_renderer_info");l&&(i.push("webgl unmasked vendor:"+e.getParameter(l.UNMASKED_VENDOR_WEBGL)),i.push("webgl unmasked renderer:"+e.getParameter(l.UNMASKED_RENDERER_WEBGL)))}catch(e){}return e.getShaderPrecisionFormat?(i.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),i.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),i.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),i.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),i.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),i.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),i.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),i.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),i.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),i.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),i.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),i.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),i.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),i.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),i.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),i.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),i.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),i.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),i.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),i.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),i.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),i.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),i.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),i.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),i.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),i.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),i.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),i.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),i.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),i.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),i.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),i.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),i.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),i.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),i.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),i.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax),i.join("~")):i.join("~")},getAdBlock:function(){var e=document.createElement("div");e.innerHTML="&nbsp;",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(e)}catch(e){t=!1}return t},getHasLiedLanguages:function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(e){return!0}return!1},getHasLiedResolution:function(){return screen.width<screen.availWidth||screen.height<screen.availHeight},getHasLiedOs:function(){var e,t=navigator.userAgent.toLowerCase(),i=navigator.oscpu,n=navigator.platform.toLowerCase();if(e=t.indexOf("windows phone")>=0?"Windows Phone":t.indexOf("win")>=0?"Windows":t.indexOf("android")>=0?"Android":t.indexOf("linux")>=0?"Linux":t.indexOf("iphone")>=0||t.indexOf("ipad")>=0?"iOS":t.indexOf("mac")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows Phone"!==e&&"Android"!==e&&"iOS"!==e&&"Other"!==e)return!0;if(void 0!==i){if((i=i.toLowerCase()).indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e)return!0;if(i.indexOf("linux")>=0&&"Linux"!==e&&"Android"!==e)return!0;if(i.indexOf("mac")>=0&&"Mac"!==e&&"iOS"!==e)return!0;if(0===i.indexOf("win")&&0===i.indexOf("linux")&&i.indexOf("mac")>=0&&"other"!==e)return!0}return n.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e||(n.indexOf("linux")>=0||n.indexOf("android")>=0||n.indexOf("pike")>=0)&&"Linux"!==e&&"Android"!==e||(n.indexOf("mac")>=0||n.indexOf("ipad")>=0||n.indexOf("ipod")>=0||n.indexOf("iphone")>=0)&&"Mac"!==e&&"iOS"!==e||0===n.indexOf("win")&&0===n.indexOf("linux")&&n.indexOf("mac")>=0&&"other"!==e||void 0===navigator.plugins&&"Windows"!==e&&"Windows Phone"!==e},getHasLiedBrowser:function(){var e,t=navigator.userAgent.toLowerCase(),i=navigator.productSub;if(("Chrome"===(e=t.indexOf("firefox")>=0?"Firefox":t.indexOf("opera")>=0||t.indexOf("opr")>=0?"Opera":t.indexOf("chrome")>=0?"Chrome":t.indexOf("safari")>=0?"Safari":t.indexOf("trident")>=0?"Internet Explorer":"Other")||"Safari"===e||"Opera"===e)&&"20030107"!==i)return!0;var n,r=eval.toString().length;if(37===r&&"Safari"!==e&&"Firefox"!==e&&"Other"!==e)return!0;if(39===r&&"Internet Explorer"!==e&&"Other"!==e)return!0;if(33===r&&"Chrome"!==e&&"Opera"!==e&&"Other"!==e)return!0;try{throw"a"}catch(e){try{e.toSource(),n=!0}catch(e){n=!1}}return!(!n||"Firefox"===e||"Other"===e)},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var e,t=document.createElement("canvas");try{e=t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){e=!1}return!!window.WebGLRenderingContext&&!!e},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return void 0!==window.swfobject},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var e=document.createElement("div");e.setAttribute("id",this.options.swfContainerId),document.body.appendChild(e)},loadSwfAndDetectFonts:function(e){var t="___fp_swf_loaded";window[t]=function(t){e(t)};var i=this.options.swfContainerId;this.addFlashDivNode();var n={onReady:t};swfobject.embedSWF(this.options.swfPath,i,"1","1","9.0.0",!1,n,{allowScriptAccess:"always",menu:"false"},{})},getWebglCanvas:function(){var e=document.createElement("canvas"),t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(e){}return t||(t=null),t},each:function(e,t,i){if(null!==e)if(this.nativeForEach&&e.forEach===this.nativeForEach)e.forEach(t,i);else if(e.length===+e.length){for(var n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e)==={})return}else for(var a in e)if(e.hasOwnProperty(a)&&t.call(i,e[a],a,e)==={})return},map:function(e,t,i){var n=[];return null==e?n:this.nativeMap&&e.map===this.nativeMap?e.map(t,i):(this.each(e,function(e,r,a){n[n.length]=t.call(i,e,r,a)}),n)},x64Add:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]+t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]+t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]+t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]+t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Multiply:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]*t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]*t[3],i[1]+=i[2]>>>16,i[2]&=65535,i[2]+=e[3]*t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]*t[3],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[2]*t[2],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[3]*t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Rotl:function(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])},x64LeftShift:function(e,t){return 0===(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]},x64Xor:function(e,t){return[e[0]^t[0],e[1]^t[1]]},x64Fmix:function(e){return e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[4283543511,3981806797]),e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[3301882366,444984403]),this.x64Xor(e,[0,e[0]>>>1])},x64hash128:function(e,t){t=t||0;for(var i=(e=e||"").length%16,n=e.length-i,r=[0,t],a=[0,t],o=[0,0],s=[0,0],l=[2277735313,289559509],u=[1291169091,658871167],c=0;c<n;c+=16)o=[255&e.charCodeAt(c+4)|(255&e.charCodeAt(c+5))<<8|(255&e.charCodeAt(c+6))<<16|(255&e.charCodeAt(c+7))<<24,255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24],s=[255&e.charCodeAt(c+12)|(255&e.charCodeAt(c+13))<<8|(255&e.charCodeAt(c+14))<<16|(255&e.charCodeAt(c+15))<<24,255&e.charCodeAt(c+8)|(255&e.charCodeAt(c+9))<<8|(255&e.charCodeAt(c+10))<<16|(255&e.charCodeAt(c+11))<<24],o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,u),r=this.x64Xor(r,o),r=this.x64Rotl(r,27),r=this.x64Add(r,a),r=this.x64Add(this.x64Multiply(r,[0,5]),[0,1390208809]),s=this.x64Multiply(s,u),s=this.x64Rotl(s,33),s=this.x64Multiply(s,l),a=this.x64Xor(a,s),a=this.x64Rotl(a,31),a=this.x64Add(a,r),a=this.x64Add(this.x64Multiply(a,[0,5]),[0,944331445]);switch(o=[0,0],s=[0,0],i){case 15:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(c+9)],8));case 9:s=this.x64Xor(s,[0,e.charCodeAt(c+8)]),s=this.x64Multiply(s,u),s=this.x64Rotl(s,33),s=this.x64Multiply(s,l),a=this.x64Xor(a,s);case 8:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+7)],56));case 7:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+6)],48));case 6:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+5)],40));case 5:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+4)],32));case 4:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+3)],24));case 3:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+2)],16));case 2:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(c+1)],8));case 1:o=this.x64Xor(o,[0,e.charCodeAt(c)]),o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,u),r=this.x64Xor(r,o)}return r=this.x64Xor(r,[0,e.length]),a=this.x64Xor(a,[0,e.length]),r=this.x64Add(r,a),a=this.x64Add(a,r),r=this.x64Fmix(r),a=this.x64Fmix(a),r=this.x64Add(r,a),a=this.x64Add(a,r),("00000000"+(r[0]>>>0).toString(16)).slice(-8)+("00000000"+(r[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}},e.VERSION="1.5.1",e},e.exports?e.exports=i():t.exports?t.exports=i():t.Fingerprint2=i()}),JwPlayerPlugin=function(){function e(e,t,i,n){this.adIsShowing=!1,this.startAdShowed=!1,this.endAdShowed=!1,t.debug&&console.debug("Init JwPlayer Vast Plugin Class."),this.jwPlayerIns=e,this.config=t,this.player=i,this.div=n}return e.prototype.setup=function(){var e=this;this.config.debug&&console.debug("Setting JwPlayer Vast Plugin up."),this.loadVMAP().then(function(t){e.VMAP=t,e.config.debug&&console.debug("VMAP object is loaded",t),e.player.onTime(e.timeController.bind(e)),e.player.onComplete(function(){e.onVideoEnd(!1)})})},e.prototype.timeController=function(e){this.overlayController.setTimeLine(e),!this.callCompleteViewApiLock&&this.adIsShowing&&e.position>=30&&this.callCompleteViewApi()},e.prototype.onVideoEnd=function(e){var t=this;this.overlayController.remove(),this.adIsShowing?(e||this.callCompleteViewApi(),setTimeout(function(){t.adIsShowing=!1,t.callCompleteViewApiLock=!1},2e3),"start"===this.currentAdBreak.timeOffset?this.videoPlayer?(this.videoPlayer.skip(!0),this.videoPlayer=null):this.imagePlayer&&(this.player.play(),this.imagePlayer.stop(),this.imagePlayer=null):"end"===this.currentAdBreak.timeOffset&&(this.videoPlayer?(this.videoPlayer.skip(!1),this.videoPlayer=null):this.imagePlayer&&(this.imagePlayer.stop(),this.imagePlayer=null))):!1===e&&this.showEndLinerAd()},e.prototype.callCompleteViewApi=function(){if(this.config.debug&&console.debug("Call complete view api"),!this.callCompleteViewApiLock){this.callCompleteViewApiLock=!0;var e=this.currentAdBreak.adSource.VASTAdData.ads[0].creative[0],t=e.trackings.findIndex(function(e){return"complete"===e.event});if(-1!==t&&"video/mp4"===this.currentAdBreak.adSource.VASTAdData.ads[0].creative[0].mediaFiles[0].mimetype){this.config.debug&&console.debug("Call complete view api with url: ",e.trackings[t].uri);var i=new XMLHttpRequest;i.open("get",e.trackings[t].uri),i.send()}}},e.prototype.callImpressionAdi=function(){var e=this;if(this.config.debug&&console.debug("Call impression api"),!this.callImpressionViewApiLock){this.callImpressionViewApiLock=!0,setTimeout(function(){e.callImpressionViewApiLock=!1},2e3);var t=this.currentAdBreak.adSource.VASTAdData.ads[0].impressions[0];if(t){this.config.debug&&console.debug("Call impression api with url: ",t.uri);var i=document.createElement("img");i.src=t.uri,i.style.display="none",this.div.appendChild(i)}}},e.prototype.showStartLinearAd=function(){var e=this;this.config.debug&&console.debug("show start liner ad");var t=!1;this.adIsShowing||this.startAdShowed||(this.adIsShowing=!0,this.startAdShowed=!0,this.player.getPosition()>=.1||this.VMAP.breaks.forEach(function(i){i.breakTypes[0]!==AdBreakType.linear||"start"!==i.timeOffset||t||(e.showAd(i),t=!0)}))},e.prototype.showEndLinerAd=function(){var e=this,t=!1;this.adIsShowing||this.endAdShowed||(this.adIsShowing=!0,this.endAdShowed=!0,this.VMAP.breaks.forEach(function(i){i.breakTypes[0]!==AdBreakType.linear||"end"!==i.timeOffset||t||(e.showAd(i),t=!0)}))},e.prototype.loadVMAP=function(e){void 0===e&&(e=this.config.schedule),this.config.debug&&console.debug("Try to load JwPlayer VMAP from "+e);var t=this;return new Promise(function(i,n){(new fingerprint2_min).get(function(r){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var e=new VMAPParser(a.responseText,t.config.debug).JSON();t.config.debug&&console.debug("VMAP loaded:",e),i(e)}},a.onerror=function(){throw n(),new Error("Failed to load VideoJs VMAP from "+e)},a.open("GET",e+(-1===e.indexOf("?")?"?":"&")+"tid="+r+"&p="+window.location.href+"&r="+document.referrer),a.send()})})},e.prototype.showAd=function(e){switch(this.config.debug&&console.debug("show ad break",e),this.currentAdBreak=e,e.breakTypes[0]){case AdBreakType.linear:var t=e.adSource.VASTAdData.ads[0].creative[0].mediaFiles[0];switch(t.mimetype){case mimetype.IMAGE_GIF:case mimetype.IMAGE_JPEG:case mimetype.IMAGE_JPG:case mimetype.IMAGE_PNG:this.showImagePlayer(e.adSource.VASTAdData.ads[0],e);break;case mimetype.VIDEO_MP4:this.showVideoPlayer(e.adSource.VASTAdData.ads[0],e);break;default:throw new Error('Media file type "'+t.mimetype+'" is not support.')}break;default:throw new Error('AdBreak type "'+this.VMAP.breaks[0].breakTypes[0]+'" is not support.')}},e.prototype.showImagePlayer=function(e,t){var i=this,n=e.creative[0].videoClicks.clickThrough.uri,r=t.extensions?t.extensions.findIndex(function(e){return"domain"===e.extensionType}):-1,a=t.extensions?t.extensions.findIndex(function(e){return"skip"===e.extensionType}):-1;this.imagePlayer=new ImagePlayer(this.div,e.creative[0].mediaFiles[0].uri,{}),this.imagePlayer.play(),this.player.stop(),this.overlayController=new Controller(this.player,this.div,r>-1&&t.extensions?t.extensions[r].value.toString():"",n,a>-1&&t.extensions?parseInt(t.extensions[a].value.toString(),10):1e3,!0,this.config.debug),this.overlayController.setShowControllerBtn(!1);var o=parseInt(e.creative[0].duration.replace(new RegExp(":","g"),""),10),s=0,l=setInterval(function(){if(++s-o>0)return i.onVideoEnd(!1),void(s&&clearInterval(l));i.overlayController.setTimeLine({duration:o,position:s,type:"time"})},1e3);this.overlayController.setOnSkip(function(){i.onVideoEnd(!0),i.overlayController.remove(),s&&clearInterval(l)}),this.overlayController.show(),this.callImpressionAdi()},e.prototype.showVideoPlayer=function(e,t){var i=this;this.config.debug&&console.debug("show video ad",e);var n=e.creative[0].videoClicks.clickThrough.uri,r=t.extensions?t.extensions.findIndex(function(e){return"domain"===e.extensionType}):-1,a=t.extensions?t.extensions.findIndex(function(e){return"skip"===e.extensionType}):-1;this.videoPlayer=new VideoPlayer(this.jwPlayerIns,this.player,this.div,e.creative[0].mediaFiles[0].uri),this.overlayController=new Controller(this.player,this.div,r>-1&&t.extensions?t.extensions[r].value.toString():"",n,a>-1&&t.extensions?parseInt(t.extensions[a].value.toString(),10):1e3,!1,this.config.debug),this.overlayController.setShowControllerBtn(!0),this.overlayController.setOnSkip(function(){i.onVideoEnd(!0),i.overlayController.remove()}),this.videoPlayer.play(),this.overlayController.show(),this.callImpressionAdi()},e}();function JwPlayerPluginFn(){if(jwplayer){jwplayer("").registerPlugin("vast","6.0",function(e,t,i){var n=e.getConfig(),r=new JwPlayerPlugin(jwplayer,n.advertising,e,i);e.onReady(function(){}),e.onPlay(function(){r.showStartLinearAd()}),e.onPlaylistItem(function(){r.setup()}),n.advertising.debug&&console.debug("Init JwPlayer Vast Plugin.")})}}JwPlayerPluginFn();export default JwPlayerPluginFn;
  //# sourceMappingURL=index.js.map
  