{"version":3,"file":"multi-file-upload.bundle.mjs","sources":["../../../../node_modules/govuk-frontend/dist/govuk/common/index.mjs","../../../../node_modules/govuk-frontend/dist/govuk/errors/index.mjs","../../../../node_modules/govuk-frontend/dist/govuk/component.mjs","../../../../node_modules/govuk-frontend/dist/govuk/common/configuration.mjs","../../../../src/moj/components/multi-file-upload/multi-file-upload.mjs"],"sourcesContent":["function getBreakpoint(name) {\n  const property = `--govuk-breakpoint-${name}`;\n  const value = window.getComputedStyle(document.documentElement).getPropertyValue(property);\n  return {\n    property,\n    value: value || undefined\n  };\n}\nfunction setFocus($element, options = {}) {\n  var _options$onBeforeFocu;\n  const isFocusable = $element.getAttribute('tabindex');\n  if (!isFocusable) {\n    $element.setAttribute('tabindex', '-1');\n  }\n  function onFocus() {\n    $element.addEventListener('blur', onBlur, {\n      once: true\n    });\n  }\n  function onBlur() {\n    var _options$onBlur;\n    (_options$onBlur = options.onBlur) == null || _options$onBlur.call($element);\n    if (!isFocusable) {\n      $element.removeAttribute('tabindex');\n    }\n  }\n  $element.addEventListener('focus', onFocus, {\n    once: true\n  });\n  (_options$onBeforeFocu = options.onBeforeFocus) == null || _options$onBeforeFocu.call($element);\n  $element.focus();\n}\nfunction isInitialised($root, moduleName) {\n  return $root instanceof HTMLElement && $root.hasAttribute(`data-${moduleName}-init`);\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nfunction isSupported($scope = document.body) {\n  if (!$scope) {\n    return false;\n  }\n  return $scope.classList.contains('govuk-frontend-supported');\n}\nfunction isArray(option) {\n  return Array.isArray(option);\n}\nfunction isObject(option) {\n  return !!option && typeof option === 'object' && !isArray(option);\n}\nfunction isScope($scope) {\n  return !!$scope && ($scope instanceof Element || $scope instanceof Document);\n}\nfunction formatErrorMessage(Component, message) {\n  return `${Component.moduleName}: ${message}`;\n}\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\nexport { formatErrorMessage, getBreakpoint, isInitialised, isObject, isScope, isSupported, setFocus };\n//# sourceMappingURL=index.mjs.map\n","import { isObject, formatErrorMessage } from '../common/index.mjs';\n\nclass GOVUKFrontendError extends Error {\n  constructor(...args) {\n    super(...args);\n    this.name = 'GOVUKFrontendError';\n  }\n}\nclass SupportError extends GOVUKFrontendError {\n  /**\n   * Checks if GOV.UK Frontend is supported on this page\n   *\n   * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n   */\n  constructor($scope = document.body) {\n    const supportMessage = 'noModule' in HTMLScriptElement.prototype ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet' : 'GOV.UK Frontend is not supported in this browser';\n    super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type=\"module\">`');\n    this.name = 'SupportError';\n  }\n}\nclass ConfigError extends GOVUKFrontendError {\n  constructor(...args) {\n    super(...args);\n    this.name = 'ConfigError';\n  }\n}\nclass ElementError extends GOVUKFrontendError {\n  constructor(messageOrOptions) {\n    let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';\n    if (isObject(messageOrOptions)) {\n      const {\n        component,\n        identifier,\n        element,\n        expectedType\n      } = messageOrOptions;\n      message = identifier;\n      message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';\n      if (component) {\n        message = formatErrorMessage(component, message);\n      }\n    }\n    super(message);\n    this.name = 'ElementError';\n  }\n}\nclass InitError extends GOVUKFrontendError {\n  constructor(componentOrMessage) {\n    const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\\`$root\\`) already initialised`);\n    super(message);\n    this.name = 'InitError';\n  }\n}\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n\nexport { ConfigError, ElementError, GOVUKFrontendError, InitError, SupportError };\n//# sourceMappingURL=index.mjs.map\n","import { isInitialised, isSupported } from './common/index.mjs';\nimport { InitError, ElementError, SupportError } from './errors/index.mjs';\n\nclass Component {\n  /**\n   * Returns the root element of the component\n   *\n   * @protected\n   * @returns {RootElementType} - the root element of component\n   */\n  get $root() {\n    return this._$root;\n  }\n  constructor($root) {\n    this._$root = void 0;\n    const childConstructor = this.constructor;\n    if (typeof childConstructor.moduleName !== 'string') {\n      throw new InitError(`\\`moduleName\\` not defined in component`);\n    }\n    if (!($root instanceof childConstructor.elementType)) {\n      throw new ElementError({\n        element: $root,\n        component: childConstructor,\n        identifier: 'Root element (`$root`)',\n        expectedType: childConstructor.elementType.name\n      });\n    } else {\n      this._$root = $root;\n    }\n    childConstructor.checkSupport();\n    this.checkInitialised();\n    const moduleName = childConstructor.moduleName;\n    this.$root.setAttribute(`data-${moduleName}-init`, '');\n  }\n  checkInitialised() {\n    const constructor = this.constructor;\n    const moduleName = constructor.moduleName;\n    if (moduleName && isInitialised(this.$root, moduleName)) {\n      throw new InitError(constructor);\n    }\n  }\n  static checkSupport() {\n    if (!isSupported()) {\n      throw new SupportError();\n    }\n  }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\nComponent.elementType = HTMLElement;\n\nexport { Component };\n//# sourceMappingURL=component.mjs.map\n","import { Component } from '../component.mjs';\nimport { ConfigError } from '../errors/index.mjs';\nimport { isObject, formatErrorMessage, isScope } from './index.mjs';\n\nconst configOverride = Symbol.for('configOverride');\nclass ConfigurableComponent extends Component {\n  [configOverride](param) {\n    return {};\n  }\n\n  /**\n   * Returns the root element of the component\n   *\n   * @protected\n   * @returns {ConfigurationType} - the root element of component\n   */\n  get config() {\n    return this._config;\n  }\n  constructor($root, config) {\n    super($root);\n    this._config = void 0;\n    const childConstructor = this.constructor;\n    if (!isObject(childConstructor.defaults)) {\n      throw new ConfigError(formatErrorMessage(childConstructor, 'Config passed as parameter into constructor but no defaults defined'));\n    }\n    const datasetConfig = normaliseDataset(childConstructor, this._$root.dataset);\n    this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {}, this[configOverride](datasetConfig), datasetConfig);\n  }\n}\nfunction normaliseString(value, property) {\n  const trimmedValue = value ? value.trim() : '';\n  let output;\n  let outputType = property == null ? void 0 : property.type;\n  if (!outputType) {\n    if (['true', 'false'].includes(trimmedValue)) {\n      outputType = 'boolean';\n    }\n    if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {\n      outputType = 'number';\n    }\n  }\n  switch (outputType) {\n    case 'boolean':\n      output = trimmedValue === 'true';\n      break;\n    case 'number':\n      output = Number(trimmedValue);\n      break;\n    default:\n      output = value;\n  }\n  return output;\n}\nfunction normaliseDataset(Component, dataset) {\n  if (!isObject(Component.schema)) {\n    throw new ConfigError(formatErrorMessage(Component, 'Config passed as parameter into constructor but no schema defined'));\n  }\n  const out = {};\n  const entries = Object.entries(Component.schema.properties);\n  for (const entry of entries) {\n    const [namespace, property] = entry;\n    const field = namespace.toString();\n    if (field in dataset) {\n      out[field] = normaliseString(dataset[field], property);\n    }\n    if ((property == null ? void 0 : property.type) === 'object') {\n      out[field] = extractConfigByNamespace(Component.schema, dataset, namespace);\n    }\n  }\n  return out;\n}\nfunction normaliseOptions(scopeOrOptions) {\n  let $scope = document;\n  let onError;\n  if (isObject(scopeOrOptions)) {\n    const options = scopeOrOptions;\n    if (isScope(options.scope) || options.scope === null) {\n      $scope = options.scope;\n    }\n    if (typeof options.onError === 'function') {\n      onError = options.onError;\n    }\n  }\n  if (isScope(scopeOrOptions)) {\n    $scope = scopeOrOptions;\n  } else if (scopeOrOptions === null) {\n    $scope = null;\n  } else if (typeof scopeOrOptions === 'function') {\n    onError = scopeOrOptions;\n  }\n  return {\n    scope: $scope,\n    onError\n  };\n}\nfunction mergeConfigs(...configObjects) {\n  const formattedConfigObject = {};\n  for (const configObject of configObjects) {\n    for (const key of Object.keys(configObject)) {\n      const option = formattedConfigObject[key];\n      const override = configObject[key];\n      if (isObject(option) && isObject(override)) {\n        formattedConfigObject[key] = mergeConfigs(option, override);\n      } else {\n        formattedConfigObject[key] = override;\n      }\n    }\n  }\n  return formattedConfigObject;\n}\nfunction validateConfig(schema, config) {\n  const validationErrors = [];\n  for (const [name, conditions] of Object.entries(schema)) {\n    const errors = [];\n    if (Array.isArray(conditions)) {\n      for (const {\n        required,\n        errorMessage\n      } of conditions) {\n        if (!required.every(key => !!config[key])) {\n          errors.push(errorMessage);\n        }\n      }\n      if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n        validationErrors.push(...errors);\n      }\n    }\n  }\n  return validationErrors;\n}\nfunction extractConfigByNamespace(schema, dataset, namespace) {\n  const property = schema.properties[namespace];\n  if ((property == null ? void 0 : property.type) !== 'object') {\n    return;\n  }\n  const newObject = {\n    [namespace]: {}\n  };\n  for (const [key, value] of Object.entries(dataset)) {\n    let current = newObject;\n    const keyParts = key.split('.');\n    for (const [index, name] of keyParts.entries()) {\n      if (isObject(current)) {\n        if (index < keyParts.length - 1) {\n          if (!isObject(current[name])) {\n            current[name] = {};\n          }\n          current = current[name];\n        } else if (key !== namespace) {\n          current[name] = normaliseString(value);\n        }\n      }\n    }\n  }\n  return newObject[namespace];\n}\n/**\n * Schema for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} Schema\n * @property {Record<keyof ConfigurationType, SchemaProperty | undefined>} properties - Schema properties\n * @property {SchemaCondition<ConfigurationType>[]} [anyOf] - List of schema conditions\n */\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n/**\n * Schema condition for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} SchemaCondition\n * @property {(keyof ConfigurationType)[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n * @property {Schema<ConfigurationType>} [schema] - The schema of the component configuration\n * @property {ConfigurationType} [defaults] - The default values of the configuration of the component\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>\n */\n/**\n * @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'\n */\n\nexport { ConfigurableComponent, configOverride, extractConfigByNamespace, mergeConfigs, normaliseDataset, normaliseOptions, normaliseString, validateConfig };\n//# sourceMappingURL=configuration.mjs.map\n","/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport { ConfigurableComponent } from 'govuk-frontend'\n\n/**\n * @augments {ConfigurableComponent<MultiFileUploadConfig>}\n */\nexport class MultiFileUpload extends ConfigurableComponent {\n  /**\n   * @param {Element | null} $root - HTML element to use for multi file upload\n   * @param {MultiFileUploadConfig} [config] - Multi file upload config\n   */\n  constructor($root, config = {}) {\n    super($root, config)\n\n    if (!MultiFileUpload.isSupported()) {\n      return this\n    }\n\n    const $feedbackContainer =\n      this.config.feedbackContainer.element ??\n      this.$root.querySelector(this.config.feedbackContainer.selector)\n\n    if (!$feedbackContainer || !($feedbackContainer instanceof HTMLElement)) {\n      return this\n    }\n\n    this.$feedbackContainer = $feedbackContainer\n\n    this.setupFileInput()\n    this.setupDropzone()\n    this.setupLabel()\n    this.setupStatusBox()\n\n    this.$root.addEventListener('click', this.onFileDeleteClick.bind(this))\n    this.$root.classList.add('moj-multi-file-upload--enhanced')\n  }\n\n  setupDropzone() {\n    this.$dropzone = document.createElement('div')\n    this.$dropzone.classList.add('moj-multi-file-upload__dropzone')\n\n    this.$dropzone.addEventListener('dragover', this.onDragOver.bind(this))\n    this.$dropzone.addEventListener('dragleave', this.onDragLeave.bind(this))\n    this.$dropzone.addEventListener('drop', this.onDrop.bind(this))\n\n    this.$fileInput.replaceWith(this.$dropzone)\n    this.$dropzone.appendChild(this.$fileInput)\n  }\n\n  setupLabel() {\n    const $label = document.createElement('label')\n    $label.setAttribute('for', this.$fileInput.id)\n    $label.classList.add('govuk-button', 'govuk-button--secondary')\n    $label.textContent = this.config.dropzoneButtonText\n\n    const $hint = document.createElement('p')\n    $hint.classList.add('govuk-body')\n    $hint.textContent = this.config.dropzoneHintText\n\n    this.$label = $label\n    this.$dropzone.append($hint)\n    this.$dropzone.append($label)\n  }\n\n  setupFileInput() {\n    this.$fileInput = /** @type {HTMLInputElement} */ (\n      this.$root.querySelector('.moj-multi-file-upload__input')\n    )\n    this.$fileInput.addEventListener('change', this.onFileChange.bind(this))\n    this.$fileInput.addEventListener('focus', this.onFileFocus.bind(this))\n    this.$fileInput.addEventListener('blur', this.onFileBlur.bind(this))\n  }\n\n  setupStatusBox() {\n    this.$status = document.createElement('div')\n    this.$status.classList.add('govuk-visually-hidden')\n    this.$status.setAttribute('aria-live', 'polite')\n    this.$status.setAttribute('role', 'status')\n    this.$dropzone.append(this.$status)\n  }\n\n  /**\n   * @param {DragEvent} event - Drag event\n   */\n  onDragOver(event) {\n    event.preventDefault()\n    this.$dropzone.classList.add('moj-multi-file-upload--dragover')\n  }\n\n  onDragLeave() {\n    this.$dropzone.classList.remove('moj-multi-file-upload--dragover')\n  }\n\n  /**\n   * @param {DragEvent} event - Drag event\n   */\n  onDrop(event) {\n    event.preventDefault()\n    this.$dropzone.classList.remove('moj-multi-file-upload--dragover')\n    this.$feedbackContainer.classList.remove('moj-hidden')\n    this.$status.textContent = this.config.uploadStatusText\n    this.uploadFiles(event.dataTransfer.files)\n  }\n\n  /**\n   * @param {FileList} files - File list\n   */\n  uploadFiles(files) {\n    for (const file of Array.from(files)) {\n      this.uploadFile(file)\n    }\n  }\n\n  onFileChange() {\n    this.$feedbackContainer.classList.remove('moj-hidden')\n    this.$status.textContent = this.config.uploadStatusText\n    this.uploadFiles(this.$fileInput.files)\n\n    const $fileInput = this.$fileInput.cloneNode(true)\n    if (!$fileInput || !($fileInput instanceof HTMLInputElement)) {\n      return\n    }\n\n    $fileInput.value = ''\n    this.$fileInput.replaceWith($fileInput)\n\n    this.setupFileInput()\n    this.$fileInput.focus()\n  }\n\n  onFileFocus() {\n    this.$label.classList.add('moj-multi-file-upload--focused')\n  }\n\n  onFileBlur() {\n    this.$label.classList.remove('moj-multi-file-upload--focused')\n  }\n\n  /**\n   * @param {UploadResponseSuccess['success']} success\n   */\n  getSuccessHtml(success) {\n    return `<span class=\"moj-multi-file-upload__success\"> <svg class=\"moj-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\"><path d=\"M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z\"/></svg>${success.messageHtml}</span>`\n  }\n\n  /**\n   * @param {UploadResponseError['error']} error\n   */\n  getErrorHtml(error) {\n    return `<span class=\"moj-multi-file-upload__error\"> <svg class=\"moj-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\"><path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"/></svg>${error.message}</span>`\n  }\n\n  /**\n   * @param {File} file\n   */\n  getFileRow(file) {\n    const $row = document.createElement('div')\n\n    $row.classList.add('govuk-summary-list__row', 'moj-multi-file-upload__row')\n\n    $row.innerHTML = `\n    <div class=\"govuk-summary-list__value moj-multi-file-upload__message\">\n      <span class=\"moj-multi-file-upload__filename\">${file.name}</span>\n      <span class=\"moj-multi-file-upload__progress\">0%</span>\n    </div>\n    <div class=\"govuk-summary-list__actions moj-multi-file-upload__actions\"></div>\n  `\n\n    return $row\n  }\n\n  /**\n   * @param {UploadResponseFile} file\n   */\n  getDeleteButton(file) {\n    const $button = document.createElement('button')\n\n    $button.setAttribute('type', 'button')\n    $button.setAttribute('name', 'delete')\n    $button.setAttribute('value', file.filename)\n\n    $button.classList.add(\n      'moj-multi-file-upload__delete',\n      'govuk-button',\n      'govuk-button--secondary',\n      'govuk-!-margin-bottom-0'\n    )\n\n    $button.innerHTML = `Delete <span class=\"govuk-visually-hidden\">${file.originalname}</span>`\n\n    return $button\n  }\n\n  /**\n   * @param {File} file\n   */\n  uploadFile(file) {\n    this.config.hooks.entryHook(this, file)\n\n    const $item = this.getFileRow(file)\n    const $message = $item.querySelector('.moj-multi-file-upload__message')\n    const $actions = $item.querySelector('.moj-multi-file-upload__actions')\n    const $progress = $item.querySelector('.moj-multi-file-upload__progress')\n\n    const formData = new FormData()\n    formData.append('documents', file)\n\n    this.$feedbackContainer\n      .querySelector('.moj-multi-file-upload__list')\n      .append($item)\n\n    const xhr = new XMLHttpRequest()\n\n    const onLoad = () => {\n      if (\n        xhr.status < 200 ||\n        xhr.status >= 300 ||\n        !('success' in xhr.response)\n      ) {\n        return onError()\n      }\n\n      $message.innerHTML = this.getSuccessHtml(xhr.response.success)\n      this.$status.textContent = xhr.response.success.messageText\n\n      $actions.append(this.getDeleteButton(xhr.response.file))\n      this.config.hooks.exitHook(this, file, xhr, xhr.statusText)\n    }\n\n    const onError = () => {\n      const error = new Error(\n        xhr.response && 'error' in xhr.response\n          ? xhr.response.error.message\n          : xhr.statusText || 'Upload failed'\n      )\n\n      $message.innerHTML = this.getErrorHtml(error)\n      this.$status.textContent = error.message\n\n      this.config.hooks.errorHook(this, file, xhr, xhr.statusText, error)\n    }\n\n    xhr.addEventListener('load', onLoad)\n    xhr.addEventListener('error', onError)\n\n    xhr.upload.addEventListener('progress', (event) => {\n      if (!event.lengthComputable) {\n        return\n      }\n\n      const percentComplete = Math.round((event.loaded / event.total) * 100)\n      $progress.textContent = ` ${percentComplete}%`\n    })\n\n    xhr.open('POST', this.config.uploadUrl)\n    xhr.responseType = 'json'\n\n    xhr.send(formData)\n  }\n\n  /**\n   * @param {MouseEvent} event - Click event\n   */\n  onFileDeleteClick(event) {\n    const $button = event.target\n\n    if (\n      !$button ||\n      !($button instanceof HTMLButtonElement) ||\n      !$button.classList.contains('moj-multi-file-upload__delete')\n    ) {\n      return\n    }\n\n    event.preventDefault() // if user refreshes page and then deletes\n\n    const xhr = new XMLHttpRequest()\n\n    xhr.addEventListener('load', () => {\n      if (xhr.status < 200 || xhr.status >= 300) {\n        return\n      }\n\n      const $rows = Array.from(\n        this.$feedbackContainer.querySelectorAll('.moj-multi-file-upload__row')\n      )\n\n      if ($rows.length === 1) {\n        this.$feedbackContainer.classList.add('moj-hidden')\n      }\n\n      const $rowDelete = $rows.find(($row) => $row.contains($button))\n      if ($rowDelete) $rowDelete.remove()\n\n      this.config.hooks.deleteHook(this, undefined, xhr, xhr.statusText)\n    })\n\n    xhr.open('POST', this.config.deleteUrl)\n    xhr.setRequestHeader('Content-Type', 'application/json')\n    xhr.responseType = 'json'\n\n    xhr.send(\n      JSON.stringify({\n        [$button.name]: $button.value\n      })\n    )\n  }\n\n  static isSupported() {\n    return (\n      this.isDragAndDropSupported() &&\n      this.isFormDataSupported() &&\n      this.isFileApiSupported()\n    )\n  }\n\n  static isDragAndDropSupported() {\n    const div = document.createElement('div')\n    return typeof div.ondrop !== 'undefined'\n  }\n\n  static isFormDataSupported() {\n    return typeof FormData === 'function'\n  }\n\n  static isFileApiSupported() {\n    const input = document.createElement('input')\n    input.type = 'file'\n    return typeof input.files !== 'undefined'\n  }\n\n  /**\n   * Name for the component used when initialising using data-module attributes.\n   */\n  static moduleName = 'moj-multi-file-upload'\n\n  /**\n   * Multi file upload default config\n   *\n   * @type {MultiFileUploadConfig}\n   */\n  static defaults = Object.freeze({\n    uploadStatusText: 'Uploading files, please wait',\n    dropzoneHintText: 'Drag and drop files here or',\n    dropzoneButtonText: 'Choose files',\n    feedbackContainer: {\n      selector: '.moj-multi-file__uploaded-files'\n    },\n    hooks: {\n      entryHook: () => {},\n      exitHook: () => {},\n      errorHook: () => {},\n      deleteHook: () => {}\n    }\n  })\n\n  /**\n   * Multi file upload config schema\n   *\n   * @satisfies {Schema<MultiFileUploadConfig>}\n   */\n  static schema = Object.freeze(\n    /** @type {const} */ ({\n      properties: {\n        uploadUrl: { type: 'string' },\n        deleteUrl: { type: 'string' },\n        uploadStatusText: { type: 'string' },\n        dropzoneHintText: { type: 'string' },\n        dropzoneButtonText: { type: 'string' },\n        feedbackContainer: { type: 'object' },\n        hooks: { type: 'object' }\n      }\n    })\n  )\n}\n\n/**\n * Multi file upload config\n *\n * @typedef {object} MultiFileUploadConfig\n * @property {string} [uploadUrl] - File upload URL\n * @property {string} [deleteUrl] - File delete URL\n * @property {string} [uploadStatusText] - Upload status text\n * @property {string} [dropzoneHintText] - Dropzone hint text\n * @property {string} [dropzoneButtonText] - Dropzone button text\n * @property {object} [feedbackContainer] - Feedback container config\n * @property {string} [feedbackContainer.selector] - Selector for feedback container\n * @property {Element | null} [feedbackContainer.element] - HTML element for feedback container\n * @property {MultiFileUploadHooks} [hooks] - Upload hooks\n */\n\n/**\n * Multi file upload hooks\n *\n * @typedef {object} MultiFileUploadHooks\n * @property {OnUploadFileEntryHook} [entryHook] - File upload entry hook\n * @property {OnUploadFileExitHook} [exitHook] - File upload exit hook\n * @property {OnUploadFileErrorHook} [errorHook] - File upload error hook\n * @property {OnUploadFileDeleteHook} [deleteHook] - File delete hook\n */\n\n/**\n * Upload hook: File entry\n *\n * @callback OnUploadFileEntryHook\n * @param {InstanceType<typeof MultiFileUpload>} upload - Multi file upload\n * @param {File} file - File upload\n */\n\n/**\n * Upload hook: File exit\n *\n * @callback OnUploadFileExitHook\n * @param {InstanceType<typeof MultiFileUpload>} upload - Multi file upload\n * @param {File} file - File upload\n * @param {XMLHttpRequest} xhr - XMLHttpRequest\n * @param {string} textStatus - Text status\n */\n\n/**\n * Upload hook: File error\n *\n * @callback OnUploadFileErrorHook\n * @param {InstanceType<typeof MultiFileUpload>} upload - Multi file upload\n * @param {File} file - File upload\n * @param {XMLHttpRequest} xhr - XMLHttpRequest\n * @param {string} textStatus - Text status\n * @param {Error} errorThrown - Error thrown\n */\n\n/**\n * Upload hook: File delete\n *\n * @callback OnUploadFileDeleteHook\n * @param {InstanceType<typeof MultiFileUpload>} upload - Multi file upload\n * @param {File} [file] - File upload\n * @param {XMLHttpRequest} xhr - XMLHttpRequest\n * @param {string} textStatus - Text status\n */\n\n/**\n * @typedef {object} UploadResponseSuccess\n * @property {{ messageText: string, messageHtml: string }} success - Response success\n * @property {UploadResponseFile} file - Response file\n */\n\n/**\n * @typedef {object} UploadResponseError\n * @property {{ message: string }} error - Response error\n * @property {UploadResponseFile} file - Response file\n */\n\n/**\n * @typedef {object} UploadResponseFile\n * @property {string} filename - File name\n * @property {string} originalname - Original file name\n */\n\n/**\n * @import { Schema } from 'govuk-frontend/dist/govuk/common/configuration.mjs'\n */\n"],"names":["isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","isArray","option","Array","isObject","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","supportMessage","HTMLScriptElement","prototype","ConfigError","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","configOverride","Symbol","for","ConfigurableComponent","param","config","_config","defaults","datasetConfig","normaliseDataset","dataset","mergeConfigs","normaliseString","value","property","trimmedValue","trim","output","outputType","type","includes","length","isFinite","Number","schema","out","entries","Object","properties","entry","namespace","field","toString","extractConfigByNamespace","configObjects","formattedConfigObject","configObject","key","keys","override","newObject","current","keyParts","split","index","MultiFileUpload","_this$config$feedback","$feedbackContainer","feedbackContainer","querySelector","selector","setupFileInput","setupDropzone","setupLabel","setupStatusBox","addEventListener","onFileDeleteClick","bind","add","$dropzone","createElement","onDragOver","onDragLeave","onDrop","$fileInput","replaceWith","appendChild","$label","id","textContent","dropzoneButtonText","$hint","dropzoneHintText","append","onFileChange","onFileFocus","onFileBlur","$status","event","preventDefault","remove","uploadStatusText","uploadFiles","dataTransfer","files","file","from","uploadFile","cloneNode","HTMLInputElement","focus","getSuccessHtml","success","messageHtml","getErrorHtml","error","getFileRow","$row","innerHTML","getDeleteButton","$button","filename","originalname","hooks","entryHook","$item","$message","$actions","$progress","formData","FormData","xhr","XMLHttpRequest","onLoad","status","response","onError","messageText","exitHook","statusText","errorHook","upload","lengthComputable","percentComplete","Math","round","loaded","total","open","uploadUrl","responseType","send","target","HTMLButtonElement","$rows","querySelectorAll","$rowDelete","find","deleteHook","undefined","deleteUrl","setRequestHeader","JSON","stringify","isDragAndDropSupported","isFormDataSupported","isFileApiSupported","div","ondrop","input","freeze"],"mappings":"AAmFO,SAASA,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;EAC/C,OACED,KAAK,YAAYE,WAAW,IAC5BF,KAAK,CAACG,YAAY,CAAC,CAAA,KAAA,EAAQF,UAAU,CAAA,KAAA,CAAO,CAAC;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACC,MAAM,GAAGC,QAAQ,CAACC,IAAI,EAAE;EAClD,IAAI,CAACF,MAAM,EAAE;AACX,IAAA,OAAO,KAAK;AACd,EAAA;AAEA,EAAA,OAAOA,MAAM,CAACG,SAAS,CAACC,QAAQ,CAAC,0BAA0B,CAAC;AAC9D;AASA,SAASC,OAAOA,CAACC,MAAM,EAAE;AACvB,EAAA,OAAOC,KAAK,CAACF,OAAO,CAACC,MAAM,CAAC;AAC9B;AAUO,SAASE,QAAQA,CAACF,MAAM,EAAE;AAC/B,EAAA,OAAO,CAAC,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAACD,OAAO,CAACC,MAAM,CAAC;AACnE;AAsBO,SAASG,kBAAkBA,CAACC,SAAS,EAAEC,OAAO,EA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