    <script type="text/javascript">

        // ------ Add to react-app ------ //

        // Extract redirectTo from URL query parameter
        const urlParams = new URLSearchParams(window.location.search);
        const redirectTo = urlParams.get('redirectTo') || '';
        
        // Save to cookie if present
        if (redirectTo) {
            document.cookie = 'crm-redirect-to=' + encodeURIComponent(redirectTo) + '; Max-Age=' + (24 * 60 * 60) + '; path=/; SameSite=None; Secure';
        }
        
        // Get from cookie if not in URL (for persistence after redirects)
        function getCookie(name) {
            const value = `; ${document.cookie}`;
            const parts = value.split(`; ${name}=`);
            if (parts.length === 2) return decodeURIComponent(parts.pop().split(';').shift());
            return '';
        }
        
        const savedRedirectTo = redirectTo || getCookie('crm-redirect-to');

        window.__BRAND__ =  'dobby'
        window.__API_URL__ = 'https://dobby-q1-theme.monocrm.dev'
        window.__REDIRECT_TO__ = savedRedirectTo || ''

        // ------ Add to react-app ------ //

        function cp_crm_logout() {
            if (location.hash === "#/sign-in" || location.hash === "#/logout") {
                let form = new FormData();
                form.append('action', 'logout')
                fetch('/wp-admin/admin-ajax.php' , {

                    method: 'POST',
                    body: form
                })
                    .then(response => response.json())
                    .then(result => {
                        console.log(result.data.message)
                    })

                document.cookie = 'crm-lang=; Max-Age=-99999999; path=/; SameSite=None; Secure';
                document.cookie = 'crm-redirect-to=; Max-Age=-99999999; path=/; SameSite=None; Secure';
                window.location = 'https://landing1.monocrm.dev/sign-in';
            }
        }

        cp_crm_logout();
        window.addEventListener('hashchange', cp_crm_logout);
    </script>

            <script type="text/javascript">
            window.location.hash = '#/logout';
        </script>
        
    <!-- Add to react-app -->

    <link id="react-app-styles" href="https://dobby-q1-theme.monocrm.dev/assets/index.css" rel="stylesheet">

    <div id="react-app"></div>

    <script src="https://dobby-q1-theme.monocrm.dev/assets/index.js"></script>
                    
    <!-- Add to react-app -->

    <div id="cp-widget">
        <div id="support-btn">
            <div class="support-btn__outer"></div>
            <div class="support-btn__outer_2"></div>
            <a id="support-callback" class="support-services" href="#/callback-request">
                <img src="https://landing1.monocrm.dev/wp-content/plugins/cp-crm-integration/assets/images/support.svg" alt="">
            </a>
        </div>
    </div>
    {"id":4574,"date":"2023-04-03T23:44:30","date_gmt":"2023-04-03T22:44:30","guid":{"rendered":"https:\/\/landing1.monocrm.dev\/?page_id=4574"},"modified":"2023-11-21T16:26:41","modified_gmt":"2023-11-21T15:26:41","slug":"client-portal","status":"publish","type":"page","link":"https:\/\/landing1.monocrm.dev\/ru\/client-portal","title":{"rendered":"Client Portal"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4574","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/pages\/4574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/comments?post=4574"}],"version-history":[{"count":2,"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/pages\/4574\/revisions"}],"predecessor-version":[{"id":6809,"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/pages\/4574\/revisions\/6809"}],"wp:attachment":[{"href":"https:\/\/landing1.monocrm.dev\/ru\/wp-json\/wp\/v2\/media?parent=4574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}