from ..config import NEW_PAGE_TAG


def generate_fpq1_pages_header_text() -> str:
    """
    Function to generate FPQ1 pages header text.

    Return:
        The FPQ1 pages header.
    """
    text = (
        "OWNERS FORM\n"
        "Q.P.F. B 1 – QUEBEC AUTOMOBILE INSURANCE POLICY (2014-03)\n"
        "Approved by the Autorité des marchés financiers\n"
    )

    return text


def generate_toc_text() -> str:
    """
    Function to generate FPQ1 TOC text.

    Return:
        The FPQ1 Table Of Content.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "TABLE OF CONTENTS\n"
        "INTRODUCTION 3\n"
        "1. DOCUMENTS INCLUDED IN INSURANCE CONTRACT 3\n"
        "2. OBLIGATION TO INFORM INSURER 3\n"
        "DECLARATIONS 4\n"
        "SECTION A: COVERAGE FOR CIVIL LIABILITY ARISING FROM PROPERTY DAMAGE AND BODILY INJURY "
        "CAUSED TO ANOTHER PERSON (MANDATORY INSURANCE) 6\n"
        "1. INSURED PERSONS 6\n"
        "2. INSURED VEHICLES 6\n"
        "3. PRINCIPAL COVERAGE 6\n"
        "3.1 Description of principal coverage 6\n"
        "3.2 Clarification concerning damage 7\n"
        "4. ADDITIONAL COVERAGES 7\n"
        "4.1 Protection and defence of insured persons' interests 7\n"
        "4.2 Bearing certain costs related to legal action 7\n"
        "4.3 Reimbursement of medical treatment 8\n"
        "4.4 Bearing costs claimed by municipality 8\n"
        "5. EXCLUSIONS 8\n"
        "6. INDEMNITY PAYABLE BY INSURER 8\n"
        "6.1 General rule 8\n"
        "6.2 Adjustment of amount of insurance by law 9\n"
        "6.3 Cases where insured persons must refund indemnity 9\n"
        "6.4 Limitation of amount of insurance for nuclear hazard 9\n"
        "6.5 Specific rules for vehicle of which the named insured has recently become the owner 9\n"
        "6.6 Specific rules for temporary replacement vehicle 9\n"
        "6.7 Specific rules for vehicle of which named insured is not the owner 10\n"
        "6.8 Specific rules for trailers or semi-trailers attached to a motor vehicle 10\n"
        "6.9 Specific rules for insured vehicle in custody of a person engaged in a garage business 10\n"
        "7. REPRESENTATION MANDATE 11\n"
        "SECTION B: COVERAGE FOR DAMAGE TO INSURED VEHICLES (OPTIONAL INSURANCE) 11\n"
        "1. INSURED PERSON 11\n"
        "2. INSURED VEHICLES 11\n"
        "3. PRINCIPAL COVERAGE 11\n"
        "3.1 Description of principal coverage 11\n"
        "3.2 Description of protections 12\n"
        "4. ADDITIONAL COVERAGES 13\n"
        "4.1 Travel expenses due to theft of insured vehicle 13\n"
        "4.2 Bearing costs claimed by municipality 13\n"
        "4.3 Bearing other costs 13\n"
        "5. COVERAGE FOR TEMPORARY REPLACEMENT VEHICLES 14\n"
        "6. EXCLUSIONS 14\n"
        "7. DEDUCTIBLE PAYABLE BY NAMED INSURED 15\n"
        "8. INDEMNITY PAYABLE BY INSURER 15\n"
        "8.1 General rule 15\n"
        "8.2 Time of payment 16\n"
        "8.3 Specific rules for vehicle of which the named insured has recently become the owner 16\n"
        f"{NEW_PAGE_TAG}\n"
        "8.4 Specific rules for temporary replacement vehicle 16\n"
        "8.5 Specific rules for trailers or semi-trailers attached to a motor vehicle 16\n"
        "GENERAL CONDITIONS 17\n"
        "1. LAWS APPLICABLE TO INSURANCE CONTRACT 17\n"
        "2. PLACES WHERE COVERAGE APPLIES 17\n"
        "3. CONTINUATION OF COVERAGE AFTER A LOSS 17\n"
        "4. RULES PERTAINING TO APPLICATION OF INSURANCE CONTRACT WHEN THERE ARE TWO OR MORE DESCRIBED VEHICLES 17\n"
        "5. DISCLOSURE TO INSURER 17\n"
        "5.1 Initial declaration of risk 17\n"
        "5.2 Aggravation of risk 18\n"
        "5.3 Consequences of misrepresentation or non-disclosure 18\n"
        "6. BREACH OF WARRANTY 19\n"
        "7. PROHIBITED USE OF INSURED VEHICLE 20\n"
        "8. EXAMINATION OF INSURED VEHICLES 20\n"
        "9. NOTICE TO INSURER AND NAMED INSURED 20\n"
        "REPORTING A LOSS AND SUBMITTING A CLAIM 20\n"
        "1. WHAT TO DO IN THE EVENT OF A LOSS 20\n"
        "1.1 Report information to insurer 20\n"
        "1.2 Fulfil obligations relating to insured vehicle 21\n"
        "1.3 Refrain from commenting on liability and from settling claim 22\n"
        "1.4 Cooperate with the insurer 22\n"
        "2. HOW TO CALCULATE VALUE OF DAMAGE 22\n"
        "2.1 Value of damage payable by insurer for repair of insured vehicle 22\n"
        "2.2 Value of damage payable by insurer for insured vehicle if a total loss 23\n"
        "2.3 Value of damage where insurer may decide to repair, rebuild or replace damaged property 23\n"
        "3. RIGHT OF INSURER AFTER PAYING AN INDEMNITY (RIGHT OF SUBROGATION) 24\n"
        "3.1 General rule 24\n"
        "3.2 Exceptions 24\n"
        "4. ARBITRATION IN EVENT OF DISAGREEMENT BETWEEN NAMED INSURED AND INSURER 24\n"
        "4.1 Request for arbitration 24\n"
        "4.2 Designation of experts and arbitrator 25\n"
        "4.3 Value of damage payable by insurer 25\n"
        "4.4 Conduct of arbitration 25\n"
        "4.5 Choice of language 26\n"
        "4.6 Place of arbitration proceedings 26\n"
        "4.7 Arbitrator's decision 26\n"
        "4.8 Costs and fees of arbitration 26\n"
        "5. PRESERVATION OF RIGHTS OF NAMED INSURED AND INSURER 26\n"
        "6. TIME TO START LEGAL ACTION UNDER INSURANCE CONTRACT (PRESCRIPTION PERIOD) 26\n"
        "EFFECTIVE DATE, RENEWAL AND EXPIRY OF INSURANCE CONTRACT 27\n"
        "1. EFFECTIVE DATE AND EXPIRY OF INSURANCE CONTRACT 27\n"
        "2. RENEWAL OF INSURANCE CONTRACT 27\n"
        "3. CANCELLATION OF INSURANCE CONTRACT ( ENDING OF INSURANCE CONTRACT) 27\n"
        "3.1 Cancellation by named insured 27\n"
        "3.2 Cancellation by insurer 28\n"
        "CANCELLATION TABLE 29\n"
        "DEFINITIONS 30\n"
        f"{NEW_PAGE_TAG}\n"
    )
    return text


def generate_introduction_text() -> str:
    """
    Function to generate FPQ1 introduction.

    Return:
        The FPQ1 introduction.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "INTRODUCTION\n"
        "The following is to provide general explanations concerning the insurance contract to make it easier to "
        "understand. These explanations must not be used to create any right or coverage.\n"
        "In case of any ambiguity or discrepancy between the introduction and the laws applicable to the "
        "insurance contract, the terms of the laws will prevail.\n"
        "1. DOCUMENTS INCLUDED IN INSURANCE CONTRACT\n"
        "The following documents form part of the insurance contract:\n"
        "\t This document, i.e., the ''Quebec Automobile Insurance Policy Form (Q.P.F.) B 1 – Owners' Form,'' "
        "a standard document approved by the Autorité des marchés financiers.\n"
        "Note that the ''Declarations'' section of this insurance policy contains information specific to the "
        "named insured.\n"
        "\t The endorsements listed in Item 4, ''Declarations.''\n"
        "Below is useful information to help understand the insurance contract:\n"
        "\t Refer to the ''Table of Contents'' to see how the insurance contract is structured and to locate "
        "specific information.\n"
        "\t Words and expressions in bold throughout this document and in the endorsements are explained "
        "in the ''Definitions'' section. Note that the endorsements may include their own definitions.\n"
        "\t The insurance contract should be read as a whole. Consequently, clauses should be interpreted as "
        "they relate to each other and considering the entire insurance contract.\n"
        "\t Coverages described in Section A and Section B are different and apply separately.\n"
        "\t Words in the singular include the plural.\n"
        "2. OBLIGATION TO INFORM INSURER\n"
        "Both before the contract is made and after, any and all information that may influence the risk must "
        "be reported to the insurer. Such information must also be reported upon renewal of the insurance "
        "contract.\n"
        "In case of doubt over the obligation to report specific information, it is advisable to contact the "
        "insurer.\n"
        "Among other information, the following must be reported:\n"
        "\t Any change in the use of the described vehicle.\n"
        "\t If any persons other than the named insured drive the described vehicle.\n"
        "\t Any automobile accident or any loss that occurred in the past.\n"
        "\t Any conviction for an offence under the Highway Safety Code.\n"
        "\t Any criminal conviction.\n"
        "\t Any change or addition to the described vehicle.\n"
        "\t Any change to the personal circumstances of the named insured or drivers.\n"
        "The obligation to inform the insurer is detailed in Article 5, ''General conditions.''\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text


