UNPKG

npaw-plugin

Version:
2 lines 619 kB
/*! For license information please see NpawPlugin.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.NpawPlugin=e():t.NpawPlugin=e()}(self,(()=>(()=>{var t={61:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>s});class s{}s.Products={VIDEO_ANALYTICS:"videoAnalytics",BALANCER:"balancer",DEVICE_ANALYTICS:"deviceAnalytics"},s.AnalyticsVariables={VIEW_CODE:"viewCode",METHOD_OPTION:"methodOption"},s.BalancerVariables={AS_ENABLED:"activeSwitchingEnabled",PROFILE_NAME:"profileName",BUCKET:"bucket",DECISION_FINISHED:"decisionFinished",LAST_USED_CDN:"lastUsedCdn",BALANCER_TRAFFIC:"balancerTraffic",BALANCER_BITRATE:"balancerBitrate"},s.Consumer={NQS:"NQS",PERSISTENT:"PERSISTENT",BLACK_HOLE:"BLACK_HOLE"},s.DeviceVariables={APP_ANALYTICS_DEVICE_STRING:"deviceString"}},108:(t,e,i)=>{"use strict";var s;i.d(e,{A:()=>r});class n{}s=n,n.VideoService={INIT:"/init",START:"/start",JOIN:"/joinTime",PAUSE:"/pause",RESUME:"/resume",SEEK:"/seek",BUFFER:"/bufferUnderrun",ERROR:"/error",STOP:"/stop",PING:"/ping",DATA_OBJECT:"/data"},n.Service=Object.assign(Object.assign({DATA:"/data",ADAPTERS:"/adapters",CONFIGURATION:"/configuration",APP_ANALYTICS_PLUGIN_LOGS:"/infinity/session/pluginLogs",VIDEO_PLUGIN_LOGS:"/infinity/video/pluginLogs"},s.VideoService),{CDN:"/cdn",VIDEO_EVENT:"/infinity/video/event",AD_INIT:"/adInit",AD_START:"/adStart",AD_JOIN:"/adJoin",AD_PAUSE:"/adPause",AD_RESUME:"/adResume",AD_BUFFER:"/adBufferUnderrun",AD_STOP:"/adStop",AD_CLICK:"/adClick",AD_ERROR:"/adError",AD_MANIFEST:"/adManifest",AD_POD_START:"/adBreakStart",AD_POD_STOP:"/adBreakStop",AD_QUARTILE:"/adQuartile",EVENT:"/infinity/session/event",SESSION_START:"/infinity/session/start",SESSION_STOP:"/infinity/session/stop",NAV:"/infinity/session/nav",BEAT:"/infinity/session/beat",OFFLINE_EVENTS:"/offlineEvents"});const r=n},245:(t,e,i)=>{var s=i(3948).extend({constructor:function(t){this.plugin=t},getAllData:function(){var t=this.getNonRandomData();return t.timestamp=this.getTimestamp(),t},getNonRandomData:function(){var t={};return t.userAgent=this.getUserAgent(),t.threads=this.getVirtualCores(),t.language=this.getLanguage(),t.langList=this.getAvailableLanguages(),t.resolution=this.getResolution(),t.colorDepth=this.getColorDepth(),t.deviceMemory=this.getMemory(),t.touchscreen=this.getTouchscreen(),t.localStorage=this.getLocalStorage(),t.sessionStorage=this.getSessionStorage(),t.cookiesAvailable=this.getCookiesAvailable(),t.flashAvailable=this.getHasFlash(),t.timeZone=this.getTimeZone(),t.plugins=this.getPluginList(),t},getUserAgent:function(){return this._getNavigatorValue("userAgent")},getVirtualCores:function(){return this._getNavigatorValue("hardwareConcurrency")},getLanguage:function(){return this._getNavigatorValue("language")},getAvailableLanguages:function(){return this._getNavigatorValue("languages")},getResolution:function(){var t=null;try{this._getNavigatorValue("screen")&&(t=navigator.screen.width.toString()+navigator.screen.height.toString())}catch(t){}return t},getColorDepth:function(){var t=null;try{this._getNavigatorValue("screen")&&(t=navigator.screen.colorDepth)}catch(t){}return t},getMemory:function(){return this._getNavigatorValue("deviceMemory")},getTouchscreen:function(){return this._getNavigatorValue("maxTouchPoints")||!1},getLocalStorage:function(){var t=!1;try{t="undefined"!=typeof localStorage}catch(t){}return t},getSessionStorage:function(){var t=!1;try{t="undefined"!=typeof sessionStorage}catch(t){}return t},getCookiesAvailable:function(){return this._getNavigatorValue("cookieEnabled")||!1},getHasFlash:function(){var t=!1;try{var e=this._getNavigatorValue("plugins");t=e&&"object"==typeof e["Shockwave Flash"]||"undefined"!=typeof window&&window.ActiveXObject&&!1!==new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){}return t},getPluginList:function(){var t=null;try{var e=this._getNavigatorValue("plugins");if(e&&0!==e.length){for(var i="",s=0;s<navigator.plugins.length;s++)i+=navigator.plugins[s].description+" "+navigator.plugins[s].filename+" "+navigator.plugins[s].name+" ";t=i}}catch(t){}return t},getTimeZone:function(){var t=null;try{t=(new Date).getTimezoneOffset().toString()}catch(t){}return t},getTimestamp:function(){return(new Date).getTime()},_navigatorCheck:function(){return"undefined"!=typeof navigator},_getNavigatorValue:function(t){var e=null;try{this._navigatorCheck()&&(e=navigator[t])}catch(t){}return e}});t.exports=s},470:(t,e,i)=>{var s=i(3948);const{default:n}=i(7276),{AnalyticsTag:r}=i(2784);var a=s.extend({constructor:function(t,e,i,s){this.prefix=t||"npaw",this.disableCookies=e,this.forceCookies=i,this.disabled=s},updateStorageOptions:function(t,e,i){this.disableCookies=t,this.forceCookies=e,this.disabled=i},isEnabled:function(){if(this.disabled)return!1;var t=!0;if(!this.forceCookies)try{localStorage.setItem(this.prefix+".test","true"),localStorage.removeItem(this.prefix+".test")}catch(e){t=!1}return t},setLocal:function(t,e){if(this.disabled)return null;var i=null;try{!this.forceCookies&&("undefined"!=typeof localStorage&&localStorage||this.disableCookies)?"undefined"!=typeof localStorage&&localStorage&&(i=localStorage.setItem(this.prefix+"."+t,e)):i=this._setCookie(this.prefix+".local."+t,e)}catch(t){n.error(r,"Npaw App Analytics needs localStorage or cookies, not supported by your browser.")}return i},getLocal:function(t){return this.disabled?null:this._localGetRemove("getItem","_getCookie",t)},removeLocal:function(t){return this.disabled?null:this._localGetRemove("removeItem","_removeCookie",t)},_localGetRemove:function(t,e,i){var s=null;try{!this.forceCookies&&("undefined"!=typeof localStorage&&localStorage||this.disableCookies)?"undefined"!=typeof localStorage&&localStorage&&(s=localStorage[t](this.prefix+"."+i)):s=this[e](this.prefix+".local."+i)}catch(t){n.error(r,"Npaw App Analytics needs localStorage or cookies, not supported by your browser.")}return s},setSession:function(t,e){if(this.disabled)return null;var i=null;try{i=!this.forceCookies&&("undefined"!=typeof sessionStorage&&sessionStorage||this.disableCookies)?sessionStorage.setItem(this.prefix+"."+t,e):this._setCookie(this.prefix+".session."+t,e)}catch(t){n.error(r,"Npaw App Analytics needs sessionStorage or cookies, not supported by your browser.")}return i},getSession:function(t){return this.disabled?null:this._sessionGetRemove("getItem","_getCookie",t)},removeSession:function(t){return this.disabled?null:this._sessionGetRemove("removeItem","_removeCookie",t)},_sessionGetRemove:function(t,e,i){var s=null;try{s=!this.forceCookies&&("undefined"!=typeof sessionStorage&&sessionStorage||this.disableCookies)?sessionStorage[t](this.prefix+"."+i):this[e](this.prefix+".session."+i)}catch(t){n.error(r,"Npaw App Analytics needs sessionStorage or cookies, not supported by your browser.")}return s},getStorages:function(t){return this.disabled?null:this.getSession(t)||this.getLocal(t)},setStorages:function(t,e){if(this.disabled)return null;this.setSession(t,e),this.setLocal(t,e)},removeStorages:function(t){if(this.disabled)return null;this.removeSession(t),this.removeLocal(t)},_setCookie:function(t,e){if("undefined"!=typeof document){var i=";";"undefined"!=typeof location&&(i+="domain="+location.host.split(".").reverse().splice(0,2).reverse().join(".")+";path=/;"),document.cookie=t+"="+e+i}},_getCookie:function(t){if("undefined"!=typeof document)for(var e=t+"=",i=decodeURIComponent(document.cookie).split(";"),s=0;s<i.length;s++){for(var n=i[s];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(e))return n.substring(e.length,n.length)}return null},_removeCookie:function(t){this._setCookie(t,"")}});t.exports=a},525:(t,e)=>{"use strict";function i(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var s=i({HTML:"text/html",isHTML:function(t){return t===s.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var s=0;s<t.length;s++)if(Object.prototype.hasOwnProperty.call(t,s)){var n=t[s];if(e.call(void 0,n,s,t))return n}},e.freeze=i,e.MIME_TYPE=s,e.NAMESPACE=n},563:t=>{t.exports={cdnName:"FASTLY",parsers:[{element:"host",headerName:"X-Served-By",regex:/([^,\s]+)$/},{element:"type",headerName:"X-Cache",regex:/([^,\s]+)$/}],parseType:function(t){switch(t){case"HIT":return 1;case"MISS":return 2;default:return 0}}}},594:(t,e,i)=>{var s=i(7086);const{default:n}=i(7276),{AnalyticsTag:r}=i(2784);var a={getPlayrate:function(){return this.flags.isPaused?0:1},getFramesPerSecond:function(){},getDroppedFrames:function(){},getThroughput:function(){},getRendition:function(){},getTitle2:function(){},getIsLive:function(){},getCdnTraffic:function(){},getP2PTraffic:function(){},getUploadTraffic:function(){},getIsP2PEnabled:function(){},getSegmentDuration:function(){},getHouseholdId:function(){},getLatency:function(){},getPacketLoss:function(){},getPacketSent:function(){},getMetrics:function(){},getAudioCodec:function(){},getVideoCodec:function(){},getURLToParse:function(){},fireSeekBegin:function(t,e,i){if(this._discardFalseBuffers(),!(this.getVideo()&&this.getVideo().getIsLive()&&this.plugin.options["content.isLive.noSeek"])&&this.flags.isJoined&&!this.flags.isSeeking){if(this.flags.isBuffering){if(!1===e)return;n.notice(r,"Converting current buffer to seek"),this.chronos.seek=this.chronos.buffer.clone(),this.chronos.buffer.reset(),this.flags.isBuffering=!1}else this.chronos.seek.start();try{this.fireEventsStruct.seek=[],i?this.fireEventsStruct.seek.push(i):this.fireEventsStruct.seek.push("undefinedEvent")}catch(t){}this.flags.isSeeking=!0,this.emit(s.Event.SEEK_BEGIN,{params:t})}},fireSeekEnd:function(t,e){if(!(this.getVideo()&&this.getVideo().getIsLive()&&this.plugin.options["content.isLive.noSeek"])&&this.flags.isJoined&&this.flags.isSeeking){try{e?this.fireEventsStruct.seek.push(e):this.fireEventsStruct.seek.push("undefinedEvent")}catch(t){}(t=t||{}).triggeredEvents=this.fireEventsStruct.seek,this.cancelSeek(),this.emit(s.Event.SEEK_END,{params:t});try{this.chronos.pause.getDeltaTime(!1)>0&&this.chronos.pause.resume()}catch(t){}}},cancelSeek:function(t){this.flags.isJoined&&this.flags.isSeeking&&(this.flags.isSeeking=!1,this.chronos.seek.stop(),this.monitor&&this.monitor.skipNextTick())},fireEvent:function(t,e,i,n){if("data"===t)this.emit(s.Event.DATA_OBJECT,{params:n});else{var r=n||{};r.name=t||"",r.dimensions=e||{},r.values=i||{},this.emit(s.Event.VIDEO_EVENT,{params:r})}},storeNewRendition:function(t){this.getVideo().triggerUpdateRendition(t)}};t.exports=a},703:t=>{t.exports={Preroll:"pre",Midroll:"mid",Postroll:"post"}},825:t=>{t.exports={WILL_SEND_LOG_PLUGIN_INIT:"will-send-log-plugin-init",WILL_SEND_LOG_PLUGIN_SET_OPTIONS:"will-send-log-plugin-set-options",WILL_SEND_LOG_PLUGIN_RECEIVE_DATA:"will-send-log-plugin-receive-data",WILL_SEND_LOG_INFINITY_BEGIN:"will-send-log-infinity-begin",WILL_SEND_LOG_INFINITY_START:"will-send-log-infinity-start",WILL_SEND_LOG_INFINITY_EVENT:"will-send-log-infinity-event",WILL_SEND_LOG_INFINITY_NAV:"will-send-log-infinity-nav",WILL_SEND_LOG_INFINITY_NEW_SESSION:"will-send-log-infinity-new-session"}},1048:(t,e,i)=>{"use strict";const s=i(7991),n=i(9318),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=d,e.IS=50;const a=2147483647;function o(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return c(t,e,i)}function c(t,e,i){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const i=0|g(t,e);let s=o(i);const n=s.write(t,e);return n!==i&&(s=s.slice(0,n)),s}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return p(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return p(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const s=t.valueOf&&t.valueOf();if(null!=s&&s!==t)return d.from(s,e,i);const n=function(t){if(d.isBuffer(t)){const e=0|f(t.length),i=o(e);return 0===i.length||t.copy(i,0,0,e),i}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?o(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return d.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),o(t<0?0:0|f(t))}function h(t){const e=t.length<0?0:0|f(t.length),i=o(e);for(let s=0;s<e;s+=1)i[s]=255&t[s];return i}function p(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let s;return s=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i),Object.setPrototypeOf(s,d.prototype),s}function f(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function g(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const i=t.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===i)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Y(t).length;default:if(n)return s?-1:W(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,i){let s=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,i);case"utf8":case"utf-8":return I(this,e,i);case"ascii":return P(this,e,i);case"latin1":case"binary":return R(this,e,i);case"base64":return _(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,i);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function v(t,e,i){const s=t[e];t[e]=t[i],t[i]=s}function y(t,e,i,s,n){if(0===t.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),Q(i=+i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof e&&(e=d.from(e,s)),d.isBuffer(e))return 0===e.length?-1:T(t,e,i,s,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):T(t,[e],i,s,n);throw new TypeError("val must be string, number or Buffer")}function T(t,e,i,s,n){let r,a=1,o=t.length,d=e.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(t.length<2||e.length<2)return-1;a=2,o/=2,d/=2,i/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){let s=-1;for(r=i;r<o;r++)if(c(t,r)===c(e,-1===s?0:r-s)){if(-1===s&&(s=r),r-s+1===d)return s*a}else-1!==s&&(r-=r-s),s=-1}else for(i+d>o&&(i=o-d),r=i;r>=0;r--){let i=!0;for(let s=0;s<d;s++)if(c(t,r+s)!==c(e,s)){i=!1;break}if(i)return r}return-1}function S(t,e,i,s){i=Number(i)||0;const n=t.length-i;s?(s=Number(s))>n&&(s=n):s=n;const r=e.length;let a;for(s>r/2&&(s=r/2),a=0;a<s;++a){const s=parseInt(e.substr(2*a,2),16);if(Q(s))return a;t[i+a]=s}return a}function E(t,e,i,s){return z(W(e,t.length-i),t,i,s)}function b(t,e,i,s){return z(function(t){const e=[];for(let i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,s)}function A(t,e,i,s){return z(Y(e),t,i,s)}function w(t,e,i,s){return z(function(t,e){let i,s,n;const r=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),s=i>>8,n=i%256,r.push(n),r.push(s);return r}(e,t.length-i),t,i,s)}function _(t,e,i){return 0===e&&i===t.length?s.fromByteArray(t):s.fromByteArray(t.slice(e,i))}function I(t,e,i){i=Math.min(t.length,i);const s=[];let n=e;for(;n<i;){const e=t[n];let r=null,a=e>239?4:e>223?3:e>191?2:1;if(n+a<=i){let i,s,o,d;switch(a){case 1:e<128&&(r=e);break;case 2:i=t[n+1],128==(192&i)&&(d=(31&e)<<6|63&i,d>127&&(r=d));break;case 3:i=t[n+1],s=t[n+2],128==(192&i)&&128==(192&s)&&(d=(15&e)<<12|(63&i)<<6|63&s,d>2047&&(d<55296||d>57343)&&(r=d));break;case 4:i=t[n+1],s=t[n+2],o=t[n+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(d=(15&e)<<18|(63&i)<<12|(63&s)<<6|63&o,d>65535&&d<1114112&&(r=d))}}null===r?(r=65533,a=1):r>65535&&(r-=65536,s.push(r>>>10&1023|55296),r=56320|1023&r),s.push(r),n+=a}return function(t){const e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);let i="",s=0;for(;s<e;)i+=String.fromCharCode.apply(String,t.slice(s,s+=N));return i}(s)}d.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),d.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(t,e,i){return c(t,e,i)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(t,e,i){return function(t,e,i){return l(t),t<=0?o(t):void 0!==e?"string"==typeof i?o(t).fill(e,i):o(t).fill(e):o(t)}(t,e,i)},d.allocUnsafe=function(t){return u(t)},d.allocUnsafeSlow=function(t){return u(t)},d.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==d.prototype},d.compare=function(t,e){if(K(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),K(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(t)||!d.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let i=t.length,s=e.length;for(let n=0,r=Math.min(i,s);n<r;++n)if(t[n]!==e[n]){i=t[n],s=e[n];break}return i<s?-1:s<i?1:0},d.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return d.alloc(0);let i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;const s=d.allocUnsafe(e);let n=0;for(i=0;i<t.length;++i){let e=t[i];if(K(e,Uint8Array))n+e.length>s.length?(d.isBuffer(e)||(e=d.from(e)),e.copy(s,n)):Uint8Array.prototype.set.call(s,e,n);else{if(!d.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(s,n)}n+=e.length}return s},d.byteLength=g,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)v(this,e,e+1);return this},d.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},d.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},d.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):m.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(t){if(!d.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===d.compare(this,t)},d.prototype.inspect=function(){let t="";const i=e.IS;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},r&&(d.prototype[r]=d.prototype.inspect),d.prototype.compare=function(t,e,i,s,n){if(K(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===s&&(s=0),void 0===n&&(n=this.length),e<0||i>t.length||s<0||n>this.length)throw new RangeError("out of range index");if(s>=n&&e>=i)return 0;if(s>=n)return-1;if(e>=i)return 1;if(this===t)return 0;let r=(n>>>=0)-(s>>>=0),a=(i>>>=0)-(e>>>=0);const o=Math.min(r,a),c=this.slice(s,n),l=t.slice(e,i);for(let t=0;t<o;++t)if(c[t]!==l[t]){r=c[t],a=l[t];break}return r<a?-1:a<r?1:0},d.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},d.prototype.indexOf=function(t,e,i){return y(this,t,e,i,!0)},d.prototype.lastIndexOf=function(t,e,i){return y(this,t,e,i,!1)},d.prototype.write=function(t,e,i,s){if(void 0===e)s="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)s=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===s&&(s="utf8")):(s=i,i=void 0)}const n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let r=!1;for(;;)switch(s){case"hex":return S(this,t,e,i);case"utf8":case"utf-8":return E(this,t,e,i);case"ascii":case"latin1":case"binary":return b(this,t,e,i);case"base64":return A(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,i);default:if(r)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),r=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function P(t,e,i){let s="";i=Math.min(t.length,i);for(let n=e;n<i;++n)s+=String.fromCharCode(127&t[n]);return s}function R(t,e,i){let s="";i=Math.min(t.length,i);for(let n=e;n<i;++n)s+=String.fromCharCode(t[n]);return s}function D(t,e,i){const s=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>s)&&(i=s);let n="";for(let s=e;s<i;++s)n+=J[t[s]];return n}function L(t,e,i){const s=t.slice(e,i);let n="";for(let t=0;t<s.length-1;t+=2)n+=String.fromCharCode(s[t]+256*s[t+1]);return n}function C(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,s,n,r){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<r)throw new RangeError('"value" argument is out of bounds');if(i+s>t.length)throw new RangeError("Index out of range")}function B(t,e,i,s,n){X(e,s,n,t,i,7);let r=Number(e&BigInt(4294967295));t[i++]=r,r>>=8,t[i++]=r,r>>=8,t[i++]=r,r>>=8,t[i++]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a,i}function x(t,e,i,s,n){X(e,s,n,t,i,7);let r=Number(e&BigInt(4294967295));t[i+7]=r,r>>=8,t[i+6]=r,r>>=8,t[i+5]=r,r>>=8,t[i+4]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a>>=8,t[i+2]=a,a>>=8,t[i+1]=a,a>>=8,t[i]=a,i+8}function k(t,e,i,s,n,r){if(i+s>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function M(t,e,i,s,r){return e=+e,i>>>=0,r||k(t,0,i,4),n.write(t,e,i,s,23,4),i+4}function V(t,e,i,s,r){return e=+e,i>>>=0,r||k(t,0,i,8),n.write(t,e,i,s,52,8),i+8}d.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);const s=this.subarray(t,e);return Object.setPrototypeOf(s,d.prototype),s},d.prototype.readUintLE=d.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||C(t,e,this.length);let s=this[t],n=1,r=0;for(;++r<e&&(n*=256);)s+=this[t+r]*n;return s},d.prototype.readUintBE=d.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||C(t,e,this.length);let s=this[t+--e],n=1;for(;e>0&&(n*=256);)s+=this[t+--e]*n;return s},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||G(t,this.length-8);const s=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(s)+(BigInt(n)<<BigInt(32))})),d.prototype.readBigUInt64BE=$((function(t){H(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||G(t,this.length-8);const s=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(s)<<BigInt(32))+BigInt(n)})),d.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||C(t,e,this.length);let s=this[t],n=1,r=0;for(;++r<e&&(n*=256);)s+=this[t+r]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},d.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||C(t,e,this.length);let s=e,n=1,r=this[t+--s];for(;s>0&&(n*=256);)r+=this[t+--s]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*e)),r},d.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},d.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||G(t,this.length-8);const s=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(s)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),d.prototype.readBigInt64BE=$((function(t){H(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||G(t,this.length-8);const s=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(s)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+i)})),d.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),n.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),n.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),n.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),n.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,e,i,s){t=+t,e>>>=0,i>>>=0,s||O(this,t,e,i,Math.pow(2,8*i)-1,0);let n=1,r=0;for(this[e]=255&t;++r<i&&(n*=256);)this[e+r]=t/n&255;return e+i},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(t,e,i,s){t=+t,e>>>=0,i>>>=0,s||O(this,t,e,i,Math.pow(2,8*i)-1,0);let n=i-1,r=1;for(this[e+n]=255&t;--n>=0&&(r*=256);)this[e+n]=t/r&255;return e+i},d.prototype.writeUint8=d.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigUInt64LE=$((function(t,e=0){return B(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=$((function(t,e=0){return x(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(t,e,i,s){if(t=+t,e>>>=0,!s){const s=Math.pow(2,8*i-1);O(this,t,e,i,s-1,-s)}let n=0,r=1,a=0;for(this[e]=255&t;++n<i&&(r*=256);)t<0&&0===a&&0!==this[e+n-1]&&(a=1),this[e+n]=(t/r|0)-a&255;return e+i},d.prototype.writeIntBE=function(t,e,i,s){if(t=+t,e>>>=0,!s){const s=Math.pow(2,8*i-1);O(this,t,e,i,s-1,-s)}let n=i-1,r=1,a=0;for(this[e+n]=255&t;--n>=0&&(r*=256);)t<0&&0===a&&0!==this[e+n+1]&&(a=1),this[e+n]=(t/r|0)-a&255;return e+i},d.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},d.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigInt64LE=$((function(t,e=0){return B(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=$((function(t,e=0){return x(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(t,e,i){return M(this,t,e,!0,i)},d.prototype.writeFloatBE=function(t,e,i){return M(this,t,e,!1,i)},d.prototype.writeDoubleLE=function(t,e,i){return V(this,t,e,!0,i)},d.prototype.writeDoubleBE=function(t,e,i){return V(this,t,e,!1,i)},d.prototype.copy=function(t,e,i,s){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),s||0===s||(s=this.length),e>=t.length&&(e=t.length),e||(e=0),s>0&&s<i&&(s=i),s===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),t.length-e<s-i&&(s=t.length-e+i);const n=s-i;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,i,s):Uint8Array.prototype.set.call(t,this.subarray(i,s),e),n},d.prototype.fill=function(t,e,i,s){if("string"==typeof t){if("string"==typeof e?(s=e,e=0,i=this.length):"string"==typeof i&&(s=i,i=this.length),void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!d.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(1===t.length){const e=t.charCodeAt(0);("utf8"===s&&e<128||"latin1"===s)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;let n;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(n=e;n<i;++n)this[n]=t;else{const r=d.isBuffer(t)?t:d.from(t,s),a=r.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<i-e;++n)this[n+e]=r[n%a]}return this};const U={};function q(t,e,i){U[t]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",i=t.length;const s="-"===t[0]?1:0;for(;i>=s+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function X(t,e,i,s,n,r){if(t>i||t<e){const s="bigint"==typeof e?"n":"";let n;throw n=r>3?0===e||e===BigInt(0)?`>= 0${s} and < 2${s} ** ${8*(r+1)}${s}`:`>= -(2${s} ** ${8*(r+1)-1}${s}) and < 2 ** ${8*(r+1)-1}${s}`:`>= ${e}${s} and <= ${i}${s}`,new U.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,i){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||G(e,t.length-(i+1))}(s,n,r)}function H(t,e){if("number"!=typeof t)throw new U.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,i){if(Math.floor(t)!==t)throw H(t,i),new U.ERR_OUT_OF_RANGE(i||"offset","an integer",t);if(e<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,i){let s=`The value of "${t}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=F(String(i)):"bigint"==typeof i&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=F(n)),n+="n"),s+=` It must be ${e}. Received ${n}`,s}),RangeError);const j=/[^+/0-9A-Za-z-_]/g;function W(t,e){let i;e=e||1/0;const s=t.length;let n=null;const r=[];for(let a=0;a<s;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(a+1===s){(e-=3)>-1&&r.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&r.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&r.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;r.push(i)}else if(i<2048){if((e-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function Y(t){return s.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,i,s){let n;for(n=0;n<s&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const s=16*i;for(let n=0;n<16;++n)e[s+n]=t[i]+t[n]}return e}();function $(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},1083:t=>{t.exports={ClientSide:"csai",ServerSide:"ssai"}},1129:(t,e,i)=>{var s=i(525),n=s.find,r=s.NAMESPACE;function a(t){return""!==t}function o(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function d(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(a):[]}(t);return Object.keys(e.reduce(o,{}))}function c(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function l(t,e){var i=t.prototype;if(!(i instanceof e)){function s(){}s.prototype=e.prototype,c(i,s=new s),t.prototype=i=s}i.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),i.constructor=t)}var u={},h=u.ELEMENT_NODE=1,p=u.ATTRIBUTE_NODE=2,f=u.TEXT_NODE=3,g=u.CDATA_SECTION_NODE=4,m=u.ENTITY_REFERENCE_NODE=5,v=u.ENTITY_NODE=6,y=u.PROCESSING_INSTRUCTION_NODE=7,T=u.COMMENT_NODE=8,S=u.DOCUMENT_NODE=9,E=u.DOCUMENT_TYPE_NODE=10,b=u.DOCUMENT_FRAGMENT_NODE=11,A=u.NOTATION_NODE=12,w={},_={},I=(w.INDEX_SIZE_ERR=(_[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(_[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(_[3]="Hierarchy request error",3)),N=(w.WRONG_DOCUMENT_ERR=(_[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(_[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(_[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(_[7]="No modification allowed",7),w.NOT_FOUND_ERR=(_[8]="Not found",8)),P=(w.NOT_SUPPORTED_ERR=(_[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(_[10]="Attribute in use",10));function R(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,_[t]),this.message=_[t],Error.captureStackTrace&&Error.captureStackTrace(this,R);return i.code=t,e&&(this.message=this.message+": "+e),i}function D(){}function L(t,e){this._node=t,this._refresh=e,C(this)}function C(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(yt(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var s=i.length;s in t;s++)Object.prototype.hasOwnProperty.call(t,s)&&delete t[s];c(i,t),t._inc=e}}function O(){}function B(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function x(t,e,i,s){if(s?e[B(e,s)]=i:e[e.length++]=i,t){i.ownerElement=t;var n=t.ownerDocument;n&&(s&&X(n,t,s),function(t,e,i){t&&t._inc++,i.namespaceURI===r.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(n,t,i))}}function k(t,e,i){var s=B(e,i);if(!(s>=0))throw new R(N,new Error(t.tagName+"@"+i));for(var n=e.length-1;s<n;)e[s]=e[++s];if(e.length=n,t){var r=t.ownerDocument;r&&(X(r,t,i),i.ownerElement=null)}}function M(){}function V(){}function U(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function q(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(q(t,e))return!0}while(t=t.nextSibling)}function F(){this.ownerDocument=this}function X(t,e,i,s){t&&t._inc++,i.namespaceURI===r.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function H(t,e,i){if(t&&t._inc){t._inc++;var s=e.childNodes;if(i)s[s.length++]=i;else{for(var n=e.firstChild,r=0;n;)s[r++]=n,n=n.nextSibling;s.length=r,delete s[s.length]}}}function G(t,e){var i=e.previousSibling,s=e.nextSibling;return i?i.nextSibling=s:t.firstChild=s,s?s.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,H(t.ownerDocument,t),e}function j(t){return t&&t.nodeType===V.DOCUMENT_TYPE_NODE}function W(t){return t&&t.nodeType===V.ELEMENT_NODE}function Y(t){return t&&t.nodeType===V.TEXT_NODE}function z(t,e){var i=t.childNodes||[];if(n(i,W)||j(e))return!1;var s=n(i,j);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function K(t,e){var i=t.childNodes||[];if(n(i,(function(t){return W(t)&&t!==e})))return!1;var s=n(i,j);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function Q(t,e,i){var s=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===V.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,Y))throw new R(I,"More than one element or text in fragment");if(1===a.length&&!z(t,i))throw new R(I,"Element in fragment can not be inserted before doctype")}if(W(e)&&!z(t,i))throw new R(I,"Only one element can be added and only after doctype");if(j(e)){if(n(s,j))throw new R(I,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new R(I,"Doctype can only be inserted before an element");if(!i&&o)throw new R(I,"Doctype can not be appended since element is present")}}function J(t,e,i){var s=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===V.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,Y))throw new R(I,"More than one element or text in fragment");if(1===a.length&&!K(t,i))throw new R(I,"Element in fragment can not be inserted before doctype")}if(W(e)&&!K(t,i))throw new R(I,"Only one element can be added and only after doctype");if(j(e)){if(n(s,(function(t){return j(t)&&t!==i})))throw new R(I,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new R(I,"Doctype can only be inserted before an element")}}function $(t,e,i,s){(function(t,e,i){if(!function(t){return t&&(t.nodeType===V.DOCUMENT_NODE||t.nodeType===V.DOCUMENT_FRAGMENT_NODE||t.nodeType===V.ELEMENT_NODE)}(t))throw new R(I,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new R(N,"child not in parent");if(!function(t){return t&&(W(t)||Y(t)||j(t)||t.nodeType===V.DOCUMENT_FRAGMENT_NODE||t.nodeType===V.COMMENT_NODE||t.nodeType===V.PROCESSING_INSTRUCTION_NODE)}(e)||j(e)&&t.nodeType!==V.DOCUMENT_NODE)throw new R(I,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)})(t,e,i),t.nodeType===V.DOCUMENT_NODE&&(s||Q)(t,e,i);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===b){var r=e.firstChild;if(null==r)return e;var a=e.lastChild}else r=a=e;var o=i?i.previousSibling:t.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:t.firstChild=r,null==i?t.lastChild=a:i.previousSibling=a;do{r.parentNode=t}while(r!==a&&(r=r.nextSibling));return H(t.ownerDocument||t,t),e.nodeType==b&&(e.firstChild=e.lastChild=null),e}function Z(){this._nsMap={}}function tt(){}function et(){}function it(){}function st(){}function nt(){}function rt(){}function at(){}function ot(){}function dt(){}function ct(){}function lt(){}function ut(){}function ht(t,e){var i=[],s=9==this.nodeType&&this.documentElement||this,n=s.prefix,r=s.namespaceURI;if(r&&null==n&&null==(n=s.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return gt(this,i,t,e,a),i.join("")}function pt(t,e,i){var s=t.prefix||"",n=t.namespaceURI;if(!n)return!1;if("xml"===s&&n===r.XML||n===r.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===s)return o.namespace!==n}return!0}function ft(t,e,i){t.push(" ",e,'="',i.replace(/[<&"]/g,U),'"')}function gt(t,e,i,s,n){if(n||(n=[]),s){if(!(t=s(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case h:var a=t.attributes,o=a.length,d=t.firstChild,c=t.tagName,l=c;if(!(i=r.isHTML(t.namespaceURI)||i)&&!t.prefix&&t.namespaceURI){for(var u,v=0;v<a.length;v++)if("xmlns"===a.item(v).name){u=a.item(v).value;break}if(!u)for(var A=n.length-1;A>=0;A--)if(""===(w=n[A]).prefix&&w.namespace===t.namespaceURI){u=w.namespace;break}if(u!==t.namespaceURI)for(A=n.length-1;A>=0;A--){var w;if((w=n[A]).namespace===t.namespaceURI){w.prefix&&(l=w.prefix+":"+c);break}}}e.push("<",l);for(var _=0;_<o;_++)"xmlns"==(I=a.item(_)).prefix?n.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&n.push({prefix:"",namespace:I.value});for(_=0;_<o;_++){var I,N,P;pt(I=a.item(_),0,n)&&(ft(e,(N=I.prefix||"")?"xmlns:"+N:"xmlns",P=I.namespaceURI),n.push({prefix:N,namespace:P})),gt(I,e,i,s,n)}if(c===l&&pt(t,0,n)&&(ft(e,(N=t.prefix||"")?"xmlns:"+N:"xmlns",P=t.namespaceURI),n.push({prefix:N,namespace:P})),d||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(c)){if(e.push(">"),i&&/^script$/i.test(c))for(;d;)d.data?e.push(d.data):gt(d,e,i,s,n.slice()),d=d.nextSibling;else for(;d;)gt(d,e,i,s,n.slice()),d=d.nextSibling;e.push("</",l,">")}else e.push("/>");return;case S:case b:for(d=t.firstChild;d;)gt(d,e,i,s,n.slice()),d=d.nextSibling;return;case p:return ft(e,t.name,t.value);case f:return e.push(t.data.replace(/[<&]/g,U).replace(/]]>/g,"]]&gt;"));case g:return e.push("<![CDATA[",t.data,"]]>");case T:return e.push("\x3c!--",t.data,"--\x3e");case E:var R=t.publicId,D=t.systemId;if(e.push("<!DOCTYPE ",t.name),R)e.push(" PUBLIC ",R),D&&"."!=D&&e.push(" ",D),e.push(">");else if(D&&"."!=D)e.push(" SYSTEM ",D,">");else{var L=t.internalSubset;L&&e.push(" [",L,"]"),e.push(">")}return;case y:return e.push("<?",t.target," ",t.data,"?>");case m:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function mt(t,e,i){var s;switch(e.nodeType){case h:(s=e.cloneNode(!1)).ownerDocument=t;case b:break;case p:i=!0}if(s||(s=e.cloneNode(!1)),s.ownerDocument=t,s.parentNode=null,i)for(var n=e.firstChild;n;)s.appendChild(mt(t,n,i)),n=n.nextSibling;return s}function vt(t,e,i){var s=new e.constructor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];"object"!=typeof r&&r!=s[n]&&(s[n]=r)}switch(e.childNodes&&(s.childNodes=new D),s.ownerDocument=t,s.nodeType){case h:var a=e.attributes,o=s.attributes=new O,d=a.length;o._ownerElement=s;for(var c=0;c<d;c++)s.setAttributeNode(vt(t,a.item(c),!0));break;case p:i=!0}if(i)for(var l=e.firstChild;l;)s.appendChild(vt(t,l,i)),l=l.nextSibling;return s}function yt(t,e,i){t[e]=i}w.INVALID_STATE_ERR=(_[11]="Invalid state",11),w.SYNTAX_ERR=(_[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(_[13]="Invalid modification",13),w.NAMESPACE_ERR=(_[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(_[15]="Invalid access",15),R.prototype=Error.prototype,c(w,R),D.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],s=0;s<this.length;s++)gt(this[s],i,t,e);return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},L.prototype.item=function(t){return C(this),this[t]||null},l(L,D),O.prototype={length:0,item:D.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var i=this[e];if(i.nodeName==t)return i}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new R(P);var i=this.getNamedItem(t.nodeName);return x(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new R(P);return e=this.getNamedItemNS(t.namespaceURI,t.localName),x(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return k(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return k(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var s=this[i];if(s.localName==e&&s.namespaceURI==t)return s}return null}},M.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,i){var s=new F;if(s.implementation=this,s.childNodes=new D,s.doctype=i||null,i&&s.appendChild(i),e){var n=s.createElementNS(t,e);s.appendChild(n)}return s},createDocumentType:function(t,e,i){var s=new rt;return s.name=t,s.nodeName=t,s.publicId=e||"",s.systemId=i||"",s}},V.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return $(this,t,e)},replaceChild:function(t,e){$(this,t,e,J),e&&this.removeChild(e)},removeChild:function(t){return G(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return vt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==f&&t.nodeType==f?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===t)return s;e=e.nodeType==p?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&t in i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==p?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},c(u,V),c(u,V.prototype),F.prototype={nodeName:"#document",nodeType:S,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==b){for(var i=t.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,e),i=s}return t}return $(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===h&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),G(this,t)},replaceChild:function(t,e){$(this,t,e,J),t.ownerDocument=this,e&&this.removeChild(e),W(t)&&(this.documentElement=t)},importNode:function(t,e){return mt(this,t,e)},getElementById:function(t){var e=null;return q(this.documentElement,(function(i){if(i.nodeType==h&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=d(t);return new L(this,(function(i){var s=[];return e.length>0&&q(i.documentElement,(function(n){if(n!==i&&n.nodeType===h){var r=n.getAttribute("class");if(r){var a=t===r;if(!a){var o=d(r);a=e.every((c=o,function(t){return c&&-1!==c.indexOf(t)}))}a&&s.push(n)}}var c})),s}))},createElement:function(t){var e=new Z;return e.ownerDocument=this,e.node