Socket
Socket
Sign inDemoInstall

riot

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riot - npm Package Compare versions

Comparing version 7.0.6 to 7.0.7

3

esm/api/__.js

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { DOM_COMPONENT_INSTANCE_PROPERTY, PARENT_KEY_SYMBOL } from '@riotjs/util';

@@ -6,2 +6,3 @@ import { template, createBinding, createExpression, bindingTypes, expressionTypes } from '@riotjs/dom-bindings';

// expose some internal stuff that might be used from external tools
const __ = {

@@ -8,0 +9,0 @@ cssManager,

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import compose from 'cumpa';

@@ -10,3 +10,2 @@ import { createComponentFromWrapper } from '../core/create-component-from-wrapper.js';

*/
function component(implementation) {

@@ -13,0 +12,0 @@ return function (el, props, _temp) {

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { isFunction, panic, PLUGINS_SET } from '@riotjs/util';

@@ -9,3 +9,2 @@

*/
function install(plugin) {

@@ -12,0 +11,0 @@ if (!isFunction(plugin)) panic('Plugins must be of type function');

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import $ from 'bianco.query';

@@ -12,3 +12,2 @@ import { mountComponent } from '../core/mount-component.js';

*/
function mount(selector, initialProps, name) {

@@ -15,0 +14,0 @@ return $(selector).map(element => mountComponent(element, initialProps, name));

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { isFunction, panic, IS_PURE_SYMBOL } from '@riotjs/util';

@@ -9,3 +9,2 @@

*/
function pure(func) {

@@ -12,0 +11,0 @@ if (!isFunction(func)) panic('riot.pure accepts only arguments of type "function"');

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP, panic } from '@riotjs/util';

@@ -11,3 +11,2 @@ import { createComponentFromWrapper } from '../core/create-component-from-wrapper.js';

*/
function register(name, _ref) {

@@ -14,0 +13,0 @@ let {

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { PLUGINS_SET, panic } from '@riotjs/util';

@@ -9,3 +9,2 @@

*/
function uninstall(plugin) {

@@ -12,0 +11,0 @@ if (!PLUGINS_SET.has(plugin)) panic('This plugin was never installed');

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import $ from 'bianco.query';

@@ -11,3 +11,2 @@ import { DOM_COMPONENT_INSTANCE_PROPERTY } from '@riotjs/util';

*/
function unmount(selector, keepRootElement) {

@@ -18,3 +17,2 @@ return $(selector).map(element => {

}
return element;

@@ -21,0 +19,0 @@ });

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP, panic } from '@riotjs/util';

@@ -10,3 +10,2 @@ import cssManager from '../core/css-manager.js';

*/
function unregister(name) {

@@ -13,0 +12,0 @@ if (!COMPONENTS_IMPLEMENTATION_MAP.has(name)) panic(`The component "${name}" was never registered`);

@@ -1,5 +0,5 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
/** @type {string} current riot version */
const version = 'WIP';
const version = 'v7.0.7';
export { version };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
/**

@@ -7,3 +7,2 @@ * no-op function needed to add the proper types to your component via typescript

*/
/* istanbul ignore next */

@@ -10,0 +9,0 @@ const withTypes = component => component;

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { IS_DIRECTIVE } from '@riotjs/util';

@@ -3,0 +3,0 @@ import { getName } from '../utils/dom.js';

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { DOM_COMPONENT_INSTANCE_PROPERTY } from '@riotjs/util';

@@ -10,5 +10,4 @@

*/
const bindDOMNodeToComponentInstance = (node, component) => node[DOM_COMPONENT_INSTANCE_PROPERTY] = component;
export { bindDOMNodeToComponentInstance };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import $ from 'bianco.query';

@@ -9,9 +9,7 @@

},
$$(selector) {
return $(selector, this.root);
}
});
export { COMPONENT_DOM_SELECTORS };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { SHOULD_UPDATE_KEY, noop, ON_BEFORE_MOUNT_KEY, ON_MOUNTED_KEY, ON_BEFORE_UPDATE_KEY, ON_UPDATED_KEY, ON_BEFORE_UNMOUNT_KEY, ON_UNMOUNTED_KEY } from '@riotjs/util';

@@ -3,0 +3,0 @@

@@ -1,6 +0,3 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { template, expressionTypes, bindingTypes } from '@riotjs/dom-bindings';
import { COMPONENTS_IMPLEMENTATION_MAP } from '@riotjs/util';
import { createChildrenComponentsObject } from './create-children-components-object.js';
import { memoizedCreateComponentFromWrapper } from './create-component-from-wrapper.js';

@@ -11,15 +8,9 @@ /**

* @param {RiotComponentWrapper} componentWrapper - riot compiler generated object
* @param {Function} getChildComponent - getter function to return the children components
* @returns {TemplateChunk} template chunk object
*/
function componentTemplateFactory(template$1, componentWrapper) {
const components = createChildrenComponentsObject(componentWrapper.exports ? componentWrapper.exports.components : {});
return template$1(template, expressionTypes, bindingTypes, name => {
// improve support for recursive components
if (name === componentWrapper.name) return memoizedCreateComponentFromWrapper(componentWrapper); // return the registered components
return components[name] || COMPONENTS_IMPLEMENTATION_MAP.get(name);
});
function componentTemplateFactory(template$1, componentWrapper, getChildComponent) {
return template$1(template, expressionTypes, bindingTypes, getChildComponent);
}
export { componentTemplateFactory };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { callOrAssign } from '@riotjs/util';

@@ -10,3 +10,2 @@

*/
function computeComponentState(oldState, newState) {

@@ -13,0 +12,0 @@ return Object.assign({}, oldState, callOrAssign(newState));

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { DOMattributesToObject, callOrAssign } from '@riotjs/util';

@@ -10,3 +10,2 @@

*/
function computeInitialProps(element, initialProps) {

@@ -16,3 +15,2 @@ if (initialProps === void 0) {

}
return Object.assign({}, DOMattributesToObject(element), callOrAssign(initialProps));

@@ -19,0 +17,0 @@ }

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { createCoreAPIMethods } from './create-core-api-methods.js';

@@ -11,3 +11,2 @@ import { createExpression } from '@riotjs/dom-bindings';

*/
function createAttributeBindings(node, attributes) {

@@ -17,3 +16,2 @@ if (attributes === void 0) {

}
const expressions = attributes.map(a => createExpression(node, a));

@@ -20,0 +18,0 @@ const binding = {};

@@ -1,3 +0,3 @@

/* Riot WIP, @license MIT */
import { IS_PURE_SYMBOL, callOrAssign, memoize } from '@riotjs/util';
/* Riot v7.0.7, @license MIT */
import { memoize, IS_PURE_SYMBOL, callOrAssign, COMPONENTS_IMPLEMENTATION_MAP, camelToDashCase } from '@riotjs/util';
import { MOCKED_TEMPLATE_INTERFACE } from './mocked-template-interface.js';

@@ -9,2 +9,40 @@ import { componentTemplateFactory } from './component-template-factory.js';

/**
* Create the subcomponents that can be included inside a tag in runtime
* @param {Object} components - components imported in runtime
* @returns {Object} all the components transformed into Riot.Component factory functions
*/
function createChildrenComponentsObject(components) {
if (components === void 0) {
components = {};
}
return Object.entries(callOrAssign(components)).reduce((acc, _ref) => {
let [key, value] = _ref;
acc[camelToDashCase(key)] = createComponentFromWrapper(value);
return acc;
}, {});
}
/**
* Create the getter function to render the child components
* @param {RiotComponentWrapper} componentWrapper - riot compiler generated object
* @returns {Function} function returning the component factory function
*/
const createChildComponentGetter = componentWrapper => {
const childrenComponents = createChildrenComponentsObject(componentWrapper.exports ? componentWrapper.exports.components : {});
return name => {
// improve support for recursive components
if (name === componentWrapper.name) return memoizedCreateComponentFromWrapper(componentWrapper);
// return the registered components
return childrenComponents[name] || COMPONENTS_IMPLEMENTATION_MAP.get(name);
};
};
/**
* Performance optimization for the recursive components
* @param {RiotComponentWrapper} componentWrapper - riot compiler generated object
* @returns {Object} component like interface
*/
const memoizedCreateComponentFromWrapper = memoize(createComponentFromWrapper);
/**
* Create the component interface needed for the @riotjs/dom-bindings tag bindings

@@ -18,3 +56,2 @@ * @param {RiotComponentWrapper} componentWrapper - riot compiler generated object

*/
function createComponentFromWrapper(componentWrapper) {

@@ -27,4 +64,4 @@ const {

} = componentWrapper;
const templateFn = template ? componentTemplateFactory(template, componentWrapper) : MOCKED_TEMPLATE_INTERFACE;
return _ref => {
const templateFn = template ? componentTemplateFactory(template, componentWrapper, createChildComponentGetter(componentWrapper)) : MOCKED_TEMPLATE_INTERFACE;
return _ref2 => {
let {

@@ -34,3 +71,3 @@ slots,

props
} = _ref;
} = _ref2;
// pure components rendering will be managed by the end user

@@ -54,7 +91,8 @@ if (exports && exports[IS_PURE_SYMBOL]) return createPureComponent(exports, {

props
}); // notice that for the components created via tag binding
});
// notice that for the components created via tag binding
// we need to invert the mount (state/parentScope) arguments
// the template bindings will only forward the parentScope updates
// and never deal with the component state
return {

@@ -64,22 +102,12 @@ mount(element, parentScope, state) {

},
update(parentScope, state) {
return component.update(state, parentScope);
},
unmount(preserveRoot) {
return component.unmount(preserveRoot);
}
};
};
}
/**
* Performance optimization for the recursive components
* @param {RiotComponentWrapper} componentWrapper - riot compiler generated object
* @returns {Object} component like interface
*/
const memoizedCreateComponentFromWrapper = memoize(createComponentFromWrapper);
export { createComponentFromWrapper, memoizedCreateComponentFromWrapper };
export { createComponentFromWrapper };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { MOUNT_METHOD_KEY, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY } from '@riotjs/util';

@@ -9,3 +9,2 @@

*/
function createCoreAPIMethods(mapFunction) {

@@ -12,0 +11,0 @@ return [MOUNT_METHOD_KEY, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY].reduce((acc, method) => {

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { panic, defineDefaults, MOUNT_METHOD_KEY, defineProperty, IS_PURE_SYMBOL } from '@riotjs/util';

@@ -17,3 +17,2 @@ import { PURE_COMPONENT_API } from './pure-component-api.js';

*/
function createPureComponent(pureFactoryFunction, _ref) {

@@ -38,12 +37,10 @@ let {

}
// intercept the mount calls to bind the DOM node to the pure object created
// see also https://github.com/riot/riot/issues/2806
if (method === MOUNT_METHOD_KEY) {
const [element] = args; // mark this node as pure element
const [element] = args;
// mark this node as pure element
defineProperty(element, IS_PURE_SYMBOL, true);
bindDOMNodeToComponentInstance(element, component);
}
component[method](...args);

@@ -50,0 +47,0 @@ return component;

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import $ from 'bianco.query';

@@ -6,4 +6,5 @@ import { set } from 'bianco.attr';

const CSS_BY_NAME = new Map();
const STYLE_NODE_SELECTOR = 'style[riot]'; // memoized curried function
const STYLE_NODE_SELECTOR = 'style[riot]';
// memoized curried function
const getStyleNode = (style => {

@@ -14,9 +15,10 @@ return () => {

// we return its cached result
if (style) return style; // create a new style element or use an existing one
if (style) return style;
// create a new style element or use an existing one
// and cache it internally
style = $(STYLE_NODE_SELECTOR)[0] || document.createElement('style');
set(style, 'type', 'text/css');
/* istanbul ignore next */
if (!style.parentNode) document.head.appendChild(style);

@@ -26,10 +28,8 @@ return style;

})();
/**
* Object that will be used to inject and manage the css of every tag instance
*/
const cssManager = {
CSS_BY_NAME,
/**

@@ -46,6 +46,4 @@ * Save a tag style to be later injected into DOM

}
return this;
},
/**

@@ -60,3 +58,2 @@ * Inject all previously saved tag styles into DOM

},
/**

@@ -72,8 +69,6 @@ * Remove a tag style from the DOM

}
return this;
}
};
export { CSS_BY_NAME, STYLE_NODE_SELECTOR, cssManager as default };

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { defineProperties, defineDefaults, PROPS_KEY, STATE_KEY, SLOTS_KEY, ROOT_KEY } from '@riotjs/util';

@@ -15,3 +15,2 @@ import { COMPONENT_DOM_SELECTORS } from './component-dom-selectors.js';

*/
function instantiateComponent(_ref) {

@@ -26,3 +25,4 @@ let {

if (css && name) cssManager.add(name, css);
return curry(manageComponentLifecycle)(defineProperties( // set the component defaults without overriding the original component API
return curry(manageComponentLifecycle)(defineProperties(
// set the component defaults without overriding the original component API
defineDefaults(componentAPI, Object.assign({}, COMPONENT_LIFECYCLE_METHODS, {

@@ -29,0 +29,0 @@ [PROPS_KEY]: {},

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { autobindMethods, defineProperties, isObject, defineProperty, IS_PURE_SYMBOL, PARENT_KEY_SYMBOL, ATTRIBUTES_KEY_SYMBOL, PROPS_KEY, evaluateAttributeExpressions, STATE_KEY, TEMPLATE_KEY_SYMBOL, ROOT_KEY, SLOTS_KEY, ON_BEFORE_MOUNT_KEY, ON_MOUNTED_KEY, SHOULD_UPDATE_KEY, ON_BEFORE_UPDATE_KEY, IS_COMPONENT_UPDATING, ON_UPDATED_KEY, ON_BEFORE_UNMOUNT_KEY, ON_UNMOUNTED_KEY, isFunction } from '@riotjs/util';

@@ -17,3 +17,2 @@ import { addCssHook } from './add-css-hook.js';

*/
function manageComponentLifecycle(component, _ref) {

@@ -30,3 +29,2 @@ let {

}
// any element mounted passing through this function can't be a pure component

@@ -38,14 +36,17 @@ defineProperty(element, IS_PURE_SYMBOL, false);

this[STATE_KEY] = computeComponentState(this[STATE_KEY], state);
this[TEMPLATE_KEY_SYMBOL] = this.template.createDOM(element).clone(); // link this object to the DOM node
this[TEMPLATE_KEY_SYMBOL] = this.template.createDOM(element).clone();
bindDOMNodeToComponentInstance(element, this); // add eventually the 'is' attribute
// link this object to the DOM node
bindDOMNodeToComponentInstance(element, this);
// add eventually the 'is' attribute
component.name && addCssHook(element, component.name);
component.name && addCssHook(element, component.name); // define the root element
// define the root element
defineProperty(this, ROOT_KEY, element);
// define the slots array
defineProperty(this, SLOTS_KEY, slots);
defineProperty(this, ROOT_KEY, element); // define the slots array
defineProperty(this, SLOTS_KEY, slots); // before mount lifecycle event
this[ON_BEFORE_MOUNT_KEY](this[PROPS_KEY], this[STATE_KEY]); // mount the template
// before mount lifecycle event
this[ON_BEFORE_MOUNT_KEY](this[PROPS_KEY], this[STATE_KEY]);
// mount the template
this[TEMPLATE_KEY_SYMBOL].mount(element, this, parentScope);

@@ -55,3 +56,2 @@ this[ON_MOUNTED_KEY](this[PROPS_KEY], this[STATE_KEY]);

},
update(state, parentScope) {

@@ -61,3 +61,2 @@ if (state === void 0) {

}
if (parentScope) {

@@ -67,3 +66,2 @@ this[PARENT_KEY_SYMBOL] = parentScope;

}
const newProps = evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions);

@@ -73,5 +71,6 @@ if (this[SHOULD_UPDATE_KEY](newProps, this[PROPS_KEY]) === false) return;

this[STATE_KEY] = computeComponentState(this[STATE_KEY], state);
this[ON_BEFORE_UPDATE_KEY](this[PROPS_KEY], this[STATE_KEY]); // avoiding recursive updates
this[ON_BEFORE_UPDATE_KEY](this[PROPS_KEY], this[STATE_KEY]);
// avoiding recursive updates
// see also https://github.com/riot/riot/issues/2895
if (!this[IS_COMPONENT_UPDATING]) {

@@ -81,3 +80,2 @@ this[IS_COMPONENT_UPDATING] = true;

}
this[ON_UPDATED_KEY](this[PROPS_KEY], this[STATE_KEY]);

@@ -87,8 +85,7 @@ this[IS_COMPONENT_UPDATING] = false;

},
unmount(preserveRoot) {
this[ON_BEFORE_UNMOUNT_KEY](this[PROPS_KEY], this[STATE_KEY]);
this[ATTRIBUTES_KEY_SYMBOL].unmount(); // if the preserveRoot is null the template html will be left untouched
this[ATTRIBUTES_KEY_SYMBOL].unmount();
// if the preserveRoot is null the template html will be left untouched
// in that case the DOM cleanup will happen differently from a parent node
this[TEMPLATE_KEY_SYMBOL].unmount(this, this[PARENT_KEY_SYMBOL], preserveRoot === null ? null : !preserveRoot);

@@ -98,3 +95,2 @@ this[ON_UNMOUNTED_KEY](this[PROPS_KEY], this[STATE_KEY]);

}
})), Object.keys(component).filter(prop => isFunction(component[prop])));

@@ -101,0 +97,0 @@ }

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { PURE_COMPONENT_API } from './pure-component-api.js';

@@ -3,0 +3,0 @@ import { noop } from '@riotjs/util';

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP, panic } from '@riotjs/util';

@@ -13,3 +13,2 @@ import { getName } from '../utils/dom.js';

*/
function mountComponent(element, initialProps, componentName, slots) {

@@ -16,0 +15,0 @@ const name = componentName || getName(element);

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { MOUNT_METHOD_KEY, noop, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY } from '@riotjs/util';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { PLUGINS_SET } from '@riotjs/util';

@@ -9,3 +9,2 @@

*/
function runPlugins(component) {

@@ -12,0 +11,0 @@ return [...PLUGINS_SET].reduce((c, fn) => fn(c) || c, component);

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
export { register } from './api/register.js';

@@ -3,0 +3,0 @@ export { unregister } from './api/unregister.js';

@@ -1,2 +0,2 @@

/* Riot WIP, @license MIT */
/* Riot v7.0.7, @license MIT */
import { IS_DIRECTIVE } from '@riotjs/util';

@@ -10,3 +10,2 @@ import { get } from 'bianco.attr';

*/
function getName(element) {

@@ -13,0 +12,0 @@ return get(element, IS_DIRECTIVE) || element.tagName.toLowerCase();

{
"name": "riot",
"version": "7.0.6",
"version": "7.0.7",
"description": "Simple and elegant component-based UI library",

@@ -38,5 +38,5 @@ "homepage": "https://riot.js.org/",

"dependencies": {
"@riotjs/compiler": "^6.3.2",
"@riotjs/compiler": "^6.4.1",
"@riotjs/dom-bindings": "^6.0.7",
"@riotjs/util": "^2.1.3",
"@riotjs/util": "^2.2.0",
"bianco.attr": "^1.1.1",

@@ -48,15 +48,15 @@ "bianco.query": "^1.1.4",

"devDependencies": {
"@babel/core": "^7.19.0",
"@babel/preset-env": "^7.19.0",
"@babel/core": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@riotjs/babel-preset": "1.0.0",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.0.1",
"@rollup/plugin-node-resolve": "^14.1.0",
"babel-plugin-istanbul": "^6.1.1",
"chai": "^4.3.6",
"core-js": "^3.25.1",
"eslint": "^8.23.0",
"core-js": "^3.26.0",
"eslint": "^8.26.0",
"eslint-config-riot": "^3.0.0",
"jsdom": "20.0.0",
"jsdom": "20.0.2",
"jsdom-global": "3.0.2",
"karma": "^6.4.0",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",

@@ -67,10 +67,10 @@ "karma-coverage": "^2.2.0",

"karma-sauce-launcher": "^4.3.6",
"mocha": "^10.0.0",
"rollup": "^2.79.0",
"mocha": "^10.1.0",
"rollup": "^2.79.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-riot": "^6.0.0",
"sinon": "^14.0.0",
"sinon": "^14.0.1",
"sinon-chai": "^3.7.0",
"terser": "^5.15.0",
"typescript": "^4.8.3"
"terser": "^5.15.1",
"typescript": "^4.8.4"
},

@@ -77,0 +77,0 @@ "files": [

@@ -1,1 +0,1 @@

var t,e;t=this,e=function(t){"use strict";const e={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};function n(t,e){return typeof t===e}function r(t){const e=t.ownerSVGElement;return!!e||null===e}function s(t){return"template"===t.tagName.toLowerCase()}function o(t){return n(t,"function")}function i(t){return!u(t)&&t.constructor===Object}function u(t){return null==t}const a=new Map,c=Symbol(),l=new Set,h="mount",d="update",p="unmount",m="props",f="slots",b="root",g=Symbol(),v=Symbol(),y=Symbol(),O=Symbol(),j=Symbol();function N(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function x(t){for(;t.firstChild;)t.removeChild(t.firstChild)}const M=t=>t&&t.parentNode&&t.parentNode.removeChild(t),E=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),A={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};function T(){return this}function w(t){return o(t)?t.prototype&&t.prototype.constructor?new t:t():t}function S(t){const e=new Map,n=n=>(e.has(n)||e.set(n,t.call(this,n)))&&e.get(n);return n.cache=e,n}function C(t){return t.reduce(((t,e)=>{const{value:n,type:r}=e;switch(!0){case!e.name&&0===r:return Object.assign({},t,n);case 3===r:t.value=e.value;break;default:t[N(e.name)]=e.value}return t}),{})}function D(t,e,n,r){return void 0===r&&(r={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},r)),t}function k(t,e,n){return Object.entries(e).forEach((e=>{let[r,s]=e;D(t,r,s,n)})),t}function L(t,e){return Object.entries(e).forEach((e=>{let[n,r]=e;t[n]||(t[n]=r)})),t}const U=Object.freeze({[h]:T,[d]:T,[p]:T}),B=Object.assign({},U,{clone:T,createDOM:T}),I=Symbol(),P=Symbol(),_=Symbol(),$={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:s}=this,o=t===_?null:this.evaluate(t),i=o?Array.from(o):[],{newChildrenMap:u,batches:a,futureNodes:c}=function(t,e,n,r){const{condition:s,template:o,childrenMap:i,itemName:u,getKey:a,indexName:c,root:l,isTemplateTag:h}=r,d=new Map,p=[],m=[];return t.forEach(((t,r)=>{const f=function(t,e){let{itemName:n,indexName:r,index:s,item:o}=e;return D(t,n,o),r&&D(t,r,s),t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(f):r,g=i.get(b),v=[];if(function(t,e){return!!t&&!t(e)}(s,f))return;const y=!g,O=g?g.template:o.clone(),j=O.el||l.cloneNode(),N=h&&y?function(t){const e=t.dom.cloneNode(!0),{head:n,tail:r}=function(){const t=document.createTextNode(""),e=document.createTextNode("");return t[I]=!0,e[P]=!0,{head:t,tail:e}}();return{avoidDOMInjection:!0,fragment:e,head:n,tail:r,children:[n,...Array.from(e.childNodes),r]}}(O):O.meta;y?p.push((()=>O.mount(j,f,n,N))):p.push((()=>O.update(f,n))),h?v.push(...N.children):v.push(j),i.delete(b),m.push(...v),d.set(b,{nodes:v,template:O,context:f,index:r})})),{newChildrenMap:d,batches:p,futureNodes:m}}(i,t,e,this);return((t,e,n,r)=>{const s=e.length;let o=t.length,i=s,u=0,a=0,c=null;for(;u<o||a<i;)if(o===u){const t=i<s?a?n(e[a-1],-0).nextSibling:n(e[i-a],0):r;for(;a<i;)E(n(e[a++],1),t)}else if(i===a)for(;u<o;)c&&c.has(t[u])||M(n(t[u],-1)),u++;else if(t[u]===e[a])u++,a++;else if(t[o-1]===e[i-1])o--,i--;else if(t[u]===e[i-1]&&e[a]===t[o-1]){const r=n(t[--o],-1).nextSibling;E(n(e[a++],1),n(t[u++],-1).nextSibling),E(n(e[--i],1),r),t[o]=e[i]}else{if(!c){c=new Map;let t=a;for(;t<i;)c.set(e[t],t++)}if(c.has(t[u])){const r=c.get(t[u]);if(a<r&&r<i){let s=u,d=1;for(;++s<o&&s<i&&c.get(t[s])===r+d;)d++;if(d>r-a){const s=n(t[u],0);for(;a<r;)E(n(e[a++],1),s)}else l=n(e[a++],1),(h=n(t[u++],-1))&&h.parentNode&&h.parentNode.replaceChild(l,h)}else u++}else M(n(t[u++],-1))}var l,h})(r,c,function(t,e){return(n,r)=>{if(r<0){const n=t[t.length-1];if(n){const{template:r,nodes:s,context:o}=n;s.pop(),s.length||(t.pop(),r.unmount(o,e,null))}}return n}}(Array.from(s.values()),e),n),a.forEach((t=>t())),this.childrenMap=u,this.nodes=c,this},unmount(t,e){return this.update(_,e),this}},z={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,s=this.value&&!n,o=()=>{const n=this.node.cloneNode();E(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:o();break;case s:this.unmount(t);break;default:n&&this.template.update(t,e)}return this.value=n,this},unmount(t,e){return this.template.unmount(t,e,!0),this}},H="undefined"==typeof Element?{}:Element.prototype,K=S((t=>H.hasOwnProperty(t))),R=/^on/,Y={handleEvent(t){this[t.type](t)}},F=new WeakMap;function V(t){return u(t)?"":t}const q=(t,e)=>{const n=t.childNodes[e];if(n.nodeType===Node.COMMENT_NODE){const e=document.createTextNode("");return t.replaceChild(e,n),e}return n},G={0:function t(e,r,s,u){let{name:a}=r;if(!a)return u&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter((t=>!r.includes(t))).forEach((e=>t.removeAttribute(e)))}(e,s,u),void(s&&function(e,n){Object.entries(n).forEach((n=>{let[r,s]=n;return t(e,{name:r},s)}))}(e,s));!K(a)&&(function(t){return n(t,"boolean")}(s)||i(s)||o(s))&&(e[a]=s),function(t){return!t&&0!==t}(s)?e.removeAttribute(a):function(t){return!0===t||["string","number"].includes(typeof t)}(s)&&e.setAttribute(a,function(t,e){return!0===e?t:e}(a,s))},1:function(t,e,n){let{name:r}=e;const s=r.replace(R,""),o=F.get(t)||(t=>{const e=Object.create(Y);return F.set(t,e),e})(t),[i,u]=(t=>Array.isArray(t)?t:[t,!1])(n),a=o[s],c=i&&!a;a&&!i&&t.removeEventListener(s,o),c&&t.addEventListener(s,o,u),o[s]=i},2:function(t,e,n){t.data=V(n)},3:function(t,e,n){t.value=V(n)}},W={mount(t){return this.value=this.evaluate(t),X(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(X(this,e),this.value=e),this},unmount(){return 1===this.type&&X(this,null),this}};function X(t,e){return G[t.type](t.node,t,e,t.value)}function Z(t,e){return Object.assign({},W,e,{node:2===e.type?q(t,e.childNodeIndex):t})}const J=(t,e)=>t[y]||e,Q={attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map((t=>Object.assign({},t,{value:t.evaluate(e)})));return Object.assign(Object.create(n||null),C(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find((t=>{let{id:e}=t;return e===this.name})),{parentNode:r}=this.node,s=J(t,e);return this.template=n&&ut(n.html,n.bindings).createDOM(r),this.template&&(x(this.node),this.template.mount(this.node,this.getTemplateScope(t,s),s),this.template.children=Array.from(this.node.childNodes)),tt(this.node),M(this.node),this},update(t,e){if(this.template){const n=J(t,e);this.template.update(this.getTemplateScope(t,n),n)}return this},unmount(t,e,n){return this.template&&this.template.unmount(this.getTemplateScope(t,e),null,n),this}};function tt(t){const e=t&&t.firstChild;e&&(E(e,t),tt(t))}function et(t){return t.reduce(((t,e)=>{let{bindings:n}=e;return t.concat(n)}),[])}const nt={mount(t){return this.update(t)},update(t,e){const n=this.evaluate(t);return n&&n===this.name?this.tag.update(t):(this.unmount(t,e,!0),this.name=n,this.tag=(r=this.getComponent(n),void 0===(s=this.slots)&&(s=[]),void 0===(o=this.attributes)&&(o=[]),r?r({slots:s,attributes:o}):ut(function(t){return t.reduce(((t,e)=>t+e.html),"")}(s),[...et(s),{expressions:o.map((t=>Object.assign({type:0},t)))}])),this.tag.mount(this.node,t)),this;var r,s,o},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}},rt={1:function(t,e){let{evaluate:n,template:r}=e;const s=document.createTextNode("");return E(s,t),M(t),Object.assign({},z,{node:t,evaluate:n,placeholder:s,template:r.createDOM(t)})},2:function(t,e){let{expressions:n}=e;return Object.assign({},(r=n.map((e=>Z(t,e))),["mount","update","unmount"].reduce(((t,e)=>Object.assign({},t,{[e]:t=>r.map((n=>n[e](t)))&&void 0})),{})));var r},0:function(t,e){let{evaluate:n,condition:r,itemName:o,indexName:i,getKey:u,template:a}=e;const c=document.createTextNode(""),l=t.cloneNode();return E(c,t),M(t),Object.assign({},$,{childrenMap:new Map,node:t,root:l,condition:r,evaluate:n,isTemplateTag:s(l),template:a.createDOM(t),getKey:u,indexName:i,itemName:o,placeholder:c})},3:function(t,e){let{evaluate:n,getComponent:r,slots:s,attributes:o}=e;return Object.assign({},nt,{node:t,evaluate:n,slots:s,attributes:o,getComponent:r})},4:function(t,e){let{name:n,attributes:r}=e;return Object.assign({},Q,{attributes:r,node:t,name:n})}};function st(t,e){return t.map((t=>2===t.type?Object.assign({},t,{childNodeIndex:t.childNodeIndex+e}):t))}function ot(t,e,n){const{selector:r,type:s,redundantAttribute:o,expressions:i}=e,u=r?t.querySelector(r):t;o&&u.removeAttribute(o);const a=i||[];return(rt[s]||rt[2])(u,Object.assign({},e,{expressions:n&&!r?st(a,n):a}))}const it={createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?function(t,e){return r(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=s(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}(t,e):e)}(t,this.html)||document.createDocumentFragment(),this},mount(t,e,n,o){void 0===o&&(o={}),this.el&&this.unmount(e);const{fragment:i,children:u,avoidDOMInjection:a}=o,{parentNode:c}=u?u[0]:t,l=s(t),h=l?function(t,e,n){const r=Array.from(t.childNodes);return Math.max(r.indexOf(e),r.indexOf(n.head)+1,0)}(c,t,o):null;this.createDOM(t);const d=i||this.dom.cloneNode(!0);return this.el=l?c:t,this.children=l?u||Array.from(d.childNodes):null,!a&&d&&function(t,e){switch(!0){case r(t):n=e,t.replaceChildren(...n.childNodes);break;case s(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}var n}(t,d),this.bindings=this.bindingsData.map((t=>ot(this.el,t,h))),this.bindings.forEach((t=>t.mount(e,n))),this.meta=o,this},update(t,e){return this.bindings.forEach((n=>n.update(t,e))),this},unmount(t,e,n){void 0===n&&(n=!1);const r=this.el;if(!r)return this;switch(this.bindings.forEach((r=>r.unmount(t,e,n))),!0){case r[g]||null===n:break;case Array.isArray(this.children):!function(t){for(let e=0;e<t.length;e++)M(t[e])}(this.children);break;case!n:x(r);break;case!!n:M(r)}return this.el=null,this},clone(){return Object.assign({},this,{meta:{},el:null})}};function ut(t,e){return void 0===e&&(e=[]),Object.assign({},it,{html:t,bindingsData:e})}const at=(t,e)=>t[c]=e;function ct(t){return[h,d,p].reduce(((e,n)=>(e[n]=t(n),e)),{})}function lt(t){return Array.isArray(t)?t:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&"number"==typeof t.length?Array.from(t):[t]}function ht(t,e){return lt("string"==typeof t?(e||document).querySelectorAll(t):t)}const dt=Object.freeze({$(t){return ht(t,this.root)[0]},$$(t){return ht(t,this.root)}}),pt=Object.freeze({shouldUpdate:T,onBeforeMount:T,onMounted:T,onBeforeUpdate:T,onUpdated:T,onBeforeUnmount:T,onUnmounted:T}),mt=t=>1===t.length?t[0]:t;function ft(t,e,n){const r="object"==typeof e?e:{[e]:n},s=Object.keys(r);return lt(t).forEach((t=>{s.forEach((e=>t.setAttribute(e,r[e])))})),t}const bt=new Map;var gt;const vt={CSS_BY_NAME:bt,add(t,e){return bt.has(t)||(bt.set(t,e),this.inject()),this},inject(){return(gt||(ft(gt=ht("style[riot]")[0]||document.createElement("style"),"type","text/css"),gt.parentNode||document.head.appendChild(gt),gt)).innerHTML=[...bt.values()].join("\n"),this},remove(t){return bt.has(t)&&(bt.delete(t),this.inject()),this}};function yt(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var e=arguments.length,r=Array(e),s=0;s<e;s++)r[s]=arguments[s];return(r=[...n,...r]).length<t.length?yt(t,...r):t(...r)}}function Ot(t){return function(t,e,n){const r=["is"];return mt(lt(t).map((t=>mt(r.map((e=>t.getAttribute(e)))))))}(t)||t.tagName.toLowerCase()}function jt(t,e){return Object.assign({},t,w(e))}function Nt(t,e){let{slots:n,attributes:r,props:s}=e;return u=function(t){return[...l].reduce(((t,e)=>e(t)||t),t)}(k(i(t)?Object.create(t):t,{mount(e,o,i){return void 0===o&&(o={}),D(e,g,!1),this[y]=i,this[O]=function(t,e){void 0===e&&(e=[]);const n=e.map((e=>Z(t,e))),r={};return Object.assign(r,Object.assign({expressions:n},ct((t=>e=>(n.forEach((n=>n[t](e))),r)))))}(e,r).mount(i),D(this,m,Object.freeze(Object.assign({},function(t,e){return void 0===e&&(e={}),Object.assign({},function(t){return Array.from(t.attributes).reduce(((t,e)=>(t[N(e.name)]=e.value,t)),{})}(t),w(e))}(e,s),C(this[O].expressions)))),this.state=jt(this.state,o),this[j]=this.template.createDOM(e).clone(),at(e,this),t.name&&function(t,e){Ot(t)!==e&&ft(t,"is",e)}(e,t.name),D(this,b,e),D(this,f,n),this.onBeforeMount(this.props,this.state),this[j].mount(e,this,i),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[y]=e,this[O].update(e));const n=C(this[O].expressions);if(!1!==this.shouldUpdate(n,this.props))return D(this,m,Object.freeze(Object.assign({},this.props,n))),this.state=jt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[v]||(this[v]=!0,this[j].update(this,this[y])),this.onUpdated(this.props,this.state),this[v]=!1,this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[O].unmount(),this[j].unmount(this,this[y],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter((e=>o(t[e]))).forEach((t=>{u[t]=u[t].bind(u)})),u;var u}function xt(t){let{css:e,template:n,componentAPI:r,name:s}=t;return e&&s&&vt.add(s,e),yt(Nt)(k(L(r,Object.assign({},pt,{[m]:{},state:{}})),Object.assign({[f]:null,[b]:null},dt,{name:s,css:e,template:n})))}function Mt(t){const{css:n,template:r,exports:s,name:o}=t,i=r?function(t,n){const r=function(t){return void 0===t&&(t={}),Object.entries(w(t)).reduce(((t,e)=>{let[n,r]=e;var s;return t[(s=n,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=Mt(r),t}),{})}(n.exports?n.exports.components:{});return t(ut,A,e,(t=>t===n.name?Et(n):r[t]||a.get(t)))}(r,t):B;return t=>{let{slots:e,attributes:u,props:a}=t;if(s&&s[g])return function(t,e){let{slots:n,attributes:r,props:s,css:o,template:i}=e;const u=L(t({slots:n,attributes:r,props:s}),U);return ct((t=>function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(t===h){const[t]=n;D(t,g,!0),at(t,u)}return u[t](...n),u}))}(s,{slots:e,attributes:u,props:a,css:n,template:r});const c=w(s)||{},l=xt({css:n,template:i,componentAPI:c,name:o})({slots:e,attributes:u,props:a});return{mount:(t,e,n)=>l.mount(t,n,e),update:(t,e)=>l.update(e,t),unmount:t=>l.unmount(t)}}}const Et=S(Mt),At={cssManager:vt,DOMBindings:{template:ut,createBinding:ot,createExpression:Z,bindingTypes:e,expressionTypes:A},globals:{DOM_COMPONENT_INSTANCE_PROPERTY:c,PARENT_KEY_SYMBOL:y}};t.__=At,t.component=function(t){return function(e,n,r){let{slots:s,attributes:o,parentScope:i}=void 0===r?{}:r;return function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>function(){return t(e(...arguments))}))}((t=>t.mount(e,i)),(t=>t({props:n,slots:s,attributes:o})),Mt)(t)}},t.install=function(t){return o(t),l.has(t),l.add(t),l},t.mount=function(t,e,n){return ht(t).map((t=>function(t,e,n,r){const s=n||Ot(t);return a.has(s),a.get(s)({props:e,slots:void 0}).mount(t)}(t,e,n)))},t.pure=function(t){return o(t),t[g]=!0,t},t.register=function(t,e){let{css:n,template:r,exports:s}=e;return a.has(t),a.set(t,Mt({name:t,css:n,template:r,exports:s})),a},t.uninstall=function(t){return l.has(t),l.delete(t),l},t.unmount=function(t,e){return ht(t).map((t=>(t[c]&&t[c].unmount(e),t)))},t.unregister=function(t){return a.has(t),a.delete(t),vt.remove(t),a},t.version="v7.0.6",t.withTypes=t=>t,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).riot={});
var t,e;t=this,e=function(t){"use strict";const e={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};function n(t,e){return typeof t===e}function r(t){const e=t.ownerSVGElement;return!!e||null===e}function s(t){return"template"===t.tagName.toLowerCase()}function o(t){return n(t,"function")}function i(t){return!u(t)&&t.constructor===Object}function u(t){return null==t}const a=new Map,c=Symbol(),l=new Set,h="mount",d="update",p="unmount",m="props",f="slots",b="root",g=Symbol(),v=Symbol(),y=Symbol(),O=Symbol(),j=Symbol();function N(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function x(t){for(;t.firstChild;)t.removeChild(t.firstChild)}const M=t=>t.remove(),E=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),A={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};function T(){return this}function w(t){return o(t)?t.prototype&&t.prototype.constructor?new t:t():t}function S(t){const e=new Map,n=n=>(e.has(n)||e.set(n,t.call(this,n)))&&e.get(n);return n.cache=e,n}function C(t){return t.reduce(((t,e)=>{const{value:n,type:r}=e;switch(!0){case!e.name&&0===r:return Object.assign({},t,n);case 3===r:t.value=e.value;break;default:t[N(e.name)]=e.value}return t}),{})}function D(t,e,n,r){return void 0===r&&(r={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},r)),t}function k(t,e,n){return Object.entries(e).forEach((e=>{let[r,s]=e;D(t,r,s,n)})),t}function L(t,e){return Object.entries(e).forEach((e=>{let[n,r]=e;t[n]||(t[n]=r)})),t}const U=Object.freeze({[h]:T,[d]:T,[p]:T}),B=Object.assign({},U,{clone:T,createDOM:T}),I=Symbol(),P=Symbol(),_=Symbol(),$={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:s}=this,o=t===_?null:this.evaluate(t),i=o?Array.from(o):[],{newChildrenMap:u,batches:a,futureNodes:c}=function(t,e,n,r){const{condition:s,template:o,childrenMap:i,itemName:u,getKey:a,indexName:c,root:l,isTemplateTag:h}=r,d=new Map,p=[],m=[];return t.forEach(((t,r)=>{const f=function(t,e){let{itemName:n,indexName:r,index:s,item:o}=e;return D(t,n,o),r&&D(t,r,s),t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(f):r,g=i.get(b),v=[];if(function(t,e){return!!t&&!t(e)}(s,f))return;const y=!g,O=g?g.template:o.clone(),j=O.el||l.cloneNode(),N=h&&y?function(t){const e=t.dom.cloneNode(!0),{head:n,tail:r}=function(){const t=document.createTextNode(""),e=document.createTextNode("");return t[I]=!0,e[P]=!0,{head:t,tail:e}}();return{avoidDOMInjection:!0,fragment:e,head:n,tail:r,children:[n,...Array.from(e.childNodes),r]}}(O):O.meta;y?p.push((()=>O.mount(j,f,n,N))):p.push((()=>O.update(f,n))),h?v.push(...N.children):v.push(j),i.delete(b),m.push(...v),d.set(b,{nodes:v,template:O,context:f,index:r})})),{newChildrenMap:d,batches:p,futureNodes:m}}(i,t,e,this);return((t,e,n,r)=>{const s=e.length;let o=t.length,i=s,u=0,a=0,c=null;for(;u<o||a<i;)if(o===u){const t=i<s?a?n(e[a-1],-0).nextSibling:n(e[i-a],0):r;for(;a<i;)E(n(e[a++],1),t)}else if(i===a)for(;u<o;)c&&c.has(t[u])||M(n(t[u],-1)),u++;else if(t[u]===e[a])u++,a++;else if(t[o-1]===e[i-1])o--,i--;else if(t[u]===e[i-1]&&e[a]===t[o-1]){const r=n(t[--o],-1).nextSibling;E(n(e[a++],1),n(t[u++],-1).nextSibling),E(n(e[--i],1),r),t[o]=e[i]}else{if(!c){c=new Map;let t=a;for(;t<i;)c.set(e[t],t++)}if(c.has(t[u])){const r=c.get(t[u]);if(a<r&&r<i){let s=u,d=1;for(;++s<o&&s<i&&c.get(t[s])===r+d;)d++;if(d>r-a){const s=n(t[u],0);for(;a<r;)E(n(e[a++],1),s)}else l=n(e[a++],1),(h=n(t[u++],-1))&&h.parentNode&&h.parentNode.replaceChild(l,h)}else u++}else M(n(t[u++],-1))}var l,h})(r,c,function(t,e){return(n,r)=>{if(r<0){const n=t[t.length-1];if(n){const{template:r,nodes:s,context:o}=n;s.pop(),s.length||(t.pop(),r.unmount(o,e,null))}}return n}}(Array.from(s.values()),e),n),a.forEach((t=>t())),this.childrenMap=u,this.nodes=c,this},unmount(t,e){return this.update(_,e),this}},z={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,s=this.value&&!n,o=()=>{const n=this.node.cloneNode();E(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:o();break;case s:this.unmount(t);break;default:n&&this.template.update(t,e)}return this.value=n,this},unmount(t,e){return this.template.unmount(t,e,!0),this}},H="undefined"==typeof Element?{}:Element.prototype,K=S((t=>H.hasOwnProperty(t))),R=/^on/,Y={handleEvent(t){this[t.type](t)}},F=new WeakMap;function V(t){return u(t)?"":t}const q=(t,e)=>{const n=t.childNodes[e];if(n.nodeType===Node.COMMENT_NODE){const e=document.createTextNode("");return t.replaceChild(e,n),e}return n},G={0:function t(e,r,s,u){let{name:a}=r;if(!a)return u&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter((t=>!r.includes(t))).forEach((e=>t.removeAttribute(e)))}(e,s,u),void(s&&function(e,n){Object.entries(n).forEach((n=>{let[r,s]=n;return t(e,{name:r},s)}))}(e,s));!K(a)&&(function(t){return n(t,"boolean")}(s)||i(s)||o(s))&&(e[a]=s),function(t){return!t&&0!==t}(s)?e.removeAttribute(a):function(t){return!0===t||["string","number"].includes(typeof t)}(s)&&e.setAttribute(a,function(t,e){return!0===e?t:e}(a,s))},1:function(t,e,n){let{name:r}=e;const s=r.replace(R,""),o=F.get(t)||(t=>{const e=Object.create(Y);return F.set(t,e),e})(t),[i,u]=(t=>Array.isArray(t)?t:[t,!1])(n),a=o[s],c=i&&!a;a&&!i&&t.removeEventListener(s,o),c&&t.addEventListener(s,o,u),o[s]=i},2:function(t,e,n){t.data=V(n)},3:function(t,e,n){t.value=V(n)}},W={mount(t){return this.value=this.evaluate(t),X(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(X(this,e),this.value=e),this},unmount(){return 1===this.type&&X(this,null),this}};function X(t,e){return G[t.type](t.node,t,e,t.value)}function Z(t,e){return Object.assign({},W,e,{node:2===e.type?q(t,e.childNodeIndex):t})}const J=(t,e)=>t[y]||e,Q={attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map((t=>Object.assign({},t,{value:t.evaluate(e)})));return Object.assign(Object.create(n||null),C(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find((t=>{let{id:e}=t;return e===this.name})),{parentNode:r}=this.node,s=J(t,e);return this.template=n&&ut(n.html,n.bindings).createDOM(r),this.template&&(x(this.node),this.template.mount(this.node,this.getTemplateScope(t,s),s),this.template.children=Array.from(this.node.childNodes)),tt(this.node),M(this.node),this},update(t,e){if(this.template){const n=J(t,e);this.template.update(this.getTemplateScope(t,n),n)}return this},unmount(t,e,n){return this.template&&this.template.unmount(this.getTemplateScope(t,e),null,n),this}};function tt(t){const e=t&&t.firstChild;e&&(E(e,t),tt(t))}function et(t){return t.reduce(((t,e)=>{let{bindings:n}=e;return t.concat(n)}),[])}const nt={mount(t){return this.update(t)},update(t,e){const n=this.evaluate(t);return n&&n===this.name?this.tag.update(t):(this.unmount(t,e,!0),this.name=n,this.tag=(r=this.getComponent(n),void 0===(s=this.slots)&&(s=[]),void 0===(o=this.attributes)&&(o=[]),r?r({slots:s,attributes:o}):ut(function(t){return t.reduce(((t,e)=>t+e.html),"")}(s),[...et(s),{expressions:o.map((t=>Object.assign({type:0},t)))}])),this.tag.mount(this.node,t)),this;var r,s,o},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}},rt={1:function(t,e){let{evaluate:n,template:r}=e;const s=document.createTextNode("");return E(s,t),M(t),Object.assign({},z,{node:t,evaluate:n,placeholder:s,template:r.createDOM(t)})},2:function(t,e){let{expressions:n}=e;return Object.assign({},(r=n.map((e=>Z(t,e))),["mount","update","unmount"].reduce(((t,e)=>Object.assign({},t,{[e]:t=>r.map((n=>n[e](t)))&&void 0})),{})));var r},0:function(t,e){let{evaluate:n,condition:r,itemName:o,indexName:i,getKey:u,template:a}=e;const c=document.createTextNode(""),l=t.cloneNode();return E(c,t),M(t),Object.assign({},$,{childrenMap:new Map,node:t,root:l,condition:r,evaluate:n,isTemplateTag:s(l),template:a.createDOM(t),getKey:u,indexName:i,itemName:o,placeholder:c})},3:function(t,e){let{evaluate:n,getComponent:r,slots:s,attributes:o}=e;return Object.assign({},nt,{node:t,evaluate:n,slots:s,attributes:o,getComponent:r})},4:function(t,e){let{name:n,attributes:r}=e;return Object.assign({},Q,{attributes:r,node:t,name:n})}};function st(t,e){return t.map((t=>2===t.type?Object.assign({},t,{childNodeIndex:t.childNodeIndex+e}):t))}function ot(t,e,n){const{selector:r,type:s,redundantAttribute:o,expressions:i}=e,u=r?t.querySelector(r):t;o&&u.removeAttribute(o);const a=i||[];return(rt[s]||rt[2])(u,Object.assign({},e,{expressions:n&&!r?st(a,n):a}))}const it={createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?function(t,e){return r(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=s(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}(t,e):e)}(t,this.html)||document.createDocumentFragment(),this},mount(t,e,n,o){void 0===o&&(o={}),this.el&&this.unmount(e);const{fragment:i,children:u,avoidDOMInjection:a}=o,{parentNode:c}=u?u[0]:t,l=s(t),h=l?function(t,e,n){const r=Array.from(t.childNodes);return Math.max(r.indexOf(e),r.indexOf(n.head)+1,0)}(c,t,o):null;this.createDOM(t);const d=i||this.dom.cloneNode(!0);return this.el=l?c:t,this.children=l?u||Array.from(d.childNodes):null,!a&&d&&function(t,e){switch(!0){case r(t):!function(t,e){for(;t.firstChild;)e.appendChild(t.firstChild)}(e,t);break;case s(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}(t,d),this.bindings=this.bindingsData.map((t=>ot(this.el,t,h))),this.bindings.forEach((t=>t.mount(e,n))),this.meta=o,this},update(t,e){return this.bindings.forEach((n=>n.update(t,e))),this},unmount(t,e,n){void 0===n&&(n=!1);const r=this.el;if(!r)return this;switch(this.bindings.forEach((r=>r.unmount(t,e,n))),!0){case r[g]||null===n:break;case Array.isArray(this.children):!function(t){for(let e=0;e<t.length;e++)M(t[e])}(this.children);break;case!n:x(r);break;case!!n:M(r)}return this.el=null,this},clone(){return Object.assign({},this,{meta:{},el:null})}};function ut(t,e){return void 0===e&&(e=[]),Object.assign({},it,{html:t,bindingsData:e})}const at=(t,e)=>t[c]=e;function ct(t){return[h,d,p].reduce(((e,n)=>(e[n]=t(n),e)),{})}function lt(t){return Array.isArray(t)?t:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&"number"==typeof t.length?Array.from(t):[t]}function ht(t,e){return lt("string"==typeof t?(e||document).querySelectorAll(t):t)}const dt=Object.freeze({$(t){return ht(t,this.root)[0]},$$(t){return ht(t,this.root)}}),pt=Object.freeze({shouldUpdate:T,onBeforeMount:T,onMounted:T,onBeforeUpdate:T,onUpdated:T,onBeforeUnmount:T,onUnmounted:T}),mt=t=>1===t.length?t[0]:t;function ft(t,e,n){const r="object"==typeof e?e:{[e]:n},s=Object.keys(r);return lt(t).forEach((t=>{s.forEach((e=>t.setAttribute(e,r[e])))})),t}const bt=new Map;var gt;const vt={CSS_BY_NAME:bt,add(t,e){return bt.has(t)||(bt.set(t,e),this.inject()),this},inject(){return(gt||(ft(gt=ht("style[riot]")[0]||document.createElement("style"),"type","text/css"),gt.parentNode||document.head.appendChild(gt),gt)).innerHTML=[...bt.values()].join("\n"),this},remove(t){return bt.has(t)&&(bt.delete(t),this.inject()),this}};function yt(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var e=arguments.length,r=Array(e),s=0;s<e;s++)r[s]=arguments[s];return(r=[...n,...r]).length<t.length?yt(t,...r):t(...r)}}function Ot(t){return function(t,e,n){const r=["is"];return mt(lt(t).map((t=>mt(r.map((e=>t.getAttribute(e)))))))}(t)||t.tagName.toLowerCase()}function jt(t,e){return Object.assign({},t,w(e))}function Nt(t,e){let{slots:n,attributes:r,props:s}=e;return u=function(t){return[...l].reduce(((t,e)=>e(t)||t),t)}(k(i(t)?Object.create(t):t,{mount(e,o,i){return void 0===o&&(o={}),D(e,g,!1),this[y]=i,this[O]=function(t,e){void 0===e&&(e=[]);const n=e.map((e=>Z(t,e))),r={};return Object.assign(r,Object.assign({expressions:n},ct((t=>e=>(n.forEach((n=>n[t](e))),r)))))}(e,r).mount(i),D(this,m,Object.freeze(Object.assign({},function(t,e){return void 0===e&&(e={}),Object.assign({},function(t){return Array.from(t.attributes).reduce(((t,e)=>(t[N(e.name)]=e.value,t)),{})}(t),w(e))}(e,s),C(this[O].expressions)))),this.state=jt(this.state,o),this[j]=this.template.createDOM(e).clone(),at(e,this),t.name&&function(t,e){Ot(t)!==e&&ft(t,"is",e)}(e,t.name),D(this,b,e),D(this,f,n),this.onBeforeMount(this.props,this.state),this[j].mount(e,this,i),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[y]=e,this[O].update(e));const n=C(this[O].expressions);if(!1!==this.shouldUpdate(n,this.props))return D(this,m,Object.freeze(Object.assign({},this.props,n))),this.state=jt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[v]||(this[v]=!0,this[j].update(this,this[y])),this.onUpdated(this.props,this.state),this[v]=!1,this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[O].unmount(),this[j].unmount(this,this[y],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter((e=>o(t[e]))).forEach((t=>{u[t]=u[t].bind(u)})),u;var u}function xt(t){let{css:e,template:n,componentAPI:r,name:s}=t;return e&&s&&vt.add(s,e),yt(Nt)(k(L(r,Object.assign({},pt,{[m]:{},state:{}})),Object.assign({[f]:null,[b]:null},dt,{name:s,css:e,template:n})))}const Mt=S(Et);function Et(t){const{css:n,template:r,exports:s,name:o}=t,i=r?function(t,n,r){return t(ut,A,e,r)}(r,0,(t=>{const e=(void 0===(n=t.exports?t.exports.components:{})&&(n={}),Object.entries(w(n)).reduce(((t,e)=>{let[n,r]=e;var s;return t[(s=n,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=Et(r),t}),{}));var n;return n=>n===t.name?Mt(t):e[n]||a.get(n)})(t)):B;return t=>{let{slots:e,attributes:u,props:a}=t;if(s&&s[g])return function(t,e){let{slots:n,attributes:r,props:s,css:o,template:i}=e;const u=L(t({slots:n,attributes:r,props:s}),U);return ct((t=>function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(t===h){const[t]=n;D(t,g,!0),at(t,u)}return u[t](...n),u}))}(s,{slots:e,attributes:u,props:a,css:n,template:r});const c=w(s)||{},l=xt({css:n,template:i,componentAPI:c,name:o})({slots:e,attributes:u,props:a});return{mount:(t,e,n)=>l.mount(t,n,e),update:(t,e)=>l.update(e,t),unmount:t=>l.unmount(t)}}}const At={cssManager:vt,DOMBindings:{template:ut,createBinding:ot,createExpression:Z,bindingTypes:e,expressionTypes:A},globals:{DOM_COMPONENT_INSTANCE_PROPERTY:c,PARENT_KEY_SYMBOL:y}};t.__=At,t.component=function(t){return function(e,n,r){let{slots:s,attributes:o,parentScope:i}=void 0===r?{}:r;return function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>function(){return t(e(...arguments))}))}((t=>t.mount(e,i)),(t=>t({props:n,slots:s,attributes:o})),Et)(t)}},t.install=function(t){return o(t),l.has(t),l.add(t),l},t.mount=function(t,e,n){return ht(t).map((t=>function(t,e,n,r){const s=n||Ot(t);return a.has(s),a.get(s)({props:e,slots:void 0}).mount(t)}(t,e,n)))},t.pure=function(t){return o(t),t[g]=!0,t},t.register=function(t,e){let{css:n,template:r,exports:s}=e;return a.has(t),a.set(t,Et({name:t,css:n,template:r,exports:s})),a},t.uninstall=function(t){return l.has(t),l.delete(t),l},t.unmount=function(t,e){return ht(t).map((t=>(t[c]&&t[c].unmount(e),t)))},t.unregister=function(t){return a.has(t),a.delete(t),vt.remove(t),a},t.version="v7.0.7",t.withTypes=t=>t,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).riot={});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc