Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nextgis/paint

Package Overview
Dependencies
Maintainers
3
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextgis/paint - npm Package Compare versions

Comparing version 1.18.6 to 1.18.10

2

lib/paint.cjs.js

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

/** Bundle of @nextgis/paint; version: 1.18.6; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.10; author: NextGIS */
'use strict';

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

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

/** Bundle of @nextgis/paint; version: 1.18.6; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.10; author: NextGIS */
function isPropertiesPaint(paint) {

@@ -58,2 +58,9 @@ if (Array.isArray(paint)) {

function evaluateArgs(cb) {
return (args, data) => {
const unwrap = args.map((a) => a());
return cb(unwrap, data);
};
}
const array = (args) => {

@@ -90,42 +97,42 @@ const [firstArg, secondArg, thirdArg] = args;

const typeExpressions = {
array,
boolean: fallback((arg) => (typeof arg === 'boolean' ? arg : undefined)),
literal: ([arg]) => arg,
number: fallback((arg) => (typeof arg === 'number' ? arg : undefined)),
object: fallback((arg) => arg !== null && typeof arg === 'object' && !Array.isArray(arg)
array: evaluateArgs(array),
boolean: evaluateArgs(fallback((arg) => (typeof arg === 'boolean' ? arg : undefined))),
literal: evaluateArgs(([arg]) => arg),
number: evaluateArgs(fallback((arg) => (typeof arg === 'number' ? arg : undefined))),
object: evaluateArgs(fallback((arg) => arg !== null && typeof arg === 'object' && !Array.isArray(arg)
? arg
: undefined),
string: fallback((arg) => (typeof arg === 'string' ? arg : undefined)),
'to-boolean': fallback(Boolean),
'to-number': fallback(Number),
'to-string': fallback(String),
typeof: ([arg]) => typeof arg,
: undefined)),
string: evaluateArgs(fallback((arg) => (typeof arg === 'string' ? arg : undefined))),
'to-boolean': evaluateArgs(fallback(Boolean)),
'to-number': evaluateArgs(fallback(Number)),
'to-string': evaluateArgs(fallback(String)),
typeof: evaluateArgs(([arg]) => typeof arg),
};
const mathExpressions = {
'+': (args) => args.reduce((a, b) => a + b, 0),
'-': (args) => args.reduce((a, b) => a - b),
'*': (args) => args.reduce((a, b) => a * b, 1),
'/': (args) => args.reduce((a, b) => a / b),
'%': (args) => args[0] % args[1],
'^': (args) => Math.pow(args[0], args[1]),
abs: (args) => Math.abs(args[0]),
acos: (args) => Math.acos(args[0]),
asin: (args) => Math.asin(args[0]),
atan: (args) => Math.atan(args[0]),
ceil: (args) => Math.ceil(args[0]),
cos: (args) => Math.cos(args[0]),
'+': evaluateArgs((args) => args.reduce((a, b) => a + b, 0)),
'-': evaluateArgs((args) => args.reduce((a, b) => a - b)),
'*': evaluateArgs((args) => args.reduce((a, b) => a * b, 1)),
'/': evaluateArgs((args) => args.reduce((a, b) => a / b)),
'%': evaluateArgs((args) => args[0] % args[1]),
'^': evaluateArgs((args) => Math.pow(args[0], args[1])),
abs: evaluateArgs((args) => Math.abs(args[0])),
acos: evaluateArgs((args) => Math.acos(args[0])),
asin: evaluateArgs((args) => Math.asin(args[0])),
atan: evaluateArgs((args) => Math.atan(args[0])),
ceil: evaluateArgs((args) => Math.ceil(args[0])),
cos: evaluateArgs((args) => Math.cos(args[0])),
e: () => Math.E,
floor: (args) => Math.floor(args[0]),
ln: (args) => Math.log(args[0]),
floor: evaluateArgs((args) => Math.floor(args[0])),
ln: evaluateArgs((args) => Math.log(args[0])),
ln2: () => Math.LN2,
log10: (args) => Math.log10(args[0]),
log2: (args) => Math.log2(args[0]),
max: (args) => Math.max(...args),
min: (args) => Math.min(...args),
log10: evaluateArgs((args) => Math.log10(args[0])),
log2: evaluateArgs((args) => Math.log2(args[0])),
max: evaluateArgs((args) => Math.max(...args)),
min: evaluateArgs((args) => Math.min(...args)),
pi: () => Math.PI,
round: (args) => Math.round(args[0]),
sin: (args) => Math.sin(args[0]),
sqrt: (args) => Math.sqrt(args[0]),
tan: (args) => Math.tan(args[0]),
round: evaluateArgs((args) => Math.round(args[0])),
sin: evaluateArgs((args) => Math.sin(args[0])),
sqrt: evaluateArgs((args) => Math.sqrt(args[0])),
tan: evaluateArgs((args) => Math.tan(args[0])),
};

@@ -182,15 +189,15 @@

const lookupExpressions = {
get,
length,
at,
has,
in: inFunc,
'index-of': indexOf,
slice,
get: evaluateArgs(get),
length: evaluateArgs(length),
at: evaluateArgs(at),
has: evaluateArgs(has),
in: evaluateArgs(inFunc),
'index-of': evaluateArgs(indexOf),
slice: evaluateArgs(slice),
};
const stringExpressions = {
concat: (args) => args.reduce((a, b) => String(a) + String(b), ''),
downcase: (args) => String(args[0]).toLowerCase(),
upcase: (args) => String(args[0]).toUpperCase(),
concat: evaluateArgs((args) => args.reduce((a, b) => String(a) + String(b), '')),
downcase: evaluateArgs((args) => String(args[0]).toLowerCase()),
upcase: evaluateArgs((args) => String(args[0]).toUpperCase()),
};

@@ -230,5 +237,5 @@

}
function all(args) {
const all = (args) => {
for (let i = 0; i < args.length; i++) {
const arg = args[i];
const arg = args[i]();
if (!arg) {

@@ -239,6 +246,6 @@ return false;

return true;
}
function any(args) {
};
const any = (args) => {
for (let i = 0; i < args.length; i++) {
const arg = args[i];
const arg = args[i]();
if (arg) {

@@ -249,20 +256,20 @@ return true;

return false;
}
function match(args) {
const [lookup, ...cases] = args;
};
const match = (args) => {
const [lookupFn, ...cases] = args;
const lookup = lookupFn();
// remove last odd item from cases array
const defValue = cases.splice(-1, cases.length % 2)[0];
for (let fry = 0; fry < cases.length - 1; fry += 2) {
const key = cases[fry];
const key = cases[fry]();
if (key === lookup) {
return cases[fry + 1];
return cases[fry + 1]();
}
}
return defValue;
}
function caseFunc(args) {
return defValue();
};
const caseFunc = (args) => {
if (args.length < 2) {
throw new Error('The "case" function requires at least a condition and a corresponding output.');
}
const fallback = args[args.length - 1];
if (args.length % 2 === 0) {

@@ -272,4 +279,4 @@ throw new Error('Missing a fallback value or unmatched condition-output pair.');

for (let i = 0; i < args.length - 1; i += 2) {
const condition = args[i];
const value = args[i + 1];
const condition = args[i]();
const value = args[i + 1]();
if (condition) {

@@ -279,14 +286,15 @@ return value;

}
return fallback;
}
const fallback = args[args.length - 1];
return fallback();
};
const decisionExpressions = {
'!': not,
'!=': notEqual,
'<': lessThan,
'<=': lessThanOrEqual,
'==': equal,
'>': greaterThan,
'>=': greaterThanOrEqual,
all: all,
any: any,
'!': evaluateArgs(not),
'!=': evaluateArgs(notEqual),
'<': evaluateArgs(lessThan),
'<=': evaluateArgs(lessThanOrEqual),
'==': evaluateArgs(equal),
'>': evaluateArgs(greaterThan),
'>=': evaluateArgs(greaterThanOrEqual),
all,
any,
case: caseFunc,

@@ -296,11 +304,12 @@ match,

function step(args) {
const [input, defaultValue, ...stops] = args;
const step = (args) => {
const [inputFn, defaultValue, ...stops] = args;
const input = inputFn();
if (typeof input !== 'number') {
return defaultValue;
return defaultValue();
}
for (let i = 0; i < stops.length - 2; i += 2) {
const stopInput = stops[i];
const stopOutput = stops[i + 1];
const nextStopInput = stops[i + 2];
const stopInput = stops[i]();
const stopOutput = stops[i + 1]();
const nextStopInput = stops[i + 2]();
if (input >= stopInput && input < nextStopInput) {

@@ -310,7 +319,7 @@ return stopOutput;

}
if (input >= stops[stops.length - 2]) {
return stops[stops.length - 1];
if (input >= stops[stops.length - 2]()) {
return stops[stops.length - 1]();
}
return defaultValue;
}
return defaultValue();
};

@@ -584,17 +593,19 @@ const COLORS = {

}
function interpolate([interpolation, input, ...stops]) {
const interpolate = ([interpolationFn, inputFn, ...stops]) => {
if (stops.length < 2) {
throw new Error('At least two stops are required');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
const input = inputFn();
if (typeof input !== 'number') {
throw new Error('Input must be a number.');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
const interpolation = interpolationFn();
for (let i = 0; i < stops.length - 2; i += 2) {
const stopInput1 = stops[i];
const stopOutput1 = stops[i + 1];
const stopInput2 = stops[i + 2];
const stopOutput2 = stops[i + 3];
const stopInput1 = stops[i]();
const stopOutput1 = stops[i + 1]();
const stopInput2 = stops[i + 2]();
const stopOutput2 = stops[i + 3]();
if (input >= stopInput1 && input <= stopInput2) {

@@ -618,3 +629,3 @@ if (interpolation[0] === 'linear') {

throw new Error('Invalid interpolation type.');
}
};

@@ -649,3 +660,3 @@ const interpolationExpressions = {

if (expressionFun) {
return expressionFun(args.map((arg) => (isExpression(arg) ? evaluate(arg, data) : arg)), data);
return expressionFun(args.map((arg) => () => isExpression(arg) ? evaluate(arg, data) : arg), data);
}

@@ -652,0 +663,0 @@ throw new Error(`Expression "${name}" is not supported.`);

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

function e(e){return!!Array.isArray(e)}function t(e){return"[object Object]"===Object.prototype.toString.call(e)}function r(e){return!!t(e)&&("get-paint"!==e.type&&"icon"!==e.type)}function n(e){return"function"==typeof e}function o(e){return"icon"===e.type||"html"in e}const f=(e,t,r)=>{try{const n=e(t,r);if(void 0!==n)return n}catch{}};function i(e){return(t,r)=>{for(const n of t){const t=f(e,n,r);if(void 0!==t)return t}throw new Error("Received a mismatched type")}}const a={array:e=>{const[t,r,n]=e;let o,f,i;if("string"==typeof t&&["string","number","boolean"].includes(t)?(o=t,"number"==typeof r?(f=r,i=n):i=r):Array.isArray(t)&&(i=t),!Array.isArray(i))throw new Error("Expected an array");if(o&&!i.every((e=>typeof e===o)))throw new Error(`Expected all items in array to be of type ${o}`);if(f&&i.length!==f)throw new Error(`Expected array of length ${f}`);return i},boolean:i((e=>"boolean"==typeof e?e:void 0)),literal:([e])=>e,number:i((e=>"number"==typeof e?e:void 0)),object:i((e=>null===e||"object"!=typeof e||Array.isArray(e)?void 0:e)),string:i((e=>"string"==typeof e?e:void 0)),"to-boolean":i(Boolean),"to-number":i(Number),"to-string":i(String),typeof:([e])=>typeof e};const l={get:function([e,t],r){const n=t||r;return n&&"object"==typeof n&&e in n?n[e]:null},length:([e])=>{if("string"==typeof e||Array.isArray(e))return e.length},at:function([e,t]){return t[e]},has:function([e,t],r){const n=t||r;return!(!n||"object"!=typeof n||!(e in n))},in:function([e,t]){if("string"==typeof t)return t.includes(String(e));if(Array.isArray(t))return t.includes(e);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof t}.`)},"index-of":function([e,t,r]){if("string"==typeof t)return t.indexOf(String(e),r);if(Array.isArray(t))return t.indexOf(e,r);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof t}.`)},slice:function(e){const[t,r,n]=e;if("string"==typeof t)return t.slice(r,n);if(Array.isArray(t))return t.slice(r,n);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof t}.`)}};const c=([e,t])=>{if(typeof e!=typeof t)throw new Error("Values have different types.")};const u={"!":function([e]){return!e},"!=":function([e,t]){return c([e,t]),e!==t},"<":function([e,t]){return c([e,t]),e<t},"<=":function([e,t]){return c([e,t]),e<=t},"==":function([e,t]){return c([e,t]),e===t},">":function([e,t]){return c([e,t]),e>t},">=":function([e,t]){return c([e,t]),e>=t},all:function(e){for(let t=0;t<e.length;t++){if(!e[t])return!1}return!0},any:function(e){for(let t=0;t<e.length;t++){if(e[t])return!0}return!1},case:function(e){if(e.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');const t=e[e.length-1];if(e.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let r=0;r<e.length-1;r+=2){if(e[r])return e[r+1]}return t},match:function(e){const[t,...r]=e,n=r.splice(-1,r.length%2)[0];for(let o=0;o<r.length-1;o+=2){if(r[o]===t)return r[o+1]}return n}};const s={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function d(e){if("string"==typeof(r=e)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(r))return p(e);if("string"==typeof(t=e)&&t in s)return function(e){return p(s[e])}(e);if(function(e){return"string"==typeof e&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(e)}(e))return function(e){const t=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let r;if(r=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];if(r=e.match(t))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];throw new Error(`The '${e}' Is not valid rgb`)}(e);if(function(e){if("object"==typeof e&&null!==e)return"r"in e&&"g"in e&&"b"in e&&(!("a"in e)||"number"==typeof e.a&&e.a>=0&&e.a<=1);return!1}(e))return function({r:e,g:t,b:r,a:n}){return[e,t,r,...void 0!==n?[n]:[]]}(e);var t,r;throw new Error(`The '${e}' cannot be converted to color`)}function p(e){let t;if(t=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),parseInt(t[4]+t[4],16)/255];if(t=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];if(t=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),parseInt(t[4],16)/255];throw new Error(`The '${e}' Is not valid hex`)}function g(e,t,r,n,o){if("number"==typeof r&&"number"==typeof o)return r+(e-t)/(n-t)*(o-r);try{const f=d(r),i=d(o);return function(e){return`rgb(${e.join(",")})`}(f.map(((r,o)=>Math.ceil(g(e,t,r,n,i[o])))))}catch(f){console.log(f)}throw new Error("Unsupported output type for linear interpolation.")}function y(e){if(Array.isArray(e)){const[t,...r]=e;return"string"==typeof t&&"literal"!==t&&t in h&&r.length>0}return!1}const h={...{"+":e=>e.reduce(((e,t)=>e+t),0),"-":e=>e.reduce(((e,t)=>e-t)),"*":e=>e.reduce(((e,t)=>e*t),1),"/":e=>e.reduce(((e,t)=>e/t)),"%":e=>e[0]%e[1],"^":e=>Math.pow(e[0],e[1]),abs:e=>Math.abs(e[0]),acos:e=>Math.acos(e[0]),asin:e=>Math.asin(e[0]),atan:e=>Math.atan(e[0]),ceil:e=>Math.ceil(e[0]),cos:e=>Math.cos(e[0]),e:()=>Math.E,floor:e=>Math.floor(e[0]),ln:e=>Math.log(e[0]),ln2:()=>Math.LN2,log10:e=>Math.log10(e[0]),log2:e=>Math.log2(e[0]),max:e=>Math.max(...e),min:e=>Math.min(...e),pi:()=>Math.PI,round:e=>Math.round(e[0]),sin:e=>Math.sin(e[0]),sqrt:e=>Math.sqrt(e[0]),tan:e=>Math.tan(e[0])},...a,...{concat:e=>e.reduce(((e,t)=>String(e)+String(t)),""),downcase:e=>String(e[0]).toLowerCase(),upcase:e=>String(e[0]).toUpperCase()},...l,...u,...{step:function(e){const[t,r,...n]=e;if("number"!=typeof t)return r;for(let o=0;o<n.length-2;o+=2){if(t>=n[o]&&t<n[o+2])return n[o+1]}return t>=n[n.length-2]?n[n.length-1]:r},interpolate:function([e,t,...r]){if(r.length<2)throw new Error("At least two stops are required");if("number"!=typeof t)throw new Error("Input must be a number.");if(r.length<2||r.length%2!=0)throw new Error("Invalid stops provided.");for(let n=0;n<r.length-2;n+=2){const o=r[n],f=r[n+2];if(t>=o&&t<=f&&"linear"===e[0])return g(t,o,r[n+1],f,r[n+3])}throw new Error("Invalid interpolation type.")}}};function b(e,t={}){const[r,...n]=e,o=h[r];if(o)return o(n.map((e=>y(e)?b(e,t):e)),t);throw new Error(`Expression "${r}" is not supported.`)}function m(e){return t=>{const r=t.properties;return!!r&&b(e,r)}}const w=["iconSize","iconAnchor"];function k(e){let t=!1;const r={};for(const n in e)if(-1===w.indexOf(n)){const o=n,f=e[o];y(f)&&(t=!0,r[o]=m(f))}if(t)return t=>{const n={};for(const e in r)n[e]=r[e](t);return{...e,...n}}}function v(e,t,r){if((t=String(t))===(e=String(e)))return!0;if(r&&t.toUpperCase()===e.toUpperCase())return!0;const n=`^${o=t,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(n,r?"i":"").exec(e)}const A={gt:(e,t)=>e>t,lt:(e,t)=>e<t,ge:(e,t)=>e>=t,le:(e,t)=>e<=t,eq:(e,t)=>e===t,ne:(e,t)=>e!==t,in:(e,t)=>-1!==t.indexOf(e),notin:(e,t)=>-1===t.indexOf(e),like:(e,t)=>v(e,t),ilike:(e,t)=>v(e,t,!0)};function E(e,t){const r={...e.properties};return!!r&&(r.$id=e.id,I(r,t))}function I(e,t){const r="string"==typeof t[0]?t[0]:"all",n=t=>{if(3===(r=t).length&&"string"==typeof r[0]&&"string"==typeof r[1]){const[r,n,o]=t,f=A[n];if(f){if(("like"===n||"ilike"===n)&&"string"==typeof r){let t="";const n=r.replace(/^%?(\w+)%?$/,((n,f)=>(t=e[f],r.replace(f,o))));return f(t,n)}return f(e[r],o)}return!1}return I(e,t);var r},o=t.filter((e=>Array.isArray(e)));return"any"===r?o.some(n):o.every(n)}function x(e){let t={};const r=[];for(const n of e)n&&(Array.isArray(n)?r.push(n):t=n);return e=>{const n=r.find((t=>E(e,t[0])));return n?{...t,...n[1]}:t}}function $({paint:e,defaultPaint:t}){var r;let n={...t};return n={...n,...e},n.fill=null===(r=n.fill)||void 0===r||r,n.stroke=void 0!==n.stroke?n.stroke:!n.fill||!(!n.strokeColor&&!n.strokeOpacity),n}function M({paint:t,defaultPaint:r,getPaintFunctions:o}){if(!t)throw new Error("paint is empty");let f={...r};if(n(t)){const e=e=>{const n=M({paint:t(e),defaultPaint:r,getPaintFunctions:o});return n.type=t.type,n};return e.type=t.type,e}if(e(t))return e=>M({paint:x(t)(e),defaultPaint:r,getPaintFunctions:o});if("get-paint"===t.type){const e=function(e,t){if("function"==typeof e.from)return e.from(e.options);if("string"==typeof e.from&&t){const r=t[e.from];if(r)return r(e.options)}}(t,o);e&&(f=M({paint:e,defaultPaint:r,getPaintFunctions:o}))}else{if("icon"===t.type)return t;f=function({paint:e,defaultPaint:t}){const r=k(e);if(r){const n=e=>M({paint:r(e),defaultPaint:t});return n.paint=$({paint:e,defaultPaint:t}),n}return $({paint:e,defaultPaint:t})}({paint:t,defaultPaint:r})}return n(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}export{k as createExpressionCallback,r as isBasePaint,o as isIcon,t as isPaint,n as isPaintCallback,e as isPropertiesPaint,M as preparePaint};
function e(e){return!!Array.isArray(e)}function t(e){return"[object Object]"===Object.prototype.toString.call(e)}function r(e){return!!t(e)&&("get-paint"!==e.type&&"icon"!==e.type)}function n(e){return"function"==typeof e}function o(e){return"icon"===e.type||"html"in e}const f=(e,t,r)=>{try{const n=e(t,r);if(void 0!==n)return n}catch{}};function i(e){return(t,r)=>{for(const n of t){const t=f(e,n,r);if(void 0!==t)return t}throw new Error("Received a mismatched type")}}function a(e){return(t,r)=>{const n=t.map((e=>e()));return e(n,r)}}const l={array:a((e=>{const[t,r,n]=e;let o,f,i;if("string"==typeof t&&["string","number","boolean"].includes(t)?(o=t,"number"==typeof r?(f=r,i=n):i=r):Array.isArray(t)&&(i=t),!Array.isArray(i))throw new Error("Expected an array");if(o&&!i.every((e=>typeof e===o)))throw new Error(`Expected all items in array to be of type ${o}`);if(f&&i.length!==f)throw new Error(`Expected array of length ${f}`);return i})),boolean:a(i((e=>"boolean"==typeof e?e:void 0))),literal:a((([e])=>e)),number:a(i((e=>"number"==typeof e?e:void 0))),object:a(i((e=>null===e||"object"!=typeof e||Array.isArray(e)?void 0:e))),string:a(i((e=>"string"==typeof e?e:void 0))),"to-boolean":a(i(Boolean)),"to-number":a(i(Number)),"to-string":a(i(String)),typeof:a((([e])=>typeof e))},c={"+":a((e=>e.reduce(((e,t)=>e+t),0))),"-":a((e=>e.reduce(((e,t)=>e-t)))),"*":a((e=>e.reduce(((e,t)=>e*t),1))),"/":a((e=>e.reduce(((e,t)=>e/t)))),"%":a((e=>e[0]%e[1])),"^":a((e=>Math.pow(e[0],e[1]))),abs:a((e=>Math.abs(e[0]))),acos:a((e=>Math.acos(e[0]))),asin:a((e=>Math.asin(e[0]))),atan:a((e=>Math.atan(e[0]))),ceil:a((e=>Math.ceil(e[0]))),cos:a((e=>Math.cos(e[0]))),e:()=>Math.E,floor:a((e=>Math.floor(e[0]))),ln:a((e=>Math.log(e[0]))),ln2:()=>Math.LN2,log10:a((e=>Math.log10(e[0]))),log2:a((e=>Math.log2(e[0]))),max:a((e=>Math.max(...e))),min:a((e=>Math.min(...e))),pi:()=>Math.PI,round:a((e=>Math.round(e[0]))),sin:a((e=>Math.sin(e[0]))),sqrt:a((e=>Math.sqrt(e[0]))),tan:a((e=>Math.tan(e[0])))};const u={get:a((function([e,t],r){const n=t||r;return n&&"object"==typeof n&&e in n?n[e]:null})),length:a((([e])=>{if("string"==typeof e||Array.isArray(e))return e.length})),at:a((function([e,t]){return t[e]})),has:a((function([e,t],r){const n=t||r;return!(!n||"object"!=typeof n||!(e in n))})),in:a((function([e,t]){if("string"==typeof t)return t.includes(String(e));if(Array.isArray(t))return t.includes(e);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof t}.`)})),"index-of":a((function([e,t,r]){if("string"==typeof t)return t.indexOf(String(e),r);if(Array.isArray(t))return t.indexOf(e,r);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof t}.`)})),slice:a((function(e){const[t,r,n]=e;if("string"==typeof t)return t.slice(r,n);if(Array.isArray(t))return t.slice(r,n);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof t}.`)}))},s={concat:a((e=>e.reduce(((e,t)=>String(e)+String(t)),""))),downcase:a((e=>String(e[0]).toLowerCase())),upcase:a((e=>String(e[0]).toUpperCase()))};const d=([e,t])=>{if(typeof e!=typeof t)throw new Error("Values have different types.")};const p={"!":a((function([e]){return!e})),"!=":a((function([e,t]){return d([e,t]),e!==t})),"<":a((function([e,t]){return d([e,t]),e<t})),"<=":a((function([e,t]){return d([e,t]),e<=t})),"==":a((function([e,t]){return d([e,t]),e===t})),">":a((function([e,t]){return d([e,t]),e>t})),">=":a((function([e,t]){return d([e,t]),e>=t})),all:e=>{for(let t=0;t<e.length;t++){if(!e[t]())return!1}return!0},any:e=>{for(let t=0;t<e.length;t++){if(e[t]())return!0}return!1},case:e=>{if(e.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(e.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let t=0;t<e.length-1;t+=2){const r=e[t](),n=e[t+1]();if(r)return n}return(0,e[e.length-1])()},match:e=>{const[t,...r]=e,n=t(),o=r.splice(-1,r.length%2)[0];for(let f=0;f<r.length-1;f+=2){if(r[f]()===n)return r[f+1]()}return o()}},g={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function y(e){if("string"==typeof(r=e)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(r))return h(e);if("string"==typeof(t=e)&&t in g)return function(e){return h(g[e])}(e);if(function(e){return"string"==typeof e&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(e)}(e))return function(e){const t=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let r;if(r=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];if(r=e.match(t))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];throw new Error(`The '${e}' Is not valid rgb`)}(e);if(function(e){if("object"==typeof e&&null!==e)return"r"in e&&"g"in e&&"b"in e&&(!("a"in e)||"number"==typeof e.a&&e.a>=0&&e.a<=1);return!1}(e))return function({r:e,g:t,b:r,a:n}){return[e,t,r,...void 0!==n?[n]:[]]}(e);var t,r;throw new Error(`The '${e}' cannot be converted to color`)}function h(e){let t;if(t=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),parseInt(t[4]+t[4],16)/255];if(t=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];if(t=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),parseInt(t[4],16)/255];throw new Error(`The '${e}' Is not valid hex`)}function b(e,t,r,n,o){if("number"==typeof r&&"number"==typeof o)return r+(e-t)/(n-t)*(o-r);try{const f=y(r),i=y(o);return function(e){return`rgb(${e.join(",")})`}(f.map(((r,o)=>Math.ceil(b(e,t,r,n,i[o])))))}catch(f){console.log(f)}throw new Error("Unsupported output type for linear interpolation.")}function m(e){if(Array.isArray(e)){const[t,...r]=e;return"string"==typeof t&&"literal"!==t&&t in w&&r.length>0}return!1}const w={...c,...l,...s,...u,...p,...{step:e=>{const[t,r,...n]=e,o=t();if("number"!=typeof o)return r();for(let f=0;f<n.length-2;f+=2){const e=n[f](),t=n[f+1](),r=n[f+2]();if(o>=e&&o<r)return t}return o>=n[n.length-2]()?n[n.length-1]():r()},interpolate:([e,t,...r])=>{if(r.length<2)throw new Error("At least two stops are required");if(r.length<2||r.length%2!=0)throw new Error("Invalid stops provided.");const n=t();if("number"!=typeof n)throw new Error("Input must be a number.");const o=e();for(let f=0;f<r.length-2;f+=2){const e=r[f](),t=r[f+1](),i=r[f+2](),a=r[f+3]();if(n>=e&&n<=i&&"linear"===o[0])return b(n,e,t,i,a)}throw new Error("Invalid interpolation type.")}}};function k(e,t={}){const[r,...n]=e,o=w[r];if(o)return o(n.map((e=>()=>m(e)?k(e,t):e)),t);throw new Error(`Expression "${r}" is not supported.`)}function v(e){return t=>{const r=t.properties;return!!r&&k(e,r)}}const A=["iconSize","iconAnchor"];function E(e){let t=!1;const r={};for(const n in e)if(-1===A.indexOf(n)){const o=n,f=e[o];m(f)&&(t=!0,r[o]=v(f))}if(t)return t=>{const n={};for(const e in r)n[e]=r[e](t);return{...e,...n}}}function I(e,t,r){if((t=String(t))===(e=String(e)))return!0;if(r&&t.toUpperCase()===e.toUpperCase())return!0;const n=`^${o=t,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(n,r?"i":"").exec(e)}const x={gt:(e,t)=>e>t,lt:(e,t)=>e<t,ge:(e,t)=>e>=t,le:(e,t)=>e<=t,eq:(e,t)=>e===t,ne:(e,t)=>e!==t,in:(e,t)=>-1!==t.indexOf(e),notin:(e,t)=>-1===t.indexOf(e),like:(e,t)=>I(e,t),ilike:(e,t)=>I(e,t,!0)};function $(e,t){const r={...e.properties};return!!r&&(r.$id=e.id,M(r,t))}function M(e,t){const r="string"==typeof t[0]?t[0]:"all",n=t=>{if(3===(r=t).length&&"string"==typeof r[0]&&"string"==typeof r[1]){const[r,n,o]=t,f=x[n];if(f){if(("like"===n||"ilike"===n)&&"string"==typeof r){let t="";const n=r.replace(/^%?(\w+)%?$/,((n,f)=>(t=e[f],r.replace(f,o))));return f(t,n)}return f(e[r],o)}return!1}return M(e,t);var r},o=t.filter((e=>Array.isArray(e)));return"any"===r?o.some(n):o.every(n)}function F(e){let t={};const r=[];for(const n of e)n&&(Array.isArray(n)?r.push(n):t=n);return e=>{const n=r.find((t=>$(e,t[0])));return n?{...t,...n[1]}:t}}function P({paint:e,defaultPaint:t}){var r;let n={...t};return n={...n,...e},n.fill=null===(r=n.fill)||void 0===r||r,n.stroke=void 0!==n.stroke?n.stroke:!n.fill||!(!n.strokeColor&&!n.strokeOpacity),n}function q({paint:t,defaultPaint:r,getPaintFunctions:o}){if(!t)throw new Error("paint is empty");let f={...r};if(n(t)){const e=e=>{const n=q({paint:t(e),defaultPaint:r,getPaintFunctions:o});return n.type=t.type,n};return e.type=t.type,e}if(e(t))return e=>q({paint:F(t)(e),defaultPaint:r,getPaintFunctions:o});if("get-paint"===t.type){const e=function(e,t){if("function"==typeof e.from)return e.from(e.options);if("string"==typeof e.from&&t){const r=t[e.from];if(r)return r(e.options)}}(t,o);e&&(f=q({paint:e,defaultPaint:r,getPaintFunctions:o}))}else{if("icon"===t.type)return t;f=function({paint:e,defaultPaint:t}){const r=E(e);if(r){const n=e=>q({paint:r(e),defaultPaint:t});return n.paint=P({paint:e,defaultPaint:t}),n}return P({paint:e,defaultPaint:t})}({paint:t,defaultPaint:r})}return n(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}export{E as createExpressionCallback,r as isBasePaint,o as isIcon,t as isPaint,n as isPaintCallback,e as isPropertiesPaint,q as preparePaint};
//# sourceMappingURL=paint.esm-browser.prod.js.map

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

/** Bundle of @nextgis/paint; version: 1.18.6; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.10; author: NextGIS */
import { isExpression, evaluate } from '@nextgis/expression';

@@ -3,0 +3,0 @@ import { featureFilter } from '@nextgis/properties-filter';

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

/** Bundle of @nextgis/paint; version: 1.18.6; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.10; author: NextGIS */
var Paint = (function (exports) {

@@ -103,2 +103,9 @@ 'use strict';

function evaluateArgs(cb) {
return function (args, data) {
var unwrap = args.map(function (a) { return a(); });
return cb(unwrap, data);
};
}
var array = function (args) {

@@ -135,50 +142,50 @@ var firstArg = args[0], secondArg = args[1], thirdArg = args[2];

var typeExpressions = {
array: array,
boolean: fallback(function (arg) { return (typeof arg === 'boolean' ? arg : undefined); }),
literal: function (_a) {
array: evaluateArgs(array),
boolean: evaluateArgs(fallback(function (arg) { return (typeof arg === 'boolean' ? arg : undefined); })),
literal: evaluateArgs(function (_a) {
var arg = _a[0];
return arg;
},
number: fallback(function (arg) { return (typeof arg === 'number' ? arg : undefined); }),
object: fallback(function (arg) {
}),
number: evaluateArgs(fallback(function (arg) { return (typeof arg === 'number' ? arg : undefined); })),
object: evaluateArgs(fallback(function (arg) {
return arg !== null && typeof arg === 'object' && !Array.isArray(arg)
? arg
: undefined;
}),
string: fallback(function (arg) { return (typeof arg === 'string' ? arg : undefined); }),
'to-boolean': fallback(Boolean),
'to-number': fallback(Number),
'to-string': fallback(String),
typeof: function (_a) {
})),
string: evaluateArgs(fallback(function (arg) { return (typeof arg === 'string' ? arg : undefined); })),
'to-boolean': evaluateArgs(fallback(Boolean)),
'to-number': evaluateArgs(fallback(Number)),
'to-string': evaluateArgs(fallback(String)),
typeof: evaluateArgs(function (_a) {
var arg = _a[0];
return typeof arg;
},
}),
};
var mathExpressions = {
'+': function (args) { return args.reduce(function (a, b) { return a + b; }, 0); },
'-': function (args) { return args.reduce(function (a, b) { return a - b; }); },
'*': function (args) { return args.reduce(function (a, b) { return a * b; }, 1); },
'/': function (args) { return args.reduce(function (a, b) { return a / b; }); },
'%': function (args) { return args[0] % args[1]; },
'^': function (args) { return Math.pow(args[0], args[1]); },
abs: function (args) { return Math.abs(args[0]); },
acos: function (args) { return Math.acos(args[0]); },
asin: function (args) { return Math.asin(args[0]); },
atan: function (args) { return Math.atan(args[0]); },
ceil: function (args) { return Math.ceil(args[0]); },
cos: function (args) { return Math.cos(args[0]); },
'+': evaluateArgs(function (args) { return args.reduce(function (a, b) { return a + b; }, 0); }),
'-': evaluateArgs(function (args) { return args.reduce(function (a, b) { return a - b; }); }),
'*': evaluateArgs(function (args) { return args.reduce(function (a, b) { return a * b; }, 1); }),
'/': evaluateArgs(function (args) { return args.reduce(function (a, b) { return a / b; }); }),
'%': evaluateArgs(function (args) { return args[0] % args[1]; }),
'^': evaluateArgs(function (args) { return Math.pow(args[0], args[1]); }),
abs: evaluateArgs(function (args) { return Math.abs(args[0]); }),
acos: evaluateArgs(function (args) { return Math.acos(args[0]); }),
asin: evaluateArgs(function (args) { return Math.asin(args[0]); }),
atan: evaluateArgs(function (args) { return Math.atan(args[0]); }),
ceil: evaluateArgs(function (args) { return Math.ceil(args[0]); }),
cos: evaluateArgs(function (args) { return Math.cos(args[0]); }),
e: function () { return Math.E; },
floor: function (args) { return Math.floor(args[0]); },
ln: function (args) { return Math.log(args[0]); },
floor: evaluateArgs(function (args) { return Math.floor(args[0]); }),
ln: evaluateArgs(function (args) { return Math.log(args[0]); }),
ln2: function () { return Math.LN2; },
log10: function (args) { return Math.log10(args[0]); },
log2: function (args) { return Math.log2(args[0]); },
max: function (args) { return Math.max.apply(Math, args); },
min: function (args) { return Math.min.apply(Math, args); },
log10: evaluateArgs(function (args) { return Math.log10(args[0]); }),
log2: evaluateArgs(function (args) { return Math.log2(args[0]); }),
max: evaluateArgs(function (args) { return Math.max.apply(Math, args); }),
min: evaluateArgs(function (args) { return Math.min.apply(Math, args); }),
pi: function () { return Math.PI; },
round: function (args) { return Math.round(args[0]); },
sin: function (args) { return Math.sin(args[0]); },
sqrt: function (args) { return Math.sqrt(args[0]); },
tan: function (args) { return Math.tan(args[0]); },
round: evaluateArgs(function (args) { return Math.round(args[0]); }),
sin: evaluateArgs(function (args) { return Math.sin(args[0]); }),
sqrt: evaluateArgs(function (args) { return Math.sqrt(args[0]); }),
tan: evaluateArgs(function (args) { return Math.tan(args[0]); }),
};

@@ -241,15 +248,15 @@

var lookupExpressions = {
get: get,
length: length,
at: at,
has: has,
in: inFunc,
'index-of': indexOf,
slice: slice,
get: evaluateArgs(get),
length: evaluateArgs(length),
at: evaluateArgs(at),
has: evaluateArgs(has),
in: evaluateArgs(inFunc),
'index-of': evaluateArgs(indexOf),
slice: evaluateArgs(slice),
};
var stringExpressions = {
concat: function (args) { return args.reduce(function (a, b) { return String(a) + String(b); }, ''); },
downcase: function (args) { return String(args[0]).toLowerCase(); },
upcase: function (args) { return String(args[0]).toUpperCase(); },
concat: evaluateArgs(function (args) { return args.reduce(function (a, b) { return String(a) + String(b); }, ''); }),
downcase: evaluateArgs(function (args) { return String(args[0]).toLowerCase(); }),
upcase: evaluateArgs(function (args) { return String(args[0]).toUpperCase(); }),
};

@@ -297,5 +304,5 @@

}
function all(args) {
var all = function (args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
var arg = args[i]();
if (!arg) {

@@ -306,6 +313,6 @@ return false;

return true;
}
function any(args) {
};
var any = function (args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
var arg = args[i]();
if (arg) {

@@ -316,20 +323,20 @@ return true;

return false;
}
function match(args) {
var lookup = args[0], cases = args.slice(1);
};
var match = function (args) {
var lookupFn = args[0], cases = args.slice(1);
var lookup = lookupFn();
// remove last odd item from cases array
var defValue = cases.splice(-1, cases.length % 2)[0];
for (var fry = 0; fry < cases.length - 1; fry += 2) {
var key = cases[fry];
var key = cases[fry]();
if (key === lookup) {
return cases[fry + 1];
return cases[fry + 1]();
}
}
return defValue;
}
function caseFunc(args) {
return defValue();
};
var caseFunc = function (args) {
if (args.length < 2) {
throw new Error('The "case" function requires at least a condition and a corresponding output.');
}
var fallback = args[args.length - 1];
if (args.length % 2 === 0) {

@@ -339,4 +346,4 @@ throw new Error('Missing a fallback value or unmatched condition-output pair.');

for (var i = 0; i < args.length - 1; i += 2) {
var condition = args[i];
var value = args[i + 1];
var condition = args[i]();
var value = args[i + 1]();
if (condition) {

@@ -346,12 +353,13 @@ return value;

}
return fallback;
}
var fallback = args[args.length - 1];
return fallback();
};
var decisionExpressions = {
'!': not,
'!=': notEqual,
'<': lessThan,
'<=': lessThanOrEqual,
'==': equal,
'>': greaterThan,
'>=': greaterThanOrEqual,
'!': evaluateArgs(not),
'!=': evaluateArgs(notEqual),
'<': evaluateArgs(lessThan),
'<=': evaluateArgs(lessThanOrEqual),
'==': evaluateArgs(equal),
'>': evaluateArgs(greaterThan),
'>=': evaluateArgs(greaterThanOrEqual),
all: all,

@@ -363,11 +371,12 @@ any: any,

function step(args) {
var input = args[0], defaultValue = args[1], stops = args.slice(2);
var step = function (args) {
var inputFn = args[0], defaultValue = args[1], stops = args.slice(2);
var input = inputFn();
if (typeof input !== 'number') {
return defaultValue;
return defaultValue();
}
for (var i = 0; i < stops.length - 2; i += 2) {
var stopInput = stops[i];
var stopOutput = stops[i + 1];
var nextStopInput = stops[i + 2];
var stopInput = stops[i]();
var stopOutput = stops[i + 1]();
var nextStopInput = stops[i + 2]();
if (input >= stopInput && input < nextStopInput) {

@@ -377,7 +386,7 @@ return stopOutput;

}
if (input >= stops[stops.length - 2]) {
return stops[stops.length - 1];
if (input >= stops[stops.length - 2]()) {
return stops[stops.length - 1]();
}
return defaultValue;
}
return defaultValue();
};

@@ -652,18 +661,20 @@ var COLORS = {

}
function interpolate(_a) {
var interpolation = _a[0], input = _a[1], stops = _a.slice(2);
var interpolate = function (_a) {
var interpolationFn = _a[0], inputFn = _a[1], stops = _a.slice(2);
if (stops.length < 2) {
throw new Error('At least two stops are required');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
var input = inputFn();
if (typeof input !== 'number') {
throw new Error('Input must be a number.');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
var interpolation = interpolationFn();
for (var i = 0; i < stops.length - 2; i += 2) {
var stopInput1 = stops[i];
var stopOutput1 = stops[i + 1];
var stopInput2 = stops[i + 2];
var stopOutput2 = stops[i + 3];
var stopInput1 = stops[i]();
var stopOutput1 = stops[i + 1]();
var stopInput2 = stops[i + 2]();
var stopOutput2 = stops[i + 3]();
if (input >= stopInput1 && input <= stopInput2) {

@@ -687,3 +698,3 @@ if (interpolation[0] === 'linear') {

throw new Error('Invalid interpolation type.');
}
};

@@ -712,3 +723,3 @@ var interpolationExpressions = {

if (expressionFun) {
return expressionFun(args.map(function (arg) { return (isExpression(arg) ? evaluate(arg, data) : arg); }), data);
return expressionFun(args.map(function (arg) { return function () { return isExpression(arg) ? evaluate(arg, data) : arg; }; }), data);
}

@@ -715,0 +726,0 @@ throw new Error("Expression \"".concat(name, "\" is not supported."));

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

var Paint=function(r){"use strict";function n(r){return!!Array.isArray(r)}function e(r){return"[object Object]"===Object.prototype.toString.call(r)}function t(r){return"function"==typeof r}var i=function(){return i=Object.assign||function(r){for(var n,e=1,t=arguments.length;e<t;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var a=function(r,n,e){try{var t=r(n,e);if(void 0!==t)return t}catch(i){}};function o(r){return function(n,e){for(var t=0,i=n;t<i.length;t++){var o=a(r,i[t],e);if(void 0!==o)return o}throw new Error("Received a mismatched type")}}var f={array:function(r){var n,e=r[0],t=r[1],i=r[2],a=void 0,o=void 0;if("string"==typeof e&&["string","number","boolean"].includes(e)?(a=e,"number"==typeof t?(o=t,n=i):n=t):Array.isArray(e)&&(n=e),!Array.isArray(n))throw new Error("Expected an array");if(a&&!n.every((function(r){return typeof r===a})))throw new Error("Expected all items in array to be of type ".concat(a));if(o&&n.length!==o)throw new Error("Expected array of length ".concat(o));return n},boolean:o((function(r){return"boolean"==typeof r?r:void 0})),literal:function(r){return r[0]},number:o((function(r){return"number"==typeof r?r:void 0})),object:o((function(r){return null===r||"object"!=typeof r||Array.isArray(r)?void 0:r})),string:o((function(r){return"string"==typeof r?r:void 0})),"to-boolean":o(Boolean),"to-number":o(Number),"to-string":o(String),typeof:function(r){return typeof r[0]}};var u={get:function(r,n){var e=r[0],t=r[1]||n;return t&&"object"==typeof t&&e in t?t[e]:null},length:function(r){var n=r[0];if("string"==typeof n||Array.isArray(n))return n.length},at:function(r){return r[1][r[0]]},has:function(r,n){var e=r[1]||n;return!(!e||"object"!=typeof e||!(r[0]in e))},in:function(r){var n=r[0],e=r[1];if("string"==typeof e)return e.includes(String(n));if(Array.isArray(e))return e.includes(n);throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof e,"."))},"index-of":function(r){var n=r[0],e=r[1],t=r[2];if("string"==typeof e)return e.indexOf(String(n),t);if(Array.isArray(e))return e.indexOf(n,t);throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof e,"."))},slice:function(r){var n=r[0],e=r[1],t=r[2];if("string"==typeof n)return n.slice(e,t);if(Array.isArray(n))return n.slice(e,t);throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof n,"."))}},c={concat:function(r){return r.reduce((function(r,n){return String(r)+String(n)}),"")},downcase:function(r){return String(r[0]).toLowerCase()},upcase:function(r){return String(r[0]).toUpperCase()}};var l=function(r){if(typeof r[0]!=typeof r[1])throw new Error("Values have different types.")};var s={"!":function(r){return!r[0]},"!=":function(r){var n=r[0],e=r[1];return l([n,e]),n!==e},"<":function(r){var n=r[0],e=r[1];return l([n,e]),n<e},"<=":function(r){var n=r[0],e=r[1];return l([n,e]),n<=e},"==":function(r){var n=r[0],e=r[1];return l([n,e]),n===e},">":function(r){var n=r[0],e=r[1];return l([n,e]),n>e},">=":function(r){var n=r[0],e=r[1];return l([n,e]),n>=e},all:function(r){for(var n=0;n<r.length;n++){if(!r[n])return!1}return!0},any:function(r){for(var n=0;n<r.length;n++){if(r[n])return!0}return!1},case:function(r){if(r.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');var n=r[r.length-1];if(r.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(var e=0;e<r.length-1;e+=2){if(r[e])return r[e+1]}return n},match:function(r){for(var n=r[0],e=r.slice(1),t=e.splice(-1,e.length%2)[0],i=0;i<e.length-1;i+=2){if(e[i]===n)return e[i+1]}return t}};var d={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function p(r){if("string"==typeof(a=r)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(a))return g(r);if("string"==typeof(i=r)&&i in d)return function(r){return g(d[r])}(r);if(function(r){return"string"==typeof r&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(r)}(r))return function(r){var n,e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(n=r.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)];if(n=r.match(e))return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4])];throw new Error("The '".concat(r,"' Is not valid rgb"))}(r);if("object"==typeof(t=r)&&null!==t&&"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1))return function(r,n,e){if(e||2===arguments.length)for(var t,i=0,a=n.length;i<a;i++)!t&&i in n||(t||(t=Array.prototype.slice.call(n,0,i)),t[i]=n[i]);return r.concat(t||Array.prototype.slice.call(n))}([(n=r).r,n.g,n.b],void 0!==(e=n.a)?[e]:[],!0);var n,e,t,i,a;throw new Error("The '".concat(r,"' cannot be converted to color"))}function g(r){var n;if(n=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];if(n=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),parseInt(n[4]+n[4],16)/255];if(n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];if(n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),parseInt(n[4],16)/255];throw new Error("The '".concat(r,"' Is not valid hex"))}function y(r,n,e,t,i){if("number"==typeof e&&"number"==typeof i)return e+(r-n)/(t-n)*(i-e);try{var a=p(e),o=p(i);return function(r){return"rgb(".concat(r.join(","),")")}(a.map((function(e,i){return Math.ceil(y(r,n,e,t,o[i]))})))}catch(f){console.log(f)}throw new Error("Unsupported output type for linear interpolation.")}var h={step:function(r){var n=r[0],e=r[1],t=r.slice(2);if("number"!=typeof n)return e;for(var i=0;i<t.length-2;i+=2){if(n>=t[i]&&n<t[i+2])return t[i+1]}return n>=t[t.length-2]?t[t.length-1]:e},interpolate:function(r){var n=r[0],e=r[1],t=r.slice(2);if(t.length<2)throw new Error("At least two stops are required");if("number"!=typeof e)throw new Error("Input must be a number.");if(t.length<2||t.length%2!=0)throw new Error("Invalid stops provided.");for(var i=0;i<t.length-2;i+=2){var a=t[i],o=t[i+2];if(e>=a&&e<=o&&"linear"===n[0])return y(e,a,t[i+1],o,t[i+3])}throw new Error("Invalid interpolation type.")}};function b(r){if(Array.isArray(r)){var n=r[0],e=r.slice(1);return"string"==typeof n&&"literal"!==n&&n in v&&e.length>0}return!1}var v=i(i(i(i(i(i({},{"+":function(r){return r.reduce((function(r,n){return r+n}),0)},"-":function(r){return r.reduce((function(r,n){return r-n}))},"*":function(r){return r.reduce((function(r,n){return r*n}),1)},"/":function(r){return r.reduce((function(r,n){return r/n}))},"%":function(r){return r[0]%r[1]},"^":function(r){return Math.pow(r[0],r[1])},abs:function(r){return Math.abs(r[0])},acos:function(r){return Math.acos(r[0])},asin:function(r){return Math.asin(r[0])},atan:function(r){return Math.atan(r[0])},ceil:function(r){return Math.ceil(r[0])},cos:function(r){return Math.cos(r[0])},e:function(){return Math.E},floor:function(r){return Math.floor(r[0])},ln:function(r){return Math.log(r[0])},ln2:function(){return Math.LN2},log10:function(r){return Math.log10(r[0])},log2:function(r){return Math.log2(r[0])},max:function(r){return Math.max.apply(Math,r)},min:function(r){return Math.min.apply(Math,r)},pi:function(){return Math.PI},round:function(r){return Math.round(r[0])},sin:function(r){return Math.sin(r[0])},sqrt:function(r){return Math.sqrt(r[0])},tan:function(r){return Math.tan(r[0])}}),f),c),u),s),h);function m(r,n){void 0===n&&(n={});var e=r[0],t=r.slice(1),i=v[e];if(i)return i(t.map((function(r){return b(r)?m(r,n):r})),n);throw new Error('Expression "'.concat(e,'" is not supported.'))}function w(r){return function(n){var e=n.properties;return!!e&&m(r,e)}}var k=["iconSize","iconAnchor"];function A(r){var n=!1,e={};for(var t in r)if(-1===k.indexOf(t)){var a=t,o=r[a];b(o)&&(n=!0,e[a]=w(o))}if(n)return function(n){var t={};for(var a in e)t[a]=e[a](n);return i(i({},r),t)}}function E(r,n,e){if((n=String(n))===(r=String(r)))return!0;if(e&&n.toUpperCase()===r.toUpperCase())return!0;var t,i="^".concat((t=n,t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,e?"i":"").exec(r)}var I={gt:function(r,n){return r>n},lt:function(r,n){return r<n},ge:function(r,n){return r>=n},le:function(r,n){return r<=n},eq:function(r,n){return r===n},ne:function(r,n){return r!==n},in:function(r,n){return-1!==n.indexOf(r)},notin:function(r,n){return-1===n.indexOf(r)},like:function(r,n){return E(r,n)},ilike:function(r,n){return E(r,n,!0)}};function M(r,n){var e=i({},r.properties);return!!e&&(e.$id=r.id,x(e,n))}function x(r,n){var e="string"==typeof n[0]?n[0]:"all",t=function(n){if(3===(u=n).length&&"string"==typeof u[0]&&"string"==typeof u[1]){var e=n[0],t=n[1],i=n[2],a=I[t];if(a){if(("like"===t||"ilike"===t)&&"string"==typeof e){var o="",f=e.replace(/^%?(\w+)%?$/,(function(n,t){return o=r[t],e.replace(t,i)}));return a(o,f)}return a(r[e],i)}return!1}return x(r,n);var u},i=n.filter((function(r){return Array.isArray(r)}));return"any"===e?i.some(t):i.every(t)}function P(r){for(var n={},e=[],t=0,a=r;t<a.length;t++){var o=a[t];o&&(Array.isArray(o)?e.push(o):n=o)}return function(r){var t=e.find((function(n){return M(r,n[0])}));return t?i(i({},n),t[1]):n}}function F(r){var n,e=r.paint,t=i({},r.defaultPaint);return(t=i(i({},t),e)).fill=null===(n=t.fill)||void 0===n||n,t.stroke=void 0!==t.stroke?t.stroke:!t.fill||!(!t.strokeColor&&!t.strokeOpacity),t}function O(r){var e=r.paint,a=r.defaultPaint,o=r.getPaintFunctions;if(!e)throw new Error("paint is empty");var f=i({},a);if(t(e)){var u=function(r){var n=O({paint:e(r),defaultPaint:a,getPaintFunctions:o});return n.type=e.type,n};return u.type=e.type,u}if(n(e))return function(r){return O({paint:P(e)(r),defaultPaint:a,getPaintFunctions:o})};if("get-paint"===e.type){var c=function(r,n){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&n){var e=n[r.from];if(e)return e(r.options)}}(e,o);c&&(f=O({paint:c,defaultPaint:a,getPaintFunctions:o}))}else{if("icon"===e.type)return e;f=function(r){var n=r.paint,e=r.defaultPaint,t=A(n);if(t){var i=function(r){return O({paint:t(r),defaultPaint:e})};return i.paint=F({paint:n,defaultPaint:e}),i}return F({paint:n,defaultPaint:e})}({paint:e,defaultPaint:a})}return t(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}return r.createExpressionCallback=A,r.isBasePaint=function(r){return!!e(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=e,r.isPaintCallback=t,r.isPropertiesPaint=n,r.preparePaint=O,Object.defineProperty(r,"__esModule",{value:!0}),r}({});
var Paint=function(r){"use strict";function n(r){return!!Array.isArray(r)}function e(r){return"[object Object]"===Object.prototype.toString.call(r)}function t(r){return"function"==typeof r}var i=function(){return i=Object.assign||function(r){for(var n,e=1,t=arguments.length;e<t;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var a=function(r,n,e){try{var t=r(n,e);if(void 0!==t)return t}catch(i){}};function o(r){return function(n,e){for(var t=0,i=n;t<i.length;t++){var o=a(r,i[t],e);if(void 0!==o)return o}throw new Error("Received a mismatched type")}}function f(r){return function(n,e){var t=n.map((function(r){return r()}));return r(t,e)}}var u={array:f((function(r){var n,e=r[0],t=r[1],i=r[2],a=void 0,o=void 0;if("string"==typeof e&&["string","number","boolean"].includes(e)?(a=e,"number"==typeof t?(o=t,n=i):n=t):Array.isArray(e)&&(n=e),!Array.isArray(n))throw new Error("Expected an array");if(a&&!n.every((function(r){return typeof r===a})))throw new Error("Expected all items in array to be of type ".concat(a));if(o&&n.length!==o)throw new Error("Expected array of length ".concat(o));return n})),boolean:f(o((function(r){return"boolean"==typeof r?r:void 0}))),literal:f((function(r){return r[0]})),number:f(o((function(r){return"number"==typeof r?r:void 0}))),object:f(o((function(r){return null===r||"object"!=typeof r||Array.isArray(r)?void 0:r}))),string:f(o((function(r){return"string"==typeof r?r:void 0}))),"to-boolean":f(o(Boolean)),"to-number":f(o(Number)),"to-string":f(o(String)),typeof:f((function(r){return typeof r[0]}))},c={"+":f((function(r){return r.reduce((function(r,n){return r+n}),0)})),"-":f((function(r){return r.reduce((function(r,n){return r-n}))})),"*":f((function(r){return r.reduce((function(r,n){return r*n}),1)})),"/":f((function(r){return r.reduce((function(r,n){return r/n}))})),"%":f((function(r){return r[0]%r[1]})),"^":f((function(r){return Math.pow(r[0],r[1])})),abs:f((function(r){return Math.abs(r[0])})),acos:f((function(r){return Math.acos(r[0])})),asin:f((function(r){return Math.asin(r[0])})),atan:f((function(r){return Math.atan(r[0])})),ceil:f((function(r){return Math.ceil(r[0])})),cos:f((function(r){return Math.cos(r[0])})),e:function(){return Math.E},floor:f((function(r){return Math.floor(r[0])})),ln:f((function(r){return Math.log(r[0])})),ln2:function(){return Math.LN2},log10:f((function(r){return Math.log10(r[0])})),log2:f((function(r){return Math.log2(r[0])})),max:f((function(r){return Math.max.apply(Math,r)})),min:f((function(r){return Math.min.apply(Math,r)})),pi:function(){return Math.PI},round:f((function(r){return Math.round(r[0])})),sin:f((function(r){return Math.sin(r[0])})),sqrt:f((function(r){return Math.sqrt(r[0])})),tan:f((function(r){return Math.tan(r[0])}))};var l={get:f((function(r,n){var e=r[0],t=r[1]||n;return t&&"object"==typeof t&&e in t?t[e]:null})),length:f((function(r){var n=r[0];if("string"==typeof n||Array.isArray(n))return n.length})),at:f((function(r){return r[1][r[0]]})),has:f((function(r,n){var e=r[1]||n;return!(!e||"object"!=typeof e||!(r[0]in e))})),in:f((function(r){var n=r[0],e=r[1];if("string"==typeof e)return e.includes(String(n));if(Array.isArray(e))return e.includes(n);throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof e,"."))})),"index-of":f((function(r){var n=r[0],e=r[1],t=r[2];if("string"==typeof e)return e.indexOf(String(n),t);if(Array.isArray(e))return e.indexOf(n,t);throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof e,"."))})),slice:f((function(r){var n=r[0],e=r[1],t=r[2];if("string"==typeof n)return n.slice(e,t);if(Array.isArray(n))return n.slice(e,t);throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof n,"."))}))},s={concat:f((function(r){return r.reduce((function(r,n){return String(r)+String(n)}),"")})),downcase:f((function(r){return String(r[0]).toLowerCase()})),upcase:f((function(r){return String(r[0]).toUpperCase()}))};var d=function(r){if(typeof r[0]!=typeof r[1])throw new Error("Values have different types.")};var p={"!":f((function(r){return!r[0]})),"!=":f((function(r){var n=r[0],e=r[1];return d([n,e]),n!==e})),"<":f((function(r){var n=r[0],e=r[1];return d([n,e]),n<e})),"<=":f((function(r){var n=r[0],e=r[1];return d([n,e]),n<=e})),"==":f((function(r){var n=r[0],e=r[1];return d([n,e]),n===e})),">":f((function(r){var n=r[0],e=r[1];return d([n,e]),n>e})),">=":f((function(r){var n=r[0],e=r[1];return d([n,e]),n>=e})),all:function(r){for(var n=0;n<r.length;n++){if(!r[n]())return!1}return!0},any:function(r){for(var n=0;n<r.length;n++){if(r[n]())return!0}return!1},case:function(r){if(r.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(r.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(var n=0;n<r.length-1;n+=2){var e=r[n](),t=r[n+1]();if(e)return t}return(0,r[r.length-1])()},match:function(r){for(var n=r[0],e=r.slice(1),t=n(),i=e.splice(-1,e.length%2)[0],a=0;a<e.length-1;a+=2){if(e[a]()===t)return e[a+1]()}return i()}},g={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function y(r){if("string"==typeof(a=r)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(a))return h(r);if("string"==typeof(i=r)&&i in g)return function(r){return h(g[r])}(r);if(function(r){return"string"==typeof r&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(r)}(r))return function(r){var n,e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(n=r.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)];if(n=r.match(e))return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4])];throw new Error("The '".concat(r,"' Is not valid rgb"))}(r);if("object"==typeof(t=r)&&null!==t&&"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1))return function(r,n,e){if(e||2===arguments.length)for(var t,i=0,a=n.length;i<a;i++)!t&&i in n||(t||(t=Array.prototype.slice.call(n,0,i)),t[i]=n[i]);return r.concat(t||Array.prototype.slice.call(n))}([(n=r).r,n.g,n.b],void 0!==(e=n.a)?[e]:[],!0);var n,e,t,i,a;throw new Error("The '".concat(r,"' cannot be converted to color"))}function h(r){var n;if(n=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];if(n=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),parseInt(n[4]+n[4],16)/255];if(n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];if(n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),parseInt(n[4],16)/255];throw new Error("The '".concat(r,"' Is not valid hex"))}function b(r,n,e,t,i){if("number"==typeof e&&"number"==typeof i)return e+(r-n)/(t-n)*(i-e);try{var a=y(e),o=y(i);return function(r){return"rgb(".concat(r.join(","),")")}(a.map((function(e,i){return Math.ceil(b(r,n,e,t,o[i]))})))}catch(f){console.log(f)}throw new Error("Unsupported output type for linear interpolation.")}var v={step:function(r){var n=r[0],e=r[1],t=r.slice(2),i=n();if("number"!=typeof i)return e();for(var a=0;a<t.length-2;a+=2){var o=t[a](),f=t[a+1](),u=t[a+2]();if(i>=o&&i<u)return f}return i>=t[t.length-2]()?t[t.length-1]():e()},interpolate:function(r){var n=r[0],e=r[1],t=r.slice(2);if(t.length<2)throw new Error("At least two stops are required");if(t.length<2||t.length%2!=0)throw new Error("Invalid stops provided.");var i=e();if("number"!=typeof i)throw new Error("Input must be a number.");for(var a=n(),o=0;o<t.length-2;o+=2){var f=t[o](),u=t[o+1](),c=t[o+2](),l=t[o+3]();if(i>=f&&i<=c&&"linear"===a[0])return b(i,f,u,c,l)}throw new Error("Invalid interpolation type.")}};function m(r){if(Array.isArray(r)){var n=r[0],e=r.slice(1);return"string"==typeof n&&"literal"!==n&&n in w&&e.length>0}return!1}var w=i(i(i(i(i(i({},c),u),s),l),p),v);function k(r,n){void 0===n&&(n={});var e=r[0],t=r.slice(1),i=w[e];if(i)return i(t.map((function(r){return function(){return m(r)?k(r,n):r}})),n);throw new Error('Expression "'.concat(e,'" is not supported.'))}function A(r){return function(n){var e=n.properties;return!!e&&k(r,e)}}var E=["iconSize","iconAnchor"];function I(r){var n=!1,e={};for(var t in r)if(-1===E.indexOf(t)){var a=t,o=r[a];m(o)&&(n=!0,e[a]=A(o))}if(n)return function(n){var t={};for(var a in e)t[a]=e[a](n);return i(i({},r),t)}}function M(r,n,e){if((n=String(n))===(r=String(r)))return!0;if(e&&n.toUpperCase()===r.toUpperCase())return!0;var t,i="^".concat((t=n,t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,e?"i":"").exec(r)}var x={gt:function(r,n){return r>n},lt:function(r,n){return r<n},ge:function(r,n){return r>=n},le:function(r,n){return r<=n},eq:function(r,n){return r===n},ne:function(r,n){return r!==n},in:function(r,n){return-1!==n.indexOf(r)},notin:function(r,n){return-1===n.indexOf(r)},like:function(r,n){return M(r,n)},ilike:function(r,n){return M(r,n,!0)}};function P(r,n){var e=i({},r.properties);return!!e&&(e.$id=r.id,F(e,n))}function F(r,n){var e="string"==typeof n[0]?n[0]:"all",t=function(n){if(3===(u=n).length&&"string"==typeof u[0]&&"string"==typeof u[1]){var e=n[0],t=n[1],i=n[2],a=x[t];if(a){if(("like"===t||"ilike"===t)&&"string"==typeof e){var o="",f=e.replace(/^%?(\w+)%?$/,(function(n,t){return o=r[t],e.replace(t,i)}));return a(o,f)}return a(r[e],i)}return!1}return F(r,n);var u},i=n.filter((function(r){return Array.isArray(r)}));return"any"===e?i.some(t):i.every(t)}function O(r){for(var n={},e=[],t=0,a=r;t<a.length;t++){var o=a[t];o&&(Array.isArray(o)?e.push(o):n=o)}return function(r){var t=e.find((function(n){return P(r,n[0])}));return t?i(i({},n),t[1]):n}}function q(r){var n,e=r.paint,t=i({},r.defaultPaint);return(t=i(i({},t),e)).fill=null===(n=t.fill)||void 0===n||n,t.stroke=void 0!==t.stroke?t.stroke:!t.fill||!(!t.strokeColor&&!t.strokeOpacity),t}function j(r){var e=r.paint,a=r.defaultPaint,o=r.getPaintFunctions;if(!e)throw new Error("paint is empty");var f=i({},a);if(t(e)){var u=function(r){var n=j({paint:e(r),defaultPaint:a,getPaintFunctions:o});return n.type=e.type,n};return u.type=e.type,u}if(n(e))return function(r){return j({paint:O(e)(r),defaultPaint:a,getPaintFunctions:o})};if("get-paint"===e.type){var c=function(r,n){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&n){var e=n[r.from];if(e)return e(r.options)}}(e,o);c&&(f=j({paint:c,defaultPaint:a,getPaintFunctions:o}))}else{if("icon"===e.type)return e;f=function(r){var n=r.paint,e=r.defaultPaint,t=I(n);if(t){var i=function(r){return j({paint:t(r),defaultPaint:e})};return i.paint=q({paint:n,defaultPaint:e}),i}return q({paint:n,defaultPaint:e})}({paint:e,defaultPaint:a})}return t(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}return r.createExpressionCallback=I,r.isBasePaint=function(r){return!!e(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=e,r.isPaintCallback=t,r.isPropertiesPaint=n,r.preparePaint=j,Object.defineProperty(r,"__esModule",{value:!0}),r}({});
//# sourceMappingURL=paint.global.prod.js.map
{
"name": "@nextgis/paint",
"version": "1.18.6",
"version": "1.18.10",
"description": "Create style for vector layer",

@@ -11,3 +11,3 @@ "main": "index.js",

"dependencies": {
"@nextgis/expression": "^1.18.0",
"@nextgis/expression": "^1.18.10",
"@nextgis/properties-filter": "^1.18.0",

@@ -53,3 +53,3 @@ "@types/geojson": "^7946.0.8"

},
"gitHead": "0402a2fa8f938e9e9b13b5021d9b7ad3c7e7b14c"
"gitHead": "1a1aa4cda93f1a3dccfc6efa921fbc0397fe44d4"
}

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 not supported yet

Sorry, the diff of this file is not supported yet

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