/*
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 __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var frontmatter_link_cache_with_offsets_exports = {};
__export(frontmatter_link_cache_with_offsets_exports, {
  isFrontmatterLinkCacheWithOffsets: () => isFrontmatterLinkCacheWithOffsets,
  toFrontmatterLinkCacheWithOffsets: () => toFrontmatterLinkCacheWithOffsets
});
module.exports = __toCommonJS(frontmatter_link_cache_with_offsets_exports);
var import_implementations = require('@obsidian-typings/obsidian-public-latest/implementations');
function isFrontmatterLinkCacheWithOffsets(reference) {
  if (!(0, import_implementations.isFrontmatterLinkCache)(reference)) {
    return false;
  }
  const frontmatterLinkCacheWithOffsets = reference;
  return frontmatterLinkCacheWithOffsets.startOffset !== void 0 && frontmatterLinkCacheWithOffsets.endOffset !== void 0;
}
function toFrontmatterLinkCacheWithOffsets(reference) {
  if (isFrontmatterLinkCacheWithOffsets(reference)) {
    return reference;
  }
  return {
    ...reference,
    endOffset: reference.original.length,
    startOffset: 0
  };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  isFrontmatterLinkCacheWithOffsets,
  toFrontmatterLinkCacheWithOffsets
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2Zyb250bWF0dGVyLWxpbmstY2FjaGUtd2l0aC1vZmZzZXRzLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogVGhpcyBtb2R1bGUgcHJvdmlkZXMgYSB0eXBlIGZvciBmcm9udG1hdHRlciBsaW5rIGNhY2hlIHdpdGggb2Zmc2V0cy5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7XG4gIEZyb250bWF0dGVyTGlua0NhY2hlLFxuICBSZWZlcmVuY2Vcbn0gZnJvbSAnb2JzaWRpYW4nO1xuXG5pbXBvcnQgeyBpc0Zyb250bWF0dGVyTGlua0NhY2hlIH0gZnJvbSAnQG9ic2lkaWFuLXR5cGluZ3Mvb2JzaWRpYW4tcHVibGljLWxhdGVzdC9pbXBsZW1lbnRhdGlvbnMnO1xuXG4vKipcbiAqIFR5cGUgZm9yIGZyb250bWF0dGVyIGxpbmsgY2FjaGUgd2l0aCBvZmZzZXRzLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIEZyb250bWF0dGVyTGlua0NhY2hlV2l0aE9mZnNldHMgZXh0ZW5kcyBGcm9udG1hdHRlckxpbmtDYWNoZSB7XG4gIC8qKlxuICAgKiBBbiBlbmQgb2Zmc2V0IG9mIHRoZSBsaW5rIGluIHRoZSBwcm9wZXJ0eSB2YWx1ZS5cbiAgICovXG4gIGVuZE9mZnNldDogbnVtYmVyO1xuXG4gIC8qKlxuICAgKiBBIHN0YXJ0IG9mZnNldCBvZiB0aGUgbGluayBpbiB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