<commit_before><template>
  <section>
    <div
      v-if="!isPurchaseEnabled"
      class="mx-auto max-w-md flex flex-col items-center py-5"
    >
      <a
        href="#"
        alt="Changelly"
        @click.stop="openChangellyWebsite"
      >
        <img
          :src="changellyLogo"
          alt="Changelly"
        >
      </a>

      <div class="leading-normal mt-10 mb-5">
        <p class="font-semibold mb-2 text-center">
          {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.TITLE', { ticker: currentTicker }) }}
        </p>
        <p class="text-justify">
          {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.CONTENT', { ticker: currentTicker }) }}
        </p>
      </div>

      <InputSwitch
        v-model="isChangellyEnabled"
        :is-reverse="true"
        :is-large="false"
      >
        <i18n
          path="PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.CONFIRMATION"
          tag="div"
          class="ml-4 leading-normal"
        >
          <a
            place="terms"
            href="#"
            @click.stop="openChangellyTerms"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.TERMS_OF_USE') }}
          </a>
          <a
            place="privacy"
            href="#"
            @click.stop="openChangellyPrivacyPolicy"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.PRIVACY_POLICY') }}
          </a>
          <a
            href="#"
            place="kyc"
            @click.stop="openChangellyKYC"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.KYC') }}
          </a>
          <span place="button">
            "{{ $t('COMMON.CONFIRM') }}"
          </span>
        </i18n>
      </InputSwitch>

      <div class="text-center mt-10">
        <button
          :disabled="!isChangellyEnabled"
          class="blue-button"
          @click="setConfirmed"
        >
          {{ $t('COMMON.CONFIRM') }}
        </button>
      </div>
    </div>

    <div
      v-else
      class="WalletExchange__iframe mx-auto overflow-hidden mt-5"
    >
      <iframe
        :src="changellyWidgetURL"
        width="100%"
        height="550"
        class="changelly overflow-y-hidden border-none"
        scrolling="no"
      />
    </div>
  </section>
</template>

<script>
import { format } from 'util'
import { InputSwitch } from '@/components/Input'
import { MARKET } from '@config'

export default {
  name: 'WalletExchange',

  components: {
    InputSwitch
  },

  data: () => ({
    isChangellyEnabled: false,
    isPurchaseEnabled: false
  }),

  computed: {
    hasDarkTheme () {
      return this.session_hasDarkTheme
    },

    currentNetwork () {<commit_msg>fix: use webview instead of iframe for changelly (#1277)<commit_after><template>
  <section>
    <div
      v-if="!isPurchaseEnabled"
      class="mx-auto max-w-md flex flex-col items-center py-5"
    >
      <a
        href="#"
        alt="Changelly"
        @click.stop="openChangellyWebsite"
      >
        <img
          :src="changellyLogo"
          alt="Changelly"
        >
      </a>

      <div class="leading-normal mt-10 mb-5">
        <p class="font-semibold mb-2 text-center">
          {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.TITLE', { ticker: currentTicker }) }}
        </p>
        <p class="text-justify">
          {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.CONTENT', { ticker: currentTicker }) }}
        </p>
      </div>

      <InputSwitch
        v-model="isChangellyEnabled"
        :is-reverse="true"
        :is-large="false"
      >
        <i18n
          path="PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.CONFIRMATION"
          tag="div"
          class="ml-4 leading-normal"
        >
          <a
            place="terms"
            href="#"
            @click.stop="openChangellyTerms"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.TERMS_OF_USE') }}
          </a>
          <a
            place="privacy"
            href="#"
            @click.stop="openChangellyPrivacyPolicy"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.PRIVACY_POLICY') }}
          </a>
          <a
            href="#"
            place="kyc"
            @click.stop="openChangellyKYC"
          >
            {{ $t('PAGES.WALLET_EXCHANGE.CHANGELLY_TERMS.KYC') }}
          </a>
          <span place="button">
            "{{ $t('COMMON.CONFIRM') }}"
          </span>
        </i18n>
      </InputSwitch>

      <div class="text-center mt-10">
        <button
          :disabled="!isChangellyEnabled"
          class="blue-button"
          @click="setConfirmed"
        >
          {{ $t('COMMON.CONFIRM') }}
        </button>
      </div>
    </div>

    <div
      v-else
      class="WalletExchange__iframe mx-auto overflow-hidden mt-5"
    >
      <webview
        id="changelly"
        :src="changellyWidgetURL"
        class="changelly overflow-y-hidden border-none"
        style="width:100%; height:550px"
      />
    </div>
  </section>
</template>

<script>
import { format } from 'util'
import { InputSwitch } from '@/components/Input'
import { MARKET } from '@config'

export default {
  name: 'WalletExchange',

  components: {
    InputSwitch
  },

  data: () => ({
    isChangellyEnabled: false,
    isPurchaseEnabled: false
  }),

  computed: {
    hasDarkTheme () {
      return this.session_hasDarkTheme
    },

    currentNetwork () {
{'fraction_non_alphanumeric': 0.14521207631042785, 'fraction_numerical': 0.007779218373772921, 'mean_word_length': 1.7452974072191154, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 75, 'https://': 0, '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': '4939646', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1805, 'n_words': 262}