def generate_declarations_text() -> str:
    """
    Function to generate FPQ1 declarations.

    Return:
        The FPQ1 declarations.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "DECLARATIONS\n"
        "ITEM 1\n"
        "Name and address of the named insured:\n"
        "The described vehicle is and will be mainly used, stored and parked in the town/city and province shown "
        "in Item 1. If not, the client or the named insured must so declare.\n"
        "ITEM 2\n"
        "Contract period:\n"
        "From ________________* to _______________* exclusively.\n"
        "*at 12:01 A.M. standard time at the address of the named insured.\n"
        "ITEM 3\n"
        "Particulars of the described vehicle:\n"
        "Creditor entitled to the indemnities under Section B, to the extent of the creditor's interest:\n"
        "ITEM 4\n"
        "The perils covered by the insurance contract are those for which an amount of insurance, a deductible "
        "or an insurance premium is shown in the table below. Coverage is subject to the conditions set out in "
        "the insurance contract.\n"
        "COVERAGE | PERILS | AMOUNT OF INSURANCE AND DEDUCTIBLE | INSURANCE PREMIUM\n"
        "Section A: Civil liability | Property damage or bodily injury to another person | "
        "Amount of insurance: $ |  $\n"
        "Section B: Damage to insured vehicles | Protection 1 : ''All perils'', Protection 2: "
        "Collision and upset, Protection 3: All perils other than collision or upset, "
        "Protection 4: Specific perils | Deductible per loss: $ $ $ $ | $ $ $ $\n"
        "Endorsements: |  |  |  $|\n"
        "Due date for payment of insurance premiums: | Total: | $\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        f"ITEM 5\n"
        f"The named insured is both the actual owner and the registered owner of the described vehicle. If not, "
        f"the following information must be provided:\n"
        f"Actual owner:\n"
        f"Registered owner:\n"
        f"ITEM 6\n"
        f"Important statements for analyzing the risk:\n"
        f"ITEM 7\n"
        f"Information for the named insured:\n"
        f"Name of insurance broker or agent:\n"
        f"Address of insurance broker or agent:\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text


def generate_section_a_text() -> str:
    """
    Function to generate FPQ1 Section A.

    Return:
        The FPQ1 Section A.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "SECTION A:\n"
        "COVERAGE FOR CIVIL LIABILITY ARISING FROM PROPERTY DAMAGE AND BODILY INJURY CAUSED TO ANOTHER PERSON\n"
        "(MANDATORY INSURANCE)\n"
        "1. INSURED PERSONS\n"
        "The persons insured under Section A are as follows:\n"
        "\t the named insured;\n"
        "\t any person who drives an insured vehicle; and\n"
        "\t any person who uses an insured vehicle. Any person who operates a part of an insured vehicle is "
        "deemed to be using that vehicle.\n"
        "The legal representatives and succession of such persons are also insured.\n"
        "A person who steals or assists in stealing an insured vehicle is not insured.\n"
        "2. INSURED VEHICLES\n"
        "Unless the context indicates otherwise, the expression ''insured vehicle'' under Section A refers to the "
        "following:\n"
        "\t A. Described vehicle.\n"
        "\t B. Vehicle of which the named insured has recently become the owner, subject to the "
        "conditions set out in that definition.\n"
        "\t C. Temporary replacement vehicle, subject to the conditions set out in that definition.\n"
        "\t D. Vehicle of which the named insured is not the owner, subject to the conditions set out in that "
        "definition.\n"
        "\t E. Trailer or semi-trailer of which the named insured is the owner, subject to the conditions set "
        "out in that definition.\n"
        "\t F. Trailer or semi-trailer of which the named insured is not the owner and that is used with a "
        "vehicle insured under the insurance contract.\n"
        "3. PRINCIPAL COVERAGE\n"
        "3.1 Description of principal coverage\n"
        "Section A covers the following risk: the financial consequences that an insured person may incur if "
        "held civilly liable for damage caused to another person by an insured vehicle.\n"
        "The insured person's civil liability must arise from the fact that he or she is the owner of the vehicle or "
        "was driving or using it.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "3.2 Clarification concerning damage\n"
        "3.2.1 Damage caused to trailers or semi-trailers of which insured persons are not the owners\n"
        "When damage is caused to a trailer or semi-trailer of which an insured person is not the owner and:\n"
        "\t the trailer or semi-trailer is attached to a motor vehicle used for personal purposes and "
        "insured under this Section A; or\n"
        "\t it is not attached to a motor vehicle used for personal purposes, provided that it is usually "
        "attached to such a vehicle;\n"
        "the financial consequences suffered by the insured person will be covered if the trailer or "
        "semi-trailer is not designed or used either to carry passengers or for demonstration, "
        "sales, office or dwelling purposes.\n"
        "3.2.2 Damage under the Direct Compensation Agreement\n"
        "When property damage is caused to an insured person and if the Direct Compensation "
        "Agreement made in accordance with the Automobile Insurance Act applies, this damage will be "
        "covered under Section A.\n"
        "3.2.3 Damage caused to another named insured\n"
        "When a named insured suffers damage caused by another named insured, the person who suffers the "
        "damage will be deemed to be another person and may therefore be indemnified by the insurer under "
        "Section A.\n"
        "4. ADDITIONAL COVERAGES\n"
        "When the principal coverage applies, Section A will include the following additional coverages:\n"
        "4.1 Protection and defence of insured persons' interests\n"
        "When a loss is reported, the insurer will protect the interests and assume the defence of the "
        "insured persons.\n"
        "The insurer is free to act as it wishes with regard to investigation, transaction or settlement.\n"
        "However, the insurer may not raise any legal defence prohibited to insurers where the loss occurred.\n"
        "4.2 Bearing certain costs related to legal action\n"
        "When an insured person is sued, the insurer will bear\n"
        "\t the costs and expenses arising from the lawsuit; and\n"
        "\t any interest on the amount of insurance.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "4.3 Reimbursement of medical treatment\n"
        "When another person suffers bodily injury, the insurer will reimburse expenses incurred by an "
        "insured person for immediately necessary medical treatment.\n"
        "4.4 Bearing costs claimed by municipality\n"
        "The insurer bears the costs claimed from the named insured by a municipality under the Act "
        "respecting municipal taxation and its regulations, if its fire protection service was called to "
        "prevent or fight any fire in an insured vehicle.\n"
        "5. EXCLUSIONS\n"
        "The following are excluded from coverage under Section A:\n"
        "A. Any bodily injury when compensation is provided under:\n"
        "\t the Automobile Insurance Act,\n"
        "\t An Act respecting industrial accidents and occupational diseases, or\n"
        "\t the Crime Victims Compensation Act.\n"
        "However, if the Automobile Insurance Act does not apply, coverage will be provided.\n"
        "B. Any liability imposed under a worker's compensation act.\n"
        "C. Any bodily injury caused to a person who is employed by an insured person and who is "
        "engaged in the operation or repair of an insured vehicle.\n"
        "D. Any damage caused to a person who is engaged in a garage business while the insured vehicle "
        "is in the person's custody.\n"
        "E. Any loss that occurs while the insured vehicle is:\n"
        "\t leased to another person;\n"
        "\t used as a taxicab, sightseeing vehicle, bus, coach or other chauffeur-driven vehicle;\n"
        "\t used to carry explosives;\n"
        "\t used to carry radioactive material for research, education, development, industrial or other "
        "related purposes.\n"
        "\t The insurer may accept to insure the above situations by specifying them in ''Declarations'' or by "
        "way of an endorsement.\n"
        "6. INDEMNITY PAYABLE BY INSURER\n"
        "6.1 General ruleThe indemnity payable by the insurer may not be greater than the amount of insurance, "
        "plus any expenses described under the additional coverages. This rule applies even if:\n"
        "\t there are more than one insured person or multiple interests;\n"
        "\t more than one person suffers damage;\n"
        "\t more than one insured person is civilly liable for damage arising from one and the same loss; and\n"
        "\t if damage differs in nature.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "If more than one insured person are civilly liable for damage arising from one and the same "
        "loss and the amount of insurance is insufficient, the named insured will be given priority for coverage.\n"
        "6.2 Adjustment of amount of insurance by law\n"
        "If the amount of insurance is less than the minimum amount prescribed by the applicable laws "
        "regarding motor vehicle insurance which are in force where the loss occurred, the amount of "
        "insurance will be adjusted to comply with this minimum requirement.\n"
        "6.3 Cases where insured persons must refund indemnity\n"
        "If the insurer is required to indemnify another person under a legal provision regarding motor "
        "vehicle insurance and the insurer was not otherwise required to do so under the insurance "
        "contract, the insured persons agree to refund such indemnity to the insurer, upon request.\n"
        "6.4 Limitation of amount of insurance for nuclear hazard\n"
        "If damage arose out of the occurrence of a nuclear hazard, the applicable amount of insurance "
        "will be limited to the minimum amount prescribed by either of the following laws, depending on "
        "the type of motor vehicle involved in the loss:\n"
        "\t Automobile Insurance Act; or\n"
        "\t An Act Respecting Off-highway Vehicles.\n"
        "6.5 Specific rules for vehicle of which the named insured has recently become the owner\n"
        "\t A. The vehicle of which the named insured has recently become the owner will benefit "
        "from the same coverage as the described vehicle.\n"
        "\t B. If the named insured has more than one described vehicle insured with the insurer, under "
        "one or more insurance contracts, the vehicle of which he or she has recently "
        "become the owner will be insured to the extent of the least of existing coverages on all "
        "such other vehicles.\n"
        "6.6 Specific rules for temporary replacement vehicle\n"
        "A. Any civil liability insurance contract issued to the owner of a temporary replacement "
        "vehicle applies first.\n"
        "B. This Section A will apply only if the insurance of that owner is insufficient,\n"
        "\t up to the amount of insurance on the described vehicle, and\n"
        "\t only for the amount exceeding the obligation of the owner's insurer.\n"
        "If the named insured has more than one described vehicle insured with the insurer, under one "
        "or more insurance contracts, the highest amount of insurance on those vehicles will apply.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "6.7 Specific rules for vehicle of which named insured is not the owner\n"
        "A. Any civil liability insurance contract issued to the owner of a vehicle of which the named "
        "insured is not the owner applies first.\n"
        "B. This Section A will apply only if the insurance of that owner is insufficient,\n"
        "\t up to the amount of insurance on the described vehicle, and\n"
        "\t only for the amount exceeding the obligation of the owner's insurer.\n"
        "If the named insured has more than one described vehicle insured with the insurer, under one "
        "or more insurance contracts, the highest amount of insurance on those vehicles will apply.\n"
        "C. For the four exceptions described in the definition of vehicle of which the named insured "
        "is not the owner and subject to the conditions set out therein, the amount of insurance is "
        "limited to the minimum amount prescribed by either of the following laws, depending on the type "
        "of motor vehicle involved in the loss:\n"
        "\t Automobile Insurance Act; or\n"
        "\t An Act Respecting Off-highway Vehicles.\n"
        "6.8 Specific rules for trailers or semi-trailers attached to a motor vehicle\n"
        "A. When one or more trailers or semi-trailers are attached to a motor vehicle, they will be "
        "held to be one and the same vehicle.\n"
        "This rule means that, if damage is caused by the motor vehicle, trailer or semi-trailer, a single "
        "amount of insurance will apply, namely, the highest amount.\n"
        "B. The same rule will apply if the vehicles are insured under different insurance contracts "
        "with the insurer.\n"
        "C. For the four exceptions described in the definition of vehicle of which the named insured "
        "is not the owner and subject to the conditions set out therein, the amount of insurance is "
        "limited to the minimum amount prescribed by either of the following laws, depending on the "
        "type of motor vehicle involved in the loss:\n"
        "\t Automobile Insurance Act; or\n"
        "\t An Act Respecting Off-highway Vehicles.\n"
        "6.9 Specific rules for insured vehicle in custody of a person engaged in a garage business\n"
        "When damage is caused by an insured vehicle in the custody of a garage business at the time of loss:\n"
        "\t A. The insurance contract of the person who engages in a garage business and in whose "
        "custody the vehicle has been placed applies first, provided such contract covers the person's "
        "civil liability without expressly designating the vehicles that are insured.\n"
        "\t B. This Section A only applies if such person's insurance is insufficient,\n"
        "\t up to the applicable amount of insurance, and\n"
        "\t only for the amount exceeding the obligation of that person's insurer.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "7. REPRESENTATION MANDATE\n"
        "The insured persons authorize the insurer to represent them in any lawsuit brought against them in "
        "Canada or the United States.\n"
        "The lawsuit must arise from the fact that the insured person is the owner of the insured vehicle or "
        "from the insured person having been driving or using it.\n"
        "This representation mandate includes the right for the insurer to appear on behalf of the insured "
        "persons and to assume their defence.\n"
        "The insured persons renounce their right to withdraw this mandate from the insurer without the "
        "insurer's consent.\n"
    )
    return text


