PageSourceSearch

https://mco-25.vercel.app/assets/js/PurchaseNotifier.BynDR2n6.js

js mco-25.vercel.app collected 2026-10-03 07:18:23 UTC 5,747 bytes, 88 lines download raw bytes

1import{a as r,j as e,z as a}from"./index.D5_msMfK.js";import{C as c}from"./copy.C9ezbI7g.js";function f(){const{activeOrg:i}=r(),n=(i==null?void 0:i.exams.filter(t=>!t.isPractice&&t.price>0&&t.name).map(t=>t.name).slice(0,6))||["CPC Certification Exam","CCA Certification Exam","Medical Billing Certification","CPB Certification Exam","CRC Certification Exam","Risk Adjustment Certification"],o=`
2<!-- START: MCO Live Purchase Notifier -->
3<div id="mco-purchase-notifier" style="display: none; position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 9999; background-color: white; padding: 1rem; border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); border: 1px solid #e5e7eb; width: 100%; max-width: 320px; font-family: sans-serif;">
4    <div style="display: flex; align-items: flex-start;">
5        <div style="background-color: #dcfce7; padding: 0.5rem; border-radius: 9999px; margin-right: 1rem;">
6            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#16a34a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 0 0 0 2-1.61L23 6H6"/></svg>
7        </div>
8        <div style="flex: 1;">
9            <p id="mco-notifier-text" style="font-weight: bold; color: #1f2937; margin: 0;"></p>
10            <p id="mco-notifier-subtext" style="font-size: 0.875rem; color: #4b5563; margin: 0;"></p>
11            <p id="mco-notifier-time" style="font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem;"></p>
12        </div>
13    </div>
14</div>
15
16<style>
17    @keyframes mco-slide-in-up {
18        from { transform: translateY(100%); opacity: 0; }
19        to { transform: translateY(0); opacity: 1; }
20    }
21    @keyframes mco-fade-out {
22        from { opacity: 1; }
23        to { opacity: 0; }
24    }
25    #mco-purchase-notifier.visible {
26        display: block !important;
27        animation: mco-slide-in-up 0.5s ease-out forwards;
28    }
29    #mco-purchase-notifier.hiding {
30        animation: mco-fade-out 0.5s ease-in forwards;
31    }
32</style>
33
34<script>
35document.addEventListener('DOMContentLoaded', function() {
36    const notifierElement = document.getElementById('mco-purchase-notifier');
37    if (!notifierElement) return;
38
39    const notificationData = {
40        names: ['John', 'Maria', 'David', 'Sarah', 'Michael', 'Jessica', 'Chris', 'Emily', 'Daniel', 'Laura'],
41        locations: ['New York, NY', 'London, UK', 'Sydney, AU', 'Toronto, CA', 'Mumbai, IN', 'Los Angeles, CA', 'Chicago, IL', 'Dubai, AE'],
42        exams: ${JSON.stringify(n)}
43    };
44
45    function getRandomItem(arr) {
46        return arr[Math.floor(Math.random() * arr.length)];
47    }
48
49    function showNotification() {
50        const name = getRandomItem(notificationData.names);
51        const location = getRandomItem(notificationData.locations);
52        const exam = getRandomItem(notificationData.exams);
53        const time = (Math.floor(Math.random() * 10) + 1) + " minutes ago";
54
55        document.getElementById('mco-notifier-text').innerText = name + ' from ' + location;
56        document.getElementById('mco-notifier-subtext').innerText = 'Just purchased the "' + exam + '"';
57        document.getElementById('mco-notifier-time').innerText = time;
58
59        notifierElement.classList.remove('hiding');
60        notifierElement.classList.add('visible');
61
62        setTimeout(() => {
63            notifierElement.classList.remove('visible');
64            notifierElement.classList.add('hiding');
65        }, 5000); // Visible for 5 seconds
66
67        setTimeout(() => {
68            if (!notifierElement.classList.contains('visible')) {
69               notifierElement.style.display = 'none';
70            }
71        }, 5500); // Hide after animation
72    }
73
74    function startNotifier() {
75        // Delay before showing the next notification
76        const randomDelay = Math.random() * 15000 + 8000; // 8 to 23 seconds
77        setTimeout(() => {
78            showNotification();
79            startNotifier();
80        }, randomDelay);
81    }
82    
83    // Start the loop after an initial delay
84    setTimeout(startNotifier, 7000);
85});
86<\/script>
87<!-- END: MCO Live Purchase Notifier -->
88    `,s=()=>{navigator.clipboard.writeText(o.trim()).then(()=>
88a.success("Notifier code copied to clipboard!")).catch(t=>{console.error("Failed to copy text: ",t),a.error("Could not copy code.")})};return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsx("h1",{className:"text-3xl font-extrabold text-slate-800",children:"Live Purchase Notifier Script"}),e.jsxs("div",{className:"bg-white p-6 rounded-lg shadow",children:[e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Enhance Social Proof on Your Website"}),e.jsx("p",{className:"mb-4",children:"This standalone script creates a small notification pop-up that displays fake, randomized purchase data. It helps create a sense of activity and social proof on your main website, encouraging new visitors to make a purchase."}),e.jsx("p",{className:"mb-4",children:`To use this on your WordPress site, simply copy the code below and paste it into a "Custom HTML" block in your site's footer, or use a plugin that allows you to add scripts to your pages. It has no external dependencies and will start working immediately.`}),e.jsxs("div",{className:"bg-slate-800 text-white p-4 rounded-lg relative font-mono text-sm",children:[e.jsx("button",{onClick:s,className:"absolute top-2 right-2 p-2 bg-slate-600 rounded-md hover:bg-slate-500 transition",title:"Copy to clipboard",children:e.jsx(c,{size:16})}),e.jsx("pre",{children:e.jsx("code",{className:"language-html",children:o.trim()})})]})]})]})}export{f as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.