brew-js-react 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,85 +1,85 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
4
- else if(typeof define === 'function' && define.amd)
5
- define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe", "jQuery"], factory);
6
- else if(typeof exports === 'object')
7
- exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
8
- else
9
- root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"], root["jQuery"]);
10
- })(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__, __WEBPACK_EXTERNAL_MODULE__145__) {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 145:
15
- /***/ ((module) => {
16
-
17
- "use strict";
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__145__;
19
-
20
- /***/ }),
21
-
22
- /***/ 715:
23
- /***/ ((module) => {
24
-
25
- "use strict";
26
- if(typeof __WEBPACK_EXTERNAL_MODULE__715__ === 'undefined') { var e = new Error("Cannot find module 'react-dom/client'"); e.code = 'MODULE_NOT_FOUND'; throw e; }
27
-
28
- module.exports = __WEBPACK_EXTERNAL_MODULE__715__;
29
-
30
- /***/ }),
31
-
32
- /***/ 28:
33
- /***/ ((module) => {
34
-
35
- "use strict";
36
- module.exports = __WEBPACK_EXTERNAL_MODULE__28__;
37
-
38
- /***/ }),
39
-
40
- /***/ 103:
41
- /***/ ((module) => {
42
-
43
- "use strict";
44
- module.exports = __WEBPACK_EXTERNAL_MODULE__103__;
45
-
46
- /***/ }),
47
-
48
- /***/ 80:
49
- /***/ ((module) => {
50
-
51
- "use strict";
52
- module.exports = __WEBPACK_EXTERNAL_MODULE__80__;
53
-
54
- /***/ }),
55
-
56
- /***/ 359:
57
- /***/ ((module) => {
58
-
59
- "use strict";
60
- module.exports = __WEBPACK_EXTERNAL_MODULE__359__;
61
-
62
- /***/ }),
63
-
64
- /***/ 318:
65
- /***/ ((module) => {
66
-
67
- "use strict";
68
- module.exports = __WEBPACK_EXTERNAL_MODULE__318__;
69
-
70
- /***/ }),
71
-
72
- /***/ 654:
73
- /***/ ((module) => {
74
-
75
- "use strict";
76
- module.exports = __WEBPACK_EXTERNAL_MODULE__654__;
77
-
78
- /***/ }),
79
-
80
- /***/ 662:
81
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
82
-
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe", "jQuery"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"), require("jQuery"));
8
+ else
9
+ root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"], root["jQuery"]);
10
+ })(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__, __WEBPACK_EXTERNAL_MODULE__145__) {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 145:
15
+ /***/ ((module) => {
16
+
17
+ "use strict";
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__145__;
19
+
20
+ /***/ }),
21
+
22
+ /***/ 715:
23
+ /***/ ((module) => {
24
+
25
+ "use strict";
26
+ if(typeof __WEBPACK_EXTERNAL_MODULE__715__ === 'undefined') { var e = new Error("Cannot find module 'react-dom/client'"); e.code = 'MODULE_NOT_FOUND'; throw e; }
27
+
28
+ module.exports = __WEBPACK_EXTERNAL_MODULE__715__;
29
+
30
+ /***/ }),
31
+
32
+ /***/ 28:
33
+ /***/ ((module) => {
34
+
35
+ "use strict";
36
+ module.exports = __WEBPACK_EXTERNAL_MODULE__28__;
37
+
38
+ /***/ }),
39
+
40
+ /***/ 103:
41
+ /***/ ((module) => {
42
+
43
+ "use strict";
44
+ module.exports = __WEBPACK_EXTERNAL_MODULE__103__;
45
+
46
+ /***/ }),
47
+
48
+ /***/ 80:
49
+ /***/ ((module) => {
50
+
51
+ "use strict";
52
+ module.exports = __WEBPACK_EXTERNAL_MODULE__80__;
53
+
54
+ /***/ }),
55
+
56
+ /***/ 359:
57
+ /***/ ((module) => {
58
+
59
+ "use strict";
60
+ module.exports = __WEBPACK_EXTERNAL_MODULE__359__;
61
+
62
+ /***/ }),
63
+
64
+ /***/ 318:
65
+ /***/ ((module) => {
66
+
67
+ "use strict";
68
+ module.exports = __WEBPACK_EXTERNAL_MODULE__318__;
69
+
70
+ /***/ }),
71
+
72
+ /***/ 654:
73
+ /***/ ((module) => {
74
+
75
+ "use strict";
76
+ module.exports = __WEBPACK_EXTERNAL_MODULE__654__;
77
+
78
+ /***/ }),
79
+
80
+ /***/ 662:
81
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
82
+
83
83
  var React = __webpack_require__(318);
84
84
  var ReactDOMClient;
85
85
  try {
@@ -111,1675 +111,1679 @@ try {
111
111
  }
112
112
  /** @type {import("react-dom/client")} */
113
113
  module.exports = ReactDOMClient;
114
-
115
-
116
- /***/ })
117
-
118
- /******/ });
119
- /************************************************************************/
120
- /******/ // The module cache
121
- /******/ var __webpack_module_cache__ = {};
122
- /******/
123
- /******/ // The require function
124
- /******/ function __webpack_require__(moduleId) {
125
- /******/ // Check if module is in cache
126
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
127
- /******/ if (cachedModule !== undefined) {
128
- /******/ return cachedModule.exports;
129
- /******/ }
130
- /******/ // Create a new module (and put it into the cache)
131
- /******/ var module = __webpack_module_cache__[moduleId] = {
132
- /******/ // no module.id needed
133
- /******/ // no module.loaded needed
134
- /******/ exports: {}
135
- /******/ };
136
- /******/
137
- /******/ // Execute the module function
138
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
139
- /******/
140
- /******/ // Return the exports of the module
141
- /******/ return module.exports;
142
- /******/ }
143
- /******/
144
- /************************************************************************/
145
- /******/ /* webpack/runtime/define property getters */
146
- /******/ (() => {
147
- /******/ // define getter functions for harmony exports
148
- /******/ __webpack_require__.d = (exports, definition) => {
149
- /******/ for(var key in definition) {
150
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
151
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
152
- /******/ }
153
- /******/ }
154
- /******/ };
155
- /******/ })();
156
- /******/
157
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
158
- /******/ (() => {
159
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
160
- /******/ })();
161
- /******/
162
- /******/ /* webpack/runtime/make namespace object */
163
- /******/ (() => {
164
- /******/ // define __esModule on exports
165
- /******/ __webpack_require__.r = (exports) => {
166
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
167
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
168
- /******/ }
169
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
170
- /******/ };
171
- /******/ })();
172
- /******/
173
- /************************************************************************/
174
- var __webpack_exports__ = {};
175
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
176
- (() => {
177
- "use strict";
178
-
179
- // EXPORTS
180
- __webpack_require__.d(__webpack_exports__, {
181
- "default": () => (/* binding */ entry)
182
- });
183
-
184
- // NAMESPACE OBJECT: ./src/index.js
185
- var src_namespaceObject = {};
186
- __webpack_require__.r(src_namespaceObject);
187
- __webpack_require__.d(src_namespaceObject, {
188
- "AnimateMixin": () => (AnimateMixin),
189
- "AnimateSequenceItemMixin": () => (AnimateSequenceItemMixin),
190
- "AnimateSequenceMixin": () => (AnimateSequenceMixin),
191
- "ClassNameMixin": () => (ClassNameMixin),
192
- "Dialog": () => (Dialog),
193
- "FlyoutMixin": () => (FlyoutMixin),
194
- "FlyoutToggleMixin": () => (FlyoutToggleMixin),
195
- "FocusStateMixin": () => (FocusStateMixin),
196
- "LoadingStateMixin": () => (LoadingStateMixin),
197
- "Mixin": () => (Mixin),
198
- "ScrollableMixin": () => (ScrollableMixin),
199
- "StatefulMixin": () => (StatefulMixin),
200
- "ViewStateContainer": () => (ViewStateContainer),
201
- "createDialog": () => (createDialog),
202
- "default": () => (src),
203
- "isViewMatched": () => (isViewMatched),
204
- "linkTo": () => (linkTo),
205
- "makeTranslation": () => (makeTranslation),
206
- "matchView": () => (matchView),
207
- "navigateTo": () => (navigateTo),
208
- "redirectTo": () => (redirectTo),
209
- "registerErrorView": () => (registerErrorView),
210
- "registerView": () => (registerView),
211
- "renderView": () => (renderView),
212
- "useAnimateMixin": () => (useAnimateMixin),
213
- "useAnimateSequenceMixin": () => (useAnimateSequenceMixin),
214
- "useAppReady": () => (useAppReady),
215
- "useFlyoutMixin": () => (useFlyoutMixin),
216
- "useFocusStateMixin": () => (useFocusStateMixin),
217
- "useLanguage": () => (useLanguage),
218
- "useLoadingStateMixin": () => (useLoadingStateMixin),
219
- "useMixin": () => (useMixin),
220
- "useMixinRef": () => (useMixinRef),
221
- "useRouteParam": () => (useRouteParam),
222
- "useRouteState": () => (useRouteState),
223
- "useScrollableMixin": () => (useScrollableMixin),
224
- "useViewContainerState": () => (useViewContainerState)
225
- });
226
-
227
- // EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
228
- var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(80);
229
- ;// CONCATENATED MODULE: ./tmp/brew-js/app.js
230
-
231
- var _defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_;
232
- /* harmony default export */ const app = (_defaultExport);
233
- var install = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install,
234
- addExtension = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addExtension,
235
- addDetect = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addDetect,
236
- isElementActive = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isElementActive;
237
-
238
- ;// CONCATENATED MODULE: ./src/include/brew-js/app.js
239
-
240
-
241
- /* harmony default export */ const brew_js_app = (app);
242
- // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
243
- var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(359);
244
- // EXTERNAL MODULE: external {"commonjs":"react-dom","commonjs2":"react-dom","amd":"react-dom","root":"ReactDOM"}
245
- var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_ = __webpack_require__(318);
246
- // EXTERNAL MODULE: ./node_modules/@misonou/react-dom-client/index.js
247
- var react_dom_client = __webpack_require__(662);
248
- ;// CONCATENATED MODULE: ./src/include/external/react-dom-client.js
249
- // @ts-nocheck
250
-
251
- /** @type {import("react-dom/client")} */
252
-
253
- /* harmony default export */ const external_react_dom_client = (react_dom_client);
254
- // EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
255
- var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(654);
256
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/util.js
257
-
258
- var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
259
- noop = _lib$util.noop,
260
- pipe = _lib$util.pipe,
261
- either = _lib$util.either,
262
- is = _lib$util.is,
263
- isUndefinedOrNull = _lib$util.isUndefinedOrNull,
264
- isArray = _lib$util.isArray,
265
- isFunction = _lib$util.isFunction,
266
- isThenable = _lib$util.isThenable,
267
- isPlainObject = _lib$util.isPlainObject,
268
- isArrayLike = _lib$util.isArrayLike,
269
- makeArray = _lib$util.makeArray,
270
- extend = _lib$util.extend,
271
- each = _lib$util.each,
272
- map = _lib$util.map,
273
- grep = _lib$util.grep,
274
- splice = _lib$util.splice,
275
- any = _lib$util.any,
276
- single = _lib$util.single,
277
- kv = _lib$util.kv,
278
- fill = _lib$util.fill,
279
- pick = _lib$util.pick,
280
- exclude = _lib$util.exclude,
281
- mapObject = _lib$util.mapObject,
282
- mapGet = _lib$util.mapGet,
283
- mapRemove = _lib$util.mapRemove,
284
- arrRemove = _lib$util.arrRemove,
285
- setAdd = _lib$util.setAdd,
286
- equal = _lib$util.equal,
287
- combineFn = _lib$util.combineFn,
288
- executeOnce = _lib$util.executeOnce,
289
- createPrivateStore = _lib$util.createPrivateStore,
290
- util_setTimeout = _lib$util.setTimeout,
291
- setTimeoutOnce = _lib$util.setTimeoutOnce,
292
- util_setInterval = _lib$util.setInterval,
293
- setIntervalSafe = _lib$util.setIntervalSafe,
294
- setImmediate = _lib$util.setImmediate,
295
- setImmediateOnce = _lib$util.setImmediateOnce,
296
- _throws = _lib$util["throws"],
297
- throwNotFunction = _lib$util.throwNotFunction,
298
- errorWithCode = _lib$util.errorWithCode,
299
- isErrorWithCode = _lib$util.isErrorWithCode,
300
- util_keys = _lib$util.keys,
301
- values = _lib$util.values,
302
- util_hasOwnProperty = _lib$util.hasOwnProperty,
303
- getOwnPropertyDescriptors = _lib$util.getOwnPropertyDescriptors,
304
- util_define = _lib$util.define,
305
- definePrototype = _lib$util.definePrototype,
306
- defineOwnProperty = _lib$util.defineOwnProperty,
307
- defineGetterProperty = _lib$util.defineGetterProperty,
308
- defineHiddenProperty = _lib$util.defineHiddenProperty,
309
- defineAliasProperty = _lib$util.defineAliasProperty,
310
- defineObservableProperty = _lib$util.defineObservableProperty,
311
- watch = _lib$util.watch,
312
- watchOnce = _lib$util.watchOnce,
313
- watchable = _lib$util.watchable,
314
- inherit = _lib$util.inherit,
315
- freeze = _lib$util.freeze,
316
- deepFreeze = _lib$util.deepFreeze,
317
- iequal = _lib$util.iequal,
318
- randomId = _lib$util.randomId,
319
- repeat = _lib$util.repeat,
320
- camel = _lib$util.camel,
321
- hyphenate = _lib$util.hyphenate,
322
- ucfirst = _lib$util.ucfirst,
323
- lcfirst = _lib$util.lcfirst,
324
- trim = _lib$util.trim,
325
- matchWord = _lib$util.matchWord,
326
- htmlDecode = _lib$util.htmlDecode,
327
- resolve = _lib$util.resolve,
328
- reject = _lib$util.reject,
329
- always = _lib$util.always,
330
- resolveAll = _lib$util.resolveAll,
331
- retryable = _lib$util.retryable,
332
- deferrable = _lib$util.deferrable,
333
- catchAsync = _lib$util.catchAsync,
334
- setPromiseTimeout = _lib$util.setPromiseTimeout,
335
- delay = _lib$util.delay,
336
- makeAsync = _lib$util.makeAsync;
337
-
338
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/util.js
339
-
340
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/domUtil.js
341
-
342
- var domUtil_lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
343
- domReady = domUtil_lib$util.domReady,
344
- tagName = domUtil_lib$util.tagName,
345
- isVisible = domUtil_lib$util.isVisible,
346
- matchSelector = domUtil_lib$util.matchSelector,
347
- comparePosition = domUtil_lib$util.comparePosition,
348
- connected = domUtil_lib$util.connected,
349
- containsOrEquals = domUtil_lib$util.containsOrEquals,
350
- acceptNode = domUtil_lib$util.acceptNode,
351
- combineNodeFilters = domUtil_lib$util.combineNodeFilters,
352
- iterateNode = domUtil_lib$util.iterateNode,
353
- iterateNodeToArray = domUtil_lib$util.iterateNodeToArray,
354
- getCommonAncestor = domUtil_lib$util.getCommonAncestor,
355
- parentsAndSelf = domUtil_lib$util.parentsAndSelf,
356
- selectIncludeSelf = domUtil_lib$util.selectIncludeSelf,
357
- selectClosestRelative = domUtil_lib$util.selectClosestRelative,
358
- createNodeIterator = domUtil_lib$util.createNodeIterator,
359
- createTreeWalker = domUtil_lib$util.createTreeWalker,
360
- bind = domUtil_lib$util.bind,
361
- bindUntil = domUtil_lib$util.bindUntil,
362
- dispatchDOMMouseEvent = domUtil_lib$util.dispatchDOMMouseEvent,
363
- removeNode = domUtil_lib$util.removeNode,
364
- getClass = domUtil_lib$util.getClass,
365
- setClass = domUtil_lib$util.setClass,
366
- getScrollOffset = domUtil_lib$util.getScrollOffset,
367
- getScrollParent = domUtil_lib$util.getScrollParent,
368
- getContentRect = domUtil_lib$util.getContentRect,
369
- scrollBy = domUtil_lib$util.scrollBy,
370
- scrollIntoView = domUtil_lib$util.scrollIntoView,
371
- makeSelection = domUtil_lib$util.makeSelection,
372
- getRect = domUtil_lib$util.getRect,
373
- getRects = domUtil_lib$util.getRects,
374
- toPlainRect = domUtil_lib$util.toPlainRect,
375
- rectEquals = domUtil_lib$util.rectEquals,
376
- rectCovers = domUtil_lib$util.rectCovers,
377
- rectIntersects = domUtil_lib$util.rectIntersects,
378
- pointInRect = domUtil_lib$util.pointInRect,
379
- mergeRect = domUtil_lib$util.mergeRect,
380
- elementFromPoint = domUtil_lib$util.elementFromPoint;
381
-
382
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/domUtil.js
383
-
384
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/dom.js
385
-
386
- var dom_defaultExport = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
387
- /* harmony default export */ const dom = (dom_defaultExport);
388
- var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
389
- textInputAllowed = _lib$dom.textInputAllowed,
390
- beginDrag = _lib$dom.beginDrag,
391
- beginPinchZoom = _lib$dom.beginPinchZoom,
392
- getShortcut = _lib$dom.getShortcut,
393
- setShortcut = _lib$dom.setShortcut,
394
- focusable = _lib$dom.focusable,
395
- focused = _lib$dom.focused,
396
- setModal = _lib$dom.setModal,
397
- releaseModal = _lib$dom.releaseModal,
398
- retainFocus = _lib$dom.retainFocus,
399
- releaseFocus = _lib$dom.releaseFocus,
400
- iterateFocusPath = _lib$dom.iterateFocusPath,
401
- dom_focus = _lib$dom.focus;
402
-
403
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/dom.js
404
-
405
-
406
- /* harmony default export */ const zeta_dom_dom = (dom);
407
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/domLock.js
408
-
409
- var domLock_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
410
- lock = domLock_lib$dom.lock,
411
- locked = domLock_lib$dom.locked,
412
- cancelLock = domLock_lib$dom.cancelLock,
413
- subscribeAsync = domLock_lib$dom.subscribeAsync,
414
- notifyAsync = domLock_lib$dom.notifyAsync,
415
- preventLeave = domLock_lib$dom.preventLeave;
416
-
417
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/domLock.js
418
-
419
- ;// CONCATENATED MODULE: ./tmp/brew-js/domAction.js
420
-
421
- var addAsyncAction = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAsyncAction,
422
- closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
423
- openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout;
424
-
425
- ;// CONCATENATED MODULE: ./src/include/brew-js/domAction.js
426
-
427
- ;// CONCATENATED MODULE: ./src/dialog.js
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
114
+
115
+
116
+ /***/ })
117
+
118
+ /******/ });
119
+ /************************************************************************/
120
+ /******/ // The module cache
121
+ /******/ var __webpack_module_cache__ = {};
122
+ /******/
123
+ /******/ // The require function
124
+ /******/ function __webpack_require__(moduleId) {
125
+ /******/ // Check if module is in cache
126
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
127
+ /******/ if (cachedModule !== undefined) {
128
+ /******/ return cachedModule.exports;
129
+ /******/ }
130
+ /******/ // Create a new module (and put it into the cache)
131
+ /******/ var module = __webpack_module_cache__[moduleId] = {
132
+ /******/ // no module.id needed
133
+ /******/ // no module.loaded needed
134
+ /******/ exports: {}
135
+ /******/ };
136
+ /******/
137
+ /******/ // Execute the module function
138
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
139
+ /******/
140
+ /******/ // Return the exports of the module
141
+ /******/ return module.exports;
142
+ /******/ }
143
+ /******/
144
+ /************************************************************************/
145
+ /******/ /* webpack/runtime/define property getters */
146
+ /******/ (() => {
147
+ /******/ // define getter functions for harmony exports
148
+ /******/ __webpack_require__.d = (exports, definition) => {
149
+ /******/ for(var key in definition) {
150
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
151
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
152
+ /******/ }
153
+ /******/ }
154
+ /******/ };
155
+ /******/ })();
156
+ /******/
157
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
158
+ /******/ (() => {
159
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
160
+ /******/ })();
161
+ /******/
162
+ /******/ /* webpack/runtime/make namespace object */
163
+ /******/ (() => {
164
+ /******/ // define __esModule on exports
165
+ /******/ __webpack_require__.r = (exports) => {
166
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
167
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
168
+ /******/ }
169
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
170
+ /******/ };
171
+ /******/ })();
172
+ /******/
173
+ /************************************************************************/
174
+ var __webpack_exports__ = {};
175
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
176
+ (() => {
177
+ "use strict";
178
+
179
+ // EXPORTS
180
+ __webpack_require__.d(__webpack_exports__, {
181
+ "default": () => (/* binding */ entry)
182
+ });
183
+
184
+ // NAMESPACE OBJECT: ./src/index.js
185
+ var src_namespaceObject = {};
186
+ __webpack_require__.r(src_namespaceObject);
187
+ __webpack_require__.d(src_namespaceObject, {
188
+ "AnimateMixin": () => (AnimateMixin),
189
+ "AnimateSequenceItemMixin": () => (AnimateSequenceItemMixin),
190
+ "AnimateSequenceMixin": () => (AnimateSequenceMixin),
191
+ "ClassNameMixin": () => (ClassNameMixin),
192
+ "Dialog": () => (Dialog),
193
+ "FlyoutMixin": () => (FlyoutMixin),
194
+ "FlyoutToggleMixin": () => (FlyoutToggleMixin),
195
+ "FocusStateMixin": () => (FocusStateMixin),
196
+ "LoadingStateMixin": () => (LoadingStateMixin),
197
+ "Mixin": () => (Mixin),
198
+ "ScrollableMixin": () => (ScrollableMixin),
199
+ "StatefulMixin": () => (StatefulMixin),
200
+ "ViewStateContainer": () => (ViewStateContainer),
201
+ "createDialog": () => (createDialog),
202
+ "default": () => (src),
203
+ "isViewMatched": () => (isViewMatched),
204
+ "linkTo": () => (linkTo),
205
+ "makeTranslation": () => (makeTranslation),
206
+ "matchView": () => (matchView),
207
+ "navigateTo": () => (navigateTo),
208
+ "redirectTo": () => (redirectTo),
209
+ "registerErrorView": () => (registerErrorView),
210
+ "registerView": () => (registerView),
211
+ "renderView": () => (renderView),
212
+ "useAnimateMixin": () => (useAnimateMixin),
213
+ "useAnimateSequenceMixin": () => (useAnimateSequenceMixin),
214
+ "useAppReady": () => (useAppReady),
215
+ "useFlyoutMixin": () => (useFlyoutMixin),
216
+ "useFocusStateMixin": () => (useFocusStateMixin),
217
+ "useLanguage": () => (useLanguage),
218
+ "useLoadingStateMixin": () => (useLoadingStateMixin),
219
+ "useMixin": () => (useMixin),
220
+ "useMixinRef": () => (useMixinRef),
221
+ "useRouteParam": () => (useRouteParam),
222
+ "useRouteState": () => (useRouteState),
223
+ "useScrollableMixin": () => (useScrollableMixin),
224
+ "useViewContainerState": () => (useViewContainerState)
225
+ });
226
+
227
+ // EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
228
+ var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(80);
229
+ ;// CONCATENATED MODULE: ./tmp/brew-js/app.js
230
+
231
+ var _defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_;
232
+ /* harmony default export */ const app = (_defaultExport);
233
+ var install = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install,
234
+ addExtension = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addExtension,
235
+ addDetect = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addDetect,
236
+ isElementActive = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isElementActive;
237
+
238
+ ;// CONCATENATED MODULE: ./src/include/brew-js/app.js
239
+
240
+
241
+ /* harmony default export */ const brew_js_app = (app);
242
+ // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
243
+ var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(359);
244
+ // EXTERNAL MODULE: external {"commonjs":"react-dom","commonjs2":"react-dom","amd":"react-dom","root":"ReactDOM"}
245
+ var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_ = __webpack_require__(318);
246
+ // EXTERNAL MODULE: ./node_modules/@misonou/react-dom-client/index.js
247
+ var react_dom_client = __webpack_require__(662);
248
+ ;// CONCATENATED MODULE: ./src/include/external/react-dom-client.js
249
+ // @ts-nocheck
250
+
251
+ /** @type {import("react-dom/client")} */
252
+
253
+ /* harmony default export */ const external_react_dom_client = (react_dom_client);
254
+ // EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
255
+ var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(654);
256
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/util.js
257
+
258
+ var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
259
+ noop = _lib$util.noop,
260
+ pipe = _lib$util.pipe,
261
+ either = _lib$util.either,
262
+ is = _lib$util.is,
263
+ isUndefinedOrNull = _lib$util.isUndefinedOrNull,
264
+ isArray = _lib$util.isArray,
265
+ isFunction = _lib$util.isFunction,
266
+ isThenable = _lib$util.isThenable,
267
+ isPlainObject = _lib$util.isPlainObject,
268
+ isArrayLike = _lib$util.isArrayLike,
269
+ makeArray = _lib$util.makeArray,
270
+ extend = _lib$util.extend,
271
+ each = _lib$util.each,
272
+ map = _lib$util.map,
273
+ grep = _lib$util.grep,
274
+ splice = _lib$util.splice,
275
+ any = _lib$util.any,
276
+ single = _lib$util.single,
277
+ kv = _lib$util.kv,
278
+ fill = _lib$util.fill,
279
+ pick = _lib$util.pick,
280
+ exclude = _lib$util.exclude,
281
+ mapObject = _lib$util.mapObject,
282
+ mapGet = _lib$util.mapGet,
283
+ mapRemove = _lib$util.mapRemove,
284
+ arrRemove = _lib$util.arrRemove,
285
+ setAdd = _lib$util.setAdd,
286
+ equal = _lib$util.equal,
287
+ combineFn = _lib$util.combineFn,
288
+ executeOnce = _lib$util.executeOnce,
289
+ createPrivateStore = _lib$util.createPrivateStore,
290
+ util_setTimeout = _lib$util.setTimeout,
291
+ setTimeoutOnce = _lib$util.setTimeoutOnce,
292
+ util_setInterval = _lib$util.setInterval,
293
+ setIntervalSafe = _lib$util.setIntervalSafe,
294
+ setImmediate = _lib$util.setImmediate,
295
+ setImmediateOnce = _lib$util.setImmediateOnce,
296
+ _throws = _lib$util["throws"],
297
+ throwNotFunction = _lib$util.throwNotFunction,
298
+ errorWithCode = _lib$util.errorWithCode,
299
+ isErrorWithCode = _lib$util.isErrorWithCode,
300
+ util_keys = _lib$util.keys,
301
+ values = _lib$util.values,
302
+ util_hasOwnProperty = _lib$util.hasOwnProperty,
303
+ getOwnPropertyDescriptors = _lib$util.getOwnPropertyDescriptors,
304
+ util_define = _lib$util.define,
305
+ definePrototype = _lib$util.definePrototype,
306
+ defineOwnProperty = _lib$util.defineOwnProperty,
307
+ defineGetterProperty = _lib$util.defineGetterProperty,
308
+ defineHiddenProperty = _lib$util.defineHiddenProperty,
309
+ defineAliasProperty = _lib$util.defineAliasProperty,
310
+ defineObservableProperty = _lib$util.defineObservableProperty,
311
+ watch = _lib$util.watch,
312
+ watchOnce = _lib$util.watchOnce,
313
+ watchable = _lib$util.watchable,
314
+ inherit = _lib$util.inherit,
315
+ freeze = _lib$util.freeze,
316
+ deepFreeze = _lib$util.deepFreeze,
317
+ iequal = _lib$util.iequal,
318
+ randomId = _lib$util.randomId,
319
+ repeat = _lib$util.repeat,
320
+ camel = _lib$util.camel,
321
+ hyphenate = _lib$util.hyphenate,
322
+ ucfirst = _lib$util.ucfirst,
323
+ lcfirst = _lib$util.lcfirst,
324
+ trim = _lib$util.trim,
325
+ matchWord = _lib$util.matchWord,
326
+ htmlDecode = _lib$util.htmlDecode,
327
+ resolve = _lib$util.resolve,
328
+ reject = _lib$util.reject,
329
+ always = _lib$util.always,
330
+ resolveAll = _lib$util.resolveAll,
331
+ retryable = _lib$util.retryable,
332
+ deferrable = _lib$util.deferrable,
333
+ catchAsync = _lib$util.catchAsync,
334
+ setPromiseTimeout = _lib$util.setPromiseTimeout,
335
+ delay = _lib$util.delay,
336
+ makeAsync = _lib$util.makeAsync;
337
+
338
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/domUtil.js
339
+
340
+ var domUtil_lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
341
+ domReady = domUtil_lib$util.domReady,
342
+ tagName = domUtil_lib$util.tagName,
343
+ isVisible = domUtil_lib$util.isVisible,
344
+ matchSelector = domUtil_lib$util.matchSelector,
345
+ comparePosition = domUtil_lib$util.comparePosition,
346
+ connected = domUtil_lib$util.connected,
347
+ containsOrEquals = domUtil_lib$util.containsOrEquals,
348
+ acceptNode = domUtil_lib$util.acceptNode,
349
+ combineNodeFilters = domUtil_lib$util.combineNodeFilters,
350
+ iterateNode = domUtil_lib$util.iterateNode,
351
+ iterateNodeToArray = domUtil_lib$util.iterateNodeToArray,
352
+ getCommonAncestor = domUtil_lib$util.getCommonAncestor,
353
+ parentsAndSelf = domUtil_lib$util.parentsAndSelf,
354
+ selectIncludeSelf = domUtil_lib$util.selectIncludeSelf,
355
+ selectClosestRelative = domUtil_lib$util.selectClosestRelative,
356
+ createNodeIterator = domUtil_lib$util.createNodeIterator,
357
+ createTreeWalker = domUtil_lib$util.createTreeWalker,
358
+ bind = domUtil_lib$util.bind,
359
+ bindUntil = domUtil_lib$util.bindUntil,
360
+ dispatchDOMMouseEvent = domUtil_lib$util.dispatchDOMMouseEvent,
361
+ removeNode = domUtil_lib$util.removeNode,
362
+ getClass = domUtil_lib$util.getClass,
363
+ setClass = domUtil_lib$util.setClass,
364
+ getScrollOffset = domUtil_lib$util.getScrollOffset,
365
+ getScrollParent = domUtil_lib$util.getScrollParent,
366
+ getContentRect = domUtil_lib$util.getContentRect,
367
+ scrollBy = domUtil_lib$util.scrollBy,
368
+ scrollIntoView = domUtil_lib$util.scrollIntoView,
369
+ makeSelection = domUtil_lib$util.makeSelection,
370
+ getRect = domUtil_lib$util.getRect,
371
+ getRects = domUtil_lib$util.getRects,
372
+ toPlainRect = domUtil_lib$util.toPlainRect,
373
+ rectEquals = domUtil_lib$util.rectEquals,
374
+ rectCovers = domUtil_lib$util.rectCovers,
375
+ rectIntersects = domUtil_lib$util.rectIntersects,
376
+ pointInRect = domUtil_lib$util.pointInRect,
377
+ mergeRect = domUtil_lib$util.mergeRect,
378
+ elementFromPoint = domUtil_lib$util.elementFromPoint;
379
+
380
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/dom.js
381
+
382
+ var dom_defaultExport = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
383
+ /* harmony default export */ const dom = (dom_defaultExport);
384
+ var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
385
+ textInputAllowed = _lib$dom.textInputAllowed,
386
+ beginDrag = _lib$dom.beginDrag,
387
+ beginPinchZoom = _lib$dom.beginPinchZoom,
388
+ getShortcut = _lib$dom.getShortcut,
389
+ setShortcut = _lib$dom.setShortcut,
390
+ focusable = _lib$dom.focusable,
391
+ focused = _lib$dom.focused,
392
+ setModal = _lib$dom.setModal,
393
+ releaseModal = _lib$dom.releaseModal,
394
+ retainFocus = _lib$dom.retainFocus,
395
+ releaseFocus = _lib$dom.releaseFocus,
396
+ iterateFocusPath = _lib$dom.iterateFocusPath,
397
+ dom_focus = _lib$dom.focus;
398
+
399
+ ;// CONCATENATED MODULE: ./src/include/zeta-dom/dom.js
400
+
401
+
402
+ /* harmony default export */ const zeta_dom_dom = (dom);
403
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/domLock.js
404
+
405
+ var domLock_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
406
+ lock = domLock_lib$dom.lock,
407
+ locked = domLock_lib$dom.locked,
408
+ cancelLock = domLock_lib$dom.cancelLock,
409
+ subscribeAsync = domLock_lib$dom.subscribeAsync,
410
+ notifyAsync = domLock_lib$dom.notifyAsync,
411
+ preventLeave = domLock_lib$dom.preventLeave;
412
+
413
+ ;// CONCATENATED MODULE: ./tmp/brew-js/domAction.js
414
+
415
+ var addAsyncAction = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAsyncAction,
416
+ closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
417
+ openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout;
418
+
419
+ ;// CONCATENATED MODULE: ./src/dialog.js
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
436
428
  /**
437
429
  * @param {Partial<import("./dialog").DialogOptions<any>>} props
438
- */
439
-
440
- function createDialog(props) {
441
- var root = document.createElement('div');
442
- var reactRoot = external_react_dom_client.createRoot(root);
443
-
444
- var _closeDialog = closeFlyout.bind(0, root);
445
-
446
- var promise;
447
- zeta_dom_dom.on(root, 'flyouthide', function () {
448
- removeNode(root);
449
- (props.onClose || noop)(root);
450
-
451
- if (props.onRender) {
452
- reactRoot.unmount();
453
- }
454
- });
455
- return {
456
- root: root,
457
- close: _closeDialog,
458
- open: function open() {
459
- if (promise) {
460
- return promise;
461
- }
462
-
463
- root.className = props.className || '';
464
- document.body.appendChild(root);
465
- zeta_dom_dom.retainFocus(zeta_dom_dom.activeElement, root);
466
-
467
- if (props.modal) {
468
- root.setAttribute('is-modal', '');
469
- zeta_dom_dom.setModal(root);
470
- }
471
-
472
- if (props.onRender) {
473
- var dialogProps = extend({}, props, {
474
- closeDialog: function closeDialog(value) {
475
- var promise = makeAsync(props.onCommit || pipe)(value);
476
- catchAsync(lock(zeta_dom_dom.activeElement, promise));
477
- promise.then(_closeDialog, noop);
478
- }
479
- });
480
- var content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.onRender, dialogProps);
481
-
482
- if (props.wrapper) {
483
- content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.wrapper, dialogProps, content);
484
- }
485
-
486
- reactRoot.render(content);
487
- }
488
-
489
- promise = openFlyout(root);
490
-
491
- if (props.preventLeave) {
492
- preventLeave(root, promise);
493
- } else if (props.preventNavigation) {
494
- lock(root, promise);
495
- }
496
-
497
- always(promise, function () {
498
- promise = null;
499
- });
500
- (props.onOpen || noop)(root);
501
- return promise;
502
- }
503
- };
504
- }
430
+ */
431
+
432
+ function createDialog(props) {
433
+ var root = document.createElement('div');
434
+ var reactRoot = external_react_dom_client.createRoot(root);
435
+
436
+ var _closeDialog = closeFlyout.bind(0, root);
437
+
438
+ var promise;
439
+ zeta_dom_dom.on(root, 'flyouthide', function () {
440
+ removeNode(root);
441
+ (props.onClose || noop)(root);
442
+
443
+ if (props.onRender) {
444
+ reactRoot.unmount();
445
+ }
446
+ });
447
+ return {
448
+ root: root,
449
+ close: _closeDialog,
450
+ open: function open() {
451
+ if (promise) {
452
+ return promise;
453
+ }
454
+
455
+ root.className = props.className || '';
456
+ document.body.appendChild(root);
457
+ zeta_dom_dom.retainFocus(zeta_dom_dom.activeElement, root);
458
+
459
+ if (props.modal) {
460
+ root.setAttribute('is-modal', '');
461
+ zeta_dom_dom.setModal(root);
462
+ }
463
+
464
+ if (props.onRender) {
465
+ var dialogProps = extend({}, props, {
466
+ closeDialog: function closeDialog(value) {
467
+ var promise = makeAsync(props.onCommit || pipe)(value);
468
+ catchAsync(lock(zeta_dom_dom.activeElement, promise));
469
+ promise.then(_closeDialog, noop);
470
+ }
471
+ });
472
+ var content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.onRender, dialogProps);
473
+
474
+ if (props.wrapper) {
475
+ content = /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(props.wrapper, dialogProps, content);
476
+ }
477
+
478
+ reactRoot.render(content);
479
+ }
480
+
481
+ promise = openFlyout(root);
482
+
483
+ if (props.preventLeave) {
484
+ preventLeave(root, promise);
485
+ } else if (props.preventNavigation) {
486
+ lock(root, promise);
487
+ }
488
+
489
+ always(promise, function () {
490
+ promise = null;
491
+ });
492
+ (props.onOpen || noop)(root);
493
+ return promise;
494
+ }
495
+ };
496
+ }
505
497
  /**
506
498
  * @param {import("./dialog").DialogProps} props
507
- */
508
-
509
- function Dialog(props) {
510
- var _props = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)({})[0];
511
- var dialog = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
512
- return createDialog(_props);
513
- })[0];
514
- extend(_props, props);
515
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
516
- var opened = containsOrEquals(zeta_dom_dom.root, dialog.root);
517
-
518
- if (either(opened, _props.isOpen)) {
519
- if (!opened) {
520
- dialog.open();
521
- } else {
522
- dialog.close();
523
- }
524
- }
525
- }, [_props.isOpen]);
526
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
527
- return dialog.close;
528
- }, [dialog]);
529
- return /*#__PURE__*/external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.createPortal(props.children, dialog.root);
530
- }
531
- // EXTERNAL MODULE: external "zeta-dom-react"
532
- var external_zeta_dom_react_ = __webpack_require__(103);
533
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/events.js
534
-
535
- var ZetaEventContainer = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.EventContainer;
536
-
537
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/events.js
538
-
539
- ;// CONCATENATED MODULE: ./tmp/brew-js/defaults.js
540
-
541
- var defaults_defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults;
542
- /* harmony default export */ const defaults = (defaults_defaultExport);
543
- ;// CONCATENATED MODULE: ./src/include/brew-js/defaults.js
544
-
545
- /* harmony default export */ const brew_js_defaults = (defaults);
546
- ;// CONCATENATED MODULE: ./src/app.js
547
-
548
-
549
- /** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
550
-
551
- var app_app;
552
- install('react', function (app_) {
553
- // @ts-ignore: type inference issue
554
- app_app = app_;
555
- });
556
- brew_js_defaults.react = true;
557
- ;// CONCATENATED MODULE: ./tmp/brew-js/anim.js
558
-
559
- var animateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn,
560
- animateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut,
561
- addAnimateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateIn,
562
- addAnimateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateOut;
563
-
564
- ;// CONCATENATED MODULE: ./src/include/brew-js/anim.js
565
-
566
- ;// CONCATENATED MODULE: ./tmp/brew-js/util/path.js
567
-
568
- var setBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.setBaseUrl,
569
- combinePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.combinePath,
570
- normalizePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.normalizePath,
571
- removeQueryAndHash = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.removeQueryAndHash,
572
- withBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.withBaseUrl,
573
- toAbsoluteUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toAbsoluteUrl,
574
- toRelativeUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toRelativeUrl,
575
- isSubPathOf = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isSubPathOf,
576
- toSegments = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toSegments;
577
-
578
- ;// CONCATENATED MODULE: ./src/include/brew-js/util/path.js
579
-
580
- ;// CONCATENATED MODULE: ./src/view.js
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
- var root = zeta_dom_dom.root;
591
- var routeMap = new Map();
592
- var usedParams = {};
593
- var sortedViews = [];
594
- var StateContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createContext(Object.freeze({
595
- container: root,
596
- active: true
597
- }));
598
- var errorView;
599
-
600
- function ErrorBoundary() {
601
- external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
602
- this.state = {};
603
- }
604
-
605
- ErrorBoundary.contextType = StateContext;
606
- definePrototype(ErrorBoundary, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
607
- componentDidCatch: function componentDidCatch(error) {
608
- var self = this;
609
-
610
- if (errorView && !self.state.error) {
611
- self.setState({
612
- error: error
613
- });
614
- } else {
615
- zeta_dom_dom.emit('error', self.context.container, {
616
- error: error
617
- }, true);
618
- }
619
- },
620
- render: function render() {
621
- var self = this;
622
- var props = {
623
- view: self.context.view,
624
- error: self.state.error,
625
- reset: self.reset.bind(self)
626
- };
627
- var onComponentLoaded = self.props.onComponentLoaded;
628
-
629
- if (props.error) {
630
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(errorView, {
631
- onComponentLoaded: onComponentLoaded,
632
- viewProps: props
633
- });
634
- }
635
-
636
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(props.view, {
637
- onComponentLoaded: onComponentLoaded
638
- });
639
- },
640
- reset: function reset() {
641
- this.setState({
642
- error: null
643
- });
644
- }
645
- });
646
-
647
- function ViewContainer() {
648
- external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
649
- this.stateId = history.state;
650
- }
651
-
652
- definePrototype(ViewContainer, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
653
- componentDidMount: function componentDidMount() {
654
- /** @type {any} */
655
- var self = this;
656
- self.componentWillUnmount = combineFn(watch(app_app.route, function () {
657
- self.setActive(self.getViewComponent() === self.currentViewComponent);
658
- }), app_app.on('beforepageload', function (e) {
659
- self.waitFor = e.waitFor;
660
- self.stateId = history.state;
661
- self.forceUpdate();
662
- }));
663
- },
664
- render: function render() {
665
- /** @type {any} */
666
- var self = this;
667
-
668
- if (history.state !== self.stateId) {
669
- return self.lastChild || null;
670
- }
671
-
672
- var V = self.getViewComponent();
673
-
674
- if (V) {
675
- // ensure the current path actually corresponds to the matched view
676
- // when some views are not included in the list of allowed views
677
- var targetPath = linkTo(V, getCurrentParams(V, true));
678
-
679
- if (targetPath !== removeQueryAndHash(app_app.path)) {
680
- app_app.navigate(targetPath, true);
681
- }
682
- }
683
-
684
- if (V && V !== self.currentViewComponent) {
685
- var prevElement = self.currentElement;
686
-
687
- if (prevElement) {
688
- self.setActive(false);
689
- self.prevView = self.currentView;
690
- self.currentElement = undefined;
691
- app_app.emit('pageleave', prevElement, {
692
- pathname: self.currentPath
693
- }, true);
694
- animateOut(prevElement, 'show').then(function () {
695
- self.prevView = undefined;
696
- self.forceUpdate();
697
- });
698
- }
699
-
700
- var onComponentLoaded;
701
- var promise = new Promise(function (resolve) {
702
- onComponentLoaded = resolve;
703
- });
704
- var initElement = executeOnce(function (element) {
705
- self.currentElement = element;
706
- state.container = element;
707
- promise.then(function () {
708
- animateIn(element, 'show');
709
- app_app.emit('pageenter', element, {
710
- pathname: app_app.path
711
- }, true);
712
- });
713
- notifyAsync(element, promise);
714
- });
715
- var state = {
716
- view: V
717
- };
718
- var view = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(StateContext.Provider, {
719
- key: routeMap.get(V).id,
720
- value: state
721
- }, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewStateContainer, null, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement('div', extend({}, self.props.rootProps, {
722
- ref: initElement
723
- }), /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ErrorBoundary, {
724
- onComponentLoaded: onComponentLoaded
725
- }))));
726
- extend(self, {
727
- currentPath: app_app.path,
728
- currentView: view,
729
- currentViewComponent: V,
730
- setActive: defineObservableProperty(state, 'active', true, true)
731
- });
732
- (self.waitFor || noop)(promise);
733
- }
734
-
735
- var child = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, self.prevView, self.currentView);
736
- self.lastChild = child;
737
- return child;
738
- },
739
- getViewComponent: function getViewComponent() {
740
- var props = this.props;
741
- return any(props.views, isViewMatched) || props.defaultView;
742
- }
743
- });
744
-
745
- function getCurrentParams(view, includeAll, params) {
746
- var state = routeMap.get(view);
747
-
748
- if (!state.maxParams) {
749
- var matchers = exclude(state.matchers, ['remainingSegments']);
750
- var matched = map(app_app.routes, function (v) {
751
- var route = app_app.parseRoute(v);
752
- var matched = route.length && !any(matchers, function (v, i) {
753
- var pos = route.params[i];
754
- return (v ? !(pos >= 0) : pos < route.minLength) || !isFunction(v) && !route.match(i, v);
755
- });
756
- return matched ? route : null;
757
- });
758
-
759
- if (matched[1]) {
760
- matched = grep(matched, function (v) {
761
- return !single(v.params, function (v, i) {
762
- return usedParams[i] && !matchers[i];
763
- });
764
- });
765
- }
766
-
767
- if (matched[0]) {
768
- var last = matched.slice(-1)[0];
769
- state.maxParams = util_keys(extend.apply(0, [{
770
- remainingSegments: true
771
- }].concat(matched.map(function (v) {
772
- return v.params;
773
- }))));
774
- state.minParams = map(last.params, function (v, i) {
775
- return state.params[i] || v >= last.minLength ? null : i;
776
- });
777
- }
778
- }
779
-
780
- return pick(params || app_app.route, includeAll ? state.maxParams : state.minParams);
781
- }
782
-
783
- function sortViews(a, b) {
784
- return (routeMap.get(b) || {}).matchCount - (routeMap.get(a) || {}).matchCount;
785
- }
786
-
787
- function matchViewParams(view, route) {
788
- var params = routeMap.get(view);
789
- return !!params && !single(params.matchers, function (v, i) {
790
- var value = route[i] || '';
791
- return isFunction(v) ? !v(value) : (v || '') !== value;
792
- });
793
- }
794
-
795
- function createViewComponent(factory) {
796
- var promise;
797
- throwNotFunction(factory);
798
-
799
- if (factory.prototype instanceof external_commonjs_react_commonjs2_react_amd_react_root_React_.Component) {
800
- factory = external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement.bind(null, factory);
801
- }
802
-
803
- return function (props) {
804
- var viewProps = Object.freeze(props.viewProps || {});
805
- var children = !promise && factory(viewProps);
806
-
807
- if (isThenable(children)) {
808
- promise = children;
809
- children = null;
810
- }
811
-
812
- var state = (0,external_zeta_dom_react_.useAsync)(function () {
813
- return promise.then(function (s) {
814
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(s["default"], viewProps);
815
- });
816
- }, !!promise)[1];
817
-
818
- if (!promise || !state.loading) {
819
- props.onComponentLoaded();
820
-
821
- if (state.error) {
822
- throw state.error;
823
- }
824
- }
825
-
826
- return children || state.value || /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment);
827
- };
828
- }
829
-
830
- function useViewContainerState() {
831
- return external_commonjs_react_commonjs2_react_amd_react_root_React_.useContext(StateContext);
832
- }
833
- function isViewMatched(view) {
834
- return matchViewParams(view, app_app.route);
835
- }
836
- function matchView(path, views) {
837
- var route = app_app.route;
838
-
839
- if (typeof path === 'string') {
840
- route = route.parse(path);
841
- } else {
842
- views = path;
843
- }
844
-
845
- views = views ? makeArray(views).sort(sortViews) : sortedViews;
846
- return any(views, function (v) {
847
- return matchViewParams(v, route);
848
- }) || undefined;
849
- }
850
- function registerView(factory, routeParams) {
851
- var Component = createViewComponent(factory);
852
- routeParams = extend({}, routeParams);
853
- each(routeParams, function (i, v) {
854
- usedParams[i] = true;
855
-
856
- if (v instanceof RegExp) {
857
- routeParams[i] = v.test.bind(v);
858
- }
859
- });
860
- routeMap.set(Component, {
861
- id: randomId(),
862
- matchCount: util_keys(routeParams).length,
863
- matchers: routeParams,
864
- params: pick(routeParams, function (v) {
865
- return isUndefinedOrNull(v) || typeof v === 'string';
866
- })
867
- });
868
- sortedViews.push(Component);
869
- sortedViews.sort(sortViews);
870
- return Component;
871
- }
872
- function registerErrorView(factory) {
873
- errorView = createViewComponent(factory);
874
- }
875
- function renderView() {
876
- var views = makeArray(arguments);
877
- var rootProps = isFunction(views[0]) ? {} : views.shift();
878
- var defaultView = views[0];
879
- views.sort(sortViews);
880
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewContainer, {
881
- rootProps: rootProps,
882
- views: views,
883
- defaultView: defaultView
884
- });
885
- }
886
- function linkTo(view, params) {
887
- var state = routeMap.get(view);
888
-
889
- if (!state) {
890
- return '/';
891
- }
892
-
893
- var newParams = extend(getCurrentParams(view), getCurrentParams(view, true, params || {}), state.params);
894
- return app_app.route.getPath(newParams);
895
- }
896
- function navigateTo(view, params) {
897
- return app_app.navigate(linkTo(view, params));
898
- }
899
- function redirectTo(view, params) {
900
- return app_app.navigate(linkTo(view, params), true);
901
- }
902
- ;// CONCATENATED MODULE: ./src/hooks.js
903
-
904
-
905
-
906
-
907
-
908
-
909
- var emitter = new ZetaEventContainer();
910
- var states = {};
911
-
912
- function getCurrentStates() {
913
- return states[history.state] || (states[history.state] = {});
914
- }
915
-
916
- function ViewState(key, value) {
917
- this.key = key;
918
- this.value = value;
919
- }
920
-
921
- definePrototype(ViewState, {
922
- get: function get() {
923
- return this.value;
924
- },
925
- set: function set(value) {
926
- this.value = value;
927
- },
928
- onPopState: function onPopState(callback) {
929
- throwNotFunction(callback);
930
- return emitter.add(this, 'popstate', function (e) {
931
- callback.call(this, e.newValue);
932
- });
933
- }
934
- });
935
- function useAppReady() {
936
- var sReady = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
937
- var ready = sReady[0],
938
- setReady = sReady[1];
939
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
940
- app_app.ready.then(function () {
941
- setReady(true);
942
- });
943
- }, []);
944
- return ready;
945
- }
946
- function useRouteParam(name, defaultValue) {
947
- var container = useViewContainerState();
948
- var route = app_app.route;
949
- var value = route[name] || '';
950
- var ref = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useRef)(value);
951
- var forceUpdate = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)()[1];
952
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
953
- var setValue = function setValue() {
954
- var current = route[name] || '';
955
-
956
- if (current !== ref.current) {
957
- if (container.active) {
958
- ref.current = current;
959
- forceUpdate({});
960
- } else {
961
- watch(container, 'active', setValue);
962
- }
963
- }
964
- }; // route parameter might be changed after state initialization and before useEffect hook is called
965
-
966
-
967
- setValue();
968
-
969
- if (name in route) {
970
- return route.watch(name, function () {
971
- setImmediateOnce(setValue);
972
- });
973
- }
974
-
975
- console.error('Route parameter ' + name + ' does not exist');
976
- }, [name, defaultValue]);
977
- ref.current = value;
978
-
979
- if (defaultValue !== undefined && (!value || name === 'remainingSegments' && value === '/')) {
980
- app_app.navigate(route.getPath(extend({}, route, kv(name, defaultValue))), true);
981
- }
982
-
983
- return value;
984
- }
985
- function useRouteState(key, defaultValue) {
986
- var container = useViewContainerState();
987
- var cur = getCurrentStates();
988
- var state = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(key in cur ? cur[key] : defaultValue);
989
-
990
- if (container.active) {
991
- cur[key] = state[0];
992
- }
993
-
994
- return state;
995
- }
996
- function ViewStateContainer(props) {
997
- var container = useViewContainerState();
998
- var provider = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
999
- var cache = {};
1000
- return {
1001
- getState: function getState(uniqueId, key) {
1002
- var cur = getCurrentStates();
1003
- var state = cache[uniqueId] || (cache[uniqueId] = new ViewState(key, cur[key] && cur[key].value));
1004
-
1005
- if (container.active) {
1006
- var stateId = state.stateId;
1007
-
1008
- if (stateId && (stateId !== history.state || key !== state.key)) {
1009
- var newValue = cur[key] && cur[key].value;
1010
- emitter.emit('popstate', state, {
1011
- newValue: newValue
1012
- }); // detach value in previous history state from current one
1013
-
1014
- var previous = new ViewState(state.key, state.value);
1015
- states[stateId][previous.key] = previous;
1016
- state.value = newValue;
1017
- state.key = key;
1018
- }
1019
-
1020
- state.stateId = history.state;
1021
- cur[key] = state;
1022
- }
1023
-
1024
- return state;
1025
- }
1026
- };
1027
- })[0];
1028
- return /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(external_zeta_dom_react_.ViewStateProvider, {
1029
- value: provider
1030
- }, props.children);
1031
- }
1032
- // EXTERNAL MODULE: external "waterpipe"
1033
- var external_waterpipe_ = __webpack_require__(28);
1034
- ;// CONCATENATED MODULE: ./src/include/external/waterpipe.js
1035
- // @ts-nocheck
1036
-
1037
- /* harmony default export */ const waterpipe = (external_waterpipe_);
1038
- ;// CONCATENATED MODULE: ./src/i18n.js
1039
-
1040
-
1041
-
1042
-
1043
- var empty = Object.create(null);
1044
- var toPrimitive = typeof Symbol === 'function' && Symbol.toPrimitive;
1045
-
1046
- function TString(toString) {
1047
- this.toString = toString;
1048
- }
1049
-
1050
- if (toPrimitive) {
1051
- TString.prototype[toPrimitive] = function () {
1052
- return this.toString();
1053
- };
1054
- }
1055
-
1056
- function createCallback(translate) {
1057
- var callback = function callback(key, data) {
1058
- var result = translate(key, data, true);
1059
- return result !== undefined ? result : key;
1060
- };
1061
-
1062
- return extend(callback, {
1063
- html: function html(id, data) {
1064
- return {
1065
- __html: translate(id, data)
1066
- };
1067
- },
1068
- lazy: function lazy(id, data) {
1069
- return new TString(translate.bind(0, id, data, true));
1070
- }
1071
- });
1072
- }
1073
-
1074
- function useLanguage() {
1075
- return (0,external_zeta_dom_react_.useObservableProperty)(app_app, 'language');
1076
- }
1077
- function makeTranslation(resources, defaultLang) {
1078
- var re = new RegExp('^(' + Object.keys(resources[defaultLang]).join('|') + ')\\.');
1079
- var cache = {};
1080
-
1081
- function getTranslation(prefix, name, data, noEncode, lang) {
1082
- var str = ((resources[lang] || empty)[prefix] || empty)[name];
1083
-
1084
- if (typeof str === 'string') {
1085
- if (str && (!noEncode || data !== undefined)) {
1086
- return waterpipe(str, data, {
1087
- noEncode: noEncode
1088
- });
1089
- }
1090
-
1091
- return str;
1092
- }
1093
-
1094
- if (lang !== defaultLang) {
1095
- return getTranslation(prefix, name, data, noEncode, defaultLang);
1096
- }
1097
- }
1098
-
1099
- function translate(key, data, noEncode) {
1100
- var prefix = re.test(key) ? RegExp.$1 : '';
1101
- var name = prefix ? key.slice(RegExp.lastMatch.length) : key;
1102
- return getTranslation(prefix, name, data, noEncode, app_app.language);
1103
- }
1104
-
1105
- function getTranslationCallback() {
1106
- var prefix = makeArray(arguments);
1107
- var key = prefix.join(' ');
1108
- return cache[key] || (cache[key] = createCallback(function (key, data, noEncode) {
1109
- var lang = app_app.language;
1110
- return single(prefix, function (v) {
1111
- return getTranslation(v, key, data, noEncode, lang);
1112
- });
1113
- }));
1114
- }
1115
-
1116
- function useTranslation() {
1117
- var language = useLanguage();
1118
- var t = getTranslationCallback.apply(0, arguments);
1119
- return {
1120
- language: language,
1121
- t: t
1122
- };
1123
- }
1124
-
1125
- cache[''] = createCallback(translate);
1126
- return {
1127
- translate: cache[''],
1128
- getTranslation: getTranslationCallback,
1129
- useTranslation: useTranslation,
1130
- keys: function keys(prefix) {
1131
- return util_keys(resources[defaultLang][prefix] || empty);
1132
- }
1133
- };
1134
- }
1135
- ;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
1136
-
1137
-
1138
- function StaticAttributeMixin(attributes) {
1139
- Mixin.call(this);
1140
- this.attributes = attributes || {};
1141
- }
1142
- definePrototype(StaticAttributeMixin, Mixin, {
1143
- getCustomAttributes: function getCustomAttributes() {
1144
- return extend({}, this.attributes);
1145
- }
1146
- });
1147
- ;// CONCATENATED MODULE: ./src/mixins/Mixin.js
1148
-
1149
-
1150
-
1151
- function Mixin() {}
1152
- definePrototype(Mixin, {
1153
- next: function next() {},
1154
- getRef: function getRef() {
1155
- return noop;
1156
- },
1157
- getClassNames: function getClassNames() {
1158
- return [];
1159
- },
1160
- getCustomAttributes: function getCustomAttributes() {
1161
- return {};
1162
- },
1163
- dispose: function dispose() {}
1164
- });
1165
- watchable(Mixin.prototype);
1166
- util_define(Mixin, {
1167
- get scrollableTarget() {
1168
- return new StaticAttributeMixin({
1169
- 'scrollable-target': ''
1170
- });
1171
- },
1172
-
1173
- use: function use() {
1174
- var args = makeArray(arguments);
1175
- var ref = args[0];
1176
- var props = {};
1177
- var mixins = args.filter(function (v) {
1178
- return v instanceof Mixin;
1179
- });
1180
- var refs = mixins.map(function (v) {
1181
- return v.getRef();
1182
- });
1183
-
1184
- if (ref && !(ref instanceof Mixin)) {
1185
- if (typeof ref !== 'function') {
1186
- refs.push(function (v) {
1187
- ref.current = v;
1188
- });
1189
- } else {
1190
- refs.push(ref);
1191
- }
1192
-
1193
- args.shift();
1194
- } else if (!ref) {
1195
- args.shift();
1196
- }
1197
-
1198
- each(mixins, function (i, v) {
1199
- extend(props, v.getCustomAttributes());
1200
- });
1201
- extend(props, {
1202
- ref: combineFn(refs),
1203
- className: external_zeta_dom_react_.classNames.apply(null, args)
1204
- });
1205
- each(mixins, function (i, v) {
1206
- v.next();
1207
- });
1208
- return props;
1209
- }
1210
- });
1211
- ;// CONCATENATED MODULE: ./tmp/zeta-dom/observe.js
1212
-
1213
- var observe_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
1214
- observe = observe_lib$dom.observe,
1215
- registerCleanup = observe_lib$dom.registerCleanup,
1216
- createAutoCleanupMap = observe_lib$dom.createAutoCleanupMap,
1217
- afterDetached = observe_lib$dom.afterDetached,
1218
- watchElements = observe_lib$dom.watchElements,
1219
- watchAttributes = observe_lib$dom.watchAttributes,
1220
- watchOwnAttributes = observe_lib$dom.watchOwnAttributes;
1221
-
1222
- ;// CONCATENATED MODULE: ./src/include/zeta-dom/observe.js
1223
-
1224
- ;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
1225
-
1226
-
1227
-
1228
- var _ = createPrivateStore();
1229
-
1230
- function MixinRefImpl(mixin) {
1231
- this.mixin = mixin;
1232
- }
1233
-
1234
- definePrototype(MixinRefImpl, {
1235
- getMixin: function getMixin() {
1236
- return this.mixin;
1237
- }
1238
- });
1239
- function StatefulMixin() {
1240
- Mixin.call(this);
1241
-
1242
- _(this, {
1243
- elements: new WeakSet(),
1244
- flush: watch(this, false),
1245
- dispose: [],
1246
- states: {},
1247
- prefix: '',
1248
- counter: 0
1249
- });
1250
- }
1251
- definePrototype(StatefulMixin, Mixin, {
1252
- get ref() {
1253
- var self = this;
1254
- var state = self.state;
1255
- self.next();
1256
- return state.ref || (state.ref = new MixinRefImpl(self.clone()));
1257
- },
1258
-
1259
- get state() {
1260
- var obj = _(this);
1261
-
1262
- var key = obj.prefix + obj.counter;
1263
- return obj.states[key] || (obj.states[key] = this.initState());
1264
- },
1265
-
1266
- reset: function reset() {
1267
- _(this).counter = 0;
1268
- return this;
1269
- },
1270
- next: function next() {
1271
- _(this).counter++;
1272
- return this;
1273
- },
1274
- getRef: function getRef() {
1275
- var self = this;
1276
- var state = self.state;
1277
- return function (current) {
1278
- state.element = current;
1279
-
1280
- if (current && setAdd(_(self).elements, current)) {
1281
- self.initElement(current, state);
1282
- }
1283
- };
1284
- },
1285
- elements: function elements() {
1286
- return values(_(this).states).map(function (v) {
1287
- return v.element;
1288
- }).filter(function (v) {
1289
- return v;
1290
- });
1291
- },
1292
- onDispose: function onDispose(callback) {
1293
- _(this).dispose.push(callback);
1294
- },
1295
- initState: function initState() {
1296
- return {
1297
- element: null
1298
- };
1299
- },
1300
- initElement: function initElement(element, state) {},
1301
- clone: function clone() {
1302
- var self = this;
1303
- var clone = inherit(Object.getPrototypeOf(self), self);
1304
-
1305
- _(clone, extend({}, _(self), {
1306
- prefix: randomId() + '.',
1307
- counter: 0
1308
- }));
1309
-
1310
- return clone;
1311
- },
1312
- dispose: function dispose() {
1313
- var state = _(this);
1314
-
1315
- var states = state.states;
1316
- combineFn(state.dispose.splice(0))();
1317
- state.flush();
1318
- each(states, function (i, v) {
1319
- delete states[i];
1320
- });
1321
- }
1322
- });
1323
- ;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
1324
-
1325
-
1326
-
1327
-
1328
-
1329
- var ClassNameMixinSuper = StatefulMixin.prototype;
1330
-
1331
- function checkState(self, element, state, isAsync) {
1332
- var classNames = state.classNames;
1333
- var prev = extend({}, classNames);
1334
- each(self.classNames, function (i, v) {
1335
- classNames[v] = element.classList.contains(v);
1336
- });
1337
-
1338
- if (!equal(prev, classNames)) {
1339
- var cb = self.onClassNameUpdated.bind(self, element, prev, extend({}, classNames));
1340
-
1341
- if (isAsync) {
1342
- setImmediate(cb);
1343
- } else {
1344
- cb();
1345
- }
1346
- }
1347
- }
1348
-
1349
- function ClassNameMixin(classNames) {
1350
- StatefulMixin.call(this);
1351
- this.classNames = classNames || [];
1352
- }
1353
- definePrototype(ClassNameMixin, StatefulMixin, {
1354
- getClassNames: function getClassNames() {
1355
- return [this.state.classNames];
1356
- },
1357
- getRef: function getRef() {
1358
- var self = this;
1359
- var element = self.state.element;
1360
-
1361
- if (element && containsOrEquals(zeta_dom_dom.root, element)) {
1362
- checkState(self, element, self.state, true);
1363
- }
1364
-
1365
- return ClassNameMixinSuper.getRef.call(this);
1366
- },
1367
- initState: function initState() {
1368
- return {
1369
- element: null,
1370
- classNames: {}
1371
- };
1372
- },
1373
- initElement: function initElement(element, state) {
1374
- var self = this;
1375
- watchOwnAttributes(element, 'class', function () {
1376
- checkState(self, element, state);
1377
- });
1378
- },
1379
- onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
1380
- });
1381
- ;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
1382
-
1383
-
1384
- var AnimateMixinSuper = ClassNameMixin.prototype;
1385
- function AnimateMixin() {
1386
- ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1387
- }
1388
- definePrototype(AnimateMixin, ClassNameMixin, {
1389
- next: function next() {
1390
- var self = this;
1391
- self.effects = undefined;
1392
- self.trigger = undefined;
1393
- return AnimateMixinSuper.next.call(self);
1394
- },
1395
- "with": function _with(props) {
1396
- var self = this;
1397
- self.effects = props.effects;
1398
- self.trigger = props.trigger;
1399
- return self;
1400
- },
1401
- withEffects: function withEffects() {
1402
- this.effects = makeArray(arguments);
1403
- return this;
1404
- },
1405
- getCustomAttributes: function getCustomAttributes() {
1406
- var self = this;
1407
- return extend({}, AnimateMixinSuper.getCustomAttributes.call(self), {
1408
- 'animate-in': (self.effects || []).join(' '),
1409
- 'animate-on': self.trigger || 'show'
1410
- });
1411
- }
1412
- });
1413
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
1414
-
1415
-
1416
- var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
1417
- function AnimateSequenceItemMixin(className) {
1418
- ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1419
- this.className = className;
1420
- }
1421
- definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
1422
- getClassNames: function getClassNames() {
1423
- return [this.className].concat(AnimateSequenceItemMixinSuper.getClassNames.call(this));
1424
- }
1425
- });
1426
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
1427
-
1428
-
1429
-
1430
- var AnimateSequenceMixinSuper = AnimateMixin.prototype;
1431
- var animateSequenceMixinCounter = 0;
1432
- function AnimateSequenceMixin() {
1433
- var self = this;
1434
- AnimateMixin.call(self);
1435
- self.className = 'brew-anim-' + ++animateSequenceMixinCounter;
1436
- self.item = new AnimateSequenceItemMixin(self.className);
1437
- }
1438
- definePrototype(AnimateSequenceMixin, AnimateMixin, {
1439
- reset: function reset() {
1440
- this.item.reset();
1441
- return AnimateSequenceMixinSuper.reset.call(this);
1442
- },
1443
- getCustomAttributes: function getCustomAttributes() {
1444
- return extend({}, AnimateSequenceMixinSuper.getCustomAttributes.call(this), {
1445
- 'animate-sequence': '.' + this.className
1446
- });
1447
- },
1448
- clone: function clone() {
1449
- return extend(AnimateSequenceMixinSuper.clone.call(this), {
1450
- item: this.item.ref.getMixin()
1451
- });
1452
- }
1453
- });
1454
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutToggleMixin.js
1455
-
1456
-
1457
- var FlyoutToggleMixinSuper = ClassNameMixin.prototype;
1458
- function FlyoutToggleMixin(mixin) {
1459
- ClassNameMixin.call(this, ['target-opened']);
1460
- this.flyoutMixin = mixin;
1461
- }
1462
- definePrototype(FlyoutToggleMixin, ClassNameMixin, {
1463
- open: function open(value) {
1464
- return this.flyoutMixin.open(value);
1465
- },
1466
- close: function close(value) {
1467
- return this.flyoutMixin.close(value);
1468
- },
1469
- getCustomAttributes: function getCustomAttributes() {
1470
- var element = this.flyoutMixin.elements()[0];
1471
- return extend({}, FlyoutToggleMixinSuper.getCustomAttributes.call(this), {
1472
- 'toggle': element && '#' + element.id
1473
- });
1474
- }
1475
- });
1476
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
1477
-
1478
-
1479
-
1480
-
1481
-
1482
- var FlyoutMixinSuper = ClassNameMixin.prototype;
1483
- var valueMap = new WeakMap();
1484
- var flyoutMixinCounter = 0;
1485
- function FlyoutMixin() {
1486
- var self = this;
1487
- ClassNameMixin.call(self, ['open', 'closing', 'visible', 'tweening-in', 'tweening-out']);
1488
- self.modal = false;
1489
- self.tabThrough = false;
1490
- self.isFlyoutOpened = false;
1491
- self.animating = false;
1492
- self.visible = false;
1493
- self.toggle = new FlyoutToggleMixin(self);
1494
- self.onDispose(function () {
1495
- self.isFlyoutOpened = false;
1496
- self.visible = false;
1497
- });
1498
- }
1499
- definePrototype(FlyoutMixin, ClassNameMixin, {
1500
- reset: function reset() {
1501
- this.toggle.reset();
1502
- return FlyoutMixinSuper.reset.call(this);
1503
- },
1504
- next: function next() {
1505
- this.effects = undefined;
1506
- return FlyoutMixinSuper.next.call(this);
1507
- },
1508
- withEffects: function withEffects() {
1509
- this.effects = makeArray(arguments);
1510
- return this;
1511
- },
1512
- getCustomAttributes: function getCustomAttributes() {
1513
- var self = this;
1514
- return extend({}, FlyoutMixinSuper.getCustomAttributes.call(self), {
1515
- 'is-flyout': '',
1516
- 'swipe-dismiss': self.swipeToDismiss
1517
- }, self.modal && {
1518
- 'is-modal': ''
1519
- }, self.tabThrough && {
1520
- 'tab-through': ''
1521
- }, self.effects && {
1522
- 'animate-on': 'open',
1523
- 'animate-in': self.effects.join(' '),
1524
- 'animate-out': ''
1525
- });
1526
- },
1527
- open: function open(value) {
1528
- var element = this.elements()[0];
1529
- valueMap.set(element, value);
1530
- return openFlyout(element);
1531
- },
1532
- close: function close(value) {
1533
- return closeFlyout(this.elements()[0], value);
1534
- },
1535
- onOpen: function onOpen(callback) {
1536
- var element = this.elements()[0];
1537
- return this.onToggleState(function (opened) {
1538
- if (opened) {
1539
- return callback(valueMap.get(element));
1540
- }
1541
- });
1542
- },
1543
- onToggleState: function onToggleState(callback) {
1544
- return this.watch('isFlyoutOpened', callback);
1545
- },
1546
- onVisibilityChanged: function onVisibilityChanged(callback) {
1547
- return this.watch('visible', callback);
1548
- },
1549
- initElement: function initElement(element, state) {
1550
- var self = this;
1551
- FlyoutMixinSuper.initElement.call(self, element, state);
1552
-
1553
- if (!element.id) {
1554
- element.id = 'flyout-' + ++flyoutMixinCounter;
1555
- }
1556
-
1557
- app_app.on(element, {
1558
- animationstart: function animationstart() {
1559
- self.animating = true;
1560
- },
1561
- animationcomplete: function animationcomplete() {
1562
- self.animating = false;
1563
- }
1564
- }, true);
1565
- setImmediate(function () {
1566
- each(self.toggle.elements(), function (i, v) {
1567
- v.setAttribute('toggle', '#' + element.id);
1568
- });
1569
- });
1570
- },
1571
- clone: function clone() {
1572
- var self = this;
1573
- var mixin = extend(FlyoutMixinSuper.clone.call(self), {
1574
- toggle: self.toggle.ref.getMixin()
1575
- });
1576
- defineAliasProperty(mixin, 'isFlyoutOpened', self);
1577
- defineAliasProperty(mixin, 'modal', self);
1578
- return mixin;
1579
- },
1580
- onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
1581
- var self = this;
1582
- self.visible = state.open;
1583
- self.isFlyoutOpened = state.open && !state.closing && !state['tweening-out'];
1584
- }
1585
- });
1586
- ;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
1587
-
1588
-
1589
-
1590
-
1591
- var FocusStateMixinSuper = StatefulMixin.prototype;
1592
- function FocusStateMixin() {
1593
- StatefulMixin.call(this);
1594
- }
1595
- definePrototype(FocusStateMixin, StatefulMixin, {
1596
- initElement: function initElement(element, state) {
1597
- FocusStateMixinSuper.initElement.call(this, element, state);
1598
- zeta_dom_dom.on(element, {
1599
- focusin: function focusin(e) {
1600
- state.focused = true;
1601
- setClass(element, 'focused', e.source);
1602
- },
1603
- focusout: function focusout() {
1604
- state.focused = false;
1605
- setClass(element, 'focused', false);
1606
- }
1607
- });
1608
- },
1609
- getClassNames: function getClassNames() {
1610
- return [{
1611
- focused: !!this.state.focused
1612
- }];
1613
- }
1614
- });
1615
- ;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
1616
-
1617
-
1618
-
1619
-
1620
-
1621
- var LoadingStateMixinSuper = StatefulMixin.prototype;
1622
- function LoadingStateMixin() {
1623
- StatefulMixin.call(this);
1624
- }
1625
- definePrototype(LoadingStateMixin, StatefulMixin, {
1626
- initElement: function initElement(element, state) {
1627
- LoadingStateMixinSuper.initElement.call(this, element, state);
1628
- lock(element);
1629
- zeta_dom_dom.on(element, {
1630
- asyncStart: function asyncStart() {
1631
- state.loading = true;
1632
- setClass(element, 'loading', true);
1633
- },
1634
- asyncEnd: function asyncEnd() {
1635
- state.loading = false;
1636
- setClass(element, 'loading', false);
1637
- },
1638
- cancelled: function cancelled() {
1639
- state.loading = false;
1640
- setClass(element, 'loading', false);
1641
- }
1642
- });
1643
- },
1644
- getClassNames: function getClassNames() {
1645
- return [{
1646
- loading: !!this.state.loading
1647
- }];
1648
- }
1649
- });
1650
- // EXTERNAL MODULE: external "jQuery"
1651
- var external_jQuery_ = __webpack_require__(145);
1652
- ;// CONCATENATED MODULE: ./src/include/external/jquery.js
1653
- // @ts-nocheck
1654
-
1655
- /* harmony default export */ const jquery = (external_jQuery_);
1656
- ;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
1657
-
1658
-
1659
-
1660
-
1661
-
1662
- var ScrollableMixinSuper = ClassNameMixin.prototype;
1663
- function ScrollableMixin() {
1664
- var self = this;
1665
- ClassNameMixin.call(self, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
1666
- self.target = Mixin.scrollableTarget;
1667
- self.pageIndex = 0;
1668
- self.scrolling = false;
1669
- }
1670
- definePrototype(ScrollableMixin, ClassNameMixin, {
1671
- withOptions: function withOptions(options) {
1672
- this.options = options;
1673
- return this;
1674
- },
1675
- getCustomAttributes: function getCustomAttributes() {
1676
- var options = this.options || {};
1677
- return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
1678
- 'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
1679
- }, options.paged && {
1680
- 'var': '{ pageIndex: 0 }',
1681
- 'scroller-snap-page': options.paged,
1682
- 'scroller-page': options.pagedItemSelector,
1683
- 'scroller-state': 'pageIndex'
1684
- });
1685
- },
1686
- onPageIndexChanged: function onPageIndexChanged(callback) {
1687
- return this.watch('pageIndex', callback);
1688
- },
1689
- initElement: function initElement(element, state) {
1690
- var self = this;
1691
- app_app.on(element, {
1692
- statechange: function statechange(e) {
1693
- if ('pageIndex' in e.newValues) {
1694
- extend(self, {
1695
- pageIndex: e.newValues.pageIndex
1696
- });
1697
- }
1698
- },
1699
- scrollStart: function scrollStart() {
1700
- self.scrolling = true;
1701
- },
1702
- scrollStop: function scrollStop() {
1703
- self.scrolling = false;
1704
- }
1705
- }, true);
1706
- },
1707
- clone: function clone() {
1708
- var mixin = ScrollableMixinSuper.clone.call(this);
1709
- defineAliasProperty(mixin, 'pageIndex', this);
1710
- return mixin;
1711
- }
1712
- });
1713
- each('destroy enable disable setOptions refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
1714
- defineHiddenProperty(ScrollableMixin.prototype, v, function () {
1715
- var obj = jquery(this.elements());
1716
- return obj.scrollable.apply(obj, [v].concat(makeArray(arguments)));
1717
- });
1718
- });
1719
- ;// CONCATENATED MODULE: ./src/mixin.js
1720
-
1721
-
1722
-
1723
-
1724
-
1725
-
1726
-
1727
-
1728
-
1729
-
1730
-
1731
-
1732
-
1733
-
1734
- function extendSelf(options) {
1735
- extend(this, options);
1736
- }
1737
-
1738
- function createUseFunction(ctor) {
1739
- return function () {
1740
- var mixin = useMixin(ctor);
1741
- (mixin.withOptions || extendSelf).apply(mixin, arguments);
1742
- return mixin;
1743
- };
1744
- }
1745
-
1746
- var useAnimateMixin = createUseFunction(AnimateMixin);
1747
- var useAnimateSequenceMixin = createUseFunction(AnimateSequenceMixin);
1748
- var useFlyoutMixin = createUseFunction(FlyoutMixin);
1749
- var useFocusStateMixin = createUseFunction(FocusStateMixin);
1750
- var useLoadingStateMixin = createUseFunction(LoadingStateMixin);
1751
- var useScrollableMixin = createUseFunction(ScrollableMixin);
1752
- function useMixin(ctor) {
1753
- var mixin = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1754
- return new ctor();
1755
- })[0].reset();
1756
- (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
1757
- return mixin.dispose.bind(mixin);
1758
- }, []);
1759
- return mixin;
1760
- }
1761
- function useMixinRef(mixin) {
1762
- return mixin && mixin.getMixin().reset();
1763
- }
1764
-
1765
- ;// CONCATENATED MODULE: ./src/index.js
1766
-
1767
- /* harmony default export */ const src = (brew_js_app);
1768
-
1769
-
1770
-
1771
-
1772
-
1773
- ;// CONCATENATED MODULE: ./src/entry.js
1774
-
1775
- /* harmony default export */ const entry = (src_namespaceObject);
1776
-
1777
- brew_js_app.react = src_namespaceObject;
1778
- })();
1779
-
1780
- __webpack_exports__ = __webpack_exports__["default"];
1781
- /******/ return __webpack_exports__;
1782
- /******/ })()
1783
- ;
1784
- });
499
+ */
500
+
501
+ function Dialog(props) {
502
+ var _props = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)({})[0];
503
+ var dialog = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
504
+ return createDialog(_props);
505
+ })[0];
506
+ extend(_props, props);
507
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
508
+ var opened = containsOrEquals(zeta_dom_dom.root, dialog.root);
509
+
510
+ if (either(opened, _props.isOpen)) {
511
+ if (!opened) {
512
+ dialog.open();
513
+ } else {
514
+ dialog.close();
515
+ }
516
+ }
517
+ }, [_props.isOpen]);
518
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
519
+ return dialog.close;
520
+ }, [dialog]);
521
+ return /*#__PURE__*/external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.createPortal(props.children, dialog.root);
522
+ }
523
+ // EXTERNAL MODULE: external "zeta-dom-react"
524
+ var external_zeta_dom_react_ = __webpack_require__(103);
525
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/events.js
526
+
527
+ var ZetaEventContainer = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.EventContainer;
528
+
529
+ ;// CONCATENATED MODULE: ./tmp/brew-js/defaults.js
530
+
531
+ var defaults_defaultExport = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults;
532
+ /* harmony default export */ const defaults = (defaults_defaultExport);
533
+ ;// CONCATENATED MODULE: ./src/include/brew-js/defaults.js
534
+
535
+ /* harmony default export */ const brew_js_defaults = (defaults);
536
+ ;// CONCATENATED MODULE: ./src/app.js
537
+
538
+
539
+ /** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
540
+
541
+ var app_app;
542
+ install('react', function (app_) {
543
+ // @ts-ignore: type inference issue
544
+ app_app = app_;
545
+ });
546
+ brew_js_defaults.react = true;
547
+ ;// CONCATENATED MODULE: ./tmp/brew-js/anim.js
548
+
549
+ var animateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn,
550
+ animateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut,
551
+ addAnimateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateIn,
552
+ addAnimateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAnimateOut;
553
+
554
+ ;// CONCATENATED MODULE: ./tmp/brew-js/util/path.js
555
+
556
+ var setBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.setBaseUrl,
557
+ combinePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.combinePath,
558
+ parsePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.parsePath,
559
+ normalizePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.normalizePath,
560
+ removeQueryAndHash = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.removeQueryAndHash,
561
+ withBaseUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.withBaseUrl,
562
+ toAbsoluteUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toAbsoluteUrl,
563
+ toRelativeUrl = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toRelativeUrl,
564
+ isSubPathOf = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isSubPathOf,
565
+ toSegments = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toSegments;
566
+
567
+ ;// CONCATENATED MODULE: ./src/view.js
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+ var root = zeta_dom_dom.root;
578
+ var routeMap = new Map();
579
+ var usedParams = {};
580
+ var sortedViews = [];
581
+ var StateContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createContext(Object.freeze({
582
+ container: root,
583
+ active: true
584
+ }));
585
+ var errorView;
586
+
587
+ function ErrorBoundary() {
588
+ external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
589
+ this.state = {};
590
+ }
591
+
592
+ ErrorBoundary.contextType = StateContext;
593
+ definePrototype(ErrorBoundary, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
594
+ componentDidCatch: function componentDidCatch(error) {
595
+ var self = this;
596
+
597
+ if (errorView && !self.state.error) {
598
+ self.setState({
599
+ error: error
600
+ });
601
+ } else {
602
+ // emit error in next tick as ref callback may yet to be invoked
603
+ // if error is thrown synchronously in first render
604
+ setImmediate(function () {
605
+ zeta_dom_dom.emit('error', self.context.container, {
606
+ error: error
607
+ }, true);
608
+ });
609
+ }
610
+ },
611
+ render: function render() {
612
+ var self = this;
613
+ var props = {
614
+ view: self.context.view,
615
+ error: self.state.error,
616
+ reset: self.reset.bind(self)
617
+ };
618
+ var onComponentLoaded = self.props.onComponentLoaded;
619
+
620
+ if (props.error) {
621
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(errorView, {
622
+ onComponentLoaded: onComponentLoaded,
623
+ viewProps: props
624
+ });
625
+ }
626
+
627
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(props.view, {
628
+ onComponentLoaded: onComponentLoaded
629
+ });
630
+ },
631
+ reset: function reset() {
632
+ this.setState({
633
+ error: null
634
+ });
635
+ }
636
+ });
637
+
638
+ function ViewContainer() {
639
+ external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(this, arguments);
640
+ this.stateId = history.state;
641
+ }
642
+
643
+ definePrototype(ViewContainer, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
644
+ componentDidMount: function componentDidMount() {
645
+ /** @type {any} */
646
+ var self = this;
647
+ self.componentWillUnmount = combineFn(watch(app_app.route, function () {
648
+ self.setActive(self.getViewComponent() === self.currentViewComponent);
649
+ }), app_app.on('beforepageload', function (e) {
650
+ self.waitFor = e.waitFor;
651
+ self.stateId = history.state;
652
+ self.forceUpdate();
653
+ }));
654
+ },
655
+ render: function render() {
656
+ /** @type {any} */
657
+ var self = this;
658
+
659
+ if (history.state !== self.stateId) {
660
+ return self.lastChild || null;
661
+ }
662
+
663
+ var V = self.getViewComponent();
664
+
665
+ if (V) {
666
+ // ensure the current path actually corresponds to the matched view
667
+ // when some views are not included in the list of allowed views
668
+ var targetPath = linkTo(V, getCurrentParams(V, true));
669
+
670
+ if (targetPath !== removeQueryAndHash(app_app.path)) {
671
+ app_app.navigate(targetPath, true);
672
+ }
673
+ }
674
+
675
+ if (V && V !== self.currentViewComponent) {
676
+ var prevElement = self.currentElement;
677
+
678
+ if (prevElement) {
679
+ self.setActive(false);
680
+ self.prevView = self.currentView;
681
+ self.currentElement = undefined;
682
+ app_app.emit('pageleave', prevElement, {
683
+ pathname: self.currentPath
684
+ }, true);
685
+ animateOut(prevElement, 'show').then(function () {
686
+ self.prevView = undefined;
687
+ self.forceUpdate();
688
+ });
689
+ }
690
+
691
+ var onComponentLoaded;
692
+ var promise = new Promise(function (resolve) {
693
+ onComponentLoaded = resolve;
694
+ });
695
+ var initElement = executeOnce(function (element) {
696
+ self.currentElement = element;
697
+ state.container = element;
698
+ promise.then(function () {
699
+ animateIn(element, 'show');
700
+ app_app.emit('pageenter', element, {
701
+ pathname: app_app.path
702
+ }, true);
703
+ });
704
+ notifyAsync(element, promise);
705
+ });
706
+ var state = {
707
+ view: V
708
+ };
709
+ var view = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(StateContext.Provider, {
710
+ key: routeMap.get(V).id,
711
+ value: state
712
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewStateContainer, null, /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement('div', extend({}, self.props.rootProps, {
713
+ ref: initElement
714
+ }), /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ErrorBoundary, {
715
+ onComponentLoaded: onComponentLoaded
716
+ }))));
717
+ extend(self, {
718
+ currentPath: app_app.path,
719
+ currentView: view,
720
+ currentViewComponent: V,
721
+ setActive: defineObservableProperty(state, 'active', true, true)
722
+ });
723
+ (self.waitFor || noop)(promise);
724
+ }
725
+
726
+ var child = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, self.prevView, self.currentView);
727
+ self.lastChild = child;
728
+ return child;
729
+ },
730
+ getViewComponent: function getViewComponent() {
731
+ var props = this.props;
732
+ return any(props.views, isViewMatched) || props.defaultView;
733
+ }
734
+ });
735
+
736
+ function getCurrentParams(view, includeAll, params) {
737
+ var state = routeMap.get(view);
738
+
739
+ if (!state.maxParams) {
740
+ var matchers = exclude(state.matchers, ['remainingSegments']);
741
+ var matched = map(app_app.routes, function (v) {
742
+ var route = app_app.parseRoute(v);
743
+ var matched = route.length && !any(matchers, function (v, i) {
744
+ var pos = route.params[i];
745
+ return (v ? !(pos >= 0) : pos < route.minLength) || !isFunction(v) && !route.match(i, v);
746
+ });
747
+ return matched ? route : null;
748
+ });
749
+
750
+ if (matched[1]) {
751
+ matched = grep(matched, function (v) {
752
+ return !single(v.params, function (v, i) {
753
+ return usedParams[i] && !matchers[i];
754
+ });
755
+ });
756
+ }
757
+
758
+ if (matched[0]) {
759
+ var last = matched.slice(-1)[0];
760
+ state.maxParams = util_keys(extend.apply(0, [{
761
+ remainingSegments: true
762
+ }].concat(matched.map(function (v) {
763
+ return v.params;
764
+ }))));
765
+ state.minParams = map(last.params, function (v, i) {
766
+ return state.params[i] || v >= last.minLength ? null : i;
767
+ });
768
+ }
769
+ }
770
+
771
+ return pick(params || app_app.route, includeAll ? state.maxParams : state.minParams);
772
+ }
773
+
774
+ function sortViews(a, b) {
775
+ return (routeMap.get(b) || {}).matchCount - (routeMap.get(a) || {}).matchCount;
776
+ }
777
+
778
+ function matchViewParams(view, route) {
779
+ var params = routeMap.get(view);
780
+ return !!params && !single(params.matchers, function (v, i) {
781
+ var value = route[i] || '';
782
+ return isFunction(v) ? !v(value) : (v || '') !== value;
783
+ });
784
+ }
785
+
786
+ function createViewComponent(factory) {
787
+ var promise;
788
+ throwNotFunction(factory);
789
+
790
+ if (factory.prototype instanceof external_commonjs_react_commonjs2_react_amd_react_root_React_.Component) {
791
+ factory = external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement.bind(null, factory);
792
+ }
793
+
794
+ return function (props) {
795
+ var viewProps = Object.freeze(props.viewProps || {});
796
+ var children = !promise && factory(viewProps);
797
+
798
+ if (isThenable(children)) {
799
+ promise = children;
800
+ children = null;
801
+ }
802
+
803
+ var state = (0,external_zeta_dom_react_.useAsync)(function () {
804
+ return promise.then(function (s) {
805
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(s["default"], viewProps);
806
+ });
807
+ }, !!promise)[1];
808
+
809
+ if (!promise || !state.loading) {
810
+ props.onComponentLoaded();
811
+
812
+ if (state.error) {
813
+ throw state.error;
814
+ }
815
+ }
816
+
817
+ return children || state.value || /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment);
818
+ };
819
+ }
820
+
821
+ function useViewContainerState() {
822
+ return external_commonjs_react_commonjs2_react_amd_react_root_React_.useContext(StateContext);
823
+ }
824
+ function isViewMatched(view) {
825
+ return matchViewParams(view, app_app.route);
826
+ }
827
+ function matchView(path, views) {
828
+ var route = app_app.route;
829
+
830
+ if (typeof path === 'string') {
831
+ route = route.parse(path);
832
+ } else {
833
+ views = path;
834
+ }
835
+
836
+ views = views ? makeArray(views).sort(sortViews) : sortedViews;
837
+ return any(views, function (v) {
838
+ return matchViewParams(v, route);
839
+ }) || undefined;
840
+ }
841
+ function registerView(factory, routeParams) {
842
+ var Component = createViewComponent(factory);
843
+ routeParams = extend({}, routeParams);
844
+ each(routeParams, function (i, v) {
845
+ usedParams[i] = true;
846
+
847
+ if (v instanceof RegExp) {
848
+ routeParams[i] = v.test.bind(v);
849
+ }
850
+ });
851
+ routeMap.set(Component, {
852
+ id: randomId(),
853
+ matchCount: util_keys(routeParams).length,
854
+ matchers: routeParams,
855
+ params: pick(routeParams, function (v) {
856
+ return isUndefinedOrNull(v) || typeof v === 'string';
857
+ })
858
+ });
859
+ sortedViews.push(Component);
860
+ sortedViews.sort(sortViews);
861
+ return Component;
862
+ }
863
+ function registerErrorView(factory) {
864
+ errorView = createViewComponent(factory);
865
+ }
866
+ function renderView() {
867
+ var views = makeArray(arguments);
868
+ var rootProps = isFunction(views[0]) ? {} : views.shift();
869
+ var defaultView = views[0];
870
+ views.sort(sortViews);
871
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewContainer, {
872
+ rootProps: rootProps,
873
+ views: views,
874
+ defaultView: defaultView
875
+ });
876
+ }
877
+ function linkTo(view, params) {
878
+ var state = routeMap.get(view);
879
+
880
+ if (!state) {
881
+ return '/';
882
+ }
883
+
884
+ var newParams = extend(getCurrentParams(view), getCurrentParams(view, true, params || {}), state.params);
885
+ return app_app.route.getPath(newParams);
886
+ }
887
+ function navigateTo(view, params) {
888
+ return app_app.navigate(linkTo(view, params));
889
+ }
890
+ function redirectTo(view, params) {
891
+ return app_app.navigate(linkTo(view, params), true);
892
+ }
893
+ ;// CONCATENATED MODULE: ./src/hooks.js
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+ var emitter = new ZetaEventContainer();
902
+ var states = {};
903
+
904
+ function getCurrentStates() {
905
+ return states[history.state] || (states[history.state] = {});
906
+ }
907
+
908
+ function ViewState(key, value) {
909
+ this.key = key;
910
+ this.value = value;
911
+ }
912
+
913
+ definePrototype(ViewState, {
914
+ get: function get() {
915
+ return this.value;
916
+ },
917
+ set: function set(value) {
918
+ this.value = value;
919
+ },
920
+ onPopState: function onPopState(callback) {
921
+ throwNotFunction(callback);
922
+ return emitter.add(this, 'popstate', function (e) {
923
+ callback.call(this, e.newValue);
924
+ });
925
+ }
926
+ });
927
+ function useAppReady() {
928
+ var sReady = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
929
+ var ready = sReady[0],
930
+ setReady = sReady[1];
931
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
932
+ app_app.ready.then(function () {
933
+ setReady(true);
934
+ });
935
+ }, []);
936
+ return ready;
937
+ }
938
+ function useRouteParam(name, defaultValue) {
939
+ var container = useViewContainerState();
940
+ var route = app_app.route;
941
+ var value = route[name] || '';
942
+ var ref = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useRef)(value);
943
+ var forceUpdate = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)()[1];
944
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
945
+ var setValue = function setValue() {
946
+ var current = route[name] || '';
947
+
948
+ if (current !== ref.current) {
949
+ if (container.active) {
950
+ ref.current = current;
951
+ forceUpdate({});
952
+ } else {
953
+ watch(container, 'active', setValue);
954
+ }
955
+ }
956
+ }; // route parameter might be changed after state initialization and before useEffect hook is called
957
+
958
+
959
+ setValue();
960
+
961
+ if (name in route) {
962
+ return route.watch(name, function () {
963
+ setImmediateOnce(setValue);
964
+ });
965
+ }
966
+
967
+ console.error('Route parameter ' + name + ' does not exist');
968
+ }, [name, defaultValue]);
969
+ ref.current = value;
970
+
971
+ if (defaultValue !== undefined && (!value || name === 'remainingSegments' && value === '/')) {
972
+ app_app.navigate(route.getPath(extend({}, route, kv(name, defaultValue))), true);
973
+ }
974
+
975
+ return value;
976
+ }
977
+ function useRouteState(key, defaultValue, snapshotOnUpdate) {
978
+ var container = useViewContainerState();
979
+ var cur = getCurrentStates();
980
+ var state = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(key in cur ? cur[key] : defaultValue);
981
+
982
+ if (container.active && cur[key] !== state[0]) {
983
+ if (snapshotOnUpdate && key in cur) {
984
+ app_app.snapshot();
985
+ cur = getCurrentStates();
986
+ }
987
+
988
+ cur[key] = state[0];
989
+ }
990
+
991
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
992
+ return bind(window, 'popstate', function () {
993
+ if (snapshotOnUpdate && container.active) {
994
+ var cur = getCurrentStates();
995
+ state[1](key in cur ? cur[key] : defaultValue);
996
+ }
997
+ });
998
+ }, [container, snapshotOnUpdate]);
999
+ return state;
1000
+ }
1001
+ function ViewStateContainer(props) {
1002
+ var container = useViewContainerState();
1003
+ var provider = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1004
+ var cache = {};
1005
+ return {
1006
+ getState: function getState(uniqueId, key) {
1007
+ var cur = getCurrentStates();
1008
+ var state = cache[uniqueId] || (cache[uniqueId] = new ViewState(key, cur[key] && cur[key].value));
1009
+
1010
+ if (container.active) {
1011
+ var stateId = state.stateId;
1012
+
1013
+ if (stateId && (stateId !== history.state || key !== state.key)) {
1014
+ var newValue = cur[key] && cur[key].value;
1015
+ emitter.emit('popstate', state, {
1016
+ newValue: newValue
1017
+ }); // detach value in previous history state from current one
1018
+
1019
+ var previous = new ViewState(state.key, state.value);
1020
+ states[stateId][previous.key] = previous;
1021
+ state.value = newValue;
1022
+ state.key = key;
1023
+ }
1024
+
1025
+ state.stateId = history.state;
1026
+ cur[key] = state;
1027
+ }
1028
+
1029
+ return state;
1030
+ }
1031
+ };
1032
+ })[0];
1033
+ return /*#__PURE__*/(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement)(external_zeta_dom_react_.ViewStateProvider, {
1034
+ value: provider
1035
+ }, props.children);
1036
+ }
1037
+ // EXTERNAL MODULE: external "waterpipe"
1038
+ var external_waterpipe_ = __webpack_require__(28);
1039
+ ;// CONCATENATED MODULE: ./src/include/external/waterpipe.js
1040
+ // @ts-nocheck
1041
+
1042
+ /* harmony default export */ const waterpipe = (external_waterpipe_);
1043
+ ;// CONCATENATED MODULE: ./src/i18n.js
1044
+
1045
+
1046
+
1047
+
1048
+ var empty = Object.create(null);
1049
+ var toPrimitive = typeof Symbol === 'function' && Symbol.toPrimitive;
1050
+
1051
+ function TString(toString) {
1052
+ this.toString = toString;
1053
+ }
1054
+
1055
+ if (toPrimitive) {
1056
+ TString.prototype[toPrimitive] = function () {
1057
+ return this.toString();
1058
+ };
1059
+ }
1060
+
1061
+ function createCallback(translate) {
1062
+ var callback = function callback(key, data) {
1063
+ var result = translate(key, data, true);
1064
+ return result !== undefined ? result : key;
1065
+ };
1066
+
1067
+ return extend(callback, {
1068
+ html: function html(id, data) {
1069
+ return {
1070
+ __html: translate(id, data)
1071
+ };
1072
+ },
1073
+ lazy: function lazy(id, data) {
1074
+ return new TString(translate.bind(0, id, data, true));
1075
+ }
1076
+ });
1077
+ }
1078
+
1079
+ function useLanguage() {
1080
+ return (0,external_zeta_dom_react_.useObservableProperty)(app_app, 'language');
1081
+ }
1082
+ function makeTranslation(resources, defaultLang) {
1083
+ var re = new RegExp('^(' + Object.keys(resources[defaultLang]).join('|') + ')\\.');
1084
+ var cache = {};
1085
+
1086
+ function getTranslation(prefix, name, data, noEncode, lang) {
1087
+ var str = ((resources[lang] || empty)[prefix] || empty)[name];
1088
+
1089
+ if (typeof str === 'string') {
1090
+ if (str && (!noEncode || data !== undefined)) {
1091
+ return waterpipe(str, data, {
1092
+ noEncode: noEncode
1093
+ });
1094
+ }
1095
+
1096
+ return str;
1097
+ }
1098
+
1099
+ if (lang !== defaultLang) {
1100
+ return getTranslation(prefix, name, data, noEncode, defaultLang);
1101
+ }
1102
+ }
1103
+
1104
+ function translate(key, data, noEncode) {
1105
+ var prefix = re.test(key) ? RegExp.$1 : '';
1106
+ var name = prefix ? key.slice(RegExp.lastMatch.length) : key;
1107
+ return getTranslation(prefix, name, data, noEncode, app_app.language);
1108
+ }
1109
+
1110
+ function getTranslationCallback() {
1111
+ var prefix = makeArray(arguments);
1112
+ var key = prefix.join(' ');
1113
+ return cache[key] || (cache[key] = createCallback(function (key, data, noEncode) {
1114
+ var lang = app_app.language;
1115
+ return single(prefix, function (v) {
1116
+ return getTranslation(v, key, data, noEncode, lang);
1117
+ });
1118
+ }));
1119
+ }
1120
+
1121
+ function useTranslation() {
1122
+ var language = useLanguage();
1123
+ var t = getTranslationCallback.apply(0, arguments);
1124
+ return {
1125
+ language: language,
1126
+ t: t
1127
+ };
1128
+ }
1129
+
1130
+ cache[''] = createCallback(translate);
1131
+ return {
1132
+ translate: cache[''],
1133
+ getTranslation: getTranslationCallback,
1134
+ useTranslation: useTranslation,
1135
+ keys: function keys(prefix) {
1136
+ return util_keys(resources[defaultLang][prefix] || empty);
1137
+ }
1138
+ };
1139
+ }
1140
+ ;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
1141
+
1142
+
1143
+ function StaticAttributeMixin(attributes) {
1144
+ Mixin.call(this);
1145
+ this.attributes = attributes || {};
1146
+ }
1147
+ definePrototype(StaticAttributeMixin, Mixin, {
1148
+ getCustomAttributes: function getCustomAttributes() {
1149
+ return extend({}, this.attributes);
1150
+ }
1151
+ });
1152
+ ;// CONCATENATED MODULE: ./src/mixins/Mixin.js
1153
+
1154
+
1155
+
1156
+ function Mixin() {}
1157
+ definePrototype(Mixin, {
1158
+ next: function next() {},
1159
+ getRef: function getRef() {
1160
+ return noop;
1161
+ },
1162
+ getClassNames: function getClassNames() {
1163
+ return [];
1164
+ },
1165
+ getCustomAttributes: function getCustomAttributes() {
1166
+ return {};
1167
+ },
1168
+ dispose: function dispose() {}
1169
+ });
1170
+ watchable(Mixin.prototype);
1171
+ util_define(Mixin, {
1172
+ get scrollableTarget() {
1173
+ return new StaticAttributeMixin({
1174
+ 'scrollable-target': ''
1175
+ });
1176
+ },
1177
+
1178
+ use: function use() {
1179
+ var args = makeArray(arguments);
1180
+ var ref = args[0];
1181
+ var props = {};
1182
+ var mixins = args.filter(function (v) {
1183
+ return v instanceof Mixin;
1184
+ });
1185
+ var refs = mixins.map(function (v) {
1186
+ return v.getRef();
1187
+ });
1188
+
1189
+ if (ref && !(ref instanceof Mixin)) {
1190
+ if (typeof ref !== 'function') {
1191
+ refs.push(function (v) {
1192
+ ref.current = v;
1193
+ });
1194
+ } else {
1195
+ refs.push(ref);
1196
+ }
1197
+
1198
+ args.shift();
1199
+ } else if (!ref) {
1200
+ args.shift();
1201
+ }
1202
+
1203
+ each(mixins, function (i, v) {
1204
+ extend(props, v.getCustomAttributes());
1205
+ });
1206
+ extend(props, {
1207
+ ref: combineFn(refs),
1208
+ className: external_zeta_dom_react_.classNames.apply(null, args)
1209
+ });
1210
+ each(mixins, function (i, v) {
1211
+ v.next();
1212
+ });
1213
+ return props;
1214
+ }
1215
+ });
1216
+ ;// CONCATENATED MODULE: ./tmp/zeta-dom/observe.js
1217
+
1218
+ var observe_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
1219
+ observe = observe_lib$dom.observe,
1220
+ registerCleanup = observe_lib$dom.registerCleanup,
1221
+ createAutoCleanupMap = observe_lib$dom.createAutoCleanupMap,
1222
+ afterDetached = observe_lib$dom.afterDetached,
1223
+ watchElements = observe_lib$dom.watchElements,
1224
+ watchAttributes = observe_lib$dom.watchAttributes,
1225
+ watchOwnAttributes = observe_lib$dom.watchOwnAttributes;
1226
+
1227
+ ;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
1228
+
1229
+
1230
+
1231
+ var _ = createPrivateStore();
1232
+
1233
+ function MixinRefImpl(mixin) {
1234
+ this.mixin = mixin;
1235
+ }
1236
+
1237
+ definePrototype(MixinRefImpl, {
1238
+ getMixin: function getMixin() {
1239
+ return this.mixin;
1240
+ }
1241
+ });
1242
+ function StatefulMixin() {
1243
+ Mixin.call(this);
1244
+
1245
+ _(this, {
1246
+ elements: new Set(),
1247
+ flush: watch(this, false),
1248
+ dispose: [],
1249
+ states: {},
1250
+ prefix: '',
1251
+ counter: 0
1252
+ });
1253
+ }
1254
+ definePrototype(StatefulMixin, Mixin, {
1255
+ get ref() {
1256
+ var self = this;
1257
+ var state = self.state;
1258
+ self.next();
1259
+ return state.ref || (state.ref = new MixinRefImpl(self.clone()));
1260
+ },
1261
+
1262
+ get state() {
1263
+ var obj = _(this);
1264
+
1265
+ var key = obj.prefix + obj.counter;
1266
+ return obj.states[key] || (obj.states[key] = this.initState());
1267
+ },
1268
+
1269
+ reset: function reset() {
1270
+ _(this).counter = 0;
1271
+ return this;
1272
+ },
1273
+ next: function next() {
1274
+ _(this).counter++;
1275
+ return this;
1276
+ },
1277
+ getRef: function getRef() {
1278
+ var self = this;
1279
+ var state = self.state;
1280
+ return function (current) {
1281
+ state.element = current;
1282
+
1283
+ if (current && setAdd(_(self).elements, current)) {
1284
+ self.initElement(current, state);
1285
+ }
1286
+ };
1287
+ },
1288
+ elements: function elements() {
1289
+ return values(_(this).states).map(function (v) {
1290
+ return v.element;
1291
+ }).filter(function (v) {
1292
+ return v;
1293
+ });
1294
+ },
1295
+ onDispose: function onDispose(callback) {
1296
+ _(this).dispose.push(callback);
1297
+ },
1298
+ initState: function initState() {
1299
+ return {
1300
+ element: null
1301
+ };
1302
+ },
1303
+ initElement: function initElement(element, state) {},
1304
+ clone: function clone() {
1305
+ var self = this;
1306
+ var clone = inherit(Object.getPrototypeOf(self), self);
1307
+
1308
+ _(clone, extend({}, _(self), {
1309
+ prefix: randomId() + '.',
1310
+ counter: 0
1311
+ }));
1312
+
1313
+ return clone;
1314
+ },
1315
+ dispose: function dispose() {
1316
+ var state = _(this);
1317
+
1318
+ var states = state.states;
1319
+ combineFn(state.dispose.splice(0))();
1320
+ state.flush();
1321
+ state.elements.clear();
1322
+ each(states, function (i, v) {
1323
+ delete states[i];
1324
+ });
1325
+ }
1326
+ });
1327
+ ;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+ var ClassNameMixinSuper = StatefulMixin.prototype;
1334
+
1335
+ function checkState(self, element, state, isAsync) {
1336
+ var classNames = state.classNames;
1337
+ var prev = extend({}, classNames);
1338
+ each(self.classNames, function (i, v) {
1339
+ classNames[v] = element.classList.contains(v);
1340
+ });
1341
+
1342
+ if (!equal(prev, classNames)) {
1343
+ var cb = self.onClassNameUpdated.bind(self, element, prev, extend({}, classNames));
1344
+
1345
+ if (isAsync) {
1346
+ setImmediate(cb);
1347
+ } else {
1348
+ cb();
1349
+ }
1350
+ }
1351
+ }
1352
+
1353
+ function ClassNameMixin(classNames) {
1354
+ StatefulMixin.call(this);
1355
+ this.classNames = classNames || [];
1356
+ }
1357
+ definePrototype(ClassNameMixin, StatefulMixin, {
1358
+ getClassNames: function getClassNames() {
1359
+ return [this.state.classNames];
1360
+ },
1361
+ getRef: function getRef() {
1362
+ var self = this;
1363
+ var element = self.state.element;
1364
+
1365
+ if (element && containsOrEquals(zeta_dom_dom.root, element)) {
1366
+ checkState(self, element, self.state, true);
1367
+ }
1368
+
1369
+ return ClassNameMixinSuper.getRef.call(this);
1370
+ },
1371
+ initState: function initState() {
1372
+ return {
1373
+ element: null,
1374
+ classNames: {}
1375
+ };
1376
+ },
1377
+ initElement: function initElement(element, state) {
1378
+ var self = this;
1379
+ watchOwnAttributes(element, 'class', function () {
1380
+ checkState(self, element, state);
1381
+ });
1382
+ },
1383
+ onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
1384
+ });
1385
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
1386
+
1387
+
1388
+ var AnimateMixinSuper = ClassNameMixin.prototype;
1389
+ function AnimateMixin() {
1390
+ ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1391
+ }
1392
+ definePrototype(AnimateMixin, ClassNameMixin, {
1393
+ next: function next() {
1394
+ var self = this;
1395
+ self.effects = undefined;
1396
+ self.trigger = undefined;
1397
+ return AnimateMixinSuper.next.call(self);
1398
+ },
1399
+ "with": function _with(props) {
1400
+ var self = this;
1401
+ self.effects = props.effects;
1402
+ self.trigger = props.trigger;
1403
+ return self;
1404
+ },
1405
+ withEffects: function withEffects() {
1406
+ this.effects = makeArray(arguments);
1407
+ return this;
1408
+ },
1409
+ getCustomAttributes: function getCustomAttributes() {
1410
+ var self = this;
1411
+ return extend({}, AnimateMixinSuper.getCustomAttributes.call(self), {
1412
+ 'animate-in': (self.effects || []).join(' '),
1413
+ 'animate-on': self.trigger || 'show'
1414
+ });
1415
+ }
1416
+ });
1417
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
1418
+
1419
+
1420
+ var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
1421
+ function AnimateSequenceItemMixin(className) {
1422
+ ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
1423
+ this.className = className;
1424
+ }
1425
+ definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
1426
+ getClassNames: function getClassNames() {
1427
+ return [this.className].concat(AnimateSequenceItemMixinSuper.getClassNames.call(this));
1428
+ }
1429
+ });
1430
+ ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
1431
+
1432
+
1433
+
1434
+ var AnimateSequenceMixinSuper = AnimateMixin.prototype;
1435
+ var animateSequenceMixinCounter = 0;
1436
+ function AnimateSequenceMixin() {
1437
+ var self = this;
1438
+ AnimateMixin.call(self);
1439
+ self.className = 'brew-anim-' + ++animateSequenceMixinCounter;
1440
+ self.item = new AnimateSequenceItemMixin(self.className);
1441
+ }
1442
+ definePrototype(AnimateSequenceMixin, AnimateMixin, {
1443
+ reset: function reset() {
1444
+ this.item.reset();
1445
+ return AnimateSequenceMixinSuper.reset.call(this);
1446
+ },
1447
+ getCustomAttributes: function getCustomAttributes() {
1448
+ return extend({}, AnimateSequenceMixinSuper.getCustomAttributes.call(this), {
1449
+ 'animate-sequence': '.' + this.className
1450
+ });
1451
+ },
1452
+ clone: function clone() {
1453
+ return extend(AnimateSequenceMixinSuper.clone.call(this), {
1454
+ item: this.item.ref.getMixin()
1455
+ });
1456
+ }
1457
+ });
1458
+ ;// CONCATENATED MODULE: ./src/mixins/FlyoutToggleMixin.js
1459
+
1460
+
1461
+ var FlyoutToggleMixinSuper = ClassNameMixin.prototype;
1462
+ function FlyoutToggleMixin(mixin) {
1463
+ ClassNameMixin.call(this, ['target-opened']);
1464
+ this.flyoutMixin = mixin;
1465
+ }
1466
+ definePrototype(FlyoutToggleMixin, ClassNameMixin, {
1467
+ open: function open(value) {
1468
+ return this.flyoutMixin.open(value);
1469
+ },
1470
+ close: function close(value) {
1471
+ return this.flyoutMixin.close(value);
1472
+ },
1473
+ getCustomAttributes: function getCustomAttributes() {
1474
+ var element = this.flyoutMixin.elements()[0];
1475
+ return extend({}, FlyoutToggleMixinSuper.getCustomAttributes.call(this), {
1476
+ 'toggle': element && '#' + element.id
1477
+ });
1478
+ }
1479
+ });
1480
+ ;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+ var FlyoutMixinSuper = ClassNameMixin.prototype;
1487
+ var valueMap = new WeakMap();
1488
+ var flyoutMixinCounter = 0;
1489
+ function FlyoutMixin() {
1490
+ var self = this;
1491
+ ClassNameMixin.call(self, ['open', 'closing', 'visible', 'tweening-in', 'tweening-out']);
1492
+ self.modal = false;
1493
+ self.tabThrough = false;
1494
+ self.isFlyoutOpened = false;
1495
+ self.animating = false;
1496
+ self.visible = false;
1497
+ self.toggle = new FlyoutToggleMixin(self);
1498
+ self.onDispose(function () {
1499
+ self.isFlyoutOpened = false;
1500
+ self.visible = false;
1501
+ });
1502
+ }
1503
+ definePrototype(FlyoutMixin, ClassNameMixin, {
1504
+ reset: function reset() {
1505
+ this.toggle.reset();
1506
+ return FlyoutMixinSuper.reset.call(this);
1507
+ },
1508
+ next: function next() {
1509
+ this.effects = undefined;
1510
+ return FlyoutMixinSuper.next.call(this);
1511
+ },
1512
+ withEffects: function withEffects() {
1513
+ this.effects = makeArray(arguments);
1514
+ return this;
1515
+ },
1516
+ getCustomAttributes: function getCustomAttributes() {
1517
+ var self = this;
1518
+ return extend({}, FlyoutMixinSuper.getCustomAttributes.call(self), {
1519
+ 'is-flyout': '',
1520
+ 'swipe-dismiss': self.swipeToDismiss
1521
+ }, self.modal && {
1522
+ 'is-modal': ''
1523
+ }, self.tabThrough && {
1524
+ 'tab-through': ''
1525
+ }, self.effects && {
1526
+ 'animate-on': 'open',
1527
+ 'animate-in': self.effects.join(' '),
1528
+ 'animate-out': ''
1529
+ });
1530
+ },
1531
+ open: function open(value) {
1532
+ var element = this.elements()[0];
1533
+ valueMap.set(element, value);
1534
+ return openFlyout(element);
1535
+ },
1536
+ close: function close(value) {
1537
+ return closeFlyout(this.elements()[0], value);
1538
+ },
1539
+ onOpen: function onOpen(callback) {
1540
+ var element = this.elements()[0];
1541
+ return this.onToggleState(function (opened) {
1542
+ if (opened) {
1543
+ return callback(valueMap.get(element));
1544
+ }
1545
+ });
1546
+ },
1547
+ onToggleState: function onToggleState(callback) {
1548
+ return this.watch('isFlyoutOpened', callback);
1549
+ },
1550
+ onVisibilityChanged: function onVisibilityChanged(callback) {
1551
+ return this.watch('visible', callback);
1552
+ },
1553
+ initElement: function initElement(element, state) {
1554
+ var self = this;
1555
+ FlyoutMixinSuper.initElement.call(self, element, state);
1556
+
1557
+ if (!element.id) {
1558
+ element.id = 'flyout-' + ++flyoutMixinCounter;
1559
+ }
1560
+
1561
+ self.onDispose(app_app.on(element, {
1562
+ animationstart: function animationstart() {
1563
+ self.animating = true;
1564
+ },
1565
+ animationcomplete: function animationcomplete() {
1566
+ self.animating = false;
1567
+ }
1568
+ }, true));
1569
+ setImmediate(function () {
1570
+ each(self.toggle.elements(), function (i, v) {
1571
+ v.setAttribute('toggle', '#' + element.id);
1572
+ });
1573
+ });
1574
+ },
1575
+ clone: function clone() {
1576
+ var self = this;
1577
+ var mixin = extend(FlyoutMixinSuper.clone.call(self), {
1578
+ toggle: self.toggle.ref.getMixin()
1579
+ });
1580
+ defineAliasProperty(mixin, 'isFlyoutOpened', self);
1581
+ defineAliasProperty(mixin, 'modal', self);
1582
+ return mixin;
1583
+ },
1584
+ onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
1585
+ var self = this;
1586
+ self.visible = state.open;
1587
+ self.isFlyoutOpened = state.open && !state.closing && !state['tweening-out'];
1588
+ }
1589
+ });
1590
+ ;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
1591
+
1592
+
1593
+
1594
+
1595
+ var FocusStateMixinSuper = StatefulMixin.prototype;
1596
+ function FocusStateMixin() {
1597
+ StatefulMixin.call(this);
1598
+ }
1599
+ definePrototype(FocusStateMixin, StatefulMixin, {
1600
+ initElement: function initElement(element, state) {
1601
+ FocusStateMixinSuper.initElement.call(this, element, state);
1602
+ this.onDispose(zeta_dom_dom.on(element, {
1603
+ focusin: function focusin(e) {
1604
+ state.focused = true;
1605
+ setClass(element, 'focused', e.source);
1606
+ },
1607
+ focusout: function focusout() {
1608
+ state.focused = false;
1609
+ setClass(element, 'focused', false);
1610
+ }
1611
+ }));
1612
+ },
1613
+ getClassNames: function getClassNames() {
1614
+ return [{
1615
+ focused: !!this.state.focused
1616
+ }];
1617
+ }
1618
+ });
1619
+ ;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+ var LoadingStateMixinSuper = StatefulMixin.prototype;
1626
+ function LoadingStateMixin() {
1627
+ StatefulMixin.call(this);
1628
+ }
1629
+ definePrototype(LoadingStateMixin, StatefulMixin, {
1630
+ initElement: function initElement(element, state) {
1631
+ LoadingStateMixinSuper.initElement.call(this, element, state);
1632
+ lock(element);
1633
+ this.onDispose(zeta_dom_dom.on(element, {
1634
+ asyncStart: function asyncStart() {
1635
+ state.loading = true;
1636
+ setClass(element, 'loading', true);
1637
+ },
1638
+ asyncEnd: function asyncEnd() {
1639
+ state.loading = false;
1640
+ setClass(element, 'loading', false);
1641
+ },
1642
+ cancelled: function cancelled() {
1643
+ state.loading = false;
1644
+ setClass(element, 'loading', false);
1645
+ }
1646
+ }));
1647
+ },
1648
+ getClassNames: function getClassNames() {
1649
+ return [{
1650
+ loading: !!this.state.loading
1651
+ }];
1652
+ }
1653
+ });
1654
+ // EXTERNAL MODULE: external "jQuery"
1655
+ var external_jQuery_ = __webpack_require__(145);
1656
+ ;// CONCATENATED MODULE: ./src/include/external/jquery.js
1657
+ // @ts-nocheck
1658
+
1659
+ /* harmony default export */ const jquery = (external_jQuery_);
1660
+ ;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+ var ScrollableMixinSuper = ClassNameMixin.prototype;
1667
+ function ScrollableMixin() {
1668
+ var self = this;
1669
+ ClassNameMixin.call(self, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
1670
+ self.target = Mixin.scrollableTarget;
1671
+ self.pageIndex = 0;
1672
+ self.scrolling = false;
1673
+ }
1674
+ definePrototype(ScrollableMixin, ClassNameMixin, {
1675
+ withOptions: function withOptions(options) {
1676
+ this.options = options;
1677
+ return this;
1678
+ },
1679
+ getCustomAttributes: function getCustomAttributes() {
1680
+ var options = this.options || {};
1681
+ return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
1682
+ 'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
1683
+ }, options.paged && {
1684
+ 'var': '{ pageIndex: 0 }',
1685
+ 'scroller-snap-page': options.paged,
1686
+ 'scroller-page': options.pagedItemSelector,
1687
+ 'scroller-state': 'pageIndex'
1688
+ });
1689
+ },
1690
+ onPageIndexChanged: function onPageIndexChanged(callback) {
1691
+ return this.watch('pageIndex', callback);
1692
+ },
1693
+ initElement: function initElement(element, state) {
1694
+ var self = this;
1695
+ self.onDispose(app_app.on(element, {
1696
+ statechange: function statechange(e) {
1697
+ if ('pageIndex' in e.newValues) {
1698
+ extend(self, {
1699
+ pageIndex: e.newValues.pageIndex
1700
+ });
1701
+ }
1702
+ },
1703
+ scrollStart: function scrollStart() {
1704
+ self.scrolling = true;
1705
+ },
1706
+ scrollStop: function scrollStop() {
1707
+ self.scrolling = false;
1708
+ }
1709
+ }, true));
1710
+ },
1711
+ clone: function clone() {
1712
+ var mixin = ScrollableMixinSuper.clone.call(this);
1713
+ defineAliasProperty(mixin, 'pageIndex', this);
1714
+ return mixin;
1715
+ }
1716
+ });
1717
+ each('destroy enable disable setOptions refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
1718
+ defineHiddenProperty(ScrollableMixin.prototype, v, function () {
1719
+ var obj = jquery(this.elements());
1720
+ return obj.scrollable.apply(obj, [v].concat(makeArray(arguments)));
1721
+ });
1722
+ });
1723
+ ;// CONCATENATED MODULE: ./src/mixin.js
1724
+
1725
+
1726
+
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+
1733
+
1734
+
1735
+
1736
+
1737
+
1738
+ function extendSelf(options) {
1739
+ extend(this, options);
1740
+ }
1741
+
1742
+ function createUseFunction(ctor) {
1743
+ return function () {
1744
+ var mixin = useMixin(ctor);
1745
+ (mixin.withOptions || extendSelf).apply(mixin, arguments);
1746
+ return mixin;
1747
+ };
1748
+ }
1749
+
1750
+ var useAnimateMixin = createUseFunction(AnimateMixin);
1751
+ var useAnimateSequenceMixin = createUseFunction(AnimateSequenceMixin);
1752
+ var useFlyoutMixin = createUseFunction(FlyoutMixin);
1753
+ var useFocusStateMixin = createUseFunction(FocusStateMixin);
1754
+ var useLoadingStateMixin = createUseFunction(LoadingStateMixin);
1755
+ var useScrollableMixin = createUseFunction(ScrollableMixin);
1756
+ function useMixin(ctor) {
1757
+ var mixin = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
1758
+ return new ctor();
1759
+ })[0].reset();
1760
+ (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
1761
+ return mixin.dispose.bind(mixin);
1762
+ }, []);
1763
+ return mixin;
1764
+ }
1765
+ function useMixinRef(mixin) {
1766
+ return mixin && mixin.getMixin().reset();
1767
+ }
1768
+
1769
+ ;// CONCATENATED MODULE: ./src/index.js
1770
+
1771
+ /* harmony default export */ const src = (brew_js_app);
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+ ;// CONCATENATED MODULE: ./src/entry.js
1778
+
1779
+ /* harmony default export */ const entry = (src_namespaceObject);
1780
+
1781
+ brew_js_app.react = src_namespaceObject;
1782
+ })();
1783
+
1784
+ __webpack_exports__ = __webpack_exports__["default"];
1785
+ /******/ return __webpack_exports__;
1786
+ /******/ })()
1787
+ ;
1788
+ });
1785
1789
  //# sourceMappingURL=brew-js-react.js.map