<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Simplyin_Payment::css/simplyin.css"/>
        <css src="Simplyin_Payment::css/simplyin-modal.css"/>
    </head>
    <body>
        <referenceBlock name="head.additional">
            <block class="Magento\Framework\View\Element\Template" name="simplyin.modal" template="Simplyin_Payment::modal.phtml"/>
        </referenceBlock>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="customer-email" xsi:type="array">
                                                            <item name="component" xsi:type="string">Simplyin_Payment/js/view/form/element/email</item>
                                                            <item name="template" xsi:type="string">Simplyin_Payment/form/element/email</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                        <item name="billing-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="payment" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <!-- Global SimplyIN Account Section - appears for all payment methods -->
                                                        <item name="simplyin-account-section" xsi:type="array">
                                                            <item name="component" xsi:type="string">Simplyin_Payment/js/view/checkout/simplyin-account-section</item>
                                                            <item name="displayArea" xsi:type="string">afterMethods</item>
                                                            <item name="sortOrder" xsi:type="string">100</item>
                                                        </item>
                                                        <item name="renders" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="simplyin-payments" xsi:type="array">
                                                                    <item name="component" xsi:type="string">Simplyin_Payment/js/view/payment/simplyin-payments</item>
                                                                    <item name="methods" xsi:type="array">
                                                                        <item name="simplyin_payment" xsi:type="array">
                                                                            <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>
