<commit_before>{% set version = get_data("@bolt-components-video/package.json").version %}

{% set attributes = create_attribute(attributes | default({})) %}

{# if videoAttributes %}
  {% set attributes = videoAttributes | merge(attributes) %}

  {% for key, value in videoAttributes %}
    {% if attributes[key] %}
      {% set oldValue = attributes[key] %}
      {% set newValue = attributes[key] | merge(videoAttributes[key]) %}

      {% set attributes = attributes|merge({
        (key):newValue
      }) %}
    {% endif %}

  {% endfor %}
{% endif #}

{# force HTML5 Only Rendering + disable resizeManager in Brightcove to fix ability to click overlapping elements on iOS:
https://github.com/videojs/video.js/blob/22fd327076cb044c135c747086b58b7be64a747a/src/js/resize-manager.js#L19 #}
{% set attributes = attributes.setAttribute("data-setup", '{"techOrder": ["Html5"], "resizeManager": false}') %}
{% set showMeta = showMeta is null ? true : showMeta %}
{% set showMetaTitle = showMeta is null ? false : showMetaTitle %}

{% set controls = controls is null ? true : controls %}
{% set autoplay = autoplay is null ? false : autoplay %}
{% set loop = loop is null ? false : loop %}

{% if videoId %}
  {% set attributes = attributes.setAttribute("video-id", videoId) %}
{% endif %}

{% if accountId %}
  {% set attributes = attributes.setAttribute("account-id", accountId) %}
{% endif %}

{% if showMeta %}
  {% set attributes = attributes.setAttribute("show-meta", showMeta) %}
{% endif %}

{% if showMetaTitle %}
  {% set attributes = attributes.setAttribute("show-meta-title", showMetaTitle) %}
{% endif %}

{% if playerId %}
  {% set attributes = attributes.setAttribute("player-id", playerId) %}
{% endif %}

{% if autoplay %}
  {% set attributes = attributes.setAttribute("autoplay", autoplay) %}
{% endif %}

{% if controls %}
  {% set attributes = attributes.setAttribute("controls", controls) %}
{% endif %}

{% if loop %}
  {% set attributes = attributes.setAttribute("loop", true) %}
{% endif %}

{% if share_description %}
  {% set attributes = attributes.setAttribute("share-description", share_description) %}
{% endif %}

{% if isBackgroundVideo %}
  {% set attributes = attributes.setAttribute("is-background-video", isBackgroundVideo) %}
{% else %}
  {% set attributes = attributes.setAttribute("is-background-video", false) %}
{% endif %}

{% set customElementName = "#{bolt.data.config.namespace}-video" %}

<{{ customElementName }} {{ attributes }} v="{{ version }}"></{{ customElementName }}><commit_msg>feat: Make video share text translatable by default when using twig<commit_after>{% set version = get_data("@bolt-components-video/package.json").version %}

{% set attributes = create_attribute(attributes | default({})) %}

{# if videoAttributes %}
  {% set attributes = videoAttributes | merge(attributes) %}

  {% for key, value in videoAttributes %}
    {% if attributes[key] %}
      {% set oldValue = attributes[key] %}
      {% set newValue = attributes[key] | merge(videoAttributes[key]) %}

      {% set attributes = attributes|merge({
        (key):newValue
      }) %}
    {% endif %}

  {% endfor %}
{% endif #}

{# force HTML5 Only Rendering + disable resizeManager in Brightcove to fix ability to click overlapping elements on iOS:
https://github.com/videojs/video.js/blob/22fd327076cb044c135c747086b58b7be64a747a/src/js/resize-manager.js#L19 #}
{% set attributes = attributes.setAttribute("data-setup", '{"techOrder": ["Html5"], "resizeManager": false}') %}
{% set showMeta = showMeta is null ? true : showMeta %}
{% set showMetaTitle = showMeta is null ? false : showMetaTitle %}

{% set controls = controls is null ? true : controls %}
{% set autoplay = autoplay is null ? false : autoplay %}
{% set loop = loop is null ? false : loop %}

{% if videoId %}
  {% set attributes = attributes.setAttribute("video-id", videoId) %}
{% endif %}

{% if accountId %}
  {% set attributes = attributes.setAttribute("account-id", accountId) %}
{% endif %}

{% if showMeta %}
  {% set attributes = attributes.setAttribute("show-meta", showMeta) %}
{% endif %}

{% if showMetaTitle %}
  {% set attributes = attributes.setAttribute("show-meta-title", showMetaTitle) %}
{% endif %}

{% if playerId %}
  {% set attributes = attributes.setAttribute("player-id", playerId) %}
{% endif %}

{% if autoplay %}
  {% set attributes = attributes.setAttribute("autoplay", autoplay) %}
{% endif %}

{% if controls %}
  {% set attributes = attributes.setAttribute("controls", controls) %}
{% endif %}

{% if loop %}
  {% set attributes = attributes.setAttribute("loop", true) %}
{% endif %}

{% set attributes = attributes.setAttribute("share-description", share_description|default('Share This Video'|t)) %}

{% if isBackgroundVideo %}
  {% set attributes = attributes.setAttribute("is-background-video", isBackgroundVideo) %}
{% else %}
  {% set attributes = attributes.setAttribute("is-background-video", false) %}
{% endif %}

{% set customElementName = "#{bolt.data.config.namespace}-video" %}

<{{ customElementName }} {{ attributes }} v="{{ version }}"></{{ customElementName }}>
{'fraction_non_alphanumeric': 0.16976698648913258, 'fraction_numerical': 0.01253181907186215, 'mean_word_length': 4.540130151843818, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '129486', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1449, 'n_words': 365}