(function (global, factory) { const LayerClass = factory(); // Allow usage as `Layer({...})` or `new Layer()` // But Layer is a class. We can wrap it in a proxy or factory function. function LayerFactory(options) { if (options && typeof options === 'object') { return LayerClass.$(options); } return new LayerClass(); } // Copy static methods (including non-enumerable class statics like `fire` / `$`) // Class static methods are non-enumerable by default, so Object.assign() would miss them. const copyStatic = (to, from) => { try { Object.getOwnPropertyNames(from).forEach((k) => { if (k === 'prototype' || k === 'name' || k === 'length') return; const desc = Object.getOwnPropertyDescriptor(from, k); if (!desc) return; Object.defineProperty(to, k, desc); }); } catch (e) { // Best-effort fallback try { Object.assign(to, from); } catch {} } }; copyStatic(LayerFactory, LayerClass); // Also copy prototype for instanceof checks if needed (though tricky with factory) LayerFactory.prototype = LayerClass.prototype; typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = LayerFactory : typeof define === 'function' && define.amd ? define(() => LayerFactory) : (global.Layer = LayerFactory); }(this, (function () { 'use strict'; const PREFIX = 'layer-'; const RING_TYPES = new Set(['success', 'error', 'warning', 'info', 'question']); const RING_BG_PARTS_SELECTOR = `.${PREFIX}success-circular-line-left, .${PREFIX}success-circular-line-right, .${PREFIX}success-fix`; const normalizeOptions = (options, text, icon) => { if (typeof options !== 'string') return options || {}; const o = { title: options }; if (text) o.text = text; if (icon) o.icon = icon; return o; }; const el = (tag, className, text) => { const node = document.createElement(tag); if (className) node.className = className; if (text !== undefined) node.textContent = text; return node; }; const svgEl = (tag) => document.createElementNS('http://www.w3.org/2000/svg', tag); // Ensure library CSS is loaded (xjs.css) // - CSS is centralized in xjs.css (no runtime