def generate_section_b_text() -> str:
    """
    Function to generate FPQ1 Section B.

    Return:
        The FPQ1 Section B.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "SECTION B:\n"
        "COVERAGE FOR DAMAGE TO INSURED VEHICLES\n"
        "(OPTIONAL INSURANCE)\n"
        "1. INSURED PERSON\n"
        "The insured person under Section B is the named insured.\n"
        "To determine which persons are insured when a temporary replacement vehicle is involved in a "
        "loss, refer to Article 5, Section B.\n"
        "2. INSURED VEHICLES\n"
        "Unless the context indicates otherwise, the expression ''insured vehicle'' under Section B refers to the "
        "following vehicles:\n"
        "\t A. Described vehicle.\n"
        "\t B. Vehicle of which the named insured has recently become the owner, subject to the "
        "conditions set out in that definition.\n"
        "3. PRINCIPAL COVERAGE\n"
        "3.1 Description of principal coverage\n"
        "Section B covers:\n"
        "\t any direct and accidental damage to an insured vehicle or its equipment and accessories; and\n"
        "\t the disappearance of an insured vehicle or its equipment and accessories.\n"
        "The damage or disappearance must result from the occurrence of a peril covered by the "
        "applicable protection.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "3.2 Description of protections\n"
        "To determine which protection applies, refer to Item 4, ''Declarations.''\n"
        "3.2.1 Protection 1 – ''All perils'' coverage\n"
        "This protection covers damage caused by any type of peril. However, perils and damage as "
        "listed in Article 6, Section B are excluded.\n"
        "3.2.2 Protection 2 – Coverage against perils of collision and upset\n"
        "This protection covers damage caused by the perils of collision and upset.\n"
        "''Collision'' includes:\n"
        "\t any collision between an insured vehicle and the ground;\n"
        "\t any collision between two vehicles attached to each other; and\n"
        "\t any collision between an insured vehicle and a person or an animal.\n"
        "''Upset'' of an insured vehicle may be partial or total.\n"
        "However, perils and damage as listed in Article 6, Section B are excluded.\n"
        "3.2.3 Protection 3 - Coverage against perils other than collision or upset\n"
        "This protection covers damage caused by perils other than collision or upset.\n"
        "Coverage includes damage caused by the following perils:\n"
        "\t the perils listed in Protection 4;\n"
        "\t falling or flying objects;\n"
        "\t malicious mischief; and\n"
        "\t projectiles.\n"
        "Like Protection 2, this protection also covers damage caused by a collision between an "
        "insured vehicle and a person or an animal.\n"
        "However, perils and damage as listed in Article 6, Section B are excluded.\n"
        "3.2.4 Protection 4 - Coverage against specific perils\n"
        "This protection only covers damage caused by the following perils:\n"
        "\t attempted theft;\n"
        "\t civil commotion;\n"
        "\t earthquakes;\n"
        "\t explosions;\n"
        "\t falling or forced landing of aircraft or parts of aircraft;\n"
        "\t fire;\n"
        "\t hail;\n"
        "\t lightning;\n"
        "\t riots;\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "\t rising water;\n"
        "\t stranding, sinking, burning, derailment or collision of any vehicle or vessel in or upon which "
        "an insured vehicle is being transported;\n"
        "\t theft; and\n"
        "\t windstorms.\n"
        "However, perils and damage as listed in Article 6, Section B are excluded.\n"
        "4. ADDITIONAL COVERAGES\n"
        "When the principal coverage applies, Section B will include the following additional coverages:\n"
        "4.1 Travel expenses due to theft of insured vehicle\n"
        "If an insured vehicle is covered by Protection 1, Protection 3 or Protection 4 and can no longer "
        "be used by the named insured due to theft of the entire vehicle, the insurer will reimburse any "
        "expenses incurred for:\n"
        "\t leasing of temporary replacement vehicle;\n"
        "\t public transportation; and\n"
        "\t use of taxicab.\n"
        "Upon submission of receipts, the above expenses will be reimbursed up to a maximum of 40$ a day "
        "and 1200$ per loss.\n"
        "This coverage only applies to expenses incurred 72 hours or more after the theft has been "
        "reported to the police or the insurer, even if the insurance contract has expired since the loss.\n"
        "Expenses will no longer be eligible for reimbursement once:\n"
        "\t the insured vehicle has been replaced, or repaired if it was found damaged; or\n"
        "\t a settlement agreement for the loss has been reached before the insured vehicle is replaced or repaired.\n"
        "4.2 Bearing costs claimed by municipality\n"
        "The insurer bears the costs claimed from the named insured by a municipality under the Act respecting "
        "municipal taxation and its regulations, if its fire protection service was called to prevent or "
        "fight any fire in an insured vehicle.\n"
        "4.3 Bearing other costs\n"
        "The insurer will bear the following costs when the named insured is civilly liable:\n"
        "\t general average costs;\n"
        "\t salvage costs; and\n"
        "\t customs duties of Canada and the United States.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "5. COVERAGE FOR TEMPORARY REPLACEMENT VEHICLES\n"
        "The insurer will indemnify the named insured and the driver of a temporary replacement vehicle "
        "against the financial consequences they may incur when they are civilly liable for:\n"
        "\t direct and accidental damage to the vehicle; or\n"
        "\t disappearance of the vehicle.\n"
        "Civil liability may be contractual or extracontractual.\n"
        "The following conditions apply:\n"
        "\t the coverage applicable to the temporary replacement vehicle, i.e., coverage of the "
        "described vehicle that it replaces, must include the peril that caused the damage; and\n"
        "\t the named insured or the driver must have the care, custody or control of the vehicle.\n"
        "The additional coverages under Section B do not apply to this coverage. However, the "
        "additional coverages under Section A may apply, as the case may be.\n"
        "Coverage is subject to the exclusions listed in Article 6, Section B.\n"
        "The indemnity payable by the insurer is determined in accordance with the rules set out in "
        "Article 8, Section B.\n"
        "6. EXCLUSIONS\n"
        "The following are excluded from coverage under Section B:\n"
        "A. Damage to tires, except:\n"
        "\t if damage is coincident with other damage insured under the same coverage; or\n"
        "\t in case of fire, theft or malicious mischief insured under the same coverage.\n"
        "B. Damage caused by:\n"
        "\t breakdown;\n"
        "\t corrosion;\n"
        "\t explosion within the combustion chamber;\n"
        "\t freezing;\n"
        "\t mechanical failure;\n"
        "\t normal wear and tear; and\n"
        "\t rust.\n"
        "However, the damage described above will not be excluded:\n"
        "\t if damage is coincident with other damage insured under the same coverage; or\n"
        "\t in case of fire, theft or malicious mischief insured under the same coverage.\n"
        "C. For Protection 3 and Protection 4 only, theft committed by one of the following persons:\n"
        "\t a person whose domicile is the same as that of the named insured;\n"
        "\t a person employed by the named insured in operating, selling, equipping, repairing, maintaining, "
        "servicing, storing, parking or moving an insured vehicle, whether or not the theft occurs in "
        "the course of such service or employment.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "D. Conversion, embezzlement, theft or secretion of an insured vehicle by any person in lawful "
        "possession of the vehicle under a hypothec, conditional sale, lease agreement or contract of "
        "leasing or under any other similar written agreement.\n"
        "E. Voluntary parting with title or ownership, with or without breach of trust, fraud or deceitful "
        "representation.\n"
        "F. Contents of a trailer or a semi-trailer.\n"
        "G. Tapes or accessories for use with a tape recorder or tape player, or compact discs, unless in "
        "place in a device.\n"
        "H. Whether or not war is declared, damage caused directly or indirectly by:\n"
        "\t bombardment;\n"
        "\t civil war;\n"
        "\t insurrection;\n"
        "\t invasion;\n"
        "\t military power;\n"
        "\t operation of armed forces while engaged in hostilities;\n"
        "\t rebellion;\n"
        "\t revolution; and\n"
        "\t usurped power.\n"
        "I. Damage caused by a loss that occurs while the insured vehicle:\n"
        "\t is leased to another person;\n"
        "\t is used as a taxicab, sightseeing vehicle, bus, coach or any other chauffeur-driven vehicle;\n"
        "\t is used to carry explosives;\n"
        "\t is used to carry radioactive material for research, education, development, industrial or "
        "other related purposes.\n"
        "The insurer may accept to insure the above situations by specifying them in ''Declarations'' or by "
        "way of an endorsement.\n"
        "7. DEDUCTIBLE PAYABLE BY NAMED INSURED\n"
        "The named insured must assume the deductible for the applicable protection. However, if the "
        "damage is caused by lightning or fire, the deductible will not apply.\n"
        "To determine the deductible applicable for each of the protections, refer to Item 4, ''Declarations'', or "
        "the endorsements, as applicable.\n"
        "8. INDEMNITY PAYABLE BY INSURER\n"
        "8.1 General rule\n"
        "The indemnity payable by the insurer is equal to the value of the damage, less the deductible. It "
        "also includes any expenses described under the additional coverages.\n"
        "For the rules relating to determination of the value of damage, refer to Article 2, ''Reporting a "
        "loss and submitting a claim.''\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "8.2 Time of payment\n"
        "The insurer must pay the indemnity:\n"
        "\t within 60 days after the date on which the named insured reported the loss; or\n"
        "\t within 60 days after receipt by the insurer of the information or supporting documents "
        "that it requested.\n"
        "8.3 Specific rules for vehicle of which the named insured has recently become the owner\n"
        "A. If a vehicle of which the named insured has recently become the owner replaces or "
        "is in addition to a sole described vehicle:\n"
        "\t coverage will be the same as for the described vehicle;\n"
        "\t the deductible will be the same as for the described vehicle.\n"
        "B. If the vehicle is in addition to more than one described vehicle covered under one or "
        "more insurance contracts with the insurer:\n"
        "\t damage will be covered only to the extent that all the described vehicles are covered, "
        "at the date of loss, for the peril that caused the damage;\n"
        "\t the applicable deductible will be the highest of all deductibles for the protections "
        "covering the peril that caused the damage.\n"
        "8.4 Specific rules for temporary replacement vehicle\n"
        "A. Any insurance contract issued to the owner of the temporary replacement vehicle will "
        "apply first.\n"
        "B. This Section B only applies if:\n"
        "\t the owner of the vehicle is not covered for the damage caused to his or her vehicle; or\n"
        "\t the owner of the vehicle is covered, but the deductible under his or her insurance "
        "contract is higher than the deductible under this contract. The indemnity under this Section B "
        "is then limited to the difference between:\n"
        "- the deductible payable by the owner of the vehicle; and\n"
        "- the deductible payable for the described vehicle that is being replaced by the temporary "
        "replacement vehicle.\n"
        "8.5 Specific rules for trailers or semi-trailers attached to a motor vehicle\n"
        "If one or more trailers or semi-trailers are attached to a motor vehicle and the vehicles incur "
        "damage in the same loss:\n"
        "\t the vehicles will be held to be separate vehicles; and\n"
        "\t their own coverage and their own deductible will apply.\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text


def generate_general_conditions_text() -> str:
    """
    Function to generate FPQ1 general conditions.

    Return:
        The FPQ1 general conditions.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "GENERAL CONDITIONS\n"
        "1. LAWS APPLICABLE TO INSURANCE CONTRACT\n"
        "The insurance contract is governed by the following laws:\n"
        "\t Civil Code of Quebec;\n"
        "\t Code of Civil Procedure of Quebec;\n"
        "\t Automobile Insurance Act and its regulations; and\n"
        "\t An Act Respecting Off-highway Vehicles, where applicable.\n"
        "Some of the general conditions of the insurance contract are a simplified version of the requirements "
        "of the above laws. In case of any ambiguity or discrepancy, the terms of the laws will prevail.\n"
        "2. PLACES WHERE COVERAGE APPLIES\n"
        "The coverage provided under the insurance contract will apply only if the loss occurs:\n"
        "\t in Canada or the United States; or\n"
        "\t on a vessel or in an aircraft travelling between the seaports and airports of those countries.\n"
        "The insurer may accept, by way of endorsement, to cover a loss that occurs elsewhere.\n"
        "3. CONTINUATION OF COVERAGE AFTER A LOSS\n"
        "A loss does not cause the insurance contract to terminate.\n"
        "4. RULES PERTAINING TO APPLICATION OF INSURANCE CONTRACT WHEN THERE ARE TWO OR "
        "MORE DESCRIBED VEHICLES\n"
        "If there are two or more described vehicles, the insurance contract is deemed to apply to each of "
        "the vehicles as if a separate contract had been issued for each of them.\n"
        "5. DISCLOSURE TO INSURER\n"
        "5.1 Initial declaration of risk\n"
        "The client and the insured person if required by the insurer are bound to represent the facts "
        "known to them that are likely to materially influence an insurer in:\n"
        "\t analyzing the risk;\n"
        "\t deciding whether or not to cover the risk; or\n"
        "\t setting the insurance premium.\n"
        "However, the client and the insured person are not required to represent facts known to the "
        "insurer already or which the insurer is presumed to know by their notoriety, unless the insurer "
        "asks questions in that regard.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "5.2 Aggravation of risk\n"
        "5.2.1 Obligation of insured person\n"
        "The insured person is required to promptly report to the insurer any change that "
        "increases the risks specified in the insurance contract.\n"
        "The facts to be reported must result from events within the control of the insured person."
        "They must also be likely to materially influence an insurer in:\n"
        "\t analyzing the risk;\n"
        "\t deciding whether to continue or terminate the insurance contract; or\n"
        "\t setting the insurance premium.\n"
        "5.2.2 Rights of insurer\n"
        "Upon being informed of any new facts, the insurer may:\n"
        "\t propose a new insurance premium to the named insured in writing. The named insured must "
        "then accept and pay the new insurance premium within 30 days of the proposal, failing which "
        "the insurance contract will terminate; or\n"
        "\t cancel the insurance contract subject to the conditions set out in Article 3, ''Effective date, "
        "renewal and expiry of insurance contract.''\n"
        "However, if the insurer continues to accept payment of the insurance premium or if the "
        "insurer pays an indemnity after a loss, the insurer will be deemed to have accepted the "
        "new facts as reported.\n"
        "5.3 Consequences of misrepresentation or non-disclosure\n"
        "5.3.1 Consequences for Section A\n"
        "A. Nullification of Section A\n"
        "Section A may be nullified at any time at the instance of the insurer if:\n"
        "(a) the client or an insured person:\n"
        "\t has falsely declared any of the information that must be reported, as stated in Articles "
        "5.1 and 5.2 of this section (known as ''misrepresentation''); or\n"
        "\t has voluntarily failed to disclose any of the information referred to in Articles 5.1 "
        "and 5.2 of this section (known as ''concealment'');\n"
        "and\n"
        "(b) such misrepresentation or concealment is likely to substantially influence a "
        "reasonable insurer in the decision to cover the risk.\n"
        "B. Reduction of indemnity following a loss\n"
        "If, following a loss, the insurer fails to establish that the misrepresentation or "
        "concealment was likely to substantially influence a reasonable insurer in the "
        "decision to cover the risk, the insurer will be required to pay a portion of the "
        "indemnity.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "The indemnity is calculated in proportion to the insurance premium established by the "
        "insurer before becoming aware of the misrepresentation or concealment, divided by the "
        "insurance premium that the insurer would have established, had the client or the insured "
        "person provided the information that they were required to disclose.\n"
        "5.3.2 Consequences for Section B\n"
        "A. Nullification of Section B\n"
        "Section B may be nullified at any time at the instance of the insurer if:\n"
        "(a) the client or an insured person:\n"
        "\t has falsely declared any of the information that must be reported, as stated in "
        "Articles 5.1 and 5.2 of this section (known as ''misrepresentation''); or\n"
        "\t has voluntarily failed to disclose any of the information referred to in Articles 5.1 "
        "and 5.2 of this section (known as ''concealment'');\n"
        "and\n"
        "(b) such misrepresentation or concealment is likely to substantially influence a reasonable "
        "insurer in the decision to cover the risk.\n"
        "Following a loss, Section B may be nullified at the instance of the insurer even if the "
        "loss does not result from the risk so misrepresented or concealed.\n"
        "B. Reduction of indemnity following a loss\n"
        "Following a loss, and notwithstanding any misrepresentation or concealment, the insurer "
        "is required to pay a portion of the indemnity if the insurer fails to establish:\n"
        "\t the bad faith of the named insured or the client; or\n"
        "\t that it would not have covered the risk, had it known the true facts.\n"
        "The indemnity is calculated in proportion to the insurance premium established by the "
        "insurer before becoming aware of the misrepresentation or concealment, divided by the "
        "insurance premium that the insurer would have established, had the client or the insured "
        "person provided the information that they were required to disclose.\n"
        "6. BREACH OF WARRANTY\n"
        "In the event of a breach of warranty aggravating the risk, coverage of the risk subject to "
        "the warranty will be suspended.\n"
        "The suspension will cease when:\n"
        "\t an insured person remedies the breach; or\n"
        "\t the insurer gives its consent.\n"
        "Warranties may be found, among others, in:\n"
        "\t the ''Declarations'' section; and\n"
        "\t the endorsements.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "7. PROHIBITED USE OF INSURED VEHICLE\n"
        "The insured vehicle may not be driven or operated by the insured persons\n"
        "(a) When the insured persons:\n"
        "\t are under 16 years of age or the legal age to drive; and\n"
        "\t are not authorized to drive, by law, or qualified to drive or operate the vehicle.\n"
        "(b) To make any illicit trade or transportation.\n"
        "(c) To participate in a race or speed test.\n"
        "In addition, the insured persons are not to allow another person to use the insured vehicle in the "
        "above situations.\n"
        "8. EXAMINATION OF INSURED VEHICLES\n"
        "At any reasonable time, the insurer is entitled to examine the described vehicle and its "
        "equipment and accessories.\n"
        "9. NOTICE TO INSURER AND NAMED INSURED\n"
        "Any notice to the insurer may be sent by any recognized means of communication to the insurer "
        "or its authorized representative.\n"
        "Any notice to the named insured may be delivered personally to the named insured or by mail to "
        "the last known address of the name insured.\n"
    )

    return text


