1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/public/js/card.min.js

4 lines
52 KiB
JavaScript
Raw Permalink Normal View History

2020-03-29 08:39:57 +02:00
var card=function(r){function n(t){if(e[t])return e[t].exports;var a=e[t]={exports:{},id:t,loaded:!1};return r[t].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var e={};return n.m=r,n.c=e,n.p="",n(0)}([function(r,n,e){(function(n){var t,a,i,o,d=function(r,n){return function(){return r.apply(n,arguments)}};e(1),a=e(5),o=e(6),i=e(7),t=function(){function r(r){this.maskCardNumber=d(this.maskCardNumber,this);var n;return this.options=i(!0,this.defaults,r),this.options.form?(this.$el=a(this.options.form),this.options.container?(this.$container=a(this.options.container),n=a.isDOMElement(this.$container)?this.$container:this.$container[0],void(n.getAttribute(this.initializedDataAttr)||(n.setAttribute(this.initializedDataAttr,!0),this.render(),this.attachHandlers(),this.handleInitialPlaceholders()))):void console.log("Please provide a container")):void console.log("Please provide a form")}var n;return r.prototype.initializedDataAttr="data-jp-card-initialized",r.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-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>',r.prototype.template=function(r,n){return r.replace(/\{\{(.*?)\}\}/g,function(r,e,t){return n[e]})},r.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"],r.prototype.defaults={formatting:!0,formSelectors:{numberInput:'input[name="number"]',expiryInput:'input[name="expiry"]',cvcInput:'input[name="cvc"]',nameInput:'input[name="name"]'},cardSelectors:{cardContainer:".jp-card-container",card:".jp-card",numberDisplay:".jp-card-number",expiryDisplay:".jp-card-expiry",cvcDisplay:".jp-card-cvc",nameDisplay:".jp-card-name"},messages:{validDate:"valid\nthru",monthYear:"month/year"},placeholders:{number:"&bull;&bull;&bull;&bull; &bull;&bull;&bull;&bull; &bull;&bull;&bull;&bull; &bull;&bull;&bull;&bull;",cvc:"&bull;&bull;&bull;",expiry:"&bull;&bull;/&bull;&bull;",name:"Full Name"},masks:{cardNumber:!1},classes:{valid:"jp-card-valid",invalid:"jp-card-invalid"},debug:!1},r.prototype.render=function(){var r,n,e,t,o,d,p,c;a.append(this.$container,this.template(this.cardTemplate,i({},this.options.messages,this.options.placeholders))),p=this.options.cardSelectors;for(e in p)o=p[e],this["$"+e]=a.find(this.$container,o);c=this.options.formSelectors;for(e in c)o=c[e],o=this.options[e]?this.options[e]:o,t=a.find(this.$el,o),!t.length&&this.options.debug&&console.error("Card can't find a "+e+" in your form."),this["$"+e]=t;if(this.options.formatting&&(Payment.formatCardNumber(this.$numberInput),Payment.formatCardCVC(this.$cvcInput),Payment.formatCardExpiry(this.$expiryInput)),this.options.width&&(r=a(this.options.cardSelectors.cardContainer)[0],n=parseInt(r.clientWidth||window.getComputedStyle(r).width),r.style.transform="scale("+this.options.width/n+")"),("undefined"!=typeof navigator&&null!==navigator?navigator.userAgent:void 0)&&(d=navigator.userAgent.toLowerCase(),d.indexOf("safari")!==-1&&d.indexOf("chrome")===-
2017-02-22 19:57:32 +01:00
},function(r,n){r.exports=function(){var r=[];return r.toString=function(){for(var r=[],n=0;n<this.length;n++){var e=this[n];e[2]?r.push("@media "+e[2]+"{"+e[1]+"}"):r.push(e[1])}return r.join("")},r.i=function(n,e){"string"==typeof n&&(n=[[null,n,""]]);for(var t={},a=0;a<this.length;a++){var i=this[a][0];"number"==typeof i&&(t[i]=!0)}for(a=0;a<n.length;a++){var o=n[a];"number"==typeof o[0]&&t[o[0]]||(e&&!o[2]?o[2]=e:e&&(o[2]="("+o[2]+") and ("+e+")"),r.push(o))}},r}},function(r,n,e){function t(r,n){for(var e=0;e<r.length;e++){var t=r[e],a=g[t.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](t.parts[i]);for(;i<t.parts.length;i++)a.parts.push(c(t.parts[i],n))}else{for(var o=[],i=0;i<t.parts.length;i++)o.push(c(t.parts[i],n));g[t.id]={id:t.id,refs:1,parts:o}}}}function a(r){for(var n=[],e={},t=0;t<r.length;t++){var a=r[t],i=a[0],o=a[1],d=a[2],p=a[3],c={css:o,media:d,sourceMap:p};e[i]?e[i].parts.push(c):n.push(e[i]={id:i,parts:[c]})}return n}function i(r,n){var e=j(),t=v[v.length-1];if("top"===r.insertAt)t?t.nextSibling?e.insertBefore(n,t.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),v.push(n);else{if("bottom"!==r.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function o(r){r.parentNode.removeChild(r);var n=v.indexOf(r);n>=0&&v.splice(n,1)}function d(r){var n=document.createElement("style");return n.type="text/css",i(r,n),n}function p(r){var n=document.createElement("link");return n.rel="stylesheet",i(r,n),n}function c(r,n){var e,t,a;if(n.singleton){var i=m++;e=h||(h=d(n)),t=l.bind(null,e,i,!1),a=l.bind(null,e,i,!0)}else r.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=p(n),t=f.bind(null,e),a=function(){o(e),e.href&&URL.revokeObjectURL(e.href)}):(e=d(n),t=s.bind(null,e),a=function(){o(e)});return t(r),function(n){if(n){if(n.css===r.css&&n.media===r.media&&n.sourceMap===r.sourceMap)return;t(r=n)}else a()}}function l(r,n,e,t){var a=e?"":t.css;if(r.styleSheet)r.styleSheet.cssText=x(n,a);else{var i=document.createTextNode(a),o=r.childNodes;o[n]&&r.removeChild(o[n]),o.length?r.insertBefore(i,o[n]):r.appendChild(i)}}function s(r,n){var e=n.css,t=n.media;if(t&&r.setAttribute("media",t),r.styleSheet)r.styleSheet.cssText=e;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(e))}}function f(r,n){var e=n.css,t=n.sourceMap;t&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */");var a=new Blob([e],{type:"text/css"}),i=r.href;r.href=URL.createObjectURL(a),i&&URL.revokeObjectURL(i)}var g={},u=function(r){var n;return function(){return"undefined"==typeof n&&(n=r.apply(this,arguments)),n}},b=u(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),j=u(function(){return document.head||document.getElementsByTagName("head")[0]}),h=null,m=0,v=[];r.exports=function(r,n){n=n||{},"undefined"==typeof n.singleton&&(n.singleton=b()),"undefined"==typeof n.insertAt&&(n.insertAt="bottom");var e=a(r);return t(e,n),function(r){for(var i=[],o=0;o<e.length;o++){var d=e[o],p=g[d.id];p.refs--,i.push(p)}if(r){var c=a(r);t(c,n)}for(var o=0;o<i.length;o++){var p=i[o];if(0===p.refs){for(var l=0;l<p.parts.length;l++)p.parts[l]();delete g[p.id]}}}};var x=function(){var r=[];return function(n,e){return r[n]=e,r.filter(Boolean).join("\n")}}()},function(r,n){(function(){var n,e,t;n=function(r){return n.isDOMElement(r)?r:document.querySelectorAll(r)},n.isDOMElement=function(r){return r&&null!=r.nodeName},t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,n.trim=function(r){return null===r?"":(r+"").replace(t,"")},e=/\r/g,n.val=function(r,n){var t;return arguments.length>1?r.value=n:(t=r.value,"string"==typeof t?t.replace(e,""):null===t?"":t)},n.preventDefault=function(r){return"function"==typeof r.preventDefault?void r.preventDefault():(r.returnValue=!1,!1)},n.normalizeEvent=function(r){var e;return e=r,r={which:null!=e.which?e.which:void 0
//# sourceMappingURL=card.min.js.map