|
"use strict";(()=>{var l=class{constructor(e={}){this.namespace=e.namespace,this.prefix=[this.namespace,e.prefix].filter(Boolean).join(" "),this.enabled=e.enabled!==!1,this.timestamp=e.timestamp!==!1,this.timestampFormat=e.timestampFormat||"locale"}getTimestamp(){let e=new Date;return this.timestampFormat==="ISO"?e.toISOString():e.toLocaleString()}formatMessage(e,...t){let n=[this.prefix];return this.timestamp&&n.push(`[${this.getTimestamp()}]`),n.push(`[${e.toUpperCase()}]`),[n.join(" "),...t]}debug(...e){this.enabled&&console.debug(...this.formatMessage("debug",...e))}info(...e){this.enabled&&console.info(...this.formatMessage("info",...e))}warn(...e){this.enabled&&console.warn(...this.formatMessage("warn",...e))}error(...e){this.enabled&&console.error(...this.formatMessage("error",...e))}log(...e){this.enabled&&console.log(...this.formatMessage("log",...e))}custom(e,...t){this.enabled&&console.log(...this.formatMessage(e,...t))}group(e,t){if(!this.enabled)return t();console.group(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}groupCollapsed(e,t){if(!this.enabled)return t();console.groupCollapsed(`${this.prefix} ${e}`);try{t()}finally{console.groupEnd()}}table(e,t){this.enabled&&(this.info("Table data:"),console.table(e,t))}time(e){this.enabled&&console.time(`${this.prefix} ${e}`)}timeEnd(e){this.enabled&&console.timeEnd(`${this.prefix} ${e}`)}timeLog(e){this.enabled&&console.timeLog(`${this.prefix} ${e}`)}enable(){this.enabled=!0}disable(){this.enabled=!1}setPrefix(e){this.prefix=e}};function u(r={}){return new l(r)}function d({selector:r,onReady:e,onRemoved:t}){let n=new Set,f=()=>typeof r=="function"?r():document.querySelector(r),s=f();s&&s instanceof HTMLElement&&(n.add(s),e(s));let c=new MutationObserver(h=>{h.forEach(m=>{m.addedNodes.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){let i=f();i&&i instanceof HTMLElement&&!n.has(i)&&(n.add(i),e(i)),typeof r=="string"&&o instanceof Element&&o.querySelectorAll(r).forEach(a=>{a instanceof HTMLElement&&!n.has(a)&&(n.add(a),e(a))})}}),t&&m.removedNodes.forEach(o=>{o.nodeType===Node.ELEMENT_NODE&&n.forEach(i=>{(o===i||o instanceof Element&&o.contains(i))&&(n.delete(i),t(i))})})})});return c.observe(document.body,{childList:!0,subtree:!0}),()=>{c.disconnect(),n.clear()}}(function(){"use strict";let r=u({prefix:"[FastDelete]",namespace:"UserScript"});function e(t){return document.querySelector(t)}d({selector:"delete-dialog",onReady:t=>{if(r.log("Delete dialog detected:",t),!(t instanceof HTMLElement))return r.warn("Modal element is not an HTMLElement:",t);r.log("Delete note element is ready:",t);let n=e("delete-dialog button[type='submit'][aria-label='Confirm deletion']");if(!n)return r.warn("Confirm button not found.");n.click()}})})();})(); |