export default function({
  discountPrice,
  parcelNumber,
  parcelPrice,
  priceColor,
  totalParcels,
  customPreview,
  discountType,
  parcel_with_discounts,
  parcel_with_no_fees,
  discount_parcels,
  custom,
  increaseValue,
  customPromotion,
  discountValue,
  customView,
  minimumParcel
}) {
  const priceDiscountProduct =
      discountType == 2
        ? `number_format($pr - ($pr * ${discountValue})/100, 2,',','.')`
        : `number_format($pr - ${discountValue}, 2,',','.')`,
    priceDiscountExibition =
      discountType == 2
        ? `number_format($product['price_pr'] - ($product['price_pr'] * ${discountValue})/100, 2,',','.')`
        : `number_format($product['price_pr'] - ${discountValue}, 2,',','.')`,
    pricePromoDiscount =
      discountType == 2
        ? `number_format($replace_valor - ($replace_valor * ${discountValue})/100, 2,',','.')`
        : `number_format($replace_valor - ${discountValue}, 2,',','.')`;

  const modelComplete = {
    preview:
      parcelNumber > 0
        ? parcel_with_discounts > 0 && parcel_with_no_fees == 0
          ? `${discountPrice} no boleto à vista ou até ${parcelNumber}x com desconto de ${parcelPrice}`
          : `${discountPrice} no boleto à vista ou até ${parcelNumber}x sem juros de ${parcelPrice}`
        : `${discountPrice} no boleto à vista ou até ${totalParcels}x de ${parcelPrice}`,

    product: `$preco = number_format($pr, 2,',','.');
    $total_parcels = ${parcelNumber};
    $parcel_with_no_fees = ${parcel_with_no_fees};
    $parcel_with_discounts = ${parcel_with_discounts};
    $number_parcels = ${parcelNumber > 0} ? '${parcelNumber}' : ${totalParcels};
    $preco_promo = $special;
    $increase_value = '${increaseValue}';
    $discount_parcels = str_replace(',', '.', '${discount_parcels}');;
    $preco_discount = ${priceDiscountProduct};

    $valor = $special;
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_promo_discount = ${pricePromoDiscount};


    if($total_parcels > 0){
      $preco_parcelado = number_format(($pr/$total_parcels), 2,',','.');
      $preco_parcelado_promo = number_format($replace_valor/$total_parcels , 2,',','.');
    }

    if($parcel_with_discounts > 0){
      $parcel_price_discount = ($pr - ($pr * ($discount_parcels / 100))) / $parcel_with_discounts;
      $parcel_price_discount = number_format($parcel_price_discount, 2,',','.');
    }

    $price_with_fees = ftr_geral::juroComposto($pr, $number_parcels, $increase_value);

    $price_promo = str_replace(',', '.', $preco_promo);
    $price_discount_valid = str_replace(',', '.', $preco_discount);
    $price_promo_discount_valid = str_replace(',', '.', $preco_promo_discount);

    if($special){
      $price_with_fees = ftr_geral::juroComposto($replace_valor, $number_parcels, $increase_value);
    }else{
      $price_with_fees = ftr_geral::juroComposto($pr, $number_parcels, $increase_value);
    }

    $price_with_fees = $price_with_fees/$number_parcels;
    $price_with_fees = number_format($price_with_fees, 2,',','.');

    if ($preco_promo) {
    if ($price_promo > $price_promo_discount_valid) {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode('
          <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
          ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
          ' no boleto à vista ou até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>');
        }else{
          echo html_entity_decode('
          <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
          ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
          ' no boleto à vista ou até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . '</span>');
        }
      }else{
        echo html_entity_decode('
        <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
        '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
        ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
        ' no boleto à vista ou até ${totalParcels}x de R$ ' . $price_with_fees . '</span>');
      }
    } else {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode('
          <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
          ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>');
        }else{
          echo html_entity_decode('
          <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
          ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . '</span>');
        }
      }else{
        echo html_entity_decode('
        <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
        '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
        ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${totalParcels}x de R$ ' . $price_with_fees . '</span>');
      }
    }
    } else {
    if ($price > $price_discount_valid) {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_discount .
          ' no boleto à vista ou até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>');
        }else{
          echo html_entity_decode('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_discount .
          ' no boleto à vista ou até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . '</span>');
        }
      }else{
        echo html_entity_decode('
        <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
        '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_discount .
        ' no boleto à vista ou até ${totalParcels}x de R$ ' . $price_with_fees . '</span>');
      }
    } else {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>');
        }else{
          echo html_entity_decode('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . '</span>');
        }
      }else{
        echo html_entity_decode('
        <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
        '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${totalParcels}x de R$ ' . $price_with_fees . '</span>');
      }
    }
    }`,
    exibition: `$preco = number_format($product['price_pr'], 2,',','.');
    $total_parcels = ${parcelNumber};
    $parcel_with_no_fees = ${parcel_with_no_fees};
    $parcel_with_discounts = ${parcel_with_discounts};

    $number_parcels = ${parcelNumber > 0} ? '${parcelNumber}' : ${totalParcels};
    $preco_promo = $product['special'];
    $preco_discount = ${priceDiscountExibition};
    $increase_value = '${increaseValue}';
    $discount_parcels = str_replace(',', '.', '${discount_parcels}');

    $valor = $product['special'];
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_promo_discount = ${pricePromoDiscount};

    $price = str_replace(',', '.', $preco);
    $price_promo = str_replace(',', '.', $preco_promo);
    $price_discount_valid = str_replace(',', '.', $preco_discount);
    $price_promo_discount_valid = str_replace(',', '.', $preco_promo_discount);

    if($product['special']){
      $price_with_fees = ftr_geral::juroComposto($replace_valor, $number_parcels, $increase_value);
    }else{
      $price_with_fees = ftr_geral::juroComposto($product['price_pr'], $number_parcels, $increase_value);
    }

    $price_with_fees = $price_with_fees/$number_parcels;
    $price_with_fees = number_format($price_with_fees, 2,',','.');

    if($total_parcels > 0){
      $preco_parcelado = number_format(($product['price_pr']/$total_parcels), 2,',','.');
      $preco_parcelado_promo = number_format(($replace_valor/$total_parcels) , 2,',','.');
    }

    if($parcel_with_discounts > 0){
      $parcel_price_discount = ($product['price_pr'] - ($product['price_pr'] * ($discount_parcels / 100))) / $parcel_with_discounts;
      $parcel_price_discount = number_format($parcel_price_discount, 2,',','.');
    }

    if ($preco_promo) {
    if ($price_promo > $price_promo_discount_valid) {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
          ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
          ' no boleto à vista ou até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>'));
        }else{
          echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
          ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
          ' no boleto à vista ou até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . '</span>'));
        }
      }else{
        echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
        '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
        ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
        ' no boleto à vista ou até ${totalParcels}x de R$ ' . $price_with_fees . '</span>'));
      }
    } else {
    echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
    ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . '</span>'));
    }
    } else {
    if ($price > $price_discount_valid) {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">R$ ' . $preco_discount .
          ' no boleto à vista ou até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>'));
        }else{
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">R$ ' . $preco_discount .
          ' no boleto à vista ou até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . '</span>'));
        }
      }else{
        echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
        '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">R$ ' . $preco_discount .
        ' no boleto à vista ou até ${totalParcels}x de R$ ' . $price_with_fees . '</span>'));
      }
    } else {
      if($total_parcels > 0){
        if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>'));
        }else{
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . '</span>'));
        }
      }else{
        echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
        '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${totalParcels}x de R$ ' . $price_with_fees . '</span>'));
      }
    }
    }`
  };

  const modelCustom = {
    preview: customPreview,

    product: `$preco = number_format($pr, 2,',','.');
    $preco_promo = $special;
    $valor = $special;
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_parcelado_promo = number_format($replace_valor/${totalParcels} , 2,',','.');
    $preco_promo_discount = 'R$ ' . ${pricePromoDiscount} . '';

    if($preco_promo){
      $priceDiscountExibition = ${discountType} == 2 ? number_format($replace_valor - ($replace_valor * ${discountValue})/100, 2,',','.') : number_format($replace_valor - ${discountValue}, 2,',','.');
      $preco_discount = 'R$ ' . $priceDiscountExibition . '';
    }else{
      $priceDiscountExibition = ${discountType} == 2 ? number_format($pr - ($pr * ${discountValue})/100, 2,',','.') : number_format($pr - ${discountValue}, 2,',','.');
      $preco_discount = 'R$ ' . $priceDiscountExibition . '';
    }

    $increase_value = '${increaseValue}';
    $discount_value = str_replace(',', '.', '${discount_parcels}');;
    $quantity_parcels_with_increase = (${parcel_with_no_fees} + ${parcel_with_discounts}) ===  ${totalParcels} ? 0 : ${totalParcels};
    $customView = '${customView}';

    if($preco_promo){
      $preco_value = $replace_valor;
    }else{
      $preco_value = (float) $preco;
    }

    if (strpos($customView, 'parcela_sem_juros') !== false) {
        if(${parcel_with_no_fees} || ${parcel_with_discounts}){
          $parcelNoFees = $preco_value / (${parcel_with_no_fees} + ${parcel_with_discounts});
          $noFeesFormat = 'R$ ' . number_format($parcelNoFees, 2, ',', '.') . '';
          $customView = str_replace('parcela_sem_juros' , $noFeesFormat, $customView);
        }else{
          $noFeesFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
          $customView = str_replace('parcela_sem_juros' , $noFeesFormat, $customView);
        };
    };

    if (strpos($customView, 'parcela_com_desconto') !== false) {
        $discount = !empty($discount_value) ? preg_replace('/[^0-9\\s]+/', '.', $discount_value) : 0;
        $discount = (float) $discount;
        $totalDiscount = $preco_value - ($preco_value * ($discount / 100));

        if(${parcel_with_discounts}){
          $parcelWithDiscount = $totalDiscount / ${parcel_with_discounts};
          $discountFormat = 'R$ ' . number_format($parcelWithDiscount, 2, ',', '.') . '';
          $customView = str_replace('parcela_com_desconto' , $discountFormat, $customView);
        }else{
          $discountFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
          $customView = str_replace('parcela_com_desconto' , $discountFormat, $customView);
        };
    };

    if (strpos($customView, 'parcela_com_juros') !== false) {
        $fees = !empty($increase_value) ? preg_replace('/[^0-9\\s]+/', '.', $increase_value) : 0;
        $fess = (float) $fees;
        $increase = $preco_value * pow((1 + ($fees / 100)), ${totalParcels});
        $totalIncrease = $increase / ${totalParcels};

        if($quantity_parcels_with_increase){
            $increaseFormat = 'R$ ' . number_format($totalIncrease, 2, ',', '.') . '';
        }else{
            $increaseFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
        };
        $customView = str_replace('parcela_com_juros' , $increaseFormat, $customView);
    };

    if ($preco_promo) {
    echo html_entity_decode(nl2br('
    <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
    ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">'. $customView .'</span>'));
    } else {
    echo html_entity_decode(nl2br('
    <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
    '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">'. $customView .'</span>'));
    }`,

    exibition: `$preco = number_format($product['price_pr'], 2,',','.');

    $preco_promo = $product['special'];
    $valor = $product['special'];
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_parcelado_promo = number_format($replace_valor/${totalParcels} , 2,',','.');
    $preco_promo_discount = 'R$ ' . ${pricePromoDiscount} . '';

    if($preco_promo){
      $priceDiscountExibition = ${discountType} == 2 ? number_format($replace_valor - ($replace_valor * ${discountValue})/100, 2,',','.') : number_format($replace_valor - ${discountValue}, 2,',','.');
      $preco_discount = 'R$ ' . $priceDiscountExibition . '';
    }else{
      $priceDiscountExibition = ${discountType} == 2 ? number_format($product['price_pr'] - ($product['price_pr'] * ${discountValue})/100, 2,',','.') : number_format($product['price_pr']- ${discountValue}, 2,',','.');
      $preco_discount = 'R$ ' . $priceDiscountExibition . '';
    }

    $increase_value = '${increaseValue}';
    $discount_value = str_replace(',', '.', '${discount_parcels}');;
    $quantity_parcels_with_increase = (${parcel_with_no_fees}+${parcel_with_discounts}) ===  ${totalParcels} ? 0 : ${totalParcels};
    $customView = '${customView}';

    if($preco_promo){
      $preco_value = $replace_valor;
    }else{
      $preco_value = (float) $product['price_pr'];
    }

    if (strpos($customView, 'parcela_sem_juros') !== false) {
        if(${parcel_with_no_fees} || ${parcel_with_discounts}){
          $parcelNoFees = $preco_value / (${parcel_with_no_fees} + ${parcel_with_discounts});
          $noFeesFormat = 'R$ ' . number_format($parcelNoFees, 2, ',', '.') . '';
          $customView = str_replace('parcela_sem_juros' , $noFeesFormat, $customView);
        }else{
          $noFeesFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
          $customView = str_replace('parcela_sem_juros' , $noFeesFormat, $customView);
        };
    };

    if (strpos($customView, 'parcela_com_desconto') !== false) {
        $discount = !empty($discount_value) ? preg_replace('/[^0-9\\s]+/', '.', $discount_value) : 0;
        $discount = (float) $discount;
        $totalDiscount = $preco_value - ($preco_value * ($discount / 100));

        if(${parcel_with_discounts}){
          $parcelWithDiscount = $totalDiscount / ${parcel_with_discounts};
          $discountFormat = 'R$ ' . number_format($parcelWithDiscount, 2, ',', '.') . '';
          $customView = str_replace('parcela_com_desconto' , $discountFormat, $customView);
        }else{
          $discountFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
          $customView = str_replace('parcela_com_desconto' , $discountFormat, $customView);
        };
    };

    if (strpos($customView, 'parcela_com_juros') !== false) {
        $fees = !empty($increase_value) ? preg_replace('/[^0-9\\s]+/', '.', $increase_value) : 0;
        $fess = (float) $fees;
        $increase = $preco_value * pow((1 + ($fees / 100)), ${totalParcels});
        $totalIncrease = $increase / ${totalParcels};

        if($quantity_parcels_with_increase){
           $increaseFormat = 'R$ ' . number_format($totalIncrease, 2, ',', '.') . '';
        }else{
           $increaseFormat = 'R$ ' . number_format(0.00, 2, ',', '.') . '';
        };
        $customView = str_replace('parcela_com_juros' , $increaseFormat, $customView);
    };

    if ($preco_promo) {
    echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
    ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">'. $customView .'</span>'));
    } else {
    echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
    '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">'. $customView .'</span>'));
    }`
  };

  const modelBillet = {
    preview: `${discountPrice} no boleto à vista`,

    product: `$preco = number_format($pr, 2,',','.');
    $preco_promo = $special;
    $preco_discount = ${priceDiscountProduct};

    $valor = $special;
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_promo_discount = ${pricePromoDiscount};

    $price = str_replace(',', '.', $preco);
    $price_promo = str_replace(',', '.', $preco_promo);
    $price_discount_valid = str_replace(',', '.', $preco_discount);
    $price_promo_discount_valid = str_replace(',', '.', $preco_promo_discount);

    if ($preco_promo) {
    if ($price_promo > $price_promo_discount_valid) {
    echo html_entity_decode('
    <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
    ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
    ' no boleto à vista</span>');
    } else {
    echo html_entity_decode('
    <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo . ' </span>');
    }
    } else {
    if ($price > $price_discount_valid) {
    echo html_entity_decode('
    <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
    '</span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_discount . ' no boleto à vista</span>');
    } else {
    echo html_entity_decode('
    <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco . '</span>');
    }
    }`,
    exibition: `$preco = number_format($product['price_pr'], 2,',','.');
    $preco_promo = $product['special'];
    $preco_discount = ${priceDiscountExibition};

    $valor = $product['special'];
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $preco_promo_discount = ${pricePromoDiscount};

    $price = str_replace(',', '.', $preco);
    $price_promo = str_replace(',', '.', $preco_promo);
    $price_discount_valid = str_replace(',', '.', $preco_discount);
    $price_promo_discount_valid = str_replace(',', '.', $preco_promo_discount);

    if ($preco_promo) {
    if ($price_promo > $price_promo_discount_valid) {
    echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
    ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">R$ ' . $preco_promo_discount .
    ' no boleto à vista</span>'));
    } else {
    echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
    '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo . '</span>'));
    }
    } else {
    if ($price > $price_discount_valid) {
    echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
    '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">R$ ' . $preco_discount . ' no boleto à vista</span>'));
    } else {
    echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco . '</span>'));
    }
    }`
  };

  const modelParcel = {
    preview:
      parcelNumber > 0
        ? parcel_with_discounts > 0 && parcel_with_no_fees == 0
          ? `Em até ${parcelNumber}x com desconto de ${parcelPrice}`
          : `Em até ${parcelNumber}x sem juros de ${parcelPrice}`
        : `Em até ${totalParcels}x de ${parcelPrice}`,

    product: `$preco = number_format($pr, 2,',','.');
    $total_parcels = ${parcelNumber};
    $parcel_with_no_fees = ${parcel_with_no_fees};
    $parcel_with_discounts = ${parcel_with_discounts};
    $number_parcels = ${parcelNumber > 0} ? '${parcelNumber}' : ${totalParcels};
    $preco_promo = $special;
    $increase_value = '${increaseValue}';
    $discount_parcels = str_replace(',', '.', '${discount_parcels}');
    $minimum_parcel = '${minimumParcel}';
    $minimum_parcel = (float) str_replace(['R$', ','], ['', '.'], $minimum_parcel);

    $totalMinimalParcels = null;
    $i = 0;

    if(isset($minimum_parcel)){
      $totalMinimalParcels = 0;
      $price = null;

      while ($i < $parcel_with_discounts) {
        $discount_parcels_value = !empty('${discount_parcels}') ? str_replace(['%', ','], ['', '.'], '${discount_parcels}') : 0;

        if($special){
          $pr = (float) str_replace(['R$', ','], ['', '.'], $special);
        }

        $total_value_with_discounts = $pr - ($pr * ($discount_parcels_value / 100));


        if(($total_value_with_discounts / ($i + 1)) >= $minimum_parcel){
          $price = $total_value_with_discounts / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($totalMinimalParcels == 0){
        $i = 0;
      }else{
        $parcel_with_no_fees = $parcel_with_no_fees + $i;
      }

      while ($i < $parcel_with_no_fees) {
        if($special){
          $pr = (float) str_replace(['R$', ','], ['', '.'], $special);
        }

        if(($pr / ($i + 1)) >= $minimum_parcel){
          $price = $pr / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($totalMinimalParcels == 0){
        $i = 0;
      }

      while ($i < '${totalParcels}') {
        if($special){
          $pr = (float) str_replace(['R$', ','], ['', '.'], $special);
          $total_value_with_fees = ftr_geral::juroComposto($pr, ($i + 1), $increase_value);
        }else{
          $total_value_with_fees = ftr_geral::juroComposto($pr, ($i + 1), $increase_value);
        }

        if(($total_value_with_fees / ($i + 1)) >= $minimum_parcel){
          $price = $total_value_with_fees / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($price){
        $price = number_format($price, 2,',','.');
      }else{
        $price = $preco;
      }
    }

    $valor = $special;
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));

    if($parcel_with_discounts > 0){
      $parcel_price_discount = ($pr - ($pr * ($discount_parcels / 100))) / $parcel_with_discounts;
      $parcel_price_discount = number_format($parcel_price_discount, 2,',','.');
    }

    if($total_parcels > 0){
      $preco_parcelado = number_format(($pr/$total_parcels), 2,',','.');
      $preco_parcelado_promo = number_format($replace_valor/$total_parcels , 2,',','.');
    }

    if($special){
      $price_with_fees = ftr_geral::juroComposto($replace_valor, $number_parcels, $increase_value);
    }else{
      $price_with_fees = ftr_geral::juroComposto($pr, $number_parcels, $increase_value);
    }

    $price_with_fees = $price_with_fees/$number_parcels;
    $price_with_fees = number_format($price_with_fees, 2,',','.');

    if(!isset($totalMinimalParcels)){
      if ($preco_promo) {
        if($total_parcels > 0){
          if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
            echo html_entity_decode(nl2br('
            <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
            ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>'));
          }else{
            echo html_entity_decode(nl2br('
            <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
            ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . '</span>'));
          }
        }else{
          echo html_entity_decode(nl2br('
          <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
          ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${totalParcels}x de R$ ' . $price_with_fees . '</span>'));
        }
      } else {
        if($total_parcels > 0){
          if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
            echo html_entity_decode(nl2br('
            <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
            '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . ' </span>'));
          }else{
            echo html_entity_decode(nl2br('
            <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
            '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . ' </span>'));
          }
        }else{
          echo html_entity_decode(nl2br('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
          '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até ${totalParcels}x de R$ ' . $price_with_fees . ' </span>'));
        }
      }
    }else{
      if($totalMinimalParcels == 0){
        if ($preco_promo) {
          echo html_entity_decode(nl2br('
            <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.rem;"><s>R$ ' . $preco . '</s></span>
            <span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 1.25rem;">' . $preco_promo .'</span>'));
        }else{
          echo html_entity_decode(nl2br('
          <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .'</span>'));
        }
      }else{
        if ($preco_promo) {
          if($total_parcels > 0){
            if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
              echo html_entity_decode(nl2br('
              <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
              '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
              ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
            }else{
              echo html_entity_decode(nl2br('
              <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
              '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
              ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
            }
          }else{
            echo html_entity_decode(nl2br('
            <span style="color: #737373;display:block;font-size: 1rem;line-height: 1.25rem;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">' . $preco_promo .
            ' </span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
          }
        } else {
          if($total_parcels > 0){
            if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
              echo html_entity_decode(nl2br('
              <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
              '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
            }else{
              echo html_entity_decode(nl2br('
              <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
              '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
            }
          }else{
            echo html_entity_decode(nl2br('
            <span style="color: ${priceColor};display:block;font-weight: 700;font-size: 2rem;line-height: 2.25rem;">R$ ' . $preco .
            '</span><span style="color: #737373; font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
          }
        }
      }
    }

    `,
    exibition: `$preco = number_format($product['price_pr'], 2,',','.');
    $number_parcels = ${parcelNumber > 0} ? '${parcelNumber}' : ${totalParcels};
    $total_parcels = ${parcelNumber};
    $parcel_with_no_fees = ${parcel_with_no_fees};
    $parcel_with_discounts = ${parcel_with_discounts};
    $preco_promo = $product['special'];
    $valor = $product['special'];
    $replace_valor = (double) trim(str_replace(['R$', '.', ','], ['', '', '.'], $valor));
    $increase_value = '${increaseValue}';
    $discount_parcels = str_replace(',', '.', '${discount_parcels}');
    $minimum_parcel = '${minimumParcel}';
    $minimum_parcel = (float) str_replace(['R$', ','], ['', '.'], $minimum_parcel);

    $totalMinimalParcels = null;
    $i = 0;

    if(isset($minimum_parcel)){
      $totalMinimalParcels = 0;
      $price = null;

      while ($i < $parcel_with_discounts) {
        $discount_parcels_value = !empty('${discount_parcels}') ? str_replace(['%', ','], ['', '.'], '${discount_parcels}') : 0;

        if($product['special']){
          $product['price_pr'] = (float) str_replace(['R$', ','], ['', '.'], $product['special']);
        }

        $total_value_with_discounts = $product['price_pr'] - ($product['price_pr'] * ($discount_parcels_value / 100));

        if(($total_value_with_discounts / ($i + 1)) > $minimum_parcel){
          $price = $total_value_with_discounts / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($totalMinimalParcels == 0){
        $i = 0;
      }else{
        $parcel_with_no_fees = $parcel_with_no_fees + $i;
      }

      while ($i < $parcel_with_no_fees) {
        if($product['special']){
          $product['price_pr'] = (float) str_replace(['R$', ','], ['', '.'], $product['special']);
        }

        if(($product['price_pr'] / ($i + 1)) > $minimum_parcel){
          $price = $product['price_pr'] / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($totalMinimalParcels == 0){
        $i = 0;
      }

      while ($i < '${totalParcels}') {
        if($product['special']){
          $product['price_pr'] = (float) str_replace(['R$', ','], ['', '.'], $product['special']);
        }

        $total_value_with_fees = ftr_geral::juroComposto($product['price_pr'], ($i + 1), $increase_value);

        if(($total_value_with_fees / ($i + 1)) > $minimum_parcel){
          $price = $total_value_with_fees / ($i + 1);
          $totalMinimalParcels += 1;
        }

        $i++;
      }

      if($price){
        $price = number_format($price, 2,',','.');
      }else{
        $price = $preco;
      }
    }

    if($total_parcels > 0){
      $preco_parcelado_promo = number_format($replace_valor/$total_parcels  , 2,',','.');
      $preco_parcelado = number_format(($product['price_pr']/$total_parcels ), 2,',','.');
    }

    if($parcel_with_discounts > 0){
      $parcel_price_discount = ($product['price_pr'] - ($product['price_pr'] * ($discount_parcels / 100))) / $parcel_with_discounts;
      $parcel_price_discount = number_format($parcel_price_discount, 2,',','.');
    }

    if($product['special']){
      $price_with_fees = ftr_geral::juroComposto($replace_valor, $number_parcels, $increase_value);
    }else{
      $price_with_fees = ftr_geral::juroComposto($product['price_pr'], $number_parcels, $increase_value);
    }

    $price_with_fees = $price_with_fees/$number_parcels;
    $price_with_fees = number_format($price_with_fees, 2,',','.');

    if(!isset($totalMinimalParcels)){
      if ($preco_promo) {
        if($total_parcels > 0){
          if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
            echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: px;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
            ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . ' </span>'));
          }else{
            echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
            ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado_promo . ' </span>'));
          }
        }else{
          echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
          ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até ${totalParcels}x de R$ ' . $price_with_fees . ' </span>'));
        }
      } else {
        if($total_parcels > 0){
          if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
            echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
            '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${parcelNumber}x com desconto de R$ ' . $parcel_price_discount . '</span>'));
          }else{
            echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
            '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${parcelNumber}x sem juros de R$ ' . $preco_parcelado . '</span>'));
          }
        }else{
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
          '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até ${totalParcels}x de R$ ' . $price_with_fees . '</span>'));
        }
      }
    }else{
      if($totalMinimalParcels == 0){
        if ($preco_promo) {
          echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: px;"><s>R$ ' . $preco .
          '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .'</span>'));
        }else{
          echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco . '</span>'));
        }
      }else{
        if ($preco_promo) {
          if($total_parcels > 0){
            if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
              echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: px;"><s>R$ ' . $preco .
              '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
              ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
            }else{
              echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
              '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
              ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
            }
          }else{
            echo html_entity_decode(nl2br('<span style="color: #737373;display:block;font-size: 14px;"><s>R$ ' . $preco .
            '</s></span><span style="color: ${priceColor}; display:block;font-size: 16px;font-weight: 700;">' . $preco_promo .
            ' </span><span style="color: #737373; display:block;font-size: 1rem;line-height: 1.25rem;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . ' </span>'));
          }
        } else {
          if($total_parcels > 0){
            if($parcel_with_discounts > 0 && $parcel_with_no_fees == 0){
              echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
              '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
            }else{
              echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
              '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
            }
          }else{
            echo html_entity_decode(nl2br('<span style="color: ${priceColor}; display:block;font-size: 14px;">R$ ' . $preco .
            '</span><span style="color: #737373; display:block;font-size: 16px;font-weight: 400;">Em até '. $totalMinimalParcels .'x de R$ ' . $price . '</span>'));
          }
        }
      }

    }
    `
  };

  return {
    complete: modelComplete,
    custom: modelCustom,
    billet: modelBillet,
    parcel: modelParcel
  };
}
