/*
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 time_component_exports = {};
__export(time_component_exports, {
  TimeComponent: () => TimeComponent
});
module.exports = __toCommonJS(time_component_exports);
var import_obsidian = require('obsidian');
var import_css_class = require('../../css-class.cjs');
var import_typed_range_text_component = require('./typed-range-text-component.cjs');
class TimeComponent extends import_typed_range_text_component.TypedRangeTextComponent {
  /**
   * Creates a new time component.
   *
   * @param containerEl - The container element of the component.
   */
  constructor(containerEl) {
    super(containerEl, "time", import_css_class.CssClass.TimeComponent);
  }
  /**
   * Converts a string to a time.
   *
   * @param str - The string to convert.
   * @returns The date.
   */
  valueFromString(str) {
    return import_obsidian.moment.duration(str);
  }
  /**
   * Converts a time to a string.
   *
   * @param value - The time to convert.
   * @returns The string.
   */
  valueToString(value) {
    let format;
    if (value.milliseconds() > 0) {
      format = "HH:mm:ss.SSS";
    } else if (value.seconds() > 0) {
      format = "HH:mm:ss";
    } else {
      format = "HH:mm";
    }
    return import_obsidian.moment.utc(value.asMilliseconds()).format(format);
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TimeComponent
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL3NldHRpbmctY29tcG9uZW50cy90aW1lLWNvbXBvbmVudC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIENvbnRhaW5zIGEgY29tcG9uZW50IHRoYXQgZGlzcGxheXMgYW5kIGVkaXRzIGEgdGltZS5cbiAqL1xuXG5pbXBvcnQgeyBtb21lbnQgfSBmcm9tICdvYnNpZGlhbic7XG5cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgLS0gV2UgbmVlZCB0byBpbXBvcnQgYGluaXRQbHVnaW5Db250ZXh0YCB0byB1c2UgaXQgaW4gdGhlIHRzZG9jcy5cbmltcG9ydCB0eXBlIHsgaW5pdFBsdWdpbkNvbnRleHQgfSBmcm9tICcuLi9wbHVnaW4vcGx1Z2luLWNvbnRleHQudHMnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnVzZWQtdmFycyAtLSBXZSBuZWVkIHRvIGltcG9ydCBgU2V0dGluZ0V4YCB0byB1c2UgaXQgaW4gdGhlIHRzZG9jcy5cbmltcG9ydCB0eXBlIHsgU2V0dGluZ0V4IH0gZnJvbSAnLi4vc2V0dGluZy1leC50cyc7XG5cbmltcG9ydCB7IENzc0NsYXNzIH0gZnJvbSAnLi4vLi4vY3NzLWNsYXNzLnRzJztcbmltcG9ydCB7IFR5cGVkUmFu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