4UR3 / AvaRevive

// ==UserScript==
// @name          AvaRevive
// @description   revive twinoid avatars
// @copyright     Aure 2022
// @license       ISC
// @match        https://twinoid.com/en/tid/forum
// @match        https://twinoid.com/fr/tid/forum
// @match        https://twinoid.com/tid/forum
// ==/UserScript==
(()=>{var e={483:(e,n,t)=>{e.exports=function e(n,t,r){function o(a,c){if(!t[a]){if(!n[a]){if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=t[a]={exports:{}};n[a][0].call(f.exports,(function(e){return o(n[a][1][e]||e)}),f,f.exports,e,n,t,r)}return t[a].exports}for(var i=void 0,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,n,r){(function(e){"use strict";var t,r,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(s),c=e.document.createTextNode("");a.observe(c,{characterData:!0}),t=function(){c.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var n=e.document.createElement("script");n.onreadystatechange=function(){s(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n)}:function(){setTimeout(s,0)};else{var u=new e.MessageChannel;u.port1.onmessage=s,t=function(){u.port2.postMessage(0)}}var f=[];function s(){var e,n;r=!0;for(var t=f.length;t;){for(n=f,f=[],e=-1;++e<t;)n[e]();t=f.length}r=!1}n.exports=function(e){1!==f.push(e)||r||t()}}).call(this,void 0!==t.g?t.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,n,t){"use strict";var r=e(1);function o(){}var i={},a=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==o&&v(this,e)}function s(e,n,t){this.promise=e,"function"==typeof n&&(this.onFulfilled=n,this.callFulfilled=this.otherCallFulfilled),"function"==typeof t&&(this.onRejected=t,this.callRejected=this.otherCallRejected)}function l(e,n,t){r((function(){var r;try{r=n(t)}catch(n){return i.reject(e,n)}r===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,r)}))}function d(e){var n=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof n)return function(){n.apply(e,arguments)}}function v(e,n){var t=!1;function r(n){t||(t=!0,i.reject(e,n))}function o(n){t||(t=!0,i.resolve(e,n))}var a=h((function(){n(o,r)}));"error"===a.status&&r(a.value)}function h(e,n){var t={};try{t.value=e(n),t.status="success"}catch(e){t.status="error",t.value=e}return t}n.exports=f,f.prototype.catch=function(e){return this.then(null,e)},f.prototype.then=function(e,n){if("function"!=typeof e&&this.state===c||"function"!=typeof n&&this.state===a)return this;var t=new this.constructor(o);return this.state!==u?l(t,this.state===c?e:n,this.outcome):this.queue.push(new s(t,e,n)),t},s.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},s.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},s.prototype.callRejected=function(e){i.reject(this.promise,e)},s.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,n){var t=h(d,n);if("error"===t.status)return i.reject(e,t.value);var r=t.value;if(r)v(e,r);else{e.state=c,e.outcome=n;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(n)}return e},i.reject=function(e,n){e.state=a,e.outcome=n;for(var t=-1,r=e.queue.length;++t<r;)e.queue[t].callRejected(n);return e},f.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},f.reject=function(e){var n=new this(o);return i.reject(n,e)},f.all=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var a=new Array(t),c=0,u=-1,f=new this(o);++u<t;)s(e[u],u);return f;function s(e,o){n.resolve(e).then((function(e){a[o]=e,++c!==t||r||(r=!0,i.resolve(f,a))}),(function(e){r||(r=!0,i.reject(f,e))}))}},f.race=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t,r=e.length,a=!1;if(!r)return this.resolve([]);for(var c=-1,u=new this(o);++c<r;)t=e[c],n.resolve(t).then((function(e){a||(a=!0,i.resolve(u,e))}),(function(e){a||(a=!0,i.reject(u,e))}));return u}},{1:1}],3:[function(e,n,r){(function(n){"use strict";"function"!=typeof n.Promise&&(n.Promise=e(2))}).call(this,void 0!==t.g?t.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,n,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,n){e=e||[],n=n||{};try{return new Blob(e,n)}catch(o){if("TypeError"!==o.name)throw o;for(var t=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)t.append(e[r]);return t.getBlob(n.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function c(e,n){n&&e.then((function(e){n(null,e)}),(function(e){n(e)}))}function u(e,n,t){"function"==typeof n&&e.then(n),"function"==typeof t&&e.catch(t)}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function s(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",d=void 0,v={},h=Object.prototype.toString,y="readonly",p="readwrite";function b(e){for(var n=e.length,t=new ArrayBuffer(n),r=new Uint8Array(t),o=0;o<n;o++)r[o]=e.charCodeAt(o);return t}function m(e){return"boolean"==typeof d?a.resolve(d):function(e){return new a((function(n){var t=e.transaction(l,p),r=i([""]);t.objectStore(l).put(r,"key"),t.onabort=function(e){e.preventDefault(),e.stopPropagation(),n(!1)},t.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),t=navigator.userAgent.match(/Edge\//);n(t||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function g(e){var n=v[e.name],t={};t.promise=new a((function(e,n){t.resolve=e,t.reject=n})),n.deferredOperations.push(t),n.dbReady?n.dbReady=n.dbReady.then((function(){return t.promise})):n.dbReady=t.promise}function _(e){var n=v[e.name].deferredOperations.pop();if(n)return n.resolve(),n.promise}function w(e,n){var t=v[e.name].deferredOperations.pop();if(t)return t.reject(n),t.promise}function I(e,n){return new a((function(t,r){if(v[e.name]=v[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!n)return t(e.db);g(e),e.db.close()}var i=[e.name];n&&i.push(e.version);var a=o.open.apply(o,i);n&&(a.onupgradeneeded=function(n){var t=a.result;try{t.createObjectStore(e.storeName),n.oldVersion<=1&&t.createObjectStore(l)}catch(t){if("ConstraintError"!==t.name)throw t;console.warn('The database "'+e.name+'" has been upgraded from version '+n.oldVersion+" to version "+n.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var n=a.result;n.onversionchange=function(e){e.target.close()},t(n),_(e)}}))}function S(e){return I(e,!1)}function E(e){return I(e,!0)}function N(e,n){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version;if(r&&(e.version!==n&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function j(e){return i([b(atob(e.data))],{type:e.type})}function A(e){return e&&e.__local_forage_encoded_blob}function R(e){var n=this,t=n._initReady().then((function(){var e=v[n._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return u(t,e,e),t}function x(e,n,t,r){void 0===r&&(r=1);try{var o=e.db.transaction(e.storeName,n);t(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((function(){return function(e){g(e);for(var n=v[e.name],t=n.forages,r=0;r<t.length;r++){var o=t[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,S(e).then((function(n){return e.db=n,N(e)?E(e):n})).then((function(r){e.db=n.db=r;for(var o=0;o<t.length;o++)t[o]._dbInfo.db=r})).catch((function(n){throw w(e,n),n}))}(e).then((function(){x(e,n,t,r-1)}))})).catch(t);t(o)}}var O={_driver:"asyncStorage",_initStorage:function(e){var n=this,t={db:null};if(e)for(var r in e)t[r]=e[r];var o=v[t.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},v[t.name]=o),o.forages.push(n),n._initReady||(n._initReady=n.ready,n.ready=R);var i=[];function c(){return a.resolve()}for(var u=0;u<o.forages.length;u++){var f=o.forages[u];f!==n&&i.push(f._initReady().catch(c))}var s=o.forages.slice(0);return a.all(i).then((function(){return t.db=o.db,S(t)})).then((function(e){return t.db=e,N(t,n._defaultConfig.version)?E(t):e})).then((function(e){t.db=o.db=e,n._dbInfo=t;for(var r=0;r<s.length;r++){var i=s[r];i!==n&&(i._dbInfo.db=t.db,i._dbInfo.version=t.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),n="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||n)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,n){var t=this,r=new a((function(n,r){t.ready().then((function(){x(t._dbInfo,y,(function(o,i){if(o)return r(o);try{var a=i.objectStore(t._dbInfo.storeName).openCursor(),c=1;a.onsuccess=function(){var t=a.result;if(t){var r=t.value;A(r)&&(r=j(r));var o=e(r,t.key,c++);void 0!==o?n(o):t.continue()}else n()},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,n),r},getItem:function(e,n){var t=this;e=f(e);var r=new a((function(n,r){t.ready().then((function(){x(t._dbInfo,y,(function(o,i){if(o)return r(o);try{var a=i.objectStore(t._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),A(e)&&(e=j(e)),n(e)},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,n),r},setItem:function(e,n,t){var r=this;e=f(e);var o=new a((function(t,o){var i;r.ready().then((function(){return i=r._dbInfo,"[object Blob]"===h.call(n)?m(i.db).then((function(e){return e?n:(t=n,new a((function(e,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:t.type})},r.readAsBinaryString(t)})));var t})):n})).then((function(n){x(r._dbInfo,p,(function(i,a){if(i)return o(i);try{var c=a.objectStore(r._dbInfo.storeName);null===n&&(n=void 0);var u=c.put(n,e);a.oncomplete=function(){void 0===n&&(n=null),t(n)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return c(o,t),o},removeItem:function(e,n){var t=this;e=f(e);var r=new a((function(n,r){t.ready().then((function(){x(t._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(t._dbInfo.storeName).delete(e);i.oncomplete=function(){n()},i.onerror=function(){r(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,n),r},clear:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){x(n._dbInfo,p,(function(r,o){if(r)return t(r);try{var i=o.objectStore(n._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;t(e)}}catch(e){t(e)}}))})).catch(t)}));return c(t,e),t},length:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){x(n._dbInfo,y,(function(r,o){if(r)return t(r);try{var i=o.objectStore(n._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){t(i.error)}}catch(e){t(e)}}))})).catch(t)}));return c(t,e),t},key:function(e,n){var t=this,r=new a((function(n,r){e<0?n(null):t.ready().then((function(){x(t._dbInfo,y,(function(o,i){if(o)return r(o);try{var a=i.objectStore(t._dbInfo.storeName),c=!1,u=a.openKeyCursor();u.onsuccess=function(){var t=u.result;t?0===e||c?n(t.key):(c=!0,t.advance(e)):n(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,n),r},keys:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){x(n._dbInfo,y,(function(r,o){if(r)return t(r);try{var i=o.objectStore(n._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var n=i.result;n?(a.push(n.key),n.continue()):e(a)},i.onerror=function(){t(i.error)}}catch(e){t(e)}}))})).catch(t)}));return c(t,e),t},dropInstance:function(e,n){n=s.apply(this,arguments);var t=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var r,i=this;if(e.name){var u=e.name===t.name&&i._dbInfo.db?a.resolve(i._dbInfo.db):S(e).then((function(n){var t=v[e.name],r=t.forages;t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n;return n}));r=e.storeName?u.then((function(n){if(n.objectStoreNames.contains(e.storeName)){var t=n.version+1;g(e);var r=v[e.name],i=r.forages;n.close();for(var c=0;c<i.length;c++){var u=i[c];u._dbInfo.db=null,u._dbInfo.version=t}var f=new a((function(n,r){var i=o.open(e.name,t);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),n(e)}}));return f.then((function(e){r.db=e;for(var n=0;n<i.length;n++){var t=i[n];t._dbInfo.db=e,_(t._dbInfo)}})).catch((function(n){throw(w(e,n)||a.resolve()).catch((function(){})),n}))}})):u.then((function(n){g(e);var t=v[e.name],r=t.forages;n.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var c=new a((function(n,t){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),t(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),n(e)}}));return c.then((function(e){t.db=e;for(var n=0;n<r.length;n++)_(r[n]._dbInfo)})).catch((function(n){throw(w(e,n)||a.resolve()).catch((function(){})),n}))}))}else r=a.reject("Invalid arguments");return c(r,n),r}};var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/^~~local_forage_type~([^~]+)~/,k="__lfsc__:",C=k.length,T="arbf",L="blob",F="si08",M="ui08",z="uic8",P="si16",U="si32",q="ur16",W="ui32",H="fl32",K="fl64",Q=C+T.length,X=Object.prototype.toString;function G(e){var n,t,r,o,i,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var f=new ArrayBuffer(a),s=new Uint8Array(f);for(n=0;n<c;n+=4)t=B.indexOf(e[n]),r=B.indexOf(e[n+1]),o=B.indexOf(e[n+2]),i=B.indexOf(e[n+3]),s[u++]=t<<2|r>>4,s[u++]=(15&r)<<4|o>>2,s[u++]=(3&o)<<6|63&i;return f}function J(e){var n,t=new Uint8Array(e),r="";for(n=0;n<t.length;n+=3)r+=B[t[n]>>2],r+=B[(3&t[n])<<4|t[n+1]>>4],r+=B[(15&t[n+1])<<2|t[n+2]>>6],r+=B[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var V={serialize:function(e,n){var t="";if(e&&(t=X.call(e)),e&&("[object ArrayBuffer]"===t||e.buffer&&"[object ArrayBuffer]"===X.call(e.buffer))){var r,o=k;e instanceof ArrayBuffer?(r=e,o+=T):(r=e.buffer,"[object Int8Array]"===t?o+=F:"[object Uint8Array]"===t?o+=M:"[object Uint8ClampedArray]"===t?o+=z:"[object Int16Array]"===t?o+=P:"[object Uint16Array]"===t?o+=q:"[object Int32Array]"===t?o+=U:"[object Uint32Array]"===t?o+=W:"[object Float32Array]"===t?o+=H:"[object Float64Array]"===t?o+=K:n(new Error("Failed to get type for BinaryArray"))),n(o+J(r))}else if("[object Blob]"===t){var i=new FileReader;i.onload=function(){var t="~~local_forage_type~"+e.type+"~"+J(this.result);n("__lfsc__:blob"+t)},i.readAsArrayBuffer(e)}else try{n(JSON.stringify(e))}catch(t){console.error("Couldn't convert value into a JSON string: ",e),n(null,t)}},deserialize:function(e){if(e.substring(0,C)!==k)return JSON.parse(e);var n,t=e.substring(Q),r=e.substring(C,Q);if(r===L&&D.test(t)){var o=t.match(D);n=o[1],t=t.substring(o[0].length)}var a=G(t);switch(r){case T:return a;case L:return i([a],{type:n});case F:return new Int8Array(a);case M:return new Uint8Array(a);case z:return new Uint8ClampedArray(a);case P:return new Int16Array(a);case q:return new Uint16Array(a);case U:return new Int32Array(a);case W:return new Uint32Array(a);case H:return new Float32Array(a);case K:return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:G,bufferToString:J};function Y(e,n,t,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+n.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,r)}function Z(e,n,t,r,o,i){e.executeSql(t,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],(function(e,c){c.rows.length?i(e,a):Y(e,n,(function(){e.executeSql(t,r,o,i)}),i)}),i):i(e,a)}),i)}function $(e,n,t,r){var o=this;e=f(e);var i=new a((function(i,a){o.ready().then((function(){void 0===n&&(n=null);var c=n,u=o._dbInfo;u.serializer.serialize(n,(function(n,f){f?a(f):u.db.transaction((function(t){Z(t,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,n],(function(){i(c)}),(function(e,n){a(n)}))}),(function(n){if(n.code===n.QUOTA_ERR){if(r>0)return void i($.apply(o,[e,c,t,r-1]));a(n)}}))}))})).catch(a)}));return c(i,t),i}function ee(e){return new a((function(n,t){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(t,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);n({db:e,storeNames:o})}),(function(e,n){t(n)}))}),(function(e){t(e)}))}))}var ne={_driver:"webSQLStorage",_initStorage:function(e){var n=this,t={db:null};if(e)for(var r in e)t[r]="string"!=typeof e[r]?e[r].toString():e[r];var o=new a((function(e,r){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(e){return r(e)}t.db.transaction((function(o){Y(o,t,(function(){n._dbInfo=t,e()}),(function(e,n){r(n)}))}),r)}));return t.serializer=V,o},_support:"function"==typeof openDatabase,iterate:function(e,n){var t=this,r=new a((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){Z(t,o,"SELECT * FROM "+o.storeName,[],(function(t,r){for(var i=r.rows,a=i.length,c=0;c<a;c++){var u=i.item(c),f=u.value;if(f&&(f=o.serializer.deserialize(f)),void 0!==(f=e(f,u.key,c+1)))return void n(f)}n()}),(function(e,n){r(n)}))}))})).catch(r)}));return c(r,n),r},getItem:function(e,n){var t=this;e=f(e);var r=new a((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){Z(t,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,t){var r=t.rows.length?t.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return c(r,n),r},setItem:function(e,n,t){return $.apply(this,[e,n,t,1])},removeItem:function(e,n){var t=this;e=f(e);var r=new a((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){Z(t,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){n()}),(function(e,n){r(n)}))}))})).catch(r)}));return c(r,n),r},clear:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){Z(n,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,n){t(n)}))}))})).catch(t)}));return c(t,e),t},length:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){Z(n,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(n,t){var r=t.rows.item(0).c;e(r)}),(function(e,n){t(n)}))}))})).catch(t)}));return c(t,e),t},key:function(e,n){var t=this,r=new a((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){Z(t,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,t){var r=t.rows.length?t.rows.item(0).key:null;n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return c(r,n),r},keys:function(e){var n=this,t=new a((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){Z(n,r,"SELECT key FROM "+r.storeName,[],(function(n,t){for(var r=[],o=0;o<t.rows.length;o++)r.push(t.rows.item(o).key);e(r)}),(function(e,n){t(n)}))}))})).catch(t)}));return c(t,e),t},dropInstance:function(e,n){n=s.apply(this,arguments);var t=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var r,o=this;return c(r=e.name?new a((function(n){var r;r=e.name===t.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?n({db:r,storeNames:[e.storeName]}):n(ee(r))})).then((function(e){return new a((function(n,t){e.db.transaction((function(r){function o(e){return new a((function(n,t){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){n()}),(function(e,n){t(n)}))}))}for(var i=[],c=0,u=e.storeNames.length;c<u;c++)i.push(o(e.storeNames[c]));a.all(i).then((function(){n()})).catch((function(e){t(e)}))}),(function(e){t(e)}))}))})):a.reject("Invalid arguments"),n),r}};function te(e,n){var t=e.name+"/";return e.storeName!==n.storeName&&(t+=e.storeName+"/"),t}function re(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var oe={_driver:"localStorageWrapper",_initStorage:function(e){var n={};if(e)for(var t in e)n[t]=e[t];return n.keyPrefix=te(e,this._defaultConfig),re()?(this._dbInfo=n,n.serializer=V,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo,r=n.keyPrefix,o=r.length,i=localStorage.length,a=1,c=0;c<i;c++){var u=localStorage.key(c);if(0===u.indexOf(r)){var f=localStorage.getItem(u);if(f&&(f=n.serializer.deserialize(f)),void 0!==(f=e(f,u.substring(o),a++)))return f}}}));return c(r,n),r},getItem:function(e,n){var t=this;e=f(e);var r=t.ready().then((function(){var n=t._dbInfo,r=localStorage.getItem(n.keyPrefix+e);return r&&(r=n.serializer.deserialize(r)),r}));return c(r,n),r},setItem:function(e,n,t){var r=this;e=f(e);var o=r.ready().then((function(){void 0===n&&(n=null);var t=n;return new a((function(o,i){var a=r._dbInfo;a.serializer.serialize(n,(function(n,r){if(r)i(r);else try{localStorage.setItem(a.keyPrefix+e,n),o(t)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return c(o,t),o},removeItem:function(e,n){var t=this;e=f(e);var r=t.ready().then((function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)}));return c(r,n),r},clear:function(e){var n=this,t=n.ready().then((function(){for(var e=n._dbInfo.keyPrefix,t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return c(t,e),t},length:function(e){var n=this.keys().then((function(e){return e.length}));return c(n,e),n},key:function(e,n){var t=this,r=t.ready().then((function(){var n,r=t._dbInfo;try{n=localStorage.key(e)}catch(e){n=null}return n&&(n=n.substring(r.keyPrefix.length)),n}));return c(r,n),r},keys:function(e){var n=this,t=n.ready().then((function(){for(var e=n._dbInfo,t=localStorage.length,r=[],o=0;o<t;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}return r}));return c(t,e),t},dropInstance:function(e,n){if(n=s.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var r,o=this;return r=e.name?new a((function(n){e.storeName?n(te(e,o._defaultConfig)):n(e.name+"/")})).then((function(e){for(var n=localStorage.length-1;n>=0;n--){var t=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}})):a.reject("Invalid arguments"),c(r,n),r}},ie=function(e,n){for(var t=e.length,r=0;r<t;){if((o=e[r])===(i=n)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;r++}var o,i;return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ce={},ue={},fe={INDEXEDDB:O,WEBSQL:ne,LOCALSTORAGE:oe},se=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],le=["dropInstance"],de=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),ve={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function he(e,n){e[n]=function(){var t=arguments;return e.ready().then((function(){return e[n].apply(e,t)}))}}function ye(){for(var e=1;e<arguments.length;e++){var n=arguments[e];if(n)for(var t in n)n.hasOwnProperty(t)&&(ae(n[t])?arguments[0][t]=n[t].slice():arguments[0][t]=n[t])}return arguments[0]}var pe=function(){function e(n){for(var t in function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),fe)if(fe.hasOwnProperty(t)){var r=fe[t],o=r._driver;this[t]=o,ce[o]||this.defineDriver(r)}this._defaultConfig=ye({},ve),this._config=ye({},this._defaultConfig,n),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var n in e){if("storeName"===n&&(e[n]=e[n].replace(/\W/g,"_")),"version"===n&&"number"!=typeof e[n])return new Error("Database version must be a number.");this._config[n]=e[n]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,n,t){var r=new a((function(n,t){try{var r=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void t(o);for(var i=de.concat("_initStorage"),u=0,f=i.length;u<f;u++){var s=i[u];if((!ie(le,s)||e[s])&&"function"!=typeof e[s])return void t(o)}!function(){for(var n=function(e){return function(){var n=new Error("Method "+e+" is not implemented by the current driver"),t=a.reject(n);return c(t,arguments[arguments.length-1]),t}},t=0,r=le.length;t<r;t++){var o=le[t];e[o]||(e[o]=n(o))}}();var l=function(t){ce[r]&&console.info("Redefining LocalForage driver: "+r),ce[r]=e,ue[r]=t,n()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,t):l(!!e._support):l(!0)}catch(e){t(e)}}));return u(r,n,t),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,n,t){var r=ce[e]?a.resolve(ce[e]):a.reject(new Error("Driver not found."));return u(r,n,t),r},e.prototype.getSerializer=function(e){var n=a.resolve(V);return u(n,e),n},e.prototype.ready=function(e){var n=this,t=n._driverSet.then((function(){return null===n._ready&&(n._ready=n._initDriver()),n._ready}));return u(t,e,e),t},e.prototype.setDriver=function(e,n,t){var r=this;ae(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){r._config.driver=r.driver()}function c(e){return r._extend(e),i(),r._ready=r._initStorage(r._config),r._ready}var f=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=f.then((function(){var e=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var n=0;return function t(){for(;n<e.length;){var o=e[n];return n++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(c).catch(t)}i();var u=new Error("No available storage method found.");return r._driverSet=a.reject(u),r._driverSet}()}}(o)}))})).catch((function(){i();var e=new Error("No available storage method found.");return r._driverSet=a.reject(e),r._driverSet})),u(this._driverSet,n,t),this._driverSet},e.prototype.supports=function(e){return!!ue[e]},e.prototype._extend=function(e){ye(this,e)},e.prototype._getSupportedDrivers=function(e){for(var n=[],t=0,r=e.length;t<r;t++){var o=e[t];this.supports(o)&&n.push(o)}return n},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,n=de.length;e<n;e++)he(this,de[e])},e.prototype.createInstance=function(n){return new e(n)},e}(),be=new pe;n.exports=be},{3:3}]},{},[4])(4)}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e=t(483);e.getItem("knownAvatars").then((n=>{n||(n={});const t=document.createElement("style");t.id="avaReviveStyle",t.innerText=".tid_content.tid_modinit { display: none!important; }";const r=async(r,i)=>{const a=await(async(r,o)=>{let i,a;document.body.append(t),r.getElementsByClassName("tid_user")[0].click();const c=new Promise(((e,n)=>{i=e,a=n})).catch((()=>null));let u=0;const f=setInterval((()=>{u+=1;const e=document.querySelector(".tid_bubble.tid_editorContent.tid_parsed");if(e){const n=e?e.querySelector("a"):null,t=n?n.href:null,r=document.getElementsByClassName("tid_noclick")[0];r&&r.click(),e.remove(),clearInterval(f),i(t)}else u>10&&(a(),clearInterval(f),console.error("timeout"))}),50),s=await c;return t.remove(),s&&(n[o]=s),e.setItem("knownAvatars",n),s})(r,i);a&&o(r,i)},o=async(e,t)=>{const r=e.querySelector(".tid_floatBox"),o=document.createElement("img");for(o.src=n[t],o.style.maxWidth="80px",o.style.maxHeight="80px";r.children.length;)r.lastChild.remove();r.append(o)};(()=>{const e=new MutationObserver((async()=>{e.disconnect();const t=[...document.getElementsByClassName("tid_post")];for(const e of t){const t=[],i=[];if(!e.classList.contains("parsed")){e.classList.add("parsed");const a=e.getElementsByClassName("tid_user")[0].getAttribute("tid_id");a in n?i.push([e,a]):t.push([e,a]);for(const[e,n]of i)o(e,n);for(const[e,n]of t)await r(e,n)}}e.observe(document.getElementById("tid_forum_right")||document.getElementsByClassName("tid_module")[0],{childList:!0})}));e.observe(document.body,{childList:!0})})()}))})()})();