def generate_loss_and_claims_reporting_text() -> str:
    """
    Function to generate FPQ1 loss reporting and claims processing.

    Return:
        The FPQ1 loss reporting and claims processing.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        "REPORTING A LOSS AND SUBMITTING A CLAIM\n"
        "1. WHAT TO DO IN THE EVENT OF A LOSS\n"
        "1.1 Report information to insurer\n"
        "1.1.1 Report the loss\n"
        "Notice must be given to the insurer as soon as an insured person becomes aware of a loss "
        "that may be covered under the insurance contract.\n"
        "Any interested person may give such notice to the insurer.\n"
        "Failure to fulfil the obligation to report the loss will result in the loss of his or her right to "
        "indemnity for the insured person if such failure causes prejudice to the insurer.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "1.1.2 Report any additional information\n"
        "When so requested by the insurer, the insured person will be required to inform the "
        "insurer as soon as possible of all the circumstances surrounding the loss, including:\n"
        "\t the probable cause of the loss;\n"
        "\t the nature and extent of the damage;\n"
        "\t the location of the insured vehicle or any other property;\n"
        "\t the rights of another person; and\n"
        "\t any other insurance contracts that may apply.\n"
        "The insured person must also provide the insurer with supporting documents and declare "
        "under oath that all of the information provided is true.\n"
        "If, for any serious reason, the insured person is unable to fulfil these obligations as "
        "soon as possible, the insured person will be entitled to a reasonable time in which to do so.\n"
        "If the insured person fails to fulfil these obligations, any interested person may do so on "
        "the insured person's behalf.\n"
        "The insured person must also provide the insurer promptly with a copy of any documents "
        "received in connection with a claim, including:\n"
        "\t notices;\n"
        "\t letters; and\n"
        "\t summons and any other legal process.\n"
        "1.1.3 Consequences of deceitful representations\n"
        "If a person makes a deceitful representation relating to a loss, the person will lose his or "
        "her right to an indemnity. The person will lose that right solely with respect to the "
        "damage caused by the occurrence of the peril to which the deceitful representation relates.\n"
        "However, if the occurrence of the peril caused damage both to property for occupational "
        "use and to personal property, the person will lose his or her right to indemnity solely "
        "with respect to the damage caused to the class of property to which the deceitful "
        "representation relates.\n"
        "1.2 Fulfil obligations relating to insured vehicle\n"
        "1.2.1 Do not abandon insured vehicle\n"
        "The insured person must not abandon the insured vehicle or any other damaged property "
        "without the insurer's consent.\n"
        "1.2.2 Facilitate the salvage and examination of the insured vehicle by the insurer\n"
        "The insured person must facilitate the salvage of the insured vehicle and any other "
        "insured property.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "The insured person must also facilitate the examination by the insurer. This includes "
        "allowing the insurer and its representatives to visit any premises and examine the "
        "insured vehicle and its equipment and accessories.\n"
        "1.2.3 Protect the insured vehicle\n"
        "The insured person must ensure the protection of the insured vehicle from further loss "
        "or damage, as far as reasonably possible and at the expense of the insurer.\n"
        "If the insured person fails to fulfil this obligation, any damage resulting directly or "
        "indirectly will be at the insured person's expense.\n"
        "1.2.4 Do not perform repairs or remove physical evidence\n"
        "Until the insurer has had a reasonable time to examine the insured vehicle, as "
        "provided for in Article 8, ''General conditions'':\n"
        "\t no repairs must be made to the vehicle; and\n"
        "\t no physical evidence of the damage must be removed from the vehicle.\n"
        "However, such actions may be taken if\n"
        "\t they are necessary to protect the insured vehicle; or\n"
        "\t the insurer gives its consent in writing.\n"
        "1.3 Refrain from commenting on liability and from settling claim\n"
        "Except at his or her own cost, following a loss, the insured person must refrain:\n"
        "\t from commenting on his or her liability; and\n"
        "\t from settling or attempting to settle any claim.\n"
        "Should an insured person enter into an agreement (called a ''transaction'') in respect of the "
        "loss, without the consent of the insurer, the insurer will not be bound by such agreement.\n"
        "1.4 Cooperate with the insurer\n"
        "The insured person must cooperate with the insurer in the processing of any claim.\n"
        "2. HOW TO CALCULATE VALUE OF DAMAGE\n"
        "The value of damage payable by the insurer may not be greater than the ''actual cash value'' of the "
        "insured vehicle.\n"
        "Once the named insured has been indemnified, the insurer has the right to recover the damaged "
        "property in whole or in part.\n"
        "2.1 Value of damage payable by insurer for repair of insured vehicle\n"
        "The value of damage is determined on the basis of, among other things, the cost of materials "
        "at the time of loss.\n"
        "The materials used to repair the insured vehicle, or to replace the damaged parts, must be of "
        "like kind and quality, taking into account any kind of depreciation.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "2.1.1 Clarification concerning automobile body parts\n"
        "The insurer will determine the cost of materials on the basis of original equipment "
        "manufacturer parts if\n"
        "\t the vehicle is less than two years old or has less than 40,000 km; or\n"
        "\t the vehicle is used for commercial purposes and is less than one year old.\n"
        "In all other instances, the insurer may base its determination on the cost of similar "
        "automobile body parts. However, the named insured may ask for original equipment "
        "manufacturer parts, if available, and must then inform the insurer accordingly when "
        "reporting the loss. The insurer will then specify the applicable conditions and "
        "additional costs that the named insured will be required to pay.\n"
        "2.1.2 Parts out of stock or no longer manufactured\n"
        "If the materials needed to repair the vehicle include replacement parts that are out of stock "
        "or no longer manufactured, the liability of the insurer will be limited to the latest "
        "list price of original equipment manufacturer parts."
        "The insurer may also take into account any kind of depreciation.\n"
        "2.2 Value of damage payable by insurer for insured vehicle if a total loss\n"
        "If the insured vehicle is a total loss or constructive total loss, the value of damage will be equal "
        "to the ''actual cash value'' of the insured vehicle.\n"
        "In spite of the total loss or constructive total loss of the insured vehicle, the named insured may "
        "ask for the vehicle to be restored to the same condition as it was at the time of loss.\n"
        "The named insured must provide the insurer with supporting evidence to determine the "
        "vehicle's condition at the time of loss.\n"
        "In such instance, the insurer must accept the request if it considers that the costs are "
        "reasonable to restore the vehicle to the condition it was in at the time of loss.\n"
        "2.3 Value of damage where insurer may decide to repair, rebuild or replace "
        "damaged property\n"
        "In the absence of arbitration, and subject to the rights of preferred and hypothecary creditors, "
        "the insurer may decide to repair, rebuild or replace the damaged property with other property "
        "of like kind and quality, instead of making a cash payment.\n"
        "Before repairing, rebuilding or replacing the property, the insurer must inform the named "
        "insured in writing within seven days after receipt of the proof of loss.\n"
        "In addition, the property must be repaired, rebuilt or replaced within a reasonable amount of "
        "time.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "3. RIGHT OF INSURER AFTER PAYING AN INDEMNITY (RIGHT OF SUBROGATION)\n"
        "3.1 General rule\n"
        "After paying an indemnity, the insurer will be subrogated to the rights of the insured person "
        "against the person responsible for the damage. This means that the rights of the insured "
        "person are transferred to the insurer.\n"
        "Subrogation operates up to the amount of the indemnity paid by the insurer.\n"
        "If the insurer cannot exercise its right of subrogation due to any act of the insured person, the "
        "insurer may be fully or partly released from its obligations towards the insured person.\n"
        "3.2 Exceptions\n"
        "In the following two instances, the insurer cannot ask the person responsible for the damage "
        "to reimburse the indemnity that it has paid:\n"
        "(a) When that person is a member of the insured person's household;\n"
        "(b) For Section B only, when that person had care, custody or control of the insured "
        "vehicle, with the consent of the named insured. The latter exception will not apply if "
        "the person:\n"
        "\t was engaged in a garage business at the time of loss; or\n"
        "\t has failed to comply with the insurance contract.\n"
        "4. ARBITRATION IN EVENT OF DISAGREEMENT BETWEEN NAMED INSURED AND INSURER\n"
        "4.1 Request for arbitration\n"
        "The named insured or the insurer may request arbitration in the event of disagreement on the following:\n"
        "\t the nature, extent or value of the damage;\n"
        "\t the adequacy of the repairs or replacement.\n"
        "Arbitration may be requested even if the validity of the insurance contract is being challenged.\n"
        "4.1.1 Request made by named insured\n"
        "The named insured must send a written notice to the insurer indicating the reason of the disagreement.\n"
        "The insurer must accept a request for arbitration made by the named insured and "
        "send the name insured an acknowledgement of receipt within 15 clear days after "
        "receipt of the notice.\n"
        "4.1.2 Request made by insurer\n"
        "The insurer must send a written notice to the named insured indicating the reason of "
        "the disagreement.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "The named insured must send the insurer confirmation of his or her acceptance or refusal to submit "
        "the disagreement to arbitration within 15 clear days after receipt of the notice.\n"
        "4.2 Designation of experts and arbitrator\n"
        "The insurer and the named insured must each choose an expert.\n"
        "Depending on the nature of the disagreement, both experts thus chosen must determine:\n"
        "\t the nature, extent and value of the damage. In order to do so, they must assess\n"
        "\t separately the ''actual cash value'' and the cost of repair or replacement; or\n"
        "\t the adequacy of the repair or replacement.\n"
        "If their assessments differ, experts must try and agree on a common value.\n"
        "Should they fail to agree, they must submit their difference to a neutral arbitrator of their "
        "choosing, that is, an arbitrator who represents the interests of neither the insurer nor the "
        "named insured.\n"
        "The insurer or the named insured must ask a competent jurisdiction where the arbitration is "
        "held to appoint the arbitrator or experts if:\n"
        "\t the insurer or the named insured failed to choose an expert within 30 clear days of the "
        "date of notice;\n"
        "\t the experts fail to choose an arbitrator within15 clear days of their appointment; or\n"
        "\t one of the experts or the arbitrator refuses to act or is unavailable.\n"
        "4.3 Value of damage payable by insurer\n"
        "Even if there is arbitration, the insurer will be required to pay the unchallenged portion of the "
        "value of damage. Payment must be made no later than:\n"
        "\t within 60 days after the loss was reported; or\n"
        "\t within 60 days after receipt by the insurer of the information or supporting documents "
        "that it requested.\n"
        "However, if the validity or application of the insurance contract is being challenged, the insurer "
        "will not be required to pay such amount within the above time periods.\n"
        "Following arbitration, the insurer will be required to pay the amount determined by the "
        "arbitrator within 15 days after the date on which the named insured accepted the arbitrator's "
        "decision.\n"
        "4.4 Conduct of arbitration\n"
        "The arbitration must follow the procedure outlined in Articles 940 to 951.2, Code of Civil "
        "Procedure of Quebec, with the necessary modifications due to specific rules set out in the "
        "insurance contract.\n"
        "As stated in Article 944.1, Code of Civil Procedure of Quebec, the arbitrator may decide which "
        "procedure to apply for arbitration. Nonetheless, the arbitrator must ensure that the rules set out "
        "in Articles 940 to 951.2, Code of Civil Procedure of Quebec are followed.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "4.5 Choice of language\n"
        "The arbitrator, the insurer and the named insured may use the language of their choice "
        "during arbitration proceedings. Arrangements must be made to ensure that proceedings are "
        "understood by everyone.\n"
        "4.6 Place of arbitration proceedings\n"
        "Arbitration proceedings take place in a location to be determined according to the domicile of "
        "the named insured.\n"
        "4.7 Arbitrator's decision\n"
        "The arbitrator renders a decision based on the applicable laws of Quebec.\n"
        "The arbitrator's decision must be written and reasoned. It must also be signed and indicate the "
        "date and place where it was made.\n"
        "The decision must be sent to the insurer and the named insured within 30 days after the date "
        "on which it was made.\n"
        "4.8 Costs and fees of arbitration\n"
        "The insurer and the named insured each pay the costs and fees of their own expert and half "
        "the costs and fees of the arbitration proceedings.\n"
        "However, if the arbitrator considers that the method for sharing the costs and fees of the "
        "arbitration proceedings is not justified or fair in the circumstances, the arbitrator may decide "
        "otherwise.\n"
        "5. PRESERVATION OF RIGHTS OF NAMED INSURED AND INSURER\n"
        "The actions of the named insured or the insurer are not considered as the waiving of their rights "
        "under the insurance contract if they relate to:\n"
        "\t investigation of a loss;\n"
        "\t settlement of a loss;\n"
        "\t arbitration; and\n"
        "\t proof of loss.\n"
        "6. TIME TO START LEGAL ACTION UNDER INSURANCE CONTRACT (PRESCRIPTION PERIOD)\n"
        "Any legal action arising from the insurance contract, including a lawsuit must be started within "
        "three years after the date on which the right of action has arisen.\n"
    )

    return text


def generate_dates_text() -> str:
    """
    Function to generate FPQ1 dates.

    Return:
        The FPQ1 dates.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        "EFFECTIVE DATE, RENEWAL AND EXPIRY OF INSURANCE CONTRACT\n"
        "1. EFFECTIVE DATE AND EXPIRY OF INSURANCE CONTRACT\n"
        "The insurance contract takes effect and expires at the time and dates indicated in Item 2, "
        "''Declarations'' or, where applicable, in the endorsements.\n"
        "2. RENEWAL OF INSURANCE CONTRACT\n"
        "Upon its date of expiry, the insurance contract will be renewed automatically, unless notice to "
        "the contrary is given by the named insured or the insurer.\n"
        "The insurance contract will be renewed for the same insurance premium and the same period, "
        "unless notice to the contrary is given by the named insured or the insurer.\n"
        "The notice sent by the insurer may be a notice of non-renewal or a notice to change the insurance "
        "premium. The notice must be sent to the named insured no later than 30 days before the date of "
        "expiry of the insurance contract, at the last known address of the named insured.\n"
        "If the named insured uses an insurance broker, the insurer's notice must be sent to the insurance "
        "broker who must then deliver it to the named insured.\n"
        "3. CANCELLATION OF INSURANCE CONTRACT ( ENDING OF INSURANCE CONTRACT)\n"
        "3.1 Cancellation by named insured\n"
        "3.1.1. Conditions to be met\n"
        "The named insured may cancel the insurance contract at any time by written notice to "
        "the insurer.\n"
        "The named insureds may mandate one or more of them to send a notice on behalf of them all.\n"
        "Cancellation takes effect upon receipt by the insurer of the notice of each of the "
        "named insureds or their representative.\n"
        "3.1.2 Refund of insurance premium\n"
        "If the insurance contract is cancelled by the named insured, the insurer must refund "
        "any overpayment of insurance premiums, as calculated according to the "
        "''Cancellation table.'' The ''Cancellation table'' is part of the insurance contract.\n"
        "However, if the insurance premium was paid to the insurer by the insurance broker, "
        "the named insured may be refunded solely for what has actually been paid or "
        "refunded to the insurance broker.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "3.2 Cancellation by insurer\n"
        "3.2.1 Conditions to be met\n"
        "A. Cancellation within 60 days\n"
        "The insurer may cancel the insurance contract within 60 days after its effective date.\n"
        "The insurer must send a written notice to each of the named insureds or their representative.\n"
        "Cancellation takes effect 15 days after receipt of the notice by each of the named "
        "insureds or by their representative, at their last known address.\n"
        "B. Cancellation after 60 days\n"
        "More than 60 days after the effective date of the insurance contract, the insurer may "
        "cancel the insurance contract only if\n"
        "\t there has been an aggravation of risk which is likely to substantially influence "
        "a reasonable insurer in the decision to maintain the insurance contract; or\n"
        "\t the insurance premium has not been paid.\n"
        "The insurer must send a written notice to each of the named insureds or their representative.\n"
        "Cancellation is effective either:\n"
        "\t 30 days after receipt of the notice by each of the named insureds or by their "
        "representative, at their last known address; or\n"
        "\t 15 days after receipt of the notice by each of the named insureds or by their "
        "representative, at their last known address, if the described vehicle is a "
        "vehicle under Title VIII.1, Highway Safety Code, and is not a school bus.\n"
        "3.2.2 Refund of insurance premium\n"
        "If the insurer cancels the insurance contract, the insurer will be entitled only to the "
        "portion of the insurance premium corresponding to the number of days for which the "
        "named insured was actually covered under the insurance contract.\n"
        "If the named insured paid the insurance premium in advance, the insurer must "
        "refund the overpayment. However, if the insurance premium was paid to the insurer "
        "by the insurance broker, the named insured may be refunded solely for what has "
        "actually been paid or refunded to the insurance broker.\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text


