{"version":3,"names":["STATUS_URL","INCIDENTS_URL","extractUrlFromText","text","urlRegex","match","getRelativeTimeString","date","now","Date","diffInMs","diffInSecs","Math","floor","diffInMins","diffInHours","diffInDays","createStatusElement","status","title","description","url","createdAt","updatedAt","container","document","createElement","classList","add","style","display","inner","textContainer","text1","textContent","text2","innerHTML","replace","appendChild","timeInfo","timeText","created","updated","button","currentUrl","window","location","href","shouldShowButton","includes","onclick","startsWith","open","buildIncidentBanner","incident","severity","impact","name","incident_updates","body","extractedUrl","trim","created_at","updated_at","renderStatus","incidents","existing","getElementById","remove","length","id","outlet","parentNode","insertBefore","setTimeout","fetchStatus","__cursorStatusOverride","statusRes","incidentsRes","Promise","all","fetch","statusJson","json","incidentsJson","indicator","err","console","error","overrideCursorStatus","warn","setInterval"],"sources":["theme-239-inline-common-head_tag.js"],"sourcesContent":["\n  (function () {\n    const STATUS_URL = \"https://status.cursor.com/api/v2/status.json\";\n    const INCIDENTS_URL = \"https://status.cursor.com/api/v2/incidents/unresolved.json\";\n\n    function extractUrlFromText(text) {\n      const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n      const match = text.match(urlRegex);\n      return match ? match[0] : null;\n    }\n\n    function getRelativeTimeString(date) {\n      const now = new Date();\n      const diffInMs = now - date;\n\n      const diffInSecs = Math.floor(diffInMs / 1000);\n      const diffInMins = Math.floor(diffInSecs / 60);\n      const diffInHours = Math.floor(diffInMins / 60);\n      const diffInDays = Math.floor(diffInHours / 24);\n\n      if (diffInDays > 0) {\n        return diffInDays === 1 ? \"1 day ago\" : `${diffInDays} days ago`;\n      } else if (diffInHours > 0) {\n        return diffInHours === 1 ? \"1 hour ago\" : `${diffInHours} hours ago`;\n      } else if (diffInMins > 0) {\n        return diffInMins === 1 ? \"1 min ago\" : `${diffInMins} mins ago`;\n      } else {\n        return \"just now\";\n      }\n    }\n\n    function createStatusElement(status, title, description, url, createdAt, updatedAt) {\n      const container = document.createElement(\"div\");\n      container.classList.add(\"cursorstatus\", status);\n      container.style.display = \"flex\";\n\n      const inner = document.createElement(\"div\");\n      inner.classList.add(\"cursorstatus-inner\");\n\n      const textContainer = document.createElement(\"div\");\n      textContainer.classList.add(\"cursorstatustextcontainer\");\n\n      const text1 = document.createElement(\"p\");\n      text1.classList.add(\"cursorstatustext1\");\n      text1.textContent = `⚠️ ${title}`;\n\n      const text2 = document.createElement(\"p\");\n      text2.classList.add(\"cursorstatustext2\");\n      text2.innerHTML = description\n        .replace(/(https?:\\/\\/[^\\s]+)/g, '<a href=\"$1\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>')\n        .replace(/\\n/g, \"<br>\");\n\n      textContainer.appendChild(text1);\n      textContainer.appendChild(text2);\n\n      // Add timestamps if available\n      if (createdAt || updatedAt) {\n        const timeInfo = document.createElement(\"p\");\n        timeInfo.classList.add(\"cursorstatustimes\");\n\n        let timeText = \"\";\n        if (createdAt) {\n          const created = new Date(createdAt);\n          timeText += `Created: ${getRelativeTimeString(created)} `;\n        }\n        if (updatedAt) {\n          const updated = new Date(updatedAt);\n          timeText += createdAt ? `• Updated: ${getRelativeTimeString(updated)}` : `Updated: ${getRelativeTimeString(updated)}`;\n        }\n\n        timeInfo.textContent = timeText;\n        textContainer.appendChild(timeInfo);\n      }\n\n      const button = document.createElement(\"button\");\n      button.textContent = url ? \"Learn More →\" : \"View Incident →\";\n\n      // Check if current URL matches the extracted URL to avoid sending users to the page they're already on\n      const currentUrl = window.location.href;\n      const shouldShowButton = !url || !currentUrl.includes(url);\n\n      if (shouldShowButton) {\n        button.onclick = () => {\n          if (url && url.startsWith(\"https://forum.cursor.com\")) {\n            window.location.href = url;\n          } else if (url) {\n            window.open(url, \"_blank\");\n          } else {\n            window.open(\"https://status.cursor.com\", \"_blank\");\n          }\n        };\n      }\n\n      inner.appendChild(textContainer);\n\n      // Only append button if it should be shown\n      if (shouldShowButton) {\n        inner.appendChild(button);\n      }\n\n      container.appendChild(inner);\n\n      return container;\n    }\n\n    function buildIncidentBanner(status, incident) {\n      const severity = incident.impact || status;\n      const title = incident.name || \"Service Issue\";\n      let description = incident.incident_updates?.[0]?.body || \"We're investigating an issue affecting Cursor.\";\n\n      // Extract URL from description if present\n      const extractedUrl = extractUrlFromText(description);\n      if (extractedUrl) {\n        // Remove the URL from the description\n        description = description.replace(extractedUrl, \"\").trim();\n      }\n\n      // Get created and updated timestamps\n      const createdAt = incident.created_at;\n      const updatedAt = incident.updated_at || (incident.incident_updates?.[0]?.created_at);\n\n      return createStatusElement(severity, title, description, extractedUrl, createdAt, updatedAt);\n    }\n\n    function renderStatus(status, incidents) {\n      const existing = document.getElementById(\"cursorstatus-container\");\n      if (existing) existing.remove();\n\n      if (incidents && incidents.length > 0) {\n        const container = document.createElement(\"div\");\n        container.id = \"cursorstatus-container\";\n\n        for (const incident of incidents) {\n          container.appendChild(buildIncidentBanner(status, incident));\n        }\n\n        const outlet = document.getElementById(\"main-outlet-wrapper\");\n        if (outlet) {\n          outlet.parentNode.insertBefore(container, outlet);\n          return true;\n        } else {\n          setTimeout(() => {\n            if (!renderStatus(status, incidents)) {\n              setTimeout(() => {\n                if (!renderStatus(status, incidents)) {\n                  setTimeout(() => {\n                    if (!renderStatus(status, incidents)) {\n                      setTimeout(() => {\n                        renderStatus(status, incidents);\n                      }, 2000);\n                    }\n                  }, 1000);\n                }\n              }, 500);\n            }\n          }, 200);\n        }\n      }\n    }\n\n    async function fetchStatus() {\n      try {\n        if (typeof window.__cursorStatusOverride === \"string\") {\n          renderStatus(window.__cursorStatusOverride, [\n            {\n              name: \"Test Incident\",\n              incident_updates: [{ body: \"This is a test description.\" }],\n              impact: window.__cursorStatusOverride\n            },\n            {\n              name: \"Second Test Incident\",\n              incident_updates: [{ body: \"This is a second concurrent incident.\" }],\n              impact: window.__cursorStatusOverride\n            }\n          ]);\n          return;\n        }\n\n        const [statusRes, incidentsRes] = await Promise.all([\n          fetch(STATUS_URL),\n          fetch(INCIDENTS_URL)\n        ]);\n\n        const statusJson = await statusRes.json();\n        const incidentsJson = await incidentsRes.json();\n\n        const status = statusJson?.status?.indicator || \"unknown\";\n        const incidents = incidentsJson?.incidents || []; // Show all unresolved incidents\n\n        renderStatus(status, incidents);\n      } catch (err) {\n        console.error(\"Failed to fetch Cursor status:\", err);\n      }\n    }\n\n    // Global override for manual testing\n    window.overrideCursorStatus = function (status) {\n      if ([\"major\", \"minor\", \"none\"].includes(status)) {\n        window.__cursorStatusOverride = status;\n        fetchStatus();\n      } else {\n        console.warn(\"Invalid override status. Use 'major', 'minor', or 'none'.\");\n      }\n    };\n\n    // Run immediately and every 5 minutes\n    fetchStatus();\n    setInterval(fetchStatus, 5 * 60 * 1000);\n  })();\n"],"mappings":"AACE,CAAC,YAAY;EACX,MAAMA,UAAU,GAAG,8CAA8C;EACjE,MAAMC,aAAa,GAAG,4DAA4D;EAElF,SAASC,kBAAkBA,CAACC,IAAI,EAAE;IAChC,MAAMC,QAAQ,GAAG,sBAAsB;IACvC,MAAMC,KAAK,GAAGF,IAAI,CAACE,KAAK,CAACD,QAAQ,CAAC;IAClC,OAAOC,KAAK,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI;EAChC;EAEA,SAASC,qBAAqBA,CAACC,IAAI,EAAE;IACnC,MAAMC,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;IACtB,MAAMC,QAAQ,GAAGF,GAAG,GAAGD,IAAI;IAE3B,MAAMI,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACH,QAAQ,GAAG,IAAI,CAAC;IAC9C,MAAMI,UAAU,GAAGF,IAAI,CAACC,KAAK,CAACF,UAAU,GAAG,EAAE,CAAC;IAC9C,MAAMI,WAAW,GAAGH,IAAI,CAACC,KAAK,CAACC,UAAU,GAAG,EAAE,CAAC;IAC/C,MAAME,UAAU,GAAGJ,IAAI,CAACC,KAAK,CAACE,WAAW,GAAG,EAAE,CAAC;IAE/C,IAAIC,UAAU,GAAG,CAAC,EAAE;MAClB,OAAOA,UAAU,KAAK,CAAC,GAAG,WAAW,GAAG,GA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