/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@riotjs/observable/dist/observable.js": /*!************************************************************!*\ !*** ./node_modules/@riotjs/observable/dist/observable.js ***! \************************************************************/ /***/ ((module) => { ;(function(window, undefined) {const ALL_CALLBACKS = '*' const define = Object.defineProperties const entries = Object.entries const on = (callbacks, el) => (event, fn) => { if (callbacks.has(event)) { callbacks.get(event).add(fn) } else { callbacks.set(event, new Set().add(fn)) } return el } const deleteCallback = (callbacks, el, event, fn) => { if (fn) { const fns = callbacks.get(event) if (fns) { fns.delete(fn) if (fns.size === 0) callbacks.delete(event) } } else callbacks.delete(event) } const off = (callbacks, el) => (event, fn) => { if (event === ALL_CALLBACKS && !fn) { callbacks.clear() } else { deleteCallback(callbacks, el, event, fn) } return el } const one = (callbacks, el) => (event, fn) => { function on(...args) { el.off(event, on) fn.apply(el, args) } return el.on(event, on) } const trigger = (callbacks, el) => (event, ...args) => { const fns = callbacks.get(event) if (fns) fns.forEach(fn => fn.apply(el, args)) if (callbacks.get(ALL_CALLBACKS) && event !== ALL_CALLBACKS) { el.trigger(ALL_CALLBACKS, event, ...args) } return el } const observable = function(el) { // eslint-disable-line const callbacks = new Map() const methods = {on, off, one, trigger} el = el || {} define(el, entries(methods).reduce((acc, [key, method]) => { acc[key] = { value: method(callbacks, el), enumerable: false, writable: false, configurable: false } return acc }, {}) ) return el } /* istanbul ignore next */ // support CommonJS, AMD & browser if (true) module.exports = observable else {} })(typeof window != 'undefined' ? window : undefined); /***/ }), /***/ "./js/components/file/index.riot": /*!***************************************!*\ !*** ./js/components/file/index.riot ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stores_file_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../stores/file.js */ "./js/stores/file.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ css: null, exports: { state: { files: [] }, onMounted() { _stores_file_js__WEBPACK_IMPORTED_MODULE_0__["default"].on('update', (data) => { this.state.files = data this.update() }) _stores_file_js__WEBPACK_IMPORTED_MODULE_0__["default"].get(this.props.hubId) } }, template: ( template, expressionTypes, bindingTypes, getComponent ) => template( '
', [ { type: bindingTypes.EACH, getKey: null, condition: null, template: template( ' ', [ { redundantAttribute: 'expr27', selector: '[expr27]', expressions: [ { type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => [ _scope.file.name ].join( '' ) }, { type: expressionTypes.ATTRIBUTE, name: 'href', evaluate: _scope => [ '/file/', _scope.file.name ].join( '' ) } ] } ] ), redundantAttribute: 'expr26', selector: '[expr26]', itemName: 'file', indexName: null, evaluate: _scope => _scope.state.files } ] ), name: 'app-file-index' }); /***/ }), /***/ "./node_modules/@tiny-components/notification/src/notification.riot": /*!**************************************************************************!*\ !*** ./node_modules/@tiny-components/notification/src/notification.riot ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js"); /* harmony import */ var _notificationStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notificationStore.js */ "./node_modules/@tiny-components/notification/src/notificationStore.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ css: null, exports: { state: { items: [], timeout: 5000, prefixId: 'tiny-notification-', wrapperClass: '' }, /** * on mounted * * @param {Object} props * @param {Object} state * */ onMounted(props, state) { // change timeout by props if (props.timeout) { state.timeout = props.timeout } // change timeout by props if (props.wrapperClass) { state.wrapperClass = props.wrapperClass } // adding service for notifications and listen to "update" _notificationStore_js__WEBPACK_IMPORTED_MODULE_0__["default"].on('append', (item) => { // adding attributes item.id = this.state.prefixId + 'toast-' + (0,uuid__WEBPACK_IMPORTED_MODULE_1__["default"])() // create timeout to remove notification item.timeout = setTimeout(() => { this.removeItem(item) }, this.state.timeout) item.classes = [ 'toast', 'toast--' + item.type ] this.state.items.push(item) this.update() setTimeout(() => { for (let i = 0; i < this.state.items.length; i++) { if (this.state.items[i].id === item.id) { this.state.items[i].classes.push('toast--animation') this.update() } } }, 10) }) }, /** * remove single item * * * @param {Object} item * */ removeItem(item) { // set event transitionend only to item that has to removed // after animation is complete search for cleartimeout and remove it // form items this.$('#' + item.id).addEventListener('transitionend', () => { const items = [] for (let i = 0; i < this.state.items.length; i++) { if (this.state.items[i].id === item.id) { clearTimeout(this.state.items[i].timeout) } else { items.push(this.state.items[i]) } } this.state.items = items this.update() }) // remove class animation and update requestAnimationFrame(() => { for (let i = 0; i < this.state.items.length; i++) { if (this.state.items[i].id === item.id) { this.state.items[i].classes.pop('toast--animation') this.update() } } }) }, /** * remove item by clicked on it * * @param {Object} event * @param {Object} item * */ handleClick(event, item) { this.removeItem(item) } }, template: ( template, expressionTypes, bindingTypes, getComponent ) => template( '
', [ { type: bindingTypes.IF, evaluate: _scope => _scope.state.items.length > 0, redundantAttribute: 'expr28', selector: '[expr28]', template: template( '
', [ { expressions: [ { type: expressionTypes.ATTRIBUTE, name: 'class', evaluate: _scope => [ 'toast-wrapper ', _scope.state.wrapperClass ].join( '' ) } ] }, { type: bindingTypes.EACH, getKey: null, condition: null, template: template( '
', [ { expressions: [ { type: expressionTypes.ATTRIBUTE, name: 'id', evaluate: _scope => _scope.item.id }, { type: expressionTypes.ATTRIBUTE, name: 'class', evaluate: _scope => _scope.item.classes.join(' ') }, { type: expressionTypes.EVENT, name: 'onclick', evaluate: _scope => (event) => { _scope.handleClick(event, _scope.item) } } ] }, { redundantAttribute: 'expr30', selector: '[expr30]', expressions: [ { type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => [ _scope.item.message ].join( '' ) } ] } ] ), redundantAttribute: 'expr29', selector: '[expr29]', itemName: 'item', indexName: null, evaluate: _scope => _scope.state.items } ] ) } ] ), name: 'tiny-notification' }); /***/ }), /***/ "./node_modules/@tiny-components/notification/src/notificationStore.js": /*!*****************************************************************************!*\ !*** ./node_modules/@tiny-components/notification/src/notificationStore.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _riotjs_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @riotjs/observable */ "./node_modules/@riotjs/observable/dist/observable.js"); /* harmony import */ var _riotjs_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_riotjs_observable__WEBPACK_IMPORTED_MODULE_0__); /** * NotificationService * * @author Björn Hase * @license http://opensource.org/licenses/MIT The MIT License * @link https://gitea.node001.net/tiny-components/notification * */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_riotjs_observable__WEBPACK_IMPORTED_MODULE_0___default()({ SUCCESS: 'success', DANGER: 'danger', INFO: 'info', /** * adding success notification * */ success(message) { this._add(message, this.SUCCESS) }, /** * * */ danger(message) { this._add(message, this.DANGER) }, /** * * */ info(message) { this._add(message, this.INFO) }, /** * * @param {[type]} message [description] * @param {[type]} type [description] */ _add(message, type) { this.trigger('append', { message: message, type: type }) } })); /***/ }), /***/ "./js/stores/file.js": /*!***************************!*\ !*** ./js/stores/file.js ***! \***************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _riotjs_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @riotjs/observable */ "./node_modules/@riotjs/observable/dist/observable.js"); /* harmony import */ var _riotjs_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_riotjs_observable__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _tiny_components_notification_src_notificationStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tiny-components/notification/src/notificationStore.js */ "./node_modules/@tiny-components/notification/src/notificationStore.js"); /** * * Store for hub * * * @author Björn Hase * */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_riotjs_observable__WEBPACK_IMPORTED_MODULE_0___default()({ /** * getting all hubs, * trigger update after response * * * @param {object} data * */ get: function get(id) { var _this = this; fetch('/api/files/v1/' + id).then(function (response) { return response.json(); }).then(function (response) { _this.trigger('update', response.data); })["catch"](function () { _tiny_components_notification_src_notificationStore_js__WEBPACK_IMPORTED_MODULE_1__["default"].danger('Error! Connection Problem!'); }); } })); /***/ }), /***/ "./node_modules/riot/riot.esm.js": /*!***************************************!*\ !*** ./node_modules/riot/riot.esm.js ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "__": () => (/* binding */ __), /* harmony export */ "component": () => (/* binding */ component), /* harmony export */ "install": () => (/* binding */ install), /* harmony export */ "mount": () => (/* binding */ mount), /* harmony export */ "pure": () => (/* binding */ pure), /* harmony export */ "register": () => (/* binding */ register), /* harmony export */ "uninstall": () => (/* binding */ uninstall), /* harmony export */ "unmount": () => (/* binding */ unmount), /* harmony export */ "unregister": () => (/* binding */ unregister), /* harmony export */ "version": () => (/* binding */ version), /* harmony export */ "withTypes": () => (/* binding */ withTypes) /* harmony export */ }); /* Riot v6.1.2, @license MIT */ /** * Convert a string from camel case to dash-case * @param {string} string - probably a component tag name * @returns {string} component name normalized */ function camelToDashCase(string) { return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); } /** * Convert a string containing dashes to camel case * @param {string} string - input string * @returns {string} my-string -> myString */ function dashToCamelCase(string) { return string.replace(/-(\w)/g, (_, c) => c.toUpperCase()); } /** * Get all the element attributes as object * @param {HTMLElement} element - DOM node we want to parse * @returns {Object} all the attributes found as a key value pairs */ function DOMattributesToObject(element) { return Array.from(element.attributes).reduce((acc, attribute) => { acc[dashToCamelCase(attribute.name)] = attribute.value; return acc; }, {}); } /** * Move all the child nodes from a source tag to another * @param {HTMLElement} source - source node * @param {HTMLElement} target - target node * @returns {undefined} it's a void method ¯\_(ツ)_/¯ */ // Ignore this helper because it's needed only for svg tags function moveChildren(source, target) { if (source.firstChild) { target.appendChild(source.firstChild); moveChildren(source, target); } } /** * Remove the child nodes from any DOM node * @param {HTMLElement} node - target node * @returns {undefined} */ function cleanNode(node) { clearChildren(node.childNodes); } /** * Clear multiple children in a node * @param {HTMLElement[]} children - direct children nodes * @returns {undefined} */ function clearChildren(children) { Array.from(children).forEach(removeChild); } /** * Remove a node * @param {HTMLElement}node - node to remove * @returns {undefined} */ const removeChild = node => node && node.parentNode && node.parentNode.removeChild(node); /** * Insert before a node * @param {HTMLElement} newNode - node to insert * @param {HTMLElement} refNode - ref child * @returns {undefined} */ const insertBefore = (newNode, refNode) => refNode && refNode.parentNode && refNode.parentNode.insertBefore(newNode, refNode); /** * Replace a node * @param {HTMLElement} newNode - new node to add to the DOM * @param {HTMLElement} replaced - node to replace * @returns {undefined} */ const replaceChild = (newNode, replaced) => replaced && replaced.parentNode && replaced.parentNode.replaceChild(newNode, replaced); // Riot.js constants that can be used accross more modules const COMPONENTS_IMPLEMENTATION_MAP$1 = new Map(), DOM_COMPONENT_INSTANCE_PROPERTY$1 = Symbol('riot-component'), PLUGINS_SET$1 = new Set(), IS_DIRECTIVE = 'is', VALUE_ATTRIBUTE = 'value', MOUNT_METHOD_KEY = 'mount', UPDATE_METHOD_KEY = 'update', UNMOUNT_METHOD_KEY = 'unmount', SHOULD_UPDATE_KEY = 'shouldUpdate', ON_BEFORE_MOUNT_KEY = 'onBeforeMount', ON_MOUNTED_KEY = 'onMounted', ON_BEFORE_UPDATE_KEY = 'onBeforeUpdate', ON_UPDATED_KEY = 'onUpdated', ON_BEFORE_UNMOUNT_KEY = 'onBeforeUnmount', ON_UNMOUNTED_KEY = 'onUnmounted', PROPS_KEY = 'props', STATE_KEY = 'state', SLOTS_KEY = 'slots', ROOT_KEY = 'root', IS_PURE_SYMBOL = Symbol('pure'), IS_COMPONENT_UPDATING = Symbol('is_updating'), PARENT_KEY_SYMBOL = Symbol('parent'), ATTRIBUTES_KEY_SYMBOL = Symbol('attributes'), TEMPLATE_KEY_SYMBOL = Symbol('template'); var globals = /*#__PURE__*/Object.freeze({ __proto__: null, COMPONENTS_IMPLEMENTATION_MAP: COMPONENTS_IMPLEMENTATION_MAP$1, DOM_COMPONENT_INSTANCE_PROPERTY: DOM_COMPONENT_INSTANCE_PROPERTY$1, PLUGINS_SET: PLUGINS_SET$1, IS_DIRECTIVE: IS_DIRECTIVE, VALUE_ATTRIBUTE: VALUE_ATTRIBUTE, MOUNT_METHOD_KEY: MOUNT_METHOD_KEY, UPDATE_METHOD_KEY: UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY: UNMOUNT_METHOD_KEY, SHOULD_UPDATE_KEY: SHOULD_UPDATE_KEY, ON_BEFORE_MOUNT_KEY: ON_BEFORE_MOUNT_KEY, ON_MOUNTED_KEY: ON_MOUNTED_KEY, ON_BEFORE_UPDATE_KEY: ON_BEFORE_UPDATE_KEY, ON_UPDATED_KEY: ON_UPDATED_KEY, ON_BEFORE_UNMOUNT_KEY: ON_BEFORE_UNMOUNT_KEY, ON_UNMOUNTED_KEY: ON_UNMOUNTED_KEY, PROPS_KEY: PROPS_KEY, STATE_KEY: STATE_KEY, SLOTS_KEY: SLOTS_KEY, ROOT_KEY: ROOT_KEY, IS_PURE_SYMBOL: IS_PURE_SYMBOL, IS_COMPONENT_UPDATING: IS_COMPONENT_UPDATING, PARENT_KEY_SYMBOL: PARENT_KEY_SYMBOL, ATTRIBUTES_KEY_SYMBOL: ATTRIBUTES_KEY_SYMBOL, TEMPLATE_KEY_SYMBOL: TEMPLATE_KEY_SYMBOL }); const EACH = 0; const IF = 1; const SIMPLE = 2; const TAG = 3; const SLOT = 4; var bindingTypes = { EACH, IF, SIMPLE, TAG, SLOT }; const ATTRIBUTE = 0; const EVENT = 1; const TEXT = 2; const VALUE = 3; var expressionTypes = { ATTRIBUTE, EVENT, TEXT, VALUE }; const HEAD_SYMBOL = Symbol('head'); const TAIL_SYMBOL = Symbol('tail'); /** * Create the