(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["tcg_pvc_ePayForm"],{"0810":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{attrs:{action:t.actionAddress,method:"post",target:"_blank"}},[n("input",{attrs:{name:"billStmt",type:"hidden"},domProps:{value:t.xmlData}}),n("input",{directives:[{name:"show",rawName:"v-show",value:t.shouldShowButton,expression:"shouldShowButton"}],staticClass:"button external",style:t.buttonStyle,attrs:{type:"submit"},domProps:{value:this.$props.slots.text}})])},s=[],r=(n("d81d"),n("13d5"),n("f076")),o=n("b166"),i=n("74a0"),u=n.n(i),l=function(t){if(console.log("pvc generate billing xml, data:",t,"data.address.zipCode:",t.address.zipCode),Object.keys(t).length<1)return"";let e=Object(o["a"])(new Date,"yyyy-MM-dd'T'HH:mm:ssxxx");console.log("timestamp in pvc gb:",e);const n=`<?xml version="1.0" encoding="utf-16"?>\n<BillingStatement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n  <ApplicationID>fcd68fd2-e923-4b03-a0e7-a678c2ed612a</ApplicationID>\n  <AccountNumber />\n  <BillNumber>${t.balances.accountNum}</BillNumber>\n  <StatementNumber />\n  <BillingDate>${e}</BillingDate>\n  <DueDate>${e}</DueDate>\n  <TotalDue>${t.totalDue}</TotalDue>\n  <DepartMentId>0</DepartMentId>\n  <Fund>0</Fund>\n  <PaymentDate>0001-01-01T00:00:00</PaymentDate>\n  <Quantity>0</Quantity>\n  <ItemAmount>0</ItemAmount>\n  <TotalAmountdue>0</TotalAmountdue>\n  <PartialPaymentFlag>false</PartialPaymentFlag>\n  <ReceiptpresentFlag>false</ReceiptpresentFlag>\n  <Details>\n    <BillingStatementDetail>\n      <ItemDate>${e}</ItemDate>\n      <ItemDescription>Real Estate Tax</ItemDescription>\n      <Charges>${t.totalDue}</Charges>\n      <Credits>0</Credits>\n    </BillingStatementDetail>\n  </Details>\n  <Customers>\n    <Customer>\n      <FirstName>${t.balances.property.ownerName}</FirstName>\n      <MiddleName />\n      <LastName />\n      <BillingAddress>\n        <Address>\n          <AddressLine1>${t.address.streetAddress}</AddressLine1>\n          <City>PHILADELPHIA</City>\n          <State>PA</State>\n          <PostalCode>${t.address.zipCode}</PostalCode>\n          <Country>US</Country>\n        </Address>\n      </BillingAddress>\n    </Customer>\n  </Customers>\n</BillingStatement>\n  `;return u()(n)},c=["principal","interest","penalty","other"],d={mixins:[r["a"]],data:function(){var t={parseData:{accountNum:this.$store.state.sources.tips.data.data.accountNum,totalDue:"",balances:this.$store.state.sources.tips.data.data,address:{streetAddress:this.$store.state.sources.tips.data.data.property.address,zipCode:this.zipCode}},xmlData:{},buttonStyle:"height: "+this.$props.options.height+"px;         width: "+this.$props.options.width+"px;         font-size: "+this.$props.options.fontSize+"px;         ",actionAddress:this.$props.options.actionAddress||"https://test-secure.phila.gov/PaymentCenter/Gateway1/InitiatePurchase.aspx"};return t},computed:{zipCode:function(){return this.$store.state.geocode.data?this.$store.state.geocode.data.properties.zip_code:""},message:function(){var t;return this.$props.slots&&(t=this.evaluateSlot(this.$props.slots.text)),t},class:function(){var t;return this.$props.options&&(t=this.$props.options.class||""),t},style:function(){var t;return this.$props.options&&(t=this.$props.options.style||""),t},shouldShowButton:function(){return this.parseData.totalDue>0}},created:function(){this.parseData.totalDue=this.calculateTotalDue(),this.$store.commit("setPropertyBalance",this.parseData.totalDue)},mounted:function(){this.$data.parseData.address.zipCode=this.zipCode,this.xmlData=l(this.parseData)},methods:{calculateTotalDue:function(){var t=this;return this.parseData.balances.years.reduce((function(e,n){var a=t.calculateTotalForYear(n);return e+a}),0)},calculateTotalForYear:function(t){var e=c.map((function(e){return t[e]}));return e.reduce((function(t,e){return t+e}),0)}}},p=d,h=n("2877"),f=Object(h["a"])(p,a,s,!1,null,"de516e46",null);e["default"]=f.exports},"13d5":function(t,e,n){"use strict";var a=n("23e7"),s=n("d58f").left,r=n("a640"),o=n("ae40"),i=r("reduce"),u=o("reduce",{1:0});a({target:"Array",proto:!0,forced:!i||!u},{reduce:function(t){return s(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"74a0":function(t,e,n){"use strict";
/*!
 * escape-html
 * Copyright(c) 2012-2013 TJ Holowaychuk
 * Copyright(c) 2015 Andreas Lubbe
 * Copyright(c) 2015 Tiancheng "Timothy" Gu
 * MIT Licensed
 */var a=/["'&<>]/;function s(t){var e,n=""+t,s=a.exec(n);if(!s)return n;var r="",o=0,i=0;for(o=s.index;o<n.length;o++){switch(n.charCodeAt(o)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#39;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}i!==o&&(r+=n.substring(i,o)),i=o+1,r+=e}return i!==o?r+n.substring(i,o):r}t.exports=s},d58f:function(t,e,n){var a=n("1c0b"),s=n("7b0b"),r=n("44ad"),o=n("50c4"),i=function(t){return function(e,n,i,u){a(n);var l=s(e),c=r(l),d=o(l.length),p=t?d-1:0,h=t?-1:1;if(i<2)while(1){if(p in c){u=c[p],p+=h;break}if(p+=h,t?p<0:d<=p)throw TypeError("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=h)p in c&&(u=n(u,c[p],p,l));return u}};t.exports={left:i(!1),right:i(!0)}},f076:function(t,e,n){"use strict";n("4de4"),n("caad"),n("13d5"),n("b64b"),n("2532");var a,s,r=n("b85c"),o=n("53ca"),i={props:{slots:{type:Object,default:function(){return{}}},options:{type:Object,default:function(){return{}}},item:{type:Object,default:function(){return{}}}},computed:{nullValue:function(){var t=this.options||{};return t.nullValue}},beforeCreate:function(){},created:function(){},methods:{evaluateSlot:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!t)return t;var s,i=Object(o["a"])(t);if("function"===i){var u=this.$store.state,l=this.$controller,c=t,d=this.item;s=d?c(u,d,l):c(u)}else s=t;if(!1===s);else if(!n.includes("currency")&&!s)return a;var p,h=Object(r["a"])(n);try{var f=function(){var t=p.value,n=e.$config.transforms[t],a=void 0,r=n.globals;r&&(a=Object.keys(window).filter((function(t){return r.includes(t)})).reduce((function(t,e){return t[e]=window[e],t}),{}));var o=n.transform;s=o(s,a)};for(h.s();!(p=h.n()).done;)f()}catch(m){h.e(m)}finally{h.f()}return s}}},u=i,l=n("2877"),c=Object(l["a"])(u,a,s,!1,null,null,null);e["a"]=c.exports}}]);
//# sourceMappingURL=tcg_pvc_ePayForm.15acf27e.js.map