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 9.1.2 to 9.1.3

esm/utils/get-root-computed-attribute-names.js

2

esm/api/__.js

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import bindingTypes from '../dependencies/@riotjs/util/binding-types.js';

@@ -3,0 +3,0 @@ import { DOM_COMPONENT_INSTANCE_PROPERTY, PARENT_KEY_SYMBOL } from '../dependencies/@riotjs/util/constants.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import compose from '../dependencies/cumpa/index.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { isFunction } from '../dependencies/@riotjs/util/checks.js';

@@ -3,0 +3,0 @@ import { PLUGINS_SET } from '../dependencies/@riotjs/util/constants.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { isFunction } from '../dependencies/@riotjs/util/checks.js';

@@ -3,0 +3,0 @@ import { IS_PURE_SYMBOL } from '../dependencies/@riotjs/util/constants.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { panic } from '../dependencies/@riotjs/util/misc.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { PLUGINS_SET } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { panic } from '../dependencies/@riotjs/util/misc.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

@@ -3,0 +3,0 @@ import { DOM_COMPONENT_INSTANCE_PROPERTY } from '../dependencies/@riotjs/util/constants.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { panic } from '../dependencies/@riotjs/util/misc.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
/** @type {string} current riot version */
const version = 'v9.1.2';
const version = 'v9.1.3';
export { version };

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
/**

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { compile } from '../dependencies/@riotjs/compiler/dist/compiler.essential.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { compile } from '../dependencies/@riotjs/compiler/dist/compiler.essential.js';

@@ -6,2 +6,3 @@

const response = await fetch(url);
const code = await response.text();

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

@@ -3,0 +3,0 @@ import { compileFromUrl } from './compile-from-url.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import createRuntimeSlots from '../utils/create-runtime-slots.js';

@@ -3,0 +3,0 @@ import { component as component$1 } from '../api/component.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { GLOBAL_REGISTRY } from './global-registry.js';

@@ -6,6 +6,5 @@

function defineWindowRiotGlobalRegistry() {
if (window[GLOBAL_REGISTRY]) return
window[GLOBAL_REGISTRY] = {};
window[GLOBAL_REGISTRY] = window[GLOBAL_REGISTRY] || {};
}
export { defineWindowRiotGlobalRegistry };

@@ -1,15 +0,27 @@

/* Riot v9.1.2, @license MIT */
// evaluates a compiled tag within the global context
function evaluate(js, url) {
/* Riot v9.1.3, @license MIT */
const isBrowser = typeof process === 'undefined';
/* c8 ignore start */
const evaluateWithScriptInjection = (code, url) => {
const node = document.createElement('script');
const root = document.documentElement;
// make the source available in the "(no domain)" tab
// of Chrome DevTools, with a .js extension
if (url) node.text = `${js}\n//# sourceURL=${url}.js`;
node.text = url ? `${code}\n//# sourceURL=${url}.js` : code;
root.appendChild(node);
root.removeChild(node);
};
/* c8 ignore end */
// evaluates a compiled tag within the global context
function evaluate(code, url) {
// browsers can evaluate the code via script injection and sourcemaps
/* c8 ignore start */
if (isBrowser) evaluateWithScriptInjection(code, url);
/* c8 ignore end */
// in other environments we rely on a simple Function eval
else new Function(code)();
}
export { evaluate };

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
const GLOBAL_REGISTRY = '__riot_registry__';
export { GLOBAL_REGISTRY };

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { GLOBAL_REGISTRY } from './global-registry.js';

@@ -3,0 +3,0 @@ import { defineWindowRiotGlobalRegistry } from './define-window-riot-global-registry.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

@@ -3,0 +3,0 @@ import createRuntimeSlots from '../utils/create-runtime-slots.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
// cheap module transpilation

@@ -3,0 +3,0 @@ function transpile(code) {

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { IS_DIRECTIVE } from '../dependencies/@riotjs/util/constants.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { DOM_COMPONENT_INSTANCE_PROPERTY } from '../dependencies/@riotjs/util/constants.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { SHOULD_UPDATE_KEY, ON_BEFORE_MOUNT_KEY, ON_MOUNTED_KEY, ON_BEFORE_UPDATE_KEY, ON_UPDATED_KEY, ON_BEFORE_UNMOUNT_KEY, ON_UNMOUNTED_KEY } from '../dependencies/@riotjs/util/constants.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { template as create } from '../dependencies/@riotjs/dom-bindings/dist/dom-bindings.js';

@@ -3,0 +3,0 @@ import expressionTypes from '../dependencies/@riotjs/util/expression-types.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { callOrAssign } from '../dependencies/@riotjs/util/functions.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { DOMattributesToObject } from '../dependencies/@riotjs/util/dom.js';

@@ -3,0 +3,0 @@ import { callOrAssign } from '../dependencies/@riotjs/util/functions.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { createCoreAPIMethods } from './create-core-api-methods.js';

@@ -3,0 +3,0 @@ import { createExpression as create$4 } from '../dependencies/@riotjs/dom-bindings/dist/dom-bindings.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { IS_PURE_SYMBOL, COMPONENTS_IMPLEMENTATION_MAP } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { camelToDashCase } from '../dependencies/@riotjs/util/strings.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { MOUNT_METHOD_KEY, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY } from '../dependencies/@riotjs/util/constants.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { MOUNT_METHOD_KEY, IS_PURE_SYMBOL } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { panic } from '../dependencies/@riotjs/util/misc.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import $ from '../dependencies/bianco.query/index.next.js';

@@ -3,0 +3,0 @@ import { set } from '../dependencies/bianco.attr/index.next.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { SLOTS_KEY, ROOT_KEY, PROPS_KEY, STATE_KEY } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { defineProperties, defineDefaults } from '../dependencies/@riotjs/util/objects.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { isFunction, isObject } from '../dependencies/@riotjs/util/checks.js';

@@ -14,2 +14,3 @@ import { IS_PURE_SYMBOL, PARENT_KEY_SYMBOL, ATTRIBUTES_KEY_SYMBOL, PROPS_KEY, 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, IS_DIRECTIVE } from '../dependencies/@riotjs/util/constants.js';

import { runPlugins } from './run-plugins.js';
import { getRootComputedAttributeNames } from '../utils/get-root-computed-attribute-names.js';

@@ -79,7 +80,20 @@ /**

// get the attribute names that don't belong to the the props object
// this will avoid recursive props rendering https://github.com/riot/riot/issues/2994
const computedAttributeNames = getRootComputedAttributeNames(
this[TEMPLATE_KEY_SYMBOL],
);
// filter out the computed attributes from the root node
const staticRootAttributes = Array.from(
this[ROOT_KEY].attributes,
).filter(({ name }) => !computedAttributeNames.includes(name));
// evaluate the
const domNodeAttributes = DOMattributesToObject({
attributes: staticRootAttributes,
});
// Avoid adding the riot "is" directives to the component props
// eslint-disable-next-line no-unused-vars
const { [IS_DIRECTIVE]: _, ...newProps } = {
// make sure that the root node attributes will be always parsed
...DOMattributesToObject(this[ROOT_KEY]),
...domNodeAttributes,
...evaluateAttributeExpressions(

@@ -86,0 +100,0 @@ this[ATTRIBUTES_KEY_SYMBOL].expressions,

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { MOUNT_METHOD_KEY, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { removeChild, cleanNode } from '../dependencies/@riotjs/util/dom.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { COMPONENTS_IMPLEMENTATION_MAP } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { panic } from '../dependencies/@riotjs/util/misc.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { MOUNT_METHOD_KEY, UPDATE_METHOD_KEY, UNMOUNT_METHOD_KEY } from '../dependencies/@riotjs/util/constants.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { PLUGINS_SET } from '../dependencies/@riotjs/util/constants.js';

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

@@ -68,2 +68,10 @@ /* Riot WIP, @license MIT */

export { checkType, isBoolean, isFunction, isNil, isObject, isSvg, isTemplate };
/**
* Detect node js environment
* @returns {boolean} true if the runtime is node
*/
function isNode() {
return typeof globalThis.process !== 'undefined'
}
export { checkType, isBoolean, isFunction, isNil, isNode, isObject, isSvg, isTemplate };

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import * as compiler_essential from './dependencies/@riotjs/compiler/dist/compiler.essential.js';

@@ -3,0 +3,0 @@ export { compiler_essential as compiler };

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
export { register } from './api/register.js';

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

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { template as create } from '../dependencies/@riotjs/dom-bindings/dist/dom-bindings.js';

@@ -3,0 +3,0 @@ import bindingTypes from '../dependencies/@riotjs/util/binding-types.js';

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

/* Riot v9.1.2, @license MIT */
/* Riot v9.1.3, @license MIT */
import { IS_DIRECTIVE } from '../dependencies/@riotjs/util/constants.js';

@@ -3,0 +3,0 @@ import { get } from '../dependencies/bianco.attr/index.next.js';

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

@@ -60,3 +60,3 @@ "license": "MIT",

"scripts": {
"test": "make riot"
"test": "make unit-test"
},

@@ -70,33 +70,36 @@ "jsnext:main": "esm/riot.js",

"devDependencies": {
"@riotjs/compiler": "^9.0.6",
"@riotjs/compiler": "^9.0.7",
"@riotjs/prettier-config": "^1.1.0",
"@riotjs/register": "^9.0.0",
"@riotjs/util": "^2.2.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@testing-library/user-event": "^14.5.2",
"@wdio/cli": "^8.31.1",
"@wdio/local-runner": "^8.31.1",
"@wdio/mocha-framework": "^8.31.1",
"@wdio/sauce-service": "^8.31.1",
"@wdio/spec-reporter": "^8.31.1",
"bianco.attr": "^1.1.1",
"bianco.query": "^1.1.4",
"chai": "^4.3.10",
"c8": "^9.1.0",
"chai": "^4.4.1",
"cumpa": "^2.0.1",
"curri": "^2.0.3",
"eslint": "^8.54.0",
"eslint-config-riot": "^4.1.1",
"eslint-plugin-import": "^2.29.0",
"jsdom": "23.0.1",
"jsdom-global": "3.0.2",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-mocha": "^2.0.1",
"karma-rollup-preprocessor": "^7.0.8",
"karma-sauce-launcher": "^4.3.6",
"mocha": "^10.2.0",
"prettier": "^3.1.0",
"rollup": "^4.6.1",
"rollup-plugin-istanbul": "^5.0.0",
"eslint": "^8.56.0",
"eslint-config-riot": "^4.1.2",
"eslint-plugin-import": "^2.29.1",
"jsdom": "^24.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.3.0",
"prettier": "^3.2.5",
"rollup": "^4.9.6",
"rollup-plugin-riot": "^9.0.2",
"serve": "^14.2.1",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"terser": "^5.24.0",
"typescript": "^5.3.2"
"start-server-and-test": "^2.0.3",
"terser": "^5.27.0",
"typescript": "^5.3.3"
}
}

@@ -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 o(t){return"template"===t.tagName.toLowerCase()}function s(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="is",d="mount",p="update",m="unmount",f="shouldUpdate",b="onBeforeMount",g="onMounted",y="onBeforeUpdate",v="onUpdated",N="onBeforeUnmount",O="onUnmounted",x="props",E="state",M="slots",T="root",j=Symbol(),A=Symbol(),w=Symbol(),S=Symbol(),C=Symbol();function D(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function k(t){return Array.from(t.attributes).reduce(((t,e)=>(t[D(e.name)]=e.value,t)),{})}function L(t){for(;t.firstChild;)t.removeChild(t.firstChild)}const I=t=>t.remove(),P=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),B=0,_=2,U=3,$={ATTRIBUTE:B,EVENT:1,TEXT:_,VALUE:U};function z(){return this}function H(t){return s(t)?t.prototype&&t.prototype.constructor?new t:t():t}function K(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 R(t){return t.reduce(((t,e)=>{const{value:n,type:r}=e;switch(!0){case!e.name&&r===B:return{...t,...n};case r===U:t.value=e.value;break;default:t[D(e.name)]=e.value}return t}),{})}function Y(t,e,n,r={}){return Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!1,configurable:!0,...r}),t}function F(t,e,n){return Object.entries(e).forEach((([e,r])=>{Y(t,e,r,n)})),t}function V(t,e){return Object.entries(e).forEach((([e,n])=>{t[e]||(t[e]=n)})),t}const q={[d](t){this.el=t},[p]:z,[m](t,e,n=!1){n?I(this.el):n||L(this.el)},clone:z,createDOM:z},G=Symbol(),W=Symbol(),X=Symbol(),Z={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:o}=this,s=t===X?null:this.evaluate(t),i=s?Array.from(s):[],{newChildrenMap:u,batches:a,futureNodes:c}=function(t,e,n,r){const{condition:o,template:s,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,{itemName:e,indexName:n,index:r,item:o}){return Y(t,e,o),n&&Y(t,n,r),t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(f):r,g=i.get(b),y=[];if(function(t,e){return!!t&&!t(e)}(o,f))return;const v=!g,N=g?g.template:s.clone(),O=N.el||l.cloneNode(),x=h&&v?function(t){const e=t.dom.cloneNode(!0),{head:n,tail:r}=function(){const t=document.createTextNode(""),e=document.createTextNode("");return t[G]=!0,e[W]=!0,{head:t,tail:e}}();return{avoidDOMInjection:!0,fragment:e,head:n,tail:r,children:[n,...Array.from(e.childNodes),r]}}(N):N.meta;v?p.push((()=>N.mount(O,f,n,x))):p.push((()=>N.update(f,n))),h?y.push(...x.children):y.push(O),i.delete(b),m.push(...y),d.set(b,{nodes:y,template:N,context:f,index:r})})),{newChildrenMap:d,batches:p,futureNodes:m}}(i,t,e,this);return((t,e,n,r)=>{const o=e.length;let s=t.length,i=o,u=0,a=0,c=null;for(;u<s||a<i;)if(s===u){const t=i<o?a?n(e[a-1],-0).nextSibling:n(e[i-a],0):r;for(;a<i;)P(n(e[a++],1),t)}else if(i===a)for(;u<s;)c&&c.has(t[u])||I(n(t[u],-1)),u++;else if(t[u]===e[a])u++,a++;else if(t[s-1]===e[i-1])s--,i--;else if(t[u]===e[i-1]&&e[a]===t[s-1]){const r=n(t[--s],-1).nextSibling;P(n(e[a++],1),n(t[u++],-1).nextSibling),P(n(e[--i],1),r),t[s]=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 o=u,d=1;for(;++o<s&&o<i&&c.get(t[o])===r+d;)d++;if(d>r-a){const o=n(t[u],0);for(;a<r;)P(n(e[a++],1),o)}else l=n(e[a++],1),(h=n(t[u++],-1))&&h.parentNode&&h.parentNode.replaceChild(l,h)}else u++}else I(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:o,context:s}=n;o.pop(),o.length||(t.pop(),r.unmount(s,e,null))}}return n}}(Array.from(o.values()),e),n),a.forEach((t=>t())),this.childrenMap=u,this.nodes=c,this},unmount(t,e){return this.update(X,e),this}},J={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,o=this.value&&!n,s=()=>{const n=this.node.cloneNode();P(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:s();break;case o: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}},Q="undefined"==typeof Element?{}:Element.prototype,tt=K((t=>Q.hasOwnProperty(t))),et=/^on/,nt={handleEvent(t){this[t.type](t)}},rt=new WeakMap;function ot(t){return u(t)?"":t}const st=(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},it={[B]:function t(e,{name:r,isBoolean:o},u,a){if(!r)return a&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter((t=>!r.includes(t))).forEach((e=>t.removeAttribute(e)))}(e,u,a),void(u&&function(e,n){Object.entries(n).forEach((([n,r])=>t(e,{name:n},r)))}(e,u));!tt(r)&&(function(t){return n(t,"boolean")}(u)||i(u)||s(u))&&(e[r]=u),function(t,e){return e?!t&&0!==t:null==t}(u,o)?e.removeAttribute(r):function(t){return["string","number","boolean"].includes(typeof t)}(u)&&e.setAttribute(r,function(t,e,n){return!0===e&&n?t:e}(r,u,o))},1:function(t,{name:e},n){const r=e.replace(et,""),o=rt.get(t)||(t=>{const e=Object.create(nt);return rt.set(t,e),e})(t),[s,i]=(t=>Array.isArray(t)?t:[t,!1])(n),u=o[r],a=s&&!u;u&&!s&&t.removeEventListener(r,o),a&&t.addEventListener(r,o,i),o[r]=s},[_]:function(t,e,n){t.data=ot(n)},[U]:function(t,e,n){t.value=ot(n)}},ut={mount(t){return this.value=this.evaluate(t),at(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(at(this,e),this.value=e),this},unmount(){return 1===this.type&&at(this,null),this}};function at(t,e){return it[t.type](t.node,t,e,t.value)}function ct(t,e){return{...ut,...e,node:e.type===_?st(t,e.childNodeIndex):t}}const lt=(t,e)=>t[w]||e,ht={attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map((t=>({...t,value:t.evaluate(e)})));return Object.assign(Object.create(n||null),R(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find((({id:t})=>t===this.name)),{parentNode:r}=this.node,o=lt(t,e);return this.template=n&&vt(n.html,n.bindings).createDOM(r),this.template&&(L(this.node),this.template.mount(this.node,this.getTemplateScope(t,o),o),this.template.children=Array.from(this.node.childNodes)),dt(this.node),I(this.node),this},update(t,e){if(this.template){const n=lt(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 dt(t){const e=t&&t.firstChild;e&&(P(e,t),dt(t))}function pt(t){return t.reduce(((t,{bindings:e})=>t.concat(e)),[])}const mt={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=function(t,e=[],n=[]){return t?t({slots:e,attributes:n}):vt(function(t){return t.reduce(((t,e)=>t+e.html),"")}(e),[...pt(e),{expressions:n.map((t=>({type:B,...t})))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,t)),this},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}},ft={1:function(t,{evaluate:e,template:n}){const r=document.createTextNode("");return P(r,t),I(t),{...J,node:t,evaluate:e,placeholder:r,template:n.createDOM(t)}},2:function(t,{expressions:e}){return{...(n=e.map((e=>ct(t,e))),r=["mount","update","unmount"],r.reduce(((t,e)=>({...t,[e]:t=>n.map((n=>n[e](t)))&&void 0})),{}))};var n,r},0:function(t,{evaluate:e,condition:n,itemName:r,indexName:s,getKey:i,template:u}){const a=document.createTextNode(""),c=t.cloneNode();return P(a,t),I(t),{...Z,childrenMap:new Map,node:t,root:c,condition:n,evaluate:e,isTemplateTag:o(c),template:u.createDOM(t),getKey:i,indexName:s,itemName:r,placeholder:a}},3:function(t,{evaluate:e,getComponent:n,slots:r,attributes:o}){return{...mt,node:t,evaluate:e,slots:r,attributes:o,getComponent:n}},4:function(t,{name:e,attributes:n}){return{...ht,attributes:n,node:t,name:e}}};function bt(t,e){return t.map((t=>t.type===_?{...t,childNodeIndex:t.childNodeIndex+e}:t))}function gt(t,e,n){const{selector:r,type:o,redundantAttribute:s,expressions:i}=e,u=r?t.querySelector(r):t;s&&u.removeAttribute(s);const a=i||[];return(ft[o]||ft[2])(u,{...e,expressions:n&&!r?bt(a,n):a})}const yt={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=o(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,s={}){this.el&&this.unmount(e);const{fragment:i,children:u,avoidDOMInjection:a}=s,{parentNode:c}=u?u[0]:t,l=o(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,s):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 o(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}(t,d),this.bindings=this.bindingsData.map((t=>gt(this.el,t,h))),this.bindings.forEach((t=>t.mount(e,n))),this.meta=s,this},update(t,e){return this.bindings.forEach((n=>n.update(t,e))),this},unmount(t,e,n=!1){const r=this.el;if(!r)return this;switch(this.bindings.forEach((r=>r.unmount(t,e,n))),!0){case r[j]||null===n:break;case Array.isArray(this.children):!function(t){for(let e=0;e<t.length;e++)I(t[e])}(this.children);break;case!n:L(r);break;case!!n:I(r)}return this.el=null,this},clone(){return{...this,meta:{},el:null}}};function vt(t,e=[]){return{...yt,html:t,bindingsData:e}}const Nt=Object.freeze({[d]:z,[p]:z,[m]:z}),Ot=(t,e)=>t[c]=e;function xt(t){return[d,p,m].reduce(((e,n)=>(e[n]=t(n),e)),{})}function Et(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 Mt(t,e){return Et("string"==typeof t?(e||document).querySelectorAll(t):t)}const Tt=Object.freeze({$(t){return Mt(t,this.root)[0]},$$(t){return Mt(t,this.root)}}),jt=Object.freeze({[f]:z,[b]:z,[g]:z,[y]:z,[v]:z,[N]:z,[O]:z}),At=t=>1===t.length?t[0]:t;function wt(t,e,n){const r="object"==typeof e?e:{[e]:n},o=Object.keys(r);return Et(t).forEach((t=>{o.forEach((e=>t.setAttribute(e,r[e])))})),t}const St=new Map;var Ct;const Dt={CSS_BY_NAME:St,add(t,e){return St.has(t)||(St.set(t,e),this.inject()),this},inject(){return(Ct||(wt(Ct=Mt("style[riot]")[0]||document.createElement("style"),"type","text/css"),Ct.parentNode||document.head.appendChild(Ct),Ct)).innerHTML=[...St.values()].join("\n"),this},remove(t){return St.has(t)&&(St.delete(t),this.inject()),this}};function kt(t,...e){return(...n)=>(n=[...e,...n]).length<t.length?kt(t,...n):t(...n)}function Lt(t){return function(t,e,n){const r="string"==typeof e?[e]:e;return At(Et(t).map((t=>At(r.map((e=>t.getAttribute(e)))))))}(t,h)||t.tagName.toLowerCase()}function It(t,e){return{...t,...H(e)}}function Pt(t,e={}){return{...k(t),...H(e)}}function Bt(t,{slots:e,attributes:n,props:r}){return o=function(t){return[...l].reduce(((t,e)=>e(t)||t),t)}(F(i(t)?Object.create(t):t,{mount(o,s={},i){return Y(o,j,!1),this[w]=i,this[S]=function(t,e=[]){const n=e.map((e=>ct(t,e))),r={};return Object.assign(r,{expressions:n,...xt((t=>e=>(n.forEach((n=>n[t](e))),r)))})}(o,n).mount(i),Y(this,x,Object.freeze({...Pt(o,r),...R(this[S].expressions)})),this[E]=It(this[E],s),this[C]=this.template.createDOM(o).clone(),Ot(o,this),t.name&&function(t,e){Lt(t)!==e&&wt(t,h,e)}(o,t.name),Y(this,T,o),Y(this,M,e),this[b](this[x],this[E]),this[C].mount(o,this,i),this[g](this[x],this[E]),this},update(t={},e){e&&(this[w]=e,this[S].update(e));const{[h]:n,...r}={...k(this[T]),...R(this[S].expressions)};if(!1!==this[f](r,this[x]))return Y(this,x,Object.freeze({...e?null:this[x],...r})),this[E]=It(this[E],t),this[y](this[x],this[E]),this[A]||(this[A]=!0,this[C].update(this,this[w])),this[v](this[x],this[E]),this[A]=!1,this},unmount(t){return this[N](this[x],this[E]),this[S].unmount(),this[C].unmount(this,this[w],null===t?null:!t),this[O](this[x],this[E]),this}})),Object.keys(t).filter((e=>s(t[e]))).forEach((t=>{o[t]=o[t].bind(o)})),o;var o}function _t({css:t,template:e,componentAPI:n,name:r}){return t&&r&&Dt.add(r,t),kt(Bt)(F(V(n,{...jt,[x]:{},[E]:{}}),{[M]:null,[T]:null,...Tt,name:r,css:t,template:e}))}const Ut=K($t);function $t(t){const{css:n,template:r,exports:o,name:s}=t,i=r?function(t,n,r){return t(vt,$,e,r)}(r,0,(t=>{const e=function(t={}){return Object.entries(H(t)).reduce(((t,[e,n])=>{var r;return t[(r=e,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=$t(n),t}),{})}(t.exports?t.exports.components:{});return n=>n===t.name?Ut(t):e[n]||a.get(n)})(t)):q;return({slots:t,attributes:e,props:u})=>{if(o&&o[j])return function(t,{slots:e,attributes:n,props:r,css:o,template:s}){const i=V(t({slots:e,attributes:n,props:r}),Nt);return xt((t=>(...e)=>{if(t===d){const[t]=e;Y(t,j,!0),Ot(t,i)}return i[t](...e),i}))}(o,{slots:t,attributes:e,props:u,css:n,template:r});const a=H(o)||{},c=_t({css:n,template:i,componentAPI:a,name:s})({slots:t,attributes:e,props:u});return{mount:(t,e,n)=>c.mount(t,n,e),update:(t,e)=>c.update(e,t),unmount:t=>c.unmount(t)}}}const zt={cssManager:Dt,DOMBindings:{template:vt,createBinding:gt,createExpression:ct,bindingTypes:e,expressionTypes:$},globals:{DOM_COMPONENT_INSTANCE_PROPERTY:c,PARENT_KEY_SYMBOL:w}};t.__=zt,t.component=function(t){return(e,n,{slots:r,attributes:o,parentScope:s}={})=>function(...t){return t.reduce(((t,e)=>(...n)=>t(e(...n))))}((t=>t.mount(e,s)),(t=>t({props:n,slots:r,attributes:o})),$t)(t)},t.install=function(t){return s(t),l.has(t),l.add(t),l},t.mount=function(t,e,n){return Mt(t).map((t=>function(t,e,n,r){const o=n||Lt(t);return a.has(o),a.get(o)({props:e,slots:void 0}).mount(t)}(t,e,n)))},t.pure=function(t){return s(t),t[j]=!0,t},t.register=function(t,{css:e,template:n,exports:r}){return a.has(t),a.set(t,$t({name:t,css:e,template:n,exports:r})),a},t.uninstall=function(t){return l.has(t),l.delete(t),l},t.unmount=function(t,e){return Mt(t).map((t=>(t[c]&&t[c].unmount(e),t)))},t.unregister=function(t){return a.has(t),a.delete(t),Dt.remove(t),a},t.version="v9.1.2",t.withTypes=t=>t},"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 o(t){return"template"===t.tagName.toLowerCase()}function s(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="is",d="mount",p="update",m="unmount",f="shouldUpdate",b="onBeforeMount",g="onMounted",y="onBeforeUpdate",v="onUpdated",N="onBeforeUnmount",x="onUnmounted",O="props",E="state",M="slots",T="root",A=Symbol(),j=Symbol(),w=Symbol(),S=Symbol(),C=Symbol();function D(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function k(t){return Array.from(t.attributes).reduce(((t,e)=>(t[D(e.name)]=e.value,t)),{})}function I(t){for(;t.firstChild;)t.removeChild(t.firstChild)}const L=t=>t.remove(),B=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),P=0,_=2,U=3,$={ATTRIBUTE:P,EVENT:1,TEXT:_,VALUE:U};function z(){return this}function R(t){return s(t)?t.prototype&&t.prototype.constructor?new t:t():t}function H(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 K(t){return t.reduce(((t,e)=>{const{value:n,type:r}=e;switch(!0){case!e.name&&r===P:return{...t,...n};case r===U:t.value=e.value;break;default:t[D(e.name)]=e.value}return t}),{})}function Y(t,e,n,r={}){return Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!1,configurable:!0,...r}),t}function F(t,e,n){return Object.entries(e).forEach((([e,r])=>{Y(t,e,r,n)})),t}function V(t,e){return Object.entries(e).forEach((([e,n])=>{t[e]||(t[e]=n)})),t}const q={[d](t){this.el=t},[p]:z,[m](t,e,n=!1){n?L(this.el):n||I(this.el)},clone:z,createDOM:z},G=Symbol(),W=Symbol(),X=Symbol(),Z={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:o}=this,s=t===X?null:this.evaluate(t),i=s?Array.from(s):[],{newChildrenMap:u,batches:a,futureNodes:c}=function(t,e,n,r){const{condition:o,template:s,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,{itemName:e,indexName:n,index:r,item:o}){return Y(t,e,o),n&&Y(t,n,r),t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(f):r,g=i.get(b),y=[];if(function(t,e){return!!t&&!t(e)}(o,f))return;const v=!g,N=g?g.template:s.clone(),x=N.el||l.cloneNode(),O=h&&v?function(t){const e=t.dom.cloneNode(!0),{head:n,tail:r}=function(){const t=document.createTextNode(""),e=document.createTextNode("");return t[G]=!0,e[W]=!0,{head:t,tail:e}}();return{avoidDOMInjection:!0,fragment:e,head:n,tail:r,children:[n,...Array.from(e.childNodes),r]}}(N):N.meta;v?p.push((()=>N.mount(x,f,n,O))):p.push((()=>N.update(f,n))),h?y.push(...O.children):y.push(x),i.delete(b),m.push(...y),d.set(b,{nodes:y,template:N,context:f,index:r})})),{newChildrenMap:d,batches:p,futureNodes:m}}(i,t,e,this);return((t,e,n,r)=>{const o=e.length;let s=t.length,i=o,u=0,a=0,c=null;for(;u<s||a<i;)if(s===u){const t=i<o?a?n(e[a-1],-0).nextSibling:n(e[i-a],0):r;for(;a<i;)B(n(e[a++],1),t)}else if(i===a)for(;u<s;)c&&c.has(t[u])||L(n(t[u],-1)),u++;else if(t[u]===e[a])u++,a++;else if(t[s-1]===e[i-1])s--,i--;else if(t[u]===e[i-1]&&e[a]===t[s-1]){const r=n(t[--s],-1).nextSibling;B(n(e[a++],1),n(t[u++],-1).nextSibling),B(n(e[--i],1),r),t[s]=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 o=u,d=1;for(;++o<s&&o<i&&c.get(t[o])===r+d;)d++;if(d>r-a){const o=n(t[u],0);for(;a<r;)B(n(e[a++],1),o)}else l=n(e[a++],1),(h=n(t[u++],-1))&&h.parentNode&&h.parentNode.replaceChild(l,h)}else u++}else L(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:o,context:s}=n;o.pop(),o.length||(t.pop(),r.unmount(s,e,null))}}return n}}(Array.from(o.values()),e),n),a.forEach((t=>t())),this.childrenMap=u,this.nodes=c,this},unmount(t,e){return this.update(X,e),this}},J={mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,o=this.value&&!n,s=()=>{const n=this.node.cloneNode();B(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:s();break;case o: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}},Q="undefined"==typeof Element?{}:Element.prototype,tt=H((t=>Q.hasOwnProperty(t))),et=/^on/,nt={handleEvent(t){this[t.type](t)}},rt=new WeakMap;function ot(t){return u(t)?"":t}const st=(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},it={[P]:function t(e,{name:r,isBoolean:o},u,a){if(!r)return a&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter((t=>!r.includes(t))).forEach((e=>t.removeAttribute(e)))}(e,u,a),void(u&&function(e,n){Object.entries(n).forEach((([n,r])=>t(e,{name:n},r)))}(e,u));!tt(r)&&(function(t){return n(t,"boolean")}(u)||i(u)||s(u))&&(e[r]=u),function(t,e){return e?!t&&0!==t:null==t}(u,o)?e.removeAttribute(r):function(t){return["string","number","boolean"].includes(typeof t)}(u)&&e.setAttribute(r,function(t,e,n){return!0===e&&n?t:e}(r,u,o))},1:function(t,{name:e},n){const r=e.replace(et,""),o=rt.get(t)||(t=>{const e=Object.create(nt);return rt.set(t,e),e})(t),[s,i]=(t=>Array.isArray(t)?t:[t,!1])(n),u=o[r],a=s&&!u;u&&!s&&t.removeEventListener(r,o),a&&t.addEventListener(r,o,i),o[r]=s},[_]:function(t,e,n){t.data=ot(n)},[U]:function(t,e,n){t.value=ot(n)}},ut={mount(t){return this.value=this.evaluate(t),at(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(at(this,e),this.value=e),this},unmount(){return 1===this.type&&at(this,null),this}};function at(t,e){return it[t.type](t.node,t,e,t.value)}function ct(t,e){return{...ut,...e,node:e.type===_?st(t,e.childNodeIndex):t}}const lt=(t,e)=>t[w]||e,ht={attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map((t=>({...t,value:t.evaluate(e)})));return Object.assign(Object.create(n||null),K(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find((({id:t})=>t===this.name)),{parentNode:r}=this.node,o=lt(t,e);return this.template=n&&vt(n.html,n.bindings).createDOM(r),this.template&&(I(this.node),this.template.mount(this.node,this.getTemplateScope(t,o),o),this.template.children=Array.from(this.node.childNodes)),dt(this.node),L(this.node),this},update(t,e){if(this.template){const n=lt(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 dt(t){const e=t&&t.firstChild;e&&(B(e,t),dt(t))}function pt(t){return t.reduce(((t,{bindings:e})=>t.concat(e)),[])}const mt={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=function(t,e=[],n=[]){return t?t({slots:e,attributes:n}):vt(function(t){return t.reduce(((t,e)=>t+e.html),"")}(e),[...pt(e),{expressions:n.map((t=>({type:P,...t})))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,t)),this},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}},ft={1:function(t,{evaluate:e,template:n}){const r=document.createTextNode("");return B(r,t),L(t),{...J,node:t,evaluate:e,placeholder:r,template:n.createDOM(t)}},2:function(t,{expressions:e}){return{...(n=e.map((e=>ct(t,e))),r=["mount","update","unmount"],r.reduce(((t,e)=>({...t,[e]:t=>n.map((n=>n[e](t)))&&void 0})),{}))};var n,r},0:function(t,{evaluate:e,condition:n,itemName:r,indexName:s,getKey:i,template:u}){const a=document.createTextNode(""),c=t.cloneNode();return B(a,t),L(t),{...Z,childrenMap:new Map,node:t,root:c,condition:n,evaluate:e,isTemplateTag:o(c),template:u.createDOM(t),getKey:i,indexName:s,itemName:r,placeholder:a}},3:function(t,{evaluate:e,getComponent:n,slots:r,attributes:o}){return{...mt,node:t,evaluate:e,slots:r,attributes:o,getComponent:n}},4:function(t,{name:e,attributes:n}){return{...ht,attributes:n,node:t,name:e}}};function bt(t,e){return t.map((t=>t.type===_?{...t,childNodeIndex:t.childNodeIndex+e}:t))}function gt(t,e,n){const{selector:r,type:o,redundantAttribute:s,expressions:i}=e,u=r?t.querySelector(r):t;s&&u.removeAttribute(s);const a=i||[];return(ft[o]||ft[2])(u,{...e,expressions:n&&!r?bt(a,n):a})}const yt={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=o(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,s={}){this.el&&this.unmount(e);const{fragment:i,children:u,avoidDOMInjection:a}=s,{parentNode:c}=u?u[0]:t,l=o(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,s):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 o(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}(t,d),this.bindings=this.bindingsData.map((t=>gt(this.el,t,h))),this.bindings.forEach((t=>t.mount(e,n))),this.meta=s,this},update(t,e){return this.bindings.forEach((n=>n.update(t,e))),this},unmount(t,e,n=!1){const r=this.el;if(!r)return this;switch(this.bindings.forEach((r=>r.unmount(t,e,n))),!0){case r[A]||null===n:break;case Array.isArray(this.children):!function(t){for(let e=0;e<t.length;e++)L(t[e])}(this.children);break;case!n:I(r);break;case!!n:L(r)}return this.el=null,this},clone(){return{...this,meta:{},el:null}}};function vt(t,e=[]){return{...yt,html:t,bindingsData:e}}const Nt=Object.freeze({[d]:z,[p]:z,[m]:z}),xt=(t,e)=>t[c]=e;function Ot(t){return[d,p,m].reduce(((e,n)=>(e[n]=t(n),e)),{})}function Et(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 Mt(t,e){return Et("string"==typeof t?(e||document).querySelectorAll(t):t)}const Tt=Object.freeze({$(t){return Mt(t,this.root)[0]},$$(t){return Mt(t,this.root)}}),At=Object.freeze({[f]:z,[b]:z,[g]:z,[y]:z,[v]:z,[N]:z,[x]:z}),jt=t=>1===t.length?t[0]:t;function wt(t,e,n){const r="object"==typeof e?e:{[e]:n},o=Object.keys(r);return Et(t).forEach((t=>{o.forEach((e=>t.setAttribute(e,r[e])))})),t}const St=new Map;var Ct;const Dt={CSS_BY_NAME:St,add(t,e){return St.has(t)||(St.set(t,e),this.inject()),this},inject(){return(Ct||(wt(Ct=Mt("style[riot]")[0]||document.createElement("style"),"type","text/css"),Ct.parentNode||document.head.appendChild(Ct),Ct)).innerHTML=[...St.values()].join("\n"),this},remove(t){return St.has(t)&&(St.delete(t),this.inject()),this}};function kt(t,...e){return(...n)=>(n=[...e,...n]).length<t.length?kt(t,...n):t(...n)}function It(t){return function(t,e,n){const r="string"==typeof e?[e]:e;return jt(Et(t).map((t=>jt(r.map((e=>t.getAttribute(e)))))))}(t,h)||t.tagName.toLowerCase()}function Lt(t,e){return{...t,...R(e)}}function Bt(t,e={}){return{...k(t),...R(e)}}const Pt=H((t=>t?.bindingsData?.[0].expressions?.reduce(((t,{name:e,type:n})=>n===$.ATTRIBUTE?[...t,e]:t),[])??[]));function _t(t,{slots:e,attributes:n,props:r}){return o=function(t){return[...l].reduce(((t,e)=>e(t)||t),t)}(F(i(t)?Object.create(t):t,{mount(o,s={},i){return Y(o,A,!1),this[w]=i,this[S]=function(t,e=[]){const n=e.map((e=>ct(t,e))),r={};return Object.assign(r,{expressions:n,...Ot((t=>e=>(n.forEach((n=>n[t](e))),r)))})}(o,n).mount(i),Y(this,O,Object.freeze({...Bt(o,r),...K(this[S].expressions)})),this[E]=Lt(this[E],s),this[C]=this.template.createDOM(o).clone(),xt(o,this),t.name&&function(t,e){It(t)!==e&&wt(t,h,e)}(o,t.name),Y(this,T,o),Y(this,M,e),this[b](this[O],this[E]),this[C].mount(o,this,i),this[g](this[O],this[E]),this},update(t={},e){e&&(this[w]=e,this[S].update(e));const n=Pt(this[C]),r=k({attributes:Array.from(this[T].attributes).filter((({name:t})=>!n.includes(t)))}),{[h]:o,...s}={...r,...K(this[S].expressions)};if(!1!==this[f](s,this[O]))return Y(this,O,Object.freeze({...e?null:this[O],...s})),this[E]=Lt(this[E],t),this[y](this[O],this[E]),this[j]||(this[j]=!0,this[C].update(this,this[w])),this[v](this[O],this[E]),this[j]=!1,this},unmount(t){return this[N](this[O],this[E]),this[S].unmount(),this[C].unmount(this,this[w],null===t?null:!t),this[x](this[O],this[E]),this}})),Object.keys(t).filter((e=>s(t[e]))).forEach((t=>{o[t]=o[t].bind(o)})),o;var o}function Ut({css:t,template:e,componentAPI:n,name:r}){return t&&r&&Dt.add(r,t),kt(_t)(F(V(n,{...At,[O]:{},[E]:{}}),{[M]:null,[T]:null,...Tt,name:r,css:t,template:e}))}const $t=H(zt);function zt(t){const{css:n,template:r,exports:o,name:s}=t,i=r?function(t,n,r){return t(vt,$,e,r)}(r,0,(t=>{const e=function(t={}){return Object.entries(R(t)).reduce(((t,[e,n])=>{var r;return t[(r=e,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=zt(n),t}),{})}(t.exports?t.exports.components:{});return n=>n===t.name?$t(t):e[n]||a.get(n)})(t)):q;return({slots:t,attributes:e,props:u})=>{if(o&&o[A])return function(t,{slots:e,attributes:n,props:r,css:o,template:s}){const i=V(t({slots:e,attributes:n,props:r}),Nt);return Ot((t=>(...e)=>{if(t===d){const[t]=e;Y(t,A,!0),xt(t,i)}return i[t](...e),i}))}(o,{slots:t,attributes:e,props:u,css:n,template:r});const a=R(o)||{},c=Ut({css:n,template:i,componentAPI:a,name:s})({slots:t,attributes:e,props:u});return{mount:(t,e,n)=>c.mount(t,n,e),update:(t,e)=>c.update(e,t),unmount:t=>c.unmount(t)}}}const Rt={cssManager:Dt,DOMBindings:{template:vt,createBinding:gt,createExpression:ct,bindingTypes:e,expressionTypes:$},globals:{DOM_COMPONENT_INSTANCE_PROPERTY:c,PARENT_KEY_SYMBOL:w}};t.__=Rt,t.component=function(t){return(e,n,{slots:r,attributes:o,parentScope:s}={})=>function(...t){return t.reduce(((t,e)=>(...n)=>t(e(...n))))}((t=>t.mount(e,s)),(t=>t({props:n,slots:r,attributes:o})),zt)(t)},t.install=function(t){return s(t),l.has(t),l.add(t),l},t.mount=function(t,e,n){return Mt(t).map((t=>function(t,e,n,r){const o=n||It(t);return a.has(o),a.get(o)({props:e,slots:void 0}).mount(t)}(t,e,n)))},t.pure=function(t){return s(t),t[A]=!0,t},t.register=function(t,{css:e,template:n,exports:r}){return a.has(t),a.set(t,zt({name:t,css:e,template:n,exports:r})),a},t.uninstall=function(t){return l.has(t),l.delete(t),l},t.unmount=function(t,e){return Mt(t).map((t=>(t[c]&&t[c].unmount(e),t)))},t.unregister=function(t){return a.has(t),a.delete(t),Dt.remove(t),a},t.version="v9.1.3",t.withTypes=t=>t},"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 not supported yet

Sorry, the diff of this file is not supported yet

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

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