· 5 years ago · Apr 17, 2020, 05:26 PM
1(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2module.exports = require('./lib/extend');
3
4
5},{"./lib/extend":2}],2:[function(require,module,exports){
6/*!
7 * node.extend
8 * Copyright 2011, John Resig
9 * Dual licensed under the MIT or GPL Version 2 licenses.
10 * http://jquery.org/license
11 *
12 * @fileoverview
13 * Port of jQuery.extend that actually works on node.js
14 */
15var is = require('is');
16
17function extend() {
18 var target = arguments[0] || {};
19 var i = 1;
20 var length = arguments.length;
21 var deep = false;
22 var options, name, src, copy, copy_is_array, clone;
23
24 // Handle a deep copy situation
25 if (typeof target === 'boolean') {
26 deep = target;
27 target = arguments[1] || {};
28 // skip the boolean and the target
29 i = 2;
30 }
31
32 // Handle case when target is a string or something (possible in deep copy)
33 if (typeof target !== 'object' && !is.fn(target)) {
34 target = {};
35 }
36
37 for (; i < length; i++) {
38 // Only deal with non-null/undefined values
39 options = arguments[i]
40 if (options != null) {
41 if (typeof options === 'string') {
42 options = options.split('');
43 }
44 // Extend the base object
45 for (name in options) {
46 src = target[name];
47 copy = options[name];
48
49 // Prevent never-ending loop
50 if (target === copy) {
51 continue;
52 }
53
54 // Recurse if we're merging plain objects or arrays
55 if (deep && copy && (is.hash(copy) || (copy_is_array = is.array(copy)))) {
56 if (copy_is_array) {
57 copy_is_array = false;
58 clone = src && is.array(src) ? src : [];
59 } else {
60 clone = src && is.hash(src) ? src : {};
61 }
62
63 // Never move original objects, clone them
64 target[name] = extend(deep, clone, copy);
65
66 // Don't bring in undefined values
67 } else if (typeof copy !== 'undefined') {
68 target[name] = copy;
69 }
70 }
71 }
72 }
73
74 // Return the modified object
75 return target;
76};
77
78/**
79 * @public
80 */
81extend.version = '1.1.3';
82
83/**
84 * Exports module.
85 */
86module.exports = extend;
87
88
89},{"is":3}],3:[function(require,module,exports){
90
91/**!
92 * is
93 * the definitive JavaScript type testing library
94 *
95 * @copyright 2013-2014 Enrico Marino / Jordan Harband
96 * @license MIT
97 */
98
99var objProto = Object.prototype;
100var owns = objProto.hasOwnProperty;
101var toStr = objProto.toString;
102var symbolValueOf;
103if (typeof Symbol === 'function') {
104 symbolValueOf = Symbol.prototype.valueOf;
105}
106var isActualNaN = function (value) {
107 return value !== value;
108};
109var NON_HOST_TYPES = {
110 boolean: 1,
111 number: 1,
112 string: 1,
113 undefined: 1
114};
115
116var base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
117var hexRegex = /^[A-Fa-f0-9]+$/;
118
119/**
120 * Expose `is`
121 */
122
123var is = module.exports = {};
124
125/**
126 * Test general.
127 */
128
129/**
130 * is.type
131 * Test if `value` is a type of `type`.
132 *
133 * @param {Mixed} value value to test
134 * @param {String} type type
135 * @return {Boolean} true if `value` is a type of `type`, false otherwise
136 * @api public
137 */
138
139is.a = is.type = function (value, type) {
140 return typeof value === type;
141};
142
143/**
144 * is.defined
145 * Test if `value` is defined.
146 *
147 * @param {Mixed} value value to test
148 * @return {Boolean} true if 'value' is defined, false otherwise
149 * @api public
150 */
151
152is.defined = function (value) {
153 return typeof value !== 'undefined';
154};
155
156/**
157 * is.empty
158 * Test if `value` is empty.
159 *
160 * @param {Mixed} value value to test
161 * @return {Boolean} true if `value` is empty, false otherwise
162 * @api public
163 */
164
165is.empty = function (value) {
166 var type = toStr.call(value);
167 var key;
168
169 if ('[object Array]' === type || '[object Arguments]' === type || '[object String]' === type) {
170 return value.length === 0;
171 }
172
173 if ('[object Object]' === type) {
174 for (key in value) {
175 if (owns.call(value, key)) { return false; }
176 }
177 return true;
178 }
179
180 return !value;
181};
182
183/**
184 * is.equal
185 * Test if `value` is equal to `other`.
186 *
187 * @param {Mixed} value value to test
188 * @param {Mixed} other value to compare with
189 * @return {Boolean} true if `value` is equal to `other`, false otherwise
190 */
191
192is.equal = function (value, other) {
193 var strictlyEqual = value === other;
194 if (strictlyEqual) {
195 return true;
196 }
197
198 var type = toStr.call(value);
199 var key;
200
201 if (type !== toStr.call(other)) {
202 return false;
203 }
204
205 if ('[object Object]' === type) {
206 for (key in value) {
207 if (!is.equal(value[key], other[key]) || !(key in other)) {
208 return false;
209 }
210 }
211 for (key in other) {
212 if (!is.equal(value[key], other[key]) || !(key in value)) {
213 return false;
214 }
215 }
216 return true;
217 }
218
219 if ('[object Array]' === type) {
220 key = value.length;
221 if (key !== other.length) {
222 return false;
223 }
224 while (--key) {
225 if (!is.equal(value[key], other[key])) {
226 return false;
227 }
228 }
229 return true;
230 }
231
232 if ('[object Function]' === type) {
233 return value.prototype === other.prototype;
234 }
235
236 if ('[object Date]' === type) {
237 return value.getTime() === other.getTime();
238 }
239
240 return strictlyEqual;
241};
242
243/**
244 * is.hosted
245 * Test if `value` is hosted by `host`.
246 *
247 * @param {Mixed} value to test
248 * @param {Mixed} host host to test with
249 * @return {Boolean} true if `value` is hosted by `host`, false otherwise
250 * @api public
251 */
252
253is.hosted = function (value, host) {
254 var type = typeof host[value];
255 return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];
256};
257
258/**
259 * is.instance
260 * Test if `value` is an instance of `constructor`.
261 *
262 * @param {Mixed} value value to test
263 * @return {Boolean} true if `value` is an instance of `constructor`
264 * @api public
265 */
266
267is.instance = is['instanceof'] = function (value, constructor) {
268 return value instanceof constructor;
269};
270
271/**
272 * is.nil / is.null
273 * Test if `value` is null.
274 *
275 * @param {Mixed} value value to test
276 * @return {Boolean} true if `value` is null, false otherwise
277 * @api public
278 */
279
280is.nil = is['null'] = function (value) {
281 return value === null;
282};
283
284/**
285 * is.undef / is.undefined
286 * Test if `value` is undefined.
287 *
288 * @param {Mixed} value value to test
289 * @return {Boolean} true if `value` is undefined, false otherwise
290 * @api public
291 */
292
293is.undef = is.undefined = function (value) {
294 return typeof value === 'undefined';
295};
296
297/**
298 * Test arguments.
299 */
300
301/**
302 * is.args
303 * Test if `value` is an arguments object.
304 *
305 * @param {Mixed} value value to test
306 * @return {Boolean} true if `value` is an arguments object, false otherwise
307 * @api public
308 */
309
310is.args = is.arguments = function (value) {
311 var isStandardArguments = '[object Arguments]' === toStr.call(value);
312 var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);
313 return isStandardArguments || isOldArguments;
314};
315
316/**
317 * Test array.
318 */
319
320/**
321 * is.array
322 * Test if 'value' is an array.
323 *
324 * @param {Mixed} value value to test
325 * @return {Boolean} true if `value` is an array, false otherwise
326 * @api public
327 */
328
329is.array = function (value) {
330 return '[object Array]' === toStr.call(value);
331};
332
333/**
334 * is.arguments.empty
335 * Test if `value` is an empty arguments object.
336 *
337 * @param {Mixed} value value to test
338 * @return {Boolean} true if `value` is an empty arguments object, false otherwise
339 * @api public
340 */
341is.args.empty = function (value) {
342 return is.args(value) && value.length === 0;
343};
344
345/**
346 * is.array.empty
347 * Test if `value` is an empty array.
348 *
349 * @param {Mixed} value value to test
350 * @return {Boolean} true if `value` is an empty array, false otherwise
351 * @api public
352 */
353is.array.empty = function (value) {
354 return is.array(value) && value.length === 0;
355};
356
357/**
358 * is.arraylike
359 * Test if `value` is an arraylike object.
360 *
361 * @param {Mixed} value value to test
362 * @return {Boolean} true if `value` is an arguments object, false otherwise
363 * @api public
364 */
365
366is.arraylike = function (value) {
367 return !!value && !is.boolean(value)
368 && owns.call(value, 'length')
369 && isFinite(value.length)
370 && is.number(value.length)
371 && value.length >= 0;
372};
373
374/**
375 * Test boolean.
376 */
377
378/**
379 * is.boolean
380 * Test if `value` is a boolean.
381 *
382 * @param {Mixed} value value to test
383 * @return {Boolean} true if `value` is a boolean, false otherwise
384 * @api public
385 */
386
387is.boolean = function (value) {
388 return '[object Boolean]' === toStr.call(value);
389};
390
391/**
392 * is.false
393 * Test if `value` is false.
394 *
395 * @param {Mixed} value value to test
396 * @return {Boolean} true if `value` is false, false otherwise
397 * @api public
398 */
399
400is['false'] = function (value) {
401 return is.boolean(value) && Boolean(Number(value)) === false;
402};
403
404/**
405 * is.true
406 * Test if `value` is true.
407 *
408 * @param {Mixed} value value to test
409 * @return {Boolean} true if `value` is true, false otherwise
410 * @api public
411 */
412
413is['true'] = function (value) {
414 return is.boolean(value) && Boolean(Number(value)) === true;
415};
416
417/**
418 * Test date.
419 */
420
421/**
422 * is.date
423 * Test if `value` is a date.
424 *
425 * @param {Mixed} value value to test
426 * @return {Boolean} true if `value` is a date, false otherwise
427 * @api public
428 */
429
430is.date = function (value) {
431 return '[object Date]' === toStr.call(value);
432};
433
434/**
435 * Test element.
436 */
437
438/**
439 * is.element
440 * Test if `value` is an html element.
441 *
442 * @param {Mixed} value value to test
443 * @return {Boolean} true if `value` is an HTML Element, false otherwise
444 * @api public
445 */
446
447is.element = function (value) {
448 return value !== undefined
449 && typeof HTMLElement !== 'undefined'
450 && value instanceof HTMLElement
451 && value.nodeType === 1;
452};
453
454/**
455 * Test error.
456 */
457
458/**
459 * is.error
460 * Test if `value` is an error object.
461 *
462 * @param {Mixed} value value to test
463 * @return {Boolean} true if `value` is an error object, false otherwise
464 * @api public
465 */
466
467is.error = function (value) {
468 return '[object Error]' === toStr.call(value);
469};
470
471/**
472 * Test function.
473 */
474
475/**
476 * is.fn / is.function (deprecated)
477 * Test if `value` is a function.
478 *
479 * @param {Mixed} value value to test
480 * @return {Boolean} true if `value` is a function, false otherwise
481 * @api public
482 */
483
484is.fn = is['function'] = function (value) {
485 var isAlert = typeof window !== 'undefined' && value === window.alert;
486 return isAlert || '[object Function]' === toStr.call(value);
487};
488
489/**
490 * Test number.
491 */
492
493/**
494 * is.number
495 * Test if `value` is a number.
496 *
497 * @param {Mixed} value value to test
498 * @return {Boolean} true if `value` is a number, false otherwise
499 * @api public
500 */
501
502is.number = function (value) {
503 return '[object Number]' === toStr.call(value);
504};
505
506/**
507 * is.infinite
508 * Test if `value` is positive or negative infinity.
509 *
510 * @param {Mixed} value value to test
511 * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise
512 * @api public
513 */
514is.infinite = function (value) {
515 return value === Infinity || value === -Infinity;
516};
517
518/**
519 * is.decimal
520 * Test if `value` is a decimal number.
521 *
522 * @param {Mixed} value value to test
523 * @return {Boolean} true if `value` is a decimal number, false otherwise
524 * @api public
525 */
526
527is.decimal = function (value) {
528 return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;
529};
530
531/**
532 * is.divisibleBy
533 * Test if `value` is divisible by `n`.
534 *
535 * @param {Number} value value to test
536 * @param {Number} n dividend
537 * @return {Boolean} true if `value` is divisible by `n`, false otherwise
538 * @api public
539 */
540
541is.divisibleBy = function (value, n) {
542 var isDividendInfinite = is.infinite(value);
543 var isDivisorInfinite = is.infinite(n);
544 var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;
545 return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);
546};
547
548/**
549 * is.int
550 * Test if `value` is an integer.
551 *
552 * @param value to test
553 * @return {Boolean} true if `value` is an integer, false otherwise
554 * @api public
555 */
556
557is.int = function (value) {
558 return is.number(value) && !isActualNaN(value) && value % 1 === 0;
559};
560
561/**
562 * is.maximum
563 * Test if `value` is greater than 'others' values.
564 *
565 * @param {Number} value value to test
566 * @param {Array} others values to compare with
567 * @return {Boolean} true if `value` is greater than `others` values
568 * @api public
569 */
570
571is.maximum = function (value, others) {
572 if (isActualNaN(value)) {
573 throw new TypeError('NaN is not a valid value');
574 } else if (!is.arraylike(others)) {
575 throw new TypeError('second argument must be array-like');
576 }
577 var len = others.length;
578
579 while (--len >= 0) {
580 if (value < others[len]) {
581 return false;
582 }
583 }
584
585 return true;
586};
587
588/**
589 * is.minimum
590 * Test if `value` is less than `others` values.
591 *
592 * @param {Number} value value to test
593 * @param {Array} others values to compare with
594 * @return {Boolean} true if `value` is less than `others` values
595 * @api public
596 */
597
598is.minimum = function (value, others) {
599 if (isActualNaN(value)) {
600 throw new TypeError('NaN is not a valid value');
601 } else if (!is.arraylike(others)) {
602 throw new TypeError('second argument must be array-like');
603 }
604 var len = others.length;
605
606 while (--len >= 0) {
607 if (value > others[len]) {
608 return false;
609 }
610 }
611
612 return true;
613};
614
615/**
616 * is.nan
617 * Test if `value` is not a number.
618 *
619 * @param {Mixed} value value to test
620 * @return {Boolean} true if `value` is not a number, false otherwise
621 * @api public
622 */
623
624is.nan = function (value) {
625 return !is.number(value) || value !== value;
626};
627
628/**
629 * is.even
630 * Test if `value` is an even number.
631 *
632 * @param {Number} value value to test
633 * @return {Boolean} true if `value` is an even number, false otherwise
634 * @api public
635 */
636
637is.even = function (value) {
638 return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);
639};
640
641/**
642 * is.odd
643 * Test if `value` is an odd number.
644 *
645 * @param {Number} value value to test
646 * @return {Boolean} true if `value` is an odd number, false otherwise
647 * @api public
648 */
649
650is.odd = function (value) {
651 return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);
652};
653
654/**
655 * is.ge
656 * Test if `value` is greater than or equal to `other`.
657 *
658 * @param {Number} value value to test
659 * @param {Number} other value to compare with
660 * @return {Boolean}
661 * @api public
662 */
663
664is.ge = function (value, other) {
665 if (isActualNaN(value) || isActualNaN(other)) {
666 throw new TypeError('NaN is not a valid value');
667 }
668 return !is.infinite(value) && !is.infinite(other) && value >= other;
669};
670
671/**
672 * is.gt
673 * Test if `value` is greater than `other`.
674 *
675 * @param {Number} value value to test
676 * @param {Number} other value to compare with
677 * @return {Boolean}
678 * @api public
679 */
680
681is.gt = function (value, other) {
682 if (isActualNaN(value) || isActualNaN(other)) {
683 throw new TypeError('NaN is not a valid value');
684 }
685 return !is.infinite(value) && !is.infinite(other) && value > other;
686};
687
688/**
689 * is.le
690 * Test if `value` is less than or equal to `other`.
691 *
692 * @param {Number} value value to test
693 * @param {Number} other value to compare with
694 * @return {Boolean} if 'value' is less than or equal to 'other'
695 * @api public
696 */
697
698is.le = function (value, other) {
699 if (isActualNaN(value) || isActualNaN(other)) {
700 throw new TypeError('NaN is not a valid value');
701 }
702 return !is.infinite(value) && !is.infinite(other) && value <= other;
703};
704
705/**
706 * is.lt
707 * Test if `value` is less than `other`.
708 *
709 * @param {Number} value value to test
710 * @param {Number} other value to compare with
711 * @return {Boolean} if `value` is less than `other`
712 * @api public
713 */
714
715is.lt = function (value, other) {
716 if (isActualNaN(value) || isActualNaN(other)) {
717 throw new TypeError('NaN is not a valid value');
718 }
719 return !is.infinite(value) && !is.infinite(other) && value < other;
720};
721
722/**
723 * is.within
724 * Test if `value` is within `start` and `finish`.
725 *
726 * @param {Number} value value to test
727 * @param {Number} start lower bound
728 * @param {Number} finish upper bound
729 * @return {Boolean} true if 'value' is is within 'start' and 'finish'
730 * @api public
731 */
732is.within = function (value, start, finish) {
733 if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {
734 throw new TypeError('NaN is not a valid value');
735 } else if (!is.number(value) || !is.number(start) || !is.number(finish)) {
736 throw new TypeError('all arguments must be numbers');
737 }
738 var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);
739 return isAnyInfinite || (value >= start && value <= finish);
740};
741
742/**
743 * Test object.
744 */
745
746/**
747 * is.object
748 * Test if `value` is an object.
749 *
750 * @param {Mixed} value value to test
751 * @return {Boolean} true if `value` is an object, false otherwise
752 * @api public
753 */
754
755is.object = function (value) {
756 return '[object Object]' === toStr.call(value);
757};
758
759/**
760 * is.hash
761 * Test if `value` is a hash - a plain object literal.
762 *
763 * @param {Mixed} value value to test
764 * @return {Boolean} true if `value` is a hash, false otherwise
765 * @api public
766 */
767
768is.hash = function (value) {
769 return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;
770};
771
772/**
773 * Test regexp.
774 */
775
776/**
777 * is.regexp
778 * Test if `value` is a regular expression.
779 *
780 * @param {Mixed} value value to test
781 * @return {Boolean} true if `value` is a regexp, false otherwise
782 * @api public
783 */
784
785is.regexp = function (value) {
786 return '[object RegExp]' === toStr.call(value);
787};
788
789/**
790 * Test string.
791 */
792
793/**
794 * is.string
795 * Test if `value` is a string.
796 *
797 * @param {Mixed} value value to test
798 * @return {Boolean} true if 'value' is a string, false otherwise
799 * @api public
800 */
801
802is.string = function (value) {
803 return '[object String]' === toStr.call(value);
804};
805
806/**
807 * Test base64 string.
808 */
809
810/**
811 * is.base64
812 * Test if `value` is a valid base64 encoded string.
813 *
814 * @param {Mixed} value value to test
815 * @return {Boolean} true if 'value' is a base64 encoded string, false otherwise
816 * @api public
817 */
818
819is.base64 = function (value) {
820 return is.string(value) && (!value.length || base64Regex.test(value));
821};
822
823/**
824 * Test base64 string.
825 */
826
827/**
828 * is.hex
829 * Test if `value` is a valid hex encoded string.
830 *
831 * @param {Mixed} value value to test
832 * @return {Boolean} true if 'value' is a hex encoded string, false otherwise
833 * @api public
834 */
835
836is.hex = function (value) {
837 return is.string(value) && (!value.length || hexRegex.test(value));
838};
839
840/**
841 * is.symbol
842 * Test if `value` is an ES6 Symbol
843 *
844 * @param {Mixed} value value to test
845 * @return {Boolean} true if `value` is a Symbol, false otherise
846 * @api public
847 */
848
849is.symbol = function (value) {
850 return typeof Symbol === 'function' && toStr.call(value) === '[object Symbol]' && typeof symbolValueOf.call(value) === 'symbol';
851};
852
853},{}],4:[function(require,module,exports){
854(function (global){
855!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.qj||(f.qj={})).js=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
856var QJ, rreturn, rtrim;
857
858QJ = function(selector) {
859 if (QJ.isDOMElement(selector)) {
860 return selector;
861 }
862 return document.querySelectorAll(selector);
863};
864
865QJ.isDOMElement = function(el) {
866 return el && (el.nodeName != null);
867};
868
869rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
870
871QJ.trim = function(text) {
872 if (text === null) {
873 return "";
874 } else {
875 return (text + "").replace(rtrim, "");
876 }
877};
878
879rreturn = /\r/g;
880
881QJ.val = function(el, val) {
882 var ret;
883 if (arguments.length > 1) {
884 return el.value = val;
885 } else {
886 ret = el.value;
887 if (typeof ret === "string") {
888 return ret.replace(rreturn, "");
889 } else {
890 if (ret === null) {
891 return "";
892 } else {
893 return ret;
894 }
895 }
896 }
897};
898
899QJ.preventDefault = function(eventObject) {
900 if (typeof eventObject.preventDefault === "function") {
901 eventObject.preventDefault();
902 return;
903 }
904 eventObject.returnValue = false;
905 return false;
906};
907
908QJ.normalizeEvent = function(e) {
909 var original;
910 original = e;
911 e = {
912 which: original.which != null ? original.which : void 0,
913 target: original.target || original.srcElement,
914 preventDefault: function() {
915 return QJ.preventDefault(original);
916 },
917 originalEvent: original,
918 data: original.data || original.detail
919 };
920 if (e.which == null) {
921 e.which = original.charCode != null ? original.charCode : original.keyCode;
922 }
923 return e;
924};
925
926QJ.on = function(element, eventName, callback) {
927 var el, multEventName, originalCallback, _i, _j, _len, _len1, _ref;
928 if (element.length) {
929 for (_i = 0, _len = element.length; _i < _len; _i++) {
930 el = element[_i];
931 QJ.on(el, eventName, callback);
932 }
933 return;
934 }
935 if (eventName.match(" ")) {
936 _ref = eventName.split(" ");
937 for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
938 multEventName = _ref[_j];
939 QJ.on(element, multEventName, callback);
940 }
941 return;
942 }
943 originalCallback = callback;
944 callback = function(e) {
945 e = QJ.normalizeEvent(e);
946 return originalCallback(e);
947 };
948 if (element.addEventListener) {
949 return element.addEventListener(eventName, callback, false);
950 }
951 if (element.attachEvent) {
952 eventName = "on" + eventName;
953 return element.attachEvent(eventName, callback);
954 }
955 element['on' + eventName] = callback;
956};
957
958QJ.addClass = function(el, className) {
959 var e;
960 if (el.length) {
961 return (function() {
962 var _i, _len, _results;
963 _results = [];
964 for (_i = 0, _len = el.length; _i < _len; _i++) {
965 e = el[_i];
966 _results.push(QJ.addClass(e, className));
967 }
968 return _results;
969 })();
970 }
971 if (el.classList) {
972 return el.classList.add(className);
973 } else {
974 return el.className += ' ' + className;
975 }
976};
977
978QJ.hasClass = function(el, className) {
979 var e, hasClass, _i, _len;
980 if (el.length) {
981 hasClass = true;
982 for (_i = 0, _len = el.length; _i < _len; _i++) {
983 e = el[_i];
984 hasClass = hasClass && QJ.hasClass(e, className);
985 }
986 return hasClass;
987 }
988 if (el.classList) {
989 return el.classList.contains(className);
990 } else {
991 return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
992 }
993};
994
995QJ.removeClass = function(el, className) {
996 var cls, e, _i, _len, _ref, _results;
997 if (el.length) {
998 return (function() {
999 var _i, _len, _results;
1000 _results = [];
1001 for (_i = 0, _len = el.length; _i < _len; _i++) {
1002 e = el[_i];
1003 _results.push(QJ.removeClass(e, className));
1004 }
1005 return _results;
1006 })();
1007 }
1008 if (el.classList) {
1009 _ref = className.split(' ');
1010 _results = [];
1011 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1012 cls = _ref[_i];
1013 _results.push(el.classList.remove(cls));
1014 }
1015 return _results;
1016 } else {
1017 return el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
1018 }
1019};
1020
1021QJ.toggleClass = function(el, className, bool) {
1022 var e;
1023 if (el.length) {
1024 return (function() {
1025 var _i, _len, _results;
1026 _results = [];
1027 for (_i = 0, _len = el.length; _i < _len; _i++) {
1028 e = el[_i];
1029 _results.push(QJ.toggleClass(e, className, bool));
1030 }
1031 return _results;
1032 })();
1033 }
1034 if (bool) {
1035 if (!QJ.hasClass(el, className)) {
1036 return QJ.addClass(el, className);
1037 }
1038 } else {
1039 return QJ.removeClass(el, className);
1040 }
1041};
1042
1043QJ.append = function(el, toAppend) {
1044 var e;
1045 if (el.length) {
1046 return (function() {
1047 var _i, _len, _results;
1048 _results = [];
1049 for (_i = 0, _len = el.length; _i < _len; _i++) {
1050 e = el[_i];
1051 _results.push(QJ.append(e, toAppend));
1052 }
1053 return _results;
1054 })();
1055 }
1056 return el.insertAdjacentHTML('beforeend', toAppend);
1057};
1058
1059QJ.find = function(el, selector) {
1060 if (el instanceof NodeList || el instanceof Array) {
1061 el = el[0];
1062 }
1063 return el.querySelectorAll(selector);
1064};
1065
1066QJ.trigger = function(el, name, data) {
1067 var e, ev;
1068 try {
1069 ev = new CustomEvent(name, {
1070 detail: data
1071 });
1072 } catch (_error) {
1073 e = _error;
1074 ev = document.createEvent('CustomEvent');
1075 if (ev.initCustomEvent) {
1076 ev.initCustomEvent(name, true, true, data);
1077 } else {
1078 ev.initEvent(name, true, true, data);
1079 }
1080 }
1081 return el.dispatchEvent(ev);
1082};
1083
1084module.exports = QJ;
1085
1086
1087},{}]},{},[1])
1088(1)
1089});
1090}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1091},{}],5:[function(require,module,exports){
1092module.exports = require('cssify');
1093},{"cssify":6}],6:[function(require,module,exports){
1094module.exports = function (css, customDocument) {
1095 var doc = customDocument || document;
1096 if (doc.createStyleSheet) {
1097 var sheet = doc.createStyleSheet()
1098 sheet.cssText = css;
1099 return sheet.ownerNode;
1100 } else {
1101 var head = doc.getElementsByTagName('head')[0],
1102 style = doc.createElement('style');
1103
1104 style.type = 'text/css';
1105
1106 if (style.styleSheet) {
1107 style.styleSheet.cssText = css;
1108 } else {
1109 style.appendChild(doc.createTextNode(css));
1110 }
1111
1112 head.appendChild(style);
1113 return style;
1114 }
1115};
1116
1117module.exports.byUrl = function(url) {
1118 if (document.createStyleSheet) {
1119 return document.createStyleSheet(url).ownerNode;
1120 } else {
1121 var head = document.getElementsByTagName('head')[0],
1122 link = document.createElement('link');
1123
1124 link.rel = 'stylesheet';
1125 link.href = url;
1126
1127 head.appendChild(link);
1128 return link;
1129 }
1130};
1131
1132},{}],7:[function(require,module,exports){
1133(function (global){
1134var Card, QJ, extend, payment;
1135
1136require('../scss/card.scss');
1137
1138QJ = require('qj');
1139
1140payment = require('./payment/src/payment.coffee');
1141
1142extend = require('node.extend');
1143
1144Card = (function() {
1145 var bindVal;
1146
1147 Card.prototype.cardTemplate = '' + '<div class="jp-card-container">' + '<div class="jp-card">' + '<div class="jp-card-front">' + '<div class="jp-card-logo jp-card-visa">visa</div>' + '<div class="jp-card-logo jp-card-mastercard">MasterCard</div>' + '<div class="jp-card-logo jp-card-maestro">Maestro</div>' + '<div class="jp-card-logo jp-card-amex"></div>' + '<div class="jp-card-logo jp-card-discover">discover</div>' + '<div class="jp-card-logo jp-card-dankort"><div class="dk"><div class="d"></div><div class="k"></div></div></div>' + '<div class="jp-card-lower">' + '<div class="jp-card-shiny"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-number jp-card-display">{{number}}</div>' + '<div class="jp-card-name jp-card-display">{{name}}</div>' + '<div class="jp-card-expiry jp-card-display" data-before="{{monthYear}}" data-after="{{validDate}}">{{expiry}}</div>' + '</div>' + '</div>' + '<div class="jp-card-back">' + '<div class="jp-card-bar"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-shiny"></div>' + '</div>' + '</div>' + '</div>';
1148
1149 Card.prototype.template = function(tpl, data) {
1150 return tpl.replace(/\{\{(.*?)\}\}/g, function(match, key, str) {
1151 return data[key];
1152 });
1153 };
1154
1155 Card.prototype.cardTypes = ['jp-card-amex', 'jp-card-dankort', 'jp-card-dinersclub', 'jp-card-discover', 'jp-card-jcb', 'jp-card-laser', 'jp-card-maestro', 'jp-card-mastercard', 'jp-card-unionpay', 'jp-card-visa', 'jp-card-visaelectron'];
1156
1157 Card.prototype.defaults = {
1158 formatting: true,
1159 formSelectors: {
1160 numberInput: 'input[name="number"]',
1161 expiryInput: 'input[name="expiry"]',
1162 cvcInput: 'input[name="cvc"]',
1163 nameInput: 'input[name="name"]'
1164 },
1165 cardSelectors: {
1166 cardContainer: '.jp-card-container',
1167 card: '.jp-card',
1168 numberDisplay: '.jp-card-number',
1169 expiryDisplay: '.jp-card-expiry',
1170 cvcDisplay: '.jp-card-cvc',
1171 nameDisplay: '.jp-card-name'
1172 },
1173 messages: {
1174 validDate: 'valid\nthru',
1175 monthYear: 'month/year'
1176 },
1177 placeholders: {
1178 number: '•••• •••• •••• ••••',
1179 cvc: '•••',
1180 expiry: '••/••',
1181 name: 'Full Name'
1182 },
1183 classes: {
1184 valid: 'jp-card-valid',
1185 invalid: 'jp-card-invalid'
1186 },
1187 debug: false
1188 };
1189
1190 function Card(opts) {
1191 this.options = extend(true, this.defaults, opts);
1192 if (!this.options.form) {
1193 console.log("Please provide a form");
1194 return;
1195 }
1196 this.$el = QJ(this.options.form);
1197 if (!this.options.container) {
1198 console.log("Please provide a container");
1199 return;
1200 }
1201 this.$container = QJ(this.options.container);
1202 this.render();
1203 this.attachHandlers();
1204 this.handleInitialPlaceholders();
1205 }
1206
1207 Card.prototype.render = function() {
1208 var $cardContainer, baseWidth, name, obj, selector, ua, _ref, _ref1;
1209 QJ.append(this.$container, this.template(this.cardTemplate, extend({}, this.options.messages, this.options.placeholders)));
1210 _ref = this.options.cardSelectors;
1211 for (name in _ref) {
1212 selector = _ref[name];
1213 this["$" + name] = QJ.find(this.$container, selector);
1214 }
1215 _ref1 = this.options.formSelectors;
1216 for (name in _ref1) {
1217 selector = _ref1[name];
1218 selector = this.options[name] ? this.options[name] : selector;
1219 obj = QJ.find(this.$el, selector);
1220 if (!obj.length && this.options.debug) {
1221 console.error("Card can't find a " + name + " in your form.");
1222 }
1223 this["$" + name] = obj;
1224 }
1225 if (this.options.formatting) {
1226 Payment.formatCardNumber(this.$numberInput);
1227 Payment.formatCardCVC(this.$cvcInput);
1228 if (this.$expiryInput.length === 1) {
1229 Payment.formatCardExpiry(this.$expiryInput);
1230 }
1231 }
1232 if (this.options.width) {
1233 $cardContainer = QJ(this.options.cardSelectors.cardContainer)[0];
1234 baseWidth = parseInt($cardContainer.clientWidth);
1235 $cardContainer.style.transform = "scale(" + (this.options.width / baseWidth) + ")";
1236 }
1237 if (typeof navigator !== "undefined" && navigator !== null ? navigator.userAgent : void 0) {
1238 ua = navigator.userAgent.toLowerCase();
1239 if (ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1) {
1240 QJ.addClass(this.$card, 'jp-card-safari');
1241 }
1242 }
1243 if (/MSIE 10\./i.test(navigator.userAgent)) {
1244 QJ.addClass(this.$card, 'jp-card-ie-10');
1245 }
1246 if (/rv:11.0/i.test(navigator.userAgent)) {
1247 return QJ.addClass(this.$card, 'jp-card-ie-11');
1248 }
1249 };
1250
1251 Card.prototype.attachHandlers = function() {
1252 var expiryFilters;
1253 bindVal(this.$numberInput, this.$numberDisplay, {
1254 fill: false,
1255 filters: this.validToggler('cardNumber')
1256 });
1257 QJ.on(this.$numberInput, 'payment.cardType', this.handle('setCardType'));
1258 expiryFilters = [
1259 function(val) {
1260 return val.replace(/(\s+)/g, '');
1261 }
1262 ];
1263 if (this.$expiryInput.length === 1) {
1264 expiryFilters.push(this.validToggler('cardExpiry'));
1265 }
1266 bindVal(this.$expiryInput, this.$expiryDisplay, {
1267 join: function(text) {
1268 if (text[0].length === 2 || text[1]) {
1269 return "/";
1270 } else {
1271 return "";
1272 }
1273 },
1274 filters: expiryFilters
1275 });
1276 bindVal(this.$cvcInput, this.$cvcDisplay, {
1277 filters: this.validToggler('cardCVC')
1278 });
1279 QJ.on(this.$cvcInput, 'focus', this.handle('flipCard'));
1280 QJ.on(this.$cvcInput, 'blur', this.handle('unflipCard'));
1281 return bindVal(this.$nameInput, this.$nameDisplay, {
1282 fill: false,
1283 filters: this.validToggler('cardHolderName'),
1284 join: ' '
1285 });
1286 };
1287
1288 Card.prototype.handleInitialPlaceholders = function() {
1289 var el, name, selector, _ref, _results;
1290 _ref = this.options.formSelectors;
1291 _results = [];
1292 for (name in _ref) {
1293 selector = _ref[name];
1294 el = this["$" + name];
1295 if (QJ.val(el)) {
1296 QJ.trigger(el, 'paste');
1297 _results.push(setTimeout(function() {
1298 return QJ.trigger(el, 'keyup');
1299 }));
1300 } else {
1301 _results.push(void 0);
1302 }
1303 }
1304 return _results;
1305 };
1306
1307 Card.prototype.handle = function(fn) {
1308 return (function(_this) {
1309 return function(e) {
1310 var args;
1311 args = Array.prototype.slice.call(arguments);
1312 args.unshift(e.target);
1313 return _this.handlers[fn].apply(_this, args);
1314 };
1315 })(this);
1316 };
1317
1318 Card.prototype.validToggler = function(validatorName) {
1319 var isValid;
1320 if (validatorName === "cardExpiry") {
1321 isValid = function(val) {
1322 var objVal;
1323 objVal = Payment.fns.cardExpiryVal(val);
1324 return Payment.fns.validateCardExpiry(objVal.month, objVal.year);
1325 };
1326 } else if (validatorName === "cardCVC") {
1327 isValid = (function(_this) {
1328 return function(val) {
1329 return Payment.fns.validateCardCVC(val, _this.cardType);
1330 };
1331 })(this);
1332 } else if (validatorName === "cardNumber") {
1333 isValid = function(val) {
1334 return Payment.fns.validateCardNumber(val);
1335 };
1336 } else if (validatorName === "cardHolderName") {
1337 isValid = function(val) {
1338 return val !== "";
1339 };
1340 }
1341 return (function(_this) {
1342 return function(val, $in, $out) {
1343 var result;
1344 result = isValid(val);
1345 _this.toggleValidClass($in, result);
1346 _this.toggleValidClass($out, result);
1347 return val;
1348 };
1349 })(this);
1350 };
1351
1352 Card.prototype.toggleValidClass = function(el, test) {
1353 QJ.toggleClass(el, this.options.classes.valid, test);
1354 return QJ.toggleClass(el, this.options.classes.invalid, !test);
1355 };
1356
1357 Card.prototype.handlers = {
1358 setCardType: function($el, e) {
1359 var cardType;
1360 cardType = e.data;
1361 if (!QJ.hasClass(this.$card, cardType)) {
1362 QJ.removeClass(this.$card, 'jp-card-unknown');
1363 QJ.removeClass(this.$card, this.cardTypes.join(' '));
1364 QJ.addClass(this.$card, "jp-card-" + cardType);
1365 QJ.toggleClass(this.$card, 'jp-card-identified', cardType !== 'unknown');
1366 return this.cardType = cardType;
1367 }
1368 },
1369 flipCard: function() {
1370 return QJ.addClass(this.$card, 'jp-card-flipped');
1371 },
1372 unflipCard: function() {
1373 return QJ.removeClass(this.$card, 'jp-card-flipped');
1374 }
1375 };
1376
1377 bindVal = function(el, out, opts) {
1378 var joiner, o, outDefaults;
1379 if (opts == null) {
1380 opts = {};
1381 }
1382 opts.fill = opts.fill || false;
1383 opts.filters = opts.filters || [];
1384 if (!(opts.filters instanceof Array)) {
1385 opts.filters = [opts.filters];
1386 }
1387 opts.join = opts.join || "";
1388 if (!(typeof opts.join === "function")) {
1389 joiner = opts.join;
1390 opts.join = function() {
1391 return joiner;
1392 };
1393 }
1394 outDefaults = (function() {
1395 var _i, _len, _results;
1396 _results = [];
1397 for (_i = 0, _len = out.length; _i < _len; _i++) {
1398 o = out[_i];
1399 _results.push(o.textContent);
1400 }
1401 return _results;
1402 })();
1403 QJ.on(el, 'focus', function() {
1404 return QJ.addClass(out, 'jp-card-focused');
1405 });
1406 QJ.on(el, 'blur', function() {
1407 return QJ.removeClass(out, 'jp-card-focused');
1408 });
1409 QJ.on(el, 'keyup change paste', function(e) {
1410 var elem, filter, i, join, outEl, outVal, val, _i, _j, _len, _len1, _ref, _results;
1411 val = (function() {
1412 var _i, _len, _results;
1413 _results = [];
1414 for (_i = 0, _len = el.length; _i < _len; _i++) {
1415 elem = el[_i];
1416 _results.push(QJ.val(elem));
1417 }
1418 return _results;
1419 })();
1420 join = opts.join(val);
1421 val = val.join(join);
1422 if (val === join) {
1423 val = "";
1424 }
1425 _ref = opts.filters;
1426 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1427 filter = _ref[_i];
1428 val = filter(val, el, out);
1429 }
1430 _results = [];
1431 for (i = _j = 0, _len1 = out.length; _j < _len1; i = ++_j) {
1432 outEl = out[i];
1433 if (opts.fill) {
1434 outVal = val + outDefaults[i].substring(val.length);
1435 } else {
1436 outVal = val || outDefaults[i];
1437 }
1438 _results.push(outEl.textContent = outVal);
1439 }
1440 return _results;
1441 });
1442 return el;
1443 };
1444
1445 return Card;
1446
1447})();
1448
1449module.exports = Card;
1450
1451global.Card = Card;
1452
1453}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1454},{"../scss/card.scss":10,"./payment/src/payment.coffee":9,"node.extend":1,"qj":4}],8:[function(require,module,exports){
1455var $, Card,
1456 __slice = [].slice;
1457
1458Card = require('./card');
1459
1460$ = jQuery;
1461
1462$.card = {};
1463
1464$.card.fn = {};
1465
1466$.fn.card = function(opts) {
1467 return $.card.fn.construct.apply(this, opts);
1468};
1469
1470$.fn.extend({
1471 card: function() {
1472 var args, option;
1473 option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
1474 return this.each(function() {
1475 var $this, data;
1476 $this = $(this);
1477 data = $this.data('card');
1478 if (!data) {
1479 $.each(option, (function(_this) {
1480 return function(key, value) {
1481 if (value instanceof jQuery) {
1482 return option[key] = value[0];
1483 }
1484 };
1485 })(this));
1486 option['form'] = this;
1487 $this.data('card', (data = new Card(option)));
1488 }
1489 if (typeof option === 'string') {
1490 return data[option].apply(data, args);
1491 }
1492 });
1493 }
1494});
1495
1496},{"./card":7}],9:[function(require,module,exports){
1497(function (global){
1498var Payment, QJ, cardFromNumber, cardFromType, cards, defaultFormat, formatBackCardNumber, formatBackExpiry, formatCardNumber, formatExpiry, formatForwardExpiry, formatForwardSlash, hasTextSelected, luhnCheck, reFormatCardNumber, restrictCVC, restrictCardNumber, restrictExpiry, restrictNumeric, setCardType,
1499 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
1500
1501QJ = require('qj');
1502
1503defaultFormat = /(\d{1,4})/g;
1504
1505cards = [
1506 {
1507 type: 'amex',
1508 pattern: /^3[47]/,
1509 format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
1510 length: [15],
1511 cvcLength: [4],
1512 luhn: true
1513 }, {
1514 type: 'dankort',
1515 pattern: /^5019/,
1516 format: defaultFormat,
1517 length: [16],
1518 cvcLength: [3],
1519 luhn: true
1520 }, {
1521 type: 'dinersclub',
1522 pattern: /^(36|38|30[0-5])/,
1523 format: defaultFormat,
1524 length: [14],
1525 cvcLength: [3],
1526 luhn: true
1527 }, {
1528 type: 'discover',
1529 pattern: /^(6011|65|64[4-9]|622)/,
1530 format: defaultFormat,
1531 length: [16],
1532 cvcLength: [3],
1533 luhn: true
1534 }, {
1535 type: 'jcb',
1536 pattern: /^35/,
1537 format: defaultFormat,
1538 length: [16],
1539 cvcLength: [3],
1540 luhn: true
1541 }, {
1542 type: 'laser',
1543 pattern: /^(6706|6771|6709)/,
1544 format: defaultFormat,
1545 length: [16, 17, 18, 19],
1546 cvcLength: [3],
1547 luhn: true
1548 }, {
1549 type: 'maestro',
1550 pattern: /^(5018|5020|5038|6304|6703|6759|676[1-3])/,
1551 format: defaultFormat,
1552 length: [12, 13, 14, 15, 16, 17, 18, 19],
1553 cvcLength: [3],
1554 luhn: true
1555 }, {
1556 type: 'mastercard',
1557 pattern: /^5[1-5]/,
1558 format: defaultFormat,
1559 length: [16],
1560 cvcLength: [3],
1561 luhn: true
1562 }, {
1563 type: 'unionpay',
1564 pattern: /^62/,
1565 format: defaultFormat,
1566 length: [16, 17, 18, 19],
1567 cvcLength: [3],
1568 luhn: false
1569 }, {
1570 type: 'visaelectron',
1571 pattern: /^4(026|17500|405|508|844|91[37])/,
1572 format: defaultFormat,
1573 length: [16],
1574 cvcLength: [3],
1575 luhn: true
1576 }, {
1577 type: 'visa',
1578 pattern: /^4/,
1579 format: defaultFormat,
1580 length: [13, 14, 15, 16],
1581 cvcLength: [3],
1582 luhn: true
1583 }
1584];
1585
1586cardFromNumber = function(num) {
1587 var card, _i, _len;
1588 num = (num + '').replace(/\D/g, '');
1589 for (_i = 0, _len = cards.length; _i < _len; _i++) {
1590 card = cards[_i];
1591 if (card.pattern.test(num)) {
1592 return card;
1593 }
1594 }
1595};
1596
1597cardFromType = function(type) {
1598 var card, _i, _len;
1599 for (_i = 0, _len = cards.length; _i < _len; _i++) {
1600 card = cards[_i];
1601 if (card.type === type) {
1602 return card;
1603 }
1604 }
1605};
1606
1607luhnCheck = function(num) {
1608 var digit, digits, odd, sum, _i, _len;
1609 odd = true;
1610 sum = 0;
1611 digits = (num + '').split('').reverse();
1612 for (_i = 0, _len = digits.length; _i < _len; _i++) {
1613 digit = digits[_i];
1614 digit = parseInt(digit, 10);
1615 if ((odd = !odd)) {
1616 digit *= 2;
1617 }
1618 if (digit > 9) {
1619 digit -= 9;
1620 }
1621 sum += digit;
1622 }
1623 return sum % 10 === 0;
1624};
1625
1626hasTextSelected = function(target) {
1627 var _ref;
1628 if ((target.selectionStart != null) && target.selectionStart !== target.selectionEnd) {
1629 return true;
1630 }
1631 if ((typeof document !== "undefined" && document !== null ? (_ref = document.selection) != null ? _ref.createRange : void 0 : void 0) != null) {
1632 if (document.selection.createRange().text) {
1633 return true;
1634 }
1635 }
1636 return false;
1637};
1638
1639reFormatCardNumber = function(e) {
1640 return setTimeout((function(_this) {
1641 return function() {
1642 var target, value;
1643 target = e.target;
1644 value = QJ.val(target);
1645 value = Payment.fns.formatCardNumber(value);
1646 return QJ.val(target, value);
1647 };
1648 })(this));
1649};
1650
1651formatCardNumber = function(e) {
1652 var card, digit, length, re, target, upperLength, value;
1653 digit = String.fromCharCode(e.which);
1654 if (!/^\d+$/.test(digit)) {
1655 return;
1656 }
1657 target = e.target;
1658 value = QJ.val(target);
1659 card = cardFromNumber(value + digit);
1660 length = (value.replace(/\D/g, '') + digit).length;
1661 upperLength = 16;
1662 if (card) {
1663 upperLength = card.length[card.length.length - 1];
1664 }
1665 if (length >= upperLength) {
1666 return;
1667 }
1668 if ((target.selectionStart != null) && target.selectionStart !== value.length) {
1669 return;
1670 }
1671 if (card && card.type === 'amex') {
1672 re = /^(\d{4}|\d{4}\s\d{6})$/;
1673 } else {
1674 re = /(?:^|\s)(\d{4})$/;
1675 }
1676 if (re.test(value)) {
1677 e.preventDefault();
1678 return QJ.val(target, value + ' ' + digit);
1679 } else if (re.test(value + digit)) {
1680 e.preventDefault();
1681 return QJ.val(target, value + digit + ' ');
1682 }
1683};
1684
1685formatBackCardNumber = function(e) {
1686 var target, value;
1687 target = e.target;
1688 value = QJ.val(target);
1689 if (e.meta) {
1690 return;
1691 }
1692 if (e.which !== 8) {
1693 return;
1694 }
1695 if ((target.selectionStart != null) && target.selectionStart !== value.length) {
1696 return;
1697 }
1698 if (/\d\s$/.test(value)) {
1699 e.preventDefault();
1700 return QJ.val(target, value.replace(/\d\s$/, ''));
1701 } else if (/\s\d?$/.test(value)) {
1702 e.preventDefault();
1703 return QJ.val(target, value.replace(/\s\d?$/, ''));
1704 }
1705};
1706
1707formatExpiry = function(e) {
1708 var digit, target, val;
1709 digit = String.fromCharCode(e.which);
1710 if (!/^\d+$/.test(digit)) {
1711 return;
1712 }
1713 target = e.target;
1714 val = QJ.val(target) + digit;
1715 if (/^\d$/.test(val) && (val !== '0' && val !== '1')) {
1716 e.preventDefault();
1717 return QJ.val(target, "0" + val + " / ");
1718 } else if (/^\d\d$/.test(val)) {
1719 e.preventDefault();
1720 return QJ.val(target, "" + val + " / ");
1721 }
1722};
1723
1724formatForwardExpiry = function(e) {
1725 var digit, target, val;
1726 digit = String.fromCharCode(e.which);
1727 if (!/^\d+$/.test(digit)) {
1728 return;
1729 }
1730 target = e.target;
1731 val = QJ.val(target);
1732 if (/^\d\d$/.test(val)) {
1733 return QJ.val(target, "" + val + " / ");
1734 }
1735};
1736
1737formatForwardSlash = function(e) {
1738 var slash, target, val;
1739 slash = String.fromCharCode(e.which);
1740 if (slash !== '/') {
1741 return;
1742 }
1743 target = e.target;
1744 val = QJ.val(target);
1745 if (/^\d$/.test(val) && val !== '0') {
1746 return QJ.val(target, "0" + val + " / ");
1747 }
1748};
1749
1750formatBackExpiry = function(e) {
1751 var target, value;
1752 if (e.metaKey) {
1753 return;
1754 }
1755 target = e.target;
1756 value = QJ.val(target);
1757 if (e.which !== 8) {
1758 return;
1759 }
1760 if ((target.selectionStart != null) && target.selectionStart !== value.length) {
1761 return;
1762 }
1763 if (/\d(\s|\/)+$/.test(value)) {
1764 e.preventDefault();
1765 return QJ.val(target, value.replace(/\d(\s|\/)*$/, ''));
1766 } else if (/\s\/\s?\d?$/.test(value)) {
1767 e.preventDefault();
1768 return QJ.val(target, value.replace(/\s\/\s?\d?$/, ''));
1769 }
1770};
1771
1772restrictNumeric = function(e) {
1773 var input;
1774 if (e.metaKey || e.ctrlKey) {
1775 return true;
1776 }
1777 if (e.which === 32) {
1778 return e.preventDefault();
1779 }
1780 if (e.which === 0) {
1781 return true;
1782 }
1783 if (e.which < 33) {
1784 return true;
1785 }
1786 input = String.fromCharCode(e.which);
1787 if (!/[\d\s]/.test(input)) {
1788 return e.preventDefault();
1789 }
1790};
1791
1792restrictCardNumber = function(e) {
1793 var card, digit, target, value;
1794 target = e.target;
1795 digit = String.fromCharCode(e.which);
1796 if (!/^\d+$/.test(digit)) {
1797 return;
1798 }
1799 if (hasTextSelected(target)) {
1800 return;
1801 }
1802 value = (QJ.val(target) + digit).replace(/\D/g, '');
1803 card = cardFromNumber(value);
1804 if (card) {
1805 if (!(value.length <= card.length[card.length.length - 1])) {
1806 return e.preventDefault();
1807 }
1808 } else {
1809 if (!(value.length <= 16)) {
1810 return e.preventDefault();
1811 }
1812 }
1813};
1814
1815restrictExpiry = function(e) {
1816 var digit, target, value;
1817 target = e.target;
1818 digit = String.fromCharCode(e.which);
1819 if (!/^\d+$/.test(digit)) {
1820 return;
1821 }
1822 if (hasTextSelected(target)) {
1823 return;
1824 }
1825 value = QJ.val(target) + digit;
1826 value = value.replace(/\D/g, '');
1827 if (value.length > 6) {
1828 return e.preventDefault();
1829 }
1830};
1831
1832restrictCVC = function(e) {
1833 var digit, target, val;
1834 target = e.target;
1835 digit = String.fromCharCode(e.which);
1836 if (!/^\d+$/.test(digit)) {
1837 return;
1838 }
1839 val = QJ.val(target) + digit;
1840 if (!(val.length <= 4)) {
1841 return e.preventDefault();
1842 }
1843};
1844
1845setCardType = function(e) {
1846 var allTypes, card, cardType, target, val;
1847 target = e.target;
1848 val = QJ.val(target);
1849 cardType = Payment.fns.cardType(val) || 'unknown';
1850 if (!QJ.hasClass(target, cardType)) {
1851 allTypes = (function() {
1852 var _i, _len, _results;
1853 _results = [];
1854 for (_i = 0, _len = cards.length; _i < _len; _i++) {
1855 card = cards[_i];
1856 _results.push(card.type);
1857 }
1858 return _results;
1859 })();
1860 QJ.removeClass(target, 'unknown');
1861 QJ.removeClass(target, allTypes.join(' '));
1862 QJ.addClass(target, cardType);
1863 QJ.toggleClass(target, 'identified', cardType !== 'unknown');
1864 return QJ.trigger(target, 'payment.cardType', cardType);
1865 }
1866};
1867
1868Payment = (function() {
1869 function Payment() {}
1870
1871 Payment.fns = {
1872 cardExpiryVal: function(value) {
1873 var month, prefix, year, _ref;
1874 value = value.replace(/\s/g, '');
1875 _ref = value.split('/', 2), month = _ref[0], year = _ref[1];
1876 if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
1877 prefix = (new Date).getFullYear();
1878 prefix = prefix.toString().slice(0, 2);
1879 year = prefix + year;
1880 }
1881 month = parseInt(month, 10);
1882 year = parseInt(year, 10);
1883 return {
1884 month: month,
1885 year: year
1886 };
1887 },
1888 validateCardNumber: function(num) {
1889 var card, _ref;
1890 num = (num + '').replace(/\s+|-/g, '');
1891 if (!/^\d+$/.test(num)) {
1892 return false;
1893 }
1894 card = cardFromNumber(num);
1895 if (!card) {
1896 return false;
1897 }
1898 return (_ref = num.length, __indexOf.call(card.length, _ref) >= 0) && (card.luhn === false || luhnCheck(num));
1899 },
1900 validateCardExpiry: function(month, year) {
1901 var currentTime, expiry, prefix, _ref;
1902 if (typeof month === 'object' && 'month' in month) {
1903 _ref = month, month = _ref.month, year = _ref.year;
1904 }
1905 if (!(month && year)) {
1906 return false;
1907 }
1908 month = QJ.trim(month);
1909 year = QJ.trim(year);
1910 if (!/^\d+$/.test(month)) {
1911 return false;
1912 }
1913 if (!/^\d+$/.test(year)) {
1914 return false;
1915 }
1916 if (!(parseInt(month, 10) <= 12)) {
1917 return false;
1918 }
1919 if (year.length === 2) {
1920 prefix = (new Date).getFullYear();
1921 prefix = prefix.toString().slice(0, 2);
1922 year = prefix + year;
1923 }
1924 expiry = new Date(year, month);
1925 currentTime = new Date;
1926 expiry.setMonth(expiry.getMonth() - 1);
1927 expiry.setMonth(expiry.getMonth() + 1, 1);
1928 return expiry > currentTime;
1929 },
1930 validateCardCVC: function(cvc, type) {
1931 var _ref, _ref1;
1932 cvc = QJ.trim(cvc);
1933 if (!/^\d+$/.test(cvc)) {
1934 return false;
1935 }
1936 if (type && cardFromType(type)) {
1937 return _ref = cvc.length, __indexOf.call((_ref1 = cardFromType(type)) != null ? _ref1.cvcLength : void 0, _ref) >= 0;
1938 } else {
1939 return cvc.length >= 3 && cvc.length <= 4;
1940 }
1941 },
1942 cardType: function(num) {
1943 var _ref;
1944 if (!num) {
1945 return null;
1946 }
1947 return ((_ref = cardFromNumber(num)) != null ? _ref.type : void 0) || null;
1948 },
1949 formatCardNumber: function(num) {
1950 var card, groups, upperLength, _ref;
1951 card = cardFromNumber(num);
1952 if (!card) {
1953 return num;
1954 }
1955 upperLength = card.length[card.length.length - 1];
1956 num = num.replace(/\D/g, '');
1957 num = num.slice(0, +upperLength + 1 || 9e9);
1958 if (card.format.global) {
1959 return (_ref = num.match(card.format)) != null ? _ref.join(' ') : void 0;
1960 } else {
1961 groups = card.format.exec(num);
1962 if (groups != null) {
1963 groups.shift();
1964 }
1965 return groups != null ? groups.join(' ') : void 0;
1966 }
1967 }
1968 };
1969
1970 Payment.restrictNumeric = function(el) {
1971 return QJ.on(el, 'keypress', restrictNumeric);
1972 };
1973
1974 Payment.cardExpiryVal = function(el) {
1975 return Payment.fns.cardExpiryVal(QJ.val(el));
1976 };
1977
1978 Payment.formatCardCVC = function(el) {
1979 Payment.restrictNumeric(el);
1980 QJ.on(el, 'keypress', restrictCVC);
1981 return el;
1982 };
1983
1984 Payment.formatCardExpiry = function(el) {
1985 Payment.restrictNumeric(el);
1986 QJ.on(el, 'keypress', restrictExpiry);
1987 QJ.on(el, 'keypress', formatExpiry);
1988 QJ.on(el, 'keypress', formatForwardSlash);
1989 QJ.on(el, 'keypress', formatForwardExpiry);
1990 QJ.on(el, 'keydown', formatBackExpiry);
1991 return el;
1992 };
1993
1994 Payment.formatCardNumber = function(el) {
1995 Payment.restrictNumeric(el);
1996 QJ.on(el, 'keypress', restrictCardNumber);
1997 QJ.on(el, 'keypress', formatCardNumber);
1998 QJ.on(el, 'keydown', formatBackCardNumber);
1999 QJ.on(el, 'keyup', setCardType);
2000 QJ.on(el, 'paste', reFormatCardNumber);
2001 return el;
2002 };
2003
2004 Payment.getCardArray = function() {
2005 return cards;
2006 };
2007
2008 Payment.setCardArray = function(cardArray) {
2009 cards = cardArray;
2010 return true;
2011 };
2012
2013 Payment.addToCardArray = function(cardObject) {
2014 return cards.push(cardObject);
2015 };
2016
2017 Payment.removeFromCardArray = function(type) {
2018 var key, value;
2019 for (key in cards) {
2020 value = cards[key];
2021 if (value.type === type) {
2022 cards.splice(key, 1);
2023 }
2024 }
2025 return true;
2026 };
2027
2028 return Payment;
2029
2030})();
2031
2032module.exports = Payment;
2033
2034global.Payment = Payment;
2035
2036}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2037},{"qj":4}],10:[function(require,module,exports){
2038module.exports = require('sassify')('.jp-card.jp-card-safari.jp-card-identified .jp-card-front:before, .jp-card.jp-card-safari.jp-card-identified .jp-card-back:before { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); } .jp-card.jp-card-ie-10.jp-card-flipped, .jp-card.jp-card-ie-11.jp-card-flipped { -webkit-transform: 0deg; -moz-transform: 0deg; -ms-transform: 0deg; -o-transform: 0deg; transform: 0deg; } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-front, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-front { -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back { -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back:after { left: 18%; } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-cvc, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-cvc { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -o-transform: rotateY(180deg); transform: rotateY(180deg); left: 5%; } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny { left: 84%; } .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny:after { left: -480%; -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -o-transform: rotateY(180deg); transform: rotateY(180deg); } .jp-card.jp-card-ie-10.jp-card-amex .jp-card-back, .jp-card.jp-card-ie-11.jp-card-amex .jp-card-back { display: none; } .jp-card-logo { height: 36px; width: 60px; font-style: italic; } .jp-card-logo, .jp-card-logo:before, .jp-card-logo:after { box-sizing: border-box; } .jp-card-logo.jp-card-amex { text-transform: uppercase; font-size: 4px; font-weight: bold; color: white; background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px); background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px); border: 1px solid #EEE; } .jp-card-logo.jp-card-amex:before, .jp-card-logo.jp-card-amex:after { width: 28px; display: block; position: absolute; left: 16px; } .jp-card-logo.jp-card-amex:before { height: 28px; content: "american"; top: 3px; text-align: left; padding-left: 2px; padding-top: 11px; background: #267AC3; } .jp-card-logo.jp-card-amex:after { content: "express"; bottom: 11px; text-align: right; padding-right: 2px; } .jp-card.jp-card-amex.jp-card-flipped { -webkit-transform: none; -moz-transform: none; -ms-transform: none; -o-transform: none; transform: none; } .jp-card.jp-card-amex.jp-card-identified .jp-card-front:before, .jp-card.jp-card-amex.jp-card-identified .jp-card-back:before { background-color: #108168; } .jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-logo.jp-card-amex { opacity: 1; } .jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-cvc { visibility: visible; } .jp-card.jp-card-amex.jp-card-identified .jp-card-front:after { opacity: 1; } .jp-card-logo.jp-card-discover { background: #FF6600; color: #111; text-transform: uppercase; font-style: normal; font-weight: bold; font-size: 10px; text-align: center; overflow: hidden; z-index: 1; padding-top: 9px; letter-spacing: .03em; border: 1px solid #EEE; } .jp-card-logo.jp-card-discover:before, .jp-card-logo.jp-card-discover:after { content: " "; display: block; position: absolute; } .jp-card-logo.jp-card-discover:before { background: white; width: 200px; height: 200px; border-radius: 200px; bottom: -5%; right: -80%; z-index: -1; } .jp-card-logo.jp-card-discover:after { width: 8px; height: 8px; border-radius: 4px; top: 10px; left: 27px; background-color: #FF6600; background-image: -webkit-radial-gradient(#FF6600, #fff, , , , , , , , ); background-image: radial-gradient( #FF6600, #fff, , , , , , , , ); content: "network"; font-size: 4px; line-height: 24px; text-indent: -7px; } .jp-card .jp-card-front .jp-card-logo.jp-card-discover { right: 12%; top: 18%; } .jp-card.jp-card-discover.jp-card-identified .jp-card-front:before, .jp-card.jp-card-discover.jp-card-identified .jp-card-back:before { background-color: #86B8CF; } .jp-card.jp-card-discover.jp-card-identified .jp-card-logo.jp-card-discover { opacity: 1; } .jp-card.jp-card-discover.jp-card-identified .jp-card-front:after { -webkit-transition: 400ms; -moz-transition: 400ms; transition: 400ms; content: " "; display: block; background-color: #FF6600; background-image: -webkit-linear-gradient(#FF6600, #ffa366, #FF6600); background-image: linear-gradient(#FF6600, #ffa366, #FF6600, , , , , , , ); height: 50px; width: 50px; border-radius: 25px; position: absolute; left: 100%; top: 15%; margin-left: -25px; box-shadow: inset 1px 1px 3px 1px rgba(0, 0, 0, 0.5); } .jp-card-logo.jp-card-visa { background: white; text-transform: uppercase; color: #1A1876; text-align: center; font-weight: bold; font-size: 15px; line-height: 18px; } .jp-card-logo.jp-card-visa:before, .jp-card-logo.jp-card-visa:after { content: " "; display: block; width: 100%; height: 25%; } .jp-card-logo.jp-card-visa:before { background: #1A1876; } .jp-card-logo.jp-card-visa:after { background: #E79800; } .jp-card.jp-card-visa.jp-card-identified .jp-card-front:before, .jp-card.jp-card-visa.jp-card-identified .jp-card-back:before { background-color: #191278; } .jp-card.jp-card-visa.jp-card-identified .jp-card-logo.jp-card-visa { opacity: 1; } .jp-card-logo.jp-card-mastercard { color: white; font-weight: bold; text-align: center; font-size: 9px; line-height: 36px; z-index: 1; text-shadow: 1px 1px rgba(0, 0, 0, 0.6); } .jp-card-logo.jp-card-mastercard:before, .jp-card-logo.jp-card-mastercard:after { content: " "; display: block; width: 36px; top: 0; position: absolute; height: 36px; border-radius: 18px; } .jp-card-logo.jp-card-mastercard:before { left: 0; background: #FF0000; z-index: -1; } .jp-card-logo.jp-card-mastercard:after { right: 0; background: #FFAB00; z-index: -2; } .jp-card.jp-card-mastercard.jp-card-identified .jp-card-front .jp-card-logo.jp-card-mastercard, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back .jp-card-logo.jp-card-mastercard { box-shadow: none; } .jp-card.jp-card-mastercard.jp-card-identified .jp-card-front:before, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back:before { background-color: #0061A8; } .jp-card.jp-card-mastercard.jp-card-identified .jp-card-logo.jp-card-mastercard { opacity: 1; } .jp-card-logo.jp-card-maestro { color: white; font-weight: bold; text-align: center; font-size: 14px; line-height: 36px; z-index: 1; text-shadow: 1px 1px rgba(0, 0, 0, 0.6); } .jp-card-logo.jp-card-maestro:before, .jp-card-logo.jp-card-maestro:after { content: " "; display: block; width: 36px; top: 0; position: absolute; height: 36px; border-radius: 18px; } .jp-card-logo.jp-card-maestro:before { left: 0; background: #0064CB; z-index: -1; } .jp-card-logo.jp-card-maestro:after { right: 0; background: #CC0000; z-index: -2; } .jp-card.jp-card-maestro.jp-card-identified .jp-card-front .jp-card-logo.jp-card-maestro, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back .jp-card-logo.jp-card-maestro { box-shadow: none; } .jp-card.jp-card-maestro.jp-card-identified .jp-card-front:before, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back:before { background-color: #0B2C5F; } .jp-card.jp-card-maestro.jp-card-identified .jp-card-logo.jp-card-maestro { opacity: 1; } .jp-card-logo.jp-card-dankort { width: 60px; height: 36px; padding: 3px; border-radius: 8px; border: #000000 1px solid; background-color: #FFFFFF; } .jp-card-logo.jp-card-dankort .dk { position: relative; width: 100%; height: 100%; overflow: hidden; } .jp-card-logo.jp-card-dankort .dk:before { background-color: #ED1C24; content: \'\'; position: absolute; width: 100%; height: 100%; display: block; border-radius: 6px; } .jp-card-logo.jp-card-dankort .dk:after { content: \'\'; position: absolute; top: 50%; margin-top: -7.7px; right: 0; width: 0; height: 0; border-style: solid; border-width: 7px 7px 10px 0; border-color: transparent #ED1C24 transparent transparent; z-index: 1; } .jp-card-logo.jp-card-dankort .d, .jp-card-logo.jp-card-dankort .k { position: absolute; top: 50%; width: 50%; display: block; height: 15.4px; margin-top: -7.7px; background: white; } .jp-card-logo.jp-card-dankort .d { left: 0; border-radius: 0 8px 10px 0; } .jp-card-logo.jp-card-dankort .d:before { content: \'\'; position: absolute; top: 50%; left: 50%; display: block; background: #ED1C24; border-radius: 2px 4px 6px 0px; height: 5px; width: 7px; margin: -3px 0 0 -4px; } .jp-card-logo.jp-card-dankort .k { right: 0; } .jp-card-logo.jp-card-dankort .k:before, .jp-card-logo.jp-card-dankort .k:after { content: \'\'; position: absolute; right: 50%; width: 0; height: 0; border-style: solid; margin-right: -1px; } .jp-card-logo.jp-card-dankort .k:before { top: 0; border-width: 8px 5px 0 0; border-color: #ED1C24 transparent transparent transparent; } .jp-card-logo.jp-card-dankort .k:after { bottom: 0; border-width: 0 5px 8px 0; border-color: transparent transparent #ED1C24 transparent; } .jp-card.jp-card-dankort.jp-card-identified .jp-card-front:before, .jp-card.jp-card-dankort.jp-card-identified .jp-card-back:before { background-color: #0055C7; } .jp-card.jp-card-dankort.jp-card-identified .jp-card-logo.jp-card-dankort { opacity: 1; } .jp-card-container { -webkit-perspective: 1000px; -moz-perspective: 1000px; perspective: 1000px; width: 350px; max-width: 100%; height: 200px; margin: auto; z-index: 1; position: relative; } .jp-card { font-family: "Helvetica Neue"; line-height: 1; position: relative; width: 100%; height: 100%; min-width: 315px; border-radius: 10px; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 400ms linear; -moz-transition: all 400ms linear; transition: all 400ms linear; } .jp-card > *, .jp-card > *:before, .jp-card > *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; font-family: inherit; } .jp-card.jp-card-flipped { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -o-transform: rotateY(180deg); transform: rotateY(180deg); } .jp-card .jp-card-front, .jp-card .jp-card-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 400ms linear; -moz-transition: all 400ms linear; transition: all 400ms linear; width: 100%; height: 100%; position: absolute; top: 0; left: 0; overflow: hidden; border-radius: 10px; background: #DDD; } .jp-card .jp-card-front:before, .jp-card .jp-card-back:before { content: " "; display: block; position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; border-radius: 10px; -webkit-transition: all 400ms ease; -moz-transition: all 400ms ease; transition: all 400ms ease; } .jp-card .jp-card-front:after, .jp-card .jp-card-back:after { content: " "; display: block; } .jp-card .jp-card-front .jp-card-display, .jp-card .jp-card-back .jp-card-display { color: white; font-weight: normal; opacity: 0.5; -webkit-transition: opacity 400ms linear; -moz-transition: opacity 400ms linear; transition: opacity 400ms linear; } .jp-card .jp-card-front .jp-card-display.jp-card-focused, .jp-card .jp-card-back .jp-card-display.jp-card-focused { opacity: 1; font-weight: 700; } .jp-card .jp-card-front .jp-card-cvc, .jp-card .jp-card-back .jp-card-cvc { font-family: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; font-size: 14px; } .jp-card .jp-card-front .jp-card-shiny, .jp-card .jp-card-back .jp-card-shiny { width: 50px; height: 35px; border-radius: 5px; background: #CCC; position: relative; } .jp-card .jp-card-front .jp-card-shiny:before, .jp-card .jp-card-back .jp-card-shiny:before { content: " "; display: block; width: 70%; height: 60%; border-top-right-radius: 5px; border-bottom-right-radius: 5px; background: #d9d9d9; position: absolute; top: 20%; } .jp-card .jp-card-front .jp-card-logo { position: absolute; opacity: 0; right: 5%; top: 8%; -webkit-transition: 400ms; -moz-transition: 400ms; transition: 400ms; } .jp-card .jp-card-front .jp-card-lower { width: 80%; position: absolute; left: 10%; bottom: 30px; } @media only screen and (max-width: 480px) { .jp-card .jp-card-front .jp-card-lower { width: 90%; left: 5%; } } .jp-card .jp-card-front .jp-card-lower .jp-card-cvc { visibility: hidden; float: right; position: relative; bottom: 5px; } .jp-card .jp-card-front .jp-card-lower .jp-card-number { font-family: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; font-size: 24px; clear: both; margin-bottom: 30px; } .jp-card .jp-card-front .jp-card-lower .jp-card-expiry { font-family: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; letter-spacing: 0em; position: relative; float: right; width: 25%; } .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before, .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after { font-family: "Helvetica Neue"; font-weight: bold; font-size: 7px; white-space: pre; display: block; opacity: .5; } .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before { content: attr(data-before); margin-bottom: 2px; font-size: 7px; text-transform: uppercase; } .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after { position: absolute; content: attr(data-after); text-align: right; right: 100%; margin-right: 5px; margin-top: 2px; bottom: 0; } .jp-card .jp-card-front .jp-card-lower .jp-card-name { text-transform: uppercase; font-family: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; font-size: 20px; max-height: 45px; position: absolute; bottom: 0; width: 190px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: horizontal; overflow: hidden; text-overflow: ellipsis; } .jp-card .jp-card-back { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); -ms-transform: rotateY(180deg); -o-transform: rotateY(180deg); transform: rotateY(180deg); } .jp-card .jp-card-back .jp-card-bar { background-color: #444; background-image: -webkit-linear-gradient(#444, #333); background-image: linear-gradient(#444, #333, , , , , , , , ); width: 100%; height: 20%; position: absolute; top: 10%; } .jp-card .jp-card-back:after { content: " "; display: block; background-color: #FFF; background-image: -webkit-linear-gradient(#FFF, #FFF); background-image: linear-gradient(#FFF, #FFF, , , , , , , , ); width: 80%; height: 16%; position: absolute; top: 40%; left: 2%; } .jp-card .jp-card-back .jp-card-cvc { position: absolute; top: 40%; left: 85%; -webkit-transition-delay: 600ms; -moz-transition-delay: 600ms; transition-delay: 600ms; } .jp-card .jp-card-back .jp-card-shiny { position: absolute; top: 66%; left: 2%; } .jp-card .jp-card-back .jp-card-shiny:after { content: "This card has been issued by Jesse Pollak and is licensed for anyone to use anywhere for free.\AIt comes with no warranty.\A For support issues, please visit: github.com/jessepollak/card."; position: absolute; left: 120%; top: 5%; color: white; font-size: 7px; width: 230px; opacity: .5; } .jp-card.jp-card-identified { box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); } .jp-card.jp-card-identified .jp-card-front, .jp-card.jp-card-identified .jp-card-back { background-color: #000; background-color: rgba(0, 0, 0, 0.5); } .jp-card.jp-card-identified .jp-card-front:before, .jp-card.jp-card-identified .jp-card-back:before { -webkit-transition: all 400ms ease; -moz-transition: all 400ms ease; transition: all 400ms ease; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); opacity: 1; } .jp-card.jp-card-identified .jp-card-front .jp-card-logo, .jp-card.jp-card-identified .jp-card-back .jp-card-logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); } .jp-card.jp-card-identified.no-radial-gradient .jp-card-front:before, .jp-card.jp-card-identified.no-radial-gradient .jp-card-back:before { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); } ');;
2039},{"sassify":5}]},{},[8]);