/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

(function initCjs() {
  // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
  const globalThisRecord = globalThis;
  globalThisRecord['__name'] ??= name;
  const originalRequire = require;
  if (originalRequire && !originalRequire.__isPatched) {
    // eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
    require = Object.assign(
      (id) => requirePatched(id),
      originalRequire,
      {
        __isPatched: true
      }
    );
  }

  const newFuncs = {
    __extractDefault() {
      return extractDefault;
    },
    process() {
      const browserProcess = {
        browser: true,
        cwd() {
          return '/';
        },
        env: {},
        platform: 'android'
      };
      return browserProcess;
    }
  };

  for (const key of Object.keys(newFuncs)) {
    globalThisRecord[key] ??= newFuncs[key]?.();
  }

  function name(obj) {
    return obj;
  }

  function extractDefault(module) {
    return module && module.__esModule && 'default' in module ? module.default : module;
  }

  const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  'obsidian',
  '@codemirror/autocomplete',
  '@codemirror/collab',
  '@codemirror/commands',
  '@codemirror/language',
  '@codemirror/lint',
  '@codemirror/search',
  '@codemirror/state',
  '@codemirror/text',
  '@codemirror/view',
  '@lezer/common',
  '@lezer/lr',
  '@lezer/highlight'];


  const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  '@codemirror/closebrackets',
  '@codemirror/comment',
  '@codemirror/fold',
  '@codemirror/gutter',
  '@codemirror/highlight',
  '@codemirror/history',
  '@codemirror/matchbrackets',
  '@codemirror/panel',
  '@codemirror/rangeset',
  '@codemirror/rectangular-selection',
  '@codemirror/stream-parser',
  '@codemirror/tooltip'];


  function requirePatched(id) {
    if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
      return originalRequire?.(id);
    }

    // eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this  -- Need access to app. Actively use globalThis.
    if (globalThis.app.isMobile) {
      if (id === 'process' || id === 'node:process') {
        // eslint-disable-next-line no-console -- Valid usage.
        console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
        // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
        return globalThis.process;
      }
    } else {
      const module = originalRequire?.(id);
      if (module) {
        return extractDefault(module);
      }
    }

    // eslint-disable-next-line no-console -- Valid usage.
    console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
    return {};
  }
})();

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var command_handlers_exports = {};
__export(command_handlers_exports, {
  "abstract-file-command-handler": () => abstract_file_command_handler,
  "command-handler": () => command_handler,
  "command-handler-component": () => command_handler_component,
  "editor-command-handler": () => editor_command_handler,
  "file-command-handler": () => file_command_handler,
  "folder-command-handler": () => folder_command_handler,
  "global-command-handler": () => global_command_handler,
  "open-settings-command-handler": () => open_settings_command_handler
});
module.exports = __toCommonJS(command_handlers_exports);
var abstract_file_command_handler = __toESM(__extractDefault(require('./abstract-file-command-handler.cjs')), 1);
var command_handler_component = __toESM(__extractDefault(require('./command-handler-component.cjs')), 1);
var command_handler = __toESM(__extractDefault(require('./command-handler.cjs')), 1);
var editor_command_handler = __toESM(__extractDefault(require('./editor-command-handler.cjs')), 1);
var file_command_handler = __toESM(__extractDefault(require('./file-command-handler.cjs')), 1);
var folder_command_handler = __toESM(__extractDefault(require('./folder-command-handler.cjs')), 1);
var global_command_handler = __toESM(__extractDefault(require('./global-command-handler.cjs')), 1);
var open_settings_command_handler = __toESM(__extractDefault(require('./open-settings-command-handler.cjs')), 1);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  "abstract-file-command-handler": null,
  "command-handler": null,
  "command-handler-component": null,
  "editor-command-handler": null,
  "file-command-handler": null,
  "folder-command-handler": null,
  "global-command-handler": null,
  "open-settings-command-handler": null
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbW1hbmQtaGFuZGxlcnMvaW5kZXgudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qIFRISVMgSVMgQSBHRU5FUkFURUQvQlVORExFRCBGSUxFIEJZIEJVSUxEIFNDUklQVCAqL1xuXG5leHBvcnQgKiBhcyAnYWJzdHJhY3QtZmlsZS1jb21tYW5kLWhhbmRsZXInIGZyb20gJy4vYWJzdHJhY3QtZmlsZS1jb21tYW5kLWhhbmRsZXIudHMnO1xuZXhwb3J0ICogYXMgJ2NvbW1hbmQtaGFuZGxlci1jb21wb25lbnQnIGZyb20gJy4vY29tbWFuZC1oYW5kbGVyLWNvbXBvbmVudC50cyc7XG5leHBvcnQgKiBhcyAnY29tbWFuZC1oYW5kbGVyJyBmcm9tICcuL2NvbW1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