def generate_cancellation_table_text() -> str:
    """
    Function to generate FPQ1 cancellation table.

    Return:
        The FPQ1 cancellation table.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = f"{fpq1_pages_header_text}CANCELLATION TABLE\n{NEW_PAGE_TAG}\n"

    return text


def generate_definitions_text() -> str:
    """
    Function to generate FPQ1 definitions.

    Return:
        The FPQ1 definitions.
    """
    fpq1_pages_header_text = generate_fpq1_pages_header_text()
    text = (
        f"{fpq1_pages_header_text}"
        "DEFINITIONS\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "Unless the context indicates otherwise, the definitions below applies apply to the words and expressions "
        "shown in bold in the insurance contract. Because of the context, a defined word or expression may not be "
        "shown in bold in the insurance contract, in which case it is being used in its ordinary meaning and the "
        "definition does not apply.\n"
        "Some of the definitions are a simplified version of those set out in the following laws:\n"
        "\t Civil Code of Quebec;\n"
        "\t Code of Civil Procedure of Quebec;\n"
        "\t Automobile Insurance Act; and\n"
        "\t An Act Respecting Off-highway Vehicles.\n"
        "In case of any ambiguity or discrepancy, the terms of the laws will prevail.\n"
        "AMOUNT OF INSURANCE: The maximum amount payable by the insurer, under Item 4, ''Declarations'' or in "
        "an endorsement.\n"
        "BODILY INJURY: Any physical or mental injury, including death.\n"
        "CLIENT: The person who submits an application to the insurer in order to enter into an insurance "
        "contract. The insurance application may be made for the client personally or for another person."
        "The client is not necessarily the named insured.\n"
        "DAMAGE:\n"
        "\t In Section A, ''damage'' refers to both property damage and bodily injury.\n"
        "\t In Section B, ''damage'' refers solely to property damage.\n"
        "DEDUCTIBLE: The amount left to be paid by the named insured.\n"
        "DESCRIBED VEHICLE: A motor vehicle, trailer or semi-trailer specifically designated in Item 3, "
        "''Declarations'', or included within the description of described vehicles therein.\n"
        "ENDORSEMENT: A document modifying the insurance contract and officially called ''Quebec "
        "Endorsement Form'' or ''Q.E.F.''\n"
        "GARAGE BUSINESS: Includes any business activity involving the custody, selling, equipping, "
        "repairing, maintaining, storing, parking, moving or servicing of motor vehicles.\n"
        "INSURANCE PREMIUM: The amount payable to the insurer in consideration of the coverages "
        "provided under the insurance contract.\n"
        "INSURER: The insurer issuing this insurance contract.\n"
        "LOSS: A risk that occurs and causes damage.\n"
        "MOTOR VEHICLE: A vehicle propelled by any power other than muscular force and adapted "
        "for transportation on public highways but not on rails.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "MOTOR VEHICLE USED FOR PERSONAL PURPOSES: Includes any utility motor vehicle while used for "
        "personal purposes and whose gross vehicle weight does not exceed 4,500 kg (10,000 lbs.).\n"
        "NAMED INSURED: A person designated in Item 1, ''Declarations.''\n"
        "NUCLEAR HAZARD: The risk arising from the hazardous nature of substances:\n"
        "\t that have radioactive, toxic or explosive properties; and\n"
        "\t that are prescribed under the Nuclear Safety and Control Act or its regulations.\n"
        "ANOTHER PERSON: Anyone who is not an ''insured person'' under the insurance contract.\n"
        "OWNER: A person who acquires or possesses a motor vehicle under one of the following:\n"
        "\t a document confirming the person's status as owner of the vehicle (called a ''title of "
        "ownership'');\n"
        "\t a document entitling the person to become the owner of the vehicle subject to certain "
        "conditions or at a certain time;\n"
        "\t a document entitling the person to use the vehicle as if the owner, for a certain amount of "
        "time only;\n"
        "\t a lease agreement for a period of not less than one year.\n"
        "PROPERTY DAMAGE: Any damage caused to a motor vehicle or another type of property, including "
        "their disappearance.\n"
        "SPOUSE: A person who, at the time of the loss:\n"
        "(a) is married to and living with another person;\n"
        "(b) is not married, but has been living in a de facto union with another person of the same "
        "or opposite sex and is publicly represented as spouse. These conditions must exist for at "
        "least three years or, in the following cases, for at least one year:\n"
        "\t a child has been born or is to be born of their union;\n"
        "\t they have adopted a child together; or\n"
        "\t one of them has adopted a child of the other.\n"
        "TEMPORARY REPLACEMENT VEHICLE: A motor vehicle used temporarily to replace a described "
        "vehicle, if the following conditions are met:\n"
        "\t the described vehicle cannot be used for one of the following reasons: breakdown, "
        "repair, maintenance, loss, destruction, sale or servicing; and\n"
        "\t neither the named insured nor anyone whose domicile is the same as that of the named "
        "insured is owner of the temporary replacement vehicle.\n"
        "TRAILER OR SEMI-TRAILER OF WHICH THE NAMED INSURED IS THE OWNER: A trailer or semi-trailer "
        "of which the named insured is the owner and that is not described in Item 3, ''Declarations'', if:\n"
        "\t (a) the trailer or semi-trailer is not designed or used to carry passengers or for "
        "demonstration, sales, office or dwelling purposes; and\n"
        "\t (b) the trailer or semi-trailer is attached to a motor vehicle used for personal purposes "
        "that is insured, or is not attached to such a vehicle provided that it is usually attached to "
        "such a vehicle.\n"
        "VEHICLE OF WHICH THE NAMED INSURED HAS RECENTLY BECOME THE OWNER: A motor vehicle, trailer "
        "or semi-trailer of which the named insured has recently become the owner, if the "
        "following conditions are met:\n"
        "(a) Within 14 days of taking possession of the vehicle, the named insured informs the "
        "insurer that he or she is the owner thereof.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "(b) The vehicle replaces or is in addition to one or more described vehicles. If the "
        "vehicle is in addition to one or more described vehicles:\n"
        "\t the named insured must have no other specific insurance in respect of such vehicle at "
        "the date of loss; and\n"
        "\t the insurer must insure all the other vehicles of which the named insured is the owner "
        "on the date of taking possession of the vehicle.\n"
        "(c) The named insured agrees to pay the additional insurance premium charged by the insurer.\n"
        "If the named insured is engaged in the business of selling motor vehicles, the motor "
        "vehicles acquired for such business activities will not be held to be ''vehicles of which the named "
        "insured has recently become the owner.''\n"
        "VEHICLE OF WHICH THE NAMED INSURED IS NOT THE OWNER: A motor vehicle of which the named insured "
        "is not the owner provided the conditions outlined below are met. The conditions differ, depending "
        "on whether the named insured is an individual or a legal person, partnership or association.\n"
        "(a) If the named insured is an individual: At the time of loss, the driver must be the named "
        "insured or his or her spouse.\n"
        "However, in the four exceptions listed below, the vehicle will be held to be an insured "
        "vehicle only if driven by the owner of a described vehicle. In addition, only the owner will "
        "be covered, and only for a reduced amount of insurance (see Articles 6.7 and 6.8, Section A):\n"
        "1. At the time of loss, the vehicle is being driven in connection with a garage business.\n"
        "2. The owner of the vehicle is a person whose domicile is the same as that of the "
        "named insured.\n"
        "3. The vehicle is provided by the employer of the named insured or by the employer "
        "of anyone whose domicile is the same as that of the named insured.\n"
        "4. The vehicle is appropriated for a use, outside Quebec:\n"
        "\t as a taxicab, bus or coach; or\n"
        "\t for commercial delivery.\n"
        "(b) If the named insured is a legal person, partnership or association:\n"
        "1. At the time of loss, the vehicle must be driven by one of the following drivers or "
        "by their spouse:\n"
        "\t an employee of the named insured;\n"
        "\t a shareholder of the named insured;\n"
        "\t a member of the named insured;\n"
        "\t a partner of the named insured.\n"
        "2. These drivers must regularly use the described vehicle.\n"
        "3. These drivers or their spouse must not be owners of a motor vehicle.\n"
        "4. At the time of loss, the vehicle is not being driven in connection with a garage business.\n"
        "5. The vehicle must not be appropriated to a use outside Quebec:\n"
        "\t as a taxicab, bus or coach; or\n"
        "\t for commercial delivery.\n"
        f"{NEW_PAGE_TAG}\n"
        f"{fpq1_pages_header_text}"
        "6. Neither the named insured, nor the employee of the named insured, nor the following "
        "persons must be owners of the vehicle or in possession of the vehicle under a written "
        "agreement similar to a hypothec, conditional sale or lease agreement:\n"
        "\t a shareholder, member or partner of the named insured;\n"
        "\t anyone whose domicile is the same as that of the named insured or of the named "
        "insured's employee, shareholder, member or partner.\n"
        "Condition 6 will not apply in the case of a lease for use that is not regular or frequent.\n"
        f"{NEW_PAGE_TAG}\n"
    )

    return text


@staticmethod
def generate_fpq1_text() -> str:
    """
    Static method to generate a complete FPQ1 contract text.

    This static method is dynamically imported in the FPQ1 contract.

    Return:
        The FPQ1 contract text.
    """
    text = generate_toc_text()
    text += generate_introduction_text()
    text += generate_declarations_text()
    text += generate_section_a_text()
    text += generate_section_b_text()
    text += generate_general_conditions_text()
    text += generate_loss_and_claims_reporting_text()
    text += generate_dates_text()
    text += generate_cancellation_table_text()
    text += generate_definitions_text()

    return text
