BetterBlacket

the best client mod for blacket.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         BetterBlacket
// @description  the best client mod for blacket.
// @version      3.3.1.0
// @icon         https://i.ibb.co/b50cfdZK/Removal-505.png

// @author       Death / VillainsRule, Syfe, Zastix, Monkxy, Franxe, and C00LESTKIDDEVER
// @namespace    https://bb.villainsrule.xyz

// @match        *://blacket.org/*
// @match        *://blacket.xotic.org/*
// @match        *://blacket.monkxy.com/*
// @match        *://dashboard.iblooket.com/*
// @match        *://b.blooketis.life/*
// @match        *://b.fart.services/*
// @match        *://blacket.app/*
// @match        *://blacket.dev/*
// @match        *://blacket.online/*
// @match        *://blacket.store/*
// @match        *://blacket.xyz/*
// @match        *://b.blacket.wiki/*
// @match        *://blooket.dev/*
// @match        *://blacket.xotic.org/*
// @match        *://blacket.aprilsheep.com/*
// @match        *://blacket.site/*
// @match        *://blacket.fun/*
// @match        *://blacket.space/*
// @match        *://blooket.llc/*
// @match        *://blacket.ink/*
// @match        *://blacket.lol/*
// @match        *://blacket.zastix.club/*
// @match        *://blacket.blog/*
// @match        *://blacket.live/*
// @match        *://haribo.dev/*
// @match        *://v2.haribo.dev/*
// @match        *://one111-qyi8.onrender.com/*

// @grant        none
// @run-at       document-start
// ==/UserScript==

/* eslint-disable */
var __defProp = Object.defineProperty;
var __typeError = (msg) => {
  throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var _subscriptions;
function bind(fn, thisArg) {
  return function wrap() {
    return fn.apply(thisArg, arguments);
  };
}
const { toString } = Object.prototype;
const { getPrototypeOf } = Object;
const { iterator, toStringTag } = Symbol;
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
  const str = toString.call(thing);
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null));
const kindOfTest = (type) => {
  type = type.toLowerCase();
  return (thing) => kindOf(thing) === type;
};
const typeOfTest = (type) => (thing) => typeof thing === type;
const { isArray } = Array;
const isUndefined = typeOfTest("undefined");
function isBuffer(val) {
  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
const isArrayBuffer = kindOfTest("ArrayBuffer");
function isArrayBufferView(val) {
  let result;
  if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
    result = ArrayBuffer.isView(val);
  } else {
    result = val && val.buffer && isArrayBuffer(val.buffer);
  }
  return result;
}
const isString = typeOfTest("string");
const isFunction = typeOfTest("function");
const isNumber = typeOfTest("number");
const isObject = (thing) => thing !== null && typeof thing === "object";
const isBoolean = (thing) => thing === true || thing === false;
const isPlainObject = (val) => {
  if (kindOf(val) !== "object") {
    return false;
  }
  const prototype2 = getPrototypeOf(val);
  return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
};
const isDate = kindOfTest("Date");
const isFile = kindOfTest("File");
const isBlob = kindOfTest("Blob");
const isFileList = kindOfTest("FileList");
const isStream = (val) => isObject(val) && isFunction(val.pipe);
const isFormData = (thing) => {
  let kind;
  return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
  kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
};
const isURLSearchParams = kindOfTest("URLSearchParams");
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function forEach(obj, fn, { allOwnKeys = false } = {}) {
  if (obj === null || typeof obj === "undefined") {
    return;
  }
  let i;
  let l;
  if (typeof obj !== "object") {
    obj = [obj];
  }
  if (isArray(obj)) {
    for (i = 0, l = obj.length; i < l; i++) {
      fn.call(null, obj[i], i, obj);
    }
  } else {
    const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
    const len = keys.length;
    let key;
    for (i = 0; i < len; i++) {
      key = keys[i];
      fn.call(null, obj[key], key, obj);
    }
  }
}
function findKey(obj, key) {
  key = key.toLowerCase();
  const keys = Object.keys(obj);
  let i = keys.length;
  let _key;
  while (i-- > 0) {
    _key = keys[i];
    if (key === _key.toLowerCase()) {
      return _key;
    }
  }
  return null;
}
const _global = (() => {
  if (typeof globalThis !== "undefined") return globalThis;
  return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
function merge() {
  const { caseless } = isContextDefined(this) && this || {};
  const result = {};
  const assignValue = (val, key) => {
    const targetKey = caseless && findKey(result, key) || key;
    if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
      result[targetKey] = merge(result[targetKey], val);
    } else if (isPlainObject(val)) {
      result[targetKey] = merge({}, val);
    } else if (isArray(val)) {
      result[targetKey] = val.slice();
    } else {
      result[targetKey] = val;
    }
  };
  for (let i = 0, l = arguments.length; i < l; i++) {
    arguments[i] && forEach(arguments[i], assignValue);
  }
  return result;
}
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
  forEach(b, (val, key) => {
    if (thisArg && isFunction(val)) {
      a[key] = bind(val, thisArg);
    } else {
      a[key] = val;
    }
  }, { allOwnKeys });
  return a;
};
const stripBOM = (content) => {
  if (content.charCodeAt(0) === 65279) {
    content = content.slice(1);
  }
  return content;
};
const inherits = (constructor, superConstructor, props, descriptors2) => {
  constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  constructor.prototype.constructor = constructor;
  Object.defineProperty(constructor, "super", {
    value: superConstructor.prototype
  });
  props && Object.assign(constructor.prototype, props);
};
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  let props;
  let i;
  let prop;
  const merged = {};
  destObj = destObj || {};
  if (sourceObj == null) return destObj;
  do {
    props = Object.getOwnPropertyNames(sourceObj);
    i = props.length;
    while (i-- > 0) {
      prop = props[i];
      if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
        destObj[prop] = sourceObj[prop];
        merged[prop] = true;
      }
    }
    sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  return destObj;
};
const endsWith = (str, searchString, position) => {
  str = String(str);
  if (position === void 0 || position > str.length) {
    position = str.length;
  }
  position -= searchString.length;
  const lastIndex = str.indexOf(searchString, position);
  return lastIndex !== -1 && lastIndex === position;
};
const toArray = (thing) => {
  if (!thing) return null;
  if (isArray(thing)) return thing;
  let i = thing.length;
  if (!isNumber(i)) return null;
  const arr = new Array(i);
  while (i-- > 0) {
    arr[i] = thing[i];
  }
  return arr;
};
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
  return (thing) => {
    return TypedArray && thing instanceof TypedArray;
  };
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
const forEachEntry = (obj, fn) => {
  const generator = obj && obj[iterator];
  const _iterator = generator.call(obj);
  let result;
  while ((result = _iterator.next()) && !result.done) {
    const pair = result.value;
    fn.call(obj, pair[0], pair[1]);
  }
};
const matchAll = (regExp, str) => {
  let matches;
  const arr = [];
  while ((matches = regExp.exec(str)) !== null) {
    arr.push(matches);
  }
  return arr;
};
const isHTMLForm = kindOfTest("HTMLFormElement");
const toCamelCase = (str) => {
  return str.toLowerCase().replace(
    /[-_\s]([a-z\d])(\w*)/g,
    function replacer(m, p1, p2) {
      return p1.toUpperCase() + p2;
    }
  );
};
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
const isRegExp = kindOfTest("RegExp");
const reduceDescriptors = (obj, reducer) => {
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  const reducedDescriptors = {};
  forEach(descriptors2, (descriptor, name) => {
    let ret;
    if ((ret = reducer(descriptor, name, obj)) !== false) {
      reducedDescriptors[name] = ret || descriptor;
    }
  });
  Object.defineProperties(obj, reducedDescriptors);
};
const freezeMethods = (obj) => {
  reduceDescriptors(obj, (descriptor, name) => {
    if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
      return false;
    }
    const value = obj[name];
    if (!isFunction(value)) return;
    descriptor.enumerable = false;
    if ("writable" in descriptor) {
      descriptor.writable = false;
      return;
    }
    if (!descriptor.set) {
      descriptor.set = () => {
        throw Error("Can not rewrite read-only method '" + name + "'");
      };
    }
  });
};
const toObjectSet = (arrayOrString, delimiter) => {
  const obj = {};
  const define = (arr) => {
    arr.forEach((value) => {
      obj[value] = true;
    });
  };
  isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  return obj;
};
const noop = () => {
};
const toFiniteNumber = (value, defaultValue) => {
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
};
function isSpecCompliantForm(thing) {
  return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
}
const toJSONObject = (obj) => {
  const stack = new Array(10);
  const visit = (source, i) => {
    if (isObject(source)) {
      if (stack.indexOf(source) >= 0) {
        return;
      }
      if (!("toJSON" in source)) {
        stack[i] = source;
        const target = isArray(source) ? [] : {};
        forEach(source, (value, key) => {
          const reducedValue = visit(value, i + 1);
          !isUndefined(reducedValue) && (target[key] = reducedValue);
        });
        stack[i] = void 0;
        return target;
      }
    }
    return source;
  };
  return visit(obj, 0);
};
const isAsyncFn = kindOfTest("AsyncFunction");
const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  if (setImmediateSupported) {
    return setImmediate;
  }
  return postMessageSupported ? ((token, callbacks) => {
    _global.addEventListener("message", ({ source, data }) => {
      if (source === _global && data === token) {
        callbacks.length && callbacks.shift()();
      }
    }, false);
    return (cb) => {
      callbacks.push(cb);
      _global.postMessage(token, "*");
    };
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(
  typeof setImmediate === "function",
  isFunction(_global.postMessage)
);
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
const utils$1 = {
  isArray,
  isArrayBuffer,
  isBuffer,
  isFormData,
  isArrayBufferView,
  isString,
  isNumber,
  isBoolean,
  isObject,
  isPlainObject,
  isReadableStream,
  isRequest,
  isResponse,
  isHeaders,
  isUndefined,
  isDate,
  isFile,
  isBlob,
  isRegExp,
  isFunction,
  isStream,
  isURLSearchParams,
  isTypedArray,
  isFileList,
  forEach,
  merge,
  extend,
  trim,
  stripBOM,
  inherits,
  toFlatObject,
  kindOf,
  kindOfTest,
  endsWith,
  toArray,
  forEachEntry,
  matchAll,
  isHTMLForm,
  hasOwnProperty,
  hasOwnProp: hasOwnProperty,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors,
  freezeMethods,
  toObjectSet,
  toCamelCase,
  noop,
  toFiniteNumber,
  findKey,
  global: _global,
  isContextDefined,
  isSpecCompliantForm,
  toJSONObject,
  isAsyncFn,
  isThenable,
  setImmediate: _setImmediate,
  asap,
  isIterable
};
function AxiosError$1(message, code, config, request, response) {
  Error.call(this);
  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, this.constructor);
  } else {
    this.stack = new Error().stack;
  }
  this.message = message;
  this.name = "AxiosError";
  code && (this.code = code);
  config && (this.config = config);
  request && (this.request = request);
  if (response) {
    this.response = response;
    this.status = response.status ? response.status : null;
  }
}
utils$1.inherits(AxiosError$1, Error, {
  toJSON: function toJSON() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: utils$1.toJSONObject(this.config),
      code: this.code,
      status: this.status
    };
  }
});
const prototype$1 = AxiosError$1.prototype;
const descriptors = {};
[
  "ERR_BAD_OPTION_VALUE",
  "ERR_BAD_OPTION",
  "ECONNABORTED",
  "ETIMEDOUT",
  "ERR_NETWORK",
  "ERR_FR_TOO_MANY_REDIRECTS",
  "ERR_DEPRECATED",
  "ERR_BAD_RESPONSE",
  "ERR_BAD_REQUEST",
  "ERR_CANCELED",
  "ERR_NOT_SUPPORT",
  "ERR_INVALID_URL"
  // eslint-disable-next-line func-names
].forEach((code) => {
  descriptors[code] = { value: code };
});
Object.defineProperties(AxiosError$1, descriptors);
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
AxiosError$1.from = (error, code, config, request, response, customProps) => {
  const axiosError = Object.create(prototype$1);
  utils$1.toFlatObject(error, axiosError, function filter2(obj) {
    return obj !== Error.prototype;
  }, (prop) => {
    return prop !== "isAxiosError";
  });
  AxiosError$1.call(axiosError, error.message, code, config, request, response);
  axiosError.cause = error;
  axiosError.name = error.name;
  customProps && Object.assign(axiosError, customProps);
  return axiosError;
};
const httpAdapter = null;
function isVisitable(thing) {
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
}
function removeBrackets(key) {
  return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
}
function renderKey(path, key, dots) {
  if (!path) return key;
  return path.concat(key).map(function each(token, i) {
    token = removeBrackets(token);
    return !dots && i ? "[" + token + "]" : token;
  }).join(dots ? "." : "");
}
function isFlatArray(arr) {
  return utils$1.isArray(arr) && !arr.some(isVisitable);
}
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
  return /^is[A-Z]/.test(prop);
});
function toFormData$1(obj, formData, options) {
  if (!utils$1.isObject(obj)) {
    throw new TypeError("target must be an object");
  }
  formData = formData || new FormData();
  options = utils$1.toFlatObject(options, {
    metaTokens: true,
    dots: false,
    indexes: false
  }, false, function defined(option, source) {
    return !utils$1.isUndefined(source[option]);
  });
  const metaTokens = options.metaTokens;
  const visitor = options.visitor || defaultVisitor;
  const dots = options.dots;
  const indexes = options.indexes;
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
  if (!utils$1.isFunction(visitor)) {
    throw new TypeError("visitor must be a function");
  }
  function convertValue(value) {
    if (value === null) return "";
    if (utils$1.isDate(value)) {
      return value.toISOString();
    }
    if (!useBlob && utils$1.isBlob(value)) {
      throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
    }
    if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
      return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
    }
    return value;
  }
  function defaultVisitor(value, key, path) {
    let arr = value;
    if (value && !path && typeof value === "object") {
      if (utils$1.endsWith(key, "{}")) {
        key = metaTokens ? key : key.slice(0, -2);
        value = JSON.stringify(value);
      } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
        key = removeBrackets(key);
        arr.forEach(function each(el, index2) {
          !(utils$1.isUndefined(el) || el === null) && formData.append(
            // eslint-disable-next-line no-nested-ternary
            indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
            convertValue(el)
          );
        });
        return false;
      }
    }
    if (isVisitable(value)) {
      return true;
    }
    formData.append(renderKey(path, key, dots), convertValue(value));
    return false;
  }
  const stack = [];
  const exposedHelpers = Object.assign(predicates, {
    defaultVisitor,
    convertValue,
    isVisitable
  });
  function build(value, path) {
    if (utils$1.isUndefined(value)) return;
    if (stack.indexOf(value) !== -1) {
      throw Error("Circular reference detected in " + path.join("."));
    }
    stack.push(value);
    utils$1.forEach(value, function each(el, key) {
      const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
        formData,
        el,
        utils$1.isString(key) ? key.trim() : key,
        path,
        exposedHelpers
      );
      if (result === true) {
        build(el, path ? path.concat(key) : [key]);
      }
    });
    stack.pop();
  }
  if (!utils$1.isObject(obj)) {
    throw new TypeError("data must be an object");
  }
  build(obj);
  return formData;
}
function encode$1(str) {
  const charMap = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0"
  };
  return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
    return charMap[match];
  });
}
function AxiosURLSearchParams(params, options) {
  this._pairs = [];
  params && toFormData$1(params, this, options);
}
const prototype = AxiosURLSearchParams.prototype;
prototype.append = function append(name, value) {
  this._pairs.push([name, value]);
};
prototype.toString = function toString2(encoder) {
  const _encode = encoder ? function(value) {
    return encoder.call(this, value, encode$1);
  } : encode$1;
  return this._pairs.map(function each(pair) {
    return _encode(pair[0]) + "=" + _encode(pair[1]);
  }, "").join("&");
};
function encode(val) {
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function buildURL(url, params, options) {
  if (!params) {
    return url;
  }
  const _encode = options && options.encode || encode;
  if (utils$1.isFunction(options)) {
    options = {
      serialize: options
    };
  }
  const serializeFn = options && options.serialize;
  let serializedParams;
  if (serializeFn) {
    serializedParams = serializeFn(params, options);
  } else {
    serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
  }
  if (serializedParams) {
    const hashmarkIndex = url.indexOf("#");
    if (hashmarkIndex !== -1) {
      url = url.slice(0, hashmarkIndex);
    }
    url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  }
  return url;
}
class InterceptorManager {
  constructor() {
    this.handlers = [];
  }
  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(fulfilled, rejected, options) {
    this.handlers.push({
      fulfilled,
      rejected,
      synchronous: options ? options.synchronous : false,
      runWhen: options ? options.runWhen : null
    });
    return this.handlers.length - 1;
  }
  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */
  eject(id2) {
    if (this.handlers[id2]) {
      this.handlers[id2] = null;
    }
  }
  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    if (this.handlers) {
      this.handlers = [];
    }
  }
  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(fn) {
    utils$1.forEach(this.handlers, function forEachHandler(h) {
      if (h !== null) {
        fn(h);
      }
    });
  }
}
const transitionalDefaults = {
  silentJSONParsing: true,
  forcedJSONParsing: true,
  clarifyTimeoutError: false
};
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
const platform$1 = {
  isBrowser: true,
  classes: {
    URLSearchParams: URLSearchParams$1,
    FormData: FormData$1,
    Blob: Blob$1
  },
  protocols: ["http", "https", "file", "blob", "url", "data"]
};
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
const _navigator = typeof navigator === "object" && navigator || void 0;
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
const hasStandardBrowserWebWorkerEnv = (() => {
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
})();
const origin = hasBrowserEnv && window.location.href || "http://localhost";
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv, hasStandardBrowserEnv, hasStandardBrowserWebWorkerEnv, navigator: _navigator, origin }, Symbol.toStringTag, { value: "Module" }));
const platform = {
  ...utils,
  ...platform$1
};
function toURLEncodedForm(data, options) {
  return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
    visitor: function(value, key, path, helpers) {
      if (platform.isNode && utils$1.isBuffer(value)) {
        this.append(key, value.toString("base64"));
        return false;
      }
      return helpers.defaultVisitor.apply(this, arguments);
    }
  }, options));
}
function parsePropPath(name) {
  return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
    return match[0] === "[]" ? "" : match[1] || match[0];
  });
}
function arrayToObject(arr) {
  const obj = {};
  const keys = Object.keys(arr);
  let i;
  const len = keys.length;
  let key;
  for (i = 0; i < len; i++) {
    key = keys[i];
    obj[key] = arr[key];
  }
  return obj;
}
function formDataToJSON(formData) {
  function buildPath(path, value, target, index2) {
    let name = path[index2++];
    if (name === "__proto__") return true;
    const isNumericKey = Number.isFinite(+name);
    const isLast = index2 >= path.length;
    name = !name && utils$1.isArray(target) ? target.length : name;
    if (isLast) {
      if (utils$1.hasOwnProp(target, name)) {
        target[name] = [target[name], value];
      } else {
        target[name] = value;
      }
      return !isNumericKey;
    }
    if (!target[name] || !utils$1.isObject(target[name])) {
      target[name] = [];
    }
    const result = buildPath(path, value, target[name], index2);
    if (result && utils$1.isArray(target[name])) {
      target[name] = arrayToObject(target[name]);
    }
    return !isNumericKey;
  }
  if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
    const obj = {};
    utils$1.forEachEntry(formData, (name, value) => {
      buildPath(parsePropPath(name), value, obj, 0);
    });
    return obj;
  }
  return null;
}
function stringifySafely(rawValue, parser, encoder) {
  if (utils$1.isString(rawValue)) {
    try {
      (parser || JSON.parse)(rawValue);
      return utils$1.trim(rawValue);
    } catch (e) {
      if (e.name !== "SyntaxError") {
        throw e;
      }
    }
  }
  return (encoder || JSON.stringify)(rawValue);
}
const defaults = {
  transitional: transitionalDefaults,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [function transformRequest(data, headers) {
    const contentType = headers.getContentType() || "";
    const hasJSONContentType = contentType.indexOf("application/json") > -1;
    const isObjectPayload = utils$1.isObject(data);
    if (isObjectPayload && utils$1.isHTMLForm(data)) {
      data = new FormData(data);
    }
    const isFormData2 = utils$1.isFormData(data);
    if (isFormData2) {
      return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
    }
    if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
      return data;
    }
    if (utils$1.isArrayBufferView(data)) {
      return data.buffer;
    }
    if (utils$1.isURLSearchParams(data)) {
      headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
      return data.toString();
    }
    let isFileList2;
    if (isObjectPayload) {
      if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
        return toURLEncodedForm(data, this.formSerializer).toString();
      }
      if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
        const _FormData = this.env && this.env.FormData;
        return toFormData$1(
          isFileList2 ? { "files[]": data } : data,
          _FormData && new _FormData(),
          this.formSerializer
        );
      }
    }
    if (isObjectPayload || hasJSONContentType) {
      headers.setContentType("application/json", false);
      return stringifySafely(data);
    }
    return data;
  }],
  transformResponse: [function transformResponse(data) {
    const transitional2 = this.transitional || defaults.transitional;
    const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
    const JSONRequested = this.responseType === "json";
    if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
      return data;
    }
    if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
      const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
      const strictJSONParsing = !silentJSONParsing && JSONRequested;
      try {
        return JSON.parse(data);
      } catch (e) {
        if (strictJSONParsing) {
          if (e.name === "SyntaxError") {
            throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
          }
          throw e;
        }
      }
    }
    return data;
  }],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: platform.classes.FormData,
    Blob: platform.classes.Blob
  },
  validateStatus: function validateStatus(status) {
    return status >= 200 && status < 300;
  },
  headers: {
    common: {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": void 0
    }
  }
};
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  defaults.headers[method] = {};
});
const ignoreDuplicateOf = utils$1.toObjectSet([
  "age",
  "authorization",
  "content-length",
  "content-type",
  "etag",
  "expires",
  "from",
  "host",
  "if-modified-since",
  "if-unmodified-since",
  "last-modified",
  "location",
  "max-forwards",
  "proxy-authorization",
  "referer",
  "retry-after",
  "user-agent"
]);
const parseHeaders = (rawHeaders) => {
  const parsed = {};
  let key;
  let val;
  let i;
  rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
    i = line.indexOf(":");
    key = line.substring(0, i).trim().toLowerCase();
    val = line.substring(i + 1).trim();
    if (!key || parsed[key] && ignoreDuplicateOf[key]) {
      return;
    }
    if (key === "set-cookie") {
      if (parsed[key]) {
        parsed[key].push(val);
      } else {
        parsed[key] = [val];
      }
    } else {
      parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
    }
  });
  return parsed;
};
const $internals = Symbol("internals");
function normalizeHeader(header) {
  return header && String(header).trim().toLowerCase();
}
function normalizeValue(value) {
  if (value === false || value == null) {
    return value;
  }
  return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
  const tokens2 = /* @__PURE__ */ Object.create(null);
  const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  let match;
  while (match = tokensRE.exec(str)) {
    tokens2[match[1]] = match[2];
  }
  return tokens2;
}
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  if (utils$1.isFunction(filter2)) {
    return filter2.call(this, value, header);
  }
  if (isHeaderNameFilter) {
    value = header;
  }
  if (!utils$1.isString(value)) return;
  if (utils$1.isString(filter2)) {
    return value.indexOf(filter2) !== -1;
  }
  if (utils$1.isRegExp(filter2)) {
    return filter2.test(value);
  }
}
function formatHeader(header) {
  return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
    return char.toUpperCase() + str;
  });
}
function buildAccessors(obj, header) {
  const accessorName = utils$1.toCamelCase(" " + header);
  ["get", "set", "has"].forEach((methodName) => {
    Object.defineProperty(obj, methodName + accessorName, {
      value: function(arg1, arg2, arg3) {
        return this[methodName].call(this, header, arg1, arg2, arg3);
      },
      configurable: true
    });
  });
}
let AxiosHeaders$1 = class AxiosHeaders2 {
  constructor(headers) {
    headers && this.set(headers);
  }
  set(header, valueOrRewrite, rewrite) {
    const self2 = this;
    function setHeader(_value, _header, _rewrite) {
      const lHeader = normalizeHeader(_header);
      if (!lHeader) {
        throw new Error("header name must be a non-empty string");
      }
      const key = utils$1.findKey(self2, lHeader);
      if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
        self2[key || _header] = normalizeValue(_value);
      }
    }
    const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
    if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
      setHeaders(header, valueOrRewrite);
    } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
      setHeaders(parseHeaders(header), valueOrRewrite);
    } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
      let obj = {}, dest, key;
      for (const entry of header) {
        if (!utils$1.isArray(entry)) {
          throw TypeError("Object iterator must return a key-value pair");
        }
        obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
      }
      setHeaders(obj, valueOrRewrite);
    } else {
      header != null && setHeader(valueOrRewrite, header, rewrite);
    }
    return this;
  }
  get(header, parser) {
    header = normalizeHeader(header);
    if (header) {
      const key = utils$1.findKey(this, header);
      if (key) {
        const value = this[key];
        if (!parser) {
          return value;
        }
        if (parser === true) {
          return parseTokens(value);
        }
        if (utils$1.isFunction(parser)) {
          return parser.call(this, value, key);
        }
        if (utils$1.isRegExp(parser)) {
          return parser.exec(value);
        }
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(header, matcher) {
    header = normalizeHeader(header);
    if (header) {
      const key = utils$1.findKey(this, header);
      return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
    }
    return false;
  }
  delete(header, matcher) {
    const self2 = this;
    let deleted = false;
    function deleteHeader(_header) {
      _header = normalizeHeader(_header);
      if (_header) {
        const key = utils$1.findKey(self2, _header);
        if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
          delete self2[key];
          deleted = true;
        }
      }
    }
    if (utils$1.isArray(header)) {
      header.forEach(deleteHeader);
    } else {
      deleteHeader(header);
    }
    return deleted;
  }
  clear(matcher) {
    const keys = Object.keys(this);
    let i = keys.length;
    let deleted = false;
    while (i--) {
      const key = keys[i];
      if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
        delete this[key];
        deleted = true;
      }
    }
    return deleted;
  }
  normalize(format) {
    const self2 = this;
    const headers = {};
    utils$1.forEach(this, (value, header) => {
      const key = utils$1.findKey(headers, header);
      if (key) {
        self2[key] = normalizeValue(value);
        delete self2[header];
        return;
      }
      const normalized = format ? formatHeader(header) : String(header).trim();
      if (normalized !== header) {
        delete self2[header];
      }
      self2[normalized] = normalizeValue(value);
      headers[normalized] = true;
    });
    return this;
  }
  concat(...targets) {
    return this.constructor.concat(this, ...targets);
  }
  toJSON(asStrings) {
    const obj = /* @__PURE__ */ Object.create(null);
    utils$1.forEach(this, (value, header) => {
      value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
    });
    return obj;
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  }
  getSetCookie() {
    return this.get("set-cookie") || [];
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(thing) {
    return thing instanceof this ? thing : new this(thing);
  }
  static concat(first, ...targets) {
    const computed = new this(first);
    targets.forEach((target) => computed.set(target));
    return computed;
  }
  static accessor(header) {
    const internals = this[$internals] = this[$internals] = {
      accessors: {}
    };
    const accessors = internals.accessors;
    const prototype2 = this.prototype;
    function defineAccessor(_header) {
      const lHeader = normalizeHeader(_header);
      if (!accessors[lHeader]) {
        buildAccessors(prototype2, _header);
        accessors[lHeader] = true;
      }
    }
    utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
    return this;
  }
};
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
  let mapped = key[0].toUpperCase() + key.slice(1);
  return {
    get: () => value,
    set(headerValue) {
      this[mapped] = headerValue;
    }
  };
});
utils$1.freezeMethods(AxiosHeaders$1);
function transformData(fns, response) {
  const config = this || defaults;
  const context = response || config;
  const headers = AxiosHeaders$1.from(context.headers);
  let data = context.data;
  utils$1.forEach(fns, function transform(fn) {
    data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  });
  headers.normalize();
  return data;
}
function isCancel$1(value) {
  return !!(value && value.__CANCEL__);
}
function CanceledError$1(message, config, request) {
  AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
  this.name = "CanceledError";
}
utils$1.inherits(CanceledError$1, AxiosError$1, {
  __CANCEL__: true
});
function settle(resolve, reject, response) {
  const validateStatus2 = response.config.validateStatus;
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
    resolve(response);
  } else {
    reject(new AxiosError$1(
      "Request failed with status code " + response.status,
      [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
      response.config,
      response.request,
      response
    ));
  }
}
function parseProtocol(url) {
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  return match && match[1] || "";
}
function speedometer(samplesCount, min) {
  samplesCount = samplesCount || 10;
  const bytes = new Array(samplesCount);
  const timestamps = new Array(samplesCount);
  let head = 0;
  let tail = 0;
  let firstSampleTS;
  min = min !== void 0 ? min : 1e3;
  return function push(chunkLength) {
    const now = Date.now();
    const startedAt = timestamps[tail];
    if (!firstSampleTS) {
      firstSampleTS = now;
    }
    bytes[head] = chunkLength;
    timestamps[head] = now;
    let i = tail;
    let bytesCount = 0;
    while (i !== head) {
      bytesCount += bytes[i++];
      i = i % samplesCount;
    }
    head = (head + 1) % samplesCount;
    if (head === tail) {
      tail = (tail + 1) % samplesCount;
    }
    if (now - firstSampleTS < min) {
      return;
    }
    const passed = startedAt && now - startedAt;
    return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  };
}
function throttle(fn, freq) {
  let timestamp = 0;
  let threshold = 1e3 / freq;
  let lastArgs;
  let timer;
  const invoke = (args2, now = Date.now()) => {
    timestamp = now;
    lastArgs = null;
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    fn.apply(null, args2);
  };
  const throttled = (...args2) => {
    const now = Date.now();
    const passed = now - timestamp;
    if (passed >= threshold) {
      invoke(args2, now);
    } else {
      lastArgs = args2;
      if (!timer) {
        timer = setTimeout(() => {
          timer = null;
          invoke(lastArgs);
        }, threshold - passed);
      }
    }
  };
  const flush = () => lastArgs && invoke(lastArgs);
  return [throttled, flush];
}
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
  let bytesNotified = 0;
  const _speedometer = speedometer(50, 250);
  return throttle((e) => {
    const loaded = e.loaded;
    const total = e.lengthComputable ? e.total : void 0;
    const progressBytes = loaded - bytesNotified;
    const rate = _speedometer(progressBytes);
    const inRange = loaded <= total;
    bytesNotified = loaded;
    const data = {
      loaded,
      total,
      progress: total ? loaded / total : void 0,
      bytes: progressBytes,
      rate: rate ? rate : void 0,
      estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
      event: e,
      lengthComputable: total != null,
      [isDownloadStream ? "download" : "upload"]: true
    };
    listener(data);
  }, freq);
};
const progressEventDecorator = (total, throttled) => {
  const lengthComputable = total != null;
  return [(loaded) => throttled[0]({
    lengthComputable,
    total,
    loaded
  }), throttled[1]];
};
const asyncDecorator = (fn) => (...args2) => utils$1.asap(() => fn(...args2));
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
  url = new URL(url, platform.origin);
  return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
})(
  new URL(platform.origin),
  platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
) : () => true;
const cookies = platform.hasStandardBrowserEnv ? (
  // Standard browser envs support document.cookie
  {
    write(name, value, expires, path, domain, secure) {
      const cookie = [name + "=" + encodeURIComponent(value)];
      utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
      utils$1.isString(path) && cookie.push("path=" + path);
      utils$1.isString(domain) && cookie.push("domain=" + domain);
      secure === true && cookie.push("secure");
      document.cookie = cookie.join("; ");
    },
    read(name) {
      const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
      return match ? decodeURIComponent(match[3]) : null;
    },
    remove(name) {
      this.write(name, "", Date.now() - 864e5);
    }
  }
) : (
  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {
    },
    read() {
      return null;
    },
    remove() {
    }
  }
);
function isAbsoluteURL(url) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
}
function combineURLs(baseURL, relativeURL) {
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
    return combineURLs(baseURL, requestedURL);
  }
  return requestedURL;
}
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
function mergeConfig$1(config1, config2) {
  config2 = config2 || {};
  const config = {};
  function getMergedValue(target, source, prop, caseless) {
    if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
      return utils$1.merge.call({ caseless }, target, source);
    } else if (utils$1.isPlainObject(source)) {
      return utils$1.merge({}, source);
    } else if (utils$1.isArray(source)) {
      return source.slice();
    }
    return source;
  }
  function mergeDeepProperties(a, b, prop, caseless) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(a, b, prop, caseless);
    } else if (!utils$1.isUndefined(a)) {
      return getMergedValue(void 0, a, prop, caseless);
    }
  }
  function valueFromConfig2(a, b) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(void 0, b);
    }
  }
  function defaultToConfig2(a, b) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(void 0, b);
    } else if (!utils$1.isUndefined(a)) {
      return getMergedValue(void 0, a);
    }
  }
  function mergeDirectKeys(a, b, prop) {
    if (prop in config2) {
      return getMergedValue(a, b);
    } else if (prop in config1) {
      return getMergedValue(void 0, a);
    }
  }
  const mergeMap = {
    url: valueFromConfig2,
    method: valueFromConfig2,
    data: valueFromConfig2,
    baseURL: defaultToConfig2,
    transformRequest: defaultToConfig2,
    transformResponse: defaultToConfig2,
    paramsSerializer: defaultToConfig2,
    timeout: defaultToConfig2,
    timeoutMessage: defaultToConfig2,
    withCredentials: defaultToConfig2,
    withXSRFToken: defaultToConfig2,
    adapter: defaultToConfig2,
    responseType: defaultToConfig2,
    xsrfCookieName: defaultToConfig2,
    xsrfHeaderName: defaultToConfig2,
    onUploadProgress: defaultToConfig2,
    onDownloadProgress: defaultToConfig2,
    decompress: defaultToConfig2,
    maxContentLength: defaultToConfig2,
    maxBodyLength: defaultToConfig2,
    beforeRedirect: defaultToConfig2,
    transport: defaultToConfig2,
    httpAgent: defaultToConfig2,
    httpsAgent: defaultToConfig2,
    cancelToken: defaultToConfig2,
    socketPath: defaultToConfig2,
    responseEncoding: defaultToConfig2,
    validateStatus: mergeDirectKeys,
    headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
  };
  utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
    const merge2 = mergeMap[prop] || mergeDeepProperties;
    const configValue = merge2(config1[prop], config2[prop], prop);
    utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  });
  return config;
}
const resolveConfig = (config) => {
  const newConfig = mergeConfig$1({}, config);
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
  if (auth) {
    headers.set(
      "Authorization",
      "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
    );
  }
  let contentType;
  if (utils$1.isFormData(data)) {
    if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
      headers.setContentType(void 0);
    } else if ((contentType = headers.getContentType()) !== false) {
      const [type, ...tokens2] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
      headers.setContentType([type || "multipart/form-data", ...tokens2].join("; "));
    }
  }
  if (platform.hasStandardBrowserEnv) {
    withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
    if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
      const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
      if (xsrfValue) {
        headers.set(xsrfHeaderName, xsrfValue);
      }
    }
  }
  return newConfig;
};
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
const xhrAdapter = isXHRAdapterSupported && function(config) {
  return new Promise(function dispatchXhrRequest(resolve, reject) {
    const _config = resolveConfig(config);
    let requestData = _config.data;
    const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
    let { responseType, onUploadProgress, onDownloadProgress } = _config;
    let onCanceled;
    let uploadThrottled, downloadThrottled;
    let flushUpload, flushDownload;
    function done() {
      flushUpload && flushUpload();
      flushDownload && flushDownload();
      _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
      _config.signal && _config.signal.removeEventListener("abort", onCanceled);
    }
    let request = new XMLHttpRequest();
    request.open(_config.method.toUpperCase(), _config.url, true);
    request.timeout = _config.timeout;
    function onloadend() {
      if (!request) {
        return;
      }
      const responseHeaders = AxiosHeaders$1.from(
        "getAllResponseHeaders" in request && request.getAllResponseHeaders()
      );
      const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
      const response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config,
        request
      };
      settle(function _resolve(value) {
        resolve(value);
        done();
      }, function _reject(err) {
        reject(err);
        done();
      }, response);
      request = null;
    }
    if ("onloadend" in request) {
      request.onloadend = onloadend;
    } else {
      request.onreadystatechange = function handleLoad() {
        if (!request || request.readyState !== 4) {
          return;
        }
        if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
          return;
        }
        setTimeout(onloadend);
      };
    }
    request.onabort = function handleAbort() {
      if (!request) {
        return;
      }
      reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
      request = null;
    };
    request.onerror = function handleError() {
      reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request));
      request = null;
    };
    request.ontimeout = function handleTimeout() {
      let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
      const transitional2 = _config.transitional || transitionalDefaults;
      if (_config.timeoutErrorMessage) {
        timeoutErrorMessage = _config.timeoutErrorMessage;
      }
      reject(new AxiosError$1(
        timeoutErrorMessage,
        transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
        config,
        request
      ));
      request = null;
    };
    requestData === void 0 && requestHeaders.setContentType(null);
    if ("setRequestHeader" in request) {
      utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
        request.setRequestHeader(key, val);
      });
    }
    if (!utils$1.isUndefined(_config.withCredentials)) {
      request.withCredentials = !!_config.withCredentials;
    }
    if (responseType && responseType !== "json") {
      request.responseType = _config.responseType;
    }
    if (onDownloadProgress) {
      [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
      request.addEventListener("progress", downloadThrottled);
    }
    if (onUploadProgress && request.upload) {
      [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
      request.upload.addEventListener("progress", uploadThrottled);
      request.upload.addEventListener("loadend", flushUpload);
    }
    if (_config.cancelToken || _config.signal) {
      onCanceled = (cancel) => {
        if (!request) {
          return;
        }
        reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
        request.abort();
        request = null;
      };
      _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
      if (_config.signal) {
        _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
      }
    }
    const protocol = parseProtocol(_config.url);
    if (protocol && platform.protocols.indexOf(protocol) === -1) {
      reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
      return;
    }
    request.send(requestData || null);
  });
};
const composeSignals = (signals, timeout) => {
  const { length } = signals = signals ? signals.filter(Boolean) : [];
  if (timeout || length) {
    let controller = new AbortController();
    let aborted;
    const onabort = function(reason) {
      if (!aborted) {
        aborted = true;
        unsubscribe();
        const err = reason instanceof Error ? reason : this.reason;
        controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
      }
    };
    let timer = timeout && setTimeout(() => {
      timer = null;
      onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
    }, timeout);
    const unsubscribe = () => {
      if (signals) {
        timer && clearTimeout(timer);
        timer = null;
        signals.forEach((signal2) => {
          signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
        });
        signals = null;
      }
    };
    signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
    const { signal } = controller;
    signal.unsubscribe = () => utils$1.asap(unsubscribe);
    return signal;
  }
};
const streamChunk = function* (chunk, chunkSize) {
  let len = chunk.byteLength;
  if (len < chunkSize) {
    yield chunk;
    return;
  }
  let pos = 0;
  let end;
  while (pos < len) {
    end = pos + chunkSize;
    yield chunk.slice(pos, end);
    pos = end;
  }
};
const readBytes = async function* (iterable, chunkSize) {
  for await (const chunk of readStream(iterable)) {
    yield* streamChunk(chunk, chunkSize);
  }
};
const readStream = async function* (stream) {
  if (stream[Symbol.asyncIterator]) {
    yield* stream;
    return;
  }
  const reader = stream.getReader();
  try {
    for (; ; ) {
      const { done, value } = await reader.read();
      if (done) {
        break;
      }
      yield value;
    }
  } finally {
    await reader.cancel();
  }
};
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
  const iterator2 = readBytes(stream, chunkSize);
  let bytes = 0;
  let done;
  let _onFinish = (e) => {
    if (!done) {
      done = true;
      onFinish && onFinish(e);
    }
  };
  return new ReadableStream({
    async pull(controller) {
      try {
        const { done: done2, value } = await iterator2.next();
        if (done2) {
          _onFinish();
          controller.close();
          return;
        }
        let len = value.byteLength;
        if (onProgress) {
          let loadedBytes = bytes += len;
          onProgress(loadedBytes);
        }
        controller.enqueue(new Uint8Array(value));
      } catch (err) {
        _onFinish(err);
        throw err;
      }
    },
    cancel(reason) {
      _onFinish(reason);
      return iterator2.return();
    }
  }, {
    highWaterMark: 2
  });
};
const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
const test = (fn, ...args2) => {
  try {
    return !!fn(...args2);
  } catch (e) {
    return false;
  }
};
const supportsRequestStream = isReadableStreamSupported && test(() => {
  let duplexAccessed = false;
  const hasContentType = new Request(platform.origin, {
    body: new ReadableStream(),
    method: "POST",
    get duplex() {
      duplexAccessed = true;
      return "half";
    }
  }).headers.has("Content-Type");
  return duplexAccessed && !hasContentType;
});
const DEFAULT_CHUNK_SIZE = 64 * 1024;
const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
const resolvers = {
  stream: supportsResponseStream && ((res) => res.body)
};
isFetchSupported && ((res) => {
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
    !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
      throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
    });
  });
})(new Response());
const getBodyLength = async (body) => {
  if (body == null) {
    return 0;
  }
  if (utils$1.isBlob(body)) {
    return body.size;
  }
  if (utils$1.isSpecCompliantForm(body)) {
    const _request = new Request(platform.origin, {
      method: "POST",
      body
    });
    return (await _request.arrayBuffer()).byteLength;
  }
  if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
    return body.byteLength;
  }
  if (utils$1.isURLSearchParams(body)) {
    body = body + "";
  }
  if (utils$1.isString(body)) {
    return (await encodeText(body)).byteLength;
  }
};
const resolveBodyLength = async (headers, body) => {
  const length = utils$1.toFiniteNumber(headers.getContentLength());
  return length == null ? getBodyLength(body) : length;
};
const fetchAdapter = isFetchSupported && (async (config) => {
  let {
    url,
    method,
    data,
    signal,
    cancelToken,
    timeout,
    onDownloadProgress,
    onUploadProgress,
    responseType,
    headers,
    withCredentials = "same-origin",
    fetchOptions
  } = resolveConfig(config);
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
  let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
  let request;
  const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
    composedSignal.unsubscribe();
  });
  let requestContentLength;
  try {
    if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
      let _request = new Request(url, {
        method: "POST",
        body: data,
        duplex: "half"
      });
      let contentTypeHeader;
      if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
        headers.setContentType(contentTypeHeader);
      }
      if (_request.body) {
        const [onProgress, flush] = progressEventDecorator(
          requestContentLength,
          progressEventReducer(asyncDecorator(onUploadProgress))
        );
        data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
      }
    }
    if (!utils$1.isString(withCredentials)) {
      withCredentials = withCredentials ? "include" : "omit";
    }
    const isCredentialsSupported = "credentials" in Request.prototype;
    request = new Request(url, {
      ...fetchOptions,
      signal: composedSignal,
      method: method.toUpperCase(),
      headers: headers.normalize().toJSON(),
      body: data,
      duplex: "half",
      credentials: isCredentialsSupported ? withCredentials : void 0
    });
    let response = await fetch(request);
    const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
    if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
      const options = {};
      ["status", "statusText", "headers"].forEach((prop) => {
        options[prop] = response[prop];
      });
      const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
      const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
        responseContentLength,
        progressEventReducer(asyncDecorator(onDownloadProgress), true)
      ) || [];
      response = new Response(
        trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
          flush && flush();
          unsubscribe && unsubscribe();
        }),
        options
      );
    }
    responseType = responseType || "text";
    let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
    !isStreamResponse && unsubscribe && unsubscribe();
    return await new Promise((resolve, reject) => {
      settle(resolve, reject, {
        data: responseData,
        headers: AxiosHeaders$1.from(response.headers),
        status: response.status,
        statusText: response.statusText,
        config,
        request
      });
    });
  } catch (err) {
    unsubscribe && unsubscribe();
    if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
      throw Object.assign(
        new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
        {
          cause: err.cause || err
        }
      );
    }
    throw AxiosError$1.from(err, err && err.code, config, request);
  }
});
const knownAdapters = {
  http: httpAdapter,
  xhr: xhrAdapter,
  fetch: fetchAdapter
};
utils$1.forEach(knownAdapters, (fn, value) => {
  if (fn) {
    try {
      Object.defineProperty(fn, "name", { value });
    } catch (e) {
    }
    Object.defineProperty(fn, "adapterName", { value });
  }
});
const renderReason = (reason) => `- ${reason}`;
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
const adapters = {
  getAdapter: (adapters2) => {
    adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
    const { length } = adapters2;
    let nameOrAdapter;
    let adapter;
    const rejectedReasons = {};
    for (let i = 0; i < length; i++) {
      nameOrAdapter = adapters2[i];
      let id2;
      adapter = nameOrAdapter;
      if (!isResolvedHandle(nameOrAdapter)) {
        adapter = knownAdapters[(id2 = String(nameOrAdapter)).toLowerCase()];
        if (adapter === void 0) {
          throw new AxiosError$1(`Unknown adapter '${id2}'`);
        }
      }
      if (adapter) {
        break;
      }
      rejectedReasons[id2 || "#" + i] = adapter;
    }
    if (!adapter) {
      const reasons = Object.entries(rejectedReasons).map(
        ([id2, state]) => `adapter ${id2} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
      );
      let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
      throw new AxiosError$1(
        `There is no suitable adapter to dispatch the request ` + s,
        "ERR_NOT_SUPPORT"
      );
    }
    return adapter;
  },
  adapters: knownAdapters
};
function throwIfCancellationRequested(config) {
  if (config.cancelToken) {
    config.cancelToken.throwIfRequested();
  }
  if (config.signal && config.signal.aborted) {
    throw new CanceledError$1(null, config);
  }
}
function dispatchRequest(config) {
  throwIfCancellationRequested(config);
  config.headers = AxiosHeaders$1.from(config.headers);
  config.data = transformData.call(
    config,
    config.transformRequest
  );
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
    config.headers.setContentType("application/x-www-form-urlencoded", false);
  }
  const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
  return adapter(config).then(function onAdapterResolution(response) {
    throwIfCancellationRequested(config);
    response.data = transformData.call(
      config,
      config.transformResponse,
      response
    );
    response.headers = AxiosHeaders$1.from(response.headers);
    return response;
  }, function onAdapterRejection(reason) {
    if (!isCancel$1(reason)) {
      throwIfCancellationRequested(config);
      if (reason && reason.response) {
        reason.response.data = transformData.call(
          config,
          config.transformResponse,
          reason.response
        );
        reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
      }
    }
    return Promise.reject(reason);
  });
}
const VERSION$1 = "1.9.0";
const validators$1 = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
  validators$1[type] = function validator2(thing) {
    return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
  };
});
const deprecatedWarnings = {};
validators$1.transitional = function transitional(validator2, version, message) {
  function formatMessage(opt, desc) {
    return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  }
  return (value, opt, opts) => {
    if (validator2 === false) {
      throw new AxiosError$1(
        formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
        AxiosError$1.ERR_DEPRECATED
      );
    }
    if (version && !deprecatedWarnings[opt]) {
      deprecatedWarnings[opt] = true;
      console.warn(
        formatMessage(
          opt,
          " has been deprecated since v" + version + " and will be removed in the near future"
        )
      );
    }
    return validator2 ? validator2(value, opt, opts) : true;
  };
};
validators$1.spelling = function spelling(correctSpelling) {
  return (value, opt) => {
    console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
    return true;
  };
};
function assertOptions(options, schema, allowUnknown) {
  if (typeof options !== "object") {
    throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
  }
  const keys = Object.keys(options);
  let i = keys.length;
  while (i-- > 0) {
    const opt = keys[i];
    const validator2 = schema[opt];
    if (validator2) {
      const value = options[opt];
      const result = value === void 0 || validator2(value, opt, options);
      if (result !== true) {
        throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
      }
      continue;
    }
    if (allowUnknown !== true) {
      throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
    }
  }
}
const validator = {
  assertOptions,
  validators: validators$1
};
const validators = validator.validators;
let Axios$1 = class Axios2 {
  constructor(instanceConfig) {
    this.defaults = instanceConfig || {};
    this.interceptors = {
      request: new InterceptorManager(),
      response: new InterceptorManager()
    };
  }
  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(configOrUrl, config) {
    try {
      return await this._request(configOrUrl, config);
    } catch (err) {
      if (err instanceof Error) {
        let dummy = {};
        Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
        const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
        try {
          if (!err.stack) {
            err.stack = stack;
          } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
            err.stack += "\n" + stack;
          }
        } catch (e) {
        }
      }
      throw err;
    }
  }
  _request(configOrUrl, config) {
    if (typeof configOrUrl === "string") {
      config = config || {};
      config.url = configOrUrl;
    } else {
      config = configOrUrl || {};
    }
    config = mergeConfig$1(this.defaults, config);
    const { transitional: transitional2, paramsSerializer, headers } = config;
    if (transitional2 !== void 0) {
      validator.assertOptions(transitional2, {
        silentJSONParsing: validators.transitional(validators.boolean),
        forcedJSONParsing: validators.transitional(validators.boolean),
        clarifyTimeoutError: validators.transitional(validators.boolean)
      }, false);
    }
    if (paramsSerializer != null) {
      if (utils$1.isFunction(paramsSerializer)) {
        config.paramsSerializer = {
          serialize: paramsSerializer
        };
      } else {
        validator.assertOptions(paramsSerializer, {
          encode: validators.function,
          serialize: validators.function
        }, true);
      }
    }
    if (config.allowAbsoluteUrls !== void 0) ;
    else if (this.defaults.allowAbsoluteUrls !== void 0) {
      config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
    } else {
      config.allowAbsoluteUrls = true;
    }
    validator.assertOptions(config, {
      baseUrl: validators.spelling("baseURL"),
      withXsrfToken: validators.spelling("withXSRFToken")
    }, true);
    config.method = (config.method || this.defaults.method || "get").toLowerCase();
    let contextHeaders = headers && utils$1.merge(
      headers.common,
      headers[config.method]
    );
    headers && utils$1.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      (method) => {
        delete headers[method];
      }
    );
    config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
    const requestInterceptorChain = [];
    let synchronousRequestInterceptors = true;
    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
      if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
        return;
      }
      synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
      requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
    });
    const responseInterceptorChain = [];
    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
      responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
    });
    let promise;
    let i = 0;
    let len;
    if (!synchronousRequestInterceptors) {
      const chain = [dispatchRequest.bind(this), void 0];
      chain.unshift.apply(chain, requestInterceptorChain);
      chain.push.apply(chain, responseInterceptorChain);
      len = chain.length;
      promise = Promise.resolve(config);
      while (i < len) {
        promise = promise.then(chain[i++], chain[i++]);
      }
      return promise;
    }
    len = requestInterceptorChain.length;
    let newConfig = config;
    i = 0;
    while (i < len) {
      const onFulfilled = requestInterceptorChain[i++];
      const onRejected = requestInterceptorChain[i++];
      try {
        newConfig = onFulfilled(newConfig);
      } catch (error) {
        onRejected.call(this, error);
        break;
      }
    }
    try {
      promise = dispatchRequest.call(this, newConfig);
    } catch (error) {
      return Promise.reject(error);
    }
    i = 0;
    len = responseInterceptorChain.length;
    while (i < len) {
      promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
    }
    return promise;
  }
  getUri(config) {
    config = mergeConfig$1(this.defaults, config);
    const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
    return buildURL(fullPath, config.params, config.paramsSerializer);
  }
};
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
  Axios$1.prototype[method] = function(url, config) {
    return this.request(mergeConfig$1(config || {}, {
      method,
      url,
      data: (config || {}).data
    }));
  };
});
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  function generateHTTPMethod(isForm) {
    return function httpMethod(url, data, config) {
      return this.request(mergeConfig$1(config || {}, {
        method,
        headers: isForm ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url,
        data
      }));
    };
  }
  Axios$1.prototype[method] = generateHTTPMethod();
  Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
});
let CancelToken$1 = class CancelToken2 {
  constructor(executor) {
    if (typeof executor !== "function") {
      throw new TypeError("executor must be a function.");
    }
    let resolvePromise;
    this.promise = new Promise(function promiseExecutor(resolve) {
      resolvePromise = resolve;
    });
    const token = this;
    this.promise.then((cancel) => {
      if (!token._listeners) return;
      let i = token._listeners.length;
      while (i-- > 0) {
        token._listeners[i](cancel);
      }
      token._listeners = null;
    });
    this.promise.then = (onfulfilled) => {
      let _resolve;
      const promise = new Promise((resolve) => {
        token.subscribe(resolve);
        _resolve = resolve;
      }).then(onfulfilled);
      promise.cancel = function reject() {
        token.unsubscribe(_resolve);
      };
      return promise;
    };
    executor(function cancel(message, config, request) {
      if (token.reason) {
        return;
      }
      token.reason = new CanceledError$1(message, config, request);
      resolvePromise(token.reason);
    });
  }
  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason) {
      throw this.reason;
    }
  }
  /**
   * Subscribe to the cancel signal
   */
  subscribe(listener) {
    if (this.reason) {
      listener(this.reason);
      return;
    }
    if (this._listeners) {
      this._listeners.push(listener);
    } else {
      this._listeners = [listener];
    }
  }
  /**
   * Unsubscribe from the cancel signal
   */
  unsubscribe(listener) {
    if (!this._listeners) {
      return;
    }
    const index2 = this._listeners.indexOf(listener);
    if (index2 !== -1) {
      this._listeners.splice(index2, 1);
    }
  }
  toAbortSignal() {
    const controller = new AbortController();
    const abort = (err) => {
      controller.abort(err);
    };
    this.subscribe(abort);
    controller.signal.unsubscribe = () => this.unsubscribe(abort);
    return controller.signal;
  }
  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let cancel;
    const token = new CancelToken2(function executor(c) {
      cancel = c;
    });
    return {
      token,
      cancel
    };
  }
};
function spread$1(callback) {
  return function wrap(arr) {
    return callback.apply(null, arr);
  };
}
function isAxiosError$1(payload) {
  return utils$1.isObject(payload) && payload.isAxiosError === true;
}
const HttpStatusCode$1 = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511
};
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
  HttpStatusCode$1[value] = key;
});
function createInstance(defaultConfig) {
  const context = new Axios$1(defaultConfig);
  const instance = bind(Axios$1.prototype.request, context);
  utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
  utils$1.extend(instance, context, null, { allOwnKeys: true });
  instance.create = function create(instanceConfig) {
    return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
  };
  return instance;
}
const axios = createInstance(defaults);
axios.Axios = Axios$1;
axios.CanceledError = CanceledError$1;
axios.CancelToken = CancelToken$1;
axios.isCancel = isCancel$1;
axios.VERSION = VERSION$1;
axios.toFormData = toFormData$1;
axios.AxiosError = AxiosError$1;
axios.Cancel = axios.CanceledError;
axios.all = function all2(promises) {
  return Promise.all(promises);
};
axios.spread = spread$1;
axios.isAxiosError = isAxiosError$1;
axios.mergeConfig = mergeConfig$1;
axios.AxiosHeaders = AxiosHeaders$1;
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode$1;
axios.default = axios;
const {
  Axios,
  AxiosError,
  CanceledError,
  isCancel,
  CancelToken,
  VERSION,
  all,
  Cancel,
  isAxiosError,
  spread,
  toFormData,
  AxiosHeaders,
  HttpStatusCode,
  formToJSON,
  getAdapter,
  mergeConfig
} = axios;
class Patcher {
  constructor() {
    __publicField(this, "blacklistedKeywords", ["cdn-cgi", "jquery", "jscolor"]);
    __publicField(this, "patched", []);
    __publicField(this, "observer");
  }
  start() {
    ("Called Patcher.start()...");
    this.observer = new MutationObserver((mutations) => {
      mutations.forEach((mutation) => {
        if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
          mutation.addedNodes.forEach(async (node) => {
            if (node.tagName === "SCRIPT" && !this.blacklistedKeywords.some((k) => node.src.includes(k)) && node.src.includes(location.host) && !this.patched.includes(node.src)) {
              ("MutationObserver Blocked script", node.src);
              this.patched.push(node.src);
              node.removeAttribute("src");
            }
          });
        }
      });
    });
    this.observer.observe(document.documentElement, {
      childList: true,
      subtree: true
    });
    [...document.querySelectorAll("script")].forEach((script) => {
      if (!this.blacklistedKeywords.some((k) => script.src.includes(k)) && script.src.includes(location.host) && !this.patched.includes(script.src)) {
        ("QuerySelector Blocked script", script.src);
        this.patched.push(script.src);
        script.removeAttribute("src");
      }
    });
  }
  async patch() {
    if (!window.$) {
      ("Called patch(), but jQuery was not detected. Waiting 100ms...");
      return setTimeout(() => this.patch(), 100);
    }
    ("Detected jQuery! Disconnecting Observer & Patching...");
    this.observer.disconnect();
    this.patched.forEach(async (script) => {
      try {
        let { data } = await axios.get(script);
        let filePatches = bb.patches.filter((e) => script.replace(location.origin, "").startsWith(e.file));
        for (const patch of filePatches) for (const replacement of patch.replacement) {
          if (replacement.setting && bb.plugins.settings[patch.plugin]?.[replacement.setting] === false) {
            ("Setting", replacement.setting, "is not active, ignoring...");
            continue;
          } else if (replacement.setting) ("Setting", replacement.setting, "is active, applying...");
          const matchRegex = new RegExp(replacement.match, "gm");
          if (!matchRegex.test(data)) {
            (`Patch did nothing! Plugin: ${patch.plugin}; Regex: \`${replacement.match}\`.`);
            continue;
          }
          ;
          data = data.replaceAll(matchRegex, replacement.replace.replaceAll("$self", `bb.plugins.list.find(a => a.name === '${patch.plugin}')`));
        }
        ;
        const url = URL.createObjectURL(new Blob([
          `// ${script.replace(location.origin, "")}${filePatches.map((p) => p.replacement).flat().length >= 1 ? ` - Patched by ${filePatches.map((p) => p.plugin).join(", ")}` : ``}
`,
          data
        ]));
        (`Patched ${script.replace(location.origin, "")}!`);
        let newScript = document.createElement("script");
        newScript.src = url;
        newScript.setAttribute("__nopatch", true);
        newScript.setAttribute("__src", newScript);
        document.head.appendChild(newScript);
      } catch (error) {
        console.error(`Error patching ${script}, ignoring file.`, error);
      }
    });
    let activeStyles = Object.entries(bb.plugins.styles).filter((style) => bb.plugins.active.includes(style[0])).map((s) => s[1]);
    document.head.insertAdjacentHTML("beforeend", `<style>${activeStyles.join("\n\n")}</style>`);
    ("Finished Patcher.start() & plugin style injection!");
  }
}
const patcher = new Patcher();
class Events {
  constructor() {
    __privateAdd(this, _subscriptions, /* @__PURE__ */ new Map());
    __publicField(this, "listen", (event, callback) => {
      (`Listening to event '${event}'...`);
      if (!__privateGet(this, _subscriptions).has(event)) __privateGet(this, _subscriptions).set(event, /* @__PURE__ */ new Set());
      __privateGet(this, _subscriptions).get(event).add(callback);
    });
    __publicField(this, "dispatch", (event, payload) => {
      (`Dispatching event '${event}'...`);
      if (__privateGet(this, _subscriptions).has(event))
        __privateGet(this, _subscriptions).get(event).forEach((callback) => callback(payload));
    });
  }
}
_subscriptions = new WeakMap();
const events = new Events();
class Modal {
  constructor({
    title,
    description,
    inputs,
    buttons,
    autoClose = true
  }) {
    __publicField(this, "element");
    __publicField(this, "autoClose");
    __publicField(this, "listening");
    __publicField(this, "listen", async () => {
      this.listening = true;
      return new Promise((resolve) => {
        [...document.querySelectorAll('[id*="bb_modalButton-"]')].forEach((button) => {
          button.addEventListener("click", () => {
            resolve({
              button: button.id.split("bb_modalButton-")[1],
              inputs: [...document.querySelectorAll('[id*="bb_modalInput-"]')].map((a) => {
                return {
                  name: a.placeholder,
                  value: a.value
                };
              })
            });
            if (this.autoClose) this.close();
          });
        });
      });
    });
    __publicField(this, "close", () => this.element.remove());
    if (document.querySelector("#modal")) return console.error("Cannot open more than one modal at once.");
    document.body.insertAdjacentHTML("beforeend", `
            <div class="arts__modal___VpEAD-camelCase" id="modal">
                <form class="styles__container___1BPm9-camelCase">
                    <div class="styles__text___KSL4--camelCase">${title}</div>
                    ${description ? `<div class="bb_modalDescription">${description}</div>` : ""}
                    <div class="styles__holder___3CEfN-camelCase">
                        ${inputs ? `<div style="flex-direction: column;" class="styles__numRow___xh98F-camelCase">
                            ${inputs.map(({ placeholder }, i) => `
                                <div class="bb_modalOuterInput">
                                    <input class="bb_modalInput" placeholder="${placeholder}" type="text" value="" id="${"bb_modalInput-" + i}" />
                                </div>
                            `).join("<br>")}
                        </div>` : ""}
                        ${buttons ? `<div class="styles__buttonContainer___2EaVD-camelCase">
                            ${buttons.map(({ text }, i) => `
                                <div class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0">
                                    <div class="styles__shadow___3GMdH-camelCase"></div>
                                    <div class="styles__edge___3eWfq-camelCase" style="background-color: #2f2f2f;"></div>
                                    <div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: #2f2f2f;" id="${"bb_modalButton-" + i}">${text}</div>
                                </div>
                            `).join("")}
                        </div>` : ""}
                    </div>
                </form>
            </div>
        `);
    this.element = document.querySelector("#modal");
    this.autoClose = autoClose;
    [...document.querySelectorAll('[id*="bb_modalButton-"]')].forEach((b) => b.addEventListener("click", () => !this.listening ? this.close() : null));
  }
}
class Storage {
  constructor() {
    __publicField(this, "storage", {});
    __publicField(this, "refresh", () => {
      Object.keys(localStorage).forEach((key) => delete localStorage[key]);
      Object.entries(this.storage).forEach(([key, value]) => localStorage.setItem(key, value));
      return this.storage;
    });
    __publicField(this, "get", (key, parse, fallback = null) => {
      if (!this.storage[key]) return fallback;
      if (parse) return JSON.parse(this.storage[key]);
      return this.storage[key];
    });
    __publicField(this, "set", (key, value, stringify) => {
      if (stringify) this.storage[key] = JSON.stringify(value);
      else this.storage[key] = value;
      return this.refresh();
    });
    Object.entries(localStorage).forEach(([key, value]) => this.storage[key] = value);
  }
}
const storage = new Storage();
const loadThemes = async (single) => {
  ("Called loadThemes()");
  bb.themes.list = [];
  bb.themes.broken = [];
  [...document.querySelectorAll("[id*='bb-theme']")].forEach((v) => v.remove());
  let themes = storage.get("bb_themeData", true).active.filter((a) => a.trim() !== "");
  for (let theme of themes) axios.get(theme).then(async (res) => {
    let data = res.data;
    let meta = {};
    const matches = data.match(/\/\*\*\s*\n([\s\S]*?)\*\//s)[1].split("\n");
    if (matches) matches.forEach((input) => {
      let match = /@(\w+)\s+([\s\S]+)/g.exec(input);
      if (match) meta[match[1]] = match[2].trim();
    });
    else return bb.themes.broken.push({
      url: theme,
      reason: "Theme metadata could not be found."
    });
    const themeStyle = document.createElement("style");
    themeStyle.id = `bb-theme-${btoa(Math.random().toString(36).slice(2))}`;
    themeStyle.innerHTML = data;
    bb.themes.list.push({
      element: themeStyle,
      name: meta.name,
      meta,
      url: theme
    });
    document.head.appendChild(themeStyle);
    (`Loaded theme "${meta.name}".`);
    bb.events.dispatch("themeUpdate");
  }).catch((err) => {
    ("Failed to load theme: " + theme + " - ", err.message);
    bb.themes.broken.push({
      url: theme,
      reason: "Theme could not be loaded."
    });
    bb.events.dispatch("themeUpdate");
  });
  if (single) ("Reloaded themes.");
  else ("Finished initial theme load function.");
};
const createPlugin = ({
  name,
  description,
  authors,
  patches,
  settings,
  styles,
  onLoad,
  onStart,
  required,
  disabled,
  ...custom
}) => {
  if (!name || !authors?.length || !onLoad && !onStart && !patches && !styles) return console.error(`ERROR: Plugin does not have a title, authors, or executable functions.`);
  let plugin = {
    name,
    description: description || "No description.",
    authors,
    patches: patches || [],
    settings: settings || [],
    styles: styles || ``,
    onLoad: onLoad || (() => {
    }),
    onStart: onStart || (() => {
    }),
    required: required || false,
    disabled: disabled || false,
    ...custom
  };
  return plugin;
};
const index$l = () => createPlugin({
  name: "Advanced Opener",
  description: "the fastest way to mass open blacket packs.",
  authors: [
    { name: "Syfe", avatar: "https://i.imgur.com/OKpOipQ.gif", url: "https://github.com/ItsSyfe" },
    { name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" },
    { name: "C00LESTKIDDEVER", avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png", url: "https://c00lestkiddever.nekoweb.org/" }
  ],

  styles: `
    .bb_openModal {
      font-family: "Nunito", sans-serif;
      font-size: 1vw;

      min-width: 220px;
      min-height: 160px;

      width: 22vw;
      height: 32vw;

      border: 3px solid #262626;
      background: #2f2f2f;

      position: fixed;
      bottom: 1vw;
      right: 1vw;

      border-radius: 7.5px;
      text-align: center;
      color: white;

      overflow: hidden;
      padding: 2vw;

      resize: both;
      z-index: 99999;
      box-sizing: border-box;
    }

    .bb_openIcons {
      position: absolute;
      right: 1vw;
      top: 1vw;
      font-size: 1.2vw;
      display: flex;
      gap: 0.5vw;
      z-index: 5;
    }

    .bb_openIcon {
      cursor: pointer;
      user-select: none;
    }

    .bb_openTitle {
      font-size: 2vw;
      font-weight: 1000;
      user-select: none;
    }

    .bb_openedCount {
      font-weight: 800;
      font-size: 1.2vw;
      margin-top: 0.7vw;
      padding-bottom: 0.7vw;
      word-break: break-word;
    }

    .bb_opened {
      margin-top: 1vw;
      height: calc(100% - 10vw);
      overflow: auto;

      -ms-overflow-style: none;
      scrollbar-width: none;
    }

    .bb_opened::-webkit-scrollbar {
      display: none;
    }

    .bb_openResult {
      font-size: 1vw;
      margin-top: 0.3vw;
      font-weight: 600;
      word-break: break-word;
    }

.bb_openButtons {
  position: absolute;
  bottom: 1vw;
  left: 2vw;
  right: 2vw;

  display: flex;
  flex-direction: column;
  gap: 0.5vw;
}

.bb_pauseButton {
  font-size: 1.1vw;
  cursor: pointer;

  width: 100%;
  height: 2.2vw;

  min-height: 35px;

  border: 4px solid white;
  border-radius: 0.4vw;

  display: flex;
  justify-content: center;
  align-items: center;

  user-select: none;
}

    .bb_openButton {
      font-size: 1.1vw;
      cursor: pointer;

      width: 100%;
      height: 2.2vw;

      min-height: 35px;

      border: 4px solid white;
      border-radius: 0.4vw;

      display: flex;
      justify-content: center;
      align-items: center;

      user-select: none;
    }

    .bb_resizeHandle {
      position: absolute;
      right: 0;
      bottom: 0;

      width: 18px;
      height: 18px;

      cursor: nwse-resize;
      z-index: 10;
    }

    .bb_resizeHandle::after {
      content: "";
      position: absolute;
      right: 4px;
      bottom: 4px;

      width: 10px;
      height: 10px;

      border-right: 2px solid rgba(255,255,255,0.5);
      border-bottom: 2px solid rgba(255,255,255,0.5);
    }
  `,

  onStart: () => {
    if (!location.pathname.startsWith("/market")) return;

    bb.plugins.massopen = {};

    bb.plugins.massopen.start = async () => {

      let packModal = new bb.Modal({
        title: "Mass Open",
        inputs: [{ placeholder: "Pack" }],
        buttons: [{ text: "Next" }, { text: "Cancel" }]
      });

      let packResponse = await packModal.listen();
      if (packResponse.button !== "0") return;

      let pack = packResponse.inputs[0].value;

      if (!blacket.packs[pack]) return new bb.Modal({
        title: "I cannot find that pack.",
        buttons: [{ text: "Close" }]
      });

      let countModal = new bb.Modal({
  title: "Mass Open",
  description:
    "Enter either packs or tokens. If both are filled, tokens will be used.",
  inputs: [
    { placeholder: "Packs to open" },
    { placeholder: "Tokens to spend" }
  ],
  buttons: [{ text: "Next" }, { text: "Cancel" }]
});

let countResponse = await countModal.listen();
if (countResponse.button !== "0") return;

let packInputRaw = countResponse.inputs[0].value;
let tokenInputRaw = countResponse.inputs[1].value;

let packInput = Number(packInputRaw);
let tokenInput = Number(tokenInputRaw);

let packPrice = blacket.packs[pack].price;

let qty;

// ---- TOKENS MODE (priority) ----
if (tokenInputRaw !== "" && !isNaN(tokenInput) && tokenInput > 0) {
  qty = Math.floor(tokenInput / packPrice);
}

// ---- PACKS MODE ----
else if (packInputRaw !== "" && !isNaN(packInput) && packInput > 0) {
  qty = Math.floor(packInput);
}

// ---- INVALID INPUT ----
else {
  return new bb.Modal({
    title: "Invalid input.",
    buttons: [{ text: "Close" }]
  });
}

// ---- FINAL VALIDATION ----
if (!Number.isFinite(qty) || qty <= 0) {
  return new bb.Modal({
    title: "You must open at least 1 pack.",
    buttons: [{ text: "Close" }]
  });
}

// ---- COST (based on actual qty used) ----
let cost = qty * packPrice;

if (blacket.user.tokens < cost) {
  return new bb.Modal({
    title: "You do not have enough tokens!",
    description: `You need ${cost.toLocaleString()} tokens.`,
    buttons: [{ text: "Close" }]
  });
}
      let extraDelayModal = new bb.Modal({
        title: "Mass Open",
        description: "you can leave this at zero (nothing) if you're not going to be using blacket while running the opener, otherwise recommended is 50-75",
        inputs: [{ placeholder: "Extra Delay" }],
        buttons: [{ text: "Next" }, { text: "Cancel" }]
      });

      let extraDelayResponse = await extraDelayModal.listen();
      if (extraDelayResponse.button !== "0") return;

      let extraDelay = Number(extraDelayResponse.inputs[0].value);

      if (isNaN(extraDelay)) return new bb.Modal({
        title: "Invalid Extra Delay.",
        buttons: [{ text: "Close" }]
      });

      let confirmModal = new bb.Modal({
        title: "Mass Open",
        description: `Are you sure you want to open ${qty.toLocaleString()}x ${pack}? This will cost ${cost.toLocaleString()} tokens!`,
        buttons: [{ text: "Start!" }, { text: "Cancel" }]
      });

let confirmResponse = await confirmModal.listen();
if (confirmResponse.button !== "0") return;

let opened = [];
let openedCount = 0;

let paused = false;
let stopped = false;

const stopButton = document.querySelector(".bb_openButton");
const pauseButton = document.querySelector(".bb_pauseButton");

pauseButton.style.display = "flex";

stopButton.innerText = "Stop Opening";

stopButton.onclick = () => {
  stopped = true;
  pauseButton.style.display = "none";
};

pauseButton.innerText = "Pause Opening";

pauseButton.onclick = () => {
  paused = !paused;

  pauseButton.innerText =
    paused ? "Resume Opening" : "Pause Opening";
};

      let maxDelay = Object.values(blacket.rarities)
        .map((x) => x.wait)
        .reduce((curr, prev) => curr > prev ? curr : prev) + extraDelay;

      let openPack = async () => new Promise((resolve, reject) => {
        blacket.requests.post("/worker3/open", { pack }, (data) => {
          if (data.error) reject();
          resolve(data.blook);
        });
      });

      while (openedCount < qty && !stopped) {

  while (paused && !stopped) {
    await new Promise((r) => setTimeout(r, 150));
  }

  try {

          const attainedBlook = await openPack();

          blacket.user.tokens -= blacket.packs[pack].price;

          $("#tokenBalance").html(`
            <img loading="lazy"
              src="/content/tokenIcon.webp"
              alt="Token"
              class="styles__tokenBalanceIcon___3MGhs-camelCase"
              draggable="false">
            <div>${blacket.user.tokens.toLocaleString()}</div>
          `);

          const delay =
            blacket.rarities[blacket.blooks[attainedBlook].rarity].wait
            - 45
            + extraDelay;

          opened.push(attainedBlook);
          openedCount = opened.length;

          let count = opened.reduce((acc, blook) => {
            acc[blook] = (acc[blook] || 0) + 1;
            return acc;
          }, {});

          document.querySelector(".bb_openedCount").innerHTML =
            `${pack} | ${openedCount}/${qty} opened`;

          document.querySelector(".bb_opened").innerHTML =
            Object.entries(count).map(([blook, qtyOf]) => {
              return `
                <div class="bb_openResult"
                  style="color:${blacket.rarities[blacket.blooks[blook].rarity].color};">
                  ${blook} x${qtyOf}
                </div>
              `;
            }).join("");

          await new Promise((r) => setTimeout(r, delay));

        } catch (err) {

          (err);

          await new Promise((r) => setTimeout(r, maxDelay));
        }
      }

      if (stopped) {
  alert(`Opening stopped after ${openedCount.toLocaleString()} packs.`);
} else {
  alert(`Open Complete! Opened ${qty}x ${pack}, spending ${cost.toLocaleString()} tokens!`);
}

document.querySelector(".bb_openedCount").innerHTML = "Opening ended!";

paused = false;
stopped = false;

stopButton.innerText = "Start Opening";
stopButton.onclick = () => bb.plugins.massopen.start();

pauseButton.innerText = "Pause Opening";
pauseButton.onclick = null;
pauseButton.style.display = "none";
    };

    document.body.insertAdjacentHTML("beforeend", `
      <div class="bb_openModal">

        <div class="bb_openIcons">
          <i class="fas fa-arrows-up-down-left-right bb_openIcon" id="bb_openDragger"></i>
          <i class="fas fa-x bb_openIcon"
             onclick="document.querySelector('.bb_openModal').remove()"></i>
        </div>

        <div class="bb_openTitle">Pack Opening</div>

        <div class="bb_openedCount">
          Waiting to open...
        </div>

        <hr>

        <div class="bb_opened"></div>

        <div class="bb_openButtons">
  <div class="bb_pauseButton" style="display:none;">
  Pause Opening
</div>

  <div class="bb_openButton"
       onclick="bb.plugins.massopen.start()">
    Start Opening
  </div>
</div>

        <div class="bb_resizeHandle"></div>

      </div>
    `);

    let pos1 = 0,
        pos2 = 0,
        pos3 = 0,
        pos4 = 0;

    let modal = document.querySelector(".bb_openModal");
    let dragger = document.querySelector("#bb_openDragger");

    dragger.onmousedown = (e) => {

      e.preventDefault();

      pos3 = e.clientX;
      pos4 = e.clientY;

      document.onmouseup = () => {
        document.onmouseup = null;
        document.onmousemove = null;
      };

      document.onmousemove = (e2) => {

        e2.preventDefault();

        pos1 = pos3 - e2.clientX;
        pos2 = pos4 - e2.clientY;

        pos3 = e2.clientX;
        pos4 = e2.clientY;

        let top =
          modal.offsetTop - pos2 > 0
          ? modal.offsetTop - pos2
          : 0;

        let left =
          modal.offsetLeft - pos1 > 0
          ? modal.offsetLeft - pos1
          : 0;

        modal.style.top = top + "px";
        modal.style.left = left + "px";
      };
    };

    window.onresize = () => {
      modal.style.top = "";
      modal.style.left = "";
    };
  }
});
const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$l }, Symbol.toStringTag, { value: "Module" }));
const index$k = () => createPlugin({
  name: "April Fools 2023",
  description: "returns the 2023 april fools update.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  styles: `
        .styles__sidebar___1XqWi-camelCase,
        .styles__left___9beun-camelCase,
        .styles__postsContainer___39_IQ-camelCase,
        .styles__middleWrapper___hjUyY-camelCase,
        .styles__header___22Ne2-camelCase,
        .styles__container___2VzTy-camelCase,
        .styles__input___2XTSp-camelCase {
            background-color: #dcd9d9;
        }

        .styles__background___2J-JA-camelCase,
        .styles__background___2J-JA-camelCase,
        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #b5b5b5;
        }

        .styles__headerBadges___ffKa4-camelCase,
        .styles__statsContainer___QnrRB-camelCase,
        .styles__profileContainer___CSuIE-camelCase,
        .styles__tokenBalance___1FHgT-camelCase,
        .styles__infoContainer___2uI-S-camelCase,
        .styles__header___2O21B-camelCase,
        .styles__cardContainer___NGmjp-camelCase,
        .styles__plan___1OEy4-camelCase,
        .styles__perkContainer___2rw2I-camelCase,
        .styles__headerSide___1r1-b-camelCase,
        .styles__signUpButton___3_ch3-camelCase,
        .styles__loginButton___1e3jI-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase,
        .styles__button___2hNZo-camelCase,
        .styles__tradingContainer___B1ABS-camelCase,
        .styles__otherTokenAmount___SEGGS-camelCase,
        .styles__myTokenAmount___ANKHA-camelCase,
        .styles__horizontalBlookGridLine___4SAvz-camelCase,
        .styles__verticalBlookGridLine___rQWaZ-camelCase,
        .styles__profileDropdownMenu___2jUAA-camelCase,
        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #9d9d9d;
        }

        .styles__button___2hNZo-camelCase {
            color: #3a3a3a;
        }

        .styles__pageButton___1wFuu-camelCase,
        .styles__bottomIcon___3Fswk-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__statNum___5RYSd-camelCase {
            color: #5f5a5a;
        }
        .styles__statContainer___QKuOF-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__containerHeader___3xghM-camelCase,
        .styles__containerHeaderRight___3xghM-camelCase {
            background-color: #d5d4d4;
        }

        #chatBox,
        .styles__chatInputContainer___gkR4A-camelCase  {
            background-color: #d2cccc;
        }

        .styles__setText___1PQLQ-camelCase {
            color: #3a3939;
        }

        .styles__edge___3eWfq-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #ffffff;
            border-color: #ffffff;
        }

        .styles__lockedBlook___3oGaX-camelCase {
            filter: brightness(0.3);
        }

        #packSelector::-webkit-scrollbar,
        #blookSelector::-webkit-scrollbar,
        .styles__bazaarItems___KmNa2-camelCase::-webkit-scrollbar {
            display: none;
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: rgba(0, 0, 0, 0.33);
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #9d9d9d;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #3a3939;
        }

        .styles__container___3St5B-camelCase {
            background-color: #808080;
        }
    `,
  onLoad: () => {
    if (document.getElementsByClassName("styles__topRightRow___dQvxc-camelCase")[0] && location.pathname === "/market") {
      document.getElementsByClassName("styles__topRightRow___dQvxc-camelCase")[0].children[0].style.backgroundColor = "#9d9d9d";
    }
    if (document.getElementsByClassName("styles__front___vcvuy-camelCase")[0] && location.pathname === "/blooks" || location.pathname === "/store" || location.pathname === "/bazaar") {
      Array.from(document.getElementsByClassName("styles__front___vcvuy-camelCase")).forEach((a) => {
        a.style.backgroundColor = "#9d9d9d";
      });
      Array.from(document.getElementsByClassName("styles__edge___3eWfq-camelCase")).forEach((a) => {
        a.style.backgroundColor = "#9d9a9a";
      });
      setInterval(() => {
        Array.from(document.getElementsByClassName("styles__front___vcvuy-camelCase")).forEach((a) => {
          a.style.backgroundColor = "#9d9d9d";
        });
        Array.from(document.getElementsByClassName("styles__edge___3eWfq-camelCase")).forEach((a) => {
          a.style.backgroundColor = "#9d9a9a";
        });
      }, 25);
    }
    if (document.getElementsByTagName("div")[0] && location.pathname === "/404" || location.pathname === "/502/" || location.pathname === "/blacklisted") {
      document.getElementsByTagName("div")[0].style.backgroundColor = "#b5b5b5";
      document.getElementsByTagName("div")[2].style.backgroundColor = "#d5d4d4";
      document.getElementsByTagName("div")[2].style.filter = "drop-shadow(white 0px 1px 3px)";
    }
    if (document.getElementsByClassName("styles__background___2J-JA-camelCase")[0] && location.pathname === "/trade" || location.pathname === "/store") {
      document.getElementsByClassName("styles__background___2J-JA-camelCase")[0].style.backgroundColor = "#b5b5b5";
    }
    Array.from(document.getElementsByTagName("input")).forEach((n) => {
      n.style.backgroundColor = "#9d9d9d";
    });
    setInterval(() => {
      Array.from(document.getElementsByTagName("div")).forEach((n) => {
        n.style.fontFamily = "Comic Sans MS";
      });
      Array.from(document.getElementsByTagName("a")).forEach((n) => {
        n.style.fontFamily = "Comic Sans MS";
      });
      Array.from(document.getElementsByTagName("text")).forEach((n) => {
        n.style.fontFamily = "Comic Sans MS";
      });
      Array.from(document.getElementsByTagName("div")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => node.nodeValue = node.nodeValue.toLowerCase());
      });
      Array.from(document.getElementsByTagName("a")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => node.nodeValue = node.nodeValue.toLowerCase());
      });
      Array.from(document.getElementsByTagName("text")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => node.nodeValue = node.nodeValue.toLowerCase());
      });
    }, 25);
    setTimeout(() => {
      Array.from(document.getElementsByTagName("div")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => {
          let letters = node.nodeValue.split("");
          let randomIndex = Math.floor(Math.random() * letters.length);
          let randomIndex2 = Math.floor(Math.random() * letters.length);
          let temp = letters[randomIndex];
          letters[randomIndex] = letters[randomIndex2];
          letters[randomIndex2] = temp;
          node.nodeValue = letters.join("");
        });
      });
      Array.from(document.getElementsByTagName("a")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => {
          let letters = node.nodeValue.split("");
          let randomIndex = Math.floor(Math.random() * letters.length);
          let randomIndex2 = Math.floor(Math.random() * letters.length);
          let temp = letters[randomIndex];
          letters[randomIndex] = letters[randomIndex2];
          letters[randomIndex2] = temp;
          node.nodeValue = letters.join("");
        });
      });
      Array.from(document.getElementsByTagName("text")).forEach((n) => {
        let textNodes = Array.from(n.childNodes).filter((node) => node.nodeType === 3);
        textNodes.forEach((node) => {
          let letters = node.nodeValue.split("");
          let randomIndex = Math.floor(Math.random() * letters.length);
          let randomIndex2 = Math.floor(Math.random() * letters.length);
          let temp = letters[randomIndex];
          letters[randomIndex] = letters[randomIndex2];
          letters[randomIndex2] = temp;
          node.nodeValue = letters.join("");
        });
      });
    }, 500);
  }
});
const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$k }, Symbol.toStringTag, { value: "Module" }));
const index$j = () => createPlugin({
  name: "Bazaar Sniper",
  description: "pew pew! sniped right off the bazaar!",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  onStart: () => {
    let checkBazaar = setInterval(() => {
      if (blacket.login || blacket.config.path === "") return clearInterval(checkBazaar);
      if (!blacket.user) return;
      axios.get("/worker/bazaar").then((bazaar) => {
        bazaar.data.bazaar.forEach((bazaarItem) => {
          let blookData = blacket.blooks[bazaarItem.item];
          if (!!!blookData || blookData.price < bazaarItem.price || bazaarItem.seller === blacket.user.username) return;
          axios.post("/worker/bazaar/buy", { id: bazaarItem.id }).then((purchase) => {
            if (purchase.data.error) return console.log(`[Bazaar Sniper] Error sniping Blook`, bazaarItem, purchase);
            console.log(`[Bazaar Sniper] Sniped a blook!`, bazaarItem);
            blacket.createToast({ message: `Sniped Blook ${bazaarItem.item} from seller ${bazaarItem.seller} with price ${bazaarItem.price}!` });
          });
        });
      });
    }, 750);
  }
});
const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$j }, Symbol.toStringTag, { value: "Module" }));
const index$i = () => createPlugin({
  name: "Better Chat",
  description: "enhances your chatting experience!",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /id="\${randomUsernameId}"/,
          replace: "",
          setting: "Click 2 Clan"
        },
        {
          match: /style="color: \${data\.author\.co/,
          replace: `id="\${randomUsernameId}" style="color: \${data.author.co`,
          setting: "Click 2 Clan"
        },
        {
          match: /style="color: \${data\.author\.clan\.color};"/,
          replace: `onclick="window.open('/clans/discover?name=\${encodeURIComponent(data.author.clan.name)}');" style="color: \${data.author.clan.color};"`,
          setting: "Click 2 Clan"
        },
        {
          match: /\$\{blacket\.config\.path !== "trade" \? `<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" id="message-context-quote">/,
          replace: `\${(data.author.id !== blacket.user.id) && blacket.config.path !== "trade" ? \`<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" id="message-context-trade">
                        <div class="styles__contextMenuItemName___vj9a3-camelCase">Trade</div>
                        <i class="styles__contextMenuItemIcon___2Zq3a-camelCase fas fa-hand-holding"></i>
                    </div>\` : ""}

                    \${blacket.config.path !== "trade" ? \`<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" id="message-context-quote">`
        },
        {
          match: /\$\(`#message-context-copy-id`\)\.click\(\(\) => navigator\.clipboard\.writeText\(data\.message\.id\)\);/,
          replace: `$('message-context-trade').click(() => blacket.tradeUser(data.author.id));
                    $(\`#message-context-copy-id\`).click(() => navigator.clipboard.writeText(data.message.id));`
        }
      ]
    }
  ],
  styles: `
        .styles__chatMessageContainer__G1Z4P-camelCase {
            padding: 1vw 1.5vw;
        }

        .styles__chatContainer___iA8ZU-camelCase {
            height: calc(100% - 4.25vw);
        }

        div[style="position: absolute;bottom: 0;width: 100%;"] {
            bottom: 1.25vw !important;
            left: 2vw;
            width: calc(100% - 3vw) !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            border-radius: 10vw;
        }

        .styles__chatUploadButton___g39Ac-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase {
            border-radius: 50%;
        }

        .styles__chatEmojiPickerContainer___KR4aN-camelCase {
            border-radius: 0 0 0.5vw 0.5vw;
            bottom: 3.3vw;
            background-color: #2f2f2f;
            width: 19vw;
        }

        .styles__chatEmojiPickerBody___KR4aN-camelCase {
            left: unset;
            gap: 0.5vw;
            justify-content: center;
        }

        .styles__chatEmojiPickerHeader___FK4Ac-camelCase {
            font-size: 1.15vw;
            height: 3vw;
            font-weight: 800;
            background-color: #3f3f3f;
        }
    `,
  settings: [{
    name: "Click 2 Clan",
    default: true
  }]
});
const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$i }, Symbol.toStringTag, { value: "Module" }));
const index$h = () => createPlugin({
  name: "Better Notifications",
  description: "a new and improved notification system.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],

  patches: [
    {
      file: "/lib/js/all.js",
      replacement: [
        {
          match: /\.styles__toastContainer___o4pCa-camelCase/,
          replace: `.toastMessage`
        },
        {
          match: /\$\("body"\)\.append\(`<div class="s.*?<\/div><\/div>`\)/,
          replace: `
let icon = "";
try {
  icon = toast.icon || toast.img || "";
} catch {}

bb.plugins.notifications(toast.title, toast.message, toast.audio, icon);
return;
`
        }
      ]
    },
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /Notification\.permission == "granted"/,
          replace: "false",
          setting: "Disable Desktop"
        },
        {
          match: /Notification\.permission !== "granted" && Notification\.permission !== "denied"/,
          replace: "false",
          setting: "Disable Desktop"
        },
        {
          match: /3500/,
          replace: "1000"
        },
        {
          match: /flyOut 0\.35s ease-in-out/,
          replace: `styles__oldGrowOut___3FTko-camelCase 0.5s linear`
        },
        {
          match: /flyIn 0.35s ease-in-out/,
          replace: `styles__oldGrowIn___3FTko-camelCase 0.5s linear`
        }
      ]
    }
  ],

  styles: `
.toastMessage {
  animation: styles__oldGrowIn___3FTko-camelCase 0.5s linear forwards;
  background-color: #1f1f1f;
  border-radius: 5px;
  left: 0;
  right: 0;
  text-align: center;
  top: 20px;
  display: flex;
  flex-direction: column;
  padding: 5px 20px 10px 20px;
  position: absolute;
  margin: 0 auto;
  height: fit-content;
  cursor: pointer;
}
  `,

  onLoad: () => {

    const key = "betterNotifications_settings";

    // =========================
    // LOAD SETTINGS
    // =========================
    const saved = JSON.parse(localStorage.getItem(key) || "{}");

    const settingsObj = bb.plugins.settings["Better Notifications"] = {
      "Disable Desktop": false,
      "Show Icons": true,
      ...saved
    };

    // =========================
    // AUTO-SAVE (RELIABLE)
    // =========================
    let lastSnapshot = JSON.stringify(settingsObj);

    const save = () => {
      localStorage.setItem(key, JSON.stringify(settingsObj));
    };

    // Poll for changes (works with UI systems that mutate directly)
    setInterval(() => {
      const current = JSON.stringify(settingsObj);

      if (current !== lastSnapshot) {
        lastSnapshot = current;
        save();
      }
    }, 300);

    // =========================
    // ICON FLAG
    // =========================
    bb.plugins.notificationsShowIcons = () =>
      bb.plugins.settings["Better Notifications"]["Show Icons"] ?? true;

    // =========================
    // NOTIFICATIONS
    // =========================
    bb.plugins.notifications = (title, message, audio = true, icon = "") => {
      let id2 = Math.random().toString(36).substring(2, 15);

      const showIcons = bb.plugins.notificationsShowIcons();

      $("#app").append(`
        <div id='${id2}' class='toastMessage'>
          <div style="display:flex; align-items:center; justify-content:center; gap:8px;">

            ${showIcons ? `
              <img class="styles__toastIcon___vna3A-camelCase"
                src="${icon || '/content/blooks/Info.webp'}"
                style="width:100px; height:110px;">
            ` : ""}

            <div style="display:flex; flex-direction:column;">
              ${title ? `<text style='color: white; font-size:25px;'>${title}</text>` : ""}
              ${message ? `<text style='color: white; font-size:20px;'>${message}</text>` : ""}
            </div>

          </div>
        </div>
      `);

      let timeout = setTimeout(() => {
        document.getElementById(id2).onclick = null;

        $(`#${id2}`).attr(
          "style",
          "animation: styles__oldGrowOut___3FTko-camelCase 0.5s linear forwards;"
        );

        setTimeout(() => {
          $(`#${id2}`).remove();
          blacket.toasts.shift();
          if (blacket.toasts.length > 0)
            blacket.createToast(blacket.toasts[0], true);
        }, 1000);
      }, 5000);

      document.getElementById(id2).onclick = () => {
        clearTimeout(timeout);
        $(`#${id2}`).remove();
        blacket.toasts.shift();
        if (blacket.toasts.length > 0)
          blacket.createToast(blacket.toasts[0], true);
      };
    };
  },

  settings: [
    {
      name: "Disable Desktop",
      default: false
    },
    {
      name: "Show Icons",
      default: true
    }
  ]
});
const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$h }, Symbol.toStringTag, { value: "Module" }));
const index$g = () => createPlugin({
  name: "Better Replies",
  description: "overhauls the message reply system.",
  authors: [
    { name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" },
    { name: "Syfe", avatar: "https://i.imgur.com/OKpOipQ.gif", url: "https://github.com/ItsSyfe" }
  ],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /var tem \= document\.querySelector\('\#chatContainer \.styles__chatMessageContainer__G1Z4P\-camelCase\:last\-child'\);/,
          replace: `
                        message = message.replace(/&lt;\\/gradient=.*&gt;/, '');
                        message = message.replace(/&lt;gradient=.*&gt;/, '');
                        message = message.replace(/&lt;\\/#.*&gt;/, '');
                        message = message.replace(/&lt;#.*&gt;/, '');
                        var tem = document.querySelector('#chatContainer .styles__chatMessageContainer__G1Z4P-camelCase:last-child');
                    `
        },
        {
          match: /quote`\).click\(\(\) => \{/,
          replace: `quote\`).click(() => {return;`
        },
        {
          match: /\$\(`\#message-context-copy`\)/,
          replace: `$('#message-context-quote').click(() => $self.quote(data));$('#message-context-copy')`
        },
        {
          match: /\$\(`\#message-\$\{data.message.id\}-r/,
          replace: `$(\`#message-\${data.message.id}-quote\`).click(() => $self.quote(data));$(\`#message-\${data.message.id}-r`
        },
        {
          match: /let delay = 0;/,
          replace: `window.blacket.chat.update = () => chatBoxUpdate();let delay = 0;`
        }
      ]
    }
  ],
  quote: (data) => {
    let msg = `↳ From <@${data.author.id}> ${localStorage.getItem("chatColor") ? "</c>" : ""}${data.author.clan ? `**<${data.author.clan.color}>[ ${data.author.clan.name} ]</c>**` : ""} ${data.message.content}
${localStorage.getItem("chatColor") ? `<${localStorage.getItem("chatColor")}>` : ""}`;
    document.querySelector("#chatBox").value = msg;
    document.querySelector("#chatBox").focus();
    blacket.chat.update();
  }
});
const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$g }, Symbol.toStringTag, { value: "Module" }));
const index$f = () => createPlugin({
  name: "Blook Utilities",
  description: "enhances the blook manager experience.",
  authors: [
    {
      name: "Death",
      avatar: "https://i.imgur.com/PrvNWub.png",
      url: "https://villainsrule.xyz"
    }
  ],

  patches: [
    {
      file: "/lib/js/blooks.js",
      replacement: [
        {
          match: /\`\$\{blacket\.user\.blooks\[blook\]\.toLocaleString\(\)\} Owned\`/,
          replace: `bb.plugins.blookutils ? bb.plugins.blookutils.blooks[blook].toLocaleString() + ' Owned' : \`\${blacket.user.blooks[blook].toLocaleString()} Owned\``
        },
        {
          match: /let packBlooks/,
          replace: "window.packBlooks"
        }
      ]
    }
  ],

  onStart: () => {

    if (!location.pathname.startsWith("/blooks")) return;

    bb.plugins.blookutils = {
      viewingSelf: true,
      blooks: blacket.user.blooks
    };

    document.querySelector(".arts__profileBody___eNPbH-camelCase")
      .insertAdjacentHTML("afterbegin", `

      <style>

        .styles__left___9beun-camelCase {
          height: calc(100% - 6.125vw);
          top: 4.563vw;
        }

        .bb_dupeManager {
          display: flex;
          justify-content: space-between;
          gap: 1vw;
          position: absolute;
          left: 2.5%;
          width: calc(95% - 22.396vw);
        }

        .bb_dupeManager > .styles__button___1_E-G-camelCase {
          width: 100%;
          margin-left: 0;
          text-align: center;
          top: 1vw;
        }

        .bb_userSelector {
          position: absolute;
          top: calc(50% + 15.417vw);
          right: 2.5%;
          width: 20.833vw;
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: space-evenly;
        }

        .bb_userSelectBtn {
          margin: 0.521vw;
          width: 100%;
        }

        .bb_userSelectText {
          width: 80%;
          justify-content: space-between;
        }

        #bb_userSelectUsername {
          font-family: 'Titan One';
        }

        /* ✅ NEW BUTTON */
        .bb_viewAllBlooksBtn {
          position: absolute;
          top: 1.2vw;
          right: 2.5%;
          width: 20.833vw;
          margin-bottom: 0.5vw;
        }

      </style>

      <div class="bb_viewAllBlooksBtn">
        <div id="viewAllBlooks"
          class="styles__button___1_E-G-camelCase"
          role="button"
          tabindex="0">

          </div>
        </div>
      </div>

      <div class="bb_dupeManager">

        <div id='checkDupes'
          class='styles__button___1_E-G-camelCase'
          role='button'
          tabindex='0'>

          <div class='styles__shadow___3GMdH-camelCase'></div>

          <div class='styles__edge___3eWfq-camelCase'
            style='background-color: #2f2f2f;'></div>

          <div class='styles__front___vcvuy-camelCase'
            style='background-color: #2f2f2f;'>

            <div class='styles__rightButtonInside___14imT-camelCase'>
              Check Dupes
            </div>

          </div>
        </div>

      </div>

      <div class='bb_userSelector'>

        <div id='sellButton'
          class='styles__button___1_E-G-camelCase bb_userSelectBtn'
          role='button'
          tabindex='0'>

          <div class='styles__shadow___3GMdH-camelCase'></div>

          <div class='styles__edge___3eWfq-camelCase'
            style='background-color: #2f2f2f;'></div>

          <div class='styles__front___vcvuy-camelCase'
            style='background-color: #2f2f2f;'>

            <div class='styles__rightButtonInside___14imT-camelCase bb_userSelectText'>

              <span id='bb_userSelectUsername'>
                User: ${blacket.user.username}
              </span>

              <i class='bb_userSelectIcon fas fa-caret-down'></i>

            </div>
          </div>
        </div>
      </div>
    `);

      (() => {
    if (document.getElementById("runCustomScript")) return;

    const viewAllWrapper = document.querySelector(".bb_viewAllBlooksBtn");
    if (!viewAllWrapper || !viewAllWrapper.parentElement) return;

    const wrapper = document.createElement("div");

    wrapper.className = "bb_viewAllBlooksBtn";
    wrapper.style.top = "7vw"; // adjust if needed
    wrapper.style.right = "calc(2.5% + 2px)";

    wrapper.innerHTML = `
        <div id="runCustomScript" class="styles__button___1_E-G-camelCase" role="button" tabindex="0">
            <div class="styles__shadow___3GMdH-camelCase"></div>
            <div class="styles__edge___3eWfq-camelCase" style="background-color:#2f2f2f;"></div>
            <div class="styles__front___vcvuy-camelCase" style="background-color:#2f2f2f;">
                <div class="styles__rightButtonInside___14imT-camelCase">
                    View All Blooks
                </div>
            </div>
        </div>
    `;

    viewAllWrapper.parentElement.appendChild(wrapper);

const btnText = wrapper.querySelector(".styles__rightButtonInside___14imT-camelCase");

document.getElementById("runCustomScript").onclick = () => {

    if (window.viewAllBlooksEnabled) {
        window.viewAllBlooksEnabled = false;
        location.reload();
        return;
    }

    window.viewAllBlooksEnabled = true;
    btnText.textContent = "Refresh";

    (async () => {

    const safeId = (name) =>
        name.replace(/[^a-zA-Z0-9_-]/g, "_");

    const normalizeName = (name) =>
        name?.toString().replace(/\s+/g, " ").trim();

    blacket.startLoading();
    document.getElementsByClassName('styles__blooksHolder___3qZR1-camelCase')[0].replaceChildren();

    let selected = blacket.blooks.selected;

    Object.keys(blacket.blooks).forEach(blook => {
        blacket.user.blooks[blook] = 1;
    });

    blacket.blooks.selected = selected;

    blacket.packBlooks = [];
    const renderedBlooks = new Set();

    Object.keys(blacket.packs).forEach((pack) => {
        if (blacket.packs[pack].hidden) return;

        let packId = Math.random()
            .toString(36)
            .replace(/[^a-z]+/g, '')
            .substr(0, 16);

        $('.styles__blooksHolder___3qZR1-camelCase').append(`
            <div class='styles__setHolder___rVq3Z-camelCase'>
                <div class='styles__setTop___wIaVS-camelCase'>
                    <div class='styles__setTopBackground___342Wr-camelCase'
                         style='background-image:url("/content/blookTile.webp");'>
                    </div>
                    <div class='styles__setText___1PQLQ-camelCase'>${pack} Pack</div>
                    <div class='styles__setDivider___3da0c-camelCase'></div>
                </div>
                <div id='${packId}' class='styles__setBlooks___3xamH-camelCase'></div>
            </div>
        `);

        Object.entries(blacket.packs[pack].blooks).forEach((blook) => {

            const blookName = normalizeName(blook[1]);

            if (!blacket.blooks[blookName]) return;
            if (renderedBlooks.has(blookName)) return;

            renderedBlooks.add(blookName);
            blacket.packBlooks.push(blookName);

            let quantity;

            if (blacket.rarities[blacket.blooks[blookName].rarity]?.color === 'rainbow') {
                quantity = `
                    <div class='styles__blookText___3AMdK-camelCase'
                         style='background-image:url("/content/rainbow.webp");'>
                        1
                    </div>
                `;
            } else {
                quantity = `
                    <div class='styles__blookText___3AMdK-camelCase'
                         style='background-color:${
                             blacket.rarities[blacket.blooks[blookName].rarity]?.color || '#888'
                         };'>
                        ${(blacket.user.blooks[blookName] || 0).toLocaleString()}
                    </div>
                `;
            }

            const id = safeId(blookName);

            $(`#${packId}`).append(`
                <div id='${id}'
                     class='styles__blookContainer___3JrKb-camelCase'
                     style='cursor:pointer'
                     role='button'
                     tabindex='0'>
                    <div class='styles__blookContainer___36LK2-camelCase styles__blook___bNr_t-camelCase'>
                        <img loading='lazy'
                             src="${blacket.blooks[blookName].image}"
                             draggable='false'
                             class='styles__blook___1R6So-camelCase'/>
                    </div>
                    ${quantity}
                </div>
            `);

            $(`#${id}`).click(() => {
                blacket.selectBlook(blookName);
            });
        });
    });

    setTimeout(() => {

        let uncatogorizedBlooks = [];

        Object.keys(blacket.user.blooks).forEach(blook => {
            const clean = normalizeName(blook);

            if (!blacket.packBlooks.includes(clean) && blacket.blooks[clean]) {
                uncatogorizedBlooks.push(clean);
            }
        });

        if (uncatogorizedBlooks.length > 0) {

            let packId = Math.random()
                .toString(36)
                .replace(/[^a-z]+/g, '')
                .substr(0, 16);

            $('.styles__blooksHolder___3qZR1-camelCase').append(`
                <div class='styles__setHolder___rVq3Z-camelCase'>
                    <div class='styles__setTop___wIaVS-camelCase'>
                        <div class='styles__setTopBackground___342Wr-camelCase'
                             style='background-image: url("/content/blookTile.webp");'>
                        </div>
                        <div class='styles__setText___1PQLQ-camelCase'>Miscellaneous</div>
                        <div class='styles__setDivider___3da0c-camelCase'></div>
                    </div>
                    <div id='${packId}' class='styles__setBlooks___3xamH-camelCase'></div>
                </div>
            `);

            uncatogorizedBlooks.forEach(blook => {

                const clean = normalizeName(blook);

                if (!blacket.blooks[clean] || blook === 'selected') return;

                let quantity;

                if (
                    blacket.rarities[blacket.blooks[clean].rarity] &&
                    blacket.rarities[blacket.blooks[clean].rarity].color == 'rainbow'
                ) {
                    quantity = `
                        <div class='styles__blookText___3AMdK-camelCase'
                             style='background-image:url("/content/rainbow.webp");'>
                            1
                        </div>
                    `;
                } else {
                    quantity = `
                        <div class='styles__blookText___3AMdK-camelCase'
                             style='background-color:${blacket.rarities[blacket.blooks[clean].rarity].color};'>
                            1
                        </div>
                    `;
                }

                const id = safeId(clean);

                $(`#${packId}`).append(`
                    <div id='${id}'
                         class='styles__blookContainer___3JrKb-camelCase'
                         style='cursor:pointer'
                         role='button'
                         tabindex='0'>
                        <div class='styles__blookContainer___36LK2-camelCase styles__blook___bNr_t-camelCase'>
                            <img loading='lazy'
                                 src="${blacket.blooks[clean].image}"
                                 draggable='false'
                                 class='styles__blook___1R6So-camelCase' />
                        </div>
                        ${quantity}
                    </div>
                `);

                $(`#${id}`).click(() => {
                    blacket.selectBlook(clean);
                });
            });
        }

        blacket.selectBlook(blacket.blooks.selected);
    }, 1500);

    blacket.sellBlook = (quantity) => {
        if (quantity == `` || quantity == 0) return;

        $(`.arts__modal___VpEAD-camelCase`).remove();

        const selected = normalizeName(blacket.blooks.selected);
        const selectedId = safeId(selected);

        blacket.user.blooks[selected] -= quantity;

        if (blacket.user.blooks[selected] < 1) {

            $(`#${selectedId} > div:nth-child(2)`).remove();
            $(`#${selectedId}`).append(`<i class='fas fa-lock styles__blookLock___3Kgua-camelCase'></i>`);
            $(`#${selectedId}`).attr('style', 'cursor:auto;');

            $(`#${selectedId} > div:nth-child(1)`).attr(
                'class',
                'styles__blookContainer___36LK2-camelCase styles__blook___bNr_t-camelCase styles__lockedBlook___3oGaX-camelCase'
            );

            delete blacket.user.blooks[selected];

            blacket.blooks.selected =
                Object.keys(blacket.user.blooks)[
                    Math.floor(Math.random() * Object.keys(blacket.user.blooks).length)
                ];

        } else {
            $(`#${selectedId} > div:nth-child(2)`).html(
                blacket.user.blooks[selected].toLocaleString()
            );
        }

        blacket.selectBlook(blacket.blooks.selected);
    };

    blacket.listBlook = (price) => {
        if (price == `` || price == 0) return;

        $(`.arts__modal___VpEAD-camelCase`).remove();

        const selected = normalizeName(blacket.blooks.selected);
        const selectedId = safeId(selected);

        blacket.user.blooks[selected] -= 1;

        if (blacket.user.blooks[selected] < 1) {

            $(`#${selectedId} > div:nth-child(2)`).remove();
            $(`#${selectedId}`).append(`<i class='fas fa-lock styles__blookLock___3Kgua-camelCase'></i>`);
            $(`#${selectedId}`).attr('style', 'cursor:auto;');

            $(`#${selectedId} > div:nth-child(1)`).attr(
                'class',
                'styles__blookContainer___36LK2-camelCase styles__blook___bNr_t-camelCase styles__lockedBlook___3oGaX-camelCase'
            );

            delete blacket.user.blooks[selected];

            blacket.blooks.selected =
                Object.keys(blacket.user.blooks)[
                    Math.floor(Math.random() * Object.keys(blacket.user.blooks).length)
                ];

        } else {
            $(`#${selectedId} > div:nth-child(2)`).html(
                blacket.user.blooks[selected].toLocaleString()
            );
        }

        blacket.selectBlook(blacket.blooks.selected);
    };

    blacket.stopLoading();
})();
    };
})();

// VIEW PLAYER BLOOKS
document.querySelector(".bb_userSelectBtn").onclick = async () => {

  const modal = new bb.Modal({
    title: "Blook Viewer",
    description: "Enter a username to search their blooks.",
    inputs: [{ placeholder: "Username" }],
    buttons: [{ text: "Search" }, { text: "Cancel" }]
  });

  const result = await modal.listen();

  if (result.button.toString() !== "0") {
    modal.close();
    return;
  }

  axios.get("/worker2/user/" + result.inputs[0].value).then((u) => {

    if (u.data.error) {
      return new bb.Modal({
        title: "User not found.",
        buttons: [{ text: "Close" }]
      });
    }

    const user = u.data.user;

    // Lock every blook currently displayed
    const lock = (blook) => {
      const element = document.getElementById(
        blook.replaceAll("'", "_").replaceAll(" ", "-")
      );

      if (!element) return;

      element.children[0].classList.add(
        "styles__lockedBlook___3oGaX-camelCase"
      );

      if (element.children[1]) {
        element.children[1].outerHTML =
          `<i class='fas fa-lock styles__blookLock___3Kgua-camelCase' aria-hidden='true'></i>`;
      }
    };

    // Unlock a blook with the user's quantity
    const unlock = (blook, qty, rarity) => {
      const element = document.getElementById(
        blook.replaceAll("'", "_").replaceAll(" ", "-")
      );

      if (!element) return;

      element.children[0].classList.remove(
        "styles__lockedBlook___3oGaX-camelCase"
      );

      const rarityData = blacket.rarities[rarity];

      if (rarityData?.color === "rainbow") {
        element.children[1].outerHTML =
          `<div class='styles__blookText___3AMdK-camelCase'
             style='background-image:url("/content/rainbow.webp");'>
             ${Number(qty).toLocaleString()}
           </div>`;
      } else {
        element.children[1].outerHTML =
          `<div class='styles__blookText___3AMdK-camelCase'
             style='background-color:${rarityData?.color || "#888"};'>
             ${Number(qty).toLocaleString()}
           </div>`;
      }
    };

    // Save the viewed user's blooks
    bb.plugins.blookutils = {
      viewingSelf: false,
      blooks: user.blooks
    };

    // Change username shown on button
    document.querySelector("#bb_userSelectUsername").innerText =
      `User: ${user.username}`;

    // Find all currently displayed blook containers
    const blooks2 = [
      ...document.querySelectorAll(
        ".styles__blookContainer___3JrKb-camelCase"
      )
    ].map((element) => element.id);

    // Lock everything first
    blooks2.forEach((blook) => lock(blook));

    // Find the Miscellaneous container
    const containers = [
      ...document.querySelectorAll(
        ".styles__setBlooks___3xamH-camelCase"
      )
    ];

    const miscList = containers[containers.length - 1];

    if (!miscList) {
      modal.close();
      return;
    }

    // Clear old miscellaneous blooks
    miscList.replaceChildren();

    // Display the searched user's blooks
    Object.entries(user.blooks).forEach(([blook, qty]) => {

      // Blooks already inside packs
      if (
        window.packBlooks &&
        window.packBlooks.includes(blook)
      ) {
        if (blacket.blooks[blook]) {
          unlock(
            blook,
            qty,
            blacket.blooks[blook].rarity
          );
        }

        return;
      }

      // Ignore blooks that don't exist locally
      if (!blacket.blooks[blook]) return;

      const rarity =
        blacket.blooks[blook].rarity;

      let quantity;

      if (
        blacket.rarities[rarity] &&
        blacket.rarities[rarity].color === "rainbow"
      ) {
        quantity = `
          <div
            class='styles__blookText___3AMdK-camelCase'
            style='background-image:url("/content/rainbow.webp");'
          >
            ${Number(qty).toLocaleString()}
          </div>
        `;
      } else {
        quantity = `
          <div
            class='styles__blookText___3AMdK-camelCase'
            style='background-color:${blacket.rarities[rarity]?.color || "#888"};'
          >
            ${Number(qty).toLocaleString()}
          </div>
        `;
      }

      const id = blook
        .replaceAll(" ", "-")
        .replaceAll("'", "_");

      miscList.insertAdjacentHTML(
        "beforeend",
        `
          <div
            id='${id}'
            class='styles__blookContainer___3JrKb-camelCase'
            style='cursor:pointer'
            role='button'
            tabindex='0'
          >
            <div
              class='styles__blookContainer___36LK2-camelCase styles__blook___bNr_t-camelCase'
            >
              <img
                loading='lazy'
                src='${blacket.blooks[blook].image}'
                draggable='false'
                class='styles__blook___1R6So-camelCase'
              />
            </div>
            ${quantity}
          </div>
        `
      );

      document
        .getElementById(id)
        ?.addEventListener("click", () => {
          blacket.selectBlook(blook);
        });
    });

    modal.close();
  }).catch(() => {
    new bb.Modal({
      title: "Error",
      description: "Failed to load that user's blooks.",
      buttons: [{ text: "Close" }]
    });
  });
};

    // CHECK DUPES
    document.querySelector("#checkDupes").onclick = async () => {

      const dupes = Object.entries(blacket.user.blooks)
        .filter(([_, qty]) => qty > 1);

      const modal = new bb.Modal({
        title: "Duplicate Blooks",
        description: dupes.length
          ? dupes.map(([blook, qty]) =>
              `<span style="color: ${blacket.rarities[
                blacket.blooks[blook].rarity
              ].color}">
                ${blook}: ${qty.toLocaleString()}
              </span>`
            ).join(" | ")
          : "You have no duplicate blooks.",
        buttons: [
          { text: "Sell All Dupes" },
          { text: "Close" }
        ]
      });

      const result = await modal.listen();

      if (result.button.toString() !== "0") return;

      let tosell = {};

      Object.keys(blacket.user.blooks).forEach((blook) => {
        let amount = blacket.user.blooks[blook] - 1;
        if (amount > 0) tosell[blook] = amount;
      });

      blacket.startLoading();

      const sellNext = () => {
        const current = Object.keys(tosell)[0];
        if (!current) {
          blacket.stopLoading();
          blacket.createToast({
          title: "Success",
          message: "Successfully sold all duplicate blooks.",
          icon: "/content/blooks/Success.webp",
          time: 5000
          });
          return;
        }

        const amount = tosell[current];

        blacket.requests.post("/worker/sell", {
          blook: current,
          quantity: amount
        }, (response) => {

          if (!response.error) {
            blacket.user.blooks[current] -= amount;
            if (blacket.user.blooks[current] <= 0) delete blacket.user.blooks[current];
            delete tosell[current];
          }

          setTimeout(sellNext, 150);
        });
      };

      sellNext();
    };
  }
});
const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$f }, Symbol.toStringTag, { value: "Module" }));
const badges = async (...args2) => {
  if (args2[0]) axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) bb.plugins.deafbot.send(`Error fetching user ${args2[0]}: **${u.data.reason}**`);
    else bb.plugins.deafbot.send(`**${u.data.user.username}**'s Badges: ${u.data.user.badges.join(" ")}`);
  });
  else bb.plugins.deafbot.send(`Your Badges: ${blacket.user.badges.join(" ")}`);
};
const blocks = async (...args2) => {
  switch (args2[0]) {
    case "list":
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching blocks: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`**${f.data.blocks.length}** blocks: ${f.data.blocks.map((f2) => f2.username).join(", ")}`);
      });
      break;
    case "add":
      if (!args2[1]) return bb.plugins.deafbot.send(`Whoa - you want to block yourself or something? Tell me who to block!`);
      axios.post("/worker/friends/block", { user: args2[1] }).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error blocking user: **${f.data.reason}**. I guess they get mercy for now.`);
        else bb.plugins.deafbot.send(`Blocked **${args2[1]}**. You must be in a GREAT mood!`);
      });
      break;
    case "remove":
      if (!args2[1]) return bb.plugins.deafbot.send(`Tell me to remove, or keep hating people. I don't care.`);
      axios.post("/worker/friends/unblock", { user: args2[1] }).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error removing block: **${f.data.reason}**. L them.`);
        else bb.plugins.deafbot.send(`You are no longer blocking **${args2[1]}**. How nice you must feel today!`);
      });
      break;
    case "check":
      if (!args2[1]) return bb.plugins.deafbot.send(`Specify a username to check.`);
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching blocks: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`**${args2[1]}** is **${f.data.blocks.map((a) => a.username).map((a) => a.toLowerCase()).includes(args2[1].toLowerCase()) ? "blocked" : "not blocked"}**.`);
      });
      break;
    default:
      bb.plugins.deafbot.send(`Subcommands: **list** ~ **add** ~ **remove** ~ **check**`);
      break;
  }
};
const blooks = async (...args2) => {
  if (!args2[0]) return bb.plugins.deafbot.send(`You have **${Object.keys(blacket.user.blooks).length}** unique blooks (**${Object.values(blacket.user.blooks).reduce((partialSum, a) => partialSum + a, 0)}** total), consisting of **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Uncommon").length}** Uncommons, **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Rare").length}** Rares, **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Epic").length}** Epics, **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Legendary").length}** Legendaries, **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Chroma").length}** Chromas, and **${Object.keys(blacket.user.blooks).filter((b) => blacket.blooks[b].rarity === "Mystical").length}** Mysticals.`);
  if (args2[0] === "check" && args2[1]?.length) {
    let blook = blacket.blooks[args2.slice(1).join(" ")];
    if (!blook) return bb.plugins.deafbot.send(`No blook found for **${args2.slice(1).join(" ")}**. This is case-sensitive.`);
    if (blacket.user.blooks[args2.slice(1).join(" ")]) return bb.plugins.deafbot.send(`You have **${blacket.user.blooks[args2.slice(1).join(" ")]}x** ${args2.slice(1).join(" ")}.`);
    else return bb.plugins.deafbot.send(`You don't have **${args2.slice(1).join(" ")}**.`);
  }
  axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) bb.plugins.deafbot.send(`Error fetching user ${args2[0]}: **${u.data.reason}**`);
    if (args2[1]) {
      let blook = blacket.blooks[args2.slice(1).join(" ")];
      if (!blook) return bb.plugins.deafbot.send(`No blook found for **${args2.slice(1).join(" ")}**. This is case-sensitive.`);
      if (u.data.user.blooks[args2.slice(1).join(" ")]) return bb.plugins.deafbot.send(`**${u.data.user.username}** has **${u.data.user.blooks[args2.slice(1).join(" ")]}x** ${args2.slice(1).join(" ")}.`);
      else return bb.plugins.deafbot.send(`**${u.data.user.username}** doesn't have **${args2.slice(1).join(" ")}**.`);
    }
    bb.plugins.deafbot.send(`**${u.data.user.username}** has **${Object.keys(u.data.user.blooks).length}** unique blooks (**${Object.values(u.data.user.blooks).reduce((partialSum, a) => partialSum + a, 0)}** total), consisting of **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Uncommon").length}** Uncommons, **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Rare").length}** Rares, **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Epic").length}** Epics, **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Legendary").length}** Legendaries, **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Chroma").length}** Chromas, and **${Object.keys(u.data.user.blooks).filter((b) => blacket.blooks[b].rarity === "Mystical").length}** Mysticals.`);
  });
};
const booster = async () => {
  let b = await axios.get("/data/index.json");
  if (!b.data.booster.active) return bb.plugins.deafbot.send("There is no active booster.");
  let u = await axios.get("/worker2/user/" + b.data.booster.user);
  bb.plugins.deafbot.send(`<@${u.data.user.id}> (${u.data.user.username}) is boosting with a ${b.data.booster.multiplier}x booster until ${new Date(b.data.booster.time * 1e3).toLocaleTimeString().replaceAll("ΓÇ»", " ")}!`);
};
const cheapest = async (...args2) => {
  axios.get("/worker/bazaar?item=" + args2.join(" ")).then((b) => {
    if (b.data.error) return bb.plugins.deafbot.send(`Error fetching bazaar: **${b.data.reason}**`);
    let items = b.data.bazaar.filter((i) => i.item.toLowerCase() === args2.join(" ").toLowerCase());
    if (!items.length) return bb.plugins.deafbot.send(`No items found for **${args2.join(" ")}**.`);
    let cheapest2 = items.sort((a, b2) => a.price - b2.price)[0];
    bb.plugins.deafbot.send(`The cheapest listing for **${cheapest2.item}** costs **${cheapest2.price.toLocaleString()}** tokens & is sold by **${cheapest2.seller}**.`);
  });
};
const claim = async () => {
  let claim2 = await axios.get("/worker/claim");
  if (claim2.data.error) bb.plugins.deafbot.send(`Error: **${claim2.data.reason}**`);
  else bb.plugins.deafbot.send(`Claimed **${blacket.config.rewards[claim2.data.reward - 1]}** tokens!`);
};
const clan = async (...args2) => {
  if (!args2[0]) axios.get("/worker/clans").then((clan2) => {
    if (clan2.data.error) return bb.plugins.deafbot.send(`Error fetching your clan: **${clan2.data.reason}**`);
    let clanData = clan2.data.clan;
    bb.plugins.deafbot.send(`You are in the ${clanData.members.map((a) => a.username).includes("Death") ? "esteemed " : ""}**${clanData.name}** clan, owned by **${clanData.owner.username}**. You have **${clanData.members.length}** (**${clanData.online}** online) members, and **[REDACTED]** investments. The clan **${clanData.safe ? "is" : "is not"}** in safe mode.`);
  });
  else axios.get("/worker/clans/discover/name/" + args2.join(" ")).then((clan2) => {
    if (clan2.data.error) return bb.plugins.deafbot.send(`Error fetching clan: **${clan2.data.reason}**`);
    clan2 = clan2.data.clans[0];
    bb.plugins.deafbot.send(`The ${clan2.members.map((a) => a.username).includes("Death") ? "esteemed " : ""}**${clan2.name}** clan is owned by **${clan2.owner.username}**. They have **${clan2.members.length}** (**${clan2.online}** online) members, and **[REDACTED]** investments. The clan **${clan2.safe ? "is" : "is not"}** in safe mode.`);
  });
};
const color = async (...args2) => {
  if (!args2[0]) return bb.plugins.deafbot.send(`Choose a subcommand: **name** or **text**.`);
  if (args2[0].toLowerCase() === "name") axios.post("https://blacket.org/worker/settings/color", {
    color: `#${args2[1].replace("#", "")}`
  }).then((r) => {
    if (r.data.error) return bb.plugins.deafbot.send(`Error changing name color: **${r.data.reason}**`);
    bb.plugins.deafbot.send(`Name color was set to **#${args2[1].replace("#", "")}**!`);
  });
  if (args2[0].toLowerCase() === "text") {
    if (args2[1] === "gradient") {
      let formed = `${args2[1]}=[${args2[2]}: ${args2.slice(3).join(", ")}]`;
      localStorage.setItem("chatColor", formed);
      bb.plugins.deafbot.send(`Gradient was updated!`);
    } else {
      localStorage.setItem("chatColor", args2[1]);
      bb.plugins.deafbot.send(`Text color was set to **${args2[1]}**!`);
    }
  }
};
const $eval = async (...args) => {
  eval(`
        let send = (msg) => bb.plugins.deafbot.send(msg);
        ${args.join(" ")}
    `);
};
const friends = async (...args2) => {
  switch (args2[0]) {
    case "list":
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching friends: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`You have **${f.data.friends.length}** friends: ${f.data.friends.map((f2) => f2.username).join(", ")}`);
      });
      break;
    case "request":
      if (!args2[1]) return bb.plugins.deafbot.send(`Tell me who you actually want to request, you friendless fool.`);
      axios.post("/worker/friends/request", { user: args2[1] }).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error friending: **${f.data.reason}** - ig you just don't want friends.`);
        else bb.plugins.deafbot.send(`Sent a friend request to **${args2[1]}**. How kind of you :3`);
      });
      break;
    case "accept":
      if (!args2[1]) return bb.plugins.deafbot.send(`Tell me who you actually want to accept, you friendless fool.`);
      axios.post("/worker/friends/accept", { user: args2[1] }).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error accepting: **${f.data.reason}** - ig you just don't want friends.`);
        else bb.plugins.deafbot.send(`Accepted **${args2[1]}**'s friend request! How kind of you :3`);
      });
      break;
    case "remove":
      if (!args2[1]) return bb.plugins.deafbot.send(`So you want to KEEP all your bad friends? Tell me who to get rid of!`);
      axios.post("/worker/friends/remove", { user: args2[1] }).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error removing: **${f.data.reason}** - L you. With them forever.`);
        else bb.plugins.deafbot.send(`You are no longer friended to **${args2[1]}**. How nice you must feel today!`);
      });
      break;
    case "check":
      if (!args2[1]) return bb.plugins.deafbot.send(`Specify a username to check.`);
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching friends: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`**${args2[1]}** **${f.data.friends.map((a) => a.username).map((a) => a.toLowerCase()).includes(args2[1].toLowerCase()) ? "is" : "isn't"}** your friend.`);
      });
      break;
    case "requests":
    case "incoming":
    case "pending":
    case "recieving":
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching friends: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`You have **${f.data.receiving.length}** incoming requests: ${f.data.receiving.map((f2) => f2.username).join(", ")}`);
      });
      break;
    case "requested":
    case "outgoing":
    case "sending":
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching friends: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`You have **${f.data.sending.length}** outgoing requests: ${f.data.sending.map((f2) => f2.username).join(", ")}`);
      });
      break;
    case "mutual":
      if (!args2[1]) return bb.plugins.deafbot.send(`Tell me who you want to check for mutual friends, fool.`);
      axios.get("/worker2/user/" + args2[1]).then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`You and **${f.data.user.username}** have **${f.data.user.friends.length}** mutual friends: ${f.data.user.friends.map((f2) => blacket.friends.friends.find((fr) => fr.id === f2)).map((a) => a?.username).filter((a) => a).join(", ")}`);
      });
      break;
    case "count":
      axios.get("/worker2/friends").then((f) => {
        if (f.data.error) bb.plugins.deafbot.send(`Error fetching friends: **${f.data.reason}**`);
        else bb.plugins.deafbot.send(`You have **${f.data.friends.length}** friends.`);
      });
      break;
    default:
      bb.plugins.deafbot.send(`Subcommands: **list** ~ **request** ~ **accept** ~ **remove** ~ **check** ~ **mutual** ~ **requests** ~ **sending** ~ **count**`);
      break;
  }
};
const id = async (...args2) => {
  if (args2[0]) axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) bb.plugins.deafbot.send(`Error: **${u.data.reason}**`);
    else bb.plugins.deafbot.send(`**${u.data.user.username}**'s ID: ${u.data.user.id}`);
  });
  else bb.plugins.deafbot.send(`Your ID: ${blacket.user.id}`);
};
const level = async (...args2) => {
  let calculate = (exp) => {
    let level2 = 0;
    let needed = 0;
    for (let i = 0; i <= 27915; i++) {
      needed = 5 * Math.pow(level2, blacket.config.exp.difficulty) * level2;
      if (exp >= needed) {
        exp -= needed;
        level2++;
      }
    }
    return { level: level2, needed, exp };
  };
  if (args2[0]) return axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) return bb.plugins.deafbot.send(`Error fetching user ${args2[0]}: **${u.data.reason}**`);
    let levelData2 = calculate(u.data.user.exp);
    bb.plugins.deafbot.send(`**${u.data.user.username}** is level **${levelData2.level}**. They need **${Math.round(levelData2.needed).toLocaleString()} XP** to advance, and they're currently **${Math.round(levelData2.exp / levelData2.needed * 100)}%** complete.`);
  });
  let levelData = blacket.user.level && blacket.user.needed ? blacket.user : calculate(blacket.user.exp);
  bb.plugins.deafbot.send(`You are level **${levelData.level}**. You need **${Math.round(levelData.needed).toLocaleString()} XP** to advance, and you're currently **${Math.round(levelData.exp / levelData.needed * 100)}%** complete.`);
};
const tokens = async (...args2) => {
  if (args2[0]) axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) bb.plugins.deafbot.send(`Error fetching user ${args2[0]}: **${u.data.reason}**`);
    else bb.plugins.deafbot.send(`**${u.data.user.username}** currently has **${u.data.user.tokens.toLocaleString()}** tokens.`);
  });
  else bb.plugins.deafbot.send(`You currently have **${blacket.user.tokens.toLocaleString()}** tokens.`);
};
const trade = async (...args2) => {
  if (!args2[0]) return bb.plugins.deafbot.send(`Who are you trying to trade, yourself?`);
  axios.get("/worker2/user/" + args2[0]).then((u) => {
    if (u.data.error) return bb.plugins.deafbot.send(`Error fetching user ${args2[0]}: **${u.data.reason}**`);
    axios.post("/worker/trades/requests/send", { user: u.data.user.id.toString() }).then((r) => {
      if (r.data.error) bb.plugins.deafbot.send(`Error sending trade request to ${u.data.user.username}: **${r.data.reason}**`);
      else bb.plugins.deafbot.send(`Sent a trade request to **${u.data.user.username}**.`);
    });
  });
};
const theme = async (...args) => {
  const arg = (args[0] || "").toLowerCase();

  let style = document.getElementById("bb_theme");
  if (!style) {
    style = document.createElement("style");
    style.id = "bb_theme";
    document.head.appendChild(style);
  }

  if (arg === "off") {
    style.remove();
    return bb.plugins.deafbot.send("Theme removed, I guess you just hate color in your life.");
  }

  if (arg === "aurora") {
    try {
      const css = await fetch("https://raw.githubusercontent.com/ieatducks/blacket-themes/refs/heads/main/aurora.css").then(r => r.text());
      style.innerHTML = css;
      return bb.plugins.deafbot.send("Aurora theme applied. Fancy.");
    } catch {
      return bb.plugins.deafbot.send("Failed to load theme.");
    }
  }

  const themes = {

    red: {
      css: `        :root {
            --red: #c41a1a;
            --red-hover: #a31313;
            --text-white: #ffffff;
            --button-red: #d62b2b;
        }
        .styles__blooketText___1pMBG-camelCase {
            color: var(--text-white);
            filter: drop-shadow(0px 0px 5px var(--text-white));
        }
        .styles__background___2J-JA-camelCase,
        .styles__bazaarItems___KmNa2-camelCase,
        .styles__blookGridContainer___AK47P-camelCase,
        .styles__cardContainer___NGmjp-camelCase,
        .styles__chatCurrentRoom___MCaV4-camelCase,
        .styles__chatInputContainer___gkR4A-camelCase,
        .styles__chatRoomsListContainer___Gk4Av-camelCase,
        .styles__chatRoomsTitle___fR4Av-camelCase,
        .styles__chatRooms___o5ASb-camelCase,
        .styles__container___1BPm9-camelCase,
        .styles__container___2VzTy-camelCase,
        .styles__container___3St5B-camelCase,
        .styles__containerHeader___3xghM-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase,
        .styles__editHeaderContainer___2G1ji-camelCase,
        .styles__formsForm___MvA35-camelCase,
        .styles__header___22Ne2-camelCase,
        .styles__header___2O21B-camelCase,
        .styles__headerBadgeBg___12ogR-camelCase,
        .styles__headerSide___1r1-b-camelCase,
        .styles__infoContainer___2uI-S-camelCase,
        .styles__input___2XTSp-camelCase,
        .styles__left___9beun-camelCase,
        .styles__myTokenAmount___ANKHA-camelCase,
        .styles__otherTokenAmount___SEGGS-camelCase,
        .styles__postsContainer___39_IQ-camelCase,
        .styles__profileContainer___CSuIE-camelCase,
        .styles__profileDropdownMenu___2jUAA-camelCase,
        .styles__sidebar___1XqWi-camelCase,
        .styles__signUpButton___3_ch3-camelCase,
        .styles__statContainer___QKuOF-camelCase,
        .styles__statsContainer___QnrRB-camelCase,
        .styles__toastContainer___o4pCa-camelCase,
        .styles__tokenContainer___3yBv--camelCase,
        .styles__tradingContainer___B1ABS-camelCase,
        textarea,
        input,
        .toastMessage {
            background-color: var(--red) !important;
            color: var(--text-white) !important;
        }
        .styles__bazaarItem___Meg69-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase,
        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: var(--red-hover) !important;
            transition: 0.2s ease-in-out;
        }
        .styles__bazaarItem___Meg69-camelCase:hover,
        .styles__chatEmojiButton___8RFa2-camelCase:hover,
        .styles__chatUploadButton___g39Ac-camelCase:hover,
        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #890f0f !important;
            transform: scale(1.05);
        }
        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: var(--button-red) !important;
            color: var(--text-white) !important;
        }
        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase,
        .styles__loginButton___1e3jI-camelCase {
            background-color: var(--text-white) !important;
            color: var(--red-hover) !important;
        }
        .styles__edge___3eWfq-camelCase,
        .styles__horizontalBlookGridLine___4SAvz-camelCase,
        .styles__verticalBlookGridLine___rQWaZ-camelCase,
        hr {
            background-color: var(--text-white) !important;
        }
        .styles__rightButtonInside___14imT-camelCase {
            color: var(--text-white) !important;
        }
        #searchInput {
            background-color: var(--button-red) !important;
        }`,
      msg: "Red theme applied. Feeling aggressive today, eh?"
    },

    orange: {
      css: `:root {
            --orange: #c46a1a;
            --orange-hover: #a35213;
            --text-white: #ffffff;
            --button-orange: #d67f2b;
        }

        .styles__blooketText___1pMBG-camelCase {
            color: var(--text-white);
            filter: drop-shadow(0px 0px 5px var(--text-white));
        }

        .styles__background___2J-JA-camelCase,
        .styles__bazaarItems___KmNa2-camelCase,
        .styles__blookGridContainer___AK47P-camelCase,
        .styles__cardContainer___NGmjp-camelCase,
        .styles__chatCurrentRoom___MCaV4-camelCase,
        .styles__chatInputContainer___gkR4A-camelCase,
        .styles__chatRoomsListContainer___Gk4Av-camelCase,
        .styles__chatRoomsTitle___fR4Av-camelCase,
        .styles__chatRooms___o5ASb-camelCase,
        .styles__container___1BPm9-camelCase,
        .styles__container___2VzTy-camelCase,
        .styles__container___3St5B-camelCase,
        .styles__containerHeader___3xghM-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase,
        .styles__editHeaderContainer___2G1ji-camelCase,
        .styles__formsForm___MvA35-camelCase,
        .styles__header___22Ne2-camelCase,
        .styles__header___2O21B-camelCase,
        .styles__headerBadgeBg___12ogR-camelCase,
        .styles__headerSide___1r1-b-camelCase,
        .styles__infoContainer___2uI-S-camelCase,
        .styles__input___2XTSp-camelCase,
        .styles__left___9beun-camelCase,
        .styles__myTokenAmount___ANKHA-camelCase,
        .styles__otherTokenAmount___SEGGS-camelCase,
        .styles__postsContainer___39_IQ-camelCase,
        .styles__profileContainer___CSuIE-camelCase,
        .styles__profileDropdownMenu___2jUAA-camelCase,
        .styles__profileDropdownOption___ljZXD-camelCase,
        .styles__sidebar___1XqWi-camelCase,
        .styles__signUpButton___3_ch3-camelCase,
        .styles__statContainer___QKuOF-camelCase,
        .styles__statsContainer___QnrRB-camelCase,
        .styles__toastContainer___o4pCa-camelCase,
        .styles__tokenContainer___3yBv--camelCase,
        .styles__tradingContainer___B1ABS-camelCase,
        textarea,
        input,
        .toastMessage {
            background-color: var(--orange) !important;
            color: var(--text-white) !important;
        }

        .styles__bazaarItem___Meg69-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase,
        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: var(--orange-hover) !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover,
        .styles__chatEmojiButton___8RFa2-camelCase:hover,
        .styles__chatUploadButton___g39Ac-camelCase:hover,
        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #8f3f07 !important;
            transform: scale(1.05);
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: var(--button-orange) !important;
            color: var(--text-white) !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase,
        .styles__loginButton___1e3jI-camelCase {
            background-color: var(--text-white) !important;
            color: var(--orange-hover) !important;
        }

        .styles__edge___3eWfq-camelCase,
        .styles__horizontalBlookGridLine___4SAvz-camelCase,
        .styles__verticalBlookGridLine___rQWaZ-camelCase,
        hr {
            background-color: var(--text-white) !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: var(--text-white) !important;
        }

        #searchInput {
            background-color: var(--button-orange) !important;
        }`,
      msg: "Orange theme applied. What is this, a traffic cone simulator?"
    },

    yellow: {
      css: `:root {
        --deep-yellow: #d4c60f;
        --deep-yellow-hover: #b1a309;
        --text-white: #ffffff;
        --button-yellow: #e2d414;
    }

    .styles__blooketText___1pMBG-camelCase {
        color: var(--text-white);
        filter: drop-shadow(0px 0px 5px var(--text-white));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--deep-yellow) !important;
        color: var(--text-white) !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--deep-yellow-hover) !important;
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: #a99708 !important;
        transform: scale(1.05);
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-yellow) !important;
        color: var(--text-white) !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-white) !important;
        color: var(--deep-yellow-hover) !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-white) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-white) !important;
    }

    #searchInput {
        background-color: var(--button-yellow) !important;
    }`,
      msg: "Yellow theme applied. Hope you like being blinded."
    },

    green: {
      css: `:root {
        --deep-green: #0a8a0a;
        --deep-green-hover: #076f07;
        --text-white: #ffffff;
        --button-green: #12a012;
    }

    .styles__blooketText___1pMBG-camelCase {
        color: var(--text-white);
        filter: drop-shadow(0px 0px 5px var(--text-white));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__profileDropdownOption___ljZXD-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--deep-green) !important;
        color: var(--text-white) !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--deep-green-hover) !important;
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: #065906 !important;
        transform: scale(1.05);
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-green) !important;
        color: var(--text-white) !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-white) !important;
        color: var(--deep-green-hover) !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-white) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-white) !important;
    }

    #searchInput {
        background-color: var(--button-green) !important;
    }`,
      msg: "Green theme applied. Touching grass was not enough?"
    },

    blue: {
      css: `:root {
    --deep-blue: #1a28c4;
    --deep-blue-hover: #131fa3;
    --text-white: #ffffff;
    --button-blue: #2b39d6;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--deep-blue) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--deep-blue-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #101890 !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-blue) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--deep-blue-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-blue) !important;
}`,
      msg: "Blue theme applied. Feeling calm... or just sad?"
    },

    purple: {
      css: `:root {
    --deep-purple: #6a1b9a;
    --deep-purple-hover: #4b1373;
    --text-white: #ffffff;
    --button-purple: #7e22ce;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--deep-purple) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--deep-purple-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #3d0d5c !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-purple) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--deep-purple-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-purple) !important;
}`,
      msg: "Purple theme applied. Trying to look mysterious, huh?"
    },

    pink: {
      css: `:root {
    --pink: #f702c6;
    --pink-hover: #d401ad;
    --text-white: #ffffff;
    --button-pink: #f702c6;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--pink) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--pink-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #a8008e !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-pink) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--pink-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-pink) !important;
}`,
      msg: "Pink theme applied. Bold. Very bold."
    },

    white: {
      css: `:root {
        --white-bg: #e6e6e6;
        --white-bg-alt: #f9f9f9;
        --shadow-color: rgba(0,0,0,0.1);
        --text-black: #000000;
        --button-white: #ffffff;
        --button-hover: #dcdcdc;
    }

    /* Make all text black */
    * {
        color: var(--text-black) !important;
    }

    .styles__blooketText___1pMBG-camelCase {
        filter: drop-shadow(0 0 3px var(--shadow-color));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__profileDropdownOption___ljZXD-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--white-bg) !important;
        box-shadow: 0 0 8px var(--shadow-color) !important;
        border: 1px solid #ccc !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--white-bg-alt) !important;
        transition: 0.2s ease-in-out;
        border: 1px solid #ccc !important;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: var(--button-hover) !important;
        transform: scale(1.05);
        border-color: #bbb !important;
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-white) !important;
        border: 1px solid #ccc !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-black) !important;
        color: var(--white-bg) !important;
        border: none !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-black) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-black) !important;
    }

    #searchInput {
        background-color: var(--button-white) !important;
        border: 1px solid #ccc !important;
    }`,
      msg: "White theme applied. Blinding yourself willingly is crazy."
    },

    black: {
      css: `.styles__blooketText___1pMBG-camelCase {
            font-size: 40px;
            text-decoration: none;
            color: white;
            filter: drop-shadow(0px 0px 5px white);
            margin-bottom: 20px;
            text-align: center;
        }

        .styles__background___2J-JA-camelCase {
            background-color: #000 !important;
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #111111 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #222222 !important;
            transform: scale(1.05);
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: #000 !important;
        }

        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #000 !important;
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #000 !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__cardContainer___NGmjp-camelCase {
            background-color: #000 !important;
        }

        .styles__chatCurrentRoom___MCaV4-camelCase {
            background-color: #000 !important;
        }

        .styles__chatEmojiButton___8RFa2-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatEmojiButton___8RFa2-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsListContainer___Gk4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsTitle___fR4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRooms___o5ASb-camelCase {
            background-color: #000 !important;
        }

        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatUploadButton___g39Ac-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__container___1BPm9-camelCase {
            background-color: #000 !important;
        }

        .styles__container___2VzTy-camelCase {
            background-color: #000 !important;
        }

        .styles__container___3St5B-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeader___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderInside___2omQm-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__editHeaderContainer___2G1ji-camelCase {
            background-color: #000 !important;
        }

        .styles__edge___3eWfq-camelCase {
            background-color: #fff !important;
        }

        .styles__formsForm___MvA35-camelCase {
            background-color: #000 !important;
        }

        .styles__header___22Ne2-camelCase {
            background-color: #000 !important;
        }

        .styles__header___2O21B-camelCase {
            background-color: #000 !important;
        }

        .styles__headerBadgeBg___12ogR-camelCase {
            background-color: #000 !important;
        }

        .styles__headerSide___1r1-b-camelCase {
            background-color: #000 !important;
        }

        .styles__horizontalBlookGridLine___4SAvz-camelCase {
            background-color: #fff !important;
        }

        .styles__infoContainer___2uI-S-camelCase {
            background-color: #000 !important;
        }

        .styles__input___2XTSp-camelCase {
            background-color: #000 !important;
        }

        .styles__left___9beun-camelCase {
            background-color: #000 !important;
        }

        .styles__loginButton___1e3jI-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__myTokenAmount___ANKHA-camelCase {
            background-color: #000 !important;
        }

        .styles__otherTokenAmount___SEGGS-camelCase {
            background-color: #000 !important;
        }

        .styles__postsContainer___39_IQ-camelCase {
            background-color: #111111 !important;
        }

        .styles__profileContainer___CSuIE-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownMenu___2jUAA-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: #000 !important;
        }

        .styles__sidebar___1XqWi-camelCase {
            background-color: #000 !important;
        }

        .styles__signUpButton___3_ch3-camelCase {
            background-color: #000 !important;
            color: #fff !important;
        }

        .styles__statContainer___QKuOF-camelCase {
            background-color: #111111 !important;
        }

        .styles__statsContainer___QnrRB-camelCase {
            background-color: #000 !important;
        }

        .styles__toastContainer___o4pCa-camelCase {
            background-color: #000 !important;
        }

        .styles__tokenContainer___3yBv--camelCase {
            background-color: #000 !important;
        }

        .styles__tradingContainer___B1ABS-camelCase {
            background-color: #000 !important;
        }

        .styles__verticalBlookGridLine___rQWaZ-camelCase {
            background-color: #fff !important;
        }

        #searchInput {
            background-color: #111111 !important;
        }

        textarea {
            background-color: #000 !important;
        }

        .toastMessage {
            background-color: #000 !important;
        }

        input {
            background-color: #000 !important;
        }

        hr {
            background-color: #fff !important;
        }`,
      msg: "Black theme applied. Finally, something reasonable."
    },

      rainbow: {
  css: `
    :root {
/* TITLE TEXT */
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

/* UNIVERSAL RAINBOW GRADIENT */
.rainbowBG,
.styles__background___2J-JA-camelCase,
.styles__bazaarItem___Meg69-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
#searchInput,
.toastMessage {
    background: linear-gradient(286deg,
        #ff0000, #ff7f00, #ffff00,
        #00ff00, #0000ff, #4b0082, #8f00ff,
        #ff0000, #ff7f00, #ffff00,
        #00ff00, #0000ff, #4b0082, #8f00ff
    ) !important;

    background-size: 300% 300%;
    animation: rainbowShift 10s linear infinite;
}

/* HOVER BRIGHTEN */
.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* WHITE UI ELEMENTS */
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #000 !important;
}

/* WHITE LINES */
.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: #fff !important;
}

/* 🌈 CIRCULAR RAINBOW ANIMATION */
@keyframes rainbowShift {
    0% { background-position: 50% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 50% 0%; }
}
  `,
  msg: "Rainbow theme applied. You must be VERY proud of being gay!"
}

  };

  if (themes[arg]) {
    style.innerHTML = themes[arg].css;
    return bb.plugins.deafbot.send(themes[arg].msg);
  }

  return bb.plugins.deafbot.send("Themes: red, orange, yellow, green, blue, purple, pink, white, black, aurora, off");
};
const mrbinks = async (...args) => {
  bb.plugins.deafbot.send("Salem is a good kitty");
};
const testCommand = async (...args) => {
  bb.plugins.deafbot.send("Wow. A test command. Truly groundbreaking.");
};
const commandsList = async () => {
  const send = bb.plugins.deafbot.send;

  send("**Core Commands**\n$badges\n$blocks\n$blooks\n$booster\n$cheapest\n$claim");
  send("$clan\n$color\n$friends\n$id\n$level\n$tokens\n$trade");
  send("**Themes**\n$theme red/orange/yellow/green/blue\n$theme purple/pink/white/black\n$theme aurora/rainbow/off");
};
const coinflip = async () => {
  const result = Math.random() < 0.5 ? "Heads" : "Tails";
  const responses = [
    `${result}.`,
    `${result}. Totally not rigged.`,
    `${result}. Skill issue.`,
    `${result}. You had a 50/50 and still doubted it.`,
    `${result}. Incredible prediction skills.`
  ];
  bb.plugins.deafbot.send(responses[Math.floor(Math.random() * responses.length)]);
};
const roll = async () => {
  const num = Math.floor(Math.random() * 6) + 1;
  const responses = [
    `🎲 You rolled a ${num}.`,
    `🎲 ${num}. Impressive. Not really.`,
    `🎲 ${num}. Could be worse.`,
    `🎲 ${num}. RNG carried you.`,
    `🎲 ${num}. That was your moment.`
  ];
  bb.plugins.deafbot.send(responses[Math.floor(Math.random() * responses.length)]);
};
const eightball = async (...args) => {
  if (!args.length) return bb.plugins.deafbot.send("Ask a question. I’m not a mind reader.");

  const answers = [
    "Yes.",
    "No.",
    "Maybe.",
    "Definitely.",
    "Absolutely not.",
    "It is certain.",
    "Very doubtful.",
    "Without a doubt.",
    "Ask again later.",
    "I wouldn’t count on it.",
    "Signs point to yes.",
    "Better not tell you now."
  ];

  const question = args.join(" ");
  const answer = answers[Math.floor(Math.random() * answers.length)];

  bb.plugins.deafbot.send(`🎱 ${question}\n→ ${answer}`);
};
const commands = {
  badges,
  blocks,
  blooks,
  booster,
  cheapest,
  coinflip,
  claim,
  clan,
  color,
  eval: $eval,
  roll,
  eightball,
  friends,
  id,
  level,
  mrbinks,
  tokens,
  trade,
  theme,
  testCommand,
  commands: commandsList
};
const index$e = () => createPlugin({
  name: "DeafBot",
  description: "the chatbot you know and love.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /blacket\.sendMessage =\ async \((.*?)\) => \{/,
          replace: `blacket.sendMessage = async (room, content, instantSend) => {
                        let rawContent = content.replace(/<(gradient=\\[(?:up|down|left|right|\\d{1,3}deg)(?: |):(?: |)(?:(?:(?:black|lime|white|brown|magenta|cyan|turquoise|red|orange|yellow|green|blue|purple|\\#[0-9a-fA-F]{6})(?:, |,| ,| , |)){2,7})\\]|black|lime|white|brown|magenta|cyan|turquoise|red|orange|yellow|green|blue|purple|(\\#[0-9a-fA-F]{6}))>(.+?)<\\/([^&]+?)>/g, (...args) => {
                            return args[3];
                        });
                        if (rawContent.startsWith(' ')) rawContent = rawContent.slice(1);

                        if (rawContent.startsWith(atob('JA==')) && !instantSend) {
                            let data = rawContent.split(' ');
                            let command = data[0].slice(1);
                            let args = data.slice(1);
                            (\`Executed BB command "\${command}" with args\`, args);
                            if (!bb.plugins.deafbot.commands[command]) return bb.plugins.deafbot.send('Command not found.');
                            bb.plugins.deafbot.commands[command](...args);
                            return;
                        };
                    `
        }
      ]
    }
  ],

  onLoad: () => {
    bb.plugins.deafbot = {
      send: (msg) => {
        let prefix = "**$ sudo node deafbot.js** > > > ";
        blacket.sendMessage(blacket.chat.room, prefix + msg, true);
      },
      commands
    };
  }
});
const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$e }, Symbol.toStringTag, { value: "Module" }));
const index$d = () => createPlugin({
  name: "Double Leaderboard",
  description: "see both leaderboards together.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/leaderboard.js",
      replacement: [
        {
          match: /div:nth-child\(4\) > div:nth-child\(1\)/,
          replace: "div:nth-child(3) > div:nth-child(2)"
        },
        {
          match: /\$\(".styles__containerHeaderRight___3xghM-camelCase"/,
          replace: `
                        document.querySelector('.styles__topStats___3qffP-camelCase').insertAdjacentHTML('afterend', \`<div class="styles__topStats___3qffP-camelCase" style="text-align: center;font-size: 2.604vw;margin-top: 0.521vw;display:block;"></div>\`);
                        document.querySelector('.styles__statsContainer___QnrRB-camelCase > div:nth-child(4)').remove();

                        $(".styles__containerHeaderRight___3xghM-camelCase"
                    `
        },
        {
          match: / \(\$\{data.me.exp.ex(.*?)">\)/,
          replace: ""
        },
        {
          match: / \(\$\{data.ex(.*?)">\)/,
          replace: ""
        }
      ]
    }
  ],
  onStart: () => {
    if (location.pathname.includes("leaderboard")) document.body.insertAdjacentHTML("beforeend", `<style>
            .styles__statsContainer___QnrRB-camelCase > div:nth-child(3) {
                display: flex;
                gap: 2vw;
                padding: 2vw 1.5vw;
            }

            .styles__topStats___3qffP-camelCase {
                font-size: 1.8vw !important;
            }

            .styles__containerHeaderRight___3xghM-camelCase {
                display: none;
            }
        </style>`);
  }
});

const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$d }, Symbol.toStringTag, { value: "Module" }));
const index$c = () => createPlugin({
  name: "Extra Stats",
  description: "gives you extra stats for users.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/stats.js",
      replacement: [
        {
          match: /\$\("#messages"\)\.html\(`\$\{user\.misc\.messages\.toLocaleString\(\)\}`\);/,
          replace: `
                        $("#messages").html(user.misc.messages.toLocaleString());
                        $("#stat_id").html(user.id);
                        $("#stat_created").html(new Date(user.created * 1000).toLocaleString('en-US', {
                            year: '2-digit',
                            month: '2-digit',
                            day: '2-digit',
                            timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
                        }));
                        $("#stat_lastonline").removeAttr('timestamped');
                        $("#stat_lastonline").text(\`<t:\${user.modified}:R>\`);
                    `
        }
      ]
    }
  ],
  onLoad: () => {
    if (location.pathname.startsWith("/stats")) document.querySelector(".styles__statsContainer___QnrRB-camelCase").insertAdjacentHTML("afterend", `
            <div class="styles__statsContainer___QnrRB-camelCase">
                <div class="styles__containerHeader___3xghM-camelCase">
                    <div class="styles__containerHeaderInside___2omQm-camelCase">Account</div>
                </div>
                <div class="styles__topStats___3qffP-camelCase">
                    <div class="styles__statContainer___QKuOF-camelCase" currentitem="false">
                        <div class="styles__statTitle___z4wSV-camelCase">ID</div>
                        <div id="stat_id" class="styles__statNum___5RYSd-camelCase">0</div>
                        <img loading="lazy" src="https://cdn-icons-png.flaticon.com/512/3596/3596097.png" class="styles__statImg___3DBXt-camelCase" draggable="false">
                    </div>
                    <div class="styles__statContainer___QKuOF-camelCase" currentitem="false">
                        <div class="styles__statTitle___z4wSV-camelCase">Created</div>
                        <div id="stat_created" class="styles__statNum___5RYSd-camelCase">0/0/0</div>
                        <img loading="lazy" src="https://cdn-icons-png.flaticon.com/512/4305/4305432.png" class="styles__statImg___3DBXt-camelCase" draggable="false">
                    </div>
                    <div class="styles__statContainer___QKuOF-camelCase" currentitem="false">
                        <div class="styles__statTitle___z4wSV-camelCase">Last Online</div>
                        <div id="stat_lastonline" class="styles__statNum___5RYSd-camelCase" style="font-size: 0.9vw;text-align:center;">0/0/0</div>
                        <img loading="lazy" src="https://cdn.discordapp.com/emojis/1102897525192663050.png?size=2048&quality=lossless" class="styles__statImg___3DBXt-camelCase" draggable="false">
                    </div>
                </div>
            </div>
        `);
  }
});
const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$c }, Symbol.toStringTag, { value: "Module" }));
const index$b = () => createPlugin({
  name: "Highlight Rarity",
  description: "displays the rarity of Bazaar blooks.",
  authors: [{
    name: "Death",
    avatar: "https://i.imgur.com/PrvNWub.png",
    url: "https://villainsrule.xyz"
  }],

  patches: [
    {
      file: "/lib/js/bazaar.js",
      replacement: [
        {
          match: /"\/content\/blooks\/Error\.png"\}" /,
          replace: `"/content/blooks/Error.png"}" style="\${
            blacket.blooks[blook]?.rarity === "Iridescent"
              ? "animation: bb_iridescentGlow 3s linear infinite;"
              : \`filter: drop-shadow(0 0 7px \${blacket.rarities[blacket.blooks[blook].rarity].color});\`
          }" `
        },

        {
          match: /class="styles__bazaarItemImage___KriA4-camelCase" /,
          replace: `class="styles__bazaarItemImage___KriA4-camelCase" \${
            blacket.blooks[listing.item]
              ? \`style="
                  \${
                    blacket.blooks[listing.item].rarity === "Iridescent"
                      ? "animation: bb_iridescentGlow 3s linear infinite;"
                      : \`filter: drop-shadow(0 0 7px \${blacket.rarities[blacket.blooks[listing.item].rarity].color});\`
                  }
                "\`
              : ""
          } `
        },

        {
          match: /class="styles__bazaarSelectorItem___Meg69-camelCase"/g,
          replace: `class="styles__bazaarSelectorItem___Meg69-camelCase" \${
            typeof blook !== "undefined" && blacket.blooks[blook]
              ? \`style="
                  \${
                    blacket.blooks[blook].rarity === "Iridescent"
                      ? "animation: bb_iridescentGlow 3s linear infinite;"
                      : \`filter: drop-shadow(0 0 7px \${blacket.rarities[blacket.blooks[blook].rarity].color});\`
                  }
                "\`
              : ""
          }`
        }

      ]
    }
  ],

  onLoad() {

    const style = document.createElement("style");

    style.innerHTML = `
@keyframes bb_iridescentGlow {
  0%   { filter: drop-shadow(0 0 10px #ff0000); }
  14%  { filter: drop-shadow(0 0 10px #ff8800); }
  28%  { filter: drop-shadow(0 0 10px #ffff00); }
  42%  { filter: drop-shadow(0 0 10px #00ff00); }
  57%  { filter: drop-shadow(0 0 10px #00ffff); }
  71%  { filter: drop-shadow(0 0 10px #0066ff); }
  85%  { filter: drop-shadow(0 0 10px #ff00ff); }
  100% { filter: drop-shadow(0 0 10px #ff0000); }
}
    `;

    document.head.appendChild(style);

    this.bbIridescentStyle = style;
  },

  onUnload() {

    if (this.bbIridescentStyle) {
      this.bbIridescentStyle.remove();
    }

  }

});
const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$b }, Symbol.toStringTag, { value: "Module" }));
const index$a = () => createPlugin({
  name: "Internals",
  description: "the internals of BetterBlacket.",
  authors: [{ name: "Internal" }],
  required: true,
  patches: [
    {
      file: "/lib/js/home.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\);/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');"
        },
        {
          match: /if \(blacket\.config\)/,
          replace: "if (window?.blacket?.config)"
        }
      ]
    },
    {
      file: "/lib/js/auth.js",
      replacement: [
        {
          match: /blacket\.htmlEncode\s*=\s*\(\s*s\s*\)\s*=>\s*{/,
          replace: "bb.events.dispatch('pageInit');blacket.htmlEncode = (s) => {"
        },
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        }
      ]
    },
    {
      file: "/lib/js/terms.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\);/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');"
        },
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        }
      ]
    },
    {
      file: "/lib/js/stats.js",
      replacement: [
        {
          match: /blacket\.setUser\(blacket\.user\)\;/,
          replace: "blacket.setUser(blacket.user);bb.events.dispatch('pageInit');"
        },
        {
          match: /blacket\.user\s*&&\s*blacket\.friends/,
          replace: "window?.blacket?.user && window?.blacket?.friends"
        }
      ]
    },
    {
      file: "/lib/js/leaderboard.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\);/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');"
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/clans/my-clan.js",
      replacement: [
        {
          match: /\$\("#clanInvestmentsButton"\)\.click\(\(\) \=\> \{/,
          replace: `bb.events.dispatch('pageInit');$("#clanInvestmentsButton").click(() => {`
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        },
        {
          match: /item.user\).avatar/,
          replace: `item.user)?.avatar || '/content/blooks/Error.png'`
        }
      ]
    },
    {
      file: "/lib/js/clans/discover.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\)\;/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');"
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/market.js",
      replacement: [
        {
          match: /blacket\.showBuyItemModal =/,
          replace: "bb.events.dispatch('pageInit');blacket.showBuyItemModal ="
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/blooks.js",
      replacement: [
        {
          match: /blacket\.appendBlooks\(\)\;/,
          replace: "blacket.appendBlooks();bb.events.dispatch('pageInit');"
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/chat.js",
      replacement: [
       {
         match: /blacket\.currentRoom\s*=\s*"global";/,
         replace: `blacket.currentRoom = "global";bb.events.dispatch('pageInit');`
       },
       {
         match: /blacket\.socket\.on\("chat",\s*\(data\)\s*=>\s*\{/,
         replace: `blacket.socket.on("chat", (data) => {bb.events.dispatch('chatMessage', data);`
        }
      ]
    },
    {
      file: "/lib/js/bazaar.js",
      replacement: [
        {
          match: /\}\);\s*blacket\.getBazaar\(\);/,
          replace: "});blacket.getBazaar();bb.events.dispatch('pageInit');"
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/inventory.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\);\s*\}\s*else\s*setTimeout\(reset,\s*1\);/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');} else setTimeout(reset, 1);"
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/settings.js",
      replacement: [
        {
          match: /\$\(\"#tradeRequestsButton\"\).click\(\(\) \=\> \{/,
          replace: `bb.events.dispatch('pageInit');$("#tradeRequestsButton").click(() => {`
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/store.js",
      replacement: [
        {
          match: /\$\("#buy1hBoosterButton"\)\.click\(\(\) => \{/,
          replace: `bb.events.dispatch('pageInit');$("#buy1hBoosterButton").click(() => {`
        },
        {
          match: /if \(blacket\.user\) \{/,
          replace: "if (window?.blacket?.user) {"
        }
      ]
    },
    {
      file: "/lib/js/credits.js",
      replacement: [
        {
          match: /blacket\.stopLoading\(\)\;/,
          replace: "blacket.stopLoading();bb.events.dispatch('pageInit');"
        },
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        }
      ]
    },
    {
      file: "/lib/js/trade.js",
      replacement: [
        {
          match: /blacket\.appendBlooks\(\)\;/,
          replace: "blacket.appendBlooks();bb.events.dispatch('pageInit');"
        },
        {
          match: /blacket\.user\s*&&\s*blacket\.trade/,
          replace: "window?.blacket?.user && window?.blacket?.trade"
        }
      ]
    },
    {
      file: "/lib/js/all.js",
      replacement: [
        {
          match: /blacket\s*=\s*{/,
          replace: "window.blacket = {"
        },
        {
          match: /mutation\.type === "childList" \? replace/,
          replace: "false ? "
        }
      ]
    },
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /blacket\.config\s*&&\s*blacket\.socket/,
          replace: "window?.blacket?.config && window?.blacket?.socket"
        },
        {
          match: /data\.author\.badges = \[/,
          replace: `if (typeof data.author.badges !== 'object' && !data?.author?.badges?.length) data.author.badges = [`
        },
        {
          match: /data\.friends/,
          replace: `data.friends.filter(f => f.username !== '£')`
        },
        {
          match: /forEach\(post \=\> \{/,
          replace: `forEach(post => {blacket.news[post].body=blacket.news[post].body.replace(/\\<iframe.*?iframe>/, '');`
        }
      ]
    },
    {
      file: "/lib/js/panel/home.js",
      replacement: [
        {
          match: /blacket\.user\)/,
          replace: "window.blacket?.user)"
        },
        {
          match: /Loading\(\)/,
          replace: `Loading();bb.events.dispatch('pageInit')`
        }
      ]
    },
    {
      file: "/lib/js/panel/console.js",
      replacement: [
        {
          match: /blacket\.user && blacket\.socket/,
          replace: `window.blacket?.user && window.blacket?.socket`
        },
        {
          match: /blacket\.socket\.on/,
          replace: `bb.events.dispatch('pageInit');blacket.socket.on`
        }
      ]
    },
    {
      file: "/lib/js/panel/blooks.js",
      replacement: [
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        },
        {
          match: /\$\("#createButtonBlook"\)\.c/,
          replace: `bb.events.dispatch('pageInit');$("#createButtonBlook").c`
        }
      ]
    },
    {
      file: "/lib/js/panel/rarities.js",
      replacement: [
        {
          match: /blacket\.config && blacket\.user && blacket\.rarities/,
          replace: "window?.blacket?.config && window?.blacket?.user && window?.blacket?.rarities"
        },
        {
          match: /\$\("\#createButtonRarity"\)\.c/,
          replace: `bb.events.dispatch('pageInit');$("#createButtonRarity").c`
        }
      ]
    },
    {
      file: "/lib/js/panel/badges.js",
      replacement: [
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        },
        {
          match: /blacket\.createBadge \=/,
          replace: `bb.events.dispatch('pageInit');blacket.createBadge = `
        }
      ]
    },
    {
      file: "/lib/js/panel/banners.js",
      replacement: [
        {
          match: /blacket\.config && blacket\.banners/,
          replace: "window?.blacket?.config && window?.blacket?.banners"
        },
        {
          match: /\$\("\#createButtonBanner"\)\.c/,
          replace: `bb.events.dispatch('pageInit');$("#createButtonBanner").c`
        }
      ]
    },
    {
      file: "/lib/js/panel/news.js",
      replacement: [
        {
          match: /blacket\.user && blacket\.news/,
          replace: "window?.blacket?.user && window?.blacket?.news"
        },
        {
          match: /localStorage/,
          replace: "bb.events.dispatch('pageInit');localStorage"
        }
      ]
    },
    {
      file: "/lib/js/panel/emojis.js",
      replacement: [
        {
          match: /blacket\.config/,
          replace: "window?.blacket?.config"
        },
        {
          match: /blacket.showEditModal =/,
          replace: "bb.events.dispatch('pageInit');blacket.showEditModal ="
        }
      ]
    },
    {
      file: "/lib/js/panel/users.js",
      replacement: [
        {
          match: /blacket\.user\) \{/,
          replace: "window?.blacket?.user) {"
        },
        {
          match: /blacket.setUser =/,
          replace: "bb.events.dispatch('pageInit');blacket.setUser ="
        }
      ]
    },
    {
      file: "/lib/js/panel/forms.js",
      replacement: [
        {
          match: /blacket.config/,
          replace: "window?.blacket?.config"
        },
        {
          match: /blacket.reject =/,
          replace: "bb.events.dispatch('pageInit');blacket.reject ="
        }
      ]
    }
  ],
  styles: `
        .bb_topLeftRow {
            position: absolute;
            top: 0;
            left: 11.5vw;
            display: flex;
            flex-direction: row;
            z-index: 14;
            margin: 0.5vw;
            gap: 0.5vw;
        }

        .bb_backButtonContainer {
            position: relative;
            cursor: pointer;
            outline: none;
            user-select: none;
            text-decoration: none;
            transition: filter 0.25s;
            margin-left: 0.521vw;
            margin: auto;
        }

        .bb_settingsContainer {
            display: flex;
            flex-flow: row wrap;
            justify-content: flex-start;
            margin: 0.260vw calc(5% - 0.625vw);
            width: calc(90% - 1.250vw);
            max-width: 62.500vw;
        }

        .bb_pluginContainer {
            border-radius: 0.365vw;
            background-color: #2f2f2f;
            padding: 0.781vw 1.042vw 1.146vw;
            box-shadow: inset 0 -0.365vw rgba(0, 0, 0, 0.2), 0 0 0.208vw rgba(0, 0, 0, 0.15);
            margin: 0.625vw;
            min-width: 23.958vw;
            display: flex;
            flex-direction: column;
            color: #ffffff;
            width: 27.5vw;
        }

        .bb_pluginHeader {
            display: flex;
            align-items: center;
            gap: 1vw;
        }

        .bb_pluginTitle {
            width: 100%;
        }

        .bb_pluginDescription {
            margin-top: 0.7vh;
            font-size: 2.3vh;
        }

        .switch {
            position: relative;
            display: inline-block;
            min-width: 30px;
            max-width: 30px;
            height: 17px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 34px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 13px;
            min-width: 13px;
            max-width: 13px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .slider {
            background-color: #2196F3;
        }

        input:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
        }

        input:checked + .slider:before {
            transform: translateX(13px);
        }

        .bb_requiredPluginSlider {
            background-color: #075c9f;
            cursor: not-allowed;
        }

        .bb_pluginIcon {
            cursor: pointer;
        }

        .bb_pluginAuthors {
            display: flex;
            justify-content: center;
            cursor: pointer;
            margin-top: 1vw;
            margin-right: 6px;
            font-weight: bold;
        }

        .bb_pluginAuthor {
            height: 22px;
            border-radius: 50%;
            margin-right: -6px;
            border: 2px solid #3f3f3f;
        }

        .bb_themeInfo {
            font-family: Nunito, sans-serif;
            line-height: 1.823vw;
            margin: 1.5vh 0 5px 0;
            color: #ffffff;
            font-size: 1.6vw;
        }

        .bb_themeHeader {
            font-family: Nunito, sans-serif;
            line-height: 1.823vw;
            margin: 3.5vw 0 5px 0;
            color: #ffffff;
            font-size: 2.75vw;
        }

        .bb_themeTextarea {
            min-height: 30vh;
            height: auto;
            width: 100%;
            background: #2f2f2f;
            border: 2px solid #1f1f1f;
            border-radius: 3px;
            color: white;
            padding: 10px;
            margin-top: 2.5vh;
            outline: none;
            resize: none;
        }

        .styles__container___1BPm9-camelCase {
            width: 25vw;
        }

        .bb_bigModal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 50%;
            background-color: #3f3f3f;
            border-radius: 0.365vw;
            text-align: center;
            box-sizing: border-box;
            padding-bottom: 0.365vw;
            box-shadow: inset 0 -0.365vw rgba(0, 0, 0, 0.2), 0 0 0.208vw rgba(0, 0, 0, 0.15);
        }

        .bb_bigModalTitle {
            font-family: Nunito, sans-serif;
            font-size: 2.8vw;
            line-height: 1.823vw;
            font-weight: 700;
            margin: 2vw 1.563vw;
            color: #ffffff;
        }

        .bb_bigModalDescription {
            font-family: Nunito, sans-serif;
            line-height: 1.823vw;
            font-weight: 700;
            margin: -3px 0 5px 0;
            color: #ffffff;
            font-size: 1.6vw;
        }

        .bb_bigModalDivider {
            height: 1.5px;
            border-top: 1px solid var(--ss-white);
            border-radius: 10px;
            width: 90%;
            margin: 2vh 5%;
        }

        .bb_bigModalHeader {
            font-family: Nunito, sans-serif;
            font-size: 2vw;
            line-height: 1.823vw;
            font-weight: 700;
            margin: 1.8vw 1.3vw;
            color: #ffffff;
        }

        .bb_modalDescription {
            font-family: Nunito, sans-serif;
            line-height: 1.823vw;
            font-weight: 700;
            margin: -7px 0 5px 0;
            color: #ffffff;
            font-size: 1vw;
            padding: 0 1vw;
        }

        .bb_modalOuterInput {
            border: 0.156vw solid rgba(0, 0, 0, 0.17);
            border-radius: 0.313vw;
            width: 90%;
            height: 2.604vw;
            margin: 0.000vw;
            display: flex;
            flex-direction: row;
            align-items: center;
        }

        .bb_modalInput {
            border: none;
            height: 2.083vw;
            line-height: 2.083vw;
            font-size: 1.458vw;
            text-align: center;
            font-weight: 700;
            font-family: Nunito, sans-serif;
            color: #ffffff;
            background-color: #3f3f3f;
            outline: none;
            width: 100%;
        }

        .bb_pluginSettings {
            display: flex;
            align-items: center;
            flex-direction: column;
            gap: 1vh;
        }

        .bb_pluginSetting {
            display: flex;
            align-items: center;
            gap: 1.5vw;
        }

        .bb_settingName {
            color: white;
            font-size: 1.8vw;
        }
    `,
  onStart: () => {
    let mods = {
      "BetterBlacket v2": () => !!(window.pr || window.addCSS),
      "Flybird": () => !!window.gold,
      "Themeify": () => !!document.querySelector("#themifyButton"),
      "Blacket++": () => !!(window.BPP || window.bpp)
    };
    if (Object.entries(mods).some((mod2) => mod2[1]() ? true : false)) return document.body.insertAdjacentHTML("beforeend", `
            <div class="arts__modal___VpEAD-camelCase" id="bigModal">
                <div class="bb_bigModal">
                    <div class="bb_bigModalTitle">External Mod Detected</div>
                    <div class="bb_bigModalDescription" style="padding-bottom: 1vw;">Our automated systems believe you are running the ${mod[0]} mod. We require that only BetterBlacket v3 is running. This prevents unneeded "IP abuse bans" from Blacket's systems.</div>
                </div>
            </div>
        `);
    if (!location.pathname.startsWith("/settings")) return;
    ("Internals started! Patching settings...");
    document.querySelector(".styles__mainContainer___4TLvi-camelCase").id = "settings-main";
    $(`
            <div class="styles__infoContainer___2uI-S-camelCase">
                <div class="styles__headerRow___1tdPa-camelCase">
                    <i class="fas fa-code styles__headerIcon___1ykdN-camelCase" aria-hidden="true"></i>
                    <div class="styles__infoHeader___1lsZY-camelCase">BetterBlacket</div>
                </div>
                <div><a id="pluginsButton" class="styles__link___5UR6_-camelCase">Manage Plugins</a></div>
                <div><a id="themesButton" class="styles__link___5UR6_-camelCase">Manage Themes</a></div>
                <div><a id="resetDataButton" class="styles__link___5UR6_-camelCase">Reset Data</a></div>
            </div>
        `).insertBefore($(".styles__infoContainer___2uI-S-camelCase")[0]);
    document.querySelector("#app > div > div").insertAdjacentHTML("beforeend", `
            <div class="bb_topLeftRow">
                <div class="bb_backButtonContainer" style="display: none;">
                    <div class="styles__shadow___3GMdH-camelCase"></div>
                    <div class="styles__edge___3eWfq-camelCase" style="background-color: #2f2f2f;"></div>
                    <div class="styles__front___vcvuy-camelCase styles__buttonInsideNoMinWidth___39vdp-camelCase" style="background-color: #2f2f2f;">
                        <i class="fas fa-reply" aria-hidden="true"></i>
                    </div>
                </div>
            </div>
        `);
    $("#resetDataButton").click(async () => {
      Object.keys(localStorage).forEach((key) => localStorage.removeItem(key));
      location.reload();
    });
    $("#pluginsButton").click(() => {
      document.querySelector("#settings-main").style.display = "none";
      document.querySelector("#plugins-main").style.display = "";
      document.querySelector(".styles__header___WE435-camelCase").innerHTML = "Settings | Plugins";
      document.querySelector(".styles__header___WE435-camelCase").style.textAlign = "center";
      document.querySelector(".bb_backButtonContainer").style.display = "";
    });
    $("#themesButton").click(() => {
      document.querySelector("#settings-main").style.display = "none";
      document.querySelector("#themes-main").style.display = "";
      document.querySelector(".styles__header___WE435-camelCase").innerHTML = "Settings | Themes";
      document.querySelector(".styles__header___WE435-camelCase").style.textAlign = "center";
      document.querySelector(".bb_backButtonContainer").style.display = "";
    });
    $(".bb_backButtonContainer").click(() => {
      document.querySelector("#settings-main").style.display = "";
      document.querySelector("#plugins-main").style.display = "none";
      document.querySelector("#themes-main").style.display = "none";
      document.querySelector(".styles__header___WE435-camelCase").innerHTML = "Settings";
      document.querySelector(".styles__header___WE435-camelCase").style.textAlign = "";
      document.querySelector(".bb_backButtonContainer").style.display = "none";
    });
    let activePlugins = bb.storage.get("bb_pluginData", true).active;
    let themeData = bb.storage.get("bb_themeData", true);
    $(".arts__profileBody___eNPbH-camelCase").append(`
            <div class="bb_settingsContainer" id="plugins-main" style="display: none;">
                ${bb.plugins.list.filter((p) => !p.required && !p.disabled).map((p) => `
                    <div class="bb_pluginContainer">
                        <div class="bb_pluginHeader">
                            <div class="bb_pluginTitle">${p.name}</div>
                            ${p.settings.length ? `<i id="bb_pluginIcon_${p.name.replaceAll(" ", "-")}" class="fas fa-gear bb_pluginIcon" aria-hidden="true"></i>` : `<i id="bb_pluginIcon_${p.name.replaceAll(" ", "-")}" class="far fa-circle-info bb_pluginIcon" aria-hidden="true"></i>`}
                            <label class="switch">
                                <input type="checkbox" ${activePlugins.includes(p.name) || p.required ? "checked" : ""} id="bb_pluginCheckbox_${p.name.replaceAll(" ", "-")}">
                                <span class="${p.required ? "slider bb_requiredPluginSlider" : "slider"}"></span>
                            </label>
                        </div>
                        <div class="bb_pluginDescription">${p.description}</div>
                    </div>
                `).join("")}
            </div>

            <div class="bb_settingsContainer" id="themes-main" style="display: none;">
                <div class="bb_themeInfo"><b>Paste CSS file links here.</b><br>    - Paste one link per line.<br>    - Use raw CSS files, like from "raw.githubusercontent.com" or "github.io".<br>    - Put "//" in front of a theme link to ignore it.</div>
                <textarea class="bb_themeTextarea">${themeData?.textarea ? themeData.textarea : "https://blacket.org/lib/css/all.css\nhttps://blacket.org/lib/css/game.css"}</textarea>
                <div class="bb_themeHeader">Theme Checker</div>
                <div class="bb_themeValidation">
                    ${bb.themes.list.map((t) => `<div class="bb_themeInfo" style="color: green;">${t.name} | ${t.url}</div>`).join("")}
                    ${bb.themes.broken.map((t) => `<div class="bb_themeInfo" style="color: red;">${t.url} - ${t.reason}</div>`).join("")}
                </div>
            </div>
        `);
    document.querySelector(".bb_themeTextarea").oninput = (ev) => {
      bb.storage.set("bb_themeData", {
        active: ev.target.value.split("\\n").filter((a) => !a.startsWith("//")),
        textarea: ev.target.value
      }, true);
      bb.themes.reload();
    };
    bb.events.listen("themeUpdate", () => {
      document.querySelector(".bb_themeValidation").innerHTML = `
                ${bb.themes.list.map((t) => `<div class="bb_themeInfo" style="color: green;">${t.name} | ${t.url}</div>`).join("")}
                ${bb.themes.broken.map((t) => `<div class="bb_themeInfo" style="color: red;">${t.url} - ${t.reason}</div>`).join("")}
            `;
    });
    let storedPluginData = bb.storage.get("bb_pluginData", true);
    bb.plugins.list.forEach((p) => {
      if (p.required || p.disabled) return;
      document.querySelector(`#bb_pluginCheckbox_${p.name.replaceAll(" ", "-")}`).onchange = (ev) => {
        if (p.required) return ev.target.checked = true;
        const inform = () => blacket.createToast({
          title: "Pending Changes",
          message: "You have changes in your plugins you have not applied. Reload to apply.",
          time: 5e3
        });
        inform();
        setInterval(() => inform(), 1e4);
        bb.plugins.pendingChanges = true;
        if (storedPluginData.active.includes(p.name)) storedPluginData.active.splice(storedPluginData.active.indexOf(p.name), 1);
        else storedPluginData.active.push(p.name);
        bb.storage.set("bb_pluginData", storedPluginData, true);
      };
      document.querySelector(`#bb_pluginIcon_${p.name.replaceAll(" ", "-")}`).onclick = () => {
        document.body.insertAdjacentHTML("beforeend", `
                    <div class="arts__modal___VpEAD-camelCase" id="bigModal">
                        <div class="bb_bigModal">
                            <div class="bb_bigModalTitle">${p.name}</div>
                            <div class="bb_bigModalDescription">${p.description}</div>
                            <div class="bb_pluginAuthors">${p.authors.map((a) => `<img src="${a.avatar}" onclick="window.open('${a.url}', '_blank')" class="bb_pluginAuthor" />`).join("")}</div>
                            <hr class="bb_bigModalDivider" />
                            <div class="bb_bigModalHeader">Settings</div>
                            ${p.settings.length ? `<div class="bb_pluginSettings">
                                ${p.settings.map((set) => `
                                    <div class="bb_pluginSetting">
                                        <div class="bb_settingName">${set.name}</div>
                                        <label class="switch">
                                            <input type="checkbox" ${typeof storedPluginData.settings?.[p.name]?.[set.name] === "boolean" ? storedPluginData.settings?.[p.name]?.[set.name] ? "checked" : "" : set.default ? "checked" : ""} id="bb_settingCheck_${p.name.replaceAll(" ", "-")}_${set.name.replaceAll(" ", "-")}">
                                            <span class="slider"></span>
                                        </label>
                                    </div>
                                `).join("")}
                            </div>` : `<div class="bb_modalDescription">This plugin has no settings.</div>`}
                            <hr class="bb_bigModalDivider" />
                            <div class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0" onclick="document.getElementById('bigModal').remove()" style="width: 30%;margin-bottom: 1.5vh;">
                                <div class="styles__shadow___3GMdH-camelCase"></div>
                                <div class="styles__edge___3eWfq-camelCase" style="background-color: #2f2f2f;"></div>
                                <div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: #2f2f2f;">Close</div>
                            </div>
                        </div>
                    </div>
                `);
        p.settings.forEach((setting) => {
          document.querySelector(`#bb_settingCheck_${p.name.replaceAll(" ", "-")}_${setting.name.replaceAll(" ", "-")}`).onchange = (ev) => {
            if (!storedPluginData.settings) storedPluginData.settings = {};
            if (!storedPluginData.settings[p.name]) storedPluginData.settings[p.name] = {};
            storedPluginData.settings[p.name][setting.name] = ev.target.checked;
            bb.plugins.settings[p.name][setting.name] = ev.target.checked;
            bb.storage.set("bb_pluginData", storedPluginData, true);
          };
        });
      };
    });
  }
});
const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$a }, Symbol.toStringTag, { value: "Module" }));
const index$9 = () => createPlugin({
  name: "Message Logger",
  description: "view deleted messages like a staff would.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  disabled: false,
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /blacket\.user\.perms\.includes\("delete_messages"\) \|\| blacket\.user\.perms\.includes\("\*"\)/,
          replace: "true"
        }
      ]
    }
  ]
});
const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$9 }, Symbol.toStringTag, { value: "Module" }));
const index$8 = () => createPlugin({
  name: "No Chat Color",
  description: "disables color in chat.",
  authors: [{ name: "Syfe", avatar: "https://i.imgur.com/OKpOipQ.gif", url: "https://github.com/ItsSyfe" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /\$\{data\.author\.color/,
          replace: `\${"#ffffff"`,
          setting: "No Username Colors"
        },
        {
          match: /\$\{blacket\.chat\.cached\.users\[id\]\.color/,
          replace: `\${"#ffffff"`,
          setting: "No Mention Colors"
        },
        {
          match: /\!data\.author\.permissions\.includes\("use_chat_colors"\)/,
          replace: `bb.plugins.settings['No Chat Color']?.['No Message Colors'] ?? true`,
          setting: "No Message Colors"
        },
        {
          match: /\$\{data\.author\.clan\.color\}/,
          replace: `\${"#ffffff"}`,
          setting: "No Clan Colors"
        }
      ]
    }
  ],
  settings: [
    { name: "No Username Colors", default: true },
    { name: "No Mention Colors", default: true },
    { name: "No Message Colors", default: true },
    { name: "No Clan Colors", default: true }
  ]
});
const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$8 }, Symbol.toStringTag, { value: "Module" }));
const index$7 = () => createPlugin({
  name: "No Chat Ping",
  description: "prevents you from being pinged in chat.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /message\.message\.mentions\.includes\(\w+\.user\.id\.toString\(\)\)/,
          replace: "false"
        },
        {
          match: /data\.data\.message\.mentions\.includes\(blacket\.user\.id\.toString\(\)\)/,
          replace: "false"
        },
        {
          match: /\$\{mentioned/,
          replace: `\${bb.plugins.settings['No Chat Ping']?.['Keep Highlight'] && rawMessage.includes(blacket.user.id.toString()) || mentioned`
        }
      ]
    }
  ],
  settings: [
    {
      name: "Keep Highlight",
      default: false
    }
  ]
});
const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$7 }, Symbol.toStringTag, { value: "Module" }));
const index$6 = () => createPlugin({
  name: "No Devtools Warning",
  description: "disables the warning in the console.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/all.js",
      replacement: [
        {
          match: /console\.log\(`%cWARNING!`, `font-size: 35px;`\);\s*console\.log\(`%cThis is a browser feature intended for developers\. If someone told you to copy and paste something here to enable a \${blacket\.config\.name} feature or "hack" someone else's account, it is most likely a scam and will give them access to your account\.`, `font-size: 20px;`\);\s*console\.log\(`%cIf you ignore this message and the script does work, PLEASE contact a \${blacket\.config\.name} developer immediately\.`, `font-size: 20px;`\);\s*/s,
          replace: ""
        }
      ]
    }
  ]
});
const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$6 }, Symbol.toStringTag, { value: "Module" }));
const index$5 = () => createPlugin({
  name: "OldBadges",
  description: "reverts the first badge upgrade, returning many badges to the original state.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/all.js",
      replacement: [
        {
          match: /Object.assign/,
          replace: `data=$self.modify(data);Object.assign`
        }
      ]
    }
  ],
  modify: (data) => {
    let oldBadges = {
      Plus: "https://i.imgur.com/qu3WJQ6.png",
      //"https://i.ibb.co/3yNrKhb4/8abab1d2-1f05-43a6-bb5b-bb9d6cb7717b-removalai-preview.png",
      //"https://i.ibb.co/7NxvTnMT/6d65726368616e745f69643d616363745f315133305a4343464f3847506d45395926636c69656e743d5041594d454e545f50.png",
      Owner: "https://i.imgur.com/w5PV2jw.png",/*"https://i.ibb.co/YFfB8KdN/b72bbeaf-4267-45cd-b3f5-53ab0cd70a55-removalai-preview.png",*/
      Artist: "https://i.imgur.com/2EGHbLG.png",
      "Legacy Ankh": "https://i.imgur.com/m0Vin3j.png",//"https://i.ibb.co/6RRnZdzg/bbf5716e-206b-43c9-b0de-41066caa9e9f-removalai-preview.png",
      Booster: "https://i.imgur.com/7E20vLD.png",//"https://i.ibb.co/XkGKLsQw/5e2be507-ff78-4fff-8d69-5472d3a9126c-removalai-preview.png",
      Verified: "https://i.imgur.com/RwlUTSe.png",/*"https://i.ibb.co/JwPJJPHf/935a4946-d616-4007-8b5c-5a9f95bbb237-removalai-preview.png",*/
      "Verified Bot": "https://i.imgur.com/0eLB3Xz.png",
      Tester: "https://i.imgur.com/0K816Nj.png",/*"https://i.ibb.co/0j5WtjLr/55194d14-e105-4820-bdd1-0400c4aa3748-removalai-preview.png",*/
      Staff: "https://i.imgur.com/dmJ2lIB.png",//"https://i.ibb.co/jvYmxTMJ/78a47641-b6c5-48c2-8ee8-94e6ccf0cd03-removalai-preview.png",
      OG: "https://i.imgur.com/kWNfORf.png",//"https://i.ibb.co/xt0sYPnY/3f7bfd9b-da45-4b2c-b9db-e70359ae7150-removalai-preview.png",
      "Big Spender": "https://i.imgur.com/bpr9QoT.png",
      /*"6 Month Veteran": "https://i.ibb.co/B226gT1q/6-Month-Veteran.webp",
      "12 Month Veteran": "https://i.ibb.co/SXXQzXGH/12-Month-Veteran.webp",
      "18 Month Veteran": "https://i.ibb.co/cShC5v3Z/18-Month-Veteran.webp",
      "24 Month Veteran": "https://i.ibb.co/przBhS91/24-Month-Veteran.webp",
      "30 Month Veteran": "https://i.ibb.co/s9S02rNq/30-Month-Veteran.webp",
      "36 Month Veteran": "https://i.ibb.co/BKHYCC3T/36-Month-Veteran.webp",
      "42 Month Veteran": "https://i.ibb.co/4RnxYcwV/42-Month-Veteran.webp",
      "48 Month Veteran": "https://i.ibb.co/k64rcTdm/48-Month-Veteran.webp",
      "Developer": /*"https://i.ibb.co/qMBqv7tK/Developer.png", "https://i.ibb.co/4ZjNRGFg/Removal-819.png",
      "Collector": "https://i.ibb.co/5XF0SLfW/Collector.png",
      "Avid Collector": "https://i.ibb.co/27JXL8K8/Avid-Collector-1.png",
      "Master Collector": "https://i.ibb.co/DHNgD4Dz/Collector1.png",
      "Ultimate Collector": "https://i.ibb.co/rLSZGCT/Collector.png",
      "Co-Owner": "https://i.ibb.co/H8J8FsR/w5PV2jw.png",
      "Big Spender V": "https://i.ibb.co/m5fyH3yT/Big-Spender-V.png",
      "Blacktuber": "https://i.ibb.co/rG3rJXF0/Removal-555.png",
      "Mixer": "https://i.ibb.co/Gvx0tTjw/Mixer-1.png",
      "Partner": "https://i.ibb.co/0RTJB11d/Partner.png",
      "Scat": "https://i.ibb.co/qMq6KS4s/Scat.png"*/
       };
    if (bb.plugins.settings["OldBadges"]["Co-Owner to Owner"]) oldBadges["Co-Owner"] = oldBadges["Owner"];
    Object.entries(oldBadges).forEach(([badge, url]) => data.badges[badge].image = url);
    return data;
  },
  settings: [{
    name: "Co-Owner to Owner",
    default: false
  }]
});
const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$5 }, Symbol.toStringTag, { value: "Module" }));
const index$4 = () => createPlugin({
  name: "Quick CSS",
  description: "edit CSS for the game and have it applied instantly.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  styles: `
        .bb_customCSSBox {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            min-width: 5vw;
            height: 2.865vw;
            border-bottom-left-radius: 0.521vw;
            border-bottom-right-radius: 0.521vw;
            box-sizing: border-box;
            box-shadow: inset 0 -0.417vw rgba(0, 0, 0, 0.2), 0 0 0.208vw rgba(0, 0, 0, 0.15);
            padding: 0 0.521vw 0.417vw;
            font-size: 1.042vw;
            color: white;
            background: #2f2f2f;
        }

        .bb_customCSSIcon {
            margin: -0.2vw 0 0 0;
            padding: 0;
            font-size: 1.5vw;
        }

        .bb_customCSSCorner {
            position: absolute;
            bottom: 1vw;
            right: 1vw;
            padding: 10px;
        }

        .bb_customCSSCornerIcon {
            font-size: 2.5vw;
        }

        .bb_customCSSTextarea {
            min-height: 30vh;
            height: 40vh;
            width: 80%;
            background: #2f2f2f;
            border: 2px solid #1f1f1f;
            border-radius: 3px;
            color: white;
            padding: 10px;
            margin-top: 2.5vh;
            outline: none;
            resize: none;
        }
    `,
  onStart: () => {
    let storage2 = bb.storage.get("bb_pluginData", true);
    if ([
      "stats",
      "leaderboard",
      "clans/discover",
      "market",
      "blooks",
      "bazaar",
      "inventory",
      "settings"
    ].some((path) => location.pathname.startsWith(`/${path}`))) {
      document.querySelector("#app > div > div > div").insertAdjacentHTML("afterbegin", `
                <div class="bb_customCSSBox">
                    <i class="bb_customCSSIcon fas fa-palette"></i>
                </div>
            `);
    } else if ([
      "trade",
      "store",
      "register",
      "login"
    ].some((path) => location.pathname.startsWith(`/${path}`))) {
      document.querySelector(".arts__body___3acI_-camelCase").insertAdjacentHTML("beforeend", `
                <div class='bb_customCSSCorner styles__button___1_E-G-camelCase' role='button' tabindex='0'>
                    <div class='styles__shadow___3GMdH-camelCase'></div>
                    <div class='styles__edge___3eWfq-camelCase' style='background-color: #2f2f2f;'></div>
                    <div class='styles__front___vcvuy-camelCase''>
                        <i class="bb_customCSSCornerIcon fas fa-palette"></i>
                    </div>
                </div>
            `);
    } else if (location.pathname.includes("my-clan")) {
      document.querySelector("#clanLeaveButton").insertAdjacentHTML("afterend", `
                <div class="bb_customCSSBox">
                    <i class="bb_customCSSIcon fas fa-palette"></i>
                </div>
            `);
    } else return;
    document.body.insertAdjacentHTML("beforeend", `<style id="bb_quickCSS">${storage2?.quickcss || ""}</style>`);
    (document.querySelector(".bb_customCSSBox") || document.querySelector(".bb_customCSSCorner") || document.querySelector(".bb_customCSSSmallBox")).onclick = () => {
      document.body.insertAdjacentHTML("beforeend", `
                <div class="arts__modal___VpEAD-camelCase" id="bigModal">
                    <div class="bb_bigModal">
                        <div class="bb_bigModalTitle">QuickCSS</div>
                        <div class="bb_bigModalDescription">Quickly modify the CSS of Blacket.</div>
                        <hr class="bb_bigModalDivider" />
                        <textarea class="bb_customCSSTextarea">${document.querySelector("#bb_quickCSS")?.innerHTML || ""}</textarea>
                        <hr class="bb_bigModalDivider" />
                        <div class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0" onclick="document.getElementById('bigModal').remove()" style="width: 30%;margin-bottom: 1.5vh;">
                            <div class="styles__shadow___3GMdH-camelCase"></div>
                            <div class="styles__edge___3eWfq-camelCase" style="background-color: #2f2f2f;"></div>
                            <div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: #2f2f2f;">Close</div>
                        </div>
                    </div>
                </div>
            `);
      document.querySelector(".bb_customCSSTextarea").oninput = (e) => {
        document.querySelector("#bb_quickCSS").innerHTML = e.target.value;
        let storage3 = bb.storage.get("bb_pluginData", true);
        storage3.quickcss = e.target.value;
        bb.storage.set("bb_pluginData", storage3, true);
      };
    };
    (document.querySelector(".bb_customCSSBox") || document.querySelector(".bb_customCSSCorner") || document.querySelector(".bb_customCSSSmallBox")).oncontextmenu = (r) => {
      r.preventDefault();
      bb.themes.reload();
    };
  }
});
const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$4 }, Symbol.toStringTag, { value: "Module" }));
const index$3 = () => createPlugin({
  name: "Real Total blooks",
  description: "displays the true number of total blooks on the stats page.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/stats.js",
      replacement: [
        {
          match: /maxBlooks\.toLocaleString\(\)/,
          replace: `Object.keys(blacket.blooks).length`
        }
      ]
    }
  ]
});
const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$3 }, Symbol.toStringTag, { value: "Module" }));
const index$2 = () => createPlugin({
  name: "Staff Tags",
  description: "gives staff who speak in chat a special tag.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /\$\{badges\}/,
          replace: `\${badges} \${['Common', 'Plus', 'Tester', 'Partner', 'Owner', 'Co-Owner', 'President/Co-Owner', 'Admin', 'Administrator', 'Moderator', 'Helper', 'System', 'The Original Pokémon', 'hooligan', 'p2w king', 'in his prime', 'Pig', 'woman', 'Glummy Cartel Leader',  ].includes(data.author.role) || bb.plugins.settings['Staff Tags']?.['Show Artists'] && data.author.role === 'Artist' || bb.plugins.settings['Staff Tags']?.['Show Testers'] && data.author.role === 'Tester' ? \`<span class="bb_roleTag">\${data.author.role}</span>\` : ''}`
        }
      ]
    }
  ],
  styles: `
.bb_roleTag {
    margin-left: 0.30vw;
    background: #2f2f2f;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 1vw;
    color: white;
}
    `,
  settings: [
    {
      name: "Show Testers",
      default: true
    },
    {
      name: "Show Artists",
      default: true
    }
  ]
});
const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$2 }, Symbol.toStringTag, { value: "Module" }));
const index$1 = () => createPlugin({
  name: "Test Admin",
  description: "allows anyone to access the forced admin panel.",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /perm == "none"/,
          replace: `perm == "none" || page === "Panel"`
        }
      ]
    },
    {
      file: "/lib/js/panel/home.js",
      replacement: [
        {
          match: /\("\*"\)/,
          replace: `("*") || !blacket.panel.buttons[button].disabled`
        },
        {
          match: /"edit_presets"/,
          replace: `"edit_presets",disabled:false`
        },
        {
          match: /\/\*"/,
          replace: `"`
        },
        {
          match: /_packs"/,
          replace: `_packs",disabled:false`
        },
        {
          match: /_reports"/,
          replace: `_reports",disabled:false`
        },
        {
          match: /\},\*\//,
          replace: "},"
        }
      ]
    },
    {
      file: "/lib/js/panel/users.js",
      replacement: [
        {
          match: /let online/,
          replace: `
                        user.mute = { muted: Math.random() < 0.6 };
                        user.ban = { banned: Math.random() < 0.6 };
                        let online
                    `
        },
        {
          match: /\("ban_users"\)/,
          replace: `("ban_users") || true`
        }
      ]
    },
    {
      file: "/lib/js/panel/console.js",
      replacement: [
        {
          match: /\$\("\#commandInputBox"\).k/,
          replace: `
                        [
                            '[Blacket] Started!',
                            '[Blacket] Type "help" for commands.',
                            '[Blacket] Type "clear" to clear the console.',
                            '[Blacket] Type "exit" to exit the console.',
                            '[Blacket] Please note that this is populated data written by BetterBlacket',
                            '[Blacket] To disable these populations, turn off the TestAdmin plugin.'
                        ].forEach(p => blacket.appendConsoleLine(p));
                        $('#commandInputBox').k`
        }
      ]
    },
    {
      file: "/lib/js/panel/forms.js",
      replacement: [
        {
          match: /currentPage = 1/,
          replace: `currentPage = 0`
        },
        {
          match: /return blacket/,
          replace: `blacket`
        },
        {
          match: /maxPages = data\.pages/,
          replace: `maxPages = 5`
        },
        {
          match: /blacket\.currentPage = data\.page/,
          replace: `blacket.currentPage++`
        },
        {
          match: /data\.forms\.length/,
          replace: `Math.round(Math.random() * 20)`
        },
        {
          match: /data\.total/,
          replace: `Math.round(Math.random() * 70)`
        },
        {
          match: /data.forms/,
          replace: `
                        let createAge = () => Math.round(Math.random() * 3) + 13;
                        let createUsername = () => 'Username' + Math.round(Math.random() * 1000);
                        let discord = () => 'username' + Math.round(Math.random() * 1000);
                        let body = () => 'This body was generated by the Test Admin BetterBlacket Plugin. This is NOT a real form. If you are a staff, you can see real forms by disabling this plugin. '.repeat(Math.round(Math.random() * 3));

                        let createForm = () => ({
                            username: createUsername(),
                            age: createAge(),
                            discord: discord(),
                            body: body()
                        });

                        new Array(69).fill().map(() => createForm())`
        }
      ]
    }
  ]
});
const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$1 }, Symbol.toStringTag, { value: "Module" }));
const index = () => createPlugin({
  name: "Tokens Everywhere",
  description: "shows your token count on ALL pages!",
  authors: [{ name: "Death", avatar: "https://i.imgur.com/PrvNWub.png", url: "https://villainsrule.xyz" }],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /\$\("#roomDropdownGlobal"\)/,
          replace: `$self.updateTokens();$("#roomDropdownGlobal")`
        }
      ]
    },
    {
      file: "/lib/js/blooks.js",
      replacement: [
        {
          match: /-= quantity;/,
          replace: `-= quantity;blacket.user.tokens += blacket.blooks[blacket.blooks.selected].price*quantity;$self.updateTokens();`
        }
      ]
    }
  ],
  updateTokens: () => $("#tokenBalance > div:nth-child(2)").html(blacket.user.tokens.toLocaleString()),
  onLoad: () => {
    if ([
      "leaderboard",
      "clans/discover",
      "blooks",
      "inventory",
      "settings"
    ].some((path) => location.pathname.startsWith(`/${path}`))) {
      document.querySelector(".styles__topRightRow___dQvxc-camelCase").insertAdjacentHTML("afterbegin", `
                <div id="tokenBalance" class="styles__tokenBalance___1FHgT-camelCase">
                    <img loading="lazy" src="/content/tokenIcon.webp" alt="Token" class="styles__tokenBalanceIcon___3MGhs-camelCase" draggable="false">
                    <div>tokens</div>
                </div>
            `);
    }
  }
});
const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index }, Symbol.toStringTag, { value: "Module" }));
const index_customtest = () => createPlugin({
  name: "test",
  description: "testy testy hehe",
  disabled: true,
  authors: [
    { name: "C00LESTKIDDEVER", avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png", url: "https://c00lestkiddever.nekoweb.org/" }
  ],
  onLoad: () => {
  }
});
const index_custom = () => createPlugin({
  name: "Trade Message Highlighter",
  description: "Highlights trade-related chat messages.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  settings: [
    { name: "tradeColor", type: "text", default: "#ff000033" },
    { name: "offerColor", type: "text", default: "#ffff0033" },
    { name: "lookingColor", type: "text", default: "#0096ff33" },
    { name: "tradeLookingColor", type: "text", default: "#8000ff33" },
    { name: "tradeOfferColor", type: "text", default: "#ff8c0033" },
    { name: "offerLookingColor", type: "text", default: "#00c86433" },
    { name: "allColor", type: "text", default: "#5a2d0059" }
  ],

  onLoad: () => {
    const getColors = () => bb.plugins.settings["Trade Message Highlighter"];

    const normalize = (text) =>
      text
        .toLowerCase()
        .replace(/[^a-z\s]/g, " ")
        .replace(/\s+/g, " ")
        .trim();

    const hasWord = (words, list) => {
      for (const w of words) {
        for (const target of list) {
          if (w === target) return true;
        }
      }
      return false;
    };

    const highlightMessages = () => {
      const messages = document.querySelectorAll('[class*="chatMessage"]');

      messages.forEach(msg => {
        if (msg.dataset.tradeHighlighted) return;

        const text = normalize(msg.textContent);
        const words = text.split(" ");

        // 🔥 completely clean detection
        const hasTrade = hasWord(words, ["trade", "trades", "trading"]);
        const hasOffer = hasWord(words, ["offer", "offers", "offering"]);
        const hasLooking =
          text.includes("looking for") ||
          hasWord(words, ["looking", "lf"]);

        const colors = getColors();
        let color = null;

        if (hasTrade && hasOffer && hasLooking) {
          color = colors.allColor;
        } else if (hasTrade && hasLooking) {
          color = colors.tradeLookingColor;
        } else if (hasTrade && hasOffer) {
          color = colors.tradeOfferColor;
        } else if (hasOffer && hasLooking) {
          color = colors.offerLookingColor;
        } else if (hasTrade) {
          color = colors.tradeColor;
        } else if (hasOffer) {
          color = colors.offerColor;
        } else if (hasLooking) {
          color = colors.lookingColor;
        }

        if (color) {
          msg.style.setProperty("background-color", color, "important");
          msg.dataset.tradeHighlighted = "true";
        }
      });
    };

    // run once
    highlightMessages();

    // watch for new messages
    const observer = new MutationObserver(highlightMessages);

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
});

const index_custom2 = () => createPlugin({
  name: "Notification Creator",
  description: "Create custom Blacket toast notifications in-game.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {
    const waitForUI = () => {
      const container = document.querySelector('[class*="mainContainer"]');
      if (!container) {
        setTimeout(waitForUI, 500);
        return;
      }

      // prevent duplicates
      if (document.getElementById("notif-creator")) return;

      const wrapper = document.createElement("div");
      wrapper.id = "notif-creator";

      wrapper.innerHTML = `
        <div class="styles__infoContainer___2uI-S-camelCase">
          <div class="styles__headerRow___1tdPa-camelCase">
            <i class="fas fa-bell styles__headerIcon___1ykdN-camelCase"></i>
            <div class="styles__infoHeader___1lsZY-camelCase">Notification Creator</div>
          </div>

          <div class="styles__text___1x37n-camelCase">
            <b>Title:</b><br>
            <input id="toast-title" style="width:100%;">
          </div>

          <div class="styles__text___1x37n-camelCase">
            <b>Message:</b><br>
            <input id="toast-message" style="width:100%;">
          </div>

          <div class="styles__text___1x37n-camelCase">
            <b>Icon:</b><br>
            <input id="toast-icon" style="width:100%;" placeholder="/content/blooks/Info.webp">
          </div>

          <div class="styles__text___1x37n-camelCase">
            <b>Time (ms):</b><br>
            <input id="toast-time" style="width:100%;" placeholder="5000">
          </div>

          <div class="styles__text___1x37n-camelCase">
            <a id="toast-create" class="styles__link___5UR6_-camelCase">
             Send Notification
            </a>
          </div>
        </div>
      `;

      container.appendChild(wrapper);

      const btn = wrapper.querySelector("#toast-create");

      btn.addEventListener("click", () => {
        const title = wrapper.querySelector("#toast-title").value || "";
        const message = wrapper.querySelector("#toast-message").value || "";
        const icon = wrapper.querySelector("#toast-icon").value || "/content/blooks/Info.webp";
        const time = parseInt(wrapper.querySelector("#toast-time").value) || 5000;

        window.blacket.createToast({
          title,
          message,
          icon,
          time
        });
      });
    };

    waitForUI();
  }
});
const index_custom3 = () => createPlugin({
  name: "Chat Timestamps",
  description: "Adds timestamps next to usernames in chat.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    const formatTime = () => {
      const d = new Date();
      let h = d.getHours();
      const m = d.getMinutes().toString().padStart(2, "0");
      const ampm = h >= 12 ? "PM" : "AM";
      h = h % 12 || 12;
      return `[${h}:${m} ${ampm}]`;
    };

    const addTimestamps = () => {
      const names = document.querySelectorAll('[class*="chatName"]');

      names.forEach(nameEl => {
        if (nameEl.dataset.timestampAdded) return;

        const time = document.createElement("span");
        time.textContent = " " + formatTime();
        time.style.opacity = "0.6";
        time.style.fontSize = "0.75em";
        time.style.marginLeft = "6px";

        // 🔥 insert AFTER the username
        nameEl.appendChild(time);

        nameEl.dataset.timestampAdded = "true";
      });
    };

    // initial run
    addTimestamps();

    // watch for new messages
    const observer = new MutationObserver(() => {
      addTimestamps();
    });

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
});
// ===== REPLY FIX (PLUGIN FORMAT) =====

const index_custom4 = () => createPlugin({
  name: "Reply Fix",
  description: "Fixes Blacket's broken replies.",
  authors: [
    {
      name: "Syfe",
      avatar: "https://i.imgur.com/OKpOipQ.gif",
      url: "https://github.com/ItsSyfe"
    }
  ],

  onLoad: () => {

    // 🧠 safe cleaner
    const cleanMessage = (text) => {
      return text
        .replace(/<\/?gradient[^>]*>/gi, "")
        .replace(/<\/?#.*?>/g, "");
    };

    const fixMessages = () => {
      const messages = document.querySelectorAll('[class*="chatMessage"]');

      messages.forEach(msg => {
        if (msg.dataset.replyFixed) return;

        // target message text node
        const textEl = msg.querySelector("span, div");
        if (!textEl) return;

        const original = textEl.innerHTML;
        const cleaned = cleanMessage(original);

        if (original !== cleaned) {
          textEl.innerHTML = cleaned;
        }

        msg.dataset.replyFixed = "true";
      });
    };

    // initial run
    fixMessages();

    // watch for new messages
    const observer = new MutationObserver(() => {
      fixMessages();
    });

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
});
const index_custom5 = () => createPlugin({
    name: 'SpeedUp',
    description: "Decreases Blacket's loading speed.",
    authors: [
        {
            name: 'zastix',
            avatar: 'https://avatars.githubusercontent.com/u/135683847?v=4',
            url: 'https://github.com/zastlx'
        }
    ],

    patches: [
        {
            file: '/lib/js/game.js',
            replacement: [
                {
                    // safer intercept
                    match: /blacket\.getMessages = async \(room, limit\) => \{/,
                    replace: `
                        blacket.getMessages = async (room, limit, real = false) => {
                            if (!real) return { error: false, messages: [] };
                    `,
                    setting: 'No Load Chat'
                },
                {
                    match: /blacket\.getMessages\(([^,]+), 250\)/,
                    replace: `blacket.getMessages($1, 250, true)`,
                    setting: 'No Load Chat'
                },
                {
                    // safer toggle hook
                    match: /blacket\.toggleChat = \(\) => \{/,
                    replace: `
                        blacket.toggleChat = () => {
                            if (!$self.initedChat) {
                                try {
                                    blacket.getMessages(blacket.chat.room, 125, true);
                                    $self.initedChat = true;
                                } catch (e) {}
                            }
                    `,
                    setting: 'No Load Chat'
                }
            ]
        },

        {
            file: '/lib/js/stats.js',
            replacement: [
                {
                    match: /Object\.keys\(blacket\.friends\.friends\)/,
                    replace: `[]`,
                    setting: 'No Friends'
                },
                {
                    match: /user\.clan == null/,
                    replace: `true`,
                    setting: 'No Clan On Stats'
                }
            ]
        },

        {
            file: '/lib/js/blooks.js',
            replacement: [
                {
                    match: /\$\{locked\.class\}"><img loading="lazy" src="\$\{blacket\.blooks\[blook\[1\]\]\.image\}"/,
                    replace: `
                        \${locked.class}">
                        <img loading="lazy" src="\${locked.class ? '/content/blooks/Default.webp' : blacket.blooks[blook[1]].image}"
                    `,
                    setting: 'Disable Unowned Blooks'
                }
            ]
        }
    ],

    settings: [
        { name: 'No Friends', default: false },
        { name: 'No Clan On Stats', default: true },
        { name: 'No Load Chat', default: true },
        { name: 'Disable Unowned Blooks', default: true }
    ],

    initedChat: false
});
const index_custom6 = () => createPlugin({
  name: "Load Remover",
  description: "Removes the annoying blacket is currently under maintence overlay.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    const removeModal = () => {
      const modal = document.getElementById("pingModal");
      if (modal) modal.remove();
    };

    // 🔁 fast loop (guarantees removal)
    const interval = setInterval(() => {
      removeModal();
    }, 200);

    // 👀 observer (catches instant inserts)
    const observer = new MutationObserver(() => {
      removeModal();
    });

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });

    // optional: stop interval after a while to reduce load
    setTimeout(() => {
      clearInterval(interval);
    }, 10000); // runs aggressively for 10s, then observer handles it
  }
});

const index_custom7 = () => createPlugin({
  name: "Sound Booster",
  description: "Makes the quiet Blacket sound effects louder so you can ACTUALLY hear them.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

onLoad: () => {

    const replaceSrc = (audio) => {
      if (!audio || !audio.src) return;

      if (audio.src.includes("/content/notification.ogg")) {
        audio.src = "https://f005.backblazeb2.com/file/blacket-v2-cdn/uploads/2769570/kvp48x5s1u/1786848729847-notification%20(mp3cut.net)%20(1).mp3";
        audio.load();
      }

      if (audio.src.includes("/content/mention.ogg")) {
        audio.src = "https://f005.backblazeb2.com/file/blacket-v2-cdn/uploads/2769570/yzmpeptxyyd/1786848768701-mention%20(mp3cut.net)%20(1).mp3";
        audio.load();
      }
    };

    // 🔁 scan existing
    const scan = () => {
      document.querySelectorAll("audio").forEach(audio => {
        if (audio.dataset.bbReplaced) return;
        replaceSrc(audio);
        audio.dataset.bbReplaced = "true";
      });
    };

    scan();

    // 👀 watch for new audio
    new MutationObserver(scan).observe(document.body, {
      childList: true,
      subtree: true
    });

    // 🔥 hook Audio constructor (best reliability)
    const OriginalAudio = window.Audio;

    window.Audio = function (...args) {
      if (args[0]) {
        if (args[0].includes("/content/notification.ogg")) {
          args[0] = "https://f005.backblazeb2.com/file/blacket-v2-cdn/uploads/2769570/kvp48x5s1u/1786848729847-notification%20(mp3cut.net)%20(1).mp3";
        }

        if (args[0].includes("/content/mention.ogg")) {
          args[0] = "https://f005.backblazeb2.com/file/blacket-v2-cdn/uploads/2769570/yzmpeptxyyd/1786848768701-mention%20(mp3cut.net)%20(1).mp3";
        }
      }

      return new OriginalAudio(...args);
    };

    window.Audio.prototype = OriginalAudio.prototype;

  }
});
const index_custom8 = () => createPlugin({
  name: "Legacy Features",
  description: "Replaces modern Blacket stuff with the old classic ones.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad() {


const style = document.createElement("style");
style.textContent = `.arts__modal___VpEAD-camelCase {
    display: block;
    position: fixed;
    z-index: 15;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.loaderModal {
    display: flex;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loader {
    transform: scale(200%);
}

.styles__inputContainer___t9pz0-camelCase {
    border: 0.104vw solid rgba(0, 0, 0, 0.17);
    border-radius: 0.313vw;
    width: 90%;
    height: 45;
}

.loaderBox {
    width: 1.823vw;
    height: 2.096vw;
    -webkit-animation: loading 2s linear infinite;
    animation: loading 2s linear infinite;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0.208vw;
    z-index: 3;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.loaderBlook {
    content: url("/content/blooks/Default.webp") !important;
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
    object-fit: contain;
    overflow-y: none;
    filter: drop-shadow(0.000vw 0.000vw 0.260vw #000000);
}

.loaderText {
    color: white;
    margin-bottom: 6.250vw;
    text-align: center;
    margin-right: 7.292vw;
}

.blookContainerLoader {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    outline: none;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

@-webkit-keyframes loading {
    4.25% {
        border-bottom-left-radius: 0.208vw;
        border-bottom-right-radius: 0.208vw;
    }

    6.25% {
        transform: translateY(0.469vw) rotate(22.5deg);
    }

    12.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(45deg);
        border-bottom-right-radius: 1.953vw;
    }

    18.75% {
        transform: translateY(0.469vw) rotate(67.5deg);
    }

    25% {
        transform: translateY(0) rotate(90deg);
    }

    29.25% {
        border-bottom-right-radius: 0.208vw;
        border-top-right-radius: 0.208vw;
    }

    31.25% {
        transform: translateY(0.469vw) rotate(112.5deg);
    }

    37.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(135deg);
        border-top-right-radius: 1.953vw;
    }

    43.75% {
        transform: translateY(0.469vw) rotate(157.5deg);
    }

    50% {
        transform: translateY(0) rotate(180deg);
    }

    54.25% {
        border-top-right-radius: 0.208vw;
        border-top-left-radius: 0.208vw;
    }

    56.25% {
        transform: translateY(0.469vw) rotate(202.5deg);
    }

    62.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(225deg);
        border-top-left-radius: 1.953vw;
    }

    68.75% {
        transform: translateY(0.469vw) rotate(247.5deg);
    }

    75% {
        border-top-left-radius: 0.208vw;
        transform: translateY(0) rotate(270deg);
    }

    79.25% {
        border-bottom-left-radius: 0.208vw;
    }

    81.25% {
        transform: translateY(0.469vw) rotate(292.5deg);
    }

    87.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(315deg);
        border-bottom-left-radius: 1.953vw;
    }

    93.75% {
        transform: translateY(0.469vw) rotate(337.5deg);
    }

    to {
        transform: translateY(0) rotate(1turn);
    }
}

@keyframes loading {
    4.25% {
        border-bottom-left-radius: 0.208vw;
        border-bottom-right-radius: 0.208vw;
    }

    6.25% {
        transform: translateY(0.469vw) rotate(22.5deg);
    }

    12.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(45deg);
        border-bottom-right-radius: 1.953vw;
    }

    18.75% {
        transform: translateY(0.469vw) rotate(67.5deg);
    }

    25% {
        transform: translateY(0) rotate(90deg);
    }

    29.25% {
        border-bottom-right-radius: 0.208vw;
        border-top-right-radius: 0.208vw;
    }

    31.25% {
        transform: translateY(0.469vw) rotate(112.5deg);
    }

    37.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(135deg);
        border-top-right-radius: 1.953vw;
    }

    43.75% {
        transform: translateY(0.469vw) rotate(157.5deg);
    }

    50% {
        transform: translateY(0) rotate(180deg);
    }

    54.25% {
        border-top-right-radius: 0.208vw;
        border-top-left-radius: 0.208vw;
    }

    56.25% {
        transform: translateY(0.469vw) rotate(202.5deg);
    }

    62.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(225deg);
        border-top-left-radius: 1.953vw;
    }

    68.75% {
        transform: translateY(0.469vw) rotate(247.5deg);
    }

    75% {
        border-top-left-radius: 0.208vw;
        transform: translateY(0) rotate(270deg);
    }

    79.25% {
        border-bottom-left-radius: 0.208vw;
    }

    81.25% {
        transform: translateY(0.469vw) rotate(292.5deg);
    }

    87.5% {
        transform: translateY(0.938vw) scaleY(0.9) rotate(315deg);
        border-bottom-left-radius: 1.953vw;
    }

    93.75% {
        transform: translateY(0.469vw) rotate(337.5deg);
    }

    to {
        transform: translateY(0) rotate(1turn);
    }
}

`;

function inject() {
    if (!style.isConnected) {
        (document.head || document.documentElement).appendChild(style);
    }
}

inject();

new MutationObserver(inject).observe(document.documentElement, {
    childList: true,
    subtree: true
});

    // =========================
    // HEADER BUTTONS
    // =========================

    const injectButtons = () => {

      const header = document.querySelector(
        ".styles__headerLeftButtons___3zGk0-camelCase"
      );

      if (!header) return;

      if (document.querySelector("#unlockBlooksButton")) return;

      header.insertAdjacentHTML("beforeend", `

        <a
          id="discordButton"
          class="styles__button___1_E-G-camelCase styles__headerButton___36TRh-camelCase"
          role="button"
          tabindex="0"
          href="https://discord.gg/blacket"
          target="_blank"
        >
          <div class="styles__shadow___3GMdH-camelCase"></div>

          <div
            class="styles__edge___3eWfq-camelCase"
            style="background-color:#2f2f2f;"
          ></div>

          <div
            class="styles__front___vcvuy-camelCase"
            style="background-color:#2f2f2f;"
          >
            <div class="styles__headerButtonInside___26e_U-camelCase">
              <i
                class="styles__headerButtonIcon___1pOun-camelCase fab fa-discord"
              ></i>
              Discord
            </div>
          </div>
        </a>

        <a
          id="unlockBlooksButton"
          class="styles__button___1_E-G-camelCase styles__headerButton___36TRh-camelCase"
          role="button"
          tabindex="0"
          href="/market"
        >
          <div class="styles__shadow___3GMdH-camelCase"></div>

          <div
            class="styles__edge___3eWfq-camelCase"
            style="background-color:#FFA31E;"
          ></div>

          <div
            class="styles__front___vcvuy-camelCase"
            style="background-color:#FFA31E;"
          >
            <div class="styles__headerButtonInside___26e_U-camelCase">
              <i
                class="styles__headerButtonIcon___1pOun-camelCase fas fa-store"
              ></i>
              Unlock Blooks
            </div>
          </div>
        </a>

        <a
          id="manageBlooksButton"
          class="styles__button___1_E-G-camelCase styles__headerButton___36TRh-camelCase"
          role="button"
          tabindex="0"
          href="/blooks"
        >
          <div class="styles__shadow___3GMdH-camelCase"></div>

          <div
            class="styles__edge___3eWfq-camelCase"
            style="background-color:#1E92FF;"
          ></div>

          <div
            class="styles__front___vcvuy-camelCase"
            style="background-color:#1E92FF;"
          >
            <div class="styles__headerButtonInside___26e_U-camelCase">
              <i
                class="styles__headerButtonIcon___1pOun-camelCase fas fa-suitcase"
              ></i>
              Manage Blooks
            </div>
          </div>
        </a>

      `);
    };

    this.headerInterval = setInterval(injectButtons, 500);

    // =========================
    // BACKGROUND
    // =========================

    try {
      const style = document.createElement("style");

      style.textContent = `
        .styles__blooksBackground___3oQ7Y-camelCase {
          background-image: url('https://blacket.org/content/background.webp') !important;
          background-repeat: repeat;
          background-size: auto;
        }
      `;

      document.head.appendChild(style);

    } catch (err) {
      console.error(err);
    }

    // =========================
    // BLOOK OVERRIDES
    // =========================
try {

  (() => {

    const overrides = {

  /*"/content/blooks/Ankha.webp":
    "https://blacket.org/content/ankha.webp",

  "Glowing Ankha":
    "https://blacket.org/content/blooks/Glowing%20Ankha.webp",

  "Mark Ankha":
    "https://blacket.org/content/blooks/Mark%20Ankha.webp",

  "High Ankha":
    "https://blacket.org/content/blooks/High%20Ankha.webp",

  "Zone Ankha":
    "https://blacket.org/content/blooks/Zone%20Ankha.webp",

  "Lovely zastix":
    "https://blacket.org/content/blooks/Lovely%20zastix.webp",

  "zastix":
    "https://blacket.org/content/blooks/zastix.webp",

  "Festive Ankha":
    "https://c00lestkiddever.nekoweb.org/Festive_Ankha.webp",

  "Naughty Ankha":
    "https://c00lestkiddever.nekoweb.org/Naughty_Ankha.webp",

  "Lovely Ankha":
    "https://c00lestkiddever.nekoweb.org/Lovely_Ankha.webp",

  "Ukraine Ankha":
    "https://c00lestkiddever.nekoweb.org/Ukraine_Ankha.webp",

  "Lucky Ankha":
    "https://c00lestkiddever.nekoweb.org/Lucky_Ankha.webp",

  "Spring Ankha":
    "https://c00lestkiddever.nekoweb.org/Spring_Ankha.webp",

  "American Ankha":
    "https://c00lestkiddever.nekoweb.org/American_Ankha.webp",

  "Vampire Ankha":
    "https://c00lestkiddever.nekoweb.org/Vampire_Ankha%20(1).webp",

  "Turkey Ankha":
    "https://c00lestkiddever.nekoweb.org/Turkey_Ankha.webp",

  "Lunar Ankha":
    "https://c00lestkiddever.nekoweb.org/Lunar_Ankha.webp",

  "Lovely Bot":
    "https://c00lestkiddever.nekoweb.org/lovelybot.webp",

  "Brainy Bot":
    "https://c00lestkiddever.nekoweb.org/brainybot.webp",

  "Buddy Bot":
    "https://c00lestkiddever.nekoweb.org/buddybot.webp",

  "Angry Bot":
    "https://c00lestkiddever.nekoweb.org/angrybot.webp",

  "Happy Bot":
    "https://c00lestkiddever.nekoweb.org/happybot.webp",

  "Mega Bot":
    "https://c00lestkiddever.nekoweb.org/megabot.webp",

  "Lil Bot":
    "https://c00lestkiddever.nekoweb.org/lilbot.webp",

  "Breakfast Combo":
    "https://c00lestkiddever.nekoweb.org/breakfastcombo.webp",

  "Orange Juice":
    "https://c00lestkiddever.nekoweb.org/orangejuice.webp",

  /*"Nature Elemental":
    "https://c00lestkiddever.nekoweb.org/natureelemental.webp",

  "Electric Elemental":
    "https://c00lestkiddever.nekoweb.org/electricelemental.webp",

  "Water Elemental":
    "https://c00lestkiddever.nekoweb.org/waterelemental.webp",

  "Space Elemental":
    "https://c00lestkiddever.nekoweb.org/spaceelemental.webp",

  "Plasma Elemental":
    "https://c00lestkiddever.nekoweb.org/plasmaelemental.webp",

  "Frost Elemental":
    "https://c00lestkiddever.nekoweb.org/frostelemental.webp",

  "Lava Elemental":
    "https://c00lestkiddever.nekoweb.org/lavaelemental.webp",

  "Fire Elemental":
    "https://c00lestkiddever.nekoweb.org/fireelemental.webp",

  "Air Elemental":
    "https://c00lestkiddever.nekoweb.org/airelementalold.webp",*/

  /*"yesbutterjeff":
    "https://blacket.org/content/blooks/yesbutterjeff.webp",

  "Minesraft2":
    "https://blacket.org/content/blooks/Minesraft2.webp",

  "GAMERYT":
    "https://blacket.org/content/blooks/GAMERYT.webp",
    /*"https://cbys10.github.io/ploopcdn/assets/images/ploops/og/gamer.png",*/

  /*"fristic":
    "https://blacket.org/content/blooks/fristic.webp",

  "Watson":
    "https://c00lestkiddever.nekoweb.org/watson.webp",

  "Ladybug":
    "https://c00lestkiddever.nekoweb.org/ladybug.webp",

  "Pancakes":
    "https://c00lestkiddever.nekoweb.org/pancakes.webp",

  "Cereal":
    "https://c00lestkiddever.nekoweb.org/cereal.webp",

  "Yogurt":
    "https://c00lestkiddever.nekoweb.org/yogurt.webp",

  "Waffle":
    "https://c00lestkiddever.nekoweb.org/waffle.webp",

  "Xotic":
    "https://c00lestkiddever.nekoweb.org/xotic.webp",

"Haunted Pumpkin":
  "https://c00lestkiddever.nekoweb.org/hauntedpumpkin.webp",

"Spooky Pumpkin":
  "https://c00lestkiddever.nekoweb.org/spookypumpkin.webp",

"Spooky Mummy":
  "https://c00lestkiddever.nekoweb.org/spookymummy.webp",

"Spooky Skeleton":
  "https://c00lestkiddever.nekoweb.org/spookyskeleton.webp",

"Creeper":
  "https://c00lestkiddever.nekoweb.org/creeper.webp",

"Cooked Turkey":
"https://c00lestkiddever.nekoweb.org/cookedturkey.webp",

"Hijacked Neural Implant":
"https://c00lestkiddever.nekoweb.org/hijackedneuralimplant.webp",

"Golden Among Us":
"https://c00lestkiddever.nekoweb.org/goldenamongus.webp",

"Space Debugger":
"https://c00lestkiddever.nekoweb.org/spacedebugger.gif",

"Space Terminal":
"https://c00lestkiddever.nekoweb.org/spaceterminal.webp",

"iBlooket":
"https://c00lestkiddever.nekoweb.org/iblooket.webp",*/
};

    const IGNORED_BLOOKS = [
      "Ankha's House",
      "Festive Xotic",
      "Butterfly",
      "Blue Butterfly",
      "Rhino Beetle",
      "Ankha Cerulean",
      "Flying Car",
    ];

    function normalize(text = "") {
      return text
        .toLowerCase()
        .replace(/%20/g, " ")
        .trim();
    }

function isIgnored(text = "") {

  const normalized = normalize(text);

  return IGNORED_BLOOKS.some(blook =>
    normalized.includes(normalize(blook))
  );

}
function patchBlookImage(oldUrl, newUrl) {

  const encoded = oldUrl.replace(/ /g, "%20");

  document.querySelectorAll("img").forEach(img => {

    if (
      img.src.includes(oldUrl) ||
      img.src.includes(encoded)
    ) {
      img.src = newUrl;
    }

  });

  document.querySelectorAll("*").forEach(el => {

    const bg =
      el.style.backgroundImage ||
      getComputedStyle(el).backgroundImage ||
      "";

    if (
      bg.includes(oldUrl) ||
      bg.includes(encoded)
    ) {

      el.style.setProperty(
        "background-image",
        `url("${newUrl}")`,
        "important"
      );

    }

  });

}
/*const imageOverrides = {
  "/content/blooks/French Toast.webp":
    "https://c00lestkiddever.nekoweb.org/frenchtoast.webp",

  "/content/blooks/Chocolate Milk.webp":
    "https://c00lestkiddever.nekoweb.org/chocomilk.webp",

  "/content/blooks/Toast.webp":
    "https://c00lestkiddever.nekoweb.org/toast.webp",

  "/content/blooks/Milk.webp":
    "https://c00lestkiddever.nekoweb.org/milk.webp",

"/content/blooks/Pumpkin.webp":
  "https://c00lestkiddever.nekoweb.org/pumpkin.webp",

"/content/blooks/Zombie.webp":
  "https://c00lestkiddever.nekoweb.org/zombie.webp",

"/content/blooks/Mummy.webp":
  "https://c00lestkiddever.nekoweb.org/mummy.webp",

"/content/blooks/Skeleton.webp":
  "https://c00lestkiddever.nekoweb.org/skeleton.webp",

"/content/blooks/Ghost.webp":
  "https://c00lestkiddever.nekoweb.org/ghost.webp",

/*"/content/packs/art/Elemental2.webp":
  "https://c00lestkiddever.nekoweb.org/elemental.webp",
"/content/blooks/Bee.webp":
  "https://c00lestkiddever.nekoweb.org/bee.webp",

"/content/blooks/Cerulean.webp":
"https://c00lestkiddever.nekoweb.org/cerulean.webp",

"https://blacket.org/content/tokenIcon.webp":
"https://c00lestkiddever.nekoweb.org/token.webp",

"https://blacket.org/content/blooks/Pumpkin%20Pie.webp":
"https://c00lestkiddever.nekoweb.org/pumpkinpie.webp",

"/content/rarities/common.png":
"/content/blooks/White%20Blook.webp",

"/content/rarities/uncommon.png":
"/content/blooks/Green%20Blook.webp",

"/content/rarities/rare.png":
"/content/blooks/Blue%20Blook.webp",

"/content/rarities/epic.png":
"/content/blooks/Red%20Blook.webp",

"/content/rarities/legendary.png":
"/content/blooks/Orange%20Blook.webp",

"/content/rarities/chroma.png":
"/content/blooks/Light%20Blue%20Blook.webp",

"/content/rarities/supreme.png":
"/content/blooks/Light%20Blue%20Blook.webp",

"/content/rarities/mythical.png":
"/content/blooks/Purple%20Blook.webp",

"/content/rarities/iridescent.png":
"/content/blooks/Rainbow%20Blook.webp",

"/content/rarities/unique.png":
"/content/blooks/Teal%20Blook.webp",

"/content/blooks/Fly.webp":
"https://c00lestkiddever.nekoweb.org/fly.webp",
};*/

      function patchBlookImages() {

  Object.entries(imageOverrides).forEach(
    ([oldUrl, newUrl]) => {
      patchBlookImage(oldUrl, newUrl);
    }
  );

}


      function patchPacks() {

  if (!window.blacket?.packs) return;

  Object.entries(blacket.packs).forEach(([name, pack]) => {

    const replacement = packOverrides[name];

    if (!replacement) return;

    pack.icon = replacement;
    pack.image = replacement;

    if (typeof pack.getArtUrl === "function") {
      pack.getArtUrl = () => replacement;
    }

  });

}

function getReplacement(text = "") {

  const normalized = normalize(text);

  if (isIgnored(normalized)) {
    return null;
  }

  // Longest names first
const entries = Object.entries(overrides)
  .sort(([a], [b]) => b.length - a.length);

  for (const [match, replacement] of entries) {

    const cleanMatch = normalize(match);

    if (normalized.includes(cleanMatch)) {
      return replacement;
    }

  }

  return null;
}
    function patchBlooks() {
      if (!window.blacket?.blooks) return;

      Object.entries(blacket.blooks).forEach(([name, blook]) => {
        if (IGNORED_BLOOKS.some(i => normalize(i) === normalize(name))) return;

        const replacement = overrides[name];
        if (!replacement) return;

        blook.icon = replacement;
        blook.image = replacement;

        if (typeof blook.getArtUrl === "function") {
          blook.getArtUrl = () => replacement;
        }
      });
    }

    function patchImages() {
      document.querySelectorAll("img").forEach(img => {
        const src = img.src || "";

        if (isIgnored(src)) return;

        const replacement = getReplacement(src);
        if (!replacement) return;

        if (img.src !== replacement) {
          img.src = replacement;
        }
      });
    }

function patchBlookDivs() {

  document.querySelectorAll("*").forEach(div => {

    if (
      typeof div.className !== "string" ||
      !div.className.toLowerCase().includes("blook")
    ) {
      return;
    }

    const bg =
      div.style.backgroundImage ||
      getComputedStyle(div).backgroundImage ||
      "";

    // Don't touch banners
    if (
      bg.includes("/content/banners/") ||
      bg.includes("/banners/")
    ) {
      return;
    }

    if (isIgnored(bg)) return;

    const replacement = getReplacement(bg);

    if (!replacement) return;

    div.style.setProperty(
      "background-image",
      `url("${replacement}")`,
      "important"
    );

  });

}

      const packOverrides = {
  /*"Elemental":
    "https://c00lestkiddever.nekoweb.org/elementalpack.webp",*/

  "Lovely (2025)":
    "https://c00lestkiddever.nekoweb.org/Lovely.webp",
};

function patchPacks() {

  if (!window.blacket?.packs) return;

  Object.entries(blacket.packs).forEach(([name, pack]) => {

    const replacement = packOverrides[name];

    if (!replacement) return;

    try {

      pack.icon = replacement;
      pack.image = replacement;

      if (typeof pack.getArtUrl === "function") {
        pack.getArtUrl = () => replacement;
      }

    } catch (err) {
      console.error(`Failed to patch pack "${name}"`, err);
    }

  });

}

      function patchPackImages() {

  document.querySelectorAll("img").forEach(img => {

    const src = img.src || "";

    Object.entries(packOverrides).forEach(([name, replacement]) => {

      if (
        src.toLowerCase().includes(name.toLowerCase())
      ) {
        img.src = replacement;
      }

    });

  });

}

function patchEverything() {
  patchBlooks();
  patchPacks();
  patchImages();
  patchBlookImages();
  patchBlookDivs();
}

    patchEverything();

    setInterval(patchEverything, 1000);

    new MutationObserver(() => {
      patchEverything();
    }).observe(document.body, {
      childList: true,
      subtree: true
    });

  })();

} catch (err) {
  console.error(err);
}


    // =========================
    // FONT REPLACER
    // =========================

    const TARGET_FONT = "Puffet";
    const REPLACEMENT_FONT = `"Titan One", sans-serif`;

    const titan = document.createElement("link");

    titan.rel = "stylesheet";
    titan.href =
      "https://fonts.googleapis.com/css2?family=Titan+One&display=swap";

    document.head.appendChild(titan);

    const replaceFonts = () => {

      document.querySelectorAll("*").forEach((el) => {

        try {

          const style = window.getComputedStyle(el);

          if (
            style.fontFamily &&
            style.fontFamily.includes(TARGET_FONT)
          ) {
            el.style.fontFamily = REPLACEMENT_FONT;
          }

        } catch {}

      });

      for (const sheet of document.styleSheets) {

        let rules;

        try {
          rules = sheet.cssRules;
        } catch {
          continue;
        }

        if (!rules) continue;

        for (const rule of rules) {

          if (!rule.style || !rule.style.fontFamily) continue;

          if (rule.style.fontFamily.includes("Puffet")) {

            rule.style.fontFamily =
              rule.style.fontFamily.replace(
                /Puffet/g,
                `"Titan One"`
              );
          }
        }
      }
    };

    setTimeout(replaceFonts, 100);

    this.fontObserver = new MutationObserver(() => {

      replaceFonts();
      injectButtons();

    });

    this.fontObserver.observe(document.body, {
      childList: true,
      subtree: true
    });

    // =========================
    // TEXT FIXER
    // =========================

    const fixText = (node) => {

      if (!node || node.nodeType !== 3) return;

      if (node.nodeValue?.includes("BLACKET")) {
        node.nodeValue =
          node.nodeValue.replace(/BLACKET/g, "Blacket");
      }

      if (node.nodeValue?.includes("Supreme")) {
        node.nodeValue =
          node.nodeValue.replace(/Supreme/g, "Chroma");
      }

      if (node.nodeValue?.includes("Mythical")) {
        node.nodeValue =
          node.nodeValue.replace(/Mythical/g, "Mystical");
      }
        /* if (node.nodeValue?.includes("Supreme")) {
        node.nodeValue =
          node.nodeValue.replace(/Supreme/g, "Perfect");
      }

      if (node.nodeValue?.includes("Mythical")) {
        node.nodeValue =
          node.nodeValue.replace(/Mythical/g, "Divine");
      }*/
    };

       

    const scan = (root) => {

      const walker = document.createTreeWalker(
        root,
        NodeFilter.SHOW_TEXT
      );

      let node;

      while ((node = walker.nextNode())) {
        fixText(node);
      }
    };

    scan(document.body);

    this.textObserver = new MutationObserver((mutations) => {

      for (const mutation of mutations) {

        mutation.addedNodes.forEach((node) => {

          if (node.nodeType === 1) scan(node);

          if (node.nodeType === 3) fixText(node);

        });
      }

    });

    this.textObserver.observe(document.body, {
      childList: true,
      subtree: true,
      characterData: true
    });

    // =========================
    // RARITIES
    // =========================

    const applyRarities = () => {

      if (!window.blacket?.rarities) return false;

      if (blacket.rarities.Epic) {
        blacket.rarities.Epic.color = "#be0000";
      }

      if (blacket.rarities.Supreme) {
        blacket.rarities.Supreme.color = "#00ccff";
      }

      if (blacket.rarities.Mythical) {
        blacket.rarities.Mythical.color = "#a335ee";
      }

        /*if (blacket.rarities.Supreme) {
        blacket.rarities.Supreme.color = "#fffacd";
      }

      if (blacket.rarities.Mythical) {
        blacket.rarities.Mythical.color = "#ee82ee";
      }*/

      return true;
    };

    if (!applyRarities()) {

      this.rarityInterval = setInterval(() => {

        if (applyRarities()) {
          clearInterval(this.rarityInterval);
        }

      }, 100);
    }

  },

  onUnload() {

    if (this.headerInterval) {
      clearInterval(this.headerInterval);
    }

    if (this.rarityInterval) {
      clearInterval(this.rarityInterval);
    }

    if (this.fontObserver) {
      this.fontObserver.disconnect();
    }

    if (this.textObserver) {
      this.textObserver.disconnect();
    }

  }
});
const index_custom9 = () => createPlugin({
  name: "Blacket Themer",
  description: "Theme Blacket so it's not boring and grey.",

  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {
(function() {
    'use strict';

   const amoledCSS = `
        .styles__blooketText___1pMBG-camelCase {
            font-size: 40px;
            font-family: Titan One, sans-serif;
            text-decoration: none;
            color: white;
            filter: drop-shadow(0px 0px 5px white);
            margin-bottom: 20px;
            text-align: center;
        }

        .styles__background___2J-JA-camelCase {
            background-color: #000 !important;
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #111111 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #222222 !important;
            transform: scale(1.05);
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: #000 !important;
        }

        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #000 !important;
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #000 !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__cardContainer___NGmjp-camelCase {
            background-color: #000 !important;
        }

        .styles__chatCurrentRoom___MCaV4-camelCase {
            background-color: #000 !important;
        }

        .styles__chatEmojiButton___8RFa2-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatEmojiButton___8RFa2-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsListContainer___Gk4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsTitle___fR4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRooms___o5ASb-camelCase {
            background-color: #000 !important;
        }

        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatUploadButton___g39Ac-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__container___1BPm9-camelCase {
            background-color: #000 !important;
        }

        .styles__container___2VzTy-camelCase {
            background-color: #000 !important;
        }

        .styles__container___3St5B-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeader___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderInside___2omQm-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__editHeaderContainer___2G1ji-camelCase {
            background-color: #000 !important;
        }

        .styles__edge___3eWfq-camelCase {
            background-color: #fff !important;
        }

        .styles__formsForm___MvA35-camelCase {
            background-color: #000 !important;
        }

        .styles__header___22Ne2-camelCase {
            background-color: #000 !important;
        }

        .styles__header___2O21B-camelCase {
            background-color: #000 !important;
        }

        .styles__headerBadgeBg___12ogR-camelCase {
            background-color: #000 !important;
        }

        .styles__headerSide___1r1-b-camelCase {
            background-color: #000 !important;
        }

        .styles__horizontalBlookGridLine___4SAvz-camelCase {
            background-color: #fff !important;
        }

        .styles__infoContainer___2uI-S-camelCase {
            background-color: #000 !important;
        }

        .styles__input___2XTSp-camelCase {
            background-color: #000 !important;
        }

        .styles__left___9beun-camelCase {
            background-color: #000 !important;
        }

        .styles__loginButton___1e3jI-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__myTokenAmount___ANKHA-camelCase {
            background-color: #000 !important;
        }

        .styles__otherTokenAmount___SEGGS-camelCase {
            background-color: #000 !important;
        }

        .styles__postsContainer___39_IQ-camelCase {
            background-color: #111111 !important;
        }

        .styles__profileContainer___CSuIE-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownMenu___2jUAA-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: #000 !important;
        }

        .styles__sidebar___1XqWi-camelCase {
            background-color: #000 !important;
        }

        .styles__signUpButton___3_ch3-camelCase {
            background-color: #000 !important;
            color: #fff !important;
        }

        .styles__statContainer___QKuOF-camelCase {
            background-color: #111111 !important;
        }

        .styles__statsContainer___QnrRB-camelCase {
            background-color: #000 !important;
        }

        .styles__toastContainer___o4pCa-camelCase {
            background-color: #000 !important;
        }

        .styles__tokenContainer___3yBv--camelCase {
            background-color: #000 !important;
        }

        .styles__tradingContainer___B1ABS-camelCase {
            background-color: #000 !important;
        }

        .styles__verticalBlookGridLine___rQWaZ-camelCase {
            background-color: #fff !important;
        }

        #searchInput {
            background-color: #111111 !important;
        }

        textarea {
            background-color: #000 !important;
        }

        .toastMessage {
            background-color: #000 !important;
        }

        input {
            background-color: #000 !important;
        }

        hr {
            background-color: #fff !important;
        }
    `;

    const redCSS = `
        :root {
            --red: #c41a1a;
            --red-hover: #a31313;
            --text-white: #ffffff;
            --button-red: #d62b2b;
        }
        .styles__blooketText___1pMBG-camelCase {
            color: var(--text-white);
            filter: drop-shadow(0px 0px 5px var(--text-white));
        }
        .styles__background___2J-JA-camelCase,
        .styles__bazaarItems___KmNa2-camelCase,
        .styles__blookGridContainer___AK47P-camelCase,
        .styles__cardContainer___NGmjp-camelCase,
        .styles__chatCurrentRoom___MCaV4-camelCase,
        .styles__chatInputContainer___gkR4A-camelCase,
        .styles__chatRoomsListContainer___Gk4Av-camelCase,
        .styles__chatRoomsTitle___fR4Av-camelCase,
        .styles__chatRooms___o5ASb-camelCase,
        .styles__container___1BPm9-camelCase,
        .styles__container___2VzTy-camelCase,
        .styles__container___3St5B-camelCase,
        .styles__containerHeader___3xghM-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase,
        .styles__editHeaderContainer___2G1ji-camelCase,
        .styles__formsForm___MvA35-camelCase,
        .styles__header___22Ne2-camelCase,
        .styles__header___2O21B-camelCase,
        .styles__headerBadgeBg___12ogR-camelCase,
        .styles__headerSide___1r1-b-camelCase,
        .styles__infoContainer___2uI-S-camelCase,
        .styles__input___2XTSp-camelCase,
        .styles__left___9beun-camelCase,
        .styles__myTokenAmount___ANKHA-camelCase,
        .styles__otherTokenAmount___SEGGS-camelCase,
        .styles__postsContainer___39_IQ-camelCase,
        .styles__profileContainer___CSuIE-camelCase,
        .styles__profileDropdownMenu___2jUAA-camelCase,
        .styles__sidebar___1XqWi-camelCase,
        .styles__signUpButton___3_ch3-camelCase,
        .styles__statContainer___QKuOF-camelCase,
        .styles__statsContainer___QnrRB-camelCase,
        .styles__toastContainer___o4pCa-camelCase,
        .styles__tokenContainer___3yBv--camelCase,
        .styles__tradingContainer___B1ABS-camelCase,
        textarea,
        input,
        .toastMessage {
            background-color: var(--red) !important;
            color: var(--text-white) !important;
        }
        .styles__bazaarItem___Meg69-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase,
        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: var(--red-hover) !important;
            transition: 0.2s ease-in-out;
        }
        .styles__bazaarItem___Meg69-camelCase:hover,
        .styles__chatEmojiButton___8RFa2-camelCase:hover,
        .styles__chatUploadButton___g39Ac-camelCase:hover,
        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #890f0f !important;
            transform: scale(1.05);
        }
        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: var(--button-red) !important;
            color: var(--text-white) !important;
        }
        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase,
        .styles__loginButton___1e3jI-camelCase {
            background-color: var(--text-white) !important;
            color: var(--red-hover) !important;
        }
        .styles__edge___3eWfq-camelCase,
        .styles__horizontalBlookGridLine___4SAvz-camelCase,
        .styles__verticalBlookGridLine___rQWaZ-camelCase,
        hr {
            background-color: var(--text-white) !important;
        }
        .styles__rightButtonInside___14imT-camelCase {
            color: var(--text-white) !important;
        }
        #searchInput {
            background-color: var(--button-red) !important;
        }
    `;
        const DarkRedCSS = `
        :root {
 .styles__blooketText___1pMBG-camelCase {
            font-size: 40px;
            font-family: Titan One, sans-serif;
            text-decoration: none;
            color: white;
            filter: drop-shadow(0px 0px 5px white);
            margin-bottom: 20px;
            text-align: center;
        }

        .styles__background___2J-JA-camelCase {
            background-color: #240404 !important;
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #43090D !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #43090D !important;
            transform: scale(1.05);
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: #5C0101 !important;
        }

        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #1F0406 !important;
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #9F141F !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase {
            background-color: #5C0101 !important;
            color: #9F141F !important;
        }

        .styles__cardContainer___NGmjp-camelCase {
            background-color: #9F141F !important;
        }

        .styles__chatCurrentRoom___MCaV4-camelCase {
            background-color: #5A0515 !important;
        }

        .styles__chatEmojiButton___8RFa2-camelCase {
            background-color: #BD1825 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatEmojiButton___8RFa2-camelCase:hover {
            background-color: #BDA01E !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            background-color: #000000 !important;
        }

        .styles__chatRoomsListContainer___Gk4Av-camelCase {
            background-color: #330707 !important;
        }

        .styles__chatRoomsTitle___fR4Av-camelCase {
            background-color: #330707 !important;
        }

        .styles__chatRooms___o5ASb-camelCase {
            background-color: #5C0008 !important;
        }

        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: #B3000F !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatUploadButton___g39Ac-camelCase:hover {
            background-color: #2C37B3 !important;
        }

        .styles__container___1BPm9-camelCase {
            background-color: #B3000F !important;
        }

        .styles__container___2VzTy-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__container___3St5B-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__containerHeader___3xghM-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__containerHeaderInside___2omQm-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__editHeaderContainer___2G1ji-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__edge___3eWfq-camelCase {
            background-color: #5C0101 !important;
        }

        .styles__formsForm___MvA35-camelCase {
            background-color: #5F0000) !important;
        }

        .styles__header___22Ne2-camelCase {
            background-color: #5F0000 !important;
        }

        .styles__header___2O21B-camelCase {
            background-color: #F50C0C !important;
        }

        .styles__headerBadgeBg___12ogR-camelCase {
            background-color: #F50C0C !important;
        }

        .styles__headerSide___1r1-b-camelCase {
            background-color: #F50C0C !important;
        }

        .styles__horizontalBlookGridLine___4SAvz-camelCase {
            background-color: #5C0101 !important;
        }

        .styles__infoContainer___2uI-S-camelCase {
            background-color: #430303 !important;
        }

        .styles__input___2XTSp-camelCase {
            background-color: #430303 !important;
        }

        .styles__left___9beun-camelCase {
            background-color: #430303 !important;
        }

        .styles__loginButton___1e3jI-camelCase {
            background-color: #fff !important;
            color: #430303 !important;
        }

        .styles__myTokenAmount___ANKHA-camelCase {
            background-color: #430303 !important;
        }

        .styles__otherTokenAmount___SEGGS-camelCase {
            background-color: #430303 !important;
        }

        .styles__postsContainer___39_IQ-camelCase {
            background-color: #5C0101 !important;
        }

        .styles__profileContainer___CSuIE-camelCase {
            background-color: #430303 !important;
        }

        .styles__profileDropdownMenu___2jUAA-camelCase {
            background-color: #430303 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #920707 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: #920707 !important;
        }

        .styles__sidebar___1XqWi-camelCase {
            background-color: #3E0303 !important;
        }

        .styles__signUpButton___3_ch3-camelCase {
            background-color: #3E0303 !important;
            color: #5C0101 !important;
        }

        .styles__statContainer___QKuOF-camelCase {
            background-color: #111111 !important;
        }

        .styles__statsContainer___QnrRB-camelCase {
            background-color: #3E0303 !important;
        }

        .styles__toastContainer___o4pCa-camelCase {
            background-color: #3E0303 !important;
        }

        .styles__tokenContainer___3yBv--camelCase {
            background-color: #3E0303 !important;
        }

        .styles__tradingContainer___B1ABS-camelCase {
            background-color: #3E0303 !important;
        }

        .styles__verticalBlookGridLine___rQWaZ-camelCase {
            background-color: #5C0101 !important;
        }

        #searchInput {
            background-color: #5C0101 !important;
        }

        textarea {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        .toastMessage {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        input {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        hr {
            background-color: #5C0101 !important;
        }
    `;
    const orangeCSS = `
 :root {
            --orange: #c46a1a;
            --orange-hover: #a35213;
            --text-white: #ffffff;
            --button-orange: #d67f2b;
        }

        .styles__blooketText___1pMBG-camelCase {
            color: var(--text-white);
            filter: drop-shadow(0px 0px 5px var(--text-white));
        }

        .styles__background___2J-JA-camelCase,
        .styles__bazaarItems___KmNa2-camelCase,
        .styles__blookGridContainer___AK47P-camelCase,
        .styles__cardContainer___NGmjp-camelCase,
        .styles__chatCurrentRoom___MCaV4-camelCase,
        .styles__chatInputContainer___gkR4A-camelCase,
        .styles__chatRoomsListContainer___Gk4Av-camelCase,
        .styles__chatRoomsTitle___fR4Av-camelCase,
        .styles__chatRooms___o5ASb-camelCase,
        .styles__container___1BPm9-camelCase,
        .styles__container___2VzTy-camelCase,
        .styles__container___3St5B-camelCase,
        .styles__containerHeader___3xghM-camelCase,
        .styles__containerHeaderInside___2omQm-camelCase,
        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase,
        .styles__editHeaderContainer___2G1ji-camelCase,
        .styles__formsForm___MvA35-camelCase,
        .styles__header___22Ne2-camelCase,
        .styles__header___2O21B-camelCase,
        .styles__headerBadgeBg___12ogR-camelCase,
        .styles__headerSide___1r1-b-camelCase,
        .styles__infoContainer___2uI-S-camelCase,
        .styles__input___2XTSp-camelCase,
        .styles__left___9beun-camelCase,
        .styles__myTokenAmount___ANKHA-camelCase,
        .styles__otherTokenAmount___SEGGS-camelCase,
        .styles__postsContainer___39_IQ-camelCase,
        .styles__profileContainer___CSuIE-camelCase,
        .styles__profileDropdownMenu___2jUAA-camelCase,
        .styles__profileDropdownOption___ljZXD-camelCase,
        .styles__sidebar___1XqWi-camelCase,
        .styles__signUpButton___3_ch3-camelCase,
        .styles__statContainer___QKuOF-camelCase,
        .styles__statsContainer___QnrRB-camelCase,
        .styles__toastContainer___o4pCa-camelCase,
        .styles__tokenContainer___3yBv--camelCase,
        .styles__tradingContainer___B1ABS-camelCase,
        textarea,
        input,
        .toastMessage {
            background-color: var(--orange) !important;
            color: var(--text-white) !important;
        }

        .styles__bazaarItem___Meg69-camelCase,
        .styles__chatEmojiButton___8RFa2-camelCase,
        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: var(--orange-hover) !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover,
        .styles__chatEmojiButton___8RFa2-camelCase:hover,
        .styles__chatUploadButton___g39Ac-camelCase:hover,
        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #8f3f07 !important;
            transform: scale(1.05);
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: var(--button-orange) !important;
            color: var(--text-white) !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase,
        .styles__loginButton___1e3jI-camelCase {
            background-color: var(--text-white) !important;
            color: var(--orange-hover) !important;
        }

        .styles__edge___3eWfq-camelCase,
        .styles__horizontalBlookGridLine___4SAvz-camelCase,
        .styles__verticalBlookGridLine___rQWaZ-camelCase,
        hr {
            background-color: var(--text-white) !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: var(--text-white) !important;
        }

        #searchInput {
            background-color: var(--button-orange) !important;
        }
    `;
const DarkOrangeCSS = `
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

.styles__background___2J-JA-camelCase {
    background-color: #4a2a00 !important; /* brighter dark orange */
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #935600 !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #935600 !important;
    transform: scale(1.05);
}

.styles__bazaarItems___KmNa2-camelCase {
    background-color: #6e4000 !important;
}

.styles__blookGridContainer___AK47P-camelCase {
    background-color: #4a2a00 !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: #f07e00 !important; /* brighter medium dark orange */
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase {
    background-color: #6e4000 !important;
    color: #f07e00 !important;
}

.styles__cardContainer___NGmjp-camelCase {
    background-color: #f07e00 !important;
}

.styles__chatCurrentRoom___MCaV4-camelCase {
    background-color: #7c5200 !important;
}

.styles__chatEmojiButton___8RFa2-camelCase {
    background-color: #e08f17 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover {
    background-color: #d1b845 !important;
}

.styles__chatInputContainer___gkR4A-camelCase {
    background-color: #000000 !important;
}

.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase {
    background-color: #6e4000 !important;
}

.styles__chatRooms___o5ASb-camelCase {
    background-color: #704100 !important;
}

.styles__chatUploadButton___g39Ac-camelCase {
    background-color: #bd7200 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatUploadButton___g39Ac-camelCase:hover {
    background-color: #bd9034 !important;
}

.styles__container___1BPm9-camelCase {
    background-color: #bd7200 !important;
}

.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase {
    background-color: #724300 !important;
}

.styles__edge___3eWfq-camelCase {
    background-color: #6e4000 !important;
}

.styles__formsForm___MvA35-camelCase {
    background-color: #724300 !important;
}

.styles__header___22Ne2-camelCase {
    background-color: #724300 !important;
}

.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase {
    background-color: #ffa31a !important; /* bright orange */
}

.styles__horizontalBlookGridLine___4SAvz-camelCase {
    background-color: #6e4000 !important;
}

.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase {
    background-color: #5f3d00 !important;
}

.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #5f3d00 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase {
    background-color: #be7c15 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #111111 !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #be7c15 !important;
}

.styles__sidebar___1XqWi-camelCase {
    background-color: #6e4000 !important;
}

.styles__signUpButton___3_ch3-camelCase {
    background-color: #6e4000 !important;
    color: #6e4000 !important;
}

.styles__statContainer___QKuOF-camelCase {
    background-color: #111111 !important;
}

.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase {
    background-color: #6e4000 !important;
}

.styles__verticalBlookGridLine___rQWaZ-camelCase {
    background-color: #6e4000 !important;
}

#searchInput {
    background-color: #6e4000 !important;
}

textarea,
.toastMessage,
input {
    background: linear-gradient(135deg, #f29c3f, #000000) !important;
}

hr {
    background-color: #6e4000 !important;
}
`;


    const yellowCSS = `
    :root {
        --deep-yellow: #d4c60f;
        --deep-yellow-hover: #b1a309;
        --text-white: #ffffff;
        --button-yellow: #e2d414;
    }

    .styles__blooketText___1pMBG-camelCase {
        color: var(--text-white);
        filter: drop-shadow(0px 0px 5px var(--text-white));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--deep-yellow) !important;
        color: var(--text-white) !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--deep-yellow-hover) !important;
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: #a99708 !important;
        transform: scale(1.05);
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-yellow) !important;
        color: var(--text-white) !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-white) !important;
        color: var(--deep-yellow-hover) !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-white) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-white) !important;
    }

    #searchInput {
        background-color: var(--button-yellow) !important;
    }
`;
const DarkYellowCSS = `
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

.styles__background___2J-JA-camelCase {
    background-color: #6e6800 !important; /* brighter dark yellow */
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #a29f00 !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #a29f00 !important;
    transform: scale(1.05);
}

.styles__bazaarItems___KmNa2-camelCase {
    background-color: #7c7700 !important;
}

.styles__blookGridContainer___AK47P-camelCase {
    background-color: #6e6800 !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: #fff700 !important; /* bright dark yellow */
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase {
    background-color: #7c7700 !important;
    color: #fff700 !important;
}

.styles__cardContainer___NGmjp-camelCase {
    background-color: #fff700 !important;
}

.styles__chatCurrentRoom___MCaV4-camelCase {
    background-color: #8a8500 !important;
}

.styles__chatEmojiButton___8RFa2-camelCase {
    background-color: #f5f523 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover {
    background-color: #f9f95a !important;
}

.styles__chatInputContainer___gkR4A-camelCase {
    background-color: #000000 !important;
}

.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase {
    background-color: #7c7700 !important;
}

.styles__chatRooms___o5ASb-camelCase {
    background-color: #827f00 !important;
}

.styles__chatUploadButton___g39Ac-camelCase {
    background-color: #e9e900 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatUploadButton___g39Ac-camelCase:hover {
    background-color: #f9f959 !important;
}

.styles__container___1BPm9-camelCase {
    background-color: #e9e900 !important;
}

.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase {
    background-color: #7c7700 !important;
}

.styles__edge___3eWfq-camelCase {
    background-color: #7c7700 !important;
}

.styles__formsForm___MvA35-camelCase {
    background-color: #7c7700 !important;
}

.styles__header___22Ne2-camelCase {
    background-color: #7c7700 !important;
}

.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase {
    background-color: #ffff33 !important; /* bright yellow */
}

.styles__horizontalBlookGridLine___4SAvz-camelCase {
    background-color: #7c7700 !important;
}

.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase {
    background-color: #767000 !important;
}

.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #767000 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase {
    background-color: #d1cf14 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #111111 !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #d1cf14 !important;
}

.styles__sidebar___1XqWi-camelCase {
    background-color: #7c7700 !important;
}

.styles__signUpButton___3_ch3-camelCase {
    background-color: #7c7700 !important;
    color: #7c7700 !important;
}

.styles__statContainer___QKuOF-camelCase {
    background-color: #111111 !important;
}

.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase {
    background-color: #7c7700 !important;
}

.styles__verticalBlookGridLine___rQWaZ-camelCase {
    background-color: #7c7700 !important;
}

#searchInput {
    background-color: #7c7700 !important;
}

textarea,
.toastMessage,
input {
    background: linear-gradient(135deg, #f9f940, #000000) !important;
}

hr {
    background-color: #7c7700 !important;
}
`;


    const greenCSS = `
    :root {
        --deep-green: #0a8a0a;
        --deep-green-hover: #076f07;
        --text-white: #ffffff;
        --button-green: #12a012;
    }

    .styles__blooketText___1pMBG-camelCase {
        color: var(--text-white);
        filter: drop-shadow(0px 0px 5px var(--text-white));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__profileDropdownOption___ljZXD-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--deep-green) !important;
        color: var(--text-white) !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--deep-green-hover) !important;
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: #065906 !important;
        transform: scale(1.05);
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-green) !important;
        color: var(--text-white) !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-white) !important;
        color: var(--deep-green-hover) !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-white) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-white) !important;
    }

    #searchInput {
        background-color: var(--button-green) !important;
    }
`;
const DarkGreenCSS = `
:root {
    .styles__blooketText___1pMBG-camelCase {
        font-size: 40px;
        font-family: Titan One, sans-serif;
        text-decoration: none;
        color: white;
        filter: drop-shadow(0px 0px 5px white);
        margin-bottom: 20px;
        text-align: center;
    }

    .styles__background___2J-JA-camelCase {
        background-color: #042404 !important; /* very dark green */
    }

    .styles__bazaarItem___Meg69-camelCase {
        background-color: #094309 !important; /* dark green */
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover {
        background-color: #094309 !important;
        transform: scale(1.05);
    }

    .styles__bazaarItems___KmNa2-camelCase {
        background-color: #015c01 !important;
    }

    .styles__blookGridContainer___AK47P-camelCase {
        background-color: #041f04 !important;
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: #149f14 !important; /* medium green */
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase {
        background-color: #015c01 !important;
        color: #149f14 !important;
    }

    .styles__cardContainer___NGmjp-camelCase {
        background-color: #149f14 !important;
    }

    .styles__chatCurrentRoom___MCaV4-camelCase {
        background-color: #155a05 !important;
    }

    .styles__chatEmojiButton___8RFa2-camelCase {
        background-color: #18bd18 !important;
        transition: 0.2s ease-in-out;
    }

    .styles__chatEmojiButton___8RFa2-camelCase:hover {
        background-color: #a0bd18 !important;
    }

    .styles__chatInputContainer___gkR4A-camelCase {
        background-color: #000000 !important;
    }

    .styles__chatRoomsListContainer___Gk4Av-camelCase {
        background-color: #073307 !important;
    }

    .styles__chatRoomsTitle___fR4Av-camelCase {
        background-color: #073307 !important;
    }

    .styles__chatRooms___o5ASb-camelCase {
        background-color: #005c00 !important;
    }

    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: #00b300 !important;
        transition: 0.2s ease-in-out;
    }

    .styles__chatUploadButton___g39Ac-camelCase:hover {
        background-color: #2c37b3 !important; /* kept original blue hover for contrast */
    }

    .styles__container___1BPm9-camelCase {
        background-color: #00b300 !important;
    }

    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase {
        background-color: #005f00 !important;
    }

    .styles__edge___3eWfq-camelCase {
        background-color: #015c01 !important;
    }

    .styles__formsForm___MvA35-camelCase {
        background-color: #005f00 !important;
    }

    .styles__header___22Ne2-camelCase {
        background-color: #005f00 !important;
    }

    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase {
        background-color: #0cf50c !important; /* bright green */
    }

    .styles__horizontalBlookGridLine___4SAvz-camelCase {
        background-color: #015c01 !important;
    }

    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase {
        background-color: #034303 !important;
    }

    .styles__loginButton___1e3jI-camelCase {
        background-color: #fff !important;
        color: #034303 !important;
    }

    .styles__profileDropdownOption___ljZXD-camelCase {
        background-color: #079207 !important;
    }

    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: #111111 !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: #079207 !important;
    }

    .styles__sidebar___1XqWi-camelCase {
        background-color: #033e03 !important;
    }

    .styles__signUpButton___3_ch3-camelCase {
        background-color: #033e03 !important;
        color: #015c01 !important;
    }

    .styles__statContainer___QKuOF-camelCase {
        background-color: #111111 !important;
    }

    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase {
        background-color: #033e03 !important;
    }

    .styles__verticalBlookGridLine___rQWaZ-camelCase {
        background-color: #015c01 !important;
    }

    #searchInput {
        background-color: #015c01 !important;
    }

    textarea,
    .toastMessage,
    input {
        background: linear-gradient(135deg, #138d13, #000000) !important;
    }

    hr {
        background-color: #015c01 !important;
    }
}
`;

const TrianguletGreenCSS = `
.styles__background___2J-JA-camelCase {
    background-color: #53b721 !important;
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #265b09 !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #2a630c !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px #53b721;
}

.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: #265b09 !important;
    color: #ffffff !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase {
    background-color: #0e8719 !important;
    color: #ffffff !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover {
    background-color: #53b721 !important;
    box-shadow: 0 0 12px #53b721;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: #53b721 !important;
    color: #ffffff !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: #0f2404 !important;
}

.styles__postsContainer___39_IQ-camelCase,
.styles__statContainer___QKuOF-camelCase,
#searchInput {
    background-color: #183a06 !important;
    color: #ffffff !important;
}

.styles__input___2XTSp-camelCase {
    background-color: #1a340c !important;
    color: #ffffff !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #53b721 !important;
}

* {
    scrollbar-color: #53b721 #0f2404 !important;
}
`;



    const blueCSS = `
:root {
    --deep-blue: #1a28c4;
    --deep-blue-hover: #131fa3;
    --text-white: #ffffff;
    --button-blue: #2b39d6;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--deep-blue) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--deep-blue-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #101890 !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-blue) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--deep-blue-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-blue) !important;
}
`;
    const DarkBlueCSS = `
:root {
.styles__blooketText___1pMBG-camelCase {
            font-size: 40px;
            font-family: Titan One, sans-serif;
            text-decoration: none;
            color: white;
            filter: drop-shadow(0px 0px 5px white);
            margin-bottom: 20px;
            text-align: center;
        }

        .styles__background___2J-JA-camelCase {
            background-color: #020524 !important;
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #020943 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #050C43 !important;
            transform: scale(1.05);
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: #050A5C !important;
        }

        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #02041F !important;
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #0B129F !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase {
            background-color: #06105C !important;
            color: #0C0F9F !important;
        }

        .styles__cardContainer___NGmjp-camelCase {
            background-color: #0C0F9F !important;
        }

        .styles__chatCurrentRoom___MCaV4-camelCase {
            background-color: #040B5A !important;
        }

        .styles__chatEmojiButton___8RFa2-camelCase {
            background-color: #0B14BD !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatEmojiButton___8RFa2-camelCase:hover {
            background-color: #BDA01E !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            background-color: #030727 !important;
        }

        .styles__chatRoomsListContainer___Gk4Av-camelCase {
            background-color: #050833 !important;
        }

        .styles__chatRoomsTitle___fR4Av-camelCase {
            background-color: #050833 !important;
        }

        .styles__chatRooms___o5ASb-camelCase {
            background-color: #050F5C !important;
        }

        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: #0C1AB3 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatUploadButton___g39Ac-camelCase:hover {
            background-color: #B30707 !important;
        }

        .styles__container___1BPm9-camelCase {
            background-color: #0104B3 !important;
        }

        .styles__container___2VzTy-camelCase {
            background-color: #00015F !important;
        }

        .styles__container___3St5B-camelCase {
            background-color: #00015F !important;
        }

        .styles__containerHeader___3xghM-camelCase {
            background-color: #00015F !important;
        }

        .styles__containerHeaderInside___2omQm-camelCase {
            background-color: #00015F !important;
        }

        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase {
            background-color: #00015F !important;
        }

        .styles__editHeaderContainer___2G1ji-camelCase {
            background-color: #00015F !important;
        }

        .styles__edge___3eWfq-camelCase {
            background-color: #04065C !important;
        }

        .styles__formsForm___MvA35-camelCase {
            background-color: #00015F) !important;
        }

        .styles__header___22Ne2-camelCase {
            background-color: #00015F !important;
        }

        .styles__header___2O21B-camelCase {
            background-color: #2C11F5 !important;
        }

        .styles__headerBadgeBg___12ogR-camelCase {
            background-color: #2C11F5 !important;
        }

        .styles__headerSide___1r1-b-camelCase {
            background-color: #2C11F5 !important;
        }

        .styles__horizontalBlookGridLine___4SAvz-camelCase {
            background-color: #060A5C !important;
        }

        .styles__infoContainer___2uI-S-camelCase {
            background-color: #080343 !important;
        }

        .styles__input___2XTSp-camelCase {
            background-color: #020543 !important;
        }

        .styles__left___9beun-camelCase {
            background-color: #020543 !important;
        }

        .styles__loginButton___1e3jI-camelCase {
            background-color: #fff !important;
            color: #020543 !important;
        }

        .styles__myTokenAmount___ANKHA-camelCase {
            background-color: #020543 !important;
        }

        .styles__otherTokenAmount___SEGGS-camelCase {
            background-color: #020543 !important;
        }

        .styles__postsContainer___39_IQ-camelCase {
            background-color: #1A005C !important;
        }

        .styles__profileContainer___CSuIE-camelCase {
            background-color: #020543 !important;
        }

        .styles__profileDropdownMenu___2jUAA-camelCase {
            background-color: #020543 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #040B92 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: #001692 !important;
        }

        .styles__sidebar___1XqWi-camelCase {
            background-color: #04053E !important;
        }

        .styles__signUpButton___3_ch3-camelCase {
            background-color: #04053E !important;
            color: #04095C !important;
        }

        .styles__statContainer___QKuOF-camelCase {
            background-color: #111111 !important;
        }

        .styles__statsContainer___QnrRB-camelCase {
            background-color: #04053E !important;
        }

        .styles__toastContainer___o4pCa-camelCase {
            background-color: #04053E !important;
        }

        .styles__tokenContainer___3yBv--camelCase {
            background-color: #04053E !important;
        }

        .styles__tradingContainer___B1ABS-camelCase {
            background-color: #04053E !important;
        }

        .styles__verticalBlookGridLine___rQWaZ-camelCase {
            background-color: #04085C !important;
        }

        #searchInput {
            background-color: #04085C1 !important;
        }

        textarea {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        .toastMessage {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        input {
            background-color: setGradient(#8D1329, #000000) !important;
        }

        hr {
            background-color: #10055C !important;
        }
    `;


const BluletBlueCSS = `
.styles__background___2J-JA-camelCase {
    background-color: #000d70 !important;
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #000050 !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #000070 !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px #0000ff;
}

.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: #000050 !important;
    color: #fff !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase {
    background-color: #000070 !important;
    color: #fff !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover {
    background-color: #000080 !important;
    box-shadow: 0 0 12px #009bff;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #000050 !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: #009bff !important;
}

.styles__postsContainer___39_IQ-camelCase,
.styles__statContainer___QKuOF-camelCase,
#searchInput {
    background-color: #000070 !important;
    color: #fff !important;
}

.styles__input___2XTSp-camelCase {
    background-color: #000060 !important;
    color: #fff !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #009bff !important;
}

* {
    scrollbar-color: #009bff #000020 !important;
}
`

    const purpleCSS = `
:root {
    --deep-purple: #6a1b9a;
    --deep-purple-hover: #4b1373;
    --text-white: #ffffff;
    --button-purple: #7e22ce;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--deep-purple) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--deep-purple-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #3d0d5c !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-purple) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--deep-purple-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-purple) !important;
}
`;
    const DarkPurpleCSS = `
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

.styles__background___2J-JA-camelCase {
    background-color: #1a001a !important; /* very dark purple */
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #330033 !important; /* dark purple */
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #330033 !important;
    transform: scale(1.05);
}

.styles__bazaarItems___KmNa2-camelCase {
    background-color: #100050 !important;
}

.styles__blookGridContainer___AK47P-camelCase {
    background-color: #1a001a !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: #4b007a !important; /* medium dark purple */
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase {
    background-color: #100050 !important;
    color: #4b007a !important;
}

.styles__cardContainer___NGmjp-camelCase {
    background-color: #4b007a !important;
}

.styles__chatCurrentRoom___MCaV4-camelCase {
    background-color: #3f004d !important;
}

.styles__chatEmojiButton___8RFa2-camelCase {
    background-color: #5a0080 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover {
    background-color: #8a76a8 !important;
}

.styles__chatInputContainer___gkR4A-camelCase {
    background-color: #000000 !important;
}

.styles__chatRoomsListContainer___Gk4Av-camelCase {
    background-color: #220022 !important;
}

.styles__chatRoomsTitle___fR4Av-camelCase {
    background-color: #220022 !important;
}

.styles__chatRooms___o5ASb-camelCase {
    background-color: #1a005c !important;
}

.styles__chatUploadButton___g39Ac-camelCase {
    background-color: #30007a !important;
    transition: 0.2s ease-in-out;
}

.styles__chatUploadButton___g39Ac-camelCase:hover {
    background-color: #4b309a !important;
}

.styles__container___1BPm9-camelCase {
    background-color: #30007a !important;
}

.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase {
    background-color: #1a005f !important;
}

.styles__edge___3eWfq-camelCase {
    background-color: #100050 !important;
}

.styles__formsForm___MvA35-camelCase {
    background-color: #1a005f !important;
}

.styles__header___22Ne2-camelCase {
    background-color: #1a005f !important;
}

.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase {
    background-color: #5200a8 !important; /* bright dark purple */
}

.styles__horizontalBlookGridLine___4SAvz-camelCase {
    background-color: #100050 !important;
}

.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase {
    background-color: #2a002a !important;
}

.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #2a002a !important;
}

.styles__profileDropdownOption___ljZXD-camelCase {
    background-color: #3d0073 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #111111 !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #3d0073 !important;
}

.styles__sidebar___1XqWi-camelCase {
    background-color: #220022 !important;
}

.styles__signUpButton___3_ch3-camelCase {
    background-color: #220022 !important;
    color: #100050 !important;
}

.styles__statContainer___QKuOF-camelCase {
    background-color: #111111 !important;
}

.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase {
    background-color: #220022 !important;
}

.styles__verticalBlookGridLine___rQWaZ-camelCase {
    background-color: #100050 !important;
}

#searchInput {
    background-color: #100050 !important;
}

textarea,
.toastMessage,
input {
    background: linear-gradient(135deg, #3b007f, #000000) !important;
}

hr {
    background-color: #100050 !important;
}
`;



const PurpetPurpleCSS = `
 :root {
    --colors-primary: #3c005d;
    --colors-primary-hover: #2a0043;
    --colors-secondary: #590080;
    --colors-tertiary: #9070a3;
    --colors-background: #4a006e;

    --text-light: #ffffff;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-light) !important;
    filter: drop-shadow(0px 0px 5px var(--text-light));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--colors-primary) !important;
    color: var(--text-light) !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
button,
.btn {
    background-color: var(--colors-secondary) !important;
    color: var(--text-light) !important;
}

.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover,
button:hover,
.btn:hover {
    background-color: var(--colors-primary-hover) !important;
    transform: scale(1.03);
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-light) !important;
    color: var(--colors-secondary) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--colors-secondary) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: var(--colors-primary-hover) !important;
    transform: scale(1.05);
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-light) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-light) !important;
}

#searchInput {
    background-color: var(--colors-tertiary) !important;
    color: var(--text-light) !important;
}
`;

const TrianguletPurpleCSS = `
.styles__background___2J-JA-camelCase {
    background-color: #8521B7 !important;
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #4d136b !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #7b1ea9 !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px #a436db;
}

.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: #4d136b !important;
    color: #fff !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase {
    background-color: #7b1ea9 !important;
    color: #fff !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover {
    background-color: #a436db !important;
    box-shadow: 0 0 12px #b55ce2;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #4d136b !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: #b55ce2 !important;
}

.styles__postsContainer___39_IQ-camelCase,
.styles__statContainer___QKuOF-camelCase,
#searchInput {
    background-color: #7b1ea9 !important;
    color: #fff !important;
}

.styles__input___2XTSp-camelCase {
    background-color: #5c197d !important;
    color: #fff !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #b55ce2 !important;
}

* {
    scrollbar-color: #a436db #250933 !important;
}
`;

    const pinkCSS = `
:root {
    --pink: #f702c6;
    --pink-hover: #d401ad;
    --text-white: #ffffff;
    --button-pink: #f702c6;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}

.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--pink) !important;
    color: var(--text-white) !important;
}

.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--pink-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #a8008e !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--button-pink) !important;
    color: var(--text-white) !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--pink-hover) !important;
}

.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}

#searchInput {
    background-color: var(--button-pink) !important;
}
`;
const DarkPinkCSS = `
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

.styles__background___2J-JA-camelCase {
    background-color: #551a3c !important; /* brighter dark pink */
}

.styles__bazaarItem___Meg69-camelCase {
    background-color: #aa3274 !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover {
    background-color: #aa3274 !important;
    transform: scale(1.05);
}

.styles__bazaarItems___KmNa2-camelCase {
    background-color: #7f265b !important;
}

.styles__blookGridContainer___AK47P-camelCase {
    background-color: #551a3c !important;
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: #ee5599 !important; /* brighter medium pink */
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase {
    background-color: #7f265b !important;
    color: #ee5599 !important;
}

.styles__cardContainer___NGmjp-camelCase {
    background-color: #ee5599 !important;
}

.styles__chatCurrentRoom___MCaV4-camelCase {
    background-color: #8a3865 !important;
}

.styles__chatEmojiButton___8RFa2-camelCase {
    background-color: #f066a4 !important;
    transition: 0.2s ease-in-out;
}

.styles__chatEmojiButton___8RFa2-camelCase:hover {
    background-color: #e8a7be !important;
}

.styles__chatInputContainer___gkR4A-camelCase {
    background-color: #000000 !important;
}

.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase {
    background-color: #7f265b !important;
}

.styles__chatRooms___o5ASb-camelCase {
    background-color: #7d2a57 !important;
}

.styles__chatUploadButton___g39Ac-camelCase {
    background-color: #d8437b !important;
    transition: 0.2s ease-in-out;
}

.styles__chatUploadButton___g39Ac-camelCase:hover {
    background-color: #d87a9e !important;
}

.styles__container___1BPm9-camelCase {
    background-color: #d8437b !important;
}

.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase {
    background-color: #852a52 !important;
}

.styles__edge___3eWfq-camelCase {
    background-color: #7f265b !important;
}

.styles__formsForm___MvA35-camelCase {
    background-color: #852a52 !important;
}

.styles__header___22Ne2-camelCase {
    background-color: #852a52 !important;
}

.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase {
    background-color: #ff3ea6 !important; /* bright pink */
}

.styles__horizontalBlookGridLine___4SAvz-camelCase {
    background-color: #7f265b !important;
}

.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase {
    background-color: #7f265b !important;
}

.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #7f265b !important;
}

.styles__profileDropdownOption___ljZXD-camelCase {
    background-color: #c14e84 !important;
}

.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: #111111 !important;
}

.styles__rightButtonInside___14imT-camelCase {
    color: #c14e84 !important;
}

.styles__sidebar___1XqWi-camelCase {
    background-color: #7f265b !important;
}

.styles__signUpButton___3_ch3-camelCase {
    background-color: #7f265b !important;
    color: #7d2a57 !important;
}

.styles__statContainer___QKuOF-camelCase {
    background-color: #111111 !important;
}

.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase {
    background-color: #7f265b !important;
}

.styles__verticalBlookGridLine___rQWaZ-camelCase {
    background-color: #7f265b !important;
}

#searchInput {
    background-color: #7f265b !important;
}

textarea,
.toastMessage,
input {
    background: linear-gradient(135deg, #f07eb1, #000000) !important;
}

hr {
    background-color: #7f265b !important;
}
`;


const whiteCSS = `
    :root {
        --white-bg: #e6e6e6;
        --white-bg-alt: #f9f9f9;
        --shadow-color: rgba(0,0,0,0.1);
        --text-black: #000000;
        --button-white: #ffffff;
        --button-hover: #dcdcdc;
    }

    /* Make all text black */
    * {
        color: var(--text-black) !important;
    }

    .styles__blooketText___1pMBG-camelCase {
        filter: drop-shadow(0 0 3px var(--shadow-color));
    }

    .styles__background___2J-JA-camelCase,
    .styles__bazaarItems___KmNa2-camelCase,
    .styles__blookGridContainer___AK47P-camelCase,
    .styles__cardContainer___NGmjp-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRoomsTitle___fR4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__container___2VzTy-camelCase,
    .styles__container___3St5B-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__containerHeaderInside___2omQm-camelCase,
    .styles__containerHeaderRight___3xghM-camelCase,
    .styles__containerHeaderRightFriends___3xghM-camelCase,
    .styles__editHeaderContainer___2G1ji-camelCase,
    .styles__formsForm___MvA35-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__header___2O21B-camelCase,
    .styles__headerBadgeBg___12ogR-camelCase,
    .styles__headerSide___1r1-b-camelCase,
    .styles__infoContainer___2uI-S-camelCase,
    .styles__input___2XTSp-camelCase,
    .styles__left___9beun-camelCase,
    .styles__myTokenAmount___ANKHA-camelCase,
    .styles__otherTokenAmount___SEGGS-camelCase,
    .styles__postsContainer___39_IQ-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__profileDropdownMenu___2jUAA-camelCase,
    .styles__profileDropdownOption___ljZXD-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__signUpButton___3_ch3-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__tradingContainer___B1ABS-camelCase,
    textarea,
    input,
    .toastMessage {
        background-color: var(--white-bg) !important;
        box-shadow: 0 0 8px var(--shadow-color) !important;
    }

    .styles__bazaarItem___Meg69-camelCase,
    .styles__chatEmojiButton___8RFa2-camelCase,
    .styles__chatUploadButton___g39Ac-camelCase {
        background-color: var(--white-bg-alt) !important;
        transition: 0.2s ease-in-out;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__chatEmojiButton___8RFa2-camelCase:hover,
    .styles__chatUploadButton___g39Ac-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: var(--button-hover) !important;
        transform: scale(1.05);
        border-color: #bbb !important;
    }

    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--button-white) !important;
    }

    .styles__buttonInside___39vdp-camelCase,
    .styles__front___vcvuy-camelCase,
    .styles__loginButton___1e3jI-camelCase {
        background-color: var(--text-black) !important;
        color: var(--white-bg) !important;
    }

    .styles__edge___3eWfq-camelCase,
    .styles__horizontalBlookGridLine___4SAvz-camelCase,
    .styles__verticalBlookGridLine___rQWaZ-camelCase,
    hr {
        background-color: var(--text-black) !important;
    }

    .styles__rightButtonInside___14imT-camelCase {
        color: var(--text-black) !important;
    }

    #searchInput {
        background-color: var(--button-white) !important;
    }
`;


const rainbowCSS = `
@keyframes rainbowFade {
  0%   { background-color: #FF0000; }
  16%  { background-color: #FF7F00; }
  33%  { background-color: #FFFF00; }
  50%  { background-color: #00FF00; }
  66%  { background-color: #0000FF; }
  83%  { background-color: #4B0082; }
  100% { background-color: #9400D3; }
}

body, #app,
.styles__background___2J-JA-camelCase,
.styles__app___bM8h5-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__header___22Ne2-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__friendContainer___3wVox-camelCase,
.styles__bazaarItem___Meg69-camelCase,
.styles__topStatsContainer___dWfN7-camelCase,
.styles__statsContainer___1r5je-camelCase,
.styles__bottomStatsContainer___1O6MJ-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__selectOption___1RxYj-camelCase,
.arts__chatModal___4JFsa-camelCase {  /* Added chatModal */
  animation: rainbowFade 15s infinite alternate;
  color: white !important;
}

/* Also apply rainbow animation to popups, modals, toasts */
.popup,
.modal,
.toast,
.tooltip,
[role="dialog"],
[role="alert"],
.styles__toastContainer___o4pCa-camelCase,
.styles__modal___someClass-camelCase,
.styles__popup___someClass-camelCase,
.arts__chatModal___4JFsa-camelCase { /* Added chatModal here too */
  animation: rainbowFade 15s infinite alternate !important;
  background-color: unset !important;
  color: white !important;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

/* Inputs, buttons, selects inside chat & popups */
textarea, input, select, button {
  background-color: rgba(0, 0, 0, 0.35) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

/* Hover states */
.styles__buttonFilled___23Dcn-camelCase:hover,
.styles__button___2hNZo-camelCase:hover,
.styles__bazaarItem___Meg69-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__selectOption___1RxYj-camelCase:hover {
  background-color: rgba(0, 0, 0, 0.6) !important;
  transform: scale(1.05);
  color: white !important;
}

hr, .styles__edge___3eWfq-camelCase {
  background-color: white !important;
}
`;

    const rainbow2CSS = `
:root {
/* TITLE TEXT */
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}

/* UNIVERSAL RAINBOW GRADIENT */
.rainbowBG,
.styles__background___2J-JA-camelCase,
.styles__bazaarItem___Meg69-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
#searchInput,
.toastMessage {
    background: linear-gradient(286deg,
        #ff0000, #ff7f00, #ffff00,
        #00ff00, #0000ff, #4b0082, #8f00ff,
        #ff0000, #ff7f00, #ffff00,
        #00ff00, #0000ff, #4b0082, #8f00ff
    ) !important;

    background-size: 300% 300%;
    animation: rainbowShift 10s linear infinite;
}

/* HOVER BRIGHTEN */
.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* WHITE UI ELEMENTS */
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: #fff !important;
    color: #000 !important;
}

/* WHITE LINES */
.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: #fff !important;
}

/* 🌈 CIRCULAR RAINBOW ANIMATION */
@keyframes rainbowShift {
    0% { background-position: 50% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 50% 0%; }
}
`;

    const CottonCandyCSS = `
:root {
    --accent: #f000;
    --primary: #f000;
    --secondary: var(--halloween-orange);
    --tertiary: #1a1a1a;
    --halloween-purple: #a67fec;
    --halloween-orange: #2eb7e8;
}

.bb_customCSSBox {
    background-color: var(--primary) !important;
}

.styles__tokenBalanceIcon___3MGhs-camelCase {
    content: url("/content/tokenIcon.webp");
}

.styles__containerHeader___3xghM-camelCase {
    box-shadow: 0 0.208vw rgba(0, 0, 0, 0.1), inset 0 -0.208vw rgba(0, 0, 0, 0.1);
}

.styles__background___2J-JA-camelCase {
    background: linear-gradient(to right, #9796f0, #fbc7d4);
}

.styles__blooksBackground___3oQ7Y-camelCase {
    display: none !important;
    visibility: hidden !important;
    background-image: none !important;
}

.styles__sidebar___1XqWi-camelCase {
    background: linear-gradient(to bottom, rgba(18, 194, 233, 0.4) 0%, rgba(196, 113, 237, 0.4) 50%, rgba(246, 79, 89, 0.4) 100%);
}

.styles__container___1BPm9-camelCase,
.bb_bigModal {
    background: linear-gradient(45deg, rgba(251, 199, 212, 0.9) 0%, rgba(151, 150, 240, 0.9) 100%);
}

.styles__chatInputContainer___gkR4A-camelCase {
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    margin: 4px;
}

.styles__button___1_E-G-camelCase .styles__button___3zpwV-camelCase {
    background-color: var(--primary);
}

.styles__header___2O21B-camelCase {
    background-color: var(--tertiary);
}

.styles__dateRow___1jkQT-camelCase {
    color: #f1f1f1;
}

.bb_roleTag {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid #404040;
}

.styles__contextMenuContainer___3jAmv-camelCase {
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #000;
}

.styles__profileContainer___CSuIE-camelCase,
.styles__tradingContainer___B1ABS-camelCase {
    background-color: rgba(0, 0, 0, 0.3);
}

.styles__left___9beun-camelCase {
    background-color: rgba(111, 0, 111, 0.3);
    border: 3px solid rgba(0, 0, 0, 0.3);
}

.styles__blooketText___1pMBG-camelCase {
    font-family: Titan One !important;
    font-size: 2.383vw !important;
}

.styles__chatMessageButtonContainer___4jCa3-camelCase,
.styles__blookGridContainer___AK47P-camelCase {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 3px solid rgba(0, 0, 0, 0.3);
}

.styles__blookGridContainer___AK47P-camelCase {
    border-width: 5px;
    border-radius: 25px;
}

.styles__verticalBlookGridLine___rQWaZ-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase {
    background-color: #fff;
    border-radius: 5px;
}

.styles__smallChatContainer__RT55a-camelCase {
    margin-bottom: 15px;
    border-radius: 15px;
}

#searchInput {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

#searchInput::placeholder {
    color: #fff;
    opacity: 0.75;
}

.toastMessage {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.styles__pageButton___1wFuu-camelCase {
    transition: 0.7s cubic-bezier(0, 1.46, 0.58, 1);
}

.styles__pageButton___1wFuu-camelCase:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
}
`;

    const BlooketCSS = `
.styles__background___2J-JA-camelCase,
.styles__bazaarItem___Meg69-camelCase,
.styles__bazaarItem___Meg69-camelCase:hover,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
#searchInput,
textarea,
input,
.toastMessage {
    background-color: #08C2D0 !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__tradingContainer___B1ABS-camelCase,
hr,
.styles__loginButton___1e3jI-camelCase {
    background-color: #9A48AA !important;
}

.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__rightButtonInside___14imT-camelCase,
.styles__loginButton___1e3jI-camelCase {
    color: #ffffff !important;
}

.styles__signUpButton___3_ch3-camelCase {
    background-color: #08C2D0 !important;
    color: #ffffff !important;
}

.styles__sidebar___1XqWi-camelCase {
    background-color: #9A48AA !important;
}
`;

    /*const BlooketCSS = `
    /**
 * @name Blooket
 * @description Simple Blooket theme for blacket.
 * @author DMrD

:root {
    --accent: #f000;
    --primary: #f000;
    --secondary: var(#2eb7e8);
    --tertiary: #1a1a1a;
    --halloween-purple: #a67fec;
    --halloween-orange: #2eb7e8;
}

.styles__background___2J-JA-camelCase,
.styles__sidebar___1XqWi-camelCase {
    background: #0bc2cf;
}

.styles__pageButton___1wFuu-camelCase {
    transition: 0.7s cubic-bezier(0, 1.46, 0.58, 1);
    font-weight: bold;
}

.styles__pageButton___1wFuu-camelCase:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.styles__blooketText___1pMBG-camelCase {
    font-family: Titan One !important;
    font-size: 2.383vw !important;
}

.styles__tokenBalanceIcon___3MGhs-camelCase {
    content: url("/content/tokenIcon.webp");
}

.styles__contextMenuContainer___3jAmv-camelCase {
    background-color: var(--secondary);
    border-color: #fff;
    border-style: solid;
    border-radius: 6px;
    border-width: 3px;
    font-weight: bold;
}
`;*/
    const ChocoletBrownCSS = `
:root {
    --earth-base: #2d1c10;
    --earth-base-hover: #432a16;
    --earth-light: #5a3921;

    --earth-accent-green: #0e8719;
    --earth-accent-green-dark: #1a340c;

    --earth-accent-red: #ce1313;
    --earth-gold: gold;

    --text-white: #ffffff;
    --text-dark: #3a3a3a;
}

.styles__blooketText___1pMBG-camelCase {
    color: var(--text-white);
    filter: drop-shadow(0px 0px 5px var(--text-white));
}


.styles__background___2J-JA-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
textarea,
input,
.toastMessage {
    background-color: var(--earth-base) !important;
    color: var(--text-white) !important;
}


.styles__bazaarItem___Meg69-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase {
    background-color: var(--earth-base-hover) !important;
    transition: 0.2s ease-in-out;
}

.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background-color: var(--earth-light) !important;
    transform: scale(1.05);
}

.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase {
    background-color: var(--earth-accent-green-dark) !important;
    color: var(--text-white) !important;
}

.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover {
    background-color: var(--earth-accent-green) !important;
    transform: scale(1.05);
}


.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background-color: var(--text-white) !important;
    color: var(--earth-base-hover) !important;
}


.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background-color: var(--text-white) !important;
}


.styles__rightButtonInside___14imT-camelCase {
    color: var(--text-white) !important;
}


#searchInput {
    background-color: var(--earth-light) !important;
    color: var(--text-white) !important;
}
`;

  const HalloweenCSS = `
/* =========================
   HALLOWEEN PURPLE THEME
   Black / Purple / Orange
   ========================= */

/* Creepy font import */
@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');

/* ONLY text elements use Creepster */
body,
button,
input,
textarea,
span,
p,
h1,
h2,
h3,
h4,
h5,
h6,
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__tokenBalance___1FHgT-camelCase,
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase {
    font-family: 'Creepster', cursive !important;
}
/* Main background */
.styles__background___2J-JA-camelCase {
    background:
        radial-gradient(circle at top, #2b103d 0%, #120814 60%, #050505 100%) !important;
}

/* Containers */
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__sidebar___1XqWi-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__infoContainer___2uI-S-camelCase,
.styles__tradingContainer___B1ABS-camelCase,
.styles__bazaarItem___Meg69-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
textarea,
input {
    background: #1a091f !important;
    color: #ffddb0 !important;
    box-shadow:
        inset 0 -5px #2f1039,
        0 0 15px rgba(255, 123, 0, 0.25) !important;
}

/* Headers */
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerSide___1r1-b-camelCase {
    background:
        linear-gradient(#7b1ea9, #4d136b) !important;

    color: #ff9d00 !important;

    text-shadow:
        0 0 5px #ff7b00,
        0 0 10px #ff7b00 !important;
}

/* Buttons */
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase {
    background:
        linear-gradient(#ff7b00, #d35400) !important;

    color: white !important;


    transition: 0.2s ease-in-out !important;

    box-shadow:
        inset 0 -4px #8a3200,
        0 0 10px rgba(255, 123, 0, 0.4) !important;
}

/* Hover effects */
.styles__button___2hNZo-camelCase:hover,
.styles__buttonFilled___23Dcn-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover,
.styles__signUpButton___3_ch3-camelCase:hover,
.styles__bazaarItem___Meg69-camelCase:hover {
    transform: scale(1.05) rotate(-1deg);

    background:
        linear-gradient(#ff9d00, #ff6200) !important;

    box-shadow:
        0 0 20px #ff7b00,
        0 0 40px rgba(255, 123, 0, 0.5) !important;
}

/* Grid lines / separators */
.styles__edge___3eWfq-camelCase,
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr {
    background: #ff7b00 !important;
}

/* Inputs */
.styles__input___2XTSp-camelCase,
#searchInput {
    background: #2a0d30 !important;
    color: #fff !important;
    border: 2px solid #ff7b00 !important;
}

/* Login/front buttons */
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__loginButton___1e3jI-camelCase {
    background: #ff7b00 !important;
    color: #1a091f !important;
}

/* Tokens / stats */
.styles__statContainer___QKuOF-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase {
    background: #5c197d !important;
    color: #ffb347 !important;
}

/* Right side icons */
.styles__rightButtonInside___14imT-camelCase,
.styles__icon___358UQ-camelCase,
.styles__headerIcon___1ykdN-camelCase {
    color: #ff9d00 !important;
}

/* Scrollbar */
* {
    scrollbar-color: #ff7b00 #120814 !important;
}

/* Placeholder text */
::placeholder {
    color: #ffb347 !important;
}

/* Animated spooky background */
@keyframes halloweenGlow {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.15);
    }

    100% {
        filter: brightness(1);
    }
}

.styles__background___2J-JA-camelCase {
    animation: halloweenGlow 4s ease-in-out infinite !important;
}
`;

const MEOWLCSS = `

.styles__background___2J-JA-camelCase {
    background: url("https://media1.tenor.com/m/JAtzLZTVVCsAAAAd/goodday.gif") center/cover no-repeat fixed !important;
}
.styles__blooketText___1pMBG-camelCase {
    font-size: 40px;
    font-family: Titan One, sans-serif;
    text-decoration: none;
    color: white;
    filter: drop-shadow(0px 0px 5px white);
    margin-bottom: 20px;
    text-align: center;
}
/* UNIVERSAL GLASS EFFECT */
.styles__bazaarItem___Meg69-camelCase,
.styles__bazaarItems___KmNa2-camelCase,
.styles__blookGridContainer___AK47P-camelCase,
.styles__button___2hNZo-camelCase,
.styles__buttonFilled___23Dcn-camelCase,
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__cardContainer___NGmjp-camelCase,
.styles__chatCurrentRoom___MCaV4-camelCase,
.styles__chatEmojiButton___8RFa2-camelCase,
.styles__chatInputContainer___gkR4A-camelCase,
.styles__chatRoomsListContainer___Gk4Av-camelCase,
.styles__chatRoomsTitle___fR4Av-camelCase,
.styles__chatRooms___o5ASb-camelCase,
.styles__chatUploadButton___g39Ac-camelCase,
.styles__container___1BPm9-camelCase,
.styles__container___2VzTy-camelCase,
.styles__container___3St5B-camelCase,
.styles__containerHeader___3xghM-camelCase,
.styles__containerHeaderInside___2omQm-camelCase,
.styles__containerHeaderRight___3xghM-camelCase,
.styles__containerHeaderRightFriends___3xghM-camelCase,
.styles__editHeaderContainer___2G1ji-camelCase,
.styles__formsForm___MvA35-camelCase,
.styles__header___22Ne2-camelCase,
.styles__header___2O21B-camelCase,
.styles__headerBadgeBg___12ogR-camelCase,
.styles__headerSide___1r1-b-camelCase,
.styles__input___2XTSp-camelCase,
.styles__left___9beun-camelCase,
.styles__loginButton___1e3jI-camelCase,
.styles__myTokenAmount___ANKHA-camelCase,
.styles__otherTokenAmount___SEGGS-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__profileDropdownMenu___2jUAA-camelCase,
.styles__profileDropdownOption___ljZXD-camelCase,
.styles__signUpButton___3_ch3-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__toastContainer___o4pCa-camelCase,
.styles__tokenContainer___3yBv--camelCase,
.styles__tradingContainer___B1ABS-camelCase,
#searchInput,
textarea,
.toastMessage,
input {
    background: rgba(0, 0, 0, 0) !important;
}

/* HOVER EFFECTS */
.styles__bazaarItem___Meg69-camelCase:hover,
.styles__chatEmojiButton___8RFa2-camelCase:hover,
.styles__chatUploadButton___g39Ac-camelCase:hover,
.styles__profileDropdownOption___ljZXD-camelCase:hover {
    background: rgba(255,255,255,0.08) !important;
    transform: scale(1.03);
}

/* WHITE BUTTON TEXT */
.styles__buttonInside___39vdp-camelCase,
.styles__front___vcvuy-camelCase,
.styles__rightButtonInside___14imT-camelCase {
    color: white !important;
}

/* GRID LINES */
.styles__horizontalBlookGridLine___4SAvz-camelCase,
.styles__verticalBlookGridLine___rQWaZ-camelCase,
hr,
.styles__edge___3eWfq-camelCase {
    background-color: rgba(255,255,255,0.35) !important;
}

/* PLACEHOLDER TEXT */
input::placeholder,
textarea::placeholder {
    color: rgba(255,255,255,0.6) !important;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.35);
}

/* CUSTOM GIFS INSIDE INFO CONTAINERS */

.styles__infoContainer___2uI-S-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__cardContainer___NGmjp-camelCase {
    position: relative !important;
    overflow: hidden !important;
}

/* GIF OVERLAY */

.styles__infoContainer___2uI-S-camelCase::before,
.styles__profileContainer___CSuIE-camelCase::before,
.styles__postsContainer___39_IQ-camelCase::before,
.styles__statContainer___QKuOF-camelCase::before,
.styles__statsContainer___QnrRB-camelCase::before,
.styles__sidebar___1XqWi-camelCase::before,
.styles__cardContainer___NGmjp-camelCase::before {
    content: "";

    position: absolute;
    inset: 0;

    background-image: url("https://media1.tenor.com/m/JAtzLZTVVCsAAAAd/goodday.gif");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    opacity: 0.;

    pointer-events: none;

    z-index: 0;
}

/* KEEP CONTENT ABOVE GIF */

.styles__infoContainer___2uI-S-camelCase *,
.styles__profileContainer___CSuIE-camelCase *,
.styles__postsContainer___39_IQ-camelCase *,
.styles__statContainer___QKuOF-camelCase *,
.styles__statsContainer___QnrRB-camelCase *,
.styles__cardContainer___NGmjp-camelCase * {
    position: relative;
    z-index: 1;
}

/* =========================
   DROP-IN GLASS SYSTEM
   InfoContainers + Sidebars
   ========================= */

/* BASE TARGETS */
.styles__infoContainer___2uI-S-camelCase,
.styles__profileContainer___CSuIE-camelCase,
.styles__postsContainer___39_IQ-camelCase,
.styles__statContainer___QKuOF-camelCase,
.styles__statsContainer___QnrRB-camelCase,
.styles__cardContainer___NGmjp-camelCase,

.styles__sidebar___1XqWi-camelCase,
.styles__sideBar___1XqWi-camelCase,
.styles__sidebarContainer___1XqWi-camelCase,
.styles__leftSidebar___1XqWi-camelCase,
.styles__rightSidebar___1XqWi-camelCase,
.styles__friendsSidebar___1XqWi-camelCase {

/* ✨ TRANSPARENT GLASS BASE */
    background: rgba(0, 0, 0, 0) !important;

/* keeps layering stable */
    isolation: isolate;
}
/* =========================
   GIF OVERLAY (SUBTLE)
   ========================= */

.styles__infoContainer___2uI-S-camelCase::before,
.styles__profileContainer___CSuIE-camelCase::before,
.styles__postsContainer___39_IQ-camelCase::before,
.styles__statContainer___QKuOF-camelCase::before,
.styles__statsContainer___QnrRB-camelCase::before,
.styles__cardContainer___NGmjp-camelCase::before,

.styles__sidebar___1XqWi-camelCase::before,
 .styles__sideBar___1XqWi-camelCase::before,
.styles__sidebarContainer___1XqWi-camelCase::before,
.styles__leftSidebar___1XqWi-camelCase::before,
.styles__rightSidebar___1XqWi-camelCase::before,
.styles__friendsSidebar___1XqWi-camelCase::before{

    content: "";
    position: absolute;
    inset: 0;

    background-image: url("https://media1.tenor.com/m/JAtzLZTVVCsAAAAd/goodday.gif");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

/* 👇 subtle transparency */
    opacity: 0.6;

    pointer-events: none;
    z-index: 0;
}

/* =========================
   KEEP CONTENT ABOVE GIF
   ========================= */

.styles__infoContainer___2uI-S-camelCase *,
.styles__profileContainer___CSuIE-camelCase *,
.styles__postsContainer___39_IQ-camelCase *,
.styles__statContainer___QKuOF-camelCase *,
.styles__statsContainer___QnrRB-camelCase *,
.styles__cardContainer___NGmjp-camelCase *,
 {

    position: relative;
    z-index: 1;
}
`

    // Function to inject/update the theme CSS
function applyTheme(theme) {
    let styleEl = document.getElementById('blacket-theme-style');
    if (!styleEl) {
        styleEl = document.createElement('style');
        styleEl.id = 'blacket-theme-style';
        document.head.appendChild(styleEl);
    }

    // Handle custom color theme
    if (theme === 'Custom') {
        let customColor = localStorage.getItem('customThemeColor') || '#00ffff';
        const userInput = prompt('Enter a hex color (e.g. #ff8800):', customColor);
        if (userInput && /^#([0-9A-Fa-f]{3}){1,2}$/.test(userInput)) {
            customColor = userInput;
            localStorage.setItem('customThemeColor', customColor);
        }
        styleEl.textContent = generateCustomCSS(customColor);
        return;
    }
        switch (theme) {
            case 'Amoled': styleEl.textContent = amoledCSS; break;
            case 'Red': styleEl.textContent = redCSS; break;
            case 'Dark Red': styleEl.textContent = DarkRedCSS; break;
            case 'Orange': styleEl.textContent = orangeCSS; break;
            case 'Dark Orange': styleEl.textContent = DarkOrangeCSS; break;
            case 'Yellow': styleEl.textContent = yellowCSS; break;
            case 'Dark Yellow': styleEl.textContent = DarkYellowCSS; break;
            case 'Green': styleEl.textContent = greenCSS; break;
            case 'Dark Green': styleEl.textContent = DarkGreenCSS; break;
            case 'Blue': styleEl.textContent = blueCSS; break;
            case 'Dark Blue': styleEl.textContent = DarkBlueCSS; break;
            case 'Purple': styleEl.textContent = purpleCSS; break;
            case 'Dark Purple': styleEl.textContent = DarkPurpleCSS; break;
            case 'Pink': styleEl.textContent = pinkCSS; break;
            case 'Dark Pink': styleEl.textContent = DarkPinkCSS; break;
            case 'White': styleEl.textContent = whiteCSS; break;
            case 'Rainbow': styleEl.textContent = rainbowCSS; break;
            case 'Rainbow2': styleEl.textContent = rainbow2CSS; break;
            case 'Cotton Candy': styleEl.textContent = CottonCandyCSS; break;
            case 'Blooket': styleEl.textContent = BlooketCSS; break;
            case 'Halloween': styleEl.textContent = HalloweenCSS; break;
            case 'Legacy': styleEl.textContent = ''; initLegacyParticles(); break;
            case 'Triangulet Green': styleEl.textContent = TrianguletGreenCSS; break;
            case 'Triangulet Purple': styleEl.textContent =TrianguletPurpleCSS; break;
            case 'Blulet Blue': styleEl.textContent =BluletBlueCSS; break;
            case 'Purpet Purple': styleEl.textContent =PurpetPurpleCSS; break;
            case 'Chocolet Brown': styleEl.textContent =ChocoletBrownCSS; break;
            case 'MEOWL': styleEl.textContent =MEOWLCSS; break;
            default: styleEl.textContent = ''; break; // Default clears styles
        }
    }

function generateCustomCSS(color) {
    return `
    :root {
        --custom-color: ${color};
        --custom-text: #ffffff;
    }

    /* Main backgrounds */
    body, #app,
    .styles__background___2J-JA-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__containerHeader___3xghM-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__tokenContainer___3yBv--camelCase,
    .styles__topStatsContainer___dWfN7-camelCase,
    .styles__statsContainer___1r5je-camelCase,
    .styles__bottomStatsContainer___1O6MJ-camelCase,
    .styles__statsContainer___QnrRB-camelCase,
    .toastMessage {
        background-color: var(--custom-color) !important;
        color: var(--custom-text) !important;
    }

    /* Buttons */
    .styles__button___2hNZo-camelCase,
    .styles__buttonFilled___23Dcn-camelCase {
        background-color: var(--custom-color) !important;
        color: var(--custom-text) !important;
        border: none !important;
    }

    /* Inputs, selects, textareas */
    input, select, textarea {
        background-color: var(--custom-color) !important;
        color: var(--custom-text) !important;
        border: 1px solid var(--custom-text) !important;
    }

    /* Dropdown menu options */
    .styles__profileDropdownOption___ljZXD-camelCase,
    .styles__bazaarItem___Meg69-camelCase {
        background-color: var(--custom-color) !important;
        color: var(--custom-text) !important;
        border-radius: 4px;
    }

    .styles__bazaarItem___Meg69-camelCase:hover,
    .styles__profileDropdownOption___ljZXD-camelCase:hover {
        background-color: rgba(0, 0, 0, 0.3) !important;
        transform: scale(1.05);
    }

    /* Headers, navbars */
    .styles__headerRow___1tdPa-camelCase,
    .styles__infoContainer___2uI-S-camelCase {
        background-color: var(--custom-color) !important;
        color: var(--custom-text) !important;
    }

    /* Borders and dividers */
    hr, .styles__edge___3eWfq-camelCase {
        background-color: var(--custom-text) !important;
    }

    /* Scrollbar styling */
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    ::-webkit-scrollbar-track {
        background: var(--custom-color);
    }
    ::-webkit-scrollbar-thumb {
        background: var(--custom-text);
        border-radius: 10px;
    }

    /* Placeholder text */
    ::placeholder {
        color: #cccccc !important;
    }
    `;
}

   function initLegacyParticles() {
    if (document.getElementById('particles-js')) return;

    const container = document.createElement('div');
    container.id = 'particles-js';
    Object.assign(container.style, {
        position: 'fixed',
        top: '0',
        left: '0',
        width: '100vw',
        height: '100vh',
        zIndex: '-1',
        pointerEvents: 'none',
        opacity: '1',
    });
    document.body.prepend(container);

    const link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = 'https://web.archive.org/web/20220406180854cs_/https://blacket.org/particles.css';
    document.head.appendChild(link);

    const script = document.createElement('script');
    script.src = 'https://web.archive.org/web/20220406180854js_/https://blacket.org/particles.js';
    script.onload = () => {
        particlesJS("particles-js", {
            particles: {
                number: { value: 80, density: { enable: true, value_area: 800 } },
                color: { value: "#ffffff" },
                shape: { type: "circle" },
                opacity: { value: 0.5 },
                size: { value: 3, random: true },
                line_linked: {
                    enable: true, distance: 150, color: "#ffffff", opacity: 0.4, width: 1
                },
                move: {
                    enable: true, speed: 6, direction: "none", random: false,
                    straight: false, out_mode: "out"
                }
            },
            interactivity: {
                detect_on: "canvas",
                events: {
                    onhover: { enable: true, mode: "grab" },
                    onclick: { enable: true, mode: "push" },
                    resize: true
                },
                modes: {
                    grab: { distance: 140, line_linked: { opacity: 1 } },
                    push: { particles_nb: 4 }
                }
            },
            retina_detect: true
        });

        const style = document.createElement('style');
        style.textContent = `
            body, #app {
                background-color: transparent !important;
           }
    .styles__background___2J-JA-camelCase,
    .styles__sidebar___1XqWi-camelCase,
    .styles__container___1BPm9-camelCase,
    .styles__header___22Ne2-camelCase,
    .styles__toastContainer___o4pCa-camelCase,
    .styles__chatCurrentRoom___MCaV4-camelCase,
    .styles__chatRoomsListContainer___Gk4Av-camelCase,
    .styles__chatRooms___o5ASb-camelCase,
    .styles__chatInputContainer___gkR4A-camelCase,
    .styles__chatMessagesContainer___8J3rW-camelCase,
    .styles__profileContainer___CSuIE-camelCase,
    .styles__statContainer___QKuOF-camelCase,
    .styles__topStatsContainer___dWfN7-camelCase,
    .styles__statsContainer___1r5je-camelCase,
    .styles__bottomStatsContainer___1O6MJ-camelCase,
    .styles__statsContainer___QnrRB-camelCase {
        background-color: transparent !important;
        backdrop-filter: none !important;
    }
        #particles-js {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1 !important;
        pointer-events: none;
        opacity: 1;
    }
        `;
        document.head.appendChild(style);
    };
    document.head.appendChild(script);
}



    // Immediately apply saved theme on script load to persist on every page
    const savedTheme = localStorage.getItem('blacketTheme') || 'Default';
    applyTheme(savedTheme);

    // Add the cloned Additions panel with the theme selector dropdown inside the settings sidebar
function addClonedAdditionsPanel() {
    if (document.getElementById("additions-panel")) return; // Already added

    // Find the profile panel among all containers
    const profilePanel = Array.from(document.querySelectorAll(".styles__infoContainer___2uI-S-camelCase"))
        .find(el => el.innerText.includes("Username:") && el.innerText.includes("Role:"));

    if (!profilePanel) {
        setTimeout(addClonedAdditionsPanel, 250);
        return;
    }

    // Parent container where all info containers live
    const parentContainer = profilePanel.parentElement;
    if (!parentContainer) {
        setTimeout(addClonedAdditionsPanel, 250);
        return;
    }

    const clonedPanel = profilePanel.cloneNode(true);
    clonedPanel.id = "additions-panel";

    clonedPanel.innerHTML = `
        <div class="styles__headerRow___1tdPa-camelCase">
            <i class="fas fa-paintbrush-alt styles__headerIcon___1ykdN-camelCase" aria-hidden="true" style="color: #8f8f8f;"></i>
            <div class="styles__infoHeader___1lsZY-camelCase" style="color: #fff;">Additions</div>
        </div>
        <div style="font-size: 20px; color: #fff;">
            Change Theme: <br>
            <select id="themeselect" class="styles__link___5UR6_-camelCase"
                style="background-color: #2f2f2f; color: #fff; border: 1px solid #8f8f8f; outline: none;
                padding: 5px 10px; border-radius: 5px; font-size: 15px; cursor: pointer;
                margin-top: 5px; margin-bottom: 5px; margin-left: 5px;">
                <option>Default</option>
                <option>Amoled</option>
                <option>Red</option>
                <option>Dark Red</option>
                <option>Orange</option>
                <option>Dark Orange</option>
                <option>Yellow</option>
                <option>Dark Yellow</option>
                <option>Green</option>
                <option>Dark Green</option>
                <option>Blue</option>
                <option>Dark Blue</option>
                <option>Purple</option>
                <option>Dark Purple</option>
                <option>Pink</option>
                <option>Dark Pink</option>
                <option>White</option>
                <option>Rainbow</option>
                <option>Rainbow2</option>
                <option>Cotton Candy</option>
                <option>Blooket</option>
                <option>Halloween</option>
                <option>Custom</option>
                <option>Legacy</option>
                <option>Triangulet Green</option>
                <option>Triangulet Purple</option>
                <option>Blulet Blue</option>
                <option>Purpet Purple</option>
                <option>Chocolet Brown</option>
                <option>MEOWL</option>
            </select>
        </div>
    `;

    parentContainer.appendChild(clonedPanel);

    const savedTheme = localStorage.getItem('blacketTheme') || 'Default';
    const themeSelect = document.getElementById('themeselect');
    themeSelect.value = savedTheme;

    themeSelect.addEventListener('change', () => {
        const selected = themeSelect.value;
        localStorage.setItem('blacketTheme', selected);
        location.reload();
    });
}

// Start the process, retry until ready
addClonedAdditionsPanel();


})();

    } catch (err) {}
  }
});
const index_custom10 = () => createPlugin({
  name: "Gradient Creator",
  description: "Lets you create gradients simpler than ever [PLUS REQUIRED!].",

  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {
(function () {
    'use strict';

    let activeOverlay = null;

    const font = document.createElement("link");
    font.href = "https://fonts.googleapis.com/css2?family=Titan+One&display=swap";
    font.rel = "stylesheet";
    document.head.appendChild(font);

    function waitForElement(selector) {
        return new Promise(resolve => {
            const i = setInterval(() => {
                const el = document.querySelector(selector);
                if (el) {
                    clearInterval(i);
                    resolve(el);
                }
            }, 100);
        });
    }

    async function init() {
        const originalBtn = await waitForElement('#changeDefaultChatColorButton').catch(() => null);

        const container =
            originalBtn?.closest('.styles__infoContainer___2uI-S-camelCase')
            || document.body;

        const btn = document.createElement("a");
        btn.href = "javascript:void(0)";
        btn.textContent = "Edit Chat Gradient";

        btn.className = originalBtn?.className || "";
        btn.style.display = "block";
        container.appendChild(btn);

        btn.onclick = createModal;
    }

    function createModal() {
        if (activeOverlay) return;

        const MAX_DOTS = 7;

        let dots = ["#ff0000", "#0000ff"];
        let angle = 90;

        const overlay = document.createElement("div");
        activeOverlay = overlay;

        overlay.style.cssText = `
            position:fixed;
            inset:0;
            background:rgba(0,0,0,0.75);
            display:flex;
            align-items:center;
            justify-content:center;
            z-index:999999;
        `;

        document.body.style.overflow = "hidden";

        function closeModal() {
            document.body.style.overflow = "";
            overlay.remove();
            activeOverlay = null;
        }

        const form = document.createElement("div");
        form.className = "styles__container___1BPm9-camelCase";

        form.style.cssText = `
            padding:25px;
            width:650px;
            max-width:90vw;
            height:600px;
            display:flex;
            flex-direction:column;
            justify-content:space-between;
            align-items:center;
        `;

        const title = document.createElement("div");
        title.textContent = "Gradient Editor";
        title.style.cssText = `
            font-family: 'Titan One', sans-serif;
            font-size: 24px;
            color: white;
        `;

        const lineContainer = document.createElement("div");
        lineContainer.style.cssText = `
            position:relative;
            width:100%;
            height:200px;
        `;

        const line = document.createElement("div");
        line.style.cssText = `
            position:absolute;
            top:20px;
            height:14px;
            width:100%;
            border-radius:10px;
        `;

        lineContainer.appendChild(line);

        const degreeInput = document.createElement("input");
        degreeInput.type = "number";
        degreeInput.min = 0;
        degreeInput.max = 360;

        degreeInput.style.cssText = `
            margin-top:10px;
            padding:5px;
            border-radius:6px;
            border:none;
            width:80px;
            text-align:center;
        `;

        const codeBox = document.createElement("textarea");
        codeBox.style.cssText = `
            width:100%;
            height:120px;
            resize:none;
            border-radius:8px;
            padding:8px;
            font-family:monospace;
        `;

        const angleWrapper = document.createElement("div");
        const angleLine = document.createElement("div");

        function syncDial() {
            if (angleLine) {
                angleLine.style.transform = `rotate(${angle}deg)`;
            }
        }

        // 🔥 UPDATED FUNCTION
        function updateBar() {
            const gradient = `gradient=[${angle}deg: ${dots.join(", ")}]`;

            line.style.background = `linear-gradient(${angle}deg, ${dots.join(",")})`;

            degreeInput.value = angle;

            // FULL EXECUTABLE SCRIPT
            codeBox.value =
`localStorage.setItem('chatColor', \`${gradient}\`);`;

            syncDial();
        }

        function renderDots() {
            lineContainer.querySelectorAll(".dot").forEach(e => e.remove());

            dots.forEach((color, i) => {
                const percent = dots.length === 1 ? 50 : (i / (dots.length - 1)) * 100;

                const input = document.createElement("input");
                input.type = "color";
                input.value = color;
                input.className = "dot";

                input.style.cssText = `
                    position:absolute;
                    left:${percent}%;
                    top:10px;
                    transform:translateX(-50%);
                    width:22px;
                    height:22px;
                    border-radius:50%;
                    border:none;
                    cursor:pointer;
                    background:none;
                `;

                input.oninput = () => {
                    dots[i] = input.value;
                    updateBar();
                };

                lineContainer.appendChild(input);
            });

            updateBar();
        }

        renderDots();

        degreeInput.oninput = () => {
            angle = Math.max(0, Math.min(360, parseInt(degreeInput.value) || 0));
            updateBar();
        };

        // =========================
        // SAFE DIAL
        // =========================

        let dragging = false;

        angleWrapper.style.cssText = `
            position:absolute;
            top:120px;
            left:50%;
            width:140px;
            height:140px;
            transform:translate(-50%, -50%);
            pointer-events:none;
        `;

        angleLine.style.cssText = `
            position:absolute;
            width:100%;
            height:2px;
            background:white;
            top:50%;
            transform-origin:center;
            transform:rotate(0deg);
        `;

        const handle = document.createElement("div");
        handle.style.cssText = `
            position:absolute;
            right:-6px;
            top:50%;
            width:16px;
            height:16px;
            border-radius:50%;
            background:white;
            cursor:pointer;
            pointer-events:auto;
        `;

        angleLine.appendChild(handle);
        angleWrapper.appendChild(angleLine);
        lineContainer.appendChild(angleWrapper);

        handle.addEventListener("mousedown", () => {
            dragging = true;
        });

        document.addEventListener("mouseup", () => {
            dragging = false;
        });

        document.addEventListener("mousemove", (e) => {
            if (!dragging) return;

            try {
                const rect = angleWrapper.getBoundingClientRect();
                const cx = rect.left + rect.width / 2;
                const cy = rect.top + rect.height / 2;

                const dx = e.clientX - cx;
                const dy = e.clientY - cy;

                let deg = Math.atan2(dy, dx) * (180 / Math.PI);
                deg = (deg + 360) % 360;

                angle = Math.round(deg);

                updateBar();
            } catch (err) {
                console.error("[Dial Error]", err);
            }
        });

        // =========================

        function makeBtn(label, fn) {
            const b = document.createElement("div");

            b.className = "styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase";

            b.innerHTML = `
                <div class="styles__shadow___3GMdH-camelCase"></div>
                <div class="styles__edge___3eWfq-camelCase" style="background:var(--accent)"></div>
                <div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase"
                     style="background:var(--accent);">
                    ${label}
                </div>
            `;

            b.onclick = fn;
            return b;
        }

        const btnRow = document.createElement("div");
        btnRow.style.cssText = `
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            justify-content:center;
        `;

        btnRow.append(
            makeBtn("Add", () => {
                if (dots.length < MAX_DOTS) {
                    dots.push("#ffffff");
                    renderDots();
                }
            }),

            makeBtn("Remove", () => {
                if (dots.length > 1) {
                    dots.pop();
                    renderDots();
                }
            }),

            makeBtn("Save", () => {
                localStorage.setItem(
                    "chatColor",
                    `gradient=[${angle}deg: ${dots.join(", ")}]`
                );

                updateBar();
            }),

            makeBtn("Copy", () => {
                navigator.clipboard.writeText(codeBox.value);
            }),

            makeBtn("Load", () => {
                const match = codeBox.value.match(/gradient=\[(\d+)deg:\s*(.+)\]/);

                if (!match) return alert("Invalid format");

                angle = parseInt(match[1]);

                dots = match[2]
                    .split(",")
                    .map(x => x.trim());

                renderDots();
            }),

            makeBtn("Close", closeModal)
        );

        form.append(
            title,
            lineContainer,
            degreeInput,
            codeBox,
            btnRow
        );

        overlay.appendChild(form);
        document.body.appendChild(overlay);

        updateBar();
    }

    init();
})();

    } catch (err) {}
  }
});
const index_custom11 = () => createPlugin({
  name: "Trade History Viewer",
  description: "View your past trades stored in local storage (no db ofc).",

  authors: [
    {
      name: "FRANXE",
      avatar: "https://avatars.githubusercontent.com/u/218293368",
      url: "https://github.com/franxetsx"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {

      (function() {
    'use strict';

    const waitForBlacket = setInterval(() => {
        if (typeof blacket !== 'undefined' && blacket.user) {
            clearInterval(waitForBlacket);
            initTradeHistory();
        }
    }, 100);

    function initTradeHistory() {
        const style = document.createElement('style');
        style.textContent = `
            .tradeHistoryNotification {
                position: absolute;
                width: 1.302vw;
                height: 1.302vw;
                background-color: #4e9fff;
                border-radius: 50%;
                box-shadow: inset 0 -0.156vw rgba(0, 0, 0, 0.2);
                text-align: center;
                font-family: Titan One;
                text-shadow: 0.000vw 0.000vw 0.260vw black;
                font-size: 0.781vw;
                display: flex;
                justify-content: center;
                color: white;
                left: -0.5vw;
                bottom: -0.5vw;
            }
            .tradeHistoryContainer {
                width: 100%;
                height: 30vw;
                display: flex;
                flex-direction: column;
                overflow: auto;
                overflow-x: hidden;
                margin-bottom: 0.5vw;
            }
            .tradeHistoryEntryWrapper {
                position: relative;
                margin: 0.5vw;
            }
            .tradeHistoryEntry {
                padding: 0.8vw;
                background: rgba(0, 0, 0, 0.3);
                border-radius: 0.8vw;
                display: flex;
                flex-direction: row;
                gap: 0.8vw;
                padding-bottom: 1.2vw;
                padding-right: 1vw;
                cursor: pointer;
                box-shadow: inset 0 -0.3vw rgba(0, 0, 0, 0.2);
            }
            .tradeHistoryEntry:hover {
                background: rgba(0, 0, 0, 0.5);
            }
            .tradeHistoryLeftSide {
                display: flex;
                justify-content: center;
                align-items: center;
            }
            .tradeHistoryIcon {
                width: 5vw;
                height: 5vw;
                object-fit: cover;
            }
            .tradeHistoryRightSide {
                position: relative;
                display: flex;
                justify-content: left;
                align-items: flex-start;
                flex-direction: column;
                color: white;
                width: 100%;
            }
            .tradeHistoryUsername {
                font-size: 1.3vw;
                font-weight: bold;
            }
            .tradeHistoryDetails {
                text-align: left;
                word-wrap: break-word;
                margin-top: 0.3vw;
                font-size: 0.9vw;
                line-height: 1.4;
            }
            .tradeHistoryDate {
                position: absolute;
                bottom: -0.8vw;
                right: 0;
                font-size: 0.75vw;
                opacity: 0.7;

            //under here is like stuff im keeping for the next update im releasing
            }
            .tradeHistoryBlookIcon {
                width: 1.8vw;
                height: 1.8vw;
                object-fit: contain;
                display: inline-block;
                vertical-align: middle;
            }
            .tradeHistoryTokenIcon {
                width: 1.3vw;
                height: 1.3vw;
                object-fit: contain;
                display: inline-block;
                vertical-align: middle;
                margin-bottom: 0.15vw;
            }
            .tradeHistoryTokenText {
                color: #ffd700;
                font-weight: bold;
                font-size: 0.85vw;
                display: inline-block;
                vertical-align: middle;
            }
            .tradeHistoryActionButtons {
                position: absolute;
                top: 0.3vw;
                right: 0.3vw;
                display: flex;
                gap: 0.2vw;
                align-items: center;
            }
            .tradeHistoryActionBtn {
                width: 1vw;
                height: 1vw;
                cursor: pointer;
                z-index: 15;
                position: relative;
            }
            .tradeHistoryActionBtn .styles__shadow___3GMdH-camelCase {
                filter: blur(0.052vw);
                opacity: 0.5;
                position: absolute;
                width: 100%;
                height: 100%;
                border-radius: 0.15vw;
                background-color: rgba(0, 0, 0, 0.5);
                transition: all 0.1s ease;
            }
            .tradeHistoryActionBtn .styles__edge___3eWfq-camelCase {
                position: absolute;
                width: 100%;
                height: 100%;
                border-radius: 0.15vw;
                box-shadow: inset 0 -0.08vw rgba(0, 0, 0, 0.2);
                transition: all 0.1s ease;
            }
            .tradeHistoryActionBtn .styles__front___vcvuy-camelCase {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100%;
                height: 100%;
                border-radius: 0.15vw;
                font-size: 0.5vw;
                color: white;
                position: relative;
                top: -0.08vw;
                transition: all 0.1s ease;
            }
            .tradeHistoryActionBtn:hover .styles__front___vcvuy-camelCase {
                top: -0.12vw;
            }
            .tradeHistoryActionBtn:active .styles__front___vcvuy-camelCase {
                top: 0;
            }
            .tradeHistoryDeleteBtn .styles__shadow___3GMdH-camelCase {
                background-color: rgba(0, 0, 0, 0.5);
            }
            .tradeHistoryDeleteBtn .styles__edge___3eWfq-camelCase {
                background-color: #c92a2a;
            }
            .tradeHistoryDeleteBtn .styles__front___vcvuy-camelCase {
                background-color: #ff4e4e;
            }
            .tradeHistoryEditBtn .styles__shadow___3GMdH-camelCase {
                background-color: rgba(0, 0, 0, 0.5);
            }
            .tradeHistoryEditBtn .styles__edge___3eWfq-camelCase {
                background-color: #1971c2;
            }
            .tradeHistoryEditBtn .styles__front___vcvuy-camelCase {
                background-color: #4e9fff;
            }
            .tradeHistoryMoveBtn .styles__shadow___3GMdH-camelCase {
                background-color: rgba(0, 0, 0, 0.5);
            }
            .tradeHistoryMoveBtn .styles__edge___3eWfq-camelCase {
                background-color: #2b8a3e;
            }
            .tradeHistoryMoveBtn .styles__front___vcvuy-camelCase {
                background-color: #51cf66;
            }
            #tradeHistoryButton {
                margin-right: 0.5vw;
            }
        `;
        document.head.appendChild(style);

        const tradeHistoryButton = document.createElement('div');
        tradeHistoryButton.id = 'tradeHistoryButton';
        tradeHistoryButton.style.marginBottom = '0.182vw';
        tradeHistoryButton.className = 'styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase';
        tradeHistoryButton.innerHTML = `
            <div class="styles__shadow___3GMdH-camelCase"></div>
            <div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div>
            <div class="styles__front___vcvuy-camelCase styles__buttonInsideNoMinWidth___39vdp-camelCase" style="background-color: var(--primary);">
                <i class="fas fa-history" aria-hidden="true"></i>
            </div>
        `;

        const addButton = setInterval(() => {
            const inboxButton = document.getElementById('inboxButton');
            if (inboxButton) {
                clearInterval(addButton);
                inboxButton.parentNode.insertBefore(tradeHistoryButton, inboxButton.nextSibling);

                tradeHistoryButton.addEventListener('click', openTradeHistory);
            }
        }, 100);

        hookTradeCompletion();
    }

    function getTradeHistory() {
        const history = localStorage.getItem('blacket_trade_history');
        return history ? JSON.parse(history) : [];
    }

    function saveTradeToHistory(tradeData) {
        const history = getTradeHistory();
        history.unshift(tradeData);

        if (history.length > 50) {
            history.length = 50;
        }

        localStorage.setItem('blacket_trade_history', JSON.stringify(history));
    }

    function deleteTradeFromHistory(timestamp) {
        let history = getTradeHistory();
        history = history.filter(trade => trade.timestamp !== timestamp);
        localStorage.setItem('blacket_trade_history', JSON.stringify(history));
    }

    function clearAllTrades() {
        localStorage.setItem('blacket_trade_history', JSON.stringify([]));
    }

    function openTradeHistory() {
        const history = getTradeHistory();

        const modal = document.createElement('div');
        modal.id = 'tradeHistoryModal';
        modal.className = 'arts__modal___VpEAD-camelCase';
        modal.innerHTML = `
            <div class="styles__container___1BPm9-camelCase" style="width: 50vw; box-shadow: inset 0 -0.521vw rgba(0, 0, 0, 0.2); position: relative;">
                <div class="styles__text___KSL4--camelCase" style="text-align: left; font-size: 2vw; font-family: Titan One, sans-serif; font-weight: normal; margin-top: 0.2vw;">
                    Trade History
                </div>
                <div class="tradeHistoryClearAllBtn" id="clearAllTradesBtn">
                    <i class="fas fa-trash-alt"></i>
                    <span>Clear All</span>
                </div>
                <div class="styles__holder___3CEfN-camelCase">
                    <div class="tradeHistoryContainer">
                        ${history.length === 0 ? '<div style="color: white; text-align: center; padding: 2vw;">No trades yet!</div>' :
                          history.map(trade => createTradeEntry(trade)).join('')}
                    </div>
                </div>
            </div>
        `;

        document.body.appendChild(modal);

        const clearAllBtn = document.getElementById('clearAllTradesBtn');
        if (clearAllBtn) {
            clearAllBtn.addEventListener('click', (e) => {
                e.stopPropagation();
                if (confirm('Are you sure you want to clear all trade history? This cannot be undone.')) {
                    clearAllTrades();
                    modal.remove();
                    openTradeHistory();
                }
            });
        }

        modal.addEventListener('click', (e) => {
            if (e.target === modal) {
                modal.remove();
            }
        });
    }

    function createTradeEntry(trade) {
        const date = new Date(trade.timestamp);
        const formattedDate = date.toLocaleString();

        let yourItemsText = '';
        if (trade.yourItems && trade.yourItems.length > 0) {
            const items = trade.yourItems.map(item => `x${item.quantity} ${item.name}`);
            yourItemsText = items.join(', ');
        } else {
            yourItemsText = 'No blooks';
        }

        const yourTokensText = (trade.yourTokens && trade.yourTokens > 0) ? `${trade.yourTokens.toLocaleString()} tokens` : '0 tokens';

        let theirItemsText = '';
        if (trade.theirItems && trade.theirItems.length > 0) {
            const items = trade.theirItems.map(item => `x${item.quantity} ${item.name}`);
            theirItemsText = items.join(', ');
        } else {
            theirItemsText = 'No blooks';
        }

        const theirTokensText = (trade.theirTokens && trade.theirTokens > 0) ? `${trade.theirTokens.toLocaleString()} tokens` : '0 tokens';

        return `
            <div class="tradeHistoryEntryWrapper">
                <div class="tradeHistoryEntry">
                    <div class="tradeHistoryLeftSide">
                        <img class="tradeHistoryIcon" src="${trade.otherUser.avatar}" alt="${trade.otherUser.username}">
                    </div>
                    <div class="tradeHistoryRightSide">
                        <div class="tradeHistoryUsername">${trade.otherUser.username}</div>
                        <div class="tradeHistoryDetails">
                            <span style="font-size: 0.8vw; opacity: 0.8;">You gave: </span>${yourItemsText}, ${yourTokensText}
                            <br>
                            <span style="font-size: 0.8vw; opacity: 0.8;">You received: </span>${theirItemsText}, ${theirTokensText}
                        </div>
                        <div class="tradeHistoryDate">${formattedDate}</div>
                    </div>
                </div>
            </div>
        `;
    }

    function hookTradeCompletion() {
        const checkForSocket = setInterval(() => {
            if (typeof blacket !== 'undefined' && blacket.socket && blacket.socket.on) {
                clearInterval(checkForSocket);

                const originalOn = blacket.socket.on.bind(blacket.socket);

                blacket.socket.on = function(event, callback) {
                    if (event === 'trading-ongoing-complete') {
                        const wrappedCallback = function(data) {
                            callback(data);

                            if (!data.error && data.data && data.data.rewards) {
                                setTimeout(() => captureTrade(data.data), 100);
                            }
                        };
                        return originalOn(event, wrappedCallback);
                    }
                    return originalOn(event, callback);
                };
            }
        }, 100);
    }

    function captureTrade(completionData) {
        try {
            if (typeof blacket === 'undefined' || !blacket.trade || !blacket.user) {
                ('Trade data not available');
                return;
            }

            const trade = blacket.trade;
            const currentUser = blacket.user;

            ('Current user ID:', currentUser.id);
            ('Trade users:', Object.keys(trade.users));
            ('Trade object:', trade);

            const otherUserId = Object.keys(trade.users).find(id => id !== currentUser.id);
            if (!otherUserId) {
                console.error('Could not find other user ID');
                return;
            }

            ('Other user ID:', otherUserId);

            const currentUserData = trade.users[currentUser.id];
            const otherUserData = trade.users[otherUserId];

            ('Current user data:', currentUserData);
            ('Other user data:', otherUserData);
            ('Completion data:', completionData);

            blacket.requests.get(`/worker2/user/${otherUserId}`, (userData) => {
                if (userData.error) {
                    console.error('Failed to fetch user data:', userData);
                    return;
                }

                ('Fetched user data:', userData);

                const yourItems = Object.keys(currentUserData.blooks || {}).map(itemName => ({
                    name: itemName,
                    quantity: currentUserData.blooks[itemName],
                    image: blacket.blooks[itemName]?.image || '/content/blooks/Default.webp'
                }));

                const theirItems = Object.keys(completionData.rewards.blooks || {}).map(itemName => ({
                    name: itemName,
                    quantity: completionData.rewards.blooks[itemName],
                    image: blacket.blooks[itemName]?.image || '/content/blooks/Default.webp'
                }));

                ('Your items:', yourItems);
                ('Their items:', theirItems);

                const tradeData = {
                    timestamp: Date.now(),
                    otherUser: {
                        username: userData.user.username,
                        avatar: userData.user.avatar,
                        id: otherUserId
                    },
                    yourItems: yourItems,
                    theirItems: theirItems,
                    yourTokens: currentUserData.tokens || 0,
                    theirTokens: completionData.rewards.tokens || 0
                };

                ('Final trade data to save:', tradeData);

                saveTradeToHistory(tradeData);

                if (blacket.createToast) {
                    blacket.createToast({
                        title: "Trade Saved",
                        message: "Trade with " + tradeData.otherUser.username + " has been saved to history!",
                        icon: "/content/blooks/Success.webp",
                        time: 3000
                    });
                }
            });
        } catch (error) {
            console.error('Error capturing trade:', error);
        }
    }
})();

    } catch (err) {}
  }
});
const index_custom12 = () => createPlugin({
  name: "Blacket Themer 2",
  description: "Blacket Themer [SUPER BUGGY ACTIVATE AT YOUR OWN RISK].",

  authors: [
    {
      name: "FRANXE",
      avatar: "https://avatars.githubusercontent.com/u/218293368",
      url: "https://github.com/franxetsx"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {
(function() {
    'use strict';

    if (!localStorage.getItem("bb_userscript_cleanup_done")) {
  localStorage.removeItem("blacket_themes");
  localStorage.setItem("bb_userscript_cleanup_done", "true");
}

    const ThemeStorage = {
        get: (key, parse = false) => {
            const value = localStorage.getItem(key);
            return parse && value ? JSON.parse(value) : value;
        },
        set: (key, value, stringify = false) => {
            localStorage.setItem(key, stringify ? JSON.stringify(value) : value);
        }
    };

    if (!ThemeStorage.get('blacket_themes')) {
        ThemeStorage.set('blacket_themes', {
            active: 'default',
            custom: {},
            particles: {
                enabled: true,
                color: '#ffffff',
                count: 50,
                speed: 1
            }
        }, true);
    }

    const themes = {
        default: {
            name: "Default",
            description: "Original",
            author: "Blacket",
            css: ``,
            js: ``
        },
        amoled: {
            name: "Amoled",
            description: "Pure black",
            author: "monkxy",
            css: `
                .styles__background___2J-JA-camelCase { background-color: #000 !important; }
                .styles__bazaarItem___Meg69-camelCase { background-color: #111111 !important; }
                .styles__sidebar___1XqWi-camelCase { background-color: #000 !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #000 !important; }
                .styles__container___1BPm9-camelCase, .styles__container___2VzTy-camelCase { background-color: #000 !important; }
                .styles__statsContainer___QnrRB-camelCase { background-color: #000 !important; }
                .styles__statContainer___QKuOF-camelCase { background-color: #111111 !important; }
                input, textarea { background-color: #000 !important; }
            `
        },
        neon: {
            name: "Neon Glow",
            description: "Cyberpunk vibes",
            author: "System",
            css: `
                * { transition: all 0.3s ease !important; }
                .styles__background___2J-JA-camelCase { background: linear-gradient(45deg, #0a0a0a, #1a0a2a) !important; }
                .styles__sidebar___1XqWi-camelCase { background-color: #1a1a1a !important; border-right: 2px solid #0ff !important; box-shadow: 0 0 20px #0ff !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #1a1a1a !important; border: 2px solid #f0f !important; box-shadow: 0 0 30px #f0f !important; }
                .styles__container___1BPm9-camelCase { background-color: #1a1a1a !important; border: 2px solid #0ff !important; }
                .styles__bazaarItem___Meg69-camelCase { background-color: #2a2a2a !important; border: 1px solid #0ff !important; }
                .styles__bazaarItem___Meg69-camelCase:hover { box-shadow: 0 0 20px #0ff !important; transform: scale(1.05) !important; }
                * { text-shadow: 0 0 5px currentColor !important; }
            `,
            js: `
                setInterval(() => {
                    document.querySelectorAll('.styles__bazaarItem___Meg69-camelCase').forEach(item => {
                        if (Math.random() > 0.98) {
                            item.style.boxShadow = '0 0 30px #0ff';
                            setTimeout(() => item.style.boxShadow = '', 500);
                        }
                    });
                }, 100);
            `
        },
        matrix: {
            name: "Matrix",
            description: "Digital rain",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase { background-color: #000 !important; }
                * { color: #00ff00 !important; text-shadow: 0 0 10px #00ff00 !important; font-family: 'Courier New', monospace !important; }
                .styles__sidebar___1XqWi-camelCase { background-color: #001100 !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #001a00 !important; }
            `,
            js: `
                const canvas = document.createElement('canvas');
                canvas.style.position = 'fixed';
                canvas.style.top = '0';
                canvas.style.left = '0';
                canvas.style.width = '100%';
                canvas.style.height = '100%';
                canvas.style.pointerEvents = 'none';
                canvas.style.zIndex = '1';
                canvas.style.opacity = '0.3';
                document.body.appendChild(canvas);
                const ctx = canvas.getContext('2d');
                canvas.width = window.innerWidth;
                canvas.height = window.innerHeight;

                const matrix = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789@#$%^&*()*&^%+-/~{[|]}";
                const matrixArray = matrix.split("");
                const fontSize = 10;
                const columns = canvas.width/fontSize;
                const drops = [];
                for(let x = 0; x < columns; x++) drops[x] = 1;

                function draw() {
                    ctx.fillStyle = 'rgba(0, 0, 0, 0.04)';
                    ctx.fillRect(0, 0, canvas.width, canvas.height);
                    ctx.fillStyle = '#0f0';
                    ctx.font = fontSize + 'px monospace';

                    for(let i = 0; i < drops.length; i++) {
                        const text = matrixArray[Math.floor(Math.random()*matrixArray.length)];
                        ctx.fillText(text, i*fontSize, drops[i]*fontSize);
                        if(drops[i]*fontSize > canvas.height && Math.random() > 0.975) drops[i] = 0;
                        drops[i]++;
                    }
                }
                setInterval(draw, 35);
            `
        },
        galaxy: {
            name: "Galaxy",
            description: "Space theme",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #0a0a2a 0%, #1a0a3a 50%, #2a0a4a 100%) !important;
                    animation: galaxyShift 10s ease infinite !important;
                }
                @keyframes galaxyShift {
                    0%, 100% { filter: hue-rotate(0deg); }
                    50% { filter: hue-rotate(30deg); }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(15, 15, 58, 0.9) !important; backdrop-filter: blur(10px) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(26, 26, 74, 0.9) !important; backdrop-filter: blur(10px) !important; }
                .styles__bazaarItem___Meg69-camelCase { background: rgba(37, 37, 90, 0.9) !important; border: 1px solid #6a6aff !important; }
            `
        },
        sunset: {
            name: "Sunset",
            description: "Warm gradients",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #ff6b6b, #feca57, #ff9ff3) !important;
                    background-size: 300% 300% !important;
                    animation: gradientShift 15s ease infinite !important;
                }
                @keyframes gradientShift {
                    0% { background-position: 0% 50%; }
                    50% { background-position: 100% 50%; }
                    100% { background-position: 0% 50%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(45, 24, 16, 0.95) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(61, 36, 22, 0.95) !important; }
            `
        },
        ocean: {
            name: "Ocean Depths",
            description: "Deep sea",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #001429 0%, #002a52 50%, #00508a 100%) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(0, 42, 82, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(0, 61, 112, 0.9) !important; }
                .styles__bazaarItem___Meg69-camelCase { background: rgba(0, 77, 138, 0.9) !important; }
            `,
            js: `
                const style = document.createElement('style');
                style.textContent = '@keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }';
                document.head.appendChild(style);
                document.querySelectorAll('.styles__bazaarItem___Meg69-camelCase').forEach((item, i) => {
                    item.style.animation = 'wave 3s ease-in-out ' + (i * 0.1) + 's infinite';
                });
            `
        },
        volcano: {
            name: "Volcano",
            description: "Lava flow",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: radial-gradient(circle at bottom, #ff4500, #8b0000, #1a0800) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: linear-gradient(180deg, #2a0f00, #4a1c00) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(58, 21, 0, 0.95) !important; }
                .styles__bazaarItem___Meg69-camelCase {
                    background: linear-gradient(135deg, #4a1c00, #5a2200) !important;
                    border: 1px solid #ff4500 !important;
                }
            `
        },
        aurora: {
            name: "Aurora",
            description: "Northern lights",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #00ffb3, #00d4ff, #b300ff, #ff00d4) !important;
                    background-size: 400% 400% !important;
                    animation: aurora 20s ease infinite !important;
                }
                @keyframes aurora {
                    0%, 100% { background-position: 0% 50%; }
                    25% { background-position: 100% 0%; }
                    50% { background-position: 100% 100%; }
                    75% { background-position: 0% 100%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(0, 20, 40, 0.9) !important; backdrop-filter: blur(20px) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(0, 30, 60, 0.9) !important; backdrop-filter: blur(20px) !important; }
            `
        },
        retro: {
            name: "Retro Wave",
            description: "80s aesthetic",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #1a0033, #330066, #660099) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: #220044 !important;
                    border-right: 3px solid #ff00ff !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: #330055 !important;
                    border: 2px solid #00ffff !important;
                    box-shadow: 0 0 20px #ff00ff, inset 0 0 20px rgba(255, 0, 255, 0.2) !important;
                }
                * { font-family: 'Courier New', monospace !important; }
            `
        },
        glassmorphism: {
            name: "Glass",
            description: "Transparent blur",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: rgba(255, 255, 255, 0.1) !important;
                    backdrop-filter: blur(20px) !important;
                    border: 1px solid rgba(255, 255, 255, 0.2) !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: rgba(255, 255, 255, 0.15) !important;
                    backdrop-filter: blur(20px) !important;
                    border: 1px solid rgba(255, 255, 255, 0.3) !important;
                }
                .styles__bazaarItem___Meg69-camelCase {
                    background: rgba(255, 255, 255, 0.1) !important;
                    backdrop-filter: blur(10px) !important;
                }
            `
        },
        midnight: {
            name: "Midnight",
            description: "Deep blue",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase { background-color: #0a0e27 !important; }
                .styles__sidebar___1XqWi-camelCase { background-color: #0f1535 !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #151b3d !important; }
                .styles__bazaarItem___Meg69-camelCase { background-color: #1a2142 !important; }
            `
        },
        forest: {
            name: "Forest",
            description: "Nature vibes",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #0d1f0d, #163316, #1a4a1a) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background-color: #163316 !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #1a4a1a !important; }
                .styles__bazaarItem___Meg69-camelCase { background-color: #206020 !important; }
            `
        },
        candy: {
            name: "Candy",
            description: "Sweet colors",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #ff6ec7, #ffb347, #ff6ec7) !important;
                    background-size: 200% 200% !important;
                    animation: candySwirl 10s ease infinite !important;
                }
                @keyframes candySwirl {
                    0%, 100% { background-position: 0% 50%; }
                    50% { background-position: 100% 50%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(255, 182, 193, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(255, 218, 185, 0.9) !important; }
            `
        },
        royal: {
            name: "Royal Purple",
            description: "Majestic",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: radial-gradient(circle, #4a0080, #1a0033) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: linear-gradient(180deg, #2a1535, #3a1f4a) !important; }
                .styles__infoContainer___2uI-S-camelCase { background-color: #3a1f4a !important; }
                .styles__bazaarItem___Meg69-camelCase { background-color: #4a2a5f !important; border: 1px solid gold !important; }
            `
        },
        ice: {
            name: "Ice Crystal",
            description: "Frozen",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #e6f2ff, #cce7ff, #99d1ff) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: rgba(204, 231, 255, 0.95) !important;
                    box-shadow: inset 0 0 20px rgba(0, 100, 200, 0.2) !important;
                }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(179, 220, 255, 0.95) !important; }
                * { color: #003366 !important; }
            `
        },
        sakura: {
            name: "Sakura",
            description: "Cherry blossom",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #ffc0cb, #ffb6c1, #ff69b4) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(255, 182, 193, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(255, 192, 203, 0.9) !important; }
                .styles__bazaarItem___Meg69-camelCase {
                    background: rgba(255, 255, 255, 0.8) !important;
                    border: 2px solid #ff69b4 !important;
                }
            `
        },
        cosmic: {
            name: "Cosmic",
            description: "Universe",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: radial-gradient(ellipse at center, #0f0c29, #302b63, #24243e) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(48, 43, 99, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(36, 36, 62, 0.9) !important; }
                * { text-shadow: 0 0 3px rgba(255, 255, 255, 0.5) !important; }
            `
        },
        toxic: {
            name: "Toxic",
            description: "Radioactive",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #00ff00, #00aa00, #005500) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: #001a00 !important;
                    border-right: 2px solid #00ff00 !important;
                    box-shadow: 0 0 20px #00ff00 !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: #002200 !important;
                    border: 1px solid #00ff00 !important;
                }
                * { text-shadow: 0 0 5px #00ff00 !important; }
            `
        },
        desert: {
            name: "Desert",
            description: "Sandy dunes",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #edc9af, #daa520, #cd853f) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(205, 133, 63, 0.95) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(218, 165, 32, 0.95) !important; }
                * { color: #4a2c17 !important; }
            `
        },
        cyberpunk: {
            name: "Cyberpunk 2077",
            description: "Future dystopia",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #0a0a0a, #1a0033, #330066) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: #1a1a1a !important;
                    border-right: 3px solid #ffff00 !important;
                    box-shadow: 0 0 30px #ff00ff !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: rgba(26, 0, 51, 0.95) !important;
                    border: 2px solid #00ffff !important;
                    box-shadow: 0 0 20px #00ffff, inset 0 0 20px rgba(0, 255, 255, 0.1) !important;
                }
                .styles__bazaarItem___Meg69-camelCase:hover {
                    background: #330066 !important;
                    box-shadow: 0 0 30px #ffff00 !important;
                    transform: scale(1.1) rotateZ(2deg) !important;
                }
            `,
            js: `
                setInterval(() => {
                    const glitch = Math.random() > 0.95;
                    if (glitch) {
                        document.body.style.filter = 'hue-rotate(' + Math.random() * 360 + 'deg)';
                        setTimeout(() => document.body.style.filter = '', 100);
                    }
                }, 100);
            `
        },
        vaporwave: {
            name: "Vaporwave",
            description: "A E S T H E T I C",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #ff71ce, #b967ff, #01cdfe, #05ffa1) !important;
                    background-size: 400% 400% !important;
                    animation: vaporGradient 15s ease infinite !important;
                }
                @keyframes vaporGradient {
                    0%, 100% { background-position: 50% 0%; }
                    50% { background-position: 50% 100%; }
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: rgba(185, 103, 255, 0.3) !important;
                    backdrop-filter: blur(10px) !important;
                }
                * { font-family: 'Comic Sans MS', cursive !important; }
            `
        },
        steampunk: {
            name: "Steampunk",
            description: "Victorian tech",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #3d2817, #5c3d28, #8b6239) !important;
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: linear-gradient(180deg, #4a3121, #5c3d28) !important;
                    border-right: 3px solid #d4af37 !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: #5c3d28 !important;
                    border: 2px solid #d4af37 !important;
                    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.3) !important;
                }
                .styles__bazaarItem___Meg69-camelCase {
                    background: #6b4423 !important;
                    border: 1px solid #cd7f32 !important;
                }
            `
        },
        pastel: {
            name: "Pastel Dreams",
            description: "Soft colors",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #ffd3e1, #c9f0ff, #fff9c9, #d4f1d4) !important;
                    background-size: 300% 300% !important;
                    animation: pastelFlow 20s ease infinite !important;
                }
                @keyframes pastelFlow {
                    0%, 100% { background-position: 0% 50%; }
                    50% { background-position: 100% 50%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(255, 255, 255, 0.8) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(255, 255, 255, 0.85) !important; }
                * { color: #666 !important; }
            `
        },
        lava: {
            name: "Lava Lamp",
            description: "Flowing magma",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: radial-gradient(circle at 20% 80%, #ff0000, #ff4500, #ff8c00, #ff0000) !important;
                    background-size: 200% 200% !important;
                    animation: lavaFlow 10s ease infinite !important;
                }
                @keyframes lavaFlow {
                    0%, 100% { background-position: 0% 0%; }
                    50% { background-position: 100% 100%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(139, 0, 0, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(178, 34, 34, 0.9) !important; }
            `
        },
        autumn: {
            name: "Autumn",
            description: "Fall colors",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #ff8c42, #ff6b35, #ff4e20, #8b2500) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(139, 69, 19, 0.95) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(160, 82, 45, 0.95) !important; }
                .styles__bazaarItem___Meg69-camelCase { background: rgba(205, 133, 63, 0.95) !important; }
            `
        },
        winter: {
            name: "Winter",
            description: "Snow white",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #ffffff, #e6f3ff, #cce7ff) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(230, 243, 255, 0.95) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(204, 231, 255, 0.95) !important; }
                * { color: #1a3d5c !important; }
            `
        },
        spring: {
            name: "Spring",
            description: "Fresh bloom",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(135deg, #90ee90, #98fb98, #ffb6c1) !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(152, 251, 152, 0.9) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(255, 182, 193, 0.9) !important; }
            `
        },
        noir: {
            name: "Film Noir",
            description: "Black & white",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(180deg, #000, #222, #000) !important;
                }
                * { filter: grayscale(100%) contrast(1.2) !important; }
                .styles__sidebar___1XqWi-camelCase { background: #111 !important; }
                .styles__infoContainer___2uI-S-camelCase { background: #1a1a1a !important; }
            `
        },
        rainbow: {
            name: "Rainbow",
            description: "All colors",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) !important;
                    background-size: 400% 400% !important;
                    animation: rainbow 10s linear infinite !important;
                }
                @keyframes rainbow {
                    0%, 100% { background-position: 0% 50%; }
                    50% { background-position: 100% 50%; }
                }
                .styles__sidebar___1XqWi-camelCase { background: rgba(255, 255, 255, 0.2) !important; backdrop-filter: blur(10px) !important; }
                .styles__infoContainer___2uI-S-camelCase { background: rgba(255, 255, 255, 0.3) !important; backdrop-filter: blur(10px) !important; }
            `
        },
        terminal: {
            name: "Terminal",
            description: "Command line",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase { background: #000 !important; }
                * {
                    color: #0f0 !important;
                    font-family: 'Consolas', 'Courier New', monospace !important;
                    text-shadow: 0 0 2px #0f0 !important;
                }
                .styles__sidebar___1XqWi-camelCase { background: #000 !important; border-right: 1px solid #0f0 !important; }
                .styles__infoContainer___2uI-S-camelCase { background: #000 !important; border: 1px solid #0f0 !important; }
                .styles__bazaarItem___Meg69-camelCase { background: #000 !important; border: 1px solid #0f0 !important; }
            `,
            js: `
                document.querySelectorAll('*').forEach(el => {
                    if (el.textContent && !el.children.length) {
                        el.textContent = '> ' + el.textContent;
                    }
                });
            `
        },
        holographic: {
            name: "Holographic",
            description: "Iridescent",
            author: "System",
            css: `
                .styles__background___2J-JA-camelCase {
                    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff) !important;
                    background-size: 200% 200% !important;
                    animation: holoShift 3s linear infinite !important;
                }
                @keyframes holoShift {
                    0% { background-position: 0% 0%; }
                    100% { background-position: 100% 100%; }
                }
                .styles__sidebar___1XqWi-camelCase {
                    background: rgba(255, 255, 255, 0.3) !important;
                    backdrop-filter: blur(20px) !important;
                    border: 1px solid rgba(255, 255, 255, 0.5) !important;
                }
                .styles__infoContainer___2uI-S-camelCase {
                    background: rgba(255, 255, 255, 0.2) !important;
                    backdrop-filter: blur(20px) !important;
                }
                * { text-shadow: 0 0 10px currentColor !important; }
            `
        }
    };

    const themeData = ThemeStorage.get('blacket_themes', true);
    if (themeData.custom) {
        Object.assign(themes, themeData.custom);
    }

    let currentThemeStyle = null;
    let currentThemeScript = null;

    function applyTheme(themeKey) {
        const theme = themes[themeKey];
        if (!theme) return;

        if (currentThemeStyle) currentThemeStyle.remove();
        if (currentThemeScript) {
            window.themeCleanup && window.themeCleanup();
            delete window.themeCleanup;
        }

        if (theme.css) {
            currentThemeStyle = document.createElement('style');
            currentThemeStyle.id = 'blacket-theme-active';
            currentThemeStyle.textContent = theme.css;
            document.head.appendChild(currentThemeStyle);
        }

        if (theme.js) {
            try {
                const func = new Function(theme.js);
                func();
                window.themeCleanup = () => {
                    const canvases = document.querySelectorAll('canvas:not(#particles)');
                    canvases.forEach(c => c.remove());
                };
            } catch (e) {
                console.error('Theme JS error:', e);
            }
        }

        const data = ThemeStorage.get('blacket_themes', true);
        data.active = themeKey;
        ThemeStorage.set('blacket_themes', data, true);
    }

    function initParticles(config) {
        const canvas = document.querySelector('#particles');
        if (!canvas) return;

        const ctx = canvas.getContext('2d');
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;

        const particles = [];
        for (let i = 0; i < config.count; i++) {
            particles.push({
                x: Math.random() * canvas.width,
                y: Math.random() * canvas.height,
                vx: (Math.random() - 0.5) * config.speed,
                vy: (Math.random() - 0.5) * config.speed,
                size: Math.random() * 3 + 1
            });
        }

        function animate() {
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            ctx.fillStyle = config.color;

            particles.forEach(p => {
                p.x += p.vx;
                p.y += p.vy;

                if (p.x < 0 || p.x > canvas.width) p.vx *= -1;
                if (p.y < 0 || p.y > canvas.height) p.vy *= -1;

                ctx.beginPath();
                ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
                ctx.fill();
            });

            if (config.enabled) requestAnimationFrame(animate);
        }

        if (config.enabled) animate();
    }

    const style = document.createElement('style');
    style.textContent = `
        .theme-search {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: 2px solid var(--primary, #4a4a4a);
            background: var(--secondary, #2a2a2a);
            color: white;
            font-size: 1em;
            margin-bottom: 15px;
        }

        .theme-sort {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .sort-btn {
            padding: 8px 15px;
            background: var(--secondary, #2a2a2a);
            color: white;
            border: 2px solid var(--primary, #4a4a4a);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9em;
        }

        .sort-btn.active {
            background: var(--accent, #6a6aff);
            border-color: var(--accent, #6a6aff);
        }

        .sort-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }

        .theme-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 12px;
            padding: 10px 5px;
            width: 100%;
            max-height: 400px;
            overflow-y: auto;
        }

        .theme-card {
            background: var(--secondary, #2a2a2a);
            border: 2px solid var(--primary, #4a4a4a);
            border-radius: 10px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            text-align: center;
            height: 110px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .theme-card:hover {
            border-color: var(--accent, #6a6aff);
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.4);
        }

        .theme-card.active {
            border-color: #4CAF50;
            box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
            background: linear-gradient(135deg, var(--secondary, #2a2a2a), rgba(76, 175, 80, 0.2));
        }

        .theme-card.active::before {
            content: "✓";
            position: absolute;
            top: 8px;
            right: 8px;
            background: #4CAF50;
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
        }

        .theme-title {
            font-size: 1em;
            font-weight: 600;
            color: white;
            margin-bottom: 4px;
        }

        .theme-desc {
            color: #ccc;
            font-size: 0.8em;
            margin-bottom: 2px;
        }

        .theme-author {
            color: #999;
            font-size: 0.7em;
        }

        .theme-delete {
            position: absolute;
            top: 8px;
            left: 8px;
            background: #e74c3c;
            color: white;
            border: none;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .theme-card:hover .theme-delete {
            opacity: 1;
        }

        .theme-input {
            width: 100%;
            padding: 10px;
            border-radius: 6px;
            border: 2px solid var(--primary, #4a4a4a);
            background: var(--secondary, #2a2a2a);
            color: white;
            font-size: 0.95em;
            margin-bottom: 10px;
        }

        .theme-textarea {
            width: 100%;
            min-height: 120px;
            padding: 10px;
            border-radius: 6px;
            border: 2px solid var(--primary, #4a4a4a);
            background: var(--secondary, #2a2a2a);
            color: white;
            font-family: 'Consolas', monospace;
            font-size: 0.9em;
            resize: vertical;
        }

        .theme-btn {
            padding: 10px 20px;
            background: var(--accent, #6a6aff);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .theme-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }

        .section-box {
            background: var(--secondary, #2a2a2a);
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            border: 2px solid var(--primary, #4a4a4a);
        }

        .tabs-container {
            display: flex;
            gap: 5px;
            justify-content: center;
            margin-bottom: 20px;
            background: var(--secondary, #2a2a2a);
            border-radius: 10px;
            padding: 5px;
        }

        .tab-btn {
            flex: 1;
            padding: 10px 15px;
            background: transparent;
            color: #999;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s;
        }

        .tab-btn.active {
            background: var(--accent, #6a6aff);
            color: white;
            transform: scale(1.05);
        }

        .tab-btn:hover:not(.active) {
            background: rgba(255,255,255,0.1);
            color: white;
        }

        .custom-controls {
            display: grid;
            gap: 15px;
        }

        .control-group {
            background: rgba(0,0,0,0.2);
            padding: 15px;
            border-radius: 8px;
        }

        .control-group h4 {
            color: white;
            margin-bottom: 10px;
            font-size: 1em;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .slider-control {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 10px;
        }

        .slider-control label {
            color: #ccc;
            font-size: 0.9em;
            min-width: 100px;
        }

        .slider-control input[type="range"] {
            flex: 1;
        }

        .slider-control input[type="color"] {
            width: 60px;
            height: 35px;
            border: 2px solid var(--primary, #4a4a4a);
            border-radius: 6px;
            cursor: pointer;
        }

        .slider-value {
            color: white;
            font-weight: bold;
            min-width: 40px;
            text-align: center;
        }

        .toggle-switch {
            position: relative;
            width: 50px;
            height: 24px;
            background: #333;
            border-radius: 12px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .toggle-switch.active {
            background: #4CAF50;
        }

        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s;
        }

        .toggle-switch.active::after {
            transform: translateX(26px);
        }

        .effects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .effect-option {
            padding: 8px;
            background: rgba(255,255,255,0.1);
            border: 2px solid transparent;
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            color: #ccc;
            transition: all 0.2s;
        }

        .effect-option.active {
            border-color: var(--accent, #6a6aff);
            background: rgba(106, 106, 255, 0.2);
            color: white;
        }

        .effect-option:hover {
            border-color: var(--accent, #6a6aff);
            color: white;
        }

        .gradient-preview {
            width: 100%;
            height: 60px;
            border-radius: 8px;
            margin-top: 10px;
            border: 2px solid var(--primary, #4a4a4a);
        }
    `;
    document.head.appendChild(style);

    let themeButton = null;
    let currentSort = 'name';
    let searchTerm = '';

    function createThemesPage(tab = 'browse') {
        if (window.location.pathname !== '/themes') return;

        const app = document.querySelector('#app');
        if (!app) return;

        const themeData = ThemeStorage.get('blacket_themes', true);

        let pageHTML = `
            <div>
                <div><div class="styles__topRightRow___dQvxc-camelCase"></div></div>
                <div class="styles__background___2J-JA-camelCase">
                    <canvas id="particles" style="position: fixed; width: 100%; height: 100%; pointer-events: none; opacity: 0.5;"></canvas>
                    <div class="styles__blooksBackground___3oQ7Y-camelCase" style="background-image: url('/content/background.webp');"></div>
                </div>
                <div class="arts__profileBody___eNPbH-camelCase">
                    <div class="styles__header___WE435-camelCase">Theme Manager</div>
                    <div class="styles__mainContainer___4TLvi-camelCase" style="max-width: 1200px; width: 95%;">
                        <div class="tabs-container">
                            <button class="tab-btn ${tab === 'browse' ? 'active' : ''}" data-tab="browse">
                                <i class="fas fa-th"></i> Browse
                            </button>
                            <button class="tab-btn ${tab === 'custom' ? 'active' : ''}" data-tab="custom">
                                <i class="fas fa-palette"></i> Create
                            </button>
                            <button class="tab-btn ${tab === 'particles' ? 'active' : ''}" data-tab="particles">
                                <i class="fas fa-sparkles"></i> Effects
                            </button>
                        </div>`;

        if (tab === 'browse') {
            const sortedThemes = sortThemes(filterThemes(Object.entries(themes), searchTerm), currentSort);

            pageHTML += `
                <div class="styles__infoContainer___2uI-S-camelCase" style="width: 100%;">
                    <input type="text" class="theme-search" placeholder="Search themes..." id="theme-search" value="${searchTerm}">
                    <div class="theme-sort">
                        <button class="sort-btn ${currentSort === 'name' ? 'active' : ''}" data-sort="name">Name</button>
                        <button class="sort-btn ${currentSort === 'author' ? 'active' : ''}" data-sort="author">Author</button>
                        <button class="sort-btn ${currentSort === 'newest' ? 'active' : ''}" data-sort="newest">Newest</button>
                        <button class="sort-btn ${currentSort === 'custom' ? 'active' : ''}" data-sort="custom">Custom Only</button>
                    </div>
                    <div class="theme-grid">
                        ${sortedThemes.map(([key, theme]) => `
                            <div class="theme-card ${themeData.active === key ? 'active' : ''}" data-theme="${key}">
                                ${themeData.custom && themeData.custom[key] ?
                                    `<button class="theme-delete" data-theme="${key}">×</button>` : ''}
                                <div class="theme-title">${theme.name}</div>
                                <div class="theme-desc">${theme.description}</div>
                                <div class="theme-author">by ${theme.author}</div>
                            </div>
                        `).join('')}
                    </div>
                </div>`;
        } else if (tab === 'custom') {
            pageHTML += `
                <div class="styles__infoContainer___2uI-S-camelCase" style="width: 100%;">
                    <div class="custom-controls">
                        <div class="control-group">
                            <h4>Theme Info</h4>
                            <input type="text" id="custom-name" class="theme-input" placeholder="Theme Name">
                            <input type="text" id="custom-desc" class="theme-input" placeholder="Description">
                        </div>

                        <div class="control-group">
                            <h4>Background</h4>
                            <div class="effects-grid">
                                <div class="effect-option" data-bg="solid">Solid</div>
                                <div class="effect-option" data-bg="gradient">Gradient</div>
                                <div class="effect-option" data-bg="animated">Animated</div>
                                <div class="effect-option" data-bg="image">Image</div>
                            </div>
                            <div id="bg-controls" style="margin-top: 15px;"></div>
                        </div>

                        <div class="control-group">
                            <h4>Effects</h4>
                            <div class="slider-control">
                                <label>Blur</label>
                                <input type="range" id="blur-amount" min="0" max="20" value="0">
                                <span class="slider-value">0px</span>
                            </div>
                            <div class="slider-control">
                                <label>Brightness</label>
                                <input type="range" id="brightness" min="50" max="150" value="100">
                                <span class="slider-value">100%</span>
                            </div>
                            <div class="slider-control">
                                <label>Contrast</label>
                                <input type="range" id="contrast" min="50" max="200" value="100">
                                <span class="slider-value">100%</span>
                            </div>
                        </div>

                        <div class="control-group">
                            <h4>Custom CSS</h4>
                            <textarea id="custom-css" class="theme-textarea" placeholder="/* Your custom CSS */"></textarea>
                        </div>

                        <div class="control-group">
                            <h4>Custom JavaScript</h4>
                            <textarea id="custom-js" class="theme-textarea" placeholder="// Your custom JavaScript (runs on theme load)"></textarea>
                        </div>

                        <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
                            <button id="test-theme" class="theme-btn">
                                <i class="fas fa-play"></i> Test Theme
                            </button>
                            <button id="save-theme" class="theme-btn" style="background: #2ecc71;">
                                <i class="fas fa-save"></i> Save Theme
                            </button>
                        </div>
                    </div>
                </div>`;
        } else if (tab === 'particles') {
            pageHTML += `
                <div class="styles__infoContainer___2uI-S-camelCase" style="width: 100%;">
                    <div class="custom-controls">
                        <div class="control-group">
                            <h4>Particle Settings</h4>
                            <div class="slider-control">
                                <label>Enabled</label>
                                <div class="toggle-switch ${themeData.particles?.enabled ? 'active' : ''}" id="particles-toggle"></div>
                            </div>
                            <div class="slider-control">
                                <label>Color</label>
                                <input type="color" id="particle-color" value="${themeData.particles?.color || '#ffffff'}">
                            </div>
                            <div class="slider-control">
                                <label>Count</label>
                                <input type="range" id="particle-count" min="10" max="200" value="${themeData.particles?.count || 50}">
                                <span class="slider-value">${themeData.particles?.count || 50}</span>
                            </div>
                            <div class="slider-control">
                                <label>Speed</label>
                                <input type="range" id="particle-speed" min="0.1" max="5" step="0.1" value="${themeData.particles?.speed || 1}">
                                <span class="slider-value">${themeData.particles?.speed || 1}</span>
                            </div>
                        </div>

                        <div class="control-group">
                            <h4>Animation Presets (particles only for now, each "effect" is a dif colered particle)</h4>
                            <div class="effects-grid">
                                <div class="effect-option" data-preset="snow">Snow</div>
                                <div class="effect-option" data-preset="stars">Stars</div>
                                <div class="effect-option" data-preset="bubbles"Bubbles</div>
                                <div class="effect-option" data-preset="fireflies">Fireflies</div>
                                <div class="effect-option" data-preset="matrix"Matrix</div>
                                <div class="effect-option" data-preset="hearts">Hearts</div>
                            </div>
                        </div>

                        <button id="apply-particles" class="theme-btn" style="width: 100%;">
                            <i class="fas fa-check"></i> Apply Effects
                        </button>
                    </div>
                </div>`;
        }

        pageHTML += `</div></div></div>`;
        app.innerHTML = pageHTML;

        setTimeout(() => {
            setupEventListeners(tab);
            if (tab === 'particles' && themeData.particles?.enabled) {
                initParticles(themeData.particles);
            }
        }, 100);
    }

    function filterThemes(themeEntries, search) {
        if (!search) return themeEntries;
        search = search.toLowerCase();
        return themeEntries.filter(([key, theme]) =>
            theme.name.toLowerCase().includes(search) ||
            theme.description.toLowerCase().includes(search) ||
            theme.author.toLowerCase().includes(search)
        );
    }

    function sortThemes(themeEntries, sortType) {
        switch(sortType) {
            case 'name':
                return themeEntries.sort((a, b) => a[1].name.localeCompare(b[1].name));
            case 'author':
                return themeEntries.sort((a, b) => a[1].author.localeCompare(b[1].author));
            case 'newest':
                return themeEntries.reverse();
            case 'custom':
                const data = ThemeStorage.get('blacket_themes', true);
                return themeEntries.filter(([key]) => data.custom && data.custom[key]);
            default:
                return themeEntries;
        }
    }

    function setupEventListeners(currentTab) {
        document.querySelectorAll('.tab-btn').forEach(btn => {
            btn.addEventListener('click', (e) => {
                const newTab = e.currentTarget.getAttribute('data-tab');
                createThemesPage(newTab);
            });
        });

        if (currentTab === 'browse') {
            const searchInput = document.querySelector('#theme-search');
            if (searchInput) {
                searchInput.addEventListener('input', (e) => {
                    searchTerm = e.target.value;
                    createThemesPage('browse');
                });
            }

            document.querySelectorAll('.sort-btn').forEach(btn => {
                btn.addEventListener('click', (e) => {
                    currentSort = e.currentTarget.getAttribute('data-sort');
                    createThemesPage('browse');
                });
            });

            document.querySelectorAll('.theme-card').forEach(card => {
                card.addEventListener('click', (e) => {
                    if (!e.target.classList.contains('theme-delete')) {
                        const themeKey = card.getAttribute('data-theme');
                        applyTheme(themeKey);
                        showToast(`${themes[themeKey].name} applied!`);
                        setTimeout(() => createThemesPage('browse'), 100);
                    }
                });
            });

            document.querySelectorAll('.theme-delete').forEach(btn => {
                btn.addEventListener('click', (e) => {
                    e.stopPropagation();
                    const themeKey = btn.getAttribute('data-theme');
                    if (confirm(`Delete ${themes[themeKey].name}?`)) {
                        const data = ThemeStorage.get('blacket_themes', true);
                        delete data.custom[themeKey];
                        delete themes[themeKey];
                        if (data.active === themeKey) {
                            data.active = 'default';
                            applyTheme('default');
                        }
                        ThemeStorage.set('blacket_themes', data, true);
                        showToast('Theme deleted!');
                        createThemesPage('browse');
                    }
                });
            });
        } else if (currentTab === 'custom') {
            document.querySelectorAll('[data-bg]').forEach(option => {
                option.addEventListener('click', (e) => {
                    document.querySelectorAll('[data-bg]').forEach(o => o.classList.remove('active'));
                    e.target.classList.add('active');

                    const type = e.target.getAttribute('data-bg');
                    const controls = document.querySelector('#bg-controls');

                    switch(type) {
                        case 'solid':
                            controls.innerHTML = `
                                <div class="slider-control">
                                    <label>Background Color</label>
                                    <input type="color" id="bg-color" value="#1a1a1a">
                                </div>`;
                            break;
                        case 'gradient':
                            controls.innerHTML = `
                                <div class="slider-control">
                                    <label>Start Color</label>
                                    <input type="color" id="gradient-start" value="#0a0a2a">
                                </div>
                                <div class="slider-control">
                                    <label>End Color</label>
                                    <input type="color" id="gradient-end" value="#2a0a4a">
                                </div>
                                <div class="slider-control">
                                    <label>Angle</label>
                                    <input type="range" id="gradient-angle" min="0" max="360" value="45">
                                    <span class="slider-value">45°</span>
                                </div>
                                <div class="gradient-preview" id="gradient-preview"></div>`;
                            updateGradientPreview();
                            break;
                        case 'animated':
                            controls.innerHTML = `
                                <div class="slider-control">
                                    <label>Colors (comma-separated)</label>
                                    <input type="text" class="theme-input" id="animated-colors"
                                           value="#ff0000, #00ff00, #0000ff"
                                           placeholder="#color1, #color2, ...">
                                </div>
                                <div class="slider-control">
                                    <label>Duration</label>
                                    <input type="range" id="animation-duration" min="1" max="30" value="10">
                                    <span class="slider-value">10s</span>
                                </div>`;
                            break;
                        case 'image':
                            controls.innerHTML = `
                                <input type="text" class="theme-input" id="bg-image-url"
                                       placeholder="Image URL">
                                <div class="slider-control">
                                    <label>Opacity</label>
                                    <input type="range" id="bg-opacity" min="0" max="100" value="100">
                                    <span class="slider-value">100%</span>
                                </div>`;
                            break;
                    }

                    setupControlListeners();
                });
            });

            setupControlListeners();

            document.querySelector('#test-theme')?.addEventListener('click', () => {
                const css = generateCustomCSS();
                const js = document.querySelector('#custom-js')?.value || '';

                if (currentThemeStyle) currentThemeStyle.remove();
                currentThemeStyle = document.createElement('style');
                currentThemeStyle.textContent = css;
                document.head.appendChild(currentThemeStyle);

                if (js) {
                    try {
                        new Function(js)();
                    } catch (e) {
                        console.error('JS Error:', e);
                    }
                }

                showToast('Testing theme!');
            });

            document.querySelector('#save-theme')?.addEventListener('click', () => {
                const name = document.querySelector('#custom-name')?.value;
                const desc = document.querySelector('#custom-desc')?.value;

                if (!name) return showToast('Enter theme name!');

                const css = generateCustomCSS();
                const js = document.querySelector('#custom-js')?.value || '';

                const key = 'custom_' + name.replace(/\s/g, '_').toLowerCase();
                themes[key] = {
                    name: name,
                    description: desc || 'Custom theme',
                    author: 'You',
                    css: css,
                    js: js
                };

                const data = ThemeStorage.get('blacket_themes', true);
                if (!data.custom) data.custom = {};
                data.custom[key] = themes[key];
                ThemeStorage.set('blacket_themes', data, true);

                showToast('Theme saved!');
                createThemesPage('browse');
            });
        } else if (currentTab === 'particles') {
            document.querySelector('#particles-toggle')?.addEventListener('click', (e) => {
                e.target.classList.toggle('active');
            });

            document.querySelectorAll('[data-preset]').forEach(option => {
                option.addEventListener('click', (e) => {
                    const preset = e.target.getAttribute('data-preset');
                    applyParticlePreset(preset);
                });
            });

            document.querySelector('#apply-particles')?.addEventListener('click', () => {
                const data = ThemeStorage.get('blacket_themes', true);
                data.particles = {
                    enabled: document.querySelector('#particles-toggle').classList.contains('active'),
                    color: document.querySelector('#particle-color').value,
                    count: parseInt(document.querySelector('#particle-count').value),
                    speed: parseFloat(document.querySelector('#particle-speed').value)
                };
                ThemeStorage.set('blacket_themes', data, true);

                initParticles(data.particles);
                showToast('Particle effects updated!');
            });

            setupControlListeners();
        }
    }

    function setupControlListeners() {
        document.querySelectorAll('input[type="range"]').forEach(slider => {
            slider.addEventListener('input', (e) => {
                const valueSpan = e.target.parentElement.querySelector('.slider-value');
                if (valueSpan) {
                    let value = e.target.value;
                    if (e.target.id.includes('angle')) value += '°';
                    else if (e.target.id.includes('blur')) value += 'px';
                    else if (e.target.id.includes('duration')) value += 's';
                    else if (e.target.id.includes('brightness') ||
                             e.target.id.includes('contrast') ||
                             e.target.id.includes('opacity')) value += '%';
                    valueSpan.textContent = value;
                }

                if (e.target.id === 'gradient-angle') {
                    updateGradientPreview();
                }
            });
        });

        document.querySelectorAll('#gradient-start, #gradient-end').forEach(input => {
            input?.addEventListener('input', updateGradientPreview);
        });
    }

    function updateGradientPreview() {
        const preview = document.querySelector('#gradient-preview');
        if (!preview) return;

        const start = document.querySelector('#gradient-start')?.value || '#0a0a2a';
        const end = document.querySelector('#gradient-end')?.value || '#2a0a4a';
        const angle = document.querySelector('#gradient-angle')?.value || 45;

        preview.style.background = `linear-gradient(${angle}deg, ${start}, ${end})`;
    }

    function generateCustomCSS() {
        let css = '';

        const bgType = document.querySelector('[data-bg].active')?.getAttribute('data-bg');
        if (bgType === 'solid') {
            const color = document.querySelector('#bg-color')?.value || '#1a1a1a';
            css += `.styles__background___2J-JA-camelCase { background: ${color} !important; }\n`;
        } else if (bgType === 'gradient') {
            const start = document.querySelector('#gradient-start')?.value || '#0a0a2a';
            const end = document.querySelector('#gradient-end')?.value || '#2a0a4a';
            const angle = document.querySelector('#gradient-angle')?.value || 45;
            css += `.styles__background___2J-JA-camelCase {
                background: linear-gradient(${angle}deg, ${start}, ${end}) !important;
            }\n`;
        } else if (bgType === 'animated') {
            const colors = document.querySelector('#animated-colors')?.value || '#ff0000, #00ff00, #0000ff';
            const duration = document.querySelector('#animation-duration')?.value || 10;
            css += `.styles__background___2J-JA-camelCase {
                background: linear-gradient(45deg, ${colors}) !important;
                background-size: 400% 400% !important;
                animation: bgAnimation ${duration}s ease infinite !important;
            }
            @keyframes bgAnimation {
                0%, 100% { background-position: 0% 50%; }
                50% { background-position: 100% 50%; }
            }\n`;
        } else if (bgType === 'image') {
            const url = document.querySelector('#bg-image-url')?.value;
            const opacity = document.querySelector('#bg-opacity')?.value || 100;
            if (url) {
                css += `.styles__background___2J-JA-camelCase {
                    background: url('${url}') center/cover !important;
                    opacity: ${opacity / 100} !important;
                }\n`;
            }
        }

        const blur = document.querySelector('#blur-amount')?.value || 0;
        const brightness = document.querySelector('#brightness')?.value || 100;
        const contrast = document.querySelector('#contrast')?.value || 100;

        if (blur > 0 || brightness !== 100 || contrast !== 100) {
            css += `.styles__infoContainer___2uI-S-camelCase,
                    .styles__sidebar___1XqWi-camelCase {
                backdrop-filter: blur(${blur}px) brightness(${brightness}%) contrast(${contrast}%) !important;
            }\n`;
        }

        const customCSS = document.querySelector('#custom-css')?.value;
        if (customCSS) css += customCSS + '\n';

        return css;
    }

    function applyParticlePreset(preset) {
        const settings = {
            snow: { color: '#ffffff', count: 100, speed: 0.5 },
            stars: { color: '#ffff00', count: 50, speed: 0.2 },
            bubbles: { color: '#00bbff', count: 30, speed: 0.8 },
            fireflies: { color: '#ffff99', count: 25, speed: 0.3 },
            matrix: { color: '#00ff00', count: 150, speed: 2 },
            hearts: { color: '#ff69b4', count: 40, speed: 0.6 }
        };

        const s = settings[preset];
        if (s) {
            document.querySelector('#particle-color').value = s.color;
            document.querySelector('#particle-count').value = s.count;
            document.querySelector('#particle-speed').value = s.speed;
            document.querySelector('#particle-count').parentElement.querySelector('.slider-value').textContent = s.count;
            document.querySelector('#particle-speed').parentElement.querySelector('.slider-value').textContent = s.speed;
        }
    }

    function showToast(message) {
        if (typeof blacket !== 'undefined' && blacket.createToast) {
            blacket.createToast({
                title: 'Theme Manager',
                message: message,
                time: 2000
            });
        } else {
            ('[Themes] ' + message);
        }
    }

function addThemesButton() {
    const sidebar = document.querySelector('.styles__leftRow___4jCaB-camelCase');

    if (!sidebar) {
        ('Sidebar not found yet, retrying...');
        return false;
    }

    if (document.querySelector('#themes-button')) {
        ('Themes button already exists');
        return true;
    }

    const themeButton = document.createElement('a');
    themeButton.id = 'themes-button';
    themeButton.className = 'styles__pageButton___1wFuu-camelCase';
    themeButton.href = '/themes';

    const icon = document.createElement('i');
    icon.className = 'styles__pageIcon___3OSy9-camelCase fas fa-palette';
    icon.setAttribute('aria-hidden', 'true');

    const text = document.createElement('div');
    text.className = 'styles__pageText___1eo7q-camelCase';
    text.textContent = 'Themes';

    themeButton.appendChild(icon);
    themeButton.appendChild(text);

    const allButtons = sidebar.querySelectorAll('a.styles__pageButton___1wFuu-camelCase');

    let settingsButton = null;
    allButtons.forEach(btn => {
        const btnText = btn.querySelector('.styles__pageText___1eo7q-camelCase');
        if (btnText && btnText.textContent.trim() === 'Settings') {
            settingsButton = btn;
        }
    });

    if (settingsButton) {
        sidebar.insertBefore(themeButton, settingsButton);
        ('Themes button inserted before Settings');
    } else {
        const lastButton = allButtons[allButtons.length - 1];
        if (lastButton) {
            sidebar.insertBefore(themeButton, lastButton);
            ('Themes button inserted before last button');
        } else {
            sidebar.appendChild(themeButton);
            ('Themes button appended to sidebar');
        }
    }

    themeButton.addEventListener('click', (e) => {
        e.preventDefault();
        window.history.pushState({}, '', '/themes');
        createThemesPage('browse');
    });

    ('Themes button added successfully');
    return true;
}

function initThemesButton() {
    let attempts = 0;
    const maxAttempts = 50;

    const tryInsert = () => {
        attempts++;
        const success = addThemesButton();

        if (success) {
            ('Themes button successfully added after', attempts, 'attempts');
            return;
        }

        if (attempts < maxAttempts) {
            setTimeout(tryInsert, 100);
        } else {
            ('Failed to add themes button after', maxAttempts, 'attempts');
        }
    };

    tryInsert();
}

if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', initThemesButton);
} else {
    initThemesButton();
}

if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', addThemesButton);
} else {
    addThemesButton();
}
    let attempts = 0;
    const interval = setInterval(() => {
        attempts++;
        if (addThemesButton() || attempts >= 20) clearInterval(interval);
    }, 500);

    if (themeData && themeData.active && themeData.active !== 'default') {
        setTimeout(() => {
            applyTheme(themeData.active);
            (`[Themes] Applied ${themes[themeData.active]?.name}`);
        }, 1000);
    }

    if (themeData && themeData.particles?.enabled) {
        setTimeout(() => {
            const canvas = document.createElement('canvas');
            canvas.id = 'particles';
            canvas.style.position = 'fixed';
            canvas.style.top = '0';
            canvas.style.left = '0';
            canvas.style.width = '100%';
            canvas.style.height = '100%';
            canvas.style.pointerEvents = 'none';
            canvas.style.zIndex = '1';
            canvas.style.opacity = '0.5';
            document.body.appendChild(canvas);
            initParticles(themeData.particles);
        }, 1500);
    }

    if (window.location.pathname === '/themes') {
        setTimeout(() => createThemesPage('browse'), 1000);
    }

    window.addEventListener('popstate', () => {
        if (window.location.pathname === '/themes') {
            createThemesPage('browse');
        }
    });
})();
    } catch (err) {}
  }
});
const index_custom13 = () => createPlugin({
  name: "Chat on Clans",
  description: "disables the special chat page function when viewing your clan.",
  disabled: true,

  authors: [
    {
      name: "Death",
      avatar: "https://i.imgur.com/PrvNWub.png",
      url: "https://villainsrule.xyz"
    }
  ],

  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /includes\(["']\/clans\/my-clan["']\)\s*\)\s*\{/,
          replace: "false) {"
        },
        {
          match: /\s*&&\s*!location\.pathname\.toLowerCase\(\)\.includes\(["']\/clans\/my-clan["']\)/,
          replace: ""
        },
        {
          match: /if\s*\([^\)]*blacket\.user\.clan\.room[^\)]*\)\s*\{/,
          replace: ""
        }
      ]
    }
  ]
});
const index_custom14 = () => createPlugin({
  name: "NOtification Block",
  description: "stops all desktop notifications.",
  disabled: true,
  authors: [
    {
      name: "Death",
      avatar: "https://i.imgur.com/PrvNWub.png",
      url: "https://villainsrule.xyz"
    }
  ],
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /Notification\.permission == "granted"/,
          replace: "false"
        },
        {
          match: /Notification\.permission !== "granted" && Notification\.permission !== "denied"/,
          replace: "false"
        }
      ]
    }
  ]
});
const index_custom15 = () => createPlugin({
  name: "View Edits",
  description: "Lets you view chat messages prior to being edited.",
  authors: [{ name: "C00LESTKIDDEVER", avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png", url: "https://c00lestkiddever.nekoweb.org" }],
  disabled: false,
  patches: [
    {
      file: "/lib/js/game.js",
      replacement: [
        {
          match: /blacket\.user\.perms\.includes\("view_edits"\) \|\| blacket\.user\.perms\.includes\("\*"\)/,
          replace: "true"
        }
      ]
    }
  ]
});
const index_custom16 = () => createPlugin({
  name: "Bring Back Ankha Ping",
  description: "re-enables the possibility of getting the Ankha ping sound effect.",
  disabled: false,

  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  settings: [
    {
      name: "Always Ankha Ping",
      default: false
    }
  ],

  patches: [
    {
      file: "/lib/js/chat.js",
      replacement: [
        {
          match: /\/\/ if \(Math\.floor\(Math\.random\(\) \* 1000\) == 0\) new Audio\("\/content\/ankhaMention\.ogg"\)\.play\(\);/,
          replace: `if (Math.floor(Math.random() * 1000) == 0) new Audio("/content/ankhaMention.ogg").play();`
        }
      ]
    }
  ],

  onLoad() {
    if (this.settings["Always Ankha Ping"]) {
      this.patches[0].replacement[0].replace =
        `new Audio("/content/ankhaMention.ogg").play();`;
    }
  }
});
const index_custom17 = () => createPlugin({
  name: "Bring Back Ankha Mark",
  description: "re-enables the possibility of getting the Ankha market cashier.",
  disabled: false,

    authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  settings: [
    {
      name: "Always Ankha",
      default: false
    }
  ],

  onLoad() {
    const apply = (img) => {
      if (!img) return;

      if (
        this.settings["Always Ankha"] ||
        Math.random() * 100 <= 1
      ) {
        img.src = "/content/ankha.webp";
      }
    };

    const observer = new MutationObserver(() => {
      const img = document.querySelector(
        ".styles__cashierBlook___iI1UH-camelCase"
      );

      if (img) apply(img);
    });

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });

    this.observer = observer;
  },

  onUnload() {
    this.observer?.disconnect();
  }
});
const index_custom18 = () => createPlugin({
  name: "BlacketDMs",
  description: "a plugin to add dms to blacket v2.",
  disabled: false,

  authors: [
    {
      name: "zastix",
      avatar: "https://avatars.githubusercontent.com/u/135683847",
      url: "https://github.com/zastlx"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

      onLoad: () => {

    try {
        "use strict";(()=>{var f=class{dms=[];constructor(){let e=localStorage.getItem("dms");if(e)try{this.dms=JSON.parse(e)}catch(t){console.error("Error parsing dms",t),localStorage.setItem("dms",JSON.stringify(this.dms))}}saveDms(){localStorage.setItem("dms",JSON.stringify(this.dms))}async getUser(e){return new Promise((t,r)=>{window.blacket.requests.get("/worker2/user/"+e,o=>{if(o.error)return r(o.error);t(o.user)})})}getDmWithUser(e){return this.dms.find(t=>t.person==e)}closeDm(e){this.dms=this.dms.filter(t=>t.id!==e),this.saveDms()}openDm(e,t){this.dms.find(r=>r.id===e)||(this.dms.push({id:e,person:t}),this.saveDms())}getDms(){return this.dms}setDms(e){this.dms=e,this.saveDms()}getDmsObject(){return this.dms.reduce((e,t)=>(e[t.id]=t,e),{})}async getFormattedDmObject(){let e={};for(let t of this.dms){let r=window.blacket.chat.cached.users[t.person]??await this.getUser(t.person);e[t.id]={name:`[DM] ${r.username}`,date:0}}return e}};var D=["a","b","i"],l=new Map;function v(s,e,t,r,o){let n=l.get(e)?.[s];if(!n)return o?Reflect.construct(e[s],t,r):e[s].apply(r,t);for(let i of n.b.values()){let c=i.call(r,t);Array.isArray(c)&&(t=c)}let a=[...n.i.values()].reduce((i,c)=>(...g)=>c.call(r,g,i),(...i)=>o?Reflect.construct(n.o,i,r):n.o.apply(r,i))(...t);for(let i of n.a.values())a=i.call(r,t,a)??a;return a}function M(s,e,t,r){let o=l.get(s),n=o?.[e];return n?.[r].has(t)?(n[r].delete(t),D.every(a=>n[a].size===0)&&(Reflect.defineProperty(s,e,{value:n.o,writable:!0,configurable:!0})||(s[e]=n.o),delete o[e]),Object.keys(o).length==0&&l.delete(s),!0):!1}var w=s=>(e,t,r,o=!1)=>{if(typeof t[e]!="function")throw new Error(`${e} is not a function in ${t.constructor.name}`);l.has(t)||l.set(t,Object.create(null));let n=l.get(t);if(!n[e]){let c=t[e];n[e]={o:c,b:new Map,i:new Map,a:new Map};let g=(u,d,p)=>{let O=v(e,t,d,u,p);return o&&i(),O},_=new Proxy(c,{apply:(u,d,p)=>g(d,p,!1),construct:(u,d)=>g(c,d,!0),get:(u,d,p)=>d=="toString"?c.toString.bind(c):Reflect.get(u,d,p)});Reflect.defineProperty(t,e,{value:_,configurable:!0,writable:!0})||(t[e]=_)}let a=Symbol(),i=()=>M(t,e,a,s);return n[e][s].set(a,r),i};var L=w("b"),h=w("i"),k=w("a");var m=new f,j=!1,C=!1,b=!1,x=window.bb?.plugins?.active?.includes("Better Chat"),y=async()=>{if(!window.blacket||(j||(h("get",window.blacket.requests,(s,e)=>s[0]==="/worker/my-rooms"?e(s[0],async t=>t.error?s[1](t):s[1]({error:!1,rooms:{...t.rooms,...await m.getFormattedDmObject()}})):s[0].startsWith("/worker2/messages/")&&!s[0].startsWith("/worker2/messages/0")?e(s[0],async t=>t.error||t.messages.length==0?s[1](t):(t.messages.at(-1).message.content.startsWith("BDM-")&&t.messages.pop(),s[1]({error:!1,messages:t.messages}))):e(...s)),j=!0),!window.blacket.appendChat)||(C||(k("appendChat",window.blacket,async s=>{if(window.blacket.config.path==="trade"||s[0].room.name==="trade"||s[0].room.id!==window.blacket.chat.room)return;let e=$(`#message-${s[0].message.id}`),t;x?t=Object.entries(e.siblings()[1].children[0].children[0]).find(r=>r[0].includes("jQuery"))[1]:t=Object.entries(e.siblings()[1]).find(r=>r[0].includes("jQuery"))[1],k("handler",t.events.contextmenu[0],async()=>{$(".styles__contextMenuContainer___3jAmv-camelCase").append('<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" id="user-context-message"><div class="styles__contextMenuItemName___vj9a3-camelCase">Message</div><i class="styles__contextMenuItemIcon___2Zq3a-camelCase fas fa-message"></i></div>').on("click","#user-context-message",async()=>{let r=window.blacket.chat.cached.users[e[0].getAttribute("data-user-id")]??await m.getUser(e[0].getAttribute("data-user-id")),o=m.getDmWithUser(r.id);if(o)return window.blacket.switchToRoom("[DM] "+r.username,parseInt(o.id));b=!0,window.blacket.createToast({title:"Info",message:"User is not in your DMs, attempting to create DM.",icon:"/content/blooks/Info.webp",time:6e3}),window.blacket.requests.post("/worker/trades/requests/send",{user:e[0].getAttribute("data-user-id")})})})}),C=!0),!window.blacket.socket.listeners["trading-requests-accepted"]||!window.blacket.socket.listeners["messages-create"]))return setTimeout(y,1);if(k("messages-create",window.blacket.socket.listeners,s=>{if(s[0].data.message.content.startsWith("BDM-")&&s[0].data.room.name==="trade"&&s[0].data.message.user!==window.blacket.user.id){let[e,t]=atob(s[0].data.message.content.split("BDM-")[1]).split("|");m.openDm(e,t)}}),h("trading-requests-accepted",window.blacket.socket.listeners,(s,e)=>{if(b){window.blacket.requests.get("/worker/trades/ongoing",t=>{m.openDm(t.trade.room.toString(),Object.keys(t.trade.users).find(r=>r!==window.blacket.user.id)),setTimeout(()=>{window.blacket.socket.emit("messages-create",{room:t.trade.room,content:`BDM-${btoa(`${t.trade.room}|${window.blacket.user.id}`)}`}),setTimeout(()=>{window.blacket.socket.emit("trading-ongoing-decline"),b=!1,window.blacket.createToast({title:"Success",message:"User accepted the trade request, DM created, reload to see the room.",icon:"/content/blooks/Success.webp",time:6e3})},1e3)},4500)});return}return e(...s)}),h("trading-requests-declined",window.blacket.socket.listeners,(s,e)=>{if(b){b=!1,window.blacket.createToast({title:"Error",message:"User declined the trade request, failed to create DM.",icon:"/content/blooks/Error.webp",time:6e3});return}return e(...s)}),window.blacket.config.path=="settings"){$(".styles__mainContainer___4TLvi-camelCase").append('<div class="styles__infoContainer___2uI-S-camelCase"><div class="styles__headerRow___1tdPa-camelCase"><i class="fas fa-message styles__headerIcon___1ykdN-camelCase" aria-hidden="true"></i><div class="styles__infoHeader___1lsZY-camelCase">BlacketDMs</div></div><div><a id="backupDmsBtn" class="styles__link___5UR6_-camelCase">Backup DMs</a></div><div><a id="importDmsBtn" class="styles__link___5UR6_-camelCase">Import DMs</a></div><div><a id="clearDmsBtn" class="styles__link___5UR6_-camelCase">Clear DMs</a></div><p style="padding: 0;margin: 0;font-size: 0.7rem;color: #c2bbbb;">made by zastix, <a href="https://zastix.club/" target="_blank">https://zastix.club/</a></p></div>');let s=async(e,t)=>{let r=new Blob([e],{type:"text/plain"}),o=URL.createObjectURL(r),n=document.createElement("a");n.href=o,n.download=t,n.click()};$("#backupDmsBtn").on("click",async()=>{let e=JSON.stringify(m.getDms());s(e,`blacketDmsBackup-${Date.now()}.json`)}),$("#importDmsBtn").on("click",async()=>{let e=document.createElement("input");e.type="file",e.accept=".json",e.click(),e.onchange=async()=>{let t=e.files?.[0];if(!t)return;let r=new FileReader;r.onload=async()=>{let o=JSON.parse(r.result);m.setDms(o),window.blacket.createToast({title:"Success",message:"DMs imported successfully, reload to see the changes.",icon:"/content/blooks/Success.webp",time:6e3})},r.readAsText(t)}}),$("#clearDmsBtn").on("click",async()=>{confirm("Are you sure you want to clear all DMs? This is irreversible")&&(m.setDms([]),window.blacket.createToast({title:"Success",message:"DMs cleared successfully, reload to see the changes.",icon:"/content/blooks/Success.webp",time:6e3}))})}};y();})();
// made by zastix
            } catch (err) {}
  }
});
const index_custom19 = () => createPlugin({
  name: "Bazaar User Search",
  description: "search the bazaar by username.",
  authors: [
    {
      name: "Death",
      avatar: "https://i.imgur.com/PrvNWub.png",
      url: "https://villainsrule.xyz"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onStart: () => {

    if (!location.pathname.startsWith("/bazaar")) return;

    const waitForSearch = setInterval(() => {

      const input = document.querySelector(
        `input[placeholder="Search"]`
      );

      if (!input) return;

      clearInterval(waitForSearch);

      input.addEventListener("keydown", (e) => {

        if (e.key !== "Enter") return;

        let seller = input.value.trim();

        if (!seller) return;

        blacket.startLoading();

        blacket.requests.get(`/worker2/user/${seller}`, (data) => {

          blacket.stopLoading();

          if (!data || data.error || !data.user) {

          }

          blacket.getBazaar(data.user.id);

        });

      });

    }, 250);

  }
});
const index_custom20 = () => createPlugin({
  name: "Trade Plus",
  description: "Improve your trading experience by knowing your values while you trade!",
  authors: [
    {
      name: "FRANXE",
      avatar: "https://avatars.githubusercontent.com/u/218293368",
      url: "https://github.com/franxetsx"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {

(function () {
    'use strict';
    const $ = window.jQuery;
    if (!$) return;

    const TP = (window.TradePlus = window.TradePlus || {});
    TP.state = { mode: 'blooks', sort: 'default', injected: false };
    TP.PRICES_URL = 'https://raw.githubusercontent.com/philllllllllllip/ewewwefwfwf/refs/heads/main/67';

    const ready = () => {
        if (window.blacket && blacket.user && blacket.config && blacket.requests && blacket.blooks && blacket.rarities) boot();
        else setTimeout(ready, 120);
    };

    let booted = false;
    function boot() {
        if (booted) return;
        booted = true;

        TP.srcMap = {};
        Object.keys(blacket.blooks).forEach(n => { if (blacket.blooks[n].image) TP.srcMap[blacket.blooks[n].image] = n; });
        Object.keys(blacket.items || {}).forEach(n => { if (blacket.items[n].image) TP.srcMap[blacket.items[n].image] = n; });
        TP.rarIdx = {};
        Object.keys(blacket.rarities).forEach((r, i) => TP.rarIdx[r] = i);

        TP.inTrade = () => !!(blacket.trade && blacket.trade.room != null);
        TP.esc = s => String(s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
        TP.resolveName = el => {
            if (!el) return null;
            const $el = $(el), alt = $el.attr('alt');
            if (alt && (blacket.blooks[alt] || blacket.items[alt])) return alt;
            const src = $el.attr('src');
            if (src && TP.srcMap[src]) return TP.srcMap[src];
            return null;
        };

        TP.injectCSS();
        TP.loadPrices();
        TP.hookChat();
        TP.hookContextMenus();
        TP.patchAppend();
        TP.hookTradeFns();
        setInterval(TP.patchAppend, 800);
        setInterval(TP.injectBar, 500);
        setInterval(TP.updateTradeValues, 500);
        setInterval(TP.injectChatSwitch, 500);
    }

    TP.injectCSS = () => {
        if ($('#tpCSS').length) return;
        $('head').append(`<style id="tpCSS">
#tpBar{display:flex;align-items:center;gap:.6vw;flex-wrap:wrap;padding:.3vw 0;width:100%}
#tpValues{display:flex;align-items:center;gap:.8vw;flex-wrap:wrap;margin-left:auto}
.tp-gbtn{position:relative;cursor:pointer;user-select:none;display:inline-block}
.tp-gbtn .tp-gbtn-shadow{position:absolute;inset:0;background:rgba(0,0,0,.25);border-radius:.26vw;transform:translateY(.104vw);transition:transform .6s cubic-bezier(.3,.7,.4,1)}
.tp-gbtn .tp-gbtn-edge{position:absolute;inset:0;border-radius:.26vw;filter:brightness(.7);background:var(--accent,#4f4f4f)}
.tp-gbtn .tp-gbtn-front{position:relative;display:flex;align-items:center;justify-content:center;color:#fff;font-family:inherit;font-size:.85vw;font-weight:700;padding:.3vw .8vw;border-radius:.26vw;background:var(--accent,#4f4f4f);transform:translateY(-.208vw);transition:transform .6s cubic-bezier(.3,.7,.4,1);white-space:nowrap}
.tp-gbtn:hover .tp-gbtn-front{transform:translateY(-.313vw);transition:transform .25s cubic-bezier(.3,.7,.4,1.5)}
.tp-gbtn:hover .tp-gbtn-shadow{transform:translateY(.208vw);transition:transform .25s cubic-bezier(.3,.7,.4,1.5)}
.tp-gbtn:active .tp-gbtn-front{transform:translateY(-.104vw);transition:transform 34ms}
.tp-gbtn:active .tp-gbtn-shadow{transform:translateY(.052vw);transition:transform 34ms}
.tp-gbtn.tp-active .tp-gbtn-front,.tp-gbtn.tp-active .tp-gbtn-edge{background:#ffd700;color:#1f1f1f}
.tp-icon{background:none;border:none;color:#fff;font-size:1.5vw;width:2.4vw;height:2.4vw;min-width:30px;min-height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;opacity:.85}
.tp-icon:hover{opacity:1;transform:scale(1.08)}
.tp-icon.tp-active{color:#ffd700;text-shadow:0 0 .5vw #ffd700}
.tp-icon.tp-disabled{opacity:.3;cursor:not-allowed;pointer-events:none}
.tp-badge{position:absolute;bottom:0;right:0;background:rgba(0,0,0,.75);color:#fff;font-size:.7vw;padding:0 .25vw;border-radius:.2vw 0 0 0;pointer-events:none;z-index:3}
.tp-bhead{grid-column:1/-1;color:#fff;opacity:.7;font-size:.85vw;padding:.2vw 0}
.tp-bnone{grid-column:1/-1;color:#fff;opacity:.7;padding:.5vw;text-align:center}
.tp-brow{grid-column:1/-1;display:flex;align-items:center;gap:.6vw;padding:.25vw .4vw;cursor:pointer;border-radius:.2vw;box-sizing:border-box}
.tp-brow:hover{background:rgba(255,255,255,.08)}
.tp-brow img{width:1.8vw;height:1.8vw;object-fit:contain;flex-shrink:0}
.tp-brow-name{color:#fff;font-size:.85vw;flex:1}
.tp-brow-seller{color:#fff;opacity:.55;font-size:.75vw}
.tp-brow-price{color:#ffd700;font-size:.85vw;display:flex;align-items:center;gap:.2vw;min-width:5vw;justify-content:flex-end}
.tp-brow-price img{width:.85vw;height:.85vw}
.tp-tradeval{display:flex;align-items:center;gap:.3vw;color:#ffd700;font-size:1vw;font-weight:700;background:none;border:none;padding:0;white-space:nowrap}
.tp-tradeval img{width:1vw;height:1vw}
.tp-tradeval .tp-unk{color:#fff;opacity:.55;font-size:.75vw;margin-left:.2vw;font-weight:400}
#tpChatSwitch{position:fixed;top:.6vw;left:50%;transform:translateX(-50%);z-index:200;display:flex;gap:.4vw}
.tp-stat-row{display:flex;justify-content:space-between;gap:.5vw;padding:.2vw 0;border-bottom:1px solid rgba(255,255,255,.08)}
.tp-stat-label{color:#fff;opacity:.6;white-space:nowrap}
.tp-stat-val{color:#fff;text-align:right;word-break:break-word}
.tp-stat-block{display:flex;flex-direction:column;align-items:flex-start;padding:.2vw 0;border-bottom:1px solid rgba(255,255,255,.08)}
.tp-stat-json{background:rgba(0,0,0,.3);color:#fff;font-size:.7vw;padding:.4vw;border-radius:.2vw;white-space:pre-wrap;word-break:break-word;max-height:9vw;overflow-y:auto;width:100%;box-sizing:border-box;margin:.2vw 0 0}
.tp-stat-avatar{width:4vw;height:4vw;object-fit:contain;border-radius:50%;background:#222;display:block;margin:0 auto}
.tp-stat-banner{width:100%;height:6vw;object-fit:cover;border-radius:.3vw .3vw 0 0}
.tp-stat-name{color:#fff;font-size:1.15vw;font-weight:700;margin:.3vw 0 .6vw;text-align:center}
.tp-stat-body{text-align:left;font-size:.8vw;line-height:1.2vw;max-height:45vh;overflow-y:auto;padding:0 1.5vw}
</style>`);
    };

    TP.prices = {};
    TP.loadPrices = () => {
        fetch(TP.PRICES_URL).then(r => r.text()).then(t => {
            const i = t.indexOf('{');
            if (i === -1) throw new Error('no object literal found in price list');
            TP.prices = JSON.parse(t.slice(i) + '}');
        }).catch(err => console.warn('[Trade+] failed to load price list:', err));
    };

    TP.HISTORY_KEY = 'tp_price_history_v1';
    TP.loadHistory = () => {
        try { return JSON.parse(localStorage.getItem(TP.HISTORY_KEY) || '{}'); } catch (e) { return {}; }
    };
    TP.saveHistory = (hist) => {
        try { localStorage.setItem(TP.HISTORY_KEY, JSON.stringify(hist)); } catch (e) { console.warn('[Trade+] could not save price history:', e); }
    };
    TP.recordPrice = (name, price) => {
        if (!name || typeof price !== 'number') return;
        const hist = TP.loadHistory();
        const arr = hist[name] = hist[name] || [];
        const now = Date.now();
        const last = arr[arr.length - 1];
        if (last && now - last.t < 5 * 60 * 1000) return;
        arr.push({ t: now, p: price });
        if (arr.length > 500) arr.splice(0, arr.length - 500);
        TP.saveHistory(hist);
    };

    TP.showPriceGraph = (name) => {
        const hist = (TP.loadHistory()[name] || []).slice();
        $('.tp-graphModal').remove();
        $('body').append(`<div class="arts__modal___VpEAD-camelCase tp-graphModal"><form class="styles__container___1BPm9-camelCase" style="width:32vw;max-width:92vw;">
            <div class="styles__text___KSL4--camelCase" style="margin-bottom:.2vw">${TP.esc(name)} — Price History</div>
            <div style="padding:0 1.2vw 1vw">
                <canvas id="tpGraphCanvas" width="600" height="260" style="width:100%;height:16vw;background:rgba(0,0,0,.25);border-radius:.3vw"></canvas>
                <div style="color:#fff;opacity:.6;font-size:.68vw;margin-top:.4vw;text-align:left">${hist.length} recorded point${hist.length === 1 ? '' : 's'} · points are logged locally (on this browser only) whenever you search, lowest-check, or view this blook in the bazaar — there's no history from before you started using Trade+</div>
            </div>
            <div class="styles__holder___3CEfN-camelCase"><div class="styles__buttonContainer___2EaVD-camelCase">
            <div id="tpGraphClose" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">Close</div></div>
            </div></div><input type="submit" style="opacity: 0; display: none;">
        </form></div>`);
        $('#tpGraphClose').click(() => $('.tp-graphModal').remove());
        TP.drawGraph(hist);
    };

    TP.drawGraph = (points) => {
        const canvas = document.getElementById('tpGraphCanvas');
        if (!canvas) return;
        const ctx = canvas.getContext('2d');
        const w = canvas.width, h = canvas.height, pad = 34;
        ctx.clearRect(0, 0, w, h);
        if (!points.length) {
            ctx.fillStyle = 'rgba(255,255,255,.5)';
            ctx.font = '13px sans-serif';
            ctx.fillText('No price history recorded yet for this blook.', 14, h / 2);
            return;
        }
        const prices = points.map(p => p.p);
        const min = Math.min(...prices), max = Math.max(...prices);
        const range = (max - min) || 1;
        const stepX = points.length > 1 ? (w - pad * 2) / (points.length - 1) : 0;
        const xy = (p, i) => [pad + i * stepX, h - pad - ((p.p - min) / range) * (h - pad * 2)];
        ctx.strokeStyle = '#ffd700';
        ctx.lineWidth = 2;
        ctx.beginPath();
        points.forEach((p, i) => { const [x, y] = xy(p, i); if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y); });
        ctx.stroke();
        ctx.fillStyle = '#ffd700';
        points.forEach((p, i) => { const [x, y] = xy(p, i); ctx.beginPath(); ctx.arc(x, y, 2.5, 0, Math.PI * 2); ctx.fill(); });
        ctx.fillStyle = 'rgba(255,255,255,.7)';
        ctx.font = '11px sans-serif';
        ctx.fillText(max.toLocaleString(), 4, pad);
        ctx.fillText(min.toLocaleString(), 4, h - pad + 4);
    };

    TP.hookChat = () => {
        const noCd = blacket.user.perms.includes('*') || blacket.user.perms.includes('no_message_cooldown');
        const cd = ((noCd ? 0.5 : (blacket.config.chat ? blacket.config.chat.cooldown : 1)) * 1000) + 400;
        TP.queue = []; TP.sending = false;
        const pump = () => {
            if (TP.sending || !TP.queue.length) return;
            TP.sending = true;
            const { room, content } = TP.queue.shift();
            blacket.sendMessage(room, content);
            setTimeout(() => { TP.sending = false; pump(); }, cd);
        };
        TP.postResult = (plain, chat) => {
            if (!TP.inTrade()) return blacket.createToast({ title: 'Lowest Bazaar', message: plain, icon: '/content/icons/bazaar.webp', time: 8000 });
            TP.queue.push({ room: blacket.trade.room, content: chat });
            pump();
        };
    };

    TP.patchAppend = () => {
        if (!blacket.appendBlooks || TP.wrapped === blacket.appendBlooks) return;
        const base = blacket.appendBlooks;
        TP.wrapped = function (search) {
            if (TP.state.mode === 'bazaar') return TP.renderBazaar(search);
            if (TP.state.sort !== 'default') TP.sortBlooks();
            base.call(this, search);
            TP.decorateLocker();
        };
        blacket.appendBlooks = TP.wrapped;
    };

    TP.sortBlooks = () => {
        const prefs = {
            rarity: (a, b) => ((TP.rarIdx[a[0]] ?? 99) - (TP.rarIdx[b[0]] ?? 99)) || a[0].localeCompare(b[0]),
            alpha: (a, b) => a[0].localeCompare(b[0])
        };
        const s = prefs[TP.state.sort];
        if (!s) return;
        blacket.user.blooks = Object.fromEntries(Object.entries(blacket.user.blooks).sort(s));
    };

    TP.decorateLocker = () => {
        $('.styles__blooksHolder___1skET-camelCase > div').each((i, el) => {
            const $el = $(el), img = $el.find('img').first();
            const name = TP.resolveName(img[0]);
            if (!name || !blacket.user.blooks[name]) return;
            const rar = blacket.rarities[blacket.blooks[name].rarity];
            const col = (rar && rar.color) || '#fff';
            const glow = col === 'rainbow' ? '#ffd700' : col;
            $el.css('position', 'relative').attr('title', name);
            img.css('filter', `drop-shadow(0 0 .12vw ${glow}) drop-shadow(0 0 .06vw ${glow})`);
            $el.find('.tp-badge').remove();
            const cnt = blacket.user.blooks[name];
            if (cnt > 0) $el.append(`<div class="tp-badge">${cnt > 999 ? '999+' : cnt}</div>`);
        });
    };

    TP.hookTradeFns = () => {
        if (blacket.__tpHooked) return;
        blacket.__tpHooked = true;
        let t;
        const refresh = () => {
            clearTimeout(t);
            t = setTimeout(() => { if (TP.state.mode === 'blooks' && $('#searchInput').length) blacket.appendBlooks($('#searchInput').val() || ''); }, 300);
        };
        ['addBlook', 'setBlook'].forEach(fn => {
            const orig = blacket[fn];
            if (typeof orig !== 'function') return;
            blacket[fn] = function (...a) { const r = orig.apply(this, a); refresh(); return r; };
        });
    };

    TP.renderBazaar = (search) => {
        const holder = $('.styles__blooksHolder___1skET-camelCase');
        if (!holder.length) return;
        const q = (search || '').trim();
        holder.empty();
        if (!q) return holder.append('<div class="tp-bnone">Search a blook to see prices.</div>');
        const ql = q.toLowerCase();
        blacket.startLoading();
        blacket.requests.get('/worker/bazaar', (data) => {
            if (data.error) { blacket.stopLoading(); return blacket.createToast({ title: 'Error', message: data.reason, icon: '/content/blooks/Error.webp', time: 5000 }); }
            const rows = (data.bazaar || []).filter(l => l.item && l.item.toLowerCase().includes(ql));
            if (rows.length) { blacket.stopLoading(); return TP.renderBazaarRows(holder, q, rows); }
            blacket.requests.get(`/worker/bazaar?item=${encodeURIComponent(q)}`, (d2) => {
                blacket.stopLoading();
                if (d2.error) return blacket.createToast({ title: 'Error', message: d2.reason, icon: '/content/blooks/Error.webp', time: 5000 });
                TP.renderBazaarRows(holder, q, (d2.bazaar || []).filter(l => l.item));
            });
        });
    };

    TP.renderBazaarRows = (holder, q, rows) => {
        rows = rows.slice().sort((a, b) => a.price - b.price);
        const lows = {};
        rows.forEach(l => { if (lows[l.item] === undefined || l.price < lows[l.item]) lows[l.item] = l.price; });
        Object.entries(lows).forEach(([item, price]) => TP.recordPrice(item, price));
        holder.empty();
        holder.append(`<div class="tp-bhead">${rows.length} listing${rows.length === 1 ? '' : 's'} for "${TP.esc(q)}" · click to buy · right-click an image for the blook menu</div>`);
        if (!rows.length) return holder.append(`<div class="tp-bnone">No listings for "${TP.esc(q)}".</div>`);
        rows.forEach(l => {
            const img = blacket.items[l.item] ? blacket.items[l.item].image : (blacket.blooks[l.item] ? blacket.blooks[l.item].image : '/content/blooks/Error.webp');
            const row = $(`<div class="tp-brow" data-id="${TP.esc(l.id)}" data-item="${TP.esc(l.item)}">
                <img src="${img}" draggable="false">
                <div class="tp-brow-name">${TP.esc(l.item)}</div>
                <div class="tp-brow-seller">${TP.esc(l.seller)}</div>
                <div class="tp-brow-price">${l.price.toLocaleString()} <img src="/content/tokenIcon.webp" draggable="false"></div>
            </div>`);
            row.click(() => TP.buyListing(l));
            holder.append(row);
        });
    };

    TP.buyListing = (l) => {
        $('body').append(`<div class="arts__modal___VpEAD-camelCase"><form class="styles__container___1BPm9-camelCase">
            <div class="styles__text___KSL4--camelCase"><div>Buy ${TP.esc(l.item)} from ${TP.esc(l.seller)} for ${l.price.toLocaleString()} tokens?</div></div>
            <div class="styles__holder___3CEfN-camelCase"><div class="styles__buttonContainer___2EaVD-camelCase">
            <div id="tpYes" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">Yes</div></div>
            <div id="tpNo" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">No</div></div>
            </div></div><input type="submit" style="opacity: 0; display: none;">
        </form></div>`);
        if (blacket.user.tokens < l.price) {
            $('#tpYes').remove();
            $('#tpNo .styles__front___vcvuy-camelCase').text('Not Enough Tokens');
        }
        $('#tpYes').click(() => {
            $('.arts__modal___VpEAD-camelCase').remove();
            blacket.startLoading();
            blacket.requests.post('/worker/bazaar/buy', { id: l.id }, (data) => {
                blacket.stopLoading();
                if (data.error) return blacket.createToast({ title: 'Error', message: data.reason, icon: '/content/blooks/Error.webp', time: 5000 });
                blacket.user.tokens -= l.price;
                if ($('#tokenBalance > div:nth-child(2)').length) $('#tokenBalance > div:nth-child(2)').text(blacket.user.tokens.toLocaleString());
                blacket.createToast({ title: 'Bazaar', message: `Bought ${l.item} for ${l.price.toLocaleString()} tokens!`, icon: '/content/icons/bazaar.webp', time: 5000 });
                TP.renderBazaar($('#searchInput').val() || '');
            });
        });
        $('#tpNo').click(() => $('.arts__modal___VpEAD-camelCase').remove());
    };

    TP.hookContextMenus = () => {
        $(document).off('contextmenu.tp').on('contextmenu.tp', 'img', function (e) {
            const name = TP.resolveName(this);
            if (name) { e.preventDefault(); TP.blookMenu(e, name, this); return; }
            const box = $(this).closest('[data-user-id]');
            if (box.length) { e.preventDefault(); TP.userMenu(e, box.attr('data-user-id')); }
        });
    };

    TP.openMenu = (e, items) => {
        e.preventDefault();
        $('.styles__contextMenuContainer___3jAmv-camelCase').remove();
        $(document).off('.tpMenu');
        const $m = $('<div class="styles__contextMenuContainer___3jAmv-camelCase" oncontextmenu="return false;"></div>');
        items.forEach(it => $m.append(`<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" data-tp="${it.id}"><div class="styles__contextMenuItemName___vj9a3-camelCase">${it.label}</div><i class="styles__contextMenuItemIcon___2Zq3a-camelCase ${it.icon}"></i></div>`));
        $('body').append($m);
        const mw = $m.width(), mh = $m.height();
        let x = e.pageX, y = e.pageY;
        if (x + mw > $(window).width()) x -= mw;
        if (y + mh > $(window).height()) y -= mh;
        $m.css({ left: x, top: y });
        $m.find('[data-tp]').click(function () {
            const it = items.find(i => i.id === this.dataset.tp);
            $m.remove();
            $(document).off('.tpMenu');
            if (it) it.fn();
        });
        setTimeout(() => {
            $(document).on('click.tpMenu', () => $m.remove());
            $(document).on('keydown.tpMenu', e => { if (e.key === 'Escape') $m.remove(); });
        }, 0);
    };

    TP.blookMenu = (e, name, el) => {
        const items = [
            { id: 'lowest', label: 'Get Lowest Bazaar', icon: 'fas fa-tags', fn: () => TP.postLowest(name) },
            { id: 'bazaar', label: 'View in Bazaar', icon: 'fas fa-store', fn: () => TP.viewInBazaar(name) },
            { id: 'graph', label: 'Price Graph', icon: 'fas fa-chart-line', fn: () => TP.showPriceGraph(name) }
        ];
        if (TP.inTrade() && blacket.user.blooks[name] && $(el).closest('.styles__blooksHolder___1skET-camelCase').length) {
            items.push({
                id: 'add1', label: 'Add 1 to Trade', icon: 'fas fa-plus', fn: () => {
                    const mine = blacket.trade.users[blacket.user.id].blooks;
                    if (mine[name]) return blacket.createToast({ title: 'Trade', message: 'Already offering that blook.', icon: '/content/blooks/Info.webp', time: 4000 });
                    if (Object.keys(mine).length > 3) return blacket.createToast({ title: 'Trade', message: 'Max 4 different blooks in a trade.', icon: '/content/blooks/Info.webp', time: 4000 });
                    blacket.addBlook(name, 1, false, true);
                    $('.styles__acceptIndicator___GKR4a-camelCase').attr('style', 'background-color: #ff0000;');
                }
            });
        }
        items.push({ id: 'copy', label: 'Copy Name', icon: 'fas fa-copy', fn: () => navigator.clipboard.writeText(name) });
        items.push({ id: 'copyimg', label: 'Copy Image URL', icon: 'fas fa-image', fn: () => navigator.clipboard.writeText($(el).attr('src')) });
        TP.openMenu(e, items);
    };

    /*TP.userMenu = (e, id) => {
        TP.openMenu(e, [
            {
                id: 'profile', label: 'View Profile', icon: 'fas fa-user', fn: () => {
                    const cached = blacket.chat && blacket.chat.cached.users[id];
                    if (cached) return blacket.showUserInfo(cached);
                    blacket.requests.get(`/worker2/user/${id}`, d => { if (!d.error) blacket.showUserInfo(d.user); });
                }
            },
            { id: 'copyid', label: 'Copy User ID', icon: 'fas fa-copy', fn: () => navigator.clipboard.writeText(id) }
        ]);
    };

    TP.viewStats = (id) => {
        blacket.startLoading();
        blacket.requests.get(`/worker2/user/${id}`, d => {
            blacket.stopLoading();
            if (d.error) return blacket.createToast({ title: 'Error', message: d.reason, icon: '/content/blooks/Error.webp', time: 5000 });
            TP.renderStatsModal(d.user);
        });
    };*/

    TP.renderStatsModal = (u) => {
        $('.tp-statsModal').remove();
        const rows = [];
        const add = (label, val) => { if (val !== undefined && val !== null && val !== '') rows.push(`<div class="tp-stat-row"><span class="tp-stat-label">${TP.esc(label)}</span><span class="tp-stat-val">${val}</span></div>`); };
        add('ID', TP.esc(u.id));
        add('Role', TP.esc(u.role));
        add('Tokens', typeof u.tokens === 'number' ? u.tokens.toLocaleString() : undefined);
        add('Level', u.level);
        add('Created', u.created ? TP.esc(new Date(u.created * 1000).toLocaleString()) : undefined);
        add('Claimed', u.claimed ? TP.esc(new Date(u.claimed * 1000).toLocaleString()) : undefined);
        add('Clan', u.clan ? TP.esc(typeof u.clan === 'string' ? u.clan : (u.clan.name || JSON.stringify(u.clan))) : undefined);
        add('Badges', Array.isArray(u.badges) && u.badges.length ? TP.esc(u.badges.join(', ')) : undefined);

        let blocksHTML = '';
        if (u.perms) blocksHTML += `<div class="tp-stat-block"><span class="tp-stat-label">Permissions</span><pre class="tp-stat-json">${TP.esc(JSON.stringify(u.perms))}</pre></div>`;
        if (u.settings) blocksHTML += `<div class="tp-stat-block"><span class="tp-stat-label">Settings</span><pre class="tp-stat-json">${TP.esc(JSON.stringify(u.settings))}</pre></div>`;
        if (u.misc) blocksHTML += `<div class="tp-stat-block"><span class="tp-stat-label">Misc</span><pre class="tp-stat-json">${TP.esc(JSON.stringify(u.misc))}</pre></div>`;

        const known = ['id', 'username', 'role', 'tokens', 'level', 'created', 'claimed', 'clan', 'badges', 'avatar', 'banner', 'color', 'perms', 'settings', 'misc'];
        const extra = Object.keys(u).filter(k => !known.includes(k));
        if (extra.length) blocksHTML += `<div class="tp-stat-block"><span class="tp-stat-label">Other fields</span><pre class="tp-stat-json">${TP.esc(JSON.stringify(Object.fromEntries(extra.map(k => [k, u[k]])), null, 2))}</pre></div>`;

        const textClass = (u.color || '').toLowerCase() === 'rainbow' ? 'rainbow' : '';
        const nameStyle = textClass ? '' : (u.color ? `style="color:${TP.esc(String(u.color).split(';')[0])}"` : '');

        $('body').append(`<div class="arts__modal___VpEAD-camelCase tp-statsModal"><form class="styles__container___1BPm9-camelCase" style="width:26vw;max-width:92vw;">
            ${u.banner ? `<img src="${u.banner}" class="tp-stat-banner" draggable="false">` : ''}
            ${u.avatar ? `<img src="${u.avatar}" class="tp-stat-avatar" draggable="false" style="margin-top:.6vw">` : ''}
            <div class="tp-stat-name ${textClass}" ${nameStyle}>${TP.esc(u.username || 'Unknown')}</div>
            <div class="tp-stat-body">${rows.join('')}${blocksHTML}</div>
            <div class="styles__holder___3CEfN-camelCase"><div class="styles__buttonContainer___2EaVD-camelCase">
            <div id="tpStatsClose" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">Close</div></div>
            </div></div><input type="submit" style="opacity: 0; display: none;">
        </form></div>`);
        $('#tpStatsClose').click(() => $('.tp-statsModal').remove());
    };

    TP.showStatsPicker = () => {
        if (!TP.inTrade()) return;
        const me = blacket.user.id;
        const otherId = Object.keys(blacket.trade.users || {}).find(id => String(id) !== String(me));
        if (!otherId) return TP.viewStats(me);
        blacket.requests.get(`/worker2/user/${otherId}`, (d) => {
            const otherName = (!d.error && d.user) ? d.user.username : 'Opponent';
            $('body').append(`<div class="arts__modal___VpEAD-camelCase"><form class="styles__container___1BPm9-camelCase">
                <div class="styles__text___KSL4--camelCase"><div>Whose stats do you want to view?</div></div>
                <div class="styles__holder___3CEfN-camelCase"><div class="styles__buttonContainer___2EaVD-camelCase">
                <div id="tpStatsMe" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">You</div></div>
                <div id="tpStatsThem" class="styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase" role="button" tabindex="0"><div class="styles__shadow___3GMdH-camelCase"></div><div class="styles__edge___3eWfq-camelCase" style="background-color: var(--accent);"></div><div class="styles__front___vcvuy-camelCase styles__buttonInside___39vdp-camelCase" style="background-color: var(--accent);">${TP.esc(otherName)}</div></div>
                </div></div><input type="submit" style="opacity: 0; display: none;">
            </form></div>`);
            $('#tpStatsMe').click(() => { $('.arts__modal___VpEAD-camelCase').remove(); TP.viewStats(me); });
            $('#tpStatsThem').click(() => { $('.arts__modal___VpEAD-camelCase').remove(); TP.viewStats(otherId); });
        });
    };

    TP.postLowest = (name) => {
        blacket.startLoading();
        blacket.requests.get(`/worker/bazaar?item=${encodeURIComponent(name)}`, (d) => {
            blacket.stopLoading();
            if (d.error) return blacket.createToast({ title: 'Error', message: d.reason, icon: '/content/blooks/Error.webp', time: 5000 });
            const lows = (d.bazaar || []).filter(l => l.item === name).sort((a, b) => a.price - b.price);
            const disp = blacket.blooks[name] ? `[${name}]` : name;
            if (!lows.length) return TP.postResult(`Lowest bazaar for ${name}: no listings right now.`, `Lowest bazaar for ${disp}: no listings right now.`);
            const l = lows[0];
            TP.recordPrice(name, l.price);
            TP.postResult(`Lowest bazaar for ${name}: ${l.price.toLocaleString()} tokens (${l.seller})`, `Lowest bazaar for ${disp}: ${l.price.toLocaleString()} tokens (${l.seller})`);
        });
    };

    TP.viewInBazaar = (name) => {
        TP.state.mode = 'bazaar';
        TP.updateBar();
        TP.setSearchPlaceholder();
        const inp = $('#searchInput');
        if (inp.length) inp.val(name);
        blacket.appendBlooks(name);
    };

    TP.setSearchPlaceholder = () => {
        const inp = $('#searchInput');
        if (!inp.length) return;
        if (TP.origPlaceholder == null) TP.origPlaceholder = inp.attr('placeholder') || '';
        inp.attr('placeholder', TP.state.mode === 'bazaar' ? 'Search a blook to see prices...' : TP.origPlaceholder);
    };

    TP.priceOf = (name) => (TP.prices && typeof TP.prices[name] === 'number') ? TP.prices[name] : null;

    TP.sumBlooks = (blooksObj) => {
        let total = 0, unknown = 0;
        Object.entries(blooksObj || {}).forEach(([n, c]) => {
            const p = TP.priceOf(n);
            if (p == null) unknown++; else total += p * (c || 1);
        });
        return { total, unknown };
    };

    TP.tradeTokens = (u) => {
        for (const k of ['tokens', 'tokenOffer', 'offeredTokens', 'coins']) {
            if (u && typeof u[k] === 'number') return u[k];
        }
        return 0;
    };

    TP.updateTradeValues = () => {
        if (!TP.inTrade() || !$('#tpValues').length) return;
        const me = blacket.user.id;
        const otherId = Object.keys(blacket.trade.users || {}).find(id => String(id) !== String(me));
        const meU = blacket.trade.users[me];
        const themU = otherId ? blacket.trade.users[otherId] : null;
        const side = (u) => {
            if (!u) return { total: 0, unknown: 0 };
            const { total, unknown } = TP.sumBlooks(u.blooks);
            return { total: total + TP.tradeTokens(u), unknown };
        };
        const meV = side(meU), themV = side(themU);
        $('#tpValMe').html(`You: ${meV.total.toLocaleString()} <img src="/content/tokenIcon.webp" draggable="false">${meV.unknown ? `<span class="tp-unk">+${meV.unknown} unpriced</span>` : ''}`);
        $('#tpValThem').html(`Them: ${themV.total.toLocaleString()} <img src="/content/tokenIcon.webp" draggable="false">${themV.unknown ? `<span class="tp-unk">+${themV.unknown} unpriced</span>` : ''}`);
    };

    TP.barHTML = () => `
        <div id="tpBar">
            <i id="tpModeBtn" class="tp-icon fas fa-gavel" title="Toggle Bazaar"></i>
            <i id="tpSortBtn" class="tp-icon fas fa-arrow-down-wide-short" title="Sort"></i>
            <div id="tpClear" class="tp-gbtn"><div class="tp-gbtn-shadow"></div><div class="tp-gbtn-edge"></div><div class="tp-gbtn-front">Clear Offers</div></div>
            <div id="tpStats" class="tp-gbtn"><div class="tp-gbtn-shadow"></div><div class="tp-gbtn-edge"></div><div class="tp-gbtn-front">Player Stats</div></div>
            <div id="tpValues">
                <div class="tp-tradeval" id="tpValMe">You: 0 <img src="/content/tokenIcon.webp" draggable="false"></div>
                <div class="tp-tradeval" id="tpValThem">Them: 0 <img src="/content/tokenIcon.webp" draggable="false"></div>
            </div>
        </div>`;

    TP.injectBar = () => {
        if (!TP.inTrade()) { TP.state.injected = false; return; }
        if (TP.state.injected && !$('#tpBar').length) TP.state.injected = false;
        if (TP.state.injected) return;
        const holder = $('.styles__blooksHolder___1skET-camelCase');
        if (!holder.length || !$('#searchInput').length) return;
        TP.state.injected = true;
        holder.parent().prepend(TP.barHTML());
        TP.setSearchPlaceholder();
        $('#tpModeBtn').click(() => {
            TP.state.mode = TP.state.mode === 'blooks' ? 'bazaar' : 'blooks';
            TP.updateBar();
            TP.setSearchPlaceholder();
            $('#searchInput').val('');
            blacket.appendBlooks('');
        });
        $('#tpSortBtn').click(function () {
            if ($(this).hasClass('tp-disabled')) return;
            const items = [
                { id: 'default', label: 'Default', icon: 'fas fa-list', fn: () => { TP.state.sort = 'default'; blacket.appendBlooks($('#searchInput').val() || ''); } },
                { id: 'rarity', label: 'Rarity', icon: 'fas fa-star', fn: () => { TP.state.sort = 'rarity'; blacket.appendBlooks($('#searchInput').val() || ''); } },
                { id: 'alpha', label: 'A-Z', icon: 'fas fa-arrow-down-a-z', fn: () => { TP.state.sort = 'alpha'; blacket.appendBlooks($('#searchInput').val() || ''); } }
            ];
            const r = this.getBoundingClientRect();
            TP.openMenu({ preventDefault() {}, pageX: r.left + window.scrollX, pageY: r.bottom + window.scrollY }, items);
        });
        $('#tpClear').click(() => Object.keys(blacket.trade.users[blacket.user.id].blooks).forEach(k => blacket.setBlook(k, 0)));
        $('#tpStats').click(() => TP.showStatsPicker());
        TP.updateBar();
        blacket.appendBlooks($('#searchInput').val() || '');
    };

    TP.updateBar = () => {
        if (!$('#tpModeBtn').length) return;
        $('#tpModeBtn').toggleClass('tp-active', TP.state.mode === 'bazaar');
        $('#tpSortBtn').toggleClass('tp-disabled', TP.state.mode !== 'blooks');
    };

    TP.__chatWarned = false;
    TP.injectChatSwitch = () => {
        if (!TP.inTrade() || typeof blacket.switchToRoom !== 'function') { $('#tpChatSwitch').remove(); return; }
        if ($('#tpChatSwitch').length) return;
        TP.tradeRoomId = blacket.trade.room;
        $('body').append(`<div id="tpChatSwitch">
            <div id="tpChatTrade" class="tp-gbtn tp-active"><div class="tp-gbtn-shadow"></div><div class="tp-gbtn-edge"></div><div class="tp-gbtn-front">Trade Chat</div></div>
            <div id="tpChatGlobal" class="tp-gbtn"><div class="tp-gbtn-shadow"></div><div class="tp-gbtn-edge"></div><div class="tp-gbtn-front">Global Chat</div></div>
        </div>`);
        if (!TP.__chatWarned) {
            TP.__chatWarned = true;
            console.warn('[Trade+] Chat switch is a floating pill centered near the top of the page.');
        }
        $('#tpChatTrade').click(() => {
            blacket.switchToRoom('trade', TP.tradeRoomId);
            $('#tpChatTrade').addClass('tp-active');
            $('#tpChatGlobal').removeClass('tp-active');
        });
        $('#tpChatGlobal').click(() => {
            blacket.switchToRoom('global', 0);
            $('#tpChatGlobal').addClass('tp-active');
            $('#tpChatTrade').removeClass('tp-active');
        });
    };

    ready();
})();
    } catch (err) {}
  }
});
const index_custom21 = () => createPlugin({
  name: "Shopping Cart",
  description: "Ever wanted Blacket to be like Walmart?",
  authors: [
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {

(function () {
    'use strict';

    // ============================================================
    // SETTINGS
    // ============================================================

    const STORAGE_KEY =
        "blacket_bazaar_cart";

    const PANEL_STATE_KEY =
        "blacket_bazaar_cart_open";

    const PANEL_POSITION_KEY =
        "blacket_bazaar_cart_position";

    const SUCCESS_ICON =
        "/content/blooks/Success.webp";

    const ERROR_ICON =
        "/content/blooks/Error.webp";

    const cart = new Map();


    // ============================================================
    // LOCAL STORAGE - CART
    // ============================================================

    function saveCart() {
        try {
            localStorage.setItem(
                STORAGE_KEY,
                JSON.stringify([
                    ...cart.values()
                ])
            );
        } catch (error) {
            console.warn(
                "Could not save Bazaar cart:",
                error
            );
        }
    }


    function loadCart() {
        try {

            const saved =
                localStorage.getItem(
                    STORAGE_KEY
                );

            if (!saved) {
                return;
            }

            const items =
                JSON.parse(saved);

            if (!Array.isArray(items)) {
                return;
            }

            for (const item of items) {

                if (
                    !item ||
                    !item.id ||
                    typeof item.price !== "number"
                ) {
                    continue;
                }

                cart.set(
                    Number(item.id),
                    {
                        id:
                            Number(item.id),

                        price:
                            Number(item.price),

                        name:
                            item.name ||
                            "Unknown Blook",

                        image:
                            item.image ||
                            "/content/blooks/Info.webp",

                        seller:
                            item.seller ||
                            "Unknown Seller"
                    }
                );
            }

        } catch (error) {

            console.warn(
                "Could not load Bazaar cart:",
                error
            );
        }
    }


    loadCart();


    // ============================================================
    // NOTIFICATIONS
    // ============================================================

    function notify(
        title,
        message,
        icon
    ) {

        if (
            typeof window.blacket?.createToast ===
            "function"
        ) {

            window.blacket.createToast({
                title,
                message,
                icon,
                time: 5000
            });

        } else {

            console.warn(
                "Blacket notification system is unavailable."
            );
        }
    }


    // ============================================================
    // CART PANEL
    // ============================================================

    const panel =
        document.createElement("div");

    panel.id =
        "tm-bazaar-cart";

    panel.style.cssText = `
        position:fixed;

        top:80px;
        right:20px;

        width:300px;

        background:var(--primary, #222);
        color:white;

        border-radius:8px;

        padding:12px;

        z-index:999999;

        font-family:Arial, sans-serif;

        box-shadow:
            0 4px 15px rgba(0,0,0,.45);

        user-select:none;

        display:none;
    `;


    panel.innerHTML = `

        <div
            id="tm-cart-header"
            style="
                display:flex;
                align-items:center;
                justify-content:space-between;

                cursor:move;

                margin-bottom:10px;
                padding-bottom:8px;

                border-bottom:1px solid
                    rgba(255,255,255,.15);
            "
        >

            <div
                style="
                    display:flex;
                    align-items:center;
                    gap:8px;

                    font-size:18px;
                    font-weight:bold;
                "
            >

                <i
                    class="fas fa-shopping-cart"
                    aria-hidden="true"
                ></i>

                <span>
                    Bazaar Cart
                </span>

            </div>


            <i
                id="tm-cart-close"
                class="fas fa-times"
                aria-hidden="true"
                style="
                    cursor:pointer;
                    opacity:.7;
                    font-size:16px;
                "
            ></i>

        </div>


        <div
            id="cartCount"
            style="
                margin-bottom:3px;
            "
        >
            Items: 0
        </div>


        <div
            id="cartTotal"
            style="
                margin-bottom:10px;

                font-size:14px;
                font-weight:bold;

                color:#ffffff;

                text-shadow:
                    0 1px 3px
                    rgba(0,0,0,.8);
            "
        >
            Total: 0 tokens
        </div>


        <div
            id="tm-cart-items"
            style="
                max-height:300px;
                overflow-y:auto;

                margin-bottom:10px;

                padding-right:3px;
            "
        ></div>


        <button
            id="buyAll"
            disabled
            style="
                width:100%;

                padding:9px;

                border:0;
                border-radius:5px;

                background:var(--accent, #888);

                color:white;

                font-size:15px;
                font-weight:bold;

                cursor:pointer;
            "
        >

            <i
                class="fas fa-shopping-cart"
                aria-hidden="true"
            ></i>

            Buy All

        </button>


        <div
            id="buyStatus"
            style="
                margin-top:8px;

                font-size:12px;

                color:
                    rgba(255,255,255,.65);

                word-break:break-word;
            "
        ></div>

    `;


    document.body.appendChild(panel);


    // ============================================================
    // PANEL STATE
    // ============================================================

    function savePanelState() {

        try {

            localStorage.setItem(
                PANEL_STATE_KEY,

                panel.style.display !== "none"
                    ? "open"
                    : "closed"
            );

        } catch (error) {

            console.warn(
                "Could not save cart panel state:",
                error
            );
        }
    }


    function loadPanelState() {

        try {

            const state =
                localStorage.getItem(
                    PANEL_STATE_KEY
                );

            if (state === "open") {

                panel.style.display =
                    "block";

            } else {

                panel.style.display =
                    "none";
            }

        } catch (error) {

            panel.style.display =
                "none";
        }
    }


    // ============================================================
    // PANEL POSITION
    // ============================================================

    function savePanelPosition() {

        try {

            localStorage.setItem(
                PANEL_POSITION_KEY,

                JSON.stringify({
                    left:
                        panel.style.left,

                    top:
                        panel.style.top,

                    right:
                        panel.style.right
                })
            );

        } catch (error) {

            console.warn(
                "Could not save cart position:",
                error
            );
        }
    }


    function loadPanelPosition() {

        try {

            const saved =
                localStorage.getItem(
                    PANEL_POSITION_KEY
                );

            if (!saved) {
                return;
            }

            const position =
                JSON.parse(saved);

            if (position.left) {

                panel.style.left =
                    position.left;
            }

            if (position.top) {

                panel.style.top =
                    position.top;
            }

            if (position.right) {

                panel.style.right =
                    position.right;
            }

        } catch (error) {

            console.warn(
                "Could not load cart position:",
                error
            );
        }
    }


    loadPanelState();
    loadPanelPosition();


    // ============================================================
    // RENDER CART ITEMS
    // ============================================================

    function renderCartItems() {

        const container =
            document.getElementById(
                "tm-cart-items"
            );

        if (!container) {
            return;
        }

        container.innerHTML = "";


        if (cart.size === 0) {

            container.innerHTML = `

                <div
                    style="
                        text-align:center;

                        padding:20px 5px;

                        color:
                            rgba(255,255,255,.55);

                        font-size:13px;
                    "
                >

                    <i
                        class="fas fa-shopping-cart"
                        style="
                            font-size:28px;
                            margin-bottom:8px;
                        "
                    ></i>

                    <br>

                    Your cart is empty.

                </div>
            `;

            return;
        }


        for (const item of cart.values()) {

            const cartItem =
                document.createElement("div");


            cartItem.style.cssText = `
                display:flex;
                align-items:center;

                gap:8px;

                padding:8px;

                margin-bottom:6px;

                background:
                    rgba(0,0,0,.18);

                border-radius:6px;

                min-height:55px;
            `;


            // ----------------------------------------------------
            // IMAGE
            // ----------------------------------------------------

            const image =
                document.createElement("img");

            image.src =
                item.image ||
                "/content/blooks/Info.webp";

            image.style.cssText = `
                width:48px;
                height:48px;

                object-fit:contain;

                flex-shrink:0;

                border-radius:5px;
            `;


            // ----------------------------------------------------
            // INFORMATION
            // ----------------------------------------------------

            const info =
                document.createElement("div");

            info.style.cssText = `
                flex:1;

                min-width:0;

                overflow:hidden;
            `;


            const name =
                document.createElement("div");

            name.textContent =
                item.name ||
                "Unknown Blook";

            name.title =
                item.name ||
                "Unknown Blook";

            name.style.cssText = `
                font-weight:bold;

                font-size:14px;

                white-space:nowrap;

                overflow:hidden;

                text-overflow:ellipsis;

                margin-bottom:2px;
            `;


            const seller =
                document.createElement("div");

            seller.textContent =
                `Seller: ${
                    item.seller ||
                    "Unknown"
                }`;

            seller.title =
                seller.textContent;

            seller.style.cssText = `
                font-size:11px;

                color:
                    rgba(255,255,255,.55);

                white-space:nowrap;

                overflow:hidden;

                text-overflow:ellipsis;

                margin-bottom:2px;
            `;


            const price =
                document.createElement("div");

            price.textContent =
                `${item.price.toLocaleString()} tokens`;

            price.style.cssText = `
                font-size:13px;

                color:#ffffff;

                font-weight:bold;

                text-shadow:
                    0 1px 3px
                    rgba(0,0,0,.8);
            `;


            info.appendChild(name);
            info.appendChild(seller);
            info.appendChild(price);


            // ----------------------------------------------------
            // REMOVE BUTTON
            // ----------------------------------------------------

            const remove =
                document.createElement("button");

            remove.innerHTML = `
                <i
                    class="fas fa-times"
                    aria-hidden="true"
                ></i>
            `;

            remove.title =
                "Remove from cart";

            remove.style.cssText = `
                width:28px;
                height:28px;

                padding:0;

                border:0;

                border-radius:5px;

                background:
                    rgba(255,255,255,.08);

                color:white;

                cursor:pointer;

                flex-shrink:0;

                opacity:.7;

                transition:
                    opacity .15s ease,
                    background .15s ease;
            `;


            remove.addEventListener(
                "mouseenter",
                () => {

                    remove.style.opacity =
                        "1";

                    remove.style.background =
                        "rgba(255,70,70,.35)";
                }
            );


            remove.addEventListener(
                "mouseleave",
                () => {

                    remove.style.opacity =
                        ".7";

                    remove.style.background =
                        "rgba(255,255,255,.08)";
                }
            );


            remove.addEventListener(
                "click",
                event => {

                    event.stopPropagation();

                    cart.delete(item.id);

                    saveCart();

                    renderCartItems();

                    updateCart();

                    updateStars();
                }
            );


            cartItem.appendChild(image);
            cartItem.appendChild(info);
            cartItem.appendChild(remove);

            container.appendChild(cartItem);
        }
    }


    // ============================================================
    // UPDATE CART
    // ============================================================

    function updateCart() {

        let total = 0;

        for (const item of cart.values()) {
            total += item.price;
        }


        const count =
            document.getElementById(
                "cartCount"
            );


        const totalElement =
            document.getElementById(
                "cartTotal"
            );


        const buyButton =
            document.getElementById(
                "buyAll"
            );


        if (count) {

            count.textContent =
                `Items: ${cart.size}`;
        }


        if (totalElement) {

            totalElement.textContent =
                `Total: ${
                    total.toLocaleString()
                } tokens`;
        }


        if (buyButton) {

            // Empty cart
            if (cart.size === 0) {

                buyButton.disabled =
                    true;

                buyButton.innerHTML = `
                    <i
                        class="fas fa-shopping-cart"
                    ></i>
                    Buy All
                `;

            // User hasn't loaded
            } else if (
                !window.blacket?.user
            ) {

                buyButton.disabled =
                    true;

                buyButton.innerHTML = `
                    <i
                        class="fas fa-shopping-cart"
                    ></i>
                    Buy All
                `;

            // Not enough tokens
            } else if (
                Number(
                    blacket.user.tokens
                ) < total
            ) {

                buyButton.disabled =
                    true;

                buyButton.innerHTML = `
                    <i
                        class="fas fa-coins"
                    ></i>
                    Not Enough Tokens
                `;

            // Enough tokens
            } else {

                buyButton.disabled =
                    false;

                buyButton.innerHTML = `
                    <i
                        class="fas fa-shopping-cart"
                    ></i>
                    Buy All
                `;
            }
        }


        // Always render and save.
        renderCartItems();
        saveCart();
    }


    // ============================================================
    // GET BLOOK INFORMATION
    // ============================================================

    function getBlookInfo(item) {

        const priceText =
            item.querySelector(
                ".styles__bazaarItemPrice___KG4aZ-camelCase"
            )?.textContent || "0";


        const price =
            Number(
                priceText.replace(
                    /[^0-9]/g,
                    ""
                )
            );


        const imageElement =
            item.querySelector(
                ".styles__bazaarItemImage___KriA4-camelCase"
            );


        const image =
            imageElement?.getAttribute("src") ||
            "/content/blooks/Info.webp";


        let name =
            image
                .split("/")
                .pop()
                .replace(
                    /\.[^/.]+$/,
                    ""
                );


        try {

            name =
                decodeURIComponent(name);

        } catch (error) {}


        const sellerElement =
            item.querySelector(
                ".styles__bazaarItemAuthor___Fk3A1-camelCase"
            );


        const seller =
            sellerElement?.textContent?.trim() ||
            "Unknown Seller";


        return {
            price,
            name,
            image,
            seller
        };
    }


    // ============================================================
    // UPDATE STARS
    // ============================================================

    function updateStars() {

        document
            .querySelectorAll(
                ".styles__bazaarItem___Meg69-camelCase"
            )
            .forEach(item => {

                const id =
                    Number(item.id);


                const star =
                    item.querySelector(
                        ".tm-star"
                    );


                if (!star) {
                    return;
                }


                if (cart.has(id)) {

                    star.className =
                        "tm-star fas fa-star";

                    star.style.opacity =
                        "1";

                } else {

                    star.className =
                        "tm-star far fa-star";

                    star.style.opacity =
                        ".85";
                }
            });
    }


    // ============================================================
    // ADD FAVORITE STARS
    // ============================================================

    function addStars() {

        document
            .querySelectorAll(
                ".styles__bazaarItem___Meg69-camelCase"
            )
            .forEach(item => {

                if (
                    item.querySelector(
                        ".tm-star"
                    )
                ) {
                    return;
                }


                const id =
                    Number(item.id);


                if (!id) {
                    return;
                }


                item.style.position =
                    "relative";


                const star =
                    document.createElement("i");


                star.className =
                    cart.has(id)
                        ? "tm-star fas fa-star"
                        : "tm-star far fa-star";


                star.setAttribute(
                    "aria-hidden",
                    "true"
                );


                star.style.cssText = `
                    position:absolute;

                    left:7px;
                    top:7px;

                    font-size:20px;

                    cursor:pointer;

                    user-select:none;

                    color:#ffd700;

                    text-shadow:
                        0 0 4px black;

                    opacity:
                        ${
                            cart.has(id)
                                ? "1"
                                : ".85"
                        };

                    transition:
                        transform .12s ease,
                        opacity .12s ease;
                `;


                star.addEventListener(
                    "mouseenter",
                    () => {

                        star.style.transform =
                            "scale(1.2)";
                    }
                );


                star.addEventListener(
                    "mouseleave",
                    () => {

                        star.style.transform =
                            "scale(1)";
                    }
                );


                star.addEventListener(
                    "click",
                    event => {

                        event.stopPropagation();


                        const info =
                            getBlookInfo(item);


                        if (cart.has(id)) {

                            cart.delete(id);

                        } else {

                            cart.set(
                                id,
                                {
                                    id,

                                    price:
                                        info.price,

                                    name:
                                        info.name,

                                    image:
                                        info.image,

                                    seller:
                                        info.seller
                                }
                            );
                        }


                        updateStars();
                        updateCart();
                    }
                );


                item.appendChild(star);
            });
    }


    // ============================================================
    // WATCH FOR BAZAAR ITEMS
    // ============================================================

    new MutationObserver(() => {

        addStars();
        updateStars();

    }).observe(
        document.body,
        {
            childList:true,
            subtree:true
        }
    );


    addStars();
    updateStars();
    updateCart();


    // ============================================================
    // DRAGGABLE PANEL
    // ============================================================

    const header =
        document.getElementById(
            "tm-cart-header"
        );


    let dragging = false;

    let offsetX = 0;
    let offsetY = 0;


    header.addEventListener(
        "mousedown",
        event => {

            if (
                event.target.closest(
                    "#tm-cart-close"
                )
            ) {
                return;
            }


            dragging = true;


            const rect =
                panel.getBoundingClientRect();


            offsetX =
                event.clientX -
                rect.left;


            offsetY =
                event.clientY -
                rect.top;


            panel.style.right =
                "auto";

            panel.style.bottom =
                "auto";


            event.preventDefault();
        }
    );


    document.addEventListener(
        "mousemove",
        event => {

            if (!dragging) {
                return;
            }


            panel.style.left =
                `${event.clientX - offsetX}px`;


            panel.style.top =
                `${event.clientY - offsetY}px`;
        }
    );


    document.addEventListener(
        "mouseup",
        () => {

            if (!dragging) {
                return;
            }


            dragging = false;

            savePanelPosition();
        }
    );


    // ============================================================
    // CLOSE BUTTON
    // ============================================================

    document
        .getElementById(
            "tm-cart-close"
        )
        .addEventListener(
            "click",
            () => {

                panel.style.display =
                    "none";

                savePanelState();
            }
        );


    // ============================================================
    // BLACKET CART BUTTON
    // ============================================================

    function addCartButton() {

        const topRightRow =
            document.querySelector(
                ".styles__topRightRow___dQvxc-camelCase"
            );


        if (!topRightRow) {
            return false;
        }


        if (
            document.getElementById(
                "tm-bazaar-cart-button"
            )
        ) {
            return true;
        }


        const wrapper =
            document.createElement("div");


        wrapper.id =
            "tm-bazaar-cart-button";


        wrapper.style.marginBottom =
            "0.182vw";


        wrapper.className =
            "styles__button___1_E-G-camelCase styles__button___3zpwV-camelCase";


        wrapper.innerHTML = `

            <div
                class="
                    styles__shadow___3GMdH-camelCase
                "
            ></div>


            <div
                class="
                    styles__edge___3eWfq-camelCase
                "
                style="
                    background-color:
                    var(--accent);
                "
            ></div>


            <div
                class="
                    styles__front___vcvuy-camelCase
                    styles__buttonInsideNoMinWidth___39vdp-camelCase
                "
                style="
                    background-color:
                    var(--primary);
                "
            >

                <i
                    class="
                        fas fa-shopping-cart
                    "
                    aria-hidden="true"
                ></i>

            </div>
        `;


        wrapper.addEventListener(
            "click",
            event => {

                event.stopPropagation();


                if (
                    panel.style.display ===
                    "none"
                ) {

                    panel.style.display =
                        "block";

                } else {

                    panel.style.display =
                        "none";
                }


                savePanelState();
            }
        );


        topRightRow.appendChild(
            wrapper
        );


        return true;
    }


    addCartButton();


    const uiObserver =
        new MutationObserver(() => {

            addCartButton();

        });


    uiObserver.observe(
        document.body,
        {
            childList:true,
            subtree:true
        }
    );


    // ============================================================
    // BUY REQUEST
    // ============================================================

    async function buyListing(id) {

        console.log(
            "Buying Bazaar item:",
            id
        );


        const response =
            await fetch(
                "https://blacket.org/worker/bazaar/buy",
                {
                    method:"POST",

                    credentials:"include",

                    headers:{
                        "Content-Type":
                            "application/json",

                        "Accept":
                            "*/*",

                        "X-Requested-With":
                            "XMLHttpRequest"
                    },

                    body:
                        JSON.stringify({
                            id:id
                        })
                }
            );


        let data = null;


        try {

            data =
                await response.json();

        } catch (error) {

            console.warn(
                "Purchase response was not JSON."
            );
        }


        console.log(
            "Bazaar purchase response:",
            response.status,
            data
        );


        return {
            ok:
                response.ok,

            status:
                response.status,

            data:
                data
        };
    }


    // ============================================================
    // BUY ALL
    // ============================================================

    document
        .getElementById("buyAll")
        .addEventListener(
            "click",
            async function () {

                if (cart.size === 0) {
                    return;
                }


                const button = this;


                const status =
                    document.getElementById(
                        "buyStatus"
                    );


                button.disabled = true;


                button.innerHTML = `
                    <i
                        class="fas fa-spinner fa-spin"
                    ></i>
                    Buying...
                `;


                const items =
                    [...cart.values()];


                let successful = 0;

                let failed = 0;

                let tokensSpent = 0;


                // ------------------------------------------------
                // PURCHASE EACH ITEM
                // ------------------------------------------------

                for (const item of items) {

                    status.textContent =
                        `Buying ${item.name}...`;


                    try {

                        const result =
                            await buyListing(
                                item.id
                            );


                        if (result.ok) {

                            successful++;

                            tokensSpent +=
                                item.price;


                            // Remove from cart.
                            cart.delete(
                                item.id
                            );


                            // Remove actual Bazaar listing.
                            const element =
                                document.getElementById(
                                    String(item.id)
                                );


                            if (element) {

                                element.remove();
                            }


                        } else {

                            failed++;
                        }


                    } catch (error) {

                        console.error(
                            "Purchase error:",
                            item.id,
                            error
                        );

                        failed++;
                    }


                    // Update cart immediately.
                    updateCart();


                    // Wait 3 seconds between purchases
await new Promise(resolve => setTimeout(resolve, 2000));
                }


                // ------------------------------------------------
                // UPDATE LOCAL TOKEN BALANCE
                // ------------------------------------------------

                if (
                    successful > 0 &&
                    window.blacket?.user
                ) {

                    blacket.user.tokens =
                        Math.max(
                            0,

                            Number(
                                blacket.user.tokens
                            ) - tokensSpent
                        );
                }


                // Refresh cart + button.
                updateCart();


                // ------------------------------------------------
                // FINAL RESULT
                // ------------------------------------------------

                if (
                    failed === 0 &&
                    successful > 0
                ) {

                    status.textContent =
                        `Bought ${
                            successful
                        } item${
                            successful === 1
                                ? ""
                                : "s"
                        }!`;


                    notify(
                        "Bazaar Purchase",

                        `Successfully purchased ${
                            successful
                        } item${
                            successful === 1
                                ? ""
                                : "s"
                        }!`,

                        SUCCESS_ICON
                    );


                } else if (
                    failed > 0
                ) {

                    status.textContent =
                        `${
                            successful
                        } bought, ${
                            failed
                        } failed.`;


                    notify(
                        "Bazaar Purchase",

                        `${
                            successful
                        } item${
                            successful === 1
                                ? ""
                                : "s"
                        } purchased, but ${
                            failed
                        } failed.`,

                        ERROR_ICON
                    );


                } else {

                    status.textContent =
                        "Nothing was purchased.";
                }


                // Restore correct button state.
                updateCart();
            }
        );

})();

    } catch (err) {}
  }
});
const index_custom22 = () => createPlugin({
  name: "BlacketDMS v2",
  description: "a plugin to add dms to blacket v2.",
  authors: [
    {
      name: "zastix",
      avatar: "https://avatars.githubusercontent.com/u/135683847",
      url: "https://github.com/zastlx"
    },
      {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],

  onLoad: () => {

    try {

"use strict";(()=>{var f=class{dms=[];constructor(){let e=localStorage.getItem("dms");if(e)try{this.dms=JSON.parse(e).map(t=>({...t,name:t.name||null})),this.saveDms()}catch(t){console.error("Error parsing dms",t),localStorage.setItem("dms",JSON.stringify(this.dms))}}saveDms(){localStorage.setItem("dms",JSON.stringify(this.dms))}async getUser(e){return new Promise((t,r)=>{window.blacket.requests.get("/worker2/user/"+e,o=>{if(o.error)return r(o.error);t(o.user)})})}getDmWithUser(e){return this.dms.find(t=>t.person==e)}getDm(e){return this.dms.find(t=>t.id==e)}closeDm(e){this.dms=this.dms.filter(t=>t.id!==e),this.saveDms()}openDm(e,t,r=null){let o=this.dms.find(n=>n.id===e);o?r&&(o.name=r,this.saveDms()):(this.dms.push({id:e,person:t,name:r||null}),this.saveDms())}renameDm(e,t){let r=this.getDm(e);r&&(r.name=t||null,this.saveDms())}reorderDm(e,t){if(!(e<0||t<0||e>=this.dms.length||t>=this.dms.length)){const r=this.dms.splice(e,1)[0];this.dms.splice(t,0,r),this.saveDms()}}getDms(){return this.dms}setDms(e){this.dms=e.map(t=>({...t,name:t.name||null})),this.saveDms()}getDmsObject(){return this.dms.reduce((e,t)=>(e[t.id]=t,e),{})}async getFormattedDmObject(){let e={};for(let t of this.dms){let r=window.blacket.chat.cached.users[t.person]??await this.getUser(t.person);e[t.id]={name:t.name||`[DM] ${r.username}`,date:0}}return e}};var D=["a","b","i"],l=new Map;function v(s,e,t,r,o){let n=l.get(e)?.[s];if(!n)return o?Reflect.construct(e[s],t,r):e[s].apply(r,t);for(let i of n.b.values()){let c=i.call(r,t);Array.isArray(c)&&(t=c)}let a=[...n.i.values()].reduce((i,c)=>(...g)=>c.call(r,g,i),(...i)=>o?Reflect.construct(n.o,i,r):n.o.apply(r,i))(...t);for(let i of n.a.values())a=i.call(r,t,a)??a;return a}function M(s,e,t,r){let o=l.get(s),n=o?.[e];return n?.[r].has(t)?(n[r].delete(t),D.every(a=>n[a].size===0)&&(Reflect.defineProperty(s,e,{value:n.o,writable:!0,configurable:!0})||(s[e]=n.o),delete o[e]),Object.keys(o).length==0&&l.delete(s),!0):!1}var w=s=>(e,t,r,o=!1)=>{if(typeof t[e]!="function")throw new Error(`${e} is not a function in ${t.constructor.name}`);l.has(t)||l.set(t,Object.create(null));let n=l.get(t);if(!n[e]){let c=t[e];n[e]={o:c,b:new Map,i:new Map,a:new Map};let g=(u,d,p)=>{let O=v(e,t,d,u,p);return o&&i(),O},_=new Proxy(c,{apply:(u,d,p)=>g(d,p,!1),construct:(u,d)=>g(c,d,!0),get:(u,d,p)=>d=="toString"?c.toString.bind(c):Reflect.get(u,d,p)});Reflect.defineProperty(t,e,{value:_,configurable:!0,writable:!0})||(t[e]=_)}let a=Symbol(),i=()=>M(t,e,a,s);return n[e][s].set(a,r),i};var L=w("b"),h=w("i"),k=w("a");var m=new f,j=!1,C=!1,b=!1,x=window.bb?.plugins?.active?.includes("Better Chat"),y=async()=>{if(!window.blacket||(j||(h("get",window.blacket.requests,(s,e)=>s[0]==="/worker/my-rooms"?e(s[0],async t=>t.error?s[1](t):s[1]({error:!1,rooms:{...t.rooms,...await m.getFormattedDmObject()}})):s[0].startsWith("/worker2/messages/")&&!s[0].startsWith("/worker2/messages/0")?e(s[0],async t=>t.error||t.messages.length==0?s[1](t):(t.messages.at(-1).message.content.startsWith("BDM-")&&t.messages.pop(),s[1]({error:!1,messages:t.messages}))):e(...s)),j=!0),!window.blacket.appendChat)||(C||(k("appendChat",window.blacket,async s=>{if(window.blacket.config.path==="trade"||s[0].room.name==="trade"||s[0].room.id!==window.blacket.chat.room)return;let e=$(`#message-${s[0].message.id}`),t;x?t=Object.entries(e.siblings()[1].children[0].children[0]).find(r=>r[0].includes("jQuery"))[1]:t=Object.entries(e.siblings()[1]).find(r=>r[0].includes("jQuery"))[1],k("handler",t.events.contextmenu[0],async()=>{$(".styles__contextMenuContainer___3jAmv-camelCase").append('<div class="styles__contextMenuItemContainer___m3Xa3-camelCase" id="user-context-message"><div class="styles__contextMenuItemName___vj9a3-camelCase">Message</div><i class="styles__contextMenuItemIcon___2Zq3a-camelCase fas fa-message"></i></div>').on("click","#user-context-message",async()=>{let r=window.blacket.chat.cached.users[e[0].getAttribute("data-user-id")]??await m.getUser(e[0].getAttribute("data-user-id")),o=m.getDmWithUser(r.id);if(o)return window.blacket.switchToRoom(m.getDm(o.id)?.name||"[DM] "+r.username,parseInt(o.id));b=!0,window.blacket.createToast({title:"Info",message:"User is not in your DMs, attempting to create DM.",icon:"/content/blooks/Info.webp",time:6e3}),window.blacket.requests.post("/worker/trades/requests/send",{user:e[0].getAttribute("data-user-id")})})})}),C=!0),!window.blacket.socket.listeners["trading-requests-accepted"]||!window.blacket.socket.listeners["messages-create"]))return setTimeout(y,1);if(k("messages-create",window.blacket.socket.listeners,s=>{if(s[0].data.message.content.startsWith("BDM-")&&s[0].data.room.name==="trade"&&s[0].data.message.user!==window.blacket.user.id){let[e,t]=atob(s[0].data.message.content.split("BDM-")[1]).split("|");m.openDm(e,t)}}),h("trading-requests-accepted",window.blacket.socket.listeners,(s,e)=>{if(b){window.blacket.requests.get("/worker/trades/ongoing",t=>{let r=t.trade.room.toString(),o=Object.keys(t.trade.users).find(n=>n!==window.blacket.user.id),i=window.blacket.chat.cached.users[o];(async()=>{if(!i)try{i=await m.getUser(o)}catch(c){}let a=i?.username||o,u=prompt("Enter a name for this DM:",`[DM] ${a}`);u=u?.trim()||`[DM] ${a}`,m.openDm(r,o,u),setTimeout(()=>{window.blacket.socket.emit("messages-create",{room:t.trade.room,content:`BDM-${btoa(`${t.trade.room}|${window.blacket.user.id}`)}`}),setTimeout(()=>{window.blacket.socket.emit("trading-ongoing-decline"),b=!1,window.blacket.createToast({title:"Success",message:`DM created as "${u}". Reload to see the room.`,icon:"/content/blooks/Success.webp",time:6e3})},1e3)},4500)})()});return}return e(...s)}),h("trading-requests-declined",window.blacket.socket.listeners,(s,e)=>{if(b){b=!1,window.blacket.createToast({title:"Error",message:"User declined the trade request, failed to create DM.",icon:"/content/blooks/Error.webp",time:6e3});return}return e(...s)}),window.blacket.config.path=="settings"){$("<style>").text(`.styles__infoHeader___1lsZYc-camelCase { font-weight: 700 !important; font-size: 1.4em; !important;}`).appendTo("head");$(".styles__mainContainer___4TLvi-camelCase").append('<div class="styles__infoContainer___2uI-S-camelCase"><div class="styles__headerRow___1tdPa-camelCase"><i class="fas fa-message styles__headerIcon___1ykdN-camelCase" aria-hidden="true"></i><div class="styles__infoHeader___1lsZYc-camelCase">BlacketDMs</div></div><div><a id="backupDmsBtn" class="styles__link___5UR6_-camelCase">Backup DMs</a></div><div><a id="importDmsBtn" class="styles__link___5UR6_-camelCase">Import DMs</a></div><div><a id="renameDmsBtn" class="styles__link___5UR6_-camelCase">Rename DMs</a></div><div><a id="clearDmsBtn" class="styles__link___5UR6_-camelCase">Clear DMs</a></div><div><a id="reorderDmsBtn" class="styles__link___5UR6_-camelCase">Reorder DMs</a></div><p style="padding:0;margin:0;font-size:.7rem;color:#c2bbbb">made by zastix, <a href="https://zastix.club/" target="_blank">https://zastix.club/</a></p></div>');let s=async(e,t)=>{let r=new Blob([e],{type:"text/plain"}),o=URL.createObjectURL(r),n=document.createElement("a");n.href=o,n.download=t,n.click(),URL.revokeObjectURL(o)};$("#backupDmsBtn").on("click",async()=>{s(JSON.stringify(m.getDms()),`blacketDmsBackup-${Date.now()}.json`)}),$("#importDmsBtn").on("click",async()=>{let e=document.createElement("input");e.type="file";e.accept=".json";e.click();e.onchange=async()=>{let t=e.files?.[0];if(!t)return;let r=new FileReader;r.onload=async()=>{try{let o=JSON.parse(r.result);if(!Array.isArray(o))throw Error("Invalid DM backup");m.setDms(o);window.blacket.createToast({title:"Success",message:"DMs imported successfully, reload to see the changes.",icon:"/content/blooks/Success.webp",time:6e3})}catch(o){console.error(o);window.blacket.createToast({title:"Error",message:"Invalid DM backup.",icon:"/content/blooks/Error.webp",time:6e3})}};r.readAsText(t)}}),$("#renameDmsBtn").on("click",async()=>{let e=m.getDms();if(!e.length)return void window.blacket.createToast({title:"Info",message:"You don't have any DMs.",icon:"/content/blooks/Info.webp",time:6e3});let t=[];for(let r of e){let o;try{o=window.blacket.chat.cached.users[r.person]||await m.getUser(r.person)}catch{o={username:r.person}}t.push({dm:r,username:o.username})}let r=t.map((e,t)=>`${t+1}. ${e.dm.name||"[DM] "+e.username}`).join("\n"),o=prompt("Which DM do you want to rename?\n\n"+r+"\n\nEnter the number:");if(o===null)return;let i=parseInt(o)-1;if(isNaN(i)||i<0||i>=t.length)return void window.blacket.createToast({title:"Error",message:"Invalid DM selection.",icon:"/content/blooks/Error.webp",time:6e3});let a=t[i],u=prompt(`Rename DM with ${a.username}:`,a.dm.name||"[DM] "+a.username);if(u===null)return;m.renameDm(a.dm.id,u.trim()||null),window.blacket.createToast({title:"Success",message:`DM renamed to "${u.trim()||"[DM] "+a.username}". Reload to see the changes.`,icon:"/content/blooks/Success.webp",time:6e3})}),$("#reorderDmsBtn").on("click",async()=>{let e=m.getDms();if(!e.length)return void window.blacket.createToast({title:"Info",message:"You don't have any DMs.",icon:"/content/blooks/Info.webp",time:6e3});let t=[];for(let r of e){let o;try{o=window.blacket.chat.cached.users[r.person]||await m.getUser(r.person)}catch{o={username:r.person}}t.push({dm:r,username:o.username})}let r=t.map((e,r)=>`${r+1}. ${e.dm.name||"[DM] "+e.username}`).join("\n"),o=parseInt(prompt("Move which DM?\n\n"+r))-1;if(isNaN(o))return;let i=parseInt(prompt(`Move "${t[o].dm.name||"[DM] "+t[o].username}" to what position?\n\n1-${t.length}`))-1;if(isNaN(i))return;m.reorderDm(o,i),window.blacket.createToast({title:"Success",message:"DM order updated. Reload to see changes.",icon:"/content/blooks/Success.webp",time:6e3})});$("#clearDmsBtn").on("click",async()=>{confirm("Are you sure you want to clear all DMs? This is irreversible")&&(m.setDms([]),window.blacket.createToast({title:"Success",message:"DMs cleared successfully, reload to see the changes.",icon:"/content/blooks/Success.webp",time:6e3}))})}};y()})();
// made by zastix

    } catch (err) {}
  }
});
const index_custom23 = () => createPlugin({
  name: "Image Upload Messages",
  description: "Adds uploaded image URLs to the chat box instead of automatically sending them.",
  authors: [
    {
      name: "C00LESTKIDDEVER",
      avatar: "https://c00lestkiddever.nekoweb.org/media/misc/favicon.png",
      url: "https://c00lestkiddever.nekoweb.org/"
    }
  ],
patches: [
  {
    file: "/lib/js/game.js",
    replacement: [
      {
        match: /blacket\.sendMessage\(blacket\.chat\.room,\s*data\.url\.replaceAll\(" ", "%20"\)\);/,
        replace: `
          let imageUrl = data.url.replaceAll(" ", "%20");
          let chatBox = $("#chatBox");
          chatBox.val(imageUrl);
          chatBox[0].dispatchEvent(new Event("input", { bubbles: true }));
          chatBox.focus();
        `
      }
    ]
  }
],
 onLoad: () => {
   try {
    let lastUploadedUrl = null;
    let blockNextImageMessage = false;

    function findChatInput() {
        const selectors = [
            'textarea',
            'input[type="text"]',
            '[contenteditable="true"]'
        ];

        for (const selector of selectors) {
            for (const el of document.querySelectorAll(selector)) {
                if (!el.offsetParent) continue;

                const text = (
                    (el.getAttribute("placeholder") || "") +
                    " " +
                    (el.getAttribute("aria-label") || "")
                ).toLowerCase();

                if (
                    text.includes("message") ||
                    text.includes("chat")
                ) {
                    return el;
                }
            }
        }

        for (const selector of selectors) {
            const visible = [...document.querySelectorAll(selector)]
                .filter(el => el.offsetParent);

            if (visible.length) {
                return visible[visible.length - 1];
            }
        }

        return null;
    }

    function getValue(el) {
        return el.isContentEditable
            ? el.innerText || ""
            : el.value || "";
    }

    function setValue(el, value) {
        if (el.isContentEditable) {
            el.innerText = value;
        } else {
            const prototype = el instanceof HTMLTextAreaElement
                ? HTMLTextAreaElement.prototype
                : HTMLInputElement.prototype;

            const setter = Object.getOwnPropertyDescriptor(
                prototype,
                "value"
            )?.set;

            if (setter) {
                setter.call(el, value);
            } else {
                el.value = value;
            }
        }

        el.dispatchEvent(new InputEvent("input", {
            bubbles: true,
            inputType: "insertText",
            data: value
        }));

        el.dispatchEvent(new Event("change", {
            bubbles: true
        }));
    }

    function insertImageUrl(url) {
        if (!url) return;

        lastUploadedUrl = url;
        blockNextImageMessage = true;

        const input = findChatInput();

        if (!input) {
            console.warn(
                "[Blacket Image URL] Chat input not found."
            );
            return;
        }

        const current = getValue(input).trim();

        // Don't duplicate the URL if Blacket already put it there.
        if (current.includes(url)) return;

        const newMessage = current
            ? `${current} ${url}`
            : url;

        setValue(input, newMessage);

        console.log(
            "[Blacket Image URL] Added image URL:",
            url
        );
    }

    function findUrl(data) {
        if (!data) return null;

        if (typeof data === "string") {
            try {
                data = JSON.parse(data);
            } catch {
                if (/^https?:\/\//i.test(data.trim())) {
                    return data.trim();
                }

                return null;
            }
        }

        if (typeof data !== "object") return null;

        const keys = [
            "publicUrl",
            "publicURL",
            "url",
            "imageUrl",
            "imageURL"
        ];

        for (const key of keys) {
            if (
                typeof data[key] === "string" &&
                /^https?:\/\//i.test(data[key])
            ) {
                return data[key];
            }
        }

        for (const key of Object.keys(data)) {
            if (
                data[key] &&
                typeof data[key] === "object"
            ) {
                const found = findUrl(data[key]);

                if (found) return found;
            }
        }

        return null;
    }

    /*
     * Detect Blacket's automatic message.
     *
     * If Blacket tries to send a message containing ONLY
     * the image URL immediately after an upload, cancel it.
     */
    function isAutomaticImageMessage(body) {
        if (!lastUploadedUrl || !blockNextImageMessage) {
            return false;
        }

        if (!body) return false;

        let text = "";

        if (typeof body === "string") {
            try {
                const parsed = JSON.parse(body);

                if (typeof parsed === "string") {
                    text = parsed;
                } else {
                    text = JSON.stringify(parsed);
                }
            } catch {
                text = body;
            }
        } else if (typeof body === "object") {
            text = JSON.stringify(body);
        }

        text = text.trim();

        // Only block if the request contains the uploaded URL
        // and doesn't contain any other meaningful text.
        if (!text.includes(lastUploadedUrl)) {
            return false;
        }

        const cleaned = text
            .replaceAll(lastUploadedUrl, "")
            .replace(/["'{}[\],:]/g, "")
            .trim();

        /*
         * If nothing meaningful remains, this is the forced
         * image-only message.
         */
        if (!cleaned) {
            blockNextImageMessage = false;

            console.log(
                "[Blacket Image URL] Blocked automatic image message."
            );

            return true;
        }

        return false;
    }

    // =========================================================
    // FETCH HOOK
    // =========================================================

    const originalFetch = window.fetch;

    window.fetch = async function (...args) {
        const options = args[1];

        /*
         * Stop Blacket's automatic image-only message.
         */
        if (options?.body && isAutomaticImageMessage(options.body)) {
            console.log(
                "[Blacket Image URL] Cancelled automatic image send."
            );

            return new Response(
                JSON.stringify({
                    error: false,
                    blocked: true
                }),
                {
                    status: 200,
                    headers: {
                        "Content-Type": "application/json"
                    }
                }
            );
        }

        const response = await originalFetch.apply(this, args);

        try {
            const clone = response.clone();

            const contentType =
                clone.headers.get("content-type") || "";

            if (contentType.includes("application/json")) {
                clone.json()
                    .then(data => {
                        const url = findUrl(data);

                        if (url) {
                            console.log(
                                "[Blacket Image URL] Found upload:",
                                url
                            );

                            insertImageUrl(url);
                        }
                    })
                    .catch(() => {});
            }
        } catch {}

        return response;
    };

    // =========================================================
    // XHR HOOK
    // =========================================================

    const originalOpen = XMLHttpRequest.prototype.open;
    const originalSend = XMLHttpRequest.prototype.send;

    XMLHttpRequest.prototype.open = function (
        method,
        url,
        ...rest
    ) {
        this._blacketUrl = url;

        return originalOpen.call(
            this,
            method,
            url,
            ...rest
        );
    };

    XMLHttpRequest.prototype.send = function (body) {

        /*
         * Stop Blacket's automatic image-only XHR message.
         */
        if (body && isAutomaticImageMessage(body)) {
            console.log(
                "[Blacket Image URL] Cancelled automatic image XHR."
            );

            try {
                Object.defineProperty(this, "status", {
                    value: 200
                });

                Object.defineProperty(this, "responseText", {
                    value: JSON.stringify({
                        error: false,
                        blocked: true
                    })
                });
            } catch {}

            return;
        }

        this.addEventListener("load", function () {
            try {
                const contentType =
                    this.getResponseHeader("content-type") || "";

                if (
                    contentType.includes("application/json") ||
                    typeof this.responseText === "string"
                ) {
                    const url = findUrl(this.responseText);

                    if (url) {
                        console.log(
                            "[Blacket Image URL] Found upload:",
                            url
                        );

                        insertImageUrl(url);
                    }
                }
            } catch {}
        });

        return originalSend.call(this, body);
    };

    } catch (err) {
      console.error("[Image URL] Error:", err);
    }
 }
});

// ===== VIEW TEASER (UNDER MANAGE THEMES) =====

(function () {
  const IMAGE_URL = "https://camo.githubusercontent.com/d7fa50e257219555de54008a7363ee93e9dd894d90352ae1ddfc3dc5864c19a5/68747470733a2f2f692e696d6775722e636f6d2f4b5770335037532e706e67";

  const inject = () => {
    // find all links/buttons
    const links = document.querySelectorAll(".styles__link___5UR6_-camelCase");

    let target = null;

    links.forEach(link => {
      if (link.textContent.trim().toLowerCase().includes("manage themes")) {
        target = link;
      }
    });

    if (!target || document.getElementById("bb_teaser_btn")) return false;

    // create button
    const btn = document.createElement("a");
    btn.id = "bb_teaser_btn";
    btn.className = "styles__link___5UR6_-camelCase";
    btn.textContent = "View Teaser";

    // insert UNDER manage themes
    target.parentElement.insertAdjacentElement("afterend", btn);

    // click handler
    btn.onclick = () => {
      if (document.getElementById("bb_teaser_modal")) return;

      const modal = document.createElement("div");
      modal.id = "bb_teaser_modal";
      modal.className = "arts__modal___VpEAD-camelCase";
      modal.style.display = "flex";
      modal.style.justifyContent = "center";
      modal.style.alignItems = "center";
      modal.style.flexFlow = "column";

      modal.innerHTML = `
        <img oncontextmenu="return false;" src="${IMAGE_URL}" style="max-height: 40vw;">
        <text id="openImageButton" style="color: white;font-size: 1.302vw;margin-top: 1vh;cursor: pointer;">Open Image</text>
      `;

      // open image in new tab
      modal.querySelector("#openImageButton").onclick = (e) => {
        e.stopPropagation();
        window.open(IMAGE_URL, "_blank");
      };

      // click outside to close
      modal.onclick = () => modal.remove();

      document.body.appendChild(modal);
    };

    return true;
  };

  // 🔁 force until it attaches, then stop
  const loop = setInterval(() => {
    if (inject()) {
      clearInterval(loop);
    }
  }, 100);
})();

const loadPlugins = async () => {
  ("Called loadPlugins()");
  let pluginData = storage.get("bb_pluginData", true);
  let contentLoaded = false;

  await Promise.all(
    Object.values({
      "../plugins/advancedopen/index.js": __vite_glob_0_0,
      "../plugins/aprilfools/index.js": __vite_glob_0_1,
      "../plugins/bazaarsniper/index.js": __vite_glob_0_2,
      "../plugins/betterchat/index.js": __vite_glob_0_3,
      "../plugins/betternotifications/index.js": __vite_glob_0_4,
      "../plugins/betterreplies/index.js": __vite_glob_0_5,
      "../plugins/blookutils/index.js": __vite_glob_0_6,
      "../plugins/deafbot/index.js": __vite_glob_0_7,
      "../plugins/doubleleaderboard/index.js": __vite_glob_0_8,
      "../plugins/extrastats/index.js": __vite_glob_0_9,
      "../plugins/highlightrarity/index.js": __vite_glob_0_10,
      "../plugins/internals/index.js": __vite_glob_0_11,
      "../plugins/messagelogger/index.js": __vite_glob_0_12,
      "../plugins/nochatcolor/index.js": __vite_glob_0_13,
      "../plugins/nochatping/index.js": __vite_glob_0_14,
      "../plugins/nodevtoolswarn/index.js": __vite_glob_0_15,
      "../plugins/oldbadges/index.js": __vite_glob_0_16,
      "../plugins/quickcss/index.js": __vite_glob_0_17,
      "../plugins/realtotalblooks/index.js": __vite_glob_0_18,
      "../plugins/stafftags/index.js": __vite_glob_0_19,
      "../plugins/testadmin/index.js": __vite_glob_0_20,
      "../plugins/tokenseverywhere/index.js": __vite_glob_0_21,
      "../plugins/test/index.js": { default: index_customtest },
      "../plugins/tradehighlight/index.js": { default: index_custom },
      "../plugins/notificationcreator/index.js": { default: index_custom2 },
      "../plugins/chattimestamps/index.js": { default: index_custom3 },
      "../plugins/replyfix/index.js": { default: index_custom4 },
      "../plugins/speedup/index.js": { default: index_custom5 },
      "../plugins/loadremover/index.js": { default: index_custom6 },
      "../plugins/soundbooster/index.js": { default: index_custom7 },
      "../plugins/legacy/index.js": { default: index_custom8 },
      "../plugins/themer/index.js": { default: index_custom9 },
      "../plugins/gradientcreator/index.js": { default: index_custom10 },
      "../plugins/tradehistory/index.js": { default: index_custom11 },
      "../plugins/themer2/index.js": { default: index_custom12 },
      "../plugins/chatonclans/index.js": { default: index_custom13 },
      "../plugins/notificationblock/index.js": { default: index_custom14 },
      "../plugins/viewedits/index.js": { default: index_custom15 },
      "../plugins/ankhapingrevive/index.js": { default: index_custom16 },
      "../plugins/ankhamarkrevive/index.js": { default: index_custom17 },
      "../plugins/blacketdms/index.js": { default: index_custom18 },
      "../plugins/bazaarsearch/index.js": { default: index_custom19 },
      "../plugins/tradeplus/index.js": { default: index_custom20 },
      "../plugins/shoppingcart/index.js": { default: index_custom21 },
      "../plugins/blacketdmsv2/index.js": { default: index_custom22 },
      "../plugins/imagefix/index.js": { default: index_custom23 },
      /*"../plugins/earlyaccess/index.js": { default: index_custom24 },*/
    }).map(async (pluginFile) => {
      const plugin = pluginFile.default();

      plugin.patches ??= [];
      plugin.settings ??= [];

      bb.plugins.list.push(plugin);

      if (plugin.styles) {
        bb.plugins.styles[plugin.name] = plugin.styles;
      }
    })
  );

  bb.plugins.active = [
    ...pluginData.active,
    ...bb.plugins.list.filter(p => p.required).map(p => p.name)
  ];

  bb.plugins.settings = pluginData.settings;

  document.addEventListener("DOMContentLoaded", () => {
    if (contentLoaded) return;
    contentLoaded = true;

    bb.plugins.list.forEach(plugin => {
      if (pluginData.active.includes(plugin.name) || plugin.required) {
        plugin.onLoad?.();
// ===== FORCE-LOADED FAVORITES + SEARCH (NO LAG) =====

(function () {
  const FAV_KEY = "bb_favs_v3";
  const ORDER_KEY = "bb_order_v3";

  const getFavs = () => JSON.parse(localStorage.getItem(FAV_KEY) || "[]");
  const setFavs = (v) => localStorage.setItem(FAV_KEY, JSON.stringify(v));

  const getOrder = () => JSON.parse(localStorage.getItem(ORDER_KEY) || "{}");
  const setOrder = (v) => localStorage.setItem(ORDER_KEY, JSON.stringify(v));

  let booted = false;

  // -------------------------
  // 🔍 SEARCH BAR
  // -------------------------
  const ensureSearchBar = () => {
    const main = document.querySelector("#plugins-main");
    if (!main || !main.parentElement) return false;

    if (!document.getElementById("bb_search_bar")) {
      const bar = document.createElement("div");
      bar.id = "bb_search_bar";
      bar.style.marginBottom = "10px";

      bar.innerHTML = `
        <div class="styles__searchBoxHolder___1uLEf-camelCase">
          <div class="styles__searchContainer___1WB5F-camelCase">
            <input class="styles__searchInput___sVM-G-camelCase" type="search" placeholder="Search in plugins...">
          </div>
        </div>
      `;

      const input = bar.querySelector("input");

      input.oninput = () => {
        const q = input.value.toLowerCase();

        document.querySelectorAll(".bb_pluginHeader").forEach(h => {
          const name = h.dataset.pid || "";
          h.parentElement.style.display = name.includes(q) ? "" : "none";
        });
      };

      main.parentElement.insertBefore(bar, main);
    }

    return true;
  };

  // -------------------------
  // ⭐ FAVORITES
  // -------------------------
  const initFavorites = () => {
    const headers = document.querySelectorAll(".bb_pluginHeader");
    if (!headers.length) return false;

    const order = getOrder();
    let changed = false;

    headers.forEach((header, index) => {
      if (header.dataset.ready) return;

      const name = header.textContent.trim().toLowerCase();
      header.dataset.pid = name;

      if (!(name in order)) {
        order[name] = index;
        changed = true;
      }

      const star = document.createElement("span");
      star.textContent = getFavs().includes(name) ? "★" : "☆";
      star.style.marginLeft = "8px";
      star.style.cursor = "pointer";

      star.onclick = (e) => {
        e.stopPropagation();

        let favs = getFavs();

        if (favs.includes(name)) {
          favs = favs.filter(f => f !== name);
        } else {
          favs.push(name);
        }

        setFavs(favs);
        star.textContent = favs.includes(name) ? "★" : "☆";

        moveCard(header, name);
      };

      header.appendChild(star);
      header.dataset.ready = "true";
    });

    if (changed) setOrder(order);

    return true;
  };

  // -------------------------
  // 🚀 MOVE CARD (FAST)
  // -------------------------
  const moveCard = (header, name) => {
    const card = header.parentElement;
    const container = card.parentElement;

    const favs = getFavs();
    const order = getOrder();

    if (favs.includes(name)) {
      container.prepend(card);
      return;
    }

    const targetIndex = order[name];

    const cards = [...container.children].filter(c =>
      c.querySelector(".bb_pluginHeader")
    );

    const target = cards[targetIndex];

    if (target) {
      container.insertBefore(card, target);
    } else {
      container.appendChild(card);
    }
  };

  // -------------------------
  // 🚀 INITIAL ORDER
  // -------------------------
  const applyInitialOrder = () => {
    const headers = document.querySelectorAll(".bb_pluginHeader");
    if (!headers.length) return;

    const container = headers[0].parentElement.parentElement;
    const favs = getFavs();
    const order = getOrder();

    const cards = [...container.children].filter(c =>
      c.querySelector(".bb_pluginHeader")
    );

    cards.sort((a, b) => {
      const nameA = a.querySelector(".bb_pluginHeader").dataset.pid;
      const nameB = b.querySelector(".bb_pluginHeader").dataset.pid;

      const favA = favs.includes(nameA);
      const favB = favs.includes(nameB);

      if (favA && !favB) return -1;
      if (!favA && favB) return 1;

      return (order[nameA] ?? 0) - (order[nameB] ?? 0);
    });

    cards.forEach(c => container.appendChild(c));
  };

  // -------------------------
  // 🚀 MAIN INIT
  // -------------------------
  const init = () => {
    const ok1 = ensureSearchBar();
    const ok2 = initFavorites();

    if (ok1 && ok2) {
      applyInitialOrder();
      return true;
    }

    return false;
  };

  // -------------------------
  // 🔥 FORCE LOOP (FAST UNTIL SUCCESS)
  // -------------------------
  const forceLoop = setInterval(() => {
    if (booted) return;

    if (init()) {
      booted = true;
      clearInterval(forceLoop);
    }
  }, 50); // very fast, but temporary

  // -------------------------
  // 🔁 SMART OBSERVER
  // -------------------------
  let scheduled = false;

  const observer = new MutationObserver(() => {
    if (!booted) return;

    if (scheduled) return;
    scheduled = true;

    requestAnimationFrame(() => {
      initFavorites(); // only attach new ones
      scheduled = false;
    });
  });

  observer.observe(document.body, {
    childList: true,
    subtree: true
  });

})();
      }
    });
  });

  if (document.readyState !== "loading" && !contentLoaded) {
    contentLoaded = true;

    bb.plugins.list.forEach(plugin => {
      if (pluginData.active.includes(plugin.name) || plugin.required) {
        plugin.onLoad?.();
      }
    });
  }

  events.listen("pageInit", () => {
    bb.plugins.list.forEach(plugin => {
      if (pluginData.active.includes(plugin.name) || plugin.required) {
        plugin.onStart?.();
      }
    });
  });

  bb.plugins.list.forEach(plugin => {
    if (pluginData.active.includes(plugin.name) || plugin.required) {
      plugin.patches.forEach(patch => {
        bb.patches.push({
          ...patch,
          plugin: plugin.name
        });
      });
    }

    if (!bb.plugins.settings[plugin.name]) {
      bb.plugins.settings[plugin.name] = {};
    }

    plugin.settings.forEach(setting => {
      if (!bb.plugins.settings[plugin.name][setting.name]) {
        bb.plugins.settings[plugin.name][setting.name] = setting.default;
      }
    });
  });

  patcher.patch();
};
/*try {

  (() => {
  "use strict";

  const BUTTON_ID = "bb-marketplace-button";
  const STORAGE_KEY = "bb-marketplace-installed";

  // =========================================
  // MARKETPLACE DATA
  // =========================================
  const marketplaceData = {

    Plugins: [

      {
        name: "Better Notifications",
        description: "Improved notification system",

        code: `
          (() => {

            ("Better Notifications Loaded");

            const style = document.createElement("style");

            style.dataset.marketplaceRuntime = "BetterNotifications";

            style.innerHTML = \`
              .toastMessage {
                border: 2px solid white !important;
                box-shadow: 0 0 15px rgba(255,255,255,0.3);
              }
            \`;

            document.head.appendChild(style);

          })();
        `
      },

      {
        name: "CRT Mode",
        description: "Retro CRT overlay effect",

        code: `
          (() => {

            const style = document.createElement("style");

            style.dataset.marketplaceRuntime = "CRTMode";

            style.innerHTML = \`
              body::after {
                content: "";
                position: fixed;
                inset: 0;
                pointer-events: none;
                background:
                  repeating-linear-gradient(
                    to bottom,
                    rgba(255,255,255,0.03),
                    rgba(255,255,255,0.03) 1px,
                    transparent 1px,
                    transparent 2px
                  );
                z-index: 999999;
              }
            \`;

            document.head.appendChild(style);

          })();
        `
      }

    ],

    Themes: [

      {
        name: "AMOLED",
        description: "Pure black AMOLED theme",

        css: `
                 .styles__blooketText___1pMBG-camelCase {
            font-size: 40px;
            font-family: Titan One, sans-serif;
            text-decoration: none;
            color: white;
            filter: drop-shadow(0px 0px 5px white);
            margin-bottom: 20px;
            text-align: center;
        }

        .styles__background___2J-JA-camelCase {
            background-color: #000 !important;
        }

        .styles__bazaarItem___Meg69-camelCase {
            background-color: #111111 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__bazaarItem___Meg69-camelCase:hover {
            background-color: #222222 !important;
            transform: scale(1.05);
        }

        .styles__bazaarItems___KmNa2-camelCase {
            background-color: #000 !important;
        }

        .styles__blookGridContainer___AK47P-camelCase {
            background-color: #000 !important;
        }

        .styles__button___2hNZo-camelCase,
        .styles__buttonFilled___23Dcn-camelCase {
            background-color: #000 !important;
        }

        .styles__buttonInside___39vdp-camelCase,
        .styles__front___vcvuy-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__cardContainer___NGmjp-camelCase {
            background-color: #000 !important;
        }

        .styles__chatCurrentRoom___MCaV4-camelCase {
            background-color: #000 !important;
        }

        .styles__chatEmojiButton___8RFa2-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatEmojiButton___8RFa2-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__chatInputContainer___gkR4A-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsListContainer___Gk4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRoomsTitle___fR4Av-camelCase {
            background-color: #000 !important;
        }

        .styles__chatRooms___o5ASb-camelCase {
            background-color: #000 !important;
        }

        .styles__chatUploadButton___g39Ac-camelCase {
            background-color: #000 !important;
            transition: 0.2s ease-in-out;
        }

        .styles__chatUploadButton___g39Ac-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__container___1BPm9-camelCase {
            background-color: #000 !important;
        }

        .styles__container___2VzTy-camelCase {
            background-color: #000 !important;
        }

        .styles__container___3St5B-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeader___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderInside___2omQm-camelCase {
            background-color: #000 !important;
        }

        .styles__containerHeaderRight___3xghM-camelCase,
        .styles__containerHeaderRightFriends___3xghM-camelCase {
            background-color: #000 !important;
        }

        .styles__editHeaderContainer___2G1ji-camelCase {
            background-color: #000 !important;
        }

        .styles__edge___3eWfq-camelCase {
            background-color: #fff !important;
        }

        .styles__formsForm___MvA35-camelCase {
            background-color: #000 !important;
        }

        .styles__header___22Ne2-camelCase {
            background-color: #000 !important;
        }

        .styles__header___2O21B-camelCase {
            background-color: #000 !important;
        }

        .styles__headerBadgeBg___12ogR-camelCase {
            background-color: #000 !important;
        }

        .styles__headerSide___1r1-b-camelCase {
            background-color: #000 !important;
        }

        .styles__horizontalBlookGridLine___4SAvz-camelCase {
            background-color: #fff !important;
        }

        .styles__infoContainer___2uI-S-camelCase {
            background-color: #000 !important;
        }

        .styles__input___2XTSp-camelCase {
            background-color: #000 !important;
        }

        .styles__left___9beun-camelCase {
            background-color: #000 !important;
        }

        .styles__loginButton___1e3jI-camelCase {
            background-color: #fff !important;
            color: #000 !important;
        }

        .styles__myTokenAmount___ANKHA-camelCase {
            background-color: #000 !important;
        }

        .styles__otherTokenAmount___SEGGS-camelCase {
            background-color: #000 !important;
        }

        .styles__postsContainer___39_IQ-camelCase {
            background-color: #111111 !important;
        }

        .styles__profileContainer___CSuIE-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownMenu___2jUAA-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase {
            background-color: #000 !important;
        }

        .styles__profileDropdownOption___ljZXD-camelCase:hover {
            background-color: #111111 !important;
        }

        .styles__rightButtonInside___14imT-camelCase {
            color: #000 !important;
        }

        .styles__sidebar___1XqWi-camelCase {
            background-color: #000 !important;
        }

        .styles__signUpButton___3_ch3-camelCase {
            background-color: #000 !important;
            color: #fff !important;
        }

        .styles__statContainer___QKuOF-camelCase {
            background-color: #111111 !important;
        }

        .styles__statsContainer___QnrRB-camelCase {
            background-color: #000 !important;
        }

        .styles__toastContainer___o4pCa-camelCase {
            background-color: #000 !important;
        }

        .styles__tokenContainer___3yBv--camelCase {
            background-color: #000 !important;
        }

        .styles__tradingContainer___B1ABS-camelCase {
            background-color: #000 !important;
        }

        .styles__verticalBlookGridLine___rQWaZ-camelCase {
            background-color: #fff !important;
        }

        #searchInput {
            background-color: #111111 !important;
        }

        textarea {
            background-color: #000 !important;
        }

        .toastMessage {
            background-color: #000 !important;
        }

        input {
            background-color: #000 !important;
        }

        hr {
            background-color: #fff !important;
        }
        `
      },

      {
        name: "Windows XP",
        description: "Classic Windows XP look",

        css: `
          body {
            background: #245edb !important;
          }

          button {
            border-radius: 0px !important;
          }
        `
      }

    ]
  };

  // =========================================
  // STORAGE
  // =========================================
  const getInstalled = () => {
    try {
      return JSON.parse(localStorage.getItem(STORAGE_KEY)) || [];
    } catch {
      return [];
    }
  };

  const saveInstalled = (data) => {
    localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
  };

  const isInstalled = (name) => {
    return getInstalled().some(x => x.name === name);
  };

  // =========================================
  // INSTALL
  // =========================================
  const installItem = (item, type) => {

    if (isInstalled(item.name)) return;

    const installed = getInstalled();

    installed.push({
      name: item.name,
      type,
      enabled: true
    });

    saveInstalled(installed);

    // =====================================
    // THEME INJECTION
    // =====================================
    if (type === "Themes") {

      document
        .querySelectorAll(`[data-marketplace-theme="${item.name}"]`)
        .forEach(el => el.remove());

      const style = document.createElement("style");

      style.dataset.marketplaceTheme = item.name;

      style.innerHTML = item.css;

      document.head.appendChild(style);
    }

    // =====================================
    // PLUGIN INJECTION
    // =====================================
    if (type === "Plugins") {

      document
        .querySelectorAll(`[data-marketplace-plugin="${item.name}"]`)
        .forEach(el => el.remove());

      const script = document.createElement("script");

      script.dataset.marketplacePlugin = item.name;

      script.textContent = `
        try {
          ${item.code}
        } catch(e) {
          console.error("Marketplace Plugin Error:", e);
        }
      `;

      document.documentElement.appendChild(script);

      script.remove();
    }

    refreshMarketplace();
  };

  // =========================================
  // UNINSTALL
  // =========================================
  const uninstallItem = (item) => {

    let installed = getInstalled();

    installed = installed.filter(x => x.name !== item.name);

    saveInstalled(installed);

    // remove themes
    document
      .querySelectorAll(`[data-marketplace-theme="${item.name}"]`)
      .forEach(el => el.remove());

    // remove plugins
    document
      .querySelectorAll(`[data-marketplace-plugin="${item.name}"]`)
      .forEach(el => el.remove());

    refreshMarketplace();
  };

  // =========================================
  // LOAD INSTALLED
  // =========================================
  const loadInstalled = () => {

    const installed = getInstalled();

    installed.forEach(saved => {

      const item =
        marketplaceData[saved.type]
          ?.find(x => x.name === saved.name);

      if (!item) return;

      // =====================================
      // LOAD THEMES
      // =====================================
      if (saved.type === "Themes") {

        document
          .querySelectorAll(`[data-marketplace-theme="${item.name}"]`)
          .forEach(el => el.remove());

        const style = document.createElement("style");

        style.dataset.marketplaceTheme = item.name;

        style.innerHTML = item.css;

        document.head.appendChild(style);
      }

      // =====================================
      // LOAD PLUGINS
      // =====================================
      if (saved.type === "Plugins") {

        const script = document.createElement("script");

        script.dataset.marketplacePlugin = item.name;

        script.textContent = `
          try {
            ${item.code}
          } catch(e) {
            console.error("Marketplace Plugin Error:", e);
          }
        `;

        document.documentElement.appendChild(script);

        script.remove();
      }

    });

  };

  // =========================================
  // BUILD UI
  // =========================================
  const buildSections = () => {

    return Object.entries(marketplaceData)
      .map(([category, items]) => `

        <div style="margin-bottom:22px;">

          <div style="
            font-size:24px;
            font-weight:bold;
            margin-bottom:12px;
          ">
            ${category}
          </div>

          ${items.map(item => {

            const installed = isInstalled(item.name);

            return `
              <div style="
                background: rgba(255,255,255,0.06);
                padding: 12px;
                border-radius: 10px;
                margin-bottom: 10px;
                display:flex;
                align-items:center;
                justify-content:space-between;
                gap:12px;
              ">

                <div>
                  <div style="
                    font-size:18px;
                    font-weight:bold;
                  ">
                    ${item.name}
                  </div>

                  <div style="
                    opacity:0.7;
                    font-size:13px;
                  ">
                    ${item.description}
                  </div>
                </div>

                <button
                  class="bb-market-action"
                  data-name="${item.name}"
                  data-category="${category}"
                  style="
                    padding:7px 12px;
                    border:none;
                    border-radius:7px;
                    cursor:pointer;
                  "
                >
                  ${installed ? "Uninstall" : "Install"}
                </button>

              </div>
            `;

          }).join("")}

        </div>

      `).join("");
  };

  // =========================================
  // REFRESH UI
  // =========================================
  const refreshMarketplace = () => {

    const content = document.getElementById("bb-market-content");

    if (!content) return;

    content.innerHTML = buildSections();

    bindButtons();
  };

  // =========================================
  // BUTTON EVENTS
  // =========================================
  const bindButtons = () => {

    document.querySelectorAll(".bb-market-action")
      .forEach(btn => {

        btn.onclick = () => {

          const name = btn.dataset.name;
          const category = btn.dataset.category;

          const item = marketplaceData[category]
            .find(x => x.name === name);

          if (!item) return;

          if (isInstalled(item.name)) {
            uninstallItem(item);
          } else {
            installItem(item, category);
          }
        };
      });
  };

  // =========================================
  // OPEN MARKETPLACE
  // =========================================
  const openMarketplace = () => {

    if (document.getElementById("bb-marketplace-overlay"))
      return;

    const overlay = document.createElement("div");

    overlay.id = "bb-marketplace-overlay";

    overlay.style = `
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.82);
      z-index: 999999;
      display:flex;
      align-items:center;
      justify-content:center;
      font-family:sans-serif;
      backdrop-filter: blur(4px);
    `;

    overlay.innerHTML = `
      <div style="
        display:flex;
        gap:24px;
        align-items:flex-start;
        max-width:95%;
      ">

        <!-- MAIN -->
        <div style="
          width:720px;
          max-width:75vw;
          max-height:86vh;
          overflow-y:auto;
          background:#1f1f1f;
          border-radius:14px;
          padding:20px;
          color:white;
        ">

          <div style="
            display:flex;
            align-items:center;
            gap:12px;
            margin-bottom:18px;
          ">

            <div>
              <div style="
                font-size:30px;
                font-weight:bold;
              ">
                BetterBlacket Marketplace
              </div>

              <div style="
                opacity:0.7;
              ">
                Install plugins, themes, and more
              </div>
            </div>

          </div>

          <div id="bb-market-content">
            ${buildSections()}
          </div>

          <button id="bb-market-close" style="
            padding:10px 14px;
            border:none;
            border-radius:8px;
            cursor:pointer;
            margin-top:10px;
          ">
            Close
          </button>

        </div>

        <!-- SHOPKEEPER -->
        <div style="
          width:220px;
          background:#1a1a1a;
          border-radius:14px;
          padding:18px;
          color:white;
          text-align:center;
        ">

          <img
            src="https://c00lestkiddever.nekoweb.org/media/misc/c00lmarket.png"
            style="
              width:140px;
              image-rendering:pixelated;
              margin-bottom:12px;
            "
          >

          <div style="
            font-size:24px;
            font-weight:bold;
            margin-bottom:8px;
          ">
            c00lkidd
          </div>

          <div style="
            opacity:0.75;
            line-height:1.4;
            font-size:14px;
          ">
            "welcome to my marketplace..."
          </div>

        </div>

      </div>
    `;

    document.body.appendChild(overlay);

    bindButtons();

    document.getElementById("bb-market-close")
      .onclick = () => overlay.remove();
  };

  // =========================================
  // INJECT BUTTON
  // =========================================
  const inject = () => {

    const headers = document.querySelectorAll(
      ".styles__infoContainer___2uI-S-camelCase .styles__infoHeader___1lsZY-camelCase"
    );

    headers.forEach(header => {

      if (header.textContent.trim() !== "BetterBlacket")
        return;

      const container = header.closest(
        ".styles__infoContainer___2uI-S-camelCase"
      );

      if (!container ||
          container.querySelector(`#${BUTTON_ID}`))
        return;

      const wrapper = document.createElement("div");

      const btn = document.createElement("a");

      btn.id = BUTTON_ID;

      btn.className = "styles__link___5UR6_-camelCase";

      btn.style.cursor = "pointer";

      btn.innerHTML = `
        <span style="
          display:flex;
          align-items:center;
          gap:6px;
        ">
          <span>Browse Marketplace</span>
        </span>
      `;

      btn.onclick = openMarketplace;

      wrapper.appendChild(btn);

      container.appendChild(wrapper);
    });
  };

  // =========================================
  // STARTUP
  // =========================================
  loadInstalled();

  const observer = new MutationObserver(inject);

  observer.observe(document.body, {
    childList: true,
    subtree: true
  });

  inject();

})();

} catch (err) {}*/

const style = document.createElement("style");
style.textContent = `
.styles__mainContainer___4TLvi-camelCase {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}
`;
document.head.appendChild(style);
// INIT

patcher.start();

if (!storage.get("bb_pluginData")) {
  storage.set("bb_pluginData", { active: [], settings: {} }, true);
}

if (!storage.get("bb_themeData")) {
  storage.set("bb_themeData", { active: [] }, true);
}

window.bb = {
  axios,
  events,
  Modal,
  storage,
  plugins: {
    list: [],
    settings: {},
    styles: {},
    pendingChanges: false
  },
  themes: {
    list: [],
    broken: [],
    reload: () => loadThemes(true)
  },
  patches: []
};

('Defined global "bb" variable:', bb);

setTimeout(() => loadThemes(), 0);
setTimeout(() => loadPlugins(), 0);
/*blacket.requests.get("/worker2/messages/" + blacket.user.clan.room + "?limit=250", (data) => {
    (data.messages);
})*/