UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

75 lines (74 loc) • 2.05 kB
(function() { try { var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}; e.SENTRY_RELEASE = { id: "3.47.0" }; var t = new e.Error().stack; t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4669b195-276f-4f3d-843f-d0b438d39891", e._sentryDebugIdIdentifier = "sentry-dbid-4669b195-276f-4f3d-843f-d0b438d39891"); } catch {} })(); import { r as e } from "./rolldown-runtime-5rOLGCTp.js"; import { l as t } from "./i18n-DlquqKCP.js"; import { s as n } from "./efp-debug-init-D3gNE8Zq.js"; //#region src/tools/logger.ts var r = /* @__PURE__ */ e(n(), 1), i = class { constructor() { this.messages = []; } log(...e) { this.push("DEBUG", e), (0, r.default)("efp:floorplan:debug")(...e); } error(...e) { this.push("ERROR", e), a(console.error, e); } warn(...e) { this.push("WARN", e), a(console.warn, e); } info(...e) { this.push("INFO", e), (0, r.default)("efp:floorplan:info")(...e); } push(e, t) { let n = t.map((e) => { if (typeof e == "object") try { return JSON.stringify(e); } catch (e) { return e.message; } return e; }), r = e + " " + (/* @__PURE__ */ new Date()).toISOString() + " " + n.join("; "); this.messages.push(r); let i = 1e3; this.messages.length > i && this.messages.splice(0, i / 2); } }; function a(e, t) { try { e.apply(e, t); } catch {} } var o = new i(), s = "A plan is already loaded on this page; call destroy() first (one live plan per page — see the Switching plans guide).", c = !1, l = 0, u = []; function d() { return l; } function f() { if (c) throw Error(s); c = !0; } function p(e) { u.push(e); } function m() { if (!c) return; c = !1, l++; let e, t = !1; for (; u.length > 0;) try { u.pop()(); } catch (n) { t || (e = n, t = !0); } if (t) throw e; } //#endregion //#region src/utils/is-debug.ts var h = t && localStorage.getItem("efp-debugMode") === "true"; //#endregion export { p as a, d as i, f as n, o, m as r, h as t };