From b984c62746c86bed41d23201bb90c9c4f6a9a9c1 Mon Sep 17 00:00:00 2001 From: Chris Hutchinson Date: Mon, 3 May 2021 17:50:28 +0100 Subject: [PATCH] Fix error on CardKitServer regarding svgRef, add new Usage: npm where is one of: access, adduser, audit, bin, bugs, c, cache, ci, cit, clean-install, clean-install-test, completion, config, create, ddp, dedupe, deprecate, dist-tag, docs, doctor, edit, explore, fund, get, help, help-search, hook, i, init, install, install-ci-test, install-test, it, link, list, ln, login, logout, ls, org, outdated, owner, pack, ping, prefix, profile, prune, publish, rb, rebuild, repo, restart, root, run, run-script, s, se, search, set, shrinkwrap, star, stars, start, stop, t, team, test, token, tst, un, uninstall, unpublish, unstar, up, update, v, version, view, whoami npm -h quick help on npm -l display full usage info npm help search for help on npm help npm involved overview Specify configs in the ini-formatted file: /Users/chris/.npmrc or on the command line via: npm --key value Config info can be viewed via: npm help config npm@6.14.12 /Users/chris/.nvm/versions/node/v14.16.1/lib/node_modules/npm Did you mean this? create script --- dist/dom.js | 2 +- docs/bundle.js | 2 +- docs/code/Card.html | 2 +- docs/code/CardKit.html | 2 +- docs/code/CardKitDOM.html | 2 +- docs/code/CardKitServer.html | 2 +- docs/code/SVGToImage.html | 2 +- docs/code/cardkit.js.html | 2 +- docs/code/index.html | 2 +- docs/code/renderers_dom_SVGToImage.js.html | 2 +- docs/code/renderers_dom_dom.js.html | 2 +- docs/code/renderers_server_server.js.html | 2 +- docs/code/renderers_shared_Card.js.html | 4 ++-- dom.js | 2 +- package.json | 6 +++++- server.js | 2 +- src/renderers/shared/Card.js | 2 +- 17 files changed, 22 insertions(+), 18 deletions(-) diff --git a/dist/dom.js b/dist/dom.js index 55fcd75..fcaa6ed 100644 --- a/dist/dom.js +++ b/dist/dom.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("CardKitDOM",["react","react-dom"],t):"object"==typeof exports?exports.CardKitDOM=t(require("react"),require("react-dom")):e.CardKitDOM=t(e.React,e.ReactDOM)}(this,(function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=86)}([function(t,r){t.exports=e},function(e,t,r){e.exports=r(88)()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var n=l(r(126)),o=l(r(202)),i=l(r(228)),a=l(r(229)),u=l(r(230)),c=l(r(231));function l(e){return e&&e.__esModule?e:{default:e}}t.hover=a.default,t.handleHover=a.default,t.handleActive=u.default,t.loop=c.default;var s=t.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=B(e,360),t=B(t,100),r=B(r,100),0===t)n=o=i=r;else{var u=r<.5?r*(1+t):r+t-r*t,c=2*r-u;n=a(c,u,e+1/3),o=a(c,u,e),i=a(c,u,e-1/3)}return{r:255*n,g:255*o,b:255*i}}(e.h,n,c),f=!0,p="hsl"),e.hasOwnProperty("a")&&(r=e.a));var h,d,y;return r=T(r),{ok:f,format:e.format||p,r:l(255,s(t.r,0)),g:l(255,s(t.g,0)),b:l(255,s(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=c(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=r.ok,this._tc_id=u++}function h(e,t,r){e=B(e,255),t=B(t,255),r=B(r,255);var n,o,i=s(e,t,r),a=l(e,t,r),u=(i+a)/2;if(i==a)n=o=0;else{var c=i-a;switch(o=u>.5?c/(2-i-a):c/(i+a),i){case e:n=(t-r)/c+(t>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(p(n));return i}function k(e,t){t=t||6;for(var r=p(e).toHsv(),n=r.h,o=r.s,i=r.v,a=[],u=1/t;t--;)a.push(p({h:n,s:o,v:i})),i=(i+u)%1;return a}p.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:o.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return y(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var i=[z(c(e).toString(16)),z(c(t).toString(16)),z(c(r).toString(16)),z(I(n))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*B(this._r,255))+"%",g:c(100*B(this._g,255))+"%",b:c(100*B(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*B(this._r,255))+"%, "+c(100*B(this._g,255))+"%, "+c(100*B(this._b,255))+"%)":"rgba("+c(100*B(this._r,255))+"%, "+c(100*B(this._g,255))+"%, "+c(100*B(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(P[y(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+b(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=p(e);r="#"+b(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return p(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(v,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(j,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},p.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:D(e[n]));e=r}return p(e,t)},p.equals=function(e,t){return!(!e||!t)&&p(e).toRgbString()==p(t).toRgbString()},p.random=function(){return p.fromRatio({r:f(),g:f(),b:f()})},p.mix=function(e,t,r){r=0===r?0:r||50;var n=p(e).toRgb(),o=p(t).toRgb(),i=r/100;return p({r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a})},p.readability=function(e,t){var r=p(e),n=p(t);return(o.max(r.getLuminance(),n.getLuminance())+.05)/(o.min(r.getLuminance(),n.getLuminance())+.05)},p.isReadable=function(e,t,r){var n,o,i=p.readability(e,t);switch(o=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},p.mostReadable=function(e,t,r){var n,o,i,a,u=null,c=0;o=(r=r||{}).includeFallbackColors,i=r.level,a=r.size;for(var l=0;lc&&(c=n,u=p(t[l]));return p.isReadable(e,u,{level:i,size:a})||!o?u:(r.includeFallbackColors=!1,p.mostReadable(e,["#fff","#000"],r))};var A=p.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=p.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(A);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,s(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return l(1,s(0,e))}function L(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function D(e){return e<=1&&(e=100*e+"%"),e}function I(e){return o.round(255*parseFloat(e)).toString(16)}function M(e){return L(e)/255}var V,N,U,H=(N="[\\s|\\(]+("+(V="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+V+")[,|\\s]+("+V+")\\s*\\)?",U="[\\s|\\(]+("+V+")[,|\\s]+("+V+")[,|\\s]+("+V+")[,|\\s]+("+V+")\\s*\\)?",{CSS_UNIT:new RegExp(V),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+U),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+U),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+U),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Y(e){return!!H.CSS_UNIT.exec(e)}e.exports?e.exports=p:void 0===(n=function(){return p}.call(t,r,t,e))||(e.exports=n)}(Math)},function(e,t){e.exports={slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},svgToBase64:function(e,t){return t(unescape(encodeURIComponent(e)))},capitaliseFirstLetter:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}},function(e,t,r){var n=r(64),o=r(31);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(144),o=r(145),i=r(146),a=r(147),u=r(148);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(57),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,r(30)(e))},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(63)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(19),o=r(149),i=r(150),a=r(151),u=r(152),c=r(153);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=u,l.prototype.set=c,e.exports=l},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(11)(r(7),"Map");e.exports=n},function(e,t,r){var n=r(158),o=r(165),i=r(167),a=r(168),u=r(169);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((function(t,r){var o=e[t],i="svg";return"object"===n(e[t])&&(o=e[t].src,i=e[t].format||"svg"),l.createElement("style",{key:r},"@font-face {\n font-family: '".concat(t,"';\n src: url(\"").concat(o,'") format("').concat(i,'");\n font-weight: normal;\n font-style: normal;\n }'))}))}},{key:"render",value:function(){var e=this.props.configuration,t=e.card,r=e.fonts,n=e.layers,o=this.computeLayers(n),i=this.computeGradients(n),a=this.computeFonts(r);return l.createElement("div",{className:"card",ref:this.props.svgRef,style:{maxWidth:t.width,maxHeight:t.height}},l.createElement(p,{height:t.height,width:t.width,fill:t.fill},l.createElement("defs",null,a,i),o))}}])&&o(t.prototype,r),u&&o(t,u),s}(l.Component);w.propTypes={configuration:s.shape({card:s.object,fonts:s.object,layers:s.object}),svgRef:s.any.isRequired},e.exports=w},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(27))},function(e,t,r){var n=r(130),o=r(15);e.exports=function(e,t){return e&&n(e,t,o)}},function(e,t,r){var n=r(132),o=r(60),i=r(6),a=r(29),u=r(61),c=r(62),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),s=!r&&o(e),f=!r&&!s&&a(e),p=!r&&!s&&!f&&c(e),h=r||s||f||p,d=h?n(e.length,String):[],y=d.length;for(var b in e)!t&&!l.call(e,b)||h&&("length"==b||f&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||u(b,y))||d.push(b);return d}},function(e,t,r){var n=r(133),o=r(8),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=c},function(e,t){var r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&es))return!1;var p=c.get(e),h=c.get(t);if(p&&h)return p==t&&h==e;var d=-1,y=!0,b=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++d=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return a.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:i,height:c},s)},f),a.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return a.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:i,height:c},s)},f),a.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1?arguments[1]:void 0;t=t.childNodes[0]||document.getElementById(this.renderedCardID).childNodes[0];var r=new d(t),n="cardkit-default.jpg",o=this.computeConfiguration(),i=Object.keys(o.layers).find((function(e){var t=o.layers[e];return!0===t.useAsFilename&&!0!==t.hidden&&"text"===t.type})),a=o.layers[i];a&&(n=y(a.text)+".jpg"),r.download(n,{format:"image/jpeg",scale:e})}}])&&o(t.prototype,r),n&&o(t,n),c}(p);e.exports=b},function(e,r){e.exports=t},function(e,t,r){"use strict";var n=r(89);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){e.exports={SVG:r(91),Text:r(92),Rectangle:r(97),Circle:r(98),Ellipse:r(99),Line:r(100),Image:r(101),Path:r(102),LinearGradient:r(103)}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),s(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function l(e,t){return e}function s(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=s(e,o,n)),o}var i=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,r);if(i)return i;var a=Object.keys(r),u=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(r);if(0===a.length){if(O(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return f(r)}var l,x="",j=!1,C=["{","}"];(h(r)&&(j=!0,C=["[","]"]),O(r))&&(x=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(x=" "+RegExp.prototype.toString.call(r)),w(r)&&(x=" "+Date.prototype.toUTCString.call(r)),E(r)&&(x=" "+f(r)),0!==a.length||j&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=j?function(e,t,r,n,o){for(var i=[],a=0,u=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,x,C)):C[0]+x+C[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,u,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),S(n,o)||(a="["+o+"]"),u||(e.seen.indexOf(c.value)<0?(u=y(r)?s(e,c.value,null):s(e,c.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+u.split("\n").map((function(e){return" "+e})).join("\n")):u=e.stylize("[Circular]","special")),g(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function g(e){return void 0===e}function m(e){return x(e)&&"[object RegExp]"===j(e)}function x(e){return"object"==typeof e&&null!==e}function w(e){return x(e)&&"[object Date]"===j(e)}function E(e){return x(e)&&("[object Error]"===j(e)||e instanceof Error)}function O(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(i)&&(i=Object({NODE_ENV:"production"}).NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=g,t.isRegExp=m,t.isObject=x,t.isDate=w,t.isError=E,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(95);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),_[e.getMonth()],t].join(" ")}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=r(96),t._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i1)for(var r=1;r0&&void 0!==arguments[0]&&arguments[0];return this.cardkit.computeConfiguration(e)}}])&&n(t.prototype,r),i&&n(t,i),e}();e.exports=i},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(o(this,e),!t)throw new Error("A configuration object was not provided");if(!this._isValidConfiguration(t))throw new Error("Invalid configuration object provided");this.configuration=t,this._configureOptions(r),this.renderers=[]}var t,r,u;return t=e,(r=[{key:"_configureOptions",value:function(e){if(e){if(e.templates){if(!this._isValidTemplatesConfiguration(e.templates))throw new Error("Invalid templates configuration object provided");this.templates=e.templates}else this.templates=null;if(e.themes){if(!this._isValidThemesConfiguration(e.themes))throw new Error("Invalid themes configuration object provided");this.themes=e.themes}else this.themes=null;if(e.layouts){if(!this._isValidLayoutsConfiguration(e.layouts))throw new Error("Invalid layouts configuration object provided");this.layouts=e.layouts}else this.layouts=null}}},{key:"_isValidConfiguration",value:function(e){return"object"===n(e)&&void 0!==e.card&&"object"===n(e.card)&&void 0!==e.card.height&&void 0!==e.card.width}},{key:"_isValidTemplatesConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidThemesConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidLayoutsConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidRenderer",value:function(e){return e.cardkit===this}},{key:"computeConfiguration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=Object.assign({},this.configuration);return e&&(e.template&&void 0!==this.templates[e.template]&&(t=a(t,this.templates[e.template])),e.theme&&void 0!==this.themes[e.theme]&&(t=a(t,this.themes[e.theme])),e.layout&&void 0!==this.layouts[e.layout]&&(t=a(t,this.layouts[e.layout]))),t}},{key:"updateConfiguration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{layouts:null,templates:null,themes:null},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.configuration=e,this._configureOptions(t),r){var n=this.getRenderers();n.forEach((function(e){switch(e.constructor.name){case"CardKitDOM":e.rerender()}}))}}},{key:"getRenderers",value:function(){return this.renderers}},{key:"addRenderer",value:function(e){if(!this._isValidRenderer(e))throw new Error("Invalid renderer object provided");this.renderers.push(e)}}])&&i(t.prototype,r),u&&i(t,u),e}();e.exports=u,"undefined"!=typeof window&&(window.CardKit=u)},function(e,t,r){"use strict";(function(t){ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("CardKitDOM",["react","react-dom"],t):"object"==typeof exports?exports.CardKitDOM=t(require("react"),require("react-dom")):e.CardKitDOM=t(e.React,e.ReactDOM)}(this,(function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=86)}([function(t,r){t.exports=e},function(e,t,r){e.exports=r(88)()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var n=l(r(126)),o=l(r(202)),i=l(r(228)),a=l(r(229)),u=l(r(230)),c=l(r(231));function l(e){return e&&e.__esModule?e:{default:e}}t.hover=a.default,t.handleHover=a.default,t.handleActive=u.default,t.loop=c.default;var s=t.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=B(e,360),t=B(t,100),r=B(r,100),0===t)n=o=i=r;else{var u=r<.5?r*(1+t):r+t-r*t,c=2*r-u;n=a(c,u,e+1/3),o=a(c,u,e),i=a(c,u,e-1/3)}return{r:255*n,g:255*o,b:255*i}}(e.h,n,c),f=!0,p="hsl"),e.hasOwnProperty("a")&&(r=e.a));var h,d,y;return r=T(r),{ok:f,format:e.format||p,r:l(255,s(t.r,0)),g:l(255,s(t.g,0)),b:l(255,s(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=c(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=r.ok,this._tc_id=u++}function h(e,t,r){e=B(e,255),t=B(t,255),r=B(r,255);var n,o,i=s(e,t,r),a=l(e,t,r),u=(i+a)/2;if(i==a)n=o=0;else{var c=i-a;switch(o=u>.5?c/(2-i-a):c/(i+a),i){case e:n=(t-r)/c+(t>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(p(n));return i}function k(e,t){t=t||6;for(var r=p(e).toHsv(),n=r.h,o=r.s,i=r.v,a=[],u=1/t;t--;)a.push(p({h:n,s:o,v:i})),i=(i+u)%1;return a}p.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:o.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=c(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=c(360*e.h),r=c(100*e.s),n=c(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return y(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var i=[z(c(e).toString(16)),z(c(t).toString(16)),z(c(r).toString(16)),z(I(n))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*B(this._r,255))+"%",g:c(100*B(this._g,255))+"%",b:c(100*B(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*B(this._r,255))+"%, "+c(100*B(this._g,255))+"%, "+c(100*B(this._b,255))+"%)":"rgba("+c(100*B(this._r,255))+"%, "+c(100*B(this._g,255))+"%, "+c(100*B(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(P[y(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+b(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=p(e);r="#"+b(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return p(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(v,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(j,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},p.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:D(e[n]));e=r}return p(e,t)},p.equals=function(e,t){return!(!e||!t)&&p(e).toRgbString()==p(t).toRgbString()},p.random=function(){return p.fromRatio({r:f(),g:f(),b:f()})},p.mix=function(e,t,r){r=0===r?0:r||50;var n=p(e).toRgb(),o=p(t).toRgb(),i=r/100;return p({r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a})},p.readability=function(e,t){var r=p(e),n=p(t);return(o.max(r.getLuminance(),n.getLuminance())+.05)/(o.min(r.getLuminance(),n.getLuminance())+.05)},p.isReadable=function(e,t,r){var n,o,i=p.readability(e,t);switch(o=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},p.mostReadable=function(e,t,r){var n,o,i,a,u=null,c=0;o=(r=r||{}).includeFallbackColors,i=r.level,a=r.size;for(var l=0;lc&&(c=n,u=p(t[l]));return p.isReadable(e,u,{level:i,size:a})||!o?u:(r.includeFallbackColors=!1,p.mostReadable(e,["#fff","#000"],r))};var A=p.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=p.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(A);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,s(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return l(1,s(0,e))}function L(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function D(e){return e<=1&&(e=100*e+"%"),e}function I(e){return o.round(255*parseFloat(e)).toString(16)}function M(e){return L(e)/255}var V,N,U,H=(N="[\\s|\\(]+("+(V="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+V+")[,|\\s]+("+V+")\\s*\\)?",U="[\\s|\\(]+("+V+")[,|\\s]+("+V+")[,|\\s]+("+V+")[,|\\s]+("+V+")\\s*\\)?",{CSS_UNIT:new RegExp(V),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+U),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+U),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+U),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Y(e){return!!H.CSS_UNIT.exec(e)}e.exports?e.exports=p:void 0===(n=function(){return p}.call(t,r,t,e))||(e.exports=n)}(Math)},function(e,t){e.exports={slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},svgToBase64:function(e,t){return t(unescape(encodeURIComponent(e)))},capitaliseFirstLetter:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}},function(e,t,r){var n=r(64),o=r(31);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(144),o=r(145),i=r(146),a=r(147),u=r(148);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(57),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,r(30)(e))},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(63)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(19),o=r(149),i=r(150),a=r(151),u=r(152),c=r(153);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=u,l.prototype.set=c,e.exports=l},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(11)(r(7),"Map");e.exports=n},function(e,t,r){var n=r(158),o=r(165),i=r(167),a=r(168),u=r(169);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((function(t,r){var o=e[t],i="svg";return"object"===n(e[t])&&(o=e[t].src,i=e[t].format||"svg"),l.createElement("style",{key:r},"@font-face {\n font-family: '".concat(t,"';\n src: url(\"").concat(o,'") format("').concat(i,'");\n font-weight: normal;\n font-style: normal;\n }'))}))}},{key:"render",value:function(){var e=this.props.configuration,t=e.card,r=e.fonts,n=e.layers,o=this.computeLayers(n),i=this.computeGradients(n),a=this.computeFonts(r);return l.createElement("div",{className:"card",ref:this.props.svgRef,style:{maxWidth:t.width,maxHeight:t.height}},l.createElement(p,{height:t.height,width:t.width,fill:t.fill},l.createElement("defs",null,a,i),o))}}])&&o(t.prototype,r),u&&o(t,u),s}(l.Component);w.propTypes={configuration:s.shape({card:s.object,fonts:s.object,layers:s.object}),svgRef:s.any},e.exports=w},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(27))},function(e,t,r){var n=r(130),o=r(15);e.exports=function(e,t){return e&&n(e,t,o)}},function(e,t,r){var n=r(132),o=r(60),i=r(6),a=r(29),u=r(61),c=r(62),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),s=!r&&o(e),f=!r&&!s&&a(e),p=!r&&!s&&!f&&c(e),h=r||s||f||p,d=h?n(e.length,String):[],y=d.length;for(var b in e)!t&&!l.call(e,b)||h&&("length"==b||f&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||u(b,y))||d.push(b);return d}},function(e,t,r){var n=r(133),o=r(8),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=c},function(e,t){var r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&es))return!1;var p=c.get(e),h=c.get(t);if(p&&h)return p==t&&h==e;var d=-1,y=!0,b=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++d=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return a.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:i,height:c},s)},f),a.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return a.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:i,height:c},s)},f),a.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1?arguments[1]:void 0;t=t.childNodes[0]||document.getElementById(this.renderedCardID).childNodes[0];var r=new d(t),n="cardkit-default.jpg",o=this.computeConfiguration(),i=Object.keys(o.layers).find((function(e){var t=o.layers[e];return!0===t.useAsFilename&&!0!==t.hidden&&"text"===t.type})),a=o.layers[i];a&&(n=y(a.text)+".jpg"),r.download(n,{format:"image/jpeg",scale:e})}}])&&o(t.prototype,r),n&&o(t,n),c}(p);e.exports=b},function(e,r){e.exports=t},function(e,t,r){"use strict";var n=r(89);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){e.exports={SVG:r(91),Text:r(92),Rectangle:r(97),Circle:r(98),Ellipse:r(99),Line:r(100),Image:r(101),Path:r(102),LinearGradient:r(103)}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),s(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function l(e,t){return e}function s(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=s(e,o,n)),o}var i=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,r);if(i)return i;var a=Object.keys(r),u=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(r);if(0===a.length){if(O(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return f(r)}var l,x="",j=!1,C=["{","}"];(h(r)&&(j=!0,C=["[","]"]),O(r))&&(x=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(x=" "+RegExp.prototype.toString.call(r)),w(r)&&(x=" "+Date.prototype.toUTCString.call(r)),E(r)&&(x=" "+f(r)),0!==a.length||j&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=j?function(e,t,r,n,o){for(var i=[],a=0,u=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,x,C)):C[0]+x+C[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,u,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),S(n,o)||(a="["+o+"]"),u||(e.seen.indexOf(c.value)<0?(u=y(r)?s(e,c.value,null):s(e,c.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+u.split("\n").map((function(e){return" "+e})).join("\n")):u=e.stylize("[Circular]","special")),g(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function g(e){return void 0===e}function m(e){return x(e)&&"[object RegExp]"===j(e)}function x(e){return"object"==typeof e&&null!==e}function w(e){return x(e)&&"[object Date]"===j(e)}function E(e){return x(e)&&("[object Error]"===j(e)||e instanceof Error)}function O(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(i)&&(i=Object({NODE_ENV:"production"}).NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=g,t.isRegExp=m,t.isObject=x,t.isDate=w,t.isError=E,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(95);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),_[e.getMonth()],t].join(" ")}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=r(96),t._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i1)for(var r=1;r0&&void 0!==arguments[0]&&arguments[0];return this.cardkit.computeConfiguration(e)}}])&&n(t.prototype,r),i&&n(t,i),e}();e.exports=i},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(o(this,e),!t)throw new Error("A configuration object was not provided");if(!this._isValidConfiguration(t))throw new Error("Invalid configuration object provided");this.configuration=t,this._configureOptions(r),this.renderers=[]}var t,r,u;return t=e,(r=[{key:"_configureOptions",value:function(e){if(e){if(e.templates){if(!this._isValidTemplatesConfiguration(e.templates))throw new Error("Invalid templates configuration object provided");this.templates=e.templates}else this.templates=null;if(e.themes){if(!this._isValidThemesConfiguration(e.themes))throw new Error("Invalid themes configuration object provided");this.themes=e.themes}else this.themes=null;if(e.layouts){if(!this._isValidLayoutsConfiguration(e.layouts))throw new Error("Invalid layouts configuration object provided");this.layouts=e.layouts}else this.layouts=null}}},{key:"_isValidConfiguration",value:function(e){return"object"===n(e)&&void 0!==e.card&&"object"===n(e.card)&&void 0!==e.card.height&&void 0!==e.card.width}},{key:"_isValidTemplatesConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidThemesConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidLayoutsConfiguration",value:function(e){return"object"===n(e)}},{key:"_isValidRenderer",value:function(e){return e.cardkit===this}},{key:"computeConfiguration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=Object.assign({},this.configuration);return e&&(e.template&&void 0!==this.templates[e.template]&&(t=a(t,this.templates[e.template])),e.theme&&void 0!==this.themes[e.theme]&&(t=a(t,this.themes[e.theme])),e.layout&&void 0!==this.layouts[e.layout]&&(t=a(t,this.layouts[e.layout]))),t}},{key:"updateConfiguration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{layouts:null,templates:null,themes:null},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.configuration=e,this._configureOptions(t),r){var n=this.getRenderers();n.forEach((function(e){switch(e.constructor.name){case"CardKitDOM":e.rerender()}}))}}},{key:"getRenderers",value:function(){return this.renderers}},{key:"addRenderer",value:function(e){if(!this._isValidRenderer(e))throw new Error("Invalid renderer object provided");this.renderers.push(e)}}])&&i(t.prototype,r),u&&i(t,u),e}();e.exports=u,"undefined"!=typeof window&&(window.CardKit=u)},function(e,t,r){"use strict";(function(t){ /*! * @description Recursive object extending * @author Viacheslav Lotsmanov diff --git a/docs/bundle.js b/docs/bundle.js index 54fe234..2da922a 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -18526,7 +18526,7 @@ module.exports = Array.isArray || function (arr) { fonts: PropTypes.object, layers: PropTypes.object }), - svgRef: PropTypes.any.isRequired + svgRef: PropTypes.any }; // Export module.exports = Card; diff --git a/docs/code/Card.html b/docs/code/Card.html index f34b091..f30a7dc 100644 --- a/docs/code/Card.html +++ b/docs/code/Card.html @@ -1155,7 +1155,7 @@
Returns:

- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/CardKit.html b/docs/code/CardKit.html index eb8d928..5d17b35 100644 --- a/docs/code/CardKit.html +++ b/docs/code/CardKit.html @@ -3487,7 +3487,7 @@
Parameters:

- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/CardKitDOM.html b/docs/code/CardKitDOM.html index 97958a5..247b2c6 100644 --- a/docs/code/CardKitDOM.html +++ b/docs/code/CardKitDOM.html @@ -1775,7 +1775,7 @@

rerender
- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/CardKitServer.html b/docs/code/CardKitServer.html index 18a547f..8be5ec9 100644 --- a/docs/code/CardKitServer.html +++ b/docs/code/CardKitServer.html @@ -853,7 +853,7 @@
Returns:

- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/SVGToImage.html b/docs/code/SVGToImage.html index 6e1f608..41879a6 100644 --- a/docs/code/SVGToImage.html +++ b/docs/code/SVGToImage.html @@ -1907,7 +1907,7 @@
Parameters:

- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/cardkit.js.html b/docs/code/cardkit.js.html index e52f704..5d1db1f 100644 --- a/docs/code/cardkit.js.html +++ b/docs/code/cardkit.js.html @@ -284,7 +284,7 @@

cardkit.js


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/index.html b/docs/code/index.html index 8288296..309ab25 100644 --- a/docs/code/index.html +++ b/docs/code/index.html @@ -302,7 +302,7 @@

Tests


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/renderers_dom_SVGToImage.js.html b/docs/code/renderers_dom_SVGToImage.js.html index 9aa6085..1bba44e 100644 --- a/docs/code/renderers_dom_SVGToImage.js.html +++ b/docs/code/renderers_dom_SVGToImage.js.html @@ -320,7 +320,7 @@

renderers/dom/SVGToImage.js


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/renderers_dom_dom.js.html b/docs/code/renderers_dom_dom.js.html index ae907d7..02bd6df 100644 --- a/docs/code/renderers_dom_dom.js.html +++ b/docs/code/renderers_dom_dom.js.html @@ -224,7 +224,7 @@

renderers/dom/dom.js


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/renderers_server_server.js.html b/docs/code/renderers_server_server.js.html index 537a116..83095e0 100644 --- a/docs/code/renderers_server_server.js.html +++ b/docs/code/renderers_server_server.js.html @@ -118,7 +118,7 @@

renderers/server/server.js


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/docs/code/renderers_shared_Card.js.html b/docs/code/renderers_shared_Card.js.html index 7d1886e..42db8e9 100644 --- a/docs/code/renderers_shared_Card.js.html +++ b/docs/code/renderers_shared_Card.js.html @@ -392,7 +392,7 @@

renderers/shared/Card.js

fonts: PropTypes.object, layers: PropTypes.object, }), - svgRef: PropTypes.any.isRequired, + svgRef: PropTypes.any, }; // Export @@ -409,7 +409,7 @@

renderers/shared/Card.js


- Generated by JSDoc 3.6.6 on Mon May 03 2021 17:46:06 GMT+0100 (British Summer Time) using the Minami theme. + Generated by JSDoc 3.6.6 on Mon May 03 2021 17:49:47 GMT+0100 (British Summer Time) using the Minami theme.
diff --git a/dom.js b/dom.js index 1acd7c9..a100aa0 100644 --- a/dom.js +++ b/dom.js @@ -1070,7 +1070,7 @@ Card.propTypes = { fonts: PropTypes.object, layers: PropTypes.object }), - svgRef: PropTypes.any.isRequired + svgRef: PropTypes.any }; // Export module.exports = Card; diff --git a/package.json b/package.json index 65ad906..5f0dc3b 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "type": "git", "url": "https://github.com/chrishutchinson/cardkit.git" }, + "engines": { + "node": ">14" + }, "scripts": { "test": "istanbul cover --dir test/coverage _mocha -- --require @babel/register --require ignore-styles", "jsdoc": "jsdoc -c ./jsdoc.config.json -d ./docs/code -t ./node_modules/minami --verbose -R ./README.md", @@ -23,7 +26,8 @@ "build-server": "webpack --env=dist-server", "build-core": "webpack --env=dist-core", "build-dom-script": "webpack --env=dist-dom-script", - "build-core-script": "webpack --env=dist-core-script" + "build-core-script": "webpack --env=dist-core-script", + "prepare": "npm test; npm run build; npm run demo; npm run docs" }, "author": "Chris Hutchinson ", "license": "MIT", diff --git a/server.js b/server.js index 8a32c98..effec12 100644 --- a/server.js +++ b/server.js @@ -732,7 +732,7 @@ Card.propTypes = { fonts: PropTypes.object, layers: PropTypes.object }), - svgRef: PropTypes.any.isRequired + svgRef: PropTypes.any }; // Export module.exports = Card; diff --git a/src/renderers/shared/Card.js b/src/renderers/shared/Card.js index 3d3e45b..0a446d0 100644 --- a/src/renderers/shared/Card.js +++ b/src/renderers/shared/Card.js @@ -351,7 +351,7 @@ Card.propTypes = { fonts: PropTypes.object, layers: PropTypes.object, }), - svgRef: PropTypes.any.isRequired, + svgRef: PropTypes.any, }; // Export