{"version":3,"file":"index.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/Meta.ts","../src/helpers/h-demi.ts","../src/index.ts"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type MetaInterface from '@/interfaces/MetaInterface';\n\nconst Meta: MetaInterface = {\n  version: __APP_VERSION__,\n  date: __BUILD_DATE__,\n};\n\nexport default Meta;\n","/**\n * h-demi - h function for Vue 2 and 3\n *\n * @see {@link https://github.com/vueuse/vue-demi/issues/65}\n */\n\nimport {\n  h as hDemi,\n  isVue2,\n  type Component,\n  type VNode,\n  type VNodeProps,\n} from 'vue-demi';\n\ninterface Options extends VNodeProps {\n  class?: string;\n  domProps?: VNodeProps;\n  on?: Record<string, () => void>;\n  props?: VNodeProps;\n  style?: string;\n  'aria-hidden'?: string;\n}\n\nconst adaptOnsV3 = (\n  ons: Record<string, () => void>\n): Record<string, () => void> => {\n  if (!ons) return {};\n  return Object.entries(ons).reduce((ret, [key, handler]) => {\n    key = key.charAt(0).toUpperCase() + key.slice(1);\n    key = `on${key}`;\n    return { ...ret, [key]: handler };\n  }, {});\n};\n\n/**\n * hDemi function.\n */\nexport default function h(\n  type: string | Component,\n  options: Options = {},\n  children?: VNode | VNode[]\n): VNode {\n  if (isVue2) {\n    // Makeshift support :(\n    // Since Vue2.7 includes the Composition API, the functions in vue-demi are not used.\n    return hDemi(type, options, children);\n  }\n  const { props, domProps, on, ...extraOptions } = options;\n  const ons = on ? adaptOnsV3(on) : {};\n\n  return hDemi(\n    type,\n    { ...extraOptions, ...props, ...domProps, ...ons },\n    children\n  );\n}\n\nexport const slot = (\n  defaultSlots: (() => VNode[]) | VNode[] | undefined\n): VNode[] =>\n  typeof defaultSlots === 'function' ? defaultSlots() : (defaultSlots ?? []);\n","import { indentWithTab } from '@codemirror/commands';\nimport { indentUnit, type LanguageSupport } from '@codemirror/language';\nimport {\n  diagnosticCount as linterDiagnosticCount,\n  forceLinting,\n  linter,\n  lintGutter,\n  type Diagnostic,\n  type LintSource,\n} from '@codemirror/lint';\nimport {\n  Compartment,\n  EditorSelection,\n  EditorState,\n  StateEffect,\n  type Transaction,\n  type Extension,\n  type SelectionRange,\n  type StateField,\n  type Text,\n} from '@codemirror/state';\nimport {\n  EditorView,\n  keymap,\n  placeholder,\n  type KeyBinding,\n  type ViewUpdate,\n} from '@codemirror/view';\nimport { basicSetup, minimalSetup } from 'codemirror';\nimport {\n  computed,\n  defineComponent,\n  nextTick,\n  onMounted,\n  onUnmounted,\n  ref,\n  shallowRef,\n  watch,\n  type App,\n  type ComputedRef,\n  type PropType,\n  type Ref,\n  type ShallowRef,\n  type WritableComputedRef,\n} from 'vue-demi';\n\nimport type { StyleSpec } from 'style-mod';\n\nimport Meta from '@/Meta';\nimport h, { slot } from '@/helpers/h-demi';\n\n/** CodeMirror Component */\nconst CodeMirror = defineComponent({\n  /** Component Name */\n  name: 'CodeMirror',\n  /** Model Definition */\n  model: {\n    prop: 'modelValue',\n    event: 'update:modelValue',\n  },\n  /** Props Definition */\n  props: {\n    /** Model value */\n    modelValue: {\n      type: String as PropType<string | Text>,\n      default: '',\n    },\n    /**\n     * Theme\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView^theme}\n     */\n    theme: {\n      type: Object as PropType<Record<string, StyleSpec>>,\n      default: () => {\n        return {};\n      },\n    },\n    /** Dark Mode */\n    dark: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Use Basic Setup\n     *\n     * This will enable the basic setup for the editor.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup}\n     */\n    basic: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Use Minimal Setup (The basic setting has priority.)\n     *\n     * @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup}\n     */\n    minimal: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Placeholder\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.placeholder}\n     */\n    placeholder: {\n      type: String as PropType<string | HTMLElement>,\n      default: undefined,\n    },\n    /**\n     * Line wrapping\n     *\n     * An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView%5ElineWrapping}\n     */\n    wrap: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Allow tab key indent.\n     *\n     * This will enable the tab key to indent the current line or selection.\n     *\n     * @see {@link https://codemirror.net/examples/tab/}\n     */\n    tab: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Tab character\n     *\n     * This is the unit of indentation used when the editor is configured to indent with tabs.\n     * It is also used to determine the size of the tab character when the editor is configured to use tabs for indentation..\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorState^indentUnit}\n     */\n    indentUnit: {\n      type: String,\n      default: undefined,\n    },\n    /**\n     * Allow Multiple Selection.\n     *\n     * This allows the editor to have multiple selections at the same time.\n     * This is useful for editing multiple parts of the document at once.\n     * If this is set to true, the editor will allow multiple selections.\n     * If this is set to false, the editor will only allow a single selection.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorState^allowMultipleSelections}\n     */\n    allowMultipleSelections: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Tab size\n     *\n     * This is the number of spaces that a tab character represents in the editor.\n     * It is used to determine the size of the tab character when the editor is configured to use tabs for indentation.\n     * If this is set to a number, the editor will use that number of spaces for each tab character.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorState^tabSize}\n     */\n    tabSize: {\n      type: Number,\n      default: undefined,\n    },\n    /**\n     * Set line break (separetor) char.\n     *\n     * This is the character that is used to separate lines in the editor.\n     * It is used to determine the line break character when the editor is configured to use a specific line break character.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorState^lineSeparator}\n     */\n    lineSeparator: {\n      type: String,\n      default: undefined,\n    },\n    /**\n     * Readonly\n     *\n     * This is a CodeMirror Facet that allows you to set the editor to read-only mode.\n     * When this is set to true, the editor will not allow any changes to be made to the document.\n     * This is useful for displaying code that should not be edited, such as documentation or examples.\n     * If this is set to false, the editor will allow changes to be made to the document.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorState^readOnly}\n     */\n    readonly: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Disable input.\n     *\n     * This is the reversed value of the CodeMirror editable.\n     * Similar to `readonly`, but setting this value to true disables dragging.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView^editable}\n     */\n    disabled: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Additional Extension\n     *\n     * You can use this to add any additional extensions that you want to use in the editor.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.Extension}\n     */\n    extensions: {\n      type: Array as PropType<Extension[]>,\n      default: () => {\n        return [];\n      },\n    },\n    /**\n     * Language Phreses\n     *\n     * This is a CodeMirror Facet that allows you to define custom phrases for the editor.\n     * It can be used to override default phrases or add new ones.\n     * This is useful for translating the editor to different languages or for customizing the editor's UI.\n     *\n     * @see {@link https://codemirror.net/examples/translate/}\n     */\n    phrases: {\n      type: Object as PropType<Record<string, string>>,\n      default: undefined,\n    },\n    /**\n     * CodeMirror Language\n     *\n     * This is a CodeMirror Facet that allows you to define the language of the editor.\n     * It can be used to enable syntax highlighting and other language-specific features.\n     * It is useful for displaying code in a specific language, such as JavaScript, Python, or HTML.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#language}\n     */\n    lang: {\n      type: Object as PropType<LanguageSupport>,\n      default: undefined,\n    },\n    /**\n     * CodeMirror Linter\n     *\n     * This is a CodeMirror Facet that allows you to define a linter for the editor.\n     * It can be used to check the code for errors and warnings, and to provide feedback to the user.\n     * It is useful for displaying code in a specific language, such as JavaScript, Python, or HTML.\n     * This is useful for providing feedback to the user about the code they are writing.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.linter}\n     */\n    linter: {\n      type: Function as PropType<LintSource>,\n      default: undefined,\n    },\n    /**\n     * Linter Config\n     *\n     * This is a CodeMirror Facet that allows you to define the configuration for the linter.\n     * It can be used to specify options for the linter, such as the severity of errors and warnings, and to customize the behavior of the linter.\n     * This is useful for providing feedback to the user about the code they are writing.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.linter^config}\n     */\n    linterConfig: {\n      type: Object,\n      default: () => {\n        return {};\n      },\n    },\n    /**\n     * Forces any linters configured to run when the editor is idle to run right away.\n     *\n     * This is useful for running linters on the initial load of the editor, or when the user has made changes to the code and wants to see the results immediately.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.forceLinting}\n     */\n    forceLinting: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Show Linter Gutter\n     *\n     * An area to 🔴 the lines with errors will be displayed.\n     * This feature is not enabled if `linter` is not specified.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter}\n     */\n    gutter: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Gutter Config\n     *\n     * This is a CodeMirror Facet that allows you to define the configuration for the gutter.\n     * It can be used to specify options for the gutter, such as the size of the gutter, the position of the gutter, and to customize the behavior of the gutter.\n     * This is useful for providing feedback to the user about the code they are writing.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}\n     */\n    gutterConfig: {\n      type: Object,\n      default: undefined,\n    },\n    /**\n     * Using tag\n     */\n    tag: {\n      type: String,\n      default: 'div',\n    },\n    /**\n     * Allows an external update to scroll the form.\n     *\n     * This is useful for scrolling the editor to a specific position when the user has made changes to the code and wants to see the results immediately.\n     * If this is set to true, the editor will scroll to the position specified in the transaction.\n     * If this is set to false, the editor will not scroll to the position specified in the transaction.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.TransactionSpec.scrollIntoView}\n     */\n    scrollIntoView: {\n      type: Boolean,\n      default: true,\n    },\n    /**\n     * Preserve the current scroll position on external updates.\n     *\n     * This keeps the editor's own scroll container from jumping when\n     * `modelValue` is updated from outside the component.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView.scrollSnapshot}\n     */\n    preserveScrollPosition: {\n      type: Boolean,\n      default: false,\n    },\n    /**\n     * Key map\n     * This is a CodeMirror Facet that allows you to define custom key bindings.\n     * It can be used to override default key bindings or add new ones.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.keymap}\n     */\n    keymap: {\n      type: Array as PropType<KeyBinding[]>,\n      default: () => [],\n    },\n  },\n  /** Emits */\n  emits: {\n    /** Model Update */\n    'update:modelValue': (_value: string | Text = '') => true,\n    /** CodeMirror ViewUpdate */\n    update: (_value: ViewUpdate) => true,\n    /** CodeMirror onReady */\n    ready: (_value: {\n      view: EditorView;\n      state: EditorState;\n      container: HTMLElement;\n    }) => true,\n    /** CodeMirror onFocus */\n    focus: (_value: boolean) => true,\n    /** State Changed */\n    change: (_value: EditorState) => true,\n    /** CodeMirror onDestroy */\n    destroy: () => true,\n  },\n  /**\n   * Setup\n   *\n   * @param props  - Props\n   * @param context - Context\n   */\n  setup(props, context) {\n    /** Editor DOM */\n    const editor: Ref<HTMLElement | undefined> = ref();\n\n    /** Internal value */\n    const doc: Ref<string | Text> = ref(props.modelValue);\n\n    /**\n     * CodeMirror Editor View\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView}\n     */\n    const view: ShallowRef<EditorView | undefined> = shallowRef(undefined);\n\n    /**\n     * Focus\n     *\n     * @see {@link https://codemirror.net/docs/ref/#view.EditorView.hasFocus}\n     */\n    const focus: WritableComputedRef<boolean> = computed({\n      get: () => view.value?.hasFocus ?? false,\n      set: f => {\n        if (f && view.value) {\n          view.value.focus();\n        }\n      },\n    });\n\n    /**\n     * Editor Selection\n     *\n     * @see {@link https://codemirror.net/docs/ref/#state.EditorSelection}\n     */\n    const selection: WritableComputedRef<EditorSelection | undefined> =\n      computed({\n        get: () => view.value?.state.selection,\n        set: selection => {\n          if (view.value && selection) {\n            view.value.dispatch({ selection });\n          }\n        },\n      });\n\n    /** Cursor Position */\n    const cursor: WritableComputedRef<number> = computed({\n      get: () => view.value?.state.selection.main.head ?? 0,\n      set: anchor => {\n        if (view.value) {\n          view.value.dispatch({ selection: { anchor } });\n        }\n      },\n    });\n\n    /** JSON */\n    const json: WritableComputedRef<\n      Record<string, StateField<unknown>> | undefined\n    > = computed({\n      get: () => view.value?.state.toJSON(),\n      set: j => {\n        if (view.value && j) {\n          view.value.setState(EditorState.fromJSON(j));\n        }\n      },\n    });\n\n    /** Text length */\n    const length: Ref<number> = ref(0);\n\n    /**\n     * Returns the number of active lint diagnostics in the given state.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.diagnosticCount}\n     */\n    const diagnosticCount: Ref<number> = ref(0);\n\n    /** Get CodeMirror Extension */\n    const extensions: ComputedRef<Extension[]> = computed(() => {\n      // Synamic Reconfiguration\n      // @see https://codemirror.net/examples/config/\n      const language = new Compartment();\n      const tabSize = new Compartment();\n      if (props.basic && props.minimal) {\n        throw new Error(\n          '[Vue CodeMirror] Both basic and minimal cannot be specified.'\n        );\n      }\n      /** Keymap */\n      let keymaps: KeyBinding[] = [];\n      if (props.keymap && props.keymap.length > 0) {\n        // If keymap is specified, use it.\n        keymaps = props.keymap;\n      }\n      if (props.tab) {\n        // If tab is enabled, add indentWithTab to keymap.\n        keymaps.push(indentWithTab);\n      }\n\n      // TODO: Ignore previous prop was not changed.\n      return [\n        // Toggle basic setup\n        props.basic && !props.minimal ? basicSetup : undefined,\n        // Toggle minimal setup\n        props.minimal && !props.basic ? minimalSetup : undefined,\n        // ViewUpdate event listener\n        EditorView.updateListener.of((update: ViewUpdate): void => {\n          if (!view.value) {\n            return;\n          }\n          // Emit focus status\n          context.emit('focus', view.value.hasFocus);\n\n          // Update count\n          length.value = view.value.state.doc?.length;\n\n          if (update.changes.empty || !update.docChanged) {\n            // Suppress event firing if no change\n            return;\n          }\n          if (props.linter) {\n            // Linter process\n            if (props.forceLinting) {\n              // If forceLinting enabled, first liting.\n              forceLinting(view.value);\n            }\n            // Count diagnostics.\n            diagnosticCount.value = (\n              props.linter(view.value) as readonly Diagnostic[]\n            ).length;\n          }\n          context.emit('update', update);\n        }),\n        // Toggle light/dark mode.\n        EditorView.theme(props.theme, { dark: props.dark }),\n        // Toggle line wrapping\n        props.wrap ? EditorView.lineWrapping : undefined,\n        // Tab character\n        props.indentUnit ? indentUnit.of(props.indentUnit) : undefined,\n        // Allow Multiple Selections\n        EditorState.allowMultipleSelections.of(props.allowMultipleSelections),\n        // Indent tab size\n        props.tabSize\n          ? tabSize.of(EditorState.tabSize.of(props.tabSize))\n          : undefined,\n        // locale settings\n        props.phrases ? EditorState.phrases.of(props.phrases) : undefined,\n        // Readonly option\n        EditorState.readOnly.of(props.readonly),\n        // Editable option\n        EditorView.editable.of(!props.disabled),\n        // Set Line break char\n        props.lineSeparator\n          ? EditorState.lineSeparator.of(props.lineSeparator)\n          : undefined,\n        // Lang\n        props.lang ? language.of(props.lang) : undefined,\n        // Append Linter settings\n        props.linter ? linter(props.linter, props.linterConfig) : undefined,\n        // Show 🔴 to error line when linter enabled.\n        props.linter && props.gutter\n          ? lintGutter(props.gutterConfig)\n          : undefined,\n        // Placeholder\n        props.placeholder ? placeholder(props.placeholder) : undefined,\n        // Keymap and Indent with Tab\n        keymaps.length > 0 ? keymap.of(keymaps) : undefined,\n        // Append Extensions\n        ...props.extensions,\n      ].filter((extension): extension is Extension => !!extension); // Filter undefined\n    });\n\n    // Extension (mostly props) Changed\n    watch(\n      extensions,\n      exts =>\n        view.value?.dispatch({ effects: StateEffect.reconfigure.of(exts) }),\n      { immediate: true }\n    );\n\n    // for parent-to-child binding.\n    watch(\n      () => props.modelValue,\n      async value => {\n        if (!view.value) {\n          return;\n        }\n        if (\n          view.value.composing || // IME fix\n          view.value.state.doc.toJSON().join(props.lineSeparator ?? '\\n') ===\n            value // don't need to update\n        ) {\n          // Do not commit CodeMirror's store.\n          return;\n        }\n\n        // Range Fix ?\n        // https://github.com/logue/vue-codemirror6/issues/27\n        const isSelectionOutOfRange = !view.value.state.selection.ranges.every(\n          range => range.anchor < value.length && range.head < value.length\n        );\n\n        /** Scroll Fix */\n        const changes = {\n          from: 0,\n          to: view.value.state.doc.length,\n          insert: value,\n        };\n        // If preserveScrollPosition is enabled, create a scroll snapshot before updating the document.\n        const scrollSnapshot = props.preserveScrollPosition\n          ? view.value.scrollSnapshot().map(view.value.state.changes(changes))\n          : undefined;\n\n        // Update\n        view.value.dispatch({\n          changes,\n          selection: isSelectionOutOfRange\n            ? { anchor: 0, head: 0 }\n            : view.value.state.selection,\n          scrollIntoView: props.scrollIntoView,\n          effects: scrollSnapshot ? [scrollSnapshot] : undefined,\n        });\n      },\n      { immediate: true }\n    );\n\n    /** When loaded */\n    onMounted(async () => {\n      // Skip initialization in SSR environment\n      if (globalThis.window === undefined || !editor.value) {\n        return;\n      }\n\n      /** Initial value */\n      let value: string | Text = doc.value;\n\n      if (editor.value.childNodes[0]) {\n        // when slot mode, overwrite initial value\n        if (doc.value !== '') {\n          console.warn(\n            '[CodeMirror.vue] The <code-mirror> tag contains child elements that overwrite the `v-model` values.'\n          );\n        }\n        value = (editor.value.childNodes[0] as HTMLElement).innerText.trim();\n      }\n\n      // Register Codemirror\n      view.value = new EditorView({\n        parent: editor.value,\n        state: EditorState.create({ doc: value, extensions: extensions.value }),\n        dispatch: (tr: Transaction) => {\n          if (!view.value) {\n            return;\n          }\n          view.value.update([tr]);\n          if (tr.changes.empty || !tr.docChanged) {\n            // if not change value, no fire emit event\n            return;\n          }\n\n          // console.log(view.state.doc.toString(), tr);\n          // state.toString() is not defined, so use toJSON and toText function to convert string.\n          context.emit('update:modelValue', tr.state.doc.toString());\n          // Emit EditorState\n          context.emit('change', tr.state);\n        },\n      });\n\n      await nextTick();\n\n      context.emit('ready', {\n        view: view.value,\n        state: view.value.state,\n        container: editor.value,\n      });\n    });\n\n    /** Destroy */\n    onUnmounted(() => {\n      if (view.value) {\n        view.value.destroy();\n        context.emit('destroy');\n      }\n    });\n\n    /**\n     * Forces any linters configured to run when the editor is idle to run right away.\n     *\n     * @see {@link https://codemirror.net/docs/ref/#lint.forceLinting}\n     */\n    const lint = (): void => {\n      if (!props.linter || !view.value) {\n        return;\n      }\n      if (props.forceLinting) {\n        forceLinting(view.value);\n      }\n      diagnosticCount.value = linterDiagnosticCount(view.value.state);\n    };\n\n    /**\n     * Force Reconfigure Extension\n     *\n     * @see {@link https://codemirror.net/examples/config/#top-level-reconfiguration}\n     */\n    const forceReconfigure = (): void => {\n      // Deconfigure all Extensions\n      view.value?.dispatch({\n        effects: StateEffect.reconfigure.of([]),\n      });\n      // Register extensions\n      view.value?.dispatch({\n        effects: StateEffect.appendConfig.of(extensions.value),\n      });\n    };\n\n    /* ----- Bellow is experimental. ------ */\n\n    /**\n     * Get the text between the given points in the editor.\n     *\n     * @param from - start line number\n     * @param to - end line number\n     */\n    const getRange = (from?: number, to?: number): string | undefined =>\n      view.value?.state.sliceDoc(from, to);\n    /**\n     * Get the content of line.\n     *\n     * @param number - line number\n     */\n    const getLine = (number: number): string | undefined =>\n      view.value?.state.doc.line(number + 1).text;\n    /** Get the number of lines in the editor. */\n    const lineCount = (): number => view.value?.state.doc.lines ?? 0;\n    /** Retrieve one end of the primary selection. */\n    const getCursor = (): number => view.value?.state.selection.main.head ?? 0;\n    /** Retrieves a list of all current selections. */\n    const listSelections = (): readonly SelectionRange[] => {\n      return view.value?.state.selection.ranges ?? [];\n    };\n    /** Get the currently selected code. */\n    const getSelection = (): string => {\n      if (!view.value) {\n        return '';\n      }\n      return view.value.state.sliceDoc(\n        view.value.state.selection.main.from,\n        view.value.state.selection.main.to\n      );\n    };\n    /**\n     * The length of the given array should be the same as the number of active selections.\n     * Replaces the content of the selections with the strings in the array.\n     */\n    const getSelections = (): string[] => {\n      const s = view.value?.state;\n      if (!s) {\n        return [];\n      }\n\n      return s.selection.ranges.map((r: { from: number; to: number }) =>\n        s.sliceDoc(r.from, r.to)\n      );\n    };\n    /** Return true if any text is selected. */\n    const somethingSelected = (): boolean =>\n      view.value?.state.selection.ranges.some(\n        (r: { empty: boolean }) => !r.empty\n      ) ?? false;\n\n    /**\n     * Replace the part of the document between from and to with the given string.\n     *\n     * @param replacement - replacement text\n     * @param from - start string at position\n     * @param to -  insert the string at position\n     */\n    const replaceRange = (\n      replacement: string | Text,\n      from: number,\n      to: number\n    ): void => {\n      if (view.value) {\n        view.value.dispatch({\n          changes: { from, to, insert: replacement },\n        });\n      }\n    };\n    /**\n     * Replace the selection(s) with the given string.\n     * By default, the new selection ends up after the inserted text.\n     *\n     * @param replacement - replacement text\n     */\n    const replaceSelection = (replacement: string | Text): void => {\n      if (view.value) {\n        view.value.dispatch(view.value.state.replaceSelection(replacement));\n      }\n    };\n    /**\n     * Set the cursor position.\n     *\n     * @param position - position.\n     */\n    const setCursor = (position: number): void => {\n      if (view.value) {\n        view.value.dispatch({ selection: { anchor: position } });\n      }\n    };\n    /**\n     * Set a single selection range.\n     *\n     * @param anchor - anchor position\n     * @param head -\n     */\n    const setSelection = (anchor: number, head?: number): void => {\n      if (view.value) {\n        view.value.dispatch({ selection: { anchor, head } });\n      }\n    };\n    /**\n     * Sets a new set of selections. There must be at least one selection in the given array.\n     *\n     * @param ranges - Selection range\n     * @param primary -\n     */\n    const setSelections = (\n      ranges: readonly SelectionRange[],\n      primary?: number\n    ): void => {\n      if (view.value) {\n        view.value.dispatch({\n          selection: EditorSelection.create(ranges, primary),\n        });\n      }\n    };\n    /**\n     * Applies the given function to all existing selections, and calls extendSelections on the result.\n     *\n     * @param f - function\n     */\n    const extendSelectionsBy = (f: (range: SelectionRange) => number): void => {\n      if (view.value && selection.value) {\n        view.value.dispatch({\n          selection: EditorSelection.create(\n            selection.value.ranges.map((r: SelectionRange) => r.extend(f(r)))\n          ),\n        });\n      }\n    };\n\n    const exposed = {\n      editor,\n      view,\n      cursor,\n      selection,\n      focus,\n      length,\n      json,\n      diagnosticCount,\n      dom: view.value?.contentDOM,\n      lint,\n      forceReconfigure,\n      // Bellow is CodeMirror5's function\n      getRange,\n      getLine,\n      lineCount,\n      getCursor,\n      listSelections,\n      getSelection,\n      getSelections,\n      somethingSelected,\n      replaceRange,\n      replaceSelection,\n      setCursor,\n      setSelection,\n      setSelections,\n      extendSelectionsBy,\n    };\n\n    /** Export properties and functions */\n    context.expose(exposed);\n    return exposed;\n  },\n  render() {\n    // <template>\n    //   <div ref=\"editor\" class=\"vue-codemirror\">\n    //     <aside v-show=\"!context.slots.default\" aria-hidden><slot /></aside>\n    //   </div>\n    // </template>\n    return h(\n      this.$props.tag,\n      {\n        ref: 'editor',\n        class: 'vue-codemirror',\n      },\n      this.$slots.default\n        ? // Hide original content\n          h(\n            'aside',\n            { style: 'display: none;', 'aria-hidden': 'true' },\n            slot(this.$slots.default)\n          )\n        : undefined\n    );\n  },\n});\n\nconst installCodeMirror = (app: App): void => {\n  app.component('CodeMirror', CodeMirror);\n};\n\n/** Public API exposed from the CodeMirror component instance.\n * Note: Vue 3 auto-unwraps refs on the component instance proxy,\n * so reactive refs appear as their underlying value types here.\n */\nexport type CodeMirrorExposed = {\n  editor: HTMLElement | undefined;\n  view: EditorView | undefined;\n  cursor: number;\n  selection: EditorSelection | undefined;\n  focus: boolean;\n  length: number;\n  json: Record<string, StateField<unknown>> | undefined;\n  diagnosticCount: number;\n  dom: Element | undefined;\n  lint: () => void;\n  forceReconfigure: () => void;\n  getRange: (from?: number, to?: number) => string | undefined;\n  getLine: (number: number) => string | undefined;\n  lineCount: () => number;\n  getCursor: () => number;\n  listSelections: () => readonly SelectionRange[];\n  getSelection: () => string;\n  getSelections: () => string[];\n  somethingSelected: () => boolean;\n  replaceRange: (replacement: string | Text, from: number, to: number) => void;\n  replaceSelection: (replacement: string | Text) => void;\n  setCursor: (position: number) => void;\n  setSelection: (anchor: number, head?: number) => void;\n  setSelections: (ranges: readonly SelectionRange[], primary?: number) => void;\n  extendSelectionsBy: (f: (range: SelectionRange) => number) => void;\n};\n\nexport { CodeMirror as default, installCodeMirror as install, Meta };\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","Meta","__APP_VERSION__","__BUILD_DATE__","adaptOnsV3","ons","ret","handler","h","type","options","children","isVue2","hDemi","props","domProps","on","extraOptions","slot","defaultSlots","CodeMirror","defineComponent","String","Boolean","undefined","Number","Array","Function","_value","context","editor","ref","doc","view","shallowRef","focus","computed","f","selection","cursor","anchor","json","j","EditorState","length","diagnosticCount","extensions","language","Compartment","tabSize","Error","keymaps","indentWithTab","basicSetup","minimalSetup","EditorView","update","forceLinting","indentUnit","linter","lintGutter","placeholder","keymap","extension","watch","exts","StateEffect","value","isSelectionOutOfRange","range","changes","scrollSnapshot","onMounted","globalThis","console","tr","nextTick","onUnmounted","lint","linterDiagnosticCount","forceReconfigure","getRange","from","to","getLine","number","lineCount","getCursor","listSelections","getSelection","getSelections","s","r","somethingSelected","replaceRange","replacement","replaceSelection","setCursor","position","setSelection","head","setSelections","ranges","primary","EditorSelection","extendSelectionsBy","exposed","installCodeMirror","app"],"mappings":";;;;;;;;;;;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAA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