!function(t){vare={};functionn(r){if(e[r])returne[r].exports;varo=e[r]={i:r,l:!1,exports:{}};returnt[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)returnt;if(4&e&&"object"==typeoft&&t&&t.__esModule)returnt;varr=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeoft)for(varoint)n.d(r,o,function(e){returnt[e]}.bind(null,o));returnr},n.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returnn.d(e,"a",e),e},n.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=25)}({25:function(t,e,n){t.exports=n("flnV")},flnV:function(t,e,n){"use strict";n.r(e);varr=n("o0o1"),o=n.n(r);functioni(t,e,n,r,o,i,a){try{varc=t[i](a),u=c.value}catch(t){returnvoidn(t)}c.done?e(u):Promise.resolve(u).then(r,o)}functiona(t){returnfunction(){vare=this,n=arguments;returnnewPromise((function(r,o){vara=t.apply(e,n);functionc(t){i(a,r,o,c,u,"next",t)}functionu(t){i(a,r,o,c,u,"throw",t)}c(void0)}))}}functionc(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(new(function(){functiont(){!function(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}(this,t),this.appId=document.querySelector("meta[name=square-appId]").content,this.locationId=document.querySelector("meta[name=square-locationId]").content,this.isLoaded=!1}vare,n,r,i,u,s,l,f;returne=t,(n=[{key:"init",value:(f=a(o.a.mark((functiont(){vare;returno.a.wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnthis.payments=Square.payments(this.appId,this.locationId),t.next=3,this.payments.card();case3:returnthis.card=t.sent,t.next=6,this.card.attach("#card-container");case6:this.isLoaded=!0,(e=document.querySelector(".sq-card-iframe-container"))&&e.setAttribute("style","150px !important"),document.querySelector(".toggle-payment-with-token")&&document.getElementById("card-container").classList.add("hidden");case11:case"end":returnt.stop()}}),t,this)}))),function(){returnf.apply(this,arguments)})},{key:"verifyBuyerCallback",value:function(t,e){null==t&&(console.log("no error"),console.log(e)),console.log(t),die("verify buyer")}},{key:"completePaymentWithoutToken",value:(l=a(o.a.mark((functiont(e){varn,r,i;returno.a.wrap((function(t){for(;;)switch(t.prev=t.next){case0:returndocument.getElementById("errors").hidden=!0,e.target.parentElement.disabled=!0,t.next=4,this.card.tokenize();case4:returnn=t.sent,console.log("square token = "+n.token),t.prev=6,t.next=9,verifyBuyer(n.token,verifyBuyerCallback);case9:r=t.sent,t.next=16;break;case12:t.prev=12,t.t0=t.catch(6),console.log(t.t0),die("failed in the catch");case16:if(console.debug("Verification Token:",r),document.querySelector('input[name="verificationToken"]').value=r,"OK"!==n.status){t.next=23;break}returndocument.getElementById("sourceId").value=n.token,(i=document.querySelector('input[name="token-billing-checkbox"]:checked'))&&(document.querySelector('input[name="store_card"]').value=i.value),t.abrupt("return",document.getElementById("server_response").submit());case23:document.getElementById("errors").textContent=n.errors[0].message,document.getElementById("errors").hidden=!1,e.target.parentElement.disabled=!1;case26:case"end":returnt.stop()}}),t,this,[[6,12]])}))),function(t){returnl.apply(this,arguments)})},{key:"completePaymentUsingToken",value:(s=a(o.a.mark((functiont(e){returno.a.wrap((function(t){for(;;)switch(t.prev=t.next){case0:returne.target.parentElement.disabled=!0,t.abrupt("return",document.getElementById("server_response").submit());case2:case"end":returnt.stop()}}),t)}))),function(t){returns.apply(this,arguments)}