from ..endorsements.endorsement_header import generate_endorsement_page_header_text
from ...config import NEW_PAGE_TAG


@staticmethod
def generate_faq43_endorsement_text() -> str:
    endorsement_header_text = generate_endorsement_page_header_text()
    text = (
        f"{endorsement_header_text}"
        "Quebec Endorsement Form\n"
        "Q.E.F. N 43 (A to F)\n"
        "Change to indemnity\n"
        "(Section B)\n"
        "The endorsement heading and the applicable options must be entered in the ''Declarations'' section of "
        "the insurance contract. Details required for the endorsement may be entered in the ''Declarations'' "
        "section or in the endorsement itself, at the insurer's option.\n"
        "Name of insurer: \n"
        "Named insured: \n"
        "Endorsement to automobile insurance policy N: \n"
        "Effective date: This endorsement will apply from  at 12:01 A.M. "
        "standard time at the address of the named insured.\n"
        "Additional insurance premium payable:\n"
        "\t Amounts payable:  \n"
        "\t Due date:\n"
        "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
        "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
        "Endorsement description\n"
        "This endorsement extends coverage under Section B of the insurance contract by "
        "changing, depending on the applicable options, Article 2, ''Reporting a loss and "
        "submitting a claim.'' Changes made by these options relate to how the value of damage is calculated.\n"
        "APPLICATION OF ENDORSEMENT\n"
        "For the options to apply to the specified vehicle, they must be entered in the "
        "''Declarations'' section of the insurance contract.\n"
        "Except for Option 43C, the named insured may elect settlement in accordance "
        "with Article 2, ''Reporting a loss and submitting a claim'', without the selected "
        "option being applied. In such instance, the named insured must submit a request to the insurer.\n"
        "The deductible entered in the ''Declarations'' section for the specified vehicle will "
        "be assumed by the named insured.\n"
        "VALUE OF DAMAGE IN EVENT OF PARTIAL LOSS\n"
        "Options 43A and 43B relate to calculation of the value of damage payable by the "
        "insurer in the event of repair or replacement of damaged parts.\n"
        "These options change Article 2.1, ''Reporting a loss and submitting a claim.'' However, "
        "the rules set out in the first paragraph of Article 2.1.1 of that section continue to apply.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "Option 43A – Partial loss – New parts\n"
        "In the event of partial loss, when the damaged parts can be repaired, the value of "
        "damage will be calculated in accordance with Article 2.1, ''Reporting a loss and "
        "submitting a claim.'' However, there will be no deduction for depreciation.\n"
        "If the insurer determines that damaged parts cannot be repaired and must be "
        "replaced, there will be no deduction for depreciation. In addition:\n"
        "\t the value of damage will be calculated on the basis of the cost of new "
        "original equipment manufacturer parts;\n"
        "\t if glass is damaged, the named insured may ask for it to be replaced by a new "
        "original equipment manufacturer part or by a new similar part.\n"
        "If a new part is out of stock or no longer being manufactured, the liability of the insurer will be "
        "limited to the latest list price of the new original equipment manufacturer part.\n"
        "If the damaged parts are not repaired or replaced by new parts, Option 43A will not apply.\n"
        "Option 43B – Partial loss – Waiver of depreciation\n"
        "In the event of partial loss, the value of damage will be calculated in accordance with Article 2.1, "
        "''Reporting a loss and submitting a claim.'' However, if the insurer determines that "
        "depreciation is to be applied to the value of damage, this option will cover "
        "such depreciation up to a maximum of   $ per loss.\n"
        "However, if the damaged parts are not repaired or replaced, Option 43B will not apply.\n"
        "VALUE OF DAMAGE IN EVENT OF TOTAL LOSS OR TOTAL CONSTRUCTIVE LOSS\n"
        "Options 43C, 43D, 43E and 43F relate to calculation of the value of "
        "damage payable by the insurer in the event of total loss or total constructive loss. "
        "They amend Article 2.2, ''Reporting a loss and submitting a claim.''\n"
        "Option 43C – Total loss – Value of vehicle agreed in advance\n"
        "In the event of total loss or total constructive loss, the named insured and the insurer "
        "agree that the value of the specified vehicle, on the date of the loss, will be:  $ (''agreed value'').\n"
        "Option43D – Total loss – Waiver of depreciation\n"
        "In the event of total loss or total constructive loss, the value of damage "
        "will be equal to the least of the following amounts:\n"
        "\t the price paid for the specified vehicle by the named insured who is the actual owner;\n"
        "\t the current price of the specified vehicle on the original date of purchase; or\n"
        "\t the price for which the insurer may, on the date of the loss, purchase a new "
        "vehicle with specifications or equipment and accessories similar to those of the specified vehicle.\n"
        "Option 43E – Total loss – Replacement cost\n"
        "In the event of total loss or total constructive loss, the named insured may choose one "
        "of the following three indemnity options:\n"
        "1. Replacement by a new vehicle\n"
        "If the specified vehicle is replaced by a new vehicle with the "
        "same specifications or equipment and accessories, the value of damage will be equal to the "
        "price of this vehicle.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        f"If no such vehicle is available and the specified vehicle is replaced by a "
        f"new vehicle with similar specifications or equipment and accessories, the value of damage "
        f"will be equal to the price of this vehicle.\n"
        f"2. Replacement by a used vehicle, or by a new vehicle other than as in paragraph 1\n"
        f"If the specified vehicle is replaced by a used vehicle, or by a new vehicle other than as in "
        f"paragraph 1, the value of damage will be equal to:\n"
        f"\t the price paid for the specified vehicle by the named insured who is the actual "
        f"owner; or\n"
        f"\t the price of the used or new vehicle that replaces the specified vehicle; whichever is higher.\n"
        f"However, the value of damage may not be greater than the price that the "
        f"insurer would have paid had paragraph 1 applied.\n"
        f"3. Non-replacement of specified vehicle\n"
        f"If the specified vehicle is not replaced, the value of damage will be equal to:\n"
        f"\t the price paid for the specified vehicle by the named insured who is the actual "
        f"owner; or\n"
        f"\t the current price of the specified vehicle on the original date of "
        f"purchase, whichever is lower.\n"
        f"However, the value of damage may not be greater than the price that the insurer "
        f"would have paid had paragraph 1 applied.\n"
        f"Option 43F – Total loss – Increased settlement\n"
        f"In the event of total loss or total constructive loss, the value of damage will be equal to:\n"
        f"\t A – the price paid for the specified vehicle by the named insured who is the actual owner, "
        f"increased by  % compounded annually and calculated "
        f"proportionally to the number of days elapsed between   (date) and the date of the loss;\n"
        f"or\n"
        f"B – the amount of  $ increased by  "
        f"compounded annually and calculated proportionally to the number of days elapsed "
        f"between  (date) and the date of the loss;\n"
        f"or\n"
        f"C – the ''actual cash value'' of the specified vehicle increased by  % "
        f"compounded annually and calculated proportionally to the number of days elapsed between "
        f" (date) and the date of the loss;\n"
        f"or\n"
        f"D – the ''actual cash value'' of the specified vehicle increased by  $.\n"
        f"In all instances, the value of damage may not be greater than the price for which "
        f"the insurer may, on the date of the loss, purchase a new vehicle with specifications, "
        f"equipment and accessories similar to those of the specified vehicle.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{endorsement_header_text}"
        "SPECIFIC RULE FOR VEHICLE LEASED OR UNDER A CONTRACT OF LEASING\n"
        "If the specified vehicle is leased or under a contact of leasing, and if Option 43D, 43E or "
        "43F applies and the owner and lessee are designated in the insurance contract, only the "
        "lessee will be entitled to the difference between:\n"
        "\t the value of the specified vehicle, as calculated in accordance with the applicable option; and\n"
        "\t the ''actual cash value'' of the specified vehicle, as calculated in accordance "
        "with Article 2.2, ''Reporting a loss and submitting a claim.''\n"
        "All other conditions of the insurance contract remain the same.\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text
