-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoidlib-dev.js
More file actions
311 lines (244 loc) · 73.2 KB
/
oidlib-dev.js
File metadata and controls
311 lines (244 loc) · 73.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ var __webpack_modules__ = ({
/***/ "./src/assembly/full.js":
/*!******************************!*\
!*** ./src/assembly/full.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Bus\": () => (/* reexport safe */ _infra_bus_js__WEBPACK_IMPORTED_MODULE_1__.Bus),\n/* harmony export */ \"ButtonOid\": () => (/* reexport safe */ _components_ui_button_oid_js__WEBPACK_IMPORTED_MODULE_14__.ButtonOid),\n/* harmony export */ \"ConsoleOid\": () => (/* reexport safe */ _components_ui_console_oid_js__WEBPACK_IMPORTED_MODULE_15__.ConsoleOid),\n/* harmony export */ \"FileOid\": () => (/* reexport safe */ _components_data_file_oid_js__WEBPACK_IMPORTED_MODULE_12__.FileOid),\n/* harmony export */ \"ImageOid\": () => (/* reexport safe */ _components_ui_image_oid_js__WEBPACK_IMPORTED_MODULE_13__.ImageOid),\n/* harmony export */ \"Oid\": () => (/* reexport safe */ _base_oid_js__WEBPACK_IMPORTED_MODULE_5__.Oid),\n/* harmony export */ \"OidBase\": () => (/* reexport safe */ _base_oid_base_js__WEBPACK_IMPORTED_MODULE_6__.OidBase),\n/* harmony export */ \"OidPlay\": () => (/* reexport safe */ _base_oid_play_js__WEBPACK_IMPORTED_MODULE_11__.OidPlay),\n/* harmony export */ \"OidSphere\": () => (/* reexport safe */ _base_oid_sphere_js__WEBPACK_IMPORTED_MODULE_4__.OidSphere),\n/* harmony export */ \"OidUI\": () => (/* reexport safe */ _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_8__.OidUI),\n/* harmony export */ \"OidWeb\": () => (/* reexport safe */ _base_oid_web_js__WEBPACK_IMPORTED_MODULE_7__.OidWeb),\n/* harmony export */ \"Primitive\": () => (/* reexport safe */ _base_primitive_js__WEBPACK_IMPORTED_MODULE_3__.Primitive),\n/* harmony export */ \"SliderOid\": () => (/* reexport safe */ _components_ui_slider_input_oid_js__WEBPACK_IMPORTED_MODULE_17__.SliderOid),\n/* harmony export */ \"Sphere\": () => (/* reexport safe */ _infra_sphere_js__WEBPACK_IMPORTED_MODULE_2__.Sphere),\n/* harmony export */ \"SplitPaneOid\": () => (/* reexport safe */ _components_ui_container_split_pane_oid_js__WEBPACK_IMPORTED_MODULE_18__.SplitPaneOid),\n/* harmony export */ \"SwitchOid\": () => (/* reexport safe */ _components_ui_switch_input_oid_js__WEBPACK_IMPORTED_MODULE_16__.SwitchOid),\n/* harmony export */ \"css\": () => (/* reexport safe */ _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.css),\n/* harmony export */ \"html\": () => (/* reexport safe */ _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _infra_bus_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../infra/bus.js */ \"./src/infra/bus.js\");\n/* harmony import */ var _infra_sphere_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../infra/sphere.js */ \"./src/infra/sphere.js\");\n/* harmony import */ var _base_primitive_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/primitive.js */ \"./src/base/primitive.js\");\n/* harmony import */ var _base_oid_sphere_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/oid-sphere.js */ \"./src/base/oid-sphere.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_base_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/oid-base.js */ \"./src/base/oid-base.js\");\n/* harmony import */ var _base_oid_web_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../base/oid-web.js */ \"./src/base/oid-web.js\");\n/* harmony import */ var _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../base/oid-ui.js */ \"./src/base/oid-ui.js\");\n/* harmony import */ var _base_interfaces_base_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../base/interfaces-base.js */ \"./src/base/interfaces-base.js\");\n/* harmony import */ var _components_interfaces_components_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../components/interfaces-components.js */ \"./src/components/interfaces-components.js\");\n/* harmony import */ var _base_oid_play_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../base/oid-play.js */ \"./src/base/oid-play.js\");\n/* harmony import */ var _components_data_file_oid_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../components/data/file-oid.js */ \"./src/components/data/file-oid.js\");\n/* harmony import */ var _components_ui_image_oid_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../components/ui/image-oid.js */ \"./src/components/ui/image-oid.js\");\n/* harmony import */ var _components_ui_button_oid_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../components/ui/button-oid.js */ \"./src/components/ui/button-oid.js\");\n/* harmony import */ var _components_ui_console_oid_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../components/ui/console-oid.js */ \"./src/components/ui/console-oid.js\");\n/* harmony import */ var _components_ui_switch_input_oid_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../components/ui/switch-input-oid.js */ \"./src/components/ui/switch-input-oid.js\");\n/* harmony import */ var _components_ui_slider_input_oid_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../components/ui/slider-input-oid.js */ \"./src/components/ui/slider-input-oid.js\");\n/* harmony import */ var _components_ui_container_split_pane_oid_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../components/ui/container/split-pane-oid.js */ \"./src/components/ui/container/split-pane-oid.js\");\n\n\n\n\n\n\n// import '../infra/setup.js'\n\n\n\n\n\n\n\n\n\n\n// import '../components/ui/button-oid-style.js'\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@mundorum/oid/./src/assembly/full.js?");
/***/ }),
/***/ "./src/base/interfaces-base.js":
/*!*************************************!*\
!*** ./src/base/interfaces-base.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _oid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./oid */ \"./src/base/oid.js\");\n\n\n_oid__WEBPACK_IMPORTED_MODULE_0__.Oid.cInterface ({\n id: 'itf:oid',\n operations: {\n 'get': {response: true},\n 'set': {response: false}\n },\n cardinality: 'n:n'\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/interfaces-base.js?");
/***/ }),
/***/ "./src/base/oid-base.js":
/*!******************************!*\
!*** ./src/base/oid-base.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidBase\": () => (/* binding */ OidBase)\n/* harmony export */ });\n/* harmony import */ var _infra_bus_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../infra/bus.js */ \"./src/infra/bus.js\");\n/* harmony import */ var _oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _primitive_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./primitive.js */ \"./src/base/primitive.js\");\n\n\n\n\nclass OidBase extends _primitive_js__WEBPACK_IMPORTED_MODULE_2__.Primitive {\n constructor () {\n super()\n\n this._mapTopicNotice = {}\n this._rgxTopicNotice = []\n this._mapNoticeTopic = {}\n this._receiveHandler = {}\n this._provideHandler = {}\n this._connected = {}\n\n this._convertNotice = this._convertNotice.bind(this)\n this.handleNotice = this.handleNotice.bind(this)\n }\n\n async connectedCallback () {\n super.connectedCallback()\n await this._initialize()\n }\n\n disconnectedCallback () {\n this._finalize()\n }\n\n async _initialize () {\n const spec = this.constructor.spec\n if (spec) {\n this._buildHandlers(this._receiveHandler, spec.receive)\n this._buildProviders()\n this._buildProvidersHandlers()\n this._buildEventDispatchers(spec.dispatcher)\n }\n\n if (spec && spec.properties) {\n for (const [prop, def] of Object.entries(spec.properties))\n if (def.default != null && !this.hasAttribute(prop))\n this[prop] = def.default\n }\n\n if (this.hasAttribute('custom'))\n this._custom = await _oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.getCustom(spec.id, this.getAttribute('custom'))\n if (this.hasAttribute('publish'))\n this._publishNoticeTopic(this.getAttribute('publish'))\n if (this.hasAttribute('subscribe'))\n this._subscribeTopicNotice(this.getAttribute('subscribe'))\n if (this.hasAttribute('connect'))\n this._connectInterface(this.getAttribute('connect'))\n }\n\n _buildProviders () {\n const spec = this.constructor.spec\n if (spec.provide != null && this.id)\n for (const p in spec.provide)\n this._provide(p, this.id, this)\n }\n\n _buildProvidersHandlers () {\n const spec = this.constructor.spec\n if (spec.provide != null)\n for (const p in spec.provide) {\n this._buildHandlers(\n this._provideHandler, spec.provide[p].operations, p)\n }\n }\n\n _removeProviders () {\n const spec = this.constructor.spec\n if (spec.provide != null && this.id)\n for (const p in spec.provide)\n this._withhold(p, this.id)\n }\n\n _buildHandlers (handlerSet, handlersSpec, cInterface) {\n if (handlersSpec != null) {\n const prefix = (cInterface == null) ? '' : cInterface + '.'\n if (Array.isArray(handlersSpec)) {\n for (const notice of handlersSpec)\n if (handlerSet[prefix + notice] == null)\n handlerSet[prefix + notice] =\n this['handle' + notice[0].toUpperCase() +\n notice.slice(1)].bind(this)\n } else {\n for (const [notice, noticeSpec] of Object.entries(handlersSpec)) {\n if (handlerSet[prefix + notice] == null) {\n const meth = (typeof noticeSpec === 'string')\n ? noticeSpec\n : ((noticeSpec.handler != null)\n ? noticeSpec.handler\n : 'handle' + notice[0].toUpperCase() + notice.slice(1))\n handlerSet[prefix + notice] = this[meth].bind(this)\n }\n }\n }\n }\n }\n\n _buildEventDispatchers (dispatcherTempl) {\n if (dispatcherTempl) {\n this._dispatcher = []\n for (const [atr, event, dispatch] of dispatcherTempl)\n this._dispatcher.push([atr, event, dispatch.bind(this)])\n }\n }\n\n _finalize () {\n this._removeProviders()\n for (const topic in this._mapTopicNotice)\n if (this._mapTopicNotice[topic] != topic)\n this._unsubscribe(topic, this._convertNotice)\n else\n this._unsubscribe(topic, this.handleNotice)\n }\n\n // call setter every time an observed attribute changes\n attributeChangedCallback (name, oldValue, newValue) {\n const jsName = name.replace(\n /-([a-z])/g, (match, letter) => letter.toUpperCase())\n this[jsName] = newValue\n }\n\n static get observedAttributes () {\n return ['id']\n }\n\n get id () {\n return this._id\n }\n\n set id (newValue) {\n if (this._id != null && this._bus != null)\n this._removeProviders()\n this._id = newValue\n if (this._bus != null)\n this._buildProviders()\n }\n\n get publish () {\n return this.getAttribute('publish')\n // return this._publishProp\n }\n\n /*\n set publish (newValue) {\n this._publishProp = newValue\n if (this._bus != null)\n this._publishNoticeTopic(newValue)\n }\n */\n\n get subscribe () {\n return this.getAttribute('subscribe')\n // return this._subscribeProp\n }\n\n /*\n set subscribe (newValue) {\n this._subscribeProp = newValue\n if (this._bus != null)\n this._subscribeTopicNotice(newValue)\n }\n */\n\n get connect () {\n return this.getAttribute('connect')\n // return this._connectProp\n }\n\n /*\n set connect (newValue) {\n this._connectProp = newValue\n if (this._bus != null)\n this._connectInterface(newValue)\n }\n */\n\n handleGet (notice, message) {\n if (message.property != null)\n return this[message.property]\n else\n return null\n }\n\n handleSet (notice, message) {\n if (message.property != null && message.value != null)\n this[message.property] = message.value\n }\n\n _subscribeTopicNotice (topicNotice) {\n const tpnts = topicNotice.split(';')\n for (const tn of tpnts) {\n const parts = tn.split('~')\n if (parts.length > 1) {\n const topic = parts[0].trim()\n if (topic.includes('+') || topic.includes('#'))\n this._rgxTopicNotice.push(\n [_infra_bus_js__WEBPACK_IMPORTED_MODULE_0__.Bus._convertRegExp(topic), parts[1].trim(), topic])\n else\n this._mapTopicNotice[topic] = parts[1].trim()\n this._subscribe(topic, this._convertNotice)\n } else {\n const topic = tn.trim()\n this._mapTopicNotice[topic] = topic // store to unsubscribe\n this._subscribe(topic, this.handleNotice)\n }\n }\n }\n\n _publishNoticeTopic (noticeTopic) {\n const nttps = noticeTopic.split(';')\n for (const nt of nttps) {\n const parts = nt.split('~')\n if (parts.length > 1)\n this._mapNoticeTopic[parts[0].trim()] = parts[1].trim()\n else\n this._mapNoticeTopic[nt.trim()] = nt.trim()\n }\n }\n\n _connectInterface (idInterface) {\n let status = true\n const idint = idInterface.split(';')\n for (const ii of idint) {\n const parts = ii.split('#')\n if (parts.length > 1)\n this._connect(parts[0].trim(), parts[1].trim(), this)\n else\n status = false\n }\n return status\n }\n\n _notify (notice, message) {\n if (this._mapNoticeTopic[notice] != null)\n this._publish(this._mapNoticeTopic[notice], message)\n }\n\n _convertNotice (topic, message) {\n if (this._mapTopicNotice[topic] != null)\n this.handleNotice(this._mapTopicNotice[topic], message)\n else\n for (const [rgx, notice] of this._rgxTopicNotice) {\n const match = rgx.exec(topic)\n if (match != null && match[0] === topic) {\n this.handleNotice(notice, message)\n break\n }\n }\n }\n\n connectTo (cInterface, component) {\n if (component.id)\n this._connect(cInterface, component.id, this)\n }\n\n connectionReady(cInterface, id, component) {\n if (this._connected[cInterface] == null)\n this._connected[cInterface] = []\n this._connected[cInterface].push(id)\n }\n\n async _invoke (cInterface, notice, message) {\n const intSpec = _oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.getInterface(cInterface)\n if (this._connected[cInterface] != null) {\n if (intSpec.response != null &&\n intSpec.response === true) {\n const responses = []\n for (const id of this._connected[cInterface])\n responses.push(await this._bus.invoke (cInterface, id, notice, message))\n return (intSpec.cardinality &&\n intSpec.cardinality[2] == '1')\n ? responses[0] : responses\n } else {\n for (const id of this._connected[cInterface])\n return await this._bus.invoke (cInterface, id, notice, message)\n }\n }\n }\n\n handleNotice (notice, message) {\n if (this._receiveHandler[notice] != null)\n this._receiveHandler[notice](notice, message)\n }\n\n handleInvoke (cInterface, notice, message) {\n let response = null\n if (this._provideHandler[cInterface + '.' + notice] != null)\n response =\n this._provideHandler[cInterface + '.' + notice](notice, message)\n return response\n }\n\n _getCustomField (field) {\n return (this._custom == null || this._custom[field] == null)\n ? null : this._custom[field]\n }\n\n _callCustom (operation, parameters) {\n if (this._custom != null && this._custom[operation] != null)\n return this._custom[operation](this, parameters)\n }\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-base.js?");
/***/ }),
/***/ "./src/base/oid-play.js":
/*!******************************!*\
!*** ./src/base/oid-play.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidPlay\": () => (/* binding */ OidPlay)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _infra_bus_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../infra/bus.js */ \"./src/infra/bus.js\");\n/* harmony import */ var _oid_sphere_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./oid-sphere.js */ \"./src/base/oid-sphere.js\");\n/* harmony import */ var _oid_ui_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./oid-ui.js */ \"./src/base/oid-ui.js\");\n\n\n\n\n\nclass OidPlay extends _oid_sphere_js__WEBPACK_IMPORTED_MODULE_2__.OidSphere {\n connectedCallback () {\n super.connectedCallback()\n\n const html = this._prepareHTML()\n\n const template =\n OidPlay.template\n .replace('{stylesheet}', this.stylesheet)\n .replace('{code}',\n OidPlay.code\n .replace('{html}', html)\n .replace('{rows}', this._rows(html)))\n .replace('{console}', (this.messages ?\n OidPlay.console\n .replace('{rows}', ((this.rows) ? this.rows : OidPlay.rows)) : ''))\n\n _oid_ui_js__WEBPACK_IMPORTED_MODULE_3__.OidUI.prepareShadow(this, template)\n this._scriptPanel = this.shadowRoot.querySelector('#script')\n this._unlockScript = this._unlockScript.bind(this)\n this._scriptPanel.addEventListener('click', this._unlockScript)\n this._buttonRender = this.shadowRoot.querySelector('#btn-render')\n this._buttonRender.addEventListener('click', this._computeRender.bind(this))\n this._observer = new MutationObserver(this._scriptUpdated.bind(this))\n this._observer.observe(this,\n {attributes: true, childList: true, subtree: true})\n\n this.sphere.bus.subscribe('#', this._busMonitor.bind(this))\n }\n\n static get observedAttributes () {\n return _oid_sphere_js__WEBPACK_IMPORTED_MODULE_2__.OidSphere.observedAttributes.concat(['messages', 'rows'])\n }\n\n get messages () {\n return this.hasAttribute('messages')\n }\n\n get messages () {\n return this.hasAttribute('messages')\n }\n\n get rows () {\n return this.getAttribute('rows')\n }\n\n set rows (newValue) {\n this.setAttribute('rows', newValue)\n }\n\n _scriptUpdated(mutationsList, observer) {\n const html = this._prepareHTML()\n this._scriptPanel.value = html\n this._scriptPanel.rows = this._rows(html)\n }\n\n _rows (html) {\n const lines = html.split(/\\r\\n|\\r|\\n/)\n let rows = 0\n lines.forEach(l => {\n rows += Math.floor(l.length / 45) + 1\n })\n return rows\n }\n\n _prepareHTML () {\n let html = this.innerHTML.replace('=\"\"', '')\n .replace(/^[\\r\\n]+/, '')\n .replace(/[\\r\\n]+$/, '')\n if (html.startsWith(' ') || html.startsWith('\\t')) {\n const indent = html.match(/^[ \\t]+/)\n html = html.replace(new RegExp('^' + indent, 'gm'), '')\n }\n return html\n }\n\n _unlockScript() {\n this._scriptPanel.removeEventListener('click', this._unlockScript)\n this._scriptPanel.readOnly = false\n this._buttonRender.style.display = 'initial'\n }\n\n _computeRender() {\n this.shadowRoot.querySelector('#render').innerHTML = this._scriptPanel.value\n }\n\n _busMonitor (topic, message) {\n if (topic != 'bus/monitor')\n this.sphere.bus.publish('bus/monitor', {value: `[${topic}] ${JSON.stringify(message)}`})\n }\n}\n\nOidPlay.rows = 5\n\nOidPlay.code =\n_infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`<div style=\"width:100%;display:flex\">\n<textarea id=\"script\" class=\"code\" style=\"width:100%;cursor:pointer\" rows=\"{rows}\" readonly>{html}</textarea>\n<button id=\"btn-render\" class=\"btn btn-secondary\" style=\"width:auto;display:none\">Render</button>\n</div>`\n\nOidPlay.template =\n_infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`<link rel=\"stylesheet\" href=\"{stylesheet}\">\n{code}\n<div id=\"render\"><slot></slot></div>\n{console}`\n\nOidPlay.console = \n_infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`<div id=\"msg-pnl\" style=\"width:100%\">\n <b>Messages on the Bus</b><br>\n <console-oid rows=\"{rows}\" class=\"code\" prompt=\"\" subscribe=\"bus/monitor~display\"></console-oid>\n</div>`\n\nOidPlay.elementTag = 'oid-play'\ncustomElements.define(OidPlay.elementTag, OidPlay)\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-play.js?");
/***/ }),
/***/ "./src/base/oid-sphere.js":
/*!********************************!*\
!*** ./src/base/oid-sphere.js ***!
\********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidSphere\": () => (/* binding */ OidSphere)\n/* harmony export */ });\n/* harmony import */ var _infra_bus_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../infra/bus.js */ \"./src/infra/bus.js\");\n/* harmony import */ var _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../infra/sphere.js */ \"./src/infra/sphere.js\");\n\n\n\nclass OidSphere extends HTMLElement {\n connectedCallback () {\n // parametrizes the global sphere\n if (this.hasAttribute('global')) {\n this._sphere = _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.i\n if (this.hasAttribute('stylesheets'))\n _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.i.stydefault = this.getAttribute('stylesheets')\n if (this.hasAttribute('stydefault'))\n _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.i.stydefault = this.getAttribute('stydefault')\n if (this.hasAttribute('assets'))\n _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.i.assets = this.getAttribute('assets')\n // cannot change the id and the bus of the global sphere\n } else {\n const id = this.getAttribute('id')\n if (_infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.get(id))\n // if the sphere already exists, use it\n this._sphere = _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.get(id)\n else\n this._sphere = _infra_sphere_js__WEBPACK_IMPORTED_MODULE_1__.Sphere.create(\n this.getAttribute('id'),\n new _infra_bus_js__WEBPACK_IMPORTED_MODULE_0__.Bus(),\n this.getAttribute('stylesheets'),\n this.getAttribute('stydefault'),\n this.getAttribute('assets'))\n }\n }\n\n get id () {\n return this._sphere.id\n }\n\n get stylesheets () {\n return this._sphere.stylesheets\n }\n\n get stydefault () {\n return this._sphere.stydefault\n }\n\n get assets () {\n return this._sphere.assets\n }\n\n get sphere () {\n return this._sphere\n }\n}\n\nOidSphere.elementTag = 'oid-sphere'\ncustomElements.define(OidSphere.elementTag, OidSphere)\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-sphere.js?");
/***/ }),
/***/ "./src/base/oid-ui-input.js":
/*!**********************************!*\
!*** ./src/base/oid-ui-input.js ***!
\**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidUIInput\": () => (/* binding */ OidUIInput)\n/* harmony export */ });\n/* harmony import */ var _oid_ui_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./oid-ui.js */ \"./src/base/oid-ui.js\");\n/**\n * Base for all UI input components\n */\n\n\n\nclass OidUIInput extends _oid_ui_js__WEBPACK_IMPORTED_MODULE_0__.OidUI {\n connectedCallback () {\n this._value = this.getAttribute('value') || false\n super.connectedCallback()\n }\n\n static get observedAttributes () {\n return _oid_ui_js__WEBPACK_IMPORTED_MODULE_0__.OidUI.observedAttributes.concat(\n ['variable', 'value'])\n }\n\n get variable () {\n // return this.getAttribute('variable')\n return this._variable\n }\n\n set variable (newValue) {\n this._variable = newValue\n // this.setAttribute('variable', newValue)\n }\n\n get value () {\n return this._value\n }\n\n set value (newValue) {\n this._value = newValue\n }\n}\n\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-ui-input.js?");
/***/ }),
/***/ "./src/base/oid-ui.js":
/*!****************************!*\
!*** ./src/base/oid-ui.js ***!
\****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidUI\": () => (/* binding */ OidUI)\n/* harmony export */ });\n/* harmony import */ var _oid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _oid_web_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oid-web.js */ \"./src/base/oid-web.js\");\n\n\n\nclass OidUI extends _oid_web_js__WEBPACK_IMPORTED_MODULE_1__.OidWeb {\n async connectedCallback () {\n await super.connectedCallback()\n\n // resolve dynamic styles\n this._stylesheets = this.constructor.spec.stylesheets\n .replace('href=\"default\"', 'href=\"' + this._sphere.stydefault + '\"')\n .replace('href=\"stylesheets:', 'href=\"' + this._sphere.stylesheets)\n\n this.render()\n }\n\n render () {\n const spec = this.constructor.spec\n\n // handles a dynamic template\n let template = (spec != null) ? spec.template : null\n if (this.template) {\n const tmpl = this.template()\n if (tmpl != this._template) {\n this._template = tmpl\n const td = _oid_js__WEBPACK_IMPORTED_MODULE_0__.Oid.prepareDispatchers(tmpl, this.constructor)\n this._templatePre = td.template\n this._buildEventDispatchers(td.dispatcher, this)\n }\n template = this._templatePre\n }\n\n this._presentation = null\n if (spec != null && template != null) {\n let customTemplate = this._getCustomField('style')\n customTemplate = (customTemplate)\n ? `<style>${customTemplate}</style>` : ''\n\n const html =\n (this._stylesheets + spec.styles + customTemplate + template)\n .replace(\n /{{[ \\t]*(url:)?[ \\t]*this\\.([^}]*)}}/g,\n (match, p1, p2) => {\n p2 = (p2) ? p2.trim() : ''\n let value = (this[p2]) ? this[p2] : ''\n if (p1 === 'url:')\n value = value.replace('assets:', this._sphere.assets)\n return value\n })\n\n if (spec.shadow === false) {\n this.innerHTML = html\n this._presentation = this.querySelector('#oid-prs') || this\n } else\n this._presentation = this._shadowHTML(html)\n\n if (this._dispatcher) {\n const query = (spec.shadow === false) ? this : this.shadowRoot\n for (const [atr, event, dispatch] of this._dispatcher) {\n const target = query.querySelector('[' + atr + ']')\n target.addEventListener(event, dispatch)\n }\n }\n }\n }\n\n _shadowHTML (html) {\n const clone = OidUI.prepareShadow(this, html)\n return this.shadowRoot.querySelector('#oid-prs') || clone\n }\n\n static prepareShadow (owner, html) {\n const template = document.createElement('template')\n template.innerHTML = html\n const clone = document.importNode(template.content, true)\n if (!owner.shadowRoot)\n owner.attachShadow({ mode: 'open' })\n else\n owner.shadowRoot.innerHTML = ''\n owner.shadowRoot.appendChild(clone)\n return clone\n }\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-ui.js?");
/***/ }),
/***/ "./src/base/oid-web.js":
/*!*****************************!*\
!*** ./src/base/oid-web.js ***!
\*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OidWeb\": () => (/* binding */ OidWeb)\n/* harmony export */ });\n/* harmony import */ var _oid_base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./oid-base.js */ \"./src/base/oid-base.js\");\n\n\nclass OidWeb extends _oid_base_js__WEBPACK_IMPORTED_MODULE_0__.OidBase {\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid-web.js?");
/***/ }),
/***/ "./src/base/oid.js":
/*!*************************!*\
!*** ./src/base/oid.js ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Oid\": () => (/* binding */ Oid)\n/* harmony export */ });\n/* harmony import */ var _oid_base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./oid-base.js */ \"./src/base/oid-base.js\");\n/* harmony import */ var _oid_web_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oid-web.js */ \"./src/base/oid-web.js\");\n/* harmony import */ var _oid_ui_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./oid-ui.js */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass Oid {\n static eventAttribute = 'oidevent_'\n static defaultInterface = ['itf:oid']\n\n static _interfaceReg = {}\n static _oidReg = {}\n static _oidCustom = {}\n static _customQueue = {}\n static _defaultSpec = {}\n\n static cInterface (spec) {\n if (spec != null)\n Oid._interfaceReg[spec.id] = spec\n }\n\n static getInterface (cInterface) {\n return Oid._interfaceReg[cInterface]\n }\n\n static component (spec) {\n // add default values\n spec = Object.assign({}, Oid._defaultSpec, spec)\n\n // define the class implementation\n let impl = spec.implementation\n if (impl == null) {\n const inh =\n (spec.ui === false || spec.template == null)\n ? ((spec.element == null) ? _oid_base_js__WEBPACK_IMPORTED_MODULE_0__.OidBase : _oid_web_js__WEBPACK_IMPORTED_MODULE_1__.OidWeb)\n : _oid_ui_js__WEBPACK_IMPORTED_MODULE_2__.OidUI\n const className = spec.element[0].toUpperCase() +\n spec.element.slice(1)\n .replace(/-([a-z])/g, (match, letter) => letter.toUpperCase())\n impl = class extends inh { }\n Object.defineProperty(impl, 'name', {value: className})\n }\n\n // build property getters and setters\n const observed = impl.observedAttributes.slice()\n if (spec.properties) {\n Object.defineProperty(impl, 'observedAttributes', {\n get: function() { return this.observed }\n })\n for (const pname in spec.properties) {\n const property = spec.properties[pname]\n const jsName = pname.replace(\n /-([a-z])/g, (match, letter) => letter.toUpperCase())\n Object.defineProperty(impl.prototype, jsName,\n ((property.readonly)\n ? {\n get: function() {return this['_' + jsName]}\n }\n : (impl.prototype.render == null)\n ? {\n get: function() {return this['_' + jsName]},\n set: function(newValue) {\n this['_' + jsName] = newValue\n }\n }\n : {\n get: function() {return this['_' + jsName]},\n set: function(newValue) {\n const old = this['_' + jsName]\n this['_' + jsName] = newValue\n if (old != newValue && this._sphere)\n this.render()\n }\n }\n )\n )\n if (property.attribute == null || property.attribute !== false)\n observed.push(pname)\n }\n }\n\n // associate interface ids to specifications\n spec.provide = (spec.provide == null)\n ? Oid.defaultInterface : spec.provide.concat(Oid.defaultInterface)\n if (spec.provide) {\n const provideSpec = {}\n for (const p of spec.provide) {\n const cInterface = Oid._interfaceReg[p]\n if (cInterface == null)\n throw new Error('Unknown interface id: ' + p)\n else\n provideSpec[p] = cInterface\n }\n spec.provide = provideSpec\n }\n\n Oid.stylePreprocess(spec)\n\n const td = Oid.prepareDispatchers(spec.template, impl)\n spec.template = td.template\n if (td.dispatcher)\n spec.dispatcher = td.dispatcher\n\n // attach the specification to the implementation\n Object.assign(impl, {spec: spec, observed: observed})\n \n // <TODO> provisory - classes without element will not inherit HTMLElement\n if (spec.element == null)\n spec.element = 'internal-' + spec.id.replace(':', '-')\n customElements.define(spec.element, impl)\n \n // register the implementation in the dictionary\n Oid._oidReg[spec.id] = impl\n }\n\n static componentSet (id, complementarySpec) {\n if (id != null && Oid._oidReg[id] != null) {\n const spec = Oid._oidReg[id].spec\n for (const p in complementarySpec)\n spec[p] = complementarySpec[p]\n Oid.stylePreprocess(spec)\n }\n }\n\n // styles and template preprocessing\n static stylePreprocess (spec) {\n let sty = ''\n if (spec.stylesheets) {\n let ss = spec.stylesheets\n if (!Array.isArray(ss)) ss = [ss]\n for (const s of ss)\n sty += `<link href=\"${s}\" rel=\"stylesheet\">`\n }\n spec.stylesheets = sty\n spec.styles = (spec.styles) ? `<style>${spec.styles}</style>` : ''\n }\n\n static prepareDispatchers (template, impl) {\n let dispatcher = null\n if (template) {\n let atrn = 1\n const te = template.split(\n /@([^= >]*)[ \\t]*(?:=[ \\t]*{{[ \\t]*this\\.([^}]*)[ \\t]*}})?/)\n if (te.length > 1) {\n dispatcher = []\n let ntempl = ''\n for (let i = 0; i + 2 < te.length; i += 3) {\n ntempl +=\n te[i] + Oid.eventAttribute + atrn + ' '\n const evt = te[i + 1].trim()\n const funcName = (te[i + 2] != null)\n ? te[i + 2].trim()\n : '_on' + evt[0].toUpperCase() + evt.substring(1)\n dispatcher.push([\n Oid.eventAttribute + atrn, evt,\n impl.prototype[funcName]])\n atrn++\n }\n template = ntempl + te[te.length - 1]\n }\n }\n return {\n template: template,\n dispatcher: dispatcher\n }\n }\n\n static create (componentId, properties) {\n const impl = Oid._oidReg[componentId]\n if (impl == null)\n throw new Error('Unknown component id: ' + componentId)\n const instance = document.createElement(impl.spec.element)\n if (properties != null) {\n for (const p in properties)\n instance.setAttribute(p, properties[p])\n }\n return instance\n }\n\n static customize (id, spec) {\n if (id != null && Oid._oidReg[id] != null &&\n spec != null && spec.cid != null) {\n Oid._oidCustom[id + '.' + spec.cid] = spec\n if (Oid._customQueue[id + '.' + spec.cid] != null) {\n Oid._customQueue[id + '.' + spec.cid]()\n delete Oid._customQueue[id + '.' + spec.cid]\n }\n }\n }\n\n static async getCustom (id, cid) {\n if (id == null || cid == null)\n return null\n\n // wait the customization\n if (Oid._oidCustom[id + '.' + cid] == null) {\n const promise = new Promise((resolve, reject) => {\n const callback = function () {\n resolve()\n }\n Oid._customQueue[id + '.' + cid] = callback\n })\n await promise\n }\n return Oid._oidCustom[id + '.' + cid]\n }\n\n static setDefault (spec) {\n this._defaultSpec = spec\n }\n\n static addDefault (spec) {\n for (const p in spec) {\n if (this._defaultSpec[p] == null)\n this._defaultSpec[p] = spec[p]\n else if (Array.isArray(this._defaultSpec[p]))\n this._defaultSpec[p] = this._defaultSpec[p].concat(spec[p])\n else if (typeof this._defaultSpec[p] === 'object')\n Object.assign(this._defaultSpec[p], spec[p])\n else\n this._defaultSpec[p] = spec[p]\n }\n }\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/oid.js?");
/***/ }),
/***/ "./src/base/primitive.js":
/*!*******************************!*\
!*** ./src/base/primitive.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Primitive\": () => (/* binding */ Primitive)\n/* harmony export */ });\n/* harmony import */ var _infra_sphere_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../infra/sphere.js */ \"./src/infra/sphere.js\");\n/* harmony import */ var _oid_sphere_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oid-sphere.js */ \"./src/base/oid-sphere.js\");\n\n\n\nclass Primitive extends HTMLElement {\n constructor () {\n super()\n this._sphere = null\n }\n\n get _bus () {\n return this._sphere.bus\n }\n\n connectedCallback () {\n let ag = this._findAggregator(_oid_sphere_js__WEBPACK_IMPORTED_MODULE_1__.OidSphere)\n if (ag != null)\n this._sphere = ag.sphere\n else\n this._sphere = _infra_sphere_js__WEBPACK_IMPORTED_MODULE_0__.Sphere.i\n }\n\n _findAggregator(agClass) {\n let parent = (this.parentNode != null)\n ? this.parentNode\n : ((this instanceof DocumentFragment) ? this.host : null)\n while (parent != null && !(parent instanceof agClass))\n parent = (parent.parentNode != null)\n ? parent.parentNode\n : ((parent instanceof DocumentFragment) ? parent.host : null)\n return parent\n }\n\n /*\n * Bus Proxy\n */\n\n _subscribe (subscribed, handler) {\n if (this._bus != null)\n this._bus.subscribe(subscribed, handler)\n }\n\n _unsubscribe (subscribed, handler) {\n this._bus.unsubscribe(subscribed, handler)\n }\n\n async _publish (topic, message) {\n await this._bus.publish(topic, message)\n }\n\n _provide (cInterface, id, provider) {\n this._bus.provide(cInterface, id, provider)\n }\n\n _withhold (cInterface, id) {\n this._bus.withhold(cInterface, id)\n }\n\n _connect (cInterface, id, callback) {\n this._bus.connect(cInterface, id, callback)\n }\n\n async _invoke (cInterface, id, notice, message) {\n return await this._bus.invoke (cInterface, id, notice, message)\n }\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/base/primitive.js?");
/***/ }),
/***/ "./src/components/data/file-oid.js":
/*!*****************************************!*\
!*** ./src/components/data/file-oid.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FileOid\": () => (/* binding */ FileOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui.js */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass FileOid extends _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__.OidUI {\n _onDragover (event) {\n if (this.pre)\n this._presentation.innerHTML = this.pre\n event.preventDefault()\n }\n\n async _onDrop (event) {\n event.preventDefault()\n if (this.post)\n this._presentation.innerHTML = this.post\n\n let file = null\n if (event.dataTransfer.items) {\n for (let item of event.dataTransfer.items) {\n if (item.kind === 'file')\n file = item.getAsFile()\n }\n } else\n file = event.dataTransfer.files[0]\n const content = await file.text()\n this._notify('loaded', {value: content})\n this._invoke('itf:transfer', 'send', {value: content})\n }\n}\n\n_base_oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.component(\n{\n id: 'oid:file',\n element: 'file-oid',\n properties: {\n label: { default: 'Drop Zone' },\n pre: { default: 'Drop your file here' },\n post: { default: 'File loaded' }\n },\n implementation: FileOid,\n styles: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.css`\n #oid-prs {\n border: 5px solid;\n }`,\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <div id=\"oid-prs\" @dragover @drop>{{this.label}}</div>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/data/file-oid.js?");
/***/ }),
/***/ "./src/components/interfaces-components.js":
/*!*************************************************!*\
!*** ./src/components/interfaces-components.js ***!
\*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base_oid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/oid */ \"./src/base/oid.js\");\n\n\n_base_oid__WEBPACK_IMPORTED_MODULE_0__.Oid.cInterface ({\n id: 'itf:transfer',\n operations: ['send'],\n cardinality: 'n:n'\n})\n\n_base_oid__WEBPACK_IMPORTED_MODULE_0__.Oid.cInterface ({\n id: 'itf:iterate',\n operations: {\n 'first': {response: true},\n 'next': {response: true}\n },\n cardinality: '1:n'\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/interfaces-components.js?");
/***/ }),
/***/ "./src/components/ui/button-oid.js":
/*!*****************************************!*\
!*** ./src/components/ui/button-oid.js ***!
\*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ButtonOid\": () => (/* binding */ ButtonOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui.js */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass ButtonOid extends _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__.OidUI {\n _onClick () {\n this._callCustom('click')\n this._notify('click', {value: this.value || this.label})\n this._invoke('itf:transfer', 'send', {value: this.value || this.label})\n }\n\n _onMouseenter () {\n this._notify('mouseenter', {value: this.value || this.label})\n }\n\n _onMouseleave () {\n this._notify('mouseleave', {value: this.value || this.label})\n }\n}\n\n_base_oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.component(\n{\n id: 'oid:button',\n element: 'button-oid',\n properties: {\n label: {},\n value: {}\n },\n implementation: ButtonOid,\n stylesheets: 'default',\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <button id=\"oid-prs\" class=\"btn btn-primary\"\n @click @mouseenter @mouseleave>\n {{this.label}}\n </button>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/button-oid.js?");
/***/ }),
/***/ "./src/components/ui/console-oid.js":
/*!******************************************!*\
!*** ./src/components/ui/console-oid.js ***!
\******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ConsoleOid\": () => (/* binding */ ConsoleOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass ConsoleOid extends _base_oid_ui__WEBPACK_IMPORTED_MODULE_2__.OidUI {\n handleSend (topic, message) {\n if (this._presentation && message && message.value)\n this._presentation.value +=\n (this.prompt.length > 0 ? `${this.prompt} ` : '') +\n `${message.value}\\n`\n }\n}\n\n_base_oid__WEBPACK_IMPORTED_MODULE_1__.Oid.component({\n id: 'oid:console',\n element: 'console-oid',\n properties: {\n prompt: {default: '>'},\n rows: {default: 10}\n },\n receive: {'display': 'handleSend'},\n provide: ['itf:transfer'],\n implementation: ConsoleOid,\n styles: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.css`\n .console {\n width: 100%;\n font-family: \"Courier New\", monospace;\n font-size: 1em;\n background-color: lightgray\n }`,\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <textarea class=\"console\" rows=\"{{this.rows}}\" id=\"oid-prs\" readonly></textarea>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/console-oid.js?");
/***/ }),
/***/ "./src/components/ui/container/split-pane-oid.js":
/*!*******************************************************!*\
!*** ./src/components/ui/container/split-pane-oid.js ***!
\*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SplitPaneOid\": () => (/* binding */ SplitPaneOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/oid */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/oid-ui */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass SplitPaneOid extends _base_oid_ui__WEBPACK_IMPORTED_MODULE_2__.OidUI {\n constructor () {\n super()\n this._x = 0\n this._y = 0\n this._sideASize = 0\n this._onMousemove = this._onMousemove.bind(this)\n this._onMouseup = this._onMouseup.bind(this)\n }\n\n async connectedCallback () {\n await super.connectedCallback()\n this._horz = !(this.split === 'vertical')\n\n this._resizer = this.shadowRoot.getElementById('resizer')\n this._sidea = this.shadowRoot.getElementById('sidea')\n this._sideb = this.shadowRoot.getElementById('sideb')\n\n if (this._horz) {\n this._resizer.style.cursor = 'ew-resize'\n this._resizer.style.height = '100%'\n this._resizer.classList.add('divide-x')\n this._sidea.style.width = this.proportion\n } else {\n this._resizer.style.cursor = 'ns-resize'\n this._presentation.style.flexDirection = 'column'\n this._resizer.style.width = '100%'\n this._resizer.classList.add('divide-y')\n this._sidea.style.height = this.proportion\n }\n }\n\n _onMousedown (event) {\n this._x = event.clientX\n this._y = event.clientY\n this._sideASize = (this._horz)\n ? this._sidea.getBoundingClientRect().width\n : this._sidea.getBoundingClientRect().height\n\n this.shadowRoot.addEventListener('mousemove', this._onMousemove)\n this.shadowRoot.addEventListener('mouseup', this._onMouseup)\n }\n\n _onMousemove (event) {\n const dx = event.clientX - this._x\n const dy = event.clientY - this._y\n\n if (this._horz) {\n const newSideAWidth =\n (this._sideASize + dx) * 100 / this._presentation.getBoundingClientRect().width\n this._sidea.style.width = newSideAWidth + '%'\n\n this._resizer.style.cursor = 'col-resize'\n document.body.style.cursor = 'col-resize'\n } else {\n const newSideAHeight =\n (this._sideASize + dy) * 100 / this._presentation.getBoundingClientRect().height\n this._sidea.style.height = newSideAHeight + '%'\n\n this._resizer.style.cursor = 'row-resize'\n document.body.style.cursor = 'row-resize'\n }\n\n this._sidea.style.userSelect = 'none'\n this._sidea.style.pointerEvents = 'none'\n\n this._sideb.style.userSelect = 'none'\n this._sideb.style.pointerEvents = 'none'\n }\n\n _onMouseup (event) {\n this.shadowRoot.removeEventListener('mousemove', this._onMousemove)\n this.shadowRoot.removeEventListener('mouseup', this._onMouseup)\n\n this._resizer.style.cursor = (this._horz) ? 'ew-resize' : 'ns-resize'\n document.body.style.removeProperty('cursor')\n\n this._sidea.style.removeProperty('user-select')\n this._sidea.style.removeProperty('pointer-events')\n\n this._sideb.style.removeProperty('user-select')\n this._sideb.style.removeProperty('pointer-events')\n\n this._notify('resize',\n {awidth: this._sidea.style.width,\n aheight: this._sidea.style.height,\n bwidth: this._sideb.style.width,\n bheight: this._sideb.style.height})\n }\n}\n\n_base_oid__WEBPACK_IMPORTED_MODULE_1__.Oid.component({\n id: 'oid:split-pane',\n element: 'split-pane-oid',\n properties: {\n split: {default: 'horizontal'},\n proportion: {default: '50%'}\n },\n implementation: SplitPaneOid,\n stylesheets: 'default',\n styles: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.css`\n .group {\n display: flex;\n width: 100%;\n height: 100%;\n }\n .pane-b {\n flex: 1;\n }`,\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <div id=\"oid-prs\" class=\"group\">\n <div class=\"bg-base\" id=\"sidea\"><slot name=\"side-a\"></slot></div>\n <div class=\"divide\" id=\"resizer\" @mousedown></div>\n <div class=\"pane-b bg-base\" id=\"sideb\"><slot name=\"side-b\"></slot></div>\n </div>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/container/split-pane-oid.js?");
/***/ }),
/***/ "./src/components/ui/image-oid.js":
/*!****************************************!*\
!*** ./src/components/ui/image-oid.js ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ImageOid\": () => (/* binding */ ImageOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui.js */ \"./src/base/oid-ui.js\");\n\n\n\n\nclass ImageOid extends _base_oid_ui_js__WEBPACK_IMPORTED_MODULE_2__.OidUI {\n _onClick () {\n this._notify('click', {value: this.label || this.source})\n }\n\n _onMouseenter () {\n this._notify('mouseenter', {value: this.label || this.source})\n }\n\n _onMouseleave () {\n this._notify('mouseleave', {value: this.label || this.source})\n }\n}\n\n_base_oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.component(\n{\n id: 'oid:image',\n element: 'image-oid',\n properties: {\n source: {default: 'assets:images/image.svg'},\n label: {}\n },\n implementation: ImageOid,\n stylesheets: 'default',\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <image id=\"oid-prs\" src=\"{{url:this.source}}\" alt=\"{{this.label}}\"\n @click @mouseenter @mouseleave>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/image-oid.js?");
/***/ }),
/***/ "./src/components/ui/slider-input-oid.js":
/*!***********************************************!*\
!*** ./src/components/ui/slider-input-oid.js ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SliderOid\": () => (/* binding */ SliderOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui_input_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui-input.js */ \"./src/base/oid-ui-input.js\");\n\n\n\n\nclass SliderOid extends _base_oid_ui_input_js__WEBPACK_IMPORTED_MODULE_2__.OidUIInput {\n connectedCallback () {\n super.connectedCallback()\n if (!this.hasAttribute('value')) {\n // <TODO> automatically recognize attribute type and improve render\n this.value = \n Math.round((parseInt('' + this.min) + parseInt('' + this.max)) / 2)\n this.render()\n }\n this._notify('initial', { value: this.value })\n }\n\n render () {\n super.render()\n this._input = this._presentation.querySelector('#oid-input')\n if (this.hasAttribute('index')) {\n this._index = this._presentation.querySelector('#index')\n this._index.innerHTML = this.value\n }\n }\n\n _onInput () {\n this._value = this._input.value\n if (this.hasAttribute('index'))\n this._index.innerHTML = this.value\n this._notify('change', { value: this.value })\n }\n}\n\n_base_oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.component(\n{\n id: 'oid:slider',\n element: 'slider-oid',\n properties: {\n min: {default: 0},\n max: {default: 100},\n index: {default: false}\n },\n implementation: SliderOid,\n stylesheets: 'default',\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <div id=\"oid-prs\" style=\"width:100%; display:flex; flex-direction:row\">\n <span id=\"index\" style=\"flex:initial\"></span>\n <input type=\"range\" id=\"oid-input\" min=\"{{this.min}}\" max=\"{{this.max}}\"\n value=\"{{this.value}}\" style=\"flex:auto\" @input>\n </div>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/slider-input-oid.js?");
/***/ }),
/***/ "./src/components/ui/switch-input-oid.js":
/*!***********************************************!*\
!*** ./src/components/ui/switch-input-oid.js ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SwitchOid\": () => (/* binding */ SwitchOid)\n/* harmony export */ });\n/* harmony import */ var _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../infra/literals.js */ \"./src/infra/literals.js\");\n/* harmony import */ var _base_oid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/oid.js */ \"./src/base/oid.js\");\n/* harmony import */ var _base_oid_ui_input_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/oid-ui-input.js */ \"./src/base/oid-ui-input.js\");\n\n\n\n\nclass SwitchOid extends _base_oid_ui_input_js__WEBPACK_IMPORTED_MODULE_2__.OidUIInput {\n connectedCallback () {\n super.connectedCallback()\n if (this.hasAttribute('value')) {\n // <TODO> automatically recognize attribute type and improve render\n this.value = !(this.getAttribute('value') === 'off')\n this.render()\n }\n this._notify('initial',\n { value: (this.value) ? this.on : this.off })\n }\n\n render () {\n super.render()\n this._input =\n this._presentation.querySelector('#oid-input')\n this._input.checked = this.value\n }\n\n handleInvert (topic, message) {\n this.value = !this.value\n if (this.value)\n this._input.checked = true\n else\n this._input.checked = false\n }\n\n _onInput () {\n console.log('=== input')\n this._value = this._input.checked\n this._notify('change',\n { value: (this.value) ? this.on : this.off })\n }\n}\n\n_base_oid_js__WEBPACK_IMPORTED_MODULE_1__.Oid.component(\n{\n id: 'oid:switch',\n element: 'switch-oid',\n // properties: variable and value inherited from OidUIInput\n properties: {\n on: {default: 'on'},\n off: {default: 'off'}\n },\n receive: ['invert'],\n implementation: SwitchOid,\n styles: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.css`\n .switch {\n position: relative;\n display: inline-block;\n width: 60px;\n height: 34px;\n }\n .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: .4s;\n transition: .4s;\n }\n .slider:before {\n position: absolute;\n content: \"\";\n height: 26px;\n width: 26px;\n left: 4px;\n bottom: 4px;\n background-color: white;\n -webkit-transition: .4s;\n transition: .4s;\n }\n input:checked + .slider {\n background-color: #2196F3;\n }\n input:focus + .slider {\n box-shadow: 0 0 1px #2196F3;\n }\n input:checked + .slider:before {\n -webkit-transform: translateX(26px);\n -ms-transform: translateX(26px);\n transform: translateX(26px);\n }\n .slider.round {\n border-radius: 34px;\n }\n .slider.round:before {\n border-radius: 50%;\n }`,\n template: _infra_literals_js__WEBPACK_IMPORTED_MODULE_0__.html`\n <label id=\"oid-prs\" class=\"switch\">\n <input id=\"oid-input\" type=\"checkbox\" @input>\n <span class=\"slider round\"></span>\n </label>`\n})\n\n//# sourceURL=webpack://@mundorum/oid/./src/components/ui/switch-input-oid.js?");
/***/ }),
/***/ "./src/infra/bus.js":
/*!**************************!*\
!*** ./src/infra/bus.js ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Bus\": () => (/* binding */ Bus)\n/* harmony export */ });\nclass Bus {\n constructor() {\n this._listeners = {}\n this._listenersRgx = []\n this._providers = {}\n this._pendingCnx = {}\n }\n\n /* Message-oriented communication\n ********************************/\n\n subscribe (subscribed, handler) {\n if (subscribed != null) {\n let topics = {}\n if (typeof subscribed === 'string' && handler != null)\n topics[subscribed] = handler\n else if (typeof subscribed === 'object')\n topics = subscribed\n const listenersRgx = this._listenersRgx.slice()\n const listeners = { ...this._listeners }\n for (const tp in topics) {\n if (topics[tp] != null) {\n // topic filter: transform wildcards in regular expressions\n if (tp.includes('+') || tp.includes('#'))\n listenersRgx.push([Bus._convertRegExp(tp), topics[tp], tp])\n else {\n if (listeners[tp] == null)\n listeners[tp] = []\n else\n listeners[tp] = listeners[tp].slice() // clone\n listeners[tp].push(topics[tp])\n }\n }\n }\n this._listenersRgx = listenersRgx\n this._listeners = listeners\n }\n }\n\n unsubscribe (subscribed) {\n if (subscribed != null) {\n const topics = {}\n if (typeof subscribed === 'string' && handler != null)\n topics[subscribed] = handler\n else if (typeof subscribed === 'object')\n topics = subscribed\n const listenersRgx = this._listenersRgx.slice()\n const listeners = { ...this._listeners }\n for (const tp in topics) {\n if (tp.includes('+') || tp.includes('#')) {\n for (const l in listenersRgx) {\n if (listenersRgx[l][1] === topics[tp] &&\n listenersRgx[l][2] == tp) {\n listenersRgx.splice(l, 1)\n break\n }\n }\n } else if (listeners[tp] != null) {\n for (const l in listeners[tp]) {\n if (listeners[tp][l] === topics[tp]) {\n listeners[tp] = listeners[tp].toSplice(l, 1) // clone\n break\n }\n }\n }\n }\n this._listenersRgx = listenersRgx\n this._listeners = listeners\n }\n }\n\n async publish (topic, message) {\n if (this._listeners[topic] != null)\n for (const handler of this._listeners[topic])\n handler(topic, message)\n const listenersRgx = this._listenersRgx\n for (const l of listenersRgx) {\n const match = l[0].exec(topic)\n if (match != null && match[0] === topic)\n l[1](topic, message)\n }\n }\n\n /* Message analysis services\n *************************/\n\n static _convertRegExp (filter) {\n return new RegExp(filter.replace(/\\//g, '\\\\/')\n .replace(/\\+/g, '[^\\/]+')\n .replace(/#/g, '.+'))\n }\n\n /* Connection-oriented communication\n ***********************************/\n\n /*\n * Components declare provided services. Each interface defines a type of\n * service. The same component can have several interfaces/services:\n * cInterface: interface provided by the component\n * id: unique id of the component instance that offers the service\n * provider: the component or component subobject that implements\n * the interface/service\n */\n provide (cInterface, id, provider) {\n let status = false\n if (id != null && cInterface != null && provider != null) {\n const key = cInterface + '#' + id\n if (this._providers[key] == null) {\n status = true\n this._providers[key] = provider\n if (this._pendingCnx[key] != null) {\n for (let c of this._pendingCnx[key])\n c.connectionReady(cInterface, id, provider)\n delete this._pendingCnx[key]\n }\n }\n }\n return status\n }\n\n /*\n * Removes a provided service (usually, when the component is destroyed)\n */\n withhold (cInterface, id) {\n let status = false\n if (id != null && cInterface != null) {\n const key = cInterface + '#' + id\n if (this._providers[key]) {\n status = true\n delete this._providers[key]\n }\n }\n return status\n }\n\n /*\n * Connects a component to another one based on the id and a provided service.\n * id: id of the component that offers the service\n * cInterface: label related to the provided interface\n * callback: component that will be notified as soon as the interface is\n * connected\n */\n connect (cInterface, id, callback) {\n let status = false\n if (id != null && cInterface != null && callback != null) {\n const key = cInterface + '#' + id\n if (this._providers[key])\n callback.connectionReady(cInterface, id, this._providers[key])\n // callback.connectionReady(cInterface, id,\n // this.invoke.bind(this, key), this._providers[key])\n else\n if (this._pendingCnx[key])\n this._pendingCnx[key].push(callback)\n else\n this._pendingCnx[key] = [callback]\n }\n }\n\n /*\n * Triggers a interface defined by an id and component, sending an optional\n * message to it.\n */\n async invoke (cInterface, id, notice, message) {\n // console.log('=== bus invoke', cInterface, id, notice, message)\n // console.log(this._providers)\n const key = cInterface + '#' + id\n if (this._providers[key] != null)\n return await\n this._providers[key].handleInvoke(cInterface, notice, message)\n else\n return null\n }\n}\n\nBus.i = new Bus()\n\n//# sourceURL=webpack://@mundorum/oid/./src/infra/bus.js?");
/***/ }),
/***/ "./src/infra/literals.js":
/*!*******************************!*\
!*** ./src/infra/literals.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"css\": () => (/* binding */ css),\n/* harmony export */ \"html\": () => (/* binding */ html)\n/* harmony export */ });\nconst html =\n (strings, ...values) =>\n String.raw({ raw: strings }, ...values)\n\nconst css =\n (strings, ...values) =>\n String.raw({ raw: strings }, ...values)\n\n//# sourceURL=webpack://@mundorum/oid/./src/infra/literals.js?");
/***/ }),
/***/ "./src/infra/sphere-setup.js":
/*!***********************************!*\
!*** ./src/infra/sphere-setup.js ***!
\***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"sphereSetup\": () => (/* binding */ sphereSetup)\n/* harmony export */ });\n/* harmony import */ var _bus_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bus.js */ \"./src/infra/bus.js\");\n\n\nconst sphereSetup = {\n id: 'default',\n bus: _bus_js__WEBPACK_IMPORTED_MODULE_0__.Bus.i,\n stylesheets: '/lib/',\n stydefault: ['stylesheets:oiddefault.css'],\n assets: '/assets/'\n}\n\n//# sourceURL=webpack://@mundorum/oid/./src/infra/sphere-setup.js?");
/***/ }),
/***/ "./src/infra/sphere.js":
/*!*****************************!*\
!*** ./src/infra/sphere.js ***!
\*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Sphere\": () => (/* binding */ Sphere)\n/* harmony export */ });\n/* harmony import */ var _sphere_setup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sphere-setup */ \"./src/infra/sphere-setup.js\");\n\n\nclass Sphere {\n constructor (id, bus, stylesheets, stydefault, assets) {\n this._id = id || null\n this._bus = (bus) ? bus : Sphere.i.bus\n this._stylesheets = (stylesheets) ? stylesheets : Sphere.i.stylesheets\n this._stydefault =\n (stydefault) ? stydefault : Sphere.i.stydefault\n this._assets = (assets) ? assets : Sphere.i.assets\n }\n\n static create (id, bus, stylesheets, stydefault, assets) {\n if (id != null && Sphere._spheres[id] != null)\n throw new Error(`Sphere with id ${id} already exists`)\n const sphere = new Sphere(id, bus, stylesheets, stydefault, assets)\n if (id != null)\n Sphere._spheres[id] = sphere\n return sphere\n }\n\n static get (id) {\n return (id) ? (Sphere._spheres[id] || null) : null\n }\n\n get id () {\n return this._id\n }\n\n get bus () {\n return this._bus\n }\n\n set stylesheets (newValue) {\n this._stylesheets = newValue\n }\n\n get stylesheets () {\n return this._stylesheets\n }\n\n set stydefault (newValue) {\n this._stydefault = newValue\n }\n\n get stydefault () {\n return this._stydefault\n }\n\n set assets (newValue) {\n this._assets = newValue\n }\n\n get assets () {\n return this._assets\n }\n}\n\n// controls the existing spheres that have id\nSphere._spheres = {}\n\nSphere.i = Sphere.create(\n _sphere_setup__WEBPACK_IMPORTED_MODULE_0__.sphereSetup.id,\n _sphere_setup__WEBPACK_IMPORTED_MODULE_0__.sphereSetup.bus,\n _sphere_setup__WEBPACK_IMPORTED_MODULE_0__.sphereSetup.stylesheets,\n _sphere_setup__WEBPACK_IMPORTED_MODULE_0__.sphereSetup.stydefault,\n _sphere_setup__WEBPACK_IMPORTED_MODULE_0__.sphereSetup.assets\n)\n\n//# sourceURL=webpack://@mundorum/oid/./src/infra/sphere.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/assembly/full.js");
/******/ var __webpack_exports__Bus = __webpack_exports__.Bus;
/******/ var __webpack_exports__ButtonOid = __webpack_exports__.ButtonOid;
/******/ var __webpack_exports__ConsoleOid = __webpack_exports__.ConsoleOid;
/******/ var __webpack_exports__FileOid = __webpack_exports__.FileOid;
/******/ var __webpack_exports__ImageOid = __webpack_exports__.ImageOid;
/******/ var __webpack_exports__Oid = __webpack_exports__.Oid;
/******/ var __webpack_exports__OidBase = __webpack_exports__.OidBase;
/******/ var __webpack_exports__OidPlay = __webpack_exports__.OidPlay;
/******/ var __webpack_exports__OidSphere = __webpack_exports__.OidSphere;
/******/ var __webpack_exports__OidUI = __webpack_exports__.OidUI;
/******/ var __webpack_exports__OidWeb = __webpack_exports__.OidWeb;
/******/ var __webpack_exports__Primitive = __webpack_exports__.Primitive;
/******/ var __webpack_exports__SliderOid = __webpack_exports__.SliderOid;
/******/ var __webpack_exports__Sphere = __webpack_exports__.Sphere;
/******/ var __webpack_exports__SplitPaneOid = __webpack_exports__.SplitPaneOid;
/******/ var __webpack_exports__SwitchOid = __webpack_exports__.SwitchOid;
/******/ var __webpack_exports__css = __webpack_exports__.css;
/******/ var __webpack_exports__html = __webpack_exports__.html;
/******/ export { __webpack_exports__Bus as Bus, __webpack_exports__ButtonOid as ButtonOid, __webpack_exports__ConsoleOid as ConsoleOid, __webpack_exports__FileOid as FileOid, __webpack_exports__ImageOid as ImageOid, __webpack_exports__Oid as Oid, __webpack_exports__OidBase as OidBase, __webpack_exports__OidPlay as OidPlay, __webpack_exports__OidSphere as OidSphere, __webpack_exports__OidUI as OidUI, __webpack_exports__OidWeb as OidWeb, __webpack_exports__Primitive as Primitive, __webpack_exports__SliderOid as SliderOid, __webpack_exports__Sphere as Sphere, __webpack_exports__SplitPaneOid as SplitPaneOid, __webpack_exports__SwitchOid as SwitchOid, __webpack_exports__css as css, __webpack_exports__html as html };
/******/