/** * Public API bridge. * * Initializes the shared event emitter and internal helpers used by the * documented runtime API before the editor lifecycle modules run. * * Exposes: * SFE.PublicApi * SFE.PublicApiBridge */ (function() { 'use strict'; window.MWP = window.MWP || {}; window.MWP.SFE = window.MWP.SFE || {}; const SFE = window.MWP.SFE; const PublicApi = SFE.PublicApi || {}; const eventListeners = new Map(); const stagedBlockStates = new Map(); /** * Create a plain-data clone for event payloads and snapshots. * * @param {*} value Source value. * @returns {*} Cloned value when possible. */ function clonePlainData(value) { if (value === null || typeof value === 'undefined') { return value; } try { return JSON.parse(JSON.stringify(value)); } catch (error) { if (Array.isArray(value)) { return value.slice(); } if (typeof value === 'object') { return Object.assign({}, value); } return value; } } /** * Resolve the current editor snapshot builder when available. * * @param {Object|null} editorState Active editor state. * @returns {Object|null} Stable editor snapshot. */ function buildEditorSnapshot(editorState) { if (typeof PublicApi._buildEditorSnapshot === 'function') { return PublicApi._buildEditorSnapshot(editorState); } return null; } /** * Invoke one event handler safely. * * @param {Function} handler Registered listener. * @param {Object} payload Event payload. * @returns {void} */ function callHandler(handler, payload) { try { handler(payload); } catch (error) { console.error('FrontEdit: PublicApi event handler failed', error); } } /** * Emit one public runtime event. * * @param {string} eventName Event name. * @param {Object} payload Event payload. * @returns {void} */ function emitEvent(eventName, payload) { const listeners = eventListeners.get(eventName); if (!listeners || !listeners.size) { return; } const snapshot = clonePlainData(payload); listeners.forEach(handler => callHandler(handler, snapshot)); } /** * Register one runtime event listener. * * @param {string} eventName Event name. * @param {Function} handler Event handler. * @returns {Function} Unsubscribe callback. */ function on(eventName, handler) { const normalizedEventName = String(eventName || '').trim(); if (!normalizedEventName || typeof handler !== 'function') { return function noop() {}; } if (!eventListeners.has(normalizedEventName)) { eventListeners.set(normalizedEventName, new Set()); } eventListeners.get(normalizedEventName).add(handler); return function unsubscribe() { off(normalizedEventName, handler); }; } /** * Remove one runtime event listener. * * @param {string} eventName Event name. * @param {Function} handler Event handler. * @returns {void} */ function off(eventName, handler) { const normalizedEventName = String(eventName || '').trim(); if (!normalizedEventName || typeof handler !== 'function') { return; } const listeners = eventListeners.get(normalizedEventName); if (!listeners) { return; } listeners.delete(handler); if (!listeners.size) { eventListeners.delete(normalizedEventName); } } /** * Emit one editor lifecycle event using the current snapshot builder. * * @param {string} eventName Event name. * @param {Object|null} editorState Editor session state. * @param {Object} metadata Additional event metadata. * @returns {void} */ function emitEditorEvent(eventName, editorState, metadata = {}) { const editor = buildEditorSnapshot(editorState); if (!editor) { return; } emitEvent(eventName, Object.assign({}, metadata, { editor })); } /** * Emit one save lifecycle event using the current snapshot builder. * * @param {string} eventName Event name. * @param {Object|null} editorState Editor session state. * @param {Object} metadata Additional event metadata. * @returns {void} */ function emitSaveEvent(eventName, editorState, metadata = {}) { const editor = buildEditorSnapshot(editorState); if (!editor) { return; } emitEvent(eventName, Object.assign({}, metadata, { editor })); } PublicApi.on = on; PublicApi.off = off; SFE.PublicApi = PublicApi; SFE.PublicApiBridge = { clonePlainData, emitEvent, emitEditorEvent, emitSaveEvent, stagedBlockStates, }; })(); Monitor778 https://monitor778.com/ Mon, 27 Jul 2026 17:48:38 +0000 id hourly 1 https://monitor778.com/wp-content/uploads/2025/12/favicon_2025-150x150.png Monitor778 https://monitor778.com/ 32 32 MONITOR778 Server Thailand : Game Online Favorit Pemain https://monitor778.com/monitor778-server-thailand/ https://monitor778.com/monitor778-server-thailand/#respond Mon, 27 Jul 2026 17:29:45 +0000 https://monitor778.com/?p=224 The post MONITOR778 Server Thailand : Game Online Favorit Pemain appeared first on Monitor778.

]]>
The post MONITOR778 Server Thailand : Game Online Favorit Pemain appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-server-thailand/feed/ 0
MONITOR778 King : Perjalanan Seru Menuju Keberhasilan https://monitor778.com/monitor778-king/ https://monitor778.com/monitor778-king/#respond Sun, 26 Jul 2026 15:51:11 +0000 https://monitor778.com/?p=217 The post MONITOR778 King : Perjalanan Seru Menuju Keberhasilan appeared first on Monitor778.

]]>
The post MONITOR778 King : Perjalanan Seru Menuju Keberhasilan appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-king/feed/ 0
MONITOR778 Andalan : Kemenangan Spektakuler Dalam Game https://monitor778.com/monitor778-andalan/ https://monitor778.com/monitor778-andalan/#respond Sat, 25 Jul 2026 16:47:39 +0000 https://monitor778.com/?p=211 The post MONITOR778 Andalan : Kemenangan Spektakuler Dalam Game appeared first on Monitor778.

]]>
The post MONITOR778 Andalan : Kemenangan Spektakuler Dalam Game appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-andalan/feed/ 0
MONITOR778 Demo Hoki : Momen Emas Jadi Awal Kesuksesan https://monitor778.com/monitor778-demo-hoki/ https://monitor778.com/monitor778-demo-hoki/#respond Fri, 24 Jul 2026 15:27:44 +0000 https://monitor778.com/?p=204 The post MONITOR778 Demo Hoki : Momen Emas Jadi Awal Kesuksesan appeared first on Monitor778.

]]>
The post MONITOR778 Demo Hoki : Momen Emas Jadi Awal Kesuksesan appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-demo-hoki/feed/ 0
MONITOR778 Fantastis : Kemenangan Hebat Dari Permainan https://monitor778.com/monitor778-fantastis/ https://monitor778.com/monitor778-fantastis/#respond Thu, 23 Jul 2026 15:40:39 +0000 https://monitor778.com/?p=200 The post MONITOR778 Fantastis : Kemenangan Hebat Dari Permainan appeared first on Monitor778.

]]>
The post MONITOR778 Fantastis : Kemenangan Hebat Dari Permainan appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-fantastis/feed/ 0
MONITOR778 Bombastis : Strategi Baru Untuk Hasil Maksimal https://monitor778.com/monitor778-bombastis/ https://monitor778.com/monitor778-bombastis/#respond Wed, 22 Jul 2026 15:50:16 +0000 https://monitor778.com/?p=195 The post MONITOR778 Bombastis : Strategi Baru Untuk Hasil Maksimal appeared first on Monitor778.

]]>
The post MONITOR778 Bombastis : Strategi Baru Untuk Hasil Maksimal appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-bombastis/feed/ 0
MONITOR778 Fenomenal : Jalan Terbaik Menikmati Dunia Digital https://monitor778.com/monitor778-fenomenal/ https://monitor778.com/monitor778-fenomenal/#respond Tue, 21 Jul 2026 16:01:14 +0000 https://monitor778.com/?p=192 The post MONITOR778 Fenomenal : Jalan Terbaik Menikmati Dunia Digital appeared first on Monitor778.

]]>
The post MONITOR778 Fenomenal : Jalan Terbaik Menikmati Dunia Digital appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-fenomenal/feed/ 0
MONITOR778 Meroket : Bayangan Fajar Membelah Langit Cerah https://monitor778.com/monitor778-meroket/ https://monitor778.com/monitor778-meroket/#respond Mon, 20 Jul 2026 18:37:02 +0000 https://monitor778.com/?p=188 The post MONITOR778 Meroket : Bayangan Fajar Membelah Langit Cerah appeared first on Monitor778.

]]>
The post MONITOR778 Meroket : Bayangan Fajar Membelah Langit Cerah appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-meroket/feed/ 0
MONITOR778 Elit : Putaran Santai Tapi Hadiahnya Meledak Keras https://monitor778.com/monitor778-elit/ https://monitor778.com/monitor778-elit/#respond Tue, 30 Jun 2026 11:29:22 +0000 https://monitor778.com/?p=176 The post MONITOR778 Elit : Putaran Santai Tapi Hadiahnya Meledak Keras appeared first on Monitor778.

]]>
The post MONITOR778 Elit : Putaran Santai Tapi Hadiahnya Meledak Keras appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-elit/feed/ 0
MONITOR778 VIP Prioritas : Cara Baru Menikmati Game Online https://monitor778.com/monitor778-vip-prioritas/ https://monitor778.com/monitor778-vip-prioritas/#respond Mon, 29 Jun 2026 05:40:42 +0000 https://monitor778.com/?p=171 The post MONITOR778 VIP Prioritas : Cara Baru Menikmati Game Online appeared first on Monitor778.

]]>
The post MONITOR778 VIP Prioritas : Cara Baru Menikmati Game Online appeared first on Monitor778.

]]>
https://monitor778.com/monitor778-vip-prioritas/feed/ 0