Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

card.js 93KB

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