// ==UserScript== // @name Purple Adblocker // @source https://github.com/arthurbolsoni/Purple-adblock // @version 2.6.7 // @description Per aspera ad astra // @author ArthurBolzoni // @downloadURL https://raw.githubusercontent.com/arthurbolsoni/Purple-adblock/main/platform/tampermonkey/dist/purpleadblocker.user.js // @updateURL https://raw.githubusercontent.com/arthurbolsoni/Purple-adblock/main/platform/tampermonkey/dist/purpleadblocker.user.js // @match *://*.twitch.tv/* // @run-at document-start // @grant none // ==/UserScript== const u='var t=Object.defineProperty,e=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s);const i=(t,e=null)=>(i,s)=>{self.routerList||(self.routerList=[]),self.routerList.push({propertyKey:s,match:t,ignore:e})},s=t=>(e,i)=>{self.addEventListener("message",(e=>{var s;(null==(s=null==e?void 0:e.data)?void 0:s.funcName)==t&&self.appController[i](e.data)}))};var r=(t=>(t.PICTURE="picture-by-picture",t.THUNDERDOME="thunderdome",t.EMBED="embed",t.FRONTPAGE="frontpage",t.SITE="site",t.EXTERNAL="external",t.DNS="dns",t))(r||{}),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?n(e,i):e,u=t.length-1;u>=0;u--)(r=t[u])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&a(e,i,o),o};let u=class{constructor(t){e(this,"getSettings",(()=>self.postMessage({type:"getSettings"}))),this.appService=t,this.getSettings()}async setIntegrity(t){this.appService.setIntegrityToken(JSON.parse(t.value).token)}async onChannel(t,e){const i=await self.request(t,e);if(!i.ok)return console.log("Error on channel load"),i;const s=await i.text(),r=/hls\\/(.*).m3u8/gm.exec(t)||[];return await this.appService.setChannel(r[1]),new Response(s)}async onFetch(t,e){const i=await(await request(t,e)).text(),s=await this.appService.onFetch(i);return new Response(s)}async onChannelPicture(t,e){const i=await self.request(t,e);if(!i.ok)return console.log("Error on channel load"),i;const s=await i.text();return await this.appService.currentStream().setStreamAccess(s,r.PICTURE),console.log("picture-by-picture",s),new Response}async setSettings(t){this.appService.setSettings(t)}async setQuality(t){this.appService.quality=t.value}};o([s("setIntegrity")],u.prototype,"setIntegrity",1),o([i("usher.ttvnw.net/api/channel/hls/","picture-by-picture")],u.prototype,"onChannel",1),o([i("ttvnw.net/v1/playlist/")],u.prototype,"onFetch",1),o([i("picture-by-picture")],u.prototype,"onChannelPicture",1),o([s("setSettings")],u.prototype,"setSettings",1),o([s("setQuality")],u.prototype,"setQuality",1),u=o([t=>{}],u);class l{constructor(t){this.integrityToken=t}async playbackAccessToken(t,e,i){const s={operationName:"PlaybackAccessToken",variables:{isLive:!0,login:t,isVod:!1,vodID:"",playerType:e},extensions:{persistedQuery:{version:1,sha256Hash:"0828119ded1c13477966434e15800ff57ddacf13ba1911c129dc2200705b0712"}}},r=await self.request("https://gql.twitch.tv/gql#origin=twilight",{method:"POST",headers:{Host:"gql.twitch.tv","Client-ID":"kimne78kx3ncx6brgo4mv6wki5h1ko","Client-Integrity":i},body:JSON.stringify(s)}),a=await r.json();return{token:a.data.streamPlaybackAccessToken.value,signature:a.data.streamPlaybackAccessToken.signature}}async playbackAccessToken_Template(t,e){const i={operationName:"PlaybackAccessToken_Template",query:\'query PlaybackAccessToken_Template($login: String!, $isLive: Boolean!, $vodID: ID!, $isVod: Boolean!, $playerType: String!) { streamPlaybackAccessToken(channelName: $login, params: {platform: "web", playerBackend: "mediaplayer", playerType: $playerType}) @include(if: $isLive) { value signature __typename } videoPlaybackAccessToken(id: $vodID, params: {platform: "web", playerBackend: "mediaplayer", playerType: $playerType}) @include(if: $isVod) { value signature __typename }}\',variables:{isLive:!0,isVod:!1,vodID:"",login:t,playerType:e}},s=await self.request("https://gql.twitch.tv/gql",{method:"POST",headers:{Host:"gql.twitch.tv","Client-ID":"kimne78kx3ncx6brgo4mv6wki5h1ko"},body:JSON.stringify(i)}),r=await s.json();return{token:r.data.streamPlaybackAccessToken.value,signature:r.data.streamPlaybackAccessToken.signature}}async getM3U8(t,e){const i="allow_source=true&fast_bread=true&p="+Math.floor(1e7*Math.random())+"&player_backend=mediaplayer&playlist_include_framerate=true&reassignments_supported=false&sig="+e.signature+"&supported_codecs=avc1&token="+e.token;return(await self.request("https://usher.ttvnw.net/api/channel/hls/"+t+".m3u8?"+i)).text()}}class g{constructor(t){e(this,"type"),e(this,"urlList"),e(this,"sig"),e(this,"bestQuality",(()=>this.urlList[0])),e(this,"findByQuality",(t=>this.urlList.find((e=>e.quality==t)))),Object.assign(this,t)}}var c=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(i,1),i>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,s=0;s-1;e=this.buffer.indexOf("\\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)}}const y=String.fromCharCode(9),T=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},b=function(t){const e={};if(!t)return e;const i=t.split(new RegExp(\'(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))\'));let s,r=i.length;for(;r--;)""!==i[r]&&(s=/([^=]*)=(.*)/.exec(i[r]).slice(1),s[0]=s[0].replace(/^\\s+|\\s+$/g,""),s[1]=s[1].replace(/^\\s+|\\s+$/g,""),s[1]=s[1].replace(/^[\'"](.*)[\'"]$/g,"$1"),e[s[0]]=s[1]);return e};class E extends c{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(t){let e,i;if(0===(t=t.trim()).length)return;if("#"!==t[0])return void this.trigger("data",{type:"uri",uri:t});this.tagMappers.reduce(((e,i)=>{const s=i(t);return s===t?e:e.concat([s])}),[t]).forEach((t=>{for(let e=0;et),this.customParsers.push((r=>{if(t.exec(r))return this.trigger("data",{type:"custom",data:i(r),customType:e,segment:s}),!0}))}addTagMapper({expression:t,map:e}){this.tagMappers.push((i=>t.test(i)?e(i):i))}}const S=function(t){const e={};return Object.keys(t).forEach((function(i){var s;e[(s=i,s.toLowerCase().replace(/-(\\w)/g,(t=>t[1].toUpperCase())))]=t[i]})),e},A=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:s}=t;if(!e)return;const r="#EXT-X-SERVER-CONTROL",a="holdBack",n="partHoldBack",o=i&&3*i,u=s&&2*s;i&&!e.hasOwnProperty(a)&&(e[a]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[a]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&i&&(r.map=i),!r.key&&s&&(r.key=s),r.timeline||"number"!=typeof u||(r.timeline=u),this.manifest.preloadSegment=r)})),this.parseStream.on("data",(function(c){let p,d;({tag(){({version(){c.version&&(this.manifest.version=c.version)},"allow-cache"(){this.manifest.allowCache=c.allowed,"allowed"in c||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in c&&(r.byterange=t,t.length=c.length,"offset"in c||(c.offset=l)),"offset"in c&&(r.byterange=t,t.offset=c.offset),l=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),c.duration>0&&(r.duration=c.duration),0===c.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=e},key(){if(c.attributes)if("NONE"!==c.attributes.METHOD)if(c.attributes.URI){if("com.apple.streamingkeydelivery"===c.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:c.attributes});if("com.microsoft.playready"===c.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:c.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===c.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(c.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===c.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==c.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):c.attributes.KEYID&&"0x"===c.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:c.attributes.KEYFORMAT,keyId:c.attributes.KEYID.substring(2)},pssh:f(c.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}c.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),s={method:c.attributes.METHOD||"AES-128",uri:c.attributes.URI},void 0!==c.attributes.IV&&(s.iv=c.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else s=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(c.number)?this.manifest.mediaSequence=c.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+c.number})},"discontinuity-sequence"(){isFinite(c.number)?(this.manifest.discontinuitySequence=c.number,u=c.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+c.number})},"playlist-type"(){/VOD|EVENT/.test(c.playlistType)?this.manifest.playlistType=c.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+c.playlist})},map(){i={},c.uri&&(i.uri=c.uri),c.byterange&&(i.byterange=c.byterange),s&&(i.key=s)},"stream-inf"(){this.manifest.playlists=e,this.manifest.mediaGroups=this.manifest.mediaGroups||o,c.attributes?(r.attributes||(r.attributes={}),h(r.attributes,c.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(c.attributes&&c.attributes.TYPE&&c.attributes["GROUP-ID"]&&c.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[c.attributes.TYPE];t[c.attributes["GROUP-ID"]]=t[c.attributes["GROUP-ID"]]||{},p=t[c.attributes["GROUP-ID"]],d={default:/yes/i.test(c.attributes.DEFAULT)},d.default?d.autoselect=!0:d.autoselect=/yes/i.test(c.attributes.AUTOSELECT),c.attributes.LANGUAGE&&(d.language=c.attributes.LANGUAGE),c.attributes.URI&&(d.uri=c.attributes.URI),c.attributes["INSTREAM-ID"]&&(d.instreamId=c.attributes["INSTREAM-ID"]),c.attributes.CHARACTERISTICS&&(d.characteristics=c.attributes.CHARACTERISTICS),c.attributes.FORCED&&(d.forced=/yes/i.test(c.attributes.FORCED)),p[c.attributes.NAME]=d},discontinuity(){u+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(e.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=c.dateTimeString,this.manifest.dateTimeObject=c.dateTimeObject),r.dateTimeString=c.dateTimeString,r.dateTimeObject=c.dateTimeObject},targetduration(){!isFinite(c.duration)||c.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+c.duration}):(this.manifest.targetDuration=c.duration,A.call(this,this.manifest))},start(){c.attributes&&!isNaN(c.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:c.attributes["TIME-OFFSET"],precise:c.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){r.cueOut=c.data},"cue-out-cont"(){r.cueOutCont=c.data},"cue-in"(){r.cueIn=c.data},skip(){this.manifest.skip=S(c.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",c.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const t=this.manifest.segments.length,e=S(c.attributes);r.parts=r.parts||[],r.parts.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=g),g=e.byterange.offset+e.byterange.length);const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${t}`,c.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((t,e)=>{t.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${e} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const t=this.manifest.serverControl=S(c.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),A.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,e=S(c.attributes),i=e.type&&"PART"===e.type;r.preloadHints=r.preloadHints||[],r.preloadHints.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=i?g:0,i&&(g=e.byterange.offset+e.byterange.length)));const s=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,c.attributes,["TYPE","URI"]),e.type)for(let a=0;a(null==t?void 0:t.toString().includes("stitched"))||(null==t?void 0:t.toString().includes("Amazon"))||(null==t?void 0:t.toString().includes("DCM,"));function R(t){let e="#EXTM3U\\n";return e+=`#EXT-X-TARGETDURATION:${t.targetDuration??5}\\n`,e+=`#EXT-X-MEDIA-SEQUENCE:${t.mediaSequence??0}\\n`,t.segments&&t.segments.forEach((t=>{t.duration&&(e+=`#EXTINF:${t.duration}\\n`),e+=`${t.uri}\\n`})),e}function O(t){var e,i,s;if(!t.length)return"";const r=t.map((t=>{const e=new I;e.push(t),e.end();const i=e.manifest;return i.segments&&i.segments.forEach((e=>{const i=new RegExp(`#EXTINF:([0-9.]*)?,?(.*)(?:\\n|\\r\\n)${e.uri}`),s=t.match(i);s&&(e.title=s[2]?s[2].trim():"")})),i})),a=r[0],n=r.slice(1);console.log("Segmentos encontrados no manifesto principal:",null==(e=null==a?void 0:a.segments)?void 0:e.length),console.log("Manifestos de suporte encontrados:",n.length);let o=0;if(!(null==(i=a.segments)?void 0:i.length))return R(a);for(let u=0;u{if(v(e.title))return!1;const i=new Date(t.dateTimeString),s=new Date(e.dateTimeString);return i.setMilliseconds(0),s.setMilliseconds(0),i.getTime()===s.getTime()}));if(r){a.segments[u]=r,e=!0;break}}e&&o++}}return console.log("Segmento com ads removidos:",0),console.log("Segmento com ads substituídos:",o),R(a)}class w{constructor(){e(this,"integrityToken",""),e(this,"streamList",[]),e(this,"actualChannel",""),e(this,"playingAds",!1),e(this,"setting"),e(this,"quality",""),e(this,"freeStream",!1),e(this,"getQuality",(()=>self.postMessage({type:"getQuality"}))),e(this,"getSettings",(()=>self.postMessage({type:"getSettings"}))),e(this,"pause",(()=>self.postMessage({type:"pause"}))),e(this,"play",(()=>self.postMessage({type:"play"}))),e(this,"setSettings",(t=>{this.setting=t,logger("Settings loaded")})),e(this,"setIntegrityToken",(t=>this.integrityToken=t)),e(this,"pauseAndPlay",(async()=>{this.pause(),await new Promise((t=>setTimeout(t,1500))),this.play(),this.play()})),e(this,"onStartAds",(()=>{console.log("ads started"),this.pauseAndPlay()})),e(this,"onEndAds",(()=>{console.log("ads ended"),this.pauseAndPlay()})),e(this,"isAds",((t,e=!1)=>{const i=this.hasAds(t);return e?(this.playingAds!=i&&this.pauseAndPlay(),this.playingAds=i,this.playingAds):i})),e(this,"hasAds",(t=>(null==t?void 0:t.toString().includes("stitched"))||(null==t?void 0:t.toString().includes("Amazon"))||(null==t?void 0:t.toString().includes("DCM,")))),e(this,"currentStream",((t=this.actualChannel)=>{var e;return null==(e=this.streamList)?void 0:e.find((e=>e.channelName===t))}))}freeStreamChanged(t){console.log("freeStreamChanged:",t),this.freeStream!=t&&this.pauseAndPlay(),this.freeStream=t}isWhitelist(){var t,e;return(null==(e=null==(t=this.setting)?void 0:t.whitelist)?void 0:e.includes(this.actualChannel))||!1}async onFetch(t){if(this.isWhitelist())return t;if(!this.isAds(t,!0))return console.log("Stream is free"),this.freeStream=!1,O([t]);const e=[],i=await this.fetchm3u8ByStreamType(r.FRONTPAGE);if(i.data||this.currentStream().createStreamAccess(r.FRONTPAGE,this.integrityToken),i.dump&&e.push(...i.dump),i.data)return i.data;const s=await this.fetchm3u8ByStreamType(r.PICTURE);return s.data||this.currentStream().createStreamAccess(r.PICTURE,this.integrityToken),s.dump&&e.push(...s.dump),s.data?s.data:((null==e?void 0:e.length)?this.freeStreamChanged(!0):this.freeStreamChanged(!1),O([t,...e]))}async fetchm3u8ByStreamType(t){let e=[],i="",s=this.currentStream().getStreamByStreamType(t);for(const r of s){const s=r.findByQuality(this.quality)||r.bestQuality(),a=await(await self.request(null==s?void 0:s.url)).text();if(e.push(a),!this.isAds(a)){i=a,logger("Stream Type: "+t+" - Free Stream");break}logger("Stream Type: "+t+" - Ads found"),this.currentStream().removeServer(r)}return{data:i,dump:e}}setChannel(t){logger(`Loading channel ${t}`),this.actualChannel=t;let i=this.streamList.find((e=>e.channelName===t));i||(i=new class{constructor(t){e(this,"serverList",[]),e(this,"channelName"),e(this,"twitchService"),this.channelName=t,this.twitchService=new l("")}removeServer(t){const e=this.serverList.indexOf(t);e>-1&&this.serverList.splice(e,1)}setStreamAccess(t,e="local",i=!0){const s=[];let r;const a=/NAME="((?:\\S+\\s+\\S+|\\S+))",AUTO(?:^|\\S+\\s+)(?:^|\\S+\\s+)(https:\\/\\/video(\\S+).m3u8)/g;for(;null!==(r=a.exec(t));)s.push({quality:r[1],url:r[2]});const n=new g({type:e,urlList:s,sig:i});this.serverList.push(n)}async createStreamAccess(t,e){try{const i=await this.twitchService.playbackAccessToken(this.channelName,t,e);console.log("New Connection: ",t,i.token.includes(\'"hide_ads":true\'));const s=await this.twitchService.getM3U8(this.channelName,i);this.setStreamAccess(s,t)}catch(i){logger(i)}}getStreamByStreamType(t){return this.serverList.filter((e=>e.type==t))||[]}}(t),this.streamList.push(i))}}self.request=self.fetch,self.fetch=async(t,e)=>{if("string"==typeof t)for(var i=0,s=routerList.length;iconsole.log("[Purple]: ",t),self.appController=new u(new w),self.logger("Script running");\n';let o=!1;(function(){let e;window.Worker=class extends Worker{constructor(t){console.log("[Purple]: init "+t.toString());const i=new XMLHttpRequest;i.open("GET",t.toString(),!1),i.send();const s=i.responseText;if(typeof s!="string"){super(t);return}const r=`${u} ${s}`,a=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));super(a),o||(e=this,e.declareEventWorker(),e.declareEventWindow(),e.integrity(),o=!0)}async integrity(){self.request=fetch,self.fetch=async(t,i)=>{const s=await self.request(t,i),r=await s.text();return t=="https://gql.twitch.tv/integrity"&&e.postMessage({funcName:"setIntegrity",value:r}),new Response(r,s)}}declareEventWorker(){this.addEventListener("message",t=>{var i,s,r,a,n;switch((i=t==null?void 0:t.data)==null?void 0:i.type){case"getSettings":{window.postMessage({type:"getSettings",value:null});break}case"PlayerQualityChanged":{e.postMessage({funcName:"setQuality",value:t.data.arg.name});break}case"pause":{e.postMessage({funcName:"pause",args:void 0,id:1});break}case"play":{e.postMessage({funcName:"play",args:void 0,id:1});break}}switch((r=(s=t==null?void 0:t.data)==null?void 0:s.arg)==null?void 0:r.key){case"quality":{if(!t.data.arg.value.name)break;console.log("Changed quality by player: "+t.data.arg.value.name),e.postMessage({funcName:"setQuality",value:t.data.arg.value.name});break}case"state":e.postMessage({funcName:t.data.arg.value})}switch((n=(a=t==null?void 0:t.data)==null?void 0:a.arg)==null?void 0:n.name){}})}declareEventWindow(){window.addEventListener("message",t=>{switch(t.data.type){case"setSettings":e.postMessage({funcName:"setSettings",value:t.data.value})}})}}})();